@dotlottie/player-component
Version:
dotLottie animation player web component.
5 lines (4 loc) • 245 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 r,i=t.length,a;for(r=0;r<i;r+=1){a=t[r].prototype;for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e.prototype[s]=a[s]);}}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,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].pause();},resume:function(){var e,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].resume();},setRate:function(e){var r,i=this.audios.length;for(r=0;r<i;r+=1)this.audios[r].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,r=this.audios.length;for(e=0;e<r;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1));}},function(){return new t}}(),createTypedArray=function(){function t(r,i){var a=0,s=[],n;switch(r){case"int16":case"uint8c":n=1;break;default:n=1.1;break}for(a=0;a<i;a+=1)s.push(n);return s}function e(r,i){return r==="float32"?new Float32Array(i):r==="int16"?new Int16Array(i):r==="uint8c"?new Uint8ClampedArray(i):t(r,i)}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,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,r=t.length;for(e=0;e<r;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 r=createSizedArray(t.length),i,a=t.length;for(i=0;i<a;i+=1)r[i]=Math.abs(t[i]);return r}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function BMEnterFrameEvent(t,e,r,i){this.type=t,this.currentTime=e,this.totalTime=r,this.direction=i<0?-1:1;}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1;}function BMCompleteLoopEvent(t,e,r,i){this.type=t,this.currentLoop=r,this.totalLoops=e,this.direction=i<0?-1:1;}function BMSegmentStartEvent(t,e,r){this.type=t,this.firstFrame=e,this.totalFrames=r;}function BMDestroyEvent(t,e){this.type=t,this.target=e;}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e;}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t;}var createElementID=function(){var t=0;return function(){return t+=1,idPrefix$1+"__lottie_element_"+t}}();function HSVtoRGB(t,e,r){var i,a,s,n,u,h,g,v;switch(n=Math.floor(t*6),u=t*6-n,h=r*(1-e),g=r*(1-u*e),v=r*(1-(1-u)*e),n%6){case 0:i=r,a=v,s=h;break;case 1:i=g,a=r,s=h;break;case 2:i=h,a=r,s=v;break;case 3:i=h,a=g,s=r;break;case 4:i=v,a=h,s=r;break;case 5:i=r,a=h,s=g;break}return [i,a,s]}function RGBtoHSV(t,e,r){var i=Math.max(t,e,r),a=Math.min(t,e,r),s=i-a,n,u=i===0?0:s/i,h=i/255;switch(i){case a:n=0;break;case t:n=e-r+s*(e<r?6:0),n/=6*s;break;case e:n=r-t+s*2,n/=6*s;break;case r:n=t-e+s*4,n/=6*s;break}return [n,u,h]}function addSaturationToRGB(t,e){var r=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return r[1]+=e,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(t,e){var r=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return r[2]+=e,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(t,e){var r=RGBtoHSV(t[0]*255,t[1]*255,t[2]*255);return r[0]+=e/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var t=[],e,r;for(e=0;e<256;e+=1)r=e.toString(16),t[e]=r.length===1?"0"+r:r;return function(i,a,s){return i<0&&(i=0),a<0&&(a=0),s<0&&(s=0),"#"+t[i]+t[a]+t[s]}}(),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=[],r,i,a={onmessage:function(){},postMessage:function(m){r({data:m});}},s={postMessage:function(m){a.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"}),y=URL.createObjectURL(b);return new Worker(y)}return r=m,a}function u(){i||(i=n(function(m){function b(){function d(C,w){var _,x,f=C.length,S,D,k,O;for(x=0;x<f;x+=1)if(_=C[x],"ks"in _&&!_.completed){if(_.completed=!0,_.hasMask){var B=_.masksProperties;for(D=B.length,S=0;S<D;S+=1)if(B[S].pt.k.i)c(B[S].pt.k);else for(O=B[S].pt.k.length,k=0;k<O;k+=1)B[S].pt.k[k].s&&c(B[S].pt.k[k].s[0]),B[S].pt.k[k].e&&c(B[S].pt.k[k].e[0]);}_.ty===0?(_.layers=o(_.refId,w),d(_.layers,w)):_.ty===4?l(_.shapes):_.ty===5&&V(_);}}function A(C,w){if(C){var _=0,x=C.length;for(_=0;_<x;_+=1)C[_].t===1&&(C[_].data.layers=o(C[_].data.refId,w),d(C[_].data.layers,w));}}function p(C,w){for(var _=0,x=w.length;_<x;){if(w[_].id===C)return w[_];_+=1;}return null}function o(C,w){var _=p(C,w);return _?_.layers.__used?JSON.parse(JSON.stringify(_.layers)):(_.layers.__used=!0,_.layers):null}function l(C){var w,_=C.length,x,f;for(w=_-1;w>=0;w-=1)if(C[w].ty==="sh")if(C[w].ks.k.i)c(C[w].ks.k);else for(f=C[w].ks.k.length,x=0;x<f;x+=1)C[w].ks.k[x].s&&c(C[w].ks.k[x].s[0]),C[w].ks.k[x].e&&c(C[w].ks.k[x].e[0]);else C[w].ty==="gr"&&l(C[w].it);}function c(C){var w,_=C.i.length;for(w=0;w<_;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 P(C,w){var _=w?w.split("."):[100,100,100];return C[0]>_[0]?!0:_[0]>C[0]?!1:C[1]>_[1]?!0:_[1]>C[1]?!1:C[2]>_[2]?!0:_[2]>C[2]?!1:null}var M=function(){var C=[4,4,14];function w(x){var f=x.t.d;x.t.d={k:[{s:f,t:0}]};}function _(x){var f,S=x.length;for(f=0;f<S;f+=1)x[f].ty===5&&w(x[f]);}return function(x){if(P(C,x.v)&&(_(x.layers),x.assets)){var f,S=x.assets.length;for(f=0;f<S;f+=1)x.assets[f].layers&&_(x.assets[f].layers);}}}(),T=function(){var C=[4,7,99];return function(w){if(w.chars&&!P(C,w.v)){var _,x=w.chars.length;for(_=0;_<x;_+=1){var f=w.chars[_];f.data&&f.data.shapes&&(l(f.data.shapes),f.data.ip=0,f.data.op=99999,f.data.st=0,f.data.sr=1,f.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[_].t||(f.data.shapes.push({ty:"no"}),f.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"})));}}}}(),F=function(){var C=[5,7,15];function w(x){var f=x.t.p;typeof f.a=="number"&&(f.a={a:0,k:f.a}),typeof f.p=="number"&&(f.p={a:0,k:f.p}),typeof f.r=="number"&&(f.r={a:0,k:f.r});}function _(x){var f,S=x.length;for(f=0;f<S;f+=1)x[f].ty===5&&w(x[f]);}return function(x){if(P(C,x.v)&&(_(x.layers),x.assets)){var f,S=x.assets.length;for(f=0;f<S;f+=1)x.assets[f].layers&&_(x.assets[f].layers);}}}(),I=function(){var C=[4,1,9];function w(x){var f,S=x.length,D,k;for(f=0;f<S;f+=1)if(x[f].ty==="gr")w(x[f].it);else if(x[f].ty==="fl"||x[f].ty==="st")if(x[f].c.k&&x[f].c.k[0].i)for(k=x[f].c.k.length,D=0;D<k;D+=1)x[f].c.k[D].s&&(x[f].c.k[D].s[0]/=255,x[f].c.k[D].s[1]/=255,x[f].c.k[D].s[2]/=255,x[f].c.k[D].s[3]/=255),x[f].c.k[D].e&&(x[f].c.k[D].e[0]/=255,x[f].c.k[D].e[1]/=255,x[f].c.k[D].e[2]/=255,x[f].c.k[D].e[3]/=255);else x[f].c.k[0]/=255,x[f].c.k[1]/=255,x[f].c.k[2]/=255,x[f].c.k[3]/=255;}function _(x){var f,S=x.length;for(f=0;f<S;f+=1)x[f].ty===4&&w(x[f].shapes);}return function(x){if(P(C,x.v)&&(_(x.layers),x.assets)){var f,S=x.assets.length;for(f=0;f<S;f+=1)x.assets[f].layers&&_(x.assets[f].layers);}}}(),R=function(){var C=[4,4,18];function w(x){var f,S=x.length,D,k;for(f=S-1;f>=0;f-=1)if(x[f].ty==="sh")if(x[f].ks.k.i)x[f].ks.k.c=x[f].closed;else for(k=x[f].ks.k.length,D=0;D<k;D+=1)x[f].ks.k[D].s&&(x[f].ks.k[D].s[0].c=x[f].closed),x[f].ks.k[D].e&&(x[f].ks.k[D].e[0].c=x[f].closed);else x[f].ty==="gr"&&w(x[f].it);}function _(x){var f,S,D=x.length,k,O,B,j;for(S=0;S<D;S+=1){if(f=x[S],f.hasMask){var N=f.masksProperties;for(O=N.length,k=0;k<O;k+=1)if(N[k].pt.k.i)N[k].pt.k.c=N[k].cl;else for(j=N[k].pt.k.length,B=0;B<j;B+=1)N[k].pt.k[B].s&&(N[k].pt.k[B].s[0].c=N[k].cl),N[k].pt.k[B].e&&(N[k].pt.k[B].e[0].c=N[k].cl);}f.ty===4&&w(f.shapes);}}return function(x){if(P(C,x.v)&&(_(x.layers),x.assets)){var f,S=x.assets.length;for(f=0;f<S;f+=1)x.assets[f].layers&&_(x.assets[f].layers);}}}();function L(C){C.__complete||(I(C),M(C),T(C),F(C),R(C),d(C.layers,C.assets),A(C.chars,C.assets),C.__complete=!0);}function V(C){C.t.a.length===0&&"m"in C.t.p;}var G={};return G.completeData=L,G.checkColors=I,G.checkChars=T,G.checkPathProperties=F,G.checkShapes=R,G.completeLayers=d,G}if(s.dataManager||(s.dataManager=b()),s.assetLoader||(s.assetLoader=function(){function d(p){var o=p.getResponseHeader("content-type");return o&&p.responseType==="json"&&o.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,o,l,c){var P,M=new XMLHttpRequest;try{M.responseType="json";}catch{}M.onreadystatechange=function(){if(M.readyState===4)if(M.status===200)P=d(M),l(P);else try{P=d(M),l(P);}catch(T){c&&c(T);}};try{M.open(["G","E","T"].join(""),p,!0);}catch{M.open(["G","E","T"].join(""),o+"/"+p,!0);}M.send();}return {load:A}}()),m.data.type==="loadAnimation")s.assetLoader.load(m.data.path,m.data.fullPath,function(d){s.dataManager.completeData(d),s.postMessage({id:m.data.id,payload:d,status:"success"});},function(){s.postMessage({id:m.data.id,status:"error"});});else if(m.data.type==="complete"){var y=m.data.animation;s.dataManager.completeData(y),s.postMessage({id:m.data.id,payload:y,status:"success"});}else m.data.type==="loadData"&&s.assetLoader.load(m.data.path,m.data.fullPath,function(d){s.postMessage({id:m.data.id,payload:d,status:"success"});},function(){s.postMessage({id:m.data.id,status:"error"});});}),i.onmessage=function(m){var b=m.data,y=b.id,d=e[y];e[y]=null,b.status==="success"?d.onComplete(b.payload):d.onError&&d.onError();});}function h(m,b){t+=1;var y="processId_"+t;return e[y]={onComplete:m,onError:b},y}function g(m,b,y){u();var d=h(b,y);i.postMessage({type:"loadAnimation",path:m,fullPath:window.location.origin+window.location.pathname,id:d});}function v(m,b,y){u();var d=h(b,y);i.postMessage({type:"loadData",path:m,fullPath:window.location.origin+window.location.pathname,id:d});}function E(m,b,y){u();var d=h(b,y);i.postMessage({type:"complete",animation:m,id:d});}return {loadAnimation:g,loadData:v,completeAnimation:E}}(),ImagePreloader=function(){var t=function(){var p=createTag("canvas");p.width=1,p.height=1;var o=p.getContext("2d");return o.fillStyle="rgba(0,0,0,0)",o.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 r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null);}function i(p,o,l){var c="";if(p.e)c=p.p;else if(o){var P=p.p;P.indexOf("images/")!==-1&&(P=P.split("/")[1]),c=o+P;}else c=l,c+=p.u?p.u:"",c+=p.p;return c}function a(p){var o=0,l=setInterval(function(){var c=p.getBBox();(c.width||o>500)&&(this._imageLoaded(),clearInterval(l)),o+=1;}.bind(this),50);}function s(p){var o=i(p,this.assetsPath,this.path),l=createNS("image");isSafari?this.testImageLoaded(l):l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){c.img=t,this._imageLoaded();}.bind(this),!1),l.setAttributeNS("http://www.w3.org/1999/xlink","href",o),this._elementHelper.append?this._elementHelper.append(l):this._elementHelper.appendChild(l);var c={img:l,assetData:p};return c}function n(p){var o=i(p,this.assetsPath,this.path),l=createTag("img");l.crossOrigin="anonymous",l.addEventListener("load",this._imageLoaded,!1),l.addEventListener("error",function(){c.img=t,this._imageLoaded();}.bind(this),!1),l.src=o;var c={img:l,assetData:p};return c}function u(p){var o={assetData:p},l=i(p,this.assetsPath,this.path);return dataManager.loadData(l,function(c){o.img=c,this._footageLoaded();}.bind(this),function(){o.img={},this._footageLoaded();}.bind(this)),o}function h(p,o){this.imagesLoadedCb=o;var l,c=p.length;for(l=0;l<c;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 g(p){this.path=p||"";}function v(p){this.assetsPath=p||"";}function E(p){for(var o=0,l=this.images.length;o<l;){if(this.images[o].assetData===p)return this.images[o].img;o+=1;}return null}function m(){this.imagesLoadedCb=null,this.images.length=0;}function b(){return this.totalImages===this.loadedAssets}function y(){return this.totalFootages===this.loadedFootagesCount}function d(p,o){p==="svg"?(this._elementHelper=o,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this);}function A(){this._imageLoaded=e.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=a.bind(this),this.createFootageData=u.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:h,setAssetsPath:v,setPath:g,loadedImages:b,loadedFootages:y,destroy:m,getAsset:E,createImgData:n,createImageData:s,imageLoaded:e,footageLoaded:r,setCacheType:d},A}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var r=this._cbs[t],i=0;i<r.length;i+=1)r[i](e);},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e);}.bind(this)},removeEventListener:function(t,e){if(!e)this._cbs[t]=null;else if(this._cbs[t]){for(var r=0,i=this._cbs[t].length;r<i;)this._cbs[t][r]===e&&(this._cbs[t].splice(r,1),r-=1,i-=1),r+=1;this._cbs[t].length||(this._cbs[t]=null);}}};var markerParser=function(){function t(e){for(var r=e.split(`\r
`),i={},a,s=0,n=0;n<r.length;n+=1)a=r[n].split(":"),a.length===2&&(i[a[0]]=a[1].trim(),s+=1);if(s===0)throw new Error;return i}return function(e){for(var r=[],i=0;i<e.length;i+=1){var a=e[i],s={time:a.tm,duration:a.dr};try{s.payload=JSON.parse(e[i].cm);}catch{try{s.payload=t(e[i].cm);}catch{s.payload={name:e[i].cm};}}r.push(s);}return r}}(),ProjectInterface=function(){function t(e){this.compositions.push(e);}return function(){function e(r){for(var i=0,a=this.compositions.length;i<a;){if(this.compositions[i].data&&this.compositions[i].data.nm===r)return this.compositions[i].prepareFrame&&this.compositions[i].data.xt&&this.compositions[i].prepareFrame(this.currentFrame),this.compositions[i].compInterface;i+=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 r=getRenderer(e);this.renderer=new r(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 r={wrapper:t,animationData:e},i=t.attributes;r.path=i.getNamedItem("data-animation-path")?i.getNamedItem("data-animation-path").value:i.getNamedItem("data-bm-path")?i.getNamedItem("data-bm-path").value:i.getNamedItem("bm-path")?i.getNamedItem("bm-path").value:"",r.animType=i.getNamedItem("data-anim-type")?i.getNamedItem("data-anim-type").value:i.getNamedItem("data-bm-type")?i.getNamedItem("data-bm-type").value:i.getNamedItem("bm-type")?i.getNamedItem("bm-type").value:i.getNamedItem("data-bm-renderer")?i.getNamedItem("data-bm-renderer").value:i.getNamedItem("bm-renderer")?i.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var a=i.getNamedItem("data-anim-loop")?i.getNamedItem("data-anim-loop").value:i.getNamedItem("data-bm-loop")?i.getNamedItem("data-bm-loop").value:i.getNamedItem("bm-loop")?i.getNamedItem("bm-loop").value:"";a==="false"?r.loop=!1:a==="true"?r.loop=!0:a!==""&&(r.loop=parseInt(a,10));var s=i.getNamedItem("data-anim-autoplay")?i.getNamedItem("data-anim-autoplay").value:i.getNamedItem("data-bm-autoplay")?i.getNamedItem("data-bm-autoplay").value:i.getNamedItem("bm-autoplay")?i.getNamedItem("bm-autoplay").value:!0;r.autoplay=s!=="false",r.name=i.getNamedItem("data-name")?i.getNamedItem("data-name").value:i.getNamedItem("data-bm-name")?i.getNamedItem("data-bm-name").value:i.getNamedItem("bm-name")?i.getNamedItem("bm-name").value:"";var n=i.getNamedItem("data-anim-prerender")?i.getNamedItem("data-anim-prerender").value:i.getNamedItem("data-bm-prerender")?i.getNamedItem("data-bm-prerender").value:i.getNamedItem("bm-prerender")?i.getNamedItem("bm-prerender").value:"";n==="false"&&(r.prerender=!1),r.path?this.setParams(r):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,r,i=e.length,a=t.layers,s,n=a.length;for(s=0;s<n;s+=1)for(r=0;r<i;){if(e[r].id===a[s].id){e[r]=a[s];break}r+=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(i=t.assets.length,r=0;r<i;r+=1)this.animationData.assets.push(t.assets[r]);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 r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,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 r=typeof t=="number"?t:void 0,i=typeof e=="number"?e:void 0;this.renderer.updateContainerSize(r,i);},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,r=0;r<this.markers.length;r+=1)if(e=this.markers[r],e.payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,r){if(!(r&&this.name!==r)){var i=Number(t);if(isNaN(i)){var a=this.getMarkerData(t);a&&this.goToAndStop(a.time,!0);}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause();}},AnimationItem.prototype.goToAndPlay=function(t,e,r){if(!(r&&this.name!==r)){var i=Number(t);if(isNaN(i)){var a=this.getMarkerData(t);a&&(a.duration?this.playSegments([a.time,a.time+a.duration],!0):this.goToAndStop(a.time,!0));}else this.goToAndStop(i,e,r);this.play();}},AnimationItem.prototype.advanceTime=function(t){if(!(this.isPaused===!0||this.isLoaded===!1)){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!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):(r=!0,e=0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"));}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(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 r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<t?r=t:this.currentRawFrame+this.firstFrame>e&&(r=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,r!==-1&&this.goToAndStop(r,!0);},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),_typeof$4(t[0])==="object"){var r,i=t.length;for(r=0;r<i;r+=1)this.segments.push(t[r]);}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play();},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0);},AnimationItem.prototype.checkSegments=function(t){return this.segments.length?(this.adjustSegment(this.segments.shift(),t),!0):!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 r=t.p;r.indexOf("images/")!==-1&&(r=r.split("/")[1]),e=this.assetsPath+r;}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},AnimationItem.prototype.getAssetData=function(t){for(var e=0,r=this.assets.length;e<r;){if(t===this.assets[e].id)return this.assets[e];e+=1;}return null},AnimationItem.prototype.hide=function(){this.renderer.hide();},AnimationItem.prototype.show=function(){this.renderer.show();},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,r){try{var i=this.renderer.getElementByPath(t);i.updateDocumentData(e,r);}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=[],r=0,i=0,a=0,s=!0,n=!1;function u(_){for(var x=0,f=_.target;x<i;)e[x].animation===f&&(e.splice(x,1),x-=1,i-=1,f.isPaused||E()),x+=1;}function h(_,x){if(!_)return null;for(var f=0;f<i;){if(e[f].elem===_&&e[f].elem!==null)return e[f].animation;f+=1;}var S=new AnimationItem;return m(S,_),S.setData(_,x),S}function g(){var _,x=e.length,f=[];for(_=0;_<x;_+=1)f.push(e[_].animation);return f}function v(){a+=1,R();}function E(){a-=1;}function m(_,x){_.addEventListener("destroy",u),_.addEventListener("_active",v),_.addEventListener("_idle",E),e.push({elem:x,animation:_}),i+=1;}function b(_){var x=new AnimationItem;return m(x,null),x.setParams(_),x}function y(_,x){var f;for(f=0;f<i;f+=1)e[f].animation.setSpeed(_,x);}function d(_,x){var f;for(f=0;f<i;f+=1)e[f].animation.setDirection(_,x);}function A(_){var x;for(x=0;x<i;x+=1)e[x].animation.play(_);}function p(_){var x=_-r,f;for(f=0;f<i;f+=1)e[f].animation.advanceTime(x);r=_,a&&!n?window.requestAnimationFrame(p):s=!0;}function o(_){r=_,window.requestAnimationFrame(p);}function l(_){var x;for(x=0;x<i;x+=1)e[x].animation.pause(_);}function c(_,x,f){var S;for(S=0;S<i;S+=1)e[S].animation.goToAndStop(_,x,f);}function P(_){var x;for(x=0;x<i;x+=1)e[x].animation.stop(_);}function M(_){var x;for(x=0;x<i;x+=1)e[x].animation.togglePause(_);}function T(_){var x;for(x=i-1;x>=0;x-=1)e[x].animation.destroy(_);}function F(_,x,f){var S=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),D,k=S.length;for(D=0;D<k;D+=1)f&&S[D].setAttribute("data-bm-type",f),h(S[D],_);if(x&&k===0){f||(f="svg");var O=document.getElementsByTagName("body")[0];O.innerText="";var B=createTag("div");B.style.width="100%",B.style.height="100%",B.setAttribute("data-bm-type",f),O.appendChild(B),h(B,_);}}function I(){var _;for(_=0;_<i;_+=1)e[_].animation.resize();}function R(){!n&&a&&s&&(window.requestAnimationFrame(o),s=!1);}function L(){n=!0;}function V(){n=!1,R();}function G(_,x){var f;for(f=0;f<i;f+=1)e[f].animation.setVolume(_,x);}function C(_){var x;for(x=0;x<i;x+=1)e[x].animation.mute(_);}function w(_){var x;for(x=0;x<i;x+=1)e[x].animation.unmute(_);}return t.registerAnimation=h,t.loadAnimation=b,t.setSpeed=y,t.setDirection=d,t.play=A,t.pause=l,t.stop=P,t.togglePause=M,t.searchAnimations=F,t.resize=I,t.goToAndStop=c,t.destroy=T,t.freeze=L,t.unfreeze=V,t.setVolume=G,t.mute=C,t.unmute=w,t.getRegisteredAnimations=g,t}(),BezierFactory=function(){var t={};t.getBezierEasing=r;var e={};function r(o,l,c,P,M){var T=M||("bez_"+o+"_"+l+"_"+c+"_"+P).replace(/\./g,"p");if(e[T])return e[T];var F=new p([o,l,c,P]);return e[T]=F,F}var i=4,a=.001,s=1e-7,n=10,u=11,h=1/(u-1),g=typeof Float32Array=="function";function v(o,l){return 1-3*l+3*o}function E(o,l){return 3*l-6*o}function m(o){return 3*o}function b(o,l,c){return ((v(l,c)*o+E(l,c))*o+m(l))*o}function y(o,l,c){return 3*v(l,c)*o*o+2*E(l,c)*o+m(l)}function d(o,l,c,P,M){var T,F,I=0;do F=l+(c-l)/2,T=b(F,P,M)-o,T>0?c=F:l=F;while(Math.abs(T)>s&&++I<n);return F}function A(o,l,c,P){for(var M=0;M<i;++M){var T=y(l,c,P);if(T===0)return l;var F=b(l,c,P)-o;l-=F/T;}return l}function p(o){this._p=o,this._mSampleValues=g?new Float32Array(u):new Array(u),this._precomputed=!1,this.get=this.get.bind(this);}return p.prototype={get:function(o){var l=this._p[0],c=this._p[1],P=this._p[2],M=this._p[3];return this._precomputed||this._precompute(),l===c&&P===M?o:o===0?0:o===1?1:b(this._getTForX(o),c,M)},_precompute:function(){var o=this._p[0],l=this._p[1],c=this._p[2],P=this._p[3];this._precomputed=!0,(o!==l||c!==P)&&this._calcSampleValues();},_calcSampleValues:function(){for(var o=this._p[0],l=this._p[2],c=0;c<u;++c)this._mSampleValues[c]=b(c*h,o,l);},_getTForX:function(o){for(var l=this._p[0],c=this._p[2],P=this._mSampleValues,M=0,T=1,F=u-1;T!==F&&P[T]<=o;++T)M+=h;--T;var I=(o-P[T])/(P[T+1]-P[T]),R=M+I*h,L=y(R,l,c);return L>=a?A(o,R,l,c):L===0?R:d(o,M,M+h,l,c)}},t}(),pooling=function(){function t(e){return e.concat(createSizedArray(e.length))}return {double:t}}(),poolFactory=function(){return function(t,e,r){var i=0,a=t,s=createSizedArray(a),n={newElement:u,release:h};function u(){var g;return i?(i-=1,g=s[i]):g=e(),g}function h(g){i===a&&(s=pooling.double(s),a*=2),r&&r(g),s[i]=g,i+=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(r){var i,a=r.lengths.length;for(i=0;i<a;i+=1)bezierLengthPool.release(r.lengths[i]);r.lengths.length=0;}return poolFactory(8,t,e)}();function bezFunction(){var t=Math;function e(m,b,y,d,A,p){var o=m*d+b*A+y*p-A*d-p*m-y*b;return o>-.001&&o<.001}function r(m,b,y,d,A,p,o,l,c){if(y===0&&p===0&&c===0)return e(m,b,d,A,o,l);var P=t.sqrt(t.pow(d-m,2)+t.pow(A-b,2)+t.pow(p-y,2)),M=t.sqrt(t.pow(o-m,2)+t.pow(l-b,2)+t.pow(c-y,2)),T=t.sqrt(t.pow(o-d,2)+t.pow(l-A,2)+t.pow(c-p,2)),F;return P>M?P>T?F=P-M-T:F=T-M-P:T>M?F=T-M-P:F=M-P-T,F>-1e-4&&F<1e-4}var i=function(){return function(m,b,y,d){var A=getDefaultCurveSegments(),p,o,l,c,P,M=0,T,F=[],I=[],R=bezierLengthPool.newElement();for(l=y.length,p=0;p<A;p+=1){for(P=p/(A-1),T=0,o=0;o<l;o+=1)c=bmPow(1-P,3)*m[o]+3*bmPow(1-P,2)*P*y[o]+3*(1-P)*bmPow(P,2)*d[o]+bmPow(P,3)*b[o],F[o]=c,I[o]!==null&&(T+=bmPow(F[o]-I[o],2)),I[o]=F[o];T&&(T=bmSqrt(T),M+=T),R.percents[p]=P,R.lengths[p]=M;}return R.addedLength=M,R}}();function a(m){var b=segmentsLengthPool.newElement(),y=m.c,d=m.v,A=m.o,p=m.i,o,l=m._length,c=b.lengths,P=0;for(o=0;o<l-1;o+=1)c[o]=i(d[o],d[o+1],A[o],p[o+1]),P+=c[o].addedLength;return y&&l&&(c[o]=i(d[o],d[0],A[o],p[0]),P+=c[o].addedLength),b.totalLength=P,b}function s(m){this.segmentLength=0,this.points=new Array(m);}function n(m,b){this.partialLength=m,this.point=b;}var u=function(){var m={};return function(b,y,d,A){var p=(b[0]+"_"+b[1]+"_"+y[0]+"_"+y[1]+"_"+d[0]+"_"+d[1]+"_"+A[0]+"_"+A[1]).replace(/\./g,"p");if(!m[p]){var o=getDefaultCurveSegments(),l,c,P,M,T,F=0,I,R,L=null;b.length===2&&(b[0]!==y[0]||b[1]!==y[1])&&e(b[0],b[1],y[0],y[1],b[0]+d[0],b[1]+d[1])&&e(b[0],b[1],y[0],y[1],y[0]+A[0],y[1]+A[1])&&(o=2);var V=new s(o);for(P=d.length,l=0;l<o;l+=1){for(R=createSizedArray(P),T=l/(o-1),I=0,c=0;c<P;c+=1)M=bmPow(1-T,3)*b[c]+3*bmPow(1-T,2)*T*(b[c]+d[c])+3*(1-T)*bmPow(T,2)*(y[c]+A[c])+bmPow(T,3)*y[c],R[c]=M,L!==null&&(I+=bmPow(R[c]-L[c],2));I=bmSqrt(I),F+=I,V.points[l]=new n(I,R),L=R;}V.segmentLength=F,m[p]=V;}return m[p]}}();function h(m,b){var y=b.percents,d=b.lengths,A=y.length,p=bmFloor((A-1)*m),o=m*b.addedLength,l=0;if(p===A-1||p===0||o===d[p])return y[p];for(var c=d[p]>o?-1:1,P=!0;P;)if(d[p]<=o&&d[p+1]>o?(l=(o-d[p])/(d[p+1]-d[p]),P=!1):p+=c,p<0||p>=A-1){if(p===A-1)return y[p];P=!1;}return y[p]+(y[p+1]-y[p])*l}function g(m,b,y,d,A,p){var o=h(A,p),l=1-o,c=t.round((l*l*l*m[0]+(o*l*l+l*o*l+l*l*o)*y[0]+(o*o*l+l*o*o+o*l*o)*d[0]+o*o*o*b[0])*1e3)/1e3,P=t.round((l*l*l*m[1]+(o*l*l+l*o*l+l*l*o)*y[1]+(o*o*l+l*o*o+o*l*o)*d[1]+o*o*o*b[1])*1e3)/1e3;return [c,P]}var v=createTypedArray("float32",8);function E(m,b,y,d,A,p,o){A<0?A=0:A>1&&(A=1);var l=h(A,o);p=p>1?1:p;var c=h(p,o),P,M=m.length,T=1-l,F=1-c,I=T*T*T,R=l*T*T*3,L=l*l*T*3,V=l*l*l,G=T*T*F,C=l*T*F+T*l*F+T*T*c,w=l*l*F+T*l*c+l*T*c,_=l*l*c,x=T*F*F,f=l*F*F+T*c*F+T*F*c,S=l*c*F+T*c*c+l*F*c,D=l*c*c,k=F*F*F,O=c*F*F+F*c*F+F*F*c,B=c*c*F+F*c*c+c*F*c,j=c*c*c;for(P=0;P<M;P+=1)v[P*4]=t.round((I*m[P]+R*y[P]+L*d[P]+V*b[P])*1e3)/1e3,v[P*4+1]=t.round((G*m[P]+C*y[P]+w*d[P]+_*b[P])*1e3)/1e3,v[P*4+2]=t.round((x*m[P]+f*y[P]+S*d[P]+D*b[P])*1e3)/1e3,v[P*4+3]=t.round((k*m[P]+O*y[P]+B*d[P]+j*b[P])*1e3)/1e3;return v}return {getSegmentsLength:a,getNewSegment:E,getPointInSegment:g,buildBezierData:u,pointOnLine2D:e,pointOnLine3D:r}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var r=this.offsetTime,i;this.propType==="multidimensional"&&(i=createTypedArray("float32",this.pv.length));for(var a=e.lastIndex,s=a,n=this.keyframes.length-1,u=!0,h,g,v;u;){if(h=this.keyframes[s],g=this.keyframes[s+1],s===n-1&&t>=g.t-r){h.h&&(h=g),a=0;break}if(g.t-r>t){a=s;break}s<n-1?s+=1:(a=0,u=!1);}v=this.keyframesMetadata[s]||{};var E,m,b,y,d,A,p=g.t-r,o=h.t-r,l;if(h.to){v.bezierData||(v.bezierData=bez.buildBezierData(h.s,g.s||h.e,h.to,h.ti));var c=v.bezierData;if(t>=p||t<o){var P=t>=p?c.points.length-1:0;for(m=c.points[P].point.length,E=0;E<m;E+=1)i[E]=c.points[P].point[E];}else {v.__fnct?A=v.__fnct:(A=BezierFactory.getBezierEasing(h.o.x,h.o.y,h.i.x,h.i.y,h.n).get,v.__fnct=A),b=A((t-o)/(p-o));var M=c.segmentLength*b,T,F=e.lastFrame<t&&e._lastKeyframeIndex===s?e._lastAddedLength:0;for(d=e.lastFrame<t&&e._lastKeyframeIndex===s?e._lastPoint:0,u=!0,y=c.points.length;u;){if(F+=c.points[d].partialLength,M===0||b===0||d===c.points.length-1){for(m=c.points[d].point.length,E=0;E<m;E+=1)i[E]=c.points[d].point[E];break}else if(M>=F&&M<F+c.points[d+1].partialLength){for(T=(M-F)/c.points[d+1].partialLength,m=c.points[d].point.length,E=0;E<m;E+=1)i[E]=c.points[d].point[E]+(c.points[d+1].point[E]-c.points[d].point[E])*T;break}d<y-1?d+=1:u=!1;}e._lastPoint=d,e._lastAddedLength=F-c.points[d].partialLength,e._lastKeyframeIndex=s;}}else {var I,R,L,V,G;if(n=h.s.length,l=g.s||h.e,this.sh&&h.h!==1)if(t>=p)i[0]=l[0],i[1]=l[1],i[2]=l[2];else if(t<=o)i[0]=h.s[0],i[1]=h.s[1],i[2]=h.s[2];else {var C=createQuaternion(h.s),w=createQuaternion(l),_=(t-o)/(p-o);quaternionToEuler(i,slerp(C,w,_));}else for(s=0;s<n;s+=1)h.h!==1&&(t>=p?b=1:t<o?b=0:(h.o.x.constructor===Array?(v.__fnct||(v.__fnct=[]),v.__fnct[s]?A=v.__fnct[s]:(I=h.o.x[s]===void 0?h.o.x[0]:h.o.x[s],R=h.o.y[s]===void 0?h.o.y[0]:h.o.y[s],L=h.i.x[s]===void 0?h.i.x[0]:h.i.x[s],V=h.i.y[s]===void 0?h.i.y[0]:h.i.y[s],A=BezierFactory.getBezierEasing(I,R,L,V).get,v.__fnct[s]=A)):v.__fnct?A=v.__fnct:(I=h.o.x,R=h.o.y,L=h.i.x,V=h.i.y,A=BezierFactory.getBezierEasing(I,R,L,V).get,h.keyframeMetadata=A),b=A((t-o)/(p-o)))),l=g.s||h.e,G=h.h===1?h.s[s]:h.s[s]+(l[s]-h.s[s])*b,this.propType==="multidimensional"?i[s]=G:i=G;}return e.lastIndex=a,i}function slerp(t,e,r){var i=[],a=t[0],s=t[1],n=t[2],u=t[3],h=e[0],g=e[1],v=e[2],E=e[3],m,b,y,d,A;return b=a*h+s*g+n*v+u*E,b<0&&(b=-b,h=-h,g=-g,v=-v,E=-E),1-b>1e-6?(m=Math.acos(b),y=Math.sin(m),d=Math.sin((1-r)*m)/y,A=Math.sin(r*m)/y):(d=1-r,A=r),i[0]=d*a+A*h,i[1]=d*s+A*g,i[2]=d*n+A*v,i[3]=d*u+A*E,i}function quaternionToEuler(t,e){var r=e[0],i=e[1],a=e[2],s=e[3],n=Math.atan2(2*i*s-2*r*a,1-2*i*i-2*a*a),u=Math.asin(2*r*i+2*a*s),h=Math.atan2(2*r*s-2*i*a,1-2*r*r-2*a*a);t[0]=n/degToRads,t[1]=u/degToRads,t[2]=h/degToRads;}function createQuaternion(t){var e=t[0]*degToRads,r=t[1]*degToRads,i=t[2]*degToRads,a=Math.cos(e/2),s=Math.cos(r/2),n=Math.cos(i/2),u=Math.sin(e/2),h=Math.sin(r/2),g=Math.sin(i/2),v=a*s*n-u*h*g,E=u*h*n+a*s*g,m=u*s*n+a*h*g,b=a*h*n-u*s*g;return [E,m,b,v]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&t>=r||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i;}return this._caching.lastFrame=t,this.pv}function 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 r=0,i=this.v.length;r<i;)e=t[r]*this.mult,mathAbs(this.v[r]-e)>1e-5&&(this.v[r]=e,this._mdf=!0),r+=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,r=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)r=this.effectsSequence[t](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId;}}function addEffect(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this);}function ValueProperty(t,e,r,i){this.propType="unidimensional",this.mult=r||1,this.data=e,this.v=r?e.k*r:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function MultiDimensionalProperty(t,e,r,i){this.propType="multidimensional",this.mult=r||1,this.data=e,this._mdf=!1,this.elem=t,this.container=i,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a,s=e.k.length;for(this.v=createTypedArray("float32",s),this.pv=createTypedArray("float32",s),this.vel=createTypedArray("float32",s),a=0;a<s;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect;}function KeyframedValueProperty(t,e,r,i){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=r||1,this.elem=t,this.container=i,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,r,i){this.propType="multidimensional";var a,s=e.k.length,n,u,h,g;for(a=0;a<s-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(n=e.k[a].s,u=e.k[a+1].s,h=e.k[a].to,g=e.k[a].ti,(n.length===2&&!(n[0]===u[0]&&n[1]===u[1])&&bez.pointOnLine2D(n[0],n[1],u[0],u[1],n[0]+h[0],n[1]+h[1])&&bez.pointOnLine2D(n[0],n[1],u[0],u[1],u[0]+g[0],u[1]+g[1])||n.length===3&&!(n[0]===u[0]&&n[1]===u[1]&&n[2]===u[2])&&bez.pointOnLine3D(n[0],n[1],n[2],u[0],u[1],u[2],n[0]+h[0],n[1]+h[1],n[2]+h[2])&&bez.pointOnLine3D(n[0],n[1],n[2],u[0],u[1],u[2],u[0]+g[0],u[1]+g[1],u[2]+g[2]))&&(e.k[a].to=null,e.k[a].ti=null),n[0]===u[0]&&n[1]===u[1]&&h[0]===0&&h[1]===0&&g[0]===0&&g[1]===0&&(n.length===2||n[2]===u[2]&&h[2]===0&&g[2]===0)&&(e.k[a].to=null,e.k[a].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=r||1,this.elem=t,this.container=i,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),a=0;a<v;a+=1)this.v[a]=initFrame,this.pv[a]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",v)},this.addEffect=addEffect;}var PropertyFactory=function(){function t(r,i,a,s,n){i.sid&&(i=r.globalData.slotManager.getProp(i));var u;if(!i.k.length)u=new ValueProperty(r,i,s,n);else if(typeof i.k[0]=="number")u=new MultiDimensionalProperty(r,i,s,n);else switch(a){case 0:u=new KeyframedValueProperty(r,i,s,n);break;case 1:u=new KeyframedMultidimensionalProperty(r,i,s,n);break}return u.effectsSequence.length&&n.addDynamicProperty(u),u}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]._mdf&&(this._mdf=!0);},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1;}};var pointPool=function(){function t(){return createTypedArray("float32",2)}return poolFactory(8,t)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLen