1import{a1 as ir,r as kt,i as ar,l as or,s as sr,j as Fn}from"./vendor.DwGDxu32.chunk.js";import{l as ur}from"./ApiUtils.CxIoqZF_.chunk.js";var mt={},Sn={exports:{}};(function(ze,bt){(function(rt,it){ze.exports=it()})(ir,()=>(()=>{var X=[,(xe,oe,q)=>{q.r(oe),q.d(oe,{Animation:()=>f.Animation});var f=q(2)},(xe,oe,q)=>{q.r(oe),q.d(oe,{Animation:()=>f});var f=function(){function ve(J,j,b,z){this.animation=J,this.artboard=j,this.playing=z,this.loopCount=0,this.scrubTo=null,this.instance=new b.LinearAnimationInstance(J,j)}return Object.defineProperty(ve.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"time",{get:function(){return this.instance.time},set:function(J){this.instance.time=J},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:!1,configurable:!0}),ve.prototype.advance=function(J){this.scrubTo===null?this.instance.advance(J):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},ve.prototype.apply=function(J){this.instance.apply(J)},ve.prototype.cleanup=function(){this.instance.delete()},ve}()},(xe,oe,q)=>{q.r(oe),q.d(oe,{RuntimeLoader:()=>j});var f=q(4),ve=q(5),J=function(){return J=Object.assign||function(b){for(var z,h=1,we=arguments.length;h<we;h++){z=arguments[h];for(var D in z)Object.prototype.hasOwnProperty.call(z,D)&&(b[D]=z[D])}return b},J.apply(this,arguments)},j=function(){function b(){}return b.notifyError=function(z){var h;for(b.isLoading=!1;b.errorCallbackQueue.length>0;)(h=b.errorCallbackQueue.shift())===null||h===void 0||h(z);b.callBackQueue=[]},b.loadRuntime=function(){var z=b.wasmURL,h=b.wasmBinary;b.enablePerfMarks&&performance.mark("rive:wasm-init:start"),f.default(J({locateFile:function(){return z}},h?{wasmBinary:h}:{})).then(function(we){var D;for(b.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),b.runtime=we,b.errorCallbackQueue=[];b.callBackQueue.length>0;)(D=b.callBackQueue.shift())===null||D===void 0||D(b.runtime)}).catch(function(we){var D={message:(we==null?void 0:we.message)||"Unknown error",type:(we==null?void 0:we.name)||"Error",wasmError:we instanceof WebAssembly.CompileError||we instanceof WebAssembly.RuntimeError,originalError:we};
1console.debug("Rive WASM load error details:",D);var ge=b.wasmFallbackURL,C=ge!==null&&z.toLowerCase()===ge.toLowerCase();if(ge!==null&&!C)console.warn("Failed to load WASM from ".concat(z," (").concat(D.message,"), trying fallback URL: ").concat(ge)),b.wasmBinary=null,b.setWasmUrl(ge),b.loadRuntime();else{var A=C?"the configured WASM URL or its fallback (".concat(ge,")"):z,ee=["Could not load Rive WASM file from ".concat(A,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",` 2Error details:`,"- Type: ".concat(D.type),"- Message: ".concat(D.message),"- WebAssembly-specific error: ".concat(D.wasmError),` 3To resolve, you may need to:`,"1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.awaitInstance() again"].join(` 4`);console.error(ee),b.notifyError(new Error(ee))}})},b.getInstance=function(z,h){b.isLoading||(b.isLoading=!0,b.loadRuntime()),b.runtime?z(b.runtime):(b.callBackQueue.push(z),h&&b.errorCallbackQueue.push(h))},b.awaitInstance=function(){return new Promise(function(z,h){return b.getInstance(z,h)})},b.setWasmUrl=function(z){b.wasmURL=z},b.getWasmUrl=function(){return b.wasmURL},b.setWasmFallbackUrl=function(z){b.wasmFallbackURL=z},b.getWasmFallbackUrl=function(){return b.wasmFallbackURL},b.setWasmBinary=function(z){if(z instanceof ArrayBuffer||z===null){b.wasmBinary=z;return}console.error("setWasmBinary expects an ArrayBuffer or null")},b.getWasmBinary=function(){return b.wasmBinary},b.isLoading=!1,b.callBackQueue=[],b.wasmURL="https://unpkg.com/".concat(ve.name,"@").concat(ve.version,"/rive.wasm"),b.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(ve.name,"@").concat(ve.version,"/rive_fallback.wasm"),b.wasmBinary=null,b.errorCallbackQueue=[],b.enablePerfMarks=!1,b}()},(xe,oe,q)=>{q.r(oe),q.d(oe,{default:()=>ve});var f=(()=>{var j;var J=typeof document<"u"?(j=document.currentScript)==null?void 0:j.src:void 0;return function(b={}){var z,h=b,we,D,ge=new Promise((r,n)=>{we=r,D=n}),C=typeof window=="object",A=typeof importScripts=="function";function ee(){function r(E){const y=s;o=n=0,s=new Map,y.forEach(L=>{try{L(E)}catch(F){console.error(F)}}),this.va(),d&&d.Pa()}let n=0,o=0,s=new Map,d=null,v=null;this.requestAnimationFrame=function(E){n||(n=requestAnimationFrame(r.bind(this)));const y=++o;return s.set(y,E),y},this.cancelAnimationFrame=function(E){s.delete(E),n&&s.size==0&&(cancelAnimationFrame(n),n=0)},this.Na=function(E){v&&(document.body.remove(v),v=null),E||(v=document.createElement("div"),v.style.backgroundColor="black",v.style.position="fixed",v.style.right=0,v.style.top=0,v.style.color="white",v.style.padding="4px",v.innerHTML="RIVE FPS",E=function(y){v.innerHTML="RIVE FPS "+y.toFixed(1)},document.body.appendChild(v)),d=new function(){let y=0,L=0;this.Pa=function(){var F=performance.now();L?(++y,F-=L,1e3<F&&(E(1e3*y/F),y=L=0)):(L=F,y=0)}}},this.Ka=function(){v&&(document.body.remove(v),v=null),d=null},this.va=function(){}}function ye(r){console.assert(!0);const n=new Map;let o=-1/0;this.push=function(s){return s=s+((1<<r)-1)>>r,n.has(s)&&clearTimeout(n.get(s)),n.set(s,setTimeout(function(){n.delete(s),n.length==0?o=-1/0:s==o&&(o=Math.max(...n.keys()),console.assert(o<s))},1e3)),o=Math.max(s,o),o<<r}}const fe=h.onRuntimeInitialized;h.onRuntimeInitialized=function(){fe&&fe();let r=h.decodeAudio;h.decodeAudio=function(v,E){v=r(v),E(v)};let n=h.decodeFont;h.decodeFont=function(v,E){v=n(v),E(v)};let o=h.setFallbackFontCb;h.setFallbackFontCallback=typeof o=="function"?function(v){o(v)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const s=h.FileAssetLoader;h.ptrToAsset=v=>{let E=h.ptrToFileAsset(v);return E.isImage?h.ptrToImageAsset(v):E.isFont?h.ptrToFontAsset(v):E.isAudio?h.ptrToAudioAsset(v):E},h.CustomFileAssetLoader=s.extend("CustomFileAssetLoader",{__construct:function({loadContents:v}){this.__parent.__construct.call(this),this.Ea=v},loadContents:function(v,E){return v=h.ptrToAsset(v),this.Ea(v,E)}}),h.CDNFileAssetLoader=s.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(v){let E=h.ptrToAsset(v);return v=E.cdnUuid,v===""?!1:(function(y,L){var F=new XMLHttpRequest;F.responseType="arraybuffer",F.onreadystatechange=function(){F.readyState==4&&F.status==200&&L(F)},F.open("GET",y,!0),F.send(null)}(E.cdnBaseUrl+"/"+v,y=>{E.decode(new Uint8Array(y.response))}),!0)}}),h.FallbackFileAssetLoader=s.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.ua=[]},addLoader:function(v){this.ua.push(v)},loadContents:function(v,E){for(let y of this.ua)if(y.loadContents(v,E))return!0;return!1}});let d=h.computeAlignment;h.computeAlignment=function(v,E,y,L,F=1){return d.call(this,v,E,y,L,F)}};const Ie="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),H=new function(){function r(){if(!n){let Ne=function(Be,ue,$e){if(ue=W.createShader(ue),W.shaderSource(ue,$e),W.compileShader(ue),$e=W.getShaderInfoLog(ue),0<($e||"").length)throw $e;W.attachShader(Be,ue)};var m=document.createElement("canvas"),ne={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let W;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(W=m.getContext("webgl",ne),o=1,!W)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(W=m.getContext("webgl2",ne))o=2;else if(W=m.getContext("webgl",ne))o=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;if(W=new Proxy(W,{get(Be,ue){if(Be.isContextLost()){if(L||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",ue),L=!0),typeof Be[ue]=="function")return function(){}}else return typeof Be[ue]=="function"?function(...$e){return Be[ue].apply(Be,$e)}:Be[ue]},set(Be,ue,$e){if(Be.isContextLost())L||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+ue),L=!0);else return Be[ue]=$e,!0}}),s=Math.min(W.getParameter(W.MAX_RENDERBUFFER_SIZE),W.getParameter(W.MAX_TEXTURE_SIZE)),m=W.createProgram(),Ne(m,W.VERTEX_SHADER,`attribute vec2 vertex; 5 attribute vec2 uv; 6 uniform vec4 mat; 7 uniform vec2 translate; 8 varying vec2 st; 9 void main() { 10 st = uv; 11 gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1); 12 }`),Ne(m,W.FRAGMENT_SHADER,`precision highp float; 13 uniform sampler2D image; 14 varying vec2 st; 15 void main() { 16 gl_FragColor = texture2D(image, st); 17 }`),W.bindAttribLocation(m,0,"vertex"),W.bindAttribLocation(m,1,"uv"),W.linkProgram(m),ne=W.getProgramInfoLog(m),0<(ne||"").trim().length)throw ne;d=W.getUniformLocation(m,"mat"),v=W.getUniformLocation(m,"translate"),W.useProgram(m),W.bindBuffer(W.ARRAY_BUFFER,W.createBuffer()),W.enableVertexAttribArray(0),W.enableVertexAttribArray(1),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,W.createBuffer()),W.uniform1i(W.getUniformLocation(m,"image"),0),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n=W}return!0}let n=null,o=0,s=0,d=null,v=null,E=0,y=0,L=!1;r(),this.Xa=function(){return r(),s},this.Ja=function(m){n.deleteTexture&&n.deleteTexture(m)},this.Ia=function(m){if(!r())return null;const ne=n.createTexture();return ne?(n.bindTexture(n.TEXTURE_2D,ne),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,m),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.L
17INEAR),o==2?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.generateMipmap(n.TEXTURE_2D)):n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),ne):null};const F=new ye(8),G=new ye(8),me=new ye(10),Re=new ye(10);this.Ma=function(m,ne,W,Ne,Be){if(r()){var ue=F.push(m),$e=G.push(ne);if(n.canvas){(n.canvas.width!=ue||n.canvas.height!=$e)&&(n.canvas.width=ue,n.canvas.height=$e),n.viewport(0,$e-ne,m,ne),n.disable(n.SCISSOR_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.SCISSOR_TEST),W.sort((je,At)=>At.ya-je.ya),ue=me.push(Ne),E!=ue&&(n.bufferData(n.ARRAY_BUFFER,8*ue,n.DYNAMIC_DRAW),E=ue),ue=0;for(var ot of W)n.bufferSubData(n.ARRAY_BUFFER,ue,ot.ia),ue+=4*ot.ia.length;console.assert(ue==4*Ne);for(var pt of W)n.bufferSubData(n.ARRAY_BUFFER,ue,pt.Ba),ue+=4*pt.Ba.length;console.assert(ue==8*Ne),ue=Re.push(Be),y!=ue&&(n.bufferData(n.ELEMENT_ARRAY_BUFFER,2*ue,n.DYNAMIC_DRAW),y=ue),ot=0;for(var Et of W)n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,ot,Et.indices),ot+=2*Et.indices.length;console.assert(ot==2*Be),Et=0,pt=!0,ue=ot=0;for(const je of W){je.image.da!=Et&&(n.bindTexture(n.TEXTURE_2D,je.image.ca||null),Et=je.image.da),je.$a?(n.scissor(je.na,$e-je.oa-je.ta,je.lb,je.ta),pt=!0):pt&&(n.scissor(0,$e-ne,m,ne),pt=!1),W=2/m;const At=-2/ne;n.uniform4f(d,je.N[0]*W*je.X,je.N[1]*At*je.Y,je.N[2]*W*je.X,je.N[3]*At*je.Y),n.uniform2f(v,je.N[4]*W*je.X+W*(je.na-je.Ya*je.X)-1,je.N[5]*At*je.Y+At*(je.oa-je.Za*je.Y)+1),n.vertexAttribPointer(0,2,n.FLOAT,!1,0,ue),n.vertexAttribPointer(1,2,n.FLOAT,!1,0,ue+4*Ne),n.drawElements(n.TRIANGLES,je.indices.length,n.UNSIGNED_SHORT,ot),ue+=4*je.ia.length,ot+=2*je.indices.length}console.assert(ue==4*Ne),console.assert(ot==2*Be)}}},this.canvas=function(){return r()&&n.canvas}},Q=h.onRuntimeInitialized;h.onRuntimeInitialized=function(){function r(V){switch(V){case F.srcOver:return"source-over";case F.screen:return"screen";case F.overlay:return"overlay";case F.darken:return"darken";case F.lighten:return"lighten";case F.colorDodge:return"color-dodge";case F.colorBurn:return"color-burn";case F.hardLight:return"hard-light";case F.softLight:return"soft-light";case F.difference:return"difference";case F.exclusion:return"exclusion";case F.multiply:return"multiply";case F.hue:return"hue";case F.saturation:return"saturation";case F.color:return"color";case F.luminosity:return"luminosity"}}function n(V){return"rgba("+((16711680&V)>>>16)+","+((65280&V)>>>8)+","+((255&V)>>>0)+","+((4278190080&V)>>>24)/255+")"}function o(){0<$e.length&&(H.Ma(ue.drawWidth(),ue.drawHeight(),$e,ot,pt),$e=[],pt=ot=0,ue.reset(512,512));for(const V of Be){for(const re of V.v)re();V.v=[]}Be.clear()}Q&&Q();var s=h.RenderPaintStyle;const d=h.RenderPath,v=h.RenderPaint,E=h.Renderer,y=h.StrokeCap,L=h.StrokeJoin,F=h.BlendMode,G=s.fill,me=s.stroke,Re=h.FillRule.evenOdd;let m=1;var ne=h.RenderImage.extend("CanvasRenderImage",{__construct:function({R:V,W:re}={}){this.__parent.__construct.call(this),this.da=m,m=m+1&2147483647||1,this.R=V,this.W=re},__destruct:function(){this.ca&&(H.Ja(this.ca),URL.revokeObjectURL(this.la)),this.__parent.__destruct.call(this)},decode:function(V){var re=this;re.W&&re.W(re);var Le=new Image;re.la=URL.createObjectURL(new Blob([V],{type:"image/png"}
17)),Le.onload=function(){re.Da=Le,re.ca=H.Ia(Le),re.size(Le.width,Le.height),re.R&&re.R(re)},Le.src=re.la}}),W=d.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.H=new Path2D},rewind:function(){this.H=new Path2D},addPath:function(V,re,Le,Oe,Ae,Te,Ee){var Ke=this.H,Ot=Ke.addPath;V=V.H;const ht=new DOMMatrix;ht.a=re,ht.b=Le,ht.c=Oe,ht.d=Ae,ht.e=Te,ht.f=Ee,Ot.call(Ke,V,ht)},fillRule:function(V){this.ka=V},moveTo:function(V,re){this.H.moveTo(V,re)},lineTo:function(V,re){this.H.lineTo(V,re)},cubicTo:function(V,re,Le,Oe,Ae,Te){this.H.bezierCurveTo(V,re,Le,Oe,Ae,Te)},close:function(){this.H.closePath()}}),Ne=v.extend("CanvasRenderPaint",{color:function(V){this.ma=n(V)},thickness:function(V){this.Ga=V},join:function(V){switch(V){case L.miter:this.ba="miter";break;case L.round:this.ba="round";break;case L.bevel:this.ba="bevel"}},cap:function(V){switch(V){case y.butt:this.aa="butt";break;case y.round:this.aa="round";break;case y.square:this.aa="square"}},style:function(V){this.Fa=V},blendMode:function(V){this.Ca=r(V)},clearGradient:function(){this.P=null},linearGradient:function(V,re,Le,Oe){this.P={za:V,Aa:re,qa:Le,ra:Oe,ga:[]}},radialGradient:function(V,re,Le,Oe){this.P={za:V,Aa:re,qa:Le,ra:Oe,ga:[],Wa:!0}},addStop:function(V,re){this.P.ga.push({color:V,stop:re})},completeGradient:function(){},draw:function(V,re,Le,Oe){let Ae=this.Fa;var Te=this.ma,Ee=this.P;const Ke=V.globalCompositeOperation,Ot=V.globalAlpha;if(V.globalCompositeOperation=this.Ca,V.globalAlpha=Oe,Ee!=null){Te=Ee.za;const gt=Ee.Aa,Mt=Ee.qa;var ht=Ee.ra;Oe=Ee.ga,Ee.Wa?(Ee=Mt-Te,ht-=gt,Te=V.createRadialGradient(Te,gt,0,Te,gt,Math.sqrt(Ee*Ee+ht*ht))):Te=V.createLinearGradient(Te,gt,Mt,ht);for(let yt=0,Ct=Oe.length;yt<Ct;yt++)Ee=Oe[yt],Te.addColorStop(Ee.stop,n(Ee.color));this.ma=Te,this.P=null}switch(Ae){case me:V.strokeStyle=Te,V.lineWidth=this.Ga,V.lineCap=this.aa,V.lineJoin=this.ba,V.stroke(re);break;case G:V.fillStyle=Te,V.fill(re,Le)}V.globalCompositeOperation=Ke,V.globalAlpha=Ot}});const Be=new Set;let ue=null,$e=[],ot=0,pt=0;var Et=h.CanvasRenderer=E.extend("Renderer",{__construct:function(V){this.__parent.__construct.call(this),this.G=[1,0,0,1,0,0],this.u=[1],this.m=V.getContext("2d"),this.ja=V,this.v=[]},save:function(){this.G.push(...this.G.slice(this.G.length-6)),this.u.push(this.u[this.u.length-1]),this.v.push(this.m.save.bind(this.m))},restore:function(){const V=this.G.length-6;if(6>V)throw"restore() called without matching save().";this.G.splice(V),this.u.pop(),this.v.push(this.m.restore.bind(this.m))},transform:function(V,re,Le,Oe,Ae,Te){const Ee=this.G,Ke=Ee.length-6;Ee.splice(Ke,6,Ee[Ke]*V+Ee[Ke+2]*re,Ee[Ke+1]*V+Ee[Ke+3]*re,Ee[Ke]*Le+Ee[Ke+2]*Oe,Ee[Ke+1]*Le+Ee[Ke+3]*Oe,Ee[Ke]*Ae+Ee[Ke+2]*Te+Ee[Ke+4],Ee[Ke+1]*Ae+Ee[Ke+3]*Te+Ee[Ke+5]),this.v.push(this.m.transform.bind(this.m,V,re,Le,Oe,Ae,Te))},rotate:function(V){const re=Math.sin(V);V=Math.cos(V),this.transform(V,re,-re,V,0,0)},modulateOpacity:function(V){this.u[this.u.length-1]*=V},_drawPath:function(V,re){this.v.push(re.draw.bind(re,this.m,V.H,V.ka===Re?"evenodd":"nonzero",Math.max(0,this.u[this.u.length-1])))},_drawRiveImage:function(V,re,Le,Oe){var Ae=V.Da;if(Ae){var Te=this.m,Ee=r(Le),Ke=Math.max(0,Oe*this.u[this.u.length-1]);this.v.push(function(){Te.globalCompositeOperation=Ee,Te.globalAlpha=Ke,Te.drawImage(Ae,0,0),Te.globalAlpha=1})}},_getMatrix:function(V){const re=this.G,Le=re.length-6;for(let Oe=0;6>Oe;++Oe)V[Oe]=re[Le+Oe]},_drawImageMesh:function(V,re,Le,Oe,Ae,Te,Ee,Ke,Ot,ht,gt,Mt,yt,Ct){let Cn,Rn,In;try{Cn=h.HEAPF32.slice(Ae>>2,(Ae>>2)+Te),Rn=h.HEAPF32.slice(Ee>>2,(Ee>>2)+Ke),In=h.HEAPU16.slice(Ot>>1,(Ot>>1)+ht)}catch{console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}re=this.m.canvas.width,Ae=this.m.canvas.height,Ee=yt-gt,Ke=Ct-Mt,gt=Math.max(gt,0),Mt=Math.max(Mt,0),yt=Math.min(yt,re),Ct=Math.min(Ct,Ae);const Lt=yt-gt,xt=Ct-Mt;if(console.assert(Lt<=Math.min(Ee,re)),console.assert(xt<=Math.min(Ke,Ae)),!(0>=Lt||0>=xt)){yt=Lt<Ee||xt<Ke,re=Ct=1;var Ft=Math.ceil(Lt*Ct),St=Math.ceil(xt*re);Ae=H.Xa(),Ft>Ae&&(Ct*=Ae/Ft,Ft=Ae),St>Ae&&(re*=Ae/St,St=Ae),ue||(ue=new h.DynamicRectanizer(Ae),ue.reset(512,512)),Ae=ue.addRect(Ft,St),0>Ae&&(o(),Be.add(this),Ae=ue.addRect(Ft,St),console.assert(0<=Ae));var Mn=Ae&65535,En=Ae>>16;$e.push({N:this.G.slice(this.G.length-6),image:V,na:Mn,oa:En,Ya:gt,Za:Mt,lb:Ft,ta:St,X:Ct,Y:re,ia:Cn,Ba:Rn,indices:In,$a:yt,ya:V.da<<1|(yt?1:0)}),ot+=Te,pt+=ht;var Tt=this.m,nr=r(Le),rr=Math.max(0,Oe*this.u[this.u.length-1]);this.v.push(function(){Tt.save(),Tt.resetTransform(),Tt.globalCompositeOperation=nr,Tt.globalAlpha=rr;
17const an=H.canvas();an&&Tt.drawImage(an,Mn,En,Ft,St,gt,Mt,Lt,xt),Tt.restore()})}},_clipPath:function(V){this.v.push(this.m.clip.bind(this.m,V.H,V.ka===Re?"evenodd":"nonzero"))},clear:function(){Be.add(this),this.v.push(this.m.clearRect.bind(this.m,0,0,this.ja.width,this.ja.height))},flush:function(){},translate:function(V,re){this.transform(1,0,0,1,V,re)}});h.makeRenderer=function(V){const re=new Et(V),Le=re.m;return new Proxy(re,{get(Oe,Ae){if(typeof Oe[Ae]=="function")return function(...Te){return Oe[Ae].apply(Oe,Te)};if(typeof Le[Ae]=="function"){if(-1<Ie.indexOf(Ae))throw Error("RiveException: Method call to '"+Ae+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...Te){re.v.push(Le[Ae].bind(Le,...Te))}}return Oe[Ae]},set(Oe,Ae,Te){if(Ae in Le)return re.v.push(()=>{Le[Ae]=Te}),!0}})},h.decodeImage=function(V,re){new ne({R:re}).decode(V)},h.renderFactory={makeRenderPaint:function(){return new Ne},makeRenderPath:function(){return new W},makeRenderImage:function(){let V=At;return new ne({W:()=>{V.total++},R:()=>{if(V.loaded++,V.loaded===V.total){const re=V.ready;re&&(re(),V.ready=null)}}})}};let je=h.load,At=null;h.load=function(V,re,Le=!0){const Oe=new h.FallbackFileAssetLoader;return re!==void 0&&Oe.addLoader(re),Le&&(re=new h.CDNFileAssetLoader,Oe.addLoader(re)),new Promise(function(Ae){let Te=null;At={total:0,loaded:0,ready:function(){Ae(Te)}},Te=je(V,Oe),At.total==0&&Ae(Te)})};let tr=h.RendererWrapper.prototype.align;h.RendererWrapper.prototype.align=function(V,re,Le,Oe,Ae=1){tr.call(this,V,re,Le,Oe,Ae)},s=new ee,h.requestAnimationFrame=s.requestAnimationFrame.bind(s),h.cancelAnimationFrame=s.cancelAnimationFrame.bind(s),h.enableFPSCounter=s.Na.bind(s),h.disableFPSCounter=s.Ka,s.va=o,h.resolveAnimationFrame=o,h.cleanup=function(){ue&&ue.delete()}};var ie=Object.assign({},h),x="./this.program",u="",_,T;(C||A)&&(A?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),J&&(u=J),u.startsWith("blob:")?u="":u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1),A&&(T=r=>{var n=new XMLHttpRequest;return n.open("GET",r,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),_=(r,n,o)=>{if(g(r)){var s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType="arraybuffer",s.onload=()=>{s.status==200||s.status==0&&s.response?n(s.response):o()},s.onerror=o,s.send(null)}else fetch(r,{credentials:"same-origin"}).then(d=>d.ok?d.arrayBuffer():Promise.reject(Error(d.status+" : "+d.url))).then(n,o)});var Y=h.print||console.log.bind(console),U=h.printErr||console.error.bind(console);Object.assign(h,ie),ie=null,h.thisProgram&&(x=h.thisProgram);var I;h.wasmBinary&&(I=h.wasmBinary);var P,te=!1,ae,se,_e,ke,be,Ce,Pe,We;function He(){var r=P.buffer;h.HEAP8=ae=new Int8Array(r),h.HEAP16=_e=new Int16Array(r),h.HEAPU8=se=new Uint8Array(r),h.HEAPU16=ke=new Uint16Array(r),h.HEAP32=be=new Int32Array(r),h.HEAPU32=Ce=new Uint32Array(r),h.HEAPF32=Pe=new Float32Array(r),h.HEAPF64=We=new Float64Array(r)}var Fe=[],Ve=[],Ze=[];function dt(){var r=h.preRun.shift();Fe.unshift(r)}var at=0,p=null;function k(r){var n;throw(n=h.onAbort)==null||n.call(h,r),r="Aborted("+r+")",U(r),te=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),D(r),r}var R=r=>r.startsWith("data:application/octet-stream;base64,"),g=r=>r.startsWith("file://"),w;function S(r){if(r==w&&I)return new Uint8Array(I);if(T)return T(r);throw"both async and sync fetching of the wasm failed"}function B(r){return I?Promise.resolve().then(()=>S(r)):new Promise((n,o)=>{_(r,s=>n(new Uint8Array(s)),()=>{try{n(S(r))}catch(s){o(s)}})})}function K(r,n,o){return B(r).then(s=>WebAssembly.instantiate(s,n)).then(o,s=>{U(`failed to asynchronously prepare wasm: ${s}`),k(s)})}function N(r,n){var o=w;return I||typeof WebAssembly.instantiateStreaming!="function"||R(o)||g(o)||typeof fetch!="function"?K(o,r,n):fetch(o,{credentials:"same-origin"}).then(s=>WebAssembly.instantiateStreaming(s,r).then(n,function(d){return U(`wasm streaming compile failed: ${d}`),U("falling back to ArrayBuffer instantiation"),K(o,r,n)}))}var le=r=>{for(;0<r.length;)r.shift()(h)},pe=(r,n)=>Object.defineProperty(n,"name",{value:r}),he=[],De=[],de,i=r=>
17{if(!r)throw new de("Cannot use deleted val. handle = "+r);return De[r]},e=r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const n=he.pop()||De.length;return De[n]=r,De[n+1]=1,n}},t=r=>{var n=Error,o=pe(r,function(s){this.name=r,this.message=s,s=Error(s).stack,s!==void 0&&(this.stack=this.toString()+` 18`+s.replace(/^Error(:[^\n]*)?\n/,""))});return o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},o},a,l,c=r=>{for(var n="";se[r];)n+=l[se[r++]];return n},M=[],O=()=>{for(;M.length;){var r=M.pop();r.g.M=!1,r.delete()}},Z,$={},ce=(r,n)=>{if(n===void 0)throw new de("ptr should not be undefined");for(;r.o;)n=r.S(n),r=r.o;return n},Se={},Qe=r=>{r=_n(r);var n=c(r);return It(r),n},Ue=(r,n)=>{var o=Se[r];if(o===void 0)throw r=`${n} has unknown type ${Qe(r)}`,new de(r);return o},Ye=()=>{},et=!1,ut=(r,n,o)=>n===o?r:o.o===void 0?null:(r=ut(r,n,o.o),r===null?null:o.La(r)),lt={},ct=(r,n)=>(n=ce(r,n),$[n]),Je,Xe=(r,n)=>{if(!n.j||!n.i)throw new Je("makeClassHandle requires ptr and ptrType");if(!!n.A!=!!n.s)throw new Je("Both smartPtrType and smartPtr must be specified");return n.count={value:1},Ge(Object.create(r,{g:{value:n,writable:!0}}))},Ge=r=>typeof FinalizationRegistry>"u"?(Ge=n=>n,r):(et=new FinalizationRegistry(n=>{n=n.g,--n.count.value,n.count.value===0&&(n.s?n.A.D(n.s):n.j.h.D(n.i))}),Ge=n=>{var o=n.g;return o.s&&et.register(n,{g:o},n),n},Ye=n=>{et.unregister(n)},Ge(r)),tt={},nt=r=>{for(;r.length;){var n=r.pop();r.pop()(n)}};function st(r){return this.fromWireType(Ce[r>>2])}var Me={},Pt={},qe=(r,n,o)=>{function s(y){if(y=o(y),y.length!==r.length)throw new Je("Mismatched type converter count");for(var L=0;L<r.length;++L)_t(r[L],y[L])}r.forEach(function(y){Pt[y]=n});var d=Array(n.length),v=[],E=0;n.forEach((y,L)=>{Se.hasOwnProperty(y)?d[L]=Se[y]:(v.push(y),Me.hasOwnProperty(y)||(Me[y]=[]),Me[y].push(()=>{d[L]=Se[y],++E,E===v.length&&s(d)}))}),v.length===0&&s(d)};function Xt(r,n,o={}){var s=n.name;if(!r)throw new de(`type "${s}" must have a positive integer typeid pointer`);if(Se.hasOwnProperty(r)){if(o.Va)return;throw new de(`Cannot register type '${s}' twice`)}Se[r]=n,delete Pt[r],Me.hasOwnProperty(r)&&(n=Me[r],delete Me[r],n.forEach(d=>d()))}function _t(r,n,o={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Xt(r,n,o)}var $t=r=>{throw new de(r.g.j.h.name+" instance already deleted")};function Vt(){}var Gt=(r,n,o)=>{if(r[n].l===void 0){var s=r[n];r[n]=function(...d){if(!r[n].l.hasOwnProperty(d.length))throw new de(`Function '${o}' called with an invalid number of arguments (${d.length}) - expects one of (${r[n].l})!`);return r[n].l[d.length].apply(this,d)},r[n].l=[],r[n].l[s.L]=s}},Kt=(r,n,o)=>{if(h.hasOwnProperty(r)){if(o===void 0||h[r].l!==void 0&&h[r].l[o]!==void 0)throw new de(`Cannot register public name '${r}' twice`);if(Gt(h,r,r),h.hasOwnProperty(o))throw new de(`Cannot register multiple overloads of a function with the same number of arguments (${o})!`);h[r].l[o]=n}else h[r]=n,o!==void 0&&(h[r].nb=o)},Pn=r=>{if(r===void 0)return"_unknown";r=r.replace(/[^a-zA-Z0-9_]/g,"$");var n=r.charCodeAt(0);return 48<=n&&57>=n?`_${r}`:r};function On(r,n,o,s,d,v,E,y){this.name=r,this.constructor=n,this.C=o,this.D=s,this.o=d,this.Qa=v,this.S=E,this.La=y,this.wa=[]}var Dt=(r,n,o)=>{for(;n!==o;){if(!n.S)throw new de(`Expected null or instance of ${o.name}, got an instance of ${n.name}`);r=n.S(r),n=n.o}return r};function Tn(r,n){if(n===null){if(this.ea)throw new de(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new de(`Cannot pass "${Zt(n)}" as a ${this.name}`);if(!n.g.i)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);return Dt(n.g.i,n.g.j.h,this.h)}function Ln(r,n){if(n===null){if(this.ea)throw new de(`null is not a valid ${this.name}`);if(this.V){var o=this.fa();return r!==null&&r.push(this.D,o),o}return 0}if(!n||!n.g)throw new de(`Cannot pass "${Zt(n)}" as a ${this.name}`);if(!n.g.i)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.U&&n.g.j.U)throw new de(`Cannot convert argument of type ${n.g.A?n.g.A.name:n.g.j.name} to parameter type ${this.name}`);
18if(o=Dt(n.g.i,n.g.j.h,this.h),this.V){if(n.g.s===void 0)throw new de("Passing raw pointer to smart pointer is illegal");switch(this.gb){case 0:if(n.g.A===this)o=n.g.s;else throw new de(`Cannot convert argument of type ${n.g.A?n.g.A.name:n.g.j.name} to parameter type ${this.name}`);break;case 1:o=n.g.s;break;case 2:if(n.g.A===this)o=n.g.s;else{var s=n.clone();o=this.bb(o,e(()=>s.delete())),r!==null&&r.push(this.D,o)}break;default:throw new de("Unsupporting sharing policy")}}return o}function xn(r,n){if(n===null){if(this.ea)throw new de(`null is not a valid ${this.name}`);return 0}if(!n.g)throw new de(`Cannot pass "${Zt(n)}" as a ${this.name}`);if(!n.g.i)throw new de(`Cannot pass deleted object as a pointer of type ${this.name}`);if(n.g.j.U)throw new de(`Cannot convert argument of type ${n.g.j.name} to parameter type ${this.name}`);return Dt(n.g.i,n.g.j.h,this.h)}function jt(r,n,o,s,d,v,E,y,L,F,G){this.name=r,this.h=n,this.ea=o,this.U=s,this.V=d,this.ab=v,this.gb=E,this.xa=y,this.fa=L,this.bb=F,this.D=G,d||n.o!==void 0?this.toWireType=Ln:(this.toWireType=s?Tn:xn,this.B=null)}var on=(r,n,o)=>{if(!h.hasOwnProperty(r))throw new Je("Replacing nonexistent public symbol");h[r].l!==void 0&&o!==void 0?h[r].l[o]=n:(h[r]=n,h[r].L=o)},Bt=[],sn,un=r=>{var n=Bt[r];return n||(r>=Bt.length&&(Bt.length=r+1),Bt[r]=n=sn.get(r)),n},kn=(r,n,o=[])=>(r.includes("j")?(r=r.replace(/p/g,"i"),n=(0,h["dynCall_"+r])(n,...o)):n=un(n)(...o),n),Vn=(r,n)=>(...o)=>kn(r,n,o),ft=(r,n)=>{r=c(r);var o=r.includes("j")?Vn(r,n):un(n);if(typeof o!="function")throw new de(`unknown function pointer with signature ${r}: ${n}`);return o},ln,Rt=(r,n)=>{function o(v){d[v]||Se[v]||(Pt[v]?Pt[v].forEach(o):(s.push(v),d[v]=!0))}var s=[],d={};throw n.forEach(o),new ln(`${r}: `+s.map(Qe).join([", "]))};function Dn(r){for(var n=1;n<r.length;++n)if(r[n]!==null&&r[n].B===void 0)return!0;return!1}function Wt(r,n,o,s,d){var v=n.length;if(2>v)throw new de("argTypes array size mismatch! Must at least get return value and 'this' types!");var E=n[1]!==null&&o!==null,y=Dn(n),L=n[0].name!=="void",F=v-2,G=Array(F),me=[],Re=[];return pe(r,function(...m){if(m.length!==F)throw new de(`function ${r} called with ${m.length} arguments, expected ${F}`);if(Re.length=0,me.length=E?2:1,me[0]=d,E){var ne=n[1].toWireType(Re,this);me[1]=ne}for(var W=0;W<F;++W)G[W]=n[W+2].toWireType(Re,m[W]),me.push(G[W]);if(m=s(...me),y)nt(Re);else for(W=E?1:2;W<n.length;W++){var Ne=W===1?ne:G[W-2];n[W].B!==null&&n[W].B(Ne)}return ne=L?n[0].fromWireType(m):void 0,ne})}var Nt=(r,n)=>{for(var o=[],s=0;s<r;s++)o.push(Ce[n+4*s>>2]);return o},Qt=r=>{r=r.trim();const n=r.indexOf("(");return n!==-1?r.substr(0,n):r},cn=(r,n,o)=>{if(!(r instanceof Object))throw new de(`${o} with invalid "this": ${r}`);if(!(r instanceof n.h.constructor))throw new de(`${o} incompatible with "this" of type ${r.constructor.name}`);if(!r.g.i)throw new de(`cannot call emscripten binding method ${o} on deleted object`);return Dt(r.g.i,r.g.j.h,n.h)},Jt=r=>{9<r&&--De[r+1]===0&&(De[r]=void 0,he.push(r))},jn={name:"emscripten::val",fromWireType:r=>{var n=i(r);return Jt(r),n},toWireType:(r,n)=>e(n),argPackAdvance:8,readValueFromPointer:st,B:null},Bn=(r,n,o)=>{switch(n){case 1:return o?function(s){return this.fromWireType(ae[s])}:function(s){return this.fromWireType(se[s])};case 2:return o?function(s){return this.fromWireType(_e[s>>1])}:function(s){return this.fromWireType(ke[s>>1])};case 4:return o?function(s){return this.fromWireType(be[s>>2])}:function(s){return this.fromWireType(Ce[s>>2])};default:throw new TypeError(`invalid integer width (${n}): ${r}`)}},Zt=r=>{if(r===null)return"null";var n=typeof r;return n==="object"||n==="array"||n==="function"?r.toString():""+r},Wn=(r,n)=>{switch(n){case 4:return function(o){return this.fromWireType(Pe[o>>2])};case 8:return function(o){return this.fromWireType(We[o>>3])};default:throw new TypeError(`invalid float width (${n}): ${r}`)}},Nn=(r,n,o)=>{switch(n){case 1:return o?s=>ae[s]:s=>se[s];case 2:return o?s=>_e[s>>1]:s=>ke[s>>1];case 4:return o?s=>be[s>>2]:s=>Ce[s>>2];default:throw new TypeError(`invalid integer width (${n}): ${r}`)}},fn=(r,n,o,s)=>{if(0<s){s=o+s-1;for(var d=0;d<r.length;++d){var v=r.charCodeAt(d);if(55296<=v&&57343>=v){var E=r.charCodeAt(++d);v=65536+((v&1023)<<10)|E&1023}if(127>=v){if(o>=s)break;n[o++]=v}else{if(2047>=v){if(o+1>=s)break;n[o++]=192|v>>6}else{if(65535>=v){if(o+2>=s)break;n[o++]=224|v>>12}else{if(o+3>=s)break;n[o++]=240|v>>18,n[o++]=128|v>>12&63}n[o++]=128|v>>6&63}n[o++]=128|v&63}}n[o]=0}},hn=r=>{for(var n=0,o=0;o<r.length;++o){var s=r.charCodeAt(o);127>=s?n++:2047>=s?n+=2:55296<=s&&57343>=s?(n+=4,++o):n+=3}return n},dn=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ut=(r,n,o)=>{var s=n+o;for(o=n;r[o]&&!(o>=s);)++o;if(16<o-n&&r.buffer&&dn)return dn.decode(r.subarray(n,o));for(s="";n<o;){var d=r[n++];if(d&128){var v=r[n++]&63;
18if((d&224)==192)s+=String.fromCharCode((d&31)<<6|v);else{var E=r[n++]&63;d=(d&240)==224?(d&15)<<12|v<<6|E:(d&7)<<18|v<<12|E<<6|r[n++]&63,65536>d?s+=String.fromCharCode(d):(d-=65536,s+=String.fromCharCode(55296|d>>10,56320|d&1023))}}else s+=String.fromCharCode(d)}return s},vn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Un=(r,n)=>{for(var o=r>>1,s=o+n/2;!(o>=s)&&ke[o];)++o;if(o<<=1,32<o-r&&vn)return vn.decode(se.subarray(r,o));for(o="",s=0;!(s>=n/2);++s){var d=_e[r+2*s>>1];if(d==0)break;o+=String.fromCharCode(d)}return o},zn=(r,n,o)=>{if(o??(o=2147483647),2>o)return 0;o-=2;var s=n;o=o<2*r.length?o/2:r.length;for(var d=0;d<o;++d)_e[n>>1]=r.charCodeAt(d),n+=2;return _e[n>>1]=0,n-s},Hn=r=>2*r.length,Yn=(r,n)=>{for(var o=0,s="";!(o>=n/4);){var d=be[r+4*o>>2];if(d==0)break;++o,65536<=d?(d-=65536,s+=String.fromCharCode(55296|d>>10,56320|d&1023)):s+=String.fromCharCode(d)}return s},Xn=(r,n,o)=>{if(o??(o=2147483647),4>o)return 0;var s=n;o=s+o-4;for(var d=0;d<r.length;++d){var v=r.charCodeAt(d);if(55296<=v&&57343>=v){var E=r.charCodeAt(++d);v=65536+((v&1023)<<10)|E&1023}if(be[n>>2]=v,n+=4,n+4>o)break}return be[n>>2]=0,n-s},$n=r=>{for(var n=0,o=0;o<r.length;++o){var s=r.charCodeAt(o);55296<=s&&57343>=s&&++o,n+=4}return n},pn=(r,n,o)=>{var s=[];return r=r.toWireType(s,o),s.length&&(Ce[n>>2]=e(s)),r},Gn={},qt=r=>{var n=Gn[r];return n===void 0?c(r):n},en=[],Kn=r=>{var n=en.length;return en.push(r),n},Qn=(r,n)=>{for(var o=Array(r),s=0;s<r;++s)o[s]=Ue(Ce[n+4*s>>2],"parameter "+s);return o},Jn=Reflect.construct,tn={},mn=()=>
18{if(!nn){var r={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",_:x||"./this.program"},n;for(n in tn)tn[n]===void 0?delete r[n]:r[n]=tn[n];var o=[];for(n in r)o.push(`${n}=${r[n]}`);nn=o}return nn},nn,Zn=[null,[],[]],zt=r=>r%4===0&&(r%100!==0||r%400===0),gn=[31,29,31,30,31,30,31,31,30,31,30,31],yn=[31,28,31,30,31,30,31,31,30,31,30,31];function qn(r){var n=Array(hn(r)+1);return fn(r,n,0,n.length),n}var er=(r,n,o,s)=>{function d(m,ne,W){for(m=typeof m=="number"?m.toString():m||"";m.length<ne;)m=W[0]+m;return m}function v(m,ne){return d(m,ne,"0")}function E(m,ne){function W(Be){return 0>Be?-1:0<Be?1:0}var Ne;return(Ne=W(m.getFullYear()-ne.getFullYear()))===0&&(Ne=W(m.getMonth()-ne.getMonth()))===0&&(Ne=W(m.getDate()-ne.getDate())),Ne}function y(m){switch(m.getDay()){case 0:return new Date(m.getFullYear()-1,11,29);case 1:return m;case 2:return new Date(m.getFullYear(),0,3);case 3:return new Date(m.getFullYear(),0,2);case 4:return new Date(m.getFullYear(),0,1);case 5:return new Date(m.getFullYear()-1,11,31);case 6:return new Date(m.getFullYear()-1,11,30)}}function L(m){var ne=m.J;for(m=new Date(new Date(m.K+1900,0,1).getTime());0<ne;){var W=m.getMonth(),Ne=(zt(m.getFullYear())?gn:yn)[W];if(ne>Ne-m.getDate())ne-=Ne-m.getDate()+1,m.setDate(1),11>W?m.setMonth(W+1):(m.setMonth(0),m.setFullYear(m.getFullYear()+1));else{m.setDate(m.getDate()+ne);break}}return W=new Date(m.getFullYear()+1,0,4),ne=y(new Date(m.getFullYear(),0,4)),W=y(W),0>=E(ne,m)?0>=E(W,m)?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var F=Ce[s+40>>2];s={jb:be[s>>2],ib:be[s+4>>2],Z:be[s+8>>2],ha:be[s+12>>2],$:be[s+16>>2],K:be[s+20>>2],F:be[s+24>>2],J:be[s+28>>2],ob:be[s+32>>2],hb:be[s+36>>2],kb:F&&F?Ut(se,F):""},o=o?Ut(se,o):"",F={"%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 G in F)o=o.replace(new RegExp(G,"g"),F[G]);var me="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Re="January February March April May June July August September October November December".split(" ");F={"%a":m=>me[m.F].substring(0,3),"%A":m=>me[m.F],"%b":m=>Re[m.$].substring(0,3),"%B":m=>Re[m.$],"%C":m=>v((m.K+1900)/100|0,2),"%d":m=>v(m.ha,2),"%e":m=>d(m.ha,2," "),"%g":m=>L(m).toString().substring(2),"%G":L,"%H":m=>v(m.Z,2),"%I":m=>(m=m.Z,m==0?m=12:12<m&&(m-=12),v(m,2)),"%j":m=>{for(var ne=0,W=0;W<=m.$-1;ne+=(zt(m.K+1900)?gn:yn)[W++]);return v(m.ha+ne,3)},"%m":m=>v(m.$+1,2),"%M":m=>v(m.ib,2),"%n":()=>` 19`,"%p":m=>0<=m.Z&&12>m.Z?"AM":"PM","%S":m=>v(m.jb,2),"%t":()=>" ","%u":m=>m.F||7,"%U":m=>v(Math.floor((m.J+7-m.F)/7),2),"%V":m=>{var ne=Math.floor((m.J+7-(m.F+6)%7)/7);if(2>=(m.F+371-m.J-2)%7&&ne++,ne)ne==53&&(W=(m.F+371-m.J)%7,W==4||W==3&&zt(m.K)||(ne=1));else{ne=52;var W=(m.F+7-m.J-1)%7;(W==4||W==5&&zt(m.K%400-1))&&ne++}return v(ne,2)},"%w":m=>m.F,"%W":m=>v(Math.floor((m.J+7-(m.F+6)%7)/7),2),"%y":m=>(m.K+1900).toString().substring(2),"%Y":m=>m.K+1900,"%z":m=>{m=m.hb;var ne=0<=m;return m=Math.abs(m)/60,(ne?"+":"-")+("0000"+(m/60*100+m%60)).slice(-4)},"%Z":m=>m.kb,"%%":()=>"%"},o=o.replace(/%%/g,"\0\0");for(G in F)o.includes(G)&&(o=o.replace(new RegExp(G,"g"),F[G](s)));return o=o.replace(/\0\0/g,"%"),G=qn(o),G.length>n?0:(ae.set(G,r),G.length-1)};de=h.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},De.push(0,1,void 0,1,null,1,!0,1,!1,1),h.count_emval_handles=()=>
19De.length/2-5-he.length,a=h.PureVirtualError=t("PureVirtualError");for(var bn=Array(256),Ht=0;256>Ht;++Ht)bn[Ht]=String.fromCharCode(Ht);l=bn,h.getInheritedInstanceCount=()=>Object.keys($).length,h.getLiveInheritedInstances=()=>{var r=[],n;for(n in $)$.hasOwnProperty(n)&&r.push($[n]);return r},h.flushPendingDeletes=O,h.setDelayFunction=r=>{Z=r,M.length&&Z&&Z(O)},Je=h.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},Object.assign(Vt.prototype,{isAliasOf:function(r){if(!(this instanceof Vt&&r instanceof Vt))return!1;var n=this.g.j.h,o=this.g.i;r.g=r.g;var s=r.g.j.h;for(r=r.g.i;n.o;)o=n.S(o),n=n.o;for(;s.o;)r=s.S(r),s=s.o;return n===s&&o===r},clone:function(){if(this.g.i||$t(this),this.g.O)return this.g.count.value+=1,this;var r=Ge,n=Object,o=n.create,s=Object.getPrototypeOf(this),d=this.g;return r=r(o.call(n,s,{g:{value:{count:d.count,M:d.M,O:d.O,i:d.i,j:d.j,s:d.s,A:d.A}}})),r.g.count.value+=1,r.g.M=!1,r},delete(){if(this.g.i||$t(this),this.g.M&&!this.g.O)throw new de("Object already scheduled for deletion");Ye(this);var r=this.g;--r.count.value,r.count.value===0&&(r.s?r.A.D(r.s):r.j.h.D(r.i)),this.g.O||(this.g.s=void 0,this.g.i=void 0)},isDeleted:function(){return!this.g.i},deleteLater:function(){if(this.g.i||$t(this),this.g.M&&!this.g.O)throw new de("Object already scheduled for deletion");return M.push(this),M.length===1&&Z&&Z(O),this.g.M=!0,this}}),Object.assign(jt.prototype,{Ra(r){return this.xa&&(r=this.xa(r)),r},pa(r){var n;(n=this.D)==null||n.call(this,r)},argPackAdvance:8,readValueFromPointer:st,fromWireType:function(r){function n(){return this.V?Xe(this.h.C,{j:this.ab,i:o,A:this,s:r}):Xe(this.h.C,{j:this,i:r})}var o=this.Ra(r);if(!o)return this.pa(r),null;var s=ct(this.h,o);if(s!==void 0)return s.g.count.value===0?(s.g.i=o,s.g.s=r,s.clone()):(s=s.clone(),this.pa(r),s);if(s=this.h.Qa(o),s=lt[s],!s)return n.call(this);s=this.U?s.Ha:s.pointerType;var d=ut(o,this.h,s.h);return d===null?n.call(this):this.V?Xe(s.h.C,{j:s,i:d,A:this,s:r}):Xe(s.h.C,{j:s,i:d})}}),ln=h.UnboundTypeError=t("UnboundTypeError");var wn={_abort_js:()=>{k("")},_embind_create_inheriting_constructor:(r,n,o)=>{r=c(r),n=Ue(n,"wrapper"),o=i(o);var s=n.h,d=s.C,v=s.o.C,E=s.o.constructor;return r=pe(r,function(...y){s.o.wa.forEach((function(L){if(this[L]===v[L])throw new a(`Pure virtual function ${L} must be implemented in JavaScript`)}).bind(this)),Object.defineProperty(this,"__parent",{value:d}),this.__construct(...y)}),d.__construct=function(...y){if(this===d)throw new de("Pass correct 'this' to __construct");y=E.implement(this,...y),Ye(y);var L=y.g;if(y.notifyOnDestruction(),L.O=!0,Object.defineProperties(this,{g:{value:L}}),Ge(this),y=L.i,y=ce(s,y),$.hasOwnProperty(y))throw new de(`Tried to register registered instance: ${y}`);$[y]=this},d.__destruct=function(){if(this===d)throw new de("Pass correct 'this' to __destruct");Ye(this);var y=this.g.i;if(y=ce(s,y),$.hasOwnProperty(y))delete $[y];else throw new de(`Tried to unregister unregistered instance: ${y}`)},r.prototype=Object.create(d),Object.assign(r.prototype,o),e(r)},_embind_finalize_value_object:r=>{var n=tt[r];delete tt[r];var o=n.fa,s=n.D,d=n.sa,v=d.map(E=>E.Ua).concat(d.map(E=>E.eb));qe([r],v,E=>{var y={};return d.forEach((L,F)=>{var G=E[F],me=L.Sa,Re=L.Ta,m=E[F+d.length],ne=L.cb,W=L.fb;y[L.Oa]={read:Ne=>G.fromWireType(me(Re,Ne)),write:(Ne,Be)=>{var ue=[];ne(W,Ne,m.toWireType(ue,Be)),nt(ue)}}}),[{name:n.name,fromWireType:L=>{var F={},G;for(G in y)F[G]=y[G].read(L);return s(L),F},toWireType:(L,F)=>{for(var G in y)if(!(G in F))throw new TypeError(`Missing field: "${G}"`);var me=o();for(G in y)y[G].write(me,F[G]);return L!==null&&L.push(s,me),me},argPackAdvance:8,readValueFromPointer:st,B:s}]})},_embind_register_bigint:()=>{},_embind_register_bool:(r,n,o,s)=>{n=c(n),_t(r,{name:n,fromWireType:function(d){return!!d},toWireType:function(d,v){return v?o:s},argPackAdvance:8,readValueFromPointer:function(d){return this.fromWireType(se[d])},B:null})},_embind_register_class:(r,n,o,s,d,v,E,y,L,F,G,me,Re)=>{G=c(G),v=ft(d,v),y&&(y=ft(E,y)),F&&(F=ft(L,F)),Re=ft(me,Re);var m=Pn(G);Kt(m,function(){Rt(`Cannot construct ${G} due to unbound types`,[s])}),qe([r,n,o],s?[s]:[],ne=>{if(ne=ne[0],s)var W=ne.h,Ne=W.C;else Ne=Vt.prototype;ne=pe(G,function(...ot){if(Object.getPrototypeOf(this)!==Be)throw new de("Use 'new' to construct "+G);if(ue.I===void 0)throw new de(G+" has no accessible constructor");var pt=ue.I[ot.length];if(pt===void 0)throw new de(`Tried to invoke ctor of ${G}
19 with invalid number of parameters (${ot.length}) - expected (${Object.keys(ue.I).toString()}) parameters instead!`);return pt.apply(this,ot)});var Be=Object.create(Ne,{constructor:{value:ne}});ne.prototype=Be;var ue=new On(G,ne,Be,Re,W,v,y,F);if(ue.o){var $e;($e=ue.o).T??($e.T=[]),ue.o.T.push(ue)}return W=new jt(G,ue,!0,!1,!1),$e=new jt(G+"*",ue,!1,!1,!1),Ne=new jt(G+" const*",ue,!1,!0,!1),lt[r]={pointerType:$e,Ha:Ne},on(m,ne),[W,$e,Ne]})},_embind_register_class_class_function:(r,n,o,s,d,v,E)=>{var y=Nt(o,s);n=c(n),n=Qt(n),v=ft(d,v),qe([],[r],L=>{function F(){Rt(`Cannot call ${G} due to unbound types`,y)}L=L[0];var G=`${L.name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var me=L.h.constructor;return me[n]===void 0?(F.L=o-1,me[n]=F):(Gt(me,n,G),me[n].l[o-1]=F),qe([],y,Re=>{if(Re=Wt(G,[Re[0],null].concat(Re.slice(1)),null,v,E),me[n].l===void 0?(Re.L=o-1,me[n]=Re):me[n].l[o-1]=Re,L.h.T)for(const m of L.h.T)m.constructor.hasOwnProperty(n)||(m.constructor[n]=Re);return[]}),[]})},_embind_register_class_class_property:(r,n,o,s,d,v,E,y)=>{n=c(n),v=ft(d,v),qe([],[r],L=>{L=L[0];var F=`${L.name}.${n}`,G={get(){Rt(`Cannot access ${F} due to unbound types`,[o])},enumerable:!0,configurable:!0};return G.set=y?()=>{Rt(`Cannot access ${F} due to unbound types`,[o])}:()=>{throw new de(`${F} is a read-only property`)},Object.defineProperty(L.h.constructor,n,G),qe([],[o],me=>{me=me[0];var Re={get(){return me.fromWireType(v(s))},enumerable:!0};return y&&(y=ft(E,y),Re.set=m=>{var ne=[];y(s,me.toWireType(ne,m)),nt(ne)}),Object.defineProperty(L.h.constructor,n,Re),[]}),[]})},_embind_register_class_constructor:(r,n,o,s,d,v)=>{var E=Nt(n,o);d=ft(s,d),qe([],[r],y=>{y=y[0];var L=`constructor ${y.name}`;if(y.h.I===void 0&&(y.h.I=[]),y.h.I[n-1]!==void 0)throw new de(`Cannot register multiple constructors with identical number of parameters (${n-1}) for class '${y.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return y.h.I[n-1]=()=>{Rt(`Cannot construct ${y.name} due to unbound types`,E)},qe([],E,F=>(F.splice(1,0,null),y.h.I[n-1]=Wt(L,F,null,d,v),[])),[]})},_embind_register_class_function:(r,n,o,s,d,v,E,y)=>{var L=Nt(o,s);n=c(n),n=Qt(n),v=ft(d,v),qe([],[r],F=>{function G(){Rt(`Cannot call ${me} due to unbound types`,L)}F=F[0];var me=`${F.name}.${n}`;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),y&&F.h.wa.push(n);var Re=F.h.C,m=Re[n];return m===void 0||m.l===void 0&&m.className!==F.name&&m.L===o-2?(G.L=o-2,G.className=F.name,Re[n]=G):(Gt(Re,n,me),Re[n].l[o-2]=G),qe([],L,ne=>(ne=Wt(me,ne,F,v,E),Re[n].l===void 0?(ne.L=o-2,Re[n]=ne):Re[n].l[o-2]=ne,[])),[]})},_embind_register_class_property:(r,n,o,s,d,v,E,y,L,F)=>{n=c(n),d=ft(s,d),qe([],[r],G=>{G=G[0];var me=`${G.name}.${n}`,Re={get(){Rt(`Cannot access ${me} due to unbound types`,[o,E])},enumerable:!0,configurable:!0};return Re.set=L?()=>Rt(`Cannot access ${me} due to unbound types`,[o,E]):()=>{throw new de(me+" is a read-only property")},Object.defineProperty(G.h.C,n,Re),qe([],L?[o,E]:[o],m=>{var ne=m[0],W={get(){var Be=cn(this,G,me+" getter");return ne.fromWireType(d(v,Be))},enumerable:!0};if(L){L=ft(y,L);var Ne=m[1];W.set=function(Be){var ue=cn(this,G,me+" setter"),$e=[];L(F,ue,Ne.toWireType($e,Be)),nt($e)}}return Object.defineProperty(G.h.C,n,W),[]}),[]})},_embind_register_emval:r=>_t(r,jn),_embind_register_enum:(r,n,o,s)=>{function d(){}n=c(n),d.values={},_t(r,{name:n,constructor:d,fromWireType:function(v){return this.constructor.values[v]},toWireType:(v,E)=>E.value,argPackAdvance:8,readValueFromPointer:Bn(n,o,s),B:null}),Kt(n,d)},_embind_register_enum_value:(r,n,o)=>{var s=Ue(r,"enum");n=c(n),r=s.constructor,s=Object.create(s.constructor.prototype,{value:{value:o},constructor:{value:pe(`${s.name}_${n}`,function(){})}}),r.values[o]=s,r[n]=s},_embind_register_float:(r,n,o)=>{n=c(n),_t(r,{name:n,fromWireType:s=>s,toWireType:(s,d)=>d,argPackAdvance:8,readValueFromPointer:Wn(n,o),B:null})},_embind_register_function:(r,n,o,s,d,v)=>{var E=Nt(n,o);r=c(r),r=Qt(r),d=ft(s,d),Kt(r,function(){Rt(`Cannot call ${r} due to unbound types`,E)},n-1),qe([],E,y=>(on(r,Wt(r,[y[0],null].concat(y.slice(1)),null,d,v),n-1),[]))},_embind_register_integer:(r,n,o,s,d)=>
19{if(n=c(n),d===-1&&(d=4294967295),d=y=>y,s===0){var v=32-8*o;d=y=>y<<v>>>v}var E=n.includes("unsigned")?function(y,L){return L>>>0}:function(y,L){return L};_t(r,{name:n,fromWireType:d,toWireType:E,argPackAdvance:8,readValueFromPointer:Nn(n,o,s!==0),B:null})},_embind_register_memory_view:(r,n,o)=>{function s(v){return new d(ae.buffer,Ce[v+4>>2],Ce[v>>2])}var d=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];o=c(o),_t(r,{name:o,fromWireType:s,argPackAdvance:8,readValueFromPointer:s},{Va:!0})},_embind_register_std_string:(r,n)=>{n=c(n);var o=n==="std::string";_t(r,{name:n,fromWireType:function(s){var d=Ce[s>>2],v=s+4;if(o)for(var E=v,y=0;y<=d;++y){var L=v+y;if(y==d||se[L]==0){if(E=E?Ut(se,E,L-E):"",F===void 0)var F=E;else F+="\0",F+=E;E=L+1}}else{for(F=Array(d),y=0;y<d;++y)F[y]=String.fromCharCode(se[v+y]);F=F.join("")}return It(s),F},toWireType:function(s,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var v=typeof d=="string";if(!(v||d instanceof Uint8Array||d instanceof Uint8ClampedArray||d instanceof Int8Array))throw new de("Cannot pass non-string to std::string");var E=o&&v?hn(d):d.length,y=rn(4+E+1),L=y+4;if(Ce[y>>2]=E,o&&v)fn(d,se,L,E+1);else if(v)for(v=0;v<E;++v){var F=d.charCodeAt(v);if(255<F)throw It(L),new de("String has UTF-16 code units that do not fit in 8 bits");se[L+v]=F}else for(v=0;v<E;++v)se[L+v]=d[v];return s!==null&&s.push(It,y),y},argPackAdvance:8,readValueFromPointer:st,B(s){It(s)}})},_embind_register_std_wstring:(r,n,o)=>{if(o=c(o),n===2)var s=Un,d=zn,v=Hn,E=y=>ke[y>>1];else n===4&&(s=Yn,d=Xn,v=$n,E=y=>Ce[y>>2]);_t(r,{name:o,fromWireType:y=>{for(var L=Ce[y>>2],F,G=y+4,me=0;me<=L;++me){var Re=y+4+me*n;(me==L||E(Re)==0)&&(G=s(G,Re-G),F===void 0?F=G:(F+="\0",F+=G),G=Re+n)}return It(y),F},toWireType:(y,L)=>{if(typeof L!="string")throw new de(`Cannot pass non-string to C++ string type ${o}`);var F=v(L),G=rn(4+F+n);return Ce[G>>2]=F/n,d(L,G+4,F+n),y!==null&&y.push(It,G),G},argPackAdvance:8,readValueFromPointer:st,B(y){It(y)}})},_embind_register_value_object:(r,n,o,s,d,v)=>{tt[r]={name:c(n),fa:ft(o,s),D:ft(d,v),sa:[]}},_embind_register_value_object_field:(r,n,o,s,d,v,E,y,L,F)=>{tt[r].sa.push({Oa:c(n),Ua:o,Sa:ft(s,d),Ta:v,eb:E,cb:ft(y,L),fb:F})},_embind_register_void:(r,n)=>{n=c(n),_t(r,{mb:!0,name:n,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(r,n,o)=>se.copyWithin(r,n,n+o),_emval_as:(r,n,o)=>(r=i(r),n=Ue(n,"emval::as"),pn(n,o,r)),_emval_call_method:(r,n,o,s,d)=>(r=en[r],n=i(n),o=qt(o),r(n,n[o],s,d)),_emval_decref:Jt,_emval_get_method_caller:(r,n,o)=>{var s=Qn(r,n),d=s.shift();r--;var v=Array(r);return n=`methodCaller<(${s.map(E=>E.name).join(", ")}) => ${d.name}>`,Kn(pe(n,(E,y,L,F)=>{for(var G=0,me=0;me<r;++me)v[me]=s[me].readValueFromPointer(F+G),G+=s[me].argPackAdvance;return E=o===1?Jn(y,v):y.apply(E,v),pn(d,L,E)}))},_emval_get_module_property:r=>(r=qt(r),e(h[r])),_emval_get_property:(r,n)=>(r=i(r),n=i(n),e(r[n])),_emval_incref:r=>{9<r&&(De[r+1]+=1)},_emval_new_array:()=>e([]),_emval_new_cstring:r=>e(qt(r)),_emval_new_object:()=>e({}),_emval_run_destructors:r=>{var n=i(r);nt(n),Jt(r)},_emval_set_property:(r,n,o)=>{r=i(r),n=i(n),o=i(o),r[n]=o},_emval_take_value:(r,n)=>(r=Ue(r,"_emval_take_value"),r=r.readValueFromPointer(n),e(r)),emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:r=>{var n=se.length;if(r>>>=0,2147483648<r)return!1;for(var o=1;4>=o;o*=2){var s=n*(1+.2/o);s=Math.min(s,r+100663296);var d=Math;s=Math.max(r,s);e:{d=(d.min.call(d,2147483648,s+(65536-s%65536)%65536)-P.buffer.byteLength+65535)/65536;try{P.grow(d),He();var v=1;break e}catch{}v=void 0}if(v)return!0}return!1},environ_get:(r,n)=>{var o=0;return mn().forEach((s,d)=>{var v=n+o;for(d=Ce[r+4*d>>2]=v,v=0;v<s.length;++v)ae[d++]=s.charCodeAt(v);ae[d]=0,o+=s.length+1}),0},environ_sizes_get:(r,n)=>{var o=mn();Ce[r>>2]=o.length;var s=0;return o.forEach(d=>s+=d.length+1),Ce[n>>2]=s,0},fd_close:()=>52,fd_seek:function(){return 70},fd_write:(r,n,o,s)=>{for(var d=0,v=0;v<o;v++){var E=Ce[n>>2],y=Ce[n+4>>2];n+=8;for(var L=0;L<y;L++){var F=se[E+L],G=Zn[r];F===0||F===10?((r===1?Y:U)(Ut(G,0)),G.length=0):G.push(F)}d+=y}return Ce[s>>2]=d,0},strftime_l:(r,n,o,s)=>er(r,n,o,s)},vt=function(){var o;function r(s){var d;return vt=s.exports,P=vt.memory,He(),sn=vt.__indirect_function_table,Ve.unshift(vt.__wasm_call_ctors),at--,(d=h.monitorRunDependencies)==null||d.call(h,at),at==0&&p&&(s=p,p=null,s()),vt}var n={env:wn,wasi_snapshot_preview1:wn};if(at++,(o=h.monitorRunDependencies)==null||o.call(h,at),h.instantiateWasm)try{return h.instantiateWasm(n,r)}catch(s){U(`Module.instantiateWasm callback failed with error: ${s}`),D(s)}return w||(w=R("canvas_advanced.wasm")?"canvas_advanced.wasm":h.locateFile?h.locateFile("canvas_advanced.wasm",u):u+"canvas_advanced.wasm"),N(n,function(s){r(s.instance)}).catch(D),{}}(),It=r=>(It=vt.free)(r),rn=r=>(rn=vt.malloc)(r),_n=r=>(_n=vt.__getTypeName)(r);h.dynCall_jiji=(r,n,o,s,d)=>(h.dynCall_jiji=vt.dynCall_jiji)(r,n,o,s,d),h.dynCall_viijii=(r,n,o,s,d,v,E)=>(h.dynCall_viijii=vt.dynCall_viijii)(r,n,o,s,d,v,E),h.dynCall_iiiiij=(r,n,o,s,d,v,E)=>(h.dynCall_iiiiij=vt.dynCall_iiiiij)(r,n,o,s,d,v,E),h.dynCall_iiiiijj=(r,n,o,s,d,v,E,y,L)=>(h.dynCall_iiiiijj=vt.dynCall_iiiiijj)(r,n,o,s,d,v,E,y,L),h.dynCall_iiiiiijj=(r,n,o,s,d,v,E,y,L,F)=>(h.dynCall_iiiiiijj=vt.dynCall_iiiiiijj)(r,n,o,s,d,v,E,y,L,F);var Yt;p=function r(){Yt||An(),Yt||(p=r)};function An(){function r(){if(!Yt&&(Yt=!0,h.calledRun=!0,!te)){if(le(Ve),we(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),h.postRun)for(typeof h.postRun=="function"&&(h.postRu
19n=[h.postRun]);h.postRun.length;){var n=h.postRun.shift();Ze.unshift(n)}le(Ze)}}if(!(0<at)){if(h.preRun)for(typeof h.preRun=="function"&&(h.preRun=[h.preRun]);h.preRun.length;)dt();le(Fe),0<at||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1),r()},1)):r())}}if(h.preInit)for(typeof h.preInit=="function"&&(h.preInit=[h.preInit]);0<h.preInit.length;)h.preInit.pop()();return An(),z=ge,z}})();const ve=f},xe=>{xe.exports=JSON.parse(`{"name":"@rive-app/canvas-lite","version":"2.39.1","description":"A lite version of Rive's canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <[email protected]> (https://rive.app)","Maxwell Talbot <[email protected]> (https://rive.app)","Arthur Vivian <[email protected]> (https://rive.app)","Umberto Sonnino <[email protected]> (https://rive.app)","Matthew Sullivan <[email protected]> (mailto:[email protected])"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}`)},(xe,oe,q)=>{q.r(oe),q.d(oe,{AccessibilityOverlay:()=>ve.AccessibilityOverlay,SemanticActionType:()=>J.SemanticActionType,SemanticMode:()=>J.SemanticMode,SemanticRole:()=>J.SemanticRole,SemanticState:()=>J.SemanticState,SemanticTrait:()=>J.SemanticTrait,SemanticTreeModel:()=>f.SemanticTreeModel,hasState:()=>J.hasState,hasTrait:()=>J.hasTrait,roleName:()=>J.roleName,stateNames:()=>J.stateNames,traitNames:()=>J.traitNames});var f=q(7),ve=q(9),J=q(8)},(xe,oe,q)=>{q.r(oe),q.d(oe,{SemanticTreeModel:()=>J});var f=q(8),ve=function(C,A,ee){if(ee||arguments.length===2)for(var ye=0,fe=A.length,Ie;ye<fe;ye++)(Ie||!(ye in A))&&(Ie||(Ie=Array.prototype.slice.call(A,0,ye)),Ie[ye]=A[ye]);return C.concat(Ie||Array.prototype.slice.call(A))},J=function(){function C(){this._nodesById=new Map,this._roots=[],this._semanticVersion=0,this._geometryVersion=0,this._geometryChangedIds=new Set,this._semanticChangedIds=new Set,this._debug=!1}return Object.defineProperty(C.prototype,"nodeCount",{get:function(){return this._nodesById.size},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"semanticVersion",{get:function(){return this._semanticVersion},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"geometryVersion",{get:function(){return this._geometryVersion},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"geometryChangedIds",{get:function(){return this._geometryChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"semanticChangedIds",{get:function(){return this._semanticChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"roots",{get:function(){return this._roots},enumerable:!1,configurable:!0}),C.prototype.nodeById=function(A){return this._nodesById.get(A)},C.prototype.siblingIndexOf=function(A){var ee=this._nodesById.get(A);if(!ee)return-1;if(ee.parentId<0)return this._roots.indexOf(A);var ye=this._nodesById.get(ee.parentId);return ye?ye.children.indexOf(A):-1},C.prototype.detach=function(A){var ee=this._nodesById.get(A);if(ee)if(ee.parentId<0){var ye=this._roots.indexOf(A);ye!==-1&&this._roots.splice(ye,1)}else{var fe=this._nodesById.get(ee.parentId);if(fe){var ye=fe.children.indexOf(A);ye!==-1&&fe.children.splice(ye,1)}}},C.prototype.attach=function(A,ee,ye){var fe=this._nodesById.get(A);if(fe)if(ee<0){fe.parentId=-1;var Ie=j(ye,0,this._roots.length);this._roots.splice(Ie,0,A)}else{var H=this._nodesById.get(ee);if(!H)fe.parentId=-1,this._roots.push(A);else{fe.parentId=ee;var Ie=j(ye,0,H.children.length);H.children.splice(Ie,0,A)}}},C.prototype.removeSubtree=function(A){var ee=this._nodesById.get(A);if(ee){for(var ye=ve([],ee.children,!0),fe=0,Ie=ye;fe<Ie.length;fe++){var H=Ie[fe];this.removeSubtree(H)}this.detach(A),this._nodesById.delete(A)}},C.prototype.applyDiff=function(A){var ee,ye,fe=this;this._geometryChangedIds.clear(),this._semanticChangedIds.clear();for(var Ie=!1,H=!1,Q=function(){Ie=!0},ie=function(w){Ie=!0,fe._semanticChangedIds.add(w)},x=function(w){H=!0,fe._geometryChangedIds.add(w)},u=0,_=A.removed;u<_.length;u++){var T=_[u];this._nodesById.has(T)&&(this.removeSubtree(T),Q())}for(var Y=0,U=A.added;Y<U.length;Y++){var I=U[Y],P=this._nodesById.get(I.id);P?(h(P,I)&&(D(P,I),ie(I.id)),we(P,I)&&(ge(P,I),x(I.id))):(this._nodesById.set(I.id,z(I)),ie(I.id),x(I.id)),this.detach(I.id),this.attach(I.id,I.parentId,I.siblingIndex)}for(var te=0,ae=A.moved;te<ae.length;te++){var I=ae[te],P=this._nodesById.get(I.id);if(P){var se=P.parentId!==I.parentId,_e=this.siblingIndexOf(I.id),ke=we(P,I);ke&&(ge(P,I),x(I.id)),this.detach(I.id),this.attach(I.id,I.parentId,I.siblingIndex),(se||this.siblingIndexOf(I.id)!==_e)&&Q()}}for(var be=0,Ce=A.childrenUpdated;be<Ce.length;be++){var Pe=Ce[be];if(Pe.parentId<0){var We=Pe.childIds.filter(function(w){return fe._nodesById.has(w)});if(!b(this._roots,We)){this._roots.length=0,(ee=this._roots).push.apply(ee,We);for(var He=0,Fe=this._roots;He<Fe.length;He++){var T=Fe[He],Ve=this._nodesById.get(T);Ve&&(Ve.parentId=-1)}Q()}}else{var Ze=this._nodesById.get(Pe.parentId);if(!Ze)continue;var We=Pe.childIds.filter(function(S){return fe._nodesById.has(S)});if(!b(Ze.children,We)){Ze.children.length=0,(ye=Ze.children).push.apply(ye,We);for(var dt=0,at=Ze.children;dt<at.length;dt++){var T=at[dt],Ve=this._nodesById.get(T);Ve&&(Ve.parentId=Pe.parentId)}Q()}}}for(var p=0,k=A.updatedSemantic;p<k.length;p++){var I=k[p],P=this._nodesById.get(I.id);P&&h(P,I)&&(D(P,I),ie(I.id))}for(var R=0,g=A.updatedGeometry;R<g.length;R++){var I=g[R],P=this._nodesById.get(I.id);P&&we(P,I)&&(ge(P,I),x(I.id))}!Ie&&!H||(Ie&&this._semanticVersion++,H&&this._geometryVersion++,this._debug&&this.logDiff(A,Ie,H))}
19,Object.defineProperty(C.prototype,"debug",{set:function(A){this._debug=A},enumerable:!1,configurable:!0}),C.prototype.logDiff=function(A,ee,ye){for(var fe=["[rive:semantics] semantic v".concat(this._semanticVersion)+(ye?" geometry v".concat(this._geometryVersion):"")+(ee?"":" (geometry-only)")],Ie=0,H=A.removed;Ie<H.length;Ie++){var Q=H[Ie];fe.push(" - removed #".concat(Q))}for(var ie=0,x=A.added;ie<x.length;ie++){var u=x[ie];fe.push(" + added #".concat(u.id," ").concat((0,f.roleName)(u.role))+(u.label?' "'.concat(u.label,'"'):"")+" bounds:(".concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")")+" states=[".concat((0,f.stateNames)(u.stateFlags),"]")+" traits=[".concat((0,f.traitNames)(u.traitFlags),"]"))}for(var _=0,T=A.moved;_<T.length;_++){var u=T[_];fe.push(" ~ moved #".concat(u.id," → parent=").concat(u.parentId," idx=").concat(u.siblingIndex)+" bounds:(".concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")"))}for(var Y=0,U=A.childrenUpdated;Y<U.length;Y++){var I=U[Y];fe.push(" ↕ children of ".concat(I.parentId<0?"root":"#"+I.parentId,": [").concat(I.childIds.join(", "),"]"))}for(var P=0,te=A.updatedSemantic;P<te.length;P++){var u=te[P];fe.push(" ✎ semantic #".concat(u.id," ").concat((0,f.roleName)(u.role))+(u.label?' "'.concat(u.label,'"'):"")+" states=[".concat((0,f.stateNames)(u.stateFlags),"]")+" traits=[".concat((0,f.traitNames)(u.traitFlags),"]"))}for(var ae=0,se=A.updatedGeometry;ae<se.length;ae++){var u=se[ae];fe.push(" ⊞ geometry #".concat(u.id," (").concat(u.minX.toFixed(1),",").concat(u.minY.toFixed(1),")-(").concat(u.maxX.toFixed(1),",").concat(u.maxY.toFixed(1),")"))}console.log(fe.join(` 20`))},C.prototype.flattened=function(){for(var A=this,ee=[],ye=function(Q,ie){var x=A._nodesById.get(Q);if(x){ee.push({depth:ie,node:x});for(var u=0,_=x.children;u<_.length;u++){var T=_[u];ye(T,ie+1)}}},fe=0,Ie=this._roots;fe<Ie.length;fe++){var H=Ie[fe];ye(H,0)}return ee},C}();function j(C,A,ee){return C<A?A:C>ee?ee:C}function b(C,A){if(C.length!==A.length)return!1;for(var ee=0;ee<C.length;ee++)if(C[ee]!==A[ee])return!1;return!0}function z(C){return{id:C.id,parentId:-1,role:C.role,label:C.label,value:C.value,hint:C.hint,stateFlags:C.stateFlags,traitFlags:C.traitFlags,headingLevel:C.headingLevel,minX:C.minX,minY:C.minY,maxX:C.maxX,maxY:C.maxY,children:[]}}function h(C,A){return C.role!==A.role||C.label!==A.label||C.value!==A.value||C.hint!==A.hint||C.stateFlags!==A.stateFlags||C.traitFlags!==A.traitFlags||C.headingLevel!==A.headingLevel}function we(C,A){return C.minX!==A.minX||C.minY!==A.minY||C.maxX!==A.maxX||C.maxY!==A.maxY}function D(C,A){C.role=A.role,C.label=A.label,C.value=A.value,C.hint=A.hint,C.stateFlags=A.stateFlags,C.traitFlags=A.traitFlags,C.headingLevel=A.headingLevel}function ge(C,A){C.minX=A.minX,C.minY=A.minY,C.maxX=A.maxX,C.maxY=A.maxY}},(xe,oe,q)=>{q.r(oe),q.d(oe,{SemanticActionType:()=>h,SemanticMode:()=>j,SemanticRole:()=>f,SemanticState:()=>ve,SemanticTrait:()=>b,hasState:()=>J,hasTrait:()=>z,roleName:()=>Ie,stateNames:()=>H,traitNames:()=>Q});var f={none:0,button:1,link:2,checkbox:3,switchControl:4,slider:5,textField:6,text:7,image:8,group:9,list:10,listItem:11,tab:12,tabList:13,dialog:14,alertDialog:15,radioGroup:16,radioButton:17},ve={None:0,Expanded:1,Selected:2,Checked:4,Mixed:8,Toggled:16,Required:32,Disabled:64,Focused:128,Hidden:256,LiveRegion:512,ReadOnly:1024,Modal:2048,Obscured:4096,Multiline:8192};function J(ie,x){return(ie&x)!==0}var j={Disabled:"disabled",Enabled:"enabled"},b={None:0,Expandable:1,Selectable:2,Checkable:4,Toggleable:8,Requirable:16,Enablable:32,Focusable:64};function z(ie,x){return(ie&x)!==0}for(var h={tap:0,increase:1,decrease:2},we={},D=0,ge=Object.entries(f);D<ge.length;D++){var C=ge[D],A=C[0],ee=C[1];we[ee]=A}var ye=Object.entries(ve).filter(function(ie){var x=ie[1];return x!==0}),fe=Object.entries(b).filter(function(ie){var x=ie[1];return x!==0});function Ie(ie){var x;return(x=we[ie])!==null&&x!==void 0?x:"unknown(".concat(ie,")")}function H(ie){if(ie===0)return"none";for(var x=[],u=0,_=ye;u<_.length;u++){var T=_[u],Y=T[0],U=T[1];ie&U&&x.push(Y)}return x.join(", ")||"none"}function Q(ie){if(ie===0)return"none";for(var x=[],u=0,_=fe;u<_.length;u++){var T=_[u],Y=T[0],U=T[1];ie&U&&x.push(Y)}return x.join(", ")||"none"}},(xe,oe,q)=>{q.r(oe),q.d(oe,{AccessibilityOverlay:()=>ve});var f=q(8),ve=function(){function x(u){var _=this,T;this.elements=new Map,this.descElements=new Map,this.lastSemanticVersion=-1,this.lastGeometryVersion=-1,this.pendingTextGeometry=[],this.textGeometryKeys=new WeakMap,this.lastCanvasPositioning={width:-1,height:-1,offsetTop:-1,offsetLeft:-1},this._geometryDirty=!0,this.isUpdating=!1,this.transformContainer=null,this._artboardBounds={minX:0,minY:0,maxX:0,maxY:0},this.repositionTimer=null,this.canvasResizeObserver=null,this.parentResizeObserver=null,this.positionObserver=null,this._onWindowResize=function(){return _.scheduleReposition()},this.instanceId=u.instanceId,this.fireAction=u.fireAction,this.requestFocus=u.requestFocus,this.clearFocus=u.clearFocus,this.canvas=u.canvas,this.semanticsOptions=u.semanticsOptions,this.allowFocusInterrupt=(T=u.allowFocusInterrupt)!==null&&T!==void 0?T:!1,this.container=this.createContainer(u.canvas),this.attachPositionObservers()}return x.prototype.getSemanticOverlayContainer=function(){return this.container},x.prototype.attachPositionObservers=function(){var u=this;this.canvasResizeObserver=new ResizeObserver(function(){return u.scheduleReposition()}),this.canvasResizeObserver.observe(this.canvas);var _=this.canvas.parentElement;_&&(this.parentResizeObserver=new ResizeObserver(function(){return u.scheduleReposition()}),this.parentResizeObserver.observe(_)),window.addEventListener("resize",this._onWindowResize),this.observePosition()},x.prototype.observePosition=function(){var u=this,_;if(!(typeof IntersectionObserver>"u")){(_=this.positionObserver)===null||_===void 0||_.disconnect(),this.positionObserver=null;var T=this.canvas.getBoundingClientRect();if(!(!T.width||!T.height)){var Y=function(P){return"".concat(-Math.round(P),"px")},U=[T.top,window.innerWidth-T.right,window.innerHeight-T.bottom,T.left].map(Y).join(" "),I=!1;this.positionObserver=new IntersectionObserver(function(){if(!I){I=!0;return}u.scheduleReposition()},{threshold:1,rootMargin:U}),this.positionObserver.observe(this.canvas)}}},x.prototype.scheduleReposition=function(){var u=this;this._geometryDirty=!0,this.repositionTimer===null&&(this.repositionTimer=setTimeout(function(){u.repositionTimer=null,u.syncContainerGeometry(),u.observePosition()},500))},x.prototype.syncContainerGeometry=function(){var u=this.canvas.getBoundingClientRect(),_=this.canvas.offsetTop,T=this.canvas.offsetLeft;u.width===this.lastCanvasPositioning.width&&u.height===this.lastCanvasPositioning.height&&_===this.lastCanvasPositioning.offsetTop&&T===this.lastCanvasPositioning.offsetLeft||(this.container.style.top=_+"px",this.container.style.left=T+"px",this.container.style.width=u.width+"px",this.container.style.height=u.height+"px",this.container.tabIndex=-1,this.lastCanvasPositioning.width=u.width,this.lastCanvasPositioning.height=u.height,this.lastCanvasPositioning.offsetTop=_,this.lastCanvasPositioning.offsetLeft=T)},x.prototype.createContainer=function(u){var _,T,Y=document.createElement("div");Y.id="rive-a11y-".concat(this.instanceId),Y.setAttribute("role","regi
20on"),Y.setAttribute("aria-label",(T=(_=this.semanticsOptions)===null||_===void 0?void 0:_.riveCanvasLabel)!==null&&T!==void 0?T:"Rive animation");var U=u.getBoundingClientRect();return Y.style.cssText=["position:absolute","top:".concat(u.offsetTop,"px"),"left:".concat(u.offsetLeft,"px"),"width:".concat(U.width,"px"),"height:".concat(U.height,"px"),"overflow:hidden","pointer-events:none","opacity:0"].join(";"),u.insertAdjacentElement("afterend",Y),Y},x.prototype.needsUpdate=function(u){var _=u.semanticVersion!==this.lastSemanticVersion,T=u.geometryVersion!==this.lastGeometryVersion,Y=this._geometryDirty||!this.transformContainer;return!_&&!T&&!Y?null:{semanticChanged:_,nodeGeometryChanged:T,layoutChanged:Y}},x.prototype.update=function(u,_,T,Y,U){var I=U??this.needsUpdate(u);!I&&_&&(I={semanticChanged:!1,nodeGeometryChanged:!1,layoutChanged:!0}),I&&this.performUpdate(u,_,T,Y,I)},x.prototype.performUpdate=function(u,_,T,Y,U){var I,P=U.semanticChanged,te=U.nodeGeometryChanged,ae=u.semanticVersion-this.lastSemanticVersion>1;if(this.lastSemanticVersion=u.semanticVersion,this.lastGeometryVersion=u.geometryVersion,this.isUpdating=!0,this._artboardBounds=Y,_&&(this.syncContainerGeometry(),this.syncTransformContainer(_,T,Y),this._geometryDirty=!1),P){var se=(I=this.transformContainer)!==null&&I!==void 0?I:this.container,_e=new Set;this.rebuildChildren(se,u.roots,u,0,0,_e,ae);var ke=[];this.elements.forEach(function(Fe,Ve){_e.has(Ve)||ke.push(Ve)});for(var be=0,Ce=ke;be<Ce.length;be++){var Pe=Ce[be],We=this.elements.get(Pe);We&&We.parentNode&&We.parentNode.removeChild(We),this.elements.delete(Pe);var He=this.descElements.get(Pe);He&&He.parentNode&&He.parentNode.removeChild(He),this.descElements.delete(Pe)}}else te&&this.updateGeometryForChangedNodes(u);this.flushTextGeometry(),this.isUpdating=!1},x.prototype.destroy=function(){var u,_,T;this.repositionTimer!==null&&(clearTimeout(this.repositionTimer),this.repositionTimer=null),window.removeEventListener("resize",this._onWindowResize),(u=this.canvasResizeObserver)===null||u===void 0||u.disconnect(),(_=this.parentResizeObserver)===null||_===void 0||_.disconnect(),(T=this.positionObserver)===null||T===void 0||T.disconnect(),this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.elements.clear(),this.descElements.clear(),this.pendingTextGeometry.length=0},x.prototype.rebuildChildren=function(u,_,T,Y,U,I,P){for(var te=0;te<_.length;te++){var ae=_[te],se=T.nodeById(ae);if(se){I.add(ae);var _e=this.elements.get(ae),ke=!_e;_e||(_e=this.createElement(se),this.elements.set(ae,_e)),(ke||P||T.semanticChangedIds.has(ae))&&this.applyAttributes(_e,se),this.applyPosition(_e,se,Y,U);var be=u.children[te];if(be!==_e&&(be?u.insertBefore(_e,be):u.appendChild(_e)),(0,f.hasTrait)(se.traitFlags,f.SemanticTrait.Focusable)&&(0,f.hasState)(se.stateFlags,f.SemanticState.Focused)){var Ce=document.activeElement,Pe=Ce==null?void 0:Ce.closest('[aria-modal="true"]'),We=!!Pe&&this.container.contains(Pe)&&!Pe.contains(_e);Ce!==_e&&!We&&this.canMoveFocus()&&_e.focus()}se.children.length>0&&this.rebuildChildren(_e,se.children,T,se.minX,se.minY,I,P),ke&&this.autoFocusDialogOnAppear(_e,se,T)}}},x.prototype.updateGeometryForChangedNodes=function(u){for(var _,T,Y=0,U=Array.from(u.geometryChangedIds);Y<U.length;Y++){var I=U[Y],P=u.nodeById(I);if(P){var te=0,ae=0,se=(_=this.transformContainer)!==null&&_!==void 0?_:this.container;if(P.parentId>=0){var _e=u.nodeById(P.parentId);_e&&(te=_e.minX,ae=_e.minY,se=(T=this.elements.get(P.parentId))!==null&&T!==void 0?T:se)}this.updateNodeGeometrySubtree(u,I,te,ae,se)}}},x.prototype.updateNodeGeometrySubtree=function(u,_,T,Y,U){var I=u.nodeById(_);if(I){var P=this.elements.get(_);if(P){this.applyPosition(P,I,T,Y);for(var te=0,ae=I.children;te<ae.length;te++){var se=ae[te];this.updateNodeGeometrySubtree(u,se,I.minX,I.minY,P)}}}},x.prototype.canMoveFocus=function(){var u=document.activeElement,_=u===this.canvas||this.container.contains(u);return _||this.allowFocusInterrupt},x.prototype.autoFocusDialogOnAppear=function(u,_,T){var Y;if(Ie(_.role,_.stateFlags)&&this.canMoveFocus()){var U=document.activeElement;if(!(U&&U!==u&&u.contains(U))){var I=(Y=this.routeDefaultFocusTarget(_,T))!==null&&Y!==void 0?Y:u;I.hasAttribute("tabindex")||I.setAttribute("tabindex","-1"),document.activeElement!==I&&I.focus({preventScroll:!0})}}},x.prototype.routeDefaultFocusTarget=function(u,_){for(var T,Y=0,U=u.children;Y<U.length;Y++){var I=U[Y],P=_.nodeById(I);if(P){var te=this.elements.get(I);if(te&&H(P))return te;if(P.children.length>0||!P.label){var ae=this.routeDefaultFocusTarget(P,_);if(ae)return ae;continue}if(te)return(T=te.querySelector(":scope > span"))!==null&&T!==void 0?T:te}}return null},Object.defineProperty(x.prototype,"nodeIdPrefix",{get:function(){return"rive-".concat(this.instanceId,"-sem-")}
20,enumerable:!1,configurable:!0}),x.prototype.nodeIdFromElement=function(u){if(!u.id.startsWith(this.nodeIdPrefix))return null;var _=u.id.slice(this.nodeIdPrefix.length);if(!_)return null;var T=Number(_);return Number.isNaN(T)?null:T},x.prototype.createElement=function(u){var _=Q(u.role),T=document.createElement(_);if(T.id="".concat(this.nodeIdPrefix).concat(u.id),T.style.cssText=D,u.role===f.SemanticRole.text){var Y=document.createElement("span");Y.style.cssText=ge,T.appendChild(Y)}return this.attachActionHandlers(T,u),T},x.prototype.attachRovingNav=function(u,_){var T=this;u.addEventListener("keydown",function(Y){var U=null;if(Y.key==="ArrowRight"||Y.key==="ArrowDown"?U="next":Y.key==="ArrowLeft"||Y.key==="ArrowUp"?U="prev":_.includeHomeEnd&&Y.key==="Home"?U="first":_.includeHomeEnd&&Y.key==="End"&&(U="last"),!!U){Y.preventDefault();var I=_.members(),P=I.indexOf(u);if(!(P<0)){var te=I.length,ae=U==="next"?I[(P+1)%te]:U==="prev"?I[(P-1+te)%te]:U==="first"?I[0]:I[te-1];if(ae&&ae!==u){ae.focus();var se=T.nodeIdFromElement(ae);se!==null&&T.fireAction(se,f.SemanticActionType.tap)}}}})},x.prototype.attachActionHandlers=function(u,_){var T=this,Y=_.role,U=_.id;if(ye(Y)){u.addEventListener("click",function(){T.fireAction(U,f.SemanticActionType.tap)});var I=Y===f.SemanticRole.link?["Enter"]:["Enter"," "];u.addEventListener("keydown",function(P){I.includes(P.key)&&(P.preventDefault(),T.fireAction(U,f.SemanticActionType.tap))})}Y===f.SemanticRole.slider&&u.addEventListener("keydown",function(P){P.key==="ArrowRight"||P.key==="ArrowUp"?(P.preventDefault(),T.fireAction(U,f.SemanticActionType.increase)):(P.key==="ArrowLeft"||P.key==="ArrowDown")&&(P.preventDefault(),T.fireAction(U,f.SemanticActionType.decrease))}),Y===f.SemanticRole.tab&&this.attachRovingNav(u,{includeHomeEnd:!0,members:function(){var P=u.parentElement;return P?Array.from(P.children).filter(function(te){return te instanceof HTMLElement&&te.getAttribute("role")==="tab"}):[]}}),Y===f.SemanticRole.radioButton&&this.attachRovingNav(u,{includeHomeEnd:!1,members:function(){var P,te=(P=u.closest('[role="radiogroup"]'))!==null&&P!==void 0?P:u.parentElement;return te?Array.from(te.querySelectorAll('[role="radio"]')):[]}}),(0,f.hasTrait)(_.traitFlags,f.SemanticTrait.Focusable)&&u.addEventListener("focus",function(){T.requestFocus(U)})},x.prototype.applyAttributes=function(u,_){var T,Y,U,I=_.role,P=_.stateFlags,te=_.traitFlags,ae=ie(I);if(ae?C(u,"role",ae):A(u,"role"),I===f.SemanticRole.link&&C(u,"role","link"),fe(I)||(0,f.hasTrait)(te,f.SemanticTrait.Focusable)||I===f.SemanticRole.listItem?C(u,"tabindex","-1"):A(u,"tabindex"),_.label?C(u,"aria-label",_.label):A(u,"aria-label"),I===f.SemanticRole.slider){if(_.value){var se=parseFloat(_.value);Number.isFinite(se)?C(u,"aria-valuenow",String(se)):A(u,"aria-valuenow"),C(u,"aria-valuetext",_.value)}else A(u,"aria-valuenow"),A(u,"aria-valuetext");C(u,"aria-orientation","horizontal"),ee(u,"aria-readonly",(0,f.hasState)(P,f.SemanticState.ReadOnly))}else A(u,"aria-valuenow"),A(u,"aria-valuetext"),A(u,"aria-orientation"),A(u,"aria-readonly");if(_.hint){var _e="rive-".concat(this.instanceId,"-desc-").concat(_.id),ke=this.descElements.get(_.id);ke||(ke=document.createElement("span"),ke.id=_e,ke.style.cssText=we,this.container.appendChild(ke),this.descElements.set(_.id,ke)),ke.textContent!==_.hint&&(ke.textContent=_.hint),C(u,"aria-describedby",_e)}else{A(u,"aria-describedby");var be=this.descElements.get(_.id);be&&(be.parentNode&&be.parentNode.removeChild(be),this.descElements.delete(_.id))}if(I===f.SemanticRole.text){var Ce=(T=u.querySelector(":scope > span"))!==null&&T!==void 0?T:u,Pe=(Y=_.label)!==null&&Y!==void 0?Y:"";Ce.textContent!==Pe&&(Ce.textContent=Pe),A(u,"aria-label"),_.headingLevel>0?(C(u,"role","heading"),C(u,"aria-level",String(_.headingLevel))):A(u,"aria-level")}(0,f.hasTrait)(te,f.SemanticTrait.Expandable)&&J.has(I)?ee(u,"aria-expanded",(0,f.hasState)(P,f.SemanticState.Expanded)):A(u,"aria-expanded"),I===f.SemanticRole.tab||(0,f.hasTrait)(te,f.SemanticTrait.Selectable)&&j.has(I)?ee(u,"aria-selected",(0,f.hasState)(P,f.SemanticState.Selected)):A(u,"aria-selected"),(0,f.hasTrait)(te,f.SemanticTrait.Checkable)&&b.has(I)?(0,f.hasState)(P,f.SemanticState.Mixed)&&I!==f.SemanticRole.switchControl?C(u,"aria-checked","mixed"):ee(u,"aria-checked",(0,f.hasState)(P,f.SemanticState.Checked)):A(u,"aria-checked"),(0,f.hasTrait)(te,f.SemanticTrait.Toggleable)?(z.has(I)?ee(u,"aria-pressed",(0,f.hasState)(P,f.SemanticState.Toggled)):A(u,"aria-pressed"),I===f.SemanticRole.switchControl&&ee(u,"aria-checked",(0,f.hasState)(P,f.SemanticState.Toggled))):A(u,"aria-pressed"),(0,f.hasTrait)(te,f.SemanticTrait.Requirable)&&h.has(I)?ee(u,"aria-required",(0,f.hasState)(P,f.SemanticState.Required)):A(u,"aria-required"),(0,f.hasTrait)(te,f.SemanticTrait.Enablable)?ee(u,"aria-disabled",(0,f.hasState)(P,f.SemanticState.Disabled)):A(u,"aria-disabled");var We=I===f.SemanticRole.image&&!_.label;if((0,f.hasState)(P,f.SemanticState.Hidden)||(0,f.hasState)(P,f.SemanticState.Obscured)||We?C(u,"aria-hidden","true"):A(u,"aria-hidden"),(0,f.hasState)(P,f.SemanticState.LiveRegion)?C(u,"aria-live","polite"):A(u,"aria-live"),I===f.SemanticRole.textField){if(ee(u,"aria-readonly",(0,f.hasState)(P,f.SemanticState.ReadOnly)),ee(u,"aria-multiline",(0,f.hasState)(P,f.SemanticState.Multiline)),_.children.length===0){var He=(U=_.value)!==null&&U!==void 0?U:"";u.textContent!==He&&(u.textContent=He)}}else A(u,"aria-multiline");Ie(I,P)?C(u,"aria-modal","true"):A(u,"aria-modal")},x.prototype.applyPosition=function(u,_,T,Y){var U=this._artboardBounds,I=Math.max(_.minX,U.minX),P=Math.max(_.minY,U.minY),te=Math.min(_.maxX,U.maxX),ae=Math.min(_.maxY,U.maxY),se=I-T,_e=P-Y,ke=Math.max(0,te-I),be=Math.max(0,ae-P),Ce=Math.round(se),Pe=Math.round(_e),We=Math.round(ke)+"px",He=Math.round(be)+"px",Fe=Ce+"px",Ve=Pe+"px";u.style.left!==Fe&&(u.style.left=Fe),u.style.top!==Ve&&(u.style.top=Ve),u.style.width!==We&&(u.style.width=We),u.style.height!==He&&(u.style.height=He),u.style.transform&&(u.style.transform=""),_.role===f.SemanticRole.text&&this.pendingTextGeometry.push(u)},x.prototype.flushTextGeometry=function(){var u;if(this.pendingTextGeometry.length!==0){for(var _=[],T=0,Y=this.pendingTextGeometry;T<Y.length;T++){var U=Y[T],I=(u=U.querySelector(":scope > span"))!==null&&u!==void 0?u:U,P="".concat(U.style.width,"|").concat(U.style.height,"|").concat(I.textContent);this.textGeometryKeys.get(U)!==P&&(I.style.width="auto",I.style.height="auto",I.style.transformOrigin="0 0",I.style.transform="",_.push({host:U,span:I,key:P}))}this.pendingTextGeometry.length=0;for(var te=_.map(function(_e){var ke=_e.host,be=_e.span,Ce=ke.getBoundingClientRect(),Pe=be.getBoundingClientRect();if(Pe.width>0&&Pe.height>0){var We=Ce.width/Pe.width,He=Ce.height/Pe.height;return"scale(".concat(We,", ").concat(He,")")}return"none"}),ae=0;ae<_.length;ae++){var se=_[ae],U=se.host,I=se.span,P=se.key;I.style.transform=te[ae],this.textGeometryKeys.set(U,P)}}},x.prototype.syncTransformContainer=function(u,_,T){if(!this.transformContainer){var Y=document.createElement("div");Y.style.cssText=["position:absolute","top:0","left:0","overflow:visible","pointer-events:none","transform-origin:0 0"].join(";"),this.container.appendChild(Y),this.transformContainer=Y}var U=T.maxX-T.minX,I=T.maxY-T.minY;this.transformContainer.style.width=Math.round(U)+"px",this.transformContainer.style.height=Math.round(I)+"px";var P=1/(_||1),te=u.xx*P,ae=u.xy*P,se=u.yx*P,_e=u.yy*P,ke=u.tx*P,be=u.ty*P;this.transformContainer.style.transform="matrix(".concat(te,",").concat(ae,",").concat(se,",").concat(_e,",").concat(ke,",").concat(be,")")},x}(),J=new Set([f.SemanticRole.button,f.SemanticRole.link,f.SemanticRole.checkbox,f.SemanticRole.switchControl,f.SemanticRole.tab]),j=new Set([f.SemanticRole.tab]),b=new Set([f.SemanticRole.checkbox,f.SemanticRole.radioButton,f.SemanticRole.switchControl]),z=new Set([f.SemanticRole.button]),h=new Set([f.SemanticRole.checkbox,f.SemanticRole.textField,f.SemanticRole.radioGroup]),we=["position:absolute","width:1px","height:1px","overflow:hidden","pointer-events:none","left:-9999px"].join(";"),D=["position:absolute","pointer-events:none","box-sizing:border-box","overflow:visible","margin:0","padding:0","transform-origin: 0px 0px 0px","border:none","background:transparent","color:transparent"].join(";
20"),ge=["display:inline-block","white-space:nowrap","pointer-events:none"].join(";");function C(x,u,_){x.getAttribute(u)!==_&&x.setAttribute(u,_)}function A(x,u){x.hasAttribute(u)&&x.removeAttribute(u)}function ee(x,u,_){C(x,u,_?"true":"false")}function ye(x){switch(x){case f.SemanticRole.button:case f.SemanticRole.link:case f.SemanticRole.checkbox:case f.SemanticRole.switchControl:case f.SemanticRole.tab:case f.SemanticRole.radioButton:return!0;default:return!1}}function fe(x){switch(x){case f.SemanticRole.button:case f.SemanticRole.link:case f.SemanticRole.checkbox:case f.SemanticRole.switchControl:case f.SemanticRole.slider:case f.SemanticRole.tab:case f.SemanticRole.radioButton:case f.SemanticRole.textField:return!0;default:return!1}}function Ie(x,u){return x===f.SemanticRole.alertDialog||x===f.SemanticRole.dialog&&(0,f.hasState)(u,f.SemanticState.Modal)}function H(x){return fe(x.role)||(0,f.hasTrait)(x.traitFlags,f.SemanticTrait.Focusable)}function Q(x){switch(x){case f.SemanticRole.link:return"a";case f.SemanticRole.text:return"div";default:return"div"}}function ie(x){switch(x){case f.SemanticRole.none:return"group";case f.SemanticRole.button:return"button";case f.SemanticRole.link:return null;case f.SemanticRole.checkbox:return"checkbox";case f.SemanticRole.switchControl:return"switch";case f.SemanticRole.slider:return"slider";case f.SemanticRole.textField:return"textbox";case f.SemanticRole.image:return"img";case f.SemanticRole.group:return"group";case f.SemanticRole.list:return"list";case f.SemanticRole.listItem:return"listitem";case f.SemanticRole.tab:return"tab";case f.SemanticRole.tabList:return"tablist";case f.SemanticRole.dialog:return"dialog";case f.SemanticRole.alertDialog:return"alertdialog";case f.SemanticRole.radioGroup:return"radiogroup";case f.SemanticRole.radioButton:return"radio";case f.SemanticRole.text:return null;default:return null}}},(xe,oe,q)=>{q.r(oe),q.d(oe,{AudioAssetWrapper:()=>j.AudioAssetWrapper,AudioWrapper:()=>j.AudioWrapper,BLANK_URL:()=>J.BLANK_URL,CustomFileAssetLoaderWrapper:()=>j.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>j.FileAssetWrapper,FileFinalizer:()=>j.FileFinalizer,FocusSessionState:()=>ve.FocusSessionState,FontAssetWrapper:()=>j.FontAssetWrapper,FontWrapper:()=>j.FontWrapper,ImageAssetWrapper:()=>j.ImageAssetWrapper,ImageWrapper:()=>j.ImageWrapper,KeyboardInteractions:()=>ve.KeyboardInteractions,RiveFont:()=>b.RiveFont,createFinalization:()=>j.createFinalization,finalizationRegistry:()=>j.finalizationRegistry,registerTouchInteractions:()=>f.registerTouchInteractions,sanitizeUrl:()=>J.sanitizeUrl});var f=q(11),ve=q(12),J=q(13),j=q(14),b=q(15)},(xe,oe,q)=>{q.r(oe),q.d(oe,{registerTouchInteractions:()=>j});var f=void 0,ve=function(b,z,h){var we,D=[];if(z)for(var ge=0;ge<b.length;ge++){var C=b[ge];D.push({clientX:C.clientX,clientY:C.clientY,identifier:C.identifier})}else{var A=h!==null?(we=Array.from(b).find(function(ee){return ee.identifier===h}))!==null&&we!==void 0?we:null:b[0];A&&D.push({clientX:A.clientX,clientY:A.clientY,identifier:A.identifier})}return D},J=function(b,z,h,we){var D,ge=b;return!((D=ge.changedTouches)===null||D===void 0)&&D.length?(!z&&["touchstart","touchmove"].includes(b.type)&&b.preventDefault(),ve(ge.changedTouches,h,we)):[{clientX:b.clientX,clientY:b.clientY,identifier:0}]},j=function(b){var z=b.canvas,h=b.artboard,we=b.stateMachines,D=we===void 0?[]:we,ge=b.renderer,C=b.rive,A=b.fit,ee=b.alignment,ye=b.isTouchScrollEnabled,fe=ye===void 0?!1:ye,Ie=b.dispatchPointerExit,H=Ie===void 0?!0:Ie,Q=b.enableMultiTouch,ie=Q===void 0?!1:Q,x=b.layoutScaleFactor,u=x===void 0?1:x,_=b.advanceAndDrain;if(!z||!D.length||!ge||!C||!h||typeof window>"u")return null;var T=null,Y=!1,U=null,I=function(ae){var se;if(Y&&ae instanceof MouseEvent){ae.type=="mouseup"&&(Y=!1);return}Y=fe&&ae.type==="touchend"&&T==="touchstart",T=ae.type;var _e=ae.currentTarget.getBoundingClientRect();if(!ie&&ae.type==="touchstart"&&U===null){var ke=(se=ae.changedTouches)===null||se===void 0?void 0:se[0];ke&&(U=ke.identifier)}var be=J(ae,fe,ie,ie?null:U),Ce=C.computeAlignment(A,ee,{minX:0,minY:0,maxX:_e.width,maxY:_e.height},h.bounds,u),Pe=new C.Mat2D;switch(Ce.invert(Pe),be.forEach(function(le){var pe=le.clientX,he=le.clientY;if(!(!pe&&!he)){var De=pe-_e.left,de=he-_e.top,i=new C.Vec2D(De,de),e=C.mapXY(Pe,i),t=e.x(),a=e.y();le.transformedX=t,le.transformedY=a,e.delete(),i.delete()}}),Pe.delete(),Ce.delete(),ae.type){case"mouseout":for(var We=function(le){H?be.forEach(function(pe){le.pointerExit(pe.transformedX,pe.transformedY,pe.identifier)}):be.forEach(function(pe){le.pointerMove(pe.transformedX,pe.transformedY,pe.identifier)})},He=0,Fe=D;He<Fe.length;He++){var Ve=Fe[He];We(Ve)}break;case"touchmove":case"mouseover":case"mousemove":{for(var Ze=function(le){be.forEach(function(pe){le.pointerMove(pe.transformedX,pe.transformedY,pe.identifier)})},dt=0,at=D;dt<at.length;dt++){var Ve=at[dt];Ze(Ve)}break}case"touchstart":case"mousedown":{for(var p=function(le){be.forEach(function(pe){le.pointerDown(pe.transformedX,pe.transformedY,pe.identifier)})},k=0,R=D;k<R.length;k++){var Ve=R[k];p(Ve)}_(0);break}case"touchend":{for(var g=function(le){be.forEach(function(pe){le.pointerUp(pe.transformedX,pe.transformedY,pe.identifier),le.pointerExit(pe.transformedX,pe.transformedY,pe.identifier)})},w=0,S=D;w<S.length;w++){var Ve=S[w];g(Ve)}_(0),!ie&&be.some(function(le){return le.identifier===U})&&(U=null);break}case"mouseup":{for(var B=function(le){be.forEach(function(pe){le.pointerUp(pe.transformedX,pe.transformedY,pe.identifier)})},K=0,N=D;K<N.length;K++){var Ve=N[K];B(Ve)}_(0);break}}},P=function(){U=null},te=I.bind(f);return z.addEventListener("mouseover",te),z.addEventListener("mouseout",te),z.addEventListener("mousemove",te),z.addEventListener("mousedown",te),z.addEventListener("mouseup",te),z.addEventListener("touchmove",te,{passive:fe}),z.addEventListener("touchstart",te,{passive:fe}),z.addEventListener("touchend",te),z.addEventListener("touchcancel",P),function(){z.removeEventListener("mouseover",te),z.removeEventListener("mouseout",te),z.removeEventListener("mousemove",te),z.removeEventListener("mousedown",te),z.removeEventListener("mouseup",te),z.removeEventListener("touchmove",te),z.removeEventListener("touchstart",te),z.removeEventListener("touchend",te),z.removeEventListener("touchcancel",P)}}},(xe,oe,q)=>{q.r(oe),q.d(oe,{FocusSessionState:()=>f,KeyboardInteractions:()=>ve});var f;(function(J){J.NotFocused="notFocused",J.EntryPending="entryPending",J.RiveFocused="riveFocused"})(f||(f={}));var ve=function(){function J(j){var b=j.canvas,z=j.stateMachine,h=j.hasFocusNodes,we=j.getOverlayElement,D=this,ge;this.focusSessionState=f.NotFocused,this.canvasHasFocus=!1,this.focusDomainReleased=!1,this.currentOverlayElement=null,this.onCanvasF
20ocus=function(C){if(D.syncOverlayListener(),D.canvasHasFocus=!0,D.focusDomainReleased=!1,!!D.hasFocusNodes&&!D.mainSm.focusState().hasFocus&&(D.focusSessionState=f.EntryPending,!!D.isKeyboardDrivenFocus())){var A=D.cameFromBeforeCanvas(C.relatedTarget);(A?D.mainSm.focusNext():D.mainSm.focusPrevious())&&(D.focusSessionState=f.RiveFocused)}},this.onCanvasBlur=function(C){D.focusSessionState=f.NotFocused,D.canvasHasFocus=!1},this.onOverlayFocusIn=function(C){D.isInOverlay(C.target)&&(D.focusDomainReleased=!1)},this.onFocusDomainHostFocusIn=function(C){D.syncOverlayListener()},this.onKeyDown=function(C){if(D.syncOverlayListener(),!D.focusDomainReleased&&D.shouldRiveHandleKeyEvent(C)&&C.code==="Tab"&&D.hasFocusNodes){var A=!C.shiftKey,ee=A?D.mainSm.focusNext():D.mainSm.focusPrevious();ee?(D.focusSessionState=f.RiveFocused,C.preventDefault()):(D.focusSessionState=f.NotFocused,D.focusDomainReleased=!0,D.canvasHasFocus=!1),D.syncOverlayListener()}},this.canvas=b,this.mainSm=z,this.hasFocusNodes=h,this.getOverlayElement=we,this.focusDomainHost=(ge=b.parentElement)!==null&&ge!==void 0?ge:document,b.addEventListener("focus",this.onCanvasFocus),b.addEventListener("blur",this.onCanvasBlur),b.addEventListener("keydown",this.onKeyDown),this.focusDomainHost.addEventListener("focusin",this.onFocusDomainHostFocusIn),this.syncOverlayListener()}return J.prototype.setFocusSessionState=function(j){this.focusSessionState=j},J.prototype.notifyRiveFocused=function(){this.focusSessionState=f.RiveFocused},J.prototype.shouldRiveHandleKeyEvent=function(j){var b=this.isInFocusDomain(document.activeElement)||this.isInOverlay(j.target);if(b)return!0;var z=this.focusSessionState!==f.NotFocused,h=j.target===this.canvas;return z&&(this.canvasHasFocus||h)},J.prototype.isInFocusDomain=function(j){return j===this.canvas?!0:this.isInOverlay(j)},J.prototype.isInOverlay=function(j){var b,z,h;return j instanceof Node&&(h=(z=(b=this.getOverlayElement)===null||b===void 0?void 0:b.call(this))===null||z===void 0?void 0:z.contains(j))!==null&&h!==void 0?h:!1},J.prototype.syncOverlayListener=function(){var j,b,z,h,we,D,ge=(b=(j=this.getOverlayElement)===null||j===void 0?void 0:j.call(this))!==null&&b!==void 0?b:null;ge!==this.currentOverlayElement&&((z=this.currentOverlayElement)===null||z===void 0||z.removeEventListener("focusin",this.onOverlayFocusIn),(h=this.currentOverlayElement)===null||h===void 0||h.removeEventListener("keydown",this.onKeyDown,!0),this.currentOverlayElement=ge,(we=this.currentOverlayElement)===null||we===void 0||we.addEventListener("focusin",this.onOverlayFocusIn),(D=this.currentOverlayElement)===null||D===void 0||D.addEventListener("keydown",this.onKeyDown,!0))},J.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch{return!1}},J.prototype.cameFromBeforeCanvas=function(j){if(!j)return!0;var b=this.canvas.compareDocumentPosition(j);return b&Node.DOCUMENT_POSITION_PRECEDING?!0:!(b&Node.DOCUMENT_POSITION_FOLLOWING)},J.prototype.cleanup=function(){var j,b;this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown),this.focusDomainHost.removeEventListener("focusin",this.onFocusDomainHostFocusIn),(j=this.currentOverlayElement)===null||j===void 0||j.removeEventListener("focusin",this.onOverlayFocusIn),(b=this.currentOverlayElement)===null||b===void 0||b.removeEventListener("keydown",this.onKeyDown,!0)},J}()},(xe,oe,q)=>{q.r(oe),q.d(oe,{BLANK_URL:()=>h,sanitizeUrl:()=>ge});var f=/^([^\w]*)(javascript|data|vbscript)/im,ve=/&#(\w+)(^\w|;)?/g,J=/&(newline|tab);/gi,j=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,b=/^.+(:|:)/gim,z=[".","/"],h="about:blank";function we(C){return z.indexOf(C[0])>-1}function D(C){var A=C.replace(j,"");return A.replace(ve,function(ee,ye){return String.fromCharCode(ye)})}function ge(C){if(!C)return h;var A=D(C).replace(J,"").replace(j,"").trim();if(!A)return h;if(we(A))return A;var ee=A.match(b);if(!ee)return A;var ye=ee[0];return f.test(ye)?h:A}},(xe,oe,q)=>{q.r(oe),q.d(oe,{AudioAssetWrapper:()=>C,AudioWrapper:()=>z,CustomFileAssetLoaderWrapper:()=>we,FileAssetWrapper:()=>D,FileFinalizer:()=>ve,FontAssetWrapper:()=>A,FontWrapper:()=>h,ImageAssetWrapper:()=>ge,ImageWrapper:()=>b,createFinalization:()=>Ie,finalizationRegistry:()=>fe});
20var f=function(){var H=function(Q,ie){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,u){x.__proto__=u}||function(x,u){for(var _ in u)Object.prototype.hasOwnProperty.call(u,_)&&(x[_]=u[_])},H(Q,ie)};return function(Q,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Class extends value "+String(ie)+" is not a constructor or null");H(Q,ie);function x(){this.constructor=Q}Q.prototype=ie===null?Object.create(ie):(x.prototype=ie.prototype,new x)}}(),ve=function(){function H(Q){this.selfUnref=!1,this._file=Q}return H.prototype.unref=function(){this._file&&this._file.unref()},H}(),J=function(){function H(Q){this._finalizableObject=Q}return H.prototype.unref=function(){this._finalizableObject.unref()},H}(),j=function(){function H(){this.selfUnref=!1}return H.prototype.unref=function(){},H}(),b=function(H){f(Q,H);function Q(ie){var x=H.call(this)||this;return x._nativeImage=ie,x}return Object.defineProperty(Q.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),Q.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},Q}(j),z=function(H){f(Q,H);function Q(ie){var x=H.call(this)||this;return x._nativeAudio=ie,x}return Object.defineProperty(Q.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),Q.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},Q}(j),h=function(H){f(Q,H);function Q(ie){var x=H.call(this)||this;return x._nativeFont=ie,x}return Object.defineProperty(Q.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),Q.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},Q}(j),we=function(){function H(Q,ie){this._assetLoaderCallback=ie,this.assetLoader=new Q.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return H.prototype.loadContents=function(Q,ie){var x;if(Q.isImage)x=new ge(Q);else if(Q.isAudio)x=new C(Q);else if(Q.isFont)x=new A(Q);else return!1;return this._assetLoaderCallback(x,ie)},H}(),D=function(){function H(Q){this._nativeFileAsset=Q}return H.prototype.decode=function(Q){this._nativeFileAsset.decode(Q)},Object.defineProperty(H.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),H}(),ge=function(H){f(Q,H);function Q(){return H!==null&&H.apply(this,arguments)||this}return Q.prototype.setRenderImage=function(ie){this._nativeFileAsset.setRenderImage(ie.nativeImage)},Q}(D),C=function(H){f(Q,H);function Q(){return H!==null&&H.apply(this,arguments)||this}return Q.prototype.setAudioSource=function(ie){this._nativeFileAsset.setAudioSource(ie.nativeAudio)},Q}(D),A=function(H){f(Q,H);function Q(){return H!==null&&H.apply(this,arguments)||this}return Q.prototype.setFont=function(ie){this._nativeFileAsset.setFont(ie.nativeFont)},Q}(D),ee=function(){function H(Q){}return H.prototype.register=function(Q){Q.selfUnref=!0},H.prototype.unregister=function(Q){},H}(),ye=typeof FinalizationRegistry<"u"?FinalizationRegistry:ee,fe=new ye(function(H){H==null||H.unref()}),Ie=function(H,Q){var ie=new J(Q);fe.register(H,ie)}},(xe,oe,q)=>{q.r(oe),q.d(oe,{RiveFont:()=>ve});var f=q(3),ve=function(){function J(){}return J.setFallbackFontCallback=function(j){J._fallbackFontCallback=j??null,J._wireFallbackProc()},J._fontToPtr=function(j){var b;if(j==null)return null;var z=j.nativeFont,h=(b=z==null?void 0:z.ptr)===null||b===void 0?void 0:b.call(z);return h??null},J._getFallbackPtr=function(j,b){return b<0||b>=j.length?null:J._fontToPtr(j[b])},J._wireFallbackProc=function(){f.RuntimeLoader.getInstance(function(j){var b=J._fallbackFontCallback;b?j.setFallbackFontCallback(function(z,h,we){var D=b(z,we);return D?Array.isArray(D)?J._getFallbackPtr(D,h):h===0?J._fontToPtr(D):null:null}):j.setFallbackFontCallback(null)})},J._fallbackFontCallback=null,J}()}],rt={};function it(xe){var oe=rt[xe];if(oe!==void 0)return oe.exports;var q=rt[xe]={exports:{}};return X[xe](q,q.exports,it),q.exports}it.d=(xe,oe)=>{for(var q in oe)it.o(oe,q)&&!it.o(xe,q)&&Object.defineProperty(xe,q,{enumerable:!0,get:oe[q]})},it.o=(xe,oe)=>Object.prototype.hasOwnProperty.call(xe,oe),it.r=xe=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"}
20),Object.defineProperty(xe,"__esModule",{value:!0})};var wt={};return(()=>{it.r(wt),it.d(wt,{Alignment:()=>ge,DataEnum:()=>He,DataType:()=>Pe,DrawOptimizationOptions:()=>C,EventType:()=>u,Fit:()=>D,Layout:()=>A,LoopType:()=>_,Rive:()=>Ce,RiveEventType:()=>fe,RiveFile:()=>be,RiveFont:()=>f.RiveFont,RuntimeLoader:()=>oe.RuntimeLoader,SemanticMode:()=>q.SemanticMode,StateMachineInput:()=>ye,StateMachineInputType:()=>ee,Testing:()=>pe,ViewModel:()=>We,ViewModelInstance:()=>Ve,ViewModelInstanceArtboard:()=>K,ViewModelInstanceAssetFont:()=>B,ViewModelInstanceAssetImage:()=>S,ViewModelInstanceBoolean:()=>p,ViewModelInstanceColor:()=>w,ViewModelInstanceEnum:()=>R,ViewModelInstanceList:()=>g,ViewModelInstanceNumber:()=>at,ViewModelInstanceString:()=>dt,ViewModelInstanceTrigger:()=>k,ViewModelInstanceValue:()=>Ze,decodeAudio:()=>he,decodeFont:()=>de,decodeImage:()=>De});var xe=it(1),oe=it(3),q=it(6),f=it(10),ve=function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,l){a.__proto__=l}||function(a,l){for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(a[c]=l[c])},i(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function a(){this.constructor=e}e.prototype=t===null?Object.create(t):(a.prototype=t.prototype,new a)}}(),J=function(){return J=Object.assign||function(i){for(var e,t=1,a=arguments.length;t<a;t++){e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(i[l]=e[l])}return i},J.apply(this,arguments)},j=function(i,e,t,a){function l(c){return c instanceof t?c:new t(function(M){M(c)})}return new(t||(t=Promise))(function(c,M){function O(ce){try{$(a.next(ce))}catch(Se){M(Se)}}function Z(ce){try{$(a.throw(ce))}catch(Se){M(Se)}}function $(ce){ce.done?c(ce.value):l(ce.value).then(O,Z)}$((a=a.apply(i,e||[])).next())})},b=function(i,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,l,c,M=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return M.next=O(0),M.throw=O(1),M.return=O(2),typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function O($){return function(ce){return Z([$,ce])}}function Z($){if(a)throw new TypeError("Generator is already executing.");for(;M&&(M=0,$[0]&&(t=0)),t;)try{if(a=1,l&&(c=$[0]&2?l.return:$[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,$[1])).done)return c;switch(l=0,c&&($=[$[0]&2,c.value]),$[0]){case 0:case 1:c=$;break;case 4:return t.label++,{value:$[1],done:!1};case 5:t.label++,l=$[1],$=[0];continue;case 7:$=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&($[0]===6||$[0]===2)){t=0;continue}if($[0]===3&&(!c||$[1]>c[0]&&$[1]<c[3])){t.label=$[1];break}if($[0]===6&&t.label<c[1]){t.label=c[1],c=$;break}if(c&&t.label<c[2]){t.label=c[2],t.ops.push($);break}c[2]&&t.ops.pop(),t.trys.pop();continue}$=e.call(i,t)}catch(ce){$=[6,ce],l=0}finally{a=c=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}},z=function(i,e,t){if(t||arguments.length===2)for(var a=0,l=e.length,c;a<l;a++)(c||!(a in e))&&(c||(c=Array.prototype.slice.call(e,0,a)),c[a]=e[a]);return i.concat(c||Array.prototype.slice.call(e))},h=function(i){ve(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.isHandledError=!0,t}return e}(Error),we=function(i){return i&&i.isHandledError?i.message:"Problem loading file; may be corrupt!"},D;(function(i){i.Cover="cover",i.Contain="contain",i.Fill="fill",i.FitWidth="fitWidth",i.FitHeight="fitHeight",i.None="none",i.ScaleDown="scaleDown",i.Layout="layout"})(D||(D={}));var ge;(function(i){i.Center="center",i.TopLeft="topLeft",i.TopCenter="topCenter",i.TopRight="topRight",i.CenterLeft="centerLeft",i.CenterRight="centerRight",i.BottomLeft="bottomLeft",i.BottomCenter="bottomCenter",i.BottomRight="bottomRight"})(ge||(ge={}));var C;(function(i){i.AlwaysDraw="alwaysDraw",i.DrawOnChanged="drawOnChanged"})(C||(C={}));var A=function(){function i(e){var t,a,l,c,M,O,Z;this.fit=(t=e==null?void 0:e.fit)!==null&&t!==void 0?t:D.Contain,this.alignment=(a=e==null?void 0:e.alignment)!==null&&a!==void 0?a:ge.Center,this.layoutScaleFactor=(l=e==null?void 0:e.layoutScaleFactor)!==null&&l!==void 0?l:1,this.minX=(c=e==null?void 0:e.minX)!==null&&c!==void 0?c:0,this.minY=(M=e==null?void 0:e.minY)!==null&&M!==void 0?M:0,this.maxX=(O=e==null?void 0:e.maxX)!==null&&O!==void 0?O:0,this.maxY=(Z=e==null?void 0:e.maxY)!==null&&Z!==void 0?Z:0}return i.new=function(e){var t=e.fit,a=e.alignment,l=e.minX,c=e.minY,M=e.maxX,O=e.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new i({fit:t,alignment:a,minX:l,minY:c,maxX:M,maxY:O})},i.prototype.copyWith=function(e){var t=e.fit,a=e.alignment,l=e.layoutScaleFactor,c=e.minX,M=e.minY,O=e.maxX,Z=e.maxY;return new i({fit:t??this.fit,alignment:a??this.alignment,layoutScaleFactor:l??this.layoutScaleFactor,minX:c??this.minX,minY:M??this.minY,maxX:O??this.maxX,maxY:Z??this.maxY})},i.prototype.runtimeFit=function(e){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var t;return this.fit===D.Cover?t=e.Fit.cover:this.fit===D.Contain?t=e.Fit.contain:this.fit===D.Fill?t=e.Fit.fill:this.fit===D.FitWidth?t=e.Fit.fitWidth:this.fit===D.FitHeight?t=e.Fit.fitHeight:this.fit===D.ScaleDown?t=e.Fit.scaleDown:this.fit===D.Layout?t=e.Fit.layout:t=e.Fit.none,this.cachedRuntimeFit=t,t},i.prototype.runtimeAlignment=function(e){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var t;return this.alignment===ge.TopLeft?t=e.Alignment.topLeft:this.alignment===ge.TopCenter?t=e.Alignment.topCenter:this.alignment===ge.TopRight?t=e.Alignment.topRight:this.alignment===ge.CenterLeft?t=e.Alignment.centerLeft:this.alignment===ge.CenterRight?t=e.Alignment.centerRight:this.alignment===ge.BottomLeft?t=e.Alignment.bottomLeft:this.alignment===ge.BottomCenter?t=e.Alignment.bottomCenter:this.alignment===ge.BottomRight?t=e.Alignment.bottomRight:t=e.Alignment.center,this.cachedRuntimeAlignment=t,t},i}(),ee;(function(i){i[i.Number=56]="Number",i[i.Trigger=58]="Trigger",i[i.Boolean=59]="Boolean"})(ee||(ee={}));var ye=function(){function i(e,t){this.type=e,this.runtimeInput=t}return Object.defineProperty(i.prototype,"name",{get:function(){return this.runtimeInput.name}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(e){this.runtimeInput.value=e},enumerable:!1,configurable:!0}),i.prototype.fire=function(){this.type===ee.Trigger&&this.runtimeInput.fire()},i.prototype.delete=function(){this.runtimeInput=null},i}(),fe;(function(i){i[i.General=128]="General",i[i.OpenUrl=131]="OpenUrl"})(fe||(fe={}));var Ie=function(){function i(e){this.isBindableArtboard=!1,this.isBindableArtboard=e}return i}(),H=function(i){ve(e,i);function e(t,a){var l=i.call(this,!1)||this;return l.nativeArtboard=t,l.file=a,l}return e}(Ie),Q=function(i){ve(e,i);function e(t){var a=i.call(this,!0)||this;return a.selfUnref=!1,a.nativeArtboard=t,a}return Object.defineProperty(e.prototype,"viewModel",{set:function(t){this.nativeViewModel=t.nativeInstance},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){var t;this.selfUnref&&(this.nativeArtboard.unref(),(t=this.nativeViewModel)===null||t===void 0||t.unref())},e}(Ie),ie=function(){function i(e,t,a,l){this.stateMachine=e,this.playing=a,this.artboard=l,this.inputs=[],this.instance=new t.StateMachineInstance(e,l),this.initInputs(t)}return Object.defineProperty(i.prototype,"hasFocusNodes",{get:function(){return this.instance.hasFocusNodes()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"statesChanged",{get:function(){for(var e=[],t=0;t<this.instance.stateChangedCount();t++)e.push(this.instance.stateChangedNameByIndex(t));return e},enumerable:!1,configurable:!0}),i.prototype.advance=function(e){this.instance.advance(e)},i.prototype.advanceAndApply=function(e){this.instance.advanceAndApply(e)},i.prototype.enableSemantics=function(){this.instance.enableSemantics()},i.prototype.drainSemanticsDiff=function(){return this.instance.drainSemanticsDiff()},i.prototype.fireSemanticAction=function(e,t){this.instance.fireSemanticAction(e,t)},i.prototype.focusSemanticNode=function(e){return this.instance.focusSemanticNode(e)},i.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},i.prototype.reportedEventAt=function(e){return this.instance.reportedEventAt(e)},i.prototype.initInputs=function(e){for(var t=0;t<this.instance.inputCount();t++){var a=this.instance.input(t);this.inputs.push(this.mapRuntimeInput(a,e))}},i.prototype.mapRuntimeInput=function(e,t){if(e.type===t.SMIInput.bool)return new ye(ee.Boolean,e.asBool());if(e.type===t.SMIInput.number)return new ye(ee.Number,e.asNumber());if(e.type===t.SMIInput.trigger)return new ye(ee.Trigger,e.asTrigger())},i.prototype.cleanup=function(){this.inputs.forEach(function(e){e.delete()}),this.inputs.length=0,this.instance.delete()},i.prototype.bindViewModelInstance=function(e){e.runtimeInstance!=null&&this.instance.bindViewModelInstance(e.runtimeInstance)},i.prototype.focusState=function(){return this.instance.focusState()},i.prototype.clearFocus=function(){this.instance.clearFocus()},i}(),x=function(){function i(e,t,a,l,c){l===void 0&&(l=[]),c===void 0&&(c=[]),this.runtime=e,this.artboard=t,this.eventManager=a,this.animations=l,this.stateMachines=c}return i.prototype.add=function(e,t,a,l){if(a===void 0&&(a=!0),l===void 0&&(l=!1),e=le(e),e.length===0)this.animations.forEach(function(Ye){return Ye.playing=t}),this.stateMachines.forEach(function(Ye){return Ye.playing=t});else for(var c=this.animations.map(function(Ye){return Ye.name}),M=this.stateMachines.map(function(Ye){return Ye.name}),O=0;O<e.length;O++){var Z=c.indexOf(e[O]),$=M.indexOf(e[O]);if(Z>=0||$>=0)Z>=0?this.animations[Z].playing=t:this.stateMachines[$].playing=t;else{var ce=this.artboard.animationByName(e[O]);if(ce){var Se=new xe.Animation(ce,this.artboard,this.runtime,t);Se.advance(0),Se.apply(1),this.animations.push(Se)}else{var Qe=this.artboard.stateMachineByName(e[O]);if(Qe){var Ue=new ie(Qe,this.runtime,t,this.artboard);l&&Ue.enableSemantics(),this.stateMachines.push(Ue)}}}}return a&&(t?this.eventManager.fire({type:u.Play,data:this.playing}):this.eventManager.fire({type:u.Pause,data:this.paused})),t?this.playing:this.paused},i.prototype.initLinearAnimations=function(e,t,a){a===void 0&&(a=!1);for(var l=this.animations.map(function(ce){return ce.name}),c=0;c<e.length;c++){var M=l.indexOf(e[c]);if(M>=0)this.animations[M].playing=t;else{var O=this.artboard.animationByName(e[c]);if(O){var Z=new xe.Animation(O,this.artboard,this.runtime,t);Z.advance(0),Z.apply(1),this.animations.push(Z)}else if(a){var $="State Machine with name ".concat(e[c]," not found");throw new h($)}else console.error("Animation with name ".concat(e[c]," not found."))}}},i.prototype.initStateMachines=function(e,t,a){for(var l=this.stateMachines.map(function($){return $.name}),c=0;c<e.length;c++){var M=l.indexOf(e[c]);if(M>=0)this.stateMachines[M].playing=t;else{var O=this.artboard.stateMachineByName(e[c]);if(O){var Z=new ie(O,this.runtime,t,this.artboard);a&&Z.enableSemantics(),this.stateMachines.push(Z)}else console.warn("State Machine with name ".concat(e[c]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([e[c]],t,!0)}}},i.prototype.play=function(e){return this.add(e,!0)},i.prototype.advanceIfPaused=function(){this.stateMachines.forEac
20h(function(e){e.playing||e.advanceAndApply(0)})},i.prototype.pause=function(e){return this.add(e,!1)},i.prototype.scrub=function(e,t){var a=this.animations.filter(function(l){return e.includes(l.name)});return a.forEach(function(l){return l.scrubTo=t}),a.map(function(l){return l.name})},Object.defineProperty(i.prototype,"playing",{get:function(){return this.animations.filter(function(e){return e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"paused",{get:function(){return this.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}).concat(this.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}))},enumerable:!1,configurable:!0}),i.prototype.stop=function(e){var t=this;e=le(e);var a=[];if(e.length===0)a=this.animations.map(function(M){return M.name}).concat(this.stateMachines.map(function(M){return M.name})),this.animations.forEach(function(M){return M.cleanup()}),this.stateMachines.forEach(function(M){return M.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var l=this.animations.filter(function(M){return e.includes(M.name)});l.forEach(function(M){M.cleanup(),t.animations.splice(t.animations.indexOf(M),1)});var c=this.stateMachines.filter(function(M){return e.includes(M.name)});c.forEach(function(M){M.cleanup(),t.stateMachines.splice(t.stateMachines.indexOf(M),1)}),a=l.map(function(M){return M.name}).concat(c.map(function(M){return M.name}))}return this.eventManager.fire({type:u.Stop,data:a}),a},Object.defineProperty(i.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(e,t){return e||t.playing},!1)||this.stateMachines.reduce(function(e,t){return e||t.playing},!1)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:!1,configurable:!0}),i.prototype.atLeastOne=function(e,t,a){t===void 0&&(t=!0),a===void 0&&(a=!1);var l;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([l=this.artboard.animationByIndex(0).name],e,t):this.artboard.stateMachineCount()>0&&this.add([l=this.artboard.stateMachineByIndex(0).name],e,t,a)),l},i.prototype.handleLooping=function(){for(var e=0,t=this.animations.filter(function(l){return l.playing});e<t.length;e++){var a=t[e];a.loopValue===0&&a.loopCount?(a.loopCount=0,this.stop(a.name)):a.loopValue===1&&a.loopCount?(this.eventManager.fire({type:u.Loop,data:{animation:a.name,type:_.Loop}}),a.loopCount=0):a.loopValue===2&&a.loopCount>1&&(this.eventManager.fire({type:u.Loop,data:{animation:a.name,type:_.PingPong}}),a.loopCount=0)}},i.prototype.handleStateChanges=function(){for(var e=[],t=0,a=this.stateMachines.filter(function(c){return c.playing});t<a.length;t++){var l=a[t];e.push.apply(e,l.statesChanged)}e.length>0&&this.eventManager.fire({type:u.StateChange,data:e})},i.prototype.handleAdvancing=function(e){this.eventManager.fire({type:u.Advance,data:e})},i}(),u;(function(i){i.Load="load",i.LoadError="loaderror",i.Play="play",i.Pause="pause",i.Stop="stop",i.Loop="loop",i.Draw="draw",i.Advance="advance",i.StateChange="statechange",i.RiveEvent="riveevent",i.AudioStatusChange="audiostatuschange"})(u||(u={}));var _;(function(i){i.OneShot="oneshot",i.Loop="loop",i.PingPong="pingpong"})(_||(_={}));var T=function(){function i(e){e===void 0&&(e=[]),this.listeners=e}return i.prototype.getListeners=function(e){return this.listeners.filter(function(t){return t.type===e})},i.prototype.add=function(e){this.listeners.includes(e)||this.listeners.push(e)},i.prototype.remove=function(e){for(var t=0;t<this.listeners.length;t++){var a=this.listeners[t];if(a.type===e.type&&a.callback===e.callback){this.listeners.splice(t,1);break}}},i.prototype.removeAll=function(e){var t=this;e?this.listeners.filter(function(a){return a.type===e}
20).forEach(function(a){return t.remove(a)}):this.listeners.splice(0,this.listeners.length)},i.prototype.fire=function(e){var t=this.getListeners(e.type);t.forEach(function(a){return a.callback(e)})},i}(),Y=function(){function i(e){this.eventManager=e,this.queue=[]}return i.prototype.add=function(e){this.queue.push(e)},i.prototype.process=function(){for(;this.queue.length>0;){var e=this.queue.shift();e!=null&&e.action&&e.action(),e!=null&&e.event&&this.eventManager.fire(e.event)}},i}(),U;(function(i){i[i.AVAILABLE=0]="AVAILABLE",i[i.UNAVAILABLE=1]="UNAVAILABLE"})(U||(U={}));var I=function(i){ve(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t._started=!1,t._enabled=!1,t._status=U.UNAVAILABLE,t}return e.prototype.delay=function(t){return j(this,void 0,void 0,function(){return b(this,function(a){return[2,new Promise(function(l){return setTimeout(l,t)})]})})},e.prototype.timeout=function(){return j(this,void 0,void 0,function(){return b(this,function(t){return[2,new Promise(function(a,l){return setTimeout(l,50)})]})})},e.prototype.reportToListeners=function(){this.fire({type:u.AudioStatusChange}),this.removeAll()},e.prototype.enableAudio=function(){return j(this,void 0,void 0,function(){return b(this,function(t){return this._enabled||(this._enabled=!0,this._status=U.AVAILABLE,this.reportToListeners()),[2]})})},e.prototype.testAudio=function(){return j(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:if(!(this._status===U.UNAVAILABLE&&this._audioContext!==null))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}})})},e.prototype._establishAudio=function(){return j(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==U.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}})})},e.prototype.listenForUserAction=function(){var t=this,a=function(){return j(t,void 0,void 0,function(){return b(this,function(l){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",a,{once:!0})},e.prototype.establishAudio=function(){return j(this,void 0,void 0,function(){return b(this,function(t){return this._establishAudio(),[2]})})},Object.defineProperty(e.prototype,"systemVolume",{get:function(){return this._status===U.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),e}(T),P=new I,te=function(){function i(){}return i.prototype.observe=function(){},i.prototype.unobserve=function(){},i.prototype.disconnect=function(){},i}(),ae=globalThis.ResizeObserver||te,se=function(){function i(){var e=this;this._elementsMap=new Map,this._onObservedEntry=function(t){var a=e._elementsMap.get(t.target);a!==null?a.onResize(t.target.clientWidth==0||t.target.clientHeight==0):e._resizeObserver.unobserve(t.target)},this._onObserved=function(t){t.forEach(e._onObservedEntry)},this._resizeObserver=new ae(this._onObserved)}return i.prototype.add=function(e,t){var a={onResize:t,element:e};return this._elementsMap.set(e,a),this._resizeObserver.observe(e),a},i.prototype.remove=function(e){this._resizeObserver.unobserve(e.element),this._elementsMap.delete(e.element)},i}(),_e=new se,ke=0,be=function(){function i(e){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=e.src,this.buffer=e.buffer,e.assetLoader&&(this.assetLoader=e.assetLoader),this.enableRiveAssetCDN=typeof e.enableRiveAssetCDN=="boolean"?e.enableRiveAssetCDN:!0,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(oe.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new T,e.onLoad&&this.on(u.L
20oad,e.onLoad),e.onLoadError&&this.on(u.LoadError,e.onLoadError)}return i.prototype.releaseFile=function(){var e;this.selfUnref&&((e=this.file)===null||e===void 0||e.unref()),this.file=null},i.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(e){return e.destroy()})},i.prototype.initData=function(){return j(this,void 0,void 0,function(){var e,t,a,l,c,M;return b(this,function(O){switch(O.label){case 0:if(!(this.src&&!this.buffer))return[3,4];O.label=1;case 1:return O.trys.push([1,3,,4]),e=this,[4,N(this.src)];case 2:return e.buffer=O.sent(),[3,4];case 3:throw t=O.sent(),t instanceof Error?t:new h(i.fileLoadErrorMessage);case 4:return this.destroyed?[2]:(this.assetLoader&&(l=new f.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),a=l.assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),c=this,[4,this.runtime.load(new Uint8Array(this.buffer),a,this.enableRiveAssetCDN)]);case 5:return c.file=O.sent(),this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),M=new f.FileFinalizer(this.file),f.finalizationRegistry.register(this,M),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:u.Load,data:this}):this.fireLoadError(i.fileLoadErrorMessage),[2])}})})},i.prototype.loadRiveFileBytes=function(){return j(this,void 0,void 0,function(){var e;return b(this,function(t){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),e=this.src?N(this.src):Promise.resolve(this.buffer),this.enablePerfMarks&&this.src&&e.then(function(){performance.mark("rive:fetch-riv:end"),performance.measure("rive:fetch-riv","rive:fetch-riv:start","rive:fetch-riv:end")}),[2,e]})})},i.prototype.loadRuntime=function(){return j(this,void 0,void 0,function(){var e;return b(this,function(t){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),e=oe.RuntimeLoader.awaitInstance(),this.enablePerfMarks&&e.then(function(){performance.mark("rive:await-wasm:end"),performance.measure("rive:await-wasm","rive:await-wasm:start","rive:await-wasm:end")}),[2,e]})})},i.prototype.init=function(){return j(this,void 0,void 0,function(){var e,t,a,l;return b(this,function(c){switch(c.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(i.missingErrorMessage),[2];c.label=1;case 1:return c.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:return e=c.sent(),t=e[0],a=e[1],this.destroyed?[2]:(this.buffer=t,this.runtime=a,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()]);case 3:return c.sent(),this.enablePerfMarks&&(performance.mark("rive:init-data:end"),performance.measure("rive:init-data","rive:init-data:start","rive:init-data:end")),[3,5];case 4:return l=c.sent(),this.fireLoadError(l instanceof Error?l.message:i.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},i.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:u.LoadError,data:e}),new h(e)},i.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},i.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},i.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},i.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},i.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},i.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},i.prototype.createBindableArtboard=function(e){if(e!=null){var t=new Q(e);return(0,f.createFinalization)(t,t.nativeArtboard),this.bindableArtboards.push(t),t}return null},i.prototype.getArtboard=function(e){var t=this.file.artboardByName(e);if(t!=null)return new H(t,this)},i.prototype.getBindableArtboard=function(e){var t=this.file.bindableArtboardByName(e);return this.createBindableArtboard(t)},i.prototype.getDefaultBindableArtboard=function(){var e=this.file.bindableArtboardDefault();return this.createBindableArtboard(e)},i.prototype.internalBindableArtboardFromArtboard=function(e){var t=this.file.internalBindableArtboardFromArtboard(e);return this.createBindableArtboard(t)},i.prototype.viewModelByName=function(e){var t=this.file.viewModelByName(e);return t!==null?new We(t):null},i.prototype.globalViewModelNames=function(){return this.file.globalViewModelNames()},i.missingErrorMessage="Rive source file or data buffer required",i.fileLoadErrorMessage="The file failed to load",i}(),Ce=function(){function i(e){var t=this,a,l,c,M;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this._keyboardInteractions=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this.semanticsMode=q.SemanticMode.Disabled,this.semanticsOptions={riveCanvasLabel:"Rive animation"},this._semanticsActive=!1,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._needsRedraw=!1,this._currentCanvasWidth=0,this._currentCanvasHeight=0,this._audioEventListener=null,this._boundDraw=null,this._pageVisibilityHandler=null,this._explicitlyStoppedRendering=!1,this._viewModelInstance=null,this._globalViewModelInstances=new Map,this._dataEnums=null,this._tabIndex=null,this._prevHasFocus=!1,this._focusOptions={allowFocusInterrupt:!1},this._semanticTree=null,this._accessibilityOverlay=null,this._overlayTransformDirty=!0,this._instanceId="".concat(ke++),this.drawOptimization=C.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(O){var Z=t._hasZeroSize!==O;t._hasZeroSize=O,O?(!t._layout.maxX||!t._layout.maxY)&&t.resizeToCanvas():Z&&t.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),typeof document<"u"&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=e.canvas,e.canvas.constructor===HTMLCanvasElement&&(this._observed=_e.add(this.canvas,this.onCanvasResize)),this._currentCanvasWidth=this.canvas.width,this._currentCanvasHeight=this.canvas.height,this.src=e.src,this.buffer=e.buffer,this.riveFile=e.riveFile,this.layout=(a=e.layout)!==null&&a!==void 0?a:new A,this.shouldDisableRiveListeners=!!e.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!e.isTouchScrollEnabled,this.automaticallyHandleEvents=!!e.automaticallyHandleEvents,this.dispatchPointerExit=e.dispatchPointerExit===!1?e.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!e.enableMultiTouch,this.drawOptimization=(l=e.drawingOptions)!==null&&l!==void 0?l:this.drawOptimization,this.enableRiveAssetCDN=e.enableRiveAssetCDN===void 0?!0:e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(oe.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=(c=e.focusOptions)!==null&&c!==void 0?c:this._focusOptions,this._tabIndex=(M=e.tabIndex)!==null&&M!==void 0?M:null,this.eventManager=new T,e.onLoad&&this.on(u.L
20oad,e.onLoad),e.onLoadError&&this.on(u.LoadError,e.onLoadError),e.onPlay&&this.on(u.Play,e.onPlay),e.onPause&&this.on(u.Pause,e.onPause),e.onStop&&this.on(u.Stop,e.onStop),e.onLoop&&this.on(u.Loop,e.onLoop),e.onStateChange&&this.on(u.StateChange,e.onStateChange),e.onAdvance&&this.on(u.Advance,e.onAdvance),e.onload&&!e.onLoad&&this.on(u.Load,e.onload),e.onloaderror&&!e.onLoadError&&this.on(u.LoadError,e.onloaderror),e.onplay&&!e.onPlay&&this.on(u.Play,e.onplay),e.onpause&&!e.onPause&&this.on(u.Pause,e.onpause),e.onstop&&!e.onStop&&this.on(u.Stop,e.onstop),e.onloop&&!e.onLoop&&this.on(u.Loop,e.onloop),e.onstatechange&&!e.onStateChange&&this.on(u.StateChange,e.onstatechange),e.assetLoader&&(this.assetLoader=e.assetLoader),this.taskQueue=new Y(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:e.autoplay,autoBind:e.autoBind,animations:e.animations,stateMachines:e.stateMachines,artboard:e.artboard,useOffscreenRenderer:e.useOffscreenRenderer,tabIndex:e.tabIndex,semanticsMode:e.semanticsMode,semanticsOptions:e.semanticsOptions})}return Object.defineProperty(i.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),i.new=function(e){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new i(e)},i.prototype.enableSemantics=function(){this.semanticsMode=q.SemanticMode.Enabled,this.activateSemantics()},i.prototype.activateSemantics=function(){this._semanticsActive||this.semanticsMode===q.SemanticMode.Disabled||(this._semanticsActive=!0,this.syncSemanticsOnStateMachines())},i.prototype.syncSemanticsOnStateMachines=function(){if(!(!this._semanticsActive||!this.animator))for(var e=0,t=this.animator.stateMachines;e<t.length;e++){var a=t[e];a.enableSemantics()}},i.prototype.cleanupSemantics=function(){this._semanticTree=null,this._accessibilityOverlay&&(this._accessibilityOverlay.destroy(),this._accessibilityOverlay=null)},i.prototype.onSystemAudioChanged=function(){this.volume=this._volume},i.prototype.init=function(e){var t=this,a=e.src,l=e.buffer,c=e.riveFile,M=e.animations,O=e.stateMachines,Z=e.artboard,$=e.autoplay,ce=$===void 0?!1:$,Se=e.useOffscreenRenderer,Qe=Se===void 0?!1:Se,Ue=e.autoBind,Ye=Ue===void 0?!1:Ue,et=e.tabIndex,ut=e.semanticsMode,lt=e.semanticsOptions;if(!this.destroyed){if(this.src=a,this.buffer=l,this.riveFile=c,this._tabIndex=et??null,this.semanticsMode=ut??q.SemanticMode.Disabled,this.semanticsOptions=lt??this.semanticsOptions,!this.src&&!this.buffer&&!this.riveFile)throw new h(i.missingErrorMessage);var ct=le(M),Je=le(O);this.loaded=!1,this.readyForPlaying=!1,oe.RuntimeLoader.awaitInstance().then(function(Xe){if(!t.destroyed){t.runtime=Xe,t.removeRiveListeners(),t.cleanupSemantics(),t.deleteRiveRenderer(),t.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(t.renderer=t.runtime.makeRenderer(t.canvas,Qe),!t.renderer)throw new Error("Renderer is null, cannot render Rive on the canvas.")}catch(Ge){throw console.error(Ge),new h("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}t.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),t.canvas.width||t.canvas.height||t.resizeDrawingSurfaceToCanvas(),t.initData(Z,ct,Je,ce,Ye).then(function(Ge){if(Ge)return t.setupRiveListeners()}).catch(function(Ge){console.error(Ge)})}}).catch(function(Xe){t.eventManager.fire({type:u.LoadError,data:Xe.message})})}},i.prototype.setupRiveListeners=function(e){var t=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var a=this.animator.stateMachines.filter(function(Z){return Z.playing}),l=a.filter(function(Z){return t.runtime.hasListeners(Z.instance)}).map(function(Z){return Z.instance}),c=this.isTouchScrollEnabled,M=this.dispatchPointerExit,O=this.enableMultiTouch;e&&"isTouchScrollEnabled"in e&&(c=e.isTouchScrollEnabled),this.eventCleanup=(0,f.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:l,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:c,dispatchPointerExit:M,enableMultiTouch:O,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)}),this.ensureKeyboardInteractions()}},i.prototype.ensureKeyboardInteractions=function(){var e=this;if(!(this._keyboardInteractions||this.shouldDisableRiveListeners||typeof window>"u"||!(this.canvas instanceof HTMLCanvasElement))){var t=this.animator.stateMachines.find(function(l){return l.playing&&l.hasFocusNodes});if(t){var a=this.canvas.tabIndex;(a===-1||isNaN(a))&&(this.canvas.tabIndex=this._tabIndex!==null?this._tabIndex:0),this._keyboardInteractions=new f.KeyboardInteractions({canvas:this.canvas,stateMachine:t.instance,hasFocusNodes:!0,getOverlayElement:function(){var l,c;return(c=(l=e._accessibilityOverlay)===null||l===void 0?void 0:l.getSemanticOverlayContainer())!==null&&c!==void 0?c:null}})}}},i.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},i.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},i.prototype.initializeAudio=function(){var e=this,t;P.status==U.UNAVAILABLE&&(this.file.hasAudio||!((t=this.artboard)===null||t===void 0)&&t.hasAudio&&this._audioEventListener===null)&&(this._audioEventListener={type:u.AudioStatusChange,callback:function(){return e.onSystemAudioChanged()}},P.add(this._audioEventListener),P.establishAudio())},i.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},i.prototype.initData=function(e,t,a,l,c){return j(this,void 0,void 0,function(){var M,O,Z,$;return b(this,function(ce){switch(ce.label){case 0:return ce.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(M=new be({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks}),this.riveFile=M,[4,M.init()]);case 1:if(ce.sent(),this.destroyed)return M.destroyIfUnused(),[2,!1];ce.label=2;case 2:this.file=this.riveFile.getInstance(),this.initArtboard(e,t,a,l,c),this.initArtboardSize(),this.initializeAudio(),this.semanticsMode===q.SemanticMode.Enabled?this.activateSemantics():this._semanticsActive&&this.syncSemanticsOnStateMachines();try{this.loaded=!0,this.eventManager.fire({type:u.Load,data:($=this.src)!==null&&$!==void 0?$:"buffer"})}catch(Se){console.error(Se)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return O=ce.sent(),Z=we(O),this.eventManager.fire({type:u.LoadError,data:Z}),[2,Promise.reject(Z)];case 4:return[2]}})})},i.prototype.initArtboard=function(e,t,a,l,c){if(this.file){var M=e?this.file.artboardByName(e):this.file.defaultArtboard();if(!M)throw new h("Invalid artboard name or no default artboard");this.artboard=M,M.volume=this._volume*P.systemVolume,this.animator=new x(this.runtime,this.artboard,this.eventManager);var O;if(t.length>0||a.length>0?(O=t.concat(a),this.animator.initLinearAnimations(t,l),this.animator.initStateMachines(a,l,this._semanticsActive)):O=[this.animator.atLeastOne(l,!1,this._semanticsActive)],this.taskQueue.add({event:{type:l?u.Play:u.Pause,data:O}}),c){var Z=this.file.defaultArtboardViewModel(M);if(Z!==null){var $=Z.defaultInstance();if($!==null){var ce=new Ve($,null);(0,f.createFinalization)(ce,ce.runtimeInstance),this.setViewModelInstance(ce)}}for(var Se=0,Qe=this.file.globalViewModelNames();Se<Qe.length;Se++){var Ue=Qe[Se],Ye=this.file.viewModelByName(Ue);if(Ye!==null){var et=new We(Ye).defaultInstance();et!==null&&this.setGlobalViewModelInstance(Ue,et)}}this.bind()}}},i.prototype.drawFrame=function(){var e,t;!((e=document==null?void 0:document.timeline)===null||e===void 0)&&e.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(t=this.runtime)===null||t===void 0||t.resolveAnimationFrame()):this.scheduleRendering()},i.prototype._canvasSizeChanged=function(){var e=!1;return this.canvas&&(this.canvas.width!==this._currentCanvasWidth&&(this._currentCanvasWidth=this.canvas.width,e=!0),this.canvas.height!==this._currentCanvasHeight&&(this._currentCanvasHeight=this.canvas.height,e=!0)),e},i.prototype.pollFocusState=function(){var e,t;if(this.ensureKeyboardInteractions(),!this._keyboardInteractions){this._prevHasFocus=!1;return}var a=this.animator.stateMachines.find(function(O){return O.playing&&O.hasFocusNodes});if(!a){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){var l=a.focusState().hasFocus;if(l){if(this._keyboardInteractions.notifyRiveFocused(),!this._prevHasFocus){var c=(e=this._accessibilityOverlay)===null||e===void 0?void 0:e.getSemanticOverlayContainer(),M=document.activeElement===this.canvas||((t=c==null?void 0:c.contains(document.activeElement))!==null&&t!==void 0?t:!1);!M&&this._focusOptions.allowFocusInterrupt&&this.canvas.focus(),this._prevHasFocus=!0}return}this._prevHasFocus=!1,this._keyboardInteractions.focusSessionState===f.FocusSessionState.RiveFocused&&this._keyboardInteractions.setFocusSessionState(f.FocusSessionState.NotFocused)}},i.prototype.advanceAndReportChanges=function(e){for(var t,a,l=this.animator.animations.filter(function(qe){return qe.playing||qe.needsScrub}).sort(function(qe){return qe.needsScrub?-1:1}),c=0,M=l;c<M.length;c++){var O=M[c];O.advance(e),O.instance.didLoop&&(O.loopCount+=1),O.apply(1)}for(var Z=this.animator.stateMachines.filter(function(qe){return qe.playing}),$=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,ce=0,Se=Z;ce<Se.length;ce++){var Qe=Se[ce],Ue=Qe.reportedEventCount();if(Ue)for(var Ye=0;Ye<Ue;Ye++){var et=Qe.reportedEventAt(Ye);if(et)if(et.type===fe.OpenUrl){if(this.eventManager.fire({type:u.RiveEvent,data:et}),this.automaticallyHandleEvents){var ut=document.createElement("a"),lt=et,ct=lt.url,Je=lt.target,Xe=(0,f.sanitizeUrl)(ct);ct&&ut.setAttribute("href",Xe),Je&&ut.setAttribute("target",Je),Xe&&Xe!==f.BLANK_URL&&ut.click()}}else this.eventManager.fire({type:u.RiveEvent,data:et})}if($>=0&&performance.mark("rive:sm-advance:start:f".concat($)),Qe.advanceAndApply(e),$>=0&&(performance.mark("rive:sm-advance:end:f".concat($)),performance.measure("rive:sm-advance:f".concat($),"rive:sm-advance:start:f".concat($),"rive:sm-advance:end:f".concat($))),this._semanticsActive){var Ge=Qe.drainSemanticsDiff();Ge&&(this._semanticTree||(this._semanticTree=new q.SemanticTreeModel),this._semanticTree.applyDiff(Ge))}}if(this._semanticsActive&&this._semanticTree&&Z.length>0&&this.canvas instanceof HTMLCanvasElement){if(!this._accessibilityOverlay){var tt=Z[0];this._accessibilityOverlay=new q.AccessibilityOverlay({canvas:this.canvas,instanceId:this._instanceId,semanticsOptions:this.semanticsOptions,allowFocusInterrupt:this._focusOptions.allowFocusInterrupt,fireAction:function(qe,Xt){tt.f
20ireSemanticAction(qe,Xt)},requestFocus:function(qe){return tt.focusSemanticNode(qe)},clearFocus:function(){return tt.instance.clearFocus()}})}var nt=(t=this._accessibilityOverlay)===null||t===void 0?void 0:t.needsUpdate(this._semanticTree);if(nt||this._overlayTransformDirty){var st=null;if(nt!=null&&nt.layoutChanged||this._overlayTransformDirty){var Me=this._layout.runtimeFit(this.runtime),Pt=this._layout.runtimeAlignment(this.runtime);st=this.runtime.computeAlignment(Me,Pt,{minX:this._layout.minX,minY:this._layout.minY,maxX:this._layout.maxX,maxY:this._layout.maxY},this.artboard.bounds,this._devicePixelRatioUsed*this._layout.layoutScaleFactor),this._overlayTransformDirty=!1}this._accessibilityOverlay.update(this._semanticTree,st,this._devicePixelRatioUsed,this.artboard.bounds,nt),st==null||st.delete()}}this.animator.stateMachines.length==0&&this.artboard.advance(e),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(e),this.pollFocusState(),(a=this._viewModelInstance)===null||a===void 0||a.handleCallbacks()},i.prototype.draw=function(e,t){this.frameRequestId=null;var a=performance.now(),l=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=e),this.renderSecondTimer+=e-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,t==null||t());var c=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e,this.advanceAndReportChanges(c);var M=this.renderer;this._hasZeroSize||(this.drawOptimization==C.AlwaysDraw||this.artboard.didChange()||this._needsRedraw||this._canvasSizeChanged())&&(M.clear(),M.save(),l>=0&&performance.mark("rive:align-renderer:start:f".concat(l)),this.alignRenderer(),l>=0&&(performance.mark("rive:align-renderer:end:f".concat(l)),performance.measure("rive:align-renderer:f".concat(l),"rive:align-renderer:start:f".concat(l),"rive:align-renderer:end:f".concat(l))),l>=0&&performance.mark("rive:artboard-draw:start:f".concat(l)),this.artboard.draw(M),l>=0&&(performance.mark("rive:artboard-draw:end:f".concat(l)),performance.measure("rive:artboard-draw:f".concat(l),"rive:artboard-draw:start:f".concat(l),"rive:artboard-draw:end:f".concat(l))),M.restore(),l>=0&&performance.mark("rive:renderer-flush:start:f".concat(l)),M.flush(),l>=0&&(performance.mark("rive:renderer-flush:end:f".concat(l)),performance.measure("rive:renderer-flush:f".concat(l),"rive:renderer-flush:start:f".concat(l),"rive:renderer-flush:end:f".concat(l))),this._needsRedraw=!1),this.frameCount++;var O=performance.now();for(this.frameTimes.push(O),this.durations.push(O-a);this.frameTimes[0]<=O-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)},i.prototype.alignRenderer=function(){var e=this,t=e.renderer,a=e.runtime,l=e._layout,c=e.artboard;t.align(l.runtimeFit(a),l.runtimeAlignment(a),{minX:l.minX,minY:l.minY,maxX:l.maxX,maxY:l.maxY},c.bounds,this._devicePixelRatioUsed*l.layoutScaleFactor)},Object.defineProperty(i.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(e,t){return e+t},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),i.prototype.cleanup=function(){var e,t,a,l;this.destroyed=!0,this.stopRendering(),(t=(e=this.renderer)===null||e===void 0?void 0:e.bindContext)===null||t===void 0||t.call(e),this.cleanupInstances(),this._observed!==null&&_e.remove(this._observed),this.removeRiveListeners(),this.file&&((a=this.riveFile)===null||a===void 0||a.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(P.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),(l=this._viewModelInstance)===null||l===void 0||l.cleanup(),this._viewModelInstance=null,this._globalViewModelInstances.forEac
20h(function(c){return c.cleanup()}),this._globalViewModelInstances.clear(),this._dataEnums=null},i.prototype.deleteRiveRenderer=function(){var e;(e=this.renderer)===null||e===void 0||e.delete(),this.renderer=null},i.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},i.prototype.retrieveTextRun=function(e){var t;if(!e){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var a=this.artboard.textRun(e);if(!a){console.warn("Could not access a text run with name '".concat(e,"' in the '").concat((t=this.artboard)===null||t===void 0?void 0:t.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return a},i.prototype.getTextRunValue=function(e){var t=this.retrieveTextRun(e);return t?t.text:void 0},i.prototype.setTextRunValue=function(e,t){var a=this.retrieveTextRun(e);a&&(a.text=t)},i.prototype.play=function(e,t){var a=this;if(e=le(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return a.play(e,t)}});return}this.animator.play(e),this.syncSemanticsOnStateMachines(),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()},i.prototype.pause=function(e){var t=this;if(e=le(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return t.pause(e)}});return}this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(e)},i.prototype.scrub=function(e,t){var a=this;if(e=le(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return a.scrub(e,t)}});return}this.animator.scrub(e,t||0),this.drawFrame()},i.prototype.stop=function(e){var t=this;if(e=le(e),!this.readyForPlaying){this.taskQueue.add({action:function(){return t.stop(e)}});return}this.animator&&this.animator.stop(e),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics()},i.prototype.reset=function(e){var t,a,l=e==null?void 0:e.artboard,c=le(e==null?void 0:e.animations),M=le(e==null?void 0:e.stateMachines),O=(t=e==null?void 0:e.autoplay)!==null&&t!==void 0?t:!1,Z=(a=e==null?void 0:e.autoBind)!==null&&a!==void 0?a:!1;this.cleanupInstances(),this.initArtboard(l,c,M,O,Z),this.taskQueue.process()},i.prototype.load=function(e){this.file=null,this.stop(),this.init(e)},Object.defineProperty(i.prototype,"layout",{get:function(){return this._layout},set:function(e){this._layout=e,this._overlayTransformDirty=!0,(!e.maxX||!e.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),i.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height}),this._overlayTransformDirty=!0},i.prototype.resizeDrawingSurfaceToCanvas=function(e){if(this.canvas instanceof HTMLCanvasElement&&window){var t=this.canvas.getBoundingClientRect(),a=t.width,l=t.height,c=e||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=c,this.canvas.width=c*a,this.canvas.height=c*l,this._needsRedraw=!0,this.resizeToCanvas(),this.layout.fit===D.Layout){var M=this._layout.layoutScaleFactor;this.artboard.width=a/M,this.artboard.height=l/M}this.drawFrame()}},Object.defineProperty(i.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"semanticTree",{get:function(){return this._semanticTree},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessibilityOverlay",{get:function(){return this._accessibilityOverlay},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.animationCount();t++)e.push(this.artboard.animationByIndex(t).name);return e}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var e=[],t=0;t<this.artboard.stateMachineCount();t++)e.push(this.artboard.stateMachineByIndex(t).name);return e},enumerable:!1,configurable:!0}),i.prototype.stateMachineInputs=function(e){if(this.loaded){var t=this.animator.stateMachines.find(function(a){return a.name===e});return t==null?void 0:t.inputs}},i.prototype.retrieveInputAtPath=function(e,t){if(!e){console.warn("No input name provided for path '".concat(t,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));return}var a=this.artboard.inputByPath(e,t);if(!a){console.warn("Could not access an input with name: '".concat(e,"', at path:'").concat(t,"'"));return}return a},i.prototype.setBooleanStateAtPath=function(e,t,a){var l=this.retrieveInputAtPath(e,a);l&&(l.type===ee.Boolean?l.asBool().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(a,"' is not a boolean")))},i.prototype.setNumberStateAtPath=function(e,t,a){var l=this.retrieveInputAtPath(e,a);l&&(l.type===ee.Number?l.asNumber().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(a,"' is not a number")))},i.prototype.fireStateAtPath=function(e,t){var a=this.retrieveInputAtPath(e,t);a&&(a.type===ee.Trigger?a.asTrigger().fire():console.warn("Input with name: '".concat(e,"', at path:'").concat(t,"' is not a trigger")))},i.prototype.retrieveTextAtPath=function(e,t){if(!e){console.warn("No text name provided for path '".concat(t,"'"));return}if(!t){console.warn("No path provided for text '".concat(e,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));return}var a=this.artboard.textByPath(e,t);if(!a){console.warn("Could not access text with name: '".concat(e,"', at path:'").concat(t,"'"));return}return a},i.prototype.getTextRunValueAtPath=function(e,t){var a=this.retrieveTextAtPath(e,t);if(!a){console.warn("Could not get text with name: '".concat(e,"', at path:'").concat(t,"'"));return}return a.text},i.prototype.setTextRunValueAtPath=function(e,t,a){var l=this.retrieveTextAtPath(e,a);if(!l){console.warn("Could not set text with name: '".concat(e,"', at path:'").concat(a,"'"));return}l.text=t},Object.defineProperty(i.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(e){return!e.playing}).map(function(e){return e.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStopped",{get:function(){var e,t;return(t=(e=this.animator)===null||e===void 0?void 0:e.isStopped)!==null&&t!==void 0?t:!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),i.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},i.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},i.prototype.unsubscribe=function(e,t){console.warn("This function is deprecated: please use `off()` instead."),this.off(e,t)},i.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},i.prototype.unsubscribeAll=function(e){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(e)},i.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},i.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},i.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},i.prototype._onPageVisibilityChange=function(){var e,t;document.hidden?(this.frameRequestId!==null&&(!((e=this.runtime)===null||e===void 0)&&e.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):!((t=this.animator)===null||t===void 0)&&t.isPlaying&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},i.prototype.enableFPSCounter=function(e){this.runtime.enableFPSCounter(e)},i.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(i.prototype,"contents",{get:function(){if(this.loaded){for(var e={artboards:[]},t=0;t<this.file.artboardCount();t++){for(var a=this.file.artboardByIndex(t),l={name:a.name,animations:[],stateMachines:[]},c=0;c<a.animationCount();c++){var M=a.animationByIndex(c);l.animations.push(M.name)}for(var O=0;O<a.stateMachineCount();O++){for(var Z=a.stateMachineByIndex(O),$=Z.name,ce=new this.runtime.StateMachineInstance(Z,a),Se=[],Qe=0;Qe<ce.inputCount();Qe++){var Ue=ce.input(Qe);Se.push({name:Ue.name,type:Ue.type})}l.stateMachines.push({name:$,inputs:Se})}e.artboards.push(l)}return e}}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(e){this._volume=e,this.artboard&&(this.artboard.volume=e*P.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"artboardWidth",{get:function(){var e;return this.artboard?this.artboard.width:(e=this._artboardWidth)!==null&&e!==void 0?e:0},set:function(e){this._artboardWidth=e,this.artboard&&(this.artboard.width=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"artboardHeight",{get:function(){var e;return this.artboard?this.artboard.height:(e=this._artboardHeight)!==null&&e!==void 0?e:0},set:function(e){this._artboardHeight=e,this.artboard&&(this.artboard.height=e)},enumerable:!1,configurable:!0}),i.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(i.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(e){e!==this._devicePixelRatioUsed&&(this._overlayTransformDirty=!0),this._devicePixelRatioUsed=e},enumerable:!1,configurable:!0}),i.prototype.bindViewModelInstance=function(e){e&&(this.setViewModelInstance(e),this.bind())},i.prototype.setViewModelInstance=function(e){var t,a=e==null?void 0:e.runtimeInstance;!this.artboard||this.destroyed||!e||!a||(e.internalIncrementReferenceCount(),(t=this._viewModelInstance)===null||t===void 0||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(l){return l.instance.setViewModelInstance(a)}):this.artboard.setViewModelInstance(a))},i.prototype.bind=function(){!this.artboard||this.destroyed||(this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.bind()}):this.artboard.bind())},Object.defineProperty(i.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),i.prototype.setGlobalViewModelInstance=function(e,t){var a,l=t==null?void 0:t.runtimeInstance;if(!this.artboard||this.destroyed||!l)return!1;var c=!1;return this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(M){M.instance.setGlobalViewModelInstance(e,l)&&(c=!0)}):c=this.artboard.setGlobalViewModelInstance(e,l),c&&(t.internalIncrementReferenceCount(),(a=this._globalViewModelInstances.get(e))===null||a===void 0||a.cleanup(),this._globalViewModelInstances.set(e,t)),c},i.prototype.globalViewModelInstance=function(e){var t=this._globalViewModelInstances.get(e);if(t)return t;if(!this.artboard||this.destroyed)return null;var a=this.animator.stateMachines.length>0?this.animator.stateMachines[0].instance.globalViewModelInstance(e):this.artboard.globalViewModelInstance(e);if(a===null)return null;var l=new Ve(a,null);return(0,f.createFinalization)(l,a),l.internalIncrementReferenceCount(),this._globalViewModelInstances.set(e,l),l},i.prototype.globalViewModelNames=function(){var e,t;return(t=(e=this.file)===null||e===void 0?void 0:e.globalViewModelNames())!==null&&t!==void 0?t:[]},i.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return t!==null?new We(t):null},i.prototype.viewModelByName=function(e){var t;return(t=this.riveFile)===null||t===void 0?void 0:t.viewModelByName(e)},i.prototype.enums=function(){if(this._dataEnums===null){var e=this.file.enums();this._dataEnums=e.map(function(t){return new He(t)})}return this._dataEnums},i.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new We(e)}return null},i.prototype.getArtboard=function(e){var t,a;return(a=(t=this.riveFile)===null||t===void 0?void 0:t.getArtboard(e))!==null&&a!==void 0?a:null},i.prototype.getBindableArtboard=function(e){var t,a;return(a=(t=this.riveFile)===null||t===void 0?void 0:t.getBindableArtboard(e))!==null&&a!==void 0?a:null},i.prototype.getDefaultBindableArtboard=function(){var e,t;return(t=(e=this.riveFile)===null||e===void 0?void 0:e.getDefaultBindableArtboard())!==null&&t!==void 0?t:null},i.prototype.clearFocus=function(){var e=this.animator.stateMachines.filter(function(t){return t.playing&&t.hasFocusNodes});e.forEach(function(t){return t.clearFocus()})},i.missingErrorMessage="Rive source file or data buffer required",i.cleanupErrorMessage="Attempt to use file after calling cleanup.",i}(),Pe;(function(i){i.none="none",i.string="string",i.number="number",i.boolean="boolean",i.color="color",i.list="list",i.enumType="enumType",i.trigger="trigger",i.viewModel="viewModel",i.integer="integer",i.listIndex="listIndex",i.image="image",i.artboard="artboard"})(Pe||(Pe={}));var We=function(){function i(e){this._viewModel=e}return Object.defineProperty(i.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),i.prototype.instanceByIndex=function(e){var t=this._viewModel.instanceByIndex(e);if(t!==null){var a=new Ve(t,null);return(0,f.createFinalization)(a,t),a}return null},i.prototype.instanceByName=function(e){var t=this._viewModel.instanceByName(e);if(t!==null){var a=new Ve(t,null);return(0,f.createFinalization)(a,t),a}return null},i.prototype.defaultInstance=function(){var e=this._viewModel.defaultInstance();if(e!==null){var t=new Ve(e,null);return(0,f.createFinalization)(t,e),t}return null},i.prototype.instance=function(){var e=this._viewModel.instance();if(e!==null){var t=new Ve(e,null);return(0,f.createFinalization)(t,e),t}return null},Object.defineProperty(i.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),i}(),He=function(){function i(e){this._dataEnum=e}return Object.defineProperty(i.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),i}(),Fe;(function(i){i.Number="number",i.String="string",i.Boolean="boolean",i.Color="color",i.Trigger="trigger",i.Enum="enum",i.List="list",i.Image="image",i.Font="font",i.Artboard="artboard"})(Fe||(Fe={}));var Ve=function(){function i(e,t){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=e,t!==null&&this._parents.push(t)}return Object.defineProperty(i.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),i.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(e){e.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(e){e.clearChanges()})),this._children.forEach(function(e){return e.handleCallbacks()})},i.prototype.addParent=function(e){this._parents.includes(e)||(this._parents.push(e),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&e.addToViewModelCallbacks(this))},i.prototype.removeParent=function(e){var t=this._parents.indexOf(e);if(t!==-1){var a=this._parents[t];a.removeFromViewModelCallbacks(this),this._parents.splice(t,1)}},i.prototype.addToPropertyCallbacks=function(e){var t=this;this._propertiesWithCallbacks.includes(e)||(this._propertiesWithCallbacks.push(e),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(a){a.addToViewModelCallbacks(t)}))},i.prototype.removeFromPropertyCallbacks=function(e){var t=this;this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(a){return a!==e}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(a){a.removeFromViewModelCallbacks(t)}))},i.prototype.addToViewModelCallbacks=function(e){var t=this;this._children.includes(e)||(this._children.push(e),this._parents.forEach(function(a){a.addToViewModelCallbacks(t)}))},i.prototype.removeFromViewModelCallbacks=function(e){var t=this;this._children.includes(e)&&(this._children=this._children.filter(function(a){return a!==e}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(a){a.removeFromViewModelCallbacks(t)}))},i.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(e){e.clearCallbacks()})},i.prototype.propertyFromPath=function(e,t){var a=e.split("/");return this.propertyFromPathSegments(a,0,t)},i.prototype.viewModelFromPathSegments=function(e,t){var a=this.internalViewModelInstance(e[t]);return a!==null?t==e.length-1?a:a.viewModelFromPathSegments(e,t++):null},i.prototype.propertyFromPathSegments=function(e,t,a){var l,c,M,O,Z,$,ce,Se,Qe,Ue,Ye,et,ut,lt,ct,Je,Xe,Ge,tt,nt;
20if(t<e.length-1){var st=this.internalViewModelInstance(e[t]);return st!==null?st.propertyFromPathSegments(e,t+1,a):null}var Me=null;switch(a){case Fe.Number:if(Me=(c=(l=this._runtimeInstance)===null||l===void 0?void 0:l.number(e[t]))!==null&&c!==void 0?c:null,Me!==null)return new at(Me,this);break;case Fe.String:if(Me=(O=(M=this._runtimeInstance)===null||M===void 0?void 0:M.string(e[t]))!==null&&O!==void 0?O:null,Me!==null)return new dt(Me,this);break;case Fe.Boolean:if(Me=($=(Z=this._runtimeInstance)===null||Z===void 0?void 0:Z.boolean(e[t]))!==null&&$!==void 0?$:null,Me!==null)return new p(Me,this);break;case Fe.Color:if(Me=(Se=(ce=this._runtimeInstance)===null||ce===void 0?void 0:ce.color(e[t]))!==null&&Se!==void 0?Se:null,Me!==null)return new w(Me,this);break;case Fe.Trigger:if(Me=(Ue=(Qe=this._runtimeInstance)===null||Qe===void 0?void 0:Qe.trigger(e[t]))!==null&&Ue!==void 0?Ue:null,Me!==null)return new k(Me,this);break;case Fe.Enum:if(Me=(et=(Ye=this._runtimeInstance)===null||Ye===void 0?void 0:Ye.enum(e[t]))!==null&&et!==void 0?et:null,Me!==null)return new R(Me,this);break;case Fe.List:if(Me=(lt=(ut=this._runtimeInstance)===null||ut===void 0?void 0:ut.list(e[t]))!==null&<!==void 0?lt:null,Me!==null)return new g(Me,this);break;case Fe.Image:if(Me=(Je=(ct=this._runtimeInstance)===null||ct===void 0?void 0:ct.image(e[t]))!==null&&Je!==void 0?Je:null,Me!==null)return new S(Me,this);break;case Fe.Font:if(Me=(Ge=(Xe=this._runtimeInstance)===null||Xe===void 0?void 0:Xe.font(e[t]))!==null&&Ge!==void 0?Ge:null,Me!==null)return new B(Me,this);break;case Fe.Artboard:if(Me=(nt=(tt=this._runtimeInstance)===null||tt===void 0?void 0:tt.artboard(e[t]))!==null&&nt!==void 0?nt:null,Me!==null)return new K(Me,this);break}return null},i.prototype.internalViewModelInstance=function(e){var t;if(this._viewModelInstances.has(e))return this._viewModelInstances.get(e);var a=(t=this._runtimeInstance)===null||t===void 0?void 0:t.viewModel(e);if(a!==null){var l=new i(a,this);return(0,f.createFinalization)(l,a),l.internalIncrementReferenceCount(),this._viewModelInstances.set(e,l),l}return null},i.prototype.number=function(e){var t=this.propertyFromPath(e,Fe.Number);return t},i.prototype.string=function(e){var t=this.propertyFromPath(e,Fe.String);return t},i.prototype.boolean=function(e){var t=this.propertyFromPath(e,Fe.Boolean);return t},i.prototype.color=function(e){var t=this.propertyFromPath(e,Fe.Color);return t},i.prototype.trigger=function(e){var t=this.propertyFromPath(e,Fe.Trigger);return t},i.prototype.enum=function(e){var t=this.propertyFromPath(e,Fe.Enum);return t},i.prototype.list=function(e){var t=this.propertyFromPath(e,Fe.List);return t},i.prototype.image=function(e){var t=this.propertyFromPath(e,Fe.Image);return t},i.prototype.font=function(e){var t=this.propertyFromPath(e,Fe.Font);return t},i.prototype.artboard=function(e){var t=this.propertyFromPath(e,Fe.Artboard);return t},i.prototype.viewModel=function(e){var t=e.split("/"),a=t.length>1?this.viewModelFromPathSegments(t.slice(0,t.length-1),0):this;return a!=null?a.internalViewModelInstance(t[t.length-1]):null},i.prototype.internalReplaceViewModel=function(e,t){var a;if(t.runtimeInstance!==null){var l=((a=this._runtimeInstance)===null||a===void 0?void 0:a.replaceViewModel(e,t.runtimeInstance))||!1;if(l){t.internalIncrementReferenceCount();var c=this.internalViewModelInstance(e);c!==null&&(c.removeParent(this),this._children.includes(c)&&(this._children=this._children.filter(function(M){return M!==c})),c.cleanup()),this._viewModelInstances.set(e,t),t.addParent(this)}return l}return!1},i.prototype.replaceViewModel=function(e,t){var a,l=e.split("/"),c=l.length>1?this.viewModelFromPathSegments(l.slice(0,l.length-1),0):this;return(a=c==null?void 0:c.internalReplaceViewModel(l[l.length-1],t))!==null&&a!==void 0?a:!1},i.prototype.incrementReferenceCount=function(){var e;this._referenceCount++,(e=this._runtimeInstance)===null||e===void 0||e.incrementReferenceCount()},i.prototype.decrementReferenceCount=function(){var e;this._referenceCount--,(e=this._runtimeInstance)===null||e===void 0||e.decrementReferenceCount()},Object.defineProperty(i.prototype,"properties",{get:function(){var e;return((e=this._runtimeInstance)===null||e===void 0?void 0:e.getProperties().map(function(t){return J({},t)}))||[]}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"viewModelName",{get:function(){var e,t;return(t=(e=this._runtimeInstance)===null||e===void 0?void 0:e.getViewModelName())!==null&&t!==void 0?t:""},enumerable:!1,configurable:!0}),i.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},i.prototype.cleanup=function(){var e=this,t;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((t=this._runtimeInstance)===null||t===void 0||t.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(c){c.cleanup()}),this._viewModelInstances.clear();var a=z([],this._children,!0);this._children.length=0;var l=z([],this._parents,!0);this._parents.length=0,a.forEach(function(c){c.removeParent(e)}),l.forEach(function(c){c.removeFromViewModelCallbacks(e)})}},i}(),Ze=function(){function i(e,t){this.callbacks=[],this._viewModelInstanceValue=e,this._parentViewModel=t}return i.prototype.on=function(e){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(e)||(this.callbacks.push(e),this._parentViewModel.addToPropertyCallbacks(this))},i.prototype.off=function(e){e?this.callbacks=this.callbacks.filter(function(t){return t!==e}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this)},i.prototype.internalHandleCallback=function(e){},i.prototype.handleCallbacks=function(){var e=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(t){e.internalHandleCallback(t)})},i.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},i.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(i.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),i}(),dt=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t(this.value)},e}(Ze),at=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t(this.value)},e}(Ze),p=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t(this.value)},e}(Ze),k=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return e.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},e.prototype.internalHandleCallback=function(t){t()},e}(Ze),R=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(t){this._viewModelInstanceValue.valueIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t(this.value)},e}(Ze),g=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),e.prototype.addInstance=function(t){t.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(t.runtimeInstance),t.addParent(this._parentViewModel))},e.prototype.addInstanceAt=function(t,a){return t.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(t.runtimeInstance,a)?(t.addParent(this._parentViewModel),!0):!1},e.prototype.removeInstance=function(t){t.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(t.runtimeInstance),t.removeParent(this._parentViewModel))},e.prototype.removeInstanceAt=function(t){this._viewModelInstanceValue.removeInstanceAt(t)},e.prototype.instanceAt=function(t){var a=this._viewModelInstanceValue.instanceAt(t);if(a!=null){var l=new Ve(a,this._parentViewModel);return(0,f.createFinalization)(l,a),l}return null},e.prototype.swap=function(t,a){this._viewModelInstanceValue.swap(t,a)},e.prototype.internalHandleCallback=function(t){t()},e}(Ze),w=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(t){this._viewModelInstanceValue.value=t}
20,enumerable:!1,configurable:!0}),e.prototype.rgb=function(t,a,l){this._viewModelInstanceValue.rgb(t,a,l)},e.prototype.rgba=function(t,a,l,c){this._viewModelInstanceValue.argb(c,t,a,l)},e.prototype.argb=function(t,a,l,c){this._viewModelInstanceValue.argb(t,a,l,c)},e.prototype.alpha=function(t){this._viewModelInstanceValue.alpha(t)},e.prototype.opacity=function(t){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,t))*255))},e.prototype.internalHandleCallback=function(t){t(this.value)},e}(Ze),S=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{set:function(t){var a;this._viewModelInstanceValue.value((a=t==null?void 0:t.nativeImage)!==null&&a!==void 0?a:null)},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t()},e}(Ze),B=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{set:function(t){var a;this._viewModelInstanceValue.value((a=t==null?void 0:t.nativeFont)!==null&&a!==void 0?a:null)},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t()},e}(Ze),K=function(i){ve(e,i);function e(t,a){return i.call(this,t,a)||this}return Object.defineProperty(e.prototype,"value",{set:function(t){var a,l,c;t.isBindableArtboard?c=t:c=t.file.internalBindableArtboardFromArtboard(t.nativeArtboard),this._viewModelInstanceValue.value((a=c==null?void 0:c.nativeArtboard)!==null&&a!==void 0?a:null),c!=null&&c.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((l=c==null?void 0:c.nativeViewModel)!==null&&l!==void 0?l:null)},enumerable:!1,configurable:!0}),e.prototype.internalHandleCallback=function(t){t()},e}(Ze),N=function(i){return j(void 0,void 0,void 0,function(){var e,t,a;return b(this,function(l){switch(l.label){case 0:return e=new Request(i),[4,fetch(e)];case 1:if(t=l.sent(),!t.ok)throw new Error("Failed to fetch the Rive file: HTTP ".concat(t.status));return[4,t.arrayBuffer()];case 2:return a=l.sent(),[2,a]}})})},le=function(i){return typeof i=="string"?[i]:i instanceof Array?i:[]},pe={EventManager:T,TaskQueueManager:Y},he=function(i){return j(void 0,void 0,void 0,function(){var e,t,a;return b(this,function(l){switch(l.label){case 0:return e=new Promise(function(c){return oe.RuntimeLoader.getInstance(function(M){M.decodeAudio(i,c)})}),[4,e];case 1:return t=l.sent(),a=new f.AudioWrapper(t),f.finalizationRegistry.register(a,t),[2,a]}})})},De=function(i){return j(void 0,void 0,void 0,function(){var e,t,a;return b(this,function(l){switch(l.label){case 0:return e=new Promise(function(c){return oe.RuntimeLoader.getInstance(function(M){M.decodeImage(i,c)})}),[4,e];case 1:return t=l.sent(),a=new f.ImageWrapper(t),f.finalizationRegistry.register(a,t),[2,a]}})})},de=function(i){return j(void 0,void 0,void 0,function(){var e,t,a;return b(this,function(l){switch(l.label){case 0:return e=new Promise(function(c){return oe.RuntimeLoader.getInstance(function(M){M.decodeFont(i,c)})}),[4,e];case 1:return t=l.sent(),a=new f.FontWrapper(t),f.finalizationRegistry.register(a,t),[2,a]}})})}})(),wt})())})(Sn);var lr=Sn.exports;(function(ze){Object.defineProperty(ze,"__esModule",{value:!0});var bt,X=kt,rt=lr;function it(p){return p&&typeof p=="object"&&"default"in p?p:{default:p}}var wt=it(X);function xe(p){var k=p||oe(),R=X.useState(k),g=R[0],w=R[1];return X.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var S=function(){w(p||oe())},B=window.matchMedia("screen and (resolution: "+g+"dppx)");return B.hasOwnProperty("addEventListener")?B.addEventListener("change",S):B.addListener(S),function(){B.hasOwnProperty("removeEventListener")?B.removeEventListener("change",S):B.removeListener(S)}}},[g,p]),g}function oe(){return Math.min(Math.max(1,"u">typeof window&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:1),3)}var q=function(){function p(){}var k=p.prototype;return k.observe=function(){},k.unobserve=function(){},k.disconnect=function(){},p}();function f(p,k){var R=0;return function(){for(var g=this,w=arguments.length,S=Array(w),B=0;B<w;B++)S[B]=arguments[B];clearTimeout(R),R=window.setTimeout(function(){return p.apply(g,S)},k)}}var ve=globalThis.ResizeObserver||q,J=globalThis.ResizeObserver!==void 0,j=J,b=!j;function z(p,k){k===void 0&&(k=!0);var R=X.useState({width:0,height:0}
20),g=R[0],w=R[1];X.useEffect(function(){if("u">typeof window&&k){var B=function(){w({width:window.innerWidth,height:window.innerHeight})};return b&&(B(),window.addEventListener("resize",B)),function(){return window.removeEventListener("resize",B)}}},[]);var S=X.useRef(new ve(f(function(B){j&&w({width:B[B.length-1].contentRect.width,height:B[B.length-1].contentRect.height})},0)));return X.useEffect(function(){var B=S.current;if(!k)return void B.disconnect();var K=p.current;return p.current&&j&&B.observe(p.current),function(){B.disconnect(),K&&j&&B.unobserve(K)}},[p,S]),g}var h={useDevicePixelRatio:!0,fitCanvasToArtboardHeight:!1,useOffscreenRenderer:!0,shouldResizeCanvasToContainer:!0};function we(p){return Object.assign({},h,p)}function D(p){var k=p.riveLoaded,R=k!==void 0&&k,g=p.canvasElem,w=p.containerRef,S=p.options,B=p.onCanvasHasResized,K=p.artboardBounds,N=we(S===void 0?{}:S),le=X.useState({height:0,width:0}),pe=le[0],he=pe.height,De=pe.width,de=le[1],i=X.useState({height:0,width:0}),e=i[0],t=e.height,a=e.width,l=i[1],c=X.useState(!0),M=c[0],O=c[1],Z=N.fitCanvasToArtboardHeight,$=N.shouldResizeCanvasToContainer,ce=N.useDevicePixelRatio,Se=N.customDevicePixelRatio,Qe=z(w,$),Ue=xe(Se),Ye=K??{},et=Ye.maxX,ut=Ye.maxY,lt=X.useCallback(function(){var ct,Je,Xe,Ge,tt=(ct=(Xe=w.current)==null?void 0:Xe.clientWidth)!=null?ct:0,nt=(Je=(Ge=w.current)==null?void 0:Ge.clientHeight)!=null?Je:0;return Z&&K?{width:tt,height:K.maxY/K.maxX*tt}:{width:tt,height:nt}},[w,Z,et,ut]);X.useEffect(function(){if($&&w.current&&R){var ct=lt(),Je=ct.width,Xe=ct.height,Ge=!1;if(g){var tt=Je!==De||Xe!==he;if(N.fitCanvasToArtboardHeight&&tt&&(w.current.style.height=Xe+"px",Ge=!0),N.useDevicePixelRatio){var nt=Je*Ue!==a||Xe*Ue!==t;if(tt||nt){var st=Ue*Je,Me=Ue*Xe;g.width=st,g.height=Me,g.style.width=Je+"px",g.style.height=Xe+"px",l({width:st,height:Me}),Ge=!0}}else tt&&(g.width=Je,g.height=Xe,l({width:Je,height:Xe}),Ge=!0);de({width:Je,height:Xe})}B&&(M||Ge)&&B&&B(),M&&O(!1)}},[g,w,Qe,Ue,lt,M,O,t,a,he,De,B,$,Z,ce,R]),X.useEffect(function(){l({width:0,height:0})},[g])}var ge=function(){function p(){}var k=p.prototype;return k.observe=function(){},k.unobserve=function(){},k.disconnect=function(){},p}(),C=globalThis.IntersectionObserver||ge,A=function(){function p(){var R=this;this.elementsMap=new Map,this.onObserved=function(g){g.forEach(function(w){var S=R.elementsMap.get(w.target);S&&S(w)})},this.observer=new C(this.onObserved)}var k=p.prototype;return k.registerCallback=function(R,g){this.observer.observe(R),this.elementsMap.set(R,g)},k.removeCallback=function(R){this.observer.unobserve(R),this.elementsMap.delete(R)},p}(),ee=function(){return bt||(bt=new A),bt};function ye(){return{observe:X.useCallback(function(p,k){ee().registerCallback(p,k)},[]),unobserve:X.useCallback(function(p){ee().removeCallback(p)},[])}}function fe(){return(fe=Object.assign||function(p){for(var k=1;k<arguments.length;k++){var R=arguments[k];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(p[g]=R[g])}return p}).apply(this,arguments)}function Ie(p,k){if(p==null)return{};var R,g,w={},S=Object.getOwnPropertyNames(p);for(g=0;g<S.length;g++)R=S[g],!(k.indexOf(R)>=0)&&Object.prototype.propertyIsEnumerable.call(p,R)&&(w[R]=p[R]);return w}function H(p){var k=p.setContainerRef,R=p.setCanvasRef,g=p.className,w=g===void 0?"":g,S=p.style,B=p.children,K=Ie(p,["setContainerRef","setCanvasRef","className","style","children"]),N=fe({width:"100%",height:"100%"},S);return wt.default.createElement("div",fe({ref:k,className:w},!w&&{style:N}),wt.default.createElement("canvas",fe({ref:R,style:{verticalAlign:"top",width:0,height:0}},K),B))}function Q(p,k){k===void 0&&(k={});var R=X.useState(null),g=R[0],w=R[1],S=X.useRef(null),B=X.useRef(null),K=X.useState(null),N=K[0],le=K[1],pe=!!p,he=we(k),De=xe(),de=X.useCallback(function(){if(N){if(N.layout&&N.layout.fit===rt.Fit.Layout&&g){var O=De*N.layout.layoutScaleFactor;N.devicePixelRatioUsed=De,N.artboardWidth=(g==null?void 0:g.width)/O,N.artboardHeight=(g==null?void 0:g.height)/O}N.startRendering(),N.resizeToCanvas()}},[N,De]);D({riveLoaded:!!N,canvasElem:g,containerRef:S,options:he,onCanvasHasResized:de,artboardBounds:N==null?void 0:N.bounds});var i=X.useCallback(function(O){O===null&&g&&(g.height=0,g.width=0),w(O)},[]);X.useEffect(function(){if(g&&p){var O,Z=N!=null;if(N==null){var $=he.useOffscreenRenderer,ce=p.onRiveReady,Se=Ie(p,["onRiveReady"]);O=new rt.Rive(fe({useOffscreenRenderer:$},Se,{canvas:g})),B.current!=null&&B.current.cleanup(),B.current=O,O.on(rt.EventType.Load,function(){Z=!0,ce&&ce(O),g?le(O):O.cleanup()})}return function(){Z||O==null||O.cleanup()}}},[g,pe,N]);var e=X.useCallback(function(O){S.current=O},[]),t=ye(),a=t.observe,l=t.unobserve;X.useEffect(function(){var O,Z=!1,$=function(){if(g&&Z){var ce=g.getBoundingClientRect();ce.width>0&&ce.height>0&&ce.top<(window.innerHeight||document.documentElement.clientHeight)&&ce.bottom>0&&ce.left<(window.innerWidth||document.documentElement.clientWidth)&&ce.right>0&&(N==null||N.startRendering(),Z=!1)}};return g&&he.shouldUseIntersectionObserver!==!1&&a(g,function(ce){ce.isIntersecting?N&&N.startRendering():N&&N.stopRendering(),Z=!ce.isIntersecting,clearTimeout(O),ce.isIntersecting||ce.boundingClientRect.width!==0||(O=setTimeout($,10))}),function(){g&&l(g)}},[a,l,N,g,he.shouldUseIntersectionObserver]),X.useEffect(function(){return function(){N&&(N.cleanup(),le(null))}},[N,g]),X.useEffect(function(){return function(){B.current!=null&&B.current.cleanup()}},[]);var c=p==null?void 0:p.animations;X.useEffect(function(){N&&c&&(N.isPlaying?(N.stop(N.animationNames),N.play(c)):N.isPaused&&(N.stop(N.animationNames),N.pause(c)))},[c,N]);var M=X.useCallback(function(O){return wt.default.createElement(H,fe({setContainerRef:e,setCanvasRef:i},O))},[i,e]);return{canvas:g,container:S.current,setCanvasRef:i,setContainerRef:e,rive:N,RiveComponent:M}}function ie(p,k){if(p==null)return{};var R,g,w={},S=Object.getOwnPropertyNames(p);for(g=0;g<S.length;g++)R=S[g],!(k.indexOf(R)>=0)&&Object.prototype.propertyIsEnumerable.call(p,R)&&(w[R]=p[R]);return w}var x=function(p){var k=p.src,R=p.artboard,g=p.animations,w=p.stateMachines,S=p.layout,B=p.useOffscreenRenderer,K=p.shouldDisableRiveListeners,N=p.shouldResizeCanvasToContainer,le=p.automaticallyHandleEvents,pe=p.children,he=ie(p,["src","artboard","animations","stateMachines","layout","useOffscreenRenderer","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),De=Q({src:k,artboard:R,animations:g,layout:S,stateMachines:w,autoplay:!0,shouldDisableRiveListeners:K!==void 0&&K,automaticallyHandleEvents:le!==void 0&&le},{useOffscreenRenderer:B===void 0||B,shouldResizeCanvasToContainer:N===void 0||N}).RiveComponent;return wt.default.createElement(De,he,pe)};function u(p,k,R,g){var w=X.useState(null),S=w[0],B=w[1];return X.useEffect(function(){var K=function(){if(p&&k&&R||B(null),p&&k&&R){var N=p.stateMachineInputs(k);if(N){var le=N.find(function(pe){return pe.name===R});g!==void 0&&le&&(le.value=g),B(le||null)}}else B(null)};K(),p&&p.on(rt.EventType.Load,function(){K()})},[p]),S}function _(p,k){var R=k??{},g=R.name,w=R.useDefault,S=X.useState(null),B=S[0],K=S[1];return X.useEffect(function(){var N=function(){if(!p)return void K(null);K(g!=null?(p.viewModelByName==null?void 0:p.viewModelByName.call(p,g))||null:p.defaultViewModel()||null)};return N(),p&&p.on(rt.EventType.Load,N),function(){p&&p.off(rt.EventType.Load,N)}},[p,g,w!==void 0&&w]),B}var T=new WeakSet;function Y(p){T.has(p)||(T.add(p),queueMicrotask(function(){T.delete(p),p.bind()}))}function U(p,k){var R=k.name,g=k.useNew,w=k.instance;return w!==void 0?w:p?R!=null?p.instanceByName(R)||null:g?(p.instance==null?void 0:p.instance.call(p))||null:(p.defaultInstance==null?void 0:p.defaultInstance.call(p))||null:null}function I(p,k){var R=k??{},g=R.name,w=R.useDefault,S=R.useNew,B=S!==void 0&&S,K=R.rive,N=X.useState(null),le=N[0],pe=N[1];return X.useEffect(function(){if(!p)return void pe(null);var he=U(p,{name:g,useNew:B});pe(he),K&&he&&K.viewModelInstance!==he&&(K.setViewModelInstance(he),Y(K))},[p,g,w!==void 0&&w,B,K]),le}function P(p,k,R){var g=R??{},w=g.instanceName,S=g.useNew,B=S!==void 0&&S,K=g.instance,N=g.rive,le=X.useState(null),pe=le[0],he=le[1];return X.useEffect(function(){var De=U(p,{name:w,useNew:B,instance:K});he(De),N&&k&&De&&N.setGlobalViewModelInstance(k,De)&&Y(N)},[p,k,w,B,K,N]),pe}function te(){return(te=Object.assign||function(p){for(var k=1;k<arguments.length;k++){var R=arguments[k];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(p[g]=R[g])}return p}).apply(this,arguments)}function ae(p,k,R){var g=X.useState(null),w=g[0],S=g[1],B=X.useState(R.defaultValue),K=B[0],N=B[1],le=X.useState(null),pe=le[0],he=le[1],De=X.useRef(null),de=X.useRef(p),i=X.useRef(R);X.useEffect(function(){i.current=R},[R]);var e=X.useCallback(function(){var c=De.current,M=de.current,O=i.current;if(!c||!M)return S(null),N(O.defaultValue),he(null),function(){};var Z=O.getProperty(c,M);if(Z){S(Z),N(O.getValue(Z)),O.getExtendedData&&he(O.getExtendedData(Z));var $=function(){N(O.getValue(Z)),O.getExtendedData&&he(O.getExtendedData(Z)),O.onPropertyEvent&&O.onPropertyEvent()};return Z.on($),function(){Z.off($)}}return function(){}},[]);X.useEffect(function(){return De.current=k,de.current=p,e()},[k,p,e]);var t=X.useCallback(function(c){if(w&&De.current===k)try{c(w),i.current.getExtendedData&&he(i.current.getExtendedData(w));return}catch{}if(De.current)try{var M=i.current.getProperty(De.current,de.current);M&&(S(M),c(M),i.current.getExtendedData&&he(i.current.getExtendedData(M)))}catch{}},[w,k]),a=X.useMemo(function(){return i.current.buildPropertyOperations(t)},[t]),l=te({value:K},a);return R.getExtendedData&&(l.extendedData=pe),l}function se(p,k){var R=ae(p,k,{getProperty:X.useCallback(function(g,w){return g.number(w)},[]),getValue:X.useCallback(function(g){return g.value},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(g){return{setValue:function(w){g(function(S){S.value=w})}}},[])});return{value:R.value,setValue:R.setValue}}function _e(p,k){var R=ae(p,k,{getProperty:X.useCallback(function(g,w){return g.string(w)},[]),getValue:X.useCallback(function(g){return g.value},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(g){return{setValue:function(w){g(function(S){S.value=w})}}},[])});return{value:R.value,setValue:R.setValue}}function ke(p,k){var R=ae(p,k,{getProperty:X.useCallback(function(g,w){return g.boolean(w)},[]),getValue:X.useCallback(function(g){return g.value},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(g){return{setValue:function(w){g(function(S){S.value=w})}}},[])});return{value:R.value,setValue:R.setValue}}function be(p,k){var R=ae(p,k,{getProperty:X.useCallback(function(g,w){return g.color(w)},[]),getValue:X.useCallback(function(g){return g.value},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(g){return{setValue:function(w){g(function(S){S.value=w})},setRgb:function(w,S,B){g(function(K){K.rgb(w,S,B)})},setRgba:function(w,S,B,K){g(function(N){N.rgba(w,S,B,K)})}
20,setAlpha:function(w){g(function(S){S.alpha(w)})},setOpacity:function(w){g(function(S){S.opacity(w)})}}},[])});return{value:R.value,setValue:R.setValue,setRgb:R.setRgb,setRgba:R.setRgba,setAlpha:R.setAlpha,setOpacity:R.setOpacity}}function Ce(p,k){var R=ae(p,k,{getProperty:X.useCallback(function(g,w){return g.enum(w)},[]),getValue:X.useCallback(function(g){return g.value},[]),defaultValue:null,getExtendedData:X.useCallback(function(g){return g.values},[]),buildPropertyOperations:X.useCallback(function(g){return{setValue:function(w){g(function(S){S.value=w})}}},[])});return{value:R.value,values:R.extendedData||[],setValue:R.setValue}}function Pe(p,k,R){var g=(R??{}).onTrigger;return{trigger:ae(p,k,{getProperty:X.useCallback(function(w,S){return w.trigger(S)},[]),getValue:X.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:g,buildPropertyOperations:X.useCallback(function(w){return{trigger:function(){w(function(S){S.trigger()})}}},[])}).trigger}}function We(p,k){return{setValue:ae(p,k,{getProperty:X.useCallback(function(R,g){return R.image(g)},[]),getValue:X.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(R){return{setValue:function(g){R(function(w){w.value=g})}}},[])}).setValue}}function He(p,k){var R,g=X.useState(0)[1],w=ae(p,k,{getProperty:X.useCallback(function(S,B){return S.list(B)},[]),getValue:X.useCallback(function(S){return S.length},[]),defaultValue:null,onPropertyEvent:function(){g(function(S){return S+1})},buildPropertyOperations:X.useCallback(function(S){return{addInstance:function(B){S(function(K){return K.addInstance(B)})},addInstanceAt:function(B,K){var N=!1;return S(function(le){N=le.addInstanceAt(B,K)}),N},removeInstance:function(B){S(function(K){return K.removeInstance(B)})},removeInstanceAt:function(B){S(function(K){return K.removeInstanceAt(B)})},getInstanceAt:function(B){var K=null;return S(function(N){K=N.instanceAt(B)}),K},swap:function(B,K){S(function(N){return N.swap(B,K)})}}},[])});return{length:(R=w.value)!=null?R:0,addInstance:w.addInstance,addInstanceAt:w.addInstanceAt,removeInstance:w.removeInstance,removeInstanceAt:w.removeInstanceAt,getInstanceAt:w.getInstanceAt,swap:w.swap}}function Fe(p,k,R,g,w,S,B){try{var K=p[S](B),N=K.value}catch(le){R(le);return}K.done?k(N):Promise.resolve(N).then(g,w)}function Ve(p){return function(){var k=this,R=arguments;return new Promise(function(g,w){var S=p.apply(k,R);function B(N){Fe(S,g,w,B,K,"next",N)}function K(N){Fe(S,g,w,B,K,"throw",N)}B(void 0)})}}function Ze(p,k){var R,g,w,S={label:0,sent:function(){if(1&w[0])throw w[1];return w[1]},trys:[],ops:[]},B=Object.create((typeof Iterator=="function"?Iterator:Object).prototype),K=Object.defineProperty;return K(B,"next",{value:N(0)}),K(B,"throw",{value:N(1)}),K(B,"return",{value:N(2)}),typeof Symbol=="function"&&K(B,Symbol.iterator,{value:function(){return this}}),B;function N(le){return function(pe){var he=[le,pe];if(R)throw TypeError("Generator is already executing.");for(;B&&(B=0,he[0]&&(S=0)),S;)try{if(R=1,g&&(w=2&he[0]?g.return:he[0]?g.throw||((w=g.return)&&w.call(g),0):g.next)&&!(w=w.call(g,he[1])).done)return w;switch(g=0,w&&(he=[2&he[0],w.value]),he[0]){case 0:case 1:w=he;break;case 4:return S.label++,{value:he[1],done:!1};case 5:S.label++,g=he[1],he=[0];continue;case 7:he=S.ops.pop(),S.trys.pop();continue;default:if(!(w=(w=S.trys).length>0&&w[w.length-1])&&(he[0]===6||he[0]===2)){S=0;continue}if(he[0]===3&&(!w||he[1]>w[0]&&he[1]<w[3])){S.label=he[1];break}if(he[0]===6&&S.label<w[1]){S.label=w[1],w=he;break}if(w&&S.label<w[2]){S.label=w[2],S.ops.push(he);break}w[2]&&S.ops.pop(),S.trys.pop();continue}he=k.call(p,S)}catch(De){he=[6,De],g=0}finally{R=w=0}if(5&he[0])throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}}}function dt(p){var k=X.useState(null),R=k[0],g=k[1],w=X.useState("idle"),S=w[0],B=w[1];return X.useEffect(function(){var K=null;return Ve(function(){return Ze(this,function(N){try{B("loading"),(K=new rt.RiveFile(p)).init(),K.on(rt.EventType.Load,function(){K==null||K.getInstance(),g(K),B("success")}),K.on(rt.EventType.LoadError,function(){B("failed")}),g(K)}catch(le){console.error(le),B("failed")}return[2]})})(),function(){K==null||K.cleanup()}},[p.src,p.buffer]),{riveFile:R,status:S}}function at(p,k){return{setValue:ae(p,k,{getProperty:X.useCallback(function(R,g){return R.artboard(g)},[]),getValue:X.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:X.useCallback(function(R){return{setValue:function(g){R(function(w){
20w.value=g})}}},[])}).setValue}}ze.default=x,ze.useGlobalViewModelInstance=P,ze.useResizeCanvas=D,ze.useRive=Q,ze.useRiveFile=dt,ze.useStateMachineInput=u,ze.useViewModel=_,ze.useViewModelInstance=I,ze.useViewModelInstanceArtboard=at,ze.useViewModelInstanceBoolean=ke,ze.useViewModelInstanceColor=be,ze.useViewModelInstanceEnum=Ce,ze.useViewModelInstanceImage=We,ze.useViewModelInstanceList=He,ze.useViewModelInstanceNumber=se,ze.useViewModelInstanceString=_e,ze.useViewModelInstanceTrigger=Pe,Object.keys(rt).forEach(function(p){p==="default"||ze.hasOwnProperty(p)||Object.defineProperty(ze,p,{enumerable:!0,get:function(){return rt[p]}})})})(mt);const cr="/static/assets/rive.N8o2kbU4.wasm",fr="/static/assets/rive_fallback.CN1Dy5sT.wasm",hr="/static/assets/plusPets.B_fOlSN1.riv",dr=ar.div.withConfig({componentId:"sc-ysef1y-0"})(["position:absolute;inset:0;pointer-events:none;canvas{display:block;width:100%;height:100%;}",""],({$isHidden:ze})=>ze&&or(["visibility:hidden;"])),vr="State Machine 1";mt.RuntimeLoader.setWasmUrl(cr);mt.RuntimeLoader.setWasmFallbackUrl(fr);function pr(ze){const bt=ze.replace("#","");return[parseInt(bt.slice(0,2),16),parseInt(bt.slice(2,4),16),parseInt(bt.slice(4,6),16)]}function yr({pulseKey:ze,isHidden:bt,onReadyChange:X}){const rt=sr(),[it,wt]=kt.useState(!1),{RiveComponent:xe,rive:oe}=mt.useRive({src:hr,stateMachines:vr,autoplay:!0,layout:new mt.Layout({fit:mt.Fit.Contain,alignment:mt.Alignment.Center}),onLoadError:z=>{ur.error("Failed loading the plus button animation",z.data),wt(!0)}}),q=mt.useViewModel(oe,{useDefault:!0}),f=mt.useViewModelInstance(q,{useDefault:!0,rive:oe}),{trigger:ve}=mt.useViewModelInstanceTrigger("startAnimation",f),{setRgb:J}=mt.useViewModelInstanceColor("primaryColor",f),{setRgba:j}=mt.useViewModelInstanceColor("backgroundColor",f),{setRgba:b}=mt.useViewModelInstanceColor("backgroundStrokeColor",f);return kt.useEffect(()=>{X(!!oe)},[oe,X]),kt.useEffect(()=>{f&&(J(...pr(rt.colors.primary)),j(0,0,0,0),b(0,0,0,0))},[f,rt,J,j,b]),kt.useEffect(()=>{!f||ze===0||ve()},[f,ze,ve]),it?null:Fn.jsx(dr,{"aria-hidden":!0,$isHidden:bt,children:Fn.jsx(xe,{})})}export{yr as default}; 21//# sourceMappingURL=AnimatedPlusIcon.BIOPArFO.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.