'use strict'; var s0=Object.defineProperty,d0=Object.defineProperties;var u0=Object.getOwnPropertyDescriptors;var U1=Object.getOwnPropertySymbols;var s3=Object.prototype.hasOwnProperty,d3=Object.prototype.propertyIsEnumerable;var f2=(c,n,i)=>n in c?s0(c,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[n]=i,x=(c,n)=>{for(var i in n||(n={}))s3.call(n,i)&&f2(c,i,n[i]);if(U1)for(var i of U1(n))d3.call(n,i)&&f2(c,i,n[i]);return c},D=(c,n)=>d0(c,u0(n));var H1=(c,n)=>{var i={};for(var s in c)s3.call(c,s)&&n.indexOf(s)<0&&(i[s]=c[s]);if(c!=null&&U1)for(var s of U1(c))n.indexOf(s)<0&&d3.call(c,s)&&(i[s]=c[s]);return i};var _=(c,n,i)=>f2(c,typeof n!="symbol"?n+"":n,i);var g=(c,n,i)=>new Promise((s,d)=>{var m=I=>{try{C(i.next(I));}catch(R){d(R);}},w=I=>{try{C(i.throw(I));}catch(R){d(R);}},C=I=>I.done?s(I.value):Promise.resolve(I.value).then(m,w);C((i=i.apply(c,n)).next());});var m2=class{requestAnimationFrame(n){return requestAnimationFrame(n)}cancelAnimationFrame(n){cancelAnimationFrame(n);}},_2=class{constructor(){_(this,"_lastHandleId",0);_(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);}},j1=class{constructor(){_(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new m2:new _2;}requestAnimationFrame(n){return this._strategy.requestAnimationFrame(n)}cancelAnimationFrame(n){this._strategy.cancelAnimationFrame(n);}};var A=typeof window!="undefined"&&typeof window.document!="undefined";var B1=new Uint8Array([80,75,3,4]),u3=["v","ip","op","layers","fr","w","h"],g2="0.0.17",y2="yukon-orange",h3=.75;var h0=(()=>{var n;var c=typeof document!="undefined"?(n=document.currentScript)==null?void 0:n.src:void 0;return function(i={}){var s,d=i,m,w,C=new Promise((e,t)=>{m=e,w=t;}),I=Object.assign({},d),R="./this.program",H="",h1;typeof document!="undefined"&&document.currentScript&&(H=document.currentScript.src),c&&(H=c),H.startsWith("blob:")?H="":H=H.substr(0,H.replace(/[?#].*/,"").lastIndexOf("/")+1),h1=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url)));var I1=d.print||console.log.bind(console),o1=d.printErr||console.error.bind(console);Object.assign(d,I),I=null,d.thisProgram&&(R=d.thisProgram);var F1=d.wasmBinary,S1,T1=!1,V1,e1,T,t1,l1,N,E,I2,F2;function S2(){var e=S1.buffer;d.HEAP8=e1=new Int8Array(e),d.HEAP16=t1=new Int16Array(e),d.HEAPU8=T=new Uint8Array(e),d.HEAPU16=l1=new Uint16Array(e),d.HEAP32=N=new Int32Array(e),d.HEAPU32=E=new Uint32Array(e),d.HEAPF32=I2=new Float32Array(e),d.HEAPF64=F2=new Float64Array(e);}var T2=[],x2=[],A2=[];function y3(){var e=d.preRun.shift();T2.unshift(e);}var n1=0,c1=null;function x1(e){var t;throw (t=d.onAbort)==null||t.call(d,e),e="Aborted("+e+")",o1(e),T1=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),w(e),e}var R2=e=>e.startsWith("data:application/octet-stream;base64,"),p1;function k2(e){if(e==p1&&F1)return new Uint8Array(F1);throw "both async and sync fetching of the wasm failed"}function b3(e){return F1?Promise.resolve().then(()=>k2(e)):h1(e).then(t=>new Uint8Array(t),()=>k2(e))}function D2(e,t,r){return b3(e).then(a=>WebAssembly.instantiate(a,t)).then(r,a=>{o1(`failed to asynchronously prepare wasm: ${a}`),x1(a);})}function w3(e,t){var r=p1;return F1||typeof WebAssembly.instantiateStreaming!="function"||R2(r)||typeof fetch!="function"?D2(r,e,t):fetch(r,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,e).then(t,function(o){return o1(`wasm streaming compile failed: ${o}`),o1("falling back to ArrayBuffer instantiation"),D2(r,e,t)}))}var j,s1;function O2(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e;}var K1=e=>{for(;0{var a=t+r;for(r=t;e[r]&&!(r>=a);)++r;if(16o?a+=String.fromCharCode(o):(o-=65536,a+=String.fromCharCode(55296|o>>10,56320|o&1023));}}else a+=String.fromCharCode(o);}return a};class L3{constructor(t){this.Ha=t-24;}}var $2=0,f1=(e,t,r)=>{var a=T;if(0=u){var l=e.charCodeAt(++o);u=65536+((u&1023)<<10)|l&1023;}if(127>=u){if(t>=r)break;a[t++]=u;}else {if(2047>=u){if(t+1>=r)break;a[t++]=192|u>>6;}else {if(65535>=u){if(t+2>=r)break;a[t++]=224|u>>12;}else {if(t+3>=r)break;a[t++]=240|u>>18,a[t++]=128|u>>12&63;}a[t++]=128|u>>6&63;}a[t++]=128|u&63;}}a[t]=0;}},A1={},Y1=e=>{for(;e.length;){var t=e.pop();e.pop()(t);}};function m1(e){return this.fromWireType(E[e>>2])}var d1={},i1={},R1={},_1,Q=(e,t,r)=>{function a(h){if(h=r(h),h.length!==e.length)throw new _1("Mismatched type converter count");for(var p=0;pR1[h]=t);var o=Array(t.length),u=[],l=0;t.forEach((h,p)=>{i1.hasOwnProperty(h)?o[p]=i1[h]:(u.push(h),d1.hasOwnProperty(h)||(d1[h]=[]),d1[h].push(()=>{o[p]=i1[h],++l,l===u.length&&a(o);}));}),u.length===0&&a(o);},z2,k=e=>{for(var t="";T[e];)t+=z2[T[e++]];return t},y;function C3(e,t,r={}){var a=t.name;if(!e)throw new y(`type "${a}" must have a positive integer typeid pointer`);if(i1.hasOwnProperty(e)){if(r.mb)return;throw new y(`Cannot register type '${a}' twice`)}i1[e]=t,delete R1[e],d1.hasOwnProperty(e)&&(t=d1[e],delete d1[e],t.forEach(o=>o()));}function G(e,t,r={}){return C3(e,t,r)}var X1=e=>{throw new y(e.Fa.Ia.Ga.name+" instance already deleted")},Z1=!1,U2=()=>{},H2=(e,t,r)=>t===r?e:r.La===void 0?null:(e=H2(e,t,r.La),e===null?null:r.fb(e)),j2={},g1=[],Q1=()=>{for(;g1.length;){var e=g1.pop();e.Fa.Ra=!1,e.delete();}},y1,b1={},E3=(e,t)=>{if(t===void 0)throw new y("ptr should not be undefined");for(;e.La;)t=e.Ua(t),e=e.La;return b1[t]},k1=(e,t)=>{if(!t.Ia||!t.Ha)throw new _1("makeClassHandle requires ptr and ptrType");if(!!t.Ma!=!!t.Ja)throw new _1("Both smartPtrType and smartPtr must be specified");return t.count={value:1},w1(Object.create(e,{Fa:{value:t,writable:!0}}))},w1=e=>typeof FinalizationRegistry=="undefined"?(w1=t=>t,e):(Z1=new FinalizationRegistry(t=>{t=t.Fa,--t.count.value,t.count.value===0&&(t.Ja?t.Ma.Pa(t.Ja):t.Ia.Ga.Pa(t.Ha));}),w1=t=>{var r=t.Fa;return r.Ja&&Z1.register(t,{Fa:r},t),t},U2=t=>{Z1.unregister(t);},w1(e));function D1(){}var L1=(e,t)=>Object.defineProperty(t,"name",{value:e}),B2=(e,t,r)=>{if(e[t].Ka===void 0){var a=e[t];e[t]=function(...o){if(!e[t].Ka.hasOwnProperty(o.length))throw new y(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].Ka})!`);return e[t].Ka[o.length].apply(this,o)},e[t].Ka=[],e[t].Ka[a.Va]=a;}},e2=(e,t,r)=>{if(d.hasOwnProperty(e)){if(r===void 0||d[e].Ka!==void 0&&d[e].Ka[r]!==void 0)throw new y(`Cannot register public name '${e}' twice`);if(B2(d,e,e),d.hasOwnProperty(r))throw new y(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`);d[e].Ka[r]=t;}else d[e]=t,r!==void 0&&(d[e].vb=r);},P3=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 I3(e,t,r,a,o,u,l,h){this.name=e,this.constructor=t,this.Sa=r,this.Pa=a,this.La=o,this.hb=u,this.Ua=l,this.fb=h,this.ob=[];}var t2=(e,t,r)=>{for(;t!==r;){if(!t.Ua)throw new y(`Expected null or instance of ${r.name}, got an instance of ${t.name}`);e=t.Ua(e),t=t.La;}return e};function F3(e,t){if(t===null){if(this.Ya)throw new y(`null is not a valid ${this.name}`);return 0}if(!t.Fa)throw new y(`Cannot pass "${d2(t)}" as a ${this.name}`);if(!t.Fa.Ha)throw new y(`Cannot pass deleted object as a pointer of type ${this.name}`);return t2(t.Fa.Ha,t.Fa.Ia.Ga,this.Ga)}function S3(e,t){if(t===null){if(this.Ya)throw new y(`null is not a valid ${this.name}`);if(this.Xa){var r=this.Za();return e!==null&&e.push(this.Pa,r),r}return 0}if(!t||!t.Fa)throw new y(`Cannot pass "${d2(t)}" as a ${this.name}`);if(!t.Fa.Ha)throw new y(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Wa&&t.Fa.Ia.Wa)throw new y(`Cannot convert argument of type ${t.Fa.Ma?t.Fa.Ma.name:t.Fa.Ia.name} to parameter type ${this.name}`);if(r=t2(t.Fa.Ha,t.Fa.Ia.Ga,this.Ga),this.Xa){if(t.Fa.Ja===void 0)throw new y("Passing raw pointer to smart pointer is illegal");switch(this.tb){case 0:if(t.Fa.Ma===this)r=t.Fa.Ja;else throw new y(`Cannot convert argument of type ${t.Fa.Ma?t.Fa.Ma.name:t.Fa.Ia.name} to parameter type ${this.name}`);break;case 1:r=t.Fa.Ja;break;case 2:if(t.Fa.Ma===this)r=t.Fa.Ja;else {var a=t.clone();r=this.pb(r,W1(()=>a.delete())),e!==null&&e.push(this.Pa,r);}break;default:throw new y("Unsupporting sharing policy")}}return r}function T3(e,t){if(t===null){if(this.Ya)throw new y(`null is not a valid ${this.name}`);return 0}if(!t.Fa)throw new y(`Cannot pass "${d2(t)}" as a ${this.name}`);if(!t.Fa.Ha)throw new y(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.Fa.Ia.Wa)throw new y(`Cannot convert argument of type ${t.Fa.Ia.name} to parameter type ${this.name}`);return t2(t.Fa.Ha,t.Fa.Ia.Ga,this.Ga)}function M1(e,t,r,a,o,u,l,h,p,v,f){this.name=e,this.Ga=t,this.Ya=r,this.Wa=a,this.Xa=o,this.nb=u,this.tb=l,this.cb=h,this.Za=p,this.pb=v,this.Pa=f,o||t.La!==void 0?this.toWireType=S3:(this.toWireType=a?F3:T3,this.Oa=null);}var N2=(e,t,r)=>{if(!d.hasOwnProperty(e))throw new _1("Replacing nonexistent public symbol");d[e].Ka!==void 0&&r!==void 0?d[e].Ka[r]=t:(d[e]=t,d[e].Va=r);},B,x3=(e,t,r=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0, d["dynCall_"+e])(t,...r)):t=B.get(t)(...r),t),A3=(e,t)=>(...r)=>x3(e,t,r),O=(e,t)=>{e=k(e);var r=e.includes("j")?A3(e,t):B.get(t);if(typeof r!="function")throw new y(`unknown function pointer with signature ${e}: ${t}`);return r},G2,V2=e=>{e=t3(e);var t=k(e);return Z(e),t},O1=(e,t)=>{function r(u){o[u]||i1[u]||(R1[u]?R1[u].forEach(r):(a.push(u),o[u]=!0));}var a=[],o={};throw t.forEach(r),new G2(`${e}: `+a.map(V2).join([", "]))},n2=(e,t)=>{for(var r=[],a=0;a>2]);return r};function R3(e){for(var t=1;tu)throw new y("argTypes array size mismatch! Must at least get return value and 'this' types!");var l=t[1]!==null&&r!==null,h=R3(t),p=t[0].name!=="void",v=u-2,f=Array(v),b=[],L=[];return L1(e,function(...z){if(L.length=0,b.length=l?2:1,b[0]=o,l){var F=t[1].toWireType(L,this);b[1]=F;}for(var S=0;S{e=e.trim();let t=e.indexOf("(");return t!==-1?e.substr(0,t):e},r2=[],X=[],a2=e=>{9{if(!e)throw new y("Cannot use deleted val. handle = "+e);return X[e]},W1=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=r2.pop()||X.length;return X[t]=e,X[t+1]=1,t}},K2={name:"emscripten::val",fromWireType:e=>{var t=o2(e);return a2(e),t},toWireType:(e,t)=>W1(t),Na:8,readValueFromPointer:m1,Oa:null},k3=(e,t,r)=>{switch(t){case 1:return r?function(a){return this.fromWireType(e1[a])}:function(a){return this.fromWireType(T[a])};case 2:return r?function(a){return this.fromWireType(t1[a>>1])}:function(a){return this.fromWireType(l1[a>>1])};case 4:return r?function(a){return this.fromWireType(N[a>>2])}:function(a){return this.fromWireType(E[a>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},s2=(e,t)=>{var r=i1[e];if(r===void 0)throw e=`${t} has unknown type ${V2(e)}`,new y(e);return r},d2=e=>{if(e===null)return "null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},D3=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(I2[r>>2])};case 8:return function(r){return this.fromWireType(F2[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},O3=(e,t,r)=>{switch(t){case 1:return r?a=>e1[a]:a=>T[a];case 2:return r?a=>t1[a>>1]:a=>l1[a>>1];case 4:return r?a=>N[a>>2]:a=>E[a>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},W3=Object.assign({optional:!0},K2),q2=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):void 0,$3=(e,t)=>{for(var r=e>>1,a=r+t/2;!(r>=a)&&l1[r];)++r;if(r<<=1,32=t/2);++a){var o=t1[e+2*a>>1];if(o==0)break;r+=String.fromCharCode(o);}return r},z3=(e,t,r)=>{if(r!=null||(r=2147483647),2>r)return 0;r-=2;var a=t;r=r<2*e.length?r/2:e.length;for(var o=0;o>1]=e.charCodeAt(o),t+=2;return t1[t>>1]=0,t-a},U3=e=>2*e.length,H3=(e,t)=>{for(var r=0,a="";!(r>=t/4);){var o=N[e+4*r>>2];if(o==0)break;++r,65536<=o?(o-=65536,a+=String.fromCharCode(55296|o>>10,56320|o&1023)):a+=String.fromCharCode(o);}return a},j3=(e,t,r)=>{if(r!=null||(r=2147483647),4>r)return 0;var a=t;r=a+r-4;for(var o=0;o=u){var l=e.charCodeAt(++o);u=65536+((u&1023)<<10)|l&1023;}if(N[t>>2]=u,t+=4,t+4>r)break}return N[t>>2]=0,t-a},B3=e=>{for(var t=0,r=0;r=a&&++r,t+=4;}return t},u2=[],N3=e=>{var t=u2.length;return u2.push(e),t},G3=(e,t)=>{for(var r=Array(e),a=0;a>2],"parameter "+a);return r},V3=Reflect.construct,C1={},Y2=e=>{if(!(e instanceof O2||e=="unwind"))throw e},h2=0,X2=e=>{var t;throw V1=e,q1||0{if(!T1)try{if(e(),!(q1||0{if(!c2){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",_:R||"./this.program"},t;for(t in l2)l2[t]===void 0?delete e[t]:e[t]=l2[t];var r=[];for(t in e)r.push(`${t}=${e[t]}`);c2=r;}return c2},c2,K3=[null,[],[]],q3=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);x1("initRandomDevice");},Q2=e=>(Q2=q3())(e);_1=d.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError";}};for(var e3=Array(256),$1=0;256>$1;++$1)e3[$1]=String.fromCharCode($1);z2=e3,y=d.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError";}},Object.assign(D1.prototype,{isAliasOf:function(e){if(!(this instanceof D1&&e instanceof D1))return !1;var t=this.Fa.Ia.Ga,r=this.Fa.Ha;e.Fa=e.Fa;var a=e.Fa.Ia.Ga;for(e=e.Fa.Ha;t.La;)r=t.Ua(r),t=t.La;for(;a.La;)e=a.Ua(e),a=a.La;return t===a&&r===e},clone:function(){if(this.Fa.Ha||X1(this),this.Fa.Ta)return this.Fa.count.value+=1,this;var e=w1,t=Object,r=t.create,a=Object.getPrototypeOf(this),o=this.Fa;return e=e(r.call(t,a,{Fa:{value:{count:o.count,Ra:o.Ra,Ta:o.Ta,Ha:o.Ha,Ia:o.Ia,Ja:o.Ja,Ma:o.Ma}}})),e.Fa.count.value+=1,e.Fa.Ra=!1,e},delete(){if(this.Fa.Ha||X1(this),this.Fa.Ra&&!this.Fa.Ta)throw new y("Object already scheduled for deletion");U2(this);var e=this.Fa;--e.count.value,e.count.value===0&&(e.Ja?e.Ma.Pa(e.Ja):e.Ia.Ga.Pa(e.Ha)),this.Fa.Ta||(this.Fa.Ja=void 0,this.Fa.Ha=void 0);},isDeleted:function(){return !this.Fa.Ha},deleteLater:function(){if(this.Fa.Ha||X1(this),this.Fa.Ra&&!this.Fa.Ta)throw new y("Object already scheduled for deletion");return g1.push(this),g1.length===1&&y1&&y1(Q1),this.Fa.Ra=!0,this}}),d.getInheritedInstanceCount=()=>Object.keys(b1).length,d.getLiveInheritedInstances=()=>{var e=[],t;for(t in b1)b1.hasOwnProperty(t)&&e.push(b1[t]);return e},d.flushPendingDeletes=Q1,d.setDelayFunction=e=>{y1=e,g1.length&&y1&&y1(Q1);},Object.assign(M1.prototype,{ib(e){return this.cb&&(e=this.cb(e)),e},ab(e){var t;(t=this.Pa)==null||t.call(this,e);},Na:8,readValueFromPointer:m1,fromWireType:function(e){function t(){return this.Xa?k1(this.Ga.Sa,{Ia:this.nb,Ha:r,Ma:this,Ja:e}):k1(this.Ga.Sa,{Ia:this,Ha:e})}var r=this.ib(e);if(!r)return this.ab(e),null;var a=E3(this.Ga,r);if(a!==void 0)return a.Fa.count.value===0?(a.Fa.Ha=r,a.Fa.Ja=e,a.clone()):(a=a.clone(),this.ab(e),a);if(a=this.Ga.hb(r),a=j2[a],!a)return t.call(this);a=this.Wa?a.eb:a.pointerType;var o=H2(r,this.Ga,a.Ga);return o===null?t.call(this):this.Xa?k1(a.Ga.Sa,{Ia:a,Ha:o,Ma:this,Ja:e}):k1(a.Ga.Sa,{Ia:a,Ha:o})}}),G2=d.UnboundTypeError=((e,t)=>{var r=L1(t,function(a){this.name=t,this.message=a,a=Error(a).stack,a!==void 0&&(this.stack=this.toString()+` `+a.replace(/^Error(:[^\n]*)?\n/,""));});return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r})(Error,"UnboundTypeError"),X.push(0,1,void 0,1,null,1,!0,1,!1,1),d.count_emval_handles=()=>X.length/2-5-r2.length;var Y3={c:(e,t,r,a)=>{x1(`Assertion failed: ${e?v1(T,e):""}, at: `+[t?t?v1(T,t):"":"unknown filename",r,a?a?v1(T,a):"":"unknown function"]);},n:(e,t,r)=>{var a=new L3(e);throw E[a.Ha+16>>2]=0,E[a.Ha+4>>2]=t,E[a.Ha+8>>2]=r,$2=e,$2},Y:()=>{},X:()=>{},l:function(){return 0},V:()=>{},S:()=>{},W:function(){return 0},T:()=>{},C:function(){},Q:()=>{},U:()=>{},Z:()=>{x1("");},w:e=>{var t=A1[e];delete A1[e];var r=t.Za,a=t.Pa,o=t.bb,u=o.map(l=>l.lb).concat(o.map(l=>l.rb));Q([e],u,l=>{var h={};return o.forEach((p,v)=>{var f=l[v],b=p.jb,L=p.kb,z=l[v+o.length],F=p.qb,S=p.sb;h[p.gb]={read:q=>f.fromWireType(b(L,q)),write:(q,E1)=>{var U=[];F(S,q,z.toWireType(U,E1)),Y1(U);}};}),[{name:t.name,fromWireType:p=>{var v={},f;for(f in h)v[f]=h[f].read(p);return a(p),v},toWireType:(p,v)=>{for(var f in h)if(!(f in v))throw new TypeError(`Missing field: "${f}"`);var b=r();for(f in h)h[f].write(b,v[f]);return p!==null&&p.push(a,b),b},Na:8,readValueFromPointer:m1,Oa:a}]});},J:()=>{},da:(e,t,r,a)=>{t=k(t),G(e,{name:t,fromWireType:function(o){return !!o},toWireType:function(o,u){return u?r:a},Na:8,readValueFromPointer:function(o){return this.fromWireType(T[o])},Oa:null});},t:(e,t,r,a,o,u,l,h,p,v,f,b,L)=>{f=k(f),u=O(o,u),h&&(h=O(l,h)),v&&(v=O(p,v)),L=O(b,L);var z=P3(f);e2(z,function(){O1(`Cannot construct ${f} due to unbound types`,[a]);}),Q([e,t,r],a?[a]:[],F=>{if(F=F[0],a)var S=F.Ga,q=S.Sa;else q=D1.prototype;F=L1(f,function(...v2){if(Object.getPrototypeOf(this)!==E1)throw new y("Use 'new' to construct "+f);if(U.Qa===void 0)throw new y(f+" has no accessible constructor");var o3=U.Qa[v2.length];if(o3===void 0)throw new y(`Tried to invoke ctor of ${f} with invalid number of parameters (${v2.length}) - expected (${Object.keys(U.Qa).toString()}) parameters instead!`);return o3.apply(this,v2)});var E1=Object.create(q,{constructor:{value:F}});F.prototype=E1;var U=new I3(f,F,E1,L,S,u,h,v);if(U.La){var P1;((P1=U.La).$a)!=null||(P1.$a=[]),U.La.$a.push(U);}return S=new M1(f,U,!0,!1,!1),P1=new M1(f+"*",U,!1,!1,!1),q=new M1(f+" const*",U,!1,!0,!1),j2[e]={pointerType:P1,eb:q},N2(z,F),[S,P1,q]});},r:(e,t,r,a,o,u)=>{var l=n2(t,r);o=O(a,o),Q([],[e],h=>{h=h[0];var p=`constructor ${h.name}`;if(h.Ga.Qa===void 0&&(h.Ga.Qa=[]),h.Ga.Qa[t-1]!==void 0)throw new y(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return h.Ga.Qa[t-1]=()=>{O1(`Cannot construct ${h.name} due to unbound types`,l);},Q([],l,v=>(v.splice(1,0,null),h.Ga.Qa[t-1]=i2(p,v,null,o,u),[])),[]});},f:(e,t,r,a,o,u,l,h)=>{var p=n2(r,a);t=k(t),t=J2(t),u=O(o,u),Q([],[e],v=>{function f(){O1(`Cannot call ${b} due to unbound types`,p);}v=v[0];var b=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),h&&v.Ga.ob.push(t);var L=v.Ga.Sa,z=L[t];return z===void 0||z.Ka===void 0&&z.className!==v.name&&z.Va===r-2?(f.Va=r-2,f.className=v.name,L[t]=f):(B2(L,t,b),L[t].Ka[r-2]=f),Q([],p,F=>(F=i2(b,F,v,u,l),L[t].Ka===void 0?(F.Va=r-2,L[t]=F):L[t].Ka[r-2]=F,[])),[]});},ca:e=>G(e,K2),y:(e,t,r,a)=>{function o(){}t=k(t),o.values={},G(e,{name:t,constructor:o,fromWireType:function(u){return this.constructor.values[u]},toWireType:(u,l)=>l.value,Na:8,readValueFromPointer:k3(t,r,a),Oa:null}),e2(t,o);},k:(e,t,r)=>{var a=s2(e,"enum");t=k(t),e=a.constructor,a=Object.create(a.constructor.prototype,{value:{value:r},constructor:{value:L1(`${a.name}_${t}`,function(){})}}),e.values[r]=a,e[t]=a;},D:(e,t,r)=>{t=k(t),G(e,{name:t,fromWireType:a=>a,toWireType:(a,o)=>o,Na:8,readValueFromPointer:D3(t,r),Oa:null});},F:(e,t,r,a,o,u)=>{var l=n2(t,r);e=k(e),e=J2(e),o=O(a,o),e2(e,function(){O1(`Cannot call ${e} due to unbound types`,l);},t-1),Q([],l,h=>(N2(e,i2(e,[h[0],null].concat(h.slice(1)),null,o,u),t-1),[]));},m:(e,t,r,a,o)=>{if(t=k(t),o===-1&&(o=4294967295),o=h=>h,a===0){var u=32-8*r;o=h=>h<>>u;}var l=t.includes("unsigned")?function(h,p){return p>>>0}:function(h,p){return p};G(e,{name:t,fromWireType:o,toWireType:l,Na:8,readValueFromPointer:O3(t,r,a!==0),Oa:null});},h:(e,t,r)=>{function a(u){return new o(e1.buffer,E[u+4>>2],E[u>>2])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];r=k(r),G(e,{name:r,fromWireType:a,Na:8,readValueFromPointer:a},{mb:!0});},v:e=>{G(e,W3);},ja:(e,t,r,a,o,u,l,h,p,v,f,b)=>{r=k(r),u=O(o,u),h=O(l,h),v=O(p,v),b=O(f,b),Q([e],[t],L=>(L=L[0],[new M1(r,L.Ga,!1,!1,!0,L,a,u,h,v,b)]));},E:(e,t)=>{t=k(t);var r=t==="std::string";G(e,{name:t,fromWireType:function(a){var o=E[a>>2],u=a+4;if(r)for(var l=u,h=0;h<=o;++h){var p=u+h;if(h==o||T[p]==0){if(l=l?v1(T,l,p-l):"",v===void 0)var v=l;else v+="\0",v+=l;l=p+1;}}else {for(v=Array(o),h=0;h=p?u++:2047>=p?u+=2:55296<=p&&57343>=p?(u+=4,++h):u+=3;}else u=o.length;if(h=p2(4+u+1),p=h+4,E[h>>2]=u,r&&l)f1(o,p,u+1);else if(l)for(l=0;l{if(r=k(r),t===2)var a=$3,o=z3,u=U3,l=h=>l1[h>>1];else t===4&&(a=H3,o=j3,u=B3,l=h=>E[h>>2]);G(e,{name:r,fromWireType:h=>{for(var p=E[h>>2],v,f=h+4,b=0;b<=p;++b){var L=h+4+b*t;(b==p||l(L)==0)&&(f=a(f,L-f),v===void 0?v=f:(v+="\0",v+=f),f=L+t);}return Z(h),v},toWireType:(h,p)=>{if(typeof p!="string")throw new y(`Cannot pass non-string to C++ string type ${r}`);var v=u(p),f=p2(4+v+t);return E[f>>2]=v/t,o(p,f+4,v+t),h!==null&&h.push(Z,f),f},Na:8,readValueFromPointer:m1,Oa(h){Z(h);}});},x:(e,t,r,a,o,u)=>{A1[e]={name:k(t),Za:O(r,a),Pa:O(o,u),bb:[]};},j:(e,t,r,a,o,u,l,h,p,v)=>{A1[e].bb.push({gb:k(t),lb:r,jb:O(a,o),kb:u,rb:l,qb:O(h,p),sb:v});},ea:(e,t)=>{t=k(t),G(e,{ub:!0,name:t,Na:0,fromWireType:()=>{},toWireType:()=>{}});},P:()=>{q1=!1,h2=0;},K:()=>{throw 1/0},ha:(e,t,r,a)=>(e=u2[e],t=o2(t),e(null,t,r,a)),G:a2,ga:(e,t,r)=>{var a=G3(e,t),o=a.shift();e--;var u=Array(e);return t=`methodCaller<(${a.map(l=>l.name).join(", ")}) => ${o.name}>`,N3(L1(t,(l,h,p,v)=>{for(var f=0,b=0;b>2]=W1(l)),h}))},ia:e=>{9{var t=o2(e);Y1(t),a2(e);},p:(e,t)=>(e=s2(e,"_emval_take_value"),e=e.readValueFromPointer(t),W1(e)),L:(e,t)=>{if(C1[e]&&(clearTimeout(C1[e].id),delete C1[e]),!t)return 0;var r=setTimeout(()=>{delete C1[e],J3(()=>n3(e,performance.now()));},t);return C1[e]={id:r,wb:t},0},M:(e,t,r,a)=>{var o=new Date().getFullYear(),u=new Date(o,0,1).getTimezoneOffset();o=new Date(o,6,1).getTimezoneOffset(),E[e>>2]=60*Math.max(u,o),N[t>>2]=+(u!=o),t=l=>{var h=Math.abs(l);return `UTC${0<=l?"-":"+"}${String(Math.floor(h/60)).padStart(2,"0")}${String(h%60).padStart(2,"0")}`},e=t(u),t=t(o),o2147483648,ka:()=>performance.now(),N:e=>{var t=T.length;if(e>>>=0,2147483648=r;r*=2){var a=t*(1+.2/r);a=Math.min(a,e+100663296);e:{a=(Math.min(2147483648,65536*Math.ceil(Math.max(e,a)/65536))-S1.buffer.byteLength+65535)/65536;try{S1.grow(a),S2();var o=1;break e}catch(u){}o=void 0;}if(o)return !0}return !1},$:(e,t)=>{var r=0;return Z2().forEach((a,o)=>{var u=t+r;for(o=E[e+4*o>>2]=u,u=0;u{var r=Z2();E[e>>2]=r.length;var a=0;return r.forEach(o=>a+=o.length+1),E[t>>2]=a,0},s:()=>52,R:(e,t)=>{var r=0;return e==0?r=2:(e==1||e==2)&&(r=64),e1[t]=2,t1[t+2>>1]=1,s1=[r>>>0,(j=r,1<=+Math.abs(j)?0>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],N[t+8>>2]=s1[0],N[t+12>>2]=s1[1],s1=[0,(j=0,1<=+Math.abs(j)?0>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],N[t+16>>2]=s1[0],N[t+20>>2]=s1[1],0},B:()=>52,I:function(){return 70},A:(e,t,r,a)=>{for(var o=0,u=0;u>2],h=E[t+4>>2];t+=8;for(var p=0;p>2]=o,0},ba:(e,t)=>(Q2(T.subarray(e,e+t)),0),i:t0,d:e0,e:Q3,q:n0,z:a0,b:X3,a:Z3,g:r0,o:i0,H:o0,_:X2},P=function(){var r;function e(a){var o;return P=a.exports,S1=P.la,S2(),B=P.pa,x2.unshift(P.ma),n1--,(o=d.monitorRunDependencies)==null||o.call(d,n1),n1==0&&(c1&&(a=c1,c1=null,a())),P}var t={a:Y3};if(n1++,(r=d.monitorRunDependencies)==null||r.call(d,n1),d.instantiateWasm)try{return d.instantiateWasm(t,e)}catch(a){o1(`Module.instantiateWasm callback failed with error: ${a}`),w(a);}return p1!=null||(p1=R2("DotLottiePlayer.wasm")?"DotLottiePlayer.wasm":d.locateFile?d.locateFile("DotLottiePlayer.wasm",H):H+"DotLottiePlayer.wasm"),w3(t,function(a){e(a.instance);}).catch(w),{}}(),p2=e=>(p2=P.na)(e),t3=e=>(t3=P.oa)(e),Z=e=>(Z=P.qa)(e),n3=(e,t)=>(n3=P.ra)(e,t),V=(e,t)=>(V=P.sa)(e,t),J=e=>(J=P.ta)(e),K=()=>(K=P.ua)();d.dynCall_iijj=(e,t,r,a,o,u)=>(d.dynCall_iijj=P.va)(e,t,r,a,o,u),d.dynCall_vijj=(e,t,r,a,o,u)=>(d.dynCall_vijj=P.wa)(e,t,r,a,o,u),d.dynCall_jiii=(e,t,r,a)=>(d.dynCall_jiii=P.xa)(e,t,r,a),d.dynCall_jii=(e,t,r)=>(d.dynCall_jii=P.ya)(e,t,r);var i3=d.dynCall_vijjj=(e,t,r,a,o,u,l,h)=>(i3=d.dynCall_vijjj=P.za)(e,t,r,a,o,u,l,h);d.dynCall_jiji=(e,t,r,a,o)=>(d.dynCall_jiji=P.Aa)(e,t,r,a,o),d.dynCall_viijii=(e,t,r,a,o,u,l)=>(d.dynCall_viijii=P.Ba)(e,t,r,a,o,u,l),d.dynCall_iiiiij=(e,t,r,a,o,u,l)=>(d.dynCall_iiiiij=P.Ca)(e,t,r,a,o,u,l),d.dynCall_iiiiijj=(e,t,r,a,o,u,l,h,p)=>(d.dynCall_iiiiijj=P.Da)(e,t,r,a,o,u,l,h,p),d.dynCall_iiiiiijj=(e,t,r,a,o,u,l,h,p,v)=>(d.dynCall_iiiiiijj=P.Ea)(e,t,r,a,o,u,l,h,p,v);function X3(e,t){var r=K();try{B.get(e)(t);}catch(a){if(J(r),a!==a+0)throw a;V(1,0);}}function Z3(e,t,r){var a=K();try{B.get(e)(t,r);}catch(o){if(J(a),o!==o+0)throw o;V(1,0);}}function Q3(e,t,r,a){var o=K();try{return B.get(e)(t,r,a)}catch(u){if(J(o),u!==u+0)throw u;V(1,0);}}function e0(e,t,r){var a=K();try{return B.get(e)(t,r)}catch(o){if(J(a),o!==o+0)throw o;V(1,0);}}function t0(e,t){var r=K();try{return B.get(e)(t)}catch(a){if(J(r),a!==a+0)throw a;V(1,0);}}function n0(e,t,r,a,o,u){var l=K();try{return B.get(e)(t,r,a,o,u)}catch(h){if(J(l),h!==h+0)throw h;V(1,0);}}function i0(e,t,r,a,o){var u=K();try{B.get(e)(t,r,a,o);}catch(l){if(J(u),l!==l+0)throw l;V(1,0);}}function r0(e,t,r,a){var o=K();try{B.get(e)(t,r,a);}catch(u){if(J(o),u!==u+0)throw u;V(1,0);}}function a0(e){var t=K();try{B.get(e)();}catch(r){if(J(t),r!==r+0)throw r;V(1,0);}}function o0(e,t,r,a,o,u,l,h){var p=K();try{i3(e,t,r,a,o,u,l,h);}catch(v){if(J(p),v!==v+0)throw v;V(1,0);}}var z1;c1=function e(){z1||r3(),z1||(c1=e);};function r3(){function e(){var r;if(!z1&&(z1=!0,d.calledRun=!0,!T1)){if(K1(x2),m(d),(r=d.onRuntimeInitialized)==null||r.call(d),d.postRun)for(typeof d.postRun=="function"&&(d.postRun=[d.postRun]);d.postRun.length;){var t=d.postRun.shift();A2.unshift(t);}K1(A2);}}if(!(0{setTimeout(()=>d.setStatus(""),1),e();},1)):e());}}if(d.preInit)for(typeof d.preInit=="function"&&(d.preInit=[d.preInit]);0n})})}static _loadWithBackup(){return g(this,null,function*(){return this._ModulePromise||(this._ModulePromise=this._tryLoad(this._wasmURL).catch(n=>g(this,null,function*(){let i=`https://unpkg.com/${y2}@${g2}/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: ${i}`);try{return yield this._tryLoad(i)}catch(s){throw console.error(`Primary WASM URL failed: ${n.message}`),console.error(`Backup WASM URL failed: ${s.message}`),new Error("WASM loading failed from all sources.")}}))),this._ModulePromise})}static load(){return g(this,null,function*(){return this._loadWithBackup()})}static setWasmUrl(n){this._wasmURL=n,this._ModulePromise=null;}};_(r1,"_ModulePromise",null),_(r1,"_wasmURL",`https://cdn.jsdelivr.net/npm/${y2}@${g2}/dist/dotlottie-player.wasm`);var u1=class{constructor(){_(this,"_eventListeners",new Map);}addEventListener(n,i){let s=this._eventListeners.get(n);s||(s=new Set,this._eventListeners.set(n,s)),s.add(i);}removeEventListener(n,i){let s=this._eventListeners.get(n);s&&(i?(s.delete(i),s.size===0&&this._eventListeners.delete(n)):this._eventListeners.delete(n));}dispatch(n){let i=this._eventListeners.get(n.type);i==null||i.forEach(s=>s(n));}removeAllEventListeners(){this._eventListeners.clear();}};var W=class{static _initializeObserver(){if(this._observer)return;let n=i=>{i.forEach(s=>{let d=this._observedCanvases.get(s.target);d&&(s.isIntersecting?d.unfreeze():d.freeze());});};this._observer=new IntersectionObserver(n,{threshold:0});}static observe(n,i){var s;this._initializeObserver(),!this._observedCanvases.has(n)&&(this._observedCanvases.set(n,i),(s=this._observer)==null||s.observe(n));}static unobserve(n){var i,s;(i=this._observer)==null||i.unobserve(n),this._observedCanvases.delete(n),this._observedCanvases.size===0&&((s=this._observer)==null||s.disconnect(),this._observer=null);}};_(W,"_observer",null),_(W,"_observedCanvases",new Map);var $=class{static _initializeObserver(){if(this._observer)return;let n=i=>{i.forEach(s=>{let d=this._observedCanvases.get(s.target);if(!d)return;let[m,w]=d;clearTimeout(w);let C=setTimeout(()=>{m.resize();},100);this._observedCanvases.set(s.target,[m,C]);});};this._observer=new ResizeObserver(n);}static observe(n,i){var s;this._initializeObserver(),!this._observedCanvases.has(n)&&(this._observedCanvases.set(n,[i,0]),(s=this._observer)==null||s.observe(n));}static unobserve(n){var i,s;(i=this._observer)==null||i.unobserve(n),this._observedCanvases.delete(n),this._observedCanvases.size===0&&((s=this._observer)==null||s.disconnect(),this._observer=null);}};_($,"_observer",null),_($,"_observedCanvases",new Map);function l0(c){return /^#([\da-f]{6}|[\da-f]{8})$/iu.test(c)}function p3(c){if(!l0(c))return 0;let n=c.replace("#","");return n=n.length===6?`${n}ff`:n,parseInt(n,16)}function b2(c){if(c.byteLength<4)return !1;let n=new Uint8Array(c.slice(0,B1.byteLength));for(let i=0;iObject.prototype.hasOwnProperty.call(c,n))}function w2(c){if(typeof c=="string")try{return c3(JSON.parse(c))}catch(n){return !1}else return c3(c)}function a1(){return 1+((A?window.devicePixelRatio:1)-1)*h3}function N1(c){let n=c.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)}var L2=(c,n)=>c==="reverse"?n.Mode.Reverse:c==="bounce"?n.Mode.Bounce:c==="reverse-bounce"?n.Mode.ReverseBounce:n.Mode.Forward,M2=(c,n)=>c==="contain"?n.Fit.Contain:c==="cover"?n.Fit.Cover:c==="fill"?n.Fit.Fill:c==="fit-height"?n.Fit.FitHeight:c==="fit-width"?n.Fit.FitWidth:n.Fit.None,C2=(c,n)=>{let i=new n.VectorFloat;return i.push_back(c[0]),i.push_back(c[1]),i},E2=(c,n)=>{let i=new n.VectorFloat;return c.length!==2||(i.push_back(c[0]),i.push_back(c[1])),i},M=class M{constructor(n){_(this,"_canvas");_(this,"_context",null);_(this,"_eventManager");_(this,"_animationFrameId",null);_(this,"_frameManager");_(this,"_dotLottieCore",null);_(this,"_renderConfig",{});_(this,"_isFrozen",!1);_(this,"_backgroundColor",null);_(this,"_stateMachineIsActive",!1);_(this,"_previousFrameNb",0);_(this,"_pointerUpMethod");_(this,"_pointerDownMethod");_(this,"_pointerMoveMethod");_(this,"_pointerEnterMethod");_(this,"_pointerExitMethod");var i,s,d;this._canvas=n.canvas,this._context=this._canvas.getContext("2d"),this._eventManager=new u1,this._frameManager=new j1,this._renderConfig=D(x({},n.renderConfig),{devicePixelRatio:((i=n.renderConfig)==null?void 0:i.devicePixelRatio)||a1(),freezeOnOffscreen:(d=(s=n.renderConfig)==null?void 0:s.freezeOnOffscreen)!=null?d:!0}),r1.load().then(m=>{var w,C,I,R,H,h1,I1;M._wasmModule=m,this._dotLottieCore=new m.DotLottiePlayer({autoplay:(w=n.autoplay)!=null?w:!1,backgroundColor:0,loopAnimation:(C=n.loop)!=null?C:!1,mode:L2((I=n.mode)!=null?I:"forward",m),segment:E2((R=n.segment)!=null?R:[],m),speed:(H=n.speed)!=null?H:1,useFrameInterpolation:(h1=n.useFrameInterpolation)!=null?h1:!0,marker:(I1=n.marker)!=null?I1:"",layout:n.layout?{align:C2(n.layout.align,m),fit:M2(n.layout.fit,m)}:m.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(m=>{this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${m}`)});}),this._pointerUpMethod=this._onPointerUp.bind(this),this._pointerDownMethod=this._onPointerDown.bind(this),this._pointerMoveMethod=this._onPointerMove.bind(this),this._pointerEnterMethod=this._onPointerEnter.bind(this),this._pointerExitMethod=this._onPointerLeave.bind(this);}_dispatchError(n){console.error(n),this._eventManager.dispatch({type:"loadError",error:new Error(n)});}_fetchData(n){return g(this,null,function*(){let i=yield fetch(n);if(!i.ok)throw new Error(`Failed to fetch animation data from URL: ${n}. ${i.status}: ${i.statusText}`);let s=yield i.arrayBuffer();return b2(s)?s:new TextDecoder().decode(s)})}_loadFromData(n){if(this._dotLottieCore===null)return;let i=this._canvas.width,s=this._canvas.height,d=!1;if(typeof n=="string"){if(!w2(n)){this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}d=this._dotLottieCore.loadAnimationData(n,i,s);}else if(n instanceof ArrayBuffer){if(!b2(n)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}d=this._dotLottieCore.loadDotLottieData(n,i,s);}else if(typeof n=="object"){if(!w2(n)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}d=this._dotLottieCore.loadAnimationData(JSON.stringify(n),i,s);}else {this._dispatchError(`Unsupported data type for animation data. Expected: - string (Lottie JSON), - ArrayBuffer (dotLottie), - object (Lottie JSON). Received: ${typeof n}`);return}d?(this._eventManager.dispatch({type:"load"}),A&&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")),A&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&W.observe(this._canvas,this),this._renderConfig.autoResize&&$.observe(this._canvas,this))):this._dispatchError("Failed to load animation data");}_loadFromSrc(n){this._fetchData(n).then(i=>this._loadFromData(i)).catch(i=>this._dispatchError(`Failed to load animation data from URL: ${n}. ${i}`));}get activeAnimationId(){var n;return (n=this._dotLottieCore)==null?void 0:n.activeAnimationId()}get activeThemeId(){var n;return (n=this._dotLottieCore)==null?void 0:n.activeThemeId()}get layout(){var i;let n=(i=this._dotLottieCore)==null?void 0:i.config().layout;if(n)return {align:[n.align.get(0),n.align.get(1)],fit:(()=>{var s,d,m,w,C,I;switch(n.fit){case((s=M._wasmModule)==null?void 0:s.Fit.Contain):return "contain";case((d=M._wasmModule)==null?void 0:d.Fit.Cover):return "cover";case((m=M._wasmModule)==null?void 0:m.Fit.Fill):return "fill";case((w=M._wasmModule)==null?void 0:w.Fit.FitHeight):return "fit-height";case((C=M._wasmModule)==null?void 0:C.Fit.FitWidth):return "fit-width";case((I=M._wasmModule)==null?void 0:I.Fit.None):return "none";default:return "contain"}})()}}get marker(){var i;return (i=this._dotLottieCore)==null?void 0:i.config().marker}get manifest(){var n;try{let i=(n=this._dotLottieCore)==null?void 0:n.manifestString();if(this._dotLottieCore===null||!i)return null;let s=JSON.parse(i);return Object.keys(s).length===0?null:s}catch(i){return null}}get renderConfig(){return this._renderConfig}get segment(){var i;let n=(i=this._dotLottieCore)==null?void 0:i.config().segment;if(n&&n.size()===2)return [n.get(0),n.get(1)]}get loop(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.config().loopAnimation)!=null?i:!1}get mode(){var i,s,d,m;let n=(i=this._dotLottieCore)==null?void 0:i.config().mode;return n===((s=M._wasmModule)==null?void 0:s.Mode.Reverse)?"reverse":n===((d=M._wasmModule)==null?void 0:d.Mode.Bounce)?"bounce":n===((m=M._wasmModule)==null?void 0:m.Mode.ReverseBounce)?"reverse-bounce":"forward"}get isFrozen(){return this._isFrozen}get backgroundColor(){var n;return (n=this._backgroundColor)!=null?n:""}get autoplay(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.config().autoplay)!=null?i:!1}get useFrameInterpolation(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.config().useFrameInterpolation)!=null?i:!1}get speed(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.config().speed)!=null?i:0}get isReady(){return this._dotLottieCore!==null}get isLoaded(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.isLoaded())!=null?i:!1}get isPlaying(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.isPlaying())!=null?i:!1}get isPaused(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.isPaused())!=null?i:!1}get isStopped(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.isStopped())!=null?i:!1}get currentFrame(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.currentFrame())!=null?i:0}get loopCount(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.loopCount())!=null?i:0}get totalFrames(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.totalFrames())!=null?i:0}get duration(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.duration())!=null?i:0}get segmentDuration(){var n,i;return (i=(n=this._dotLottieCore)==null?void 0:n.segmentDuration())!=null?i:0}get canvas(){return this._canvas}get isStateMachineActive(){return this._stateMachineIsActive}load(n){var i,s,d,m,w,C,I,R;this._dotLottieCore===null||M._wasmModule===null||(this._dotLottieCore.setConfig({autoplay:(i=n.autoplay)!=null?i:!1,backgroundColor:0,loopAnimation:(s=n.loop)!=null?s:!1,mode:L2((d=n.mode)!=null?d:"forward",M._wasmModule),segment:E2((m=n.segment)!=null?m:[],M._wasmModule),speed:(w=n.speed)!=null?w:1,useFrameInterpolation:(C=n.useFrameInterpolation)!=null?C:!0,marker:(I=n.marker)!=null?I:"",layout:n.layout?{align:C2(n.layout.align,M._wasmModule),fit:M2(n.layout.fit,M._wasmModule)}:M._wasmModule.createDefaultLayout()}),n.data?this._loadFromData(n.data):n.src&&this._loadFromSrc(n.src),this.setBackgroundColor((R=n.backgroundColor)!=null?R:""));}_render(){if(this._dotLottieCore===null||this._context===null)return !1;if(this._dotLottieCore.render()){let i=this._dotLottieCore.buffer(),s=new Uint8ClampedArray(i,0,this._canvas.width*this._canvas.height*4),d=null;return typeof ImageData=="undefined"?(d=this._context.createImageData(this._canvas.width,this._canvas.height),d.data.set(s)):d=new ImageData(s,this._canvas.width,this._canvas.height),this._context.putImageData(d,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()&&!this._stateMachineIsActive)return;let n=this._dotLottieCore.requestFrame();(this._dotLottieCore.setFrame(n)||this._previousFrameNb!==n&&this._stateMachineIsActive)&&(this._previousFrameNb=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;(this._dotLottieCore.play()||this._dotLottieCore.isPlaying())&&(this._isFrozen=!1,this._eventManager.dispatch({type:"play"}),this._animationFrameId=this._frameManager.requestAnimationFrame(this._draw.bind(this))),A&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!N1(this._canvas)&&this.freeze();}pause(){if(this._dotLottieCore===null)return;(this._dotLottieCore.pause()||this._dotLottieCore.isPaused())&&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(D(x({},this._dotLottieCore.config()),{speed:n}));}setBackgroundColor(n){this._dotLottieCore!==null&&(A&&this._canvas instanceof HTMLCanvasElement?this._canvas.style.backgroundColor=n:this._dotLottieCore.setConfig(D(x({},this._dotLottieCore.config()),{backgroundColor:p3(n)})),this._backgroundColor=n);}setLoop(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig(D(x({},this._dotLottieCore.config()),{loopAnimation:n}));}setUseFrameInterpolation(n){this._dotLottieCore!==null&&this._dotLottieCore.setConfig(D(x({},this._dotLottieCore.config()),{useFrameInterpolation:n}));}addEventListener(n,i){this._eventManager.addEventListener(n,i);}removeEventListener(n,i){this._eventManager.removeEventListener(n,i);}destroy(){var n;A&&this._canvas instanceof HTMLCanvasElement&&(W.unobserve(this._canvas),$.unobserve(this._canvas)),(n=this._dotLottieCore)==null||n.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(!this._dotLottieCore||!this.isLoaded)return;if(A&&this._canvas instanceof HTMLCanvasElement){let i=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:s,width:d}=this._canvas.getBoundingClientRect();this._canvas.width=d*i,this._canvas.height=s*i;}this._dotLottieCore.resize(this._canvas.width,this._canvas.height)&&this._render();}setSegment(n,i){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig(D(x({},this._dotLottieCore.config()),{segment:E2([n,i],M._wasmModule)}));}setMode(n){this._dotLottieCore===null||M._wasmModule===null||this._dotLottieCore.setConfig(D(x({},this._dotLottieCore.config()),{mode:L2(n,M._wasmModule)}));}setRenderConfig(n){let m=n,{devicePixelRatio:i,freezeOnOffscreen:s}=m,d=H1(m,["devicePixelRatio","freezeOnOffscreen"]);this._renderConfig=D(x(x({},this._renderConfig),d),{devicePixelRatio:i||a1(),freezeOnOffscreen:s!=null?s:!0}),A&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?$.observe(this._canvas,this):$.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?W.observe(this._canvas,this):(W.unobserve(this._canvas),this._isFrozen&&this.unfreeze()));}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(D(x({},this._dotLottieCore.config()),{marker:n}));}markers(){var i;let n=(i=this._dotLottieCore)==null?void 0:i.markers();if(n){let s=[];for(let d=0;d{let C=I=>{let R=I.data;R.id===d.id&&(this._worker.removeEventListener("message",C),R.error?w(new Error(`Failed to execute method ${n}: ${R.error}`)):m(R.result));};this._worker.addEventListener("message",C);})})}addEventListener(n,i){this._eventManager.addEventListener(n,i);}removeEventListener(n,i){this._eventManager.removeEventListener(n,i);}static setWasmUrl(n){Y._wasmUrl=n;}loadStateMachine(n){return g(this,null,function*(){if(!this._created)return !1;let i=yield this._sendMessage("loadStateMachine",{instanceId:this._id,stateMachineId:n});return yield this._updateDotLottieInstanceState(),i})}loadStateMachineData(n){return g(this,null,function*(){if(!this._created)return !1;let i=yield this._sendMessage("loadStateMachineData",{instanceId:this._id,stateMachineData:n});return yield this._updateDotLottieInstanceState(),i})}startStateMachine(){return g(this,null,function*(){if(!this._created)return !1;this._setupStateMachineListeners();let n=yield this._sendMessage("startStateMachine",{instanceId:this._id});return yield this._updateDotLottieInstanceState(),n})}stopStateMachine(){return g(this,null,function*(){return this._created?(this._cleanupStateMachineListeners(),this._sendMessage("stopStateMachine",{instanceId:this._id})):!1})}getStateMachineListeners(){return g(this,null,function*(){return this._created?this._sendMessage("getStateMachineListeners",{instanceId:this._id}):[]})}_getPointerPosition(n){let i=this._canvas.getBoundingClientRect(),s=this._canvas.width/i.width,d=this._canvas.height/i.height,m=this._dotLottieInstanceState.renderConfig.devicePixelRatio||window.devicePixelRatio||1,w=(n.clientX-i.left)*s/m,C=(n.clientY-i.top)*d/m;return {x:w,y:C}}_onPointerUp(n){let{x:i,y:s}=this._getPointerPosition(n);this._sendMessage("postPointerUpEvent",{instanceId:this._id,x:i,y:s});}_onPointerDown(n){let{x:i,y:s}=this._getPointerPosition(n);this._sendMessage("postPointerDownEvent",{instanceId:this._id,x:i,y:s});}_onPointerMove(n){let{x:i,y:s}=this._getPointerPosition(n);this._sendMessage("postPointerMoveEvent",{instanceId:this._id,x:i,y:s});}_onPointerEnter(n){let{x:i,y:s}=this._getPointerPosition(n);this._sendMessage("postPointerEnterEvent",{instanceId:this._id,x:i,y:s});}_onPointerLeave(n){let{x:i,y:s}=this._getPointerPosition(n);this._sendMessage("postPointerExitEvent",{instanceId:this._id,x:i,y:s});}_setupStateMachineListeners(){return g(this,null,function*(){if(A&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded){let n=yield this._sendMessage("getStateMachineListeners",{instanceId:this._id});n.includes("PointerUp")&&this._canvas.addEventListener("pointerup",this._pointerUpMethod),n.includes("PointerDown")&&this._canvas.addEventListener("pointerdown",this._pointerDownMethod),n.includes("PointerMove")&&this._canvas.addEventListener("pointermove",this._pointerMoveMethod),n.includes("PointerEnter")&&this._canvas.addEventListener("pointerenter",this._pointerEnterMethod),n.includes("PointerExit")&&this._canvas.addEventListener("pointerleave",this._pointerExitMethod);}})}_cleanupStateMachineListeners(){A&&this._canvas instanceof HTMLCanvasElement&&(this._canvas.removeEventListener("pointerup",this._pointerUpMethod),this._canvas.removeEventListener("pointerdown",this._pointerDownMethod),this._canvas.removeEventListener("pointermove",this._pointerMoveMethod),this._canvas.removeEventListener("pointerenter",this._pointerEnterMethod),this._canvas.removeEventListener("pointerleave",this._pointerExitMethod));}};_(Y,"_workerManager",new G1),_(Y,"_wasmUrl","");var g3=Y; exports.DotLottie = v3; exports.DotLottieWorker = g3; //# sourceMappingURL=index.cjs.map //# sourceMappingURL=index.cjs.map