blob: 62153c94ea3f40fbc66237b0f5a4d70d56e6fc4b [file] [log] [blame]
(function (root, factory) { if(typeof define === "function" && define.amd) { define( factory); } else if(typeof module === "object" && module.exports) { module.exports = factory(); } else { root.bodymovin = factory(); } }(window, function() {function roundValues(t){bm_rnd=t?Math.round:function(t){return t}}function roundTo2Decimals(t){return Math.round(1e4*t)/1e4}function roundTo3Decimals(t){return Math.round(100*t)/100}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 styleUnselectableDiv(t){t.style.userSelect="none",t.style.MozUserSelect="none",t.style.webkitUserSelect="none",t.style.oUserSelect="none"}function BMEnterFrameEvent(t,e,s,i){this.type=t,this.currentTime=e,this.totalTime=s,this.direction=0>i?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=0>e?-1:1}function BMCompleteLoopEvent(t,e,s,i){this.type=t,this.currentLoop=e,this.totalLoops=s,this.direction=0>i?-1:1}function BMSegmentStartEvent(t,e,s){this.type=t,this.firstFrame=e,this.totalFrames=s}function BMDestroyEvent(t,e){this.type=t,this.target=e}function _addEventListener(t,e){this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e)}function _removeEventListener(t,e){if(e){if(this._cbs[t]){for(var s=0,i=this._cbs[t].length;i>s;)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}function _triggerEvent(t,e){if(this._cbs[t])for(var s=this._cbs[t].length,i=0;s>i;i++)this._cbs[t][i](e)}function randomString(t,e){void 0===e&&(e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");var s,i="";for(s=t;s>0;--s)i+=e[Math.round(Math.random()*(e.length-1))];return i}function HSVtoRGB(t,e,s){var i,r,a,n,o,h,p,l;switch(1===arguments.length&&(e=t.s,s=t.v,t=t.h),n=Math.floor(6*t),o=6*t-n,h=s*(1-e),p=s*(1-o*e),l=s*(1-(1-o)*e),n%6){case 0:i=s,r=l,a=h;break;case 1:i=p,r=s,a=h;break;case 2:i=h,r=s,a=l;break;case 3:i=h,r=p,a=s;break;case 4:i=l,r=h,a=s;break;case 5:i=s,r=h,a=p}return[i,r,a]}function RGBtoHSV(t,e,s){1===arguments.length&&(e=t.g,s=t.b,t=t.r);var i,r=Math.max(t,e,s),a=Math.min(t,e,s),n=r-a,o=0===r?0:n/r,h=r/255;switch(r){case a:i=0;break;case t:i=e-s+n*(s>e?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,o,h]}function addSaturationToRGB(t,e){var s=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return s[1]+=e,s[1]>1?s[1]=1:s[1]<=0&&(s[1]=0),HSVtoRGB(s[0],s[1],s[2])}function addBrightnessToRGB(t,e){var s=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return s[2]+=e,s[2]>1?s[2]=1:s[2]<0&&(s[2]=0),HSVtoRGB(s[0],s[1],s[2])}function addHueToRGB(t,e){var s=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return s[0]+=e/360,s[0]>1?s[0]-=1:s[0]<0&&(s[0]+=1),HSVtoRGB(s[0],s[1],s[2])}function componentToHex(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function fillToRgba(t,e){if(!cachedColors[t]){var s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);cachedColors[t]=parseInt(s[1],16)+","+parseInt(s[2],16)+","+parseInt(s[3],16)}return"rgba("+cachedColors[t]+","+e+")"}function RenderedFrame(t,e){this.tr=t,this.o=e}function LetterProps(t,e,s,i,r,a){this.o=t,this.sw=e,this.sc=s,this.fc=i,this.m=r,this.props=a}function iterateDynamicProperties(t){var e,s=this.dynamicProperties;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(t)}function reversePath(t,e){var s,i,r=[],a=[],n=[],o={},h=0;e&&(r[0]=t.o[0],a[0]=t.i[0],n[0]=t.v[0],h=1),i=t.i.length;var p=i-1;for(s=h;i>s;s+=1)r.push(t.o[p]),a.push(t.i[p]),n.push(t.v[p]),p-=1;return o.i=r,o.o=a,o.v=n,o}function Matrix(){}function matrixManagerFunction(){var t=new Matrix,e=function(e,s,i,r,a){return t.reset().translate(r,a).rotate(e).scale(s,i).toCSS()},s=function(t){return e(t.tr.r[2],t.tr.s[0],t.tr.s[1],t.tr.p[0],t.tr.p[1])};return{getMatrix:s}}function createElement(t,e,s){if(!e){var i=Object.create(t.prototype,s),r={};return i&&"[object Function]"===r.toString.call(i.init)&&i.init(),i}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype._parent=t.prototype}function extendPrototype(t,e){for(var s in t.prototype)t.prototype.hasOwnProperty(s)&&(e.prototype[s]=t.prototype[s])}function bezFunction(){function t(t,e,s,i,r,a){var n=t*i+e*r+s*a-r*i-a*t-s*e;return n>-1e-4&&1e-4>n}function e(e,s,i,r,a,n,o,h,p){return t(e,s,r,a,o,h)&&t(e,i,r,n,o,p)}function s(t){this.segmentLength=0,this.points=new Array(t)}function i(t,e){this.partialLength=t,this.point=e}function r(t,e){var s=e.segments,i=s.length,r=bm_floor((i-1)*t),a=t*e.addedLength,n=0;if(a==s[r].l)return s[r].p;for(var o=s[r].l>a?-1:1,h=!0;h;)s[r].l<=a&&s[r+1].l>a?(n=(a-s[r].l)/(s[r+1].l-s[r].l),h=!1):r+=o,(0>r||r>=i-1)&&(h=!1);return s[r].p+(s[r+1].p-s[r].p)*n}function a(){this.pt1=new Array(2),this.pt2=new Array(2),this.pt3=new Array(2),this.pt4=new Array(2)}function n(t,e,s,i,n,o,h){var p=new a;n=0>n?0:n>1?1:n;var l=r(n,h);o=o>1?1:o;var m,d=r(o,h),f=t.length,c=1-l,u=1-d;for(m=0;f>m;m+=1)p.pt1[m]=Math.round(1e3*(c*c*c*t[m]+(l*c*c+c*l*c+c*c*l)*s[m]+(l*l*c+c*l*l+l*c*l)*i[m]+l*l*l*e[m]))/1e3,p.pt3[m]=Math.round(1e3*(c*c*u*t[m]+(l*c*u+c*l*u+c*c*d)*s[m]+(l*l*u+c*l*d+l*c*d)*i[m]+l*l*d*e[m]))/1e3,p.pt4[m]=Math.round(1e3*(c*u*u*t[m]+(l*u*u+c*d*u+c*u*d)*s[m]+(l*d*u+c*d*d+l*u*d)*i[m]+l*d*d*e[m]))/1e3,p.pt2[m]=Math.round(1e3*(u*u*u*t[m]+(d*u*u+u*d*u+u*u*d)*s[m]+(d*d*u+u*d*d+d*u*d)*i[m]+d*d*d*e[m]))/1e3;return p}var o=(Math,function(){function t(t,e){this.l=t,this.p=e}var e={};return function(s,i,r,a){var n=(s.join("_")+"_"+i.join("_")+"_"+r.join("_")+"_"+a.join("_")).replace(/\./g,"p");if(e[n])return e[n];var o,h,p,l,m,d,f=defaultCurveSegments,c=0,u=[],y=[],v={addedLength:0,segments:[]};for(p=r.length,o=0;f>o;o+=1){for(m=o/(f-1),d=0,h=0;p>h;h+=1)l=bm_pow(1-m,3)*s[h]+3*bm_pow(1-m,2)*m*r[h]+3*(1-m)*bm_pow(m,2)*a[h]+bm_pow(m,3)*i[h],u[h]=l,null!==y[h]&&(d+=bm_pow(u[h]-y[h],2)),y[h]=u[h];d&&(d=bm_sqrt(d),c+=d),v.segments.push(new t(c,m))}return v.addedLength=c,e[n]=v,v}}()),h=function(){var e={};return function(r){var a=r.s,n=r.e,o=r.to,h=r.ti,p=(a.join("_")+"_"+n.join("_")+"_"+o.join("_")+"_"+h.join("_")).replace(/\./g,"p");if(e[p])return void(r.bezierData=e[p]);var l,m,d,f,c,u,y,v=defaultCurveSegments,g=0,b=null;2===a.length&&(a[0]!=n[0]||a[1]!=n[1])&&t(a[0],a[1],n[0],n[1],a[0]+o[0],a[1]+o[1])&&t(a[0],a[1],n[0],n[1],n[0]+h[0],n[1]+h[1])&&(v=2);var P=new s(v);for(d=o.length,l=0;v>l;l+=1){for(y=new Array(d),c=l/(v-1),u=0,m=0;d>m;m+=1)f=bm_pow(1-c,3)*a[m]+3*bm_pow(1-c,2)*c*(a[m]+o[m])+3*(1-c)*bm_pow(c,2)*(n[m]+h[m])+bm_pow(c,3)*n[m],y[m]=f,null!==b&&(u+=bm_pow(y[m]-b[m],2));u=bm_sqrt(u),g+=u,P.points[l]=new i(u,y),b=y}P.segmentLength=g,r.bezierData=P,e[p]=P}}();return{getBezierLength:o,getNewSegment:n,buildBezierData:h,pointOnLine2D:t,pointOnLine3D:e}}function dataFunctionManager(){function t(r,a,o){var h,p,l,m,d,f,c,u,y=r.length;for(m=0;y>m;m+=1)if(h=r[m],"ks"in h&&!h.completed){if(h.completed=!0,h.tt&&(r[m-1].td=h.tt),p=[],l=-1,h.hasMask){var v=h.masksProperties;for(f=v.length,d=0;f>d;d+=1)if(v[d].pt.k.i)i(v[d].pt.k);else for(u=v[d].pt.k.length,c=0;u>c;c+=1)v[d].pt.k[c].s&&i(v[d].pt.k[c].s[0]),v[d].pt.k[c].e&&i(v[d].pt.k[c].e[0])}0===h.ty?(h.layers=e(h.refId,a),t(h.layers,a,o)):4===h.ty?s(h.shapes):5==h.ty&&n(h,o)}}function e(t,e){for(var s=0,i=e.length;i>s;){if(e[s].id===t)return JSON.parse(JSON.stringify(e[s].layers));s+=1}}function s(t){var e,r,a,n=t.length;for(e=n-1;e>=0;e-=1)if("sh"==t[e].ty)if(t[e].ks.k.i)i(t[e].ks.k);else for(a=t[e].ks.k.length,r=0;a>r;r+=1)t[e].ks.k[r].s&&i(t[e].ks.k[r].s[0]),t[e].ks.k[r].e&&i(t[e].ks.k[r].e[0]);else"gr"==t[e].ty&&s(t[e].it)}function i(t){var e,s=t.i.length;for(e=0;s>e;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 r(t,e){var s=e?e.split("."):[100,100,100];return t[0]>s[0]?!0:s[0]>t[0]?!1:t[1]>s[1]?!0:s[1]>t[1]?!1:t[2]>s[2]?!0:s[2]>t[2]?!1:void 0}function a(e,s){o(e),t(e.layers,e.assets,s)}function n(t,e){var s,i,r,a,n,o,h,p=[],l=t.t.d,m=0,d=t.t.m.g,f=0,c=0,u=0,y=[],v=0,g=0,b=e.getFontByName(l.f),P=0,S=b.fStyle.split(" "),k="normal",E="normal";for(i=S.length,s=0;i>s;s+=1)"italic"===S[s].toLowerCase()?E="italic":"bold"===S[s].toLowerCase()?k="700":"black"===S[s].toLowerCase()?k="900":"medium"===S[s].toLowerCase()?k="500":"regular"===S[s].toLowerCase()||"normal"===S[s].toLowerCase()?k="400":("light"===S[s].toLowerCase()||"thin"===S[s].toLowerCase())&&(k="200");if(l.fWeight=k,l.fStyle=E,i=l.t.length,l.sz){var M=l.sz[0],F=-1;for(s=0;i>s;s+=1)r=!1," "===l.t.charAt(s)?F=s:13===l.t.charCodeAt(s)&&(v=0,r=!0),e.chars?(h=e.getCharData(l.t.charAt(s),b.fStyle,b.fFamily),P=r?0:h.w*l.s/100):P=e.measureText(l.t.charAt(s),l.f,l.s),v+P>M?(-1===F?(l.t=l.t.substr(0,s)+"\r"+l.t.substr(s),i+=1):(s=F,l.t=l.t.substr(0,s)+"\r"+l.t.substr(s+1)),F=-1,v=0):v+=P;i=l.t.length}for(v=0,P=0,s=0;i>s;s+=1)if(r=!1," "===l.t.charAt(s)?a=" ":13===l.t.charCodeAt(s)?(y.push(v),g=v>g?v:g,v=0,a="",r=!0,u+=1):a=l.t.charAt(s),e.chars?(h=e.getCharData(l.t.charAt(s),b.fStyle,e.getFontByName(l.f).fFamily),P=r?0:h.w*l.s/100):P=e.measureText(a,l.f,l.s),v+=P,p.push({l:P,an:P,add:f,n:r,anIndexes:[],val:a,line:u}),2==d){if(f+=P,""==a||" "==a||s==i-1){for((""==a||" "==a)&&(f-=P);s>=c;)p[c].an=f,p[c].ind=m,p[c].extra=P,c+=1;m+=1,f=0}}else if(3==d){if(f+=P,""==a||s==i-1){for(""==a&&(f-=P);s>=c;)p[c].an=f,p[c].ind=m,p[c].extra=P,c+=1;f=0,m+=1}}else p[m].ind=m,p[m].extra=0,m+=1;if(l.l=p,g=v>g?v:g,y.push(v),l.sz)l.boxWidth=l.sz[0],t.t.d.justifyOffset=0;else switch(l.boxWidth=g,l.j){case 1:t.t.d.justifyOffset=-l.boxWidth;break;case 2:t.t.d.justifyOffset=-l.boxWidth/2;break;default:t.t.d.justifyOffset=0}l.lineWidths=y;var A=t.t.a;o=A.length;var w,I,T=[];for(n=0;o>n;n+=1){for(A[n].a.sc&&(l.strokeColorAnim=!0),A[n].a.sw&&(l.strokeWidthAnim=!0),(A[n].a.fc||A[n].a.fh||A[n].a.fs||A[n].a.fb)&&(l.fillColorAnim=!0),I=0,w=A[n].s.b,s=0;i>s;s+=1)p[s].anIndexes[n]=I,(1==w&&""!=p[s].val||2==w&&""!=p[s].val&&" "!=p[s].val||3==w&&(p[s].n||" "==p[s].val||s==i-1)||4==w&&(p[s].n||s==i-1))&&(1===A[n].s.rn&&T.push(I),I+=1);t.t.a[n].s.totalChars=I;var D,C=-1;if(1===A[n].s.rn)for(s=0;i>s;s+=1)C!=p[s].anIndexes[n]&&(C=p[s].anIndexes[n],D=T.splice(Math.floor(Math.random()*T.length),1)[0]),p[s].anIndexes[n]=D}0!==o||"m"in t.t.p||(t.singleShape=!0),l.yOffset=1.2*l.s,l.ascent=b.ascent*l.s/100}var o=function(){function t(e){var s,i,r,a=e.length;for(s=0;a>s;s+=1)if("gr"===e[s].ty)t(e[s].it);else if("fl"===e[s].ty||"st"===e[s].ty)if(e[s].c.k&&e[s].c.k[0].i)for(r=e[s].c.k.length,i=0;r>i;i+=1)e[s].c.k[i].s&&(e[s].c.k[i].s[0]/=255,e[s].c.k[i].s[1]/=255,e[s].c.k[i].s[2]/=255,e[s].c.k[i].s[3]/=255),e[s].c.k[i].e&&(e[s].c.k[i].e[0]/=255,e[s].c.k[i].e[1]/=255,e[s].c.k[i].e[2]/=255,e[s].c.k[i].e[3]/=255);else e[s].c.k[0]/=255,e[s].c.k[1]/=255,e[s].c.k[2]/=255,e[s].c.k[3]/=255}function e(e){var s,i=e.length;for(s=0;i>s;s+=1)4===e[s].ty&&t(e[s].shapes)}var s=[4,1,9];return function(t){if(r(s,t.v)&&(e(t.layers),t.assets)){var i,a=t.assets.length;for(i=0;a>i;i+=1)t.assets[i].layers&&e(t.assets[i].layers)}}}(),h={};return h.completeData=a,h}function ShapeModifier(){}function TrimModifier(){}function RoundCornersModifier(){}function SVGRenderer(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.globalData={frameNum:-1},this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet"},this.elements=[],this.destroyed=!1}function MaskElement(t,e,s){this.dynamicProperties=[],this.data=t,this.element=e,this.globalData=s,this.paths=[],this.storedData=[],this.masksProperties=this.data.masksProperties,this.viewData=new Array(this.masksProperties.length),this.maskElement=null,this.firstFrame=!0;var i,r,a,n,o,h,p,l,m=(this.element.maskedElement,this.globalData.defs),d=this.masksProperties.length,f=this.masksProperties,c=0,u=[],y=randomString(10),v="clipPath",g="clip-path";for(i=0;d>i;i++)if(("a"!==f[i].mode&&"n"!==f[i].mode||f[i].inv)&&(v="mask",g="mask"),"s"!=f[i].mode&&"i"!=f[i].mode||0!=c||(o=document.createElementNS(svgNS,"rect"),o.setAttribute("fill","#ffffff"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),u.push(o)),"n"!=f[i].mode&&f[i].cl!==!1){if(c+=1,r=document.createElementNS(svgNS,"path"),f[i].cl?"s"==f[i].mode?r.setAttribute("fill","#000000"):r.setAttribute("fill","#ffffff"):(r.setAttribute("fill","none"),"s"==f[i].mode?r.setAttribute("fill","#000000"):r.setAttribute("fill","#ffffff"),r.setAttribute("stroke-width","1"),r.setAttribute("stroke-miterlimit","10")),r.setAttribute("clip-rule","nonzero"),0!==f[i].x.k){v="mask",g="mask",l=PropertyFactory.getProp(this.element,f[i].x,0,null,this.dynamicProperties);var b="fi_"+randomString(10);h=document.createElementNS(svgNS,"filter"),h.setAttribute("id",b),p=document.createElementNS(svgNS,"feMorphology"),p.setAttribute("operator","dilate"),p.setAttribute("in","SourceGraphic"),p.setAttribute("radius","0"),h.appendChild(p),m.appendChild(h),"s"==f[i].mode?r.setAttribute("stroke","#000000"):r.setAttribute("stroke","#ffffff")}else p=null,l=null;if(this.storedData[i]={elem:r,x:l,expan:p,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"==f[i].mode){n=u.length;var P=document.createElementNS(svgNS,"g");for(a=0;n>a;a+=1)P.appendChild(u[a]);var S=document.createElementNS(svgNS,"mask");S.setAttribute("mask-type","alpha"),S.setAttribute("id",y+"_"+c),S.appendChild(r),m.appendChild(S),P.setAttribute("mask","url(#"+y+"_"+c+")"),u.length=0,u.push(P)}else u.push(r);f[i].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[i]={elem:r,lastPath:"",prop:ShapePropertyFactory.getShapeProp(this.element,f[i],3,this.dynamicProperties,null)},this.viewData[i].prop.k||this.drawPath(f[i],this.viewData[i].prop.v,this.viewData[i])}else this.viewData[i]={prop:ShapePropertyFactory.getShapeProp(this.element,f[i],3,this.dynamicProperties,null)};for(this.maskElement=document.createElementNS(svgNS,v),d=u.length,i=0;d>i;i+=1)this.maskElement.appendChild(u[i]);this.maskElement.setAttribute("id",y),c>0&&this.element.maskedElement.setAttribute(g,"url(#"+y+")"),m.appendChild(this.maskElement)}function BaseElement(){}function SVGBaseElement(t,e,s,i,r){this.globalData=s,this.comp=i,this.data=t,this.matteElement=null,this.parentContainer=e,this.layerId=r?r.layerId:"ly_"+randomString(10),this.placeholder=r,this.init()}function ITextElement(t,e,s,i){}function SVGTextElement(t,e,s,i,r){this.textSpans=[],this.renderType="svg",this._parent.constructor.call(this,t,e,s,i,r)}function ICompElement(t,e,s,i,r){this._parent.constructor.call(this,t,e,s,i,r),this.layers=t.layers,this.isSvg=!0,this.data.tm&&(this.tm=PropertyFactory.getProp(this,this.data.tm,0,s.frameRate,this.dynamicProperties))}function IImageElement(t,e,s,i,r){this.assetData=s.getAssetData(t.refId),this.path=s.getPath(),this._parent.constructor.call(this,t,e,s,i,r)}function IShapeElement(t,e,s,i,r){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.viewData=[],this.shapeModifiers=[],this.shapesContainer=document.createElementNS(svgNS,"g"),this._parent.constructor.call(this,t,e,s,i,r)}function ISolidElement(t,e,s,i,r){this._parent.constructor.call(this,t,e,s,i,r)}var svgNS="http://www.w3.org/2000/svg",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,BMMath={};!function(){var t,e=Object.getOwnPropertyNames(Math),s=e.length;for(t=0;s>t;t+=1)BMMath[e[t]]=Math[e[t]]}(),BMMath.random=Math.random,BMMath.abs=function(t){var e=typeof t;if("object"===e&&t.length){var s,i=Array.apply(null,{length:t.length}),r=t.length;for(s=0;r>s;s+=1)i[s]=Math.abs(t[s]);return i}return t};var defaultCurveSegments=75,degToRads=Math.PI/180,roundCorner=.5519;roundValues(!1);var rgbToHex=function(){var t,e,s=[];for(t=0;256>t;t+=1)e=t.toString(16),s[t]=1==e.length?"0"+e:e;return function(t,e,i){return 0>t&&(t=0),0>e&&(e=0),0>i&&(i=0),"#"+s[t]+s[e]+s[i]}}(),fillColorToString=function(){var t=[];return function(e,s){return void 0!==s&&(e[3]=s),t[e[0]]||(t[e[0]]={}),t[e[0]][e[1]]||(t[e[0]][e[1]]={}),t[e[0]][e[1]][e[2]]||(t[e[0]][e[1]][e[2]]={}),t[e[0]][e[1]][e[2]][e[3]]||(t[e[0]][e[1]][e[2]][e[3]]="rgba("+e.join(",")+")"),t[e[0]][e[1]][e[2]][e[3]]}}(),Matrix=function(){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=Math.cos(t),s=Math.sin(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=Math.cos(t),s=Math.sin(t);return this._t(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1)}function i(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1)}function r(t){if(0===t)return this;var e=Math.cos(t),s=Math.sin(t);return this._t(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1)}function a(t,e){return this._t(1,e,t,1,0,0)}function n(t,e){return this.shear(Math.tan(t),Math.tan(e))}function o(t,e){var s=Math.cos(e),i=Math.sin(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,Math.tan(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 h(t,e,s){return s=isNaN(s)?1:s,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 p(t,e,s,i,r,a,n,o,h,p,l,m,d,f,c,u){return this.props[0]=t,this.props[1]=e,this.props[2]=s,this.props[3]=i,this.props[4]=r,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]=d,this.props[13]=f,this.props[14]=c,this.props[15]=u,this}function l(t,e,s){return s=isNaN(s)?0:s,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 m(t,e,s,i,r,a,n,o,h,p,l,m,d,f,c,u){if(1===t&&0===e&&0===s&&0===i&&0===r&&1===a&&0===n&&0===o&&0===h&&0===p&&1===l&&0===m)return(0!==d||0!==f||0!==c)&&(this.props[12]=this.props[12]*t+this.props[13]*r+this.props[14]*h+this.props[15]*d,this.props[13]=this.props[12]*e+this.props[13]*a+this.props[14]*p+this.props[15]*f,this.props[14]=this.props[12]*s+this.props[13]*n+this.props[14]*l+this.props[15]*c,this.props[15]=this.props[12]*i+this.props[13]*o+this.props[14]*m+this.props[15]*u),this;var y=this.props[0],v=this.props[1],g=this.props[2],b=this.props[3],P=this.props[4],S=this.props[5],k=this.props[6],E=this.props[7],M=this.props[8],F=this.props[9],A=this.props[10],w=this.props[11],I=this.props[12],T=this.props[13],D=this.props[14],C=this.props[15];return this.props[0]=y*t+v*r+g*h+b*d,this.props[1]=y*e+v*a+g*p+b*f,this.props[2]=y*s+v*n+g*l+b*c,this.props[3]=y*i+v*o+g*m+b*u,this.props[4]=P*t+S*r+k*h+E*d,this.props[5]=P*e+S*a+k*p+E*f,this.props[6]=P*s+S*n+k*l+E*c,this.props[7]=P*i+S*o+k*m+E*u,this.props[8]=M*t+F*r+A*h+w*d,this.props[9]=M*e+F*a+A*p+w*f,this.props[10]=M*s+F*n+A*l+w*c,this.props[11]=M*i+F*o+A*m+w*u,this.props[12]=I*t+T*r+D*h+C*d,this.props[13]=I*e+T*a+D*p+C*f,this.props[14]=I*s+T*n+D*l+C*c,this.props[15]=I*i+T*o+D*m+C*u,this}function d(t){var e;for(e=0;16>e;e+=1)t.props[e]=this.props[e]}function f(t){var e;for(e=0;16>e;e+=1)this.props[e]=t[e]}function c(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 u(t,e,s){return t*this.props[0]+e*this.props[4]+s*this.props[8]+this.props[12]}function y(t,e,s){return t*this.props[1]+e*this.props[5]+s*this.props[9]+this.props[13]}function v(t,e,s){return t*this.props[2]+e*this.props[6]+s*this.props[10]+this.props[14]}function g(t,e,s){return[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 b(t,e){return bm_rnd(t*this.props[0]+e*this.props[4]+this.props[12])+","+bm_rnd(t*this.props[1]+e*this.props[5]+this.props[13])}function P(){return[this.props[0],this.props[1],this.props[2],this.props[3],this.props[4],this.props[5],this.props[6],this.props[7],this.props[8],this.props[9],this.props[10],this.props[11],this.props[12],this.props[13],this.props[14],this.props[15]]}function S(){return isSafari?"matrix3d("+roundTo2Decimals(this.props[0])+","+roundTo2Decimals(this.props[1])+","+roundTo2Decimals(this.props[2])+","+roundTo2Decimals(this.props[3])+","+roundTo2Decimals(this.props[4])+","+roundTo2Decimals(this.props[5])+","+roundTo2Decimals(this.props[6])+","+roundTo2Decimals(this.props[7])+","+roundTo2Decimals(this.props[8])+","+roundTo2Decimals(this.props[9])+","+roundTo2Decimals(this.props[10])+","+roundTo2Decimals(this.props[11])+","+roundTo2Decimals(this.props[12])+","+roundTo2Decimals(this.props[13])+","+roundTo2Decimals(this.props[14])+","+roundTo2Decimals(this.props[15])+")":(this.cssParts[1]=this.props.join(","),this.cssParts.join(""))}function k(){return"matrix("+this.props[0]+","+this.props[1]+","+this.props[4]+","+this.props[5]+","+this.props[12]+","+this.props[13]+")"}function E(){return""+this.toArray()}return function(){this.reset=t,this.rotate=e,this.rotateX=s,this.rotateY=i,this.rotateZ=r,this.skew=n,this.skewFromAxis=o,this.shear=a,this.scale=h,this.setTransform=p,this.translate=l,this.transform=m,this.applyToPoint=c,this.applyToX=u,this.applyToY=y,this.applyToZ=v,this.applyToPointArray=g,this.applyToPointStringified=b,this.toArray=P,this.toCSS=S,this.to2dCSS=k,this.toString=E,this.clone=d,this.cloneFromProps=f,this._t=this.transform,this.props=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.cssParts=["matrix3d(","",")"]}}();!function(t,e){function s(s,p,l){var f=[];p=1==p?{entropy:!0}:p||{};var g=n(a(p.entropy?[s,h(t)]:null==s?o():s,3),f),b=new i(f),P=function(){for(var t=b.g(d),e=u,s=0;y>t;)t=(t+s)*m,e*=m,s=b.g(1);for(;t>=v;)t/=2,e/=2,s>>>=1;return(t+s)/e};return P.int32=function(){return 0|b.g(4)},P.quick=function(){return b.g(4)/4294967296},P["double"]=P,n(h(b.S),t),(p.pass||l||function(t,s,i,a){return a&&(a.S&&r(a,b),t.state=function(){return r(b,{})}),i?(e[c]=t,s):t})(P,g,"global"in p?p.global:this==e,p.state)}function i(t){var e,s=t.length,i=this,r=0,a=i.i=i.j=0,n=i.S=[];for(s||(t=[s++]);m>r;)n[r]=r++;for(r=0;m>r;r++)n[r]=n[a=g&a+t[r%s]+(e=n[r])],n[a]=e;(i.g=function(t){for(var e,s=0,r=i.i,a=i.j,n=i.S;t--;)e=n[r=g&r+1],s=s*m+n[g&(n[r]=n[a=g&a+e])+(n[a]=e)];return i.i=r,i.j=a,s})(m)}function r(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function a(t,e){var s,i=[],r=typeof t;if(e&&"object"==r)for(s in t)try{i.push(a(t[s],e-1))}catch(n){}return i.length?i:"string"==r?t:t+"\x00"}function n(t,e){for(var s,i=t+"",r=0;r<i.length;)e[g&r]=g&(s^=19*e[g&r])+i.charCodeAt(r++);return h(e)}function o(){try{if(p)return h(p.randomBytes(m));var e=new Uint8Array(m);return(l.crypto||l.msCrypto).getRandomValues(e),h(e)}catch(s){var i=l.navigator,r=i&&i.plugins;return[+new Date,l,r,l.screen,h(t)]}}function h(t){return String.fromCharCode.apply(0,t)}var p,l=this,m=256,d=6,f=52,c="random",u=e.pow(m,d),y=e.pow(2,f),v=2*y,g=m-1;e["seed"+c]=s,n(e.random(),t)}([],BMMath);var BezierFactory=function(){function t(t,e,s,i,r){var a=r||("bez_"+t+"_"+e+"_"+s+"_"+i).replace(/\./g,"p");if(l[a])return l[a];var n=new h([t,e,s,i]);return l[a]=n,n}function e(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function i(t){return 3*t}function r(t,r,a){return((e(r,a)*t+s(r,a))*t+i(r))*t}function a(t,r,a){return 3*e(r,a)*t*t+2*s(r,a)*t+i(r)}function n(t,e,s,i,a){var n,o,h=0;do o=e+(s-e)/2,n=r(o,i,a)-t,n>0?s=o:e=o;while(Math.abs(n)>f&&++h<c);return o}function o(t,e,s,i){for(var n=0;m>n;++n){var o=a(e,s,i);if(0===o)return e;var h=r(e,s,i)-t;e-=h/o}return e}function h(t){this._p=t,this._mSampleValues=v?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this)}var p={};p.getBezierEasing=t;var l={},m=4,d=.001,f=1e-7,c=10,u=11,y=1/(u-1),v="function"==typeof Float32Array;return h.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:r(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;u>s;++s)this._mSampleValues[s]=r(s*y,t,e)},_getTForX:function(t){for(var e=this._p[0],s=this._p[2],i=this._mSampleValues,r=0,h=1,p=u-1;h!==p&&i[h]<=t;++h)r+=y;--h;var l=(t-i[h])/(i[h+1]-i[h]),m=r+l*y,f=a(m,e,s);return f>=d?o(t,m,e,s):0===f?m:n(t,r,r+y,e,s)}},p}(),MatrixManager=matrixManagerFunction;!function(){for(var t=0,e=["ms","moz","webkit","o"],s=0;s<e.length&&!window.requestAnimationFrame;++s)window.requestAnimationFrame=window[e[s]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[s]+"CancelAnimationFrame"]||window[e[s]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,s){var i=(new Date).getTime(),r=Math.max(0,16-(i-t)),a=window.setTimeout(function(){e(i+r)},r);return t=i+r,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var bez=bezFunction(),dataManager=dataFunctionManager(),FontManager=function(){function t(t,e){var s=document.createElement("span");s.style.fontFamily=e;var i=document.createElement("span");i.innerHTML="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 r=i.offsetWidth;return i.style.fontFamily=t+", "+e,{node:i,w:r,parent:s}}function e(){var t,s,i,r=this.fonts.length,a=r;for(t=0;r>t;t+=1)if(this.fonts[t].loaded)a-=1;else if("t"===this.fonts[t].fOrigin){if(window.Typekit&&window.Typekit.load&&0===this.typekitLoaded){this.typekitLoaded=1;try{Typekit.load({async:!0,active:function(){this.typekitLoaded=2}.bind(this)})}catch(n){}}2===this.typekitLoaded&&(this.fonts[t].loaded=!0)}else"n"===this.fonts[t].fOrigin?this.fonts[t].loaded=!0:(s=this.fonts[t].monoCase.node,i=this.fonts[t].monoCase.w,s.offsetWidth!==i?(a-=1,this.fonts[t].loaded=!0):(s=this.fonts[t].sansCase.node,i=this.fonts[t].sansCase.w,s.offsetWidth!==i&&(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<h?setTimeout(e.bind(this),20):setTimeout(function(){this.loaded=!0}.bind(this),0)}function s(t,e){var s=document.createElementNS(svgNS,"text");s.style.fontSize="100px",s.style.fontFamily=e.fFamily,s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.className=e.fClass):s.style.fontFamily=e.fFamily,t.appendChild(s);var i=document.createElement("canvas").getContext("2d");return i.font="100px "+e.fFamily,i}function i(i,r){if(!i)return void(this.loaded=!0);if(this.chars)return this.loaded=!0,void(this.fonts=i.list);var a,n=i.list,o=n.length;for(a=0;o>a;a+=1){if(n[a].loaded=!1,n[a].monoCase=t(n[a].fFamily,"monospace"),n[a].sansCase=t(n[a].fFamily,"sans-serif"),n[a].fPath){if("p"===n[a].fOrigin){var h=document.createElement("style");h.type="text/css",h.innerHTML="@font-face {font-family: "+n[a].fFamily+"; font-style: normal; src: url('"+n[a].fPath+"');}",r.appendChild(h)}else if("g"===n[a].fOrigin){var p=document.createElement("link");p.type="text/css",p.rel="stylesheet",p.href=n[a].fPath,r.appendChild(p)}else if("t"===n[a].fOrigin){var l=document.createElement("script");l.setAttribute("src",n[a].fPath),r.appendChild(l)}}else n[a].loaded=!0;n[a].helper=s(r,n[a]),this.fonts.push(n[a])}e.bind(this)()}function r(t){if(t){this.chars||(this.chars=[]);var e,s,i,r=t.length,a=this.chars.length;for(e=0;r>e;e+=1){for(s=0,i=!1;a>s;)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]),a+=1)}}}function a(t,e,s){for(var i=0,r=this.chars.length;r>i;){if(this.chars[i].ch===t&&this.chars[i].style===e&&this.chars[i].fFamily===s)return this.chars[i];i+=1}}function n(t,e,s){var i=this.getFontByName(e),r=i.helper;return r.measureText(t).width*s/100}function o(t){for(var e=0,s=this.fonts.length;s>e;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return"sans-serif"}var h=5e3,p=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.loaded=!1,this.initTime=Date.now()};return p.prototype.addChars=r,p.prototype.addFonts=i,p.prototype.getCharData=a,p.prototype.getFontByName=o,p.prototype.measureText=n,p}(),PropertyFactory=function(){function t(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(t===this.lastFrame||this.lastFrame!==p&&(this.lastFrame>=this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>=this.keyframes[this.keyframes.length-1].t-this.offsetTime||this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime));else{for(var e,s,i=0,r=this.keyframes.length-1,a=1,n=!0;n;){if(e=this.keyframes[i],s=this.keyframes[i+1],i==r-1&&t>=s.t-this.offsetTime){e.h&&(e=s);break}if(s.t-this.offsetTime>t)break;r-1>i?i+=a:n=!1}var o,h,l,m,d,f=0;if(e.to){e.bezierData||bez.buildBezierData(e);var c=e.bezierData;if(t>=s.t-this.offsetTime||t<e.t-this.offsetTime){var u=t>=s.t-this.offsetTime?c.points.length-1:0;for(h=c.points[u].point.length,o=0;h>o;o+=1)this.v[o]=this.mult?c.points[u].point[o]*this.mult:c.points[u].point[o],this.pv[o]=c.points[u].point[o],this.lastPValue[o]!==this.pv[o]&&(this.mdf=!0,this.lastPValue[o]=this.pv[o])}else{e.__fnct?d=e.__fnct:(d=BezierFactory.getBezierEasing(e.o.x,e.o.y,e.i.x,e.i.y,e.n).get,e.__fnct=d),l=d((t-(e.t-this.offsetTime))/(s.t-this.offsetTime-(e.t-this.offsetTime)));var y,v=c.segmentLength*l,g=0;for(a=1,n=!0,m=c.points.length;n;){if(g+=c.points[f].partialLength*a,0===v||0===l||f==c.points.length-1){for(h=c.points[f].point.length,o=0;h>o;o+=1)this.v[o]=this.mult?c.points[f].point[o]*this.mult:c.points[f].point[o],this.pv[o]=c.points[f].point[o],this.lastPValue[o]!==this.pv[o]&&(this.mdf=!0,this.lastPValue[o]=this.pv[o]);break}if(v>=g&&v<g+c.points[f+1].partialLength){for(y=(v-g)/c.points[f+1].partialLength,h=c.points[f].point.length,o=0;h>o;o+=1)this.v[o]=this.mult?(c.points[f].point[o]+(c.points[f+1].point[o]-c.points[f].point[o])*y)*this.mult:c.points[f].point[o]+(c.points[f+1].point[o]-c.points[f].point[o])*y,this.pv[o]=c.points[f].point[o]+(c.points[f+1].point[o]-c.points[f].point[o])*y,this.lastPValue[o]!==this.pv[o]&&(this.mdf=!0,this.lastPValue[o]=this.pv[o]);break}m-1>f&&1==a||f>0&&-1==a?f+=a:n=!1}}}else{var b,P,S,k,E,M=!1;for(r=e.s.length,i=0;r>i;i+=1){if(1!==e.h&&(e.o.x instanceof Array?(M=!0,e.__fnct||(e.__fnct=[]),e.__fnct[i]||(b=e.o.x[i]||e.o.x[0],P=e.o.y[i]||e.o.y[0],S=e.i.x[i]||e.i.x[0],k=e.i.y[i]||e.i.y[0])):(M=!1,e.__fnct||(b=e.o.x,P=e.o.y,S=e.i.x,k=e.i.y)),M?e.__fnct[i]?d=e.__fnct[i]:(d=BezierFactory.getBezierEasing(b,P,S,k).get,e.__fnct[i]=d):e.__fnct?d=e.__fnct:(d=BezierFactory.getBezierEasing(b,P,S,k).get,e.__fnct=d),l=t>=s.t-this.offsetTime?1:t<e.t-this.offsetTime?0:d((t-(e.t-this.offsetTime))/(s.t-this.offsetTime-(e.t-this.offsetTime)))),this.sh&&1!==e.h){var F=e.s[i],A=e.e[i];-180>F-A?F+=360:F-A>180&&(F-=360),E=F+(A-F)*l}else E=1===e.h?e.s[i]:e.s[i]+(e.e[i]-e.s[i])*l;1===r?(this.v=this.mult?E*this.mult:E,this.pv=E,this.lastPValue!=this.pv&&(this.mdf=!0,this.lastPValue=this.pv)):(this.v[i]=this.mult?E*this.mult:E,this.pv[i]=E,this.lastPValue[i]!==this.pv[i]&&(this.mdf=!0,this.lastPValue[i]=this.pv[i]))}}}this.lastFrame=t,this.frameId=this.elem.globalData.frameId}}function e(){}function s(t,s,i){this.mult=i,this.v=i?s.k*i:s.k,this.pv=s.k,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.getValue=e}function i(t,s,i){this.mult=i,this.data=s,this.mdf=!1,this.comp=t.comp,this.k=!1,this.kf=!1,
this.frameId=-1,this.v=new Array(s.k.length),this.pv=new Array(s.k.length),this.lastValue=new Array(s.k.length);var r=Array.apply(null,{length:s.k.length});this.vel=r.map(function(){return 0});var a,n=s.k.length;for(a=0;n>a;a+=1)this.v[a]=i?s.k[a]*i:s.k[a],this.pv[a]=s.k[a];this.getValue=e}function r(e,s,i){this.keyframes=s.k,this.offsetTime=e.data.st,this.lastValue=-99999,this.lastPValue=-99999,this.frameId=-1,this.k=!0,this.kf=!0,this.data=s,this.mult=i,this.elem=e,this.comp=e.comp,this.lastFrame=p,this.v=i?s.k[0].s[0]*i:s.k[0].s[0],this.pv=s.k[0].s[0],this.getValue=t}function a(e,s,i){var r,a,n,o,h,l=s.k.length;for(r=0;l-1>r;r+=1)s.k[r].to&&s.k[r].s&&s.k[r].e&&(a=s.k[r].s,n=s.k[r].e,o=s.k[r].to,h=s.k[r].ti,(2==a.length&&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])||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]))&&(s.k[r].to=null,s.k[r].ti=null));this.keyframes=s.k,this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this.mult=i,this.elem=e,this.comp=e.comp,this.getValue=t,this.frameId=-1,this.v=new Array(s.k[0].s.length),this.pv=new Array(s.k[0].s.length),this.lastValue=new Array(s.k[0].s.length),this.lastPValue=new Array(s.k[0].s.length),this.lastFrame=p}function n(t,e,n,o,h){var p;if(2===n)p=new l(t,e,h);else if(7===n)p=new TrimProperty(t,e,h);else if(e.k.length)if("number"==typeof e.k[0])p=new i(t,e,o);else switch(n){case 0:p=new r(t,e,o);break;case 1:p=new a(t,e,o)}else p=new s(t,e,o);return p.k&&h.push(p),p}function o(t,e,s,i){return new d(t,e,s,i)}function h(t,e,s){return new f(t,e,s)}var p=-999999,l=function(){function t(){return this.p.k&&this.p.getValue(),this.p.v}function e(){return this.px.k&&this.px.getValue(),this.px.v}function s(){return this.py.k&&this.py.getValue(),this.py.v}function i(){return this.a.k&&this.a.getValue(),this.a.v}function r(){return this.or.k&&this.or.getValue(),this.or.v}function a(){return this.r.k&&this.r.getValue(),this.r.v/degToRads}function n(){return this.s.k&&this.s.getValue(),this.s.v}function o(){return this.o.k&&this.o.getValue(),this.o.v}function h(){return this.sk.k&&this.sk.getValue(),this.sk.v}function p(){return this.sa.k&&this.sa.getValue(),this.sa.v}function l(t){var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);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.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])}function m(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);this.mdf&&(this.v.reset(),this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):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.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}}function d(){this.inverted=!0,this.iv=new Matrix,this.k||(this.data.p.s?this.iv.translate(this.px.v,this.py.v,-this.pz.v):this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]),this.r?this.iv.rotate(-this.r.v):this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.s&&this.iv.scale(this.s.v[0],this.s.v[1],1),this.a&&this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]))}return function(f,c,u){this.elem=f,this.frameId=-1,this.dynamicProperties=[],this.mdf=!1,this.data=c,this.getValue=m,this.applyToMatrix=l,this.setInverted=d,this.v=new Matrix,c.p.s?(this.px=PropertyFactory.getProp(f,c.p.x,0,0,this.dynamicProperties),this.py=PropertyFactory.getProp(f,c.p.y,0,0,this.dynamicProperties),c.p.z&&(this.pz=PropertyFactory.getProp(f,c.p.z,0,0,this.dynamicProperties))):this.p=PropertyFactory.getProp(f,c.p,1,0,this.dynamicProperties),c.r?this.r=PropertyFactory.getProp(f,c.r,0,degToRads,this.dynamicProperties):c.rx&&(this.rx=PropertyFactory.getProp(f,c.rx,0,degToRads,this.dynamicProperties),this.ry=PropertyFactory.getProp(f,c.ry,0,degToRads,this.dynamicProperties),this.rz=PropertyFactory.getProp(f,c.rz,0,degToRads,this.dynamicProperties),this.or=PropertyFactory.getProp(f,c.or,0,degToRads,this.dynamicProperties)),c.sk&&(this.sk=PropertyFactory.getProp(f,c.sk,0,degToRads,this.dynamicProperties),this.sa=PropertyFactory.getProp(f,c.sa,0,degToRads,this.dynamicProperties)),c.a&&(this.a=PropertyFactory.getProp(f,c.a,1,0,this.dynamicProperties)),c.s&&(this.s=PropertyFactory.getProp(f,c.s,1,.01,this.dynamicProperties)),this.o=c.o?PropertyFactory.getProp(f,c.o,0,.01,u):{mdf:!1,v:1},this.dynamicProperties.length?u.push(this):(this.a&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r?this.v.rotate(-this.r.v):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.data.p.s?c.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])),Object.defineProperty(this,"position",{get:t}),Object.defineProperty(this,"xPosition",{get:e}),Object.defineProperty(this,"yPosition",{get:s}),Object.defineProperty(this,"orientation",{get:r}),Object.defineProperty(this,"anchorPoint",{get:i}),Object.defineProperty(this,"rotation",{get:a}),Object.defineProperty(this,"scale",{get:n}),Object.defineProperty(this,"opacity",{get:o}),Object.defineProperty(this,"skew",{get:h}),Object.defineProperty(this,"skewAxis",{get:p})}}(),m=function(){function t(t){if(this.prop.getValue(),this.cmdf=!1,this.omdf=!1,this.prop.mdf||t){var e,s,i,r=4*this.data.p;for(e=0;r>e;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=!0);if(this.o.length)for(r=this.prop.v.length,e=4*this.data.p;r>e;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=!0)}}function e(e,s,i){this.prop=n(e,s.k,1,null,[]),this.data=s,this.k=this.prop.k,this.c=Array.apply(null,{length:4*s.p});var r=s.k.k[0].s?s.k.k[0].s.length-4*s.p:s.k.k.length-4*s.p;this.o=Array.apply(null,{length:r}),this.cmdf=!1,this.omdf=!1,this.getValue=t,this.prop.k&&i.push(this),this.getValue(!0)}return function(t,s,i){return new e(t,s,i)}}(),d=function(){function t(t){var e=0,s=this.dataProps.length;if(this.elem.globalData.frameId!==this.frameId||t){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId;s>e;){if(this.dataProps[e].p.mdf){this.mdf=!0;break}e+=1}if(this.mdf||t)for("svg"===this.renderer&&(this.dasharray=""),e=0;s>e;e+=1)"o"!=this.dataProps[e].n?"svg"===this.renderer?this.dasharray+=" "+this.dataProps[e].p.v:this.dasharray[e]=this.dataProps[e].p.v:this.dashoffset=this.dataProps[e].p.v}}return function(e,s,i,r){this.elem=e,this.frameId=-1,this.dataProps=new Array(s.length),this.renderer=i,this.mdf=!1,this.k=!1,this.dasharray="svg"===this.renderer?"":new Array(s.length-1),this.dashoffset=0;var a,n,o=s.length;for(a=0;o>a;a+=1)n=PropertyFactory.getProp(e,s[a].v,0,0,r),this.k=n.k?!0:this.k,this.dataProps[a]={n:s[a].n,p:n};this.getValue=t,this.k?r.push(this):this.getValue(!0)}}(),f=function(){function t(){if(this.dynamicProperties.length){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0)}var s=this.data.totalChars,i=2===this.data.r?1:100/s,r=this.o.v/i,a=this.s.v/i+r,n=this.e.v/i+r;if(a>n){var o=a;a=n,n=o}this.finalS=a,this.finalE=n}function e(t){var e=BezierFactory.getBezierEasing(this.ne.v/100,0,1-this.xe.v/100,1).get,a=0,n=this.finalS,o=this.finalE,h=this.data.sh;if(2==h)a=o===n?t>=o?1:0:s(0,i(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(3==h)a=o===n?t>=o?0:1:1-s(0,i(.5/(o-n)+(t-n)/(o-n),1)),a=e(a);else if(4==h)o===n?a=t>=o?0:1:(a=s(0,i(.5/(o-n)+(t-n)/(o-n),1)),.5>a?a*=2:a=1-a);else if(5==h)if(o===n)a=t>=o?0:1;else{var p=o-n;a=-4/(p*p)*t*t+4/p*t}else 6==h?a=o===n?t>=o?0:1:(1+(Math.cos(Math.PI+2*Math.PI*(t-n)/(o-n))+0))/2:t>=r(n)&&(a=0>t-n?1-(n-t):s(0,i(o-t,1)));return a*this.a.v}var s=Math.max,i=Math.min,r=Math.floor;return this.mdf=!1,function(s,i,r){this.mdf=!1,this.k=!1,this.data=i,this.dynamicProperties=[],this.getValue=t,this.getMult=e,this.comp=s.comp,this.finalS=0,this.finalE=0,this.s=PropertyFactory.getProp(s,i.s||{k:0},0,0,this.dynamicProperties),this.e="e"in i?PropertyFactory.getProp(s,i.e,0,0,this.dynamicProperties):{v:2===i.r?i.totalChars:100},this.o=PropertyFactory.getProp(s,i.o||{k:0},0,0,this.dynamicProperties),this.xe=PropertyFactory.getProp(s,i.xe||{k:0},0,0,this.dynamicProperties),this.ne=PropertyFactory.getProp(s,i.ne||{k:0},0,0,this.dynamicProperties),this.a=PropertyFactory.getProp(s,i.a,0,.01,this.dynamicProperties),this.dynamicProperties.length?r.push(this):this.getValue()}}(),c={};return c.getProp=n,c.getDashProp=o,c.getTextSelectorProp=h,c.getGradientProp=m,c}(),ShapePropertyFactory=function(){function t(){this.mdf=!1;var t=this.comp.renderedFrame-this.offsetTime;if(this.lastFrame!==n&&(this.lastFrame<this.keyframes[0].t-this.offsetTime&&t<this.keyframes[0].t-this.offsetTime||this.lastFrame>this.keyframes[this.keyframes.length-1].t-this.offsetTime&&t>this.keyframes[this.keyframes.length-1].t-this.offsetTime));else{var e,s,i;if(t<this.keyframes[0].t-this.offsetTime)e=this.keyframes[0].s[0],i=!0;else if(t>this.keyframes[this.keyframes.length-1].t-this.offsetTime)e=1===this.keyframes[this.keyframes.length-2].h?this.keyframes[this.keyframes.length-2].s[0]:this.keyframes[this.keyframes.length-2].e[0],i=!0;else{for(var r,a,o,h,p,l,m=0,d=this.keyframes.length-1,f=1,c=!0;c&&(r=this.keyframes[m],a=this.keyframes[m+1],!(a.t-this.offsetTime>t&&1==f));)d-1>m&&1==f||m>0&&-1==f?m+=f:c=!1;i=1===r.h,i&&m===d-1&&(r=a);var u;if(!i){var y;r.__fnct?y=r.__fnct:(y=BezierFactory.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y).get,r.__fnct=y),u=t>=a.t-this.offsetTime?1:t<r.t-this.offsetTime?0:y((t-(r.t-this.offsetTime))/(a.t-this.offsetTime-(r.t-this.offsetTime))),s=r.e[0]}e=r.s[0]}h=this.v.i.length,l=e.i[0].length;var v,g=!1;for(o=0;h>o;o+=1)for(p=0;l>p;p+=1)i?(v=e.i[o][p],this.v.i[o][p]!==v&&(this.v.i[o][p]=v,this.pv.i[o][p]=v,g=!0),v=e.o[o][p],this.v.o[o][p]!==v&&(this.v.o[o][p]=v,this.pv.o[o][p]=v,g=!0),v=e.v[o][p],this.v.v[o][p]!==v&&(this.v.v[o][p]=v,this.pv.v[o][p]=v,g=!0)):(v=e.i[o][p]+(s.i[o][p]-e.i[o][p])*u,this.v.i[o][p]!==v&&(this.v.i[o][p]=v,this.pv.i[o][p]=v,g=!0),v=e.o[o][p]+(s.o[o][p]-e.o[o][p])*u,this.v.o[o][p]!==v&&(this.v.o[o][p]=v,this.pv.o[o][p]=v,g=!0),v=e.v[o][p]+(s.v[o][p]-e.v[o][p])*u,this.v.v[o][p]!==v&&(this.v.v[o][p]=v,this.pv.v[o][p]=v,g=!0));this.mdf=g,this.paths.length=0,this.paths[0]=this.v}this.lastFrame=t}function e(){return this.v}function s(){this.paths.length?(this.paths.length=1,this.paths[0]=this.v):this.paths=[this.v]}function i(t,i,r){this.comp=t.comp,this.k=!1,this.mdf=!1,this.closed=3===r?i.cl:i.closed,this.numNodes=3===r?i.pt.k.v.length:i.ks.k.v.length,this.v=3===r?i.pt.k:i.ks.k,this.getValue=e,this.pv=this.v,this.v.c=this.closed,this.paths=[this.v],this.reset=s}function r(e,i,r){this.comp=e.comp,this.offsetTime=e.data.st,this.getValue=t,this.keyframes=3===r?i.pt.k:i.ks.k,this.k=!0,this.closed=3===r?i.cl:i.closed;var a,o=this.keyframes[0].s[0].i.length,h=this.keyframes[0].s[0].i[0].length;for(this.numNodes=o,this.v={i:Array.apply(null,{length:o}),o:Array.apply(null,{length:o}),v:Array.apply(null,{length:o}),c:this.closed},this.pv={i:Array.apply(null,{length:o}),o:Array.apply(null,{length:o}),v:Array.apply(null,{length:o})},a=0;o>a;a+=1)this.v.i[a]=Array.apply(null,{length:h}),this.v.o[a]=Array.apply(null,{length:h}),this.v.v[a]=Array.apply(null,{length:h}),this.pv.i[a]=Array.apply(null,{length:h}),this.pv.o[a]=Array.apply(null,{length:h}),this.pv.v[a]=Array.apply(null,{length:h});this.paths=[],this.lastFrame=n,this.reset=s}function a(t,e,s,a){var n;if(3===s||4===s){var l=3===s?e.pt.k:e.ks.k;n=l.length?new r(t,e,s):new i(t,e,s)}else 5===s?n=new p(t,e):6===s?n=new o(t,e):7===s&&(n=new h(t,e));return n.k&&a.push(n),n}var n=-999999,o=function(){function t(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,r=this.s.v[1]/2;2!==this.d&&3!==this.d?(this.v.v[0]=[t,e-r],this.v.i[0]=[t-s*i,e-r],this.v.o[0]=[t+s*i,e-r],this.v.v[1]=[t+s,e],this.v.i[1]=[t+s,e-r*i],this.v.o[1]=[t+s,e+r*i],this.v.v[2]=[t,e+r],this.v.i[2]=[t+s*i,e+r],this.v.o[2]=[t-s*i,e+r],this.v.v[3]=[t-s,e],this.v.i[3]=[t-s,e+r*i],this.v.o[3]=[t-s,e-r*i]):(this.v.v[0]=[t,e-r],this.v.o[0]=[t-s*i,e-r],this.v.i[0]=[t+s*i,e-r],this.v.v[1]=[t-s,e],this.v.o[1]=[t-s,e+r*i],this.v.i[1]=[t-s,e-r*i],this.v.v[2]=[t,e+r],this.v.o[2]=[t+s*i,e+r],this.v.i[2]=[t-s*i,e+r],this.v.v[3]=[t+s,e],this.v.o[3]=[t+s,e-r*i],this.v.i[3]=[t+s,e+r*i]),this.paths.length=0,this.paths[0]=this.v}function e(t){var e,s=this.dynamicProperties.length;if(this.elem.globalData.frameId!==this.frameId){for(this.mdf=!1,this.frameId=this.elem.globalData.frameId,e=0;s>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&(this.convertEllToPath(),this.paths.length=0,this.paths[0]=this.v)}}var i=roundCorner;return function(i,r){this.v={v:Array.apply(null,{length:4}),i:Array.apply(null,{length:4}),o:Array.apply(null,{length:4}),c:!0},this.numNodes=4,this.d=r.d,this.dynamicProperties=[],this.paths=[],r.closed=!0,this.closed=!0,this.elem=i,this.comp=i.comp,this.frameId=-1,this.mdf=!1,this.getValue=e,this.convertEllToPath=t,this.reset=s,this.p=PropertyFactory.getProp(i,r.p,1,0,this.dynamicProperties),this.s=PropertyFactory.getProp(i,r.s,1,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertEllToPath()}}(),h=function(){function t(){var t=Math.floor(this.pt.v),e=2*Math.PI/t;this.v.v.length=t,this.v.i.length=t,this.v.o.length=t;var s,i=this.or.v,r=this.os.v,a=2*Math.PI*i/(4*t),n=-Math.PI/2,o=3===this.data.d?-1:1;for(n+=this.r.v,s=0;t>s;s+=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.v[s]=[h,p],this.v.i[s]=[h+l*a*r*o,p+m*a*r*o],this.v.o[s]=[h-l*a*r*o,p-m*a*r*o],n+=e*o}this.numNodes=t,this.paths.length=0,this.paths[0]=this.v}function e(){var t=2*Math.floor(this.pt.v),e=2*Math.PI/t;this.v.v.length=t,this.v.i.length=t,this.v.o.length=t;var s,i,r,a,n=!0,o=this.or.v,h=this.ir.v,p=this.os.v,l=this.is.v,m=2*Math.PI*o/(2*t),d=2*Math.PI*h/(2*t),f=-Math.PI/2;f+=this.r.v;var c=3===this.data.d?-1:1;for(s=0;t>s;s+=1){i=n?o:h,r=n?p:l,a=n?m:d;var u=i*Math.cos(f),y=i*Math.sin(f),v=0===u&&0===y?0:y/Math.sqrt(u*u+y*y),g=0===u&&0===y?0:-u/Math.sqrt(u*u+y*y);u+=+this.p.v[0],y+=+this.p.v[1],this.v.v[s]=[u,y],this.v.i[s]=[u+v*a*r*c,y+g*a*r*c],this.v.o[s]=[u-v*a*r*c,y-g*a*r*c],n=!n,f+=e*c}this.numNodes=t,this.paths.length=0,this.paths[0]=this.v}function i(){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t].mdf&&(this.mdf=!0);this.mdf&&this.convertToPath()}}return function(r,a){this.v={v:[],i:[],o:[],c:!0},this.elem=r,this.comp=r.comp,this.data=a,this.frameId=-1,this.d=a.d,this.dynamicProperties=[],this.mdf=!1,a.closed=!0,this.closed=!0,this.getValue=i,this.reset=s,1===a.sy?(this.ir=PropertyFactory.getProp(r,a.ir,0,0,this.dynamicProperties),this.is=PropertyFactory.getProp(r,a.is,0,.01,this.dynamicProperties),this.convertToPath=e):this.convertToPath=t,this.pt=PropertyFactory.getProp(r,a.pt,0,0,this.dynamicProperties),this.p=PropertyFactory.getProp(r,a.p,1,0,this.dynamicProperties),this.r=PropertyFactory.getProp(r,a.r,0,degToRads,this.dynamicProperties),this.or=PropertyFactory.getProp(r,a.or,0,0,this.dynamicProperties),this.os=PropertyFactory.getProp(r,a.os,0,.01,this.dynamicProperties),this.paths=[],this.dynamicProperties.length?this.k=!0:this.convertToPath()}}(),p=function(){function t(t){if(this.elem.globalData.frameId!==this.frameId){this.mdf=!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(t),this.dynamicProperties[e].mdf&&(this.mdf=!0);this.mdf&&this.convertRectToPath()}}function e(){var t=this.p.v[0],e=this.p.v[1],s=this.s.v[0]/2,i=this.s.v[1]/2,r=bm_min(s,i,this.r.v),a=r*(1-roundCorner);2===this.d||1===this.d?(this.v.v[0]=[t+s,e-i+r],this.v.o[0]=this.v.v[0],this.v.i[0]=[t+s,e-i+a],this.v.v[1]=[t+s,e+i-r],this.v.o[1]=[t+s,e+i-a],this.v.i[1]=this.v.v[1],this.v.v[2]=[t+s-r,e+i],this.v.o[2]=this.v.v[2],this.v.i[2]=[t+s-a,e+i],this.v.v[3]=[t-s+r,e+i],this.v.o[3]=[t-s+a,e+i],this.v.i[3]=this.v.v[3],this.v.v[4]=[t-s,e+i-r],this.v.o[4]=this.v.v[4],this.v.i[4]=[t-s,e+i-a],this.v.v[5]=[t-s,e-i+r],this.v.o[5]=[t-s,e-i+a],this.v.i[5]=this.v.v[5],this.v.v[6]=[t-s+r,e-i],this.v.o[6]=this.v.v[6],this.v.i[6]=[t-s+a,e-i],this.v.v[7]=[t+s-r,e-i],this.v.o[7]=[t+s-a,e-i],this.v.i[7]=this.v.v[7]):(this.v.v[0]=[t+s,e-i+r],this.v.o[0]=[t+s,e-i+a],this.v.i[0]=this.v.v[0],this.v.v[1]=[t+s-r,e-i],this.v.o[1]=this.v.v[1],this.v.i[1]=[t+s-a,e-i],this.v.v[2]=[t-s+r,e-i],this.v.o[2]=[t-s+a,e-i],this.v.i[2]=this.v.v[2],this.v.v[3]=[t-s,e-i+r],this.v.o[3]=this.v.v[3],this.v.i[3]=[t-s,e-i+a],this.v.v[4]=[t-s,e+i-r],this.v.o[4]=[t-s,e+i-a],this.v.i[4]=this.v.v[4],this.v.v[5]=[t-s+r,e+i],this.v.o[5]=this.v.v[5],this.v.i[5]=[t-s+a,e+i],this.v.v[6]=[t+s-r,e+i],this.v.o[6]=[t+s-a,e+i],this.v.i[6]=this.v.v[6],this.v.v[7]=[t+s,e+i-r],this.v.o[7]=this.v.v[7],this.v.i[7]=[t+s,e+i-a]),this.paths.length=0,this.paths[0]=this.v}return function(i,r){this.v={v:Array.apply(null,{length:8}),i:Array.apply(null,{length:8}),o:Array.apply(null,{length:8}),c:!0},this.paths=[],this.numNodes=8,this.elem=i,this.comp=i.comp,this.frameId=-1,this.d=r.d,this.dynamicProperties=[],this.mdf=!1,r.closed=!0,this.closed=!0,this.getValue=t,this.convertRectToPath=e,this.reset=s,this.p=PropertyFactory.getProp(i,r.p,1,0,this.dynamicProperties),this.s=PropertyFactory.getProp(i,r.s,1,0,this.dynamicProperties),this.r=PropertyFactory.getProp(i,r.r,0,0,this.dynamicProperties),this.dynamicProperties.length?this.k=!0:this.convertRectToPath()}}(),l={};return l.getShapeProp=a,l}(),ShapeModifiers=function(){function t(t,e){i[t]||(i[t]=e)}function e(t,e,s,r){return new i[t](e,s,r)}var s={},i={};return s.registerModifier=t,s.getModifier=e,s}();ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShape=function(t){this.closed||this.shapes.push({shape:t,last:[]})},ShapeModifier.prototype.init=function(t,e,s){this.elem=t,this.frameId=-1,this.shapes=[],this.dynamicProperties=[],this.mdf=!1,this.closed=!1,this.k=!1,this.isTrimming=!1,this.comp=t.comp,this.initModifierProperties(t,e),this.dynamicProperties.length?(this.k=!0,s.push(this)):this.getValue(!0)},extendPrototype(ShapeModifier,TrimModifier),TrimModifier.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0);if(this.mdf||t){var i=this.o.v%360/360;0>i&&(i+=1);var r=this.s.v+i,a=this.e.v+i;if(r>a){var n=r;r=a,a=n}this.sValue=r,this.eValue=a,this.oValue=i}}},TrimModifier.prototype.initModifierProperties=function(t,e){this.sValue=0,this.eValue=0,this.oValue=0,this.getValue=this.processKeys,this.s=PropertyFactory.getProp(t,e.s,0,.01,this.dynamicProperties),this.e=PropertyFactory.getProp(t,e.e,0,.01,this.dynamicProperties),this.o=PropertyFactory.getProp(t,e.o,0,0,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0)},TrimModifier.prototype.getSegmentsLength=function(t){var e,s=t.c,i=t.v,r=t.o,a=t.i,n=i.length,o=[],h=0;for(e=0;n-1>e;e+=1)o[e]=bez.getBezierLength(i[e],i[e+1],r[e],a[e+1]),h+=o[e].addedLength;return s&&(o[e]=bez.getBezierLength(i[e],i[0],r[e],a[0]),h+=o[e].addedLength),{lengths:o,totalLength:h}},TrimModifier.prototype.processShapes=function(){var t,e,s,i,r,a,n,o=this.shapes.length,h=this.sValue,p=this.eValue,l=0;if(p===h)for(e=0;o>e;e+=1)this.shapes[e].shape.paths=[],this.shapes[e].shape.mdf=!0;else{var m,d,f=[];for(e=0;o>e;e+=1)if(m=this.shapes[e],m.shape.mdf||this.mdf){for(t=m.shape.paths,m.shape.mdf=!0,i=t.length,r=[],n=0,s=0;i>s;s+=1)a=this.getSegmentsLength(t[s]),r.push(a),n+=a.totalLength;m.totalShapeLength=n,m.pathsData=r,l+=n}else m.shape.paths=m.last;for(e=0;o>e;e+=1)if(d=[],m=this.shapes[e],m.shape.mdf){f.length=0,1>=p?f.push({s:m.totalShapeLength*h,e:m.totalShapeLength*p}):h>=1?f.push({s:m.totalShapeLength*(h-1),e:m.totalShapeLength*(p-1)}):(f.push({s:m.totalShapeLength*h,e:m.totalShapeLength}),f.push({s:0,e:m.totalShapeLength*(p-1)}));var c,u=this.addShapes(m,f[0]);d.push(u),f.length>1&&(m.shape.closed?this.addShapes(m,f[1],u):(u.i[0]=[u.v[0][0],u.v[0][1]],c=u.v.length-1,u.o[c]=[u.v[c][0],u.v[c][1]],u=this.addShapes(m,f[1]),d.push(u))),u.i[0]=[u.v[0][0],u.v[0][1]],c=u.v.length-1,u.o[c]=[u.v[c][0],u.v[c][1]],m.last=d,m.shape.paths=d}}this.dynamicProperties.length||(this.mdf=!1)},TrimModifier.prototype.addSegment=function(t,e,s,i,r,a){r.o[a]=e,r.i[a+1]=s,r.v[a+1]=i,r.v[a]=t},TrimModifier.prototype.addShapes=function(t,e,s){var i,r,a,n,o,h,p,l=t.pathsData,m=t.shape.paths,d=m.length,f=0;for(s?o=s.v.length-1:(s={c:!1,v:[],i:[],o:[]},o=0),i=0;d>i;i+=1){for(h=l[i].lengths,a=m[i].c?h.length:h.length+1,r=1;a>r;r+=1)if(n=h[r-1],f+n.addedLength<e.s)f+=n.addedLength;else{if(f>e.e)break;e.s<=f&&e.e>=f+n.addedLength?this.addSegment(m[i].v[r-1],m[i].o[r-1],m[i].i[r],m[i].v[r],s,o):(p=bez.getNewSegment(m[i].v[r-1],m[i].v[r],m[i].o[r-1],m[i].i[r],(e.s-f)/n.addedLength,(e.e-f)/n.addedLength,h[r-1]),this.addSegment(p.pt1,p.pt3,p.pt4,p.pt2,s,o)),f+=n.addedLength,o+=1}if(m[i].c&&f<=e.e){var c=h[r-1].addedLength;e.s<=f&&e.e>=f+c?this.addSegment(m[i].v[r-1],m[i].o[r-1],m[i].i[0],m[i].v[0],s,o):(p=bez.getNewSegment(m[i].v[r-1],m[i].v[0],m[i].o[r-1],m[i].i[0],(e.s-f)/c,(e.e-f)/c,h[r-1]),this.addSegment(p.pt1,p.pt3,p.pt4,p.pt2,s,o))}}return s},ShapeModifiers.registerModifier("tm",TrimModifier),extendPrototype(ShapeModifier,RoundCornersModifier),RoundCornersModifier.prototype.processKeys=function(t){if(this.elem.globalData.frameId!==this.frameId||t){this.mdf=t?!0:!1,this.frameId=this.elem.globalData.frameId;var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.mdf=!0)}},RoundCornersModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(t,e.r,0,null,this.dynamicProperties),this.dynamicProperties.length||this.getValue(!0)},RoundCornersModifier.prototype.processPath=function(t,e){var s,i,r,a,n,o,h,p,l,m,d=t.v.length,f=[],c=[],u=[];for(s=0;d>s;s+=1)i=t.v[s],a=t.o[s],r=t.i[s],i[0]===a[0]&&i[1]===a[1]&&i[0]===r[0]&&i[1]===r[1]?0!==s&&s!==d-1||t.c?(n=0===s?t.v[d-1]:t.v[s-1],l=Math.sqrt(Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2)),m=Math.min(l/2,e)/l,o=[i[0]+(n[0]-i[0])*m,i[1]-(i[1]-n[1])*m],p=o,h=[o[0]-(o[0]-i[0])*roundCorner,o[1]-(o[1]-i[1])*roundCorner],f.push(o),c.push(h),u.push(p),n=s===d-1?t.v[0]:t.v[s+1],l=Math.sqrt(Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2)),m=Math.min(l/2,e)/l,o=[i[0]+(n[0]-i[0])*m,i[1]+(n[1]-i[1])*m],p=[o[0]-(o[0]-i[0])*roundCorner,o[1]-(o[1]-i[1])*roundCorner],h=o,f.push(o),c.push(h),u.push(p)):(f.push(i),c.push(a),u.push(r)):(f.push(t.v[s]),c.push(t.o[s]),u.push(t.i[s]));return{v:f,o:c,i:u,c:t.c}},RoundCornersModifier.prototype.processShapes=function(){var t,e,s,i,r=this.shapes.length,a=this.rd.v;if(0!==a){var n,o=[];for(e=0;r>e;e+=1)if(n=this.shapes[e],n.shape.mdf||this.mdf){for(n.shape.mdf=!0,t=n.shape.paths,i=t.length,s=0;i>s;s+=1)o.push(this.processPath(t[s],a));n.shape.paths=o,n.last=o}else n.shape.paths=n.last}this.dynamicProperties.length||(this.mdf=!1)},ShapeModifiers.registerModifier("rd",RoundCornersModifier),SVGRenderer.prototype.createItem=function(t,e,s,i){switch(t.ty){case 2:return this.createImage(t,e,s,i);case 0:return this.createComp(t,e,s,i);case 1:return this.createSolid(t,e,s,i);case 4:return this.createShape(t,e,s,i);case 5:return this.createText(t,e,s,i);case 99:return this.createPlaceHolder(t,e)}return this.createBase(t,e,s)},SVGRenderer.prototype.buildItems=function(t,e,s,i,r){var a,n=t.length;s||(s=this.elements),e||(e=this.animationItem.container),i||(i=this);var o;for(a=n-1;a>=0;a--)s[a]=this.createItem(t[a],e,i,r),0===t[a].ty&&(o=[],this.buildItems(t[a].layers,s[a].getDomElement(),o,s[a],s[a].placeholder),s[a].setElements(o)),t[a].td&&s[a+1].setMatte(s[a].layerId)},SVGRenderer.prototype.includeLayers=function(t,e,s){var i,r=t.length;s||(s=this.elements),e||(e=this.animationItem.container);var a,n,o,h=s.length;for(i=0;r>i;i+=1)for(a=0;h>a;){if(s[a].data.id==t[i].id){o=s[a],s[a]=this.createItem(t[i],e,this,o),0===t[i].ty&&(n=[],this.buildItems(t[i].layers,s[a].getDomElement(),n,s[a],s[i].placeholder),s[a].setElements(n));break}a+=1}for(i=0;r>i;i+=1)t[i].td&&s[i+1].setMatte(s[i].layerId)},SVGRenderer.prototype.createBase=function(t,e,s,i){return new SVGBaseElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.createPlaceHolder=function(t,e){return new PlaceHolderElement(t,e,this.globalData)},SVGRenderer.prototype.createShape=function(t,e,s,i){return new IShapeElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.createText=function(t,e,s,i){return new SVGTextElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.createImage=function(t,e,s,i){return new IImageElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.createComp=function(t,e,s,i){return new ICompElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.createSolid=function(t,e,s,i){return new ISolidElement(t,e,this.globalData,s,i)},SVGRenderer.prototype.configAnimation=function(t){this.animationItem.container=document.createElementNS(svgNS,"svg"),this.animationItem.container.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.animationItem.container.setAttribute("width",t.w),this.animationItem.container.setAttribute("height",t.h),this.animationItem.container.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.animationItem.container.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),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.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);var e=document.createElementNS(svgNS,"defs");this.globalData.defs=e,this.animationItem.container.appendChild(e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getPath=this.animationItem.getPath.bind(this.animationItem),this.globalData.elementLoaded=this.animationItem.elementLoaded.bind(this.animationItem),this.globalData.frameId=0,this.globalData.compSize={w:t.w,h:t.h},this.globalData.frameRate=t.fr;var s=document.createElementNS(svgNS,"clipPath"),i=document.createElementNS(svgNS,"rect");i.setAttribute("width",t.w),i.setAttribute("height",t.h),i.setAttribute("x",0),i.setAttribute("y",0);var r="animationMask_"+randomString(10);s.setAttribute("id",r),s.appendChild(i);var a=document.createElementNS(svgNS,"g");a.setAttribute("clip-path","url(#"+r+")"),this.animationItem.container.appendChild(a),e.appendChild(s),this.animationItem.container=a,this.layers=t.layers,this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e)},SVGRenderer.prototype.buildStage=function(t,e,s){var i,r,a=e.length;for(s||(s=this.elements),i=a-1;i>=0;i--)r=e[i],void 0!==r.parent&&this.buildItemParenting(r,s[i],e,r.parent,s,!0),0===r.ty&&this.buildStage(s[i].getComposingElement(),r.layers,s[i].getElements())},SVGRenderer.prototype.buildItemParenting=function(t,e,s,i,r,a){t.parents||(t.parents=[]),a&&e.resetHierarchy();for(var n=0,o=s.length;o>n;)s[n].ind==i&&(e.getHierarchy().push(r[n]),void 0!==s[n].parent&&this.buildItemParenting(t,e,s,s[n].parent,r,!1)),n+=1},SVGRenderer.prototype.destroy=function(){this.animationItem.wrapper.innerHTML="",this.animationItem.container=null,this.globalData.defs=null;var t,e=this.layers?this.layers.length:0;for(t=0;e>t;t++)this.elements[t].destroy();this.elements.length=0,this.destroyed=!0},SVGRenderer.prototype.updateContainerSize=function(){},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;var e,s=this.layers.length;for(e=s-1;e>=0;e--)this.elements[e].prepareFrame(t-this.layers[e].st);for(e=s-1;e>=0;e--)this.elements[e].renderFrame()}},SVGRenderer.prototype.hide=function(){this.animationItem.container.style.display="none"},SVGRenderer.prototype.show=function(){this.animationItem.container.style.display="block"},MaskElement.prototype.getMaskProperty=function(t){return this.viewData[t].prop},MaskElement.prototype.prepareFrame=function(){var t,e=this.dynamicProperties.length;for(t=0;e>t;t+=1)this.dynamicProperties[t].getValue()},MaskElement.prototype.renderFrame=function(){var t,e=this.masksProperties.length;for(t=0;e>t;t++)if("n"!==this.masksProperties[t].mode&&this.masksProperties[t].cl!==!1&&((this.viewData[t].prop.mdf||this.firstFrame)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),this.storedData[t].x&&(this.storedData[t].x.mdf||this.firstFrame))){var s=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url(#"+this.storedData[t].filterId+")")),s.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}this.firstFrame=!1},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,s){var i,r,a="";for(r=e.v.length,i=1;r>i;i+=1)1==i&&(a+=" M"+bm_rnd(e.v[0][0])+","+bm_rnd(e.v[0][1])),a+=" C"+bm_rnd(e.o[i-1][0])+","+bm_rnd(e.o[i-1][1])+" "+bm_rnd(e.i[i][0])+","+bm_rnd(e.i[i][1])+" "+bm_rnd(e.v[i][0])+","+bm_rnd(e.v[i][1]);t.cl&&(a+=" C"+bm_rnd(e.o[i-1][0])+","+bm_rnd(e.o[i-1][1])+" "+bm_rnd(e.i[0][0])+","+bm_rnd(e.i[0][1])+" "+bm_rnd(e.v[0][0])+","+bm_rnd(e.v[0][1])),s.lastPath!==a&&(t.inv?s.elem.setAttribute("d",this.solidPath+a):s.elem.setAttribute("d",a),s.lastPath=a)},MaskElement.prototype.getMask=function(t){for(var e=0,s=this.masksProperties.length;s>e;){if(this.masksProperties[e].nm===t)return{maskPath:this.viewData[e].prop.pv};e+=1}},MaskElement.prototype.destroy=function(){
this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.paths=null,this.masksProperties=null},BaseElement.prototype.checkMasks=function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;e>t;){if("n"!==this.data.masksProperties[t].mode&&this.data.masksProperties[t].cl!==!1)return!0;t+=1}return!1},BaseElement.prototype.prepareFrame=function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?this.isVisible!==!0&&(this.globalData.mdf=!0,this.isVisible=!0,this.firstFrame=!0,this.data.hasMask&&(this.maskManager.firstFrame=!0)):this.isVisible!==!1&&(this.globalData.mdf=!0,this.isVisible=!1);var e,s=this.dynamicProperties.length;for(e=0;s>e;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e].mdf&&(this.globalData.mdf=!0);return this.data.hasMask&&this.maskManager.prepareFrame(t*this.data.sr),this.currentFrameNum=t*this.data.sr,this.isVisible},BaseElement.prototype.setBlendMode=function(){var t="";switch(this.data.bm){case 1:t="multiply";break;case 2:t="screen";break;case 3:t="overlay";break;case 4:t="darken";break;case 5:t="lighten";break;case 6:t="color-dodge";break;case 7:t="color-burn";break;case 8:t="hard-light";break;case 9:t="soft-light";break;case 10:t="difference";break;case 11:t="exclusion";break;case 12:t="hue";break;case 13:t="saturation";break;case 14:t="color";break;case 15:t="luminosity"}this.layerElement.style["mix-blend-mode"]=t},BaseElement.prototype.init=function(){this.data.sr||(this.data.sr=1),this.dynamicProperties=[],this.data.ef&&expressionsPlugin&&(this.effectsManager=expressionsPlugin.getEffectsManager(this.data,this,this.dynamicProperties),this.effect=this.effectsManager.bind(this.effectsManager)),this.hidden=!1,this.firstFrame=!0,this.isVisible=!1,this.currentFrameNum=-99999,this.lastNum=-99999,this.finalTransform={mProp:PropertyFactory.getProp(this,this.data.ks,2,null,this.dynamicProperties),matMdf:!1,opMdf:!1,mat:new Matrix,opacity:1},this.finalTransform.op=this.finalTransform.mProp.o,this.transform=this.finalTransform.mProp,11!==this.data.ty&&this.createElements(),this.data.hasMask&&this.addMasks(this.data)},BaseElement.prototype.getType=function(){return this.type},BaseElement.prototype.resetHierarchy=function(){this.hierarchy?this.hierarchy.length=0:this.hierarchy=[]},BaseElement.prototype.getHierarchy=function(){return this.hierarchy||(this.hierarchy=[]),this.hierarchy},BaseElement.prototype.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}},BaseElement.prototype.hide=function(){},BaseElement.prototype.mHelper=new Matrix,createElement(BaseElement,SVGBaseElement),SVGBaseElement.prototype.appendNodeToParent=function(t){if(!this.data.hd||this.data.td)if(this.placeholder){var e=this.placeholder.phElement;e.parentNode.insertBefore(t,e)}else this.parentContainer.appendChild(t)},SVGBaseElement.prototype.createElements=function(){if(this.data.td){if(3==this.data.td)this.layerElement=document.createElementNS(svgNS,"mask"),this.layerElement.setAttribute("id",this.layerId),this.layerElement.setAttribute("mask-type","luminance"),this.globalData.defs.appendChild(this.layerElement);else if(2==this.data.td){var t=document.createElementNS(svgNS,"mask");t.setAttribute("id",this.layerId),t.setAttribute("mask-type","alpha");var e=document.createElementNS(svgNS,"g");t.appendChild(e),this.layerElement=document.createElementNS(svgNS,"g");var s=document.createElementNS(svgNS,"filter"),i=randomString(10);s.setAttribute("id",i),s.setAttribute("filterUnits","objectBoundingBox"),s.setAttribute("x","0%"),s.setAttribute("y","0%"),s.setAttribute("width","100%"),s.setAttribute("height","100%");var r=document.createElementNS(svgNS,"feComponentTransfer");r.setAttribute("in","SourceGraphic"),s.appendChild(r);var a=document.createElementNS(svgNS,"feFuncA");a.setAttribute("type","table"),a.setAttribute("tableValues","1.0 0.0"),r.appendChild(a),this.globalData.defs.appendChild(s);var n=document.createElementNS(svgNS,"rect");n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("fill","#ffffff"),n.setAttribute("opacity","0"),e.setAttribute("filter","url(#"+i+")"),e.appendChild(n),e.appendChild(this.layerElement),this.globalData.defs.appendChild(t)}else{this.layerElement=document.createElementNS(svgNS,"g");var o=document.createElementNS(svgNS,"mask");o.setAttribute("id",this.layerId),o.setAttribute("mask-type","alpha"),o.appendChild(this.layerElement),this.globalData.defs.appendChild(o)}this.data.hasMask&&(this.maskedElement=this.layerElement)}else this.data.hasMask?(this.layerElement=document.createElementNS(svgNS,"g"),this.data.tt?(this.matteElement=document.createElementNS(svgNS,"g"),this.matteElement.appendChild(this.layerElement),this.appendNodeToParent(this.matteElement)):this.appendNodeToParent(this.layerElement),this.maskedElement=this.layerElement):this.data.tt?(this.matteElement=document.createElementNS(svgNS,"g"),this.matteElement.setAttribute("id",this.layerId),this.appendNodeToParent(this.matteElement),this.layerElement=this.matteElement):this.layerElement=this.parentContainer;!this.data.ln&&!this.data.cl||4!==this.data.ty&&0!==this.data.ty||(this.layerElement===this.parentContainer&&(this.layerElement=document.createElementNS(svgNS,"g"),this.appendNodeToParent(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.ty||!this.finalTransform.op.k&&1===this.finalTransform.op.p||this.layerElement!==this.parentContainer||(this.layerElement=document.createElementNS(svgNS,"g"),this.appendNodeToParent(this.layerElement)),0!==this.data.bm&&(this.layerElement===this.parentContainer&&(this.layerElement=document.createElementNS(svgNS,"g"),this.appendNodeToParent(this.layerElement)),this.setBlendMode()),this.layerElement!==this.parentContainer&&(this.placeholder=null)},SVGBaseElement.prototype.setBlendMode=BaseElement.prototype.setBlendMode,SVGBaseElement.prototype.renderFrame=function(t){if(3===this.data.ty)return!1;if(!this.isVisible)return this.isVisible;this.lastNum=this.currentFrameNum,this.data.hasMask&&this.maskManager.renderFrame(),this.finalTransform.opMdf=this.finalTransform.op.mdf,this.finalTransform.matMdf=this.finalTransform.mProp.mdf,this.finalTransform.opacity=this.finalTransform.op.v,this.firstFrame&&(this.finalTransform.opMdf=!0,this.finalTransform.matMdf=!0);var e,s=this.finalTransform.mat;if(this.hierarchy){var i,r=this.hierarchy.length;for(e=this.finalTransform.mProp.v.props,s.cloneFromProps(e),i=0;r>i;i+=1)this.finalTransform.matMdf=this.hierarchy[i].finalTransform.mProp.mdf?!0:this.finalTransform.matMdf,e=this.hierarchy[i].finalTransform.mProp.v.props,s.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])}else this.isVisible&&(t?(e=this.finalTransform.mProp.v.props,s.cloneFromProps(e)):s.cloneFromProps(this.finalTransform.mProp.v.props));return t&&(e=t.mat.props,s.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.finalTransform.opacity*=t.opacity,this.finalTransform.opMdf=t.opMdf?!0:this.finalTransform.opMdf,this.finalTransform.matMdf=t.matMdf?!0:this.finalTransform.matMdf),this.data.hasMask?(this.finalTransform.matMdf&&this.layerElement.setAttribute("transform",s.to2dCSS()),this.finalTransform.opMdf&&this.layerElement.setAttribute("opacity",this.finalTransform.opacity)):0===this.data.ty&&this.finalTransform.opMdf&&(this.finalTransform.op.k||1!==this.finalTransform.op.p)&&(this.layerElement.setAttribute("opacity",this.finalTransform.opacity),this.finalTransform.opacity=1),this.isVisible},SVGBaseElement.prototype.destroy=function(){this.layerElement=null,this.parentContainer=null,this.matteElement&&(this.matteElement=null),this.maskManager&&this.maskManager.destroy()},SVGBaseElement.prototype.getDomElement=function(){return this.layerElement},SVGBaseElement.prototype.addMasks=function(t){this.maskManager=new MaskElement(t,this,this.globalData)},SVGBaseElement.prototype.setMatte=function(t){this.matteElement&&this.matteElement.setAttribute("mask","url(#"+t+")")},SVGBaseElement.prototype.hide=function(){},ITextElement.prototype.init=function(){this._parent.init.call(this),this.lettersChangedFlag=!1;var t=this.data;this.renderedLetters=Array.apply(null,{length:t.t.d.l.length}),this.viewData={m:{a:PropertyFactory.getProp(this,t.t.m.a,1,0,this.dynamicProperties)}};var e=this.data.t;if(e.a.length){this.viewData.a=Array.apply(null,{length:e.a.length});var s,i,r,a=e.a.length;for(s=0;a>s;s+=1)r=e.a[s],i={a:{},s:{}},"r"in r.a&&(i.a.r=PropertyFactory.getProp(this,r.a.r,0,degToRads,this.dynamicProperties)),"rx"in r.a&&(i.a.rx=PropertyFactory.getProp(this,r.a.rx,0,degToRads,this.dynamicProperties)),"ry"in r.a&&(i.a.ry=PropertyFactory.getProp(this,r.a.ry,0,degToRads,this.dynamicProperties)),"sk"in r.a&&(i.a.sk=PropertyFactory.getProp(this,r.a.sk,0,degToRads,this.dynamicProperties)),"sa"in r.a&&(i.a.sa=PropertyFactory.getProp(this,r.a.sa,0,degToRads,this.dynamicProperties)),"s"in r.a&&(i.a.s=PropertyFactory.getProp(this,r.a.s,1,.01,this.dynamicProperties)),"a"in r.a&&(i.a.a=PropertyFactory.getProp(this,r.a.a,1,0,this.dynamicProperties)),"o"in r.a&&(i.a.o=PropertyFactory.getProp(this,r.a.o,0,.01,this.dynamicProperties)),"p"in r.a&&(i.a.p=PropertyFactory.getProp(this,r.a.p,1,0,this.dynamicProperties)),"sw"in r.a&&(i.a.sw=PropertyFactory.getProp(this,r.a.sw,0,0,this.dynamicProperties)),"sc"in r.a&&(i.a.sc=PropertyFactory.getProp(this,r.a.sc,1,0,this.dynamicProperties)),"fc"in r.a&&(i.a.fc=PropertyFactory.getProp(this,r.a.fc,1,0,this.dynamicProperties)),"fh"in r.a&&(i.a.fh=PropertyFactory.getProp(this,r.a.fh,0,0,this.dynamicProperties)),"fs"in r.a&&(i.a.fs=PropertyFactory.getProp(this,r.a.fs,0,.01,this.dynamicProperties)),"fb"in r.a&&(i.a.fb=PropertyFactory.getProp(this,r.a.fb,0,.01,this.dynamicProperties)),"t"in r.a&&(i.a.t=PropertyFactory.getProp(this,r.a.t,0,0,this.dynamicProperties)),i.s=PropertyFactory.getTextSelectorProp(this,r.s,this.dynamicProperties),i.s.t=r.s.t,this.viewData.a[s]=i}else this.viewData.a=[];e.p&&"m"in e.p?(this.viewData.p={f:PropertyFactory.getProp(this,e.p.f,0,0,this.dynamicProperties),l:PropertyFactory.getProp(this,e.p.l,0,0,this.dynamicProperties),r:e.p.r,m:this.maskManager.getMaskProperty(e.p.m)},this.maskPath=!0):this.maskPath=!1},ITextElement.prototype.createPathShape=function(t,e){var s,i,r,a,n=e.length,o="";for(s=0;n>s;s+=1){for(r=e[s].ks.k.i.length,a=e[s].ks.k,i=1;r>i;i+=1)1==i&&(o+=" M"+t.applyToPointStringified(a.v[0][0],a.v[0][1])),o+=" C"+t.applyToPointStringified(a.o[i-1][0],a.o[i-1][1])+" "+t.applyToPointStringified(a.i[i][0],a.i[i][1])+" "+t.applyToPointStringified(a.v[i][0],a.v[i][1]);o+=" C"+t.applyToPointStringified(a.o[i-1][0],a.o[i-1][1])+" "+t.applyToPointStringified(a.i[0][0],a.i[0][1])+" "+t.applyToPointStringified(a.v[0][0],a.v[0][1]),o+="z"}return o},ITextElement.prototype.getMeasures=function(){var t,e,s,i,r=this.mHelper,a=this.renderType,n=this.data,o=n.t.d,h=o.l;if(this.maskPath){var p=this.viewData.p.m;if(!this.viewData.p.n||this.viewData.p.mdf){var l=p.v;this.viewData.p.r&&(l=reversePath(l,p.closed));var m={tLength:0,segments:[]};i=l.v.length-1;var d,f=0;for(s=0;i>s;s+=1)d={s:l.v[s],e:l.v[s+1],to:[l.o[s][0]-l.v[s][0],l.o[s][1]-l.v[s][1]],ti:[l.i[s+1][0]-l.v[s+1][0],l.i[s+1][1]-l.v[s+1][1]]},bez.buildBezierData(d),m.tLength+=d.bezierData.segmentLength,m.segments.push(d),f+=d.bezierData.segmentLength;s=i,p.closed&&(d={s:l.v[s],e:l.v[0],to:[l.o[s][0]-l.v[s][0],l.o[s][1]-l.v[s][1]],ti:[l.i[0][0]-l.v[0][0],l.i[0][1]-l.v[0][1]]},bez.buildBezierData(d),m.tLength+=d.bezierData.segmentLength,m.segments.push(d),f+=d.bezierData.segmentLength),this.viewData.p.pi=m}var c,u,y,m=this.viewData.p.pi,v=this.viewData.p.f.v,g=0,b=1,P=0,S=!0,k=m.segments;if(0>v&&p.closed)for(m.tLength<Math.abs(v)&&(v=-Math.abs(v)%m.tLength),g=k.length-1,y=k[g].bezierData.points,b=y.length-1;0>v;)v+=y[b].partialLength,b-=1,0>b&&(g-=1,y=k[g].bezierData.points,b=y.length-1);y=k[g].bezierData.points,u=y[b-1],c=y[b];var E,M,F=c.partialLength}i=h.length,t=0,e=0;var A,w,I,T,D,C=1.2*n.t.d.s*.714,x=!0,N=this.viewData,_=Array.apply(null,{length:i});this.lettersChangedFlag=!1,T=N.a.length;var L,V,B,R,z,G,O,j,H,q,W,X,U,Y,Z,J,K=-1,Q=v,$=g,tt=b,et=-1,st=0;for(s=0;i>s;s+=1)if(r.reset(),G=1,h[s].n)t=0,e+=o.yOffset,e+=x?1:0,v=Q,x=!1,st=0,this.maskPath&&(g=$,b=tt,y=k[g].bezierData.points,u=y[b-1],c=y[b],F=c.partialLength,P=0),_[s]=this.emptyProp;else{if(this.maskPath){if(et!==h[s].line){switch(o.j){case 1:v+=f-o.lineWidths[h[s].line];break;case 2:v+=(f-o.lineWidths[h[s].line])/2}et=h[s].line}K!==h[s].ind&&(h[K]&&(v+=h[K].extra),v+=h[s].an/2,K=h[s].ind),v+=N.m.a.v[0]*h[s].an/200;var it=0;for(I=0;T>I;I+=1)A=N.a[I].a,"p"in A&&(w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),it+=V.length?A.p.v[0]*V[0]:A.p.v[0]*V);for(S=!0;S;)P+F>=v+it||!y?(E=(v+it-P)/c.partialLength,R=u.point[0]+(c.point[0]-u.point[0])*E,z=u.point[1]+(c.point[1]-u.point[1])*E,r.translate(0,-(N.m.a.v[1]*C/100)+e),S=!1):y&&(P+=c.partialLength,b+=1,b>=y.length&&(b=0,g+=1,k[g]?y=k[g].bezierData.points:p.closed?(b=0,g=0,y=k[g].bezierData.points):(P-=c.partialLength,y=null)),y&&(u=c,c=y[b],F=c.partialLength));B=h[s].an/2-h[s].add,r.translate(-B,0,0)}else B=h[s].an/2-h[s].add,r.translate(-B,0,0),r.translate(-N.m.a.v[0]*h[s].an/200,-N.m.a.v[1]*C/100,0);for(st+=h[s].l/2,I=0;T>I;I+=1)A=N.a[I].a,"t"in A&&(w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),this.maskPath?v+=V.length?A.t*V[0]:A.t*V:t+=V.length?A.t.v*V[0]:A.t.v*V);for(st+=h[s].l/2,o.strokeWidthAnim&&(j=n.t.d.sw||0),o.strokeColorAnim&&(O=n.t.d.sc?[n.t.d.sc[0],n.t.d.sc[1],n.t.d.sc[2]]:[0,0,0]),o.fillColorAnim&&(H=[n.t.d.fc[0],n.t.d.fc[1],n.t.d.fc[2]]),I=0;T>I;I+=1)A=N.a[I].a,"a"in A&&(w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),V.length?r.translate(-A.a.v[0]*V[0],-A.a.v[1]*V[1],A.a.v[2]*V[2]):r.translate(-A.a.v[0]*V,-A.a.v[1]*V,A.a.v[2]*V));for(I=0;T>I;I+=1)A=N.a[I].a,"s"in A&&(w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),V.length?r.scale(1+(A.s.v[0]-1)*V[0],1+(A.s.v[1]-1)*V[1],1):r.scale(1+(A.s.v[0]-1)*V,1+(A.s.v[1]-1)*V,1));for(I=0;T>I;I+=1){if(A=N.a[I].a,w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),"sk"in A&&(V.length?r.skewFromAxis(-A.sk.v*V[0],A.sa.v*V[1]):r.skewFromAxis(-A.sk.v*V,A.sa.v*V)),"r"in A&&r.rotateZ(V.length?-A.r.v*V[2]:-A.r.v*V),"ry"in A&&r.rotateY(V.length?A.ry.v*V[1]:A.ry.v*V),"rx"in A&&r.rotateX(V.length?A.rx.v*V[0]:A.rx.v*V),"o"in A&&(G+=V.length?(A.o.v*V[0]-G)*V[0]:(A.o.v*V-G)*V),o.strokeWidthAnim&&"sw"in A&&(j+=V.length?A.sw.v*V[0]:A.sw.v*V),o.strokeColorAnim&&"sc"in A)for(q=0;3>q;q+=1)O[q]=Math.round(V.length?255*(O[q]+(A.sc.v[q]-O[q])*V[0]):255*(O[q]+(A.sc.v[q]-O[q])*V));if(o.fillColorAnim){if("fc"in A)for(q=0;3>q;q+=1)H[q]=V.length?H[q]+(A.fc.v[q]-H[q])*V[0]:H[q]+(A.fc.v[q]-H[q])*V;"fh"in A&&(H=V.length?addHueToRGB(H,A.fh.v*V[0]):addHueToRGB(H,A.fh.v*V)),"fs"in A&&(H=V.length?addSaturationToRGB(H,A.fs.v*V[0]):addSaturationToRGB(H,A.fs.v*V)),"fb"in A&&(H=V.length?addBrightnessToRGB(H,A.fb.v*V[0]):addBrightnessToRGB(H,A.fb.v*V))}}for(I=0;T>I;I+=1)A=N.a[I].a,"p"in A&&(w=N.a[I].s,V=w.getMult(h[s].anIndexes[I],n.t.a[I].s.totalChars),this.maskPath?V.length?r.translate(0,A.p.v[1]*V[0],-A.p.v[2]*V[1]):r.translate(0,A.p.v[1]*V,-A.p.v[2]*V):V.length?r.translate(A.p.v[0]*V[0],A.p.v[1]*V[1],-A.p.v[2]*V[2]):r.translate(A.p.v[0]*V,A.p.v[1]*V,-A.p.v[2]*V));if(o.strokeWidthAnim&&(W=0>j?0:j),o.strokeColorAnim&&(X="rgb("+Math.round(255*O[0])+","+Math.round(255*O[1])+","+Math.round(255*O[2])+")"),o.fillColorAnim&&(U="rgb("+Math.round(255*H[0])+","+Math.round(255*H[1])+","+Math.round(255*H[2])+")"),this.maskPath){if(n.t.p.p){M=(c.point[1]-u.point[1])/(c.point[0]-u.point[0]);var rt=180*Math.atan(M)/Math.PI;c.point[0]<u.point[0]&&(rt+=180),r.rotate(-rt*Math.PI/180)}r.translate(R,z,0),r.translate(N.m.a.v[0]*h[s].an/200,N.m.a.v[1]*C/100,0),v-=N.m.a.v[0]*h[s].an/200,h[s+1]&&K!==h[s+1].ind&&(v+=h[s].an/2,v+=o.tr/1e3*n.t.d.s)}else{switch(r.translate(t,e,0),o.ps&&r.translate(o.ps[0],o.ps[1]+o.ascent,0),o.j){case 1:r.translate(o.justifyOffset+(o.boxWidth-o.lineWidths[h[s].line]),0,0);break;case 2:r.translate(o.justifyOffset+(o.boxWidth-o.lineWidths[h[s].line])/2,0,0)}r.translate(B,0,0),r.translate(N.m.a.v[0]*h[s].an/200,N.m.a.v[1]*C/100,0),t+=h[s].l+o.tr/1e3*n.t.d.s}"html"===a?Y=r.toCSS():"svg"===a?Y=r.to2dCSS():Z=[r.props[0],r.props[1],r.props[2],r.props[3],r.props[4],r.props[5],r.props[6],r.props[7],r.props[8],r.props[9],r.props[10],r.props[11],r.props[12],r.props[13],r.props[14],r.props[15]],J=G,L=this.renderedLetters[s],!L||L.o===J&&L.sw===W&&L.sc===X&&L.fc===U?"svg"!==a&&"html"!==a||L&&L.m===Y?"canvas"!==a||L&&L.props[0]===Z[0]&&L.props[1]===Z[1]&&L.props[4]===Z[4]&&L.props[5]===Z[5]&&L.props[12]===Z[12]&&L.props[13]===Z[13]?D=L:(this.lettersChangedFlag=!0,D=new LetterProps(J,W,X,U,null,Z)):(this.lettersChangedFlag=!0,D=new LetterProps(J,W,X,U,Y)):(this.lettersChangedFlag=!0,D=new LetterProps(J,W,X,U,Y,Z)),this.renderedLetters[s]=D}},ITextElement.prototype.emptyProp=new LetterProps,createElement(SVGBaseElement,SVGTextElement),SVGTextElement.prototype.init=ITextElement.prototype.init,SVGTextElement.prototype.createPathShape=ITextElement.prototype.createPathShape,SVGTextElement.prototype.getMeasures=ITextElement.prototype.getMeasures,SVGTextElement.prototype.createElements=function(){this._parent.createElements.call(this);var t=this.data.t.d;this.innerElem=document.createElementNS(svgNS,"g"),t.fc?this.innerElem.setAttribute("fill","rgb("+Math.round(255*t.fc[0])+","+Math.round(255*t.fc[1])+","+Math.round(255*t.fc[2])+")"):this.innerElem.setAttribute("fill","rgba(0,0,0,0)"),t.sc&&(this.innerElem.setAttribute("stroke","rgb("+Math.round(255*t.sc[0])+","+Math.round(255*t.sc[1])+","+Math.round(255*t.sc[2])+")"),this.innerElem.setAttribute("stroke-width",t.sw)),this.innerElem.setAttribute("font-size",t.s);var e=this.globalData.fontManager.getFontByName(t.f);if(e.fClass)this.innerElem.setAttribute("class",e.fClass);else{this.innerElem.setAttribute("font-family",e.fFamily);var s=t.fWeight,i=t.fStyle;this.innerElem.setAttribute("font-style",i),this.innerElem.setAttribute("font-weight",s)}var r,a;this.layerElement===this.parentContainer?this.appendNodeToParent(this.innerElem):this.layerElement.appendChild(this.innerElem);var n=t.l;if(a=n.length){var o,h,p=this.mHelper,l="",m=this.data.singleShape;if(m)var d=0,f=0,c=t.lineWidths,u=t.boxWidth,y=!0;for(r=0;a>r;r+=1){if(this.globalData.fontManager.chars?m&&0!==r||(o=document.createElementNS(svgNS,"path")):o=document.createElementNS(svgNS,"text"),o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),m&&n[r].n&&(d=0,f+=t.yOffset,f+=y?1:0,y=!1),p.reset(),this.globalData.fontManager.chars&&p.scale(t.s/100,t.s/100),m){switch(t.ps&&p.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:p.translate(t.justifyOffset+(u-c[n[r].line]),0,0);break;case 2:p.translate(t.justifyOffset+(u-c[n[r].line])/2,0,0)}p.translate(d,f,0)}if(this.globalData.fontManager.chars){var v,g=this.globalData.fontManager.getCharData(t.t.charAt(r),e.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily);v=g?g.data:null,v&&v.shapes&&(h=v.shapes[0].it,m||(l=""),l+=this.createPathShape(p,h),m||o.setAttribute("d",l)),m||this.innerElem.appendChild(o)}else o.textContent=n[r].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.innerElem.appendChild(o),m&&o.setAttribute("transform",p.to2dCSS());m&&(d+=n[r].l),this.textSpans.push(o)}this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),this.data.cl&&this.innerElem.setAttribute("class",this.data.cl),m&&this.globalData.fontManager.chars&&(o.setAttribute("d",l),this.innerElem.appendChild(o))}},SVGTextElement.prototype.hide=function(){this.hidden||(this.innerElem.style.display="none",this.hidden=!0)},SVGTextElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);if(e===!1)return void this.hide();if(this.hidden&&(this.hidden=!1,this.innerElem.style.display="block"),this.data.hasMask||(this.finalTransform.matMdf&&this.innerElem.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform.opMdf&&this.innerElem.setAttribute("opacity",this.finalTransform.opacity)),!this.data.singleShape&&(this.getMeasures(),this.lettersChangedFlag)){var s,i,r=this.renderedLetters,a=this.data.t.d.l;i=a.length;var n;for(s=0;i>s;s+=1)a[s].n||(n=r[s],this.textSpans[s].setAttribute("transform",n.m),this.textSpans[s].setAttribute("opacity",n.o),n.sw&&this.textSpans[s].setAttribute("stroke-width",n.sw),n.sc&&this.textSpans[s].setAttribute("stroke",n.sc),n.fc&&this.textSpans[s].setAttribute("fill",n.fc));this.firstFrame&&(this.firstFrame=!1)}},SVGTextElement.prototype.destroy=function(){this._parent.destroy.call(),this.innerElem=null};var PlaceHolderElement=function(t,e,s){if(this.data=t,this.globalData=s,e){this.parentContainer=e;var i=document.createElementNS(svgNS,"g");i.setAttribute("id",this.data.id),e.appendChild(i),this.phElement=i}this.layerId="ly_"+randomString(10)};PlaceHolderElement.prototype.prepareFrame=function(){},PlaceHolderElement.prototype.renderFrame=function(){},PlaceHolderElement.prototype.draw=function(){},createElement(SVGBaseElement,ICompElement),ICompElement.prototype.getComposingElement=function(){return this.layerElement},ICompElement.prototype.hide=function(){if(!this.hidden){var t,e=this.elements.length;for(t=0;e>t;t+=1)this.elements[t].hide();this.hidden=!0}},ICompElement.prototype.prepareFrame=function(t){if(this._parent.prepareFrame.call(this,t),this.isVisible!==!1){var e=t;this.tm&&(e=this.tm.v,e===this.data.op&&(e=this.data.op-1)),this.renderedFrame=e/this.data.sr;var s,i=this.elements.length;for(s=0;i>s;s+=1)this.elements[s].prepareFrame(e/this.data.sr-this.layers[s].st)}},ICompElement.prototype.renderFrame=function(t){var e,s=this._parent.renderFrame.call(this,t),i=this.layers.length;if(s===!1)return void this.hide();for(this.hidden=!1,e=0;i>e;e+=1)this.data.hasMask?this.elements[e].renderFrame():this.elements[e].renderFrame(this.finalTransform);this.firstFrame&&(this.firstFrame=!1)},ICompElement.prototype.setElements=function(t){this.elements=t},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroy=function(){this._parent.destroy.call();var t,e=this.layers.length;for(t=0;e>t;t+=1)this.elements[t].destroy()},createElement(SVGBaseElement,IImageElement),IImageElement.prototype.createElements=function(){var t=this,e=function(){t.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t.path+t.assetData.p),t.maskedElement=t.innerElem},s=new Image;s.addEventListener("load",e,!1),s.addEventListener("error",e,!1),s.src=this.path+this.assetData.p,this._parent.createElements.call(this),this.innerElem=document.createElementNS(svgNS,"image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.layerElement===this.parentContainer?this.appendNodeToParent(this.innerElem):this.layerElement.appendChild(this.innerElem),this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),this.data.cl&&this.innerElem.setAttribute("class",this.data.cl)},IImageElement.prototype.hide=function(){this.hidden||(this.innerElem.setAttribute("visibility","hidden"),this.hidden=!0)},IImageElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.hidden&&(this.hidden=!1,this.innerElem.setAttribute("visibility","visible")),this.data.hasMask||((this.finalTransform.matMdf||this.firstFrame)&&this.innerElem.setAttribute("transform",this.finalTransform.mat.to2dCSS()),(this.finalTransform.opMdf||this.firstFrame)&&this.innerElem.setAttribute("opacity",this.finalTransform.opacity)),void(this.firstFrame&&(this.firstFrame=!1)))},IImageElement.prototype.destroy=function(){this._parent.destroy.call(),this.innerElem=null},createElement(SVGBaseElement,IShapeElement),IShapeElement.prototype.lcEnum={1:"butt",2:"round",3:"butt"},IShapeElement.prototype.ljEnum={1:"miter",2:"round",3:"butt"},IShapeElement.prototype.buildExpressionInterface=function(){},IShapeElement.prototype.transformHelper={opacity:1,mat:new Matrix,matMdf:!1,opMdf:!1},IShapeElement.prototype.createElements=function(){this._parent.createElements.call(this),this.searchShapes(this.shapesData,this.viewData,this.dynamicProperties),(!this.data.hd||this.data.td)&&(this.layerElement.appendChild(this.shapesContainer),styleUnselectableDiv(this.layerElement),styleUnselectableDiv(this.shapesContainer))},IShapeElement.prototype.setGradientData=function(t,e,s){var i,r="gr_"+randomString(10);i=1===e.t?document.createElementNS(svgNS,"linearGradient"):document.createElementNS(svgNS,"radialGradient"),i.setAttribute("id",r),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse");var a,n,o,h=[];for(o=4*e.g.p,n=0;o>n;n+=4)a=document.createElementNS(svgNS,"stop"),i.appendChild(a),h.push(a);t.setAttribute("gf"===e.ty?"fill":"stroke","url(#"+r+")"),this.globalData.defs.appendChild(i),s.gf=i,s.cst=h},IShapeElement.prototype.setGradientOpacity=function(t,e,s){if(t.g.k.k[0].s&&t.g.k.k[0].s.length>4*t.g.p||t.g.k.k.length>4*t.g.p){var i,r,a,n,o=document.createElementNS(svgNS,"mask"),h=document.createElementNS(svgNS,"path");o.appendChild(h);var p="op_"+randomString(10),l="mk_"+randomString(10);o.setAttribute("id",l),i=1===t.t?document.createElementNS(svgNS,"linearGradient"):document.createElementNS(svgNS,"radialGradient"),i.setAttribute("id",p),i.setAttribute("spreadMethod","pad"),i.setAttribute("gradientUnits","userSpaceOnUse"),n=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var m=[];for(a=4*t.g.p;n>a;a+=2)r=document.createElementNS(svgNS,"stop"),r.setAttribute("stop-color","rgb(255,255,255)"),i.appendChild(r),m.push(r);return h.setAttribute("gf"===t.ty?"fill":"stroke","url(#"+p+")"),this.globalData.defs.appendChild(i),this.globalData.defs.appendChild(o),e.of=i,e.ost=m,s.mElem=h,l}},IShapeElement.prototype.searchShapes=function(t,e,s){var i,r,a,n,o=t.length-1,h=[],p=[];for(i=o;i>=0;i-=1)if("fl"==t[i].ty||"st"==t[i].ty||"gf"==t[i].ty||"gs"==t[i].ty){e[i]={},n={type:t[i].ty,d:"",ld:"",mdf:!1};var l=document.createElementNS(svgNS,"path");if(e[i].o=PropertyFactory.getProp(this,t[i].o,0,.01,s),("st"==t[i].ty||"gs"==t[i].ty)&&(l.setAttribute("stroke-linecap",this.lcEnum[t[i].lc]||"round"),l.setAttribute("stroke-linejoin",this.ljEnum[t[i].lj]||"round"),l.setAttribute("fill-opacity","0"),1==t[i].lj&&l.setAttribute("stroke-miterlimit",t[i].ml),e[i].w=PropertyFactory.getProp(this,t[i].w,0,null,s),t[i].d)){var m=PropertyFactory.getDashProp(this,t[i].d,"svg",s);m.k||(l.setAttribute("stroke-dasharray",m.dasharray),l.setAttribute("stroke-dashoffset",m.dashoffset)),e[i].d=m}if("fl"==t[i].ty||"st"==t[i].ty)e[i].c=PropertyFactory.getProp(this,t[i].c,1,255,s);else{e[i].g=PropertyFactory.getGradientProp(this,t[i].g,s),2==t[i].t&&(e[i].h=PropertyFactory.getProp(this,t[i].h,1,.01,s),e[i].a=PropertyFactory.getProp(this,t[i].a,1,degToRads,s)),e[i].s=PropertyFactory.getProp(this,t[i].s,1,null,s),e[i].e=PropertyFactory.getProp(this,t[i].e,1,null,s),this.setGradientData(l,t[i],e[i],n);var d=this.setGradientOpacity(t[i],e[i],n);d&&l.setAttribute("mask","url(#"+d+")")}t[i].ln&&l.setAttribute("id",t[i].ln),t[i].cl&&l.setAttribute("class",t[i].cl),this.shapesContainer.appendChild(l),n.pElem=l,this.stylesList.push(n),e[i].style=n,h.push(n)}else if("gr"==t[i].ty)e[i]={it:[]},this.searchShapes(t[i].it,e[i].it,s);else if("tr"==t[i].ty)e[i]={transform:{mat:new Matrix,opacity:1,matMdf:!1,opMdf:!1,op:PropertyFactory.getProp(this,t[i].o,0,.01,s),mProps:PropertyFactory.getProp(this,t[i],2,null,s)},elements:[]};else if("sh"==t[i].ty||"rc"==t[i].ty||"el"==t[i].ty||"sr"==t[i].ty){e[i]={elements:[],styles:[],lStr:""};var f=4;for("rc"==t[i].ty?f=5:"el"==t[i].ty?f=6:"sr"==t[i].ty&&(f=7),e[i].sh=ShapePropertyFactory.getShapeProp(this,t[i],f,s),this.shapes.push(e[i].sh),this.addShapeToModifiers(e[i].sh),a=this.stylesList.length,r=0;a>r;r+=1)this.stylesList[r].closed||e[i].elements.push({ty:this.stylesList[r].type,st:this.stylesList[r]})}else if("tm"==t[i].ty||"rd"==t[i].ty){var c=ShapeModifiers.getModifier(t[i].ty);c.init(this,t[i],s),this.shapeModifiers.push(c),p.push(c),e[i]=c}for(o=h.length,i=0;o>i;i+=1)h[i].closed=!0;for(o=p.length,i=0;o>i;i+=1)p[i].closed=!0},IShapeElement.prototype.addShapeToModifiers=function(t){var e,s=this.shapeModifiers.length;for(e=0;s>e;e+=1)this.shapeModifiers[e].addShape(t)},IShapeElement.prototype.renderModifiers=function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;e>t;t+=1)this.shapes[t].reset();for(e=this.shapeModifiers.length,t=e-1;t>=0;t-=1)this.shapeModifiers[t].processShapes()}},IShapeElement.prototype.renderFrame=function(t){var e=this._parent.renderFrame.call(this,t);return e===!1?void this.hide():(this.hidden=!1,this.finalTransform.matMdf&&!this.data.hasMask&&this.shapesContainer.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.transformHelper.opacity=this.finalTransform.opacity,this.transformHelper.matMdf=!1,this.transformHelper.opMdf=this.finalTransform.opMdf,this.renderModifiers(),void this.renderShape(this.transformHelper,null,null,!0))},IShapeElement.prototype.hide=function(){if(!this.hidden){var t,e=this.stylesList.length;for(t=e-1;t>=0;t-=1)"0"!==this.stylesList[t].ld&&(this.stylesList[t].ld="0",this.stylesList[t].pElem.style.display="none",this.stylesList[t].pElem.parentNode&&(this.stylesList[t].parent=this.stylesList[t].pElem.parentNode));this.hidden=!0}},IShapeElement.prototype.renderShape=function(t,e,s,i){var r,a;if(!e)for(e=this.shapesData,a=this.stylesList.length,r=0;a>r;r+=1)this.stylesList[r].d="",this.stylesList[r].mdf=!1;s||(s=this.viewData),a=e.length-1;var n,o;n=t;var h;for(r=a;r>=0;r-=1)if(h=e[r].ty,"tr"==h){n=s[r].transform;var p=s[r].transform.mProps.v.props;if(n.matMdf=n.mProps.mdf,n.opMdf=n.op.mdf,o=n.mat,o.cloneFromProps(p),t){var l=t.mat.props;n.opacity=t.opacity,n.opacity*=s[r].transform.op.v,n.matMdf=t.matMdf?!0:n.matMdf,n.opMdf=t.opMdf?!0:n.opMdf,o.transform(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15])}else n.opacity=n.op.o}else"sh"==h||"el"==h||"rc"==h||"sr"==h?this.renderPath(e[r],s[r],n):"fl"==h?this.renderFill(e[r],s[r],n):"gf"==h?this.renderGradient(e[r],s[r],n):"gs"==h?(this.renderGradient(e[r],s[r],n),this.renderStroke(e[r],s[r],n)):"st"==h?this.renderStroke(e[r],s[r],n):"gr"==h&&this.renderShape(n,e[r].it,s[r].it);if(i){for(a=this.stylesList.length,r=0;a>r;r+=1)"0"===this.stylesList[r].ld&&(this.stylesList[r].ld="1",this.stylesList[r].pElem.style.display="block"),(this.stylesList[r].mdf||this.firstFrame)&&(this.stylesList[r].pElem.setAttribute("d",this.stylesList[r].d),this.stylesList[r].mElem&&this.stylesList[r].mElem.setAttribute("d",this.stylesList[r].d));this.firstFrame&&(this.firstFrame=!1)}},IShapeElement.prototype.renderPath=function(t,e,s){var i,r,a,n,o="",h=s.matMdf||e.sh.mdf||this.firstFrame;if(h){var p=e.sh.paths;for(n=p.length,a=0;n>a;a+=1){var l=p[a];if(l&&l.v){for(i=l.v.length,r=1;i>r;r+=1)1==r&&(o+=" M"+s.mat.applyToPointStringified(l.v[0][0],l.v[0][1])),o+=" C"+s.mat.applyToPointStringified(l.o[r-1][0],l.o[r-1][1])+" "+s.mat.applyToPointStringified(l.i[r][0],l.i[r][1])+" "+s.mat.applyToPointStringified(l.v[r][0],l.v[r][1]);1==i&&(o+=" M"+s.mat.applyToPointStringified(l.v[0][0],l.v[0][1])),l.c&&(o+=" C"+s.mat.applyToPointStringified(l.o[r-1][0],l.o[r-1][1])+" "+s.mat.applyToPointStringified(l.i[0][0],l.i[0][1])+" "+s.mat.applyToPointStringified(l.v[0][0],l.v[0][1]),o+="z"),e.lStr=o}}}else o=e.lStr;for(i=e.elements.length,r=0;i>r;r+=1)e.elements[r].st.mdf=h?!0:e.elements[r].st.mdf,e.elements[r].st.d+=o},IShapeElement.prototype.renderFill=function(t,e,s){
var i=e.style;(e.c.mdf||this.firstFrame)&&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||s.opMdf||this.firstFrame)&&i.pElem.setAttribute("fill-opacity",e.o.v*s.opacity)},IShapeElement.prototype.renderGradient=function(t,e,s){var i=e.style;if(e.o.mdf||s.opMdf||this.firstFrame){var r="gf"===t.ty?"fill-opacity":"stroke-opacity";i.pElem.setAttribute(r,e.o.v*s.opacity)}var a=e.gf,n=e.of;if(e.s.mdf||this.firstFrame){var o=1===t.t?"x1":"cx",h="x1"===o?"y1":"cy";a.setAttribute(o,e.s.v[0]),a.setAttribute(h,e.s.v[1]),n&&(n.setAttribute(o,e.s.v[0]),n.setAttribute(h,e.s.v[1]))}var p,l,m,d;if(e.g.cmdf||this.firstFrame){p=e.cst;var f=e.g.c;for(m=p.length,l=0;m>l;l+=1)d=p[l],d.setAttribute("offset",f[4*l]+"%"),d.setAttribute("stop-color","rgb("+f[4*l+1]+","+f[4*l+2]+","+f[4*l+3]+")")}if(n&&(e.g.omdf||this.firstFrame)){p=e.ost;var c=e.g.o;for(m=p.length,l=0;m>l;l+=1)d=p[l],d.setAttribute("offset",c[2*l]+"%"),d.setAttribute("stop-opacity",c[2*l+1])}if(1===t.t)(e.e.mdf||this.firstFrame)&&(a.setAttribute("x2",e.e.v[0]),a.setAttribute("y2",e.e.v[1]),n&&(n.setAttribute("x2",e.e.v[0]),n.setAttribute("y2",e.e.v[1])));else{var u;if((e.s.mdf||e.e.mdf||this.firstFrame)&&(u=Math.sqrt(Math.pow(e.s.v[0]-e.e.v[0],2)+Math.pow(e.s.v[1]-e.e.v[1],2)),a.setAttribute("r",u),n&&n.setAttribute("r",u)),e.e.mdf||e.h.mdf||e.a.mdf||this.firstFrame){u||(u=Math.sqrt(Math.pow(e.s.v[0]-e.e.v[0],2)+Math.pow(e.s.v[1]-e.e.v[1],2)));var y=Math.atan2(e.e.v[1]-e.s.v[1],e.e.v[0]-e.s.v[0]),v=e.h.v>=1?.99:e.h.v,g=u*v,b=Math.cos(y+e.a.v)*g+e.s.v[0],P=Math.sin(y+e.a.v)*g+e.s.v[1];a.setAttribute("fx",b),a.setAttribute("fy",P),n&&(n.setAttribute("fx",b),n.setAttribute("fy",P))}}},IShapeElement.prototype.renderStroke=function(t,e,s){var i=e.style,r=e.d;r&&r.k&&(r.mdf||this.firstFrame)&&(i.pElem.setAttribute("stroke-dasharray",r.dasharray),i.pElem.setAttribute("stroke-dashoffset",r.dashoffset)),e.c&&(e.c.mdf||this.firstFrame)&&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||s.opMdf||this.firstFrame)&&i.pElem.setAttribute("stroke-opacity",e.o.v*s.opacity),(e.w.mdf||this.firstFrame)&&(i.pElem.setAttribute("stroke-width",e.w.v),i.mElem&&i.mElem.setAttribute("stroke-width",e.w.v))},IShapeElement.prototype.destroy=function(){this._parent.destroy.call(),this.shapeData=null,this.viewData=null,this.parentContainer=null,this.placeholder=null},createElement(SVGBaseElement,ISolidElement),ISolidElement.prototype.createElements=function(){this._parent.createElements.call(this);var t=document.createElementNS(svgNS,"rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement===this.parentContainer?this.appendNodeToParent(t):this.layerElement.appendChild(t),this.innerElem=t,this.data.ln&&this.innerElem.setAttribute("id",this.data.ln),this.data.cl&&this.innerElem.setAttribute("class",this.data.cl)},ISolidElement.prototype.hide=IImageElement.prototype.hide,ISolidElement.prototype.renderFrame=IImageElement.prototype.renderFrame,ISolidElement.prototype.destroy=IImageElement.prototype.destroy;var animationManager=function(){function t(e){var s=0,i=e.target;for(i.removeEventListener("destroy",t);S>s;)g[s].animation===i&&(g.splice(s,1),s-=1,S-=1),s+=1}function e(e,s){if(!e)return null;for(var i=0;S>i;){if(g[i].elem==e&&null!==g[i].elem)return g[i].animation;i+=1}var r=new AnimationItem;return r.setData(e,s),r.addEventListener("destroy",t),g.push({elem:e,animation:r}),S+=1,r}function s(e){var s=new AnimationItem;return s.setParams(e),s.addEventListener("destroy",t),g.push({elem:null,animation:s}),S+=1,s}function i(t,e){var s;for(s=0;S>s;s+=1)g[s].animation.setSpeed(t,e)}function r(t,e){var s;for(s=0;S>s;s+=1)g[s].animation.setDirection(t,e)}function a(t){var e;for(e=0;S>e;e+=1)g[e].animation.play(t)}function n(t,e){P=!1,b=Date.now();var s;for(s=0;S>s;s+=1)g[s].animation.moveFrame(t,e)}function o(t){var e,s=t-b;for(e=0;S>e;e+=1)g[e].animation.advanceTime(s);b=t,requestAnimationFrame(o)}function h(t){b=t,requestAnimationFrame(o)}function p(t){var e;for(e=0;S>e;e+=1)g[e].animation.pause(t)}function l(t,e,s){var i;for(i=0;S>i;i+=1)g[i].animation.goToAndStop(t,e,s)}function m(t){var e;for(e=0;S>e;e+=1)g[e].animation.stop(t)}function d(t){var e;for(e=0;S>e;e+=1)g[e].animation.togglePause(t)}function f(t){var e;for(e=0;S>e;e+=1)g[e].animation.destroy(t)}function c(t,s,i){var r,a=document.getElementsByClassName("bodymovin"),n=a.length;for(r=0;n>r;r+=1)i&&a[r].setAttribute("data-bm-type",i),e(a[r],t);if(s&&0===n){i||(i="svg");var o=document.getElementsByTagName("body")[0];o.innerHTML="";var h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.setAttribute("data-bm-type",i),o.appendChild(h),e(h,t)}}function u(){var t;for(t=0;S>t;t+=1)g[t].animation.resize()}function y(){requestAnimationFrame(h)}var v={},g=[],b=0,P=!0,S=0;return setTimeout(y,0),v.registerAnimation=e,v.loadAnimation=s,v.setSpeed=i,v.setDirection=r,v.play=a,v.moveFrame=n,v.pause=p,v.stop=m,v.togglePause=d,v.searchAnimations=c,v.resize=u,v.start=y,v.goToAndStop=l,v.destroy=f,v}(),AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.pendingElements=0,this.playCount=0,this.prerenderFramesFlag=!0,this.animationData={},this.layers=[],this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=randomString(10),this.scaleMode="fit",this.timeCompleted=0,this.segmentPos=0,this.segments=[],this.pendingSegment=!1};AnimationItem.prototype.setParams=function(t){var e=this;t.context&&(this.context=t.context),(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var s=t.animType?t.animType:t.renderer?t.renderer:"svg";switch(s){case"canvas":this.renderer=new CanvasRenderer(this,t.rendererSettings);break;case"svg":this.renderer=new SVGRenderer(this,t.rendererSettings);break;case"hybrid":case"html":default:this.renderer=new HybridRenderer(this,t.rendererSettings)}if(this.animType=s,""===t.loop||null===t.loop||(this.loop=t.loop===!1?!1:t.loop===!0?!0:parseInt(t.loop)),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.prerenderFramesFlag="prerender"in t?t.prerender:!0,this.autoloadSegments=t.hasOwnProperty("autoloadSegments")?t.autoloadSegments:!0,t.animationData)e.configAnimation(t.animationData);else if(t.path){"json"!=t.path.substr(-4)&&("/"!=t.path.substr(-1,1)&&(t.path+="/"),t.path+="data.json");var i=new XMLHttpRequest;this.path=-1!=t.path.lastIndexOf("\\")?t.path.substr(0,t.path.lastIndexOf("\\")+1):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")),i.open("GET",t.path,!0),i.send(),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status)e.configAnimation(JSON.parse(i.responseText));else try{var t=JSON.parse(i.responseText);e.configAnimation(t)}catch(s){}}}},AnimationItem.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 r=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:"";""===r||(s.loop="false"===r?!1:"true"===r?!0:parseInt(r));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:!0;s.autoplay="false"!==a,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:"";var n=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:"";"false"===n&&(s.prerender=!1),this.setParams(s)},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip),this.animationData.tf=this.totalFrames);var e,s,i=this.animationData.layers,r=i.length,a=t.layers,n=a.length;for(s=0;n>s;s+=1)for(e=0;r>e;){if(i[e].id==a[s].id){i[e]=a[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(r=t.assets.length,e=0;r>e;e+=1)this.animationData.assets.push(t.assets[e]);dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.includeLayers(t.layers),this.renderer.buildStage(this.container,this.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.renderer.renderFrame(null),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.animationData.tf);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var s=new XMLHttpRequest,i=this,r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,s.open("GET",r,!0),s.send(),s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status)i.includeLayers(JSON.parse(s.responseText));else try{var t=JSON.parse(s.responseText);i.includeLayers(t)}catch(e){}}},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.animationData.tf),this.loadNextSegment()},AnimationItem.prototype.configAnimation=function(t){this.animationData=t,this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.animationData.tf=this.totalFrames,this.renderer.configAnimation(t),t.assets||(t.assets=[]),t.comps&&(t.assets=t.assets.concat(t.comps),t.comps=null),this.layers=this.animationData.layers,this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.firstFrame=Math.round(this.animationData.ip),this.frameMult=this.animationData.fr/1e3,this.trigger("config_ready"),this.loadSegments(),this.updaFrameModifier(),this.renderer.globalData.fontManager?this.waitForFontsLoaded():(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.checkLoaded())},AnimationItem.prototype.waitForFontsLoaded=function(){function t(){this.renderer.globalData.fontManager.loaded?(dataManager.completeData(this.animationData,this.renderer.globalData.fontManager),this.renderer.buildItems(this.animationData.layers),this.checkLoaded()):setTimeout(t.bind(this),20)}return function(){t.bind(this)()}}(),AnimationItem.prototype.addPendingElement=function(){this.pendingElements+=1},AnimationItem.prototype.elementLoaded=function(){this.pendingElements--,this.checkLoaded()},AnimationItem.prototype.checkLoaded=function(){0===this.pendingElements&&(this.renderer.buildStage(this.container,this.layers),expressionsPlugin&&expressionsPlugin.initExpressions(this),this.trigger("DOMLoaded"),this.isLoaded=!0,this.gotoFrame(),this.autoplay&&this.play())},AnimationItem.prototype.resize=function(){this.renderer.updateContainerSize()},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=subframeEnabled?this.currentRawFrame:Math.floor(this.currentRawFrame),this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){this.isLoaded!==!1&&this.renderer.renderFrame(this.currentFrame+this.firstFrame)},AnimationItem.prototype.play=function(t){t&&this.name!=t||this.isPaused===!0&&(this.isPaused=!1)},AnimationItem.prototype.pause=function(t){t&&this.name!=t||this.isPaused===!1&&(this.isPaused=!0)},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(this.isPaused===!0?(this.isPaused=!1,this.play()):(this.isPaused=!0,this.pause()))},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.isPaused=!0,this.currentFrame=this.currentRawFrame=0,this.playCount=0,this.gotoFrame())},AnimationItem.prototype.goToAndStop=function(t,e,s){s&&this.name!=s||(this.setCurrentRawFrameValue(e?t:t*this.frameModifier),this.isPaused=!0)},AnimationItem.prototype.goToAndPlay=function(t,e,s){this.goToAndStop(t,e,s),this.play()},AnimationItem.prototype.advanceTime=function(t){return this.pendingSegment?(this.pendingSegment=!1,this.adjustSegment(this.segments.shift()),void(this.isPaused&&this.play())):void(this.isPaused!==!0&&this.isLoaded!==!1&&this.setCurrentRawFrameValue(this.currentRawFrame+t*this.frameModifier))},AnimationItem.prototype.updateAnimation=function(t){this.setCurrentRawFrameValue(this.totalFrames*t)},AnimationItem.prototype.moveFrame=function(t,e){e&&this.name!=e||this.setCurrentRawFrameValue(this.currentRawFrame+t)},AnimationItem.prototype.adjustSegment=function(t){this.playCount=0,t[1]<t[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.01)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(0)),this.trigger("segmentStart")},AnimationItem.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-.01)),this.firstFrame=t,this.totalFrames=e-t,-1!==s&&this.goToAndStop(s,!0)},AnimationItem.prototype.playSegments=function(t,e){if("object"==typeof t[0]){var s,i=t.length;for(s=0;i>s;s+=1)this.segments.push(t[s])}else this.segments.push(t);e&&this.adjustSegment(this.segments.shift()),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op-this.animationData.ip+this.animationData.ip*this.frameRate)]),t&&this.adjustSegment(this.segments.shift())},AnimationItem.prototype.checkSegments=function(){this.segments.length&&(this.pendingSegment=!0)},AnimationItem.prototype.remove=function(t){t&&this.name!=t||this.renderer.destroy()},AnimationItem.prototype.destroy=function(t){t&&this.name!=t||this.renderer&&this.renderer.destroyed||(this.renderer.destroy(),this.trigger("destroy"),this._cbs=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){if(this.currentRawFrame=t,this.currentRawFrame>=this.totalFrames){if(this.checkSegments(),this.loop===!1)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");if(this.trigger("loopComplete"),this.playCount+=1,this.loop!==!0&&this.playCount==this.loop||this.pendingSegment)return this.currentRawFrame=this.totalFrames-.01,this.gotoFrame(),this.pause(),void this.trigger("complete");this.currentRawFrame=this.currentRawFrame%this.totalFrames}else if(this.currentRawFrame<0)return this.checkSegments(),this.playCount-=1,this.playCount<0&&(this.playCount=0),this.loop===!1||this.pendingSegment?(this.currentRawFrame=0,this.gotoFrame(),this.pause(),void this.trigger("complete")):(this.trigger("loopComplete"),this.currentRawFrame=(this.totalFrames+this.currentRawFrame)%this.totalFrames,void this.gotoFrame());this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=0>t?-1:1,this.updaFrameModifier()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetData=function(t){for(var e=0,s=this.assets.length;s>e;){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.getAssets=function(){return this.assets},AnimationItem.prototype.trigger=function(t){if(this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult));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.addEventListener=_addEventListener,AnimationItem.prototype.removeEventListener=_removeEventListener,AnimationItem.prototype.triggerEvent=_triggerEvent;var bodymovinjs = {}; function play(animation){ animationManager.play(animation); } function pause(animation){ animationManager.pause(animation); } function togglePause(animation){ animationManager.togglePause(animation); } function setSpeed(value,animation){ animationManager.setSpeed(value, animation); } function setDirection(value,animation){ animationManager.setDirection(value, animation); } function stop(animation){ animationManager.stop(animation); } function moveFrame(value){ animationManager.moveFrame(value); } function searchAnimations(){ if(standalone === true){ animationManager.searchAnimations(animationData,standalone, renderer); }else{ animationManager.searchAnimations(); } } function registerAnimation(elem){ return animationManager.registerAnimation(elem); } function resize(){ animationManager.resize(); } function start(){ animationManager.start(); } function goToAndStop(val,isFrame, animation){ animationManager.goToAndStop(val,isFrame, animation); } function setSubframeRendering(flag){ subframeEnabled = flag; } function loadAnimation(params){ if(standalone === true){ params.animationData = JSON.parse(animationData); } return animationManager.loadAnimation(params); } function destroy(animation){ return animationManager.destroy(animation); } 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); } } function installPlugin(type,plugin){ if(type==='expressions'){ expressionsPlugin = plugin; } } function getFactory(name){ switch(name){ case "propertyFactory": return PropertyFactory;case "shapePropertyFactory": return ShapePropertyFactory; case "matrix": return Matrix; } } bodymovinjs.play = play; bodymovinjs.pause = pause; bodymovinjs.togglePause = togglePause; bodymovinjs.setSpeed = setSpeed; bodymovinjs.setDirection = setDirection; bodymovinjs.stop = stop; bodymovinjs.moveFrame = moveFrame; bodymovinjs.searchAnimations = searchAnimations; bodymovinjs.registerAnimation = registerAnimation; bodymovinjs.loadAnimation = loadAnimation; bodymovinjs.setSubframeRendering = setSubframeRendering; bodymovinjs.resize = resize; bodymovinjs.start = start; bodymovinjs.goToAndStop = goToAndStop; bodymovinjs.destroy = destroy; bodymovinjs.setQuality = setQuality; bodymovinjs.installPlugin = installPlugin; bodymovinjs.__getFactory = getFactory; bodymovinjs.version = '4.4.1'; function checkReady(){ 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 standalone = '__[STANDALONE]__'; var animationData = '__[ANIMATIONDATA]__'; var renderer = ''; if(standalone) { var scripts = document.getElementsByTagName('script'); var index = scripts.length - 1; var myScript = scripts[index]; var queryString = myScript.src.replace(/^[^\?]+\??/,''); renderer = getQueryVariable('renderer'); } var readyStateCheckInterval = setInterval(checkReady, 100); return bodymovinjs; }));