@lottiefiles/dotlottie-web 0.29.2 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * This is a worker script for dotlottie.
5
- * Do not modify this file directly.
6
- * As it's generated by the build process.
7
- */
8
-
9
- var y=Object.defineProperty;var w=(r,e,t)=>e in r?y(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e,t)=>w(r,typeof e!="symbol"?e+"":e,t);var p=typeof window<"u"&&typeof window.document<"u";var c=class{constructor(){a(this,"_eventListeners",new Map);}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t);}removeEventListener(e,t){let n=this._eventListeners.get(e);n&&(t?(n.delete(t),n.size===0&&this._eventListeners.delete(e)):this._eventListeners.delete(e));}dispatch(e){this._eventListeners.get(e.type)?.forEach(n=>n(e));}removeAllEventListeners(){this._eventListeners.clear();}};var m='/**\n * This is a worker script for dotlottie.\n * Do not modify this file directly.\n * As it\'s generated by the build process.\n */\n \nvar $n=Object.defineProperty;var kn=(s,n,r)=>n in s?$n(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r;var I=(s,n,r)=>kn(s,typeof n!="symbol"?n+"":n,r);var Xe=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Ze=class{constructor(){I(this,"_lastHandleId",0);I(this,"_lastImmediate",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Ie=class{constructor(){I(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new Xe:new Ze;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var te=typeof window<"u"&&typeof window.document<"u";var xe=new Uint8Array([80,75,3,4]),jt=["v","ip","op","layers","fr","w","h"];var fe={name:"@lottiefiles/dotlottie-web",version:"0.29.2",type:"module",description:"Lottie and DotLottie player for the web",repository:{type:"git",url:"git+https://github.com/LottieFiles/dotlottie-web.git",directory:"packages/web"},homepage:"https://github.com/LottieFiles/dotlottie-web#readme",bugs:"https://github.com/LottieFiles/dotlottie-web/issues",author:"LottieFiles",contributors:["Abdelrahman Ashraf <a.theashraf@gmail.com>"],license:"MIT",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",files:["dist"],keywords:["dotlottie","lottie","player","animation","web","canvas","javascript","thorvg"],scripts:{build:"tsup",dev:"tsup --watch",lint:"eslint --fix .","stats:eslint":"cross-env TIMING=1 eslint .","stats:ts":"tsc -p tsconfig.build.json --extendedDiagnostics",test:"vitest run --browser.headless","test:coverage":"vitest run --browser.headless --coverage","test:watch":"vitest","type-check":"tsc --noEmit"},devDependencies:{"@types/node":"^20.14.11","@vitest/browser":"^2.0.3","@vitest/coverage-istanbul":"^2.0.3","cross-env":"7.0.3",playwright:"^1.45.2",tsup:"8.1.0",typescript:"5.0.4",vitest:"^2.0.3"},publishConfig:{access:"public"}};var On=(()=>{var s=typeof document<"u"?document.currentScript?.src:void 0;return function(n={}){var r=n,c,_,$=new Promise((e,t)=>{c=e,_=t;}),U=Object.assign({},r),V="./this.program",j="";typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),s&&(j=s),j.startsWith("blob:")?j="":j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1);var Nt=r.print||console.log.bind(console),Z=r.printErr||console.error.bind(console);Object.assign(r,U),U=null,r.thisProgram&&(V=r.thisProgram);var ne;r.wasmBinary&&(ne=r.wasmBinary);var ve,at=!1,Y,b,Q,re,P,L,ot,it;function st(){var e=ve.buffer;r.HEAP8=Y=new Int8Array(e),r.HEAP16=Q=new Int16Array(e),r.HEAPU8=b=new Uint8Array(e),r.HEAPU16=re=new Uint16Array(e),r.HEAP32=P=new Int32Array(e),r.HEAPU32=L=new Uint32Array(e),r.HEAPF32=ot=new Float32Array(e),r.HEAPF64=it=new Float64Array(e);}var lt=[],dt=[],ct=[];function Vt(){var e=r.preRun.shift();lt.unshift(e);}var J=0,ae=null;function ye(e){throw r.onAbort?.(e),e="Aborted("+e+")",Z(e),at=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),_(e),e}var ut=e=>e.startsWith("data:application/octet-stream;base64,"),q;if(q="DotLottiePlayer.wasm",!ut(q)){var ht=q;q=r.locateFile?r.locateFile(ht,j):j+ht;}function pt(e){if(e==q&&ne)return new Uint8Array(ne);throw "both async and sync fetching of the wasm failed"}function Yt(e){return ne||typeof fetch!="function"?Promise.resolve().then(()=>pt(e)):fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at \'${e}\'`;return t.arrayBuffer()}).catch(()=>pt(e))}function ft(e,t,a){return Yt(e).then(o=>WebAssembly.instantiate(o,t)).then(a,o=>{Z(`failed to asynchronously prepare wasm: ${o}`),ye(o);})}function Jt(e,t){var a=q;return ne||typeof WebAssembly.instantiateStreaming!="function"||ut(a)||typeof fetch!="function"?ft(a,e,t):fetch(a,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(t,function(i){return Z(`wasm streaming compile failed: ${i}`),Z("falling back to ArrayBuffer instantiation"),ft(a,e,t)}))}var Te=e=>{for(;0<e.length;)e.shift()(r);},mt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,G=(e,t,a)=>{var o=t+a;for(a=t;e[a]&&!(a>=o);)++a;if(16<a-t&&e.buffer&&mt)return mt.decode(e.subarray(t,a));for(o="";t<a;){var i=e[t++];if(i&128){var l=e[t++]&63;if((i&224)==192)o+=String.fromCharCode((i&31)<<6|l);else {var h=e[t++]&63;i=(i&240)==224?(i&15)<<12|l<<6|h:(i&7)<<18|l<<12|h<<6|e[t++]&63,65536>i?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023));}}else o+=String.fromCharCode(i);}return o};class Gt{constructor(t){this.ya=t-24;}}var vt=0,yt=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++a):t+=3;}return t},gt=(e,t,a,o)=>{if(0<o){o=a+o-1;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(127>=l){if(a>=o)break;t[a++]=l;}else {if(2047>=l){if(a+1>=o)break;t[a++]=192|l>>6;}else {if(65535>=l){if(a+2>=o)break;t[a++]=224|l>>12;}else {if(a+3>=o)break;t[a++]=240|l>>18,t[a++]=128|l>>12&63;}t[a++]=128|l>>6&63;}t[a++]=128|l&63;}}t[a]=0;}},ge={},Se=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function oe(e){return this.fromWireType(L[e>>2])}var ee={},K={},we={},ie,H=(e,t,a)=>{function o(u){if(u=a(u),u.length!==e.length)throw new ie("Mismatched type converter count");for(var f=0;f<e.length;++f)k(e[f],u[f]);}e.forEach(function(u){we[u]=t;});var i=Array(t.length),l=[],h=0;t.forEach((u,f)=>{K.hasOwnProperty(u)?i[f]=K[u]:(l.push(u),ee.hasOwnProperty(u)||(ee[u]=[]),ee[u].push(()=>{i[f]=K[u],++h,h===l.length&&o(i);}));}),l.length===0&&o(i);},wt,A=e=>{for(var t="";b[e];)t+=wt[b[e++]];return t},g;function Xt(e,t,a={}){var o=t.name;if(!e)throw new g(`type "${o}" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(a.ib)return;throw new g(`Cannot register type \'${o}\' twice`)}K[e]=t,delete we[e],ee.hasOwnProperty(e)&&(t=ee[e],delete ee[e],t.forEach(i=>i()));}function k(e,t,a={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Xt(e,t,a)}var Re=e=>{throw new g(e.ma.za.xa.name+" instance already deleted")},$e=!1,_t=()=>{},Et=(e,t,a)=>t===a?e:a.Ca===void 0?null:(e=Et(e,t,a.Ca),e===null?null:a.ab(e)),Ct={},se=[],ke=()=>{for(;se.length;){var e=se.pop();e.ma.Ka=!1,e.delete();}},le,de={},Zt=(e,t)=>{if(t===void 0)throw new g("ptr should not be undefined");for(;e.Ca;)t=e.Na(t),e=e.Ca;return de[t]},_e=(e,t)=>{if(!t.za||!t.ya)throw new ie("makeClassHandle requires ptr and ptrType");if(!!t.Da!=!!t.Aa)throw new ie("Both smartPtrType and smartPtr must be specified");return t.count={value:1},ce(Object.create(e,{ma:{value:t,writable:!0}}))},ce=e=>typeof FinalizationRegistry>"u"?(ce=t=>t,e):($e=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),ce=t=>{var a=t.ma;return a.Aa&&$e.register(t,{ma:a},t),t},_t=t=>{$e.unregister(t);},ce(e));function Ee(){}var ue=(e,t)=>Object.defineProperty(t,"name",{value:e}),Mt=(e,t,a)=>{if(e[t].Ba===void 0){var o=e[t];e[t]=function(...i){if(!e[t].Ba.hasOwnProperty(i.length))throw new g(`Function \'${a}\' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[i.length].apply(this,i)},e[t].Ba=[],e[t].Ba[o.Oa]=o;}},De=(e,t,a)=>{if(r.hasOwnProperty(e)){if(a===void 0||r[e].Ba!==void 0&&r[e].Ba[a]!==void 0)throw new g(`Cannot register public name \'${e}\' twice`);if(Mt(r,e,e),r.hasOwnProperty(a))throw new g(`Cannot register multiple overloads of a function with the same number of arguments (${a})!`);r[e].Ba[a]=t;}else r[e]=t,a!==void 0&&(r[e].vb=a);},Qt=e=>{if(e===void 0)return "_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function qt(e,t,a,o,i,l,h,u){this.name=e,this.constructor=t,this.La=a,this.Fa=o,this.Ca=i,this.cb=l,this.Na=h,this.ab=u,this.kb=[];}var Oe=(e,t,a)=>{for(;t!==a;){if(!t.Na)throw new g(`Expected null or instance of ${a.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function en(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function tn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);if(this.Qa){var a=this.Ua();return e!==null&&e.push(this.Fa,a),a}return 0}if(!t||!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(a=Oe(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new g("Passing raw pointer to smart pointer is illegal");switch(this.pb){case 0:if(t.ma.Da===this)a=t.ma.Aa;else throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:a=t.ma.Aa;break;case 2:if(t.ma.Da===this)a=t.ma.Aa;else {var o=t.clone();a=this.lb(a,Me(()=>o.delete())),e!==null&&e.push(this.Fa,a);}break;default:throw new g("Unsupporting sharing policy")}}return a}function nn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass "${Ne(t)}" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function he(e,t,a,o,i,l,h,u,f,p,m){this.name=e,this.xa=t,this.Ta=a,this.Pa=o,this.Qa=i,this.jb=l,this.pb=h,this.Za=u,this.Ua=f,this.lb=p,this.Fa=m,i||t.Ca!==void 0?this.toWireType=tn:(this.toWireType=o?en:nn,this.Ea=null);}var Lt=(e,t,a)=>{if(!r.hasOwnProperty(e))throw new ie("Replacing nonexistent public symbol");r[e].Ba!==void 0&&a!==void 0?r[e].Ba[a]=t:(r[e]=t,r[e].Oa=a);},R,rn=(e,t,a=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, r["dynCall_"+e])(t,...a)):t=R.get(t)(...a),t),an=(e,t)=>(...a)=>rn(e,t,a),T=(e,t)=>{e=A(e);var a=e.includes("j")?an(e,t):R.get(t);if(typeof a!="function")throw new g(`unknown function pointer with signature ${e}: ${t}`);return a},bt,Ft=e=>{e=kt(e);var t=A(e);return W(e),t},Ce=(e,t)=>{function a(l){i[l]||K[l]||(we[l]?we[l].forEach(a):(o.push(l),i[l]=!0));}var o=[],i={};throw t.forEach(a),new bt(`${e}: `+o.map(Ft).join([", "]))},ze=(e,t)=>{for(var a=[],o=0;o<e;o++)a.push(L[t+4*o>>2]);return a};function on(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function je(e,t,a,o,i){var l=t.length;if(2>l)throw new g("argTypes array size mismatch! Must at least get return value and \'this\' types!");var h=t[1]!==null&&a!==null,u=on(t),f=t[0].name!=="void",p=l-2,m=Array(p),w=[],C=[];return ue(e,function(...d){if(d.length!==p)throw new g(`function ${e} called with ${d.length} arguments, expected ${p}`);if(C.length=0,w.length=h?2:1,w[0]=i,h){var v=t[1].toWireType(C,this);w[1]=v;}for(var y=0;y<p;++y)m[y]=t[y+2].toWireType(C,d[y]),w.push(m[y]);if(d=o(...w),u)Se(C);else for(y=h?1:2;y<t.length;y++){var x=y===1?v:m[y-2];t[y].Ea!==null&&t[y].Ea(x);}return v=f?t[0].fromWireType(d):void 0,v})}var It=e=>{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},Be=[],B=[],We=e=>{9<e&&--B[e+1]===0&&(B[e]=void 0,Be.push(e));},Ue=e=>{if(!e)throw new g("Cannot use deleted val. handle = "+e);return B[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Be.pop()||B.length;return B[t]=e,B[t+1]=1,t}},xt={name:"emscripten::val",fromWireType:e=>{var t=Ue(e);return We(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:oe,Ea:null},sn=(e,t,a)=>{switch(t){case 1:return a?function(o){return this.fromWireType(Y[o])}:function(o){return this.fromWireType(b[o])};case 2:return a?function(o){return this.fromWireType(Q[o>>1])}:function(o){return this.fromWireType(re[o>>1])};case 4:return a?function(o){return this.fromWireType(P[o>>2])}:function(o){return this.fromWireType(L[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},He=(e,t)=>{var a=K[e];if(a===void 0)throw e=`${t} has unknown type ${Ft(e)}`,new g(e);return a},Ne=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},ln=(e,t)=>{switch(t){case 4:return function(a){return this.fromWireType(ot[a>>2])};case 8:return function(a){return this.fromWireType(it[a>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},dn=(e,t,a)=>{switch(t){case 1:return a?o=>Y[o]:o=>b[o];case 2:return a?o=>Q[o>>1]:o=>re[o>>1];case 4:return a?o=>P[o>>2]:o=>L[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},At=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,cn=(e,t)=>{for(var a=e>>1,o=a+t/2;!(a>=o)&&re[a];)++a;if(a<<=1,32<a-e&&At)return At.decode(b.subarray(e,a));for(a="",o=0;!(o>=t/2);++o){var i=Q[e+2*o>>1];if(i==0)break;a+=String.fromCharCode(i);}return a},un=(e,t,a)=>{if(a??(a=2147483647),2>a)return 0;a-=2;var o=t;a=a<2*e.length?a/2:e.length;for(var i=0;i<a;++i)Q[t>>1]=e.charCodeAt(i),t+=2;return Q[t>>1]=0,t-o},hn=e=>2*e.length,pn=(e,t)=>{for(var a=0,o="";!(a>=t/4);){var i=P[e+4*a>>2];if(i==0)break;++a,65536<=i?(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023)):o+=String.fromCharCode(i);}return o},fn=(e,t,a)=>{if(a??(a=2147483647),4>a)return 0;var o=t;a=o+a-4;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(P[t>>2]=l,t+=4,t+4>a)break}return P[t>>2]=0,t-o},mn=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);55296<=o&&57343>=o&&++a,t+=4;}return t},Ve=[],vn=e=>{var t=Ve.length;return Ve.push(e),t},yn=(e,t)=>{for(var a=Array(e),o=0;o<e;++o)a[o]=He(L[t+4*o>>2],"parameter "+o);return a},gn=Reflect.construct,Ye={},Pt=()=>{if(!Je){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:V||"./this.program"},t;for(t in Ye)Ye[t]===void 0?delete e[t]:e[t]=Ye[t];var a=[];for(t in e)a.push(`${t}=${e[t]}`);Je=a;}return Je},Je,wn=[null,[],[]],_n=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);ye("initRandomDevice");},Tt=e=>(Tt=_n())(e),Le=e=>e%4===0&&(e%100!==0||e%400===0),St=[31,29,31,30,31,30,31,31,30,31,30,31],Rt=[31,28,31,30,31,30,31,31,30,31,30,31];function En(e){var t=Array(yt(e)+1);return gt(e,t,0,t.length),t}var Cn=(e,t,a,o)=>{function i(d,v,y){for(d=typeof d=="number"?d.toString():d||"";d.length<v;)d=y[0]+d;return d}function l(d,v){return i(d,v,"0")}function h(d,v){function y(N){return 0>N?-1:0<N?1:0}var x;return (x=y(d.getFullYear()-v.getFullYear()))===0&&(x=y(d.getMonth()-v.getMonth()))===0&&(x=y(d.getDate()-v.getDate())),x}function u(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function f(d){var v=d.Ia;for(d=new Date(new Date(d.Ja+1900,0,1).getTime());0<v;){var y=d.getMonth(),x=(Le(d.getFullYear())?St:Rt)[y];if(v>x-d.getDate())v-=x-d.getDate()+1,d.setDate(1),11>y?d.setMonth(y+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else {d.setDate(d.getDate()+v);break}}return y=new Date(d.getFullYear()+1,0,4),v=u(new Date(d.getFullYear(),0,4)),y=u(y),0>=h(v,d)?0>=h(y,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}var p=L[o+40>>2];o={sb:P[o>>2],rb:P[o+4>>2],Ra:P[o+8>>2],Va:P[o+12>>2],Sa:P[o+16>>2],Ja:P[o+20>>2],Ga:P[o+24>>2],Ia:P[o+28>>2],wb:P[o+32>>2],qb:P[o+36>>2],tb:p&&p?G(b,p):""},a=a?G(b,a):"",p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var m in p)a=a.replace(new RegExp(m,"g"),p[m]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),C="January February March April May June July August September October November December".split(" ");p={"%a":d=>w[d.Ga].substring(0,3),"%A":d=>w[d.Ga],"%b":d=>C[d.Sa].substring(0,3),"%B":d=>C[d.Sa],"%C":d=>l((d.Ja+1900)/100|0,2),"%d":d=>l(d.Va,2),"%e":d=>i(d.Va,2," "),"%g":d=>f(d).toString().substring(2),"%G":f,"%H":d=>l(d.Ra,2),"%I":d=>(d=d.Ra,d==0?d=12:12<d&&(d-=12),l(d,2)),"%j":d=>{for(var v=0,y=0;y<=d.Sa-1;v+=(Le(d.Ja+1900)?St:Rt)[y++]);return l(d.Va+v,3)},"%m":d=>l(d.Sa+1,2),"%M":d=>l(d.rb,2),"%n":()=>`\n`,"%p":d=>0<=d.Ra&&12>d.Ra?"AM":"PM","%S":d=>l(d.sb,2),"%t":()=>" ","%u":d=>d.Ga||7,"%U":d=>l(Math.floor((d.Ia+7-d.Ga)/7),2),"%V":d=>{var v=Math.floor((d.Ia+7-(d.Ga+6)%7)/7);if(2>=(d.Ga+371-d.Ia-2)%7&&v++,v)v==53&&(y=(d.Ga+371-d.Ia)%7,y==4||y==3&&Le(d.Ja)||(v=1));else {v=52;var y=(d.Ga+7-d.Ia-1)%7;(y==4||y==5&&Le(d.Ja%400-1))&&v++;}return l(v,2)},"%w":d=>d.Ga,"%W":d=>l(Math.floor((d.Ia+7-(d.Ga+6)%7)/7),2),"%y":d=>(d.Ja+1900).toString().substring(2),"%Y":d=>d.Ja+1900,"%z":d=>{d=d.qb;var v=0<=d;return d=Math.abs(d)/60,(v?"+":"-")+("0000"+(d/60*100+d%60)).slice(-4)},"%Z":d=>d.tb,"%%":()=>"%"},a=a.replace(/%%/g,"\\0\\0");for(m in p)a.includes(m)&&(a=a.replace(new RegExp(m,"g"),p[m](o)));return a=a.replace(/\\0\\0/g,"%"),m=En(a),m.length>t?0:(Y.set(m,e),m.length-1)};ie=r.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var $t=Array(256),be=0;256>be;++be)$t[be]=String.fromCharCode(be);wt=$t,g=r.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(Ee.prototype,{isAliasOf:function(e){if(!(this instanceof Ee&&e instanceof Ee))return !1;var t=this.ma.za.xa,a=this.ma.ya;e.ma=e.ma;var o=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)a=t.Na(a),t=t.Ca;for(;o.Ca;)e=o.Na(e),o=o.Ca;return t===o&&a===e},clone:function(){if(this.ma.ya||Re(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=ce,t=Object,a=t.create,o=Object.getPrototypeOf(this),i=this.ma;return e=e(a.call(t,o,{ma:{value:{count:i.count,Ka:i.Ka,Ma:i.Ma,ya:i.ya,za:i.za,Aa:i.Aa,Da:i.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");_t(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g("Object already scheduled for deletion");return se.push(this),se.length===1&&le&&le(ke),this.ma.Ka=!0,this}}),r.getInheritedInstanceCount=()=>Object.keys(de).length,r.getLiveInheritedInstances=()=>{var e=[],t;for(t in de)de.hasOwnProperty(t)&&e.push(de[t]);return e},r.flushPendingDeletes=ke,r.setDelayFunction=e=>{le=e,se.length&&le&&le(ke);},Object.assign(he.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:oe,fromWireType:function(e){function t(){return this.Qa?_e(this.xa.La,{za:this.jb,ya:a,Da:this,Aa:e}):_e(this.xa.La,{za:this,ya:e})}var a=this.eb(e);if(!a)return this.Xa(e),null;var o=Zt(this.xa,a);if(o!==void 0)return o.ma.count.value===0?(o.ma.ya=a,o.ma.Aa=e,o.clone()):(o=o.clone(),this.Xa(e),o);if(o=this.xa.cb(a),o=Ct[o],!o)return t.call(this);o=this.Pa?o.$a:o.pointerType;var i=Et(a,this.xa,o.xa);return i===null?t.call(this):this.Qa?_e(o.xa.La,{za:o,ya:i,Da:this,Aa:e}):_e(o.xa.La,{za:o,ya:i})}}),bt=r.UnboundTypeError=((e,t)=>{var a=ue(t,function(o){this.name=t,this.message=o,o=Error(o).stack,o!==void 0&&(this.stack=this.toString()+`\n`+o.replace(/^Error(:[^\\n]*)?\\n/,""));});return a.prototype=Object.create(e.prototype),a.prototype.constructor=a,a.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},a})(Error,"UnboundTypeError"),B.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>B.length/2-5-Be.length;var Mn={c:(e,t,a,o)=>{ye(`Assertion failed: ${e?G(b,e):""}, at: `+[t?t?G(b,t):"":"unknown filename",a,o?o?G(b,o):"":"unknown function"]);},m:(e,t,a)=>{var o=new Gt(e);throw L[o.ya+16>>2]=0,L[o.ya+4>>2]=t,L[o.ya+8>>2]=a,vt=e,vt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ge[e];delete ge[e];var a=t.Ua,o=t.Fa,i=t.Ya,l=i.map(h=>h.hb).concat(i.map(h=>h.nb));H([e],l,h=>{var u={};return i.forEach((f,p)=>{var m=h[p],w=f.fb,C=f.gb,d=h[p+i.length],v=f.mb,y=f.ob;u[f.bb]={read:x=>m.fromWireType(w(C,x)),write:(x,N)=>{var S=[];v(y,x,d.toWireType(S,N)),Se(S);}};}),[{name:t.name,fromWireType:f=>{var p={},m;for(m in u)p[m]=u[m].read(f);return o(f),p},toWireType:(f,p)=>{for(var m in u)if(!(m in p))throw new TypeError(`Missing field: "${m}"`);var w=a();for(m in u)u[m].write(w,p[m]);return f!==null&&f.push(o,w),w},argPackAdvance:8,readValueFromPointer:oe,Ea:o}]});},I:()=>{},Y:(e,t,a,o)=>{t=A(t),k(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,l){return l?a:o},argPackAdvance:8,readValueFromPointer:function(i){return this.fromWireType(b[i])},Ea:null});},r:(e,t,a,o,i,l,h,u,f,p,m,w,C)=>{m=A(m),l=T(i,l),u&&(u=T(h,u)),p&&(p=T(f,p)),C=T(w,C);var d=Qt(m);De(d,function(){Ce(`Cannot construct ${m} due to unbound types`,[o]);}),H([e,t,a],o?[o]:[],v=>{if(v=v[0],o)var y=v.xa,x=y.La;else x=Ee.prototype;v=ue(m,function(...Ke){if(Object.getPrototypeOf(this)!==N)throw new g("Use \'new\' to construct "+m);if(S.Ha===void 0)throw new g(m+" has no accessible constructor");var zt=S.Ha[Ke.length];if(zt===void 0)throw new g(`Tried to invoke ctor of ${m} with invalid number of parameters (${Ke.length}) - expected (${Object.keys(S.Ha).toString()}) parameters instead!`);return zt.apply(this,Ke)});var N=Object.create(x,{constructor:{value:v}});v.prototype=N;var S=new qt(m,v,N,C,y,l,u,p);if(S.Ca){var pe;(pe=S.Ca).Wa??(pe.Wa=[]),S.Ca.Wa.push(S);}return y=new he(m,S,!0,!1,!1),pe=new he(m+"*",S,!1,!1,!1),x=new he(m+" const*",S,!1,!0,!1),Ct[e]={pointerType:pe,$a:x},Lt(d,v),[y,pe,x]});},q:(e,t,a,o,i,l)=>{var h=ze(t,a);i=T(o,i),H([],[e],u=>{u=u[0];var f=`constructor ${u.name}`;if(u.xa.Ha===void 0&&(u.xa.Ha=[]),u.xa.Ha[t-1]!==void 0)throw new g(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class \'${u.name}\'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.xa.Ha[t-1]=()=>{Ce(`Cannot construct ${u.name} due to unbound types`,h);},H([],h,p=>(p.splice(1,0,null),u.xa.Ha[t-1]=je(f,p,null,i,l),[])),[]});},f:(e,t,a,o,i,l,h,u)=>{var f=ze(a,o);t=A(t),t=It(t),l=T(i,l),H([],[e],p=>{function m(){Ce(`Cannot call ${w} due to unbound types`,f);}p=p[0];var w=`${p.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&p.xa.kb.push(t);var C=p.xa.La,d=C[t];return d===void 0||d.Ba===void 0&&d.className!==p.name&&d.Oa===a-2?(m.Oa=a-2,m.className=p.name,C[t]=m):(Mt(C,t,w),C[t].Ba[a-2]=m),H([],f,v=>(v=je(w,v,p,l,h),C[t].Ba===void 0?(v.Oa=a-2,C[t]=v):C[t].Ba[a-2]=v,[])),[]});},X:e=>k(e,xt),x:(e,t,a,o)=>{function i(){}t=A(t),i.values={},k(e,{name:t,constructor:i,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,h)=>h.value,argPackAdvance:8,readValueFromPointer:sn(t,a,o),Ea:null}),De(t,i);},k:(e,t,a)=>{var o=He(e,"enum");t=A(t),e=o.constructor,o=Object.create(o.constructor.prototype,{value:{value:a},constructor:{value:ue(`${o.name}_${t}`,function(){})}}),e.values[a]=o,e[t]=o;},C:(e,t,a)=>{t=A(t),k(e,{name:t,fromWireType:o=>o,toWireType:(o,i)=>i,argPackAdvance:8,readValueFromPointer:ln(t,a),Ea:null});},E:(e,t,a,o,i,l)=>{var h=ze(t,a);e=A(e),e=It(e),i=T(o,i),De(e,function(){Ce(`Cannot call ${e} due to unbound types`,h);},t-1),H([],h,u=>(Lt(e,je(e,[u[0],null].concat(u.slice(1)),null,i,l),t-1),[]));},l:(e,t,a,o,i)=>{if(t=A(t),i===-1&&(i=4294967295),i=u=>u,o===0){var l=32-8*a;i=u=>u<<l>>>l;}var h=t.includes("unsigned")?function(u,f){return f>>>0}:function(u,f){return f};k(e,{name:t,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:dn(t,a,o!==0),Ea:null});},g:(e,t,a)=>{function o(l){return new i(Y.buffer,L[l+4>>2],L[l>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];a=A(a),k(e,{name:a,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ib:!0});},w:e=>{k(e,xt);},ca:(e,t,a,o,i,l,h,u,f,p,m,w)=>{a=A(a),l=T(i,l),u=T(h,u),p=T(f,p),w=T(m,w),H([e],[t],C=>(C=C[0],[new he(a,C.xa,!1,!1,!0,C,o,l,u,p,w)]));},D:(e,t)=>{t=A(t);var a=t==="std::string";k(e,{name:t,fromWireType:function(o){var i=L[o>>2],l=o+4;if(a)for(var h=l,u=0;u<=i;++u){var f=l+u;if(u==i||b[f]==0){if(h=h?G(b,h,f-h):"",p===void 0)var p=h;else p+="\\0",p+=h;h=f+1;}}else {for(p=Array(i),u=0;u<i;++u)p[u]=String.fromCharCode(b[l+u]);p=p.join("");}return W(o),p},toWireType:function(o,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var l=typeof i=="string";if(!(l||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new g("Cannot pass non-string to std::string");var h=a&&l?yt(i):i.length,u=Ge(4+h+1),f=u+4;if(L[u>>2]=h,a&&l)gt(i,b,f,h+1);else if(l)for(l=0;l<h;++l){var p=i.charCodeAt(l);if(255<p)throw W(f),new g("String has UTF-16 code units that do not fit in 8 bits");b[f+l]=p;}else for(l=0;l<h;++l)b[f+l]=i[l];return o!==null&&o.push(W,u),u},argPackAdvance:8,readValueFromPointer:oe,Ea(o){W(o);}});},u:(e,t,a)=>{if(a=A(a),t===2)var o=cn,i=un,l=hn,h=u=>re[u>>1];else t===4&&(o=pn,i=fn,l=mn,h=u=>L[u>>2]);k(e,{name:a,fromWireType:u=>{for(var f=L[u>>2],p,m=u+4,w=0;w<=f;++w){var C=u+4+w*t;(w==f||h(C)==0)&&(m=o(m,C-m),p===void 0?p=m:(p+="\\0",p+=m),m=C+t);}return W(u),p},toWireType:(u,f)=>{if(typeof f!="string")throw new g(`Cannot pass non-string to C++ string type ${a}`);var p=l(f),m=Ge(4+p+t);return L[m>>2]=p/t,i(f,m+4,p+t),u!==null&&u.push(W,m),m},argPackAdvance:8,readValueFromPointer:oe,Ea(u){W(u);}});},s:(e,t,a,o,i,l)=>{ge[e]={name:A(t),Ua:T(a,o),Fa:T(i,l),Ya:[]};},j:(e,t,a,o,i,l,h,u,f,p)=>{ge[e].Ya.push({bb:A(t),hb:a,fb:T(o,i),gb:l,nb:h,mb:T(u,f),ob:p});},Z:(e,t)=>{t=A(t),k(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,a,o)=>(e=Ve[e],t=Ue(t),e(null,t,a,o)),F:We,$:(e,t,a)=>{var o=yn(e,t),i=o.shift();e--;var l=Array(e);return t=`methodCaller<(${o.map(h=>h.name).join(", ")}) => ${i.name}>`,vn(ue(t,(h,u,f,p)=>{for(var m=0,w=0;w<e;++w)l[w]=o[w].readValueFromPointer(p+m),m+=o[w].argPackAdvance;return u=a===1?gn(u,l):u.apply(h,l),h=[],u=i.toWireType(h,u),h.length&&(L[f>>2]=Me(h)),u}))},ba:e=>{9<e&&(B[e+1]+=1);},_:e=>{var t=Ue(e);Se(t),We(e);},o:(e,t)=>(e=He(e,"_emval_take_value"),e=e.readValueFromPointer(t),Me(e)),W:()=>{ye("");},V:()=>performance.now(),L:e=>{var t=b.length;if(e>>>=0,2147483648<e)return !1;for(var a=1;4>=a;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var i=Math;o=Math.max(e,o);e:{i=(i.min.call(i,2147483648,o+(65536-o%65536)%65536)-ve.buffer.byteLength+65535)/65536;try{ve.grow(i),st();var l=1;break e}catch{}l=void 0;}if(l)return !0}return !1},S:(e,t)=>{var a=0;return Pt().forEach((o,i)=>{var l=t+a;for(i=L[e+4*i>>2]=l,l=0;l<o.length;++l)Y[i++]=o.charCodeAt(l);Y[i]=0,a+=o.length+1;}),0},T:(e,t)=>{var a=Pt();L[e>>2]=a.length;var o=0;return a.forEach(i=>o+=i.length+1),L[t>>2]=o,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,a,o)=>{for(var i=0,l=0;l<a;l++){var h=L[t>>2],u=L[t+4>>2];t+=8;for(var f=0;f<u;f++){var p=b[h+f],m=wn[e];p===0||p===10?((e===1?Nt:Z)(G(m,0)),m.length=0):m.push(p);}i+=u;}return L[o>>2]=i,0},U:(e,t)=>(Tt(b.subarray(e,e+t)),0),i:xn,d:In,e:Fn,p:An,y:Sn,b:Ln,a:bn,h:Tn,n:Pn,G:Rn,K:(e,t,a,o)=>Cn(e,t,a,o)},F=function(){function e(a){return F=a.exports,ve=F.da,st(),R=F.ha,dt.unshift(F.ea),J--,r.monitorRunDependencies?.(J),J==0&&(ae&&(a=ae,ae=null,a())),F}var t={a:Mn};if(J++,r.monitorRunDependencies?.(J),r.instantiateWasm)try{return r.instantiateWasm(t,e)}catch(a){Z(`Module.instantiateWasm callback failed with error: ${a}`),_(a);}return Jt(t,function(a){e(a.instance);}).catch(_),{}}(),Ge=e=>(Ge=F.fa)(e),kt=e=>(kt=F.ga)(e),W=e=>(W=F.ia)(e),D=(e,t)=>(D=F.ja)(e,t),O=e=>(O=F.ka)(e),z=()=>(z=F.la)();r.dynCall_iijj=(e,t,a,o,i,l)=>(r.dynCall_iijj=F.na)(e,t,a,o,i,l),r.dynCall_vijj=(e,t,a,o,i,l)=>(r.dynCall_vijj=F.oa)(e,t,a,o,i,l),r.dynCall_jiii=(e,t,a,o)=>(r.dynCall_jiii=F.pa)(e,t,a,o),r.dynCall_jii=(e,t,a)=>(r.dynCall_jii=F.qa)(e,t,a);var Dt=r.dynCall_viiij=(e,t,a,o,i,l)=>(Dt=r.dynCall_viiij=F.ra)(e,t,a,o,i,l);r.dynCall_jiji=(e,t,a,o,i)=>(r.dynCall_jiji=F.sa)(e,t,a,o,i),r.dynCall_viijii=(e,t,a,o,i,l,h)=>(r.dynCall_viijii=F.ta)(e,t,a,o,i,l,h),r.dynCall_iiiiij=(e,t,a,o,i,l,h)=>(r.dynCall_iiiiij=F.ua)(e,t,a,o,i,l,h),r.dynCall_iiiiijj=(e,t,a,o,i,l,h,u,f)=>(r.dynCall_iiiiijj=F.va)(e,t,a,o,i,l,h,u,f),r.dynCall_iiiiiijj=(e,t,a,o,i,l,h,u,f,p)=>(r.dynCall_iiiiiijj=F.wa)(e,t,a,o,i,l,h,u,f,p);function Ln(e,t){var a=z();try{R.get(e)(t);}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function bn(e,t,a){var o=z();try{R.get(e)(t,a);}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function Fn(e,t,a,o){var i=z();try{return R.get(e)(t,a,o)}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function In(e,t,a){var o=z();try{return R.get(e)(t,a)}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function xn(e,t){var a=z();try{return R.get(e)(t)}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function An(e,t,a,o,i,l){var h=z();try{return R.get(e)(t,a,o,i,l)}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}function Pn(e,t,a,o,i){var l=z();try{R.get(e)(t,a,o,i);}catch(h){if(O(l),h!==h+0)throw h;D(1,0);}}function Tn(e,t,a,o){var i=z();try{R.get(e)(t,a,o);}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function Sn(e){var t=z();try{R.get(e)();}catch(a){if(O(t),a!==a+0)throw a;D(1,0);}}function Rn(e,t,a,o,i,l){var h=z();try{Dt(e,t,a,o,i,l);}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}var Fe;ae=function e(){Fe||Ot(),Fe||(ae=e);};function Ot(){function e(){if(!Fe&&(Fe=!0,r.calledRun=!0,!at)){if(Te(dt),c(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();ct.unshift(t);}Te(ct);}}if(!(0<J)){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Vt();Te(lt),0<J||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("");},1),e();},1)):e());}}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ot(),$}})(),Bt=On;var X=class{constructor(){throw new Error("RendererLoader is a static class and cannot be instantiated.")}static async _tryLoad(n){return await Bt({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let r=`https://unpkg.com/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${r}`);try{return await this._tryLoad(r)}catch(c){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${c.message}`),new Error("WASM loading failed from all sources.")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};I(X,"_ModulePromise",null),I(X,"_wasmURL",`https://cdn.jsdelivr.net/npm/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`);var Ae=class{constructor(){I(this,"_eventListeners",new Map);}addEventListener(n,r){let c=this._eventListeners.get(n);c||(c=new Set,this._eventListeners.set(n,c)),c.add(r);}removeEventListener(n,r){let c=this._eventListeners.get(n);c&&(r?(c.delete(r),c.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(c=>c(n));}removeAllEventListeners(){this._eventListeners.clear();}};function zn(s){return /^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(s)}function Ut(s){if(!zn(s))return 0;let n=s.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}function Qe(s){if(s.byteLength<4)return !1;let n=new Uint8Array(s.slice(0,xe.byteLength));for(let r=0;r<xe.length;r+=1)if(xe[r]!==n[r])return !1;return !0}function Wt(s){return jt.every(n=>Object.prototype.hasOwnProperty.call(s,n))}function qe(s){if(typeof s=="string")try{return Wt(JSON.parse(s))}catch{return !1}else return Wt(s)}var et=(s,n)=>s==="reverse"?n.Mode.Reverse:s==="bounce"?n.Mode.Bounce:s==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,tt=(s,n)=>s==="contain"?n.Fit.Contain:s==="cover"?n.Fit.Cover:s==="fill"?n.Fit.Fill:s==="fit-height"?n.Fit.FitHeight:s==="fit-width"?n.Fit.FitWidth:n.Fit.None,nt=(s,n)=>{let r=new n.VectorFloat;return r.push_back(s[0]),r.push_back(s[1]),r},rt=(s,n)=>{let r=new n.VectorFloat;return s.length!==2||(r.push_back(s[0]),r.push_back(s[1])),r},M=class M{constructor(n){I(this,"_canvas");I(this,"_context",null);I(this,"_eventManager");I(this,"_animationFrameId",null);I(this,"_frameManager");I(this,"_dotLottieCore",null);I(this,"_renderConfig",{});I(this,"_isFrozen",!1);I(this,"_backgroundColor",null);this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new Ae,this._frameManager=new Ie,this._renderConfig=n.renderConfig??{},X.load().then(r=>{M._wasmModule=r,this._dotLottieCore=new r.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??"forward",r),segment:rt(n.segment??[],r),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:nt(n.layout.align,r),fit:tt(n.layout.fit,r)}:r.createDefaultLayout()}),this._eventManager.dispatch({type:"ready"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(r=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${r}`)});});}_dispatchError(n){console.error(n),this._eventManager.dispatch({type:"loadError",error:new Error(n)});}async _fetchData(n){let r=await fetch(n);if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${n}. ${r.status}: ${r.statusText}`);let c=await r.arrayBuffer();return Qe(c)?c:new TextDecoder().decode(c)}_loadFromData(n){if(this._dotLottieCore===null)return;let r=this._canvas.width,c=this._canvas.height,_=!1;if(typeof n=="string"){if(!qe(n)){this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}_=this._dotLottieCore.loadAnimationData(n,r,c);}else if(n instanceof ArrayBuffer){if(!Qe(n)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}_=this._dotLottieCore.loadDotLottieData(n,r,c);}else if(typeof n=="object"){if(!qe(n)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}_=this._dotLottieCore.loadAnimationData(JSON.stringify(n),r,c);}else {this._dispatchError(`Unsupported data type for animation data. Expected: \n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON). \n Received: ${typeof n}`);return}_?(this._eventManager.dispatch({type:"load"}),te&&this.resize(),this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._dotLottieCore.config().autoplay&&(this._dotLottieCore.play(),this._dotLottieCore.isPlaying()?(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))):console.error("something went wrong, the animation was suppose to autoplay"))):this._dispatchError("Failed to load animation data");}_loadFromSrc(n){this._fetchData(n).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${n}. ${r}`));}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case M._wasmModule?.Fit.Contain:return "contain";case M._wasmModule?.Fit.Cover:return "cover";case M._wasmModule?.Fit.Fill:return "fill";case M._wasmModule?.Fit.FitHeight:return "fit-height";case M._wasmModule?.Fit.FitWidth:return "fit-width";case M._wasmModule?.Fit.None:return "none";default:return "contain"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let r=JSON.parse(n);return Object.keys(r).length===0?null:r}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===M._wasmModule?.Mode.Reverse?"reverse":n===M._wasmModule?.Mode.Bounce?"bounce":n===M._wasmModule?.Mode.ReverseBounce?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.config().autoplay??!1}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??!1}get speed(){return this._dotLottieCore?.config().speed??0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return this._dotLottieCore?.isLoaded()??!1}get isPlaying(){return this._dotLottieCore?.isPlaying()??!1}get isPaused(){return this._dotLottieCore?.isPaused()??!1}get isStopped(){return this._dotLottieCore?.isStopped()??!1}get currentFrame(){return this._dotLottieCore?.currentFrame()??0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segmentDuration()??0}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||M._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??"forward",M._wasmModule),segment:rt(n.segment??[],M._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??"",layout:n.layout?{align:nt(n.layout.align,M._wasmModule),fit:tt(n.layout.fit,M._wasmModule)}:M._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let r=this._dotLottieCore.buffer(),c=new Uint8ClampedArray(r,0,this._canvas.width*this._canvas.height*4),_=null;return typeof ImageData>"u"?(_=this._context.createImageData(this._canvas.width,this._canvas.height),_.data.set(c)):_=new ImageData(c,this._canvas.width,this._canvas.height),this._context.putImageData(_,0,0),this._eventManager.dispatch({type:"render",currentFrame:this._dotLottieCore.currentFrame()}),!0}return !1}_draw(){if(this._dotLottieCore===null||this._context===null||!this._dotLottieCore.isPlaying())return;let n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render()&&this._dotLottieCore.isComplete()&&(this._dotLottieCore.config().loopAnimation?this._eventManager.dispatch({type:"loop",loopCount:this._dotLottieCore.loopCount()}):this._eventManager.dispatch({type:"complete"}))),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this));}play(){if(this._dotLottieCore===null)return;let n=this._dotLottieCore.play();this._isFrozen=!1,n&&(this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)));}pause(){if(this._dotLottieCore===null)return;this._dotLottieCore.pause()&&this._eventManager.dispatch({type:"pause"});}stop(){if(this._dotLottieCore===null)return;this._dotLottieCore.stop()&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._eventManager.dispatch({type:"stop"}));}setFrame(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:"frame",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(te&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:Ut(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,r){this._eventManager.addEventListener(n,r);}removeEventListener(n,r){this._eventManager.removeEventListener(n,r);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}freeze(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null,this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}));}unfreeze(){this._animationFrameId===null&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)),this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}));}resize(){if(te&&this._canvas instanceof HTMLCanvasElement){let r=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:c,width:_}=this._canvas.getBoundingClientRect();this._canvas.width=_*r,this._canvas.height=c*r;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,r){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:rt([n,r],M._wasmModule)});}setMode(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:et(n,M._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:"load"}),this.resize()):this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let r=[];for(let c=0;c<n.size();c+=1){let _=n.get(c);r.push({name:_.name,time:_.time,duration:_.duration});}return r}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadTheme(n);return this._render(),r}loadThemeData(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadThemeData(n);return this._render(),r}setLayout(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:nt(n.align,M._wasmModule),fit:tt(n.fit,M._wasmModule)}});}setViewport(n,r,c,_){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,r,c,_)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let r=this._canvas.getBoundingClientRect(),c=this._canvas.width/r.width,_=this._canvas.height/r.height,$=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,U=(n.clientX-r.left)*c/$,V=(n.clientY-r.top)*_/$;return {x:U,y:V}}_onPointerUp(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${r} ${c}`);}_onPointerDown(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${r} ${c}`);}_onPointerMove(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${r} ${c}`);}_onPointerEnter(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${r} ${c}`);}_onPointerLeave(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${r} ${c}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),r=[];for(let c=0;c<n.size();c+=1)r.push(n.get(c));return r}_setupStateMachineListeners(){if(te&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),n.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){te&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,r=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:r}}setStateMachineBooleanContext(n,r){return this._dotLottieCore?.setStateMachineBooleanContext(n,r)??!1}setStateMachineNumericContext(n,r){return this._dotLottieCore?.setStateMachineNumericContext(n,r)??!1}setStateMachineStringContext(n,r){return this._dotLottieCore?.setStateMachineStringContext(n,r)??!1}};I(M,"_wasmModule",null);var me=M;var E=new Map,jn={ready:s=>n=>{let r={id:"",method:"onReady",result:{instanceId:s,event:n}};self.postMessage(r);},complete:s=>n=>{let r={id:"",method:"onComplete",result:{instanceId:s,event:n}};self.postMessage(r);},load:s=>n=>{let c={id:"",method:"onLoad",result:{instanceId:s,event:n}};self.postMessage(c);},loadError:s=>n=>{let c={id:"",method:"onLoadError",result:{instanceId:s,event:n}};self.postMessage(c);},loop:s=>n=>{let c={id:"",method:"onLoop",result:{instanceId:s,event:n}};self.postMessage(c);},play:s=>n=>{let c={id:"",method:"onPlay",result:{instanceId:s,event:n}};self.postMessage(c);},pause:s=>n=>{let c={id:"",method:"onPause",result:{instanceId:s,event:n}};self.postMessage(c);},stop:s=>n=>{let c={id:"",method:"onStop",result:{instanceId:s,event:n}};self.postMessage(c);},frame:s=>n=>{let c={id:"",method:"onFrame",result:{instanceId:s,event:n}};self.postMessage(c);},render:s=>n=>{let c={id:"",method:"onRender",result:{instanceId:s,event:n}};self.postMessage(c);},freeze:s=>n=>{let c={id:"",method:"onFreeze",result:{instanceId:s,event:n}};self.postMessage(c);},unfreeze:s=>n=>{let c={id:"",method:"onUnfreeze",result:{instanceId:s,event:n}};self.postMessage(c);},destroy:s=>n=>{let c={id:"",method:"onDestroy",result:{instanceId:s,event:n}};self.postMessage(c);}},Ht={getDotLottieInstanceState(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return {state:{isLoaded:r.isLoaded,isPaused:r.isPaused,isPlaying:r.isPlaying,isStopped:r.isStopped,isFrozen:r.isFrozen,loop:r.loop,mode:r.mode,speed:r.speed,currentFrame:r.currentFrame,totalFrames:r.totalFrames,duration:r.duration,useFrameInterpolation:r.useFrameInterpolation,renderConfig:r.renderConfig,marker:r.marker,backgroundColor:r.backgroundColor,markers:r.markers(),activeAnimationId:r.activeAnimationId,activeThemeId:r.activeThemeId,autoplay:r.autoplay,segment:r.segment,layout:r.layout,segmentDuration:r.segmentDuration,isReady:r.isReady,manifest:r.manifest}}},setLayout(s){let n=s.params.instanceId,r=s.params.layout,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLayout(r),{success:!0}},getStateMachineListeners(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.getStateMachineListeners()},postStateMachineEvent(s){let n=s.params.instanceId,r=s.params.event,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.postStateMachineEvent(r)},startStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.startStateMachine()},stopStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.stopStateMachine()},loadStateMachine(s){let n=s.params.instanceId,r=s.params.stateMachineId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachine(r)},loadStateMachineData(s){let n=s.params.instanceId,r=s.params.stateMachineData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachineData(r)},create:s=>{let n=s.params.instanceId,r=s.params.config,c=s.params.width,_=s.params.height;if(E.has(n))throw new Error(`Instance with id ${n} already exists.`);let $=new me(r);return $.canvas.height=_,$.canvas.width=c,E.set(n,$),["complete","frame","load","loadError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready"].forEach(V=>{$.addEventListener(V,jn[V](n));}),{instanceId:n}},destroy:s=>{let n=s.params.instanceId,r=E.get(n);r&&(r.destroy(),E.delete(n));},freeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.freeze();},load:s=>{let n=s.params.instanceId,r=s.params.config,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.load(r);},loadAnimation:s=>{let n=s.params.instanceId,r=s.params.animationId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.loadAnimation(r);},loadTheme:s=>{let n=s.params.instanceId,r=s.params.themeId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadTheme(r)},loadThemeData:s=>{let n=s.params.instanceId,r=s.params.themeData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadThemeData(r)},pause:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.pause()},play:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.play()},resize:s=>{let n=s.params.instanceId,r=s.params.width,c=s.params.height,_=E.get(n);if(!_)throw new Error(`Instance with id ${n} does not exist.`);return _.canvas.height=c,_.canvas.width=r,_.resize(),{success:!0}},setBackgroundColor:s=>{let n=s.params.instanceId,r=s.params.backgroundColor,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setBackgroundColor(r);},setFrame:s=>{let n=s.params.instanceId,r=s.params.frame,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setFrame(r);},setMode:s=>{let n=s.params.instanceId,r=s.params.mode,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setMode(r);},setRenderConfig:s=>{let n=s.params.instanceId,r=s.params.renderConfig,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setRenderConfig(r);},setSegment:s=>{let n=s.params.instanceId,r=s.params.segment,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSegment(r[0],r[1]);},setSpeed:s=>{let n=s.params.instanceId,r=s.params.speed,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSpeed(r);},setUseFrameInterpolation:s=>{let n=s.params.instanceId,r=s.params.useFrameInterpolation,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setUseFrameInterpolation(r);},setWasmUrl:s=>{me.setWasmUrl(s.params.url);},stop:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.stop();},unfreeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.unfreeze();},setViewport(s){let n=s.params.instanceId,r=s.params.x,c=s.params.y,_=s.params.width,$=s.params.height,U=E.get(n);if(!U)throw new Error(`Instance with id ${n} does not exist.`);return U.setViewport(r,c,_,$)},setMarker(s){let n=s.params.instanceId,r=s.params.marker,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setMarker(r),{success:!0}},setLoop(s){let n=s.params.instanceId,r=s.params.loop,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLoop(r),{success:!0}}};function Bn(s){let n=s.method;if(typeof Ht[n]=="function")return Ht[n](s);throw new Error(`Method ${n} is not implemented in commands.`)}self.onmessage=s=>{try{let n=Bn(s.data),r={id:s.data.id,method:s.data.method,result:n};self.postMessage(r);}catch(n){let r={id:s.data.id,method:s.data.method,error:n.message};self.postMessage(r);}};var Wn="",fr=Wn;\n\nexport { fr as default };\n';var h=class{constructor(){a(this,"_workers",new Map);a(this,"_animationWorkerMap",new Map);}_createWorker(e){let t=new Blob([m],{type:"application/javascript"});return new Worker(URL.createObjectURL(t),{type:"module",name:e})}getWorker(e){return this._workers.has(e)||this._workers.set(e,this._createWorker(e)),this._workers.get(e)}assignAnimationToWorker(e,t){this._animationWorkerMap.set(e,t);}unassignAnimationFromWorker(e){this._animationWorkerMap.delete(e);}sendMessage(e,t,n){this.getWorker(e).postMessage(t,n||[]);}terminateWorker(e){let t=this._workers.get(e);t&&(t.terminate(),this._workers.delete(e));}};function f(r){if(r instanceof OffscreenCanvas)return {width:r.width,height:r.height};let{height:e,width:t}=r.getBoundingClientRect();return {width:t*window.devicePixelRatio,height:e*window.devicePixelRatio}}function v(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}var i=class i{constructor(e){a(this,"_eventManager",new c);a(this,"_id");a(this,"_worker");a(this,"_canvas");a(this,"_dotLottieInstanceState",{markers:[],autoplay:!1,backgroundColor:"",currentFrame:0,duration:0,loop:!1,mode:"forward",segment:[0,0],segmentDuration:0,speed:1,totalFrames:0,isLoaded:!1,isPlaying:!1,isPaused:!1,isStopped:!0,isFrozen:!1,useFrameInterpolation:!1,renderConfig:{devicePixelRatio:window.devicePixelRatio},activeAnimationId:"",activeThemeId:"",layout:void 0,marker:void 0,isReady:!1,manifest:null});a(this,"_created",!1);this._canvas=e.canvas,this._id=`dotlottie-${v()}`;let t=e.workerId||"defaultWorker";this._worker=i._workerManager.getWorker(t),i._workerManager.assignAnimationToWorker(this._id,t),i._wasmUrl&&this._sendMessage("setWasmUrl",{url:i._wasmUrl}),this._create(e),this._worker.addEventListener("message",this._handleWorkerEvent.bind(this));}async _handleWorkerEvent(e){let t=e.data;t.id||(t.method==="onLoad"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onComplete"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onDestroy"&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method==="onUnfreeze"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._dotLottieInstanceState.isFrozen=!1,this._eventManager.dispatch(t.result.event)),t.method==="onFrame"&&t.result.instanceId===this._id&&(this._dotLottieInstanceState.currentFrame=t.result.event.currentFrame,this._eventManager.dispatch(t.result.event)),t.method==="onRender"&&t.result.instanceId===this._id&&this._eventManager.dispatch(t.result.event),t.method==="onFreeze"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onPause"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onPlay"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onStop"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onLoadError"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)),t.method==="onReady"&&t.result.instanceId===this._id&&(await this._updateDotLottieInstanceState(),this._eventManager.dispatch(t.result.event)));}async _create(e){let t;this._canvas instanceof HTMLCanvasElement?t=this._canvas.transferControlToOffscreen():t=this._canvas;let{instanceId:n}=await this._sendMessage("create",{instanceId:this._id,config:{...e,canvas:t},...f(this._canvas)},[t]);if(n!==this._id)throw new Error("Instance ID mismatch");this._created=!0,await this._updateDotLottieInstanceState();}get isLoaded(){return this._dotLottieInstanceState.isLoaded}get isPlaying(){return this._dotLottieInstanceState.isPlaying}get isPaused(){return this._dotLottieInstanceState.isPaused}get isStopped(){return this._dotLottieInstanceState.isStopped}get currentFrame(){return this._dotLottieInstanceState.currentFrame}get isFrozen(){return this._dotLottieInstanceState.isFrozen}get segmentDuration(){return this._dotLottieInstanceState.segmentDuration}get totalFrames(){return this._dotLottieInstanceState.totalFrames}get segment(){return this._dotLottieInstanceState.segment}get speed(){return this._dotLottieInstanceState.speed}get duration(){return this._dotLottieInstanceState.duration}get isReady(){return this._dotLottieInstanceState.isReady}get mode(){return this._dotLottieInstanceState.mode}get canvas(){return this._canvas}get autoplay(){return this._dotLottieInstanceState.autoplay}get backgroundColor(){return this._dotLottieInstanceState.backgroundColor}get loop(){return this._dotLottieInstanceState.loop}get useFrameInterpolation(){return this._dotLottieInstanceState.useFrameInterpolation}get renderConfig(){return this._dotLottieInstanceState.renderConfig}get manifest(){return this._dotLottieInstanceState.manifest}get activeAnimationId(){return this._dotLottieInstanceState.activeAnimationId}get marker(){return this._dotLottieInstanceState.marker}get activeThemeId(){return this._dotLottieInstanceState.activeThemeId}get layout(){return this._dotLottieInstanceState.layout}async play(){this._created&&(await this._sendMessage("play",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async pause(){this._created&&(await this._sendMessage("pause",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async stop(){this._created&&(await this._sendMessage("stop",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSpeed(e){this._created&&(await this._sendMessage("setSpeed",{instanceId:this._id,speed:e}),await this._updateDotLottieInstanceState());}async setMode(e){this._created&&(await this._sendMessage("setMode",{instanceId:this._id,mode:e}),await this._updateDotLottieInstanceState());}async setFrame(e){this._created&&(await this._sendMessage("setFrame",{frame:e,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setSegment(e,t){this._created&&(await this._sendMessage("setSegment",{instanceId:this._id,segment:[e,t]}),await this._updateDotLottieInstanceState());}async setRenderConfig(e){this._created&&(await this._sendMessage("setRenderConfig",{instanceId:this._id,renderConfig:e}),await this._updateDotLottieInstanceState());}async setUseFrameInterpolation(e){this._created&&(await this._sendMessage("setUseFrameInterpolation",{instanceId:this._id,useFrameInterpolation:e}),await this._updateDotLottieInstanceState());}async loadTheme(e){if(!this._created)return !1;let t=this._sendMessage("loadTheme",{instanceId:this._id,themeId:e});return await this._updateDotLottieInstanceState(),t}async load(e){this._created&&(await this._sendMessage("load",{config:e,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLoop(e){this._created&&(await this._sendMessage("setLoop",{instanceId:this._id,loop:e}),await this._updateDotLottieInstanceState());}async resize(){if(!this._created)return;let{height:e,width:t}=f(this._canvas);this._canvas.width=t,this._canvas.height=e,await this._sendMessage("resize",{height:e,instanceId:this._id,width:t}),await this._updateDotLottieInstanceState();}async destroy(){this._created&&(this._created=!1,await this._sendMessage("destroy",{instanceId:this._id}),this._cleanupStateMachineListeners(),i._workerManager.unassignAnimationFromWorker(this._id),this._eventManager.removeAllEventListeners());}async freeze(){this._created&&(await this._sendMessage("freeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async unfreeze(){this._created&&(await this._sendMessage("unfreeze",{instanceId:this._id}),await this._updateDotLottieInstanceState());}async setBackgroundColor(e){this._created&&(await this._sendMessage("setBackgroundColor",{instanceId:this._id,backgroundColor:e}),await this._updateDotLottieInstanceState());}async loadAnimation(e){this._created&&(await this._sendMessage("loadAnimation",{animationId:e,instanceId:this._id}),await this._updateDotLottieInstanceState());}async setLayout(e){this._created&&(await this._sendMessage("setLayout",{instanceId:this._id,layout:e}),await this._updateDotLottieInstanceState());}async _updateDotLottieInstanceState(){if(!this._created)return;let e=await this._sendMessage("getDotLottieInstanceState",{instanceId:this._id});this._dotLottieInstanceState=e.state;}markers(){return this._dotLottieInstanceState.markers}async setMarker(e){this._created&&(await this._sendMessage("setMarker",{instanceId:this._id,marker:e}),await this._updateDotLottieInstanceState());}async loadThemeData(e){if(!this._created)return !1;let t=await this._sendMessage("loadThemeData",{instanceId:this._id,themeData:e});return await this._updateDotLottieInstanceState(),t}async setViewport(e,t,n,o){return this._created?this._sendMessage("setViewport",{x:e,y:t,width:n,height:o,instanceId:this._id}):!1}async _sendMessage(e,t,n){let o={id:`dotlottie-request-${v()}`,method:e,params:t};return this._worker.postMessage(o,n||[]),new Promise((s,u)=>{let d=_=>{let l=_.data;l.id===o.id&&(this._worker.removeEventListener("message",d),l.error?u(new Error(`Failed to execute method ${e}: ${l.error}`)):s(l.result));};this._worker.addEventListener("message",d);})}addEventListener(e,t){this._eventManager.addEventListener(e,t);}removeEventListener(e,t){this._eventManager.removeEventListener(e,t);}static setWasmUrl(e){i._wasmUrl=e;}async loadStateMachine(e){if(!this._created)return !1;let t=await this._sendMessage("loadStateMachine",{instanceId:this._id,stateMachineId:e});return await this._updateDotLottieInstanceState(),t}async loadStateMachineData(e){if(!this._created)return !1;let t=await this._sendMessage("loadStateMachineData",{instanceId:this._id,stateMachineData:e});return await this._updateDotLottieInstanceState(),t}async startStateMachine(){if(!this._created)return !1;this._setupStateMachineListeners();let e=await this._sendMessage("startStateMachine",{instanceId:this._id});return await this._updateDotLottieInstanceState(),e}async stopStateMachine(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage("stopStateMachine",{instanceId:this._id})):!1}async postStateMachineEvent(e){return this._created?this._sendMessage("postStateMachineEvent",{event:e,instanceId:this._id}):!1}async getStateMachineListeners(){return this._created?this._sendMessage("getStateMachineListeners",{instanceId:this._id}):[]}_getPointerPosition(e){let t=this._canvas.getBoundingClientRect(),n=this._canvas.width/t.width,o=this._canvas.height/t.height,s=this._dotLottieInstanceState.renderConfig.devicePixelRatio||window.devicePixelRatio||1,u=(e.clientX-t.left)*n/s,d=(e.clientY-t.top)*o/s;return {x:u,y:d}}_onPointerUp(e){let{x:t,y:n}=this._getPointerPosition(e);this.postStateMachineEvent(`OnPointerUp: ${t} ${n}`);}_onPointerDown(e){let{x:t,y:n}=this._getPointerPosition(e);this.postStateMachineEvent(`OnPointerDown: ${t} ${n}`);}_onPointerMove(e){let{x:t,y:n}=this._getPointerPosition(e);this.postStateMachineEvent(`OnPointerMove: ${t} ${n}`);}_onPointerEnter(e){let{x:t,y:n}=this._getPointerPosition(e);this.postStateMachineEvent(`OnPointerEnter: ${t} ${n}`);}_onPointerLeave(e){let{x:t,y:n}=this._getPointerPosition(e);this.postStateMachineEvent(`OnPointerExit: ${t} ${n}`);}_onComplete(){this.postStateMachineEvent("OnComplete");}async _setupStateMachineListeners(){if(p&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let e=await this._sendMessage("getStateMachineListeners",{instanceId:this._id});e.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._onPointerUp.bind(this)),e.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._onPointerDown.bind(this)),e.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._onPointerMove.bind(this)),e.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._onPointerEnter.bind(this)),e.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._onPointerLeave.bind(this)),e.includes("Complete")&&this.addEventListener("complete",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){p&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._onPointerUp.bind(this)),this._canvas.removeEventListener("pointerdown",this._onPointerDown.bind(this)),this._canvas.removeEventListener("pointermove",this._onPointerMove.bind(this)),this._canvas.removeEventListener("pointerenter",this._onPointerEnter.bind(this)),this._canvas.removeEventListener("pointerleave",this._onPointerLeave.bind(this)),this.removeEventListener("complete",this._onComplete.bind(this)));}};a(i,"_workerManager",new h),a(i,"_wasmUrl","");var g=i;
10
-
11
- exports.DotLottieWorker = g;
12
- //# sourceMappingURL=out.js.map
13
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/constants.ts","../../src/event-manager.ts","../../src/worker/dotlottie.worker.js","../../src/worker/worker-manager.ts","../../src/worker/dotlottie.ts"],"names":["IS_BROWSER","ZIP_SIGNATURE","EventManager","__publicField","type","listener","listeners","event","dotlottie_worker_default","WorkerManager","workerName","blob","workerId","animationId","message","transfer","worker","getCanvasSize","canvas","height","width","generateUniqueId","_DotLottieWorker","config","rpcResponse","offscreen","instanceId","speed","mode","frame","start","end","renderConfig","useFrameInterpolation","themeId","result","loop","backgroundColor","layout","marker","themeData","loaded","x","y","method","params","rpcRequest","resolve","reject","onMessage","url","stateMachineId","stateMachineData","rect","scaleX","scaleY","devicePixelRatio","DotLottieWorker"],"mappings":";;;;;;;oKAAO,IAAMA,EAAa,OAAO,OAAW,KAAe,OAAO,OAAO,SAAa,IAG/E,IAAMC,EAAgB,IAAI,WAAW,CAAC,GAAM,GAAM,EAAM,CAA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,IAAI,CAAC,EAC9E,KAAK,QAAQ,oBAAoB,cAAe,KAAK,eAAe,KAAK,IAAI,CAAC,EAC9E,KAAK,QAAQ,oBAAoB,eAAgB,KAAK,gBAAgB,KAAK,IAAI,CAAC,EAChF,KAAK,QAAQ,oBAAoB,eAAgB,KAAK,gBAAgB,KAAK,IAAI,CAAC,EAChF,KAAK,oBAAoB,WAAY,KAAK,YAAY,KAAK,IAAI,CAAC,EAEpE,CACF,EA9nBEG,EADWmB,EACa,iBAAiB,IAAIb,GAuC7CN,EAxCWmB,EAwCI,WAAmB,IAxC7B,IAAMmC,EAANnC","sourcesContent":["export const IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nexport const MS_TO_SEC_FACTOR = 1000;\nexport const DEFAULT_BG_COLOR = '#00000000';\nexport const ZIP_SIGNATURE = new Uint8Array([0x50, 0x4b, 0x03, 0x04]);\nexport const LOTTIE_JSON_MANDATORY_FIELDS = ['v', 'ip', 'op', 'layers', 'fr', 'w', 'h'];\n","/**\n * Represents the different types of events that can be dispatched.\n */\nexport type EventType =\n | 'complete'\n | 'frame'\n | 'load'\n | 'loadError'\n | 'loop'\n | 'pause'\n | 'play'\n | 'stop'\n | 'destroy'\n | 'freeze'\n | 'unfreeze'\n | 'render'\n | 'ready';\n\n/**\n * Maps an event type string to its respective event interface.\n */\ntype EventByType<T> = T extends 'complete'\n ? CompleteEvent\n : T extends 'frame'\n ? FrameEvent\n : T extends 'load'\n ? LoadEvent\n : T extends 'loadError'\n ? LoadErrorEvent\n : T extends 'loop'\n ? LoopEvent\n : T extends 'pause'\n ? PauseEvent\n : T extends 'play'\n ? PlayEvent\n : T extends 'stop'\n ? StopEvent\n : T extends 'destroy'\n ? DestroyEvent\n : T extends 'freeze'\n ? FreezeEvent\n : T extends 'unfreeze'\n ? UnfreezeEvent\n : T extends 'render'\n ? RenderEvent\n : T extends 'ready'\n ? ReadyEvent\n : never;\n\n/**\n * Base interface for all events.\n */\nexport interface BaseEvent {\n type: EventType;\n}\n\nexport interface RenderEvent extends BaseEvent {\n currentFrame: number;\n type: 'render';\n}\n\nexport interface FreezeEvent extends BaseEvent {\n type: 'freeze';\n}\n\nexport interface UnfreezeEvent extends BaseEvent {\n type: 'unfreeze';\n}\n\n/*\n * Event fired when a destroy action occurs.\n */\nexport interface DestroyEvent extends BaseEvent {\n type: 'destroy';\n}\n\n/**\n * Event fired when a loop action occurs.\n */\nexport interface LoopEvent extends BaseEvent {\n loopCount: number;\n type: 'loop';\n}\n\n/**\n * Event fired during frame changes.\n */\nexport interface FrameEvent extends BaseEvent {\n currentFrame: number;\n type: 'frame';\n}\n\n/**\n * Event fired when a load action occurs.\n */\nexport interface LoadEvent extends BaseEvent {\n type: 'load';\n}\n\n/**\n * Event fired when a loading error occurs.\n */\nexport interface LoadErrorEvent extends BaseEvent {\n error: Error;\n type: 'loadError';\n}\n\n/**\n * Event fired when a completion action occurs.\n */\nexport interface CompleteEvent extends BaseEvent {\n type: 'complete';\n}\n\n/**\n * Event fired when a pause action occurs.\n */\nexport interface PauseEvent extends BaseEvent {\n type: 'pause';\n}\n\n/**\n * Event fired when a play action occurs.\n */\nexport interface PlayEvent extends BaseEvent {\n type: 'play';\n}\n\n/**\n * Event fired when a stop action occurs.\n */\nexport interface StopEvent extends BaseEvent {\n type: 'stop';\n}\n\n/**\n * Event fired when a WASM module is initialized and ready.\n */\nexport interface ReadyEvent extends BaseEvent {\n type: 'ready';\n}\n\n/**\n * Type representing all possible event types.\n */\nexport type Event =\n | LoopEvent\n | FrameEvent\n | LoadEvent\n | LoadErrorEvent\n | CompleteEvent\n | PauseEvent\n | PlayEvent\n | StopEvent\n | DestroyEvent\n | FreezeEvent\n | UnfreezeEvent\n | RenderEvent\n | ReadyEvent;\n\nexport interface EventListener<T extends EventType> {\n (event: EventByType<T>): void;\n}\n\n/**\n * Manages registration and dispatching of event listeners.\n */\nexport class EventManager {\n private readonly _eventListeners: Map<EventType, Set<EventListener<EventType>>> = new Map();\n\n public addEventListener<T extends EventType>(type: T, listener: EventListener<T>): void {\n let listeners = this._eventListeners.get(type);\n\n if (!listeners) {\n listeners = new Set<EventListener<T>>();\n this._eventListeners.set(type, listeners);\n }\n\n listeners.add(listener);\n }\n\n public removeEventListener<T extends EventType>(type: T, listener?: EventListener<T>): void {\n const listeners = this._eventListeners.get(type);\n\n if (!listeners) return;\n\n if (listener) {\n listeners.delete(listener);\n\n if (listeners.size === 0) {\n this._eventListeners.delete(type);\n }\n } else {\n this._eventListeners.delete(type);\n }\n }\n\n public dispatch<T extends EventType>(event: EventByType<T>): void {\n const listeners = this._eventListeners.get(event.type);\n\n listeners?.forEach((listener) => listener(event));\n }\n\n public removeAllEventListeners(): void {\n this._eventListeners.clear();\n }\n}\n","/**\n * This is a worker script for dotlottie.\n * Do not modify this file directly.\n * As it's generated by the build process.\n */\n \nvar $n=Object.defineProperty;var kn=(s,n,r)=>n in s?$n(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r;var I=(s,n,r)=>kn(s,typeof n!=\"symbol\"?n+\"\":n,r);var Xe=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},Ze=class{constructor(){I(this,\"_lastHandleId\",0);I(this,\"_lastImmediate\",null);}requestAnimationFrame(n){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{n(Date.now());}),this._lastHandleId}cancelAnimationFrame(n){this._lastImmediate&&clearImmediate(this._lastImmediate);}},Ie=class{constructor(){I(this,\"_strategy\");this._strategy=typeof requestAnimationFrame==\"function\"?new Xe:new Ze;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var te=typeof window<\"u\"&&typeof window.document<\"u\";var xe=new Uint8Array([80,75,3,4]),jt=[\"v\",\"ip\",\"op\",\"layers\",\"fr\",\"w\",\"h\"];var fe={name:\"@lottiefiles/dotlottie-web\",version:\"0.29.2\",type:\"module\",description:\"Lottie and DotLottie player for the web\",repository:{type:\"git\",url:\"git+https://github.com/LottieFiles/dotlottie-web.git\",directory:\"packages/web\"},homepage:\"https://github.com/LottieFiles/dotlottie-web#readme\",bugs:\"https://github.com/LottieFiles/dotlottie-web/issues\",author:\"LottieFiles\",contributors:[\"Abdelrahman Ashraf <a.theashraf@gmail.com>\"],license:\"MIT\",main:\"dist/index.cjs\",module:\"dist/index.js\",types:\"dist/index.d.ts\",files:[\"dist\"],keywords:[\"dotlottie\",\"lottie\",\"player\",\"animation\",\"web\",\"canvas\",\"javascript\",\"thorvg\"],scripts:{build:\"tsup\",dev:\"tsup --watch\",lint:\"eslint --fix .\",\"stats:eslint\":\"cross-env TIMING=1 eslint .\",\"stats:ts\":\"tsc -p tsconfig.build.json --extendedDiagnostics\",test:\"vitest run --browser.headless\",\"test:coverage\":\"vitest run --browser.headless --coverage\",\"test:watch\":\"vitest\",\"type-check\":\"tsc --noEmit\"},devDependencies:{\"@types/node\":\"^20.14.11\",\"@vitest/browser\":\"^2.0.3\",\"@vitest/coverage-istanbul\":\"^2.0.3\",\"cross-env\":\"7.0.3\",playwright:\"^1.45.2\",tsup:\"8.1.0\",typescript:\"5.0.4\",vitest:\"^2.0.3\"},publishConfig:{access:\"public\"}};var On=(()=>{var s=typeof document<\"u\"?document.currentScript?.src:void 0;return function(n={}){var r=n,c,_,$=new Promise((e,t)=>{c=e,_=t;}),U=Object.assign({},r),V=\"./this.program\",j=\"\";typeof document<\"u\"&&document.currentScript&&(j=document.currentScript.src),s&&(j=s),j.startsWith(\"blob:\")?j=\"\":j=j.substr(0,j.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1);var Nt=r.print||console.log.bind(console),Z=r.printErr||console.error.bind(console);Object.assign(r,U),U=null,r.thisProgram&&(V=r.thisProgram);var ne;r.wasmBinary&&(ne=r.wasmBinary);var ve,at=!1,Y,b,Q,re,P,L,ot,it;function st(){var e=ve.buffer;r.HEAP8=Y=new Int8Array(e),r.HEAP16=Q=new Int16Array(e),r.HEAPU8=b=new Uint8Array(e),r.HEAPU16=re=new Uint16Array(e),r.HEAP32=P=new Int32Array(e),r.HEAPU32=L=new Uint32Array(e),r.HEAPF32=ot=new Float32Array(e),r.HEAPF64=it=new Float64Array(e);}var lt=[],dt=[],ct=[];function Vt(){var e=r.preRun.shift();lt.unshift(e);}var J=0,ae=null;function ye(e){throw r.onAbort?.(e),e=\"Aborted(\"+e+\")\",Z(e),at=!0,e=new WebAssembly.RuntimeError(e+\". Build with -sASSERTIONS for more info.\"),_(e),e}var ut=e=>e.startsWith(\"data:application/octet-stream;base64,\"),q;if(q=\"DotLottiePlayer.wasm\",!ut(q)){var ht=q;q=r.locateFile?r.locateFile(ht,j):j+ht;}function pt(e){if(e==q&&ne)return new Uint8Array(ne);throw \"both async and sync fetching of the wasm failed\"}function Yt(e){return ne||typeof fetch!=\"function\"?Promise.resolve().then(()=>pt(e)):fetch(e,{credentials:\"same-origin\"}).then(t=>{if(!t.ok)throw `failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>pt(e))}function ft(e,t,a){return Yt(e).then(o=>WebAssembly.instantiate(o,t)).then(a,o=>{Z(`failed to asynchronously prepare wasm: ${o}`),ye(o);})}function Jt(e,t){var a=q;return ne||typeof WebAssembly.instantiateStreaming!=\"function\"||ut(a)||typeof fetch!=\"function\"?ft(a,e,t):fetch(a,{credentials:\"same-origin\"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(t,function(i){return Z(`wasm streaming compile failed: ${i}`),Z(\"falling back to ArrayBuffer instantiation\"),ft(a,e,t)}))}var Te=e=>{for(;0<e.length;)e.shift()(r);},mt=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0,G=(e,t,a)=>{var o=t+a;for(a=t;e[a]&&!(a>=o);)++a;if(16<a-t&&e.buffer&&mt)return mt.decode(e.subarray(t,a));for(o=\"\";t<a;){var i=e[t++];if(i&128){var l=e[t++]&63;if((i&224)==192)o+=String.fromCharCode((i&31)<<6|l);else {var h=e[t++]&63;i=(i&240)==224?(i&15)<<12|l<<6|h:(i&7)<<18|l<<12|h<<6|e[t++]&63,65536>i?o+=String.fromCharCode(i):(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023));}}else o+=String.fromCharCode(i);}return o};class Gt{constructor(t){this.ya=t-24;}}var vt=0,yt=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++a):t+=3;}return t},gt=(e,t,a,o)=>{if(0<o){o=a+o-1;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(127>=l){if(a>=o)break;t[a++]=l;}else {if(2047>=l){if(a+1>=o)break;t[a++]=192|l>>6;}else {if(65535>=l){if(a+2>=o)break;t[a++]=224|l>>12;}else {if(a+3>=o)break;t[a++]=240|l>>18,t[a++]=128|l>>12&63;}t[a++]=128|l>>6&63;}t[a++]=128|l&63;}}t[a]=0;}},ge={},Se=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function oe(e){return this.fromWireType(L[e>>2])}var ee={},K={},we={},ie,H=(e,t,a)=>{function o(u){if(u=a(u),u.length!==e.length)throw new ie(\"Mismatched type converter count\");for(var f=0;f<e.length;++f)k(e[f],u[f]);}e.forEach(function(u){we[u]=t;});var i=Array(t.length),l=[],h=0;t.forEach((u,f)=>{K.hasOwnProperty(u)?i[f]=K[u]:(l.push(u),ee.hasOwnProperty(u)||(ee[u]=[]),ee[u].push(()=>{i[f]=K[u],++h,h===l.length&&o(i);}));}),l.length===0&&o(i);},wt,A=e=>{for(var t=\"\";b[e];)t+=wt[b[e++]];return t},g;function Xt(e,t,a={}){var o=t.name;if(!e)throw new g(`type \"${o}\" must have a positive integer typeid pointer`);if(K.hasOwnProperty(e)){if(a.ib)return;throw new g(`Cannot register type '${o}' twice`)}K[e]=t,delete we[e],ee.hasOwnProperty(e)&&(t=ee[e],delete ee[e],t.forEach(i=>i()));}function k(e,t,a={}){if(!(\"argPackAdvance\"in t))throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");return Xt(e,t,a)}var Re=e=>{throw new g(e.ma.za.xa.name+\" instance already deleted\")},$e=!1,_t=()=>{},Et=(e,t,a)=>t===a?e:a.Ca===void 0?null:(e=Et(e,t,a.Ca),e===null?null:a.ab(e)),Ct={},se=[],ke=()=>{for(;se.length;){var e=se.pop();e.ma.Ka=!1,e.delete();}},le,de={},Zt=(e,t)=>{if(t===void 0)throw new g(\"ptr should not be undefined\");for(;e.Ca;)t=e.Na(t),e=e.Ca;return de[t]},_e=(e,t)=>{if(!t.za||!t.ya)throw new ie(\"makeClassHandle requires ptr and ptrType\");if(!!t.Da!=!!t.Aa)throw new ie(\"Both smartPtrType and smartPtr must be specified\");return t.count={value:1},ce(Object.create(e,{ma:{value:t,writable:!0}}))},ce=e=>typeof FinalizationRegistry>\"u\"?(ce=t=>t,e):($e=new FinalizationRegistry(t=>{t=t.ma,--t.count.value,t.count.value===0&&(t.Aa?t.Da.Fa(t.Aa):t.za.xa.Fa(t.ya));}),ce=t=>{var a=t.ma;return a.Aa&&$e.register(t,{ma:a},t),t},_t=t=>{$e.unregister(t);},ce(e));function Ee(){}var ue=(e,t)=>Object.defineProperty(t,\"name\",{value:e}),Mt=(e,t,a)=>{if(e[t].Ba===void 0){var o=e[t];e[t]=function(...i){if(!e[t].Ba.hasOwnProperty(i.length))throw new g(`Function '${a}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].Ba})!`);return e[t].Ba[i.length].apply(this,i)},e[t].Ba=[],e[t].Ba[o.Oa]=o;}},De=(e,t,a)=>{if(r.hasOwnProperty(e)){if(a===void 0||r[e].Ba!==void 0&&r[e].Ba[a]!==void 0)throw new g(`Cannot register public name '${e}' twice`);if(Mt(r,e,e),r.hasOwnProperty(a))throw new g(`Cannot register multiple overloads of a function with the same number of arguments (${a})!`);r[e].Ba[a]=t;}else r[e]=t,a!==void 0&&(r[e].vb=a);},Qt=e=>{if(e===void 0)return \"_unknown\";e=e.replace(/[^a-zA-Z0-9_]/g,\"$\");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function qt(e,t,a,o,i,l,h,u){this.name=e,this.constructor=t,this.La=a,this.Fa=o,this.Ca=i,this.cb=l,this.Na=h,this.ab=u,this.kb=[];}var Oe=(e,t,a)=>{for(;t!==a;){if(!t.Na)throw new g(`Expected null or instance of ${a.name}, got an instance of ${t.name}`);e=t.Na(e),t=t.Ca;}return e};function en(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass \"${Ne(t)}\" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function tn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);if(this.Qa){var a=this.Ua();return e!==null&&e.push(this.Fa,a),a}return 0}if(!t||!t.ma)throw new g(`Cannot pass \"${Ne(t)}\" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Pa&&t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);if(a=Oe(t.ma.ya,t.ma.za.xa,this.xa),this.Qa){if(t.ma.Aa===void 0)throw new g(\"Passing raw pointer to smart pointer is illegal\");switch(this.pb){case 0:if(t.ma.Da===this)a=t.ma.Aa;else throw new g(`Cannot convert argument of type ${t.ma.Da?t.ma.Da.name:t.ma.za.name} to parameter type ${this.name}`);break;case 1:a=t.ma.Aa;break;case 2:if(t.ma.Da===this)a=t.ma.Aa;else {var o=t.clone();a=this.lb(a,Me(()=>o.delete())),e!==null&&e.push(this.Fa,a);}break;default:throw new g(\"Unsupporting sharing policy\")}}return a}function nn(e,t){if(t===null){if(this.Ta)throw new g(`null is not a valid ${this.name}`);return 0}if(!t.ma)throw new g(`Cannot pass \"${Ne(t)}\" as a ${this.name}`);if(!t.ma.ya)throw new g(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.ma.za.Pa)throw new g(`Cannot convert argument of type ${t.ma.za.name} to parameter type ${this.name}`);return Oe(t.ma.ya,t.ma.za.xa,this.xa)}function he(e,t,a,o,i,l,h,u,f,p,m){this.name=e,this.xa=t,this.Ta=a,this.Pa=o,this.Qa=i,this.jb=l,this.pb=h,this.Za=u,this.Ua=f,this.lb=p,this.Fa=m,i||t.Ca!==void 0?this.toWireType=tn:(this.toWireType=o?en:nn,this.Ea=null);}var Lt=(e,t,a)=>{if(!r.hasOwnProperty(e))throw new ie(\"Replacing nonexistent public symbol\");r[e].Ba!==void 0&&a!==void 0?r[e].Ba[a]=t:(r[e]=t,r[e].Oa=a);},R,rn=(e,t,a=[])=>(e.includes(\"j\")?(e=e.replace(/p/g,\"i\"),t=(0, r[\"dynCall_\"+e])(t,...a)):t=R.get(t)(...a),t),an=(e,t)=>(...a)=>rn(e,t,a),T=(e,t)=>{e=A(e);var a=e.includes(\"j\")?an(e,t):R.get(t);if(typeof a!=\"function\")throw new g(`unknown function pointer with signature ${e}: ${t}`);return a},bt,Ft=e=>{e=kt(e);var t=A(e);return W(e),t},Ce=(e,t)=>{function a(l){i[l]||K[l]||(we[l]?we[l].forEach(a):(o.push(l),i[l]=!0));}var o=[],i={};throw t.forEach(a),new bt(`${e}: `+o.map(Ft).join([\", \"]))},ze=(e,t)=>{for(var a=[],o=0;o<e;o++)a.push(L[t+4*o>>2]);return a};function on(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].Ea===void 0)return !0;return !1}function je(e,t,a,o,i){var l=t.length;if(2>l)throw new g(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");var h=t[1]!==null&&a!==null,u=on(t),f=t[0].name!==\"void\",p=l-2,m=Array(p),w=[],C=[];return ue(e,function(...d){if(d.length!==p)throw new g(`function ${e} called with ${d.length} arguments, expected ${p}`);if(C.length=0,w.length=h?2:1,w[0]=i,h){var v=t[1].toWireType(C,this);w[1]=v;}for(var y=0;y<p;++y)m[y]=t[y+2].toWireType(C,d[y]),w.push(m[y]);if(d=o(...w),u)Se(C);else for(y=h?1:2;y<t.length;y++){var x=y===1?v:m[y-2];t[y].Ea!==null&&t[y].Ea(x);}return v=f?t[0].fromWireType(d):void 0,v})}var It=e=>{e=e.trim();let t=e.indexOf(\"(\");return t!==-1?e.substr(0,t):e},Be=[],B=[],We=e=>{9<e&&--B[e+1]===0&&(B[e]=void 0,Be.push(e));},Ue=e=>{if(!e)throw new g(\"Cannot use deleted val. handle = \"+e);return B[e]},Me=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Be.pop()||B.length;return B[t]=e,B[t+1]=1,t}},xt={name:\"emscripten::val\",fromWireType:e=>{var t=Ue(e);return We(e),t},toWireType:(e,t)=>Me(t),argPackAdvance:8,readValueFromPointer:oe,Ea:null},sn=(e,t,a)=>{switch(t){case 1:return a?function(o){return this.fromWireType(Y[o])}:function(o){return this.fromWireType(b[o])};case 2:return a?function(o){return this.fromWireType(Q[o>>1])}:function(o){return this.fromWireType(re[o>>1])};case 4:return a?function(o){return this.fromWireType(P[o>>2])}:function(o){return this.fromWireType(L[o>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},He=(e,t)=>{var a=K[e];if(a===void 0)throw e=`${t} has unknown type ${Ft(e)}`,new g(e);return a},Ne=e=>{if(e===null)return \"null\";var t=typeof e;return t===\"object\"||t===\"array\"||t===\"function\"?e.toString():\"\"+e},ln=(e,t)=>{switch(t){case 4:return function(a){return this.fromWireType(ot[a>>2])};case 8:return function(a){return this.fromWireType(it[a>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},dn=(e,t,a)=>{switch(t){case 1:return a?o=>Y[o]:o=>b[o];case 2:return a?o=>Q[o>>1]:o=>re[o>>1];case 4:return a?o=>P[o>>2]:o=>L[o>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},At=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0,cn=(e,t)=>{for(var a=e>>1,o=a+t/2;!(a>=o)&&re[a];)++a;if(a<<=1,32<a-e&&At)return At.decode(b.subarray(e,a));for(a=\"\",o=0;!(o>=t/2);++o){var i=Q[e+2*o>>1];if(i==0)break;a+=String.fromCharCode(i);}return a},un=(e,t,a)=>{if(a??(a=2147483647),2>a)return 0;a-=2;var o=t;a=a<2*e.length?a/2:e.length;for(var i=0;i<a;++i)Q[t>>1]=e.charCodeAt(i),t+=2;return Q[t>>1]=0,t-o},hn=e=>2*e.length,pn=(e,t)=>{for(var a=0,o=\"\";!(a>=t/4);){var i=P[e+4*a>>2];if(i==0)break;++a,65536<=i?(i-=65536,o+=String.fromCharCode(55296|i>>10,56320|i&1023)):o+=String.fromCharCode(i);}return o},fn=(e,t,a)=>{if(a??(a=2147483647),4>a)return 0;var o=t;a=o+a-4;for(var i=0;i<e.length;++i){var l=e.charCodeAt(i);if(55296<=l&&57343>=l){var h=e.charCodeAt(++i);l=65536+((l&1023)<<10)|h&1023;}if(P[t>>2]=l,t+=4,t+4>a)break}return P[t>>2]=0,t-o},mn=e=>{for(var t=0,a=0;a<e.length;++a){var o=e.charCodeAt(a);55296<=o&&57343>=o&&++a,t+=4;}return t},Ve=[],vn=e=>{var t=Ve.length;return Ve.push(e),t},yn=(e,t)=>{for(var a=Array(e),o=0;o<e;++o)a[o]=He(L[t+4*o>>2],\"parameter \"+o);return a},gn=Reflect.construct,Ye={},Pt=()=>{if(!Je){var e={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:V||\"./this.program\"},t;for(t in Ye)Ye[t]===void 0?delete e[t]:e[t]=Ye[t];var a=[];for(t in e)a.push(`${t}=${e[t]}`);Je=a;}return Je},Je,wn=[null,[],[]],_n=()=>{if(typeof crypto==\"object\"&&typeof crypto.getRandomValues==\"function\")return e=>crypto.getRandomValues(e);ye(\"initRandomDevice\");},Tt=e=>(Tt=_n())(e),Le=e=>e%4===0&&(e%100!==0||e%400===0),St=[31,29,31,30,31,30,31,31,30,31,30,31],Rt=[31,28,31,30,31,30,31,31,30,31,30,31];function En(e){var t=Array(yt(e)+1);return gt(e,t,0,t.length),t}var Cn=(e,t,a,o)=>{function i(d,v,y){for(d=typeof d==\"number\"?d.toString():d||\"\";d.length<v;)d=y[0]+d;return d}function l(d,v){return i(d,v,\"0\")}function h(d,v){function y(N){return 0>N?-1:0<N?1:0}var x;return (x=y(d.getFullYear()-v.getFullYear()))===0&&(x=y(d.getMonth()-v.getMonth()))===0&&(x=y(d.getDate()-v.getDate())),x}function u(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function f(d){var v=d.Ia;for(d=new Date(new Date(d.Ja+1900,0,1).getTime());0<v;){var y=d.getMonth(),x=(Le(d.getFullYear())?St:Rt)[y];if(v>x-d.getDate())v-=x-d.getDate()+1,d.setDate(1),11>y?d.setMonth(y+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else {d.setDate(d.getDate()+v);break}}return y=new Date(d.getFullYear()+1,0,4),v=u(new Date(d.getFullYear(),0,4)),y=u(y),0>=h(v,d)?0>=h(y,d)?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}var p=L[o+40>>2];o={sb:P[o>>2],rb:P[o+4>>2],Ra:P[o+8>>2],Va:P[o+12>>2],Sa:P[o+16>>2],Ja:P[o+20>>2],Ga:P[o+24>>2],Ia:P[o+28>>2],wb:P[o+32>>2],qb:P[o+36>>2],tb:p&&p?G(b,p):\"\"},a=a?G(b,a):\"\",p={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var m in p)a=a.replace(new RegExp(m,\"g\"),p[m]);var w=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),C=\"January February March April May June July August September October November December\".split(\" \");p={\"%a\":d=>w[d.Ga].substring(0,3),\"%A\":d=>w[d.Ga],\"%b\":d=>C[d.Sa].substring(0,3),\"%B\":d=>C[d.Sa],\"%C\":d=>l((d.Ja+1900)/100|0,2),\"%d\":d=>l(d.Va,2),\"%e\":d=>i(d.Va,2,\" \"),\"%g\":d=>f(d).toString().substring(2),\"%G\":f,\"%H\":d=>l(d.Ra,2),\"%I\":d=>(d=d.Ra,d==0?d=12:12<d&&(d-=12),l(d,2)),\"%j\":d=>{for(var v=0,y=0;y<=d.Sa-1;v+=(Le(d.Ja+1900)?St:Rt)[y++]);return l(d.Va+v,3)},\"%m\":d=>l(d.Sa+1,2),\"%M\":d=>l(d.rb,2),\"%n\":()=>`\n`,\"%p\":d=>0<=d.Ra&&12>d.Ra?\"AM\":\"PM\",\"%S\":d=>l(d.sb,2),\"%t\":()=>\"\t\",\"%u\":d=>d.Ga||7,\"%U\":d=>l(Math.floor((d.Ia+7-d.Ga)/7),2),\"%V\":d=>{var v=Math.floor((d.Ia+7-(d.Ga+6)%7)/7);if(2>=(d.Ga+371-d.Ia-2)%7&&v++,v)v==53&&(y=(d.Ga+371-d.Ia)%7,y==4||y==3&&Le(d.Ja)||(v=1));else {v=52;var y=(d.Ga+7-d.Ia-1)%7;(y==4||y==5&&Le(d.Ja%400-1))&&v++;}return l(v,2)},\"%w\":d=>d.Ga,\"%W\":d=>l(Math.floor((d.Ia+7-(d.Ga+6)%7)/7),2),\"%y\":d=>(d.Ja+1900).toString().substring(2),\"%Y\":d=>d.Ja+1900,\"%z\":d=>{d=d.qb;var v=0<=d;return d=Math.abs(d)/60,(v?\"+\":\"-\")+(\"0000\"+(d/60*100+d%60)).slice(-4)},\"%Z\":d=>d.tb,\"%%\":()=>\"%\"},a=a.replace(/%%/g,\"\\0\\0\");for(m in p)a.includes(m)&&(a=a.replace(new RegExp(m,\"g\"),p[m](o)));return a=a.replace(/\\0\\0/g,\"%\"),m=En(a),m.length>t?0:(Y.set(m,e),m.length-1)};ie=r.InternalError=class extends Error{constructor(e){super(e),this.name=\"InternalError\";}};for(var $t=Array(256),be=0;256>be;++be)$t[be]=String.fromCharCode(be);wt=$t,g=r.BindingError=class extends Error{constructor(e){super(e),this.name=\"BindingError\";}},Object.assign(Ee.prototype,{isAliasOf:function(e){if(!(this instanceof Ee&&e instanceof Ee))return !1;var t=this.ma.za.xa,a=this.ma.ya;e.ma=e.ma;var o=e.ma.za.xa;for(e=e.ma.ya;t.Ca;)a=t.Na(a),t=t.Ca;for(;o.Ca;)e=o.Na(e),o=o.Ca;return t===o&&a===e},clone:function(){if(this.ma.ya||Re(this),this.ma.Ma)return this.ma.count.value+=1,this;var e=ce,t=Object,a=t.create,o=Object.getPrototypeOf(this),i=this.ma;return e=e(a.call(t,o,{ma:{value:{count:i.count,Ka:i.Ka,Ma:i.Ma,ya:i.ya,za:i.za,Aa:i.Aa,Da:i.Da}}})),e.ma.count.value+=1,e.ma.Ka=!1,e},delete(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g(\"Object already scheduled for deletion\");_t(this);var e=this.ma;--e.count.value,e.count.value===0&&(e.Aa?e.Da.Fa(e.Aa):e.za.xa.Fa(e.ya)),this.ma.Ma||(this.ma.Aa=void 0,this.ma.ya=void 0);},isDeleted:function(){return !this.ma.ya},deleteLater:function(){if(this.ma.ya||Re(this),this.ma.Ka&&!this.ma.Ma)throw new g(\"Object already scheduled for deletion\");return se.push(this),se.length===1&&le&&le(ke),this.ma.Ka=!0,this}}),r.getInheritedInstanceCount=()=>Object.keys(de).length,r.getLiveInheritedInstances=()=>{var e=[],t;for(t in de)de.hasOwnProperty(t)&&e.push(de[t]);return e},r.flushPendingDeletes=ke,r.setDelayFunction=e=>{le=e,se.length&&le&&le(ke);},Object.assign(he.prototype,{eb(e){return this.Za&&(e=this.Za(e)),e},Xa(e){this.Fa?.(e);},argPackAdvance:8,readValueFromPointer:oe,fromWireType:function(e){function t(){return this.Qa?_e(this.xa.La,{za:this.jb,ya:a,Da:this,Aa:e}):_e(this.xa.La,{za:this,ya:e})}var a=this.eb(e);if(!a)return this.Xa(e),null;var o=Zt(this.xa,a);if(o!==void 0)return o.ma.count.value===0?(o.ma.ya=a,o.ma.Aa=e,o.clone()):(o=o.clone(),this.Xa(e),o);if(o=this.xa.cb(a),o=Ct[o],!o)return t.call(this);o=this.Pa?o.$a:o.pointerType;var i=Et(a,this.xa,o.xa);return i===null?t.call(this):this.Qa?_e(o.xa.La,{za:o,ya:i,Da:this,Aa:e}):_e(o.xa.La,{za:o,ya:i})}}),bt=r.UnboundTypeError=((e,t)=>{var a=ue(t,function(o){this.name=t,this.message=o,o=Error(o).stack,o!==void 0&&(this.stack=this.toString()+`\n`+o.replace(/^Error(:[^\\n]*)?\\n/,\"\"));});return a.prototype=Object.create(e.prototype),a.prototype.constructor=a,a.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},a})(Error,\"UnboundTypeError\"),B.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>B.length/2-5-Be.length;var Mn={c:(e,t,a,o)=>{ye(`Assertion failed: ${e?G(b,e):\"\"}, at: `+[t?t?G(b,t):\"\":\"unknown filename\",a,o?o?G(b,o):\"\":\"unknown function\"]);},m:(e,t,a)=>{var o=new Gt(e);throw L[o.ya+16>>2]=0,L[o.ya+4>>2]=t,L[o.ya+8>>2]=a,vt=e,vt},B:function(){return 0},P:()=>{},M:()=>{},R:function(){return 0},N:()=>{},A:function(){},O:()=>{},v:e=>{var t=ge[e];delete ge[e];var a=t.Ua,o=t.Fa,i=t.Ya,l=i.map(h=>h.hb).concat(i.map(h=>h.nb));H([e],l,h=>{var u={};return i.forEach((f,p)=>{var m=h[p],w=f.fb,C=f.gb,d=h[p+i.length],v=f.mb,y=f.ob;u[f.bb]={read:x=>m.fromWireType(w(C,x)),write:(x,N)=>{var S=[];v(y,x,d.toWireType(S,N)),Se(S);}};}),[{name:t.name,fromWireType:f=>{var p={},m;for(m in u)p[m]=u[m].read(f);return o(f),p},toWireType:(f,p)=>{for(var m in u)if(!(m in p))throw new TypeError(`Missing field: \"${m}\"`);var w=a();for(m in u)u[m].write(w,p[m]);return f!==null&&f.push(o,w),w},argPackAdvance:8,readValueFromPointer:oe,Ea:o}]});},I:()=>{},Y:(e,t,a,o)=>{t=A(t),k(e,{name:t,fromWireType:function(i){return !!i},toWireType:function(i,l){return l?a:o},argPackAdvance:8,readValueFromPointer:function(i){return this.fromWireType(b[i])},Ea:null});},r:(e,t,a,o,i,l,h,u,f,p,m,w,C)=>{m=A(m),l=T(i,l),u&&(u=T(h,u)),p&&(p=T(f,p)),C=T(w,C);var d=Qt(m);De(d,function(){Ce(`Cannot construct ${m} due to unbound types`,[o]);}),H([e,t,a],o?[o]:[],v=>{if(v=v[0],o)var y=v.xa,x=y.La;else x=Ee.prototype;v=ue(m,function(...Ke){if(Object.getPrototypeOf(this)!==N)throw new g(\"Use 'new' to construct \"+m);if(S.Ha===void 0)throw new g(m+\" has no accessible constructor\");var zt=S.Ha[Ke.length];if(zt===void 0)throw new g(`Tried to invoke ctor of ${m} with invalid number of parameters (${Ke.length}) - expected (${Object.keys(S.Ha).toString()}) parameters instead!`);return zt.apply(this,Ke)});var N=Object.create(x,{constructor:{value:v}});v.prototype=N;var S=new qt(m,v,N,C,y,l,u,p);if(S.Ca){var pe;(pe=S.Ca).Wa??(pe.Wa=[]),S.Ca.Wa.push(S);}return y=new he(m,S,!0,!1,!1),pe=new he(m+\"*\",S,!1,!1,!1),x=new he(m+\" const*\",S,!1,!0,!1),Ct[e]={pointerType:pe,$a:x},Lt(d,v),[y,pe,x]});},q:(e,t,a,o,i,l)=>{var h=ze(t,a);i=T(o,i),H([],[e],u=>{u=u[0];var f=`constructor ${u.name}`;if(u.xa.Ha===void 0&&(u.xa.Ha=[]),u.xa.Ha[t-1]!==void 0)throw new g(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.xa.Ha[t-1]=()=>{Ce(`Cannot construct ${u.name} due to unbound types`,h);},H([],h,p=>(p.splice(1,0,null),u.xa.Ha[t-1]=je(f,p,null,i,l),[])),[]});},f:(e,t,a,o,i,l,h,u)=>{var f=ze(a,o);t=A(t),t=It(t),l=T(i,l),H([],[e],p=>{function m(){Ce(`Cannot call ${w} due to unbound types`,f);}p=p[0];var w=`${p.name}.${t}`;t.startsWith(\"@@\")&&(t=Symbol[t.substring(2)]),u&&p.xa.kb.push(t);var C=p.xa.La,d=C[t];return d===void 0||d.Ba===void 0&&d.className!==p.name&&d.Oa===a-2?(m.Oa=a-2,m.className=p.name,C[t]=m):(Mt(C,t,w),C[t].Ba[a-2]=m),H([],f,v=>(v=je(w,v,p,l,h),C[t].Ba===void 0?(v.Oa=a-2,C[t]=v):C[t].Ba[a-2]=v,[])),[]});},X:e=>k(e,xt),x:(e,t,a,o)=>{function i(){}t=A(t),i.values={},k(e,{name:t,constructor:i,fromWireType:function(l){return this.constructor.values[l]},toWireType:(l,h)=>h.value,argPackAdvance:8,readValueFromPointer:sn(t,a,o),Ea:null}),De(t,i);},k:(e,t,a)=>{var o=He(e,\"enum\");t=A(t),e=o.constructor,o=Object.create(o.constructor.prototype,{value:{value:a},constructor:{value:ue(`${o.name}_${t}`,function(){})}}),e.values[a]=o,e[t]=o;},C:(e,t,a)=>{t=A(t),k(e,{name:t,fromWireType:o=>o,toWireType:(o,i)=>i,argPackAdvance:8,readValueFromPointer:ln(t,a),Ea:null});},E:(e,t,a,o,i,l)=>{var h=ze(t,a);e=A(e),e=It(e),i=T(o,i),De(e,function(){Ce(`Cannot call ${e} due to unbound types`,h);},t-1),H([],h,u=>(Lt(e,je(e,[u[0],null].concat(u.slice(1)),null,i,l),t-1),[]));},l:(e,t,a,o,i)=>{if(t=A(t),i===-1&&(i=4294967295),i=u=>u,o===0){var l=32-8*a;i=u=>u<<l>>>l;}var h=t.includes(\"unsigned\")?function(u,f){return f>>>0}:function(u,f){return f};k(e,{name:t,fromWireType:i,toWireType:h,argPackAdvance:8,readValueFromPointer:dn(t,a,o!==0),Ea:null});},g:(e,t,a)=>{function o(l){return new i(Y.buffer,L[l+4>>2],L[l>>2])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];a=A(a),k(e,{name:a,fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ib:!0});},w:e=>{k(e,xt);},ca:(e,t,a,o,i,l,h,u,f,p,m,w)=>{a=A(a),l=T(i,l),u=T(h,u),p=T(f,p),w=T(m,w),H([e],[t],C=>(C=C[0],[new he(a,C.xa,!1,!1,!0,C,o,l,u,p,w)]));},D:(e,t)=>{t=A(t);var a=t===\"std::string\";k(e,{name:t,fromWireType:function(o){var i=L[o>>2],l=o+4;if(a)for(var h=l,u=0;u<=i;++u){var f=l+u;if(u==i||b[f]==0){if(h=h?G(b,h,f-h):\"\",p===void 0)var p=h;else p+=\"\\0\",p+=h;h=f+1;}}else {for(p=Array(i),u=0;u<i;++u)p[u]=String.fromCharCode(b[l+u]);p=p.join(\"\");}return W(o),p},toWireType:function(o,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var l=typeof i==\"string\";if(!(l||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array))throw new g(\"Cannot pass non-string to std::string\");var h=a&&l?yt(i):i.length,u=Ge(4+h+1),f=u+4;if(L[u>>2]=h,a&&l)gt(i,b,f,h+1);else if(l)for(l=0;l<h;++l){var p=i.charCodeAt(l);if(255<p)throw W(f),new g(\"String has UTF-16 code units that do not fit in 8 bits\");b[f+l]=p;}else for(l=0;l<h;++l)b[f+l]=i[l];return o!==null&&o.push(W,u),u},argPackAdvance:8,readValueFromPointer:oe,Ea(o){W(o);}});},u:(e,t,a)=>{if(a=A(a),t===2)var o=cn,i=un,l=hn,h=u=>re[u>>1];else t===4&&(o=pn,i=fn,l=mn,h=u=>L[u>>2]);k(e,{name:a,fromWireType:u=>{for(var f=L[u>>2],p,m=u+4,w=0;w<=f;++w){var C=u+4+w*t;(w==f||h(C)==0)&&(m=o(m,C-m),p===void 0?p=m:(p+=\"\\0\",p+=m),m=C+t);}return W(u),p},toWireType:(u,f)=>{if(typeof f!=\"string\")throw new g(`Cannot pass non-string to C++ string type ${a}`);var p=l(f),m=Ge(4+p+t);return L[m>>2]=p/t,i(f,m+4,p+t),u!==null&&u.push(W,m),m},argPackAdvance:8,readValueFromPointer:oe,Ea(u){W(u);}});},s:(e,t,a,o,i,l)=>{ge[e]={name:A(t),Ua:T(a,o),Fa:T(i,l),Ya:[]};},j:(e,t,a,o,i,l,h,u,f,p)=>{ge[e].Ya.push({bb:A(t),hb:a,fb:T(o,i),gb:l,nb:h,mb:T(u,f),ob:p});},Z:(e,t)=>{t=A(t),k(e,{ub:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}});},J:()=>{throw 1/0},aa:(e,t,a,o)=>(e=Ve[e],t=Ue(t),e(null,t,a,o)),F:We,$:(e,t,a)=>{var o=yn(e,t),i=o.shift();e--;var l=Array(e);return t=`methodCaller<(${o.map(h=>h.name).join(\", \")}) => ${i.name}>`,vn(ue(t,(h,u,f,p)=>{for(var m=0,w=0;w<e;++w)l[w]=o[w].readValueFromPointer(p+m),m+=o[w].argPackAdvance;return u=a===1?gn(u,l):u.apply(h,l),h=[],u=i.toWireType(h,u),h.length&&(L[f>>2]=Me(h)),u}))},ba:e=>{9<e&&(B[e+1]+=1);},_:e=>{var t=Ue(e);Se(t),We(e);},o:(e,t)=>(e=He(e,\"_emval_take_value\"),e=e.readValueFromPointer(t),Me(e)),W:()=>{ye(\"\");},V:()=>performance.now(),L:e=>{var t=b.length;if(e>>>=0,2147483648<e)return !1;for(var a=1;4>=a;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var i=Math;o=Math.max(e,o);e:{i=(i.min.call(i,2147483648,o+(65536-o%65536)%65536)-ve.buffer.byteLength+65535)/65536;try{ve.grow(i),st();var l=1;break e}catch{}l=void 0;}if(l)return !0}return !1},S:(e,t)=>{var a=0;return Pt().forEach((o,i)=>{var l=t+a;for(i=L[e+4*i>>2]=l,l=0;l<o.length;++l)Y[i++]=o.charCodeAt(l);Y[i]=0,a+=o.length+1;}),0},T:(e,t)=>{var a=Pt();L[e>>2]=a.length;var o=0;return a.forEach(i=>o+=i.length+1),L[t>>2]=o,0},t:()=>52,z:()=>52,H:function(){return 70},Q:(e,t,a,o)=>{for(var i=0,l=0;l<a;l++){var h=L[t>>2],u=L[t+4>>2];t+=8;for(var f=0;f<u;f++){var p=b[h+f],m=wn[e];p===0||p===10?((e===1?Nt:Z)(G(m,0)),m.length=0):m.push(p);}i+=u;}return L[o>>2]=i,0},U:(e,t)=>(Tt(b.subarray(e,e+t)),0),i:xn,d:In,e:Fn,p:An,y:Sn,b:Ln,a:bn,h:Tn,n:Pn,G:Rn,K:(e,t,a,o)=>Cn(e,t,a,o)},F=function(){function e(a){return F=a.exports,ve=F.da,st(),R=F.ha,dt.unshift(F.ea),J--,r.monitorRunDependencies?.(J),J==0&&(ae&&(a=ae,ae=null,a())),F}var t={a:Mn};if(J++,r.monitorRunDependencies?.(J),r.instantiateWasm)try{return r.instantiateWasm(t,e)}catch(a){Z(`Module.instantiateWasm callback failed with error: ${a}`),_(a);}return Jt(t,function(a){e(a.instance);}).catch(_),{}}(),Ge=e=>(Ge=F.fa)(e),kt=e=>(kt=F.ga)(e),W=e=>(W=F.ia)(e),D=(e,t)=>(D=F.ja)(e,t),O=e=>(O=F.ka)(e),z=()=>(z=F.la)();r.dynCall_iijj=(e,t,a,o,i,l)=>(r.dynCall_iijj=F.na)(e,t,a,o,i,l),r.dynCall_vijj=(e,t,a,o,i,l)=>(r.dynCall_vijj=F.oa)(e,t,a,o,i,l),r.dynCall_jiii=(e,t,a,o)=>(r.dynCall_jiii=F.pa)(e,t,a,o),r.dynCall_jii=(e,t,a)=>(r.dynCall_jii=F.qa)(e,t,a);var Dt=r.dynCall_viiij=(e,t,a,o,i,l)=>(Dt=r.dynCall_viiij=F.ra)(e,t,a,o,i,l);r.dynCall_jiji=(e,t,a,o,i)=>(r.dynCall_jiji=F.sa)(e,t,a,o,i),r.dynCall_viijii=(e,t,a,o,i,l,h)=>(r.dynCall_viijii=F.ta)(e,t,a,o,i,l,h),r.dynCall_iiiiij=(e,t,a,o,i,l,h)=>(r.dynCall_iiiiij=F.ua)(e,t,a,o,i,l,h),r.dynCall_iiiiijj=(e,t,a,o,i,l,h,u,f)=>(r.dynCall_iiiiijj=F.va)(e,t,a,o,i,l,h,u,f),r.dynCall_iiiiiijj=(e,t,a,o,i,l,h,u,f,p)=>(r.dynCall_iiiiiijj=F.wa)(e,t,a,o,i,l,h,u,f,p);function Ln(e,t){var a=z();try{R.get(e)(t);}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function bn(e,t,a){var o=z();try{R.get(e)(t,a);}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function Fn(e,t,a,o){var i=z();try{return R.get(e)(t,a,o)}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function In(e,t,a){var o=z();try{return R.get(e)(t,a)}catch(i){if(O(o),i!==i+0)throw i;D(1,0);}}function xn(e,t){var a=z();try{return R.get(e)(t)}catch(o){if(O(a),o!==o+0)throw o;D(1,0);}}function An(e,t,a,o,i,l){var h=z();try{return R.get(e)(t,a,o,i,l)}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}function Pn(e,t,a,o,i){var l=z();try{R.get(e)(t,a,o,i);}catch(h){if(O(l),h!==h+0)throw h;D(1,0);}}function Tn(e,t,a,o){var i=z();try{R.get(e)(t,a,o);}catch(l){if(O(i),l!==l+0)throw l;D(1,0);}}function Sn(e){var t=z();try{R.get(e)();}catch(a){if(O(t),a!==a+0)throw a;D(1,0);}}function Rn(e,t,a,o,i,l){var h=z();try{Dt(e,t,a,o,i,l);}catch(u){if(O(h),u!==u+0)throw u;D(1,0);}}var Fe;ae=function e(){Fe||Ot(),Fe||(ae=e);};function Ot(){function e(){if(!Fe&&(Fe=!0,r.calledRun=!0,!at)){if(Te(dt),c(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for(typeof r.postRun==\"function\"&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();ct.unshift(t);}Te(ct);}}if(!(0<J)){if(r.preRun)for(typeof r.preRun==\"function\"&&(r.preRun=[r.preRun]);r.preRun.length;)Vt();Te(lt),0<J||(r.setStatus?(r.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){r.setStatus(\"\");},1),e();},1)):e());}}if(r.preInit)for(typeof r.preInit==\"function\"&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return Ot(),$}})(),Bt=On;var X=class{constructor(){throw new Error(\"RendererLoader is a static class and cannot be instantiated.\")}static async _tryLoad(n){return await Bt({locateFile:()=>n})}static async _loadWithBackup(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(async n=>{let r=`https://unpkg.com/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`;console.warn(`Primary WASM load failed from ${this._wasmURL}. Error: ${n.message}`),console.warn(`Attempting to load WASM from backup URL: ${r}`);try{return await this._tryLoad(r)}catch(c){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${c.message}`),new Error(\"WASM loading failed from all sources.\")}})),this._ModulePromise}static async load(){return this._loadWithBackup()}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};I(X,\"_ModulePromise\",null),I(X,\"_wasmURL\",`https://cdn.jsdelivr.net/npm/${fe.name}@${fe.version}/dist/dotlottie-player.wasm`);var Ae=class{constructor(){I(this,\"_eventListeners\",new Map);}addEventListener(n,r){let c=this._eventListeners.get(n);c||(c=new Set,this._eventListeners.set(n,c)),c.add(r);}removeEventListener(n,r){let c=this._eventListeners.get(n);c&&(r?(c.delete(r),c.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){this._eventListeners.get(n.type)?.forEach(c=>c(n));}removeAllEventListeners(){this._eventListeners.clear();}};function zn(s){return /^#([\\da-f]{6}|[\\da-f]{8})$/iu.test(s)}function Ut(s){if(!zn(s))return 0;let n=s.replace(\"#\",\"\");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}function Qe(s){if(s.byteLength<4)return !1;let n=new Uint8Array(s.slice(0,xe.byteLength));for(let r=0;r<xe.length;r+=1)if(xe[r]!==n[r])return !1;return !0}function Wt(s){return jt.every(n=>Object.prototype.hasOwnProperty.call(s,n))}function qe(s){if(typeof s==\"string\")try{return Wt(JSON.parse(s))}catch{return !1}else return Wt(s)}var et=(s,n)=>s===\"reverse\"?n.Mode.Reverse:s===\"bounce\"?n.Mode.Bounce:s===\"reverse-bounce\"?n.Mode.ReverseBounce:n.Mode.Forward,tt=(s,n)=>s===\"contain\"?n.Fit.Contain:s===\"cover\"?n.Fit.Cover:s===\"fill\"?n.Fit.Fill:s===\"fit-height\"?n.Fit.FitHeight:s===\"fit-width\"?n.Fit.FitWidth:n.Fit.None,nt=(s,n)=>{let r=new n.VectorFloat;return r.push_back(s[0]),r.push_back(s[1]),r},rt=(s,n)=>{let r=new n.VectorFloat;return s.length!==2||(r.push_back(s[0]),r.push_back(s[1])),r},M=class M{constructor(n){I(this,\"_canvas\");I(this,\"_context\",null);I(this,\"_eventManager\");I(this,\"_animationFrameId\",null);I(this,\"_frameManager\");I(this,\"_dotLottieCore\",null);I(this,\"_renderConfig\",{});I(this,\"_isFrozen\",!1);I(this,\"_backgroundColor\",null);this._canvas=n.canvas,this._context=this._canvas.getContext(\"2d\"),this._eventManager=new Ae,this._frameManager=new Ie,this._renderConfig=n.renderConfig??{},X.load().then(r=>{M._wasmModule=r,this._dotLottieCore=new r.DotLottiePlayer({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??\"forward\",r),segment:rt(n.segment??[],r),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??\"\",layout:n.layout?{align:nt(n.layout.align,r),fit:tt(n.layout.fit,r)}:r.createDefaultLayout()}),this._eventManager.dispatch({type:\"ready\"}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),n.backgroundColor&&this.setBackgroundColor(n.backgroundColor);}).catch(r=>{this._eventManager.dispatch({type:\"loadError\",error:new Error(`Failed to load wasm module: ${r}`)});});}_dispatchError(n){console.error(n),this._eventManager.dispatch({type:\"loadError\",error:new Error(n)});}async _fetchData(n){let r=await fetch(n);if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${n}. ${r.status}: ${r.statusText}`);let c=await r.arrayBuffer();return Qe(c)?c:new TextDecoder().decode(c)}_loadFromData(n){if(this._dotLottieCore===null)return;let r=this._canvas.width,c=this._canvas.height,_=!1;if(typeof n==\"string\"){if(!qe(n)){this._dispatchError(\"Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.\");return}_=this._dotLottieCore.loadAnimationData(n,r,c);}else if(n instanceof ArrayBuffer){if(!Qe(n)){this._dispatchError(\"Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.\");return}_=this._dotLottieCore.loadDotLottieData(n,r,c);}else if(typeof n==\"object\"){if(!qe(n)){this._dispatchError(\"Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.\");return}_=this._dotLottieCore.loadAnimationData(JSON.stringify(n),r,c);}else {this._dispatchError(`Unsupported data type for animation data. Expected: \n - string (Lottie JSON),\n - ArrayBuffer (dotLottie),\n - object (Lottie JSON). \n Received: ${typeof n}`);return}_?(this._eventManager.dispatch({type:\"load\"}),te&&this.resize(),this._eventManager.dispatch({type:\"frame\",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._dotLottieCore.config().autoplay&&(this._dotLottieCore.play(),this._dotLottieCore.isPlaying()?(this._eventManager.dispatch({type:\"play\"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))):console.error(\"something went wrong, the animation was suppose to autoplay\"))):this._dispatchError(\"Failed to load animation data\");}_loadFromSrc(n){this._fetchData(n).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${n}. ${r}`));}get activeAnimationId(){return this._dotLottieCore?.activeAnimationId()}get activeThemeId(){return this._dotLottieCore?.activeThemeId()}get layout(){let n=this._dotLottieCore?.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{switch(n.fit){case M._wasmModule?.Fit.Contain:return \"contain\";case M._wasmModule?.Fit.Cover:return \"cover\";case M._wasmModule?.Fit.Fill:return \"fill\";case M._wasmModule?.Fit.FitHeight:return \"fit-height\";case M._wasmModule?.Fit.FitWidth:return \"fit-width\";case M._wasmModule?.Fit.None:return \"none\";default:return \"contain\"}})()}}get marker(){return this._dotLottieCore?.config().marker}get manifest(){try{let n=this._dotLottieCore?.manifestString();if(this._dotLottieCore===null||!n)return null;let r=JSON.parse(n);return Object.keys(r).length===0?null:r}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){let n=this._dotLottieCore?.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){return this._dotLottieCore?.config().loopAnimation??!1}get mode(){let n=this._dotLottieCore?.config().mode;return n===M._wasmModule?.Mode.Reverse?\"reverse\":n===M._wasmModule?.Mode.Bounce?\"bounce\":n===M._wasmModule?.Mode.ReverseBounce?\"reverse-bounce\":\"forward\"}get isFrozen(){return this._isFrozen}get backgroundColor(){return this._backgroundColor??\"\"}get autoplay(){return this._dotLottieCore?.config().autoplay??!1}get useFrameInterpolation(){return this._dotLottieCore?.config().useFrameInterpolation??!1}get speed(){return this._dotLottieCore?.config().speed??0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return this._dotLottieCore?.isLoaded()??!1}get isPlaying(){return this._dotLottieCore?.isPlaying()??!1}get isPaused(){return this._dotLottieCore?.isPaused()??!1}get isStopped(){return this._dotLottieCore?.isStopped()??!1}get currentFrame(){return this._dotLottieCore?.currentFrame()??0}get loopCount(){return this._dotLottieCore?.loopCount()??0}get totalFrames(){return this._dotLottieCore?.totalFrames()??0}get duration(){return this._dotLottieCore?.duration()??0}get segmentDuration(){return this._dotLottieCore?.segmentDuration()??0}get canvas(){return this._canvas}load(n){this._dotLottieCore===null||M._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:n.autoplay??!1,backgroundColor:0,loopAnimation:n.loop??!1,mode:et(n.mode??\"forward\",M._wasmModule),segment:rt(n.segment??[],M._wasmModule),speed:n.speed??1,useFrameInterpolation:n.useFrameInterpolation??!0,marker:n.marker??\"\",layout:n.layout?{align:nt(n.layout.align,M._wasmModule),fit:tt(n.layout.fit,M._wasmModule)}:M._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor(n.backgroundColor??\"\"));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let r=this._dotLottieCore.buffer(),c=new Uint8ClampedArray(r,0,this._canvas.width*this._canvas.height*4),_=null;return typeof ImageData>\"u\"?(_=this._context.createImageData(this._canvas.width,this._canvas.height),_.data.set(c)):_=new ImageData(c,this._canvas.width,this._canvas.height),this._context.putImageData(_,0,0),this._eventManager.dispatch({type:\"render\",currentFrame:this._dotLottieCore.currentFrame()}),!0}return !1}_draw(){if(this._dotLottieCore===null||this._context===null||!this._dotLottieCore.isPlaying())return;let n=this._dotLottieCore.requestFrame();this._dotLottieCore.setFrame(n)&&(this._eventManager.dispatch({type:\"frame\",currentFrame:this._dotLottieCore.currentFrame()}),this._render()&&this._dotLottieCore.isComplete()&&(this._dotLottieCore.config().loopAnimation?this._eventManager.dispatch({type:\"loop\",loopCount:this._dotLottieCore.loopCount()}):this._eventManager.dispatch({type:\"complete\"}))),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this));}play(){if(this._dotLottieCore===null)return;let n=this._dotLottieCore.play();this._isFrozen=!1,n&&(this._eventManager.dispatch({type:\"play\"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)));}pause(){if(this._dotLottieCore===null)return;this._dotLottieCore.pause()&&this._eventManager.dispatch({type:\"pause\"});}stop(){if(this._dotLottieCore===null)return;this._dotLottieCore.stop()&&(this._eventManager.dispatch({type:\"frame\",currentFrame:this._dotLottieCore.currentFrame()}),this._render(),this._eventManager.dispatch({type:\"stop\"}));}setFrame(n){if(this._dotLottieCore===null||n<0||n>this._dotLottieCore.totalFrames())return;this._dotLottieCore.seek(n)&&(this._eventManager.dispatch({type:\"frame\",currentFrame:this._dotLottieCore.currentFrame()}),this._render());}setSpeed(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),speed:n});}setBackgroundColor(n){this._dotLottieCore!==null&&(te&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig({...this._dotLottieCore.config(),backgroundColor:Ut(n)}),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),loopAnimation:n});}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),useFrameInterpolation:n});}addEventListener(n,r){this._eventManager.addEventListener(n,r);}removeEventListener(n,r){this._eventManager.removeEventListener(n,r);}destroy(){this._dotLottieCore?.delete(),this._dotLottieCore=null,this._context=null,this._eventManager.dispatch({type:\"destroy\"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners();}freeze(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null,this._isFrozen=!0,this._eventManager.dispatch({type:\"freeze\"}));}unfreeze(){this._animationFrameId===null&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this)),this._isFrozen=!1,this._eventManager.dispatch({type:\"unfreeze\"}));}resize(){if(te&&this._canvas instanceof HTMLCanvasElement){let r=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:c,width:_}=this._canvas.getBoundingClientRect();this._canvas.width=_*r,this._canvas.height=c*r;}this._dotLottieCore?.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,r){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),segment:rt([n,r],M._wasmModule)});}setMode(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),mode:et(n,M._wasmModule)});}setRenderConfig(n){this._renderConfig=n;}loadAnimation(n){if(this._dotLottieCore===null||this._dotLottieCore.activeAnimationId()===n)return;this._dotLottieCore.loadAnimation(n,this._canvas.width,this._canvas.height)?(this._eventManager.dispatch({type:\"load\"}),this.resize()):this._eventManager.dispatch({type:\"loadError\",error:new Error(`Failed to animation :${n}`)});}setMarker(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig({...this._dotLottieCore.config(),marker:n});}markers(){let n=this._dotLottieCore?.markers();if(n){let r=[];for(let c=0;c<n.size();c+=1){let _=n.get(c);r.push({name:_.name,time:_.time,duration:_.duration});}return r}return []}loadTheme(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadTheme(n);return this._render(),r}loadThemeData(n){if(this._dotLottieCore===null)return !1;let r=this._dotLottieCore.loadThemeData(n);return this._render(),r}setLayout(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig({...this._dotLottieCore.config(),layout:{align:nt(n.align,M._wasmModule),fit:tt(n.fit,M._wasmModule)}});}setViewport(n,r,c,_){return this._dotLottieCore===null?!1:this._dotLottieCore.setViewport(n,r,c,_)}static setWasmUrl(n){X.setWasmUrl(n);}loadStateMachine(n){return this._dotLottieCore?.loadStateMachine(n)??!1}startStateMachine(){let n=this._dotLottieCore?.startStateMachine()??!1;return n&&this._setupStateMachineListeners(),n}stopStateMachine(){let n=this._dotLottieCore?.stopStateMachine()??!1;return n&&this._cleanupStateMachineListeners(),n}_getPointerPosition(n){let r=this._canvas.getBoundingClientRect(),c=this._canvas.width/r.width,_=this._canvas.height/r.height,$=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,U=(n.clientX-r.left)*c/$,V=(n.clientY-r.top)*_/$;return {x:U,y:V}}_onPointerUp(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerUp: ${r} ${c}`);}_onPointerDown(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerDown: ${r} ${c}`);}_onPointerMove(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerMove: ${r} ${c}`);}_onPointerEnter(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerEnter: ${r} ${c}`);}_onPointerLeave(n){let{x:r,y:c}=this._getPointerPosition(n);this.postStateMachineEvent(`OnPointerExit: ${r} ${c}`);}_onComplete(){this.postStateMachineEvent(\"OnComplete\");}postStateMachineEvent(n){return this._dotLottieCore?.postEventPayload(n)??!1}getStateMachineListeners(){if(!this._dotLottieCore)return [];let n=this._dotLottieCore.stateMachineFrameworkSetup(),r=[];for(let c=0;c<n.size();c+=1)r.push(n.get(c));return r}_setupStateMachineListeners(){if(te&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let n=this.getStateMachineListeners();n.includes(\"PointerUp\")&&this._canvas.addEventListener(\"pointerup\",this._onPointerUp.bind(this)),n.includes(\"PointerDown\")&&this._canvas.addEventListener(\"pointerdown\",this._onPointerDown.bind(this)),n.includes(\"PointerMove\")&&this._canvas.addEventListener(\"pointermove\",this._onPointerMove.bind(this)),n.includes(\"PointerEnter\")&&this._canvas.addEventListener(\"pointerenter\",this._onPointerEnter.bind(this)),n.includes(\"PointerExit\")&&this._canvas.addEventListener(\"pointerleave\",this._onPointerLeave.bind(this)),n.includes(\"Complete\")&&this.addEventListener(\"complete\",this._onComplete.bind(this));}}_cleanupStateMachineListeners(){te&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener(\"pointerup\",this._onPointerUp.bind(this)),this._canvas.removeEventListener(\"pointerdown\",this._onPointerDown.bind(this)),this._canvas.removeEventListener(\"pointermove\",this._onPointerMove.bind(this)),this._canvas.removeEventListener(\"pointerenter\",this._onPointerEnter.bind(this)),this._canvas.removeEventListener(\"pointerleave\",this._onPointerLeave.bind(this)),this.removeEventListener(\"complete\",this._onComplete.bind(this)));}loadStateMachineData(n){return this._dotLottieCore?.loadStateMachineData(n)??!1}animationSize(){let n=this._dotLottieCore?.animationSize().get(0)??0,r=this._dotLottieCore?.animationSize().get(1)??0;return {width:n,height:r}}setStateMachineBooleanContext(n,r){return this._dotLottieCore?.setStateMachineBooleanContext(n,r)??!1}setStateMachineNumericContext(n,r){return this._dotLottieCore?.setStateMachineNumericContext(n,r)??!1}setStateMachineStringContext(n,r){return this._dotLottieCore?.setStateMachineStringContext(n,r)??!1}};I(M,\"_wasmModule\",null);var me=M;var E=new Map,jn={ready:s=>n=>{let r={id:\"\",method:\"onReady\",result:{instanceId:s,event:n}};self.postMessage(r);},complete:s=>n=>{let r={id:\"\",method:\"onComplete\",result:{instanceId:s,event:n}};self.postMessage(r);},load:s=>n=>{let c={id:\"\",method:\"onLoad\",result:{instanceId:s,event:n}};self.postMessage(c);},loadError:s=>n=>{let c={id:\"\",method:\"onLoadError\",result:{instanceId:s,event:n}};self.postMessage(c);},loop:s=>n=>{let c={id:\"\",method:\"onLoop\",result:{instanceId:s,event:n}};self.postMessage(c);},play:s=>n=>{let c={id:\"\",method:\"onPlay\",result:{instanceId:s,event:n}};self.postMessage(c);},pause:s=>n=>{let c={id:\"\",method:\"onPause\",result:{instanceId:s,event:n}};self.postMessage(c);},stop:s=>n=>{let c={id:\"\",method:\"onStop\",result:{instanceId:s,event:n}};self.postMessage(c);},frame:s=>n=>{let c={id:\"\",method:\"onFrame\",result:{instanceId:s,event:n}};self.postMessage(c);},render:s=>n=>{let c={id:\"\",method:\"onRender\",result:{instanceId:s,event:n}};self.postMessage(c);},freeze:s=>n=>{let c={id:\"\",method:\"onFreeze\",result:{instanceId:s,event:n}};self.postMessage(c);},unfreeze:s=>n=>{let c={id:\"\",method:\"onUnfreeze\",result:{instanceId:s,event:n}};self.postMessage(c);},destroy:s=>n=>{let c={id:\"\",method:\"onDestroy\",result:{instanceId:s,event:n}};self.postMessage(c);}},Ht={getDotLottieInstanceState(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return {state:{isLoaded:r.isLoaded,isPaused:r.isPaused,isPlaying:r.isPlaying,isStopped:r.isStopped,isFrozen:r.isFrozen,loop:r.loop,mode:r.mode,speed:r.speed,currentFrame:r.currentFrame,totalFrames:r.totalFrames,duration:r.duration,useFrameInterpolation:r.useFrameInterpolation,renderConfig:r.renderConfig,marker:r.marker,backgroundColor:r.backgroundColor,markers:r.markers(),activeAnimationId:r.activeAnimationId,activeThemeId:r.activeThemeId,autoplay:r.autoplay,segment:r.segment,layout:r.layout,segmentDuration:r.segmentDuration,isReady:r.isReady,manifest:r.manifest}}},setLayout(s){let n=s.params.instanceId,r=s.params.layout,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLayout(r),{success:!0}},getStateMachineListeners(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.getStateMachineListeners()},postStateMachineEvent(s){let n=s.params.instanceId,r=s.params.event,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.postStateMachineEvent(r)},startStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.startStateMachine()},stopStateMachine(s){let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.stopStateMachine()},loadStateMachine(s){let n=s.params.instanceId,r=s.params.stateMachineId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachine(r)},loadStateMachineData(s){let n=s.params.instanceId,r=s.params.stateMachineData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadStateMachineData(r)},create:s=>{let n=s.params.instanceId,r=s.params.config,c=s.params.width,_=s.params.height;if(E.has(n))throw new Error(`Instance with id ${n} already exists.`);let $=new me(r);return $.canvas.height=_,$.canvas.width=c,E.set(n,$),[\"complete\",\"frame\",\"load\",\"loadError\",\"loop\",\"pause\",\"play\",\"stop\",\"destroy\",\"freeze\",\"unfreeze\",\"render\",\"ready\"].forEach(V=>{$.addEventListener(V,jn[V](n));}),{instanceId:n}},destroy:s=>{let n=s.params.instanceId,r=E.get(n);r&&(r.destroy(),E.delete(n));},freeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.freeze();},load:s=>{let n=s.params.instanceId,r=s.params.config,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.load(r);},loadAnimation:s=>{let n=s.params.instanceId,r=s.params.animationId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.loadAnimation(r);},loadTheme:s=>{let n=s.params.instanceId,r=s.params.themeId,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadTheme(r)},loadThemeData:s=>{let n=s.params.instanceId,r=s.params.themeData,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.loadThemeData(r)},pause:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.pause()},play:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);return r.play()},resize:s=>{let n=s.params.instanceId,r=s.params.width,c=s.params.height,_=E.get(n);if(!_)throw new Error(`Instance with id ${n} does not exist.`);return _.canvas.height=c,_.canvas.width=r,_.resize(),{success:!0}},setBackgroundColor:s=>{let n=s.params.instanceId,r=s.params.backgroundColor,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setBackgroundColor(r);},setFrame:s=>{let n=s.params.instanceId,r=s.params.frame,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setFrame(r);},setMode:s=>{let n=s.params.instanceId,r=s.params.mode,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setMode(r);},setRenderConfig:s=>{let n=s.params.instanceId,r=s.params.renderConfig,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setRenderConfig(r);},setSegment:s=>{let n=s.params.instanceId,r=s.params.segment,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSegment(r[0],r[1]);},setSpeed:s=>{let n=s.params.instanceId,r=s.params.speed,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setSpeed(r);},setUseFrameInterpolation:s=>{let n=s.params.instanceId,r=s.params.useFrameInterpolation,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);c.setUseFrameInterpolation(r);},setWasmUrl:s=>{me.setWasmUrl(s.params.url);},stop:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.stop();},unfreeze:s=>{let n=s.params.instanceId,r=E.get(n);if(!r)throw new Error(`Instance with id ${n} does not exist.`);r.unfreeze();},setViewport(s){let n=s.params.instanceId,r=s.params.x,c=s.params.y,_=s.params.width,$=s.params.height,U=E.get(n);if(!U)throw new Error(`Instance with id ${n} does not exist.`);return U.setViewport(r,c,_,$)},setMarker(s){let n=s.params.instanceId,r=s.params.marker,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setMarker(r),{success:!0}},setLoop(s){let n=s.params.instanceId,r=s.params.loop,c=E.get(n);if(!c)throw new Error(`Instance with id ${n} does not exist.`);return c.setLoop(r),{success:!0}}};function Bn(s){let n=s.method;if(typeof Ht[n]==\"function\")return Ht[n](s);throw new Error(`Method ${n} is not implemented in commands.`)}self.onmessage=s=>{try{let n=Bn(s.data),r={id:s.data.id,method:s.data.method,result:n};self.postMessage(r);}catch(n){let r={id:s.data.id,method:s.data.method,error:n.message};self.postMessage(r);}};var Wn=\"\",fr=Wn;\n\nexport { fr as default };\n","// This file would be inlined as a string, checkout the tsup config in the root of the project\nimport workerString from './dotlottie.worker.js';\nimport type { MethodParamsMap, RpcRequest } from './types.js';\n\nexport class WorkerManager {\n private readonly _workers: Map<string, Worker> = new Map();\n\n private readonly _animationWorkerMap: Map<string, string> = new Map();\n\n private _createWorker(workerName: string): Worker {\n const blob = new Blob([workerString], { type: 'application/javascript' });\n\n // eslint-disable-next-line node/no-unsupported-features/node-builtins\n return new Worker(URL.createObjectURL(blob), { type: 'module', name: workerName });\n }\n\n public getWorker(workerId: string): Worker {\n if (!this._workers.has(workerId)) {\n this._workers.set(workerId, this._createWorker(workerId));\n }\n\n return this._workers.get(workerId) as Worker;\n }\n\n public assignAnimationToWorker(animationId: string, workerId: string): void {\n this._animationWorkerMap.set(animationId, workerId);\n }\n\n public unassignAnimationFromWorker(animationId: string): void {\n this._animationWorkerMap.delete(animationId);\n }\n\n public sendMessage(workerId: string, message: RpcRequest<keyof MethodParamsMap>, transfer?: Transferable[]): void {\n this.getWorker(workerId).postMessage(message, transfer || []);\n }\n\n public terminateWorker(workerId: string): void {\n const worker = this._workers.get(workerId);\n\n if (worker) {\n worker.terminate();\n this._workers.delete(workerId);\n }\n }\n}\n","import { IS_BROWSER } from '../constants';\nimport type { Marker } from '../core';\nimport type { EventType, EventListener, FrameEvent } from '../event-manager';\nimport { EventManager } from '../event-manager';\nimport type { Config, Layout, Manifest, Mode, RenderConfig } from '../types';\n\nimport type { MethodParamsMap, MethodResultMap, RpcRequest, RpcResponse } from './types';\nimport { WorkerManager } from './worker-manager';\n\nfunction getCanvasSize(canvas: HTMLCanvasElement | OffscreenCanvas): { height: number; width: number } {\n if (canvas instanceof OffscreenCanvas) {\n return { width: canvas.width, height: canvas.height };\n }\n\n const { height, width } = canvas.getBoundingClientRect();\n\n return { width: width * window.devicePixelRatio, height: height * window.devicePixelRatio };\n}\n\nfunction generateUniqueId(): string {\n return Date.now().toString(36) + Math.random().toString(36).substr(2, 9);\n}\n\nexport interface DotLottieInstanceState {\n activeAnimationId: string | undefined;\n activeThemeId: string | undefined;\n autoplay: boolean;\n backgroundColor: string;\n currentFrame: number;\n duration: number;\n isFrozen: boolean;\n isLoaded: boolean;\n isPaused: boolean;\n isPlaying: boolean;\n isReady: boolean;\n isStopped: boolean;\n layout: Layout | undefined;\n loop: boolean;\n manifest: Manifest | null;\n marker: string | undefined;\n markers: Marker[];\n mode: Mode;\n renderConfig: RenderConfig;\n segment: [number, number] | undefined;\n segmentDuration: number;\n speed: number;\n totalFrames: number;\n useFrameInterpolation: boolean;\n}\n\nexport class DotLottieWorker {\n private static readonly _workerManager = new WorkerManager();\n\n private readonly _eventManager = new EventManager();\n\n private readonly _id: string;\n\n private readonly _worker: Worker;\n\n private readonly _canvas: HTMLCanvasElement;\n\n private _dotLottieInstanceState: DotLottieInstanceState = {\n markers: [],\n autoplay: false,\n backgroundColor: '',\n currentFrame: 0,\n duration: 0,\n loop: false,\n mode: 'forward',\n segment: [0, 0],\n segmentDuration: 0,\n speed: 1,\n totalFrames: 0,\n isLoaded: false,\n isPlaying: false,\n isPaused: false,\n isStopped: true,\n isFrozen: false,\n useFrameInterpolation: false,\n renderConfig: {\n devicePixelRatio: window.devicePixelRatio,\n },\n activeAnimationId: '',\n activeThemeId: '',\n layout: undefined,\n marker: undefined,\n isReady: false,\n manifest: null,\n };\n\n private static _wasmUrl: string = '';\n\n private _created: boolean = false;\n\n public constructor(config: Config & { workerId?: string }) {\n this._canvas = config.canvas;\n\n this._id = `dotlottie-${generateUniqueId()}`;\n const workerId = config.workerId || 'defaultWorker';\n\n // creates or gets the worker\n this._worker = DotLottieWorker._workerManager.getWorker(workerId);\n\n DotLottieWorker._workerManager.assignAnimationToWorker(this._id, workerId);\n\n if (DotLottieWorker._wasmUrl) {\n this._sendMessage('setWasmUrl', { url: DotLottieWorker._wasmUrl });\n }\n\n this._create(config);\n\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n this._worker.addEventListener('message', this._handleWorkerEvent.bind(this));\n }\n\n private async _handleWorkerEvent(event: MessageEvent): Promise<void> {\n const rpcResponse: RpcResponse<\n | 'onComplete'\n | 'onLoad'\n | 'onDestroy'\n | 'onUnfreeze'\n | 'onFrame'\n | 'onRender'\n | 'onFreeze'\n | 'onPause'\n | 'onPlay'\n | 'onStop'\n | 'onLoadError'\n | 'onReady'\n > = event.data;\n\n if (!rpcResponse.id) {\n if (rpcResponse.method === 'onLoad' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onComplete' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onDestroy' && rpcResponse.result.instanceId === this._id) {\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onUnfreeze' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._dotLottieInstanceState.isFrozen = false;\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onFrame' && rpcResponse.result.instanceId === this._id) {\n this._dotLottieInstanceState.currentFrame = (rpcResponse.result.event as FrameEvent).currentFrame;\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onRender' && rpcResponse.result.instanceId === this._id) {\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onFreeze' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onPause' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onPlay' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onStop' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onLoadError' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n\n if (rpcResponse.method === 'onReady' && rpcResponse.result.instanceId === this._id) {\n await this._updateDotLottieInstanceState();\n this._eventManager.dispatch(rpcResponse.result.event);\n }\n }\n }\n\n private async _create(config: Config): Promise<void> {\n let offscreen: OffscreenCanvas;\n\n if (this._canvas instanceof HTMLCanvasElement) {\n offscreen = this._canvas.transferControlToOffscreen();\n } else {\n offscreen = this._canvas;\n }\n\n const { instanceId } = await this._sendMessage(\n 'create',\n {\n instanceId: this._id,\n config: {\n ...config,\n // @ts-ignore\n canvas: offscreen,\n },\n ...getCanvasSize(this._canvas),\n },\n [offscreen],\n );\n\n if (instanceId !== this._id) {\n throw new Error('Instance ID mismatch');\n }\n\n this._created = true;\n\n await this._updateDotLottieInstanceState();\n }\n\n public get isLoaded(): boolean {\n return this._dotLottieInstanceState.isLoaded;\n }\n\n public get isPlaying(): boolean {\n return this._dotLottieInstanceState.isPlaying;\n }\n\n public get isPaused(): boolean {\n return this._dotLottieInstanceState.isPaused;\n }\n\n public get isStopped(): boolean {\n return this._dotLottieInstanceState.isStopped;\n }\n\n public get currentFrame(): number {\n return this._dotLottieInstanceState.currentFrame;\n }\n\n public get isFrozen(): boolean {\n return this._dotLottieInstanceState.isFrozen;\n }\n\n public get segmentDuration(): number {\n return this._dotLottieInstanceState.segmentDuration;\n }\n\n public get totalFrames(): number {\n return this._dotLottieInstanceState.totalFrames;\n }\n\n public get segment(): [number, number] | undefined {\n return this._dotLottieInstanceState.segment;\n }\n\n public get speed(): number {\n return this._dotLottieInstanceState.speed;\n }\n\n public get duration(): number {\n return this._dotLottieInstanceState.duration;\n }\n\n public get isReady(): boolean {\n return this._dotLottieInstanceState.isReady;\n }\n\n public get mode(): Mode {\n return this._dotLottieInstanceState.mode;\n }\n\n public get canvas(): HTMLCanvasElement | null {\n return this._canvas;\n }\n\n public get autoplay(): boolean {\n return this._dotLottieInstanceState.autoplay;\n }\n\n public get backgroundColor(): string {\n return this._dotLottieInstanceState.backgroundColor;\n }\n\n public get loop(): boolean {\n return this._dotLottieInstanceState.loop;\n }\n\n public get useFrameInterpolation(): boolean {\n return this._dotLottieInstanceState.useFrameInterpolation;\n }\n\n public get renderConfig(): RenderConfig {\n return this._dotLottieInstanceState.renderConfig;\n }\n\n public get manifest(): Manifest | null {\n return this._dotLottieInstanceState.manifest;\n }\n\n public get activeAnimationId(): string | undefined {\n return this._dotLottieInstanceState.activeAnimationId;\n }\n\n public get marker(): string | undefined {\n return this._dotLottieInstanceState.marker;\n }\n\n public get activeThemeId(): string | undefined {\n return this._dotLottieInstanceState.activeThemeId;\n }\n\n public get layout(): Layout | undefined {\n return this._dotLottieInstanceState.layout;\n }\n\n public async play(): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('play', { instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async pause(): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('pause', { instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async stop(): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('stop', { instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async setSpeed(speed: number): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setSpeed', { instanceId: this._id, speed });\n await this._updateDotLottieInstanceState();\n }\n\n public async setMode(mode: Mode): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setMode', { instanceId: this._id, mode });\n await this._updateDotLottieInstanceState();\n }\n\n public async setFrame(frame: number): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setFrame', { frame, instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async setSegment(start: number, end: number): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setSegment', { instanceId: this._id, segment: [start, end] });\n await this._updateDotLottieInstanceState();\n }\n\n public async setRenderConfig(renderConfig: RenderConfig): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setRenderConfig', { instanceId: this._id, renderConfig });\n await this._updateDotLottieInstanceState();\n }\n\n public async setUseFrameInterpolation(useFrameInterpolation: boolean): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setUseFrameInterpolation', { instanceId: this._id, useFrameInterpolation });\n await this._updateDotLottieInstanceState();\n }\n\n public async loadTheme(themeId: string): Promise<boolean> {\n if (!this._created) return false;\n\n const result = this._sendMessage('loadTheme', { instanceId: this._id, themeId });\n\n await this._updateDotLottieInstanceState();\n\n return result;\n }\n\n public async load(config: Omit<Config, 'canvas'>): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('load', { config, instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async setLoop(loop: boolean): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setLoop', { instanceId: this._id, loop });\n await this._updateDotLottieInstanceState();\n }\n\n public async resize(): Promise<void> {\n if (!this._created) return;\n\n const { height, width } = getCanvasSize(this._canvas);\n\n this._canvas.width = width;\n this._canvas.height = height;\n\n await this._sendMessage('resize', { height, instanceId: this._id, width });\n await this._updateDotLottieInstanceState();\n }\n\n public async destroy(): Promise<void> {\n if (!this._created) return;\n\n this._created = false;\n\n await this._sendMessage('destroy', { instanceId: this._id });\n\n this._cleanupStateMachineListeners();\n\n DotLottieWorker._workerManager.unassignAnimationFromWorker(this._id);\n this._eventManager.removeAllEventListeners();\n }\n\n public async freeze(): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('freeze', { instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async unfreeze(): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('unfreeze', { instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async setBackgroundColor(backgroundColor: string): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setBackgroundColor', { instanceId: this._id, backgroundColor });\n await this._updateDotLottieInstanceState();\n }\n\n public async loadAnimation(animationId: string): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('loadAnimation', { animationId, instanceId: this._id });\n await this._updateDotLottieInstanceState();\n }\n\n public async setLayout(layout: Layout): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setLayout', { instanceId: this._id, layout });\n await this._updateDotLottieInstanceState();\n }\n\n private async _updateDotLottieInstanceState(): Promise<void> {\n if (!this._created) return;\n\n const result = await this._sendMessage('getDotLottieInstanceState', { instanceId: this._id });\n\n this._dotLottieInstanceState = result.state;\n }\n\n public markers(): Marker[] {\n return this._dotLottieInstanceState.markers;\n }\n\n public async setMarker(marker: string): Promise<void> {\n if (!this._created) return;\n\n await this._sendMessage('setMarker', { instanceId: this._id, marker });\n await this._updateDotLottieInstanceState();\n }\n\n public async loadThemeData(themeData: string): Promise<boolean> {\n if (!this._created) return false;\n\n const loaded = await this._sendMessage('loadThemeData', { instanceId: this._id, themeData });\n\n await this._updateDotLottieInstanceState();\n\n return loaded;\n }\n\n public async setViewport(x: number, y: number, width: number, height: number): Promise<boolean> {\n if (!this._created) return false;\n\n return this._sendMessage('setViewport', { x, y, width, height, instanceId: this._id });\n }\n\n private async _sendMessage<T extends keyof MethodParamsMap>(\n method: T,\n params: MethodParamsMap[T],\n transfer?: Transferable[],\n ): Promise<MethodResultMap[T]> {\n const rpcRequest: RpcRequest<T> = {\n id: `dotlottie-request-${generateUniqueId()}`,\n method,\n params,\n };\n\n this._worker.postMessage(rpcRequest, transfer || []);\n\n return new Promise((resolve, reject) => {\n const onMessage = (event: MessageEvent): void => {\n const rpcResponse: RpcResponse<T> = event.data;\n\n // Check if the response corresponds to the request\n if (rpcResponse.id === rpcRequest.id) {\n this._worker.removeEventListener('message', onMessage);\n\n if (rpcResponse.error) {\n reject(new Error(`Failed to execute method ${method}: ${rpcResponse.error}`));\n } else {\n resolve(rpcResponse.result);\n }\n }\n };\n\n this._worker.addEventListener('message', onMessage);\n });\n }\n\n public addEventListener<T extends EventType>(type: T, listener: EventListener<T>): void {\n this._eventManager.addEventListener(type, listener);\n }\n\n public removeEventListener<T extends EventType>(type: T, listener?: EventListener<T>): void {\n this._eventManager.removeEventListener(type, listener);\n }\n\n public static setWasmUrl(url: string): void {\n DotLottieWorker._wasmUrl = url;\n }\n\n public async loadStateMachine(stateMachineId: string): Promise<boolean> {\n if (!this._created) return false;\n\n const result = await this._sendMessage('loadStateMachine', { instanceId: this._id, stateMachineId });\n\n await this._updateDotLottieInstanceState();\n\n return result;\n }\n\n public async loadStateMachineData(stateMachineData: string): Promise<boolean> {\n if (!this._created) return false;\n\n const result = await this._sendMessage('loadStateMachineData', { instanceId: this._id, stateMachineData });\n\n await this._updateDotLottieInstanceState();\n\n return result;\n }\n\n public async startStateMachine(): Promise<boolean> {\n if (!this._created) return false;\n\n this._setupStateMachineListeners();\n\n const result = await this._sendMessage('startStateMachine', { instanceId: this._id });\n\n await this._updateDotLottieInstanceState();\n\n return result;\n }\n\n public async stopStateMachine(): Promise<boolean> {\n if (!this._created) return false;\n\n this._cleanupStateMachineListeners();\n\n return this._sendMessage('stopStateMachine', { instanceId: this._id });\n }\n\n public async postStateMachineEvent(event: string): Promise<boolean> {\n if (!this._created) return false;\n\n return this._sendMessage('postStateMachineEvent', { event, instanceId: this._id });\n }\n\n public async getStateMachineListeners(): Promise<string[]> {\n if (!this._created) return [];\n\n return this._sendMessage('getStateMachineListeners', { instanceId: this._id });\n }\n\n private _getPointerPosition(event: PointerEvent): { x: number; y: number } {\n const rect = (this._canvas as HTMLCanvasElement).getBoundingClientRect();\n const scaleX = this._canvas.width / rect.width;\n const scaleY = this._canvas.height / rect.height;\n\n const devicePixelRatio = this._dotLottieInstanceState.renderConfig.devicePixelRatio || window.devicePixelRatio || 1;\n const x = ((event.clientX - rect.left) * scaleX) / devicePixelRatio;\n const y = ((event.clientY - rect.top) * scaleY) / devicePixelRatio;\n\n return {\n x,\n y,\n };\n }\n\n private _onPointerUp(event: PointerEvent): void {\n const { x, y } = this._getPointerPosition(event);\n\n this.postStateMachineEvent(`OnPointerUp: ${x} ${y}`);\n }\n\n private _onPointerDown(event: PointerEvent): void {\n const { x, y } = this._getPointerPosition(event);\n\n this.postStateMachineEvent(`OnPointerDown: ${x} ${y}`);\n }\n\n private _onPointerMove(event: PointerEvent): void {\n const { x, y } = this._getPointerPosition(event);\n\n this.postStateMachineEvent(`OnPointerMove: ${x} ${y}`);\n }\n\n private _onPointerEnter(event: PointerEvent): void {\n const { x, y } = this._getPointerPosition(event);\n\n this.postStateMachineEvent(`OnPointerEnter: ${x} ${y}`);\n }\n\n private _onPointerLeave(event: PointerEvent): void {\n const { x, y } = this._getPointerPosition(event);\n\n this.postStateMachineEvent(`OnPointerExit: ${x} ${y}`);\n }\n\n private _onComplete(): void {\n this.postStateMachineEvent('OnComplete');\n }\n\n private async _setupStateMachineListeners(): Promise<void> {\n if (IS_BROWSER && this._canvas instanceof HTMLCanvasElement && this.isLoaded) {\n const listeners = await this._sendMessage('getStateMachineListeners', { instanceId: this._id });\n\n if (listeners.includes('PointerUp')) {\n this._canvas.addEventListener('pointerup', this._onPointerUp.bind(this));\n }\n\n if (listeners.includes('PointerDown')) {\n this._canvas.addEventListener('pointerdown', this._onPointerDown.bind(this));\n }\n\n if (listeners.includes('PointerMove')) {\n this._canvas.addEventListener('pointermove', this._onPointerMove.bind(this));\n }\n\n if (listeners.includes('PointerEnter')) {\n this._canvas.addEventListener('pointerenter', this._onPointerEnter.bind(this));\n }\n\n if (listeners.includes('PointerExit')) {\n this._canvas.addEventListener('pointerleave', this._onPointerLeave.bind(this));\n }\n\n if (listeners.includes('Complete')) {\n this.addEventListener('complete', this._onComplete.bind(this));\n }\n }\n }\n\n private _cleanupStateMachineListeners(): void {\n if (IS_BROWSER && this._canvas instanceof HTMLCanvasElement) {\n this._canvas.removeEventListener('pointerup', this._onPointerUp.bind(this));\n this._canvas.removeEventListener('pointerdown', this._onPointerDown.bind(this));\n this._canvas.removeEventListener('pointermove', this._onPointerMove.bind(this));\n this._canvas.removeEventListener('pointerenter', this._onPointerEnter.bind(this));\n this._canvas.removeEventListener('pointerleave', this._onPointerLeave.bind(this));\n this.removeEventListener('complete', this._onComplete.bind(this));\n }\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export { p as DotLottieInstanceState, q as DotLottieWorker } from '../index-CKktTSum.cjs';
@@ -1 +0,0 @@
1
- export { p as DotLottieInstanceState, q as DotLottieWorker } from '../index-CKktTSum.js';