"undefined"!=typeof document&&"undefined"!=typeof navigator&&function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lottie=e()}(this,(function(){"use strict";var t="",e=!1,i=-999999,s=function(){return t};function a(t){return document.createElement(t)}function r(t,e){var i,s,a=t.length;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),z(i[0],i[1],i[2])}function O(t,e){var i=V(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),z(i[0],i[1],i[2])}function N(t,e){var i=V(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),z(i[0],i[1],i[2])}!function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e}();var q=function(){return m},j=function(){return d},W=function(t){k=t},H=function(){return k};function X(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}var G=function(){var t,i,s=1,a=[],r={onmessage:function(){},postMessage:function(e){t({data:e})}},n={postMessage:function(t){r.onmessage({data:t})}};function h(i){if(window.Worker&&window.Blob&&e){var s=new Blob(["var _workerSelf = self; self.onmessage = ",i.toString()],{type:"text/javascript"}),a=URL.createObjectURL(s);return new Worker(a)}return t=i,r}function o(){i||(i=h((function(t){if(n.dataManager||(n.dataManager=function(){function t(a,r){var n,h,o,l,p,m,d=a.length;for(h=0;h=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)s(t[e].ks.k);else for(r=t[e].ks.k.length,a=0;ai[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var r,n=function(){var t=[4,4,14];function e(t){var e,i,s,a=t.length;for(e=0;e=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(a=t[i].ks.k.length,s=0;s500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function n(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return G.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function h(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=n.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return h.prototype={loadAssets:function(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;ithis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,a=s.length,r=t.layers,n=r.length;for(i=0;ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},tt.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},tt.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},tt.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},tt.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},tt.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},tt.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},tt.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},tt.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},tt.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===$(t[0])){var i,s=t.length;for(i=0;i=0;i-=1)e[i].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,u()},t.setVolume=function(t,i){var a;for(a=0;a=.001?function(t,e,i,s){for(var a=0;a<4;++a){var r=l(e,i,s);if(0===r)return e;e-=(o(e,i,s)-t)/r}return e}(t,f,e,a):0===m?f:function(t,e,i,s,a){var r,n,h=0;do{(r=o(n=e+(i-e)/2,s,a)-t)>0?i=n:e=n}while(Math.abs(r)>1e-7&&++h<10);return n}(t,n,n+s,e,a)}},t}(),st={double:function(t){return t.concat(l(t.length))}},at=function(t,e,i){var s=0,a=t,r=l(a);return{newElement:function(){return s?r[s-=1]:e()},release:function(t){s===a&&(r=st.double(r),a*=2),i&&i(t),r[s]=t,s+=1}}},rt=at(8,(function(){return{addedLength:0,percents:o("float32",H()),lengths:o("float32",H())}})),nt=at(8,(function(){return{lengths:[],totalLength:0}}),(function(t){var e,i=t.lengths.length;for(e=0;e-.001&&n<.001}var i=function(t,e,i,s){var a,r,n,h,o,l,p=H(),f=0,m=[],d=[],c=rt.newElement();for(n=i.length,a=0;an?-1:1,l=!0;l;)if(s[r]<=n&&s[r+1]>n?(h=(n-s[r])/(s[r+1]-s[r]),l=!1):r+=o,r<0||r>=a-1){if(r===a-1)return i[r];l=!1}return i[r]+(i[r+1]-i[r])*h}var p=o("float32",8);return{getSegmentsLength:function(t){var e,s=nt.newElement(),a=t.c,r=t.v,n=t.o,h=t.i,o=t._length,l=s.lengths,p=0;for(e=0;e1&&(r=1);var l,f=h(r,o),m=h(n=n>1?1:n,o),d=e.length,c=1-f,u=1-m,g=c*c*c,y=f*c*c*3,v=f*f*c*3,b=f*f*f,_=c*c*u,x=f*c*u+c*f*u+c*c*m,k=f*f*u+c*f*m+f*c*m,w=f*f*m,P=c*u*u,S=f*u*u+c*m*u+c*u*m,A=f*m*u+c*m*m+f*u*m,D=f*m*m,C=u*u*u,E=m*u*u+u*m*u+u*u*m,M=m*m*u+u*m*m+m*u*m,T=m*m*m;for(l=0;ld?m>c?m-d-c:c-d-m:c>d?c-d-m:d-m-c)>-1e-4&&f<1e-4}}}(),ot=i,lt=Math.abs;function pt(t,e){var i,s=this.offsetTime;"multidimensional"===this.propType&&(i=o("float32",this.pv.length));for(var a,r,n,h,l,p,f,m,d,c=e.lastIndex,u=c,g=this.keyframes.length-1,y=!0;y;){if(a=this.keyframes[u],r=this.keyframes[u+1],u===g-1&&t>=r.t-s){a.h&&(a=r),c=0;break}if(r.t-s>t){c=u;break}u=E||t=E?T.points.length-1:0;for(l=T.points[F].point.length,h=0;h=B&&L=E)i[0]=v[0],i[1]=v[1],i[2]=v[2];else if(t<=M)i[0]=a.s[0],i[1]=a.s[1],i[2]=a.s[2];else{var q=ft(a.s),j=ft(v);b=i,_=function(t,e,i){var s,a,r,n,h,o=[],l=t[0],p=t[1],f=t[2],m=t[3],d=e[0],c=e[1],u=e[2],g=e[3];return(a=l*d+p*c+f*u+m*g)<0&&(a=-a,d=-d,c=-c,u=-u,g=-g),1-a>1e-6?(s=Math.acos(a),r=Math.sin(s),n=Math.sin((1-i)*s)/r,h=Math.sin(i*s)/r):(n=1-i,h=i),o[0]=n*l+h*d,o[1]=n*p+h*c,o[2]=n*f+h*u,o[3]=n*m+h*g,o}(q,j,(t-M)/(E-M)),x=_[0],k=_[1],P=_[2],S=_[3],A=Math.atan2(2*k*S-2*x*P,1-2*k*k-2*P*P),D=Math.asin(2*x*k+2*P*S),C=Math.atan2(2*x*S-2*k*P,1-2*x*x-2*P*P),b[0]=A/w,b[1]=D/w,b[2]=C/w}else for(u=0;u=E?p=1:t=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function dt(t){var e;if("unidimensional"===this.propType)e=t*this.mult,lt(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function ct(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[s]||r[s]&&!a)&&(r[s]=kt.newElement()),r[s][0]=t,r[s][1]=e},wt.prototype.setTripleAt=function(t,e,i,s,a,r,n,h){this.setXYAt(t,e,"v",n,h),this.setXYAt(i,s,"o",n,h),this.setXYAt(a,r,"i",n,h)},wt.prototype.reverse=function(){var t=new wt;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),a=1);var r,n=this._length-1,h=this._length;for(r=a;r=d[d.length-1].t-this.offsetTime)s=d[d.length-1].s?d[d.length-1].s[0]:d[d.length-2].e[0],r=!0;else{for(var c,u,g,y=m,v=d.length-1,b=!0;b&&(c=d[y],!((u=d[y+1]).t-this.offsetTime>t));)y=u.t-this.offsetTime)p=1;else if(ts&&e>s)||(this._caching.lastIndex=a0||t>-1e-6&&t<0?s(1e4*t)/1e4:t}function L(){var t=this.props;return"matrix("+I(t[0])+","+I(t[1])+","+I(t[4])+","+I(t[5])+","+I(t[12])+","+I(t[13])+")"}return function(){this.reset=a,this.rotate=r,this.rotateX=n,this.rotateY=h,this.rotateZ=l,this.skew=f,this.skewFromAxis=m,this.shear=p,this.scale=d,this.setTransform=c,this.translate=u,this.transform=g,this.multiply=y,this.applyToPoint=k,this.applyToX=w,this.applyToY=P,this.applyToZ=S,this.applyToPointArray=M,this.applyToTriplePoints=E,this.applyToPointStringified=T,this.toCSS=F,this.to2dCSS=L,this.clone=_,this.cloneFromProps=x,this.equals=b,this.inversePoints=C,this.inversePoint=D,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=o("float32",16),this.reset()}}();function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}var Bt={},zt="__[STANDALONE]__";function Vt(){et.searchAnimations()}Bt.play=et.play,Bt.pause=et.pause,Bt.setLocationHref=function(e){t=e},Bt.togglePause=et.togglePause,Bt.setSpeed=et.setSpeed,Bt.setDirection=et.setDirection,Bt.stop=et.stop,Bt.searchAnimations=Vt,Bt.registerAnimation=et.registerAnimation,Bt.loadAnimation=function(t){return et.loadAnimation(t)},Bt.setSubframeRendering=function(t){!function(t){f=!!t}(t)},Bt.resize=et.resize,Bt.goToAndStop=et.goToAndStop,Bt.destroy=et.destroy,Bt.setQuality=function(t){if("string"==typeof t)switch(t){case"high":W(200);break;default:case"medium":W(50);break;case"low":W(10)}else!isNaN(t)&&t>1&&W(t);H()>=50?S(!1):S(!0)},Bt.inBrowser=function(){return"undefined"!=typeof navigator},Bt.installPlugin=function(t,e){"expressions"===t&&(m=e)},Bt.freeze=et.freeze,Bt.unfreeze=et.unfreeze,Bt.setVolume=et.setVolume,Bt.mute=et.mute,Bt.unmute=et.unmute,Bt.getRegisteredAnimations=et.getRegisteredAnimations,Bt.useWebWorker=function(t){e=!!t},Bt.setIDPrefix=function(t){c=t},Bt.__getFactory=function(t){switch(t){case"propertyFactory":return _t;case"shapePropertyFactory":return Ft;case"matrix":return It;default:return null}},Bt.version="5.13.0";var Rt="";if(zt){var Ot=document.getElementsByTagName("script"),Nt=Ot[Ot.length-1]||{src:""};Rt=Nt.src?Nt.src.replace(/^[^\?]+\??/,""):"",function(t){for(var e=Rt.split("&"),i=0;i=1?r.push({s:t-1,e:e-1}):(r.push({s:t,e:1}),r.push({s:0,e:e-1}));var n,h,o=[],l=r.length;for(n=0;ns+i))p=h.s*a<=s?0:(h.s*a-s)/i,f=h.e*a>=s+i?1:(h.e*a-s)/i,o.push([p,f])}return o.length||o.push([0,0]),o},Ht.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?1+r:this.s.v<0?0+r:this.s.v+r)>(i=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r)){var n=e;e=i,i=n}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var h,o,l,p,f,m=this.shapes.length,d=0;if(i===e)for(a=0;a=0;a-=1)if((c=this.shapes[a]).shape._mdf){for((u=c.localShapeCollection).releaseShapes(),2===this.m&&m>1?(y=this.calculateShapeEdges(e,i,c.totalShapeLength,_,d),_+=c.totalShapeLength):y=[[v,b]],o=y.length,h=0;h=1?g.push({s:c.totalShapeLength*(v-1),e:c.totalShapeLength*(b-1)}):(g.push({s:c.totalShapeLength*v,e:c.totalShapeLength}),g.push({s:0,e:c.totalShapeLength*(b-1)}));var x=this.addShapes(c,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(c.shape.paths.shapes[c.shape.paths._length-1].c){var k=x.pop();this.addPaths(x,u),x=this.addShapes(c,g[1],k)}else this.addPaths(x,u),x=this.addShapes(c,g[1]);this.addPaths(x,u)}}c.shape.paths=u}}},Ht.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}e.s<=c&&e.e>=c+n.addedLength?(this.addSegment(m[s].v[a-1],m[s].o[a-1],m[s].i[a],m[s].v[a],i,h,g),g=!1):(l=ht.getNewSegment(m[s].v[a-1],m[s].v[a],m[s].o[a-1],m[s].i[a],(e.s-c)/n.addedLength,(e.e-c)/n.addedLength,o[a-1]),this.addSegmentFromArray(l,i,h,g),g=!1,i.c=!1),c+=n.addedLength,h+=1}if(m[s].c&&o.length){if(n=o[a-1],c<=e.e){var y=o[a-1].addedLength;e.s<=c&&e.e>=c+y?(this.addSegment(m[s].v[a-1],m[s].o[a-1],m[s].i[0],m[s].v[0],i,h,g),g=!1):(l=ht.getNewSegment(m[s].v[a-1],m[s].v[0],m[s].o[a-1],m[s].i[0],(e.s-c)/y,(e.e-c)/y,o[a-1]),this.addSegmentFromArray(l,i,h,g),g=!1,i.c=!1)}else i.c=!1;c+=n.addedLength,h+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),c>e.e)break;s=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),a=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,a=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],a=[];var r=this.px,n=this.py;r._caching.lastFrame+r.offsetTime<=r.keyframes[0].t?(s[0]=r.getValueAtTime((r.keyframes[0].t+.01)/i,0),s[1]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),a[0]=r.getValueAtTime(r.keyframes[0].t/i,0),a[1]=n.getValueAtTime(n.keyframes[0].t/i,0)):r._caching.lastFrame+r.offsetTime>=r.keyframes[r.keyframes.length-1].t?(s[0]=r.getValueAtTime(r.keyframes[r.keyframes.length-1].t/i,0),s[1]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),a[0]=r.getValueAtTime((r.keyframes[r.keyframes.length-1].t-.01)/i,0),a[1]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0)):(s=[r.pv,n.pv],a[0]=r.getValueAtTime((r._caching.lastFrame+r.offsetTime-.01)/i,r.offsetTime),a[1]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime))}else s=a=t;this.v.rotate(-Math.atan2(s[1]-a[1],s[0]-a[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},r([xt],e),e.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},e.prototype._addDynamicProperty=xt.prototype.addDynamicProperty,{getTransformProperty:function(t,i,s){return new e(t,i,s)}}}();function Gt(){}function Kt(){}function Jt(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function Zt(t){return Math.abs(t)<=1e-5}function Ut(t,e,i){return t*(1-i)+e*i}function Qt(t,e,i){return[Ut(t[0],e[0],i),Ut(t[1],e[1],i)]}function $t(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function te(t){return new ee(t,t,t,t,!1)}function ee(t,e,i,s,a){a&&pe(t,e)&&(e=Qt(t,s,1/3)),a&&pe(i,s)&&(i=Qt(t,s,2/3));var r=$t(t[0],e[0],i[0],s[0]),n=$t(t[1],e[1],i[1],s[1]);this.a=[r[0],n[0]],this.b=[r[1],n[1]],this.c=[r[2],n[2]],this.d=[r[3],n[3]],this.points=[t,e,i,s]}function ie(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var a=s;s=i,i=a}for(var r=function(t,e,i){if(0===t)return[];var s=e*e-4*t*i;if(s<0)return[];var a=-e/(2*t);if(0===s)return[a];var r=Math.sqrt(s)/(2*t);return[a-r,a+r]}(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&r[n]<1){var h=t.point(r[n])[e];hs&&(s=h)}return{min:i,max:s}}function se(t,e,i){var s=t.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function ae(t){var e=t.bez.split(.5);return[se(e[0],t.t1,t.t),se(e[1],t.t,t.t2)]}function re(t,e,i,s,a,r){var n,h;if(n=t,h=e,2*Math.abs(n.cx-h.cx)=r||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s)a.push([t.t,e.t]);else{var o=ae(t),l=ae(e);re(o[0],l[0],i+1,s,a,r),re(o[0],l[1],i+1,s,a,r),re(o[1],l[0],i+1,s,a,r),re(o[1],l[1],i+1,s,a,r)}}function ne(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function he(t,e,i,s){var a=[t[0],t[1],1],r=[e[0],e[1],1],n=[i[0],i[1],1],h=[s[0],s[1],1],o=ne(ne(a,r),ne(n,h));return Zt(o[2])?null:[o[0]/o[2],o[1]/o[2]]}function oe(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function le(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pe(t,e){return Jt(t[0],e[0])&&Jt(t[1],e[1])}function fe(){}function me(t,e,i,s,a,r,n){var h=i-Math.PI/2,o=i+Math.PI/2,l=e[0]+Math.cos(i)*s*a,p=e[1]-Math.sin(i)*s*a;t.setTripleAt(l,p,l+Math.cos(h)*r,p-Math.sin(h)*r,l+Math.cos(o)*n,p-Math.sin(o)*n,t.length())}function de(t,e){var i,s,a,r,n=0===e?t.length()-1:e-1,h=(e+1)%t.length(),o=t.v[n],l=t.v[h],p=(i=o,a=[(s=l)[0]-i[0],s[1]-i[1]],r=.5*-Math.PI,[Math.cos(r)*a[0]-Math.sin(r)*a[1],Math.sin(r)*a[0]+Math.cos(r)*a[1]]);return Math.atan2(0,1)-Math.atan2(p[1],p[0])}function ce(t,e,i,s,a,r,n){var h=de(e,i),o=e.v[i%e._length],l=e.v[0===i?e._length-1:i-1],p=e.v[(i+1)%e._length],f=2===r?Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)):0,m=2===r?Math.sqrt(Math.pow(o[0]-p[0],2)+Math.pow(o[1]-p[1],2)):0;me(t,e.v[i%e._length],h,n,s,m/(2*(a+1)),f/(2*(a+1)))}function ue(t,e,i,s,a,r){for(var n=0;n1&&e.length>1&&(a=be(t[0],e[e.length-1]))?[[t[0].split(a[0])[0]],[e[e.length-1].split(a[1])[1]]]:[i,s]}function xe(t,e){var i,s,a,r,n=t.inflectionPoints();if(0===n.length)return[ye(t,e)];if(1===n.length||Jt(n[1],1))return i=(a=t.split(n[0]))[0],s=a[1],[ye(i,e),ye(s,e)];i=(a=t.split(n[0]))[0];var h=(n[1]-n[0])/(1-n[0]);return r=(a=a[1].split(h))[0],s=a[1],[ye(i,e),ye(r,e),ye(s,e)]}function ke(){}function we(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",s="normal",a=e.length,r=0;r0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},Gt.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(m):Math.ceil(m),u=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,_=0;if(m>0){for(;_c;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),_-=1;d&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-d,!0),_-=d)}for(s=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,r=this._currentCopies;r;){if(b=(i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(s/(this._currentCopies-1)),0!==_){for((0!==s&&1===a||s!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),v=0;v0&&s<1?[e]:[]:[e-s,e+s].filter((function(t){return t>0&&t<1}))},ee.prototype.split=function(t){if(t<=0)return[te(this.points[0]),this];if(t>=1)return[this,te(this.points[this.points.length-1])];var e=Qt(this.points[0],this.points[1],t),i=Qt(this.points[1],this.points[2],t),s=Qt(this.points[2],this.points[3],t),a=Qt(e,i,t),r=Qt(i,s,t),n=Qt(a,r,t);return[new ee(this.points[0],e,a,n,!0),new ee(n,r,s,this.points[3],!0)]},ee.prototype.bounds=function(){return{x:ie(this,0),y:ie(this,1)}},ee.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}},ee.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var s=[];return re(se(this,0,1),se(t,0,1),0,e,s,i),s},ee.shapeSegment=function(t,e){var i=(e+1)%t.length();return new ee(t.v[e],t.o[e],t.i[i],t.v[i],!0)},ee.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new ee(t.v[i],t.i[i],t.o[e],t.v[e],!0)},r([Wt],fe),fe.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=_t.getProp(t,e.s,0,null,this),this.frequency=_t.getProp(t,e.r,0,null,this),this.pointsType=_t.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},fe.prototype.processPath=function(t,e,i,s){var a=t._length,r=St.newElement();if(r.c=t.c,t.c||(a-=1),0===a)return r;var n=-1,h=ee.shapeSegment(t,0);ce(r,t,0,e,i,s,n);for(var o=0;o=0;r-=1)h=ee.shapeSegmentInverted(t,r),l.push(xe(h,e));l=function(t){for(var e,i=1;i1&&(e=_e(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}(l);var p=null,f=null;for(r=0;r=55296&&i<=56319){var s=t.charCodeAt(1);s>=56320&&s<=57343&&(e=1024*(i-55296)+s-56320+65536)}return e}function o(t){var e=h(t);return e>=127462&&e<=127487}var l=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};l.isModifier=function(t,e){var i=t.toString(16)+e.toString(16);return-1!==s.indexOf(i)},l.isZeroWidthJoiner=function(t){return 8205===t},l.isFlagEmoji=function(t){return o(t.substr(0,2))&&o(t.substr(2,2))},l.isRegionalCode=o,l.isCombinedCharacter=function(t){return-1!==e.indexOf(t)},l.isRegionalFlag=function(t,e){var s=h(t.substr(e,2));if(s!==i)return!1;var a=0;for(e+=2;a<5;){if((s=h(t.substr(e,2)))<917601||s>917626)return!1;a+=1,e+=2}return 917631===h(t.substr(e,2))},l.isVariationSelector=function(t){return 65039===t},l.BLACK_FLAG_CODE_POINT=i;var p={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var i,s,a=t.length,r=this.chars.length;for(e=0;e0&&(f=!1),f){var m=a("style");m.setAttribute("f-forigin",s[i].fOrigin),m.setAttribute("f-origin",s[i].origin),m.setAttribute("f-family",s[i].fFamily),m.type="text/css",m.innerText="@font-face {font-family: "+s[i].fFamily+"; font-style: normal; src: url('"+s[i].fPath+"');}",e.appendChild(m)}}else if("g"===s[i].fOrigin||1===s[i].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),p=0;pt?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},je.prototype.show=function(){},je.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},je.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},je.prototype.resume=function(){this._canPlay=!0},je.prototype.setRate=function(t){this.audio.rate(t)},je.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},je.prototype.getBaseElement=function(){return null},je.prototype.destroy=function(){},je.prototype.sourceRectAtTime=function(){},je.prototype.initExpressions=function(){},We.prototype.checkLayers=function(t){var e,i,s=this.layers.length;for(this.completeLayers=!0,e=s-1;e>=0;e-=1)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},We.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}},We.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},We.prototype.createAudio=function(t){return new je(t,this.globalData,this)},We.prototype.createFootage=function(t){return new qe(t,this.globalData,this)},We.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",v),this.element.maskedElement.setAttribute(_,"url("+s()+"#"+v+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}Xe.prototype={initTransform:function(){var t=new It;this.finalTransform={mProp:this.data.ks?Yt.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:t,localMat:t,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i1&&(r+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==r){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+r:r),i.elem.setAttribute("d",n)),i.lastPath=r}},Ye.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var Ge=function(){var t={};return t.createFilter=function(t,e){var i=X("filter");i.setAttribute("id",t),!0!==e&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%"));return i},t.createAlphaToLuminanceFilter=function(){var t=X("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},t}(),Ke=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),Je={},Ze="filter_result_";function Ue(t){var e,i,a="SourceGraphic",r=t.data.ef?t.data.ef.length:0,n=B(),h=Ge.createFilter(n,!0),o=0;for(this.filters=[],e=0;e=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return!1;i+=1}return!0},mi.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)o=s.transformers[c].mProps._mdf||o,d-=1,c-=1;if(o)for(d=g-s.styles[p].lvl,c=s.transformers.length-1;d>0;)m.multiply(s.transformers[c].mProps.v),d-=1,c-=1}else m=t;if(n=(f=s.sh.paths)._length,o){for(h="",r=0;r=1?v=.99:v<=-1&&(v=-.99);var b=h*v,_=Math.cos(y+e.a.v)*b+p[0],x=Math.sin(y+e.a.v)*b+p[1];o.setAttribute("fx",_),o.setAttribute("fy",x),l&&!e.g._collapsable&&(e.of.setAttribute("fx",_),e.of.setAttribute("fy",x))}}function o(t,e,i){var s=e.style,a=e.d;a&&(a._mdf||i)&&a.dashStr&&(s.pElem.setAttribute("stroke-dasharray",a.dashStr),s.pElem.setAttribute("stroke-dashoffset",a.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+v(e.c.v[0])+","+v(e.c.v[1])+","+v(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return r;case"gf":return h;case"gs":return n;case"st":return o;case"sh":case"el":case"rc":case"sr":return a;case"tr":return i;case"no":return s;default:return null}}}}();function bi(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function _i(t,e,i,s,a,r){this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=a,this.p=r,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}function xi(t,e){this._frameId=i,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=t.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}r([Oe,Xe,Qe,si,$e,Ne,ti],bi),bi.prototype.initSecondaryElement=function(){},bi.prototype.identityMatrix=new It,bi.prototype.buildExpressionInterface=function(){},bi.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},bi.prototype.filterUniqueShapes=function(){var t,e,i,s,a=this.shapes.length,r=this.stylesList.length,n=[],h=!1;for(i=0;i1&&h&&this.setShapesAsAnimated(n)}},bi.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;h-=1){if((m=this.searchProcessedElement(t[h]))?e[h]=i[m-1]:t[h]._render=n,"fl"===t[h].ty||"st"===t[h].ty||"gf"===t[h].ty||"gs"===t[h].ty||"no"===t[h].ty)m?e[h].style.closed=t[h].hd:e[h]=this.createStyleElement(t[h],a),t[h]._render&&e[h].style.pElem.parentNode!==s&&s.appendChild(e[h].style.pElem),u.push(e[h].style);else if("gr"===t[h].ty){if(m)for(l=e[h].it.length,o=0;o1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},xi.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},xi.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var s;this.lock=!0,this._mdf=!1;var a=this.effectsSequence.length,r=t||this.data.d.k[this.keysIndex].s;for(s=0;se);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},xi.prototype.buildFinalText=function(t){for(var e,i,s=[],a=0,r=t.length,n=!1,h=!1,o="";a=55296&&e<=56319?Pe.isRegionalFlag(t,a)?o=t.substr(a,14):(i=t.charCodeAt(a+1))>=56320&&i<=57343&&(Pe.isModifier(e,i)?(o=t.substr(a,2),n=!0):o=Pe.isFlagEmoji(t.substr(a,4))?t.substr(a,4):t.substr(a,2)):e>56319?(i=t.charCodeAt(a+1),Pe.isVariationSelector(e)&&(n=!0)):Pe.isZeroWidthJoiner(e)&&(n=!0,h=!0),n?(s[s.length-1]+=o,n=!1):s.push(o),a+=o.length;return s},xi.prototype.completeTextData=function(t){t.__complete=!0;var e,i,s,a,r,n,h,o=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,d=0,c=0,u=0,g=[],y=0,v=0,b=o.getFontByName(t.f),_=0,x=we(b);t.fWeight=x.weight,t.fStyle=x.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var k,w=t.tr/1e3*t.finalSize;if(t.sz)for(var P,S,A=!0,D=t.sz[0],C=t.sz[1];A;){P=0,y=0,i=(S=this.buildFinalText(t.t)).length,w=t.tr/1e3*t.finalSize;var E=-1;for(e=0;eD&&" "!==S[e]?(-1===E?i+=1:e=E,P+=t.finalLineHeight||1.2*t.finalSize,S.splice(e,E===e?1:0,"\r"),E=-1,y=0):(y+=_,y+=w);P+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&Cv?y:v,y=-2*w,a="",s=!0,u+=1):a=M,o.chars?(h=o.getCharData(M,b.fStyle,o.getFontByName(t.f).fFamily),_=s?0:h.w*t.finalSize/100):_=o.measureText(a,t.f,t.finalSize)," "===M?T+=_+w:(y+=_+w+T,T=0),p.push({l:_,an:_,add:d,n:s,anIndexes:[],val:a,line:u,animatorJustifyOffset:0}),2==m){if(d+=_,""===a||" "===a||e===i-1){for(""!==a&&" "!==a||(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;f+=1,d=0}}else if(3==m){if(d+=_,""===a||e===i-1){for(""===a&&(d-=_);c<=e;)p[c].an=d,p[c].ind=f,p[c].extra=_,c+=1;d=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=y>v?y:v,g.push(y),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=g;var F,I,L,B,z=l.a;n=z.length;var V=[];for(r=0;r0?a=this.ne.v/100:r=-this.ne.v/100,this.xe.v>0?n=1-this.xe.v/100:h=1+this.xe.v/100;var o=it.getBezierEasing(a,r,n,h).get,l=0,p=this.finalS,f=this.finalE,m=this.data.sh;if(2===m)l=o(l=f===p?s>=f?1:0:t(0,e(.5/(f-p)+(s-p)/(f-p),1)));else if(3===m)l=o(l=f===p?s>=f?0:1:1-t(0,e(.5/(f-p)+(s-p)/(f-p),1)));else if(4===m)f===p?l=0:(l=t(0,e(.5/(f-p)+(s-p)/(f-p),1)))<.5?l*=2:l=1-2*(l-.5),l=o(l);else if(5===m){if(f===p)l=0;else{var d=f-p,c=-d/2+(s=e(t(0,s+.5-p),f-p)),u=d/2;l=Math.sqrt(1-c*c/(u*u))}l=o(l)}else 6===m?(f===p?l=0:(s=e(t(0,s+.5-p),f-p),l=(1+Math.cos(Math.PI+2*Math.PI*s/(f-p)))/2),l=o(l)):(s>=i(p)&&(l=t(0,e(s-p<0?e(f,1)-(p-s):f-s,1))),l=o(l));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;l1&&(l=1)}return l*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,s=this.s.v/e+i,a=this.e.v/e+i;if(s>a){var r=s;s=a,a=r}this.finalS=s,this.finalE=a}},r([xt],s),{getTextSelectorProp:function(t,e,i){return new s(t,e,i)}}}();function wi(t,e,i){var s={propType:!1},a=_t.getProp,r=e.a;this.a={r:r.r?a(t,r.r,0,w,i):s,rx:r.rx?a(t,r.rx,0,w,i):s,ry:r.ry?a(t,r.ry,0,w,i):s,sk:r.sk?a(t,r.sk,0,w,i):s,sa:r.sa?a(t,r.sa,0,w,i):s,s:r.s?a(t,r.s,1,.01,i):s,a:r.a?a(t,r.a,1,0,i):s,o:r.o?a(t,r.o,0,.01,i):s,p:r.p?a(t,r.p,1,0,i):s,sw:r.sw?a(t,r.sw,0,0,i):s,sc:r.sc?a(t,r.sc,1,0,i):s,fc:r.fc?a(t,r.fc,1,0,i):s,fh:r.fh?a(t,r.fh,0,0,i):s,fs:r.fs?a(t,r.fs,0,.01,i):s,fb:r.fb?a(t,r.fb,0,.01,i):s,t:r.t?a(t,r.t,0,0,i):s},this.s=ki.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function Pi(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=l(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function Si(){}Pi.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,s=_t.getProp;for(t=0;t=h+ft||!c?(v=(h+ft-l)/o.partialLength,q=d.point[0]+(o.point[0]-d.point[0])*v,j=d.point[1]+(o.point[1]-d.point[1])*v,P.translate(-x[0]*D[a].an*.005,-x[1]*B*.01),p=!1):c&&(l+=o.partialLength,(f+=1)>=c.length&&(f=0,u[m+=1]?c=u[m].points:_.v.c?(f=0,c=u[m=0].points):(l-=o.partialLength,c=null)),c&&(d=o,g=(o=c[f]).partialLength));V=D[a].an/2-D[a].add,P.translate(-V,0,0)}else V=D[a].an/2-D[a].add,P.translate(-V,0,0),P.translate(-x[0]*D[a].an*.005,-x[1]*B*.01,0);for(T=0;Tt?this.textSpans[t].span:X(o?"g":"text"),y<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=n,o){var v=X("g");n.appendChild(v),this.textSpans[t].childSpan=v}this.textSpans[t].span=n,this.layerElement.appendChild(n)}n.style.display="inherit"}if(p.reset(),f&&(h[t].n&&(m=-u,d+=i.yOffset,d+=c?1:0,c=!1),this.applyTextPropertiesToMatrix(i,p,h[t].line,m,d),m+=h[t].l||0,m+=u),o){var b;if(1===(g=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)b=new Fi(g.data,this.globalData,this);else{var _=Ai;g.data&&g.data.shapes&&(_=this.buildShapeData(g.data,i.finalSize)),b=new bi(_,this.globalData,this)}if(this.textSpans[t].glyph){var x=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(x.layerElement),x.destroy()}this.textSpans[t].glyph=b,b._debug=!0,b.prepareFrame(0),b.renderFrame(),this.textSpans[t].childSpan.appendChild(b.layerElement),1===g.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else f&&n.setAttribute("transform","translate("+p.props[12]+","+p.props[13]+")"),n.textContent=h[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}f&&n&&n.setAttribute("d","")}else{var k=this.textContainer,w="start";switch(i.j){case 1:w="end";break;case 2:w="middle";break;default:w="start"}k.setAttribute("text-anchor",w),k.setAttribute("letter-spacing",u);var P=this.buildTextContents(i.finalText);for(e=P.length,d=i.ps?i.ps[1]+i.ascent:0,t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},Ti.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t0&&h<1&&f[m].push(this.calculateF(h,t,e,i,s,m)):(o=r*r-4*n*a)>=0&&((l=(-r+y(o))/(2*a))>0&&l<1&&f[m].push(this.calculateF(l,t,e,i,s,m)),(p=(-r-y(o))/(2*a))>0&&p<1&&f[m].push(this.calculateF(p,t,e,i,s,m))));this.shapeBoundingBox.left=_.apply(null,f[0]),this.shapeBoundingBox.top=_.apply(null,f[1]),this.shapeBoundingBox.right=b.apply(null,f[0]),this.shapeBoundingBox.bottom=b.apply(null,f[1])},Oi.prototype.calculateF=function(t,e,i,s,a,r){return g(1-t,3)*e[r]+3*g(1-t,2)*t*i[r]+3*(1-t)*g(t,2)*s[r]+g(t,3)*a[r]},Oi.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=a)}i*=t.mult}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i},Oi.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},Oi.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;t-=1){var s=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-s.p.v[0],-s.p.v[1],s.p.v[2]),this.mat.rotateX(-s.or.v[0]).rotateY(-s.or.v[1]).rotateZ(s.or.v[2]),this.mat.rotateX(-s.rx.v).rotateY(-s.ry.v).rotateZ(s.rz.v),this.mat.scale(1/s.s.v[0],1/s.s.v[1],1/s.s.v[2]),this.mat.translate(s.a.v[0],s.a.v[1],s.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var a;a=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var r=Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)+Math.pow(a[2],2)),n=[a[0]/r,a[1]/r,a[2]/r],h=Math.sqrt(n[2]*n[2]+n[0]*n[0]),o=Math.atan2(n[1],h),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-o)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f,m,d;for(e=this.comp.threeDElements.length,t=0;t=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},Wi.prototype.createThreeDContainer=function(t,e){var i,s,r=a("div");A(r);var n=a("div");if(A(n),"3d"===e){(i=r.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var h="50% 50%";i.webkitTransformOrigin=h,i.mozTransformOrigin=h,i.transformOrigin=h;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(s=n.style).transform=o,s.webkitTransform=o}r.appendChild(n);var l={container:n,perspectiveElem:r,startPos:t,endPos:t,type:e};return this.threeDElements.push(l),l},Wi.prototype.build3dContainers=function(){var t,e,i=this.layers.length,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},Wi.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;in?(t=a/this.globalData.compSize.w,e=a/this.globalData.compSize.w,i=0,s=(r-this.globalData.compSize.h*(a/this.globalData.compSize.w))/2):(t=r/this.globalData.compSize.h,e=r/this.globalData.compSize.h,i=(a-this.globalData.compSize.w*(r/this.globalData.compSize.h))/2,s=0);var h=this.resizerElem.style;h.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+s+",0,1)",h.transform=h.webkitTransform},Wi.prototype.renderFrame=Ii.prototype.renderFrame,Wi.prototype.hide=function(){this.resizerElem.style.display="none"},Wi.prototype.show=function(){this.resizerElem.style.display="block"},Wi.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,s=this.threeDElements.length;for(t=0;t