@dotlottie/player-component
Version:
dotLottie animation player web component.
5 lines (4 loc) • 271 kB
JavaScript
import { a } from './chunk-HDDX7F4A.mjs';
import './chunk-ZWH2ESXT.mjs';
var ut=a((exports,module)=>{typeof navigator<"u"&&function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.lottie=e());}(exports,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t;},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t;},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,r=t.length,s;for(i=0;i<r;i+=1){s=t[i].prototype;for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e.prototype[a]=s[a]);}}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}var audioControllerFactory=function(){function t(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1;}return t.prototype={addAudio:function(e){this.audios.push(e);},pause:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].pause();},resume:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].resume();},setRate:function(e){var i,r=this.audios.length;for(i=0;i<r;i+=1)this.audios[i].setRate(e);},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0;},seek:function(){this.isPlaying=!1;},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e;},setVolume:function(e){this._volume=e,this._updateVolume();},mute:function(){this._isMuted=!0,this._updateVolume();},unmute:function(){this._isMuted=!1,this._updateVolume();},getVolume:function(){return this._volume},_updateVolume:function(){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1));}},function(){return new t}}(),createTypedArray=function(){function t(i,r){var s=0,a=[],n;switch(i){case"int16":case"uint8c":n=1;break;default:n=1.1;break}for(s=0;s<r;s+=1)a.push(n);return a}function e(i,r){return i==="float32"?new Float32Array(r):i==="int16"?new Int16Array(r):i==="uint8c"?new Uint8ClampedArray(r):t(i,r)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?e:t}();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(e){return typeof e}:_typeof$6=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};((function(){var t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e,i=t.length;for(e=0;e<i;e+=1)BMMath[t[e]]=Math[t[e]];}))(),BMMath.random=Math.random,BMMath.abs=function(t){var e=_typeof$6(t);if(e==="object"&&t.length){var i=createSizedArray(t.length),r,s=t.length;for(r=0;r<s;r+=1)i[r]=Math.abs(t[r]);return i}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d";}function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1;}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1;}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1;}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i;}function BMDestroyEvent(t,e){this.type=t,this.target=e;}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e;}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t;}var createElementID=function(){var t=0;return function(){return t+=1,idPrefix$1+"__lottie_element_"+t}}();function HSVtoRGB(t,e,i){var r,s,a,n,f,o,d,v;switch(n=Math.floor(t*6),f=t*6-n,o=i*(1-e),d=i*(1-f*e),v=i*(1-(1-f)*e),n%6){case 0:r=i,s=v,a=o;break;case 1:r=d,s=i,a=o;break;case 2:r=o,s=i,a=v;break;case 3:r=o,s=d,a=i;break;case 4:r=v,s=o,a=i;break;case 5:r=i,s=o,a=d;break}return [r,s,a]}function RGBtoHSV(t,e,i){var r=Math.max(t,e,i),s=Math.min(t,e,i),a=r-s,n,f=r===0?0:a/r,o=r/255;switch(r){case s:n=0;break;case t:n=e-i+a*(e<i?6:0),n/=6*a;break;case e:n=i-t+a*2,n/=6*a;break;case i:n=t-e+a*4,n/=6*a;break}return [n,f,o]}function addSaturationToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t=[],e,i;for(e=0;e<256;e+=1)i=e.toString(16),t[e]=i.length===1?"0"+i:i;return function(r,s,a){return r<0&&(r=0),s<0&&(s=0),a<0&&(a=0),"#"+t[r]+t[s]+t[a]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t;},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t;},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t;},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t;},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t;};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(e){return typeof e}:_typeof$5=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}var dataManager=function(){var t=1,e=[],i,r,s={onmessage:function(){},postMessage:function(m){i({data:m});}},a={postMessage:function(m){s.onmessage({data:m});}};function n(m){if(window.Worker&&window.Blob&&getWebWorker()){var b=new Blob(["var _workerSelf = self; self.onmessage = ",m.toString()],{type:"text/javascript"}),g=URL.createObjectURL(b);return new Worker(g)}return i=m,s}function f(){r||(r=n(function(m){function b(){function y(C,w){var x,_,c=C.length,S,F,T,N;for(_=0;_<c;_+=1)if(x=C[_],"ks"in x&&!x.completed){if(x.completed=!0,x.hasMask){var L=x.masksProperties;for(F=L.length,S=0;S<F;S+=1)if(L[S].pt.k.i)u(L[S].pt.k);else for(N=L[S].pt.k.length,T=0;T<N;T+=1)L[S].pt.k[T].s&&u(L[S].pt.k[T].s[0]),L[S].pt.k[T].e&&u(L[S].pt.k[T].e[0]);}x.ty===0?(x.layers=h(x.refId,w),y(x.layers,w)):x.ty===4?l(x.shapes):x.ty===5&&B(x);}}function A(C,w){if(C){var x=0,_=C.length;for(x=0;x<_;x+=1)C[x].t===1&&(C[x].data.layers=h(C[x].data.refId,w),y(C[x].data.layers,w));}}function p(C,w){for(var x=0,_=w.length;x<_;){if(w[x].id===C)return w[x];x+=1;}return null}function h(C,w){var x=p(C,w);return x?x.layers.__used?JSON.parse(JSON.stringify(x.layers)):(x.layers.__used=!0,x.layers):null}function l(C){var w,x=C.length,_,c;for(w=x-1;w>=0;w-=1)if(C[w].ty==="sh")if(C[w].ks.k.i)u(C[w].ks.k);else for(c=C[w].ks.k.length,_=0;_<c;_+=1)C[w].ks.k[_].s&&u(C[w].ks.k[_].s[0]),C[w].ks.k[_].e&&u(C[w].ks.k[_].e[0]);else C[w].ty==="gr"&&l(C[w].it);}function u(C){var w,x=C.i.length;for(w=0;w<x;w+=1)C.i[w][0]+=C.v[w][0],C.i[w][1]+=C.v[w][1],C.o[w][0]+=C.v[w][0],C.o[w][1]+=C.v[w][1];}function E(C,w){var x=w?w.split("."):[100,100,100];return C[0]>x[0]?!0:x[0]>C[0]?!1:C[1]>x[1]?!0:x[1]>C[1]?!1:C[2]>x[2]?!0:x[2]>C[2]?!1:null}var M=function(){var C=[4,4,14];function w(_){var c=_.t.d;_.t.d={k:[{s:c,t:0}]};}function x(_){var c,S=_.length;for(c=0;c<S;c+=1)_[c].ty===5&&w(_[c]);}return function(_){if(E(C,_.v)&&(x(_.layers),_.assets)){var c,S=_.assets.length;for(c=0;c<S;c+=1)_.assets[c].layers&&x(_.assets[c].layers);}}}(),D=function(){var C=[4,7,99];return function(w){if(w.chars&&!E(C,w.v)){var x,_=w.chars.length;for(x=0;x<_;x+=1){var c=w.chars[x];c.data&&c.data.shapes&&(l(c.data.shapes),c.data.ip=0,c.data.op=99999,c.data.st=0,c.data.sr=1,c.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},w.chars[x].t||(c.data.shapes.push({ty:"no"}),c.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})));}}}}(),k=function(){var C=[5,7,15];function w(_){var c=_.t.p;typeof c.a=="number"&&(c.a={a:0,k:c.a}),typeof c.p=="number"&&(c.p={a:0,k:c.p}),typeof c.r=="number"&&(c.r={a:0,k:c.r});}function x(_){var c,S=_.length;for(c=0;c<S;c+=1)_[c].ty===5&&w(_[c]);}return function(_){if(E(C,_.v)&&(x(_.layers),_.assets)){var c,S=_.assets.length;for(c=0;c<S;c+=1)_.assets[c].layers&&x(_.assets[c].layers);}}}(),I=function(){var C=[4,1,9];function w(_){var c,S=_.length,F,T;for(c=0;c<S;c+=1)if(_[c].ty==="gr")w(_[c].it);else if(_[c].ty==="fl"||_[c].ty==="st")if(_[c].c.k&&_[c].c.k[0].i)for(T=_[c].c.k.length,F=0;F<T;F+=1)_[c].c.k[F].s&&(_[c].c.k[F].s[0]/=255,_[c].c.k[F].s[1]/=255,_[c].c.k[F].s[2]/=255,_[c].c.k[F].s[3]/=255),_[c].c.k[F].e&&(_[c].c.k[F].e[0]/=255,_[c].c.k[F].e[1]/=255,_[c].c.k[F].e[2]/=255,_[c].c.k[F].e[3]/=255);else _[c].c.k[0]/=255,_[c].c.k[1]/=255,_[c].c.k[2]/=255,_[c].c.k[3]/=255;}function x(_){var c,S=_.length;for(c=0;c<S;c+=1)_[c].ty===4&&w(_[c].shapes);}return function(_){if(E(C,_.v)&&(x(_.layers),_.assets)){var c,S=_.assets.length;for(c=0;c<S;c+=1)_.assets[c].layers&&x(_.assets[c].layers);}}}(),R=function(){var C=[4,4,18];function w(_){var c,S=_.length,F,T;for(c=S-1;c>=0;c-=1)if(_[c].ty==="sh")if(_[c].ks.k.i)_[c].ks.k.c=_[c].closed;else for(T=_[c].ks.k.length,F=0;F<T;F+=1)_[c].ks.k[F].s&&(_[c].ks.k[F].s[0].c=_[c].closed),_[c].ks.k[F].e&&(_[c].ks.k[F].e[0].c=_[c].closed);else _[c].ty==="gr"&&w(_[c].it);}function x(_){var c,S,F=_.length,T,N,L,H;for(S=0;S<F;S+=1){if(c=_[S],c.hasMask){var O=c.masksProperties;for(N=O.length,T=0;T<N;T+=1)if(O[T].pt.k.i)O[T].pt.k.c=O[T].cl;else for(H=O[T].pt.k.length,L=0;L<H;L+=1)O[T].pt.k[L].s&&(O[T].pt.k[L].s[0].c=O[T].cl),O[T].pt.k[L].e&&(O[T].pt.k[L].e[0].c=O[T].cl);}c.ty===4&&w(c.shapes);}}return function(_){if(E(C,_.v)&&(x(_.layers),_.assets)){var c,S=_.assets.length;for(c=0;c<S;c+=1)_.assets[c].layers&&x(_.assets[c].layers);}}}();function V(C){C.__complete||(I(C),M(C),D(C),k(C),R(C),y(C.layers,C.assets),A(C.chars,C.assets),C.__complete=!0);}function B(C){C.t.a.length===0&&"m"in C.t.p;}var G={};return G.completeData=V,G.checkColors=I,G.checkChars=D,G.checkPathProperties=k,G.checkShapes=R,G.completeLayers=y,G}if(a.dataManager||(a.dataManager=b()),a.assetLoader||(a.assetLoader=function(){function y(p){var h=p.getResponseHeader("content-type");return h&&p.responseType==="json"&&h.indexOf("json")!==-1||p.response&&_typeof$5(p.response)==="object"?p.response:p.response&&typeof p.response=="string"?JSON.parse(p.response):p.responseText?JSON.parse(p.responseText):null}function A(p,h,l,u){var E,M=new XMLHttpRequest;try{M.responseType="json";}catch{}M.onreadystatechange=function(){if(M.readyState===4)if(M.status===200)E=y(M),l(E);else try{E=y(M),l(E);}catch(D){u&&u(D);}};try{M.open(["G","E","T"].join(""),p,!0);}catch{M.open(["G","E","T"].join(""),h+"/"+p,!0);}M.send();}return {load:A}}()),m.data.type==="loadAnimation")a.assetLoader.load(m.data.path,m.data.fullPath,function(y){a.dataManager.completeData(y),a.postMessage({id:m.data.id,payload:y,status:"success"});},function(){a.postMessage({id:m.data.id,status:"error"});});else if(m.data.type==="complete"){var g=m.data.animation;a.dataManager.completeData(g),a.postMessage({id:m.data.id,payload:g,status:"success"});}else m.data.type==="loadData"&&a.assetLoader.load(m.data.path,m.data.fullPath,function(y){a.postMessage({id:m.data.id,payload:y,status:"success"});},function(){a.postMessage({id:m.data.id,status:"error"});});}),r.onmessage=function(m){var b=m.data,g=b.id,y=e[g];e[g]=null,b.status==="success"?y.onComplete(b.payload):y.onError&&y.onError();});}function o(m,b){t+=1;var g="processId_"+t;return e[g]={onComplete:m,onError:b},g}function d(m,b,g){f();var y=o(b,g);r.postMessage({type:"loadAnimation",path:m,fullPath:window.location.origin+window.location.pathname,id:y});}function v(m,b,g){f();var y=o(b,g);r.postMessage({type:"loadData",path:m,fullPath:window.location.origin+window.location.pathname,id:y});}function P(m,b,g){f();var y=o(b,g);r.postMessage({type:"complete",animation:m,id:y});}return {loadAnimation:d,loadData:v,completeAnimation:P}}(),ImagePreloader=function(){var t=function(){var p=createTag("canvas");p.width=1,p.height=1;var h=p.getContext("2d");return h.fillStyle="rgba(0,0,0,0)",h.fillRect(0,0,1,1),p}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null);}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null);}function r(p,h,l){var u="";if(p.e)u=p.p;else if(h){var E=p.p;E.indexOf("images/")!==-1&&(E=E.split("/")[1]),u=h+E;}else u=l,u+=p.u?p.u:"",u+=p.p;return u}function s(p){var h=0,l=setInterval(function(){var u=p.getBBox();(u.width||h>500)&&(this._imageLoaded(),clearInterval(l)),h+=1;}.bind(this),50);}function a(p){var h=r(p,this.assetsPath,this.path),l=createNS("image");isSafari?this.testImageLoaded(l):l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){u.img=t,this._imageLoaded();}.bind(this),!1),l.setAttributeNS("http://www.w3.org/1999/xlink","href",h),this._elementHelper.append?this._elementHelper.append(l):this._elementHelper.appendChild(l);var u={img:l,assetData:p};return u}function n(p){var h=r(p,this.assetsPath,this.path),l=createTag("img");l.crossOrigin="anonymous",l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){u.img=t,this._imageLoaded();}.bind(this),!1),l.src=h;var u={img:l,assetData:p};return u}function f(p){var h={assetData:p},l=r(p,this.assetsPath,this.path);return dataManager.loadData(l,function(u){h.img=u,this._footageLoaded();}.bind(this),function(){h.img={},this._footageLoaded();}.bind(this)),h}function o(p,h){this.imagesLoadedCb=h;var l,u=p.length;for(l=0;l<u;l+=1)p[l].layers||(!p[l].t||p[l].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(p[l]))):p[l].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(p[l]))));}function d(p){this.path=p||"";}function v(p){this.assetsPath=p||"";}function P(p){for(var h=0,l=this.images.length;h<l;){if(this.images[h].assetData===p)return this.images[h].img;h+=1;}return null}function m(){this.imagesLoadedCb=null,this.images.length=0;}function b(){return this.totalImages===this.loadedAssets}function g(){return this.totalFootages===this.loadedFootagesCount}function y(p,h){p==="svg"?(this._elementHelper=h,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this);}function A(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=f.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[];}return A.prototype={loadAssets:o,setAssetsPath:v,setPath:d,loadedImages:b,loadedFootages:g,destroy:m,getAsset:P,createImgData:n,createImageData:a,imageLoaded:e,footageLoaded:i,setCacheType:y},A}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],r=0;r<i.length;r+=1)i[r](e);},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e);}.bind(this)},removeEventListener:function(t,e){if(!e)this._cbs[t]=null;else if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,r-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null);}}};var markerParser=function(){function t(e){for(var i=e.split(`\r
`),r={},s,a=0,n=0;n<i.length;n+=1)s=i[n].split(":"),s.length===2&&(r[s[0]]=s[1].trim(),a+=1);if(a===0)throw new Error;return r}return function(e){for(var i=[],r=0;r<e.length;r+=1){var s=e[r],a={time:s.tm,duration:s.dr};try{a.payload=JSON.parse(e[r].cm);}catch{try{a.payload=t(e[r].cm);}catch{a.payload={name:e[r].cm};}}i.push(a);}return i}}(),ProjectInterface=function(){function t(e){this.compositions.push(e);}return function(){function e(i){for(var r=0,s=this.compositions.length;r<s;){if(this.compositions[r].data&&this.compositions[r].data.nm===i)return this.compositions[r].prepareFrame&&this.compositions[r].data.xt&&this.compositions[r].prepareFrame(this.currentFrame),this.compositions[r].compInterface;r+=1;}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),renderers={},registerRenderer=function(t,e){renderers[t]=e;};function getRenderer(t){return renderers[t]}function getRegisteredRenderer(){if(renderers.canvas)return "canvas";for(var t in renderers)if(renderers[t])return t;return ""}function _typeof$4(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(e){return typeof e}:_typeof$4=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(t)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin();};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=getRenderer(e);this.renderer=new i(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,t.loop===""||t.loop===null||t.loop===void 0||t.loop===!0?this.loop=!0:t.loop===!1?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay="autoplay"in t?t.autoplay:!0,this.name=t.name?t.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(t,"autoloadSegments")?t.autoloadSegments:!0,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(t.path.lastIndexOf("\\")!==-1?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(t.path,this.configAnimation,this.onSetupError));},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed");},AnimationItem.prototype.setupAnimation=function(t){dataManager.completeAnimation(t,this.configAnimation);},AnimationItem.prototype.setData=function(t,e){e&&_typeof$4(e)!=="object"&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},r=t.attributes;i.path=r.getNamedItem("data-animation-path")?r.getNamedItem("data-animation-path").value:r.getNamedItem("data-bm-path")?r.getNamedItem("data-bm-path").value:r.getNamedItem("bm-path")?r.getNamedItem("bm-path").value:"",i.animType=r.getNamedItem("data-anim-type")?r.getNamedItem("data-anim-type").value:r.getNamedItem("data-bm-type")?r.getNamedItem("data-bm-type").value:r.getNamedItem("bm-type")?r.getNamedItem("bm-type").value:r.getNamedItem("data-bm-renderer")?r.getNamedItem("data-bm-renderer").value:r.getNamedItem("bm-renderer")?r.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var s=r.getNamedItem("data-anim-loop")?r.getNamedItem("data-anim-loop").value:r.getNamedItem("data-bm-loop")?r.getNamedItem("data-bm-loop").value:r.getNamedItem("bm-loop")?r.getNamedItem("bm-loop").value:"";s==="false"?i.loop=!1:s==="true"?i.loop=!0:s!==""&&(i.loop=parseInt(s,10));var a=r.getNamedItem("data-anim-autoplay")?r.getNamedItem("data-anim-autoplay").value:r.getNamedItem("data-bm-autoplay")?r.getNamedItem("data-bm-autoplay").value:r.getNamedItem("bm-autoplay")?r.getNamedItem("bm-autoplay").value:!0;i.autoplay=a!=="false",i.name=r.getNamedItem("data-name")?r.getNamedItem("data-name").value:r.getNamedItem("data-bm-name")?r.getNamedItem("data-bm-name").value:r.getNamedItem("bm-name")?r.getNamedItem("bm-name").value:"";var n=r.getNamedItem("data-anim-prerender")?r.getNamedItem("data-anim-prerender").value:r.getNamedItem("data-bm-prerender")?r.getNamedItem("data-bm-prerender").value:r.getNamedItem("bm-prerender")?r.getNamedItem("bm-prerender").value:"";n==="false"&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy");},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e=this.animationData.layers,i,r=e.length,s=t.layers,a,n=s.length;for(a=0;a<n;a+=1)for(i=0;i<r;){if(e[i].id===s[a].id){e[i]=s[a];break}i+=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,i=0;i<r;i+=1)this.animationData.assets.push(t.assets[i]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete);},AnimationItem.prototype.onSegmentComplete=function(t){this.animationData=t;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.loadNextSegment();},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||t.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed");}.bind(this));},AnimationItem.prototype.loadSegments=function(){var t=this.animationData.segments;t||(this.timeCompleted=this.totalFrames),this.loadNextSegment();},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded();},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this));},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=markerParser(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause();}catch(e){this.triggerConfigError(e);}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20));},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded");}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play();}},AnimationItem.prototype.resize=function(t,e){var i=typeof t=="number"?t:void 0,r=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(i,r);},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t;},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame");},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame);}catch(t){this.triggerRenderFrameError(t);}},AnimationItem.prototype.play=function(t){t&&this.name!==t||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")));},AnimationItem.prototype.pause=function(t){t&&this.name!==t||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause());},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(this.isPaused===!0?this.play():this.pause());},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0));},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if(e=this.markers[i],e.payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,i){if(!(i&&this.name!==i)){var r=Number(t);if(isNaN(r)){var s=this.getMarkerData(t);s&&this.goToAndStop(s.time,!0);}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause();}},AnimationItem.prototype.goToAndPlay=function(t,e,i){if(!(i&&this.name!==i)){var r=Number(t);if(isNaN(r)){var s=this.getMarkerData(t);s&&(s.duration?this.playSegments([s.time,s.time+s.duration],!0):this.goToAndStop(s.time,!0));}else this.goToAndStop(r,e,i);this.play();}},AnimationItem.prototype.advanceTime=function(t){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):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):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>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");},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,i!==-1&&this.goToAndStop(i,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var i,r=t.length;for(i=0;i<r;i+=1)this.segments.push(t[i]);}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play();},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0);},AnimationItem.prototype.checkSegments=function(t){return this.segments.length?(this.adjustSegment(this.segments.shift(),t),!0):!1},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null);},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame();},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier();},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier();},AnimationItem.prototype.setLoop=function(t){this.loop=t;},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t);},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute();},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute();},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection);},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;i.indexOf("images/")!==-1&&(i=i.split("/")[1]),e=this.assetsPath+i;}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1;}return null},AnimationItem.prototype.hide=function(){this.renderer.hide();},AnimationItem.prototype.show=function(){this.renderer.show();},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,i){try{var r=this.renderer.getElementByPath(t);r.updateDocumentData(e,i);}catch{}},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);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);}t==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),t==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),t==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),t==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),t==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this));},AnimationItem.prototype.triggerRenderFrameError=function(t){var e=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e);},AnimationItem.prototype.triggerConfigError=function(t){var e=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e);};var animationManager=function(){var t={},e=[],i=0,r=0,s=0,a=!0,n=!1;function f(x){for(var _=0,c=x.target;_<r;)e[_].animation===c&&(e.splice(_,1),_-=1,r-=1,c.isPaused||P()),_+=1;}function o(x,_){if(!x)return null;for(var c=0;c<r;){if(e[c].elem===x&&e[c].elem!==null)return e[c].animation;c+=1;}var S=new AnimationItem;return m(S,x),S.setData(x,_),S}function d(){var x,_=e.length,c=[];for(x=0;x<_;x+=1)c.push(e[x].animation);return c}function v(){s+=1,R();}function P(){s-=1;}function m(x,_){x.addEventListener("destroy",f),x.addEventListener("_active",v),x.addEventListener("_idle",P),e.push({elem:_,animation:x}),r+=1;}function b(x){var _=new AnimationItem;return m(_,null),_.setParams(x),_}function g(x,_){var c;for(c=0;c<r;c+=1)e[c].animation.setSpeed(x,_);}function y(x,_){var c;for(c=0;c<r;c+=1)e[c].animation.setDirection(x,_);}function A(x){var _;for(_=0;_<r;_+=1)e[_].animation.play(x);}function p(x){var _=x-i,c;for(c=0;c<r;c+=1)e[c].animation.advanceTime(_);i=x,s&&!n?window.requestAnimationFrame(p):a=!0;}function h(x){i=x,window.requestAnimationFrame(p);}function l(x){var _;for(_=0;_<r;_+=1)e[_].animation.pause(x);}function u(x,_,c){var S;for(S=0;S<r;S+=1)e[S].animation.goToAndStop(x,_,c);}function E(x){var _;for(_=0;_<r;_+=1)e[_].animation.stop(x);}function M(x){var _;for(_=0;_<r;_+=1)e[_].animation.togglePause(x);}function D(x){var _;for(_=r-1;_>=0;_-=1)e[_].animation.destroy(x);}function k(x,_,c){var S=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),F,T=S.length;for(F=0;F<T;F+=1)c&&S[F].setAttribute("data-bm-type",c),o(S[F],x);if(_&&T===0){c||(c="svg");var N=document.getElementsByTagName("body")[0];N.innerText="";var L=createTag("div");L.style.width="100%",L.style.height="100%",L.setAttribute("data-bm-type",c),N.appendChild(L),o(L,x);}}function I(){var x;for(x=0;x<r;x+=1)e[x].animation.resize();}function R(){!n&&s&&a&&(window.requestAnimationFrame(h),a=!1);}function V(){n=!0;}function B(){n=!1,R();}function G(x,_){var c;for(c=0;c<r;c+=1)e[c].animation.setVolume(x,_);}function C(x){var _;for(_=0;_<r;_+=1)e[_].animation.mute(x);}function w(x){var _;for(_=0;_<r;_+=1)e[_].animation.unmute(x);}return t.registerAnimation=o,t.loadAnimation=b,t.setSpeed=g,t.setDirection=y,t.play=A,t.pause=l,t.stop=E,t.togglePause=M,t.searchAnimations=k,t.resize=I,t.goToAndStop=u,t.destroy=D,t.freeze=V,t.unfreeze=B,t.setVolume=G,t.mute=C,t.unmute=w,t.getRegisteredAnimations=d,t}(),BezierFactory=function(){var t={};t.getBezierEasing=i;var e={};function i(h,l,u,E,M){var D=M||("bez_"+h+"_"+l+"_"+u+"_"+E).replace(/\./g,"p");if(e[D])return e[D];var k=new p([h,l,u,E]);return e[D]=k,k}var r=4,s=.001,a=1e-7,n=10,f=11,o=1/(f-1),d=typeof Float32Array=="function";function v(h,l){return 1-3*l+3*h}function P(h,l){return 3*l-6*h}function m(h){return 3*h}function b(h,l,u){return ((v(l,u)*h+P(l,u))*h+m(l))*h}function g(h,l,u){return 3*v(l,u)*h*h+2*P(l,u)*h+m(l)}function y(h,l,u,E,M){var D,k,I=0;do k=l+(u-l)/2,D=b(k,E,M)-h,D>0?u=k:l=k;while(Math.abs(D)>a&&++I<n);return k}function A(h,l,u,E){for(var M=0;M<r;++M){var D=g(l,u,E);if(D===0)return l;var k=b(l,u,E)-h;l-=k/D;}return l}function p(h){this._p=h,this._mSampleValues=d?new Float32Array(f):new Array(f),this._precomputed=!1,this.get=this.get.bind(this);}return p.prototype={get:function(h){var l=this._p[0],u=this._p[1],E=this._p[2],M=this._p[3];return this._precomputed||this._precompute(),l===u&&E===M?h:h===0?0:h===1?1:b(this._getTForX(h),u,M)},_precompute:function(){var h=this._p[0],l=this._p[1],u=this._p[2],E=this._p[3];this._precomputed=!0,(h!==l||u!==E)&&this._calcSampleValues();},_calcSampleValues:function(){for(var h=this._p[0],l=this._p[2],u=0;u<f;++u)this._mSampleValues[u]=b(u*o,h,l);},_getTForX:function(h){for(var l=this._p[0],u=this._p[2],E=this._mSampleValues,M=0,D=1,k=f-1;D!==k&&E[D]<=h;++D)M+=o;--D;var I=(h-E[D])/(E[D+1]-E[D]),R=M+I*o,V=g(R,l,u);return V>=s?A(h,R,l,u):V===0?R:y(h,M,M+o,l,u)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,i){var r=0,s=t,a=createSizedArray(s),n={newElement:f,release:o};function f(){var d;return r?(r-=1,d=a[r]):d=e(),d}function o(d){r===s&&(a=pooling.double(a),s*=2),i&&i(d),a[r]=d,r+=1;}return n}}(),bezierLengthPool=function(){function t(){return {addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,t)}(),segmentsLengthPool=function(){function t(){return {lengths:[],totalLength:0}}function e(i){var r,s=i.lengths.length;for(r=0;r<s;r+=1)bezierLengthPool.release(i.lengths[r]);i.lengths.length=0;}return poolFactory(8,t,e)}();function bezFunction(){var t=Math;function e(m,b,g,y,A,p){var h=m*y+b*A+g*p-A*y-p*m-g*b;return h>-.001&&h<.001}function i(m,b,g,y,A,p,h,l,u){if(g===0&&p===0&&u===0)return e(m,b,y,A,h,l);var E=t.sqrt(t.pow(y-m,2)+t.pow(A-b,2)+t.pow(p-g,2)),M=t.sqrt(t.pow(h-m,2)+t.pow(l-b,2)+t.pow(u-g,2)),D=t.sqrt(t.pow(h-y,2)+t.pow(l-A,2)+t.pow(u-p,2)),k;return E>M?E>D?k=E-M-D:k=D-M-E:D>M?k=D-M-E:k=M-E-D,k>-1e-4&&k<1e-4}var r=function(){return function(m,b,g,y){var A=getDefaultCurveSegments(),p,h,l,u,E,M=0,D,k=[],I=[],R=bezierLengthPool.newElement();for(l=g.length,p=0;p<A;p+=1){for(E=p/(A-1),D=0,h=0;h<l;h+=1)u=bmPow(1-E,3)*m[h]+3*bmPow(1-E,2)*E*g[h]+3*(1-E)*bmPow(E,2)*y[h]+bmPow(E,3)*b[h],k[h]=u,I[h]!==null&&(D+=bmPow(k[h]-I[h],2)),I[h]=k[h];D&&(D=bmSqrt(D),M+=D),R.percents[p]=E,R.lengths[p]=M;}return R.addedLength=M,R}}();function s(m){var b=segmentsLengthPool.newElement(),g=m.c,y=m.v,A=m.o,p=m.i,h,l=m._length,u=b.lengths,E=0;for(h=0;h<l-1;h+=1)u[h]=r(y[h],y[h+1],A[h],p[h+1]),E+=u[h].addedLength;return g&&l&&(u[h]=r(y[h],y[0],A[h],p[0]),E+=u[h].addedLength),b.totalLength=E,b}function a(m){this.segmentLength=0,this.points=new Array(m);}function n(m,b){this.partialLength=m,this.point=b;}var f=function(){var m={};return function(b,g,y,A){var p=(b[0]+"_"+b[1]+"_"+g[0]+"_"+g[1]+"_"+y[0]+"_"+y[1]+"_"+A[0]+"_"+A[1]).replace(/\./g,"p");if(!m[p]){var h=getDefaultCurveSegments(),l,u,E,M,D,k=0,I,R,V=null;b.length===2&&(b[0]!==g[0]||b[1]!==g[1])&&e(b[0],b[1],g[0],g[1],b[0]+y[0],b[1]+y[1])&&e(b[0],b[1],g[0],g[1],g[0]+A[0],g[1]+A[1])&&(h=2);var B=new a(h);for(E=y.length,l=0;l<h;l+=1){for(R=createSizedArray(E),D=l/(h-1),I=0,u=0;u<E;u+=1)M=bmPow(1-D,3)*b[u]+3*bmPow(1-D,2)*D*(b[u]+y[u])+3*(1-D)*bmPow(D,2)*(g[u]+A[u])+bmPow(D,3)*g[u],R[u]=M,V!==null&&(I+=bmPow(R[u]-V[u],2));I=bmSqrt(I),k+=I,B.points[l]=new n(I,R),V=R;}B.segmentLength=k,m[p]=B;}return m[p]}}();function o(m,b){var g=b.percents,y=b.lengths,A=g.length,p=bmFloor((A-1)*m),h=m*b.addedLength,l=0;if(p===A-1||p===0||h===y[p])return g[p];for(var u=y[p]>h?-1:1,E=!0;E;)if(y[p]<=h&&y[p+1]>h?(l=(h-y[p])/(y[p+1]-y[p]),E=!1):p+=u,p<0||p>=A-1){if(p===A-1)return g[p];E=!1;}return g[p]+(g[p+1]-g[p])*l}function d(m,b,g,y,A,p){var h=o(A,p),l=1-h,u=t.round((l*l*l*m[0]+(h*l*l+l*h*l+l*l*h)*g[0]+(h*h*l+l*h*h+h*l*h)*y[0]+h*h*h*b[0])*1e3)/1e3,E=t.round((l*l*l*m[1]+(h*l*l+l*h*l+l*l*h)*g[1]+(h*h*l+l*h*h+h*l*h)*y[1]+h*h*h*b[1])*1e3)/1e3;return [u,E]}var v=createTypedArray("float32",8);function P(m,b,g,y,A,p,h){A<0?A=0:A>1&&(A=1);var l=o(A,h);p=p>1?1:p;var u=o(p,h),E,M=m.length,D=1-l,k=1-u,I=D*D*D,R=l*D*D*3,V=l*l*D*3,B=l*l*l,G=D*D*k,C=l*D*k+D*l*k+D*D*u,w=l*l*k+D*l*u+l*D*u,x=l*l*u,_=D*k*k,c=l*k*k+D*u*k+D*k*u,S=l*u*k+D*u*u+l*k*u,F=l*u*u,T=k*k*k,N=u*k*k+k*u*k+k*k*u,L=u*u*k+k*u*u+u*k*u,H=u*u*u;for(E=0;E<M;E+=1)v[E*4]=t.round((I*m[E]+R*g[E]+V*y[E]+B*b[E])*1e3)/1e3,v[E*4+1]=t.round((G*m[E]+C*g[E]+w*y[E]+x*b[E])*1e3)/1e3,v[E*4+2]=t.round((_*m[E]+c*g[E]+S*y[E]+F*b[E])*1e3)/1e3,v[E*4+3]=t.round((T*m[E]+N*g[E]+L*y[E]+H*b[E])*1e3)/1e3;return v}return {getSegmentsLength:s,getNewSegment:P,getPointInSegment:d,buildBezierData:f,pointOnLine2D:e,pointOnLine3D:i}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var i=this.offsetTime,r;this.propType==="multidimensional"&&(r=createTypedArray("float32",this.pv.length));for(var s=e.lastIndex,a=s,n=this.keyframes.length-1,f=!0,o,d,v;f;){if(o=this.keyframes[a],d=this.keyframes[a+1],a===n-1&&t>=d.t-i){o.h&&(o=d),s=0;break}if(d.t-i>t){s=a;break}a<n-1?a+=1:(s=0,f=!1);}v=this.keyframesMetadata[a]||{};var P,m,b,g,y,A,p=d.t-i,h=o.t-i,l;if(o.to){v.bezierData||(v.bezierData=bez.buildBezierData(o.s,d.s||o.e,o.to,o.ti));var u=v.bezierData;if(t>=p||t<h){var E=t>=p?u.points.length-1:0;for(m=u.points[E].point.length,P=0;P<m;P+=1)r[P]=u.points[E].point[P];}else {v.__fnct?A=v.__fnct:(A=BezierFactory.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n).get,v.__fnct=A),b=A((t-h)/(p-h));var M=u.segmentLength*b,D,k=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastAddedLength:0;for(y=e.lastFrame<t&&e._lastKeyframeIndex===a?e._lastPoint:0,f=!0,g=u.points.length;f;){if(k+=u.points[y].partialLength,M===0||b===0||y===u.points.length-1){for(m=u.points[y].point.length,P=0;P<m;P+=1)r[P]=u.points[y].point[P];break}else if(M>=k&&M<k+u.points[y+1].partialLength){for(D=(M-k)/u.points[y+1].partialLength,m=u.points[y].point.length,P=0;P<m;P+=1)r[P]=u.points[y].point[P]+(u.points[y+1].point[P]-u.points[y].point[P])*D;break}y<g-1?y+=1:f=!1;}e._lastPoint=y,e._lastAddedLength=k-u.points[y].partialLength,e._lastKeyframeIndex=a;}}else {var I,R,V,B,G;if(n=o.s.length,l=d.s||o.e,this.sh&&o.h!==1)if(t>=p)r[0]=l[0],r[1]=l[1],r[2]=l[2];else if(t<=h)r[0]=o.s[0],r[1]=o.s[1],r[2]=o.s[2];else {var C=createQuaternion(o.s),w=createQuaternion(l),x=(t-h)/(p-h);quaternionToEuler(r,slerp(C,w,x));}else for(a=0;a<n;a+=1)o.h!==1&&(t>=p?b=1:t<h?b=0:(o.o.x.constructor===Array?(v.__fnct||(v.__fnct=[]),v.__fnct[a]?A=v.__fnct[a]:(I=o.o.x[a]===void 0?o.o.x[0]:o.o.x[a],R=o.o.y[a]===void 0?o.o.y[0]:o.o.y[a],V=o.i.x[a]===void 0?o.i.x[0]:o.i.x[a],B=o.i.y[a]===void 0?o.i.y[0]:o.i.y[a],A=BezierFactory.getBezierEasing(I,R,V,B).get,v.__fnct[a]=A)):v.__fnct?A=v.__fnct:(I=o.o.x,R=o.o.y,V=o.i.x,B=o.i.y,A=BezierFactory.getBezierEasing(I,R,V,B).get,o.keyframeMetadata=A),b=A((t-h)/(p-h)))),l=d.s||o.e,G=o.h===1?o.s[a]:o.s[a]+(l[a]-o.s[a])*b,this.propType==="multidimensional"?r[a]=G:r=G;}return e.lastIndex=s,r}function slerp(t,e,i){var r=[],s=t[0],a=t[1],n=t[2],f=t[3],o=e[0],d=e[1],v=e[2],P=e[3],m,b,g,y,A;return b=s*o+a*d+n*v+f*P,b<0&&(b=-b,o=-o,d=-d,v=-v,P=-P),1-b>1e-6?(m=Math.acos(b),g=Math.sin(m),y=Math.sin((1-i)*m)/g,A=Math.sin(i*m)/g):(y=1-i,A=i),r[0]=y*s+A*o,r[1]=y*a+A*d,r[2]=y*n+A*v,r[3]=y*f+A*P,r}function quaternionToEuler(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=Math.atan2(2*r*a-2*i*s,1-2*r*r-2*s*s),f=Math.asin(2*i*r+2*s*a),o=Math.atan2(2*i*a-2*r*s,1-2*i*i-2*s*s);t[0]=n/degToRads,t[1]=f/degToRads,t[2]=o/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),f=Math.sin(e/2),o=Math.sin(i/2),d=Math.sin(r/2),v=s*a*n-f*o*d,P=f*o*n+s*a*d,m=f*a*n+s*o*d,b=s*o*n-f*a*d;return [P,m,b,v]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r;}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if(this.propType==="unidimensional")e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i<r;)e=t[i]*this.mult,mathAbs(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1;}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId;}}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this);}function ValueProperty(t,e,i,r){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function MultiDimensionalProperty(t,e,i,r){this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=r,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var s,a=e.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),s=0;s<a;s+=1)this.v[s]=e.k[s]*this.mult,this.pv[s]=e.k[s];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function KeyframedValueProperty(t,e,i,r){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect;}function KeyframedMultidimensionalProperty(t,e,i,r){this.propType="multidimensional";var s,a=e.k.length,n,f,o,d;for(s=0;s<a-1;s+=1)e.k[s].to&&e.k[s].s&&e.k[s+1]&&e.k[s+1].s&&(n=e.k[s].s,f=e.k[s+1].s,o=e.k[s].to,d=e.k[s].ti,(n.length===2&&!(n[0]===f[0]&&n[1]===f[1])&&bez.pointOnLine2D(n[0],n[1],f[0],f[1],n[0]+o[0],n[1]+o[1])&&bez.pointOnLine2D(n[0],n[1],f[0],f[1],f[0]+d[0],f[1]+d[1])||n.length===3&&!(n[0]===f[0]&&n[1]===f[1]&&n[2]===f[2])&&bez.pointOnLine3D(n[0],n[1],n[2],f[0],f[1],f[2],n[0]+o[0],n[1]+o[1],n[2]+o[2])&&bez.pointOnLine3D(n[0],n[1],n[2],f[0],f[1],f[2],f[0]+d[0],f[1]+d[1],f[2]+d[2]))&&(e.k[s].to=null,e.k[s].ti=null),n[0]===f[0]&&n[1]===f[1]&&o[0]===0&&o[1]===0&&d[0]===0&&d[1]===0&&(n.length===2||n[2]===f[2]&&o[2]===0&&d[2]===0)&&(e.k[s].to=null,e.k[s].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=r,this.comp=t.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var v=e.k[0].s.length;for(this.v=createTypedArray("float32",v),this.pv=createTypedArray("float32",v),s=0;s<v;s+=1)this.v[s]=initFrame,this.pv[s]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",v)},this.addEffect=addEffect;}var PropertyFactory=function(){function t(i,r,s,a,n){r.sid&&(r=i.globalData.slotManager.getProp(r));var f;if(!r.k.length)f=new ValueProperty(i,r,a,n);else if(typeof r.k[0]=="number")f=new MultiDimensionalProperty(i,r,a,n);else switch(s){case 0:f=new KeyframedValueProperty(i,r,a,n);break;case 1:f=new KeyframedMultidimensionalProperty(i,r,a,n);break}return f.effectsSequence.length&&n.addDynamicProperty(f),f}var e={getProp:t};return e}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(t){this.dynamicProperties.indexOf(t)===-1&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0);},iterateDynamicProperties:function(){this._mdf=!1;var t,e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._m