@rive-app/canvas-lite 2.40.1 → 2.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rive.js CHANGED
@@ -349,98 +349,100 @@ __webpack_require__.r(__webpack_exports__);
349
349
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
350
350
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
351
351
  /* harmony export */ });
352
- var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var k=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
353
- function fa(){function b(h){const g=d;c=a=0;d=new Map;g.forEach(m=>{try{m(h)}catch(n){console.error(n)}});this.ab();e&&e.xb()}let a=0,c=0,d=new Map,e=null,f=null;this.requestAnimationFrame=function(h){a||=requestAnimationFrame(b.bind(this));const g=++c;d.set(g,h);return g};this.cancelAnimationFrame=function(h){d.delete(h);a&&0==d.size&&(cancelAnimationFrame(a),a=0)};this.vb=function(h){f&&(document.body.remove(f),f=null);h||(f=document.createElement("div"),f.style.backgroundColor="black",f.style.position=
354
- "fixed",f.style.right=0,f.style.top=0,f.style.color="white",f.style.padding="4px",f.innerHTML="RIVE FPS",h=function(g){f.innerHTML="RIVE FPS "+g.toFixed(1)},document.body.appendChild(f));e=new function(){let g=0,m=0;this.xb=function(){var n=performance.now();m?(++g,n-=m,1E3<n&&(h(1E3*g/n),g=m=0)):(m=n,g=0)}}};this.sb=function(){f&&(document.body.remove(f),f=null);e=null};this.ab=function(){}}
355
- function ja(b){console.assert(!0);const a=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<b)-1)>>b;a.has(d)&&clearTimeout(a.get(d));a.set(d,setTimeout(function(){a.delete(d);0==a.length?c=-Infinity:d==c&&(c=Math.max(...a.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<b}}const ka=k.onRuntimeInitialized;
356
- k.onRuntimeInitialized=function(){ka&&ka();let b=k.decodeAudio;k.decodeAudio=function(f,h){f=b(f);h(f)};let a=k.decodeFont;k.decodeFont=function(f,h){f=a(f);h(f)};let c=k.setFallbackFontCb;k.setFallbackFontCallback="function"===typeof c?function(f){c(f)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const d=k.FileAssetLoader;k.ptrToAsset=f=>{let h=k.ptrToFileAsset(f);return h.isImage?k.ptrToImageAsset(f):h.isFont?k.ptrToFontAsset(f):
357
- h.isAudio?k.ptrToAudioAsset(f):h};k.CustomFileAssetLoader=d.extend("CustomFileAssetLoader",{__construct:function({loadContents:f}){this.__parent.__construct.call(this);this.mb=f},loadContents:function(f,h){f=k.ptrToAsset(f);return this.mb(f,h)}});k.CDNFileAssetLoader=d.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(f){let h=k.ptrToAsset(f);f=h.cdnUuid;if(""===f)return!1;(function(g,m){var n=new XMLHttpRequest;n.responseType="arraybuffer";
358
- n.onreadystatechange=function(){4==n.readyState&&200==n.status&&m(n)};n.open("GET",g,!0);n.send(null)})(h.cdnBaseUrl+"/"+f,g=>{h.decode(new Uint8Array(g.response))});return!0}});k.FallbackFileAssetLoader=d.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);this.$a=[]},addLoader:function(f){this.$a.push(f)},loadContents:function(f,h){for(let g of this.$a)if(g.loadContents(f,h))return!0;return!1}});let e=k.computeAlignment;k.computeAlignment=function(f,h,g,
352
+ var Rive=(()=>{var _scriptName=globalThis.document?.currentScript?.src;return async function(moduleArg={}){var moduleRtn;var l=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
353
+ function ea(){function b(h){const g=d;c=a=0;d=new Map;g.forEach(m=>{try{m(h)}catch(n){console.error(n)}});this.rb();e&&e.Pb()}let a=0,c=0,d=new Map,e=null,f=null;this.requestAnimationFrame=function(h){a||=requestAnimationFrame(b.bind(this));const g=++c;d.set(g,h);return g};this.cancelAnimationFrame=function(h){d.delete(h);a&&0==d.size&&(cancelAnimationFrame(a),a=0)};this.Nb=function(h){f&&(document.body.remove(f),f=null);h||(f=document.createElement("div"),f.style.backgroundColor="black",f.style.position=
354
+ "fixed",f.style.right=0,f.style.top=0,f.style.color="white",f.style.padding="4px",f.innerHTML="RIVE FPS",h=function(g){f.innerHTML="RIVE FPS "+g.toFixed(1)},document.body.appendChild(f));e=new function(){let g=0,m=0;this.Pb=function(){var n=performance.now();m?(++g,n-=m,1E3<n&&(h(1E3*g/n),g=m=0)):(m=n,g=0)}}};this.Kb=function(){f&&(document.body.remove(f),f=null);e=null};this.rb=function(){}}
355
+ function ia(b){console.assert(!0);const a=new Map;let c=-Infinity;this.push=function(d){d=d+((1<<b)-1)>>b;a.has(d)&&clearTimeout(a.get(d));a.set(d,setTimeout(function(){a.delete(d);0==a.length?c=-Infinity:d==c&&(c=Math.max(...a.keys()),console.assert(c<d))},1E3));c=Math.max(d,c);return c<<b}}const ja=l.onRuntimeInitialized;
356
+ l.onRuntimeInitialized=function(){ja&&ja();let b=l.decodeAudio;l.decodeAudio=function(f,h){f=b(f);h(f)};let a=l.decodeFont;l.decodeFont=function(f,h){f=a(f);h(f)};let c=l.setFallbackFontCb;l.setFallbackFontCallback="function"===typeof c?function(f){c(f)}:function(){console.warn("Module.setFallbackFontCallback called, but text support is not enabled in this build.")};const d=l.FileAssetLoader;l.ptrToAsset=f=>{let h=l.ptrToFileAsset(f);return h.isImage?l.ptrToImageAsset(f):h.isFont?l.ptrToFontAsset(f):
357
+ h.isAudio?l.ptrToAudioAsset(f):h};l.CustomFileAssetLoader=d.extend("CustomFileAssetLoader",{__construct:function({loadContents:f}){this.__parent.__construct.call(this);this.Fb=f},loadContents:function(f,h){f=l.ptrToAsset(f);return this.Fb(f,h)}});l.CDNFileAssetLoader=d.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(f){let h=l.ptrToAsset(f);f=h.cdnUuid;if(""===f)return!1;(function(g,m){var n=new XMLHttpRequest;n.responseType="arraybuffer";
358
+ n.onreadystatechange=function(){4==n.readyState&&200==n.status&&m(n)};n.open("GET",g,!0);n.send(null)})(h.cdnBaseUrl+"/"+f,g=>{h.decode(new Uint8Array(g.response))});return!0}});l.FallbackFileAssetLoader=d.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this);this.qb=[]},addLoader:function(f){this.qb.push(f)},loadContents:function(f,h){for(let g of this.qb)if(g.loadContents(f,h))return!0;return!1}});let e=l.computeAlignment;l.computeAlignment=function(f,h,g,
359
359
  m,n=1){return e.call(this,f,h,g,m,n)}};
360
- const la="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),ma=new function(){function b(){if(!a){var t=document.createElement("canvas"),v={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,
361
- renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=t.getContext("webgl",v),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=t.getContext("webgl2",v))c=2;else if(p=t.getContext("webgl",v))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(F,r){if(F.isContextLost()){if(m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",r),m=!0),
362
- "function"===typeof F[r])return function(){}}else return"function"===typeof F[r]?function(...G){return F[r].apply(F,G)}:F[r]},set(F,r,G){if(F.isContextLost())m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+r),m=!0);else return F[r]=G,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function I(F,r,G){r=p.createShader(r);p.shaderSource(r,G);p.compileShader(r);G=p.getShaderInfoLog(r);if(0<(G||"").length)throw G;
363
- p.attachShader(F,r)}t=p.createProgram();I(t,p.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 }");I(t,p.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");
360
+ const ka="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),la=new function(){function b(){if(!a){var t=document.createElement("canvas"),v={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,
361
+ renderViaOffscreenBackBuffer:1};let p;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(p=t.getContext("webgl",v),c=1,!p)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(p=t.getContext("webgl2",v))c=2;else if(p=t.getContext("webgl",v))c=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;p=new Proxy(p,{get(G,r){if(G.isContextLost()){if(m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",r),m=!0),
362
+ "function"===typeof G[r])return function(){}}else return"function"===typeof G[r]?function(...E){return G[r].apply(G,E)}:G[r]},set(G,r,E){if(G.isContextLost())m||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+r),m=!0);else return G[r]=E,!0}});d=Math.min(p.getParameter(p.MAX_RENDERBUFFER_SIZE),p.getParameter(p.MAX_TEXTURE_SIZE));function I(G,r,E){r=p.createShader(r);p.shaderSource(r,E);p.compileShader(r);E=p.getShaderInfoLog(r);if(0<(E||"").length)throw E;
363
+ p.attachShader(G,r)}t=p.createProgram();I(t,p.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 }");I(t,p.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }");
364
364
  p.bindAttribLocation(t,0,"vertex");p.bindAttribLocation(t,1,"uv");p.linkProgram(t);v=p.getProgramInfoLog(t);if(0<(v||"").trim().length)throw v;e=p.getUniformLocation(t,"mat");f=p.getUniformLocation(t,"translate");p.useProgram(t);p.bindBuffer(p.ARRAY_BUFFER,p.createBuffer());p.enableVertexAttribArray(0);p.enableVertexAttribArray(1);p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,p.createBuffer());p.uniform1i(p.getUniformLocation(t,"image"),0);p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);a=p}return!0}let a=
365
- null,c=0,d=0,e=null,f=null,h=0,g=0,m=!1;b();this.Gb=function(){b();return d};this.rb=function(t){a.deleteTexture&&a.deleteTexture(t)};this.qb=function(t){if(!b())return null;const v=a.createTexture();if(!v)return null;a.bindTexture(a.TEXTURE_2D,v);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,t);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);2==c?(a.texParameteri(a.TEXTURE_2D,
366
- a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.generateMipmap(a.TEXTURE_2D)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);return v};const n=new ja(8),u=new ja(8),x=new ja(10),w=new ja(10);this.ub=function(t,v,p,I,F){if(b()){var r=n.push(t),G=u.push(v);if(a.canvas){if(a.canvas.width!=r||a.canvas.height!=G)a.canvas.width=r,a.canvas.height=G;a.viewport(0,G-v,t,v);a.disable(a.SCISSOR_TEST);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.SCISSOR_TEST);p.sort((E,U)=>U.fb-E.fb);
367
- r=x.push(I);h!=r&&(a.bufferData(a.ARRAY_BUFFER,8*r,a.DYNAMIC_DRAW),h=r);r=0;for(var L of p)a.bufferSubData(a.ARRAY_BUFFER,r,L.Oa),r+=4*L.Oa.length;console.assert(r==4*I);for(var O of p)a.bufferSubData(a.ARRAY_BUFFER,r,O.ib),r+=4*O.ib.length;console.assert(r==8*I);r=w.push(F);g!=r&&(a.bufferData(a.ELEMENT_ARRAY_BUFFER,2*r,a.DYNAMIC_DRAW),g=r);L=0;for(var ca of p)a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,L,ca.indices),L+=2*ca.indices.length;console.assert(L==2*F);ca=0;O=!0;r=L=0;for(const E of p){E.image.Ja!=
368
- ca&&(a.bindTexture(a.TEXTURE_2D,E.image.Ia||null),ca=E.image.Ja);E.Jb?(a.scissor(E.Ta,G-E.Ua-E.Za,E.Qb,E.Za),O=!0):O&&(a.scissor(0,G-v,t,v),O=!1);p=2/t;const U=-2/v;a.uniform4f(e,E.ua[0]*p*E.Ea,E.ua[1]*U*E.Fa,E.ua[2]*p*E.Ea,E.ua[3]*U*E.Fa);a.uniform2f(f,E.ua[4]*p*E.Ea+p*(E.Ta-E.Hb*E.Ea)-1,E.ua[5]*U*E.Fa+U*(E.Ua-E.Ib*E.Fa)+1);a.vertexAttribPointer(0,2,a.FLOAT,!1,0,r);a.vertexAttribPointer(1,2,a.FLOAT,!1,0,r+4*I);a.drawElements(a.TRIANGLES,E.indices.length,a.UNSIGNED_SHORT,L);r+=4*E.Oa.length;L+=2*
369
- E.indices.length}console.assert(r==4*I);console.assert(L==2*F)}}};this.canvas=function(){return b()&&a.canvas}},na=k.onRuntimeInitialized;
370
- k.onRuntimeInitialized=function(){function b(l){switch(l){case n.srcOver:return"source-over";case n.screen:return"screen";case n.overlay:return"overlay";case n.darken:return"darken";case n.lighten:return"lighten";case n.colorDodge:return"color-dodge";case n.colorBurn:return"color-burn";case n.hardLight:return"hard-light";case n.softLight:return"soft-light";case n.difference:return"difference";case n.exclusion:return"exclusion";case n.multiply:return"multiply";case n.hue:return"hue";case n.saturation:return"saturation";
371
- case n.color:return"color";case n.luminosity:return"luminosity"}}function a(l){return"rgba("+((16711680&l)>>>16)+","+((65280&l)>>>8)+","+((255&l)>>>0)+","+((4278190080&l)>>>24)/255+")"}function c(){0<G.length&&(ma.ub(r.drawWidth(),r.drawHeight(),G,L,O),G=[],O=L=0,r.reset(512,512));for(const l of F){for(const q of l.ma)q();l.ma=[]}F.clear()}na&&na();var d=k.RenderPaintStyle;const e=k.RenderPath,f=k.RenderPaint,h=k.Renderer,g=k.StrokeCap,m=k.StrokeJoin,n=k.BlendMode,u=d.fill,x=d.stroke,w=k.FillRule.evenOdd;
372
- let t=1;var v=k.RenderImage.extend("CanvasRenderImage",{__construct:function({ya:l,Da:q}={}){this.__parent.__construct.call(this);this.Ja=t;t=t+1&2147483647||1;this.ya=l;this.Da=q},__destruct:function(){this.Ia&&(ma.rb(this.Ia),URL.revokeObjectURL(this.Ra));this.__parent.__destruct.call(this)},decode:function(l){var q=this;q.Da&&q.Da(q);var D=new Image;q.Ra=URL.createObjectURL(new Blob([l],{type:"image/png"}));D.onload=function(){q.lb=D;q.Ia=ma.qb(D);q.size(D.width,D.height);q.ya&&q.ya(q)};D.src=
373
- q.Ra}}),p=e.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this);this.ra=new Path2D},rewind:function(){this.ra=new Path2D},addPath:function(l,q,D,B,y,C,A){var H=this.ra,ha=H.addPath;l=l.ra;const N=new DOMMatrix;N.a=q;N.b=D;N.c=B;N.d=y;N.e=C;N.f=A;ha.call(H,l,N)},fillRule:function(l){this.Qa=l},moveTo:function(l,q){this.ra.moveTo(l,q)},lineTo:function(l,q){this.ra.lineTo(l,q)},cubicTo:function(l,q,D,B,y,C){this.ra.bezierCurveTo(l,q,D,B,y,C)},close:function(){this.ra.closePath()}}),
374
- I=f.extend("CanvasRenderPaint",{color:function(l){this.Sa=a(l)},thickness:function(l){this.ob=l},join:function(l){switch(l){case m.miter:this.Ha="miter";break;case m.round:this.Ha="round";break;case m.bevel:this.Ha="bevel"}},cap:function(l){switch(l){case g.butt:this.Ga="butt";break;case g.round:this.Ga="round";break;case g.square:this.Ga="square"}},style:function(l){this.nb=l},blendMode:function(l){this.kb=b(l)},clearGradient:function(){this.wa=null},linearGradient:function(l,q,D,B){this.wa={gb:l,
375
- hb:q,Wa:D,Xa:B,Na:[]}},radialGradient:function(l,q,D,B){this.wa={gb:l,hb:q,Wa:D,Xa:B,Na:[],Eb:!0}},addStop:function(l,q){this.wa.Na.push({color:l,stop:q})},completeGradient:function(){},draw:function(l,q,D,B){let y=this.nb;var C=this.Sa,A=this.wa;const H=l.globalCompositeOperation,ha=l.globalAlpha;l.globalCompositeOperation=this.kb;l.globalAlpha=B;if(null!=A){C=A.gb;const R=A.hb,X=A.Wa;var N=A.Xa;B=A.Na;A.Eb?(A=X-C,N-=R,C=l.createRadialGradient(C,R,0,C,R,Math.sqrt(A*A+N*N))):C=l.createLinearGradient(C,
376
- R,X,N);for(let S=0,V=B.length;S<V;S++)A=B[S],C.addColorStop(A.stop,a(A.color));this.Sa=C;this.wa=null}switch(y){case x:l.strokeStyle=C;l.lineWidth=this.ob;l.lineCap=this.Ga;l.lineJoin=this.Ha;l.stroke(q);break;case u:l.fillStyle=C,l.fill(q,D)}l.globalCompositeOperation=H;l.globalAlpha=ha}});const F=new Set;let r=null,G=[],L=0,O=0;var ca=k.CanvasRenderer=h.extend("Renderer",{__construct:function(l){this.__parent.__construct.call(this);this.qa=[1,0,0,1,0,0];this.ja=[1];this.ga=l.getContext("2d");this.Pa=
377
- l;this.ma=[]},save:function(){this.qa.push(...this.qa.slice(this.qa.length-6));this.ja.push(this.ja[this.ja.length-1]);this.ma.push(this.ga.save.bind(this.ga))},restore:function(){const l=this.qa.length-6;if(6>l)throw"restore() called without matching save().";this.qa.splice(l);this.ja.pop();this.ma.push(this.ga.restore.bind(this.ga))},transform:function(l,q,D,B,y,C){const A=this.qa,H=A.length-6;A.splice(H,6,A[H]*l+A[H+2]*q,A[H+1]*l+A[H+3]*q,A[H]*D+A[H+2]*B,A[H+1]*D+A[H+3]*B,A[H]*y+A[H+2]*C+A[H+4],
378
- A[H+1]*y+A[H+3]*C+A[H+5]);this.ma.push(this.ga.transform.bind(this.ga,l,q,D,B,y,C))},rotate:function(l){const q=Math.sin(l);l=Math.cos(l);this.transform(l,q,-q,l,0,0)},modulateOpacity:function(l){this.ja[this.ja.length-1]*=l},_drawPath:function(l,q){this.ma.push(q.draw.bind(q,this.ga,l.ra,l.Qa===w?"evenodd":"nonzero",Math.max(0,this.ja[this.ja.length-1])))},_drawRiveImage:function(l,q,D,B){var y=l.lb;if(y){var C=this.ga,A=b(D),H=Math.max(0,B*this.ja[this.ja.length-1]);this.ma.push(function(){C.globalCompositeOperation=
379
- A;C.globalAlpha=H;C.drawImage(y,0,0);C.globalAlpha=1})}},_getMatrix:function(l){const q=this.qa,D=q.length-6;for(let B=0;6>B;++B)l[B]=q[D+B]},_drawImageMesh:function(l,q,D,B,y,C,A,H,ha,N,R,X,S,V){let nb,ob,pb;try{nb=k.HEAPF32.slice(y>>2,(y>>2)+C),ob=k.HEAPF32.slice(A>>2,(A>>2)+H),pb=k.HEAPU16.slice(ha>>1,(ha>>1)+N)}catch(Ra){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}q=this.ga.canvas.width;y=this.ga.canvas.height;A=S-R;H=V-
380
- X;R=Math.max(R,0);X=Math.max(X,0);S=Math.min(S,q);V=Math.min(V,y);const qa=S-R,ra=V-X;console.assert(qa<=Math.min(A,q));console.assert(ra<=Math.min(H,y));if(!(0>=qa||0>=ra)){S=qa<A||ra<H;q=V=1;var da=Math.ceil(qa*V),ea=Math.ceil(ra*q);y=ma.Gb();da>y&&(V*=y/da,da=y);ea>y&&(q*=y/ea,ea=y);r||(r=new k.DynamicRectanizer(y),r.reset(512,512));y=r.addRect(da,ea);0>y&&(c(),F.add(this),y=r.addRect(da,ea),console.assert(0<=y));var qb=y&65535,rb=y>>16;G.push({ua:this.qa.slice(this.qa.length-6),image:l,Ta:qb,
381
- Ua:rb,Hb:R,Ib:X,Qb:da,Za:ea,Ea:V,Fa:q,Oa:nb,ib:ob,indices:pb,Jb:S,fb:l.Ja<<1|(S?1:0)});L+=C;O+=N;var ia=this.ga,cc=b(D),dc=Math.max(0,B*this.ja[this.ja.length-1]);this.ma.push(function(){ia.save();ia.resetTransform();ia.globalCompositeOperation=cc;ia.globalAlpha=dc;const Ra=ma.canvas();Ra&&ia.drawImage(Ra,qb,rb,da,ea,R,X,qa,ra);ia.restore()})}},_clipPath:function(l){this.ma.push(this.ga.clip.bind(this.ga,l.ra,l.Qa===w?"evenodd":"nonzero"))},clear:function(){F.add(this);this.ma.push(this.ga.clearRect.bind(this.ga,
382
- 0,0,this.Pa.width,this.Pa.height))},flush:function(){},translate:function(l,q){this.transform(1,0,0,1,l,q)}});k.makeRenderer=function(l){const q=new ca(l),D=q.ga;return new Proxy(q,{get(B,y){if("function"===typeof B[y])return function(...C){return B[y].apply(B,C)};if("function"===typeof D[y]){if(-1<la.indexOf(y))throw Error("RiveException: Method call to '"+y+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");
383
- return function(...C){q.ma.push(D[y].bind(D,...C))}}return B[y]},set(B,y,C){if(y in D)return q.ma.push(()=>{D[y]=C}),!0}})};k.decodeImage=function(l,q){(new v({ya:q})).decode(l)};k.renderFactory={makeRenderPaint:function(){return new I},makeRenderPath:function(){return new p},makeRenderImage:function(){let l=U;return new v({Da:()=>{l.total++},ya:()=>{l.loaded++;if(l.loaded===l.total){const q=l.ready;q&&(q(),l.ready=null)}}})}};let E=k.load,U=null;k.load=function(l,q,D=!0){const B=new k.FallbackFileAssetLoader;
384
- void 0!==q&&B.addLoader(q);D&&(q=new k.CDNFileAssetLoader,B.addLoader(q));return new Promise(function(y){let C=null;U={total:0,loaded:0,ready:function(){y(C)}};C=E(l,B);0==U.total&&y(C)})};let ec=k.RendererWrapper.prototype.align;k.RendererWrapper.prototype.align=function(l,q,D,B,y=1){ec.call(this,l,q,D,B,y)};d=new fa;k.requestAnimationFrame=d.requestAnimationFrame.bind(d);k.cancelAnimationFrame=d.cancelAnimationFrame.bind(d);k.enableFPSCounter=d.vb.bind(d);k.disableFPSCounter=d.sb;d.ab=c;k.resolveAnimationFrame=
385
- c;k.cleanup=function(){r&&r.delete()}};var oa="./this.program";ba&&(_scriptName=self.location.href);var pa="",sa,ta;
386
- if(aa||ba){try{pa=(new URL(".",_scriptName)).href}catch{}ba&&(ta=b=>{var a=new XMLHttpRequest;a.open("GET",b,!1);a.responseType="arraybuffer";a.send(null);return new Uint8Array(a.response)});sa=async b=>{if(ua(b))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var a=await fetch(b,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+
387
- " : "+a.url);}}var va=console.log.bind(console),wa=console.error.bind(console),xa,ya=!1,za,ua=b=>b.startsWith("file://"),Aa,Ba,Ca,z,Da,Ea,Fa,J,Ga,Ha,Ia,Ja,Ka=!1;function La(){var b=Ma.buffer;k.HEAP8=Ca=new Int8Array(b);Da=new Int16Array(b);k.HEAPU8=z=new Uint8Array(b);k.HEAPU16=Ea=new Uint16Array(b);k.HEAP32=Fa=new Int32Array(b);k.HEAPU32=J=new Uint32Array(b);k.HEAPF32=Ga=new Float32Array(b);Ha=new Float64Array(b);Ia=new BigInt64Array(b);Ja=new BigUint64Array(b)}
388
- function Na(b){k.onAbort?.(b);b="Aborted("+b+")";wa(b);ya=!0;b=new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.");Ba?.(b);throw b;}var Oa;async function Pa(b){if(!xa)try{var a=await sa(b);return new Uint8Array(a)}catch{}if(b==Oa&&xa)b=new Uint8Array(xa);else if(ta)b=ta(b);else throw"both async and sync fetching of the wasm failed";return b}
389
- async function Qa(b,a){try{var c=await Pa(b);return await WebAssembly.instantiate(c,a)}catch(d){wa(`failed to asynchronously prepare wasm: ${d}`),Na(d)}}async function Sa(b){var a=Oa;if(!xa&&!ua(a))try{var c=fetch(a,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,b)}catch(d){wa(`wasm streaming compile failed: ${d}`),wa("falling back to ArrayBuffer instantiation")}return Qa(a,b)}
390
- class Ta{name="ExitStatus";constructor(b){this.message=`Program terminated with exit(${b})`;this.status=b}}
391
- var Ua=b=>{for(;0<b.length;)b.shift()(k)},Va=[],Wa=[],Xa=()=>{var b=k.preRun.shift();Wa.push(b)},Ya=!0,Za=(b,a)=>Object.defineProperty(a,"name",{value:b}),$a=[],ab=[0,1,,1,null,1,!0,1,!1,1],K=class extends Error{constructor(b){super(b);this.name="BindingError"}},M=b=>{if(!b)throw new K(`Cannot use deleted val. handle = ${b}`);return ab[b]},P=b=>{switch(b){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const a=$a.pop()||ab.length;ab[a]=b;ab[a+1]=1;return a}};
392
- class bb extends Error{}
393
- var Q=b=>{for(var a="";;){var c=z[b++];if(!c)return a;a+=String.fromCharCode(c)}},cb={},db=(b,a)=>{if(void 0===a)throw new K("ptr should not be undefined");for(;b.ha;)a=b.za(a),b=b.ha;return a},eb={},hb=b=>{b=fb(b);var a=Q(b);gb(b);return a},ib=(b,a)=>{var c=eb[b];if(void 0===c)throw b=`${a} has unknown type ${hb(b)}`,new K(b);return c},jb=()=>{},kb=!1,lb=b=>{if(!globalThis.FinalizationRegistry)return lb=a=>a,b;kb=new FinalizationRegistry(a=>{a=a.$;--a.count.value;0===a.count.value&&(a.ia?a.na.pa(a.ia):
394
- a.da.aa.pa(a.ca))});lb=a=>{var c=a.$;c.ia&&kb.register(a,{$:c},a);return a};jb=a=>{kb.unregister(a)};return lb(b)},mb={},sb=b=>{for(;b.length;){var a=b.pop();b.pop()(a)}};function tb(b){return this.ba(J[b>>2])}
395
- var ub={},vb={},wb=class extends Error{constructor(b){super(b);this.name="InternalError"}},W=(b,a,c)=>{function d(g){g=c(g);if(g.length!==b.length)throw new wb("Mismatched type converter count");for(var m=0;m<b.length;++m)T(b[m],g[m])}b.forEach(g=>vb[g]=a);var e=Array(a.length),f=[],h=0;for(let [g,m]of a.entries())eb.hasOwnProperty(m)?e[g]=eb[m]:(f.push(m),ub.hasOwnProperty(m)||(ub[m]=[]),ub[m].push(()=>{e[g]=eb[m];++h;h===f.length&&d(e)}));0===f.length&&d(e)};
396
- function xb(b,a,c={}){var d=a.name;if(!b)throw new K(`type "${d}" must have a positive integer typeid pointer`);if(eb.hasOwnProperty(b)){if(c.Db)return;throw new K(`Cannot register type '${d}' twice`);}eb[b]=a;delete vb[b];ub.hasOwnProperty(b)&&(a=ub[b],delete ub[b],a.forEach(e=>e()))}function T(b,a,c={}){return xb(b,a,c)}
397
- var yb=(b,a,c)=>{switch(a){case 1:return c?d=>Ca[d]:d=>z[d];case 2:return c?d=>Da[d>>1]:d=>Ea[d>>1];case 4:return c?d=>Fa[d>>2]:d=>J[d>>2];case 8:return c?d=>Ia[d>>3]:d=>Ja[d>>3];default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},zb=b=>{throw new K(b.$.da.aa.name+" instance already deleted");},Ab=[];function Bb(){}
398
- var Cb={},Db=(b,a,c)=>{if(void 0===b[a].fa){var d=b[a];b[a]=function(...e){if(!b[a].fa.hasOwnProperty(e.length))throw new K(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${b[a].fa})!`);return b[a].fa[e.length].apply(this,e)};b[a].fa=[];b[a].fa[d.sa]=d}},Eb=(b,a,c)=>{if(k.hasOwnProperty(b)){if(void 0===c||void 0!==k[b].fa&&void 0!==k[b].fa[c])throw new K(`Cannot register public name '${b}' twice`);Db(k,b,b);if(k[b].fa.hasOwnProperty(c))throw new K(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
399
- k[b].fa[c]=a}else k[b]=a,k[b].sa=c},Fb=b=>{b=b.replace(/[^a-zA-Z0-9_]/g,"$");var a=b.charCodeAt(0);return 48<=a&&57>=a?`_${b}`:b};function Gb(b,a,c,d,e,f,h,g){this.name=b;this.constructor=a;this.oa=c;this.pa=d;this.ha=e;this.yb=f;this.za=h;this.tb=g;this.bb=[]}
400
- var Hb=(b,a,c)=>{for(;a!==c;){if(!a.za)throw new K(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);b=a.za(b);a=a.ha}return b},Ib=b=>{if(null===b)return"null";var a=typeof b;return"object"===a||"array"===a||"function"===a?b.toString():""+b};
401
- function Jb(b,a){if(null===a){if(this.Ka)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
402
- function Kb(b,a){if(null===a){if(this.Ka)throw new K(`null is not a valid ${this.name}`);if(this.Ca){var c=this.Ma();null!==b&&b.push(this.pa,c);return c}return 0}if(!a||!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ba&&a.$.da.Ba)throw new K(`Cannot convert argument of type ${a.$.na?a.$.na.name:a.$.da.name} to parameter type ${this.name}`);c=Hb(a.$.ca,a.$.da.aa,this.aa);if(this.Ca){if(void 0===
403
- a.$.ia)throw new K("Passing raw pointer to smart pointer is illegal");switch(this.Pb){case 0:if(a.$.na===this)c=a.$.ia;else throw new K(`Cannot convert argument of type ${a.$.na?a.$.na.name:a.$.da.name} to parameter type ${this.name}`);break;case 1:c=a.$.ia;break;case 2:if(a.$.na===this)c=a.$.ia;else{var d=a.clone();c=this.Lb(c,P(()=>d["delete"]()));null!==b&&b.push(this.pa,c)}break;default:throw new K("Unsupported sharing policy");}}return c}
404
- function Lb(b,a){if(null===a){if(this.Ka)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(a.$.da.Ba)throw new K(`Cannot convert argument of type ${a.$.da.name} to parameter type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
405
- var Mb=(b,a,c)=>{if(a===c)return b;if(void 0===c.ha)return null;b=Mb(b,a,c.ha);return null===b?null:c.tb(b)},Nb=(b,a)=>{a=db(b,a);return cb[a]},Ob=(b,a)=>{if(!a.da||!a.ca)throw new wb("makeClassHandle requires ptr and ptrType");if(!!a.na!==!!a.ia)throw new wb("Both smartPtrType and smartPtr must be specified");a.count={value:1};return lb(Object.create(b,{$:{value:a,writable:!0}}))};
406
- function Pb(b,a,c,d,e,f,h,g,m,n,u){this.name=b;this.aa=a;this.Ka=c;this.Ba=d;this.Ca=e;this.Kb=f;this.Pb=h;this.cb=g;this.Ma=m;this.Lb=n;this.pa=u;e||void 0!==a.ha?this.ea=Kb:(this.ea=d?Jb:Lb,this.ka=null)}var Qb=(b,a,c)=>{if(!k.hasOwnProperty(b))throw new wb("Replacing nonexistent public symbol");void 0!==k[b].fa&&void 0!==c?k[b].fa[c]=a:(k[b]=a,k[b].sa=c)},Y=(b,a)=>{b=Q(b);var c=Rb.get(a);if("function"!=typeof c)throw new K(`unknown function pointer with signature ${b}: ${a}`);return c};
407
- class Sb extends Error{}var Z=(b,a)=>{function c(f){e[f]||eb[f]||(vb[f]?vb[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};a.forEach(c);throw new Sb(`${b}: `+d.map(hb).join([", "]));};function Tb(b){for(var a=1;a<b.length;++a)if(null!==b[a]&&void 0===b[a].ka)return!0;return!1}
408
- function Ub(b,a,c,d,e){var f=a.length;if(2>f)throw new K("argTypes array size mismatch! Must at least get return value and 'this' types!");var h=null!==a[1]&&null!==c,g=Tb(a),m=!a[0].Fb,n=f-2,u=Array(n),x=[],w=[];return Za(b,function(...t){w.length=0;x.length=h?2:1;x[0]=e;if(h){var v=a[1].ea(w,this);x[1]=v}for(var p=0;p<n;++p)u[p]=a[p+2].ea(w,t[p]),x.push(u[p]);t=d(...x);if(g)sb(w);else for(p=h?1:2;p<a.length;p++){var I=1===p?v:u[p-2];null!==a[p].ka&&a[p].ka(I)}v=m?a[0].ba(t):void 0;return v})}
409
- var Vb=(b,a)=>{for(var c=[],d=0;d<b;d++)c.push(J[a+4*d>>2]);return c},Wb=b=>{b=b.trim();const a=b.indexOf("(");return-1===a?b:b.slice(0,a)},Xb=(b,a,c)=>{if(!(b instanceof Object))throw new K(`${c} with invalid "this": ${b}`);if(!(b instanceof a.aa.constructor))throw new K(`${c} incompatible with "this" of type ${b.constructor.name}`);if(!b.$.ca)throw new K(`cannot call emscripten binding method ${c} on deleted object`);return Hb(b.$.ca,b.$.da.aa,a.aa)},Yb=b=>{9<b&&0===--ab[b+1]&&(ab[b]=void 0,$a.push(b))},
410
- Zb={name:"emscripten::val",ba:b=>{var a=M(b);Yb(b);return a},ea:(b,a)=>P(a),la:tb,ka:null},$b=(b,a,c)=>{switch(a){case 1:return c?function(d){return this.ba(Ca[d])}:function(d){return this.ba(z[d])};case 2:return c?function(d){return this.ba(Da[d>>1])}:function(d){return this.ba(Ea[d>>1])};case 4:return c?function(d){return this.ba(Fa[d>>2])}:function(d){return this.ba(J[d>>2])};default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},ac=(b,a)=>{switch(a){case 4:return function(c){return this.ba(Ga[c>>
411
- 2])};case 8:return function(c){return this.ba(Ha[c>>3])};default:throw new TypeError(`invalid float width (${a}): ${b}`);}},bc=(b,a,c)=>{var d=z;if(!(0<c))return 0;var e=a;c=a+c-1;for(var f=0;f<b.length;++f){var h=b.codePointAt(f);if(127>=h){if(a>=c)break;d[a++]=h}else if(2047>=h){if(a+1>=c)break;d[a++]=192|h>>6;d[a++]=128|h&63}else if(65535>=h){if(a+2>=c)break;d[a++]=224|h>>12;d[a++]=128|h>>6&63;d[a++]=128|h&63}else{if(a+3>=c)break;d[a++]=240|h>>18;d[a++]=128|h>>12&63;d[a++]=128|h>>6&63;d[a++]=128|
365
+ null,c=0,d=0,e=null,f=null,h=0,g=0,m=!1;b();this.Yb=function(){b();return d};this.Jb=function(t){a.deleteTexture&&a.deleteTexture(t)};this.Ib=function(t){if(!b())return null;const v=a.createTexture();if(!v)return null;a.bindTexture(a.TEXTURE_2D,v);a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,t);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);2==c?(a.texParameteri(a.TEXTURE_2D,
366
+ a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_LINEAR),a.generateMipmap(a.TEXTURE_2D)):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);return v};const n=new ia(8),u=new ia(8),A=new ia(10),x=new ia(10);this.Mb=function(t,v,p,I,G){if(b()){var r=n.push(t),E=u.push(v);if(a.canvas){if(a.canvas.width!=r||a.canvas.height!=E)a.canvas.width=r,a.canvas.height=E;a.viewport(0,E-v,t,v);a.disable(a.SCISSOR_TEST);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.SCISSOR_TEST);p.sort((F,Z)=>Z.vb-F.vb);
367
+ r=A.push(I);h!=r&&(a.bufferData(a.ARRAY_BUFFER,8*r,a.DYNAMIC_DRAW),h=r);r=0;for(var L of p)a.bufferSubData(a.ARRAY_BUFFER,r,L.ab),r+=4*L.ab.length;console.assert(r==4*I);for(var O of p)a.bufferSubData(a.ARRAY_BUFFER,r,O.yb),r+=4*O.yb.length;console.assert(r==8*I);r=x.push(G);g!=r&&(a.bufferData(a.ELEMENT_ARRAY_BUFFER,2*r,a.DYNAMIC_DRAW),g=r);L=0;for(var W of p)a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,L,W.indices),L+=2*W.indices.length;console.assert(L==2*G);W=0;O=!0;r=L=0;for(const F of p){F.image.Va!=
368
+ W&&(a.bindTexture(a.TEXTURE_2D,F.image.Ta||null),W=F.image.Va);F.ac?(a.scissor(F.ib,E-F.jb-F.pb,F.ic,F.pb),O=!0):O&&(a.scissor(0,E-v,t,v),O=!1);p=2/t;const Z=-2/v;a.uniform4f(e,F.wa[0]*p*F.La,F.wa[1]*Z*F.Ma,F.wa[2]*p*F.La,F.wa[3]*Z*F.Ma);a.uniform2f(f,F.wa[4]*p*F.La+p*(F.ib-F.Zb*F.La)-1,F.wa[5]*Z*F.Ma+Z*(F.jb-F.$b*F.Ma)+1);a.vertexAttribPointer(0,2,a.FLOAT,!1,0,r);a.vertexAttribPointer(1,2,a.FLOAT,!1,0,r+4*I);a.drawElements(a.TRIANGLES,F.indices.length,a.UNSIGNED_SHORT,L);r+=4*F.ab.length;L+=2*F.indices.length}console.assert(r==
369
+ 4*I);console.assert(L==2*G)}}};this.canvas=function(){return b()&&a.canvas}},ma=l.onRuntimeInitialized;
370
+ l.onRuntimeInitialized=function(){function b(k){switch(k){case n.srcOver:return"source-over";case n.screen:return"screen";case n.overlay:return"overlay";case n.darken:return"darken";case n.lighten:return"lighten";case n.colorDodge:return"color-dodge";case n.colorBurn:return"color-burn";case n.hardLight:return"hard-light";case n.softLight:return"soft-light";case n.difference:return"difference";case n.exclusion:return"exclusion";case n.multiply:return"multiply";case n.hue:return"hue";case n.saturation:return"saturation";
371
+ case n.color:return"color";case n.luminosity:return"luminosity"}}function a(k){return"rgba("+((16711680&k)>>>16)+","+((65280&k)>>>8)+","+((255&k)>>>0)+","+((4278190080&k)>>>24)/255+")"}function c(){0<L.length&&(la.Mb(E.drawWidth(),E.drawHeight(),L,O,W),L=[],W=O=0,E.reset(512,512));for(const k of r){for(const q of k.na)q();k.na=[]}r.clear()}ma&&ma();var d=l.RenderPaintStyle;const e=l.RenderPath,f=l.RenderPaint,h=l.Renderer,g=l.StrokeCap,m=l.StrokeJoin,n=l.BlendMode,u=d.fill,A=d.stroke,x=l.FillRule.evenOdd;
372
+ let t=1;var v=l.RenderImage.extend("CanvasRenderImage",{__construct:function({Ba:k,Ka:q}={}){this.__parent.__construct.call(this);this.Va=t;t=t+1&2147483647||1;this.Ba=k;this.Ka=q},__destruct:function(){this.Ta&&(la.Jb(this.Ta),URL.revokeObjectURL(this.gb));this.__parent.__destruct.call(this)},decode:function(k){var q=this;q.Ka&&q.Ka(q);var z=new Image;q.gb=URL.createObjectURL(new Blob([k],{type:"image/png"}));z.onload=function(){q.Eb=z;q.Ta=la.Ib(z);q.size(z.width,z.height);q.Ba&&q.Ba(q)};z.src=
373
+ q.gb}});class p{constructor(){this.Da=this.Ha=0;this.sa=new Path2D}clear(){this.Da=this.Ha=0;this.sa=new Path2D}Gb(k){for(0<this.Ha&&this.Da<k.length&&this.clear();this.Da<k.length;)k[this.Da++](this.sa);this.Ha++;return this.sa}release(k){k===this.sa&&this.Ha--}}var I=e.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this);this.Ra=[];this.sa=new p;this.Qa=!1;this.za=null},rewind:function(){this.Ra.length=0;this.sa.clear();this.Qa=!1;this.za=null},addPath:function(k,
374
+ q,z,y,D,w,C){const H=k.Ab();this.ya(fa=>{const M=new DOMMatrix;M.a=q;M.b=z;M.c=y;M.d=D;M.e=w;M.f=C;fa.addPath(H,M)})},fillRule:function(k){this.fb=k},moveTo:function(k,q){this.Qa=!0;const z={kb:!0};this.za=z;this.ya(y=>{y.moveTo(k,q);z.kb&&y.lineTo(k,q)})},lineTo:function(k,q){this.eb();this.Oa();this.ya(z=>{z.lineTo(k,q)})},cubicTo:function(k,q,z,y,D,w){this.eb();this.Oa();this.ya(C=>{C.bezierCurveTo(k,q,z,y,D,w)})},close:function(){this.Oa();this.ya(k=>{k.closePath()})},eb:function(){this.Qa||this.moveTo(0,
375
+ 0)},Oa:function(){null!==this.za&&(this.za.kb=!1,this.za=null)},ya:function(k){this.Ra.push(k)},Na:function(){return this.sa.Gb(this.Ra)},hb:function(k){this.sa.release(k)},Ab:function(){const k=this.Na();this.sa.clear();return k}}),G=f.extend("CanvasRenderPaint",{__construct:function(){this.__parent.__construct.call(this);this.la=[];this.Pa=0;this.Sa=u;this.Wa=a(4278190080);this.Ua=1;this.Ga="miter";this.Fa="butt";this.bb=b(n.srcOver);this.va=null},color:function(k){this.la.push(()=>{this.Wa=a(k)})},
376
+ thickness:function(k){this.la.push(()=>{this.Ua=Math.abs(k)})},join:function(k){this.la.push(()=>{switch(k){case m.miter:this.Ga="miter";break;case m.round:this.Ga="round";break;case m.bevel:this.Ga="bevel"}})},cap:function(k){this.la.push(()=>{switch(k){case g.butt:this.Fa="butt";break;case g.round:this.Fa="round";break;case g.square:this.Fa="square"}})},style:function(k){this.la.push(()=>{this.Sa=k})},blendMode:function(k){this.la.push(()=>{this.bb=b(k)})},clearGradient:function(){this.la.push(()=>
377
+ {this.va=null})},linearGradient:function(k,q,z,y){this.la.push(()=>{this.va={wb:k,xb:q,mb:z,nb:y,$a:[]}})},radialGradient:function(k,q,z,y){this.la.push(()=>{this.va={wb:k,xb:q,mb:z,nb:y,$a:[],Wb:!0}})},addStop:function(k,q){this.la.push(()=>{this.va.$a.push({color:k,stop:q})})},completeGradient:function(){},Bb:function(k,q,z,y){if(this.Sa!==A||0<this.Ua){var D=this.Sa,w=this.Wa,C=this.va,H=k.globalCompositeOperation,fa=k.globalAlpha;k.globalCompositeOperation=this.bb;k.globalAlpha=y;if(null!=C){w=
378
+ C.wb;const S=C.xb,U=C.mb;var M=C.nb;y=C.$a;C.Wb?(C=U-w,M-=S,w=k.createRadialGradient(w,S,0,w,S,Math.sqrt(C*C+M*M))):w=k.createLinearGradient(w,S,U,M);for(let R=0,Aa=y.length;R<Aa;R++)C=y[R],w.addColorStop(C.stop,a(C.color));this.Wa=w;this.va=null}switch(D){case A:k.strokeStyle=w;k.lineWidth=this.Ua;k.lineCap=this.Fa;k.lineJoin=this.Ga;k.stroke(q);break;case u:k.fillStyle=w,k.fill(q,z)}k.globalCompositeOperation=H;k.globalAlpha=fa}},Db:function(){return this.Pa+this.la.length},Cb:function(k){const q=
379
+ k-this.Pa;for(let z=0;z<q;z++)this.la[z]();this.la.splice(0,q);this.Pa=k}});const r=new Set;let E=null,L=[],O=0,W=0;var F=l.CanvasRenderer=h.extend("Renderer",{__construct:function(k){this.__parent.__construct.call(this);this.ra=[1,0,0,1,0,0];this.ja=[1];this.ha=k.getContext("2d");this.cb=k;this.na=[]},save:function(){this.ra.push(...this.ra.slice(this.ra.length-6));this.ja.push(this.ja[this.ja.length-1]);this.na.push(this.ha.save.bind(this.ha))},restore:function(){const k=this.ra.length-6;if(6>k)throw"restore() called without matching save().";
380
+ this.ra.splice(k);this.ja.pop();this.na.push(this.ha.restore.bind(this.ha))},transform:function(k,q,z,y,D,w){const C=this.ra,H=C.length-6;C.splice(H,6,C[H]*k+C[H+2]*q,C[H+1]*k+C[H+3]*q,C[H]*z+C[H+2]*y,C[H+1]*z+C[H+3]*y,C[H]*D+C[H+2]*w+C[H+4],C[H+1]*D+C[H+3]*w+C[H+5]);this.na.push(this.ha.transform.bind(this.ha,k,q,z,y,D,w))},rotate:function(k){const q=Math.sin(k);k=Math.cos(k);this.transform(k,q,-q,k,0,0)},modulateOpacity:function(k){this.ja[this.ja.length-1]*=k},_drawPath:function(k,q){const z=k.fb===
381
+ x?"evenodd":"nonzero",y=Math.max(0,this.ja[this.ja.length-1]),D=k.Na(),w=q.Db();this.na.push(()=>{q.Cb(w);q.Bb(this.ha,D,z,y);k.hb(D)})},_drawRiveImage:function(k,q,z){var y=k.Eb;if(y){var D=this.ha,w=b(q),C=Math.max(0,z*this.ja[this.ja.length-1]);this.na.push(function(){D.globalCompositeOperation=w;D.globalAlpha=C;D.drawImage(y,0,0);D.globalAlpha=1})}},_getMatrix:function(k){const q=this.ra,z=q.length-6;for(let y=0;6>y;++y)k[y]=q[z+y]},_drawImageMesh:function(k,q,z,y,D,w,C,H,fa,M,S,U,R){let Aa,ob,
382
+ pb;try{Aa=l.HEAPF32.slice(y>>2,(y>>2)+D),ob=l.HEAPF32.slice(w>>2,(w>>2)+C),pb=l.HEAPU16.slice(H>>1,(H>>1)+fa)}catch(Ra){console.error("[Rive] _drawImageMesh: failed to read mesh data from WASM heap. Mesh skipped for this frame.");return}y=this.ha.canvas.width;w=this.ha.canvas.height;C=U-M;H=R-S;M=Math.max(M,0);S=Math.max(S,0);U=Math.min(U,y);R=Math.min(R,w);const pa=U-M,qa=R-S;console.assert(pa<=Math.min(C,y));console.assert(qa<=Math.min(H,w));if(!(0>=pa||0>=qa)){U=pa<C||qa<H;y=R=1;var ca=Math.ceil(pa*
383
+ R),da=Math.ceil(qa*y);w=la.Yb();ca>w&&(R*=w/ca,ca=w);da>w&&(y*=w/da,da=w);E||(E=new l.DynamicRectanizer(w),E.reset(512,512));w=E.addRect(ca,da);0>w&&(c(),r.add(this),w=E.addRect(ca,da),console.assert(0<=w));var qb=w&65535,rb=w>>16;L.push({wa:this.ra.slice(this.ra.length-6),image:k,ib:qb,jb:rb,Zb:M,$b:S,ic:ca,pb:da,La:R,Ma:y,ab:Aa,yb:ob,indices:pb,ac:U,vb:k.Va<<1|(U?1:0)});O+=D;W+=fa;var ha=this.ha,cc=b(q),dc=Math.max(0,z*this.ja[this.ja.length-1]);this.na.push(function(){ha.save();ha.resetTransform();
384
+ ha.globalCompositeOperation=cc;ha.globalAlpha=dc;const Ra=la.canvas();Ra&&ha.drawImage(Ra,qb,rb,ca,da,M,S,pa,qa);ha.restore()})}},_clipPath:function(k){const q=k.fb===x?"evenodd":"nonzero",z=k.Na();this.na.push(()=>{this.ha.clip(z,q);k.hb(z)})},beginFrame:function(k=!0){r.add(this);k&&this.na.push(this.ha.clearRect.bind(this.ha,0,0,this.cb.width,this.cb.height))},clear:function(){this.beginFrame(!0)},flush:function(){},translate:function(k,q){this.transform(1,0,0,1,k,q)}});l.makeRenderer=function(k){const q=
385
+ new F(k),z=q.ha;return new Proxy(q,{get(y,D){if("function"===typeof y[D])return function(...w){return y[D].apply(y,w)};if("function"===typeof z[D]){if(-1<ka.indexOf(D))throw Error("RiveException: Method call to '"+D+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...w){q.na.push(z[D].bind(z,...w))}}return y[D]},set(y,D,w){if(D in z)return q.na.push(()=>{z[D]=w}),!0}})};l.decodeImage=function(k,
386
+ q){(new v({Ba:q})).decode(k)};l.renderFactory={makeRenderPaint:function(){return new G},makeRenderPath:function(){return new I},makeRenderImage:function(){let k=Sa;return new v({Ka:()=>{k.total++},Ba:()=>{k.loaded++;if(k.loaded===k.total){const q=k.ready;q&&(q(),k.ready=null)}}})}};let Z=l.load,Sa=null;l.load=function(k,q,z=!0){const y=new l.FallbackFileAssetLoader;void 0!==q&&y.addLoader(q);z&&(q=new l.CDNFileAssetLoader,y.addLoader(q));return new Promise(function(D){let w=null;Sa={total:0,loaded:0,
387
+ ready:function(){D(w)}};w=Z(k,y);0==Sa.total&&D(w)})};let ec=l.RendererWrapper.prototype.align;l.RendererWrapper.prototype.align=function(k,q,z,y,D=1){ec.call(this,k,q,z,y,D)};d=new ea;l.requestAnimationFrame=d.requestAnimationFrame.bind(d);l.cancelAnimationFrame=d.cancelAnimationFrame.bind(d);l.enableFPSCounter=d.Nb.bind(d);l.disableFPSCounter=d.Kb;d.rb=c;l.resolveAnimationFrame=c;l.cleanup=function(){E&&E.delete()}};var na="./this.program";ba&&(_scriptName=self.location.href);var oa="",ra,sa;
388
+ if(aa||ba){try{oa=(new URL(".",_scriptName)).href}catch{}ba&&(sa=b=>{var a=new XMLHttpRequest;a.open("GET",b,!1);a.responseType="arraybuffer";a.send(null);return new Uint8Array(a.response)});ra=async b=>{if(ta(b))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var a=await fetch(b,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+
389
+ " : "+a.url);}}var ua=console.log.bind(console),va=console.error.bind(console),wa,xa=!1,ya,ta=b=>b.startsWith("file://"),za,Ba,Ca,B,Da,Ea,Fa,J,Ga,Ha,Ia,Ja,Ka=!1;function La(){var b=Ma.buffer;l.HEAP8=Ca=new Int8Array(b);Da=new Int16Array(b);l.HEAPU8=B=new Uint8Array(b);l.HEAPU16=Ea=new Uint16Array(b);l.HEAP32=Fa=new Int32Array(b);l.HEAPU32=J=new Uint32Array(b);l.HEAPF32=Ga=new Float32Array(b);Ha=new Float64Array(b);Ia=new BigInt64Array(b);Ja=new BigUint64Array(b)}
390
+ function Na(b){l.onAbort?.(b);b="Aborted("+b+")";va(b);xa=!0;b=new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.");Ba?.(b);throw b;}var Oa;async function Pa(b){if(!wa)try{var a=await ra(b);return new Uint8Array(a)}catch{}if(b==Oa&&wa)b=new Uint8Array(wa);else if(sa)b=sa(b);else throw"both async and sync fetching of the wasm failed";return b}
391
+ async function Qa(b,a){try{var c=await Pa(b);return await WebAssembly.instantiate(c,a)}catch(d){va(`failed to asynchronously prepare wasm: ${d}`),Na(d)}}async function Ta(b){var a=Oa;if(!wa&&!ta(a))try{var c=fetch(a,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,b)}catch(d){va(`wasm streaming compile failed: ${d}`),va("falling back to ArrayBuffer instantiation")}return Qa(a,b)}
392
+ class Ua{name="ExitStatus";constructor(b){this.message=`Program terminated with exit(${b})`;this.status=b}}
393
+ var Va=b=>{for(;0<b.length;)b.shift()(l)},Wa=[],Xa=[],Ya=()=>{var b=l.preRun.shift();Xa.push(b)},Za=!0,$a=(b,a)=>Object.defineProperty(a,"name",{value:b}),ab=[],bb=[0,1,,1,null,1,!0,1,!1,1],K=class extends Error{constructor(b){super(b);this.name="BindingError"}},N=b=>{if(!b)throw new K(`Cannot use deleted val. handle = ${b}`);return bb[b]},P=b=>{switch(b){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const a=ab.pop()||bb.length;bb[a]=b;bb[a+1]=1;return a}};
394
+ class cb extends Error{}
395
+ var Q=b=>{for(var a="";;){var c=B[b++];if(!c)return a;a+=String.fromCharCode(c)}},db={},eb=(b,a)=>{if(void 0===a)throw new K("ptr should not be undefined");for(;b.ga;)a=b.Ca(a),b=b.ga;return a},fb={},ib=b=>{b=gb(b);var a=Q(b);hb(b);return a},jb=(b,a)=>{var c=fb[b];if(void 0===c)throw b=`${a} has unknown type ${ib(b)}`,new K(b);return c},kb=()=>{},lb=!1,mb=b=>{if(!globalThis.FinalizationRegistry)return mb=a=>a,b;lb=new FinalizationRegistry(a=>{a=a.$;--a.count.value;0===a.count.value&&(a.ia?a.oa.qa(a.ia):
396
+ a.da.aa.qa(a.ca))});mb=a=>{var c=a.$;c.ia&&lb.register(a,{$:c},a);return a};kb=a=>{lb.unregister(a)};return mb(b)},nb={},sb=b=>{for(;b.length;){var a=b.pop();b.pop()(a)}};function tb(b){return this.ba(J[b>>2])}
397
+ var ub={},vb={},wb=class extends Error{constructor(b){super(b);this.name="InternalError"}},V=(b,a,c)=>{function d(g){g=c(g);if(g.length!==b.length)throw new wb("Mismatched type converter count");for(var m=0;m<b.length;++m)T(b[m],g[m])}b.forEach(g=>vb[g]=a);var e=Array(a.length),f=[],h=0;for(let [g,m]of a.entries())fb.hasOwnProperty(m)?e[g]=fb[m]:(f.push(m),ub.hasOwnProperty(m)||(ub[m]=[]),ub[m].push(()=>{e[g]=fb[m];++h;h===f.length&&d(e)}));0===f.length&&d(e)};
398
+ function xb(b,a,c={}){var d=a.name;if(!b)throw new K(`type "${d}" must have a positive integer typeid pointer`);if(fb.hasOwnProperty(b)){if(c.Vb)return;throw new K(`Cannot register type '${d}' twice`);}fb[b]=a;delete vb[b];ub.hasOwnProperty(b)&&(a=ub[b],delete ub[b],a.forEach(e=>e()))}function T(b,a,c={}){return xb(b,a,c)}
399
+ var yb=(b,a,c)=>{switch(a){case 1:return c?d=>Ca[d]:d=>B[d];case 2:return c?d=>Da[d>>1]:d=>Ea[d>>1];case 4:return c?d=>Fa[d>>2]:d=>J[d>>2];case 8:return c?d=>Ia[d>>3]:d=>Ja[d>>3];default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},zb=b=>{throw new K(b.$.da.aa.name+" instance already deleted");},Ab=[];function Bb(){}
400
+ var Cb={},Db=(b,a,c)=>{if(void 0===b[a].fa){var d=b[a];b[a]=function(...e){if(!b[a].fa.hasOwnProperty(e.length))throw new K(`Function '${c}' called with an invalid number of arguments (${e.length}) - expects one of (${b[a].fa})!`);return b[a].fa[e.length].apply(this,e)};b[a].fa=[];b[a].fa[d.ta]=d}},Eb=(b,a,c)=>{if(l.hasOwnProperty(b)){if(void 0===c||void 0!==l[b].fa&&void 0!==l[b].fa[c])throw new K(`Cannot register public name '${b}' twice`);Db(l,b,b);if(l[b].fa.hasOwnProperty(c))throw new K(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`);
401
+ l[b].fa[c]=a}else l[b]=a,l[b].ta=c},Fb=b=>{b=b.replace(/[^a-zA-Z0-9_]/g,"$");var a=b.charCodeAt(0);return 48<=a&&57>=a?`_${b}`:b};function Gb(b,a,c,d,e,f,h,g){this.name=b;this.constructor=a;this.pa=c;this.qa=d;this.ga=e;this.Qb=f;this.Ca=h;this.Lb=g;this.sb=[]}
402
+ var Hb=(b,a,c)=>{for(;a!==c;){if(!a.Ca)throw new K(`Expected null or instance of ${c.name}, got an instance of ${a.name}`);b=a.Ca(b);a=a.ga}return b},Ib=b=>{if(null===b)return"null";var a=typeof b;return"object"===a||"array"===a||"function"===a?b.toString():""+b};
403
+ function Jb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
404
+ function Kb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);if(this.Ja){var c=this.Za();null!==b&&b.push(this.qa,c);return c}return 0}if(!a||!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.Ia&&a.$.da.Ia)throw new K(`Cannot convert argument of type ${a.$.oa?a.$.oa.name:a.$.da.name} to parameter type ${this.name}`);c=Hb(a.$.ca,a.$.da.aa,this.aa);if(this.Ja){if(void 0===
405
+ a.$.ia)throw new K("Passing raw pointer to smart pointer is illegal");switch(this.hc){case 0:if(a.$.oa===this)c=a.$.ia;else throw new K(`Cannot convert argument of type ${a.$.oa?a.$.oa.name:a.$.da.name} to parameter type ${this.name}`);break;case 1:c=a.$.ia;break;case 2:if(a.$.oa===this)c=a.$.ia;else{var d=a.clone();c=this.cc(c,P(()=>d["delete"]()));null!==b&&b.push(this.qa,c)}break;default:throw new K("Unsupported sharing policy");}}return c}
406
+ function Lb(b,a){if(null===a){if(this.Xa)throw new K(`null is not a valid ${this.name}`);return 0}if(!a.$)throw new K(`Cannot pass "${Ib(a)}" as a ${this.name}`);if(!a.$.ca)throw new K(`Cannot pass deleted object as a pointer of type ${this.name}`);if(a.$.da.Ia)throw new K(`Cannot convert argument of type ${a.$.da.name} to parameter type ${this.name}`);return Hb(a.$.ca,a.$.da.aa,this.aa)}
407
+ var Mb=(b,a,c)=>{if(a===c)return b;if(void 0===c.ga)return null;b=Mb(b,a,c.ga);return null===b?null:c.Lb(b)},Nb=(b,a)=>{a=eb(b,a);return db[a]},Ob=(b,a)=>{if(!a.da||!a.ca)throw new wb("makeClassHandle requires ptr and ptrType");if(!!a.oa!==!!a.ia)throw new wb("Both smartPtrType and smartPtr must be specified");a.count={value:1};return mb(Object.create(b,{$:{value:a,writable:!0}}))};
408
+ function Pb(b,a,c,d,e,f,h,g,m,n,u){this.name=b;this.aa=a;this.Xa=c;this.Ia=d;this.Ja=e;this.bc=f;this.hc=h;this.tb=g;this.Za=m;this.cc=n;this.qa=u;e||void 0!==a.ga?this.ea=Kb:(this.ea=d?Jb:Lb,this.ka=null)}var Qb=(b,a,c)=>{if(!l.hasOwnProperty(b))throw new wb("Replacing nonexistent public symbol");void 0!==l[b].fa&&void 0!==c?l[b].fa[c]=a:(l[b]=a,l[b].ta=c)},X=(b,a)=>{b=Q(b);var c=Rb.get(a);if("function"!=typeof c)throw new K(`unknown function pointer with signature ${b}: ${a}`);return c};
409
+ class Sb extends Error{}var Y=(b,a)=>{function c(f){e[f]||fb[f]||(vb[f]?vb[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};a.forEach(c);throw new Sb(`${b}: `+d.map(ib).join([", "]));};function Tb(b){for(var a=1;a<b.length;++a)if(null!==b[a]&&void 0===b[a].ka)return!0;return!1}
410
+ function Ub(b,a,c,d,e){var f=a.length;if(2>f)throw new K("argTypes array size mismatch! Must at least get return value and 'this' types!");var h=null!==a[1]&&null!==c,g=Tb(a),m=!a[0].Xb,n=f-2,u=Array(n),A=[],x=[];return $a(b,function(...t){x.length=0;A.length=h?2:1;A[0]=e;if(h){var v=a[1].ea(x,this);A[1]=v}for(var p=0;p<n;++p)u[p]=a[p+2].ea(x,t[p]),A.push(u[p]);t=d(...A);if(g)sb(x);else for(p=h?1:2;p<a.length;p++){var I=1===p?v:u[p-2];null!==a[p].ka&&a[p].ka(I)}v=m?a[0].ba(t):void 0;return v})}
411
+ var Vb=(b,a)=>{for(var c=[],d=0;d<b;d++)c.push(J[a+4*d>>2]);return c},Wb=b=>{b=b.trim();const a=b.indexOf("(");return-1===a?b:b.slice(0,a)},Xb=(b,a,c)=>{if(!(b instanceof Object))throw new K(`${c} with invalid "this": ${b}`);if(!(b instanceof a.aa.constructor))throw new K(`${c} incompatible with "this" of type ${b.constructor.name}`);if(!b.$.ca)throw new K(`cannot call emscripten binding method ${c} on deleted object`);return Hb(b.$.ca,b.$.da.aa,a.aa)},Yb=b=>{9<b&&0===--bb[b+1]&&(bb[b]=void 0,ab.push(b))},
412
+ Zb={name:"emscripten::val",ba:b=>{var a=N(b);Yb(b);return a},ea:(b,a)=>P(a),ma:tb,ka:null},$b=(b,a,c)=>{switch(a){case 1:return c?function(d){return this.ba(Ca[d])}:function(d){return this.ba(B[d])};case 2:return c?function(d){return this.ba(Da[d>>1])}:function(d){return this.ba(Ea[d>>1])};case 4:return c?function(d){return this.ba(Fa[d>>2])}:function(d){return this.ba(J[d>>2])};default:throw new TypeError(`invalid integer width (${a}): ${b}`);}},ac=(b,a)=>{switch(a){case 4:return function(c){return this.ba(Ga[c>>
413
+ 2])};case 8:return function(c){return this.ba(Ha[c>>3])};default:throw new TypeError(`invalid float width (${a}): ${b}`);}},bc=(b,a,c)=>{var d=B;if(!(0<c))return 0;var e=a;c=a+c-1;for(var f=0;f<b.length;++f){var h=b.codePointAt(f);if(127>=h){if(a>=c)break;d[a++]=h}else if(2047>=h){if(a+1>=c)break;d[a++]=192|h>>6;d[a++]=128|h&63}else if(65535>=h){if(a+2>=c)break;d[a++]=224|h>>12;d[a++]=128|h>>6&63;d[a++]=128|h&63}else{if(a+3>=c)break;d[a++]=240|h>>18;d[a++]=128|h>>12&63;d[a++]=128|h>>6&63;d[a++]=128|
412
414
  h&63;f++}}d[a]=0;return a-e},fc=b=>{for(var a=0,c=0;c<b.length;++c){var d=b.charCodeAt(c);127>=d?a++:2047>=d?a+=2:55296<=d&&57343>=d?(a+=4,++c):a+=3}return a},gc=globalThis.TextDecoder&&new TextDecoder,hc=(b,a,c,d)=>{c=a+c;if(d)return c;for(;b[a]&&!(a>=c);)++a;return a},ic=(b,a=0,c,d)=>{c=hc(b,a,c,d);if(16<c-a&&b.buffer&&gc)return gc.decode(b.subarray(a,c));for(d="";a<c;){var e=b[a++];if(e&128){var f=b[a++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var h=b[a++]&63;e=224==(e&240)?
413
415
  (e&15)<<12|f<<6|h:(e&7)<<18|f<<12|h<<6|b[a++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},jc=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,kc=(b,a,c)=>{b>>=1;a=hc(Ea,b,a/2,c);if(16<a-b&&jc)return jc.decode(Ea.subarray(b,a));for(c="";b<a;++b)c+=String.fromCharCode(Ea[b]);return c},lc=(b,a,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=a;c=c<2*b.length?c/2:b.length;for(var e=0;e<c;++e)Da[a>>1]=
414
416
  b.charCodeAt(e),a+=2;Da[a>>1]=0;return a-d},mc=b=>2*b.length,nc=(b,a,c)=>{var d="";b>>=2;for(var e=0;!(e>=a/4);e++){var f=J[b+e];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},oc=(b,a,c)=>{c??=2147483647;if(4>c)return 0;var d=a;c=d+c-4;for(var e=0;e<b.length;++e){var f=b.codePointAt(e);65535<f&&e++;Fa[a>>2]=f;a+=4;if(a+4>c)break}Fa[a>>2]=0;return a-d},pc=b=>{for(var a=0,c=0;c<b.length;++c)65535<b.codePointAt(c)&&c++,a+=4;return a},qc=0,rc=[],sc=b=>{var a=rc.length;rc.push(b);return a},tc=(b,
415
- a)=>{for(var c=Array(b),d=0;d<b;++d)c[d]=ib(J[a+4*d>>2],`parameter ${d}`);return c},uc={},vc=b=>{var a=uc[b];return void 0===a?Q(b):a},wc={},xc=b=>{if(!(b instanceof Ta||"unwind"==b))throw b;},yc=b=>{za=b;Ya||0<qc||(k.onExit?.(b),ya=!0);throw new Ta(b);},zc=b=>{if(!ya)try{if(b(),!(Ya||0<qc))try{za=b=za,yc(b)}catch(a){xc(a)}}catch(a){xc(a)}},Ac={},Cc=()=>{if(!Bc){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-",
416
- "_")+".UTF-8",_:oa||"./this.program"},a;for(a in Ac)void 0===Ac[a]?delete b[a]:b[a]=Ac[a];var c=[];for(a in b)c.push(`${a}=${b[a]}`);Bc=c}return Bc},Bc,Dc=[null,[],[]];
417
- (()=>{let b=Bb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Bb&&c instanceof Bb))return!1;var d=this.$.da.aa,e=this.$.ca;c.$=c.$;var f=c.$.da.aa;for(c=c.$.ca;d.ha;)e=d.za(e),d=d.ha;for(;f.ha;)c=f.za(c),f=f.ha;return d===f&&e===c},clone:function(){this.$.ca||zb(this);if(this.$.va)return this.$.count.value+=1,this;var c=lb,d=Object,e=d.create,f=Object.getPrototypeOf(this),h=this.$;c=c(e.call(d,f,{$:{value:{count:h.count,xa:h.xa,va:h.va,ca:h.ca,da:h.da,ia:h.ia,na:h.na}}}));c.$.count.value+=
418
- 1;c.$.xa=!1;return c},["delete"](){this.$.ca||zb(this);if(this.$.xa&&!this.$.va)throw new K("Object already scheduled for deletion");jb(this);var c=this.$;--c.count.value;0===c.count.value&&(c.ia?c.na.pa(c.ia):c.da.aa.pa(c.ca));this.$.va||(this.$.ia=void 0,this.$.ca=void 0)},isDeleted:function(){return!this.$.ca},deleteLater:function(){this.$.ca||zb(this);if(this.$.xa&&!this.$.va)throw new K("Object already scheduled for deletion");Ab.push(this);this.$.xa=!0;return this}});const a=Symbol.dispose;
417
+ a)=>{for(var c=Array(b),d=0;d<b;++d)c[d]=jb(J[a+4*d>>2],`parameter ${d}`);return c},uc={},vc=b=>{var a=uc[b];return void 0===a?Q(b):a},wc={},xc=b=>{if(!(b instanceof Ua||"unwind"==b))throw b;},yc=b=>{ya=b;Za||0<qc||(l.onExit?.(b),xa=!0);throw new Ua(b);},zc=b=>{if(!xa)try{if(b(),!(Za||0<qc))try{ya=b=ya,yc(b)}catch(a){xc(a)}}catch(a){xc(a)}},Ac={},Cc=()=>{if(!Bc){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-",
418
+ "_")+".UTF-8",_:na||"./this.program"},a;for(a in Ac)void 0===Ac[a]?delete b[a]:b[a]=Ac[a];var c=[];for(a in b)c.push(`${a}=${b[a]}`);Bc=c}return Bc},Bc,Dc=[null,[],[]];
419
+ (()=>{let b=Bb.prototype;Object.assign(b,{isAliasOf:function(c){if(!(this instanceof Bb&&c instanceof Bb))return!1;var d=this.$.da.aa,e=this.$.ca;c.$=c.$;var f=c.$.da.aa;for(c=c.$.ca;d.ga;)e=d.Ca(e),d=d.ga;for(;f.ga;)c=f.Ca(c),f=f.ga;return d===f&&e===c},clone:function(){this.$.ca||zb(this);if(this.$.xa)return this.$.count.value+=1,this;var c=mb,d=Object,e=d.create,f=Object.getPrototypeOf(this),h=this.$;c=c(e.call(d,f,{$:{value:{count:h.count,Aa:h.Aa,xa:h.xa,ca:h.ca,da:h.da,ia:h.ia,oa:h.oa}}}));c.$.count.value+=
420
+ 1;c.$.Aa=!1;return c},["delete"](){this.$.ca||zb(this);if(this.$.Aa&&!this.$.xa)throw new K("Object already scheduled for deletion");kb(this);var c=this.$;--c.count.value;0===c.count.value&&(c.ia?c.oa.qa(c.ia):c.da.aa.qa(c.ca));this.$.xa||(this.$.ia=void 0,this.$.ca=void 0)},isDeleted:function(){return!this.$.ca},deleteLater:function(){this.$.ca||zb(this);if(this.$.Aa&&!this.$.xa)throw new K("Object already scheduled for deletion");Ab.push(this);this.$.Aa=!0;return this}});const a=Symbol.dispose;
419
421
  a&&(b[a]=b["delete"])})();
420
- Object.assign(Pb.prototype,{zb(b){this.cb&&(b=this.cb(b));return b},Va(b){this.pa?.(b)},la:tb,ba:function(b){function a(){return this.Ca?Ob(this.aa.oa,{da:this.Kb,ca:c,na:this,ia:b}):Ob(this.aa.oa,{da:this,ca:b})}var c=this.zb(b);if(!c)return this.Va(b),null;var d=Nb(this.aa,c);if(void 0!==d){if(0===d.$.count.value)return d.$.ca=c,d.$.ia=b,d.clone();d=d.clone();this.Va(b);return d}d=this.aa.yb(c);d=Cb[d];if(!d)return a.call(this);d=this.Ba?d.pb:d.pointerType;var e=Mb(c,this.aa,d.aa);return null===
421
- e?a.call(this):this.Ca?Ob(d.aa.oa,{da:d,ca:e,na:this,ia:b}):Ob(d.aa.oa,{da:d,ca:e})}});k.noExitRuntime&&(Ya=k.noExitRuntime);k.print&&(va=k.print);k.printErr&&(wa=k.printErr);k.wasmBinary&&(xa=k.wasmBinary);k.thisProgram&&(oa=k.thisProgram);if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();
422
- var gb,Ec,fb,Fc,Ma,Rb,Gc={E:()=>Na(""),n:(b,a,c)=>{b=Q(b);a=ib(a,"wrapper");c=M(c);var d=a.aa,e=d.oa,f=d.ha.oa,h=d.ha.constructor;b=Za(b,function(...g){for(var m of d.ha.bb)if(this[m]===f[m])throw new bb(`Pure virtual function ${m} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:e});this.__construct(...g)});e.__construct=function(...g){if(this===e)throw new K("Pass correct 'this' to __construct");g=h.implement(this,...g);jb(g);var m=g.$;g.notifyOnDestruction();m.va=
423
- !0;Object.defineProperties(this,{$:{value:m}});lb(this);g=m.ca;g=db(d,g);if(cb.hasOwnProperty(g))throw new K(`Tried to register registered instance: ${g}`);cb[g]=this};e.__destruct=function(){if(this===e)throw new K("Pass correct 'this' to __destruct");jb(this);var g=this.$.ca;g=db(d,g);if(cb.hasOwnProperty(g))delete cb[g];else throw new K(`Tried to unregister unregistered instance: ${g}`);};b.prototype=Object.create(e);Object.assign(b.prototype,c);return P(b)},N:b=>{var a=mb[b];delete mb[b];var c=
424
- a.Ma,d=a.pa,e=a.Ya,f=e.map(h=>h.Cb).concat(e.map(h=>h.Nb));W([b],f,h=>{var g={},m,n;for([m,n]of e.entries()){const u=h[m],x=n.Ab,w=n.Bb,t=h[m+e.length],v=n.Mb,p=n.Ob;g[n.wb]={read:I=>u.ba(x(w,I)),write:(I,F)=>{var r=[];v(p,I,t.ea(r,F));sb(r)},optional:u.optional}}return[{name:a.name,ba:u=>{var x={},w;for(w in g)x[w]=g[w].read(u);d(u);return x},ea:(u,x)=>{for(var w in g)if(!(w in x||g[w].optional))throw new TypeError(`Missing field: "${w}"`);var t=c();for(w in g)g[w].write(t,x[w]);null!==u&&u.push(d,
425
- t);return t},la:tb,ka:d}]})},r:(b,a,c,d,e)=>{a=Q(a);d=0n===d;let f=h=>h;if(d){const h=8*c;f=g=>BigInt.asUintN(h,g);e=f(e)}T(b,{name:a,ba:f,ea:(h,g)=>{"number"==typeof g&&(g=BigInt(g));return g},la:yb(a,c,!d),ka:null})},H:(b,a,c,d)=>{a=Q(a);T(b,{name:a,ba:function(e){return!!e},ea:function(e,f){return f?c:d},la:function(e){return this.ba(z[e])},ka:null})},c:(b,a,c,d,e,f,h,g,m,n,u,x,w)=>{u=Q(u);f=Y(e,f);g&&=Y(h,g);n&&=Y(m,n);w=Y(x,w);var t=Fb(u);Eb(t,function(){Z(`Cannot construct ${u} due to unbound types`,
426
- [d])});W([b,a,c],d?[d]:[],v=>{v=v[0];if(d){var p=v.aa;var I=p.oa}else I=Bb.prototype;v=Za(u,function(...L){if(Object.getPrototypeOf(this)!==F)throw new K(`Use 'new' to construct ${u}`);if(void 0===r.ta)throw new K(`${u} has no accessible constructor`);var O=r.ta[L.length];if(void 0===O)throw new K(`Tried to invoke ctor of ${u} with invalid number of parameters (${L.length}) - expected (${Object.keys(r.ta).toString()}) parameters instead!`);return O.apply(this,L)});var F=Object.create(I,{constructor:{value:v}});
427
- v.prototype=F;var r=new Gb(u,v,F,w,p,f,g,n);if(r.ha){var G;(G=r.ha).Aa??(G.Aa=[]);r.ha.Aa.push(r)}p=new Pb(u,r,!0,!1,!1);G=new Pb(u+"*",r,!1,!1,!1);I=new Pb(u+" const*",r,!1,!0,!1);Cb[b]={pointerType:G,pb:I};Qb(t,v);return[p,G,I]})},j:(b,a,c,d,e,f,h)=>{var g=Vb(c,d);a=Q(a);a=Wb(a);f=Y(e,f);W([],[b],m=>{function n(){Z(`Cannot call ${u} due to unbound types`,g)}m=m[0];var u=`${m.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);var x=m.aa.constructor;void 0===x[a]?(n.sa=c-1,x[a]=n):(Db(x,a,
428
- u),x[a].fa[c-1]=n);W([],g,w=>{w=Ub(u,[w[0],null].concat(w.slice(1)),null,f,h);void 0===x[a].fa?(w.sa=c-1,x[a]=w):x[a].fa[c-1]=w;if(m.aa.Aa)for(const t of m.aa.Aa)t.constructor.hasOwnProperty(a)||(t.constructor[a]=w);return[]});return[]})},p:(b,a,c,d,e,f,h,g)=>{a=Q(a);f=Y(e,f);W([],[b],m=>{m=m[0];var n=`${m.name}.${a}`,u={get(){Z(`Cannot access ${n} due to unbound types`,[c])},enumerable:!0,configurable:!0};u.set=g?()=>{Z(`Cannot access ${n} due to unbound types`,[c])}:()=>{throw new K(`${n} is a read-only property`);
429
- };Object.defineProperty(m.aa.constructor,a,u);W([],[c],x=>{x=x[0];var w={get(){return x.ba(f(d))},enumerable:!0};g&&(g=Y(h,g),w.set=t=>{var v=[];g(d,x.ea(v,t));sb(v)});Object.defineProperty(m.aa.constructor,a,w);return[]});return[]})},m:(b,a,c,d,e,f)=>{var h=Vb(a,c);e=Y(d,e);W([],[b],g=>{g=g[0];var m=`constructor ${g.name}`;void 0===g.aa.ta&&(g.aa.ta=[]);if(void 0!==g.aa.ta[a-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${a-1}) for class '${g.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
430
- g.aa.ta[a-1]=()=>{Z(`Cannot construct ${g.name} due to unbound types`,h)};W([],h,n=>{n.splice(1,0,null);g.aa.ta[a-1]=Ub(m,n,null,e,f);return[]});return[]})},a:(b,a,c,d,e,f,h,g)=>{var m=Vb(c,d);a=Q(a);a=Wb(a);f=Y(e,f);W([],[b],n=>{function u(){Z(`Cannot call ${x} due to unbound types`,m)}n=n[0];var x=`${n.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);g&&n.aa.bb.push(a);var w=n.aa.oa,t=w[a];void 0===t||void 0===t.fa&&t.className!==n.name&&t.sa===c-2?(u.sa=c-2,u.className=n.name,w[a]=u):
431
- (Db(w,a,x),w[a].fa[c-2]=u);W([],m,v=>{v=Ub(x,v,n,f,h);void 0===w[a].fa?(v.sa=c-2,w[a]=v):w[a].fa[c-2]=v;return[]});return[]})},b:(b,a,c,d,e,f,h,g,m,n)=>{a=Q(a);e=Y(d,e);W([],[b],u=>{u=u[0];var x=`${u.name}.${a}`,w={get(){Z(`Cannot access ${x} due to unbound types`,[c,h])},enumerable:!0,configurable:!0};w.set=m?()=>Z(`Cannot access ${x} due to unbound types`,[c,h]):()=>{throw new K(x+" is a read-only property");};Object.defineProperty(u.aa.oa,a,w);W([],m?[c,h]:[c],t=>{var v=t[0],p={get(){var F=Xb(this,
432
- u,x+" getter");return v.ba(e(f,F))},enumerable:!0};if(m){m=Y(g,m);var I=t[1];p.set=function(F){var r=Xb(this,u,x+" setter"),G=[];m(n,r,I.ea(G,F));sb(G)}}Object.defineProperty(u.aa.oa,a,p);return[]});return[]})},F:b=>T(b,Zb),l:(b,a,c,d,e)=>{a=Q(a);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function h(){}h.values={};T(b,{name:a,constructor:h,valueType:e,ba:function(g){return this.constructor.values[g]},ea:(g,m)=>m.value,la:$b(a,c,d),ka:null});Eb(a,h);break;case "number":var f=
433
- {};T(b,{name:a,La:f,valueType:e,ba:g=>g,ea:(g,m)=>m,la:$b(a,c,d),ka:null});Eb(a,f);delete k[a].sa;break;case "string":f={},T(b,{name:a,jb:{},eb:{},La:f,valueType:e,ba:function(g){return this.eb[g]},ea:function(g,m){return this.jb[m]},la:$b(a,c,d),ka:null}),Eb(a,f),delete k[a].sa}},d:(b,a,c)=>{var d=ib(b,"enum");a=Q(a);switch(d.valueType){case "object":b=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:Za(`${d.name}_${a}`,function(){})}});b.values[c]=d;b[a]=
434
- d;break;case "number":d.La[a]=c;break;case "string":d.jb[a]=c,d.eb[c]=a,d.La[a]=a}},q:(b,a,c)=>{a=Q(a);T(b,{name:a,ba:d=>d,ea:(d,e)=>e,la:ac(a,c),ka:null})},i:(b,a,c,d,e,f)=>{var h=Vb(a,c);b=Q(b);b=Wb(b);e=Y(d,e);Eb(b,function(){Z(`Cannot call ${b} due to unbound types`,h)},a-1);W([],h,g=>{Qb(b,Ub(b,[g[0],null].concat(g.slice(1)),null,e,f),a-1);return[]})},k:(b,a,c,d,e)=>{a=Q(a);let f=g=>g;if(0===d){var h=32-8*c;f=g=>g<<h>>>h;e=f(e)}T(b,{name:a,ba:f,ea:(g,m)=>m,la:yb(a,c,0!==d),ka:null})},h:(b,a,
435
- c)=>{function d(f){return new e(Ca.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][a];c=Q(c);T(b,{name:c,ba:d,la:d},{Db:!0})},G:(b,a)=>{a=Q(a);T(b,{name:a,ba(c){var d=(d=c+4)?ic(z,d,J[c>>2],!0):"";gb(c);return d},ea(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new K("Cannot pass non-string to std::string");
436
- var f=e?fc(d):d.length;var h=Ec(4+f+1),g=h+4;J[h>>2]=f;e?bc(d,g,f+1):z.set(d,g);null!==c&&c.push(gb,h);return h},la:tb,ka(c){gb(c)}})},o:(b,a,c)=>{c=Q(c);if(2===a){var d=kc;var e=lc;var f=mc}else d=nc,e=oc,f=pc;T(b,{name:c,ba:h=>{var g=d(h+4,J[h>>2]*a,!0);gb(h);return g},ea:(h,g)=>{if("string"!=typeof g)throw new K(`Cannot pass non-string to C++ string type ${c}`);var m=f(g),n=Ec(4+m+a);J[n>>2]=m/a;e(g,n+4,m+a);null!==h&&h.push(gb,n);return n},la:tb,ka(h){gb(h)}})},P:(b,a,c,d,e,f)=>{mb[b]={name:Q(a),
437
- Ma:Y(c,d),pa:Y(e,f),Ya:[]}},O:(b,a,c,d,e,f,h,g,m,n)=>{mb[b].Ya.push({wb:Q(a),Cb:c,Ab:Y(d,e),Bb:f,Nb:h,Mb:Y(g,m),Ob:n})},I:(b,a)=>{a=Q(a);T(b,{Fb:!0,name:a,ba:()=>{},ea:()=>{}})},u:()=>{Ya=!1;qc=0},f:(b,a,c)=>{var [d,...e]=tc(b,a),f=d.ea.bind(d),h=e.map(m=>m.la.bind(m));b--;var g=Array(b);a=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return sc(Za(a,(m,n,u,x)=>{for(var w=0,t=0;t<b;++t)g[t]=h[t](x+w),w+=8;switch(c){case 0:var v=M(m).apply(null,g);break;case 2:v=Reflect.construct(M(m),g);break;
438
- case 3:v=g[0];break;case 1:v=M(m)[vc(n)](...g)}m=[];v=f(m,v);m.length&&(J[u>>2]=P(m));return v}))},R:Yb,J:b=>{b=vc(b);return P(k[b])},K:(b,a)=>{b=M(b);a=M(a);return P(b[a])},L:b=>{9<b&&(ab[b+1]+=1)},e:(b,a,c,d,e)=>rc[b](a,c,d,e),M:()=>P([]),s:b=>P(vc(b)),S:()=>P({}),Q:b=>{var a=M(b);sb(a);Yb(b)},g:(b,a,c)=>{b=M(b);a=M(a);c=M(c);b[a]=c},v:(b,a)=>{wc[b]&&(clearTimeout(wc[b].id),delete wc[b]);if(!a)return 0;var c=setTimeout(()=>{delete wc[b];zc(()=>Fc(b,performance.now()))},a);wc[b]={id:c,Rb:a};return 0},
422
+ Object.assign(Pb.prototype,{Rb(b){this.tb&&(b=this.tb(b));return b},lb(b){this.qa?.(b)},ma:tb,ba:function(b){function a(){return this.Ja?Ob(this.aa.pa,{da:this.bc,ca:c,oa:this,ia:b}):Ob(this.aa.pa,{da:this,ca:b})}var c=this.Rb(b);if(!c)return this.lb(b),null;var d=Nb(this.aa,c);if(void 0!==d){if(0===d.$.count.value)return d.$.ca=c,d.$.ia=b,d.clone();d=d.clone();this.lb(b);return d}d=this.aa.Qb(c);d=Cb[d];if(!d)return a.call(this);d=this.Ia?d.Hb:d.pointerType;var e=Mb(c,this.aa,d.aa);return null===
423
+ e?a.call(this):this.Ja?Ob(d.aa.pa,{da:d,ca:e,oa:this,ia:b}):Ob(d.aa.pa,{da:d,ca:e})}});l.noExitRuntime&&(Za=l.noExitRuntime);l.print&&(ua=l.print);l.printErr&&(va=l.printErr);l.wasmBinary&&(wa=l.wasmBinary);l.thisProgram&&(na=l.thisProgram);if(l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.shift()();
424
+ var hb,Ec,gb,Fc,Ma,Rb,Gc={E:()=>Na(""),n:(b,a,c)=>{b=Q(b);a=jb(a,"wrapper");c=N(c);var d=a.aa,e=d.pa,f=d.ga.pa,h=d.ga.constructor;b=$a(b,function(...g){for(var m of d.ga.sb)if(this[m]===f[m])throw new cb(`Pure virtual function ${m} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:e});this.__construct(...g)});e.__construct=function(...g){if(this===e)throw new K("Pass correct 'this' to __construct");g=h.implement(this,...g);kb(g);var m=g.$;g.notifyOnDestruction();m.xa=
425
+ !0;Object.defineProperties(this,{$:{value:m}});mb(this);g=m.ca;g=eb(d,g);if(db.hasOwnProperty(g))throw new K(`Tried to register registered instance: ${g}`);db[g]=this};e.__destruct=function(){if(this===e)throw new K("Pass correct 'this' to __destruct");kb(this);var g=this.$.ca;g=eb(d,g);if(db.hasOwnProperty(g))delete db[g];else throw new K(`Tried to unregister unregistered instance: ${g}`);};b.prototype=Object.create(e);Object.assign(b.prototype,c);return P(b)},N:b=>{var a=nb[b];delete nb[b];var c=
426
+ a.Za,d=a.qa,e=a.ob,f=e.map(h=>h.Ub).concat(e.map(h=>h.ec));V([b],f,h=>{var g={},m,n;for([m,n]of e.entries()){const u=h[m],A=n.Sb,x=n.Tb,t=h[m+e.length],v=n.dc,p=n.fc;g[n.Ob]={read:I=>u.ba(A(x,I)),write:(I,G)=>{var r=[];v(p,I,t.ea(r,G));sb(r)},optional:u.optional}}return[{name:a.name,ba:u=>{var A={},x;for(x in g)A[x]=g[x].read(u);d(u);return A},ea:(u,A)=>{for(var x in g)if(!(x in A||g[x].optional))throw new TypeError(`Missing field: "${x}"`);var t=c();for(x in g)g[x].write(t,A[x]);null!==u&&u.push(d,
427
+ t);return t},ma:tb,ka:d}]})},r:(b,a,c,d,e)=>{a=Q(a);d=0n===d;let f=h=>h;if(d){const h=8*c;f=g=>BigInt.asUintN(h,g);e=f(e)}T(b,{name:a,ba:f,ea:(h,g)=>{"number"==typeof g&&(g=BigInt(g));return g},ma:yb(a,c,!d),ka:null})},H:(b,a,c,d)=>{a=Q(a);T(b,{name:a,ba:function(e){return!!e},ea:function(e,f){return f?c:d},ma:function(e){return this.ba(B[e])},ka:null})},c:(b,a,c,d,e,f,h,g,m,n,u,A,x)=>{u=Q(u);f=X(e,f);g&&=X(h,g);n&&=X(m,n);x=X(A,x);var t=Fb(u);Eb(t,function(){Y(`Cannot construct ${u} due to unbound types`,
428
+ [d])});V([b,a,c],d?[d]:[],v=>{v=v[0];if(d){var p=v.aa;var I=p.pa}else I=Bb.prototype;v=$a(u,function(...L){if(Object.getPrototypeOf(this)!==G)throw new K(`Use 'new' to construct ${u}`);if(void 0===r.ua)throw new K(`${u} has no accessible constructor`);var O=r.ua[L.length];if(void 0===O)throw new K(`Tried to invoke ctor of ${u} with invalid number of parameters (${L.length}) - expected (${Object.keys(r.ua).toString()}) parameters instead!`);return O.apply(this,L)});var G=Object.create(I,{constructor:{value:v}});
429
+ v.prototype=G;var r=new Gb(u,v,G,x,p,f,g,n);if(r.ga){var E;(E=r.ga).Ea??(E.Ea=[]);r.ga.Ea.push(r)}p=new Pb(u,r,!0,!1,!1);E=new Pb(u+"*",r,!1,!1,!1);I=new Pb(u+" const*",r,!1,!0,!1);Cb[b]={pointerType:E,Hb:I};Qb(t,v);return[p,E,I]})},j:(b,a,c,d,e,f,h)=>{var g=Vb(c,d);a=Q(a);a=Wb(a);f=X(e,f);V([],[b],m=>{function n(){Y(`Cannot call ${u} due to unbound types`,g)}m=m[0];var u=`${m.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);var A=m.aa.constructor;void 0===A[a]?(n.ta=c-1,A[a]=n):(Db(A,a,
430
+ u),A[a].fa[c-1]=n);V([],g,x=>{x=Ub(u,[x[0],null].concat(x.slice(1)),null,f,h);void 0===A[a].fa?(x.ta=c-1,A[a]=x):A[a].fa[c-1]=x;if(m.aa.Ea)for(const t of m.aa.Ea)t.constructor.hasOwnProperty(a)||(t.constructor[a]=x);return[]});return[]})},p:(b,a,c,d,e,f,h,g)=>{a=Q(a);f=X(e,f);V([],[b],m=>{m=m[0];var n=`${m.name}.${a}`,u={get(){Y(`Cannot access ${n} due to unbound types`,[c])},enumerable:!0,configurable:!0};u.set=g?()=>{Y(`Cannot access ${n} due to unbound types`,[c])}:()=>{throw new K(`${n} is a read-only property`);
431
+ };Object.defineProperty(m.aa.constructor,a,u);V([],[c],A=>{A=A[0];var x={get(){return A.ba(f(d))},enumerable:!0};g&&(g=X(h,g),x.set=t=>{var v=[];g(d,A.ea(v,t));sb(v)});Object.defineProperty(m.aa.constructor,a,x);return[]});return[]})},m:(b,a,c,d,e,f)=>{var h=Vb(a,c);e=X(d,e);V([],[b],g=>{g=g[0];var m=`constructor ${g.name}`;void 0===g.aa.ua&&(g.aa.ua=[]);if(void 0!==g.aa.ua[a-1])throw new K(`Cannot register multiple constructors with identical number of parameters (${a-1}) for class '${g.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
432
+ g.aa.ua[a-1]=()=>{Y(`Cannot construct ${g.name} due to unbound types`,h)};V([],h,n=>{n.splice(1,0,null);g.aa.ua[a-1]=Ub(m,n,null,e,f);return[]});return[]})},a:(b,a,c,d,e,f,h,g)=>{var m=Vb(c,d);a=Q(a);a=Wb(a);f=X(e,f);V([],[b],n=>{function u(){Y(`Cannot call ${A} due to unbound types`,m)}n=n[0];var A=`${n.name}.${a}`;a.startsWith("@@")&&(a=Symbol[a.substring(2)]);g&&n.aa.sb.push(a);var x=n.aa.pa,t=x[a];void 0===t||void 0===t.fa&&t.className!==n.name&&t.ta===c-2?(u.ta=c-2,u.className=n.name,x[a]=u):
433
+ (Db(x,a,A),x[a].fa[c-2]=u);V([],m,v=>{v=Ub(A,v,n,f,h);void 0===x[a].fa?(v.ta=c-2,x[a]=v):x[a].fa[c-2]=v;return[]});return[]})},b:(b,a,c,d,e,f,h,g,m,n)=>{a=Q(a);e=X(d,e);V([],[b],u=>{u=u[0];var A=`${u.name}.${a}`,x={get(){Y(`Cannot access ${A} due to unbound types`,[c,h])},enumerable:!0,configurable:!0};x.set=m?()=>Y(`Cannot access ${A} due to unbound types`,[c,h]):()=>{throw new K(A+" is a read-only property");};Object.defineProperty(u.aa.pa,a,x);V([],m?[c,h]:[c],t=>{var v=t[0],p={get(){var G=Xb(this,
434
+ u,A+" getter");return v.ba(e(f,G))},enumerable:!0};if(m){m=X(g,m);var I=t[1];p.set=function(G){var r=Xb(this,u,A+" setter"),E=[];m(n,r,I.ea(E,G));sb(E)}}Object.defineProperty(u.aa.pa,a,p);return[]});return[]})},F:b=>T(b,Zb),l:(b,a,c,d,e)=>{a=Q(a);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function h(){}h.values={};T(b,{name:a,constructor:h,valueType:e,ba:function(g){return this.constructor.values[g]},ea:(g,m)=>m.value,ma:$b(a,c,d),ka:null});Eb(a,h);break;case "number":var f=
435
+ {};T(b,{name:a,Ya:f,valueType:e,ba:g=>g,ea:(g,m)=>m,ma:$b(a,c,d),ka:null});Eb(a,f);delete l[a].ta;break;case "string":f={},T(b,{name:a,zb:{},ub:{},Ya:f,valueType:e,ba:function(g){return this.ub[g]},ea:function(g,m){return this.zb[m]},ma:$b(a,c,d),ka:null}),Eb(a,f),delete l[a].ta}},d:(b,a,c)=>{var d=jb(b,"enum");a=Q(a);switch(d.valueType){case "object":b=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:$a(`${d.name}_${a}`,function(){})}});b.values[c]=d;b[a]=
436
+ d;break;case "number":d.Ya[a]=c;break;case "string":d.zb[a]=c,d.ub[c]=a,d.Ya[a]=a}},q:(b,a,c)=>{a=Q(a);T(b,{name:a,ba:d=>d,ea:(d,e)=>e,ma:ac(a,c),ka:null})},i:(b,a,c,d,e,f)=>{var h=Vb(a,c);b=Q(b);b=Wb(b);e=X(d,e);Eb(b,function(){Y(`Cannot call ${b} due to unbound types`,h)},a-1);V([],h,g=>{Qb(b,Ub(b,[g[0],null].concat(g.slice(1)),null,e,f),a-1);return[]})},k:(b,a,c,d,e)=>{a=Q(a);let f=g=>g;if(0===d){var h=32-8*c;f=g=>g<<h>>>h;e=f(e)}T(b,{name:a,ba:f,ea:(g,m)=>m,ma:yb(a,c,0!==d),ka:null})},h:(b,a,
437
+ c)=>{function d(f){return new e(Ca.buffer,J[f+4>>2],J[f>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][a];c=Q(c);T(b,{name:c,ba:d,ma:d},{Vb:!0})},G:(b,a)=>{a=Q(a);T(b,{name:a,ba(c){var d=(d=c+4)?ic(B,d,J[c>>2],!0):"";hb(c);return d},ea(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new K("Cannot pass non-string to std::string");
438
+ var f=e?fc(d):d.length;var h=Ec(4+f+1),g=h+4;J[h>>2]=f;e?bc(d,g,f+1):B.set(d,g);null!==c&&c.push(hb,h);return h},ma:tb,ka(c){hb(c)}})},o:(b,a,c)=>{c=Q(c);if(2===a){var d=kc;var e=lc;var f=mc}else d=nc,e=oc,f=pc;T(b,{name:c,ba:h=>{var g=d(h+4,J[h>>2]*a,!0);hb(h);return g},ea:(h,g)=>{if("string"!=typeof g)throw new K(`Cannot pass non-string to C++ string type ${c}`);var m=f(g),n=Ec(4+m+a);J[n>>2]=m/a;e(g,n+4,m+a);null!==h&&h.push(hb,n);return n},ma:tb,ka(h){hb(h)}})},P:(b,a,c,d,e,f)=>{nb[b]={name:Q(a),
439
+ Za:X(c,d),qa:X(e,f),ob:[]}},O:(b,a,c,d,e,f,h,g,m,n)=>{nb[b].ob.push({Ob:Q(a),Ub:c,Sb:X(d,e),Tb:f,ec:h,dc:X(g,m),fc:n})},I:(b,a)=>{a=Q(a);T(b,{Xb:!0,name:a,ba:()=>{},ea:()=>{}})},u:()=>{Za=!1;qc=0},f:(b,a,c)=>{var [d,...e]=tc(b,a),f=d.ea.bind(d),h=e.map(m=>m.ma.bind(m));b--;var g=Array(b);a=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return sc($a(a,(m,n,u,A)=>{for(var x=0,t=0;t<b;++t)g[t]=h[t](A+x),x+=8;switch(c){case 0:var v=N(m).apply(null,g);break;case 2:v=Reflect.construct(N(m),g);break;
440
+ case 3:v=g[0];break;case 1:v=N(m)[vc(n)](...g)}m=[];v=f(m,v);m.length&&(J[u>>2]=P(m));return v}))},R:Yb,J:b=>{b=vc(b);return P(l[b])},K:(b,a)=>{b=N(b);a=N(a);return P(b[a])},L:b=>{9<b&&(bb[b+1]+=1)},e:(b,a,c,d,e)=>rc[b](a,c,d,e),M:()=>P([]),s:b=>P(vc(b)),S:()=>P({}),Q:b=>{var a=N(b);sb(a);Yb(b)},g:(b,a,c)=>{b=N(b);a=N(a);c=N(c);b[a]=c},v:(b,a)=>{wc[b]&&(clearTimeout(wc[b].id),delete wc[b]);if(!a)return 0;var c=setTimeout(()=>{delete wc[b];zc(()=>Fc(b,performance.now()))},a);wc[b]={id:c,jc:a};return 0},
439
441
  w:(b,a,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();J[b>>2]=60*Math.max(f,e);Fa[a>>2]=Number(f!=e);a=h=>{var g=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(g/60)).padStart(2,"0")}${String(g%60).padStart(2,"0")}`};b=a(f);a=a(e);e<f?(bc(b,c,17),bc(a,d,17)):(bc(b,d,17),bc(a,c,17))},z:function(b,a,c){if(!(0<=b&&3>=b))return 28;Ia[c>>3]=BigInt(Math.round(1E6*(0===b?Date.now():performance.now())));return 0},A:b=>{var a=
440
- z.length;b>>>=0;if(2147483648<b)return!1;for(var c=1;4>=c;c*=2){var d=a*(1+.2/c);d=Math.min(d,b+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(b,d)/65536))-Ma.buffer.byteLength+65535)/65536|0;try{Ma.grow(d);La();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},x:(b,a)=>{var c=0,d=0,e;for(e of Cc()){var f=a+c;J[b+d>>2]=f;c+=bc(e,f,Infinity)+1;d+=4}return 0},y:(b,a)=>{var c=Cc();J[b>>2]=c.length;b=0;for(var d of c)b+=fc(d)+1;J[a>>2]=b;return 0},D:()=>52,B:function(){return 70},
441
- C:(b,a,c,d)=>{for(var e=0,f=0;f<c;f++){var h=J[a>>2],g=J[a+4>>2];a+=8;for(var m=0;m<g;m++){var n=b,u=z[h+m],x=Dc[n];0===u||10===u?((1===n?va:wa)(ic(x)),x.length=0):x.push(u)}e+=g}J[d>>2]=e;return 0},t:yc},Hc;
442
- Hc=await (async function(){function b(c){c=Hc=c.exports;gb=c.V;Ec=c.W;fb=c.X;Fc=c.Z;Ma=c.T;Rb=c.Y;La();return Hc}var a={a:Gc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(a,(d,e)=>{c(b(d,e))})});Oa??=k.locateFile?k.locateFile("canvas_advanced.wasm",pa):pa+"canvas_advanced.wasm";return b((await Sa(a)).instance)}());
443
- (function(){function b(){k.calledRun=!0;if(!ya){Ka=!0;Hc.U();Aa?.(k);k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var a=k.postRun.shift();Va.push(a)}Ua(Va)}}if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Xa();Ua(Wa);k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);b()},1)):b()})();Ka?moduleRtn=k:moduleRtn=new Promise((b,a)=>{Aa=b;Ba=a});
442
+ B.length;b>>>=0;if(2147483648<b)return!1;for(var c=1;4>=c;c*=2){var d=a*(1+.2/c);d=Math.min(d,b+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(b,d)/65536))-Ma.buffer.byteLength+65535)/65536|0;try{Ma.grow(d);La();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1},x:(b,a)=>{var c=0,d=0,e;for(e of Cc()){var f=a+c;J[b+d>>2]=f;c+=bc(e,f,Infinity)+1;d+=4}return 0},y:(b,a)=>{var c=Cc();J[b>>2]=c.length;b=0;for(var d of c)b+=fc(d)+1;J[a>>2]=b;return 0},D:()=>52,B:function(){return 70},
443
+ C:(b,a,c,d)=>{for(var e=0,f=0;f<c;f++){var h=J[a>>2],g=J[a+4>>2];a+=8;for(var m=0;m<g;m++){var n=b,u=B[h+m],A=Dc[n];0===u||10===u?((1===n?ua:va)(ic(A)),A.length=0):A.push(u)}e+=g}J[d>>2]=e;return 0},t:yc},Hc;
444
+ Hc=await (async function(){function b(c){c=Hc=c.exports;hb=c.V;Ec=c.W;gb=c.X;Fc=c.Z;Ma=c.T;Rb=c.Y;La();return Hc}var a={a:Gc};if(l.instantiateWasm)return new Promise(c=>{l.instantiateWasm(a,(d,e)=>{c(b(d,e))})});Oa??=l.locateFile?l.locateFile("canvas_advanced.wasm",oa):oa+"canvas_advanced.wasm";return b((await Ta(a)).instance)}());
445
+ (function(){function b(){l.calledRun=!0;if(!xa){Ka=!0;Hc.U();za?.(l);l.onRuntimeInitialized?.();if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var a=l.postRun.shift();Wa.push(a)}Va(Wa)}}if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)Ya();Va(Xa);l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1);b()},1)):b()})();Ka?moduleRtn=l:moduleRtn=new Promise((b,a)=>{za=b;Ba=a});
444
446
  ;return moduleRtn}})();
445
447
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rive);
446
448
 
@@ -449,7 +451,7 @@ Hc=await (async function(){function b(c){c=Hc=c.exports;gb=c.V;Ec=c.W;fb=c.X;Fc=
449
451
  /* 5 */
450
452
  /***/ ((module) => {
451
453
 
452
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.40.1","description":"A lite version of Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"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}}');
454
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.41.1","description":"A lite version of Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"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}}');
453
455
 
454
456
  /***/ }),
455
457
  /* 6 */
@@ -458,12 +460,16 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","versi
458
460
  __webpack_require__.r(__webpack_exports__);
459
461
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
460
462
  /* harmony export */ AccessibilityOverlay: () => (/* reexport safe */ _accessibilityOverlay__WEBPACK_IMPORTED_MODULE_1__.AccessibilityOverlay),
463
+ /* harmony export */ CHECK_STATE_MASK: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_MASK),
464
+ /* harmony export */ CHECK_STATE_OFFSET: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.CHECK_STATE_OFFSET),
461
465
  /* harmony export */ SemanticActionType: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticActionType),
466
+ /* harmony export */ SemanticCheckState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticCheckState),
462
467
  /* harmony export */ SemanticMode: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticMode),
463
468
  /* harmony export */ SemanticRole: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticRole),
464
469
  /* harmony export */ SemanticState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticState),
465
470
  /* harmony export */ SemanticTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.SemanticTrait),
466
471
  /* harmony export */ SemanticTreeModel: () => (/* reexport safe */ _semanticTreeModel__WEBPACK_IMPORTED_MODULE_0__.SemanticTreeModel),
472
+ /* harmony export */ checkStateOf: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.checkStateOf),
467
473
  /* harmony export */ hasState: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasState),
468
474
  /* harmony export */ hasTrait: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.hasTrait),
469
475
  /* harmony export */ roleName: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_2__.roleName),
@@ -928,11 +934,15 @@ function applyGeometry(target, src) {
928
934
 
929
935
  __webpack_require__.r(__webpack_exports__);
930
936
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
937
+ /* harmony export */ CHECK_STATE_MASK: () => (/* binding */ CHECK_STATE_MASK),
938
+ /* harmony export */ CHECK_STATE_OFFSET: () => (/* binding */ CHECK_STATE_OFFSET),
931
939
  /* harmony export */ SemanticActionType: () => (/* binding */ SemanticActionType),
940
+ /* harmony export */ SemanticCheckState: () => (/* binding */ SemanticCheckState),
932
941
  /* harmony export */ SemanticMode: () => (/* binding */ SemanticMode),
933
942
  /* harmony export */ SemanticRole: () => (/* binding */ SemanticRole),
934
943
  /* harmony export */ SemanticState: () => (/* binding */ SemanticState),
935
944
  /* harmony export */ SemanticTrait: () => (/* binding */ SemanticTrait),
945
+ /* harmony export */ checkStateOf: () => (/* binding */ checkStateOf),
936
946
  /* harmony export */ hasState: () => (/* binding */ hasState),
937
947
  /* harmony export */ hasTrait: () => (/* binding */ hasTrait),
938
948
  /* harmony export */ roleName: () => (/* binding */ roleName),
@@ -967,14 +977,17 @@ var SemanticRole = {
967
977
  //
968
978
  // Bits 0-7 are trait-gated (only meaningful when the corresponding
969
979
  // SemanticTrait is set). Bits 8-13 are non-trait states.
980
+ //
981
+ // Check state is the exception: it is a two-bit *field* at bits 2-3 rather
982
+ // than a flag, because a checkbox is tri-state. It is not a member of this
983
+ // table — read it with checkStateOf().
970
984
  // ---------------------------------------------------------------------------
971
985
  var SemanticState = {
972
986
  None: 0,
973
987
  // Trait-gated
974
988
  Expanded: 1 << 0, // requires Expandable
975
989
  Selected: 1 << 1, // requires Selectable
976
- Checked: 1 << 2, // requires Checkable
977
- Mixed: 1 << 3, // requires Checkable; wins over Checked
990
+ // Bits 2-3 are the check state field, not independent flags -- see SemanticCheckState.
978
991
  Toggled: 1 << 4, // requires Toggleable
979
992
  Required: 1 << 5, // requires Requirable
980
993
  Disabled: 1 << 6, // requires Enablable
@@ -990,6 +1003,30 @@ var SemanticState = {
990
1003
  function hasState(flags, state) {
991
1004
  return (flags & state) !== 0;
992
1005
  }
1006
+ // SemanticCheckState — mirrors rive::SemanticCheckState
1007
+ //
1008
+ // The tri-state of a checkable node. Occupies two bits of stateFlags at
1009
+ // CHECK_STATE_OFFSET, so it is read as a value rather than tested as a flag.
1010
+ // Only meaningful when the Checkable trait is set.
1011
+ var SemanticCheckState = {
1012
+ Unchecked: 0,
1013
+ Checked: 1,
1014
+ Mixed: 2,
1015
+ };
1016
+ /** Bit offset of the check field within stateFlags. */
1017
+ var CHECK_STATE_OFFSET = 2;
1018
+ /** Mask of the check field within stateFlags. */
1019
+ var CHECK_STATE_MASK = 3 << CHECK_STATE_OFFSET;
1020
+ /**
1021
+ * Decodes the check field out of `flags`. The field is two bits. Returns 0, 1, or 2
1022
+ * per the mapping in SemanticCheckState.
1023
+ */
1024
+ function checkStateOf(flags) {
1025
+ var value = (flags & CHECK_STATE_MASK) >> CHECK_STATE_OFFSET;
1026
+ return value >= SemanticCheckState.Mixed
1027
+ ? SemanticCheckState.Mixed
1028
+ : value;
1029
+ }
993
1030
  /**
994
1031
  * Controls when the instance builds semantic trees and accessibility overlays.
995
1032
  *
@@ -1056,6 +1093,14 @@ function stateNames(flags) {
1056
1093
  if (flags & bit)
1057
1094
  active.push(name_2);
1058
1095
  }
1096
+ switch (checkStateOf(flags)) {
1097
+ case SemanticCheckState.Checked:
1098
+ active.push("Checked");
1099
+ break;
1100
+ case SemanticCheckState.Mixed:
1101
+ active.push("Mixed");
1102
+ break;
1103
+ }
1059
1104
  return active.join(", ") || "none";
1060
1105
  }
1061
1106
  function traitNames(flags) {
@@ -1824,13 +1869,15 @@ var AccessibilityOverlay = /** @class */ (function () {
1824
1869
  removeAttr(el, "aria-selected");
1825
1870
  }
1826
1871
  if ((0,_types__WEBPACK_IMPORTED_MODULE_0__.hasTrait)(traits, _types__WEBPACK_IMPORTED_MODULE_0__.SemanticTrait.Checkable) && ARIA_CHECKED_ROLES.has(role)) {
1827
- // Mixed wins over Checked per the C++ precedence contract, but
1828
- // role="switch" only accepts true/false — "mixed" is invalid per ARIA.
1829
- if ((0,_types__WEBPACK_IMPORTED_MODULE_0__.hasState)(flags, _types__WEBPACK_IMPORTED_MODULE_0__.SemanticState.Mixed) && role !== _types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.switchControl) {
1872
+ // Check state is a tri-state field, but not every checkable role
1873
+ // accepts all three values — see ARIA_MIXED_ROLES.
1874
+ var checkState = (0,_types__WEBPACK_IMPORTED_MODULE_0__.checkStateOf)(flags);
1875
+ if (checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Mixed &&
1876
+ ARIA_MIXED_ROLES.has(role)) {
1830
1877
  setAttr(el, "aria-checked", "mixed");
1831
1878
  }
1832
1879
  else {
1833
- setBoolAttr(el, "aria-checked", (0,_types__WEBPACK_IMPORTED_MODULE_0__.hasState)(flags, _types__WEBPACK_IMPORTED_MODULE_0__.SemanticState.Checked));
1880
+ setBoolAttr(el, "aria-checked", checkState === _types__WEBPACK_IMPORTED_MODULE_0__.SemanticCheckState.Checked);
1834
1881
  }
1835
1882
  }
1836
1883
  else {
@@ -2090,6 +2137,15 @@ var ARIA_CHECKED_ROLES = new Set([
2090
2137
  _types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.radioButton,
2091
2138
  _types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.switchControl,
2092
2139
  ]);
2140
+ /**
2141
+ * aria-checked="mixed": checkbox only. ARIA defines checkbox as three-valued
2142
+ * (true/false/mixed) but radio and switch as two-valued (true/false), so an
2143
+ * indeterminate check state degrades to false for those roles rather than
2144
+ * emitting a value they do not support.
2145
+ */
2146
+ var ARIA_MIXED_ROLES = new Set([
2147
+ _types__WEBPACK_IMPORTED_MODULE_0__.SemanticRole.checkbox,
2148
+ ]);
2093
2149
  /**
2094
2150
  * aria-pressed: button only. switch is a button subclass in ARIA but uses
2095
2151
  * aria-checked (not aria-pressed) for its on/off state — it is intentionally
@@ -3574,6 +3630,12 @@ var Layout = /** @class */ (function () {
3574
3630
 
3575
3631
  // #endregion
3576
3632
  // #region state machines
3633
+ /**
3634
+ * @deprecated State machine inputs are deprecated and will be removed in a
3635
+ * future major version: please use data binding properties instead. See
3636
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
3637
+ * for how to migrate.
3638
+ */
3577
3639
  var StateMachineInputType;
3578
3640
  (function (StateMachineInputType) {
3579
3641
  StateMachineInputType[StateMachineInputType["Number"] = 56] = "Number";
@@ -3582,6 +3644,10 @@ var StateMachineInputType;
3582
3644
  })(StateMachineInputType || (StateMachineInputType = {}));
3583
3645
  /**
3584
3646
  * An input for a state machine
3647
+ * @deprecated State machine inputs are deprecated and will be removed in a
3648
+ * future major version: please use data binding properties instead. See
3649
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
3650
+ * for how to migrate.
3585
3651
  */
3586
3652
  var StateMachineInput = /** @class */ (function () {
3587
3653
  function StateMachineInput(type, runtimeInput) {
@@ -3631,6 +3697,11 @@ var StateMachineInput = /** @class */ (function () {
3631
3697
  return StateMachineInput;
3632
3698
  }());
3633
3699
 
3700
+ /**
3701
+ * @deprecated Rive Events are deprecated and will be removed in a future major
3702
+ * version: please use data binding instead. See
3703
+ * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
3704
+ */
3634
3705
  var RiveEventType;
3635
3706
  (function (RiveEventType) {
3636
3707
  RiveEventType[RiveEventType["General"] = 128] = "General";
@@ -4173,6 +4244,12 @@ var Animator = /** @class */ (function () {
4173
4244
  var instancedName;
4174
4245
  if (this.animations.length === 0 && this.stateMachines.length === 0) {
4175
4246
  if (this.artboard.animationCount() > 0) {
4247
+ // Warn only when the v3 default would actually change what plays
4248
+ if (this.artboard.stateMachineCount() > 0) {
4249
+ warnOnce("No `stateMachine` was specified, so the artboard's first linear animation is playing by default. " +
4250
+ "In the next major version, the artboard's state machine will be played by default instead when one exists. " +
4251
+ "Pass the `stateMachine` parameter to adopt that behavior now.");
4252
+ }
4176
4253
  // Add the first animation
4177
4254
  this.add([(instancedName = this.artboard.animationByIndex(0).name)], playing, fireEvent);
4178
4255
  }
@@ -4251,15 +4328,84 @@ var EventType;
4251
4328
  EventType["Play"] = "play";
4252
4329
  EventType["Pause"] = "pause";
4253
4330
  EventType["Stop"] = "stop";
4331
+ /**
4332
+ * @deprecated Loop events are deprecated and will be removed in a future
4333
+ * major version: they are only reported for linear animation playback, which
4334
+ * is deprecated. Use a state machine to control playback and data binding to
4335
+ * react to changes instead. See
4336
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
4337
+ * to migrate.
4338
+ */
4254
4339
  EventType["Loop"] = "loop";
4255
4340
  EventType["Draw"] = "draw";
4256
4341
  EventType["Advance"] = "advance";
4342
+ /**
4343
+ * @deprecated State change events are deprecated and will be removed in a
4344
+ * future major version. Use data binding (view model property observers) or
4345
+ * state machine actions to react to changes from your graphic instead. See
4346
+ * {@link https://rive.app/docs/editor/state-machine/states#actions} for more details.
4347
+ */
4257
4348
  EventType["StateChange"] = "statechange";
4349
+ /**
4350
+ * @deprecated Rive Events are deprecated and will be removed in a future
4351
+ * major version: please use data binding instead. See
4352
+ * {@link https://rive.app/docs/runtimes/web/rive-events} for how to migrate.
4353
+ */
4258
4354
  EventType["RiveEvent"] = "riveevent";
4259
4355
  EventType["AudioStatusChange"] = "audiostatuschange";
4260
4356
  })(EventType || (EventType = {}));
4357
+ var riveEventsDeprecationWarning = "Rive Events are deprecated and will be removed in a future major version: " +
4358
+ "please use data binding instead. See " +
4359
+ "https://rive.app/docs/runtimes/web/rive-events for how to migrate.";
4360
+ var stateMachineInputsDeprecationWarning = "State machine inputs are deprecated and will be removed in a future major version: " +
4361
+ "please use data binding properties instead. See " +
4362
+ "https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs for how to migrate.";
4363
+ var textRunsDeprecationWarning = "Text run APIs are deprecated and will be removed in a future major version: " +
4364
+ "please use data binding instead. See " +
4365
+ "https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime for how to migrate.";
4366
+ var loopEventsDeprecationWarning = "Loop events are deprecated and will be removed in a future major version: " +
4367
+ "they are only reported for linear animation playback, which is deprecated. " +
4368
+ "Use a state machine to control playback and data binding to react to changes instead. See " +
4369
+ "https://rive.app/docs/editor/data-binding/migration-guide for how to migrate.";
4370
+ var stateChangeEventsDeprecationWarning = "State change events are deprecated and will be removed in a future major version: " +
4371
+ "use data binding (view model property observers) or state machine actions to react to " +
4372
+ "changes from your graphic instead. See " +
4373
+ "https://rive.app/docs/editor/state-machine/states#actions for how to migrate.";
4374
+ // Deprecation warnings already emitted; each is logged at most once per page
4375
+ // session to avoid flooding the console when many instances are created.
4376
+ var emittedWarnings = new Set();
4377
+ var warnOnce = function (message) {
4378
+ if (!emittedWarnings.has(message)) {
4379
+ emittedWarnings.add(message);
4380
+ console.warn("[Rive] ".concat(message));
4381
+ }
4382
+ };
4383
+ /**
4384
+ * Warns that a playback-control method received an array of names; the next
4385
+ * major version restricts these parameters to a single string, since playing
4386
+ * multiple animations or state machines at once will not be supported.
4387
+ */
4388
+ var warnIfNamesArray = function (names, methodName) {
4389
+ if (Array.isArray(names)) {
4390
+ warnOnce("Passing an array of names to `".concat(methodName, "()` is deprecated: in the next major version this parameter will be a single string, and playing multiple animations or state machines at once will not be supported."));
4391
+ }
4392
+ };
4393
+ /**
4394
+ * Warns that a playback-control method received linear animation names;
4395
+ * name-based control remains supported for state machines only, so
4396
+ * user-specified linear animation names are going away in a future major
4397
+ * version.
4398
+ */
4399
+ var warnDeprecatedAnimationNames = function (methodName) {
4400
+ warnOnce("Passing linear animation names to `".concat(methodName, "()` is deprecated and will be removed in a future major version: ") +
4401
+ "Pass a single state machine name to control playback instead.");
4402
+ };
4261
4403
  /**
4262
4404
  * Looping types: one-shot, loop, and ping-pong
4405
+ * @deprecated Loop events are deprecated and will be removed in a future major
4406
+ * version: they are only reported for linear animation playback, which is
4407
+ * deprecated. Use a state machine to control playback and data binding to
4408
+ * react to changes instead.
4263
4409
  */
4264
4410
  var LoopType;
4265
4411
  (function (LoopType) {
@@ -4573,6 +4719,31 @@ var observers = new ObjectObservers();
4573
4719
  // #endregion
4574
4720
  // #region Rive
4575
4721
  var nextRiveInstanceId = 0;
4722
+ /**
4723
+ * Resolves which animation/state machine names playback should start with.
4724
+ * The `stateMachine` parameter takes priority; the deprecated plural
4725
+ * `animations`/`stateMachines` parameters apply only when it
4726
+ * is not provided.
4727
+ */
4728
+ var resolveStartingPlayback = function (_a) {
4729
+ var stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines;
4730
+ if (animations !== undefined) {
4731
+ warnOnce("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.");
4732
+ }
4733
+ if (stateMachines !== undefined) {
4734
+ warnOnce("The `stateMachines` parameter is deprecated: please use `stateMachine` with a single state machine name instead.");
4735
+ }
4736
+ if (stateMachine) {
4737
+ return {
4738
+ startingAnimationNames: [],
4739
+ startingStateMachineNames: [stateMachine],
4740
+ };
4741
+ }
4742
+ return {
4743
+ startingAnimationNames: mapToStringArray(animations),
4744
+ startingStateMachineNames: mapToStringArray(stateMachines),
4745
+ };
4746
+ };
4576
4747
  var RiveFile = /** @class */ (function () {
4577
4748
  function RiveFile(params) {
4578
4749
  // Allow the runtime to automatically load assets hosted in Rive's runtime.
@@ -4994,6 +5165,10 @@ var Rive = /** @class */ (function () {
4994
5165
  this.layout = (_a = params.layout) !== null && _a !== void 0 ? _a : new Layout();
4995
5166
  this.shouldDisableRiveListeners = !!params.shouldDisableRiveListeners;
4996
5167
  this.isTouchScrollEnabled = !!params.isTouchScrollEnabled;
5168
+ if (params.automaticallyHandleEvents) {
5169
+ warnOnce("The `automaticallyHandleEvents` parameter is deprecated. " +
5170
+ riveEventsDeprecationWarning);
5171
+ }
4997
5172
  this.automaticallyHandleEvents = !!params.automaticallyHandleEvents;
4998
5173
  this.dispatchPointerExit =
4999
5174
  params.dispatchPointerExit === false
@@ -5058,6 +5233,7 @@ var Rive = /** @class */ (function () {
5058
5233
  riveFile: this.riveFile,
5059
5234
  autoplay: params.autoplay,
5060
5235
  autoBind: params.autoBind,
5236
+ stateMachine: params.stateMachine,
5061
5237
  animations: params.animations,
5062
5238
  stateMachines: params.stateMachines,
5063
5239
  artboard: params.artboard,
@@ -5124,7 +5300,7 @@ var Rive = /** @class */ (function () {
5124
5300
  // Initializes the Rive object either from constructor or load()
5125
5301
  Rive.prototype.init = function (_a) {
5126
5302
  var _this = this;
5127
- var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
5303
+ var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, stateMachine = _a.stateMachine, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d, tabIndex = _a.tabIndex, semanticsMode = _a.semanticsMode, semanticsOptions = _a.semanticsOptions;
5128
5304
  if (this.destroyed) {
5129
5305
  return;
5130
5306
  }
@@ -5138,10 +5314,12 @@ var Rive = /** @class */ (function () {
5138
5314
  if (!this.src && !this.buffer && !this.riveFile) {
5139
5315
  throw new RiveError(Rive.missingErrorMessage);
5140
5316
  }
5141
- // List of animations that should be initialized.
5142
- var startingAnimationNames = mapToStringArray(animations);
5143
- // List of state machines that should be initialized
5144
- var startingStateMachineNames = mapToStringArray(stateMachines);
5317
+ // Names of the animations and state machines that should be initialized
5318
+ var _e = resolveStartingPlayback({
5319
+ stateMachine: stateMachine,
5320
+ animations: animations,
5321
+ stateMachines: stateMachines,
5322
+ }), startingAnimationNames = _e.startingAnimationNames, startingStateMachineNames = _e.startingStateMachineNames;
5145
5323
  // Ensure loaded is marked as false if loading new file
5146
5324
  this.loaded = false;
5147
5325
  this.readyForPlaying = false;
@@ -5858,6 +6036,7 @@ var Rive = /** @class */ (function () {
5858
6036
  * might happen.
5859
6037
  */
5860
6038
  Rive.prototype.cleanupInstances = function () {
6039
+ var _a;
5861
6040
  if (this.eventCleanup !== null) {
5862
6041
  this.eventCleanup();
5863
6042
  }
@@ -5865,8 +6044,9 @@ var Rive = /** @class */ (function () {
5865
6044
  // Tear down semantics before deleting state machines — the overlay's action
5866
6045
  // closures point at instances that stop() is about to free.
5867
6046
  this.cleanupSemantics();
5868
- // Delete all animation and state machine instances
5869
- this.stop();
6047
+ // Delete all animation and state machine instances synchronously via the
6048
+ // animator
6049
+ (_a = this.animator) === null || _a === void 0 ? void 0 : _a.stop();
5870
6050
  if (this.artboard) {
5871
6051
  this.artboard.delete();
5872
6052
  this.artboard = null;
@@ -5899,29 +6079,58 @@ var Rive = /** @class */ (function () {
5899
6079
  * Returns a string from a given text run node name, or undefined if the text run
5900
6080
  * cannot be queried.
5901
6081
  *
6082
+ * @deprecated Text run APIs are deprecated: use data binding instead. See
6083
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
6084
+ * for how to migrate.
5902
6085
  * @param textRunName - Name of the text run node associated with a text object
5903
6086
  * @returns - String value of the text run node or undefined
5904
6087
  */
5905
6088
  Rive.prototype.getTextRunValue = function (textRunName) {
6089
+ warnOnce(textRunsDeprecationWarning);
5906
6090
  var textRun = this.retrieveTextRun(textRunName);
5907
6091
  return textRun ? textRun.text : undefined;
5908
6092
  };
5909
6093
  /**
5910
6094
  * Sets a text value for a given text run node name if possible
5911
6095
  *
6096
+ * @deprecated Text run APIs are deprecated: use data binding instead. See
6097
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
6098
+ * for how to migrate.
5912
6099
  * @param textRunName - Name of the text run node associated with a text object
5913
6100
  * @param textRunValue - String value to set on the text run node
5914
6101
  */
5915
6102
  Rive.prototype.setTextRunValue = function (textRunName, textRunValue) {
6103
+ warnOnce(textRunsDeprecationWarning);
5916
6104
  var textRun = this.retrieveTextRun(textRunName);
5917
6105
  if (textRun) {
5918
6106
  textRun.text = textRunValue;
5919
6107
  }
5920
6108
  };
5921
- // Plays specified animations; if none specified, it unpauses everything.
6109
+ /**
6110
+ * Warns when playback-control names match linear animations in the
6111
+ * Animator's instanced context; state machine playback remain supported.
6112
+ *
6113
+ * Remove for v3 release
6114
+ */
6115
+ Rive.prototype.warnIfLinearAnimationNames = function (names, methodName) {
6116
+ if (this.animator &&
6117
+ this.animator.animations.some(function (a) { return names.includes(a.name); })) {
6118
+ warnDeprecatedAnimationNames(methodName);
6119
+ }
6120
+ };
6121
+ /**
6122
+ * Plays specified animations or state machines; if none specified, it
6123
+ * unpauses everything.
6124
+ * @param animationNames Animation or state machine name(s) to play.
6125
+ *
6126
+ * Deprecated usage: passing linear animation names (control playback with a
6127
+ * state machine instead) and passing an array of names (this parameter
6128
+ * becomes a single string in the next major version).
6129
+ */
5922
6130
  Rive.prototype.play = function (animationNames, autoplay) {
5923
6131
  var _this = this;
5924
- animationNames = mapToStringArray(animationNames);
6132
+ warnIfNamesArray(animationNames, "play");
6133
+ var names = mapToStringArray(animationNames);
5925
6134
  // If the file's not loaded, queue up the play
5926
6135
  if (!this.readyForPlaying) {
5927
6136
  this.taskQueue.add({
@@ -5929,7 +6138,8 @@ var Rive = /** @class */ (function () {
5929
6138
  });
5930
6139
  return;
5931
6140
  }
5932
- this.animator.play(animationNames);
6141
+ this.animator.play(names);
6142
+ this.warnIfLinearAnimationNames(names, "play");
5933
6143
  this.syncSemanticsOnStateMachines();
5934
6144
  if (this.eventCleanup) {
5935
6145
  this.eventCleanup();
@@ -5938,10 +6148,19 @@ var Rive = /** @class */ (function () {
5938
6148
  this.setupRiveListeners();
5939
6149
  this.startRendering();
5940
6150
  };
5941
- // Pauses specified animations; if none specified, pauses all.
6151
+ /**
6152
+ * Pauses specified animations or state machines; if none specified, pauses
6153
+ * all.
6154
+ * @param animationNames Animation or state machine name(s) to pause.
6155
+ *
6156
+ * Deprecated usage: passing linear animation names (control playback with a
6157
+ * state machine instead) and passing an array of names (this parameter
6158
+ * becomes a single string in the next major version).
6159
+ */
5942
6160
  Rive.prototype.pause = function (animationNames) {
5943
6161
  var _this = this;
5944
- animationNames = mapToStringArray(animationNames);
6162
+ warnIfNamesArray(animationNames, "pause");
6163
+ var names = mapToStringArray(animationNames);
5945
6164
  // If the file's not loaded, early out, nothing to pause
5946
6165
  if (!this.readyForPlaying) {
5947
6166
  this.taskQueue.add({
@@ -5953,11 +6172,20 @@ var Rive = /** @class */ (function () {
5953
6172
  this.eventCleanup();
5954
6173
  }
5955
6174
  this.cleanupKeyboardInteractions();
5956
- this.animator.pause(animationNames);
6175
+ this.animator.pause(names);
6176
+ this.warnIfLinearAnimationNames(names, "pause");
5957
6177
  };
6178
+ /**
6179
+ * Scrubs specified animations to the given time; if none specified, scrubs
6180
+ * all of them.
6181
+ * @deprecated `scrub()` will be removed in a future major version: use a
6182
+ * state machine to control playback instead
6183
+ */
5958
6184
  Rive.prototype.scrub = function (animationNames, value) {
5959
6185
  var _this = this;
5960
- animationNames = mapToStringArray(animationNames);
6186
+ warnOnce("`scrub()` is deprecated and will be removed in a future major version: " +
6187
+ "use a state machine to control playback instead.");
6188
+ var names = mapToStringArray(animationNames);
5961
6189
  // If the file's not loaded, early out, nothing to pause
5962
6190
  if (!this.readyForPlaying) {
5963
6191
  this.taskQueue.add({
@@ -5967,13 +6195,22 @@ var Rive = /** @class */ (function () {
5967
6195
  }
5968
6196
  // Scrub the animation time; we draw a single frame here so that if
5969
6197
  // nothing's currently playing, the scrubbed animation is still rendered/
5970
- this.animator.scrub(animationNames, value || 0);
6198
+ this.animator.scrub(names, value || 0);
5971
6199
  this.drawFrame();
5972
6200
  };
5973
- // Stops specified animations; if none specifies, stops them all.
6201
+ /**
6202
+ * Stops specified animations or state machines; if none specified, stops
6203
+ * them all.
6204
+ * @param animationNames Animation or state machine name(s) to stop.
6205
+ *
6206
+ * Deprecated usage: passing linear animation names (control playback with a
6207
+ * state machine instead) and passing an array of names (this parameter
6208
+ * becomes a single string in the next major version).
6209
+ */
5974
6210
  Rive.prototype.stop = function (animationNames) {
5975
6211
  var _this = this;
5976
- animationNames = mapToStringArray(animationNames);
6212
+ warnIfNamesArray(animationNames, "stop");
6213
+ var names = mapToStringArray(animationNames);
5977
6214
  // If the file's not loaded, early out, nothing to pause
5978
6215
  if (!this.readyForPlaying) {
5979
6216
  this.taskQueue.add({
@@ -5981,9 +6218,10 @@ var Rive = /** @class */ (function () {
5981
6218
  });
5982
6219
  return;
5983
6220
  }
6221
+ this.warnIfLinearAnimationNames(names, "stop");
5984
6222
  // If there is no artboard, this.animator will be undefined
5985
6223
  if (this.animator) {
5986
- this.animator.stop(animationNames);
6224
+ this.animator.stop(names);
5987
6225
  }
5988
6226
  if (this.eventCleanup) {
5989
6227
  this.eventCleanup();
@@ -5994,8 +6232,7 @@ var Rive = /** @class */ (function () {
5994
6232
  /**
5995
6233
  * Resets the animation
5996
6234
  * @param artboard the name of the artboard, or default if none given
5997
- * @param animations the names of animations for playback
5998
- * @param stateMachines the names of state machines for playback
6235
+ * @param stateMachine the name of the state machine for playback
5999
6236
  * @param autoplay whether to autoplay when reset, defaults to false
6000
6237
  *
6001
6238
  */
@@ -6003,15 +6240,22 @@ var Rive = /** @class */ (function () {
6003
6240
  var _a, _b;
6004
6241
  // Get the current artboard, animations, state machines, and playback states
6005
6242
  var artBoardName = params === null || params === void 0 ? void 0 : params.artboard;
6006
- var animationNames = mapToStringArray(params === null || params === void 0 ? void 0 : params.animations);
6007
- var stateMachineNames = mapToStringArray(params === null || params === void 0 ? void 0 : params.stateMachines);
6243
+ var _c = resolveStartingPlayback({
6244
+ stateMachine: params === null || params === void 0 ? void 0 : params.stateMachine,
6245
+ animations: params === null || params === void 0 ? void 0 : params.animations,
6246
+ stateMachines: params === null || params === void 0 ? void 0 : params.stateMachines,
6247
+ }), animationNames = _c.startingAnimationNames, stateMachineNames = _c.startingStateMachineNames;
6008
6248
  var autoplay = (_a = params === null || params === void 0 ? void 0 : params.autoplay) !== null && _a !== void 0 ? _a : false;
6009
6249
  var autoBind = (_b = params === null || params === void 0 ? void 0 : params.autoBind) !== null && _b !== void 0 ? _b : false;
6010
6250
  // Stop everything and clean up
6011
6251
  this.cleanupInstances();
6012
6252
  // Reinitialize an artboard instance with the state
6013
6253
  this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay, autoBind);
6014
- this.taskQueue.process();
6254
+ // Only drain the task queue once playback commands can execute; tasks
6255
+ // queued before then re-add themselves in a loop.
6256
+ if (this.readyForPlaying) {
6257
+ this.taskQueue.process();
6258
+ }
6015
6259
  };
6016
6260
  // Loads a new Rive file, keeping listeners in place
6017
6261
  Rive.prototype.load = function (params) {
@@ -6166,11 +6410,18 @@ var Rive = /** @class */ (function () {
6166
6410
  });
6167
6411
  /**
6168
6412
  * Returns the inputs for the specified instanced state machine, or an empty
6169
- * list if the name is invalid or the state machine is not instanced
6413
+ * list if the name is invalid or the state machine is not instanced. Returns
6414
+ * undefined if the file is not loaded yet.
6415
+ *
6416
+ * @deprecated State machine inputs are deprecated: use data binding
6417
+ * properties instead. See
6418
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
6419
+ * for how to migrate.
6170
6420
  * @param name the state machine name
6171
- * @returns the inputs for the named state machine
6421
+ * @returns the inputs for the named state machine or undefined
6172
6422
  */
6173
6423
  Rive.prototype.stateMachineInputs = function (name) {
6424
+ warnOnce(stateMachineInputsDeprecationWarning);
6174
6425
  // If the file's not loaded, early out, nothing to pause
6175
6426
  if (!this.loaded) {
6176
6427
  return;
@@ -6197,11 +6448,16 @@ var Rive = /** @class */ (function () {
6197
6448
  };
6198
6449
  /**
6199
6450
  * Set the boolean input with the provided name at the given path with value
6451
+ * @deprecated State machine inputs are deprecated: use data binding
6452
+ * properties instead. See
6453
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
6454
+ * for how to migrate.
6200
6455
  * @param input the state machine input name
6201
6456
  * @param value the value to set the input to
6202
6457
  * @param path the path the input is located at an artboard level
6203
6458
  */
6204
6459
  Rive.prototype.setBooleanStateAtPath = function (inputName, value, path) {
6460
+ warnOnce(stateMachineInputsDeprecationWarning);
6205
6461
  var input = this.retrieveInputAtPath(inputName, path);
6206
6462
  if (!input)
6207
6463
  return;
@@ -6214,11 +6470,16 @@ var Rive = /** @class */ (function () {
6214
6470
  };
6215
6471
  /**
6216
6472
  * Set the number input with the provided name at the given path with value
6473
+ * @deprecated State machine inputs are deprecated: use data binding
6474
+ * properties instead. See
6475
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
6476
+ * for how to migrate.
6217
6477
  * @param input the state machine input name
6218
6478
  * @param value the value to set the input to
6219
6479
  * @param path the path the input is located at an artboard level
6220
6480
  */
6221
6481
  Rive.prototype.setNumberStateAtPath = function (inputName, value, path) {
6482
+ warnOnce(stateMachineInputsDeprecationWarning);
6222
6483
  var input = this.retrieveInputAtPath(inputName, path);
6223
6484
  if (!input)
6224
6485
  return;
@@ -6231,10 +6492,15 @@ var Rive = /** @class */ (function () {
6231
6492
  };
6232
6493
  /**
6233
6494
  * Fire the trigger with the provided name at the given path
6495
+ * @deprecated State machine inputs are deprecated: use data binding
6496
+ * properties instead. See
6497
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#state-machine-inputs}
6498
+ * for how to migrate.
6234
6499
  * @param input the state machine input name
6235
6500
  * @param path the path the input is located at an artboard level
6236
6501
  */
6237
6502
  Rive.prototype.fireStateAtPath = function (inputName, path) {
6503
+ warnOnce(stateMachineInputsDeprecationWarning);
6238
6504
  var input = this.retrieveInputAtPath(inputName, path);
6239
6505
  if (!input)
6240
6506
  return;
@@ -6282,8 +6548,13 @@ var Rive = /** @class */ (function () {
6282
6548
  *
6283
6549
  * @remarks
6284
6550
  * If the text run cannot be found at the specified path, a warning will be logged to the console.
6551
+ *
6552
+ * @deprecated Text run APIs are deprecated: use data binding instead. See
6553
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
6554
+ * for how to migrate.
6285
6555
  */
6286
6556
  Rive.prototype.getTextRunValueAtPath = function (textName, path) {
6557
+ warnOnce(textRunsDeprecationWarning);
6287
6558
  var run = this.retrieveTextAtPath(textName, path);
6288
6559
  if (!run) {
6289
6560
  console.warn("Could not get text with name: '".concat(textName, "', at path:'").concat(path, "'"));
@@ -6308,8 +6579,13 @@ var Rive = /** @class */ (function () {
6308
6579
  *
6309
6580
  * @remarks
6310
6581
  * If the text run cannot be found at the specified path, a warning will be logged to the console.
6582
+ *
6583
+ * @deprecated Text run APIs are deprecated: use data binding instead. See
6584
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide#updating-text-runs-at-runtime}
6585
+ * for how to migrate.
6311
6586
  */
6312
6587
  Rive.prototype.setTextRunValueAtPath = function (textName, value, path) {
6588
+ warnOnce(textRunsDeprecationWarning);
6313
6589
  var run = this.retrieveTextAtPath(textName, path);
6314
6590
  if (!run) {
6315
6591
  console.warn("Could not set text with name: '".concat(textName, "', at path:'").concat(path, "'"));
@@ -6418,10 +6694,26 @@ var Rive = /** @class */ (function () {
6418
6694
  });
6419
6695
  /**
6420
6696
  * Subscribe to Rive-generated events
6697
+ *
6698
+ * Note: subscribing to {@link EventType.RiveEvent},
6699
+ * {@link EventType.StateChange}, or {@link EventType.Loop} is deprecated;
6700
+ * use data binding instead. See
6701
+ * {@link https://rive.app/docs/runtimes/web/rive-events} (Rive Events) and
6702
+ * {@link https://rive.app/docs/editor/data-binding/migration-guide} for how
6703
+ * to migrate Rive graphics to a data binding workflow instead.
6421
6704
  * @param type the type of event to subscribe to
6422
6705
  * @param callback callback to fire when the event occurs
6423
6706
  */
6424
6707
  Rive.prototype.on = function (type, callback) {
6708
+ if (type === EventType.RiveEvent) {
6709
+ warnOnce(riveEventsDeprecationWarning);
6710
+ }
6711
+ else if (type === EventType.StateChange) {
6712
+ warnOnce(stateChangeEventsDeprecationWarning);
6713
+ }
6714
+ else if (type === EventType.Loop) {
6715
+ warnOnce(loopEventsDeprecationWarning);
6716
+ }
6425
6717
  this.eventManager.add({
6426
6718
  type: type,
6427
6719
  callback: callback,