UNPKG

@lottielab/lottie-player

Version:

Versatile Lottie animation player based on lottie-web. Supports HTML (via Web Components) and React.

1 lines 196 kB
"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e,i={exports:{}};e=i.exports,"undefined"!=typeof navigator&&(i.exports=function(){var t="http://www.w3.org/2000/svg",i="",s=!1,a=-999999,r=function(t){s=!!t},n=function(){return s},o=function(t){i=t},h=function(){return i};function l(t){return document.createElement(t)}function p(t,e){var i,s,a=t.length;for(i=0;i<a;i+=1)for(var r in s=t[i].prototype)Object.prototype.hasOwnProperty.call(s,r)&&(e.prototype[r]=s[r])}function d(t){function e(){}return e.prototype=t,e}var f=function(){function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),m=function(){function t(t,e){var i,s=0,a=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(s=0;s<e;s+=1)a.push(i);return a}function e(e,i){return"float32"===e?new Float32Array(i):"int16"===e?new Int16Array(i):"uint8c"===e?new Uint8ClampedArray(i):t(e,i)}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();function c(t){return Array.apply(null,{length:t})}var u=!0,g=null,v="",y=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=Math.pow,_=Math.sqrt,k=Math.floor,w=Math.min,S=150,A=Math.PI/180,D=.5519;function C(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function P(t,e){this.type=t,this.direction=e<0?-1:1}function T(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function E(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function F(t,e){this.type=t,this.target=e}function x(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function M(t){this.type="configError",this.nativeError=t}var I,L=(I=0,function(){return v+"__lottie_element_"+(I+=1)});function O(t,e,i){var s,a,r,n,o,h,l,p;switch(h=i*(1-e),l=i*(1-(o=6*t-(n=Math.floor(6*t)))*e),p=i*(1-(1-o)*e),n%6){case 0:s=i,a=p,r=h;break;case 1:s=l,a=i,r=h;break;case 2:s=h,a=i,r=p;break;case 3:s=h,a=l,r=i;break;case 4:s=p,a=h,r=i;break;case 5:s=i,a=h,r=l}return[s,a,r]}function R(t,e,i){var s,a=Math.max(t,e,i),r=Math.min(t,e,i),n=a-r,o=0===a?0:n/a,h=a/255;switch(a){case r:s=0;break;case t:s=e-i+n*(e<i?6:0),s/=6*n;break;case e:s=i-t+2*n,s/=6*n;break;case i:s=t-e+4*n,s/=6*n}return[s,o,h]}function V(t,e){var i=R(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),O(i[0],i[1],i[2])}function N(t,e){var i=R(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),O(i[0],i[1],i[2])}function z(t,e){var i=R(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),O(i[0],i[1],i[2])}var j=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,s){return t<0&&(t=0),e<0&&(e=0),s<0&&(s=0),"#"+i[t]+i[e]+i[s]}}(),B=function(t){u=!!t},q=function(){return u},W=function(t){g=t},$=function(){return g},H=function(t){S=t},G=function(){return S},X=function(t){v=t};function U(e){return document.createElementNS(t,e)}function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}var Z=function(){var t,e,i=1,s=[],a={onmessage:function(){},postMessage:function(e){t({data:e})}},r={postMessage:function(t){a.onmessage({data:t})}};function o(e){if(window.Worker&&window.Blob&&n()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),s=URL.createObjectURL(i);return new Worker(s)}return t=e,a}function h(){e||((e=o((function(t){function e(){function t(e,i){var n,o,h,l,p,d,f=e.length;for(o=0;o<f;o+=1)if("ks"in(n=e[o])&&!n.completed){if(n.completed=!0,n.hasMask){var m=n.masksProperties;for(l=m.length,h=0;h<l;h+=1)if(m[h].pt.k.i)r(m[h].pt.k);else for(d=m[h].pt.k.length,p=0;p<d;p+=1)m[h].pt.k[p].s&&r(m[h].pt.k[p].s[0]),m[h].pt.k[p].e&&r(m[h].pt.k[p].e[0])}0===n.ty?(n.layers=s(n.refId,i),t(n.layers,i)):4===n.ty?a(n.shapes):5===n.ty&&c(n)}}function e(e,i){if(e){var a=0,r=e.length;for(a=0;a<r;a+=1)1===e[a].t&&(e[a].data.layers=s(e[a].data.refId,i),t(e[a].data.layers,i))}}function i(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i];i+=1}return null}function s(t,e){var s=i(t,e);return s?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function a(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)r(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&r(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&r(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&a(t[e].it)}function r(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function n(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var o,h=function(){var t=[4,4,14];function e(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),l=(o=[4,7,99],function(t){if(t.chars&&!n(o,t.v)){var e,i=t.chars.length;for(e=0;e<i;e+=1){var s=t.chars[e];s.data&&s.data.shapes&&(a(s.data.shapes),s.data.ip=0,s.data.op=99999,s.data.st=0,s.data.sr=1,s.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}},t.chars[e].t||(s.data.shapes.push({ty:"no"}),s.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"})))}}}),p=function(){var t=[5,7,15];function e(t){var e=t.t.p;"number"==typeof e.a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r&&(e.r={a:0,k:e.r})}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),d=function(){var t=[4,1,9];function e(t){var i,s,a,r=t.length;for(i=0;i<r;i+=1)if("gr"===t[i].ty)e(t[i].it);else if("fl"===t[i].ty||"st"===t[i].ty)if(t[i].c.k&&t[i].c.k[0].i)for(a=t[i].c.k.length,s=0;s<a;s+=1)t[i].c.k[s].s&&(t[i].c.k[s].s[0]/=255,t[i].c.k[s].s[1]/=255,t[i].c.k[s].s[2]/=255,t[i].c.k[s].s[3]/=255),t[i].c.k[s].e&&(t[i].c.k[s].e[0]/=255,t[i].c.k[s].e[1]/=255,t[i].c.k[s].e[2]/=255,t[i].c.k[s].e[3]/=255);else t[i].c.k[0]/=255,t[i].c.k[1]/=255,t[i].c.k[2]/=255,t[i].c.k[3]/=255}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)4===t[i].ty&&e(t[i].shapes)}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),f=function(){var t=[4,4,18];function e(t){var i,s,a;for(i=t.length-1;i>=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(a=t[i].ks.k.length,s=0;s<a;s+=1)t[i].ks.k[s].s&&(t[i].ks.k[s].s[0].c=t[i].closed),t[i].ks.k[s].e&&(t[i].ks.k[s].e[0].c=t[i].closed);else"gr"===t[i].ty&&e(t[i].it)}function i(t){var i,s,a,r,n,o,h=t.length;for(s=0;s<h;s+=1){if((i=t[s]).hasMask){var l=i.masksProperties;for(r=l.length,a=0;a<r;a+=1)if(l[a].pt.k.i)l[a].pt.k.c=l[a].cl;else for(o=l[a].pt.k.length,n=0;n<o;n+=1)l[a].pt.k[n].s&&(l[a].pt.k[n].s[0].c=l[a].cl),l[a].pt.k[n].e&&(l[a].pt.k[n].e[0].c=l[a].cl)}4===i.ty&&e(i.shapes)}}return function(e){if(n(t,e.v)&&(i(e.layers),e.assets)){var s,a=e.assets.length;for(s=0;s<a;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}();function m(i){i.__complete||(d(i),h(i),l(i),p(i),f(i),t(i.layers,i.assets),e(i.chars,i.assets),i.__complete=!0)}function c(t){0===t.t.a.length&&t.t.p}var u={};return u.completeData=m,u.checkColors=d,u.checkChars=l,u.checkPathProperties=p,u.checkShapes=f,u.completeLayers=t,u}if(r.dataManager||(r.dataManager=e()),r.assetLoader||(r.assetLoader=function(){function t(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===Y(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function e(e,i,s,a){var r,n=new XMLHttpRequest;try{n.responseType="json"}catch(t){}n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status)r=t(n),s(r);else try{r=t(n),s(r)}catch(t){a&&a(t)}};try{n.open(["G","E","T"].join(""),e,!0)}catch(t){n.open(["G","E","T"].join(""),i+"/"+e,!0)}n.send()}return{load:e}}()),"loadAnimation"===t.data.type)r.assetLoader.load(t.data.path,t.data.fullPath,(function(e){r.dataManager.completeData(e),r.postMessage({id:t.data.id,payload:e,status:"success"})}),(function(){r.postMessage({id:t.data.id,status:"error"})}));else if("complete"===t.data.type){var i=t.data.animation;r.dataManager.completeData(i),r.postMessage({id:t.data.id,payload:i,status:"success"})}else"loadData"===t.data.type&&r.assetLoader.load(t.data.path,t.data.fullPath,(function(e){r.postMessage({id:t.data.id,payload:e,status:"success"})}),(function(){r.postMessage({id:t.data.id,status:"error"})}))}))).onmessage=function(t){var e=t.data,i=e.id,a=s[i];s[i]=null,"success"===e.status?a.onComplete(e.payload):a.onError&&a.onError()})}function l(t,e){var a="processId_"+(i+=1);return s[a]={onComplete:t,onError:e},a}function p(t,i,s){h();var a=l(i,s);e.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:a})}function d(t,i,s){h();var a=l(i,s);e.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:a})}function f(t,i,s){h();var a=l(i,s);e.postMessage({type:"complete",animation:t,id:a})}return{loadAnimation:p,loadData:d,completeAnimation:f}}(),J=function(){var t=function(){var t=l("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.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 s(t,e,i){var s="";if(t.e)s=t.p;else if(e){var a=t.p;-1!==a.indexOf("images/")&&(a=a.split("/")[1]),s=e+a}else s=i,s+=t.u?t.u:"",s+=t.p;return s}function a(t){var e=0,i=setInterval(function(){(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function r(e){var i=s(e,this.assetsPath,this.path),a=U("image");y?this.testImageLoaded(a):a.addEventListener("load",this._imageLoaded,!1),a.addEventListener("error",function(){r.img=t,this._imageLoaded()}.bind(this),!1),a.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(a):this._elementHelper.appendChild(a);var r={img:a,assetData:e};return r}function n(e){var i=s(e,this.assetsPath,this.path),a=l("img");a.crossOrigin="anonymous",a.addEventListener("load",this._imageLoaded,!1),a.addEventListener("error",function(){r.img=t,this._imageLoaded()}.bind(this),!1),a.src=i;var r={img:a,assetData:e};return r}function o(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return Z.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function h(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i<s;i+=1)t[i].layers||(t[i].t&&"seq"!==t[i].t?3===t[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[i]))):(this.totalImages+=1,this.images.push(this._createImageData(t[i]))))}function p(t){this.path=t||""}function d(t){this.assetsPath=t||""}function f(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null}function m(){this.imagesLoadedCb=null,this.images.length=0}function c(){return this.totalImages===this.loadedAssets}function u(){return this.totalFootages===this.loadedFootagesCount}function g(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function v(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=a.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return v.prototype={loadAssets:h,setAssetsPath:d,setPath:p,loadedImages:c,loadedFootages:u,destroy:m,getAsset:f,createImgData:n,createImageData:r,imageLoaded:e,footageLoaded:i,setCacheType:g},v}();function K(){}K.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s<i.length;s+=1)i[s](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var i=0,s=this._cbs[t].length;i<s;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,s-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var Q=function(){function t(t){for(var e,i=t.split("\r\n"),s={},a=0,r=0;r<i.length;r+=1)2===(e=i[r].split(":")).length&&(s[e[0]]=e[1].trim(),a+=1);if(0===a)throw new Error;return s}return function(e){for(var i=[],s=0;s<e.length;s+=1){var a=e[s],r={time:a.tm,duration:a.dr};try{r.payload=JSON.parse(e[s].cm)}catch(i){try{r.payload=t(e[s].cm)}catch(t){r.payload={name:e[s].cm}}}i.push(r)}return i}}(),tt=function(){function t(t){this.compositions.push(t)}return function(){function e(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),et={},it=function(t,e){et[t]=e};function st(t){return et[t]}function at(){if(et.canvas)return"canvas";for(var t in et)if(et[t])return t;return""}function rt(t){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(t)}var nt=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=L(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=q(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=tt(),this.imagePreloader=new J,this.audioController=f(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new C("drawnFrame",0,0,0),this.expressionsPlugin=$()};p([K],nt),nt.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=st(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||null===t.loop||void 0===t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name?t.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),Z.loadAnimation(t.path,this.configAnimation,this.onSetupError))},nt.prototype.onSetupError=function(){this.trigger("data_failed")},nt.prototype.setupAnimation=function(t){Z.completeAnimation(t,this.configAnimation)},nt.prototype.setData=function(t,e){e&&"object"!==rt(e)&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:at()||"canvas";var a=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";"false"===a?i.loop=!1:"true"===a?i.loop=!0:""!==a&&(i.loop=parseInt(a,10));var r=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:!s.getNamedItem("bm-autoplay")||s.getNamedItem("bm-autoplay").value;i.autoplay="false"!==r,i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"","false"===(s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},nt.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,a=s.length,r=t.layers,n=r.length;for(i=0;i<n;i+=1)for(e=0;e<a;){if(s[e].id===r[i].id){s[e]=r[i];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(a=t.assets.length,e=0;e<a;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,Z.completeAnimation(this.animationData,this.onSegmentComplete)},nt.prototype.onSegmentComplete=function(t){this.animationData=t;var e=$();e&&e.initExpressions(this),this.loadNextSegment()},nt.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,Z.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},nt.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},nt.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},nt.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},nt.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=Q(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},nt.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},nt.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=$();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},nt.prototype.resize=function(t,e){var i="number"==typeof t?t:void 0,s="number"==typeof e?e:void 0;this.renderer.updateContainerSize(i,s)},nt.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},nt.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")},nt.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},nt.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},nt.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},nt.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},nt.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},nt.prototype.getMarkerData=function(t){for(var e,i=0;i<this.markers.length;i+=1)if((e=this.markers[i]).payload&&e.payload.name===t)return e;return null},nt.prototype.goToAndStop=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var a=this.getMarkerData(t);a&&this.goToAndStop(a.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},nt.prototype.goToAndPlay=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){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(s,e,i);this.play()}},nt.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},nt.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")},nt.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,-1!==i&&this.goToAndStop(i,!0)},nt.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===rt(t[0])){var i,s=t.length;for(i=0;i<s;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()},nt.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},nt.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},nt.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)},nt.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},nt.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},nt.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},nt.prototype.setLoop=function(t){this.loop=t},nt.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},nt.prototype.getVolume=function(){return this.audioController.getVolume()},nt.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},nt.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},nt.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},nt.prototype.getPath=function(){return this.path},nt.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},nt.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},nt.prototype.hide=function(){this.renderer.hide()},nt.prototype.show=function(){this.renderer.show()},nt.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},nt.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(t){}},nt.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new C(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 T(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new P(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new E(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new F(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new C(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new T(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new P(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new E(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new F(t,this))},nt.prototype.triggerRenderFrameError=function(t){var e=new x(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},nt.prototype.triggerConfigError=function(t){var e=new M(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var ot=function(){var t={},e=[],i=0,s=0,a=0,r=!0,n=!1;function o(t){for(var i=0,a=t.target;i<s;)e[i].animation===a&&(e.splice(i,1),i-=1,s-=1,a.isPaused||f()),i+=1}function h(t,i){if(!t)return null;for(var a=0;a<s;){if(e[a].elem===t&&null!==e[a].elem)return e[a].animation;a+=1}var r=new nt;return m(r,t),r.setData(t,i),r}function p(){var t,i=e.length,s=[];for(t=0;t<i;t+=1)s.push(e[t].animation);return s}function d(){a+=1,P()}function f(){a-=1}function m(t,i){t.addEventListener("destroy",o),t.addEventListener("_active",d),t.addEventListener("_idle",f),e.push({elem:i,animation:t}),s+=1}function c(t){var e=new nt;return m(e,null),e.setParams(t),e}function u(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setSpeed(t,i)}function g(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setDirection(t,i)}function v(t){var i;for(i=0;i<s;i+=1)e[i].animation.play(t)}function y(t){var o,h=t-i;for(o=0;o<s;o+=1)e[o].animation.advanceTime(h);i=t,a&&!n?window.requestAnimationFrame(y):r=!0}function b(t){i=t,window.requestAnimationFrame(y)}function _(t){var i;for(i=0;i<s;i+=1)e[i].animation.pause(t)}function k(t,i,a){var r;for(r=0;r<s;r+=1)e[r].animation.goToAndStop(t,i,a)}function w(t){var i;for(i=0;i<s;i+=1)e[i].animation.stop(t)}function S(t){var i;for(i=0;i<s;i+=1)e[i].animation.togglePause(t)}function A(t){var i;for(i=s-1;i>=0;i-=1)e[i].animation.destroy(t)}function D(t,e,i){var s,a=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),r=a.length;for(s=0;s<r;s+=1)i&&a[s].setAttribute("data-bm-type",i),h(a[s],t);if(e&&0===r){i||(i="svg");var n=document.getElementsByTagName("body")[0];n.innerText="";var o=l("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),n.appendChild(o),h(o,t)}}function C(){var t;for(t=0;t<s;t+=1)e[t].animation.resize()}function P(){!n&&a&&r&&(window.requestAnimationFrame(b),r=!1)}function T(){n=!0}function E(){n=!1,P()}function F(t,i){var a;for(a=0;a<s;a+=1)e[a].animation.setVolume(t,i)}function x(t){var i;for(i=0;i<s;i+=1)e[i].animation.mute(t)}function M(t){var i;for(i=0;i<s;i+=1)e[i].animation.unmute(t)}return t.registerAnimation=h,t.loadAnimation=c,t.setSpeed=u,t.setDirection=g,t.play=v,t.pause=_,t.stop=w,t.togglePause=S,t.searchAnimations=D,t.resize=C,t.goToAndStop=k,t.destroy=A,t.freeze=T,t.unfreeze=E,t.setVolume=F,t.mute=x,t.unmute=M,t.getRegisteredAnimations=p,t}(),ht=function(){var t={};t.getBezierEasing=i;var e={};function i(t,i,s,a,r){var n=r||("bez_"+t+"_"+i+"_"+s+"_"+a).replace(/\./g,"p");if(e[n])return e[n];var o=new v([t,i,s,a]);return e[n]=o,o}var s=4,a=.001,r=1e-7,n=10,o=11,h=1/(o-1),l="function"==typeof Float32Array;function p(t,e){return 1-3*e+3*t}function d(t,e){return 3*e-6*t}function f(t){return 3*t}function m(t,e,i){return((p(e,i)*t+d(e,i))*t+f(e))*t}function c(t,e,i){return 3*p(e,i)*t*t+2*d(e,i)*t+f(e)}function u(t,e,i,s,a){var o,h,l=0;do{(o=m(h=e+(i-e)/2,s,a)-t)>0?i=h:e=h}while(Math.abs(o)>r&&++l<n);return h}function g(t,e,i,a){for(var r=0;r<s;++r){var n=c(e,i,a);if(0===n)return e;e-=(m(e,i,a)-t)/n}return e}function v(t){this._p=t,this._mSampleValues=l?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return v.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],a=this._p[3];return this._precomputed||this._precompute(),e===i&&s===a?t:0===t?0:1===t?1:m(this._getTForX(t),i,a)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<o;++i)this._mSampleValues[i]=m(i*h,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],s=this._mSampleValues,r=0,n=1,l=o-1;n!==l&&s[n]<=t;++n)r+=h;var p=r+(t-s[--n])/(s[n+1]-s[n])*h,d=c(p,e,i);return d>=a?g(t,p,e,i):0===d?p:u(t,r,r+h,e,i)}},t}(),lt=function(){function t(t){return t.concat(c(t.length))}return{double:t}}(),pt=function(t,e,i){var s=0,a=t,r=c(a);function n(){return s?r[s-=1]:e()}function o(t){s===a&&(r=lt.double(r),a*=2),i&&i(t),r[s]=t,s+=1}return{newElement:n,release:o}},dt=function(){function t(){return{addedLength:0,percents:m("float32",G()),lengths:m("float32",G())}}return pt(8,t)}(),ft=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)dt.release(t.lengths[e]);t.lengths.length=0}return pt(8,t,e)}();function mt(){var t=Math;function e(t,e,i,s,a,r){var n=t*s+e*a+i*r-a*s-r*t-i*e;return n>-.001&&n<.001}function i(i,s,a,r,n,o,h,l,p){if(0===a&&0===o&&0===p)return e(i,s,r,n,h,l);var d,f=t.sqrt(t.pow(r-i,2)+t.pow(n-s,2)+t.pow(o-a,2)),m=t.sqrt(t.pow(h-i,2)+t.pow(l-s,2)+t.pow(p-a,2)),c=t.sqrt(t.pow(h-r,2)+t.pow(l-n,2)+t.pow(p-o,2));return(d=f>m?f>c?f-m-c:c-m-f:c>m?c-m-f:m-f-c)>-1e-4&&d<1e-4}var s=function(t,e,i,s){var a,r,n,o,h,l,p=G(),d=0,f=[],m=[],c=dt.newElement();for(n=i.length,a=0;a<p;a+=1){for(h=a/(p-1),l=0,r=0;r<n;r+=1)o=b(1-h,3)*t[r]+3*b(1-h,2)*h*i[r]+3*(1-h)*b(h,2)*s[r]+b(h,3)*e[r],f[r]=o,null!==m[r]&&(l+=b(f[r]-m[r],2)),m[r]=f[r];l&&(d+=l=_(l)),c.percents[a]=h,c.lengths[a]=d}return c.addedLength=d,c};function a(t){var e,i=ft.newElement(),a=t.c,r=t.v,n=t.o,o=t.i,h=t._length,l=i.lengths,p=0;for(e=0;e<h-1;e+=1)l[e]=s(r[e],r[e+1],n[e],o[e+1]),p+=l[e].addedLength;return a&&h&&(l[e]=s(r[e],r[0],n[e],o[0]),p+=l[e].addedLength),i.totalLength=p,i}function r(t){this.segmentLength=0,this.points=new Array(t)}function n(t,e){this.partialLength=t,this.point=e}var o,h=(o={},function(t,i,s,a){var h=(t[0]+"_"+t[1]+"_"+i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]+"_"+a[0]+"_"+a[1]).replace(/\./g,"p");if(!o[h]){var l,p,d,f,m,u,g,v=G(),y=0,k=null;2===t.length&&(t[0]!==i[0]||t[1]!==i[1])&&e(t[0],t[1],i[0],i[1],t[0]+s[0],t[1]+s[1])&&e(t[0],t[1],i[0],i[1],i[0]+a[0],i[1]+a[1])&&(v=2);var w=new r(v);for(d=s.length,l=0;l<v;l+=1){for(g=c(d),m=l/(v-1),u=0,p=0;p<d;p+=1)f=b(1-m,3)*t[p]+3*b(1-m,2)*m*(t[p]+s[p])+3*(1-m)*b(m,2)*(i[p]+a[p])+b(m,3)*i[p],g[p]=f,null!==k&&(u+=b(g[p]-k[p],2));y+=u=_(u),w.points[l]=new n(u,g),k=g}w.segmentLength=y,o[h]=w}return o[h]});function l(t,e){var i=e.percents,s=e.lengths,a=i.length,r=k((a-1)*t),n=t*e.addedLength,o=0;if(r===a-1||0===r||n===s[r])return i[r];for(var h=s[r]>n?-1:1,l=!0;l;)if(s[r]<=n&&s[r+1]>n?(o=(n-s[r])/(s[r+1]-s[r]),l=!1):r+=h,r<0||r>=a-1){if(r===a-1)return i[r];l=!1}return i[r]+(i[r+1]-i[r])*o}function p(e,i,s,a,r,n){var o=l(r,n),h=1-o;return[t.round(1e3*(h*h*h*e[0]+(o*h*h+h*o*h+h*h*o)*s[0]+(o*o*h+h*o*o+o*h*o)*a[0]+o*o*o*i[0]))/1e3,t.round(1e3*(h*h*h*e[1]+(o*h*h+h*o*h+h*h*o)*s[1]+(o*o*h+h*o*o+o*h*o)*a[1]+o*o*o*i[1]))/1e3]}var d=m("float32",8);function f(e,i,s,a,r,n,o){r<0?r=0:r>1&&(r=1);var h,p=l(r,o),f=l(n=n>1?1:n,o),m=e.length,c=1-p,u=1-f,g=c*c*c,v=p*c*c*3,y=p*p*c*3,b=p*p*p,_=c*c*u,k=p*c*u+c*p*u+c*c*f,w=p*p*u+c*p*f+p*c*f,S=p*p*f,A=c*u*u,D=p*u*u+c*f*u+c*u*f,C=p*f*u+c*f*f+p*u*f,P=p*f*f,T=u*u*u,E=f*u*u+u*f*u+u*u*f,F=f*f*u+u*f*f+f*u*f,x=f*f*f;for(h=0;h<m;h+=1)d[4*h]=t.round(1e3*(g*e[h]+v*s[h]+y*a[h]+b*i[h]))/1e3,d[4*h+1]=t.round(1e3*(_*e[h]+k*s[h]+w*a[h]+S*i[h]))/1e3,d[4*h+2]=t.round(1e3*(A*e[h]+D*s[h]+C*a[h]+P*i[h]))/1e3,d[4*h+3]=t.round(1e3*(T*e[h]+E*s[h]+F*a[h]+x*i[h]))/1e3;return d}return{getSegmentsLength:a,getNewSegment:f,getPointInSegment:p,buildBezierData:h,pointOnLine2D:e,pointOnLine3D:i}}var ct=mt();function ut(t){return bt(t)||yt(t)||vt(t)||gt()}function gt(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vt(t,e){if(t){if("string"==typeof t)return _t(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_t(t,e):void 0}}function yt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function bt(t){if(Array.isArray(t))return _t(t)}function _t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}function kt(t,e,i){return t*(1-i)+e*i}function wt(t,e,i){return[kt(t[0],e[0],i),kt(t[1],e[1],i)]}function St(t,e){return t.map((function(t,i){return t+(e[i]||0)}))}function At(t,e){return t.map((function(t,i){return t-(e[i]||0)}))}function Dt(t){var e=Math.hypot.apply(Math,ut(t));return e>Number.EPSILON?t.map((function(t){return t/e})):t}function Ct(t,e,i,s,a){var r=[t,St(t,e),St(s,i),s],n=Pt(r,a),o=Pt(n,a),h=At(o[1],o[0]),l=Math.hypot.apply(Math,ut(h));if(l>Number.EPSILON)return h.map((function(t){return t/l}));var p=At(n[2],n[0]),d=Math.hypot.apply(Math,ut(p));if(d>Number.EPSILON)return p.map((function(t){return t/d}));var f=At(n[1],n[0]),m=Math.hypot.apply(Math,ut(f));return m>Number.EPSILON?f.map((function(t){return t/m})):Dt(At(r[3],r[0]))}function Pt(t,e){for(var i=[],s=0;s<t.length-1;s+=1)i.push(wt(t[s],t[s+1],e));return i}var Tt=a,Et=Math.abs;function Ft(t,e){var i,s=this.offsetTime;"multidimensional"===this.propType&&(i=m("float32",this.pv.length));for(var a,r,n,o,h,l,p,d,f,c=e.lastIndex,u=c,g=this.keyframes.length-1,v=!0;v;){if(a=this.keyframes[u],r=this.keyframes[u+1],u===g-1&&t>=r.t-s){a.h&&(a=r),c=0;break}if(r.t-s>t){c=u;break}u<g-1?u+=1:(c=0,v=!1)}n=this.keyframesMetadata[u]||{};var y,b=r.t-s,_=a.t-s;if(a.to){n.bezierData||(n.bezierData=ct.buildBezierData(a.s,r.s||a.e,a.to,a.ti));var k=n.bezierData;if(t>=b||t<_){var w=t>=b?k.points.length-1:0;for(h=k.points[w].point.length,o=0;o<h;o+=1)i[o]=k.points[w].point[o]}else{n.__fnct?f=n.__fnct:(f=ht.getBezierEasing(a.o.x,a.o.y,a.i.x,a.i.y,a.n).get,n.__fnct=f),l=f((t-_)/(b-_));var S=a.s,A=r.s||a.e;if(l>1)for(var D=Ct(a.s,a.to,a.ti,r.s||a.e,1),C=k.segmentLength*(l-1),P=0;P<A.length;P+=1)i[P]=A[P]+D[P]*C;else if(l<0)for(var T=Ct(a.s,a.to,a.ti,r.s||a.e,0),E=k.segmentLength*l,F=0;F<S.length;F+=1)i[F]=S[F]+T[F]*E;else{var x,M=k.segmentLength*l,I=e.lastFrame<t&&e._lastKeyframeIndex===u?e._lastAddedLength:0;for(d=e.lastFrame<t&&e._lastKeyframeIndex===u?e._lastPoint:0,v=!0,p=k.points.length;v;){if(I+=k.points[d].partialLength,0===M||0===l||d===k.points.length-1){for(h=k.points[d].point.length,o=0;o<h;o+=1)i[o]=k.points[d].point[o];break}if(M>=I&&M<I+k.points[d+1].partialLength){for(x=(M-I)/k.points[d+1].partialLength,h=k.points[d].point.length,o=0;o<h;o+=1)i[o]=k.points[d].point[o]+(k.points[d+1].point[o]-k.points[d].point[o])*x;break}d<p-1?d+=1:v=!1}e._lastPoint=d,e._lastAddedLength=I-k.points[d].partialLength,e._lastKeyframeIndex=u}}}else{var L,O,R,V,N;if(g=a.s.length,y=r.s||a.e,this.sh&&1!==a.h)t>=b?(i[0]=y[0],i[1]=y[1],i[2]=y[2]):t<=_?(i[0]=a.s[0],i[1]=a.s[1],i[2]=a.s[2]):Mt(i,xt(It(a.s),It(y),(t-_)/(b-_)));else for(u=0;u<g;u+=1)1!==a.h&&(t>=b?l=1:t<_?l=0:(a.o.x.constructor===Array?(n.__fnct||(n.__fnct=[]),n.__fnct[u]?f=n.__fnct[u]:(L=void 0===a.o.x[u]?a.o.x[0]:a.o.x[u],O=void 0===a.o.y[u]?a.o.y[0]:a.o.y[u],R=void 0===a.i.x[u]?a.i.x[0]:a.i.x[u],V=void 0===a.i.y[u]?a.i.y[0]:a.i.y[u],f=ht.getBezierEasing(L,O,R,V).get,n.__fnct[u]=f)):n.__fnct?f=n.__fnct:(L=a.o.x,O=a.o.y,R=a.i.x,V=a.i.y,f=ht.getBezierEasing(L,O,R,V).get,a.keyframeMetadata=f),l=f((t-_)/(b-_)))),y=r.s||a.e,N=1===a.h?a.s[u]:a.s[u]+(y[u]-a.s[u])*l,"multidimensional"===this.propType?i[u]=N:i=N}return e.lastIndex=c,i}function xt(t,e,i){var s,a,r,n,o,h=[],l=t[0],p=t[1],d=t[2],f=t[3],m=e[0],c=e[1],u=e[2],g=e[3];return(a=l*m+p*c+d*u+f*g)<0&&(a=-a,m=-m,c=-c,u=-u,g=-g),1-a>1e-6?(s=Math.acos(a),r=Math.sin(s),n=Math.sin((1-i)*s)/r,o=Math.sin(i*s)/r):(n=1-i,o=i),h[0]=n*l+o*m,h[1]=n*p+o*c,h[2]=n*d+o*u,h[3]=n*f+o*g,h}function Mt(t,e){var i=e[0],s=e[1],a=e[2],r=e[3],n=Math.atan2(2*s*r-2*i*a,1-2*s*s-2*a*a),o=Math.asin(2*i*s+2*a*r),h=Math.atan2(2*i*r-2*s*a,1-2*i*i-2*a*a);t[0]=n/A,t[1]=o/A,t[2]=h/A}function It(t){var e=t[0]*A,i=t[1]*A,s=t[2]*A,a=Math.cos(e/2),r=Math.cos(i/2),n=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(s/2);return[o*h*n+a*r*l,o*r*n+a*h*l,a*h*n-o*r*l,a*r*n-o*h*l]}function Lt(){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!==Tt&&(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 s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function Ot(t){var e;if("unidimensional"===this.propType)e=t*this.mult,Et(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,Et(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function Rt(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function Vt(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function Nt(t,e,i,s){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=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=Rt,this.setVValue=Ot,this.addEffect=Vt}function zt(t,e,i,s){var a;this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var r=e.k.length;for(this.v=m("float32",r),this.pv=m("float32",r),this.vel=m("float32",r),a=0;a<r;a+=1)this.v[a]=e.k[a]*this.mult,this.pv[a]=e.k[a];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=Rt,this.setVValue=Ot,this.addEffect=Vt}function jt(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:Tt,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.v=Tt,this.pv=Tt,this._isFirstFrame=!0,this.getValue=Rt,this.setVValue=Ot,this.interpolateValue=Ft,this.effectsSequence=[Lt.bind(this)],this.addEffect=Vt}function Bt(t,e,i,s){var a;this.propType="multidimensional";var r,n,o,h,l=e.k.length;for(a=0;a<l-1;a+=1)e.k[a].to&&e.k[a].s&&e.k[a+1]&&e.k[a+1].s&&(r=e.k[a].s,n=e.k[a+1].s,o=e.k[a].to,h=e.k[a].ti,(2===r.length&&(r[0]!==n[0]||r[1]!==n[1])&&ct.pointOnLine2D(r[0],r[1],n[0],n[1],r[0]+o[0],r[1]+o[1])&&ct.pointOnLine2D(r[0],r[1],n[0],n[1],n[0]+h[0],n[1]+h[1])||3===r.length&&(r[0]!==n[0]||r[1]!==n[1]||r[2]!==n[2])&&ct.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],r[0]+o[0],r[1]+o[1],r[2]+o[2])&&ct.pointOnLine3D(r[0],r[1],r[2],n[0],n[1],n[2],n[0]+h[0],n[1]+h[1],n[2]+h[2]))&&(e.k[a].to=null,e.k[a].ti=null),r[0]===n[0]&&r[1]===n[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===r.length||r[2]===n[2]&&0===o[2]&&0===h[2])&&(e.k[a].to=null,e.k[a].ti=null));this.effectsSequence=[Lt.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=s,this.comp=t.comp,this.getValue=Rt,this.setVValue=Ot,this.interpolateValue=Ft,this.frameId=-1;var p=e.k[0].s.length;for(this.v=m("float32",p),this.pv=m("float32",p),a=0;a<p;a+=1)this.v[a]=Tt,this.pv[a]=Tt;this._caching={lastFrame:Tt,lastIndex:0,value:m("float32",p)},this.addEffect=Vt}var qt=function(){function t(t,e,i,s,a){var r;if(e.sid&&(e=t.globalData.slotManager.getProp(e)),e.k.length)if("number"==typeof e.k[0])r=new zt(t,e,s,a);else switch(i){case 0:r=new jt(t,e,s,a);break;case 1:r=new Bt(t,e,s,a)}else r=new Nt(t,e,s,a);return r.effectsSequence.length&&a.addDynamicProperty(r),r}return{getProp:t}}();function Wt(){}Wt.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var $t=function(){function t(){return m("float32",2)}return pt(8,t)}();function Ht(){this.c=!1,this._length=0,this._maxLength=8,this.v=c(this._maxLength),this.o=c(this._maxLength),this.i=c(this._maxLength)}Ht.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=$t.newElement(),this.o[i]=$t.newElement(),this.i[i]=$t.newElement(),i+=1},Ht.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},Ht.prototype.doubleArrayLength=function(){this.v=this.v.concat(c(this._maxLength)),this.i=this.i.concat(c(this._maxLength)),this.o=this.o.concat(c(this._maxLength)),this._maxLength*=2},Ht.prototype.setXYAt=function(t,e,i,s,a){var r;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":r=this.v;break;case"i":r=this.i;break;case"o":r=this.o;break;default:r=[]}(!r[s]||r[s]&&!a)&&(r[s]=$t.newElement()),r[s][0]=t,r[s][1]=e},Ht.prototype.setTripleAt=function(t,e,i,s,a,r,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,s,"o",n,o),this.setXYAt(a,r,"i",n,o)},Ht.prototype.reverse=function(){var t=new Ht;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,a=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),a=1);var r,n=this._length-1,o=this._length;for(r=a;r<o;r+=1)t.setTripleAt(e[n][0],e[n][1],s[n][0],s[n][1],i[n][0],i[n][1],r,!1),n-=1;return t},Ht.prototype.length=function(){return this._length};var Gt=function(){function t(){return new Ht}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)$t.release(t.v[e]),$t.release(t.i[e]),$t.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function i(t){var e,i=s.newElement(),a=void 0===t._length?t.v.length:t._length;for(i.setLength(a),i.c=t.c,e=0;e<a;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i}var s=pt(4,t,e);return s.clone=i,s}();function Xt(){this._length=0,this._maxLength=4,this.shapes=c(this._maxLength)}Xt.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(c(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Xt.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)Gt.release(this.shapes[t]);this._length=0};var Ut=function(){var t={newShapeCollection:a,release:r},e=0,i=4,s=c(i);function a(){return e?s[e-=1]:new Xt}function r(t){var a,r=t._length;for(a=0;a<r;a+=1)Gt.release(t.shapes[a]);t._length=0,e===i&&(s=lt.double(s),i*=2),s[e]=t,e+=1}return t}(),Yt=function(){var t=-999999;function e(t,e,i){var s,a,r,n,o,h,l,p,d,f=i.lastIndex,m=this.keyframes;if(t<m[0].t-this.offsetTime)s=m[0].s[0],r=!0,f=0;else if(t>=m[m.length-1].t-this.offsetTime)s=m[m.length-1].s?m[m.length-1].s[0]:m[m.length-2].e[0],r=!0;else{for(var c,u,g,v=f,y=m.length-1,b=!0;b&&(c=m[v],!((u=m[v+1]).t-this.offsetTime>t));)v<y-1?v+=1:b=!1;if(g=this.keyframesMetadata[v]||{},f=v,!(r=1===c.h)){if(t>=u.t-this.offsetTime)p=1;else if(t<c.t-this.offsetTime)p=0;else{var _;g.__fnct?_=g.__fnct:(_=ht.getBezierEasing(c.o.x,c.o.y,c.i.x,c.i.y).get,g.__fnct=_),p=_((t-(c.t-this.offsetTime))/(u.t-this.offsetTime-(c.t-this.offsetTime)))}a=u.s?u.s[0]:c.e[0]}s=c.s[0]}for(h=e._length,l=s.i[0].length,i.lastIndex=f,n=0;n<h;n+=1)for(o=0;o<l;o+=1)d=r?s.i[n][o]:s.i[n][o]+(a.i[n][o]-s.i[n][o])*p,e.i[n][o]=d,d=r?s.o[n][o]:s.o[n][o]+(a.o[n][o]-s.o[n][o])*p,e.o[n][o]=d,d=r?s.v[n][o]:s.v[n][o]+(a.v[n][o]-s.v[n][o])*p,