PageSourceSearch

https://mixi.social/_next/static/chunks/08r55o6432m7u.js

js mixi.social collected 2026-09-24 09:00:29 UTC 211,136 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,937041,(e,t,n)=>{e.e,t.exports=(()=>{"use strict";var e,t,n,i,r,a,o,s,u,l,c,d,h,f,p,v,m,b,y,g,w,_,C,A,R,I,S,M,F,E,x,P,k,T,O,L,D,B,V,N,U,j,z,H,W,G,X,Y,$,q,K,Q,J,Z,ee,et,en,ei,er,ea,eo,es,eu,el,ec,ed,eh,ef,ep,ev,em,eb,ey,eg,ew,e_=[,(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>i.Animation});var i=n(2)},(e,t,n)=>{n.r(t),n.d(t,{Animation:()=>i});var i=function(){function e(e,t,n,i){this.animation=e,this.artboard=t,this.playing=i,this.loopCount=0,this.scrubTo=null,this.instance=new n.LinearAnimationInstance(e,t)}return Object.defineProperty(e.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this.instance.time},set:function(e){this.instance.time=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),e.prototype.advance=function(e){null===this.scrubTo?this.instance.advance(e):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},e.prototype.apply=function(e){this.instance.apply(e)},e.prototype.cleanup=function(){this.instance.delete()},e}()},(e,t,n)=>{n.r(t),n.d(t,{RuntimeLoader:()=>o});var i=n(4),r=n(5),a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},o=function(){function e(){}return e.notifyError=function(t){var n;for(e.isLoading=!1;e.errorCallbackQueue.length>0;)null==(n=e.errorCallbackQueue.shift())||n(t);e.callBackQueue=[]},e.loadRuntime=function(){var t=e.wasmURL,n=e.wasmBinary;e.enablePerfMarks&&performance.mark("rive:wasm-init:start"),i.default(a({locateFile:function(){return t}},n?{wasmBinary:n}:{})).then(function(t){var n;for(e.enablePerfMarks&&(performance.mark("rive:wasm-init:end"),performance.measure("rive:wasm-init","rive:wasm-init:start","rive:wasm-init:end")),e.runtime=t,e.errorCallbackQueue=[];e.callBackQueue.length>0;)null==(n=e.callBackQueue.shift())||n(e.runtime)}).catch(function(n){var i={message:(null==n?void 0:n.message)||"Unknown error",type:(null==n?void 0:n.name)||"Error",wasmError:n instanceof WebAssembly.CompileError||n instanceof WebAssembly.RuntimeError,originalError:n};
1console.debug("Rive WASM load error details:",i);var r=e.wasmFallbackURL,a=null!==r&&t.toLowerCase()===r.toLowerCase();if(null===r||a){var o=a?"the configured WASM URL or its fallback (".concat(r,")"):t,s=["Could not load Rive WASM file from ".concat(o,"."),"Possible reasons:\n- Network connection is down\n- WebAssembly is not supported in this environment\n- The WASM file is corrupted or incompatible\n\nError details:","- Type: ".concat(i.type),"- Message: ".concat(i.message),"- WebAssembly-specific error: ".concat(i.wasmError),"\nTo resolve, you may need to:\n1. Check your network connection\n2. Set a new WASM source via RuntimeLoader.setWasmUrl()\n3. Call RuntimeLoader.awaitInstance() again"].join("\n");console.error(s),e.notifyError(Error(s))}else console.warn("Failed to load WASM from ".concat(t," (").concat(i.message,"), trying fallback URL: ").concat(r)),e.wasmBinary=null,e.setWasmUrl(r),e.loadRuntime()})},e.getInstance=function(t,n){e.isLoading||(e.isLoading=!0,e.loadRuntime()),e.runtime?t(e.runtime):(e.callBackQueue.push(t),n&&e.errorCallbackQueue.push(n))},e.awaitInstance=function(){return new Promise(function(t,n){return e.getInstance(t,n)})},e.setWasmUrl=function(t){e.wasmURL=t},e.getWasmUrl=function(){return e.wasmURL},e.setWasmFallbackUrl=function(t){e.wasmFallbackURL=t},e.getWasmFallbackUrl=function(){return e.wasmFallbackURL},e.setWasmBinary=function(t){if(t instanceof ArrayBuffer||null===t){e.wasmBinary=t;return}console.error("setWasmBinary expects an ArrayBuffer or null")},e.getWasmBinary=function(){return e.wasmBinary},e.isLoading=!1,e.callBackQueue=[],e.wasmURL="https://unpkg.com/".concat(r.name,"@").concat(r.version,"/rive.wasm"),e.wasmFallbackURL="https://cdn.jsdelivr.net/npm/".concat(r.name,"@").concat(r.version,"/rive_fallback.wasm"),e.wasmBinary=null,e.errorCallbackQueue=[],e.enablePerfMarks=!1,e}()},(e,t,n)=>{var i;n.r(t),n.d(t,{default:()=>r});let r=(i=globalThis.document?.currentScript?.src,async function(e={}){let t,n;var r,a=!!globalThis.window,o=!!globalThis.WorkerGlobalScope;function s(){function e(e){let a=i;n=t=0,i=new Map,a.forEach(t=>{try{t(e)}catch(e){console.error(e)}}),this.Bc(),r&&r.fd()}let t=0,n=0,i=new Map,r=null,a=null;this.requestAnimationFrame=function(r){t||=requestAnimationFrame(e.bind(this));let a=++n;return i.set(a,r),a},this.cancelAnimationFrame=function(e){i.delete(e),t&&0==i.size&&(cancelAnimationFrame(t),t=0)},this.dd=function(e){a&&(document.body.remove(a),a=null),e||((a=document.createElement("div")).style.backgroundColor="black",a.style.position="fixed",a.style.right=0,a.style.top=0,a.style.color="white",a.style.padding="4px",a.innerHTML="RIVE FPS",e=function(e){a.innerHTML="RIVE FPS "+e.toFixed(1)},document.body.appendChild(a)),r=new function(){let t=0,n=0;this.fd=function(){var i=performance.now();n?(++t,1e3<(i-=n)&&(e(1e3*t/i),t=n=0)):(n=i,t=0)}}},this.ad=function(){a&&(document.body.remove(a),a=null),r=null},this.Bc=function(){}}function u(e){console.assert(!0);let t=new Map,n=-1/0;this.push=function(i){return i=i+((1<<e)-1)>>e,t.has(i)&&clearTimeout(t.get(i)),t.set(i,setTimeout(function(){t.delete(i),0==t.length?n=-1/0:i==n&&console.assert((n=Math.max(...t.keys()))<i)},1e3)),(n=Math.max(i,n))<<e}}let l=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){l&&l();let t=e.decodeAudio;e.decodeAudio=function(e,n,i=null){n(e=t(e,i??null))};let n=e.decodeFont;e.decodeFont=function(e,t,i=null){t(e=n(e,i??null))};let i=e.FileAsset.prototype.decode;e.FileAsset.prototype.decode=function(e,t){return i.call(this,e,t??null)};let r=e.setFallbackFontCb;e.setFallbackFontCallback="function"==typeof r?function(e){r(e)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};let a=e.FileAssetLoader;e.ptrToAsset=t=>{let n=e.ptrToFileAsset(t);return n.isImage?e.ptrToImageAsset(t):n.isFont?e.ptrToFontAsset(t):n.isAudio?e.ptrToAudioAsset(t):n},e.CustomFileAssetLoader=a.extend("CustomFileAssetLoader",{__construct:function({loadContents:e}){this.__parent.__construct.call(this),this.Tc=e},loadContents:function(t,n){return t=e.ptrToAsset(t),this.Tc(t,n)}}),e.CDNFileAssetLoader=a.extend("CDNFileAssetLoader",{__construct:function(e){this.__parent.__construct.call(this),this.Vc=e??null},loadContents:function(t){var n,i,r;let a=e.ptrToAsset(t);if(""===(t=a.cdnUuid))return!1;let o=this.Vc??null;return n=a.cdnBaseUrl+"/"+t,i=e=>{a.decode(new Uint8Array(e.response),o)},(r=new XMLHttpRequest).responseType="arraybuffer",r.onreadystatechange=function(){4==r.readyState&&200==r.status&&i(r)},r.open("GET",n,!0),r.send(null),!0}}),e.FallbackFileAssetLoader=a.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.wc=[]},addLoader:function(e){this.wc.push(e)},loadContents:function(e,t){for(let n of this.wc)if(n.loadContents(e,t))return!0;return!1}});let o=e.computeAlignment;e.computeAlignment=function(e,t,n,i,r=1){return o.call(this,e,t,n,i,r)}};let c="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),d=new function(){function e(){if(!t){let u;var e=document.createElement("canvas"),o={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(u=e.getContext("webgl",o),n=1,!u)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(u=e.getContext("webgl2",o))n=2;else{if(!(u=e.getContext("webgl",o)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;n=1}function s(e,t,n){if(t=u.createShader(t),u.shaderSource(t,n),u.compileShader(t),0<((n=u.getShaderInfoLog(t))||"").length)throw n;u.attachShader(e,t)}if(i=Math.min((u=new Proxy(u,{get:(e,t)=>e.isContextLost()?(l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",t),l=!0),"function"==typeof e[t])?function(){}:void 0:"function"==typeof e[t]?function(...n){return e[t].apply(e,n)}:e[t],set(e,t,n){if(!e.isContextLost())return e[t]=n,!0;l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+t),l=!0)}})).getParameter(u.MAX_RENDERBUFFER_SIZE),u.getParameter(u.MAX_TEXTURE_SIZE)),s(e=u.createProgram(),u.VERTEX_SHADER,"attribute vec2 vertex;\n                attribute vec2 uv;\n                uniform vec4 mat;\n                uniform vec2 translate;\n                varying vec2 st;\n                void main() {\n                    st = uv;\n                    gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n                }"),s(e,u.FRAGMENT_SHADER,"precision highp float;\n                uniform sampler2D image;\n                varying vec2 st;\n                void main() {\n                    gl_FragColor = texture2D(image, st);\n                }"),u.bindAttribLocation(e,0,"vertex"),u.bindAttribLocation(e,1,"uv"),u.linkProgram(e),0<((o=u.getProgramInfoLog(e))||"").trim().length)throw o;r=u.getUniformLocation(e,"mat"),a=u.getUniformLocation(e,"translate"),u.useProgram(e),u.bindBuffer(u.ARRAY_BUFFER,u.createBuffer()),u.enableVertexAttribArray(0),u.enableVertexAttribArray(1),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,u.createBuffer()),u.uniform1i(u.getUniformLocation(e,"image"),0),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t=u}return!0}let t=null,n=0,i=0,r=null,a=null,o=0,s=0,l=!1;e(),this.td=function(){return e(),i},this.$c=function(e){t&&t.deleteTexture&&t.deleteTexture(e)},this.Zc=function(i){if(!e())return null;let r=t.createTexture();return r?(t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),2==n?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.generateMipmap(t.TEXTURE_2D)):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),r):null};let c=new u(8),d=new u(8),h=new u(10),f=new u(10);this.cd=function(n,i,u,l,p){if(e()){var v=c.push(n),m=d.push(i);if(t.canvas){for(var b of((t.canvas.width!=v||t.canvas.height!=m)&&(t.canvas.width=v,t.canvas.height=m),t.viewport(0,m-i,n,i),t.disable(t.SCISSOR_TEST),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.SCISSOR_TEST),u.sort((e,t)=>
1t.Ic-e.Ic),v=h.push(l),o!=v&&(t.bufferData(t.ARRAY_BUFFER,8*v,t.DYNAMIC_DRAW),o=v),v=0,u))t.bufferSubData(t.ARRAY_BUFFER,v,b.ec),v+=4*b.ec.length;for(var y of(console.assert(v==4*l),u))t.bufferSubData(t.ARRAY_BUFFER,v,y.Mc),v+=4*y.Mc.length;for(var g of(console.assert(v==8*l),v=f.push(p),s!=v&&(t.bufferData(t.ELEMENT_ARRAY_BUFFER,2*v,t.DYNAMIC_DRAW),s=v),b=0,u))t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,b,g.indices),b+=2*g.indices.length;for(let e of(console.assert(b==2*p),g=0,y=!0,v=b=0,u)){e.image.Tb!=g&&(t.bindTexture(t.TEXTURE_2D,e.image.Rb||null),g=e.image.Tb),e.xd?(t.scissor(e.mc,m-e.nc-e.vc,e.Gd,e.vc),y=!0):y&&(t.scissor(0,m-i,n,i),y=!1),u=2/n;let o=-2/i;t.uniform4f(r,e.lb[0]*u*e.Gb,e.lb[1]*o*e.Hb,e.lb[2]*u*e.Gb,e.lb[3]*o*e.Hb),t.uniform2f(a,e.lb[4]*u*e.Gb+u*(e.mc-e.ud*e.Gb)-1,e.lb[5]*o*e.Hb+o*(e.nc-e.vd*e.Hb)+1),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,v),t.vertexAttribPointer(1,2,t.FLOAT,!1,0,v+4*l),t.drawElements(t.TRIANGLES,e.indices.length,t.UNSIGNED_SHORT,b),v+=4*e.ec.length,b+=2*e.indices.length}console.assert(v==4*l),console.assert(b==2*p)}}},this.canvas=function(){return e()&&t.canvas}},h=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){function t(e){switch(e){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function n(e){return"rgba("+((0xff0000&e)>>>16)+","+((65280&e)>>>8)+","+((255&e)>>>0)+","+((0xff000000&e)>>>24)/255+")"}function i(){for(let e of(0<S.length&&(d.cd(I.drawWidth(),I.drawHeight(),S,M,F),S=[],F=M=0,I.reset(512,512)),A)){for(let t of e.Oa)t();e.Oa=[]}A.clear()}h&&h();var r=e.RenderPaintStyle;let a=e.RenderPath,o=e.RenderPaint,u=e.Renderer,l=e.StrokeCap,f=e.StrokeJoin,p=e.BlendMode,v=r.fill,m=r.stroke,b=e.FillRule.evenOdd,y=1;var g=e.RenderImage.extend("CanvasRenderImage",{__construct:function({sb:e,Eb:t}={}){this.__parent.__construct.call(this),this.Tb=y,y=y+1&0x7fffffff||1,this.sb=e,this.Eb=t},__destruct:function(){this.Rb&&(d.$c(this.Rb),URL.revokeObjectURL(this.kc)),this.__parent.__destruct.call(this)},decode:function(e){var t=this;t.Eb&&t.Eb(t);var n=new Image;t.kc=URL.createObjectURL(new Blob([e],{type:"image/png"})),n.onload=function(){t.Sc=n,t.Rb=d.Zc(n),t.size(n.width,n.height),t.sb&&t.sb(t)},n.src=t.kc}});class w{constructor(){this.cb=this.Kb=0,this.Za=new Path2D}clear(){this.cb=this.Kb=0,this.Za=new Path2D}Wc(e){for(0<this.Kb&&this.cb<e.length&&this.clear();this.cb<e.length;)e[this.cb++](this.Za);return this.Kb++,this.Za}release(e){e===this.Za&&this.Kb--}}var _=a.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.Pb=[],this.Za=new w,this.Ob=!1,this.pb=null},rewind:function(){this.Pb.length=0,this.Za.clear(),this.Ob=!1,this.pb=null},addPath:function(e,t,n,i,r,a,o){let s=e.Oc();this.ob(e=>{let u=new DOMMatrix;u.a=t,u.b=n,u.c=i,u.d=r,u.e=a,u.f=o,e.addPath(s,u)})},fillRule:function(e){this.jc=e},moveTo:function(e,t){this.Ob=!0;let n={pc:!0};this.pb=n,this.ob(i=>{i.moveTo(e,t),n.pc&&i.lineTo(e,t)})},lineTo:function(e,t){this.ic(),this.Mb(),this.ob(n=>{n.lineTo(e,t)})},cubicTo:function(e,t,n,i,r,a){this.ic(),this.Mb(),this.ob(o=>{o.bezierCurveTo(e,t,n,i,r,a)})},close:function(){this.Mb(),this.ob(e=>{e.closePath()})},ic:function(){this.Ob||this.moveTo(0,0)},Mb:function(){null!==this.pb&&(this.pb.pc=!1,this.pb=null)},ob:function(e){this.Pb.push(e)},Lb:function(){return this.Za.Wc(this.Pb)},lc:function(e){this.Za.release(e)},Oc:function(){let e=this.Lb();return this.Za.clear(),e}}),C=o.extend("CanvasRenderPaint",{__construct:function(){this.__parent.__construct.call(this),this.Ma=[],this.Nb=0,this.Qb=v,this.Ub=n(0xff000000),this.Sb=1,this.xb="miter",this.wb="butt",this.fc=t(p.srcOver),this.kb=null},color:function(e){this.Ma.push(()=>{this.Ub=n(e)})},thickness:function(e){this.Ma.push(()=>{this.Sb=Math.abs(e)})},join:function(e){this.Ma.push(()=>{switch(e){case f.miter:this.xb="miter";break;case f.round:this.xb="round";break;case f.bevel:this.xb="bevel"}})},cap:function(e){this.Ma.push(()=>
1{switch(e){case l.butt:this.wb="butt";break;case l.round:this.wb="round";break;case l.square:this.wb="square"}})},style:function(e){this.Ma.push(()=>{this.Qb=e})},blendMode:function(e){this.Ma.push(()=>{this.fc=t(e)})},clearGradient:function(){this.Ma.push(()=>{this.kb=null})},linearGradient:function(e,t,n,i){this.Ma.push(()=>{this.kb={Jc:e,Kc:t,rc:n,sc:i,dc:[]}})},radialGradient:function(e,t,n,i){this.Ma.push(()=>{this.kb={Jc:e,Kc:t,rc:n,sc:i,dc:[],rd:!0}})},addStop:function(e,t){this.Ma.push(()=>{this.kb.dc.push({color:e,stop:t})})},completeGradient:function(){},Pc:function(e,t,i,r){if(this.Qb!==m||0<this.Sb){var a=this.Qb,o=this.Ub,s=this.kb,u=e.globalCompositeOperation,l=e.globalAlpha;if(e.globalCompositeOperation=this.fc,e.globalAlpha=r,null!=s){o=s.Jc;let t=s.Kc,i=s.rc;var c=s.sc;r=s.dc,s.rd?(s=i-o,c-=t,o=e.createRadialGradient(o,t,0,o,t,Math.sqrt(s*s+c*c))):o=e.createLinearGradient(o,t,i,c);for(let e=0,t=r.length;e<t;e++)s=r[e],o.addColorStop(s.stop,n(s.color));this.Ub=o,this.kb=null}switch(a){case m:e.strokeStyle=o,e.lineWidth=this.Sb,e.lineCap=this.wb,e.lineJoin=this.xb,e.stroke(t);break;case v:e.fillStyle=o,e.fill(t,i)}e.globalCompositeOperation=u,e.globalAlpha=l}},Rc:function(){return this.Nb+this.Ma.length},Qc:function(e){let t=e-this.Nb;for(let e=0;e<t;e++)this.Ma[e]();this.Ma.splice(0,t),this.Nb=e}});let A=new Set,R=Object.prototype.hasOwnProperty,I=null,S=[],M=0,F=0;var E=e.CanvasRenderer=u.extend("Renderer",{__construct:function(e){this.__parent.__construct.call(this),this.Ya=[1,0,0,1,0,0],this.Ka=[1],this.Ia=e.getContext("2d"),this.hc=e,this.Oa=[]},save:function(){this.Ya.push(...this.Ya.slice(this.Ya.length-6)),this.Ka.push(this.Ka[this.Ka.length-1]),this.Oa.push(this.Ia.save.bind(this.Ia))},restore:function(){let e=this.Ya.length-6;if(6>e)throw"restore() called without matching save().";this.Ya.splice(e),this.Ka.pop(),this.Oa.push(this.Ia.restore.bind(this.Ia))},transform:function(e,t,n,i,r,a){let o=this.Ya,s=o.length-6;o.splice(s,6,o[s]*e+o[s+2]*t,o[s+1]*e+o[s+3]*t,o[s]*n+o[s+2]*i,o[s+1]*n+o[s+3]*i,o[s]*r+o[s+2]*a+o[s+4],o[s+1]*r+o[s+3]*a+o[s+5]),this.Oa.push(this.Ia.transform.bind(this.Ia,e,t,n,i,r,a))},rotate:function(e){let t=Math.sin(e);e=Math.cos(e),this.transform(e,t,-t,e,0,0)},modulateOpacity:function(e){this.Ka[this.Ka.length-1]*=e},_drawPath:function(e,t){let n=e.jc===b?"evenodd":"nonzero",i=Math.max(0,this.Ka[this.Ka.length-1]),r=e.Lb(),a=t.Rc();this.Oa.push(()=>{t.Qc(a),t.Pc(this.Ia,r,n,i),e.lc(r)})},_drawRiveImage:function(e,n,i){var r=e.Sc;if(r){var a=this.Ia,o=t(n),s=Math.max(0,i*this.Ka[this.Ka.length-1]);this.Oa.push(function(){a.globalCompositeOperation=o,a.globalAlpha=s,a.drawImage(r,0,0),a.globalAlpha=1})}},_getMatrix:function(e){let t=this.Ya,n=t.length-6;for(let i=0;6>i;++i)e[i]=t[n+i]},_drawImageMesh:function(n,r,a,o,s,u,l,c,h,f,p,v,m){let b,y,g;try{b=e.HEAPF32.slice(o>>2,(o>>2)+s),y=e.HEAPF32.slice(u>>2,(u>>2)+l),g=e.HEAPU16.slice(c>>1,(c>>1)+h)}catch(e){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}o=this.Ia.canvas.width,u=this.Ia.canvas.height,l=v-f,c=m-p,f=Math.max(f,0),p=Math.max(p,0);let w=(v=Math.min(v,o))-f,_=(m=Math.min(m,u))-p;
1if(console.assert(w<=Math.min(l,o)),console.assert(_<=Math.min(c,u)),!(0>=w||0>=_)){v=w<l||_<c,o=m=1;var C=Math.ceil(w*m),R=Math.ceil(_*o);u=d.td(),C>u&&(m*=u/C,C=u),R>u&&(o*=u/R,R=u),I||(I=new e.DynamicRectanizer(u)).reset(512,512),0>(u=I.addRect(C,R))&&(i(),A.add(this),console.assert(0<=(u=I.addRect(C,R))));var E=65535&u,x=u>>16;S.push({lb:this.Ya.slice(this.Ya.length-6),image:n,mc:E,nc:x,ud:f,vd:p,Gd:C,vc:R,Gb:m,Hb:o,ec:b,Mc:y,indices:g,xd:v,Ic:n.Tb<<1|!!v}),M+=s,F+=h;var P=this.Ia,k=t(r),T=Math.max(0,a*this.Ka[this.Ka.length-1]);this.Oa.push(function(){P.save(),P.resetTransform(),P.globalCompositeOperation=k,P.globalAlpha=T;let e=d.canvas();e&&P.drawImage(e,E,x,C,R,f,p,w,_),P.restore()})}},_clipPath:function(e){let t=e.jc===b?"evenodd":"nonzero",n=e.Lb();this.Oa.push(()=>{this.Ia.clip(n,t),e.lc(n)})},beginFrame:function(e=!0){A.add(this),e&&this.Oa.push(this.Ia.clearRect.bind(this.Ia,0,0,this.hc.width,this.hc.height))},clear:function(){this.beginFrame(!0)},flush:function(){},translate:function(e,t){this.transform(1,0,0,1,e,t)}});e.makeRenderer=function(t){let n=new E(t),i=n.Ia,r=null,a=null,o={attachSession:function(t){if(t&&r===t)return!0;if(!t||r||"function"!=typeof e.c2dDeferredClaim||"function"!=typeof e.c2dDeferredRenderer||!e.c2dDeferredClaim(t))return!1;let n=e.c2dDeferredRenderer(t);return!!n&&(r=t,a=n,!0)},detachSession:function(){r&&e.c2dDeferredDetach(r),a=r=null},deferredActive:function(){return null!==a}},s={save:function(){e.c2dDeferredSave(r)},restore:function(){e.c2dDeferredRestore(r)},transform:function(t,n,i,a,o,s){e.c2dDeferredTransform(r,t,n,i,a,o,s)},translate:function(t,n){e.c2dDeferredTransform(r,1,0,0,1,t,n)},rotate:function(t){let n=Math.sin(t);t=Math.cos(t),e.c2dDeferredTransform(r,t,n,-n,t,0,0)},align:function(t,n,i,a,o){e.c2dDeferredAlign(r,t,n,i.minX,i.minY,i.maxX,i.maxY,a.minX,a.minY,a.maxX,a.maxY,void 0===o?1:o)},beginFrame:function(t=!0){n.beginFrame(t),e.c2dDeferredBeginFrame(r)},clear:function(){n.beginFrame(!0),e.c2dDeferredBeginFrame(r)},flush:function(){e.c2dDeferredReplay(r,n)}};return new Proxy(n,{get(e,t){if(R.call(o,t))return o[t];if("_deferredRecorder"===t)return a;
1if(null!==a&&R.call(s,t))return s[t];if("function"==typeof e[t])return function(...n){return e[t].apply(e,n)};if("function"==typeof i[t]){if(-1<c.indexOf(t))throw Error("RiveException: Method call to '"+t+"()' is not allowed, as the renderer cannot immediately pass through the return                 values of any canvas 2d context methods.");return function(...e){n.Oa.push(i[t].bind(i,...e))}}return e[t]},set(e,t,r){if(t in i)return n.Oa.push(()=>{i[t]=r}),!0}})},e.decodeImage=function(e,t){new g({sb:t}).decode(e)},e.renderFactory={makeRenderPaint:function(){return new C},makeRenderPath:function(){return new _},makeRenderImage:function(){let e=P;return new g({Eb:()=>{e.total++},sb:()=>{if(e.loaded++,e.loaded===e.total){let t=e.ready;t&&(t(),e.ready=null)}}})}};let x=e.load,P=null;e.load=function(t,n,i=!0,r=null){let a=new e.FallbackFileAssetLoader;return void 0!==n&&a.addLoader(n),i&&(n=new e.CDNFileAssetLoader(r),a.addLoader(n)),new Promise(function(e){let n=null;P={total:0,loaded:0,ready:function(){e(n)}},n=x(t,a,r??null),0==P.total&&e(n)})};let k=e.Artboard.prototype.draw;e.Artboard.prototype.draw=function(e){k.call(this,e._deferredRecorder||e)};let T=e.RendererWrapper.prototype.align;e.RendererWrapper.prototype.align=function(e,t,n,i,r=1){T.call(this,e,t,n,i,r)},e.requestAnimationFrame=(r=new s).requestAnimationFrame.bind(r),e.cancelAnimationFrame=r.cancelAnimationFrame.bind(r),e.enableFPSCounter=r.dd.bind(r),e.disableFPSCounter=r.ad,r.Bc=i,e.resolveAnimationFrame=i,e.cleanup=function(){I&&I.delete()}};var f="./this.program";o&&(i=self.location.href);var p,v,m="";if(a||o){try{m=new URL(".",i).href}catch{}o&&(v=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),p=async e=>{if(O(e))return new Promise((t,n)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200==i.status||0==i.status&&i.response?t(i.response):n(i.status)},i.onerror=n,i.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var b,y,g,w,_,C,A,R,I,S,M,F,E,x,P=console.log.bind(console),k=console.error.bind(console),T=!1,O=e=>e.startsWith("file://"),L=!1;function D(){var t=t7.buffer;e.HEAP8=_=new Int8Array(t),A=new Int16Array(t),e.HEAPU8=C=new Uint8Array(t),e.HEAPU16=R=new Uint16Array(t),e.HEAP32=I=new Int32Array(t),e.HEAPU32=S=new Uint32Array(t),e.HEAPF32=M=new Float32Array(t),F=new Float64Array(t),E=new BigInt64Array(t),x=new BigUint64Array(t)}function B(t){throw e.onAbort?.(t),k(t="Aborted("+t+")"),T=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),w?.(t),t}async function V(e){if(!b)try{var t=await p(e);return new Uint8Array(t)}catch{}if(e==tC&&b)e=new Uint8Array(b);else if(v)e=v(e);else throw"both async and sync fetching of the wasm failed";return e}async function N(e,t){try{var n=await V(e);return await WebAssembly.instantiate(n,t)}catch(e){k(`failed to asynchronously prepare wasm: ${e}`),B(e)}}async function U(e){if(!b&&!O(tC))try{var t=fetch(tC,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(t,e)}catch(e){k(`wasm streaming compile failed: ${e}`),k("falling back to ArrayBuffer instantiation")}return N(tC,e)}class j{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var z=t=>{for(;0<t.length;)t.shift()(e)},H=[],W=[],G=()=>{var t=e.preRun.shift();W.push(t)},X=!0,Y=()=>{var e=I[eU>>2];return eU+=4,e},$=(e,t)=>{for(var n=0,i=e.length-1;0<=i;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},q=e=>{var t="/"===e.charAt(0),n="/"===e.slice(-1);return(e=$(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},K=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return(e=t[0],t=t[1],e||t)?e+(t&&=t.slice(0,-1)):"."},Q=e=>{(Q=e=>crypto.getRandomValues(e))(e)},J=globalThis.TextDecoder&&new TextDecoder,Z=(e,t,n,i)=>{if(n=t+n,i)return n;for(;e[t]&&!(t>=n);)++t;return t},ee=(e,t=0,n,i)=>{if(16<(n=Z(e,t,n,i))-t&&e.buffer&&J)return J.decode(e.subarray(t,n));for(i="";t<n;){var r=e[t++];if(128&r){var a=63&e[t++];if(192==(224&r))i+=String.fromCharCode((31&r)<<6|a);else{var o=63&e[t++];65536>(r=224==(240&r)?(15&r)<<12|a<<6|o:(7&r)<<18|a<<12|o<<6|63&e[t++])?i+=String.fromCharCode(r):(r-=65536,i+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else i+=String.fromCharCode(r)}return i},et=[],en=e=>{for(var t=0,n=0;n<e.length;++n){var i=e.charCodeAt(n);127>=i?t++:2047>=i?t+=2:55296<=i&&57343>=i?(t+=4,++n):t+=3}return t},ei=(e,t,n,i)=>{if(!(0<i))return 0;var r=n;i=n+i-1;for(var a=0;a<e.length;++a){var o=e.codePointAt(a);if(127>
1=o){if(n>=i)break;t[n++]=o}else if(2047>=o){if(n+1>=i)break;t[n++]=192|o>>6,t[n++]=128|63&o}else if(65535>=o){if(n+2>=i)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|63&o}else{if(n+3>=i)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|63&o,a++}}return t[n]=0,n-r},er=[];function ea(e,t){er[e]={input:[],output:[],bb:t},ex(e,eo)}var eo={open(e){var t=er[e.node.Fb];if(!t)throw new em(43);e.Ca=t,e.seekable=!1},close(e){e.Ca.bb.yb(e.Ca)},yb(e){e.Ca.bb.yb(e.Ca)},read(e,t,n,i){if(!e.Ca||!e.Ca.bb.uc)throw new em(60);for(var r=0,a=0;a<i;a++){try{var o=e.Ca.bb.uc(e.Ca)}catch(e){throw new em(29)}if(void 0===o&&0===r)throw new em(6);if(null==o)break;r++,t[n+a]=o}return r&&(e.node.ib=Date.now()),r},write(e,t,n,i){if(!e.Ca||!e.Ca.bb.ac)throw new em(60);try{for(var r=0;r<i;r++)e.Ca.bb.ac(e.Ca,t[n+r])}catch(e){throw new em(29)}return i&&(e.node.Sa=e.node.Pa=Date.now()),r}},es={Va:null,ab:()=>es.createNode(null,"/",16895,0),createNode(e,t,n,i){if(24576==(61440&n)||4096==(61440&n))throw new em(63);return es.Va||(es.Va={dir:{node:{gb:es.za.gb,Xa:es.za.Xa,rb:es.za.rb,Cb:es.za.Cb,Fc:es.za.Fc,Lc:es.za.Lc,Hc:es.za.Hc,cc:es.za.cc,Jb:es.za.Jb},stream:{Ua:es.xa.Ua}},file:{node:{gb:es.za.gb,Xa:es.za.Xa},stream:{Ua:es.xa.Ua,read:es.xa.read,write:es.xa.write,yc:es.xa.yc,Ac:es.xa.Ac}},link:{node:{gb:es.za.gb,Xa:es.za.Xa,tb:es.za.tb},stream:{}},oc:{node:{gb:es.za.gb,Xa:es.za.Xa},stream:eE}}),16384==(61440&(n=eC(e,t,n,i)).mode)?(n.za=es.Va.dir.node,n.xa=es.Va.dir.stream,n.ya={}):32768==(61440&n.mode)?(n.za=es.Va.file.node,n.xa=es.Va.file.stream,n.Ga=0,n.ya=null):40960==(61440&n.mode)?(n.za=es.Va.link.node,n.xa=es.Va.link.stream):8192==(61440&n.mode)&&(n.za=es.Va.oc.node,n.xa=es.Va.oc.stream),n.ib=n.Sa=n.Pa=Date.now(),e&&(e.ya[t]=n,e.ib=e.Sa=e.Pa=n.ib),n},Ud:e=>e.ya?e.ya.subarray?e.ya.subarray(0,e.Ga):new Uint8Array(e.ya):new Uint8Array(0),za:{gb(e){var t={};return t.Rd=8192==(61440&e.mode)?e.id:1,t.Wd=e.id,t.mode=e.mode,t.Yd=1,t.uid=0,t.Vd=0,t.Fb=e.Fb,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.Ga:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.ib=new Date(e.ib),t.Sa=new Date(e.Sa),t.Pa=new Date(e.Pa),t.Xc=4096,t.Ld=Math.ceil(t.size/t.Xc),t},Xa(e,t){for(var n of["mode","atime","mtime","ctime"])null!=t[n]&&(e[n]=t[n]);void 0!==t.size&&(t=t.size,e.Ga!=t&&(0==t?(e.ya=null,e.Ga=0):(n=e.ya,e.ya=new Uint8Array(t),n&&e.ya.set(n.subarray(0,Math.min(t,e.Ga))),e.Ga=t)))},rb(){throw es.Vb||(es.Vb=new em(44),es.Vb.stack="<generic error, no stack>"),es.Vb},Cb:(e,t,n,i)=>es.createNode(e,t,n,i),Fc(e,t,n){try{var i=e_(t,n)}catch(e){}if(i){if(16384==(61440&e.mode))for(var r in i.ya)throw new em(55);if(eh[r=ew(i.parent.id,i.name)]===i)eh[r]=i.mb;else for(r=eh[r];r;){if(r.mb===i){r.mb=i.mb;break}r=r.mb}}delete e.parent.ya[e.name],t.ya[n]=e,e.name=n,t.Pa=t.Sa=e.parent.Pa=e.parent.Sa=Date.now()},Lc(e,t){delete e.ya[t],e.Pa=e.Sa=Date.now()},Hc(e,t){var n,i=e_(e,t);for(n in i.ya)throw new em(55);delete e.ya[t],e.Pa=e.Sa=Date.now()},cc:e=>[".","..",...Object.keys(e.ya)],Jb:(e,t,n)=>((e=es.createNode(e,t,41471,0)).link=n,e),tb(e){if(40960!=(61440&e.mode))throw new em(28);return e.link}}
1,xa:{read(e,t,n,i,r){var a=e.node.ya;if(r>=e.node.Ga)return 0;if(8<(e=Math.min(e.node.Ga-r,i))&&a.subarray)t.set(a.subarray(r,r+e),n);else for(i=0;i<e;i++)t[n+i]=a[r+i];return e},write(e,t,n,i,r,a){if(t.buffer===_.buffer&&(a=!1),!i)return 0;if((e=e.node).Sa=e.Pa=Date.now(),t.subarray&&(!e.ya||e.ya.subarray)){if(a)return e.ya=t.subarray(n,n+i),e.Ga=i;if(0===e.Ga&&0===r)return e.ya=t.slice(n,n+i),e.Ga=i;if(r+i<=e.Ga)return e.ya.set(t.subarray(n,n+i),r),i}a=r+i;var o=e.ya?e.ya.length:0;if(o>=a||(a=Math.max(a,o*(1048576>o?2:1.125)>>>0),0!=o&&(a=Math.max(a,256)),o=e.ya,e.ya=new Uint8Array(a),0<e.Ga&&e.ya.set(o.subarray(0,e.Ga),0)),e.ya.subarray&&t.subarray)e.ya.set(t.subarray(n,n+i),r);else for(a=0;a<i;a++)e.ya[r+a]=t[n+a];return e.Ga=Math.max(e.Ga,r+i),i},Ua(e,t,n){if(1===n?t+=e.position:2===n&&32768==(61440&e.node.mode)&&(t+=e.node.Ga),0>t)throw new em(28);return t},yc(e,t,n,i,r){if(32768!=(61440&e.node.mode))throw new em(43);if(e=e.node.ya,2&r||!e||e.buffer!==_.buffer)throw i=!0,B(),r=void 0,new em(48);return i=!1,r=e.byteOffset,{Ba:r,Kd:i}},Ac:(e,t,n,i)=>(es.xa.write(e,t,0,i,n,!1),0)}},eu=null,el={},ec=[],ed=1,eh=null,ef=!1,ep=!0,ev={},em=class{name="ErrnoError";constructor(e){this.eb=e}},eb=class{cb={};node=null;get flags(){return this.cb.flags}set flags(e){this.cb.flags=e}get position(){return this.cb.position}set position(e){this.cb.position=e}},ey=class{za={};xa={};Db=null;constructor(e,t,n,i){e||=this,this.parent=e,this.ab=e.ab,this.id=ed++,this.name=t,this.mode=n,this.Fb=i,this.ib=this.Sa=this.Pa=Date.now()}get read(){return 365==(365&this.mode)}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return 146==(146&this.mode)}set write(e){e?this.mode|=146:this.mode&=-147}};function eg(e,t={}){if(!e)throw new em(44);t.Xb??(t.Xb=!0),"/"===e.charAt(0)||(e="//"+e);var n=0;e:for(;40>n;n++){e=e.split("/").filter(e=>!!e);for(var i=eu,r="/",a=0;a<e.length;a++){var o=a===e.length-1;if(o&&t.parent)break;if("."!==e[a])if(".."===e[a])if(r=K(r),i===i.parent){e=r+"/"+e.slice(a+1).join("/"),n--;continue e}else i=i.parent;else{r=q(r+"/"+e[a]);try{i=e_(i,e[a])}catch(e){if(44===e?.eb&&o&&t.yd)return{path:r};throw e}if(i.Db&&(!o||t.Xb)&&(i=i.Db.root),40960==(61440&i.mode)&&(!o||t.Wb)){if(!i.za.tb)throw new em(52);"/"===(i=i.za.tb(i)).charAt(0)||(i=K(r)+"/"+i),e=i+"/"+e.slice(a+1).join("/");continue e}}}return{path:r,node:i}}throw new em(32)}function ew(e,t){for(var n=0,i=0;i<t.length;i++)n=(n<<5)-n+t.charCodeAt(i)|0;return(e+n>>>0)%eh.length}function e_(e,t){var n=16384==(61440&e.mode)?(n=eR(e,"x"))?n:2*!e.za.rb:54;if(n)throw new em(n);for(n=eh[ew(e.id,t)];n;n=n.mb){var i=n.name;if(n.parent.id===e.id&&i===t)return n}return e.za.rb(e,t)}function eC(e,t,n,i){return t=ew((e=new ey(e,t,n,i)).parent.id,e.name),e.mb=eh[t],eh[t]=e}function eA(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function eR(e,t){return ep?0:t.includes("r")&&!(292&e.mode)||t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode)?2:0}function eI(e,t){if(16384!=(61440&e.mode))return 54;try{return e_(e,t),20}catch(e){}return eR(e,"wx")}function eS(e){if(!(e=ec[e]))throw new em(8);return e}function eM(e,t=-1){if(e=Object.assign(new eb,e),-1==t)e:{for(t=0;4096>=t;t++)if(!ec[t])break e;throw new em(33)}return e.fb=t,ec[t]=e}function eF(e,t){var n=void 0,i=n?null:e;if(!(n??=e.za.Xa))throw new em(63);n(i,t)}var eE={open(e){e.xa=el[e.node.Fb].xa,e.xa.open?.(e)},Ua(){throw new em(70)}};function ex(e,t){el[e]={xa:t}}function eP(e,t){var n="/"===t;if(n&&eu)throw new em(10);if(!n&&t){var i=eg(t,{Xb:!1});if(t=i.path,(i=i.node).Db)throw new em(10);if(16384!=(61440&i.mode))throw new em(54)}t={type:e,Zd:{},zc:t,wd:[]},(e=e.ab(t)).ab=t,t.root=e,n?eu=e:i&&(i.Db=t,i.ab&&i.ab.wd.push(t))}function ek(e,t,n){var i=eg(e,{parent:!0}).node;if(!(e=e&&e.match(/([^\/]+|\/)\/*$/)[1]))throw new em(28);if("."===e||".."===e)throw new em(20);var r=eI(i,e);if(r)throw new em(r);if(!i.za.Cb)throw new em(63);return i.za.Cb(i,e,t,n)}function eT(e){return ek(e,16895,0)}function eO(e,t,n){void 0===n&&(n=t,t=438),ek(e,8192|t,n)}function eL(e,t){if(!((...e)=>{for(var t="",n=!1,i=e.length-1;-1<=i&&!n;i--){if("string"!=typeof(n=0<=i?e[i]:"/"))throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,n="/"===n.charAt(0)}return t=$(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."})(e))throw new em(44);var n=eg(t,{parent:!0}).node;if(!n)throw new em(44);var i=eI(n,t=t&&t.match(/([^\/]+|\/)\/*$/)[1]);if(i)throw new em(i);if(!n.za.Jb)throw new em(63);n.za.Jb(n,t,e)}function eD(t,n,i=438){if(""===t)throw new em(44);if("string"==typeof n){var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[n];if(void 0===r)throw Error(`Unknown file open mode: ${n}`);n=r}if(i=64&n?4095&i|32768:0,"object"==typeof t)r=t;else{var a=t.endsWith("/");r=(t=eg(t,{Wb:!(131072&n),yd:!0})).node,t=t.path}var o=!1;if(64&n)if(r){if(128&n)throw new em(20)}else{if(a)throw new em(31);r=ek(t,511|i,0),o=!0}if(!r)throw new em(44);if(8192==(61440&r.mode)&&(n&=-513),65536&n&&16384!=(61440&r.mode))throw new em(54);if(!o&&(a=r?40960==(61440&r.mode)?32:16384==(61440&r.mode)&&("r"!==eA(n)||576&n)?31:eR(r,eA(n)):44))throw new em(a);if(512&n&&!o){if(16384==(61440&(a="string"==typeof(a=r)?eg(a,{Wb:!0}).node:a).mode))throw new em(31);if(32768!=(61440&a.mode))throw new em(28);var s=eR(a,"w");if(s)throw new em(s);eF(a,{size:0,timestamp:Date.now()})}for(n&=-131713,a=r;;){if(a===a.parent){a=a.ab.zc;var u=u?"/"!==a[a.length-1]?`${a}/${u}`:a+u:a;break}u=u?`${a.name}/${u}`:a.name,a=a.parent}return(u=eM({node:r,path:u,flags:n,seekable:!0,position:0,xa:r.xa,Fd:[],error:!1})).xa.open&&u.xa.open(u),o&&(i&=511,eF(r="string"==typeof r?eg(r,{Wb:!0}).node:r,{mode:4095&i|-4096&r.mode,Pa:Date.now(),Sd:void 0})),!e.logReadFiles||1&n||t in ev||(ev[t]=1),u}function eB(e,t,n){if(null===e.fb)throw new em(8);if(!e.seekable||!e.xa.Ua)throw new em(70);if(0!=n&&1!=n&&2!=n)throw new em(28);e.position=e.xa.Ua(e,t,n),e.Fd=[]}function eV(e,t,n){e=q("/dev/"+e);var i,r=(i=0,t&&(i|=365),n&&(i|=146),i);eV.xc??(eV.xc=64);var a=eV.xc++<<8;ex(a,{open(e){e.seekable=!1},close(){n?.buffer?.length&&n(10)},read(e,n,i,r){for(var a=0,o=0;o<r;o++){try{var s=t()}catch(e){throw new em(29)}if(void 0===s&&0===a)throw new em(6);if(null==s)break;a++,n[i+o]=s}return a&&(e.node.ib=Date.now()),a},write(e,t,i,r){for(var a=0;a<r;a++)try{n(t[i+a])}catch(e){throw new em(29)}return r&&(e.node.Sa=e.node.Pa=Date.now()),a}}),eO(e,r,a)}var eN={},eU=void 0,ej=(e,t)=>Object.defineProperty(t,"name",{value:e}
1),ez=[],eH=[0,1,,1,null,1,!0,1,!1,1],eW=class extends Error{constructor(e){super(e),this.name="BindingError"}},eG=e=>{if(!e)throw new eW(`Cannot use deleted val. handle = ${e}`);return eH[e]},eX=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=ez.pop()||eH.length;return eH[t]=e,eH[t+1]=1,t}};class eY extends Error{}var e$=e=>{for(var t="";;){var n=C[e++];if(!n)return t;t+=String.fromCharCode(n)}},eq={},eK=(e,t)=>{if(void 0===t)throw new eW("ptr should not be undefined");for(;e.Ha;)t=e.ub(t),e=e.Ha;return t},eQ={},eJ=e=>{var t=e$(e=t1(e));return tZ(e),t},eZ=(e,t)=>{var n=eQ[e];if(void 0===n)throw new eW(e=`${t} has unknown type ${eJ(e)}`);return n},e0=()=>{},e1=!1,e2=e=>globalThis.FinalizationRegistry?(e1=new FinalizationRegistry(e=>{e=e.va,--e.count.value,0===e.count.value&&(e.Ja?e.Qa.Wa(e.Ja):e.Da.wa.Wa(e.Ba))}),e2=e=>{var t=e.va;return t.Ja&&e1.register(e,{va:t},e),e},e0=e=>{e1.unregister(e)},e2(e)):(e2=e=>e,e),e4={},e6=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function e3(e){return this.Aa(S[e>>2])}var e5={},e8={},e9=class extends Error{constructor(e){super(e),this.name="InternalError"}},e7=(e,t,n)=>{function i(t){if((t=n(t)).length!==e.length)throw new e9("Mismatched type converter count");for(var i=0;i<e.length;++i)te(e[i],t[i])}e.forEach(e=>e8[e]=t);var r=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())eQ.hasOwnProperty(n)?r[e]=eQ[n]:(a.push(n),e5.hasOwnProperty(n)||(e5[n]=[]),e5[n].push(()=>{r[e]=eQ[n],++o===a.length&&i(r)}));0===a.length&&i(r)};function te(e,t,n={}){return function(e,t,n={}){var i=t.name;if(!e)throw new eW(`type "${i}" must have a positive integer typeid pointer`);if(eQ.hasOwnProperty(e)){if(n.md)return;throw new eW(`Cannot register type '${i}' twice`)}eQ[e]=t,delete e8[e],e5.hasOwnProperty(e)&&(t=e5[e],delete e5[e],t.forEach(e=>e()))}(e,t,n)}var tt=(e,t,n)=>{switch(t){case 1:return n?e=>_[e]:e=>C[e];case 2:return n?e=>A[e>>1]:e=>R[e>>1];case 4:return n?e=>I[e>>2]:e=>S[e>>2];case 8:return n?e=>E[e>>3]:e=>x[e>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},tn=e=>{throw new eW(e.va.Da.wa.name+" instance already deleted")},ti=[];function tr(){}var ta={},to=(e,t,n)=>{if(void 0===e[t].Fa){var i=e[t];e[t]=function(...i){if(!e[t].Fa.hasOwnProperty(i.length))throw new eW(`Function '${n}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].Fa})!`);return e[t].Fa[i.length].apply(this,i)},e[t].Fa=[],e[t].Fa[i.$a]=i}},ts=(t,n,i)=>{if(e.hasOwnProperty(t)){if(void 0===i||void 0!==e[t].Fa&&void 0!==e[t].Fa[i])throw new eW(`Cannot register public name '${t}' twice`);if(to(e,t,t),e[t].Fa.hasOwnProperty(i))throw new eW(`Cannot register multiple overloads of a function with the same number of arguments (${i})!`);e[t].Fa[i]=n}else e[t]=n,e[t].$a=i};function tu(e,t,n,i,r,a,o,s){this.name=e,this.constructor=t,this.Ta=n,this.Wa=i,this.Ha=r,this.gd=a,this.ub=o,this.bd=s,this.Dc=[]}var tl=(e,t,n)=>{for(;t!==n;){if(!t.ub)throw new eW(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.ub(e),t=t.Ha}return e},tc=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e};function td(e,t){if(null===t){if(this.Zb)throw new eW(`null is not a valid ${this.name}`);return 0}if(!t.va)throw new eW(`Cannot pass "${tc(t)}" as a ${this.name}`);if(!t.va.Ba)throw new eW(`Cannot pass deleted object as a pointer of type ${this.name}`);return tl(t.va.Ba,t.va.Da.wa,this.wa)}function th(e,t){if(null===t){if(this.Zb)throw new eW(`null is not a valid ${this.name}`);if(this.Bb){var n=this.bc();return null!==e&&e.push(this.Wa,n),n}return 0}if(!t||!t.va)throw new eW(`Cannot pass "${tc(t)}" as a ${this.name}`);if(!t.va.Ba)throw new eW(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ab&&t.va.Da.Ab)throw new eW(`Cannot convert argument of type ${t.va.Qa?t.va.Qa.name:t.va.Da.name} to parameter type ${this.name}`);if(n=tl(t.va.Ba,t.va.Da.wa,this.wa),this.Bb){if(void 0===t.va.Ja)throw new eW("Passing raw pointer to smart pointer is illegal");switch(this.Ed){case 0:if(t.va.Qa===this)n=t.va.Ja;else throw new eW(`Cannot convert argument of type ${t.va.Qa?t.va.Qa.name:t.va.Da.name} to parameter type ${this.name}`);break;case 1:n=t.va.Ja;break;case 2:if(t.va.Qa===this)n=t.va.Ja;else{var i=t.clone();n=this.Ad(n,eX(()=>i.delete())),null!==e&&e.push(this.Wa,n)}break;default:throw new eW("Unsupported sharing policy")}}return n}function tf(e,t){if(null===t){if(this.Zb)throw new eW(`null is not a valid ${this.name}`);return 0}if(!t.va)throw new eW(`Cannot pass "${tc(t)}" as a ${this.name}`);if(!t.va.Ba)throw new eW(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.va.Da.Ab)throw new eW(`Cannot convert argument of type ${t.va.Da.name} to parameter type ${this.name}`);return tl(t.va.Ba,t.va.Da.wa,this.wa)}var tp=(e,t,n)=>t===n?e:void 0===n.Ha||null===(e=tp(e,t,n.Ha))?null:n.bd(e),tv=(e,t)=>
1{if(!t.Da||!t.Ba)throw new e9("makeClassHandle requires ptr and ptrType");if(!!t.Qa!=!!t.Ja)throw new e9("Both smartPtrType and smartPtr must be specified");return t.count={value:1},e2(Object.create(e,{va:{value:t,writable:!0}}))};function tm(e,t,n,i,r,a,o,s,u,l,c){this.name=e,this.wa=t,this.Zb=n,this.Ab=i,this.Bb=r,this.zd=a,this.Ed=o,this.Ec=s,this.bc=u,this.Ad=l,this.Wa=c,r||void 0!==t.Ha?this.Ea=th:(this.Ea=i?td:tf,this.La=null)}var tb=(t,n,i)=>{if(!e.hasOwnProperty(t))throw new e9("Replacing nonexistent public symbol");void 0!==e[t].Fa&&void 0!==i?e[t].Fa[i]=n:(e[t]=n,e[t].$a=i)},ty=(e,t)=>{e=e$(e);var n=ne.get(t);if("function"!=typeof n)throw new eW(`unknown function pointer with signature ${e}: ${t}`);return n};class tg extends Error{}var tw=(e,t)=>{var n=[],i={};throw t.forEach(function e(t){i[t]||eQ[t]||(e8[t]?e8[t].forEach(e):(n.push(t),i[t]=!0))}),new tg(`${e}: `+n.map(eJ).join([", "]))};function t_(e,t,n,i,r){var a=t.length;if(2>a)throw new eW("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==n,s=function(e){for(var t=1;t<e.length;++t)if(null!==e[t]&&void 0===e[t].La)return!0;return!1}(t),u=!t[0].sd,l=a-2,c=Array(l),d=[],h=[];return ej(e,function(...e){if(h.length=0,d.length=o?2:1,d[0]=r,o){var n=t[1].Ea(h,this);d[1]=n}for(var a=0;a<l;++a)c[a]=t[a+2].Ea(h,e[a]),d.push(c[a]);if(e=i(...d),s)e6(h);else for(a=o?1:2;a<t.length;a++){var f=1===a?n:c[a-2];null!==t[a].La&&t[a].La(f)}return u?t[0].Aa(e):void 0})}var tC,tA,tR=(e,t)=>{for(var n=[],i=0;i<e;i++)n.push(S[t+4*i>>2]);return n},tI=e=>{let t=(e=e.trim()).indexOf("(");return -1===t?e:e.slice(0,t)},tS=(e,t,n)=>{if(!(e instanceof Object))throw new eW(`${n} with invalid "this": ${e}`);if(!(e instanceof t.wa.constructor))throw new eW(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.va.Ba)throw new eW(`cannot call emscripten binding method ${n} on deleted object`);return tl(e.va.Ba,e.va.Da.wa,t.wa)},tM=e=>{9<e&&0==--eH[e+1]&&(eH[e]=void 0,ez.push(e))},tF={name:"emscripten::val",Aa:e=>{var t=eG(e);return tM(e),t},Ea:(e,t)=>eX(t),Na:e3,La:null},tE=(e,t,n)=>{switch(t){case 1:return n?function(e){return this.Aa(_[e])}:function(e){return this.Aa(C[e])};case 2:return n?function(e){return this.Aa(A[e>>1])}:function(e){return this.Aa(R[e>>1])};case 4:return n?function(e){return this.Aa(I[e>>2])}:function(e){return this.Aa(S[e>>2])};default:throw TypeError(`invalid integer width (${t}): ${e}`)}},tx=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,tP=(e,t,n)=>{if(e>>=1,16<(t=Z(R,e,t/2,n))-e&&tx)return tx.decode(R.subarray(e,t));for(n="";e<t;++e)n+=String.fromCharCode(R[e]);return n},tk=(e,t,n)=>{if(2>(n??=0x7fffffff))return 0;n-=2;var i=t;n=n<2*e.length?n/2:e.length;for(var r=0;r<n;++r)A[t>>1]=e.charCodeAt(r),t+=2;return A[t>>1]=0,t-i},tT=e=>2*e.length,tO=(e,t,n)=>{var i="";e>>=2;for(var r=0;!(r>=t/4);r++){var a=S[e+r];if(!a&&!n)break;i+=String.fromCodePoint(a)}return i},tL=(e,t,n)=>{if(4>(n??=0x7fffffff))return 0;var i=t;n=i+n-4;for(var r=0;r<e.length;++r){var a=e.codePointAt(r);if(65535<a&&r++,I[t>>2]=a,(t+=4)+4>n)break}return I[t>>2]=0,t-i},tD=e=>{for(var t=0,n=0;n<e.length;++n)65535<e.codePointAt(n)&&n++,t+=4;return t},tB=0,tV=[],tN={},tU=e=>{var t=tN[e];return void 0===t?e$(e):t},tj=[0,31,60,91,121,152,182,213,244,274,305,335],tz=[0,31,59,90,120,151,181,212,243,273,304,334],tH={},tW=e=>{if(!(e instanceof j||"unwind"==e))throw e},tG=t=>{throw y=t,X||0<tB||(e.onExit?.(t),T=!0),new j(t)},tX=[],tY={},t$=()=>{if(!tA){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(e in tY)void 0===tY[e]?delete t[e]:t[e]=tY[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);tA=n}return tA};if(eh=Array(4096),eP(es,"/"),eT("/tmp"),eT("/home"),eT("/home/web_user"),eT("/dev"),ex(259,{read:()=>0,write:(e,t,n,i)=>i,Ua:()=>0}),eO("/dev/null",259),ea(1280,{uc(){e:{if(!et.length){var e=null;if(globalThis.window?.prompt&&null!==(e=window.prompt("Input: "))&&(e+="\n"),!e){var t=null;break e}t=Array(en(e)+1),e=ei(e,t,0,t.length),t.length=e,et=t}t=et.shift()}return t},ac(e,t){null===t||10===t?(P(ee(e.output)),e.output=[]):0!=t&&e.output.push(t)},yb(e){0<e.output?.length&&(P(ee(e.output)),e.output=[])},od:()=>({Od:25856,Qd:5,Nd:191,Pd:35387,Md:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),pd:()=>0,qd:()=>[24,80]}),ea(1536,{ac(e,t){null===t||10===t?(k(ee(e.output)),e.output=[]):0!=t&&e.output.push(t)},yb(e){0<e.output?.length&&(k(ee(e.output)),e.output=[])}}),eO("/dev/tty",1280),eO("/dev/tty1",1536),tq=new Uint8Array(1024),tK=0,eV("random",tQ=()=>(0===tK&&(Q(tq),tK=tq.byteLength),tq[--tK])),eV("urandom",tQ),eT("/dev/shm"),eT("/dev/shm/tmp"),eT("/proc"),tJ=eT("/proc/self"),eT("/proc/self/fd"),eP({ab(){var e=eC(tJ,"fd",16895,73);return e.xa={Ua:es.xa.Ua},e.za={rb(e,t){var n=eS(e=+t);return(e={parent:null,ab:{zc:"fake"},za:{tb:()=>n.path},id:e+1}).parent=e},cc:()=>Array.from(ec.entries()).filter(([,e])=>e).map(([e])=>e.toString())},e}},"/proc/self/fd"),Object.assign(t=tr.prototype,{isAliasOf:function(e){if(!(this instanceof tr&&e instanceof tr))return!1;var t=this.va.Da.wa,n=this.va.Ba;e.va=e.va;var i=e.va.Da.wa;for(e=e.va.Ba;t.Ha;)n=t.ub(n),t=t.Ha;for(;i.Ha;)e=i.ub(e),i=i.Ha;return t===i&&n===e},clone:function(){if(this.va.Ba||tn(this),this.va.nb)return this.va.count.value+=1,this;var e=e2,t=Object,n=t.create,i=Object.getPrototypeOf(this),r=this.va;return e=e(n.call(t,i,{va:{value:{count:r.count,qb:r.qb,nb:r.nb,Ba:r.Ba,Da:r.Da,Ja:r.Ja,Qa:r.Qa}}})),e.va.count.value+=1,e.va.qb=!1,e},delete(){if(this.va.Ba||tn(this),this.va.qb&&!this.va.nb)throw new eW("Object already scheduled for deleti
1on");e0(this);var e=this.va;--e.count.value,0===e.count.value&&(e.Ja?e.Qa.Wa(e.Ja):e.Da.wa.Wa(e.Ba)),this.va.nb||(this.va.Ja=void 0,this.va.Ba=void 0)},isDeleted:function(){return!this.va.Ba},deleteLater:function(){if(this.va.Ba||tn(this),this.va.qb&&!this.va.nb)throw new eW("Object already scheduled for deletion");return ti.push(this),this.va.qb=!0,this}}),(n=Symbol.dispose)&&(t[n]=t.delete),Object.assign(tm.prototype,{hd(e){return this.Ec&&(e=this.Ec(e)),e},qc(e){this.Wa?.(e)},Na:e3,Aa:function(e){function t(){return this.Bb?tv(this.wa.Ta,{Da:this.zd,Ba:n,Qa:this,Ja:e}):tv(this.wa.Ta,{Da:this,Ba:e})}var n=this.hd(e);if(!n)return this.qc(e),null;var i=eq[eK(this.wa,n)];if(void 0!==i)return 0===i.va.count.value?(i.va.Ba=n,i.va.Ja=e,i.clone()):(i=i.clone(),this.qc(e),i);if(!(i=ta[i=this.wa.gd(n)]))return t.call(this);i=this.Ab?i.Yc:i.pointerType;var r=tp(n,this.wa,i.wa);return null===r?t.call(this):this.Bb?tv(i.wa.Ta,{Da:i,Ba:r,Qa:this,Ja:e}):tv(i.wa.Ta,{Da:i,Ba:r})}}),e.noExitRuntime&&(X=e.noExitRuntime),e.print&&(P=e.print),e.printErr&&(k=e.printErr),e.wasmBinary&&(b=e.wasmBinary),e.thisProgram&&(f=e.thisProgram),e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.shift()();var tq,tK,tQ,tJ,tZ,t0,t1,t2,t4,t6,t3,t5,t8,t9,t7,ne,nt={258222:(e,t,n,i,r)=>{if("u"<typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.miniaudio){window.miniaudio={referenceCount:0},window.miniaudio.device_type={},window.miniaudio.device_type.playback=e,window.miniaudio.device_type.capture=t,window.miniaudio.device_type.duplex=n,window.miniaudio.device_state={},window.miniaudio.device_state.stopped=i,window.miniaudio.device_state.started=r;let a=window.miniaudio;a.devices=[],a.track_device=function(e){for(var t=0;t<a.devices.length;++t)if(null==a.devices[t])return a.devices[t]=e,t;return a.devices.push(e),a.devices.length-1},a.untrack_device_by_index=function(e){for(a.devices[e]=null;0<a.devices.length;)if(null==a.devices[a.devices.length-1])a.devices.pop();else break},a.untrack_device=function(e){for(var t=0;t<a.devices.length;++t)if(a.devices[t]==e)return a.untrack_device_by_index(t)},a.get_device_by_index=function(e){return a.devices[e]},a.unlock_event_types=["touchend","click"],a.unlock=function(){for(var e=0;e<a.devices.length;++e){var t=a.devices[e];null!=t&&null!=t.Ra&&t.state===a.device_state.started&&t.Ra.resume().then(()=>{t2(t.Cc)},e=>{console.error("Failed to resume audiocontext",e)})}a.unlock_event_types.map(function(e){document.removeEventListener(e,a.unlock,!0)})},a.unlock_event_types.map(function(e){document.addEventListener(e,a.unlock,!0)})}return window.miniaudio.referenceCount+=1,1},260400:()=>{void 0!==window.miniaudio&&(window.miniaudio.unlock_event_types.map(function(e){document.removeEventListener(e,window.miniaudio.unlock,!0)}),--window.miniaudio.referenceCount,0===window.miniaudio.referenceCount&&delete window.miniaudio)},260704:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,260808:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch(e){return 0}},260979:(e,t,n,i,r,a)=>{if(void 0===window.miniaudio)return -1;var o={},s={};return e==window.miniaudio.device_type.playback&&0!=n&&(s.sampleRate=n),o.Ra=new(window.AudioContext||window.webkitAudioContext)(s),o.Ra.suspend(),o.state=window.miniaudio.device_state.stopped,n=0,e!=window.miniaudio.device_type.playback&&(n=t),o.hb=o.Ra.createScriptProcessor(i,n,t),o.hb.onaudioprocess=function(n){if((null==o.zb||0==o.zb.length)&&(o.zb=new Float32Array(M.buffer,r,i*t)),e==window.miniaudio.device_type.capture||e==window.miniaudio.device_type.duplex){for(var s=0;s<t;s+=1)for(var u=n.inputBuffer.getChannelData(s),l=o.zb,c=0;c<i;c+=1)l[c*t+s]=u[c];t4(a,i,r)}if(e==window.miniaudio.device_type.playback||e==window.miniaudio.device_type.duplex)for(t6(a,i,r),s=0;s<n.outputBuffer.numberOfChannels;++s)for(u=n.outputBuffer.getChannelData(s),l=o.zb,c=0;c<i;c+=1)u[c]=l[c*t+s];else for(s=0;s<n.outputBuffer.numberOfChannels;++s)n.outputBuffer.getChannelData(s).fill(0)},e!=window.miniaudio.device_type.capture&&e!=window.miniaudio.device_type.duplex||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(e){o.Ib=o.Ra.createMediaStreamSource(e),o.Ib.connect(o.hb),o.hb.connect(o.Ra.destination)}).catch(function(e){console.log("Failed to get user media: "+e)}),e==window.miniaudio.device_type.playback&&o.hb.connect(o.Ra.destination),o.Cc=a,window.miniaudio.track_device(o)},263856:e=>window.miniaudio.get_device_by_index(e).Ra.sampleRate,263929:e=>{void 0!==(e=window.miniaudio.get_device_by_index(e)).hb&&(e.hb.onaudioprocess=function(){},e.hb.disconnect(),e.hb=void 0),void 0!==e.Ib&&(e.Ib.disconnect(),e.Ib=void 0),e.Ra.close(),e.Ra=void 0,e.Cc=void 0},264329:e=>{window.miniaudio.untrack_device_by_index(e)},264379:e=>{(e=window.miniaudio.get_device_by_index(e)).Ra.resume(),e.state=window.miniaudio.device_state.started},264518:e=>{(e=window.miniaudio.get_device_by_index(e)).Ra.suspend(),e.state=window.miniaudio.device_state.stopped}},nn={s:function(e,t,n){eU=n;try{var i=eS(e);
1switch(t){case 0:var r=Y();if(0>r)break;for(;ec[r];)r++;return function(e,t=-1){return e=eM(e,t),e.xa?.Td?.(e),e}(i,r).fb;case 1:case 2:case 13:case 14:return 0;case 3:return i.flags;case 4:return r=Y(),i.flags|=r,0;case 12:return A[(r=Y())+0>>1]=2,0}return -28}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return-e.eb}},L:function(e,t,n){eU=n;try{var i=eS(e);switch(t){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return i.Ca?0:-59;case 21505:if(!i.Ca)return -59;if(i.Ca.bb.od){e=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Y();I[r>>2]=25856,I[r+4>>2]=5,I[r+8>>2]=191,I[r+12>>2]=35387;for(var a=0;32>a;a++)_[r+a+17]=e[a]||0}return 0;case 21506:case 21507:case 21508:if(!i.Ca)return -59;if(i.Ca.bb.pd)for(r=Y(),e=[],a=0;32>a;a++)e.push(_[r+a+17]);return 0;case 21519:if(!i.Ca)return -59;return I[(r=Y())>>2]=0;case 21520:return i.Ca?-28:-59;case 21537:case 21531:if(r=Y(),!i.xa.nd)throw new em(59);return i.xa.nd(i,t,r);case 21523:if(!i.Ca)return -59;return i.Ca.bb.qd&&(a=[24,80],A[(r=Y())>>1]=a[0],A[r+2>>1]=a[1]),0;default:return -28}}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return-e.eb}},M:function(e,t,n,i){eU=i;try{var r=t=t?ee(C,t):"";if("/"===r.charAt(0))t=r;else{var a=-100===e?"/":eS(e).path;if(0==r.length)throw new em(44);t=a+"/"+r}var o=i?Y():0;return eD(t,n,o).fb}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return-e.eb}},P:()=>B(""),o:(e,t,n)=>{e=e$(e),t=eZ(t,"wrapper"),n=eG(n);var i=t.wa,r=i.Ta,a=i.Ha.Ta,o=i.Ha.constructor;return e=ej(e,function(...e){for(var t of i.Ha.Dc)if(this[t]===a[t])throw new eY(`Pure virtual function ${t} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:r}),this.__construct(...e)}),r.__construct=function(...e){if(this===r)throw new eW("Pass correct 'this' to __construct");e=o.implement(this,...e),e0(e);var t=e.va;if(e.notifyOnDestruction(),t.nb=!0,Object.defineProperties(this,{va:{value:t}}),e2(this),e=eK(i,e=t.Ba),eq.hasOwnProperty(e))throw new eW(`Tried to register registered instance: ${e}`);eq[e]=this},r.__destruct=function(){if(this===r)throw new eW("Pass correct 'this' to __destruct");e0(this);var e=this.va.Ba;if(e=eK(i,e),eq.hasOwnProperty(e))delete eq[e];else throw new eW(`Tried to unregister unregistered instance: ${e}`)},e.prototype=Object.create(r),Object.assign(e.prototype,n),eX(e)},_:e=>{var t=e4[e];delete e4[e];var n=t.bc,i=t.Wa,r=t.tc;e7([e],r.map(e=>e.ld).concat(r.map(e=>e.Cd)),e=>{var a,o,s={};for([a,o]of r.entries()){let t=e[a],n=o.jd,i=o.kd,u=e[a+r.length],l=o.Bd,c=o.Dd;s[o.ed]={read:e=>t.Aa(n(i,e)),write:(e,t)=>{var n=[];l(c,e,u.Ea(n,t)),e6(n)},optional:t.optional}}return[{name:t.name,Aa:e=>{var t,n={};for(t in s)n[t]=s[t].read(e);return i(e),n},Ea:(e,t)=>{for(var r in s)if(!(r in t||s[r].optional))throw TypeError(`Missing field: "${r}"`);var a=n();for(r in s)s[r].write(a,t[r]);return null!==e&&e.push(i,a),a},Na:e3,La:i}]})},u:(e,t,n,i,r)=>{t=e$(t);let a=e=>e;if(i=0n===i){let e=8*n;r=(a=t=>BigInt.asUintN(e,t))(r)}te(e,{name:t,Aa:a,Ea:(e,t)=>("number"==typeof t&&(t=BigInt(t)),t),Na:tt(t,n,!i),La:null})},V:(e,t,n,i)=>{te(e,{name:t=e$(t),Aa:function(e){return!!e},Ea:function(e,t){return t?n:i},Na:function(e){return this.Aa(C[e])},La:null})},c:(e,t,n,i,r,a,o,s,u,l,c,d,h)=>{c=e$(c),a=ty(r,a),s&&=ty(o,s),l&&=ty(u,l),h=ty(d,h);var f,p,v=48<=(p=(f=(f=c).replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0))&&57>=p?`_${f}`:f;ts(v,function(){tw(`Cannot construct ${c} due to unbound types`,[i])}),e7([e,t,n],i?[i]:[],t=>{if(t=t[0],i)var n,r=t.wa,o=r.Ta;else o=tr.prototype;var u=Object.create(o,{constructor:{value:t=ej(c,function(...e){if(Object.getPrototypeOf(this)!==u)throw new eW(`Use 'new' to construct ${c}`);if(void 0===d.jb)throw new eW(`${c} has no accessible constructor`);var t=d.jb[e.length];if(void 0===t)throw new eW(`Tried to invoke ctor of ${c} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.jb).toString()}) parameters instead!`);return t.apply(this,e)})}});t.prototype=u;var d=new tu(c,t,u,h,r,a,s,l);return d.Ha&&((n=d.Ha).vb??(n.vb=[]),d.Ha.vb.push(d)),r=new tm(c,d,!0,!1,!1),n=new tm(c+"*",d,!1,
1!1,!1),o=new tm(c+" const*",d,!1,!0,!1),ta[e]={pointerType:n,Yc:o},tb(v,t),[r,n,o]})},k:(e,t,n,i,r,a,o)=>{var s=tR(n,i);t=tI(t=e$(t)),a=ty(r,a),e7([],[e],e=>{function i(){tw(`Cannot call ${r} due to unbound types`,s)}e=e[0];var r=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var u=e.wa.constructor;return void 0===u[t]?(i.$a=n-1,u[t]=i):(to(u,t,r),u[t].Fa[n-1]=i),e7([],s,i=>{if(i=t_(r,[i[0],null].concat(i.slice(1)),null,a,o),void 0===u[t].Fa?(i.$a=n-1,u[t]=i):u[t].Fa[n-1]=i,e.wa.vb)for(let n of e.wa.vb)n.constructor.hasOwnProperty(t)||(n.constructor[t]=i);return[]}),[]})},q:(e,t,n,i,r,a,o,s)=>{t=e$(t),a=ty(r,a),e7([],[e],e=>{e=e[0];var r=`${e.name}.${t}`,u={get(){tw(`Cannot access ${r} due to unbound types`,[n])},enumerable:!0,configurable:!0};return u.set=s?()=>{tw(`Cannot access ${r} due to unbound types`,[n])}:()=>{throw new eW(`${r} is a read-only property`)},Object.defineProperty(e.wa.constructor,t,u),e7([],[n],n=>{n=n[0];var r={get:()=>n.Aa(a(i)),enumerable:!0};return s&&(s=ty(o,s),r.set=e=>{var t=[];s(i,n.Ea(t,e)),e6(t)}),Object.defineProperty(e.wa.constructor,t,r),[]}),[]})},n:(e,t,n,i,r,a)=>{var o=tR(t,n);r=ty(i,r),e7([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(void 0===e.wa.jb&&(e.wa.jb=[]),void 0!==e.wa.jb[t-1])throw new eW(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.wa.jb[t-1]=()=>{tw(`Cannot construct ${e.name} due to unbound types`,o)},e7([],o,i=>(i.splice(1,0,null),e.wa.jb[t-1]=t_(n,i,null,r,a),[])),[]})},a:(e,t,n,i,r,a,o,s)=>{var u=tR(n,i);t=tI(t=e$(t)),a=ty(r,a),e7([],[e],e=>{function i(){tw(`Cannot call ${r} due to unbound types`,u)}e=e[0];var r=`${e.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.wa.Dc.push(t);var l=e.wa.Ta,c=l[t];return void 0===c||void 0===c.Fa&&c.className!==e.name&&c.$a===n-2?(i.$a=n-2,i.className=e.name,l[t]=i):(to(l,t,r),l[t].Fa[n-2]=i),e7([],u,i=>(i=t_(r,i,e,a,o),void 0===l[t].Fa?(i.$a=n-2,l[t]=i):l[t].Fa[n-2]=i,[])),[]})},b:(e,t,n,i,r,a,o,s,u,l)=>{t=e$(t),r=ty(i,r),e7([],[e],e=>{e=e[0];var i=`${e.name}.${t}`,c={get(){tw(`Cannot access ${i} due to unbound types`,[n,o])},enumerable:!0,configurable:!0};return c.set=u?()=>tw(`Cannot access ${i} due to unbound types`,[n,o]):()=>{throw new eW(i+" is a read-only property")},Object.defineProperty(e.wa.Ta,t,c),e7([],u?[n,o]:[n],n=>{var o=n[0],c={get(){var t=tS(this,e,i+" getter");return o.Aa(r(a,t))},enumerable:!0};if(u){u=ty(s,u);var d=n[1];c.set=function(t){var n=tS(this,e,i+" setter"),r=[];u(l,n,d.Ea(r,t)),e6(r)}}return Object.defineProperty(e.wa.Ta,t,c),[]}),[]})},T:e=>te(e,tF),m:(t,n,i,r,a)=>{switch(n=e$(n),a=0===a?"object":1===a?"number":"string"){case"object":function o(){}o.values={},te(t,{name:n,constructor:o,valueType:a,Aa:function(e){return this.constructor.values[e]},Ea:(e,t)=>t.value,Na:tE(n,i,r),La:null}),ts(n,o);break;case"number":var s={};te(t,{name:n,$b:s,valueType:a,Aa:e=>e,Ea:(e,t)=>t,Na:tE(n,i,r),La:null}),ts(n,s),delete e[n].$a;break;case"string":te(t,{name:n,Nc:{},Gc:{},$b:s={},valueType:a,Aa:function(e){return this.Gc[e]},Ea:function(e,t){return this.Nc[t]},Na:tE(n,i,r),La:null}),ts(n,s),delete e[n].$a}},d:(e,t,n)=>{var i=eZ(e,"enum");switch(t=e$(t),i.valueType){case"object":e=i.constructor,i=Object.create(i.constructor.prototype,{value:{value:n},constructor:{value:ej(`${i.name}_${t}`,function(){})}}),e.values[n]=i,e[t]=i;break;case"number":i.$b[t]=n;break;case"string":i.Nc[t]=n,i.Gc[n]=t,i.$b[t]=t}},t:(e,t,n)=>{te(e,{name:t=e$(t),Aa:e=>e,Ea:(e,t)=>t,Na:((e,t)=>{switch(t){case 4:return function(e){return this.Aa(M[e>>2])};case 8:return function(e){return this.Aa(F[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}})(t,n),La:null})},g:(e,t,n,i,r,a)=>{var o=tR(t,n);e=tI(e=e$(e)),r=ty(i,r),ts(e,function(){tw(`Cannot call ${e} due to unbound types`,o)},t-1),e7([],o,n=>(tb(e,t_(e,[n[0],null].concat(n.slice(1)),null,r,a),t-1),[]))},l:(e,t,n,i,r)=>{t=e$(t);let a=e=>e;if(0===i){var o=32-8*n;r=(a=e=>e<<o>>>o)(r)}te(e,{name:t,Aa:a,Ea:(e,t)=>t,Na:tt(t,n,0!==i),La:null})},i:(e,t,n)=>{function i(e){return new r(_.buffer,S[e+4>>2],S[e>>2])}
1var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];te(e,{name:n=e$(n),Aa:i,Na:i},{md:!0})},U:(e,t)=>{te(e,{name:t=e$(t),Aa(e){var t=(t=e+4)?ee(C,t,S[e>>2],!0):"";return tZ(e),t},Ea(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;if(!(n||ArrayBuffer.isView(t)&&1==t.BYTES_PER_ELEMENT))throw new eW("Cannot pass non-string to std::string");var i=n?en(t):t.length,r=t0(4+i+1),a=r+4;return S[r>>2]=i,n?ei(t,C,a,i+1):C.set(t,a),null!==e&&e.push(tZ,r),r},Na:e3,La(e){tZ(e)}})},p:(e,t,n)=>{if(n=e$(n),2===t)var i=tP,r=tk,a=tT;else i=tO,r=tL,a=tD;te(e,{name:n,Aa:e=>{var n=i(e+4,S[e>>2]*t,!0);return tZ(e),n},Ea:(e,i)=>{if("string"!=typeof i)throw new eW(`Cannot pass non-string to C++ string type ${n}`);var o=a(i),s=t0(4+o+t);return S[s>>2]=o/t,r(i,s+4,o+t),null!==e&&e.push(tZ,s),s},Na:e3,La(e){tZ(e)}})},aa:(e,t,n,i,r,a)=>{e4[e]={name:e$(t),bc:ty(n,i),Wa:ty(r,a),tc:[]}},$:(e,t,n,i,r,a,o,s,u,l)=>{e4[e].tc.push({ed:e$(t),ld:n,jd:ty(i,r),kd:a,Cd:o,Bd:ty(s,u),Dd:l})},W:(e,t)=>{te(e,{sd:!0,name:t=e$(t),Aa:()=>{},Ea:()=>{}})},A:()=>{X=!1,tB=0},y:()=>{throw 1/0},f:(e,t,n)=>{var i,r,[a,...o]=((e,t)=>{for(var n=Array(e),i=0;i<e;++i)n[i]=eZ(S[t+4*i>>2],`parameter ${i}`);return n})(e,t),s=a.Ea.bind(a),u=o.map(e=>e.Na.bind(e)),l=Array(--e);return i=ej(t=`methodCaller<(${o.map(e=>e.name)}) => ${a.name}>`,(t,i,r,a)=>{for(var o=0,c=0;c<e;++c)l[c]=u[c](a+o),o+=8;switch(n){case 0:var d=eG(t).apply(null,l);break;case 2:d=Reflect.construct(eG(t),l);break;case 3:d=l[0];break;case 1:d=eG(t)[tU(i)](...l)}return d=s(t=[],d),t.length&&(S[r>>2]=eX(t)),d}),r=tV.length,tV.push(i),r},ca:tM,X:t=>eX(e[t=tU(t)]),Y:(e,t)=>eX((e=eG(e))[t=eG(t)]),v:e=>{9<e&&(eH[e+1]+=1)},e:(e,t,n,i,r)=>tV[e](t,n,i,r),Z:()=>eX([]),ba:e=>eX(tU(e)),da:()=>eX({}),w:e=>{e6(eG(e)),tM(e)},h:(e,t,n)=>{e=eG(e),t=eG(t),n=eG(n),e[t]=n},D:function(e,t){e=new Date(1e3*(e=-0x20000000000000>e||0x20000000000000<e?NaN:Number(e))),I[t>>2]=e.getUTCSeconds(),I[t+4>>2]=e.getUTCMinutes(),I[t+8>>2]=e.getUTCHours(),I[t+12>>2]=e.getUTCDate(),I[t+16>>2]=e.getUTCMonth(),I[t+20>>2]=e.getUTCFullYear()-1900,I[t+24>>2]=e.getUTCDay(),I[t+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},E:function(e,t){e=new Date(1e3*(e=-0x20000000000000>e||0x20000000000000<e?NaN:Number(e))),I[t>>2]=e.getSeconds(),I[t+4>>2]=e.getMinutes(),I[t+8>>2]=e.getHours(),I[t+12>>2]=e.getDate(),I[t+16>>2]=e.getMonth(),I[t+20>>2]=e.getFullYear()-1900,I[t+24>>2]=e.getDay();var n=e.getFullYear();I[t+28>>2]=(0!=n%4||0==n%100&&0!=n%400?tz:tj)[e.getMonth()]+e.getDate()-1|0,I[t+36>>2]=-(60*e.getTimezoneOffset()),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var i=new Date(e.getFullYear(),0,1).getTimezoneOffset();I[t+32>>2]=0|(n!=i&&e.getTimezoneOffset()==Math.min(i,n))},B:(e,t)=>{if(tH[e]&&(clearTimeout(tH[e].id),delete tH[e]),!t)return 0;var n=setTimeout(()=>{delete tH[e];var t=()=>t3(e,performance.now());if(!T)try{if(t(),!(X||0<tB))try{y=t=y,tG(t)}catch(e){tW(e)}}catch(e){tW(e)}},t);return tH[e]={id:n,ae:t},0},F:(e,t,n,i)=>{var r=(new Date).getFullYear(),a=new Date(r,0,1).getTimezoneOffset();r=new Date(r,6,1).getTimezoneOffset(),S[e>>2]=60*Math.max(a,r),I[t>>2]=Number(a!=r),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?"-":"+"}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`})(a),t=t(r),r<a?(ei(e,C,n,17),ei(t,C,i,17)):(ei(e,C,i,17),ei(t,C,n,17))},O:function(e,t,n){return 0<=e&&3>=e?(E[n>>3]=BigInt(Math.round(1e6*(0===e?Date.now():performance.now()))),0):28},j:(e,t,n)=>{tX.length=0;for(var i;i=C[t++];){var r=105!=i;r&=112!=i,n+=r&&n%8?4:0,tX.push(112==i?S[n>>2]:106==i?E[n>>3]:105==i?I[n>>2]:F[n>>3]),n+=r?8:4}return nt[e](...tX)},N:()=>Date.now(),Q:()=>performance.now(),C:e=>{var t=C.length;if(0x80000000<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var i=t*(1+.2/n);i=Math.min(i,e+0x6000000);e:{i=(Math.min(0x80000000,65536*Math.ceil(Math.max(e,i)/65536))-t7.buffer.byteLength+65535)/65536|0;try{t7.grow(i),D();var r=1;break e}catch(e){}r=void 0}if(r)return!0}return!1},H:(e,t)=>{var n,i=0,r=0;for(n of t$()){var a=t+i;S[e+r>>2]=a,i+=ei(n,C,a,1/0)+1,r+=4}return 0},I:(e,t)=>{var n=t$();for(var i of(S[e>>2]=n.length,e=0,n))e+=en(i)+1;return S[t>>2]=e,0},r:function(e){try{var t=eS(e);if(null===t.fb)throw new em(8);t.Yb&&(t.Yb=null);try{t.xa.close&&t.xa.close(t)}catch(e){throw e}finally{ec[t.fb]=null}return t.fb=null,0}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return e.eb}},K:function(e,t,n,i){try{e:{var r=eS(e);e=t;for(var a,o=t=0;o<n;o++){var s=S[e>>2],u=S[e+4>>2];e+=8;var l=a,c=_;if(0>u||0>l)throw new em(28);if(null===r.fb||1==(2097155&r.flags))throw new em(8);if(16384==(61440&r.node.mode))throw new em(31);if(!r.xa.read)throw new em(28);var d=void 0!==l;if(d){if(!r.seekable)throw new em(70)}else l=r.position;var h=r.xa.read(r,c,s,u,l);if(d||(r.position+=h),0>h){var f=-1;break e}if(t+=h,h<u)break;void 0!==a&&(a+=h)}f=t}return S[i>>2]=f,0}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return e.eb}},G:function(e,t,n,i){t=-0x20000000000000>t||0x20000000000000<t?NaN:Number(t);try{if(isNaN(t))return 61;var r=eS(e);return eB(r,t,n),E[i>>3]=BigInt(r.position),r.Yb&&0===t&&0===n&&(r.Yb=null),0}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return e.eb}},J:function(e,t,n,i){try{e:{var r=eS(e);e=t;for(var a,o=t=0;o<n;o++){var s=S[e>>2],u=S[e+4>>2];e+=8;var l=a,c=_;if(0>u||0>l)throw new em(28);if(null===r.fb||0==(2097155&r.flags))throw new em(8);if(16384==(61440&r.node.mode))throw new em(31);if(!r.xa.write)throw new em(28);r.seekable&&1024&r.flags&&eB(r,0,2);var d=void 0!==l;if(d){if(!r.seekable)throw new em(70)}else l=r.position;var h=r.xa.write(r,c,s,u,l,void 0);if(d||(r.position+=h),0>h){var f=-1;break e}if(t+=h,h<u)break;void 0!==a&&(a+=h)}f=t}return S[i>>2]=f,0}catch(e){if(void 0===eN||"ErrnoError"!==e.name)throw e;return e.eb}}
1,x:function(e,t,n){var i=t9();try{ne.get(e)(t,n)}catch(e){if(t8(i),e!==e+0)throw e;t5(1,0)}},R:function(){return -1<navigator.platform.indexOf("Win")},z:tG,S:function(t,n,i){n=new Uint8Array(t7.buffer,n,i),(i=new Uint8Array(i)).set(n),createImageBitmap(new Blob([i])).then(function(n){var i=new OffscreenCanvas(n.width,n.height).getContext("2d");i.drawImage(n,0,0);var r=(i=i.getImageData(0,0,n.width,n.height)).data.length,a=e.Uc(r);new Uint8Array(t7.buffer,a,r).set(i.data),e.Id(t,n.width,n.height,a,r)}).catch(function(n){n=n.message||"decode failed";var i=e.Xd(n)+1,r=e.Uc(i);e.$d(n,r,i),e.Jd(t,r),e.Hd(r)})}};function ni(){if(e.calledRun=!0,!T){if(L=!0,!e.noFSInit&&!ef){var t,n;ef=!0,t??=e.stdin,n??=e.stdout,i??=e.stderr,t?eV("stdin",t):eL("/dev/tty","/dev/stdin"),n?eV("stdout",null,n):eL("/dev/tty","/dev/stdout"),i?eV("stderr",null,i):eL("/dev/tty1","/dev/stderr"),eD("/dev/stdin",0),eD("/dev/stdout",1),eD("/dev/stderr",1)}if(r.fa(),ep=!1,g?.(e),e.onRuntimeInitialized?.(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var i=e.postRun.shift();H.push(i)}z(H)}}if(r=await async function(){function t(t){return tZ=(t=r=t.exports).ga,t0=t.ha,t1=t.ia,e._wasm_image_decode_complete=t.ja,e._wasm_image_decode_error=t.ka,t2=e._ma_device__on_notification_unlocked=t.la,e._ma_malloc_emscripten=t.ma,e._ma_free_emscripten=t.na,t4=e._ma_device_process_pcm_frames_capture__webaudio=t.oa,t6=e._ma_device_process_pcm_frames_playback__webaudio=t.pa,t3=t.ra,t5=t.sa,t8=t.ta,t9=t.ua,t7=t.ea,ne=t.qa,D(),r}var n={a:nn};return e.instantiateWasm?new Promise(i=>{e.instantiateWasm(n,(e,n)=>{i(t(e))})}):(tC??=e.locateFile?e.locateFile("canvas_advanced.wasm",m):m+"canvas_advanced.wasm",t((await U(n)).instance))}(),e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)G();return z(W),e.setStatus?(e.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>e.setStatus(""),1),ni()},1)):ni(),L?e:new Promise((e,t)=>{g=e,w=t})})},e=>{e.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.42.2","description":"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}}')},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>r.AccessibilityOverlay,CHECK_STATE_MASK:()=>a.CHECK_STATE_MASK,CHECK_STATE_OFFSET:()=>a.CHECK_STATE_OFFSET,SemanticActionType:()=>a.SemanticActionType,SemanticCheckState:()=>a.SemanticCheckState,SemanticMode:()=>a.SemanticMode,SemanticRole:()=>a.SemanticRole,SemanticState:()=>a.SemanticState,SemanticTrait:()=>a.SemanticTrait,SemanticTreeModel:()=>i.SemanticTreeModel,checkStateOf:()=>a.checkStateOf,hasState:()=>a.hasState,hasTrait:()=>a.hasTrait,roleName:()=>a.roleName,stateNames:()=>a.stateNames,traitNames:()=>a.traitNames});var i=n(7),r=n(9),a=n(8)},(e,t,n)=>{n.r(t),n.d(t,{SemanticTreeModel:()=>a});var i=n(8),r=function(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},a=function(){function e(){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(e.prototype,"nodeCount",{get:function(){return this._nodesById.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticVersion",{get:function(){return this._semanticVersion}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryVersion",{get:function(){return this._geometryVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryChangedIds",{get:function(){return this._geometryChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"semanticChangedIds",{get:function(){return this._semanticChangedIds},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roots",{get:function(){return this._roots},enumerable:!1,configurable:!0}),e.prototype.nodeById=function(e){return this._nodesById.get(e)},e.prototype.siblingIndexOf=function(e){var t=this._nodesById.get(e);if(!t)return -1;if(t.parentId<0)return this._roots.indexOf(e);var n=this._nodesById.get(t.parentId);return n?n.children.indexOf(e):-1},e.prototype.detach=function(e){var t=this._nodesById.get(e);if(t)if(t.parentId<0){var n=this._roots.indexOf(e);-1!==n&&this._roots.splice(n,1)}else{var i=this._nodesById.get(t.parentId);if(i){var n=i.children.indexOf(e);-1!==n&&i.children.splice(n,1)}}},e.prototype.attach=function(e,t,n){var i=this._nodesById.get(e);if(i)if(t<0){i.parentId=-1;var r,a,o=(r=n,a=this._roots.length,r<0?0:r>a?a:r);this._roots.splice(o,0,e)}else{var s=this._nodesById.get(t);if(s){i.parentId=t;var u,l,o=(u=n,l=s.children.length,u<0?0:u>l?l:u);s.children.splice(o,0,e)}else i.parentId=-1,this._roots.push(e)}},e.prototype.removeSubtree=function(e){var t=this._nodesById.get(e);if(t){for(var n=r([],t.children,!0),i=0;i<n.length;i++){var a=n[i];this.removeSubtree(a)}this.detach(e),this._nodesById.delete(e)}},e.prototype.applyDiff=function(e){var t,n,i=this;this._geometryChangedIds.clear(),this._semanticChangedIds.clear();for(var r=!1,a=!1,d=function(){r=!0},h=function(e){r=!0,i._semanticChangedIds.add(e)},f=function(e){a=!0,i._geometryChangedIds.add(e)},p=0,v=e.removed;p<v.length;p++){var m=v[p];this._nodesById.has(m)&&(this.removeSubtree(m),d())}for(var b=0,y=e.added;b<y.length;b++){var g,w=y[b],_=this._nodesById.get(w.id);_?(s(_,w)&&(l(_,w),h(w.id)),u(_,w)&&(c(_,w),f(w.id))):(this._nodesById.set(w.id,{id:(g=w).id,parentId:-1,role:g.role,label:g.label,value:g.value,hint:g.hint,stateFlags:g.stateFlags,traitFlags:g.traitFlags,headingLevel:g.headingLevel,minX:g.minX,minY:g.minY,maxX:g.maxX,maxY:g.maxY,children:[]}),h(w.id),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex)}for(var C=0,A=e.moved;C<A.length;C++){var w=A[C],_=this._nodesById.get(w.id);if(_){var R=_.parentId!==w.parentId,I=this.siblingIndexOf(w.id);u(_,w)&&(c(_,w),f(w.id)),this.detach(w.id),this.attach(w.id,w.parentId,w.siblingIndex),(R||this.siblingIndexOf(w.id)!==I)&&d()}}for(var S=0,M=e.childrenUpdated;S<M.length;S++){var F=M[S];if(F.parentId<0){var E=F.childIds.filter(function(e){return i._nodesById.has(e)});if(!o(this._roots,E)){this._roots.length=0,(t=this._roots).push.apply(t,E);for(var x=0,P=this._roots;x<P.length;x++){var m=P[x],k=this._nodesById.get(m);k&&(k.parentId=-1)}d()}}else{var T=this._nodesById.get(F.parentId);if(!T)continue;var E=F.childIds.filter(function(e){return i._nodesById.has(e)});if(!o(T.children,E)){T.children.length=0,(n=T.children).push.apply(n,E);for(var O=0,L=T.children;O<L.length;O++){var m=L[O],k=this._nodesById.get(m);k&&(k.parentId=F.parentId)}d()}}}for(var D=0,B=e.updatedSemantic;D<B.length;D++){var w=B[D],_=this._nodesById.get(w.id);_&&s(_,w)&&(l(_,w),h(w.id))}for(var V=0,N=e.updatedGeometry;V<N.length;V++){var w=N[V],_=this._nodesById.get(w.id);_&&u(_,w)&&(c(_,w),f(w.id))}(r||a)&&(r&&this._semanticVersion++,a&&this._geometryVersion++,this._debug&&this.logDiff(e,r,a))},Object.defineProperty(e.prototype,"debug",{set:function(e){this._debug=e},enumerable:!1,configurable:!0}),e.prototype.logDiff=function(e,t,n){for(var r=["[rive:semantics] semantic v".concat(this._semanticVersion)+(n?" geometry v".concat(this._geometryVersion):"")+(t?"":" (geometry-only)")],a=0,o=e.removed;a<o.length;a++){var s=o[a];r.push("  - removed #".concat(s))}for(var u=0,l=e.added;u<l.length;u++){var c=l[u];r.push("  + added #".concat(c.id," ").concat((0,i.roleName)(c.role))+(c.label?' "'.concat(c.label,'"'):"")+" bounds:(".concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")")+" states=[".concat((0,i.stateNames)(c.stateFlags),"]")+" traits=[".concat((0,i.traitNames)(c.traitFlags),"]"))}for(var d=0,h=e.moved;d<h.length;d++){var c=h[d];r.push("  ~ moved #".concat(c.id," → parent=").concat(c.parentId," idx=").concat(c.siblingIndex)+" bounds:(".concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")"))}for(var f=0,p=e.childrenUpdated;f<p.length;f++){var v=p[f];r.push("  ↕ children of ".concat(v.parentId<0?"root":"#"+v.parentId,": [").concat(v.childIds.join(", "),"]"))}for(var m=0,b=e.updatedSemantic;m<b.length;m++){var c=b[m];r.push("  ✎ semantic #".concat(c.id," ").concat((0,i.roleName)(c.role))+(c.label?' "'.concat(c.label,'"'):"")+" states=[".concat((0,i.stateNames)(c.stateFlags),"]")+" traits=[".concat((0,i.traitNames)(c.traitFlags),"]"))}for(var y=0,g=e.updatedGeometry;y<g.length;y++){var c=g[y];
1r.push("  ⊞ geometry #".concat(c.id," (").concat(c.minX.toFixed(1),",").concat(c.minY.toFixed(1),")-(").concat(c.maxX.toFixed(1),",").concat(c.maxY.toFixed(1),")"))}console.log(r.join("\n"))},e.prototype.flattened=function(){for(var e=this,t=[],n=function(i,r){var a=e._nodesById.get(i);if(a){t.push({depth:r,node:a});for(var o=0,s=a.children;o<s.length;o++)n(s[o],r+1)}},i=0,r=this._roots;i<r.length;i++)n(r[i],0);return t},e}();function o(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function s(e,t){return e.role!==t.role||e.label!==t.label||e.value!==t.value||e.hint!==t.hint||e.stateFlags!==t.stateFlags||e.traitFlags!==t.traitFlags||e.headingLevel!==t.headingLevel}function u(e,t){return e.minX!==t.minX||e.minY!==t.minY||e.maxX!==t.maxX||e.maxY!==t.maxY}function l(e,t){e.role=t.role,e.label=t.label,e.value=t.value,e.hint=t.hint,e.stateFlags=t.stateFlags,e.traitFlags=t.traitFlags,e.headingLevel=t.headingLevel}function c(e,t){e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY}},(e,t,n)=>{n.r(t),n.d(t,{CHECK_STATE_MASK:()=>u,CHECK_STATE_OFFSET:()=>s,SemanticActionType:()=>f,SemanticCheckState:()=>o,SemanticMode:()=>c,SemanticRole:()=>i,SemanticState:()=>r,SemanticTrait:()=>d,checkStateOf:()=>l,hasState:()=>a,hasTrait:()=>h,roleName:()=>_,stateNames:()=>C,traitNames:()=>A});var i={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},r={None:0,Expanded:1,Selected:2,Toggled:16,Required:32,Disabled:64,Focused:128,Hidden:256,LiveRegion:512,ReadOnly:1024,Modal:2048,Obscured:4096,Multiline:8192};function a(e,t){return(e&t)!=0}var o={Unchecked:0,Checked:1,Mixed:2},s=2,u=12;function l(e){var t=(e&u)>>s;return t>=o.Mixed?o.Mixed:t}var c={Disabled:"disabled",Enabled:"enabled"},d={None:0,Expandable:1,Selectable:2,Checkable:4,Toggleable:8,Requirable:16,Enablable:32,Focusable:64};function h(e,t){return(e&t)!=0}for(var f={tap:0,increase:1,decrease:2},p={},v=0,m=Object.entries(i);v<m.length;v++){var b=m[v],y=b[0];p[b[1]]=y}var g=Object.entries(r).filter(function(e){return 0!==e[1]}),w=Object.entries(d).filter(function(e){return 0!==e[1]});function _(e){var t;return null!=(t=p[e])?t:"unknown(".concat(e,")")}function C(e){if(0===e)return"none";for(var t=[],n=0;n<g.length;n++){var i=g[n],r=i[0];e&i[1]&&t.push(r)}switch(l(e)){case o.Checked:t.push("Checked");break;case o.Mixed:t.push("Mixed")}return t.join(", ")||"none"}function A(e){if(0===e)return"none";for(var t=[],n=0;n<w.length;n++){var i=w[n],r=i[0];e&i[1]&&t.push(r)}return t.join(", ")||"none"}},(e,t,n)=>{n.r(t),n.d(t,{AccessibilityOverlay:()=>r});var i=n(8),r=function(){function e(e){var t,n=this;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 n.scheduleReposition()},this.instanceId=e.instanceId,this.fireAction=e.fireAction,this.requestFocus=e.requestFocus,this.clearFocus=e.clearFocus,this.canvas=e.canvas,this.semanticsOptions=e.semanticsOptions,this.allowFocusInterrupt=null!=(t=e.allowFocusInterrupt)&&t,this.container=this.createContainer(e.canvas),this.attachPositionObservers()}return e.prototype.getSemanticOverlayContainer=function(){return this.container},e.prototype.attachPositionObservers=function(){var e=this;this.canvasResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.canvasResizeObserver.observe(this.canvas);var t=this.canvas.parentElement;t&&(this.parentResizeObserver=new ResizeObserver(function(){return e.scheduleReposition()}),this.parentResizeObserver.observe(t)),window.addEventListener("resize",this._onWindowResize),this.observePosition()},e.prototype.observePosition=function(){var e,t=this;if(!("u"<typeof IntersectionObserver)){null==(e=this.positionObserver)||e.disconnect(),this.positionObserver=null;var n=this.canvas.getBoundingClientRect();if(n.width&&n.height){var i=[n.top,window.innerWidth-n.right,window.innerHeight-n.bottom,n.left].map(function(e){return"".concat(-Math.round(e),"px")}
1).join(" "),r=!1;this.positionObserver=new IntersectionObserver(function(){if(!r){r=!0;return}t.scheduleReposition()},{threshold:1,rootMargin:i}),this.positionObserver.observe(this.canvas)}}},e.prototype.scheduleReposition=function(){var e=this;this._geometryDirty=!0,null===this.repositionTimer&&(this.repositionTimer=setTimeout(function(){e.repositionTimer=null,e.syncContainerGeometry(),e.observePosition()},500))},e.prototype.syncContainerGeometry=function(){var e=this.canvas.getBoundingClientRect(),t=this.canvas.offsetTop,n=this.canvas.offsetLeft;(e.width!==this.lastCanvasPositioning.width||e.height!==this.lastCanvasPositioning.height||t!==this.lastCanvasPositioning.offsetTop||n!==this.lastCanvasPositioning.offsetLeft)&&(this.container.style.top=t+"px",this.container.style.left=n+"px",this.container.style.width=e.width+"px",this.container.style.height=e.height+"px",this.container.tabIndex=-1,this.lastCanvasPositioning.width=e.width,this.lastCanvasPositioning.height=e.height,this.lastCanvasPositioning.offsetTop=t,this.lastCanvasPositioning.offsetLeft=n)},e.prototype.createContainer=function(e){var t,n,i=document.createElement("div");i.id="rive-a11y-".concat(this.instanceId),i.setAttribute("role","region"),i.setAttribute("aria-label",null!=(n=null==(t=this.semanticsOptions)?void 0:t.riveCanvasLabel)?n:"Rive animation");var r=e.getBoundingClientRect();return i.style.cssText=["position:absolute","top:".concat(e.offsetTop,"px"),"left:".concat(e.offsetLeft,"px"),"width:".concat(r.width,"px"),"height:".concat(r.height,"px"),"overflow:hidden;pointer-events:none;opacity:0"].join(";"),e.insertAdjacentElement("afterend",i),i},e.prototype.needsUpdate=function(e){var t=e.semanticVersion!==this.lastSemanticVersion,n=e.geometryVersion!==this.lastGeometryVersion,i=this._geometryDirty||!this.transformContainer;return t||n||i?{semanticChanged:t,nodeGeometryChanged:n,layoutChanged:i}:null},e.prototype.update=function(e,t,n,i,r){var a=null!=r?r:this.needsUpdate(e);!a&&t&&(a={semanticChanged:!1,nodeGeometryChanged:!1,layoutChanged:!0}),a&&this.performUpdate(e,t,n,i,a)},e.prototype.performUpdate=function(e,t,n,i,r){var a,o=r.semanticChanged,s=r.nodeGeometryChanged,u=e.semanticVersion-this.lastSemanticVersion>1;if(this.lastSemanticVersion=e.semanticVersion,this.lastGeometryVersion=e.geometryVersion,this.isUpdating=!0,this._artboardBounds=i,t&&(this.syncContainerGeometry(),this.syncTransformContainer(t,n,i),this._geometryDirty=!1),o){var l=null!=(a=this.transformContainer)?a:this.container,c=new Set;this.rebuildChildren(l,e.roots,e,0,0,c,u);var d=[];this.elements.forEach(function(e,t){c.has(t)||d.push(t)});for(var h=0;h<d.length;h++){var f=d[h],p=this.elements.get(f);p&&p.parentNode&&p.parentNode.removeChild(p),this.elements.delete(f);var v=this.descElements.get(f);v&&v.parentNode&&v.parentNode.removeChild(v),this.descElements.delete(f)}}else s&&this.updateGeometryForChangedNodes(e);this.flushTextGeometry(),this.isUpdating=!1},e.prototype.destroy=function(){var e,t,n;null!==this.repositionTimer&&(clearTimeout(this.repositionTimer),this.repositionTimer=null),window.removeEventListener("resize",this._onWindowResize),null==(e=this.canvasResizeObserver)||e.disconnect(),null==(t=this.parentResizeObserver)||t.disconnect(),null==(n=this.positionObserver)||n.disconnect(),this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.elements.clear(),this.descElements.clear(),this.pendingTextGeometry.length=0},e.prototype.rebuildChildren=function(e,t,n,r,a,o,s){for(var u=0;u<t.length;u++){var l=t[u],c=n.nodeById(l);if(c){o.add(l);var d=this.elements.get(l),h=!d;d||(d=this.createElement(c),this.elements.set(l,d)),(h||s||n.semanticChangedIds.has(l))&&this.applyAttributes(d,c),this.applyPosition(d,c,r,a);var f=e.children[u];if(f!==d&&(f?e.insertBefore(d,f):e.appendChild(d)),(0,i.hasTrait)(c.traitFlags,i.SemanticTrait.Focusable)&&(0,i.hasState)(c.stateFlags,i.SemanticState.Focused)){var p=document.activeElement,v=null==p?void 0:p.closest('[aria-modal="true"]'),m=!!v&&this.container.contains(v)&&!v.contains(d);p!==d&&!m&&this.canMoveFocus()&&d.focus()}c.children.length>0&&this.rebuildChildren(d,c.children,n,c.minX,c.minY,o,s),h&&this.autoFocusDialogOnAppear(d,c,n)}}},e.prototype.updateGeometryForChangedNodes=function(e){for(var t,n,i=0,r=Array.from(e.geometryChangedIds);i<r.length;i++){var a=r[i],o=e.nodeById(a);if(o){var s=0,u=0,l=null!=(t=this.transformContainer)?t:this.container;if(o.parentId>=0){var c=e.nodeById(o.parentId);c&&(s=c.minX,u=c.minY,l=null!=(n=this.elements.get(o.parentId))?n:l)}this.updateNodeGeometrySubtree(e,a,s,u,l)}}},e.prototype.updateNodeGeometrySubtree=function(e,t,n,i,r){var a=e.n
1odeById(t);if(a){var o=this.elements.get(t);if(o){this.applyPosition(o,a,n,i);for(var s=0,u=a.children;s<u.length;s++){var l=u[s];this.updateNodeGeometrySubtree(e,l,a.minX,a.minY,o)}}}},e.prototype.canMoveFocus=function(){var e=document.activeElement;return e===this.canvas||this.container.contains(e)||this.allowFocusInterrupt},e.prototype.autoFocusDialogOnAppear=function(e,t,n){if(y(t.role,t.stateFlags)&&this.canMoveFocus()){var i,r=document.activeElement;if(!(r&&r!==e&&e.contains(r))){var a=null!=(i=this.routeDefaultFocusTarget(t,n))?i:e;a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),document.activeElement!==a&&a.focus({preventScroll:!0})}}},e.prototype.routeDefaultFocusTarget=function(e,t){for(var n,r=0,a=e.children;r<a.length;r++){var o=a[r],s=t.nodeById(o);if(s){var u,l=this.elements.get(o);if(l&&(b((u=s).role)||(0,i.hasTrait)(u.traitFlags,i.SemanticTrait.Focusable)))return l;if(s.children.length>0||!s.label){var c=this.routeDefaultFocusTarget(s,t);if(c)return c;continue}if(l)return null!=(n=l.querySelector(":scope > span"))?n:l}}return null},Object.defineProperty(e.prototype,"nodeIdPrefix",{get:function(){return"rive-".concat(this.instanceId,"-sem-")},enumerable:!1,configurable:!0}),e.prototype.nodeIdFromElement=function(e){if(!e.id.startsWith(this.nodeIdPrefix))return null;var t=e.id.slice(this.nodeIdPrefix.length);if(!t)return null;var n=Number(t);return Number.isNaN(n)?null:n},e.prototype.createElement=function(e){var t=function(e){switch(e){case i.SemanticRole.link:return"a";case i.SemanticRole.text:default:return"div"}}(e.role),n=document.createElement(t);if(n.id="".concat(this.nodeIdPrefix).concat(e.id),n.style.cssText=h,e.role===i.SemanticRole.text){var r=document.createElement("span");r.style.cssText=f,n.appendChild(r)}return this.attachActionHandlers(n,e),n},e.prototype.attachRovingNav=function(e,t){var n=this;e.addEventListener("keydown",function(r){var a=null;if("ArrowRight"===r.key||"ArrowDown"===r.key?a="next":"ArrowLeft"===r.key||"ArrowUp"===r.key?a="prev":t.includeHomeEnd&&"Home"===r.key?a="first":t.includeHomeEnd&&"End"===r.key&&(a="last"),a){r.preventDefault();var o=t.members(),s=o.indexOf(e);if(!(s<0)){var u=o.length,l="next"===a?o[(s+1)%u]:"prev"===a?o[(s-1+u)%u]:"first"===a?o[0]:o[u-1];if(l&&l!==e){l.focus();var c=n.nodeIdFromElement(l);null!==c&&n.fireAction(c,i.SemanticActionType.tap)}}}})},e.prototype.attachActionHandlers=function(e,t){var n=this,r=t.role,a=t.id;if(function(e){switch(e){case i.SemanticRole.button:case i.SemanticRole.link:case i.SemanticRole.checkbox:case i.SemanticRole.switchControl:case i.SemanticRole.tab:case i.SemanticRole.radioButton:return!0;default:return!1}}(r)){e.addEventListener("click",function(){n.fireAction(a,i.SemanticActionType.tap)});var o=r===i.SemanticRole.link?["Enter"]:["Enter"," "];e.addEventListener("keydown",function(e){o.includes(e.key)&&(e.preventDefault(),n.fireAction(a,i.SemanticActionType.tap))})}r===i.SemanticRole.slider&&e.addEventListener("keydown",function(e){"ArrowRight"===e.key||"ArrowUp"===e.key?(e.preventDefault(),n.fireAction(a,i.SemanticActionType.increase)):("ArrowLeft"===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),n.fireAction(a,i.SemanticActionType.decrease))}),r===i.SemanticRole.tab&&this.attachRovingNav(e,{includeHomeEnd:!0,members:function(){var t=e.parentElement;return t?Array.from(t.children).filter(function(e){return e instanceof HTMLElement&&"tab"===e.getAttribute("role")}):[]}}),r===i.SemanticRole.radioButton&&this.attachRovingNav(e,{includeHomeEnd:!1,members:function(){var t,n=null!=(t=e.closest('[role="radiogroup"]'))?t:e.parentElement;return n?Array.from(n.querySelectorAll('[role="radio"]')):[]}}),(0,i.hasTrait)(t.traitFlags,i.SemanticTrait.Focusable)&&e.addEventListener("focus",function(){n.requestFocus(a)})},e.prototype.applyAttributes=function(e,t){var n,r,h,f=t.role,g=t.stateFlags,w=t.traitFlags,_=function(e){switch(e){case i.SemanticRole.none:return"group";case i.SemanticRole.button:return"button";case i.SemanticRole.link:return null;case i.SemanticRole.checkbox:return"checkbox";case i.SemanticRole.switchControl:return"switch";case i.SemanticRole.slider:return"slider";case i.SemanticRole.textField:return"textbox";case i.SemanticRole.image:return"img";case i.SemanticRole.group:return"group";case i.SemanticRole.list:return"list";case i.SemanticRole.listItem:return"listitem";case i.SemanticRole.tab:return"tab";case i.SemanticRole.tabList:return"tablist";case i.SemanticRole.dialog:return"dialog";case i.SemanticRole.alertDialog:return"alertdialog";case i.SemanticRole.radioGroup:return"radiogroup";case i.SemanticRole.radioButton:return"radio";case i.SemanticRole.text:default:return null}}(f);if(_?p(e,"role",_):v(e,"role"),f===i.SemanticRole.link&&p(e,"role","link"),b(f)||(0,i.hasTrait)(w,i.SemanticTrait.Focusable)||f===i.SemanticRole.listItem?p(e,"tabindex","-1"):v(e,"tabindex"),t.label?p(e,"aria-label",t.label):v(e,"aria-label"),f===i.SemanticRole.slider){if(t.value){var C=parseFloat(t.value);Number.isFinite(C)?p(e,"aria-valuenow",String(C)):v(e,"aria-valuenow"),p(e,"aria-valuetext",t.value)}else v(e,"aria-valuenow"),v(e,"aria-valuetext");p(e,"aria-orientation","horizontal"),m(e,"aria-readonly",(0,i.hasState)(g,i.SemanticState.ReadOnly))}else v(e,"aria-valuenow"),v(e,"aria-valuetext"),v(e,"aria-orientation"),v(e,"aria-readonly");if(t.hint){var A="rive-".concat(this.instanceId,"-desc-").concat(t.id),R=this.descElements.get(t.id);R||((R=document.createElement("span")).id=A,R.style.cssText=d,this.container.appendChild(R),this.descElements.set(t.id,R)),R.textContent!==t.hint&&(R.textContent=t.hint),p(e,"aria-describedby",A)}
1else{v(e,"aria-describedby");var I=this.descElements.get(t.id);I&&(I.parentNode&&I.parentNode.removeChild(I),this.descElements.delete(t.id))}if(f===i.SemanticRole.text){var S=null!=(n=e.querySelector(":scope > span"))?n:e,M=null!=(r=t.label)?r:"";S.textContent!==M&&(S.textContent=M),v(e,"aria-label"),t.headingLevel>0?(p(e,"role","heading"),p(e,"aria-level",String(t.headingLevel))):v(e,"aria-level")}if((0,i.hasTrait)(w,i.SemanticTrait.Expandable)&&a.has(f)?m(e,"aria-expanded",(0,i.hasState)(g,i.SemanticState.Expanded)):v(e,"aria-expanded"),f===i.SemanticRole.tab||(0,i.hasTrait)(w,i.SemanticTrait.Selectable)&&o.has(f)?m(e,"aria-selected",(0,i.hasState)(g,i.SemanticState.Selected)):v(e,"aria-selected"),(0,i.hasTrait)(w,i.SemanticTrait.Checkable)&&s.has(f)){var F=(0,i.checkStateOf)(g);F===i.SemanticCheckState.Mixed&&u.has(f)?p(e,"aria-checked","mixed"):m(e,"aria-checked",F===i.SemanticCheckState.Checked)}else v(e,"aria-checked");(0,i.hasTrait)(w,i.SemanticTrait.Toggleable)?(l.has(f)?m(e,"aria-pressed",(0,i.hasState)(g,i.SemanticState.Toggled)):v(e,"aria-pressed"),f===i.SemanticRole.switchControl&&m(e,"aria-checked",(0,i.hasState)(g,i.SemanticState.Toggled))):v(e,"aria-pressed"),(0,i.hasTrait)(w,i.SemanticTrait.Requirable)&&c.has(f)?m(e,"aria-required",(0,i.hasState)(g,i.SemanticState.Required)):v(e,"aria-required"),(0,i.hasTrait)(w,i.SemanticTrait.Enablable)?m(e,"aria-disabled",(0,i.hasState)(g,i.SemanticState.Disabled)):v(e,"aria-disabled");var E=f===i.SemanticRole.image&&!t.label;if((0,i.hasState)(g,i.SemanticState.Hidden)||(0,i.hasState)(g,i.SemanticState.Obscured)||E?p(e,"aria-hidden","true"):v(e,"aria-hidden"),(0,i.hasState)(g,i.SemanticState.LiveRegion)?p(e,"aria-live","polite"):v(e,"aria-live"),f===i.SemanticRole.textField){if(m(e,"aria-readonly",(0,i.hasState)(g,i.SemanticState.ReadOnly)),m(e,"aria-multiline",(0,i.hasState)(g,i.SemanticState.Multiline)),0===t.children.length){var x=null!=(h=t.value)?h:"";e.textContent!==x&&(e.textContent=x)}}else v(e,"aria-multiline");y(f,g)?p(e,"aria-modal","true"):v(e,"aria-modal")},e.prototype.applyPosition=function(e,t,n,r){var a=this._artboardBounds,o=Math.max(t.minX,a.minX),s=Math.max(t.minY,a.minY),u=Math.min(t.maxX,a.maxX),l=Math.min(t.maxY,a.maxY),c=Math.round(Math.max(0,u-o))+"px",d=Math.round(Math.max(0,l-s))+"px",h=Math.round(o-n)+"px",f=Math.round(s-r)+"px";e.style.left!==h&&(e.style.left=h),e.style.top!==f&&(e.style.top=f),e.style.width!==c&&(e.style.width=c),e.style.height!==d&&(e.style.height=d),e.style.transform&&(e.style.transform=""),t.role===i.SemanticRole.text&&this.pendingTextGeometry.push(e)},e.prototype.flushTextGeometry=function(){if(0!==this.pendingTextGeometry.length){for(var e,t=[],n=0,i=this.pendingTextGeometry;n<i.length;n++){var r=i[n],a=null!=(e=r.querySelector(":scope > span"))?e:r,o="".concat(r.style.width,"|").concat(r.style.height,"|").concat(a.textContent);this.textGeometryKeys.get(r)!==o&&(a.style.width="auto",a.style.height="auto",a.style.transformOrigin="0 0",a.style.transform="",t.push({host:r,span:a,key:o}))}this.pendingTextGeometry.length=0;for(var s=t.map(function(e){var t=e.host,n=e.span,i=t.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.width>0&&r.height>0){var a=i.width/r.width,o=i.height/r.height;return"scale(".concat(a,", ").concat(o,")")}return"none"}),u=0;u<t.length;u++){var l=t[u],r=l.host,a=l.span,o=l.key;a.style.transform=s[u],this.textGeometryKeys.set(r,o)}}},e.prototype.syncTransformContainer=function(e,t,n){if(!this.transformContainer){var i=document.createElement("div");i.style.cssText="position:absolute;top:0;left:0;overflow:visible;pointer-events:none;transform-origin:0 0",this.container.appendChild(i),this.transformContainer=i}var r=n.maxX-n.minX,a=n.maxY-n.minY;this.transformContainer.style.width=Math.round(r)+"px",this.transformContainer.style.height=Math.round(a)+"px";var o=1/(t||1),s=e.xx*o,u=e.xy*o,l=e.yx*o,c=e.yy*o,d=e.tx*o,h=e.ty*o;this.transformContainer.style.transform="matrix(".concat(s,",").concat(u,",").concat(l,",").concat(c,",").concat(d,",").concat(h,")")},e}(),a=new Set([i.SemanticRole.button,i.SemanticRole.link,i.SemanticRole.checkbox,i.SemanticRole.switchControl,i.SemanticRole.tab]),o=new Set([i.SemanticRole.tab]),s=new Set([i.SemanticRole.checkbox,i.SemanticRole.radioButton,i.SemanticRole.switchControl]),u=new Set([i.SemanticRole.checkbox]),l=new Set([i.SemanticRole.button]),c=new Set([i.SemanticRole.checkbox,i.SemanticRole.textField,i.SemanticRole.radioGroup]),d="position:absolute;width:1px;height:1px;overflow:hidden;pointer-events:none;left:-9999px",h="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",f="display:inline-block;white-space:nowrap;pointer-events:none";function p(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){e.hasAttribute(t)&&e.removeAttribute(t)}function m(e,t,n){p(e,t,n?"true":"false")}function b(e){switch(e){case i.SemanticRole.button:case i.SemanticRole.link:case i.SemanticRole.checkbox:case i.SemanticRole.switchControl:case i.SemanticRole.slider:case i.SemanticRole.tab:case i.SemanticRole.radioButton:case i.SemanticRole.textField:return!0;default:return!1}}function y(e,t){return e===i.SemanticRole.alertDialog||e===i.SemanticRole.dialog&&(0,i.hasState)(t,i.SemanticState.Modal)}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>o.AudioAssetWrapper,AudioWrapper:()=>o.AudioWrapper,BLANK_URL:()=>a.BLANK_URL,CustomFileAssetLoaderWrapper:()=>o.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>o.FileAssetWrapper,FileFinalizer:()=>o.FileFinalizer,FocusSessionState:()=>r.FocusSessionState,FontAssetWrapper:()=>o.FontAssetWrapper,FontWrapper:()=>o.FontWrapper,ImageAssetWrapper:()=>o.ImageAssetWrapper,ImageWrapper:()=>o.ImageWrapper,KeyboardInteractions:()=>r.KeyboardInteractions,RiveFont:()=>s.RiveFont,createFinalization:()=>o.createFinalization,finalizationRegistry:()=>o.finalizationRegistry,registerTouchInteractions:()=>i.registerTouchInteractions,sanitizeUrl:()=>a.sanitizeUrl});var i=n(11),r=n(12),a=n(13),o=n(14),s=n(15)},(e,t,n)=>{n.r(t),n.d(t,{registerTouchInteractions:()=>o});var i=void 0,r=function(e,t,n){var i,r=[];if(t)for(var a=0;a<e.length;a++){var o=e[a];r.push({clientX:o.clientX,clientY:o.clientY,identifier:o.identifier})}else{var s=null!==n?null!=(i=Array.from(e).find(function(e){return e.identifier===n}))?i:null:e[0];
1s&&r.push({clientX:s.clientX,clientY:s.clientY,identifier:s.identifier})}return r},a=function(e,t,n,i){var a;return(null==(a=e.changedTouches)?void 0:a.length)?(!t&&["touchstart","touchmove"].includes(e.type)&&e.preventDefault(),r(e.changedTouches,n,i)):[{clientX:e.clientX,clientY:e.clientY,identifier:0}]},o=function(e){var t=e.canvas,n=e.artboard,r=e.stateMachines,o=void 0===r?[]:r,s=e.renderer,u=e.rive,l=e.fit,c=e.alignment,d=e.isTouchScrollEnabled,h=void 0!==d&&d,f=e.dispatchPointerExit,p=void 0===f||f,v=e.enableMultiTouch,m=void 0!==v&&v,b=e.layoutScaleFactor,y=void 0===b?1:b,g=e.advanceAndDrain;if(!t||!o.length||!s||!u||!n||"u"<typeof window)return null;var w=null,_=!1,C=null,A=function(){C=null},R=(function(e){if(_&&e instanceof MouseEvent){"mouseup"==e.type&&(_=!1);return}_=h&&"touchend"===e.type&&"touchstart"===w,w=e.type;var t,i=e.currentTarget.getBoundingClientRect();if(!m&&"touchstart"===e.type&&null===C){var r=null==(t=e.changedTouches)?void 0:t[0];r&&(C=r.identifier)}var s=a(e,h,m,m?null:C),d=u.computeAlignment(l,c,{minX:0,minY:0,maxX:i.width,maxY:i.height},n.bounds,y),f=new u.Mat2D;switch(d.invert(f),s.forEach(function(e){var t=e.clientX,n=e.clientY;if(t||n){var r=t-i.left,a=n-i.top,o=new u.Vec2D(r,a),s=u.mapXY(f,o),l=s.x(),c=s.y();e.transformedX=l,e.transformedY=c,s.delete(),o.delete()}}),f.delete(),d.delete(),e.type){case"mouseout":for(var v=function(e){p?s.forEach(function(t){e.pointerExit(t.transformedX,t.transformedY,t.identifier)}):s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},b=0;b<o.length;b++){var A=o[b];v(A)}break;case"touchmove":case"mouseover":case"mousemove":for(var R=function(e){s.forEach(function(t){e.pointerMove(t.transformedX,t.transformedY,t.identifier)})},I=0;I<o.length;I++){var A=o[I];R(A)}break;case"touchstart":case"mousedown":for(var S=function(e){s.forEach(function(t){e.pointerDown(t.transformedX,t.transformedY,t.identifier)})},M=0;M<o.length;M++){var A=o[M];S(A)}g(0);break;case"touchend":for(var F=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier),e.pointerExit(t.transformedX,t.transformedY,t.identifier)})},E=0;E<o.length;E++){var A=o[E];F(A)}g(0),!m&&s.some(function(e){return e.identifier===C})&&(C=null);break;case"mouseup":for(var x=function(e){s.forEach(function(t){e.pointerUp(t.transformedX,t.transformedY,t.identifier)})},P=0;P<o.length;P++){var A=o[P];x(A)}g(0)}}).bind(i);return t.addEventListener("mouseover",R),t.addEventListener("mouseout",R),t.addEventListener("mousemove",R),t.addEventListener("mousedown",R),t.addEventListener("mouseup",R),t.addEventListener("touchmove",R,{passive:h}),t.addEventListener("touchstart",R,{passive:h}),t.addEventListener("touchend",R),t.addEventListener("touchcancel",A),function(){t.removeEventListener("mouseover",R),t.removeEventListener("mouseout",R),t.removeEventListener("mousemove",R),t.removeEventListener("mousedown",R),t.removeEventListener("mouseup",R),t.removeEventListener("touchmove",R),t.removeEventListener("touchstart",R),t.removeEventListener("touchend",R),t.removeEventListener("touchcancel",A)}}},(e,t,n)=>{n.r(t),n.d(t,{FocusSessionState:()=>r,KeyboardInteractions:()=>a}),(i=r||(r={})).NotFocused="notFocused",i.EntryPending="entryPending",i.RiveFocused="riveFocused";var i,r,a=function(){function e(e){var t,n=e.canvas,i=e.stateMachine,a=e.hasFocusNodes,o=e.getOverlayElement,s=this;this.focusSessionState=r.NotFocused,this.canvasHasFocus=!1,this.focusDomainReleased=!1,this.currentOverlayElement=null,this.onCanvasFocus=function(e){s.syncOverlayListener(),s.canvasHasFocus=!0,s.focusDomainReleased=!1,!s.hasFocusNodes||s.mainSm.focusState().hasFocus||(s.focusSessionState=r.EntryPending,s.isKeyboardDrivenFocus()&&(s.cameFromBeforeCanvas(e.relatedTarget)?s.mainSm.focusNext():s.mainSm.focusPrevious())&&(s.focusSessionState=r.RiveFocused))},this.onCanvasBlur=function(e){s.focusSessionState=r.NotFocused,s.canvasHasFocus=!1;var t=s.isInFocusDomain(e.relatedTarget),n=null===e.relatedTarget&&!document.hasFocus();t||n||s.mainSm.clearFocus()},this.onOverlayFocusIn=function(e){!s.isInOverlay(e.target)||(s.focusDomainReleased=!1,s.hasFocusNodes&&s.focusSessionState===r.NotFocused&&(s.focusSessionState=s.mainSm.focusState().hasFocus?r.RiveFocused:r.EntryPending))},this.onFocusDomainHostFocusIn=function(e){s.syncOverlayListener(),s.onOverlayFocusIn(e)},this.onKeyDown=function(e){s.syncOverlayListener(),s.focusDomainReleased||s.shouldRiveHandleKeyEvent(e)&&"Tab"===e.code&&s.hasFocusNodes&&((e.shiftKey?s.mainSm.focusPrevious():s.mainSm.focusNext())?(s.focusSessionState=r.RiveFocused,e.preventDefault()):(s.focusSessionState=r.NotFocused,s.focusDomainReleased=!0,s.canvasHasFocus=!1),s.syncOverlayListener())},this.canvas=n,this.mainSm=i,this.hasFocusNodes=a,this.getOverlayElement=o,this.focusDomainHost=null!=(t=n.parentElement)?t:document,n.addEventListener("focus",this.onCanvasF
1ocus),n.addEventListener("blur",this.onCanvasBlur),n.addEventListener("keydown",this.onKeyDown),this.focusDomainHost.addEventListener("focusin",this.onFocusDomainHostFocusIn),this.syncOverlayListener()}return e.prototype.setFocusSessionState=function(e){this.focusSessionState=e},e.prototype.notifyRiveFocused=function(){this.focusSessionState=r.RiveFocused},e.prototype.shouldRiveHandleKeyEvent=function(e){if(this.focusSessionState===r.NotFocused)return!1;var t=this.isInFocusDomain(document.activeElement)||this.isInOverlay(e.target),n=e.target===this.canvas;return t||this.canvasHasFocus||n},e.prototype.isInFocusDomain=function(e){return e===this.canvas||this.isInOverlay(e)},e.prototype.isInOverlay=function(e){var t,n,i;return e instanceof Node&&null!=(i=null==(n=null==(t=this.getOverlayElement)?void 0:t.call(this))?void 0:n.contains(e))&&i},e.prototype.syncOverlayListener=function(){var e,t,n,i,r,a,o=null!=(t=null==(e=this.getOverlayElement)?void 0:e.call(this))?t:null;o!==this.currentOverlayElement&&(null==(n=this.currentOverlayElement)||n.removeEventListener("focusin",this.onOverlayFocusIn),null==(i=this.currentOverlayElement)||i.removeEventListener("keydown",this.onKeyDown,!0),this.currentOverlayElement=o,null==(r=this.currentOverlayElement)||r.addEventListener("focusin",this.onOverlayFocusIn),null==(a=this.currentOverlayElement)||a.addEventListener("keydown",this.onKeyDown,!0))},e.prototype.isKeyboardDrivenFocus=function(){try{return this.canvas.matches(":focus-visible")}catch(e){return!1}},e.prototype.cameFromBeforeCanvas=function(e){if(!e)return!0;var t=this.canvas.compareDocumentPosition(e);return!!(t&Node.DOCUMENT_POSITION_PRECEDING)||!(t&Node.DOCUMENT_POSITION_FOLLOWING)},e.prototype.cleanup=function(){var e,t;this.canvas.removeEventListener("focus",this.onCanvasFocus),this.canvas.removeEventListener("blur",this.onCanvasBlur),this.canvas.removeEventListener("keydown",this.onKeyDown),this.focusDomainHost.removeEventListener("focusin",this.onFocusDomainHostFocusIn),null==(e=this.currentOverlayElement)||e.removeEventListener("focusin",this.onOverlayFocusIn),null==(t=this.currentOverlayElement)||t.removeEventListener("keydown",this.onKeyDown,!0)},e}()},(e,t,n)=>{n.r(t),n.d(t,{BLANK_URL:()=>l,sanitizeUrl:()=>c});var i=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,a=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,s=/^.+(:|&colon;)/gim,u=[".","/"],l="about:blank";function c(e){if(!e)return l;var t=e.replace(o,"").replace(r,function(e,t){return String.fromCharCode(t)}).replace(a,"").replace(o,"").trim();if(!t)return l;if(u.indexOf(t[0])>-1)return t;var n=t.match(s);if(!n)return t;var c=n[0];return i.test(c)?l:t}},(e,t,n)=>{n.r(t),n.d(t,{AudioAssetWrapper:()=>p,AudioWrapper:()=>l,CustomFileAssetLoaderWrapper:()=>d,FileAssetWrapper:()=>h,FileFinalizer:()=>a,FontAssetWrapper:()=>v,FontWrapper:()=>c,ImageAssetWrapper:()=>f,ImageWrapper:()=>u,createFinalization:()=>y,finalizationRegistry:()=>b});var i,r=(i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(){function e(e,t){void 0===t&&(t=null),this.selfUnref=!1,this._file=e,this._session=t}return e.prototype.unref=function(){this._file&&this._file.unref(),this._session&&(this._session.delete(),this._session=null)},e.prototype.release=function(){this._file=null,this._session=null},e}(),o=function(){function e(e){this._finalizableObject=e}return e.prototype.unref=function(){this._finalizableObject.unref()},e}(),s=function(){function e(){this.selfUnref=!1}return e.prototype.unref=function(){},e}(),u=function(e){function t(t){var n=e.call(this)||this;return n._nativeImage=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeImage",{get:function(){return this._nativeImage}
1,enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},t}(s),l=function(e){function t(t){var n=e.call(this)||this;return n._nativeAudio=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},t}(s),c=function(e){function t(t){var n=e.call(this)||this;return n._nativeFont=t,n}return r(t,e),Object.defineProperty(t.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),t.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},t}(s),d=function(){function e(e,t,n){void 0===n&&(n=null),this._assetLoaderCallback=t,this._session=n,this.assetLoader=new e.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return e.prototype.loadContents=function(e,t){var n;if(e.isImage)n=new f(e,this._session);else if(e.isAudio)n=new p(e,this._session);else{if(!e.isFont)return!1;n=new v(e,this._session)}return this._assetLoaderCallback(n,t)},e}(),h=function(){function e(e,t){void 0===t&&(t=null),this._nativeFileAsset=e,this._session=t}return e.prototype.decode=function(e){this._nativeFileAsset.decode(e,this._session)},Object.defineProperty(e.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),e}(),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setRenderImage=function(e){this._nativeFileAsset.setRenderImage(e.nativeImage)},t}(h),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setAudioSource=function(e){this._nativeFileAsset.setAudioSource(e.nativeAudio)},t}(h),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.setFont=function(e){this._nativeFileAsset.setFont(e.nativeFont)},t}(h),m=function(){function e(e){}return e.prototype.register=function(e){e.selfUnref=!0},e.prototype.unregister=function(e){},e}(),b=new("u">typeof FinalizationRegistry?FinalizationRegistry:m)(function(e){null==e||e.unref()}),y=function(e,t){var n=new o(t);b.register(e,n)}},(e,t,n)=>{n.r(t),n.d(t,{RiveFont:()=>r});var i=n(3),r=function(){function e(){}return e.setFallbackFontCallback=function(t){e._fallbackFontCallback=null!=t?t:null,e._wireFallbackProc()},e._fontToPtr=function(e){if(null==e)return null;var t,n=e.nativeFont,i=null==(t=null==n?void 0:n.ptr)?void 0:t.call(n);return null!=i?i:null},e._getFallbackPtr=function(t,n){return n<0||n>=t.length?null:e._fontToPtr(t[n])},e._wireFallbackProc=function(){i.RuntimeLoader.getInstance(function(t){var n=e._fallbackFontCallback;n?t.setFallbackFontCallback(function(t,i,r){var a=n(t,r);return a?Array.isArray(a)?e._getFallbackPtr(a,i):0===i?e._fontToPtr(a):null:null}):t.setFallbackFontCallback(null)})},e._fallbackFontCallback=null,e}()}],eC={};function eA(e){var t=eC[e];if(void 0!==t)return t.exports;var n=eC[e]={exports:{}};return e_[e](n,n.exports,eA),n.exports}eA.d=(e,t)=>{for(var n in t)eA.o(t,n)&&!eA.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},eA.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),eA.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
1),Object.defineProperty(e,"__esModule",{value:!0})};var eR={};return eA.r(eR),eA.d(eR,{Alignment:()=>t,DataEnum:()=>et,DataType:()=>u,DrawOptimizationOptions:()=>n,EventType:()=>a,Fit:()=>e,Layout:()=>R,LoopType:()=>o,Rive:()=>J,RiveEventType:()=>r,RiveFile:()=>Q,RiveFont:()=>f.RiveFont,RuntimeLoader:()=>d.RuntimeLoader,SemanticMode:()=>h.SemanticMode,StateMachineInput:()=>S,StateMachineInputType:()=>i,Testing:()=>eb,ViewModel:()=>ee,ViewModelInstance:()=>ei,ViewModelInstanceArtboard:()=>ep,ViewModelInstanceAssetFont:()=>ef,ViewModelInstanceAssetImage:()=>eh,ViewModelInstanceBoolean:()=>es,ViewModelInstanceColor:()=>ed,ViewModelInstanceEnum:()=>el,ViewModelInstanceList:()=>ec,ViewModelInstanceNumber:()=>eo,ViewModelInstanceString:()=>ea,ViewModelInstanceTrigger:()=>eu,ViewModelInstanceValue:()=>er,decodeAudio:()=>ey,decodeFont:()=>ew,decodeImage:()=>eg}),c=eA(1),d=eA(3),h=eA(6),f=eA(10),p=function(e,t){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},v=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},m=function(){return(m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},b=function(e,t,n,i){return new(n||(n=Promise))(function(r,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((i=i.apply(e,t||[])).next())})},y=function(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){var l=[s,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&l[0]?i.return:l[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;switch(i=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,i=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(6===l[0]&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],i=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},g=function(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isHandledError=!0,t}return v(t,e),t}(Error),(_=e||(e={})).Cover="cover",_.Contain="contain",_.Fill="fill",_.FitWidth="fitWidth",_.FitHeight="fitHeight",_.None="none",_.ScaleDown="scaleDown",_.Layout="layout",(C=t||(t={})).Center="center",C.TopLeft="topLeft",C.TopCenter="topCenter",C.TopRight="topRight",C.CenterLeft="centerLeft",C.CenterRight="centerRight",C.BottomLeft="bottomLeft",C.BottomCenter="bottomCenter",C.BottomRight="bottomRight",(A=n||(n={})).AlwaysDraw="alwaysDraw",A.DrawOnChanged="drawOnChanged",R=function(){function n(n){var i,r,a,o,s,u,l;this.fit=null!=(i=null==n?void 0:n.fit)?i:e.Contain,this.alignment=null!=(r=null==n?void 0:n.alignment)?r:t.Center,this.layoutScaleFactor=null!=(a=null==n?void 0:n.layoutScaleFactor)?a:1,this.minX=null!=(o=null==n?void 0:n.minX)?o:0,this.minY=null!=(s=null==n?void 0:n.minY)?s:0,this.maxX=null!=(u=null==n?void 0:n.maxX)?u:0,this.maxY=null!=(l=null==n?void 0:n.maxY)?l:0}return n.new=function(e){var t=e.fit,i=e.alignment,r=e.minX,a=e.minY,o=e.maxX,s=e.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new n({fit:t,alignment:i,minX:r,minY:a,maxX:o,maxY:s})},n.prototype.copyWith=function(e){var t=e.fit,i=e.alignment,r=e.layoutScaleFactor,a=e.minX,o=e.minY,s=e.maxX,u=e.maxY;return new n({fit:null!=t?t:this.fit,alignment:null!=i?i:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=a?a:this.minX,minY:null!=o?o:this.minY,maxX:null!=s?s:this.maxX,maxY:null!=u?u:this.maxY})},n.prototype.runtimeFit=function(t){var n;return this.cachedRuntimeFit?this.cachedRuntimeFit:(n=this.fit===e.Cover?t.Fit.cover:this.fit===e.Contain?t.Fit.contain:this.fit===e.Fill?t.Fit.fill:this.fit===e.FitWidth?t.Fit.fitWidth:this.fit===e.FitHeight?t.Fit.fitHeight:this.fit===e.ScaleDown?t.Fit.scaleDown:this.fit===e.Layout?t.Fit.layout:t.Fit.none,this.cachedRuntimeFit=n,n)},n.prototype.runtimeAlignment=function(e){var n;return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(n=this.alignment===t.TopLeft?e.Alignment.topLeft:this.alignment===t.TopCenter?e.Alignment.topCenter:this.alignment===t.TopRight?e.Alignment.topRight:this.alignment===t.CenterLeft?e.Alignment.centerLeft:this.alignment===t.CenterRight?e.Alignment.centerRight:this.alignment===t.BottomLeft?e.Alignment.bottomLeft:this.alignment===t.BottomCenter?e.Alignment.bottomCenter:this.alignment===t.BottomRight?e.Alignment.bottomRight:e.Alignment.center,this.cachedRuntimeAlignment=n,n)},n}(),(I=i||(i={}))[I.Number=56]="Number",I[I.Trigger=58]="Trigger",I[I.Boolean=59]="Boolean",S=function(){function e(e,t){this.type=e,this.runtimeInput=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.runtimeInput.name}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(e){this.runtimeInput.value=e},enumerable:!1,configurable:!0}),e.prototype.fire=function(){this.type===i.Trigger&&this.runtimeInput.fire()},e.prototype.delete=function(){this.runtimeInput=null},e}(),(M=r||(r={}))[M.General=128]="General",M[M.OpenUrl=131]="OpenUrl",E=function(e){function t(t,n){var i=e.call(this,!1)||this;return i.nativeArtboard=t,i.file=n,i}return v(t,e),t}(F=function(e){this.isBindableArtboard=!1,this.isBindableArtboard=e}),x=function(e){function t(t){var n=e.call(this,!0)||this;return n.selfUnref=!1,n.nativeArtboard=t,n}return v(t,e),Object.defineProperty(t.prototype,"viewModel",{set:function(e){this.nativeViewModel=e.nativeInstance},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){var e;this.selfUnref&&(this.nativeArtboard.unref(),null==(e=this.nativeViewModel)||e.unref())},t}(F),P=function(){function e(e,t,n,i){this.stateMachine=e,this.playing=n,this.artboard=i,this.inputs=[],this.instance=new t.StateMachineInstance(e,i),this.initInputs(t)}return Object.defineProperty(e.prototype,"hasFocusNodes",{get:function(){return this.instance.hasFocusNodes()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.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}),e.prototype.advance=function(e){this.instance.advance(e)},e.prototype.advanceAndApply=function(e){this.instance.advanceAndApply(e)},e.prototype.enableSemantics=function(){this.instance.enableSemantics()},e.prototype.drainSemanticsDiff=function(){return this.instance.drainSemanticsDiff()},e.prototype.fireSemanticAction=function(e,t){this.instance.fireSemanticAction(e,t)},e.prototype.focusSemanticNode=function(e){return this.instance.focusSemanticNode(e)},e.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},e.prototype.reportedEventAt=function(e){return this.instance.reportedEventAt(e)},e.prototype.initInputs=function(e){for(var t=0;t<this.instance.inputCount();t++){var n=this.instance.input(t);this.inputs.push(this.mapRuntimeInput(n,e))}},e.prototype.mapRuntimeInput=function(e,t){return e.type===t.SMIInput.bool?new S(i.Boolean,e.asBool()):e.type===t.SMIInput.number?new S(i.Number,e.asNumber()):e.type===t.SMIInput.trigger?new S(i.Trigger,e.asTrigger()):void 0},e.prototype.cleanup=function(){this.inputs.forEach(function(e){e.delete()}),this.inputs.length=0,this.instance.delete()},e.prototype.bindViewModelInstance=function(e){null!=e.runtimeInstance&&this.instance.bindViewModelInstance(e.runtimeInstance)},e.prototype.focusState=function(){return this.instance.focusState()},e.prototype.clearFocus=function(){this.instance.clearFocus()},e}(),k=function(){function e(e,t,n,i,r){void 0===i&&(i=[]),void 0===r&&(r=[]),this.runtime=e,this.artboard=t,this.eventManager=n,this.animations=i,this.stateMachines=r}return e.prototype.add=function(e,t,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!1),0===(e=em(e)).length)this.animations.forEach(function(e){return e.playing=t}),this.stateMachines.forEach(function(e){return e.playing=t});else for(var r=this.animations.map(function(e){return e.name}),o=this.stateMachines.map(function(e){return e.name}),s=0;s<e.length;s++){var u=r.indexOf(e[s]),l=o.indexOf(e[s]);if(u>=0||l>=0)u>=0?this.animations[u].playing=t:this.stateMachines[l].playing=t;else{var d=this.artboard.animationByName(e[s]);if(d){var h=new c.Animation(d,this.artboard,this.runtime,t);h.advance(0),h.apply(1),this.animations.push(h)}else{var f=this.artboard.stateMachineByName(e[s]);if(f){var p=new P(f,this.runtime,t,this.artboard);i&&p.enableSemantics(),this.stateMachines.push(p)}}}}return n&&(t?this.eventManager.fire({type:a.Play,data:this.playing}):this.eventManager.fire({type:a.Pause,data:this.paused})),t?this.playing:this.paused},e.prototype.initLinearAnimations=function(e,t,n){void 0===n&&(n=!1);for(var i=this.animations.map(function(e){return e.name}),r=0;r<e.length;r++){var a=i.indexOf(e[r]);if(a>=0)this.animations[a].playing=t;else{var o=this.artboard.animationByName(e[r]);if(o){var s=new c.Animation(o,this.artboard,this.runtime,t);s.advance(0),s.apply(1),this.animations.push(s)}else if(n)throw new w("State Machine with name ".concat(e[r]," not found"));else console.error("Animation with name ".concat(e[r]," not found."))}}},e.prototype.initStateMachines=function(e,t,n){for(var i=this.stateMachines.map(function(e){return e.name}),r=0;r<e.length;r++){var a=i.indexOf(e[r]);if(a>=0)this.stateMachines[a].playing=t;else{var o=this.artboard.stateMachineByName(e[r]);if(o){var s=new P(o,this.runtime,t,this.artboard);n&&s.enableSemantics(),this.stateMachines.push(s)}else console.warn("State Machine with name ".concat(e[r]," not found. Falling back to find an animation with the same name.")),this.initLinearAnimations([e[r]],t,!0)}}},e.prototype.play=function(e){return this.add(e,!0)},e.prototype.advanceIfPaused=function(){this.stateMachines.forEac
1h(function(e){e.playing||e.advanceAndApply(0)})},e.prototype.pause=function(e){return this.add(e,!1)},e.prototype.scrub=function(e,t){var n=this.animations.filter(function(t){return e.includes(t.name)});return n.forEach(function(e){return e.scrubTo=t}),n.map(function(e){return e.name})},Object.defineProperty(e.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(e.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}),e.prototype.stop=function(e){var t=this;e=em(e);var n=[];if(0===e.length)n=this.animations.map(function(e){return e.name}).concat(this.stateMachines.map(function(e){return e.name})),this.animations.forEach(function(e){return e.cleanup()}),this.stateMachines.forEach(function(e){return e.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var i=this.animations.filter(function(t){return e.includes(t.name)});i.forEach(function(e){e.cleanup(),t.animations.splice(t.animations.indexOf(e),1)});var r=this.stateMachines.filter(function(t){return e.includes(t.name)});r.forEach(function(e){e.cleanup(),t.stateMachines.splice(t.stateMachines.indexOf(e),1)}),n=i.map(function(e){return e.name}).concat(r.map(function(e){return e.name}))}return this.eventManager.fire({type:a.Stop,data:n}),n},Object.defineProperty(e.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(e.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),e.prototype.atLeastOne=function(e,t,n){var i;return void 0===t&&(t=!0),void 0===n&&(n=!1),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?(this.artboard.stateMachineCount()>0&&V("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. In the next major version, the artboard's state machine will be played by default instead when one exists. Pass the `stateMachine` parameter to adopt that behavior now."),this.add([i=this.artboard.animationByIndex(0).name],e,t)):this.artboard.stateMachineCount()>0&&this.add([i=this.artboard.stateMachineByIndex(0).name],e,t,n)),i},e.prototype.handleLooping=function(){for(var e=0,t=this.animations.filter(function(e){return e.playing});e<t.length;e++){var n=t[e];0===n.loopValue&&n.loopCount?(n.loopCount=0,this.stop(n.name)):1===n.loopValue&&n.loopCount?(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:a.Loop,data:{animation:n.name,type:o.PingPong}}),n.loopCount=0)}},e.prototype.handleStateChanges=function(){for(var e=[],t=0,n=this.stateMachines.filter(function(e){return e.playing});t<n.length;t++){var i=n[t];e.push.apply(e,i.statesChanged)}e.length>0&&this.eventManager.fire({type:a.StateChange,data:e})},e.prototype.handleAdvancing=function(e){this.eventManager.fire({type:a.Advance,data:e})},e}(),(T=a||(a={})).Load="load",T.LoadError="loaderror",T.Play="play",T.Pause="pause",T.Stop="stop",T.Loop="loop",T.Draw="draw",T.Advance="advance",T.StateChange="statechange",T.RiveEvent="riveevent",T.AudioStatusChange="audiostatuschange",O="Rive Events are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/runtimes/web/rive-events for how to migrate.",L="State machine inputs are deprecated and will be removed in a future major version: please use data binding properties instead. See https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.",D="Text run APIs are deprecated and will be removed in a future major version: please use data binding instead. See https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.",B=new Set,V=function(e){B.has(e)||(B.add(e),console.warn("[Rive] ".concat(e)))},N=function(e,t){Array.isArray(e)&&V("Passing an array of names to `".concat(t,"()` is deprecated: in the next major version this parameter will be a single str
1ing, and playing multiple animations or state machines at once will not be supported."))},U=function(e){V("Passing linear animation names to `".concat(e,"()` is deprecated and will be removed in a future major version: ")+"Pass a single state machine name to control playback instead.")},(j=o||(o={})).OneShot="oneshot",j.Loop="loop",j.PingPong="pingpong",z=function(){function e(e){void 0===e&&(e=[]),this.listeners=e}return e.prototype.getListeners=function(e){return this.listeners.filter(function(t){return t.type===e})},e.prototype.add=function(e){this.listeners.includes(e)||this.listeners.push(e)},e.prototype.remove=function(e){for(var t=0;t<this.listeners.length;t++){var n=this.listeners[t];if(n.type===e.type&&n.callback===e.callback){this.listeners.splice(t,1);break}}},e.prototype.removeAll=function(e){var t=this;e?this.listeners.filter(function(t){return t.type===e}).forEach(function(e){return t.remove(e)}):this.listeners.splice(0,this.listeners.length)},e.prototype.fire=function(e){this.getListeners(e.type).forEach(function(t){return t.callback(e)})},e}(),H=function(){function e(e){this.eventManager=e,this.queue=[]}return e.prototype.add=function(e){this.queue.push(e)},e.prototype.process=function(){for(;this.queue.length>0;){var e=this.queue.shift();(null==e?void 0:e.action)&&e.action(),(null==e?void 0:e.event)&&this.eventManager.fire(e.event)}},e}(),(W=s||(s={}))[W.AVAILABLE=0]="AVAILABLE",W[W.UNAVAILABLE=1]="UNAVAILABLE",G=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._started=!1,t._enabled=!1,t._status=s.UNAVAILABLE,t}return v(t,e),t.prototype.delay=function(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,new Promise(function(t){return setTimeout(t,e)})]})})},t.prototype.timeout=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return[2,new Promise(function(e,t){return setTimeout(t,50)})]})})},t.prototype.reportToListeners=function(){this.fire({type:a.AudioStatusChange}),this.removeAll()},t.prototype.enableAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return this._enabled||(this._enabled=!0,this._status=s.AVAILABLE,this.reportToListeners()),[2]})})},t.prototype.testAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:if(this._status!==s.UNAVAILABLE||null===this._audioContext)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return e.sent(),this.enableAudio(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})},t.prototype._establishAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:if(this._started)return[3,5];if(this._started=!0,"u">typeof window)return[3,1];return this.enableAudio(),[3,5];case 1:this._audioContext=new AudioContext,this.listenForUserAction(),e.label=2;case 2:if(this._status!==s.UNAVAILABLE)return[3,5];return[4,this.testAudio()];case 3:return e.sent(),[4,this.delay(1e3)];case 4:return e.sent(),[3,2];case 5:return[2]}})})},t.prototype.listenForUserAction=function(){var e=this;document.addEventListener("pointerdown",function(){return b(e,void 0,void 0,function(){return y(this,function(e){return this.enableAudio(),[2]})})},{once:!0})},t.prototype.establishAudio=function(){return b(this,void 0,void 0,function(){return y(this,function(e){return this._establishAudio(),[2]})})},Object.defineProperty(t.prototype,"systemVolume",{get:function(){return this._status===s.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),t}(z)),X=function(){function e(){}return e.prototype.observe=function(){},e.prototype.unobserve=function(){},e.prototype.disconnect=function(){},e}(),Y=globalThis.ResizeObserver||X,$=new(function(){function e(){var e=this;this._elementsMap=new Map,this._onObservedEntry=function(t){var n=e._elementsMap.get(t.target);null!==n?n.onResize(0==t.target.clientWidth||0==t.target.clientHeight):e._resizeObserver.unobserve(t.target)},this._onObserved=function(t){t.forEach(e._onObservedEntry)},this._resizeObserver=new Y(this._onObserved)}return e.prototype.add=function(e,t){var n={onResize:t,element:e};return this._elementsMap.set(e,n),this._resizeObserver.observe(e),n},e.prototype.remove=function(e){this._resizeObserver.unobserve(e.element),this._elementsMap.delete(e.element)},e}()),q=0,K=function(e){var t=e.stateMachine,n=e.animations,i=e.stateMachines;return(void 0!==n&&V("The `animations` parameter is deprecated and will be removed in a future major version: please use the `stateMachine` parameter to play a state machine instead."),void 0!==i&&V("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead."),t)?{startingAnimationNames:[],startingStateMachineNames:[t]}:{startingAnimationNames:em(n),startingStateMachineNames:em(i)}},Q=function(){function e(e){this.enableRiveAssetCDN=!0,this.enablePerfMarks=!1,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.deferred=!1,this.session=null,this._sessionClaimed=!1,this.fileFinalizer=null,this.boundElsewhereWarned=!1,this.src=e.src,this.buffer=e.buffer,this.deferred=!!e.enableGPUCanvas,e.assetLoader&&(this.assetLoader=e.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(d.RuntimeLoader.enablePerfMarks=!0),this.eventManager=new z,e.onLoad&&this.on(a.Lo
1ad,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError)}return e.prototype.releaseFile=function(){var e,t;null==(e=this.fileFinalizer)||e.release(),null==(t=this.file)||t.unref(),this.fileFinalizer=null,this.file=null},e.prototype.releaseSession=function(){var e;null==(e=this.session)||e.delete(),this.session=null},e.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(e){return e.destroy()})},e.prototype.initData=function(){return b(this,void 0,void 0,function(){var t,n,i,r,o,s;return y(this,function(u){switch(u.label){case 0:if(!(this.src&&!this.buffer))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),t=this,[4,ev(this.src)];case 2:return t.buffer=u.sent(),[3,4];case 3:if((n=u.sent())instanceof Error)throw n;throw new w(e.fileLoadErrorMessage);case 4:if(this.destroyed)return[2];this.deferred&&null===this.session&&(this.session=e.makeDeferredSession(this.runtime)),this.assetLoader&&(i=new f.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader,this.session).assetLoader),this.enablePerfMarks&&performance.mark("rive:file-load:start"),u.label=5;case 5:return u.trys.push([5,7,,8]),r=this,[4,this.runtime.load(new Uint8Array(this.buffer),i,this.enableRiveAssetCDN,this.session)];case 6:return r.file=u.sent(),[3,8];case 7:throw o=u.sent(),this.releaseSession(),o;case 8:if(this.enablePerfMarks&&(performance.mark("rive:file-load:end"),performance.measure("rive:file-load","rive:file-load:start","rive:file-load:end")),this.destroyed)return this.releaseFile(),this.releaseSession(),[2];if(null===this.file)return this.releaseSession(),this.fireLoadError(e.fileLoadErrorMessage),[2];return s=new f.FileFinalizer(this.file,this.session),this.fileFinalizer=s,f.finalizationRegistry.register(this,s),this.eventManager.fire({type:a.Load,data:this}),[2]}})})},e.prototype.loadRiveFileBytes=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:fetch-riv:start"),e=this.src?ev(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]})})},e.prototype.loadRuntime=function(){return b(this,void 0,void 0,function(){var e;return y(this,function(t){return this.enablePerfMarks&&performance.mark("rive:await-wasm:start"),e=d.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]})})},e.prototype.init=function(){return b(this,void 0,void 0,function(){var t,n,i,r;return y(this,function(a){switch(a.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(e.missingErrorMessage),[2];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,Promise.all([this.loadRiveFileBytes(),this.loadRuntime()])];case 2:if(n=(t=a.sent())[0],i=t[1],this.destroyed)return[2];return this.buffer=n,this.runtime=i,this.enablePerfMarks&&performance.mark("rive:init-data:start"),[4,this.initData()];case 3:return a.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 r=a.sent(),this.fireLoadError(r instanceof Error?r.message:e.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},e.prototype.fireLoadError=function(e){throw this.eventManager.fire({type:a.LoadError,data:e}),new w(e)},e.prototype.on=function(e,t){this.eventManager.add({type:e,callback:t})},e.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},e.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.releaseSession(),this.destroyed=!0)},e.makeDeferredSession=function(t){var n,i,r=null!=(i=null==(n=t.makeDeferredSession)?void 0:n.call(t))?i:null;return null!==r||e.deferredUnsupportedWarned||(e.deferredUnsupportedWarned=!0,console.warn("Rive: `enableGPUCanvas: true` was ignored because this runtime build has no GPU Canvas support; importing in immediate mode. Use a @rive-app/webgl2 or @rive-app/canvas build with deferred rendering compiled in.")),r},Object.defineProperty(e.prototype,"deferredSession",{get:function(){return this.session}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deferredRequested",{get:function(){return this.deferred},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionClaimed",{get:function(){return this._sessionClaimed},enumerable:!1,configurable:!0}),e.prototype.claimSession=function(){this._sessionClaimed=!0},e.prototype.warnBoundElsewhereOnce=function(){this.boundElsewhereWarned||(this.boundElsewhereWarned=!0,console.warn("Rive: this deferred RiveFile is already bound to another Rive instance's canvas, and a deferred session cannot span canvases. Re-importing the file for this instance (an extra parse of the retained buffer, no extra network request)."))},e.prototype.reimport=function(t){return b(this,void 0,void 0,function(){var n;return y(this,function(i){switch(i.label){case 0:return[4,(n=new e({buffer:this.buffer,assetLoader:this.assetLoader,enableRiveAssetCDN:this.enableRiveAssetCDN,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:t})).init()];case 1:return i.sent(),[2,n]}})})},e.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},e.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},e.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},e.prototype.createBindableArtboard=function(e){if(null!=e){var t=new x(e);return(0,f.createFinalization)(t,t.nativeArtboard),this.bindableArtboards.push(t),t}return null},e.prototype.getArtboard=function(e){var t=this.file.artboardByName(e);if(null!=t)return new E(t,this)},e.prototype.getBindableArtboard=function(e){var t=this.file.bindableArtboardByName(e);return this.createBindableArtboard(t)},e.prototype.getDefaultBindableArtboard=function(){var e=this.file.bindableArtboardDefault();return this.createBindableArtboard(e)},e.prototype.internalBindableArtboardFromArtboard=function(e){var t=this.file.internalBindableArtboardFromArtboard(e);return this.createBindableArtboard(t)},e.prototype.viewModelByName=function(e){var t=this.file.viewModelByName(e);return null!==t?new ee(t):null},e.prototype.globalViewModelNames=function(){return this.file.globalViewModelNames()},e.missingErrorMessage="Rive source file or data buffer required",e.fileLoadErrorMessage="The file failed to load",e.deferredUnsupportedWarned=!1,e}(),J=function(){function t(e){var t,i,r,o,s=this;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.deferredRenderer=!1,this.ownsRiveFile=!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=h.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(q++),this.drawOptimization=n.DrawOnChanged,this.enablePerfMarks=!1,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(e){var t=s._hasZeroSize!==e;s._hasZeroSize=e,e?s._layout.maxX&&s._layout.maxY||s.resizeToCanvas():t&&s.resizeDrawingSurfaceToCanvas()},this.frameRequestId=null,this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),"u">typeof document&&(this._pageVisibilityHandler=this._onPageVisibilityChange.bind(this),document.addEventListener("visibilitychange",this._pageVisibilityHandler)),this.canvas=e.canvas,e.canvas.constructor===HTMLCanvasElement&&(this._observed=$.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=null!=(t=e.layout)?t:new R,this.shouldDisableRiveListeners=!!e.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!e.isTouchScrollEnabled,e.automaticallyHandleEvents&&V("The `automaticallyHandleEvents` parameter is deprecated. "+O),this.automaticallyHandleEvents=!!e.automaticallyHandleEvents,this.dispatchPointerExit=!1===e.dispatchPointerExit?e.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!e.enableMultiTouch,this.drawOptimization=null!=(i=e.drawingOptions)?i:this.drawOptimization,this.enableRiveAssetCDN=void 0===e.enableRiveAssetCDN||e.enableRiveAssetCDN,this.enablePerfMarks=!!e.enablePerfMarks,this.enablePerfMarks&&(d.RuntimeLoader.enablePerfMarks=!0),this._focusOptions=null!=(r=e.focu
1sOptions)?r:this._focusOptions,this._tabIndex=null!=(o=e.tabIndex)?o:null,this.deferredRenderer=!!e.enableGPUCanvas,this.eventManager=new z,e.onLoad&&this.on(a.Load,e.onLoad),e.onLoadError&&this.on(a.LoadError,e.onLoadError),e.onPlay&&this.on(a.Play,e.onPlay),e.onPause&&this.on(a.Pause,e.onPause),e.onStop&&this.on(a.Stop,e.onStop),e.onLoop&&this.on(a.Loop,e.onLoop),e.onStateChange&&this.on(a.StateChange,e.onStateChange),e.onAdvance&&this.on(a.Advance,e.onAdvance),e.onload&&!e.onLoad&&this.on(a.Load,e.onload),e.onloaderror&&!e.onLoadError&&this.on(a.LoadError,e.onloaderror),e.onplay&&!e.onPlay&&this.on(a.Play,e.onplay),e.onpause&&!e.onPause&&this.on(a.Pause,e.onpause),e.onstop&&!e.onStop&&this.on(a.Stop,e.onstop),e.onloop&&!e.onLoop&&this.on(a.Loop,e.onloop),e.onstatechange&&!e.onStateChange&&this.on(a.StateChange,e.onstatechange),e.assetLoader&&(this.assetLoader=e.assetLoader),this.taskQueue=new H(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:e.autoplay,autoBind:e.autoBind,stateMachine:e.stateMachine,animations:e.animations,stateMachines:e.stateMachines,artboard:e.artboard,useOffscreenRenderer:e.useOffscreenRenderer,tabIndex:e.tabIndex,semanticsMode:e.semanticsMode,semanticsOptions:e.semanticsOptions,enableGPUCanvas:this.deferredRenderer})}return Object.defineProperty(t.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()},enumerable:!1,configurable:!0}),t.new=function(e){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(e)},t.prototype.enableSemantics=function(){this.semanticsMode=h.SemanticMode.Enabled,this.activateSemantics()},t.prototype.activateSemantics=function(){this._semanticsActive||this.semanticsMode===h.SemanticMode.Disabled||(this._semanticsActive=!0,this.syncSemanticsOnStateMachines())},t.prototype.syncSemanticsOnStateMachines=function(){if(this._semanticsActive&&this.animator)for(var e=0,t=this.animator.stateMachines;e<t.length;e++)t[e].enableSemantics()},t.prototype.cleanupSemantics=function(){this._semanticTree=null,this._accessibilityOverlay&&(this._accessibilityOverlay.destroy(),this._accessibilityOverlay=null)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(e){var n,i,r,o,s,u=this,l=e.src,c=e.buffer,f=e.riveFile,p=e.stateMachine,v=e.animations,m=e.stateMachines,b=e.artboard,y=e.autoplay,g=void 0!==y&&y,_=e.useOffscreenRenderer,C=void 0!==_&&_,A=e.autoBind,R=void 0!==A&&A,I=e.tabIndex,S=e.semanticsMode,M=e.semanticsOptions,F=e.enableGPUCanvas;if(!this.destroyed){if(!l&&!c&&!f)throw new w(t.missingErrorMessage);this.artboard&&(null==(i=null==(n=this.renderer)?void 0:n.bindContext)||i.call(n),null==(r=this.animator)||r.stop(),this.artboard.delete(),this.artboard=null),this.renderer&&(null==(s=(o=this.renderer).detachSession)||s.call(o)),this.releaseCurrentRiveFile(!1),this.src=l,this.buffer=c,this.riveFile=f,this.ownsRiveFile=!1,this.deferredRenderer=null!=F?F:this.deferredRenderer,this._tabIndex=null!=I?I:null,this.semanticsMode=null!=S?S:h.SemanticMode.Disabled,this.semanticsOptions=null!=M?M:this.semanticsOptions;var E=K({stateMachine:p,animations:v,stateMachines:m}),x=E.startingAnimationNames,P=E.startingStateMachineNames;this.loaded=!1,this.readyForPlaying=!1,d.RuntimeLoader.awaitInstance().then(function(e){if(!u.destroyed){u.runtime=e,u.removeRiveListeners(),u.cleanupSemantics(),u.deleteRiveRenderer(),u.enablePerfMarks&&performance.mark("rive:make-renderer:start");try{if(u.renderer=u.runtime.makeRenderer(u.canvas,C),!u.renderer)throw Error("Renderer is null, cannot render Rive on the canvas.")}catch(e){throw console.error(e),new w("Unable to create the renderer, your environment may not support WebGL. Try the @rive-app/canvas runtime as an alternative.")}u.enablePerfMarks&&(performance.mark("rive:make-renderer:end"),performance.measure("rive:make-renderer","rive:make-renderer:start","rive:make-renderer:end")),u.canvas.width||u.canvas.height||u.resizeDrawingSurfaceToCanvas(),u.initData(b,x,P,g,R).then(function(e){if(e)return u.setupRiveListeners()}).catch(function(e){console.error(e)})}}).catch(function(e){u.eventManager.fire({type:a.LoadError,data:e.message})})}},t.prototype.setupRiveListeners=function(e){var t=this;if(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),!this.shouldDisableRiveListeners){var n=this.animator.stateMachines.filter(function(e){return e.playing}).filter(function(e){return t.runtime.hasListeners(e.instance)}).map(function(e){return e.instance}),i=this.isTouchScrollEnabled,r=this.dispatchPointerExit,a=this.enableMultiTouch;e&&"isTouchScrollEnabled"in e&&(i=e.isTouchScrollEnabled),this.eventCleanup=(0,f.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:n,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:i,dispatchPointerExit:r,enableMultiTouch:a,layoutScaleFactor:this._layout.layoutScaleFactor,advanceAndDrain:this.advanceAndReportChanges.bind(this)}),this.ensureKeyboardInteractions()}},t.prototype.ensureKeyboardInteractions=function(){var e=this;if(!(this._keyboardInteractions||this.shouldDisableRiveListeners||"u"<typeof window)&&this.canvas instanceof HTMLCanvasElement){var t=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(t){var n=this.canvas.tabIndex;(-1===n||isNaN(n))&&(this.canvas.tabIndex=null!==this._tabIndex?this._tabIndex:0),this._keyboardInteractions=new f.KeyboardInteractions({canvas:this.canvas,stateMachine:t.instance,hasFocusNodes:!0,getOverlayElement:function(){var t,n;return null!=(n=null==(t=e._accessibilityOverlay)?void 0:t.getSemanticOverlayContainer())?n:null}})}}},t.prototype.cleanupKeyboardInteractions=function(){this._keyboardInteractions&&(this._keyboardInteractions.cleanup(),this._keyboardInteractions=null)},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null),this.cleanupKeyboardInteractions()},t.prototype.initializeAudio=function(){var e,t=this;G.status==s.UNAVAILABLE&&(this.file.hasAudio||(null==(e=this.artboard)?void 0:e.hasAudio)&&null===this._audioEventListener)&&(this._audioEventListener={type:a.AudioStatusChange,callback:function(){return t.onSystemAudioChanged()}},G.add(this._audioEventListener),G.establishAudio())},t.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)},t.prototype.initData=function(e,t,n,i,r){return b(this,void 0,void 0,function(){var o,s,u,l;return y(this,function(c){switch(c.label){case 0:if(c.trys.push([0,5,,6]),this.ownsRiveFile=null==this.riveFile,!this.ownsRiveFile)return[3,2];return o=new Q({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader,enablePerfMarks:this.enablePerfMarks,enableGPUCanvas:this.deferredRenderer}),this.riveFile=o,[4,o.init()];case 1:if(c.sent(),this.destroyed)return o.destroyIfUnused(),[2,!1];c.label=2;case 2:if(!(null!==this.riveFile.deferredSession||this.deferredRenderer))return[3,4];return[4,this.resolveDeferredRendering()];case 3:if(c.sent(),this.destroyed)return this.ownsRiveFile&&(null==(u=this.riveFile)||u.destroyIfUnused()),[2,!1];c.label=4;case 4:this.file=this.riveFile.getInstance(),this.initArtboard(e,t,n,i,r),this.initArtboardSize(),this.initializeAudio(),this.semanticsMode===h.SemanticMode.Enabled?this.activateSemantics():this._semanticsActive&&this.syncSemanticsOnStateMachines();try{this.loaded=!0,this.eventManager.fire({type:a.Load,data:null!=(l=this.src)?l:"buffer"})}catch(e){console.error(e)}return this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 5:var d;return s=(d=c.sent())&&d.isHandledError?d.message:"Problem loading file; may be corrupt!",this.eventManager.fire({type:a.LoadError,data:s}),[2,Promise.reject(s)];case 6:return[2]}})})},t.prototype.resolveDeferredRendering=function(){return b(this,void 0,void 0,function(){var e,t,n,i,r,a,o,s,u,l;return y(this,function(c){switch(c.label){case 0:if(e=this.riveFile,t=this.ownsRiveFile,n=this.renderer,null===(i=e.deferredSession))return this.deferredRenderer&&!e.deferredRequested&&console.warn("Rive: `enableGPUCanvas: true` was ignored because this RiveFile was imported without it. The mode is fixed at import: construct the RiveFile with `enableGPUCanvas: true` to opt in."),[2];if(this.deferredRenderer||console.warn("Rive: this RiveFile was imported with `enableGPUCanvas: true`, so this instance renders deferred even though `enableGPUCanvas` is false on the instance. An immediate renderer would drop the file's deferred resources and draw nothing."),"function"==typeof(r=null==n?void 0:n.attachSession))return[3,2];return console.warn("Rive: this renderer cannot replay a deferred session (`useOffscreenRenderer` is not supported with deferred rendering). Re-importing the file in immediate mode for this instance."),[4,e.reimport(!1)];case 1:if(a=c.sent(),this.destroyed)return a.destroyIfUnused(),[2];return this.riveFile=a,this.ownsRiveFile=!0,t&&e.destroyIfUnused(),[2];case 2:if(!e.sessionClaimed&&r.call(n,i))return e.claimSession(),[2];return e.warnBoundElsewhereOnce(),[4,e.reimport(!0)];case 3:if(o=c.sent(),this.destroyed)return o.destroyIfUnused(),[2];if(this.riveFile=o,this.ownsRiveFile=!0,null!==(s=o.deferredSession)&&r.call(n,s))return o.claimSession(),[2];return console.warn("Rive: could not attach the re-imported file's deferred session to this canvas; falling back to immediate rendering for this instance."),null==(l=n.detachSession)||l.call(n),[4,e.reimport(!1)];case 4:if(u=c.sent(),o.destroyIfUnused(),this.destroyed)return u.destroyIfUnused(),[2];return this.riveFile=u,this.ownsRiveFile=!0,t&&e.destroyIfUnused(),[2]}})})},t.prototype.initArtboard=function(e,t,n,i,r){if(this.file){var o,s=e?this.file.artboardByName(e):this.file.defaultArtboard();if(!s)throw new w("Invalid artboard name or no default artboard");if(this.artboard=s,s.volume=this._volume*G.systemVolume,this.animator=new k(this.runtime,this.artboard,this.eventManager),t.length>0||n.length>0?(o=t.concat(n),this.animator.initLinearAnimations(t,i),this.animator.initStateMachines(n,i,this._semanticsActive)):o=[this.animator.atLeastOne(i,!1,this._semanticsActive)],this.taskQueue.add({event:{type:i?a.Play:a.Pause,data:o}}),r){var u=this.file.defaultArtboardViewModel(s);if(null!==u){var l=u.defaultInstance();if(null!==l){var c=new ei(l,null);(0,f.createFinalization)(c,c.runtimeInstance),this.setViewModelInstance(c)}}for(var d=0,h=this.file.globalViewModelNames();d<h.length;d++){var p=h[d],v=this.file.viewModelByName(p);if(null!==v){var m=new ee(v).defaultInstance();null!==m&&this.setGlobalViewModelInstance(p,m)}}this.bind()}}},t.prototype.drawFrame=function(){var e,t;(null==(e=null==document?void 0:document.timeline)?void 0:e.currentTime)?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),null==(t=this.runtime)||t.resolveAnimationFrame()):this.scheduleRendering()},t.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},t.prototype._deferredWorkPending=function(){var e,t,n;return null!=(n=null==(t=null==(e=this.riveFile)?void 0:e.deferredSession)?void 0:t.recordedThisFrame())&&n},t.prototype.pollFocusState=function(){if(this.ensureKeyboardInteractions(),!this._keyboardInteractions){this._prevHasFocus=!1;return}var e,t,n=this.animator.stateMachines.find(function(e){return e.playing&&e.hasFocusNodes});if(!n){this._prevHasFocus=!1;return}if(this.canvas instanceof HTMLCanvasElement){if(n.focusState().hasFocus){if(this._keyboardInteractions.notifyRiveFocused(),!this._prevHasFocus){var i=null==(e=this._accessibilityOverlay)?void 0:e.getSemanticOverlayContainer();!(document.activeElement===this.canvas||null!=(t=null==i?void 0:i.contains(document.activeElement))&&t)&&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)}},t.prototype.advanceAndReportChanges=function(e){for(var t,n,i=this.animator.animations.filter(function(e){return e.playing||e.needsScrub}).sort(function(e){return e.needsScrub?-1:1}),o=0;o<i.length;o++){var s=i[o];s.advance(e),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var u=this.animator.stateMachines.filter(function(e){return e.playing}),l=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1,c=0;c<u.length;c++){var d=u[c],p=d.reportedEventCount();if(p)for(var v=0;v<p;v++){var m=d.reportedEventAt(v);if(m)if(m.type===r.OpenUrl){if(this.eventManager.fire({type:a.RiveEvent,data:m}),this.automaticallyHandleEvents){var b=document.createElement("a"),y=m.url,g=m.target,w=(0,f.sanitizeUrl)(y);
1y&&b.setAttribute("href",w),g&&b.setAttribute("target",g),w&&w!==f.BLANK_URL&&b.click()}}else this.eventManager.fire({type:a.RiveEvent,data:m})}if(l>=0&&performance.mark("rive:sm-advance:start:f".concat(l)),d.advanceAndApply(e),l>=0&&(performance.mark("rive:sm-advance:end:f".concat(l)),performance.measure("rive:sm-advance:f".concat(l),"rive:sm-advance:start:f".concat(l),"rive:sm-advance:end:f".concat(l))),this._semanticsActive){var _=d.drainSemanticsDiff();_&&(this._semanticTree||(this._semanticTree=new h.SemanticTreeModel),this._semanticTree.applyDiff(_))}}if(this._semanticsActive&&this._semanticTree&&u.length>0&&this.canvas instanceof HTMLCanvasElement){if(!this._accessibilityOverlay){var C=u[0];this._accessibilityOverlay=new h.AccessibilityOverlay({canvas:this.canvas,instanceId:this._instanceId,semanticsOptions:this.semanticsOptions,allowFocusInterrupt:this._focusOptions.allowFocusInterrupt,fireAction:function(e,t){C.fireSemanticAction(e,t)},requestFocus:function(e){return C.focusSemanticNode(e)},clearFocus:function(){return C.instance.clearFocus()}})}var A=null==(t=this._accessibilityOverlay)?void 0:t.needsUpdate(this._semanticTree);if(A||this._overlayTransformDirty){var R=null;if((null==A?void 0:A.layoutChanged)||this._overlayTransformDirty){var I=this._layout.runtimeFit(this.runtime),S=this._layout.runtimeAlignment(this.runtime);R=this.runtime.computeAlignment(I,S,{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,R,this._devicePixelRatioUsed,this.artboard.bounds,A),null==R||R.delete()}}0==this.animator.stateMachines.length&&this.artboard.advance(e),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(e),this.pollFocusState(),null==(n=this._viewModelInstance)||n.handleCallbacks(),this._globalViewModelInstances.forEach(function(e){e&&e.handleCallbacks()})},t.prototype.draw=function(e,t){if(this.frameRequestId=null,this.artboard){var i=performance.now(),r=this.enablePerfMarks&&this.frameCount<3?this.frameCount:-1;this.lastRenderTime||(this.lastRenderTime=e),this.renderSecondTimer+=e-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==t||t());var a=(e-this.lastRenderTime)/1e3;this.lastRenderTime=e,this.advanceAndReportChanges(a);var o=this.renderer;!this._hasZeroSize&&(this.drawOptimization==n.AlwaysDraw||this.artboard.didChange()||this._deferredWorkPending()||this._needsRedraw||this._canvasSizeChanged())&&(o.clear(),o.save(),r>=0&&performance.mark("rive:align-renderer:start:f".concat(r)),this.alignRenderer(),r>=0&&(performance.mark("rive:align-renderer:end:f".concat(r)),performance.measure("rive:align-renderer:f".concat(r),"rive:align-renderer:start:f".concat(r),"rive:align-renderer:end:f".concat(r))),r>=0&&performance.mark("rive:artboard-draw:start:f".concat(r)),this.artboard.draw(o),r>=0&&(performance.mark("rive:artboard-draw:end:f".concat(r)),performance.measure("rive:artboard-draw:f".concat(r),"rive:artboard-draw:start:f".concat(r),"rive:artboard-draw:end:f".concat(r))),o.restore(),r>=0&&performance.mark("rive:renderer-flush:start:f".concat(r)),o.flush(),r>=0&&(performance.mark("rive:renderer-flush:end:f".concat(r)),performance.measure("rive:renderer-flush:f".concat(r),"rive:renderer-flush:start:f".concat(r),"rive:renderer-flush:end:f".concat(r))),this._needsRedraw=!1),this.frameCount++;var s=performance.now();for(this.frameTimes.push(s),this.durations.push(s-i);this.frameTimes[0]<=s-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)}},t.prototype.alignRenderer=function(){var e=this.renderer,t=this.runtime,n=this._layout,i=this.artboard;e.align(n.runtimeFit(t),n.runtimeAlignment(t),{minX:n.minX,minY:n.minY,maxX:n.maxX,maxY:n.maxY},i.bounds,this._devicePixelRatioUsed*n.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce(function(e,t){return e+t},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var e,t,n,i,r;this.destroyed=!0,this.stopRendering(),null==(t=null==(e=this.renderer)?void 0:e.bindContext)||t.call(e),this.cleanupInstances(),null!==this._observed&&$.remove(this._observed),this.removeRiveListeners(),this.renderer&&(null==(i=(n=this.renderer).detachSession)||i.call(n)),this.releaseCurrentRiveFile(!0),this.riveFile=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(G.remove(this._audioEventListener),this._audioEventListener=null),this._pageVisibilityHandler&&(document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),null==(r=this._viewModelInstance)||r.cleanup(),this._viewModelInstance=null,this._globalViewModelInstances.forEach(function(e){return e.cleanup()}),this._globalViewModelInstances.clear(),this._dataEnums=null},t.prototype.releaseCurrentRiveFile=function(e){var t,n;this.file?((e||this.ownsRiveFile)&&(null==(t=this.riveFile)||t.cleanup()),this.file=null):this.ownsRiveFile&&(null==(n=this.riveFile)||n.destroyIfUnused())},t.prototype.deleteRiveRenderer=function(){var e,t;this.renderer&&(null==(t=(e=this.renderer).detachSession)||t.call(e),this.renderer.delete()),this.renderer=null},Object.defineProperty(t.prototype,"deferredRendererActive",{get:function(){var e,t,n;return null!=(n=null==(t=null==(e=this.renderer)?void 0:e.deferredActive)?void 0:t.call(e))&&n},enumerable:!1,configurable:!0}),t.prototype.cleanupInstances=function(){var e;null!==this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics(),null==(e=this.animator)||e.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(e){if(!e)return void console.warn("No text run name provided");if(!this.artboard)return void console.warn("Tried to access text run, but the Artboard is null");var t,n=this.artboard.textRun(e);return n||void console.warn("Could not access a text run with name '".concat(e,"' in the '").concat(null==(t=this.artboard)?void 0:t.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))},t.prototype.getTextRunValue=function(e){V(D);var t=this.retrieveTextRun(e);return t?t.text:void 0},t.prototype.setTextRunValue=function(e,t){V(D);var n=this.retrieveTextRun(e);n&&(n.text=t)},t.prototype.warnIfLinearAnimationNames=function(e,t){this.animator&&this.animator.animations.some(function(t){return e.includes(t.name)})&&U(t)},t.prototype.play=function(e,t){var n=this;N(e,"play");var i=em(e);this.readyForPlaying?(this.animator.play(i),this.warnIfLinearAnimationNames(i,"play"),this.syncSemanticsOnStateMachines(),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(e,t)}})},t.prototype.pause=function(e){var t=this;N(e,"pause");var n=em(e);this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.animator.pause(n),this.warnIfLinearAnimationNames(n,"pause")):this.taskQueue.add({action:function(){return t.pause(e)}})},t.prototype.scrub=function(e,t){var n=this;V("`scrub()` is deprecated and will be removed in a future major version: use a state machine to control playback instead.");var i=em(e);this.readyForPlaying?(this.animator.scrub(i,t||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(e,t)}})},t.prototype.stop=function(e){var t=this;N(e,"stop");var n=em(e);this.readyForPlaying?(this.warnIfLinearAnimationNames(n,"stop"),this.animator&&this.animator.stop(n),this.eventCleanup&&this.eventCleanup(),this.cleanupKeyboardInteractions(),this.cleanupSemantics()):this.taskQueue.add({action:function(){return t.stop(e)}})},t.prototype.reset=function(e){var t,n,i=null==e?void 0:e.artboard,r=K({stateMachine:null==e?void 0:e.stateMachine,animations:null==e?void 0:e.animations,stateMachines:null==e?void 0:e.stateMachines}),a=r.startingAnimationNames,o=r.startingStateMachineNames,s=null!=(t=null==e?void 0:e.autoplay)&&t,u=null!=(n=null==e?void 0:e.autoBind)&&n;this.cleanupInstances(),this.initArtboard(i,a,o,s,u),this.readyForPlaying&&this.taskQueue.process()},t.prototype.load=function(e){if(!e.src&&!e.buffer&&!e.riveFile)throw new w(t.missingErrorMessage);this.stop(),this.init(e)},Object.defineProperty(t.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()}
1,enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height}),this._overlayTransformDirty=!0},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,a=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=a,this.canvas.width=a*i,this.canvas.height=a*r,this._needsRedraw=!0,this.resizeToCanvas(),this.layout.fit===e.Layout){var o=this._layout.layoutScaleFactor;this.artboard.width=i/o,this.artboard.height=r/o}this.drawFrame()}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"semanticTree",{get:function(){return this._semanticTree},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessibilityOverlay",{get:function(){return this._accessibilityOverlay},enumerable:!1,configurable:!0}),Object.defineProperty(t.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},enumerable:!1,configurable:!0}),Object.defineProperty(t.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}),t.prototype.stateMachineInputs=function(e){if(V(L),this.loaded){var t=this.animator.stateMachines.find(function(t){return t.name===e});return null==t?void 0:t.inputs}},t.prototype.retrieveInputAtPath=function(e,t){if(!e)return void console.warn("No input name provided for path '".concat(t,"'"));if(!this.artboard)return void console.warn("Tried to access input: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));var n=this.artboard.inputByPath(e,t);return n||void console.warn("Could not access an input with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.setBooleanStateAtPath=function(e,t,n){V(L);var r=this.retrieveInputAtPath(e,n);r&&(r.type===i.Boolean?r.asBool().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(e,t,n){V(L);var r=this.retrieveInputAtPath(e,n);r&&(r.type===i.Number?r.asNumber().value=t:console.warn("Input with name: '".concat(e,"', at path:'").concat(n,"' is not a number")))},t.prototype.fireStateAtPath=function(e,t){V(L);var n=this.retrieveInputAtPath(e,t);n&&(n.type===i.Trigger?n.asTrigger().fire():console.warn("Input with name: '".concat(e,"', at path:'").concat(t,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(e,t){if(!e)return void console.warn("No text name provided for path '".concat(t,"'"));if(!t)return void console.warn("No path provided for text '".concat(e,"'"));if(!this.artboard)return void console.warn("Tried to access text: '".concat(e,"', at path: '").concat(t,"', but the Artboard is null"));var n=this.artboard.textByPath(e,t);return n||void console.warn("Could not access text with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.getTextRunValueAtPath=function(e,t){V(D);var n=this.retrieveTextAtPath(e,t);return n?n.text:void console.warn("Could not get text with name: '".concat(e,"', at path:'").concat(t,"'"))},t.prototype.setTextRunValueAtPath=function(e,t,n){V(D);var i=this.retrieveTextAtPath(e,n);i?i.text=t:console.warn("Could not set text with name: '".concat(e,"', at path:'").concat(n,"'"))},Object.defineProperty(t.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(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(e){return e.playing}).map(function(e){return e.name}):[]}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.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(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){var e,t;return null==(t=null==(e=this.animator)?void 0:e.isStopped)||t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(e,t){e===a.RiveEvent?V(O):e===a.StateChange?V("State change events are deprecated and will be removed in a future major version: use data binding (view model property observers) or state machine actions to react to changes from your graphic instead. See https://rive.app/docs/editor/state-machine/states#actions for how to migrate."):e===a.Loop&&V("Loop events are deprecated and will be removed in a future major version: they are only reported for linear animation playback, which is deprecated. Use a state machine to control playback and data binding to react to changes instead. See https://rive.app/docs/editor/data-binding/migration-guide for how to migrate."),this.eventManager.add({type:e,callback:t})},t.prototype.off=function(e,t){this.eventManager.remove({type:e,callback:t})},t.prototype.unsubscribe=function(e,t){console.warn("This function is deprecated: please use `off()` instead."),this.off(e,t)},t.prototype.removeAllRiveEventListeners=function(e){this.eventManager.removeAll(e)},t.prototype.unsubscribeAll=function(e){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(e)},t.prototype.stopRendering=function(){this._explicitlyStoppedRendering=!0,this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this._explicitlyStoppedRendering=!1,this.drawFrame()},t.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},t.prototype._onPageVisibilityChange=function(){var e,t;document.hidden?(null!==this.frameRequestId&&((null==(e=this.runtime)?void 0:e.cancelAnimationFrame)?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null),this.lastRenderTime=0):(null==(t=this.animator)?void 0:t.isPlaying)&&!this._explicitlyStoppedRendering&&this.scheduleRendering()},t.prototype.enableFPSCounter=function(e){this.runtime.enableFPSCounter(e)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var e={artboards:[]},t=0;t<this.file.artboardCount();t++){for(var n=this.file.artboardByIndex(t),i={name:n.name,animations:[],stateMachines:[]},r=0;r<n.animationCount();r++){var a=n.animationByIndex(r);i.animations.push(a.name)}for(var o=0;o<n.stateMachineCount();o++){for(var s=n.stateMachineByIndex(o),u=s.name,l=new this.runtime.StateMachineInstance(s,n),c=[],d=0;d<l.inputCount();d++){var h=l.input(d);c.push({name:h.name,type:h.type})}i.stateMachines.push({name:u,inputs:c})}e.artboards.push(i)}return e}},enumerable:!1,configurable:!0}),Object.defineProperty(t.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*G.systemVolume)}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var e;return this.artboard?this.artboard.width:null!=(e=this._artboardWidth)?e:0},set:function(e){this._artboardWidth=e,this.artboard&&(this.artboard.width=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var e;return this.artboard?this.artboard.height:null!=(e=this._artboardHeight)?e:0},set:function(e){this._artboardHeight=e,this.artboard&&(this.artboard.height=e)},enumerable:!1,configurable:!0}),t.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(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(e){e!==this._devicePixelRatioUsed&&(this._overlayTransformDirty=!0),this._devicePixelRatioUsed=e},enumerable:!1,configurable:!0}),t.prototype.bindViewModelInstance=function(e){e&&(this.setViewModelInstance(e),this.bind())},t.prototype.setViewModelInstance=function(e){var t,n=null==e?void 0:e.runtimeInstance;this.artboard&&!this.destroyed&&e&&n&&(e.internalIncrementReferenceCount(),null==(t=this._viewModelInstance)||t.cleanup(),this._viewModelInstance=e,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(e){return e.instance.setViewModelInstance(n)}):this.artboard.setViewModelInstance(n))},t.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(t.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),t.prototype.setGlobalViewModelInstance=function(e,t){var n,i=null==t?void 0:t.runtimeInstance;if(!this.artboard||this.destroyed||!i)return!1;var r=!1;return this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(t){t.instance.setGlobalViewModelInstance(e,i)&&(r=!0)}):r=this.artboard.setGlobalViewModelInstance(e,i),r&&(t.internalIncrementReferenceCount(),null==(n=this._globalViewModelInstances.get(e))||n.cleanup(),this._globalViewModelInstances.set(e,t)),r},t.prototype.globalViewModelInstance=function(e){var t=this._globalViewModelInstances.get(e);if(t)return t;if(!this.artboard||this.destroyed)return null;var n=this.animator.stateMachines.length>0?this.animator.stateMachines[0].instance.globalViewModelInstance(e):this.artboard.globalViewModelInstance(e);if(null===n)return null;var i=new ei(n,null);return(0,f.createFinalization)(i,n),i.internalIncrementReferenceCount(),this._globalViewModelInstances.set(e,i),i},t.prototype.globalViewModelNames=function(){var e,t;return null!=(t=null==(e=this.file)?void 0:e.globalViewModelNames())?t:[]},t.prototype.viewModelByIndex=function(e){var t=this.file.viewModelByIndex(e);return null!==t?new ee(t):null},t.prototype.viewModelByName=function(e){var t;return null==(t=this.riveFile)?void 0:t.viewModelByName(e)},t.prototype.enums=function(){if(null===this._dataEnums){var e=this.file.enums();this._dataEnums=e.map(function(e){return new et(e)})}return this._dataEnums},t.prototype.defaultViewModel=function(){if(this.artboard){var e=this.file.defaultArtboardViewModel(this.artboard);if(e)return new ee(e)}return null},t.prototype.getArtboard=function(e){var t,n;return null!=(n=null==(t=this.riveFile)?void 0:t.getArtboard(e))?n:null},t.prototype.getBindableArtboard=function(e){var t,n;return null!=(n=null==(t=this.riveFile)?void 0:t.getBindableArtboard(e))?n:null},t.prototype.getDefaultBindableArtboard=function(){var e,t;return null!=(t=null==(e=this.riveFile)?void 0:e.getDefaultBindableArtboard())?t:null},t.prototype.clearFocus=function(){this.animator.stateMachines.filter(function(e){return e.playing&&e.hasFocusNodes}).forEach(function(e){return e.clearFocus()})},t.missingErrorMessage="Rive source file or data buffer required",t.cleanupErrorMessage="Attempt to use file after calling cleanup.",t}(),(Z=u||(u={})).none="none",Z.string="string",Z.number="number",Z.boolean="boolean",Z.color="color",Z.list="list",Z.enumType="enumType",Z.trigger="trigger",Z.viewModel="viewModel",Z.integer="integer",Z.listIndex="listIndex",Z.image="image",Z.artboard="artboard",ee=function(){function e(e){this._viewModel=e}return Object.defineProperty(e.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),e.prototype.instanceByIndex=function(e){var t=this._viewModel.instanceByIndex(e);if(null!==t){var n=new ei(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.instanceByName=function(e){var t=this._viewModel.instanceByName(e);if(null!==t){var n=new ei(t,null);return(0,f.createFinalization)(n,t),n}return null},e.prototype.defaultInstance=function(){var e=this._viewModel.defaultInstance();if(null!==e){var t=new ei(e,null);return(0,f.createFinalization)(t,e),t}return null},e.prototype.instance=function(){var e=this._viewModel.instance();if(null!==e){var t=new ei(e,null);return(0,f.createFinalization)(t,e),t}return null},Object.defineProperty(e.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),e}(),et=function(){function e(e){this._dataEnum=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),e}(),(en=l||(l={})).Number="number",en.String="string",en.Boolean="boolean",en.Color="color",en.Trigger="trigger",en.Enum="enum",en.List="list",en.Image="image",en.Font="font",en.Artboard="artboard",ei=function(){function e(e,t){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=e,null!==t&&this._parents.push(t)}return Object.defineProperty(e.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),e.prototype.handleCallbacks=function(){0!==this._propertiesWithCallbacks.length&&(this._propertiesWithCallbacks.forEach(function(e){e.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(e){e.clearChanges()})),this._children.forEach(function(e){return e.handleCallbacks()})},e.prototype.addParent=function(e){!this._parents.includes(e)&&(this._parents.push(e),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&e.addToViewModelCallbacks(this))},e.prototype.removeParent=function(e){var t=this._parents.indexOf(e);-1!==t&&(this._parents[t].removeFromViewModelCallbacks(this),this._parents.splice(t,1))},e.prototype.addToPropertyCallbacks=function(e){var t=this;!this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks.push(e),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromPropertyCallbacks=function(e){var t=this;this._propertiesWithCallbacks.includes(e)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.addToViewModelCallbacks=function(e){var t=this;this._children.includes(e)||(this._children.push(e),this._parents.forEach(function(e){e.addToViewModelCallbacks(t)}))},e.prototype.removeFromViewModelCallbacks=function(e){var t=this;this._children.includes(e)&&(this._children=this._children.filter(function(t){return t!==e}),0===this._children.length&&0===this._propertiesWithCallbacks.length&&this._parents.forEach(function(e){e.removeFromViewModelCallbacks(t)}))},e.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(e){e.clearCallbacks()})},e.prototype.propertyFromPath=function(e,t){var n=e.split("/");return this.propertyFromPathSegments(n,0,t)},e.prototype.viewModelFromPathSegments=function(e,t){var n=this.internalViewModelInstance(e[t]);if(null!==n)if(t==e.length-1)return n;else return n.viewModelFromPathSegments(e,t++);return null},e.prototype.propertyFromPathSegments=function(e,t,n){if(t<e.length-1){var i,r,a,o,s,u,c,d,h,f,p,v,m,b,y,g,w,_,C,A,R=this.internalViewModelInstance(e[t]);return null!==R?R.propertyFromPathSegments(e,t+1,n):null}var I=null;switch(n){case l.Number:if(null!==(I=null!=(r=null==(i=this._runtimeInstance)?void 0:i.number(e[t]))?r:null))return new eo(I,this);break;case l.String:if(null!==(I=null!=(o=null==(a=this._runtimeInstance)?void 0:a.string(e[t]))?o:null))return new ea(I,this);break;case l.Boolean:if(null!==(I=null!=(u=null==(s=this._runtimeInstance)?void 0:s.boolean(e[t]))?u:null))return new es(I,this);break;case l.Color:if(null!==(I=null!=(d=null==(c=this._runtimeInstance)?void 0:c.color(e[t]))?d:null))return new ed(I,this);break;case l.Trigger:if(null!==(I=null!=(f=null==(h=this._runtimeInstance)?void 0:h.trigger(e[t]))?f:null))return new eu(I,this);break;case l.Enum:if(null!==(I=null!=(v=null==(p=this._runtimeInstance)?void 0:p.enum(e[t]))?v:null))return new el(I,this);break;case l.List:if(null!==(I=null!=(b=null==(m=this._runtimeInstance)?void 0:m.list(e[t]))?b:null))return new ec(I,this);break;case l.Image:if(null!==(I=null!=(g=null==(y=this._runtimeInstance)?void 0:y.image(e[t]))?g:null))return new eh(I,this);break;case l.Font:if(null!==(I=null!=(_=null==(w=this._runtimeInstance)?void 0:w.font(e[t]))?_:null))return new ef(I,this);break;case l.Artboard:if(null!==(I=null!=(A=null==(C=this._runtimeInstance)?void 0:C.artboard(e[t]))?A:null))return new ep(I,this)}return null},e.prototype.internalViewModelInstance=function(t){if(this._viewModelInstances.has(t))return this._viewModelInstances.get(t);var n,i=null==(n=this._runtimeInstance)?void 0:n.viewModel(t);if(null!==i){var r=new e(i,this);return(0,f.createFinalization)(r,i),r.internalIncrementReferenceCount(),this._viewModelInstances.set(t,r),r}return null},e.prototype.number=function(e){return this.propertyFromPath(e,l.Number)},e.prototype.string=function(e){return this.propertyFromPath(e,l.String)},e.prototype.boolean=function(e){return this.propertyFromPath(e,l.Boolean)},e.prototype.color=function(e){return this.propertyFromPath(e,l.Color)},e.prototype.trigger=function(e){return this.propertyFromPath(e,l.Trigger)},e.prototype.enum=function(e){return this.propertyFromPath(e,l.Enum)},e.prototype.list=function(e){return this.propertyFromPath(e,l.List)},e.prototype.image=function(e){return this.propertyFromPath(e,l.Image)},e.prototype.font=function(e){return this.propertyFromPath(e,l.Font)},e.prototype.artboard=function(e){return this.propertyFromPath(e,l.Artboard)},e.prototype.viewModel=function(e){var t=e.split("/"),n=t.length>1?this.viewModelFromPathSegments(t.slice(0,t.length-1),0):this;return null!=n?n.internalViewModelInstance(t[t.length-1]):null},e.prototype.internalReplaceViewModel=function(e,t){var n;if(null!==t.runtimeInstance){var i=(null==(n=this._runtimeInstance)?void 0:n.replaceViewModel(e,t.runtimeInstance))||!1;if(i){t.internalIncrementReferenceCount();var r=this.internalViewModelInstance(e);null!==r&&(r.removeParent(this),this._children.includes(r)&&(this._children=this._children.filter(function(e){return e!==r})),r.cleanup()),this._viewModelInstances.set(e,t),t.addParent(this)}return i}return!1},e.prototype.replaceViewModel=function(e,t){var n,i=e.split("/"),r=i.length>1?this.viewModelFromPathSegments(i.slice(0,i.length-1),0):this;return null!=(n=null==r?void 0:r.internalReplaceViewModel(i[i.length-1],t))&&n},e.prototype.incrementReferenceCount=function(){var e;this._referenceCount++,null==(e=this._runtimeInstance)||e.incrementReferenceCount()},e.prototype.decrementReferenceCount=function(){var e;this._referenceCount--,null==(e=this._runtimeInstance)||e.decrementReferenceCount()},Object.defineProperty(e.prototype,"properties",{get:function(){var e;return(null==(e=this._runtimeInstance)?void 0:e.getProperties().map(function(e){return m({},e)}))||[]}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewModelName",{get:function(){var e,t;return null!=(t=null==(e=this._runtimeInstance)?void 0:e.getViewModelName())?t:""},enumerable:!1,configurable:!0}),e.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},e.prototype.cleanup=function(){var e,t=this;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&(null==(e=this._runtimeInstance)||e.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(e){e.cleanup()}),this._viewModelInstances.clear();var n=g([],this._children,!0);this._children.length=0;var i=g([],this._parents,!0);this._parents.length=0,n.forEach(function(e){e.removeParent(t)}),i.forEach(function(e){e.removeFromViewModelCallbacks(t)})}},e}(),ea=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(er=function(){function e(e,t){this.callbacks=[],this._viewModelInstanceValue=e,this._parentViewModel=t}return e.prototype.on=function(e){0===this.callbacks.length&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(e)||(this.callbacks.push(e),this._parentViewModel.addToPropertyCallbacks(this))},e.prototype.off=function(e){e?this.callbacks=this.callbacks.filter(function(t){return t!==e}):this.callbacks.length=0,0===this.callbacks.length&&this._parentViewModel.removeFromPropertyCallbacks(this)},e.prototype.internalHandleCallback=function(e){},e.prototype.handleCallbacks=function(){var e=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(t){e.internalHandleCallback(t)})},e.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},e.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(e.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),e}()),eo=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(er),es=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(er),eu=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),t.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},t.prototype.internalHandleCallback=function(e){e()},t}(er),el=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(e){this._viewModelInstanceValue.valueIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e(this.value)},t}(er),ec=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),t.prototype.addInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.addInstance(e.runtimeInstance),e.addParent(this._parentViewModel))},t.prototype.addInstanceAt=function(e,t){return!!(null!=e.runtimeInstance&&this._viewModelInstanceValue.addInstanceAt(e.runtimeInstance,t))&&(e.addParent(this._parentViewModel),!0)},t.prototype.removeInstance=function(e){null!=e.runtimeInstance&&(this._viewModelInstanceValue.removeInstance(e.runtimeInstance),e.removeParent(this._parentViewModel))},t.prototype.removeInstanceAt=function(e){this._viewModelInstanceValue.removeInstanceAt(e)},t.prototype.instanceAt=function(e){var t=this._viewModelInstanceValue.instanceAt(e);if(null!=t){var n=new ei(t,this._parentViewModel);return(0,f.createFinalization)(n,t),n}return null},t.prototype.swap=function(e,t){this._viewModelInstanceValue.swap(e,t)},t.prototype.internalHandleCallback=function(e){e()},t}(er),ed=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(e){this._viewModelInstanceValue.value=e}
1,enumerable:!1,configurable:!0}),t.prototype.rgb=function(e,t,n){this._viewModelInstanceValue.rgb(e,t,n)},t.prototype.rgba=function(e,t,n,i){this._viewModelInstanceValue.argb(i,e,t,n)},t.prototype.argb=function(e,t,n,i){this._viewModelInstanceValue.argb(e,t,n,i)},t.prototype.alpha=function(e){this._viewModelInstanceValue.alpha(e)},t.prototype.opacity=function(e){this._viewModelInstanceValue.alpha(Math.round(255*Math.max(0,Math.min(1,e))))},t.prototype.internalHandleCallback=function(e){e(this.value)},t}(er),eh=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t;this._viewModelInstanceValue.value(null!=(t=null==e?void 0:e.nativeImage)?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(er),ef=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t;this._viewModelInstanceValue.value(null!=(t=null==e?void 0:e.nativeFont)?t:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(er),ep=function(e){function t(t,n){return e.call(this,t,n)||this}return v(t,e),Object.defineProperty(t.prototype,"value",{set:function(e){var t,n,i;i=e.isBindableArtboard?e:e.file.internalBindableArtboardFromArtboard(e.nativeArtboard),this._viewModelInstanceValue.value(null!=(t=null==i?void 0:i.nativeArtboard)?t:null),(null==i?void 0:i.nativeViewModel)&&this._viewModelInstanceValue.viewModelInstance(null!=(n=null==i?void 0:i.nativeViewModel)?n:null)},enumerable:!1,configurable:!0}),t.prototype.internalHandleCallback=function(e){e()},t}(er),ev=function(e){return b(void 0,void 0,void 0,function(){var t;return y(this,function(n){switch(n.label){case 0:return[4,fetch(new Request(e))];case 1:if(!(t=n.sent()).ok)throw Error("Failed to fetch the Rive file: HTTP ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,n.sent()]}})})},em=function(e){return"string"==typeof e?[e]:e instanceof Array?e:[]},eb={EventManager:z,TaskQueueManager:H},ey=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeAudio(e,t,null)})})];case 1:return t=i.sent(),n=new f.AudioWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eg=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeImage(e,t,null)})})];case 1:return t=i.sent(),n=new f.ImageWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},ew=function(e){return b(void 0,void 0,void 0,function(){var t,n;return y(this,function(i){switch(i.label){case 0:return[4,new Promise(function(t){return d.RuntimeLoader.getInstance(function(n){n.decodeFont(e,t,null)})})];case 1:return t=i.sent(),n=new f.FontWrapper(t),f.finalizationRegistry.register(n,t),[2,n]}})})},eR})()},578566,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0});var i,r=e.r(560503),a=e.r(937041),o=r&&"object"==typeof r&&"default"in r?r:{default:r};function s(e){var t=e||u(),n=r.useState(t),i=n[0],a=n[1];return r.useEffect(function(){if("u">typeof window&&"matchMedia"in window){var t=function(){a(e||u())},n=window.matchMedia("screen and (resolution: "+i+"dppx)");return n.hasOwnProperty("addEventListener")?n.addEventListener("change",t):n.addListener(t),function(){n.hasOwnProperty("removeEventListener")?n.removeEventListener("change",t):n.removeListener(t)}}},[i,e]),i}function u(){return Math.min(Math.max(1,"u">typeof window&&"number"==typeof window.devicePixelRatio?window.devicePixelRatio:1),3)}var l=function(){function e(){}var t=e.prototype;return t.observe=function(){},t.unobserve=function(){},t.disconnect=function(){},e}(),c=globalThis.ResizeObserver||l,d=void 0!==globalThis.ResizeObserver,h=!d,f={useDevicePixelRatio:!0,fitCanvasToArtboardHeight:!1,useOffscreenRenderer:!0,shouldResizeCanvasToContainer:!0};function p(e){return Object.assign({},f,e)}
1function v(e,t){try{t()}catch(t){console.warn("[Rive] "+e+" threw while cleaning up Rive; contained. ",t)}}function m(e){var t,n,i,a,o,u,l,f=e.riveLoaded,v=void 0!==f&&f,m=e.canvasElem,b=e.containerRef,y=e.options,g=e.onCanvasHasResized,w=e.artboardBounds,_=p(void 0===y?{}:y),C=r.useState({height:0,width:0}),A=C[0],R=A.height,I=A.width,S=C[1],M=r.useState({height:0,width:0}),F=M[0],E=F.height,x=F.width,P=M[1],k=r.useState(!0),T=k[0],O=k[1],L=_.fitCanvasToArtboardHeight,D=_.shouldResizeCanvasToContainer,B=_.useDevicePixelRatio,V=_.customDevicePixelRatio,N=(void 0===(t=D)&&(t=!0),i=(n=r.useState({width:0,height:0}))[0],a=n[1],r.useEffect(function(){if("u">typeof window&&t){var e=function(){a({width:window.innerWidth,height:window.innerHeight})};return h&&(e(),window.addEventListener("resize",e)),function(){return window.removeEventListener("resize",e)}}},[]),l=r.useRef(new c((o=function(e){d&&a({width:e[e.length-1].contentRect.width,height:e[e.length-1].contentRect.height})},u=0,function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];clearTimeout(u),u=window.setTimeout(function(){return o.apply(e,n)},0)}))),r.useEffect(function(){var e=l.current;if(!t)return void e.disconnect();var n=b.current;return b.current&&d&&e.observe(b.current),function(){e.disconnect(),n&&d&&e.unobserve(n)}},[b,l]),i),U=s(V),j=null!=w?w:{},z=j.maxX,H=j.maxY,W=r.useCallback(function(){var e,t,n,i,r=null!=(e=null==(n=b.current)?void 0:n.clientWidth)?e:0,a=null!=(t=null==(i=b.current)?void 0:i.clientHeight)?t:0;return L&&w?{width:r,height:w.maxY/w.maxX*r}:{width:r,height:a}},[b,L,z,H]);r.useEffect(function(){if(D&&b.current&&v){var e=W(),t=e.width,n=e.height,i=!1;if(m){var r=t!==I||n!==R;if(_.fitCanvasToArtboardHeight&&r&&(b.current.style.height=n+"px",i=!0),_.useDevicePixelRatio){var a=t*U!==x||n*U!==E;if(r||a){var o=U*t,s=U*n;m.width=o,m.height=s,m.style.width=t+"px",m.style.height=n+"px",P({width:o,height:s}),i=!0}}else r&&(m.width=t,m.height=n,P({width:t,height:n}),i=!0);S({width:t,height:n})}g&&(T||i)&&g&&g(),T&&O(!1)}},[m,b,N,U,W,T,O,E,x,R,I,g,D,L,B,v]),r.useEffect(function(){P({width:0,height:0})},[m])}var b=function(){function e(){}var t=e.prototype;return t.observe=function(){},t.unobserve=function(){},t.disconnect=function(){},e}(),y=globalThis.IntersectionObserver||b,g=function(){function e(){var e=this;this.elementsMap=new Map,this.onObserved=function(t){t.forEach(function(t){var n=e.elementsMap.get(t.target);n&&n(t)})},this.observer=new y(this.onObserved)}var t=e.prototype;return t.registerCallback=function(e,t){this.observer.observe(e),this.elementsMap.set(e,t)},t.removeCallback=function(e){this.observer.unobserve(e),this.elementsMap.delete(e)},e}(),w=function(){return i||(i=new g),i};function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function C(e,t){if(null==e)return{};var n,i,r={},a=Object.getOwnPropertyNames(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function A(e){var t=e.setContainerRef,n=e.setCanvasRef,i=e.className,r=void 0===i?"":i,a=e.style,s=e.children,u=C(e,["setContainerRef","setCanvasRef","className","style","children"]),l=_({width:"100%",height:"100%"},a);return o.default.createElement("div",_({ref:t,className:r},!r&&{style:l}),o.default.createElement("canvas",_({ref:n,style:{verticalAlign:"top",width:0,height:0}},u),s))}function R(e,t){void 0===t&&(t={});var n,i,u=r.useState(null),l=u[0],c=u[1],d=r.useRef(null),h=r.useRef(null),b=r.useRef(null),y=r.useState(null),g=y[0],R=y[1],I=!!e,S=p(t),M=null!=(n=null==e?void 0:e.useOffscreenRenderer)?n:t.useOffscreenRenderer,F=!!(null==e?void 0:e.enableGPUCanvas)||!!(null==e||null==(i=e.riveFile)?void 0:i.deferredRequested),E=null!=M?M:!F&&f.useOffscreenRenderer;r.useEffect(function(){F&&E&&console.warn("[Rive] GPU Canvas and `useOffscreenRenderer` cannot both be on. A GPU Canvas session records for a single <canvas>, while the offscreen renderer shares one context across every <canvas> on the page. This instance falls back to immediate rendering and GPU Canvas content will not draw — drop the explicit `useOffscreenRenderer: true` to use it.")},[F,E]);var x=s(),P=r.useCallback(function(){if(g){if(g.layout&&g.layout.fit===a.Fit.Layout&&l){var e=x*g.layout.layoutScaleFactor;g.devicePixelRatioUsed=x,g.artboardWidth=(null==l?void 0:l.width)/e,g.artboardHeight=(null==l?void 0:l.height)/e}g.startRendering(),g.resizeToCanvas()}},[g,x]);m({riveLoaded:!!g,canvasElem:l,containerRef:d,options:S,onCanvasHasResized:P,artboardBounds:null==g?void 0:g.bounds});var k=r.useCallback(function(e){var t=h.current;h.current=e,null===e&&t&&queueMicrotask(function(){h.current!==t&&(t.height=0,t.width=0)}),c(e)},[]);r.useEffect(function(){if(l&&e){var t,n=null!=g;if(null==g){var i=e.onRiveReady,r=C(e,["onRiveReady"]);t=new a.Rive(_({},r,{useOffscreenRenderer:E,canvas:l})),null!=b.current&&v("replacing a previous instance",function(){return b.current.cleanup()}),b.current=t,t.on(a.EventType.Load,function(){n=!0,i&&i(t),l?R(t):v("unmounted before load",function(){return t.cleanup()})})}return function(){n||v("teardown before load",function(){return null==t?void 0:t.cleanup()})}}},[l,I,g]);var T=r.useCallback(function(e){d.current=e},[]),O={observe:r.useCallback(function(e,t){w().registerCallback(e,t)},[]),unobserve:r.useCallback(function(e){w().removeCallback(e)},[])},L=O.observe,D=O.unobserve;r.useEffect(function(){var e,t=!1,n=function(){if(l&&t){var e=l.getBoundingClientRect();e.width>0&&e.height>
10&&e.top<(window.innerHeight||document.documentElement.clientHeight)&&e.bottom>0&&e.left<(window.innerWidth||document.documentElement.clientWidth)&&e.right>0&&(null==g||g.startRendering(),t=!1)}};return l&&!1!==S.shouldUseIntersectionObserver&&L(l,function(i){i.isIntersecting?g&&g.startRendering():g&&g.stopRendering(),t=!i.isIntersecting,clearTimeout(e),i.isIntersecting||0!==i.boundingClientRect.width||(e=setTimeout(n,10))}),function(){clearTimeout(e),l&&D(l)}},[L,D,g,l,S.shouldUseIntersectionObserver]),r.useEffect(function(){return function(){g&&(v("unmount",function(){return g.cleanup()}),R(null))}},[g,l]),r.useEffect(function(){return function(){null!=b.current&&v("final unmount",function(){return b.current.cleanup()})}},[]);var B=null==e?void 0:e.animations;r.useEffect(function(){g&&B&&(g.isPlaying?(g.stop(g.animationNames),g.play(B)):g.isPaused&&(g.stop(g.animationNames),g.pause(B)))},[B,g]);var V=r.useCallback(function(e){return o.default.createElement(A,_({setContainerRef:T,setCanvasRef:k},e))},[k,T]);return{canvas:l,container:d.current,setCanvasRef:k,setContainerRef:T,rive:g,RiveComponent:V}}function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}var S=new WeakSet;function M(e){S.has(e)||(S.add(e),queueMicrotask(function(){S.delete(e),e.bind()}))}function F(e,t){var n=t.name,i=t.useNew,r=t.instance;return void 0!==r?r:e?null!=n?e.instanceByName(n)||null:i?(null==e.instance?void 0:e.instance.call(e))||null:(null==e.defaultInstance?void 0:e.defaultInstance.call(e))||null:null}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function x(e,t,n){var i=r.useState(null),a=i[0],o=i[1],s=r.useState(n.defaultValue),u=s[0],l=s[1],c=r.useState(null),d=c[0],h=c[1],f=r.useRef(null),p=r.useRef(e),v=r.useRef(n);r.useEffect(function(){v.current=n},[n]);var m=r.useCallback(function(){var e=f.current,t=p.current,n=v.current;if(!e||!t)return o(null),l(n.defaultValue),h(null),function(){};var i=n.getProperty(e,t);if(i){o(i),l(n.getValue(i)),n.getExtendedData&&h(n.getExtendedData(i));var r=function(){l(n.getValue(i)),n.getExtendedData&&h(n.getExtendedData(i)),n.onPropertyEvent&&n.onPropertyEvent()};return i.on(r),function(){i.off(r)}}return function(){}},[]);r.useEffect(function(){return f.current=t,p.current=e,m()},[t,e,m]);var b=r.useCallback(function(e){if(a&&f.current===t)try{e(a),v.current.getExtendedData&&h(v.current.getExtendedData(a));return}catch(e){}if(f.current)try{var n=v.current.getProperty(f.current,p.current);n&&(o(n),e(n),v.current.getExtendedData&&h(v.current.getExtendedData(n)))}catch(e){}},[a,t]),y=r.useMemo(function(){return v.current.buildPropertyOperations(b)},[b]),g=E({value:u},y);return n.getExtendedData&&(g.extendedData=d),g}function P(e,t,n,i,r,a,o){try{var s=e[a](o),u=s.value}catch(e){n(e);return}s.done?t(u):Promise.resolve(u).then(i,r)}n.default=function(e){var t=e.src,n=e.artboard,i=e.stateMachine,r=e.animations,a=e.stateMachines,s=e.layout,u=e.useOffscreenRenderer,l=e.enableGPUCanvas,c=e.shouldDisableRiveListeners,d=e.shouldResizeCanvasToContainer,h=e.automaticallyHandleEvents,f=e.children,p=function(e,t){if(null==e)return{};var n,i,r={},a=Object.getOwnPropertyNames(e);for(i=0;i<a.length;i++)!(t.indexOf(n=a[i])>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}(e,["src","artboard","stateMachine","animations","stateMachines","layout","useOffscreenRenderer","enableGPUCanvas","shouldDisableRiveListeners","shouldResizeCanvasToContainer","automaticallyHandleEvents","children"]),v=R({src:t,artboard:n,stateMachine:i,animations:r,layout:s,stateMachines:a,autoplay:!0,shouldDisableRiveListeners:void 0!==c&&c,automaticallyHandleEvents:void 0!==h&&h,enableGPUCanvas:l},I({shouldResizeCanvasToContainer:void 0===d||d},void 0!==u&&{useOffscreenRenderer:u})).RiveComponent;return o.default.createElement(v,p,f)},n.useGlobalViewModelInstance=function(e,t,n){var i=null!=n?n:{},a=i.instanceName,o=i.useNew,s=void 0!==o&&o,u=i.instance,l=i.rive,c=r.useState(null),d=c[0],h=c[1];return r.useEffect(function(){var n=F(e,{name:a,useNew:s,instance:u});h(n),l&&t&&n&&l.setGlobalViewModelInstance(t,n)&&M(l)},[e,t,a,s,u,l]),d},n.useResizeCanvas=m,n.useRive=R,n.useRiveFile=function(e){var t=r.useState(null),n=t[0],i=t[1],o=r.useState("idle"),s=o[0],u=o[1];return r.useEffect(function(){var t,n=null;return(t=function(){return function(e,t){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]}
1,trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:u(0)}),s(o,"throw",{value:u(1)}),s(o,"return",{value:u(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function u(s){return function(u){var l=[s,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&l[0]?i.return:l[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;switch(i=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,i=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(6===l[0]&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],i=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(t){try{u("loading"),(n=new a.RiveFile(e)).init(),n.on(a.EventType.Load,function(){null==n||n.getInstance(),i(n),u("success")}),n.on(a.EventType.LoadError,function(){u("failed")}),i(n)}catch(e){console.error(e),u("failed")}return[2]})},function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function o(e){P(a,i,r,o,s,"next",e)}function s(e){P(a,i,r,o,s,"throw",e)}o(void 0)})})(),function(){v("RiveFile unmount",function(){return null==n?void 0:n.cleanup()})}},[e.src,e.buffer,e.enableGPUCanvas]),{riveFile:n,status:s}},n.useStateMachineInput=function(e,t,n,i){var o=r.useState(null),s=o[0],u=o[1];return r.useEffect(function(){var r=function(){if(e&&t&&n||u(null),e&&t&&n){var r=e.stateMachineInputs(t);if(r){var a=r.find(function(e){return e.name===n});void 0!==i&&a&&(a.value=i),u(a||null)}}else u(null)};r(),e&&e.on(a.EventType.Load,function(){r()})},[e]),s},n.useViewModel=function(e,t){var n=null!=t?t:{},i=n.name,o=n.useDefault,s=r.useState(null),u=s[0],l=s[1];return r.useEffect(function(){var t=function(){e?l(null!=i?(null==e.viewModelByName?void 0:e.viewModelByName.call(e,i))||null:e.defaultViewModel()||null):l(null)};return t(),e&&e.on(a.EventType.Load,t),function(){e&&e.off(a.EventType.Load,t)}},[e,i,void 0!==o&&o]),u},n.useViewModelInstance=function(e,t){var n=null!=t?t:{},i=n.name,a=n.useDefault,o=n.useNew,s=void 0!==o&&o,u=n.rive,l=r.useState(null),c=l[0],d=l[1];return r.useEffect(function(){if(!e)return void d(null);var t=F(e,{name:i,useNew:s});d(t),u&&t&&u.viewModelInstance!==t&&(u.setViewModelInstance(t),M(u))},[e,i,void 0!==a&&a,s,u]),c},n.useViewModelInstanceArtboard=function(e,t){return{setValue:x(e,t,{getProperty:r.useCallback(function(e,t){return e.artboard(t)},[]),getValue:r.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])}).setValue}},n.useViewModelInstanceBoolean=function(e,t){var n=x(e,t,{getProperty:r.useCallback(function(e,t){return e.boolean(t)},[]),getValue:r.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},n.useViewModelInstanceColor=function(e,t){var n=x(e,t,{getProperty:r.useCallback(function(e,t){return e.color(t)},[]),getValue:r.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})},setRgb:function(t,n,i){e(function(e){e.rgb(t,n,i)})},setRgba:function(t,n,i,r){e(function(e){e.rgba(t,n,i,r)})},setAlpha:function(t){e(function(e){e.alpha(t)})},setOpacity:function(t){e(function(e){e.opacity(t)})}}},[])});return{value:n.value,setValue:n.setValue,setRgb:n.setRgb,setRgba:n.setRgba,setAlpha:n.setAlpha,setOpacity:n.setOpacity}},n.useViewModelInstanceEnum=function(e,t){var n=x(e,t,{getProperty:r.useCallback(function(e,t){return e.enum(t)},[]),getValue:r.useCallback(function(e){return e.value},[]),defaultValue:null,getExtendedData:r.useCallback(function(e){return e.values},[]),buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,values:n.extendedData||[],setValue:n.setValue}},n.useViewModelInstanceFont=function(e,t){return{setValue:x(e,t,{getProperty:r.useCallback(function(e,t){return e.font(t)},[]),getValue:r.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])}).setValue}},n.useViewModelInstanceImage=function(e,t){return{setValue:x(e,t,{getProperty:r.useCallback(function(e,t){return e.image(t)},[]),getValue:r.useCallback(function(){},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])}).setValue}},n.useViewModelInstanceList=function(e,t){var n,i=r.useState(0)[1],a=x(e,t,{getProperty:r.useCallback(function(e,t){return e.list(t)},[]),getValue:r.useCallback(function(e){return e.length},[]),defaultValue:null,onPropertyEvent:function(){i(function(e){return e+1})},buildPropertyOperations:r.useCallback(function(e){return{addInstance:function(t){e(function(e){return e.addInstance(t)})},addInstanceAt:function(t,n){var i=!1;return e(function(e){i=e.addInstanceAt(t,n)}),i},removeInstance:function(t){e(function(e){return e.removeInstance(t)})},removeInstanceAt:function(t){e(function(e){return e.removeInstanceAt(t)})},getInstanceAt:function(t){var n=null;return e(function(e){n=e.instanceAt(t)}),n}
1,swap:function(t,n){e(function(e){return e.swap(t,n)})}}},[])});return{length:null!=(n=a.value)?n:0,addInstance:a.addInstance,addInstanceAt:a.addInstanceAt,removeInstance:a.removeInstance,removeInstanceAt:a.removeInstanceAt,getInstanceAt:a.getInstanceAt,swap:a.swap}},n.useViewModelInstanceNumber=function(e,t){var n=x(e,t,{getProperty:r.useCallback(function(e,t){return e.number(t)},[]),getValue:r.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},n.useViewModelInstanceString=function(e,t){var n=x(e,t,{getProperty:r.useCallback(function(e,t){return e.string(t)},[]),getValue:r.useCallback(function(e){return e.value},[]),defaultValue:null,buildPropertyOperations:r.useCallback(function(e){return{setValue:function(t){e(function(e){e.value=t})}}},[])});return{value:n.value,setValue:n.setValue}},n.useViewModelInstanceTrigger=function(e,t,n){var i=(null!=n?n:{}).onTrigger;return{trigger:x(e,t,{getProperty:r.useCallback(function(e,t){return e.trigger(t)},[]),getValue:r.useCallback(function(){},[]),defaultValue:null,onPropertyEvent:i,buildPropertyOperations:r.useCallback(function(e){return{trigger:function(){e(function(e){e.trigger()})}}},[])}).trigger}},Object.keys(a).forEach(function(e){"default"===e||n.hasOwnProperty(e)||Object.defineProperty(n,e,{enumerable:!0,get:function(){return a[e]}})})},360266,e=>{"use strict";var t=e.i(471895),n=e.i(85436),i=e.i(578566),r=e.i(559723);let a={src:r.default,autoplay:!0,animations:["ColorBrand","Slow"]},o={src:r.default,autoplay:!0,animations:["ColorWhite","Slow"]};e.s(["DotsJumpIndicator",0,function(e){let r,s,u,l=(0,n.c)(6);l[0]!==e?({color:r,...s}=e,l[0]=e,l[1]=r,l[2]=s):(r=l[1],s=l[2]);let{RiveComponent:c}=(0,i.useRive)("white"===r?o:a);return l[3]!==c||l[4]!==s?(u=(0,t.jsx)(c,{...s}),l[3]=c,l[4]=s,l[5]=u):u=l[5],u}])}]);

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.