<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Generated by Construct, the game and app creator :: https://www.construct.net
"use strict";
(function(a,b){"object"===typeof exports&amp;&amp;"undefined"!==typeof module?b(exports):"function"===typeof define&amp;&amp;define.amd?define(["exports"],b):(a="undefined"!==typeof globalThis?globalThis:a||self,b(a.glMatrix={}))})(this,function(a){function b(f,g,l){var n=g[0],r=g[1],t=g[2];g=g[3];var u=l[0],w=l[1],y=l[2];l=l[3];f[0]=n*u+t*w;f[1]=r*u+g*w;f[2]=n*y+t*l;f[3]=r*y+g*l;return f}function d(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];f[3]=g[3]-l[3];return f}function c(f,g,l){var n=g[0],r=g[1],t=
g[2],u=g[3],w=g[4];g=g[5];var y=l[0],z=l[1],B=l[2],F=l[3],I=l[4];l=l[5];f[0]=n*y+t*z;f[1]=r*y+u*z;f[2]=n*B+t*F;f[3]=r*B+u*F;f[4]=n*I+t*l+w;f[5]=r*I+u*l+g;return f}function e(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];f[3]=g[3]-l[3];f[4]=g[4]-l[4];f[5]=g[5]-l[5];return f}function h(){var f=new U(9);U!=Float32Array&amp;&amp;(f[1]=0,f[2]=0,f[3]=0,f[5]=0,f[6]=0,f[7]=0);f[0]=1;f[4]=1;f[8]=1;return f}function k(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7];g=g[8];var F=l[0],I=l[1],
H=l[2],M=l[3],N=l[4],K=l[5],Q=l[6],P=l[7];l=l[8];f[0]=F*n+I*u+H*z;f[1]=F*r+I*w+H*B;f[2]=F*t+I*y+H*g;f[3]=M*n+N*u+K*z;f[4]=M*r+N*w+K*B;f[5]=M*t+N*y+K*g;f[6]=Q*n+P*u+l*z;f[7]=Q*r+P*w+l*B;f[8]=Q*t+P*y+l*g;return f}function m(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];f[3]=g[3]-l[3];f[4]=g[4]-l[4];f[5]=g[5]-l[5];f[6]=g[6]-l[6];f[7]=g[7]-l[7];f[8]=g[8]-l[8];return f}function p(f){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=
1;return f}function q(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7],F=g[8],I=g[9],H=g[10],M=g[11],N=g[12],K=g[13],Q=g[14];g=g[15];var P=l[0],S=l[1],T=l[2],R=l[3];f[0]=P*n+S*w+T*F+R*N;f[1]=P*r+S*y+T*I+R*K;f[2]=P*t+S*z+T*H+R*Q;f[3]=P*u+S*B+T*M+R*g;P=l[4];S=l[5];T=l[6];R=l[7];f[4]=P*n+S*w+T*F+R*N;f[5]=P*r+S*y+T*I+R*K;f[6]=P*t+S*z+T*H+R*Q;f[7]=P*u+S*B+T*M+R*g;P=l[8];S=l[9];T=l[10];R=l[11];f[8]=P*n+S*w+T*F+R*N;f[9]=P*r+S*y+T*I+R*K;f[10]=P*t+S*z+T*H+R*Q;f[11]=P*u+S*B+T*M+R*g;P=l[12];
S=l[13];T=l[14];R=l[15];f[12]=P*n+S*w+T*F+R*N;f[13]=P*r+S*y+T*I+R*K;f[14]=P*t+S*z+T*H+R*Q;f[15]=P*u+S*B+T*M+R*g;return f}function v(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=n+n,y=r+r,z=t+t;g=n*w;var B=n*y;n*=z;var F=r*y;r*=z;t*=z;w*=u;y*=u;u*=z;f[0]=1-(F+t);f[1]=B+u;f[2]=n-y;f[3]=0;f[4]=B-u;f[5]=1-(g+t);f[6]=r+w;f[7]=0;f[8]=n+y;f[9]=r-w;f[10]=1-(g+F);f[11]=0;f[12]=l[0];f[13]=l[1];f[14]=l[2];f[15]=1;return f}function x(f,g){f[0]=g[12];f[1]=g[13];f[2]=g[14];return f}function A(f,g){var l=g[4],n=g[5],
r=g[6],t=g[8],u=g[9],w=g[10];f[0]=Math.hypot(g[0],g[1],g[2]);f[1]=Math.hypot(l,n,r);f[2]=Math.hypot(t,u,w);return f}function C(f,g){var l=new U(3);A(l,g);var n=1/l[0],r=1/l[1],t=1/l[2],u=g[0]*n;l=g[1]*r;var w=g[2]*t,y=g[4]*n,z=g[5]*r,B=g[6]*t;n*=g[8];r*=g[9];g=g[10]*t;t=u+z+g;0&lt;t?(u=2*Math.sqrt(t+1),f[3]=.25*u,f[0]=(B-r)/u,f[1]=(n-w)/u,f[2]=(l-y)/u):u&gt;z&amp;&amp;u&gt;g?(u=2*Math.sqrt(1+u-z-g),f[3]=(B-r)/u,f[0]=.25*u,f[1]=(l+y)/u,f[2]=(n+w)/u):z&gt;g?(u=2*Math.sqrt(1+z-u-g),f[3]=(n-w)/u,f[0]=(l+y)/u,f[1]=.25*u,
f[2]=(B+r)/u):(u=2*Math.sqrt(1+g-u-z),f[3]=(l-y)/u,f[0]=(n+w)/u,f[1]=(B+r)/u,f[2]=.25*u);return f}function D(f,g,l,n,r){g=1/Math.tan(g/2);f[0]=g/l;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=g;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[11]=-1;f[12]=0;f[13]=0;f[15]=0;null!=r&amp;&amp;Infinity!==r?(l=1/(n-r),f[10]=(r+n)*l,f[14]=2*r*n*l):(f[10]=-1,f[14]=-2*n);return f}function G(f,g,l,n,r,t,u){var w=1/(g-l),y=1/(n-r),z=1/(t-u);f[0]=-2*w;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*y;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=2*z;f[11]=0;f[12]=(g+l)*
w;f[13]=(r+n)*y;f[14]=(u+t)*z;f[15]=1;return f}function E(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];f[3]=g[3]-l[3];f[4]=g[4]-l[4];f[5]=g[5]-l[5];f[6]=g[6]-l[6];f[7]=g[7]-l[7];f[8]=g[8]-l[8];f[9]=g[9]-l[9];f[10]=g[10]-l[10];f[11]=g[11]-l[11];f[12]=g[12]-l[12];f[13]=g[13]-l[13];f[14]=g[14]-l[14];f[15]=g[15]-l[15];return f}function J(){var f=new U(3);U!=Float32Array&amp;&amp;(f[0]=0,f[1]=0,f[2]=0);return f}function L(f){return Math.hypot(f[0],f[1],f[2])}function O(f,g,l){var n=new U(3);n[0]=f;n[1]=
g;n[2]=l;return n}function V(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];return f}function W(f,g,l){f[0]=g[0]*l[0];f[1]=g[1]*l[1];f[2]=g[2]*l[2];return f}function ca(f,g,l){f[0]=g[0]/l[0];f[1]=g[1]/l[1];f[2]=g[2]/l[2];return f}function la(f,g){return Math.hypot(g[0]-f[0],g[1]-f[1],g[2]-f[2])}function ma(f,g){var l=g[0]-f[0],n=g[1]-f[1];f=g[2]-f[2];return l*l+n*n+f*f}function za(f){var g=f[0],l=f[1];f=f[2];return g*g+l*l+f*f}function Aa(f,g){var l=g[0],n=g[1],r=g[2];l=l*l+n*n+r*r;0&lt;l&amp;&amp;(l=1/
Math.sqrt(l));f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;return f}function oa(f,g){return f[0]*g[0]+f[1]*g[1]+f[2]*g[2]}function pa(f,g,l){var n=g[0],r=g[1];g=g[2];var t=l[0],u=l[1];l=l[2];f[0]=r*l-g*u;f[1]=g*t-n*l;f[2]=n*u-r*t;return f}function Ba(){var f=new U(4);U!=Float32Array&amp;&amp;(f[0]=0,f[1]=0,f[2]=0,f[3]=0);return f}function Ca(f){var g=new U(4);g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];return g}function Da(f,g,l,n){var r=new U(4);r[0]=f;r[1]=g;r[2]=l;r[3]=n;return r}function qa(f,g){f[0]=g[0];f[1]=g[1];
f[2]=g[2];f[3]=g[3];return f}function Ea(f,g,l,n,r){f[0]=g;f[1]=l;f[2]=n;f[3]=r;return f}function Fa(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];return f}function Ga(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];f[2]=g[2]-l[2];f[3]=g[3]-l[3];return f}function Ha(f,g,l){f[0]=g[0]*l[0];f[1]=g[1]*l[1];f[2]=g[2]*l[2];f[3]=g[3]*l[3];return f}function Ia(f,g,l){f[0]=g[0]/l[0];f[1]=g[1]/l[1];f[2]=g[2]/l[2];f[3]=g[3]/l[3];return f}function ua(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=
g[3]*l;return f}function Ja(f,g){return Math.hypot(g[0]-f[0],g[1]-f[1],g[2]-f[2],g[3]-f[3])}function Ka(f,g){var l=g[0]-f[0],n=g[1]-f[1],r=g[2]-f[2];f=g[3]-f[3];return l*l+n*n+r*r+f*f}function ja(f){return Math.hypot(f[0],f[1],f[2],f[3])}function ia(f){var g=f[0],l=f[1],n=f[2];f=f[3];return g*g+l*l+n*n+f*f}function ra(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=l*l+n*n+r*r+g*g;0&lt;t&amp;&amp;(t=1/Math.sqrt(t));f[0]=l*t;f[1]=n*t;f[2]=r*t;f[3]=g*t;return f}function ka(f,g){return f[0]*g[0]+f[1]*g[1]+f[2]*g[2]+
f[3]*g[3]}function La(f,g,l,n){var r=g[0],t=g[1],u=g[2];g=g[3];f[0]=r+n*(l[0]-r);f[1]=t+n*(l[1]-t);f[2]=u+n*(l[2]-u);f[3]=g+n*(l[3]-g);return f}function Ma(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===g[3]}function sa(){var f=new U(4);U!=Float32Array&amp;&amp;(f[0]=0,f[1]=0,f[2]=0);f[3]=1;return f}function Na(f,g,l){l*=.5;var n=Math.sin(l);f[0]=n*g[0];f[1]=n*g[1];f[2]=n*g[2];f[3]=Math.cos(l);return f}function Oa(f,g,l){var n=g[0],r=g[1],t=g[2];g=g[3];var u=l[0],w=l[1],y=l[2];l=l[3];f[0]=n*l+
g*u+r*y-t*w;f[1]=r*l+g*w+t*u-n*y;f[2]=t*l+g*y+n*w-r*u;f[3]=g*l-n*u-r*w-t*y;return f}function Pa(f,g,l){l*=.5;var n=g[0],r=g[1],t=g[2];g=g[3];var u=Math.sin(l);l=Math.cos(l);f[0]=n*l+g*u;f[1]=r*l+t*u;f[2]=t*l-r*u;f[3]=g*l-n*u;return f}function Qa(f,g,l){l*=.5;var n=g[0],r=g[1],t=g[2];g=g[3];var u=Math.sin(l);l=Math.cos(l);f[0]=n*l-t*u;f[1]=r*l+g*u;f[2]=t*l+n*u;f[3]=g*l-r*u;return f}function Ra(f,g,l){l*=.5;var n=g[0],r=g[1],t=g[2];g=g[3];var u=Math.sin(l);l=Math.cos(l);f[0]=n*l+r*u;f[1]=r*l-n*u;f[2]=
t*l+g*u;f[3]=g*l-t*u;return f}function Sa(f,g){var l=g[0],n=g[1],r=g[2],t=Math.sqrt(l*l+n*n+r*r);g=Math.exp(g[3]);var u=0&lt;t?g*Math.sin(t)/t:0;f[0]=l*u;f[1]=n*u;f[2]=r*u;f[3]=g*Math.cos(t);return f}function Ta(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=Math.sqrt(l*l+n*n+r*r);t=0&lt;t?Math.atan2(t,g)/t:0;f[0]=l*t;f[1]=n*t;f[2]=r*t;f[3]=.5*Math.log(l*l+n*n+r*r+g*g);return f}function ta(f,g,l,n){var r=g[0],t=g[1],u=g[2];g=g[3];var w=l[0],y=l[1],z=l[2];l=l[3];var B=r*w+t*y+u*z+g*l;0&gt;B&amp;&amp;(B=-B,w=-w,y=-y,z=
-z,l=-l);if(1E-6&lt;1-B){var F=Math.acos(B);var I=Math.sin(F);B=Math.sin((1-n)*F)/I;n=Math.sin(n*F)/I}else B=1-n;f[0]=B*r+n*w;f[1]=B*t+n*y;f[2]=B*u+n*z;f[3]=B*g+n*l;return f}function Ua(f,g){var l=g[0]+g[4]+g[8];if(0&lt;l)l=Math.sqrt(l+1),f[3]=.5*l,l=.5/l,f[0]=(g[5]-g[7])*l,f[1]=(g[6]-g[2])*l,f[2]=(g[1]-g[3])*l;else{var n=0;g[4]&gt;g[0]&amp;&amp;(n=1);g[8]&gt;g[3*n+n]&amp;&amp;(n=2);var r=(n+1)%3,t=(n+2)%3;l=Math.sqrt(g[3*n+n]-g[3*r+r]-g[3*t+t]+1);f[n]=.5*l;l=.5/l;f[3]=(g[3*r+t]-g[3*t+r])*l;f[r]=(g[3*r+n]+g[3*n+r])*l;f[t]=(g[3*
t+n]+g[3*n+t])*l}return f}function Va(f,g,l){var n=.5*l[0],r=.5*l[1];l=.5*l[2];var t=g[0],u=g[1],w=g[2];g=g[3];f[0]=t;f[1]=u;f[2]=w;f[3]=g;f[4]=n*g+r*w-l*u;f[5]=r*g+l*t-n*w;f[6]=l*g+n*u-r*t;f[7]=-n*t-r*u-l*w;return f}function Wa(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];f[4]=g[4];f[5]=g[5];f[6]=g[6];f[7]=g[7];return f}function Xa(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=l[4],y=l[5],z=l[6],B=l[7],F=g[4],I=g[5],H=g[6];g=g[7];var M=l[0],N=l[1],K=l[2];l=l[3];f[0]=n*l+u*M+r*K-t*N;f[1]=r*l+u*N+t*M-n*
K;f[2]=t*l+u*K+n*N-r*M;f[3]=u*l-n*M-r*N-t*K;f[4]=n*B+u*w+r*z-t*y+F*l+g*M+I*K-H*N;f[5]=r*B+u*y+t*w-n*z+I*l+g*N+H*M-F*K;f[6]=t*B+u*z+n*y-r*w+H*l+g*K+F*N-I*M;f[7]=u*B-n*w-r*y-t*z+g*l-F*M-I*N-H*K;return f}function Ya(){var f=new U(2);U!=Float32Array&amp;&amp;(f[0]=0,f[1]=0);return f}function Za(f,g,l){f[0]=g[0]-l[0];f[1]=g[1]-l[1];return f}function $a(f,g,l){f[0]=g[0]*l[0];f[1]=g[1]*l[1];return f}function ab(f,g,l){f[0]=g[0]/l[0];f[1]=g[1]/l[1];return f}function bb(f,g){return Math.hypot(g[0]-f[0],g[1]-f[1])}
function cb(f,g){var l=g[0]-f[0];f=g[1]-f[1];return l*l+f*f}function db(f){return Math.hypot(f[0],f[1])}function eb(f){var g=f[0];f=f[1];return g*g+f*f}var U="undefined"!==typeof Float32Array?Float32Array:Array,ha=Math.random,hb=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var f=0,g=arguments.length;g--;)f+=arguments[g]*arguments[g];return Math.sqrt(f)});var ib=Object.freeze({__proto__:null,EPSILON:1E-6,get ARRAY_TYPE(){return U},RANDOM:ha,ANGLE_ORDER:"zyx",setMatrixArrayType:function(f){U=
f},toRadian:function(f){return f*hb},equals:function(f,g){return Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))}}),jb=Object.freeze({__proto__:null,create:function(){var f=new U(4);U!=Float32Array&amp;&amp;(f[1]=0,f[2]=0);f[0]=1;f[3]=1;return f},clone:function(f){var g=new U(4);g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];return g},copy:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=1;return f},fromValues:function(f,g,l,n){var r=new U(4);
r[0]=f;r[1]=g;r[2]=l;r[3]=n;return r},set:function(f,g,l,n,r){f[0]=g;f[1]=l;f[2]=n;f[3]=r;return f},transpose:function(f,g){if(f===g){var l=g[1];f[1]=g[2];f[2]=l}else f[0]=g[0],f[1]=g[2],f[2]=g[1],f[3]=g[3];return f},invert:function(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=l*g-r*n;if(!t)return null;t=1/t;f[0]=g*t;f[1]=-n*t;f[2]=-r*t;f[3]=l*t;return f},adjoint:function(f,g){var l=g[0];f[0]=g[3];f[1]=-g[1];f[2]=-g[2];f[3]=l;return f},determinant:function(f){return f[0]*f[3]-f[2]*f[1]},multiply:b,
rotate:function(f,g,l){var n=g[0],r=g[1],t=g[2];g=g[3];var u=Math.sin(l);l=Math.cos(l);f[0]=n*l+t*u;f[1]=r*l+g*u;f[2]=n*-u+t*l;f[3]=r*-u+g*l;return f},scale:function(f,g,l){var n=g[1],r=g[2],t=g[3],u=l[0];l=l[1];f[0]=g[0]*u;f[1]=n*u;f[2]=r*l;f[3]=t*l;return f},fromRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=g;f[1]=l;f[2]=-l;f[3]=g;return f},fromScaling:function(f,g){f[0]=g[0];f[1]=0;f[2]=0;f[3]=g[1];return f},str:function(f){return"mat2("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},frob:function(f){return Math.hypot(f[0],
f[1],f[2],f[3])},LDU:function(f,g,l,n){f[2]=n[2]/n[0];l[0]=n[0];l[1]=n[1];l[3]=n[3]-f[2]*l[1];return[f,g,l]},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];return f},subtract:d,exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===g[3]},equals:function(f,g){var l=f[0],n=f[1],r=f[2];f=f[3];var t=g[0],u=g[1],w=g[2];g=g[3];return Math.abs(l-t)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(t))&amp;&amp;Math.abs(n-u)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(u))&amp;&amp;
Math.abs(r-w)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(w))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},multiplyScalar:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=g[3]*l;return f},multiplyScalarAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;f[3]=g[3]+l[3]*n;return f},mul:b,sub:d}),kb=Object.freeze({__proto__:null,create:function(){var f=new U(6);U!=Float32Array&amp;&amp;(f[1]=0,f[2]=0,f[4]=0,f[5]=0);f[0]=1;f[3]=1;return f},clone:function(f){var g=new U(6);
g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];g[4]=f[4];g[5]=f[5];return g},copy:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];f[4]=g[4];f[5]=g[5];return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=1;f[4]=0;f[5]=0;return f},fromValues:function(f,g,l,n,r,t){var u=new U(6);u[0]=f;u[1]=g;u[2]=l;u[3]=n;u[4]=r;u[5]=t;return u},set:function(f,g,l,n,r,t,u){f[0]=g;f[1]=l;f[2]=n;f[3]=r;f[4]=t;f[5]=u;return f},invert:function(f,g){var l=g[0],n=g[1],r=g[2],t=g[3],u=g[4];g=g[5];var w=l*t-n*r;if(!w)return null;
w=1/w;f[0]=t*w;f[1]=-n*w;f[2]=-r*w;f[3]=l*w;f[4]=(r*g-t*u)*w;f[5]=(n*u-l*g)*w;return f},determinant:function(f){return f[0]*f[3]-f[1]*f[2]},multiply:c,rotate:function(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=g[4];g=g[5];var y=Math.sin(l);l=Math.cos(l);f[0]=n*l+t*y;f[1]=r*l+u*y;f[2]=n*-y+t*l;f[3]=r*-y+u*l;f[4]=w;f[5]=g;return f},scale:function(f,g,l){var n=g[1],r=g[2],t=g[3],u=g[4],w=g[5],y=l[0];l=l[1];f[0]=g[0]*y;f[1]=n*y;f[2]=r*l;f[3]=t*l;f[4]=u;f[5]=w;return f},translate:function(f,g,l){var n=g[0],
r=g[1],t=g[2],u=g[3],w=g[4];g=g[5];var y=l[0];l=l[1];f[0]=n;f[1]=r;f[2]=t;f[3]=u;f[4]=n*y+t*l+w;f[5]=r*y+u*l+g;return f},fromRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=g;f[1]=l;f[2]=-l;f[3]=g;f[4]=0;f[5]=0;return f},fromScaling:function(f,g){f[0]=g[0];f[1]=0;f[2]=0;f[3]=g[1];f[4]=0;f[5]=0;return f},fromTranslation:function(f,g){f[0]=1;f[1]=0;f[2]=0;f[3]=1;f[4]=g[0];f[5]=g[1];return f},str:function(f){return"mat2d("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+")"},frob:function(f){return Math.hypot(f[0],
f[1],f[2],f[3],f[4],f[5],1)},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];f[4]=g[4]+l[4];f[5]=g[5]+l[5];return f},subtract:e,multiplyScalar:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=g[3]*l;f[4]=g[4]*l;f[5]=g[5]*l;return f},multiplyScalarAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;f[3]=g[3]+l[3]*n;f[4]=g[4]+l[4]*n;f[5]=g[5]+l[5]*n;return f},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===
g[3]&amp;&amp;f[4]===g[4]&amp;&amp;f[5]===g[5]},equals:function(f,g){var l=f[0],n=f[1],r=f[2],t=f[3],u=f[4];f=f[5];var w=g[0],y=g[1],z=g[2],B=g[3],F=g[4];g=g[5];return Math.abs(l-w)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(w))&amp;&amp;Math.abs(n-y)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(y))&amp;&amp;Math.abs(r-z)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(z))&amp;&amp;Math.abs(t-B)&lt;=1E-6*Math.max(1,Math.abs(t),Math.abs(B))&amp;&amp;Math.abs(u-F)&lt;=1E-6*Math.max(1,Math.abs(u),Math.abs(F))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},mul:c,sub:e}),
lb=Object.freeze({__proto__:null,create:h,fromMat4:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[4];f[4]=g[5];f[5]=g[6];f[6]=g[8];f[7]=g[9];f[8]=g[10];return f},clone:function(f){var g=new U(9);g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];g[4]=f[4];g[5]=f[5];g[6]=f[6];g[7]=f[7];g[8]=f[8];return g},copy:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];f[4]=g[4];f[5]=g[5];f[6]=g[6];f[7]=g[7];f[8]=g[8];return f},fromValues:function(f,g,l,n,r,t,u,w,y){var z=new U(9);z[0]=f;z[1]=g;z[2]=l;z[3]=n;z[4]=
r;z[5]=t;z[6]=u;z[7]=w;z[8]=y;return z},set:function(f,g,l,n,r,t,u,w,y,z){f[0]=g;f[1]=l;f[2]=n;f[3]=r;f[4]=t;f[5]=u;f[6]=w;f[7]=y;f[8]=z;return f},identity:function(f){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=1;f[5]=0;f[6]=0;f[7]=0;f[8]=1;return f},transpose:function(f,g){if(f===g){var l=g[1],n=g[2],r=g[5];f[1]=g[3];f[2]=g[6];f[3]=l;f[5]=g[7];f[6]=n;f[7]=r}else f[0]=g[0],f[1]=g[3],f[2]=g[6],f[3]=g[1],f[4]=g[4],f[5]=g[7],f[6]=g[2],f[7]=g[5],f[8]=g[8];return f},invert:function(f,g){var l=g[0],n=g[1],r=g[2],
t=g[3],u=g[4],w=g[5],y=g[6],z=g[7];g=g[8];var B=g*u-w*z,F=-g*t+w*y,I=z*t-u*y,H=l*B+n*F+r*I;if(!H)return null;H=1/H;f[0]=B*H;f[1]=(-g*n+r*z)*H;f[2]=(w*n-r*u)*H;f[3]=F*H;f[4]=(g*l-r*y)*H;f[5]=(-w*l+r*t)*H;f[6]=I*H;f[7]=(-z*l+n*y)*H;f[8]=(u*l-n*t)*H;return f},adjoint:function(f,g){var l=g[0],n=g[1],r=g[2],t=g[3],u=g[4],w=g[5],y=g[6],z=g[7];g=g[8];f[0]=u*g-w*z;f[1]=r*z-n*g;f[2]=n*w-r*u;f[3]=w*y-t*g;f[4]=l*g-r*y;f[5]=r*t-l*w;f[6]=t*z-u*y;f[7]=n*y-l*z;f[8]=l*u-n*t;return f},determinant:function(f){var g=
f[3],l=f[4],n=f[5],r=f[6],t=f[7],u=f[8];return f[0]*(u*l-n*t)+f[1]*(-u*g+n*r)+f[2]*(t*g-l*r)},multiply:k,translate:function(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7];g=g[8];var F=l[0];l=l[1];f[0]=n;f[1]=r;f[2]=t;f[3]=u;f[4]=w;f[5]=y;f[6]=F*n+l*u+z;f[7]=F*r+l*w+B;f[8]=F*t+l*y+g;return f},rotate:function(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7];g=g[8];var F=Math.sin(l);l=Math.cos(l);f[0]=l*n+F*u;f[1]=l*r+F*w;f[2]=l*t+F*y;f[3]=l*u-F*n;f[4]=l*w-F*r;f[5]=
l*y-F*t;f[6]=z;f[7]=B;f[8]=g;return f},scale:function(f,g,l){var n=l[0];l=l[1];f[0]=n*g[0];f[1]=n*g[1];f[2]=n*g[2];f[3]=l*g[3];f[4]=l*g[4];f[5]=l*g[5];f[6]=g[6];f[7]=g[7];f[8]=g[8];return f},fromTranslation:function(f,g){f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=1;f[5]=0;f[6]=g[0];f[7]=g[1];f[8]=1;return f},fromRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=g;f[1]=l;f[2]=0;f[3]=-l;f[4]=g;f[5]=0;f[6]=0;f[7]=0;f[8]=1;return f},fromScaling:function(f,g){f[0]=g[0];f[1]=0;f[2]=0;f[3]=0;f[4]=g[1];f[5]=
0;f[6]=0;f[7]=0;f[8]=1;return f},fromMat2d:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=0;f[3]=g[2];f[4]=g[3];f[5]=0;f[6]=g[4];f[7]=g[5];f[8]=1;return f},fromQuat:function(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=l+l,u=n+n,w=r+r;l*=t;var y=n*t;n*=u;var z=r*t,B=r*u;r*=w;t*=g;u*=g;g*=w;f[0]=1-n-r;f[3]=y-g;f[6]=z+u;f[1]=y+g;f[4]=1-l-r;f[7]=B-t;f[2]=z-u;f[5]=B+t;f[8]=1-l-n;return f},normalFromMat4:function(f,g){var l=g[0],n=g[1],r=g[2],t=g[3],u=g[4],w=g[5],y=g[6],z=g[7],B=g[8],F=g[9],I=g[10],H=g[11],M=g[12],
N=g[13],K=g[14];g=g[15];var Q=l*w-n*u,P=l*y-r*u,S=l*z-t*u,T=n*y-r*w,R=n*z-t*w,X=r*z-t*y,Y=B*N-F*M,Z=B*K-I*M;B=B*g-H*M;var aa=F*K-I*N;F=F*g-H*N;I=I*g-H*K;H=Q*I-P*F+S*aa+T*B-R*Z+X*Y;if(!H)return null;H=1/H;f[0]=(w*I-y*F+z*aa)*H;f[1]=(y*B-u*I-z*Z)*H;f[2]=(u*F-w*B+z*Y)*H;f[3]=(r*F-n*I-t*aa)*H;f[4]=(l*I-r*B+t*Z)*H;f[5]=(n*B-l*F-t*Y)*H;f[6]=(N*X-K*R+g*T)*H;f[7]=(K*S-M*X-g*P)*H;f[8]=(M*R-N*S+g*Q)*H;return f},projection:function(f,g,l){f[0]=2/g;f[1]=0;f[2]=0;f[3]=0;f[4]=-2/l;f[5]=0;f[6]=-1;f[7]=1;f[8]=1;
return f},str:function(f){return"mat3("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+", "+f[8]+")"},frob:function(f){return Math.hypot(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8])},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];f[4]=g[4]+l[4];f[5]=g[5]+l[5];f[6]=g[6]+l[6];f[7]=g[7]+l[7];f[8]=g[8]+l[8];return f},subtract:m,multiplyScalar:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=g[3]*l;f[4]=g[4]*l;f[5]=g[5]*l;f[6]=g[6]*
l;f[7]=g[7]*l;f[8]=g[8]*l;return f},multiplyScalarAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;f[3]=g[3]+l[3]*n;f[4]=g[4]+l[4]*n;f[5]=g[5]+l[5]*n;f[6]=g[6]+l[6]*n;f[7]=g[7]+l[7]*n;f[8]=g[8]+l[8]*n;return f},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===g[3]&amp;&amp;f[4]===g[4]&amp;&amp;f[5]===g[5]&amp;&amp;f[6]===g[6]&amp;&amp;f[7]===g[7]&amp;&amp;f[8]===g[8]},equals:function(f,g){var l=f[0],n=f[1],r=f[2],t=f[3],u=f[4],w=f[5],y=f[6],z=f[7];f=f[8];var B=g[0],F=g[1],I=g[2],
H=g[3],M=g[4],N=g[5],K=g[6],Q=g[7];g=g[8];return Math.abs(l-B)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(B))&amp;&amp;Math.abs(n-F)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(F))&amp;&amp;Math.abs(r-I)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(I))&amp;&amp;Math.abs(t-H)&lt;=1E-6*Math.max(1,Math.abs(t),Math.abs(H))&amp;&amp;Math.abs(u-M)&lt;=1E-6*Math.max(1,Math.abs(u),Math.abs(M))&amp;&amp;Math.abs(w-N)&lt;=1E-6*Math.max(1,Math.abs(w),Math.abs(N))&amp;&amp;Math.abs(y-K)&lt;=1E-6*Math.max(1,Math.abs(y),Math.abs(K))&amp;&amp;Math.abs(z-Q)&lt;=1E-6*Math.max(1,Math.abs(z),Math.abs(Q))&amp;&amp;
Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},mul:k,sub:m}),mb=Object.freeze({__proto__:null,create:function(){var f=new U(16);U!=Float32Array&amp;&amp;(f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0);f[0]=1;f[5]=1;f[10]=1;f[15]=1;return f},clone:function(f){var g=new U(16);g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];g[4]=f[4];g[5]=f[5];g[6]=f[6];g[7]=f[7];g[8]=f[8];g[9]=f[9];g[10]=f[10];g[11]=f[11];g[12]=f[12];g[13]=f[13];g[14]=f[14];g[15]=f[15];return g},
copy:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];f[4]=g[4];f[5]=g[5];f[6]=g[6];f[7]=g[7];f[8]=g[8];f[9]=g[9];f[10]=g[10];f[11]=g[11];f[12]=g[12];f[13]=g[13];f[14]=g[14];f[15]=g[15];return f},fromValues:function(f,g,l,n,r,t,u,w,y,z,B,F,I,H,M,N){var K=new U(16);K[0]=f;K[1]=g;K[2]=l;K[3]=n;K[4]=r;K[5]=t;K[6]=u;K[7]=w;K[8]=y;K[9]=z;K[10]=B;K[11]=F;K[12]=I;K[13]=H;K[14]=M;K[15]=N;return K},set:function(f,g,l,n,r,t,u,w,y,z,B,F,I,H,M,N,K){f[0]=g;f[1]=l;f[2]=n;f[3]=r;f[4]=t;f[5]=u;f[6]=w;f[7]=y;
f[8]=z;f[9]=B;f[10]=F;f[11]=I;f[12]=H;f[13]=M;f[14]=N;f[15]=K;return f},identity:p,transpose:function(f,g){if(f===g){var l=g[1],n=g[2],r=g[3],t=g[6],u=g[7],w=g[11];f[1]=g[4];f[2]=g[8];f[3]=g[12];f[4]=l;f[6]=g[9];f[7]=g[13];f[8]=n;f[9]=t;f[11]=g[14];f[12]=r;f[13]=u;f[14]=w}else f[0]=g[0],f[1]=g[4],f[2]=g[8],f[3]=g[12],f[4]=g[1],f[5]=g[5],f[6]=g[9],f[7]=g[13],f[8]=g[2],f[9]=g[6],f[10]=g[10],f[11]=g[14],f[12]=g[3],f[13]=g[7],f[14]=g[11],f[15]=g[15];return f},invert:function(f,g){var l=g[0],n=g[1],r=
g[2],t=g[3],u=g[4],w=g[5],y=g[6],z=g[7],B=g[8],F=g[9],I=g[10],H=g[11],M=g[12],N=g[13],K=g[14];g=g[15];var Q=l*w-n*u,P=l*y-r*u,S=l*z-t*u,T=n*y-r*w,R=n*z-t*w,X=r*z-t*y,Y=B*N-F*M,Z=B*K-I*M,aa=B*g-H*M,da=F*K-I*N,ea=F*g-H*N,fa=I*g-H*K,ba=Q*fa-P*ea+S*da+T*aa-R*Z+X*Y;if(!ba)return null;ba=1/ba;f[0]=(w*fa-y*ea+z*da)*ba;f[1]=(r*ea-n*fa-t*da)*ba;f[2]=(N*X-K*R+g*T)*ba;f[3]=(I*R-F*X-H*T)*ba;f[4]=(y*aa-u*fa-z*Z)*ba;f[5]=(l*fa-r*aa+t*Z)*ba;f[6]=(K*S-M*X-g*P)*ba;f[7]=(B*X-I*S+H*P)*ba;f[8]=(u*ea-w*aa+z*Y)*ba;f[9]=
(n*aa-l*ea-t*Y)*ba;f[10]=(M*R-N*S+g*Q)*ba;f[11]=(F*S-B*R-H*Q)*ba;f[12]=(w*Z-u*da-y*Y)*ba;f[13]=(l*da-n*Z+r*Y)*ba;f[14]=(N*P-M*T-K*Q)*ba;f[15]=(B*T-F*P+I*Q)*ba;return f},adjoint:function(f,g){var l=g[0],n=g[1],r=g[2],t=g[3],u=g[4],w=g[5],y=g[6],z=g[7],B=g[8],F=g[9],I=g[10],H=g[11],M=g[12],N=g[13],K=g[14];g=g[15];var Q=l*w-n*u,P=l*y-r*u,S=l*z-t*u,T=n*y-r*w,R=n*z-t*w,X=r*z-t*y,Y=B*N-F*M,Z=B*K-I*M,aa=B*g-H*M,da=F*K-I*N,ea=F*g-H*N,fa=I*g-H*K;f[0]=w*fa-y*ea+z*da;f[1]=r*ea-n*fa-t*da;f[2]=N*X-K*R+g*T;f[3]=
I*R-F*X-H*T;f[4]=y*aa-u*fa-z*Z;f[5]=l*fa-r*aa+t*Z;f[6]=K*S-M*X-g*P;f[7]=B*X-I*S+H*P;f[8]=u*ea-w*aa+z*Y;f[9]=n*aa-l*ea-t*Y;f[10]=M*R-N*S+g*Q;f[11]=F*S-B*R-H*Q;f[12]=w*Z-u*da-y*Y;f[13]=l*da-n*Z+r*Y;f[14]=N*P-M*T-K*Q;f[15]=B*T-F*P+I*Q;return f},determinant:function(f){var g=f[0],l=f[1],n=f[2],r=f[4],t=f[5],u=f[6],w=f[8],y=f[9],z=f[10],B=f[12],F=f[13],I=f[14],H=g*t-l*r,M=g*u-n*r,N=l*u-n*t,K=w*F-y*B,Q=w*I-z*B,P=y*I-z*F;return f[7]*(g*P-l*Q+n*K)-f[3]*(r*P-t*Q+u*K)+f[15]*(w*N-y*M+z*H)-f[11]*(B*N-F*M+I*H)},
multiply:q,translate:function(f,g,l){var n=l[0],r=l[1];l=l[2];if(g===f)f[12]=g[0]*n+g[4]*r+g[8]*l+g[12],f[13]=g[1]*n+g[5]*r+g[9]*l+g[13],f[14]=g[2]*n+g[6]*r+g[10]*l+g[14],f[15]=g[3]*n+g[7]*r+g[11]*l+g[15];else{var t=g[0];var u=g[1];var w=g[2];var y=g[3];var z=g[4];var B=g[5];var F=g[6];var I=g[7];var H=g[8];var M=g[9];var N=g[10];var K=g[11];f[0]=t;f[1]=u;f[2]=w;f[3]=y;f[4]=z;f[5]=B;f[6]=F;f[7]=I;f[8]=H;f[9]=M;f[10]=N;f[11]=K;f[12]=t*n+z*r+H*l+g[12];f[13]=u*n+B*r+M*l+g[13];f[14]=w*n+F*r+N*l+g[14];
f[15]=y*n+I*r+K*l+g[15]}return f},scale:function(f,g,l){var n=l[0],r=l[1];l=l[2];f[0]=g[0]*n;f[1]=g[1]*n;f[2]=g[2]*n;f[3]=g[3]*n;f[4]=g[4]*r;f[5]=g[5]*r;f[6]=g[6]*r;f[7]=g[7]*r;f[8]=g[8]*l;f[9]=g[9]*l;f[10]=g[10]*l;f[11]=g[11]*l;f[12]=g[12];f[13]=g[13];f[14]=g[14];f[15]=g[15];return f},rotate:function(f,g,l,n){var r=n[0],t=n[1];n=n[2];var u=Math.hypot(r,t,n);if(1E-6&gt;u)return null;u=1/u;r*=u;t*=u;n*=u;var w=Math.sin(l);var y=Math.cos(l);var z=1-y;l=g[0];u=g[1];var B=g[2];var F=g[3];var I=g[4];var H=
g[5];var M=g[6];var N=g[7];var K=g[8];var Q=g[9];var P=g[10];var S=g[11];var T=r*r*z+y;var R=t*r*z+n*w;var X=n*r*z-t*w;var Y=r*t*z-n*w;var Z=t*t*z+y;var aa=n*t*z+r*w;var da=r*n*z+t*w;r=t*n*z-r*w;t=n*n*z+y;f[0]=l*T+I*R+K*X;f[1]=u*T+H*R+Q*X;f[2]=B*T+M*R+P*X;f[3]=F*T+N*R+S*X;f[4]=l*Y+I*Z+K*aa;f[5]=u*Y+H*Z+Q*aa;f[6]=B*Y+M*Z+P*aa;f[7]=F*Y+N*Z+S*aa;f[8]=l*da+I*r+K*t;f[9]=u*da+H*r+Q*t;f[10]=B*da+M*r+P*t;f[11]=F*da+N*r+S*t;g!==f&amp;&amp;(f[12]=g[12],f[13]=g[13],f[14]=g[14],f[15]=g[15]);return f},rotateX:function(f,
g,l){var n=Math.sin(l);l=Math.cos(l);var r=g[4],t=g[5],u=g[6],w=g[7],y=g[8],z=g[9],B=g[10],F=g[11];g!==f&amp;&amp;(f[0]=g[0],f[1]=g[1],f[2]=g[2],f[3]=g[3],f[12]=g[12],f[13]=g[13],f[14]=g[14],f[15]=g[15]);f[4]=r*l+y*n;f[5]=t*l+z*n;f[6]=u*l+B*n;f[7]=w*l+F*n;f[8]=y*l-r*n;f[9]=z*l-t*n;f[10]=B*l-u*n;f[11]=F*l-w*n;return f},rotateY:function(f,g,l){var n=Math.sin(l);l=Math.cos(l);var r=g[0],t=g[1],u=g[2],w=g[3],y=g[8],z=g[9],B=g[10],F=g[11];g!==f&amp;&amp;(f[4]=g[4],f[5]=g[5],f[6]=g[6],f[7]=g[7],f[12]=g[12],f[13]=g[13],
f[14]=g[14],f[15]=g[15]);f[0]=r*l-y*n;f[1]=t*l-z*n;f[2]=u*l-B*n;f[3]=w*l-F*n;f[8]=r*n+y*l;f[9]=t*n+z*l;f[10]=u*n+B*l;f[11]=w*n+F*l;return f},rotateZ:function(f,g,l){var n=Math.sin(l);l=Math.cos(l);var r=g[0],t=g[1],u=g[2],w=g[3],y=g[4],z=g[5],B=g[6],F=g[7];g!==f&amp;&amp;(f[8]=g[8],f[9]=g[9],f[10]=g[10],f[11]=g[11],f[12]=g[12],f[13]=g[13],f[14]=g[14],f[15]=g[15]);f[0]=r*l+y*n;f[1]=t*l+z*n;f[2]=u*l+B*n;f[3]=w*l+F*n;f[4]=y*l-r*n;f[5]=z*l-t*n;f[6]=B*l-u*n;f[7]=F*l-w*n;return f},fromTranslation:function(f,g){f[0]=
1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=g[0];f[13]=g[1];f[14]=g[2];f[15]=1;return f},fromScaling:function(f,g){f[0]=g[0];f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=g[1];f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=g[2];f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromRotation:function(f,g,l){var n=l[0],r=l[1];l=l[2];var t=Math.hypot(n,r,l);if(1E-6&gt;t)return null;t=1/t;n*=t;r*=t;l*=t;t=Math.sin(g);g=Math.cos(g);var u=1-g;f[0]=n*n*u+g;f[1]=r*n*u+l*t;f[2]=l*n*u-r*t;f[3]=
0;f[4]=n*r*u-l*t;f[5]=r*r*u+g;f[6]=l*r*u+n*t;f[7]=0;f[8]=n*l*u+r*t;f[9]=r*l*u-n*t;f[10]=l*l*u+g;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromXRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=1;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=g;f[6]=l;f[7]=0;f[8]=0;f[9]=-l;f[10]=g;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromYRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=g;f[1]=0;f[2]=-l;f[3]=0;f[4]=0;f[5]=1;f[6]=0;f[7]=0;f[8]=l;f[9]=0;f[10]=g;f[11]=0;f[12]=0;f[13]=0;f[14]=
0;f[15]=1;return f},fromZRotation:function(f,g){var l=Math.sin(g);g=Math.cos(g);f[0]=g;f[1]=l;f[2]=0;f[3]=0;f[4]=-l;f[5]=g;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=1;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},fromRotationTranslation:v,fromQuat2:function(f,g){var l=new U(3),n=-g[0],r=-g[1],t=-g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7],F=n*n+r*r+t*t+u*u;0&lt;F?(l[0]=2*(w*u+B*n+y*t-z*r)/F,l[1]=2*(y*u+B*r+z*n-w*t)/F,l[2]=2*(z*u+B*t+w*r-y*n)/F):(l[0]=2*(w*u+B*n+y*t-z*r),l[1]=2*(y*u+B*r+z*n-w*t),l[2]=2*(z*u+
B*t+w*r-y*n));v(f,g,l);return f},getTranslation:x,getScaling:A,getRotation:C,decompose:function(f,g,l,n){g[0]=n[12];g[1]=n[13];g[2]=n[14];var r=n[0],t=n[1],u=n[2],w=n[4],y=n[5],z=n[6],B=n[8];g=n[9];n=n[10];l[0]=Math.hypot(r,t,u);l[1]=Math.hypot(w,y,z);l[2]=Math.hypot(B,g,n);var F=1/l[0],I=1/l[1],H=1/l[2];l=r*F;t*=I;u*=H;w*=F;y*=I;z*=H;B*=F;g*=I;n*=H;I=l+y+n;0&lt;I?(n=2*Math.sqrt(I+1),f[3]=.25*n,f[0]=(z-g)/n,f[1]=(B-u)/n,f[2]=(t-w)/n):l&gt;y&amp;&amp;l&gt;n?(n=2*Math.sqrt(1+l-y-n),f[3]=(z-g)/n,f[0]=.25*n,f[1]=(t+w)/
n,f[2]=(B+u)/n):y&gt;n?(n=2*Math.sqrt(1+y-l-n),f[3]=(B-u)/n,f[0]=(t+w)/n,f[1]=.25*n,f[2]=(z+g)/n):(n=2*Math.sqrt(1+n-l-y),f[3]=(t-w)/n,f[0]=(B+u)/n,f[1]=(z+g)/n,f[2]=.25*n);return f},fromRotationTranslationScale:function(f,g,l,n){var r=g[0],t=g[1],u=g[2],w=g[3],y=r+r,z=t+t,B=u+u;g=r*y;var F=r*z;r*=B;var I=t*z;t*=B;u*=B;y*=w;z*=w;w*=B;B=n[0];var H=n[1];n=n[2];f[0]=(1-(I+u))*B;f[1]=(F+w)*B;f[2]=(r-z)*B;f[3]=0;f[4]=(F-w)*H;f[5]=(1-(g+u))*H;f[6]=(t+y)*H;f[7]=0;f[8]=(r+z)*n;f[9]=(t-y)*n;f[10]=(1-(g+I))*n;
f[11]=0;f[12]=l[0];f[13]=l[1];f[14]=l[2];f[15]=1;return f},fromRotationTranslationScaleOrigin:function(f,g,l,n,r){var t=g[0],u=g[1],w=g[2],y=g[3],z=t+t,B=u+u,F=w+w;g=t*z;var I=t*B,H=t*F;t=u*B;u*=F;var M=w*F;w=y*z;B*=y;var N=y*F,K=n[0],Q=n[1];F=n[2];n=r[0];y=r[1];r=r[2];z=(1-(t+M))*K;var P=(I+N)*K;K*=H-B;I=(I-N)*Q;M=(1-(g+M))*Q;Q*=u+w;H=(H+B)*F;u=(u-w)*F;g=(1-(g+t))*F;f[0]=z;f[1]=P;f[2]=K;f[3]=0;f[4]=I;f[5]=M;f[6]=Q;f[7]=0;f[8]=H;f[9]=u;f[10]=g;f[11]=0;f[12]=l[0]+n-(z*n+I*y+H*r);f[13]=l[1]+y-(P*n+
M*y+u*r);f[14]=l[2]+r-(K*n+Q*y+g*r);f[15]=1;return f},fromQuat:function(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=l+l,u=n+n,w=r+r;l*=t;var y=n*t;n*=u;var z=r*t,B=r*u;r*=w;t*=g;u*=g;g*=w;f[0]=1-n-r;f[1]=y+g;f[2]=z-u;f[3]=0;f[4]=y-g;f[5]=1-l-r;f[6]=B+t;f[7]=0;f[8]=z+u;f[9]=B-t;f[10]=1-l-n;f[11]=0;f[12]=0;f[13]=0;f[14]=0;f[15]=1;return f},frustum:function(f,g,l,n,r,t,u){var w=1/(l-g),y=1/(r-n),z=1/(t-u);f[0]=2*t*w;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=2*t*y;f[6]=0;f[7]=0;f[8]=(l+g)*w;f[9]=(r+n)*y;f[10]=
(u+t)*z;f[11]=-1;f[12]=0;f[13]=0;f[14]=u*t*2*z;f[15]=0;return f},perspectiveNO:D,perspective:D,perspectiveZO:function(f,g,l,n,r){g=1/Math.tan(g/2);f[0]=g/l;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=g;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[11]=-1;f[12]=0;f[13]=0;f[15]=0;null!=r&amp;&amp;Infinity!==r?(l=1/(n-r),f[10]=r*l,f[14]=r*n*l):(f[10]=-1,f[14]=-n);return f},perspectiveFromFieldOfView:function(f,g,l,n){var r=Math.tan(g.upDegrees*Math.PI/180),t=Math.tan(g.downDegrees*Math.PI/180),u=Math.tan(g.leftDegrees*Math.PI/180);g=
Math.tan(g.rightDegrees*Math.PI/180);var w=2/(u+g),y=2/(r+t);f[0]=w;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=y;f[6]=0;f[7]=0;f[8]=-((u-g)*w*.5);f[9]=(r-t)*y*.5;f[10]=n/(l-n);f[11]=-1;f[12]=0;f[13]=0;f[14]=n*l/(l-n);f[15]=0;return f},orthoNO:G,ortho:G,orthoZO:function(f,g,l,n,r,t,u){var w=1/(g-l),y=1/(n-r);u=1/(t-u);f[0]=-2*w;f[1]=0;f[2]=0;f[3]=0;f[4]=0;f[5]=-2*y;f[6]=0;f[7]=0;f[8]=0;f[9]=0;f[10]=u;f[11]=0;f[12]=(g+l)*w;f[13]=(r+n)*y;f[14]=t*u;f[15]=1;return f},lookAt:function(f,g,l,n){var r=g[0],t=g[1];g=
g[2];var u=n[0];var w=n[1];var y=n[2];var z=l[0];n=l[1];var B=l[2];if(1E-6&gt;Math.abs(r-z)&amp;&amp;1E-6&gt;Math.abs(t-n)&amp;&amp;1E-6&gt;Math.abs(g-B))return p(f);l=r-z;n=t-n;z=g-B;var F=1/Math.hypot(l,n,z);l*=F;n*=F;z*=F;B=w*z-y*n;y=y*l-u*z;u=u*n-w*l;(F=Math.hypot(B,y,u))?(F=1/F,B*=F,y*=F,u*=F):u=y=B=0;w=n*u-z*y;var I=z*B-l*u;var H=l*y-n*B;(F=Math.hypot(w,I,H))?(F=1/F,w*=F,I*=F,H*=F):H=I=w=0;f[0]=B;f[1]=w;f[2]=l;f[3]=0;f[4]=y;f[5]=I;f[6]=n;f[7]=0;f[8]=u;f[9]=H;f[10]=z;f[11]=0;f[12]=-(B*r+y*t+u*g);f[13]=-(w*r+I*t+H*g);
f[14]=-(l*r+n*t+z*g);f[15]=1;return f},targetTo:function(f,g,l,n){var r=g[0],t=g[1];g=g[2];var u=n[0],w=n[1],y=n[2];n=r-l[0];var z=t-l[1];l=g-l[2];var B=n*n+z*z+l*l;0&lt;B&amp;&amp;(B=1/Math.sqrt(B),n*=B,z*=B,l*=B);var F=w*l-y*z;y=y*n-u*l;u=u*z-w*n;B=F*F+y*y+u*u;0&lt;B&amp;&amp;(B=1/Math.sqrt(B),F*=B,y*=B,u*=B);f[0]=F;f[1]=y;f[2]=u;f[3]=0;f[4]=z*u-l*y;f[5]=l*F-n*u;f[6]=n*y-z*F;f[7]=0;f[8]=n;f[9]=z;f[10]=l;f[11]=0;f[12]=r;f[13]=t;f[14]=g;f[15]=1;return f},str:function(f){return"mat4("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+
", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+", "+f[8]+", "+f[9]+", "+f[10]+", "+f[11]+", "+f[12]+", "+f[13]+", "+f[14]+", "+f[15]+")"},frob:function(f){return Math.hypot(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];f[4]=g[4]+l[4];f[5]=g[5]+l[5];f[6]=g[6]+l[6];f[7]=g[7]+l[7];f[8]=g[8]+l[8];f[9]=g[9]+l[9];f[10]=g[10]+l[10];f[11]=g[11]+l[11];f[12]=g[12]+l[12];f[13]=g[13]+l[13];f[14]=
g[14]+l[14];f[15]=g[15]+l[15];return f},subtract:E,multiplyScalar:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=g[3]*l;f[4]=g[4]*l;f[5]=g[5]*l;f[6]=g[6]*l;f[7]=g[7]*l;f[8]=g[8]*l;f[9]=g[9]*l;f[10]=g[10]*l;f[11]=g[11]*l;f[12]=g[12]*l;f[13]=g[13]*l;f[14]=g[14]*l;f[15]=g[15]*l;return f},multiplyScalarAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;f[3]=g[3]+l[3]*n;f[4]=g[4]+l[4]*n;f[5]=g[5]+l[5]*n;f[6]=g[6]+l[6]*n;f[7]=g[7]+l[7]*n;f[8]=g[8]+l[8]*n;f[9]=g[9]+l[9]*
n;f[10]=g[10]+l[10]*n;f[11]=g[11]+l[11]*n;f[12]=g[12]+l[12]*n;f[13]=g[13]+l[13]*n;f[14]=g[14]+l[14]*n;f[15]=g[15]+l[15]*n;return f},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===g[3]&amp;&amp;f[4]===g[4]&amp;&amp;f[5]===g[5]&amp;&amp;f[6]===g[6]&amp;&amp;f[7]===g[7]&amp;&amp;f[8]===g[8]&amp;&amp;f[9]===g[9]&amp;&amp;f[10]===g[10]&amp;&amp;f[11]===g[11]&amp;&amp;f[12]===g[12]&amp;&amp;f[13]===g[13]&amp;&amp;f[14]===g[14]&amp;&amp;f[15]===g[15]},equals:function(f,g){var l=f[0],n=f[1],r=f[2],t=f[3],u=f[4],w=f[5],y=f[6],z=f[7],B=f[8],F=f[9],I=f[10],H=f[11],M=f[12],
N=f[13],K=f[14];f=f[15];var Q=g[0],P=g[1],S=g[2],T=g[3],R=g[4],X=g[5],Y=g[6],Z=g[7],aa=g[8],da=g[9],ea=g[10],fa=g[11],ba=g[12],fb=g[13],gb=g[14];g=g[15];return Math.abs(l-Q)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(Q))&amp;&amp;Math.abs(n-P)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(P))&amp;&amp;Math.abs(r-S)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(S))&amp;&amp;Math.abs(t-T)&lt;=1E-6*Math.max(1,Math.abs(t),Math.abs(T))&amp;&amp;Math.abs(u-R)&lt;=1E-6*Math.max(1,Math.abs(u),Math.abs(R))&amp;&amp;Math.abs(w-X)&lt;=1E-6*Math.max(1,Math.abs(w),Math.abs(X))&amp;&amp;
Math.abs(y-Y)&lt;=1E-6*Math.max(1,Math.abs(y),Math.abs(Y))&amp;&amp;Math.abs(z-Z)&lt;=1E-6*Math.max(1,Math.abs(z),Math.abs(Z))&amp;&amp;Math.abs(B-aa)&lt;=1E-6*Math.max(1,Math.abs(B),Math.abs(aa))&amp;&amp;Math.abs(F-da)&lt;=1E-6*Math.max(1,Math.abs(F),Math.abs(da))&amp;&amp;Math.abs(I-ea)&lt;=1E-6*Math.max(1,Math.abs(I),Math.abs(ea))&amp;&amp;Math.abs(H-fa)&lt;=1E-6*Math.max(1,Math.abs(H),Math.abs(fa))&amp;&amp;Math.abs(M-ba)&lt;=1E-6*Math.max(1,Math.abs(M),Math.abs(ba))&amp;&amp;Math.abs(N-fb)&lt;=1E-6*Math.max(1,Math.abs(N),Math.abs(fb))&amp;&amp;Math.abs(K-gb)&lt;=1E-6*Math.max(1,Math.abs(K),
Math.abs(gb))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},mul:q,sub:E}),va=function(){var f=J();return function(g,l,n,r,t,u){l||(l=3);n||(n=0);for(r=r?Math.min(r*l+n,g.length):g.length;n&lt;r;n+=l)f[0]=g[n],f[1]=g[n+1],f[2]=g[n+2],t(f,f,u),g[n]=f[0],g[n+1]=f[1],g[n+2]=f[2];return g}}();va=Object.freeze({__proto__:null,create:J,clone:function(f){var g=new U(3);g[0]=f[0];g[1]=f[1];g[2]=f[2];return g},length:L,fromValues:O,copy:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];return f},set:function(f,
g,l,n){f[0]=g;f[1]=l;f[2]=n;return f},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];return f},subtract:V,multiply:W,divide:ca,ceil:function(f,g){f[0]=Math.ceil(g[0]);f[1]=Math.ceil(g[1]);f[2]=Math.ceil(g[2]);return f},floor:function(f,g){f[0]=Math.floor(g[0]);f[1]=Math.floor(g[1]);f[2]=Math.floor(g[2]);return f},min:function(f,g,l){f[0]=Math.min(g[0],l[0]);f[1]=Math.min(g[1],l[1]);f[2]=Math.min(g[2],l[2]);return f},max:function(f,g,l){f[0]=Math.max(g[0],l[0]);f[1]=Math.max(g[1],
l[1]);f[2]=Math.max(g[2],l[2]);return f},round:function(f,g){f[0]=Math.round(g[0]);f[1]=Math.round(g[1]);f[2]=Math.round(g[2]);return f},scale:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;return f},scaleAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;return f},distance:la,squaredDistance:ma,squaredLength:za,negate:function(f,g){f[0]=-g[0];f[1]=-g[1];f[2]=-g[2];return f},inverse:function(f,g){f[0]=1/g[0];f[1]=1/g[1];f[2]=1/g[2];return f},normalize:Aa,dot:oa,cross:pa,
lerp:function(f,g,l,n){var r=g[0],t=g[1];g=g[2];f[0]=r+n*(l[0]-r);f[1]=t+n*(l[1]-t);f[2]=g+n*(l[2]-g);return f},slerp:function(f,g,l,n){var r=Math.acos(Math.min(Math.max(oa(g,l),-1),1)),t=Math.sin(r),u=Math.sin((1-n)*r)/t;n=Math.sin(n*r)/t;f[0]=u*g[0]+n*l[0];f[1]=u*g[1]+n*l[1];f[2]=u*g[2]+n*l[2];return f},hermite:function(f,g,l,n,r,t){var u=t*t,w=u*(2*t-3)+1,y=u*(t-2)+t,z=u*(t-1);t=u*(3-2*t);f[0]=g[0]*w+l[0]*y+n[0]*z+r[0]*t;f[1]=g[1]*w+l[1]*y+n[1]*z+r[1]*t;f[2]=g[2]*w+l[2]*y+n[2]*z+r[2]*t;return f},
bezier:function(f,g,l,n,r,t){var u=1-t,w=u*u,y=t*t,z=w*u;w*=3*t;u*=3*y;t*=y;f[0]=g[0]*z+l[0]*w+n[0]*u+r[0]*t;f[1]=g[1]*z+l[1]*w+n[1]*u+r[1]*t;f[2]=g[2]*z+l[2]*w+n[2]*u+r[2]*t;return f},random:function(f,g){g=g||1;var l=2*ha()*Math.PI,n=2*ha()-1,r=Math.sqrt(1-n*n)*g;f[0]=Math.cos(l)*r;f[1]=Math.sin(l)*r;f[2]=n*g;return f},transformMat4:function(f,g,l){var n=g[0],r=g[1];g=g[2];var t=l[3]*n+l[7]*r+l[11]*g+l[15];t=t||1;f[0]=(l[0]*n+l[4]*r+l[8]*g+l[12])/t;f[1]=(l[1]*n+l[5]*r+l[9]*g+l[13])/t;f[2]=(l[2]*
n+l[6]*r+l[10]*g+l[14])/t;return f},transformMat3:function(f,g,l){var n=g[0],r=g[1];g=g[2];f[0]=n*l[0]+r*l[3]+g*l[6];f[1]=n*l[1]+r*l[4]+g*l[7];f[2]=n*l[2]+r*l[5]+g*l[8];return f},transformQuat:function(f,g,l){var n=l[0],r=l[1],t=l[2],u=g[0],w=g[1];g=g[2];var y=r*g-t*w,z=t*u-n*g,B=n*w-r*u;l=2*l[3];f[0]=u+y*l+2*(r*B-t*z);f[1]=w+z*l+2*(t*y-n*B);f[2]=g+B*l+2*(n*z-r*y);return f},rotateX:function(f,g,l,n){var r=[],t=[];r[0]=g[0]-l[0];r[1]=g[1]-l[1];r[2]=g[2]-l[2];t[0]=r[0];t[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n);
t[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n);f[0]=t[0]+l[0];f[1]=t[1]+l[1];f[2]=t[2]+l[2];return f},rotateY:function(f,g,l,n){var r=[],t=[];r[0]=g[0]-l[0];r[1]=g[1]-l[1];r[2]=g[2]-l[2];t[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n);t[1]=r[1];t[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n);f[0]=t[0]+l[0];f[1]=t[1]+l[1];f[2]=t[2]+l[2];return f},rotateZ:function(f,g,l,n){var r=[],t=[];r[0]=g[0]-l[0];r[1]=g[1]-l[1];r[2]=g[2]-l[2];t[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n);t[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n);t[2]=r[2];f[0]=t[0]+
l[0];f[1]=t[1]+l[1];f[2]=t[2]+l[2];return f},angle:function(f,g){var l=f[0],n=f[1],r=f[2],t=g[0],u=g[1],w=g[2];f=(l=Math.sqrt((l*l+n*n+r*r)*(t*t+u*u+w*w)))&amp;&amp;oa(f,g)/l;return Math.acos(Math.min(Math.max(f,-1),1))},zero:function(f){f[0]=0;f[1]=0;f[2]=0;return f},str:function(f){return"vec3("+f[0]+", "+f[1]+", "+f[2]+")"},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]},equals:function(f,g){var l=f[0],n=f[1];f=f[2];var r=g[0],t=g[1];g=g[2];return Math.abs(l-r)&lt;=1E-6*Math.max(1,
Math.abs(l),Math.abs(r))&amp;&amp;Math.abs(n-t)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(t))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},sub:V,mul:W,div:ca,dist:la,sqrDist:ma,len:L,sqrLen:za,forEach:va});var wa=function(){var f=Ba();return function(g,l,n,r,t,u){l||(l=4);n||(n=0);for(r=r?Math.min(r*l+n,g.length):g.length;n&lt;r;n+=l)f[0]=g[n],f[1]=g[n+1],f[2]=g[n+2],f[3]=g[n+3],t(f,f,u),g[n]=f[0],g[n+1]=f[1],g[n+2]=f[2],g[n+3]=f[3];return g}}();wa=Object.freeze({__proto__:null,create:Ba,clone:Ca,fromValues:Da,
copy:qa,set:Ea,add:Fa,subtract:Ga,multiply:Ha,divide:Ia,ceil:function(f,g){f[0]=Math.ceil(g[0]);f[1]=Math.ceil(g[1]);f[2]=Math.ceil(g[2]);f[3]=Math.ceil(g[3]);return f},floor:function(f,g){f[0]=Math.floor(g[0]);f[1]=Math.floor(g[1]);f[2]=Math.floor(g[2]);f[3]=Math.floor(g[3]);return f},min:function(f,g,l){f[0]=Math.min(g[0],l[0]);f[1]=Math.min(g[1],l[1]);f[2]=Math.min(g[2],l[2]);f[3]=Math.min(g[3],l[3]);return f},max:function(f,g,l){f[0]=Math.max(g[0],l[0]);f[1]=Math.max(g[1],l[1]);f[2]=Math.max(g[2],
l[2]);f[3]=Math.max(g[3],l[3]);return f},round:function(f,g){f[0]=Math.round(g[0]);f[1]=Math.round(g[1]);f[2]=Math.round(g[2]);f[3]=Math.round(g[3]);return f},scale:ua,scaleAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;f[2]=g[2]+l[2]*n;f[3]=g[3]+l[3]*n;return f},distance:Ja,squaredDistance:Ka,length:ja,squaredLength:ia,negate:function(f,g){f[0]=-g[0];f[1]=-g[1];f[2]=-g[2];f[3]=-g[3];return f},inverse:function(f,g){f[0]=1/g[0];f[1]=1/g[1];f[2]=1/g[2];f[3]=1/g[3];return f},normalize:ra,
dot:ka,cross:function(f,g,l,n){var r=l[0]*n[1]-l[1]*n[0],t=l[0]*n[2]-l[2]*n[0],u=l[0]*n[3]-l[3]*n[0],w=l[1]*n[2]-l[2]*n[1],y=l[1]*n[3]-l[3]*n[1];l=l[2]*n[3]-l[3]*n[2];n=g[0];var z=g[1],B=g[2];g=g[3];f[0]=z*l-B*y+g*w;f[1]=-(n*l)+B*u-g*t;f[2]=n*y-z*u+g*r;f[3]=-(n*w)+z*t-B*r;return f},lerp:La,random:function(f,g){g=g||1;do{var l=2*ha()-1;var n=2*ha()-1;var r=l*l+n*n}while(1&lt;=r);do{var t=2*ha()-1;var u=2*ha()-1;var w=t*t+u*u}while(1&lt;=w);r=Math.sqrt((1-r)/w);f[0]=g*l;f[1]=g*n;f[2]=g*t*r;f[3]=g*u*r;return f},
transformMat4:function(f,g,l){var n=g[0],r=g[1],t=g[2];g=g[3];f[0]=l[0]*n+l[4]*r+l[8]*t+l[12]*g;f[1]=l[1]*n+l[5]*r+l[9]*t+l[13]*g;f[2]=l[2]*n+l[6]*r+l[10]*t+l[14]*g;f[3]=l[3]*n+l[7]*r+l[11]*t+l[15]*g;return f},transformQuat:function(f,g,l){var n=g[0],r=g[1],t=g[2],u=l[0],w=l[1],y=l[2];l=l[3];var z=l*n+w*t-y*r,B=l*r+y*n-u*t,F=l*t+u*r-w*n;n=-u*n-w*r-y*t;f[0]=z*l+n*-u+B*-y-F*-w;f[1]=B*l+n*-w+F*-u-z*-y;f[2]=F*l+n*-y+z*-w-B*-u;f[3]=g[3];return f},zero:function(f){f[0]=0;f[1]=0;f[2]=0;f[3]=0;return f},
str:function(f){return"vec4("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},exactEquals:Ma,equals:function(f,g){var l=f[0],n=f[1],r=f[2];f=f[3];var t=g[0],u=g[1],w=g[2];g=g[3];return Math.abs(l-t)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(t))&amp;&amp;Math.abs(n-u)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(u))&amp;&amp;Math.abs(r-w)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(w))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},sub:Ga,mul:Ha,div:Ia,dist:Ja,sqrDist:Ka,len:ja,sqrLen:ia,forEach:wa});var xa=function(){var f=J(),
g=O(1,0,0),l=O(0,1,0);return function(n,r,t){var u=oa(r,t);if(-.999999&gt;u)return pa(f,g,r),1E-6&gt;L(f)&amp;&amp;pa(f,l,r),Aa(f,f),Na(n,f,Math.PI),n;if(.999999&lt;u)return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n;pa(f,r,t);n[0]=f[0];n[1]=f[1];n[2]=f[2];n[3]=1+u;return ra(n,n)}}(),ya=function(){var f=sa(),g=sa();return function(l,n,r,t,u,w){ta(f,n,u,w);ta(g,r,t,w);ta(l,f,g,2*w*(1-w));return l}}(),na=function(){var f=h();return function(g,l,n,r){f[0]=n[0];f[3]=n[1];f[6]=n[2];f[1]=r[0];f[4]=r[1];f[7]=r[2];f[2]=-l[0];f[5]=-l[1];
f[8]=-l[2];return ra(g,Ua(g,f))}}();xa=Object.freeze({__proto__:null,create:sa,identity:function(f){f[0]=0;f[1]=0;f[2]=0;f[3]=1;return f},setAxisAngle:Na,getAxisAngle:function(f,g){var l=2*Math.acos(g[3]),n=Math.sin(l/2);1E-6&lt;n?(f[0]=g[0]/n,f[1]=g[1]/n,f[2]=g[2]/n):(f[0]=1,f[1]=0,f[2]=0);return l},getAngle:function(f,g){f=ka(f,g);return Math.acos(2*f*f-1)},multiply:Oa,rotateX:Pa,rotateY:Qa,rotateZ:Ra,calculateW:function(f,g){var l=g[0],n=g[1];g=g[2];f[0]=l;f[1]=n;f[2]=g;f[3]=Math.sqrt(Math.abs(1-
l*l-n*n-g*g));return f},exp:Sa,ln:Ta,pow:function(f,g,l){Ta(f,g);ua(f,f,l);Sa(f,f);return f},slerp:ta,random:function(f){var g=ha(),l=ha(),n=ha(),r=Math.sqrt(1-g);g=Math.sqrt(g);f[0]=r*Math.sin(2*Math.PI*l);f[1]=r*Math.cos(2*Math.PI*l);f[2]=g*Math.sin(2*Math.PI*n);f[3]=g*Math.cos(2*Math.PI*n);return f},invert:function(f,g){var l=g[0],n=g[1],r=g[2];g=g[3];var t=l*l+n*n+r*r+g*g;t=t?1/t:0;f[0]=-l*t;f[1]=-n*t;f[2]=-r*t;f[3]=g*t;return f},conjugate:function(f,g){f[0]=-g[0];f[1]=-g[1];f[2]=-g[2];f[3]=g[3];
return f},fromMat3:Ua,fromEuler:function(f,g,l,n){var r=4&lt;arguments.length&amp;&amp;void 0!==arguments[4]?arguments[4]:"zyx",t=Math.PI/360;g*=t;n*=t;l*=t;t=Math.sin(g);var u=Math.cos(g),w=Math.sin(l),y=Math.cos(l),z=Math.sin(n),B=Math.cos(n);switch(r){case "xyz":f[0]=t*y*B+u*w*z;f[1]=u*w*B-t*y*z;f[2]=u*y*z+t*w*B;f[3]=u*y*B-t*w*z;break;case "xzy":f[0]=t*y*B-u*w*z;f[1]=u*w*B-t*y*z;f[2]=u*y*z+t*w*B;f[3]=u*y*B+t*w*z;break;case "yxz":f[0]=t*y*B+u*w*z;f[1]=u*w*B-t*y*z;f[2]=u*y*z-t*w*B;f[3]=u*y*B+t*w*z;break;case "yzx":f[0]=
t*y*B+u*w*z;f[1]=u*w*B+t*y*z;f[2]=u*y*z-t*w*B;f[3]=u*y*B-t*w*z;break;case "zxy":f[0]=t*y*B-u*w*z;f[1]=u*w*B+t*y*z;f[2]=u*y*z+t*w*B;f[3]=u*y*B-t*w*z;break;case "zyx":f[0]=t*y*B-u*w*z;f[1]=u*w*B+t*y*z;f[2]=u*y*z-t*w*B;f[3]=u*y*B+t*w*z;break;default:throw Error("Unknown angle order "+r);}return f},str:function(f){return"quat("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")"},clone:Ca,fromValues:Da,copy:qa,set:Ea,add:Fa,mul:Oa,scale:ua,dot:ka,lerp:La,length:ja,len:ja,squaredLength:ia,sqrLen:ia,normalize:ra,exactEquals:Ma,
equals:function(f,g){return.999999&lt;=Math.abs(ka(f,g))},rotationTo:xa,sqlerp:ya,setAxes:na});ya=Object.freeze({__proto__:null,create:function(){var f=new U(8);U!=Float32Array&amp;&amp;(f[0]=0,f[1]=0,f[2]=0,f[4]=0,f[5]=0,f[6]=0,f[7]=0);f[3]=1;return f},clone:function(f){var g=new U(8);g[0]=f[0];g[1]=f[1];g[2]=f[2];g[3]=f[3];g[4]=f[4];g[5]=f[5];g[6]=f[6];g[7]=f[7];return g},fromValues:function(f,g,l,n,r,t,u,w){var y=new U(8);y[0]=f;y[1]=g;y[2]=l;y[3]=n;y[4]=r;y[5]=t;y[6]=u;y[7]=w;return y},fromRotationTranslationValues:function(f,
g,l,n,r,t,u){var w=new U(8);w[0]=f;w[1]=g;w[2]=l;w[3]=n;r*=.5;t*=.5;u*=.5;w[4]=r*n+t*l-u*g;w[5]=t*n+u*f-r*l;w[6]=u*n+r*g-t*f;w[7]=-r*f-t*g-u*l;return w},fromRotationTranslation:Va,fromTranslation:function(f,g){f[0]=0;f[1]=0;f[2]=0;f[3]=1;f[4]=.5*g[0];f[5]=.5*g[1];f[6]=.5*g[2];f[7]=0;return f},fromRotation:function(f,g){f[0]=g[0];f[1]=g[1];f[2]=g[2];f[3]=g[3];f[4]=0;f[5]=0;f[6]=0;f[7]=0;return f},fromMat4:function(f,g){var l=sa();C(l,g);var n=new U(3);x(n,g);Va(f,l,n);return f},copy:Wa,identity:function(f){f[0]=
0;f[1]=0;f[2]=0;f[3]=1;f[4]=0;f[5]=0;f[6]=0;f[7]=0;return f},set:function(f,g,l,n,r,t,u,w,y){f[0]=g;f[1]=l;f[2]=n;f[3]=r;f[4]=t;f[5]=u;f[6]=w;f[7]=y;return f},getReal:qa,getDual:function(f,g){f[0]=g[4];f[1]=g[5];f[2]=g[6];f[3]=g[7];return f},setReal:qa,setDual:function(f,g){f[4]=g[0];f[5]=g[1];f[6]=g[2];f[7]=g[3];return f},getTranslation:function(f,g){var l=g[4],n=g[5],r=g[6],t=g[7],u=-g[0],w=-g[1],y=-g[2];g=g[3];f[0]=2*(l*g+t*u+n*y-r*w);f[1]=2*(n*g+t*w+r*u-l*y);f[2]=2*(r*g+t*y+l*w-n*u);return f},
translate:function(f,g,l){var n=g[0],r=g[1],t=g[2],u=g[3],w=.5*l[0],y=.5*l[1];l=.5*l[2];var z=g[4],B=g[5],F=g[6];g=g[7];f[0]=n;f[1]=r;f[2]=t;f[3]=u;f[4]=u*w+r*l-t*y+z;f[5]=u*y+t*w-n*l+B;f[6]=u*l+n*y-r*w+F;f[7]=-n*w-r*y-t*l+g;return f},rotateX:function(f,g,l){var n=-g[0],r=-g[1],t=-g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7],F=w*u+B*n+y*t-z*r,I=y*u+B*r+z*n-w*t,H=z*u+B*t+w*r-y*n;w=B*u-w*n-y*r-z*t;Pa(f,g,l);n=f[0];r=f[1];t=f[2];u=f[3];f[4]=F*u+w*n+I*t-H*r;f[5]=I*u+w*r+H*n-F*t;f[6]=H*u+w*t+F*r-I*n;f[7]=w*
u-F*n-I*r-H*t;return f},rotateY:function(f,g,l){var n=-g[0],r=-g[1],t=-g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7],F=w*u+B*n+y*t-z*r,I=y*u+B*r+z*n-w*t,H=z*u+B*t+w*r-y*n;w=B*u-w*n-y*r-z*t;Qa(f,g,l);n=f[0];r=f[1];t=f[2];u=f[3];f[4]=F*u+w*n+I*t-H*r;f[5]=I*u+w*r+H*n-F*t;f[6]=H*u+w*t+F*r-I*n;f[7]=w*u-F*n-I*r-H*t;return f},rotateZ:function(f,g,l){var n=-g[0],r=-g[1],t=-g[2],u=g[3],w=g[4],y=g[5],z=g[6],B=g[7],F=w*u+B*n+y*t-z*r,I=y*u+B*r+z*n-w*t,H=z*u+B*t+w*r-y*n;w=B*u-w*n-y*r-z*t;Ra(f,g,l);n=f[0];r=f[1];t=f[2];
u=f[3];f[4]=F*u+w*n+I*t-H*r;f[5]=I*u+w*r+H*n-F*t;f[6]=H*u+w*t+F*r-I*n;f[7]=w*u-F*n-I*r-H*t;return f},rotateByQuatAppend:function(f,g,l){var n=l[0],r=l[1],t=l[2];l=l[3];var u=g[0],w=g[1],y=g[2],z=g[3];f[0]=u*l+z*n+w*t-y*r;f[1]=w*l+z*r+y*n-u*t;f[2]=y*l+z*t+u*r-w*n;f[3]=z*l-u*n-w*r-y*t;u=g[4];w=g[5];y=g[6];z=g[7];f[4]=u*l+z*n+w*t-y*r;f[5]=w*l+z*r+y*n-u*t;f[6]=y*l+z*t+u*r-w*n;f[7]=z*l-u*n-w*r-y*t;return f},rotateByQuatPrepend:function(f,g,l){var n=g[0],r=g[1],t=g[2];g=g[3];var u=l[0],w=l[1],y=l[2],z=
l[3];f[0]=n*z+g*u+r*y-t*w;f[1]=r*z+g*w+t*u-n*y;f[2]=t*z+g*y+n*w-r*u;f[3]=g*z-n*u-r*w-t*y;u=l[4];w=l[5];y=l[6];z=l[7];f[4]=n*z+g*u+r*y-t*w;f[5]=r*z+g*w+t*u-n*y;f[6]=t*z+g*y+n*w-r*u;f[7]=g*z-n*u-r*w-t*y;return f},rotateAroundAxis:function(f,g,l,n){if(1E-6&gt;Math.abs(n))return Wa(f,g);var r=Math.hypot(l[0],l[1],l[2]);n*=.5;var t=Math.sin(n),u=t*l[0]/r,w=t*l[1]/r;l=t*l[2]/r;n=Math.cos(n);r=g[0];t=g[1];var y=g[2],z=g[3];f[0]=r*n+z*u+t*l-y*w;f[1]=t*n+z*w+y*u-r*l;f[2]=y*n+z*l+r*w-t*u;f[3]=z*n-r*u-t*w-y*l;
r=g[4];t=g[5];y=g[6];g=g[7];f[4]=r*n+g*u+t*l-y*w;f[5]=t*n+g*w+y*u-r*l;f[6]=y*n+g*l+r*w-t*u;f[7]=g*n-r*u-t*w-y*l;return f},add:function(f,g,l){f[0]=g[0]+l[0];f[1]=g[1]+l[1];f[2]=g[2]+l[2];f[3]=g[3]+l[3];f[4]=g[4]+l[4];f[5]=g[5]+l[5];f[6]=g[6]+l[6];f[7]=g[7]+l[7];return f},multiply:Xa,mul:Xa,scale:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;f[2]=g[2]*l;f[3]=g[3]*l;f[4]=g[4]*l;f[5]=g[5]*l;f[6]=g[6]*l;f[7]=g[7]*l;return f},dot:ka,lerp:function(f,g,l,n){var r=1-n;0&gt;ka(g,l)&amp;&amp;(n=-n);f[0]=g[0]*r+l[0]*n;f[1]=
g[1]*r+l[1]*n;f[2]=g[2]*r+l[2]*n;f[3]=g[3]*r+l[3]*n;f[4]=g[4]*r+l[4]*n;f[5]=g[5]*r+l[5]*n;f[6]=g[6]*r+l[6]*n;f[7]=g[7]*r+l[7]*n;return f},invert:function(f,g){var l=ia(g);f[0]=-g[0]/l;f[1]=-g[1]/l;f[2]=-g[2]/l;f[3]=g[3]/l;f[4]=-g[4]/l;f[5]=-g[5]/l;f[6]=-g[6]/l;f[7]=g[7]/l;return f},conjugate:function(f,g){f[0]=-g[0];f[1]=-g[1];f[2]=-g[2];f[3]=g[3];f[4]=-g[4];f[5]=-g[5];f[6]=-g[6];f[7]=g[7];return f},length:ja,len:ja,squaredLength:ia,sqrLen:ia,normalize:function(f,g){var l=ia(g);if(0&lt;l){l=Math.sqrt(l);
var n=g[0]/l,r=g[1]/l,t=g[2]/l,u=g[3]/l,w=g[4],y=g[5],z=g[6];g=g[7];var B=n*w+r*y+t*z+u*g;f[0]=n;f[1]=r;f[2]=t;f[3]=u;f[4]=(w-n*B)/l;f[5]=(y-r*B)/l;f[6]=(z-t*B)/l;f[7]=(g-u*B)/l}return f},str:function(f){return"quat2("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", "+f[4]+", "+f[5]+", "+f[6]+", "+f[7]+")"},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]&amp;&amp;f[2]===g[2]&amp;&amp;f[3]===g[3]&amp;&amp;f[4]===g[4]&amp;&amp;f[5]===g[5]&amp;&amp;f[6]===g[6]&amp;&amp;f[7]===g[7]},equals:function(f,g){var l=f[0],n=f[1],r=f[2],t=f[3],u=f[4],w=f[5],
y=f[6];f=f[7];var z=g[0],B=g[1],F=g[2],I=g[3],H=g[4],M=g[5],N=g[6];g=g[7];return Math.abs(l-z)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(z))&amp;&amp;Math.abs(n-B)&lt;=1E-6*Math.max(1,Math.abs(n),Math.abs(B))&amp;&amp;Math.abs(r-F)&lt;=1E-6*Math.max(1,Math.abs(r),Math.abs(F))&amp;&amp;Math.abs(t-I)&lt;=1E-6*Math.max(1,Math.abs(t),Math.abs(I))&amp;&amp;Math.abs(u-H)&lt;=1E-6*Math.max(1,Math.abs(u),Math.abs(H))&amp;&amp;Math.abs(w-M)&lt;=1E-6*Math.max(1,Math.abs(w),Math.abs(M))&amp;&amp;Math.abs(y-N)&lt;=1E-6*Math.max(1,Math.abs(y),Math.abs(N))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,
Math.abs(f),Math.abs(g))}});na=function(){var f=Ya();return function(g,l,n,r,t,u){l||(l=2);n||(n=0);for(r=r?Math.min(r*l+n,g.length):g.length;n&lt;r;n+=l)f[0]=g[n],f[1]=g[n+1],t(f,f,u),g[n]=f[0],g[n+1]=f[1];return g}}();na=Object.freeze({__proto__:null,create:Ya,clone:function(f){var g=new U(2);g[0]=f[0];g[1]=f[1];return g},fromValues:function(f,g){var l=new U(2);l[0]=f;l[1]=g;return l},copy:function(f,g){f[0]=g[0];f[1]=g[1];return f},set:function(f,g,l){f[0]=g;f[1]=l;return f},add:function(f,g,l){f[0]=
g[0]+l[0];f[1]=g[1]+l[1];return f},subtract:Za,multiply:$a,divide:ab,ceil:function(f,g){f[0]=Math.ceil(g[0]);f[1]=Math.ceil(g[1]);return f},floor:function(f,g){f[0]=Math.floor(g[0]);f[1]=Math.floor(g[1]);return f},min:function(f,g,l){f[0]=Math.min(g[0],l[0]);f[1]=Math.min(g[1],l[1]);return f},max:function(f,g,l){f[0]=Math.max(g[0],l[0]);f[1]=Math.max(g[1],l[1]);return f},round:function(f,g){f[0]=Math.round(g[0]);f[1]=Math.round(g[1]);return f},scale:function(f,g,l){f[0]=g[0]*l;f[1]=g[1]*l;return f},
scaleAndAdd:function(f,g,l,n){f[0]=g[0]+l[0]*n;f[1]=g[1]+l[1]*n;return f},distance:bb,squaredDistance:cb,length:db,squaredLength:eb,negate:function(f,g){f[0]=-g[0];f[1]=-g[1];return f},inverse:function(f,g){f[0]=1/g[0];f[1]=1/g[1];return f},normalize:function(f,g){var l=g[0],n=g[1];l=l*l+n*n;0&lt;l&amp;&amp;(l=1/Math.sqrt(l));f[0]=g[0]*l;f[1]=g[1]*l;return f},dot:function(f,g){return f[0]*g[0]+f[1]*g[1]},cross:function(f,g,l){g=g[0]*l[1]-g[1]*l[0];f[0]=f[1]=0;f[2]=g;return f},lerp:function(f,g,l,n){var r=g[0];
g=g[1];f[0]=r+n*(l[0]-r);f[1]=g+n*(l[1]-g);return f},random:function(f,g){g=g||1;var l=2*ha()*Math.PI;f[0]=Math.cos(l)*g;f[1]=Math.sin(l)*g;return f},transformMat2:function(f,g,l){var n=g[0];g=g[1];f[0]=l[0]*n+l[2]*g;f[1]=l[1]*n+l[3]*g;return f},transformMat2d:function(f,g,l){var n=g[0];g=g[1];f[0]=l[0]*n+l[2]*g+l[4];f[1]=l[1]*n+l[3]*g+l[5];return f},transformMat3:function(f,g,l){var n=g[0];g=g[1];f[0]=l[0]*n+l[3]*g+l[6];f[1]=l[1]*n+l[4]*g+l[7];return f},transformMat4:function(f,g,l){var n=g[0];g=
g[1];f[0]=l[0]*n+l[4]*g+l[12];f[1]=l[1]*n+l[5]*g+l[13];return f},rotate:function(f,g,l,n){var r=g[0]-l[0];g=g[1]-l[1];var t=Math.sin(n);n=Math.cos(n);f[0]=r*n-g*t+l[0];f[1]=r*t+g*n+l[1];return f},angle:function(f,g){var l=f[0];f=f[1];var n=g[0];g=g[1];var r=Math.sqrt((l*l+f*f)*(n*n+g*g));return Math.acos(Math.min(Math.max(r&amp;&amp;(l*n+f*g)/r,-1),1))},zero:function(f){f[0]=0;f[1]=0;return f},str:function(f){return"vec2("+f[0]+", "+f[1]+")"},exactEquals:function(f,g){return f[0]===g[0]&amp;&amp;f[1]===g[1]},equals:function(f,
g){var l=f[0];f=f[1];var n=g[0];g=g[1];return Math.abs(l-n)&lt;=1E-6*Math.max(1,Math.abs(l),Math.abs(n))&amp;&amp;Math.abs(f-g)&lt;=1E-6*Math.max(1,Math.abs(f),Math.abs(g))},len:db,sub:Za,mul:$a,div:ab,dist:bb,sqrDist:cb,sqrLen:eb,forEach:na});a.glMatrix=ib;a.mat2=jb;a.mat2d=kb;a.mat3=lb;a.mat4=mb;a.quat=xa;a.quat2=ya;a.vec2=na;a.vec3=va;a.vec4=wa;Object.defineProperty(a,"__esModule",{value:!0})});
self.GraphemeSplitter=function(){function a(c,e){void 0===e&amp;&amp;(e=0);var h=c.charCodeAt(e);if(55296&lt;=h&amp;&amp;56319&gt;=h&amp;&amp;e&lt;c.length-1){var k=h;c=c.charCodeAt(e+1);return 56320&lt;=c&amp;&amp;57343&gt;=c?1024*(k-55296)+(c-56320)+65536:k}return 56320&lt;=h&amp;&amp;57343&gt;=h&amp;&amp;1&lt;=e?(k=c.charCodeAt(e-1),c=h,55296&lt;=k&amp;&amp;56319&gt;=k?1024*(k-55296)+(c-56320)+65536:c):h}function b(c,e,h){var k=[c].concat(e).concat([h]),m=k[k.length-2],p=k.lastIndexOf(14);if(1&lt;p&amp;&amp;k.slice(1,p).every(function(q){return 3==q})&amp;&amp;-1==[3,13,17].indexOf(c))return 2;c=
k.lastIndexOf(4);if(0&lt;c&amp;&amp;k.slice(1,c).every(function(q){return 4==q})&amp;&amp;-1==[12,4].indexOf(m))return 1==k.filter(function(q){return 4==q}).length%2?3:4;if(0==m&amp;&amp;1==h)return 0;if(2==m||0==m||1==m)return 14==h&amp;&amp;e.every(function(q){return 3==q})?2:1;if(2==h||0==h||1==h)return 1;if(6!=m||6!=h&amp;&amp;7!=h&amp;&amp;9!=h&amp;&amp;10!=h)if(9!=m&amp;&amp;7!=m||7!=h&amp;&amp;8!=h)if(10!=m&amp;&amp;8!=m||8!=h){if(3==h||15==h||5==h||12==m)return 0}else return 0;else return 0;else return 0;c=-1!=k.indexOf(3)?k.lastIndexOf(3)-1:k.length-2;return-1!=[13,17].indexOf(k[c])&amp;&amp;
k.slice(c+1,-1).every(function(q){return 3==q})&amp;&amp;14==h||15==m&amp;&amp;-1!=[16,17].indexOf(h)?0:-1!=e.indexOf(4)?2:4==m&amp;&amp;4==h?0:1}function d(c){return 1536&lt;=c&amp;&amp;1541&gt;=c||1757==c||1807==c||2274==c||3406==c||69821==c||70082&lt;=c&amp;&amp;70083&gt;=c||72250==c||72326&lt;=c&amp;&amp;72329&gt;=c||73030==c?12:13==c?0:10==c?1:0&lt;=c&amp;&amp;9&gt;=c||11&lt;=c&amp;&amp;12&gt;=c||14&lt;=c&amp;&amp;31&gt;=c||127&lt;=c&amp;&amp;159&gt;=c||173==c||1564==c||6158==c||8203==c||8206&lt;=c&amp;&amp;8207&gt;=c||8232==c||8233==c||8234&lt;=c&amp;&amp;8238&gt;=c||8288&lt;=c&amp;&amp;8292&gt;=c||8293==c||8294&lt;=c&amp;&amp;8303&gt;=c||55296&lt;=c&amp;&amp;57343&gt;=c||65279==
c||65520&lt;=c&amp;&amp;65528&gt;=c||65529&lt;=c&amp;&amp;65531&gt;=c||113824&lt;=c&amp;&amp;113827&gt;=c||119155&lt;=c&amp;&amp;119162&gt;=c||917504==c||917505==c||917506&lt;=c&amp;&amp;917535&gt;=c||917632&lt;=c&amp;&amp;917759&gt;=c||918E3&lt;=c&amp;&amp;921599&gt;=c?2:768&lt;=c&amp;&amp;879&gt;=c||1155&lt;=c&amp;&amp;1159&gt;=c||1160&lt;=c&amp;&amp;1161&gt;=c||1425&lt;=c&amp;&amp;1469&gt;=c||1471==c||1473&lt;=c&amp;&amp;1474&gt;=c||1476&lt;=c&amp;&amp;1477&gt;=c||1479==c||1552&lt;=c&amp;&amp;1562&gt;=c||1611&lt;=c&amp;&amp;1631&gt;=c||1648==c||1750&lt;=c&amp;&amp;1756&gt;=c||1759&lt;=c&amp;&amp;1764&gt;=c||1767&lt;=c&amp;&amp;1768&gt;=c||1770&lt;=c&amp;&amp;1773&gt;=c||1809==c||1840&lt;=c&amp;&amp;1866&gt;=c||1958&lt;=c&amp;&amp;1968&gt;=c||2027&lt;=c&amp;&amp;2035&gt;=c||2070&lt;=c&amp;&amp;2073&gt;=c||2075&lt;=
c&amp;&amp;2083&gt;=c||2085&lt;=c&amp;&amp;2087&gt;=c||2089&lt;=c&amp;&amp;2093&gt;=c||2137&lt;=c&amp;&amp;2139&gt;=c||2260&lt;=c&amp;&amp;2273&gt;=c||2275&lt;=c&amp;&amp;2306&gt;=c||2362==c||2364==c||2369&lt;=c&amp;&amp;2376&gt;=c||2381==c||2385&lt;=c&amp;&amp;2391&gt;=c||2402&lt;=c&amp;&amp;2403&gt;=c||2433==c||2492==c||2494==c||2497&lt;=c&amp;&amp;2500&gt;=c||2509==c||2519==c||2530&lt;=c&amp;&amp;2531&gt;=c||2561&lt;=c&amp;&amp;2562&gt;=c||2620==c||2625&lt;=c&amp;&amp;2626&gt;=c||2631&lt;=c&amp;&amp;2632&gt;=c||2635&lt;=c&amp;&amp;2637&gt;=c||2641==c||2672&lt;=c&amp;&amp;2673&gt;=c||2677==c||2689&lt;=c&amp;&amp;2690&gt;=c||2748==c||2753&lt;=c&amp;&amp;2757&gt;=c||2759&lt;=c&amp;&amp;2760&gt;=c||2765==c||2786&lt;=c&amp;&amp;2787&gt;=c||2810&lt;=c&amp;&amp;2815&gt;=c||2817==c||2876==
c||2878==c||2879==c||2881&lt;=c&amp;&amp;2884&gt;=c||2893==c||2902==c||2903==c||2914&lt;=c&amp;&amp;2915&gt;=c||2946==c||3006==c||3008==c||3021==c||3031==c||3072==c||3134&lt;=c&amp;&amp;3136&gt;=c||3142&lt;=c&amp;&amp;3144&gt;=c||3146&lt;=c&amp;&amp;3149&gt;=c||3157&lt;=c&amp;&amp;3158&gt;=c||3170&lt;=c&amp;&amp;3171&gt;=c||3201==c||3260==c||3263==c||3266==c||3270==c||3276&lt;=c&amp;&amp;3277&gt;=c||3285&lt;=c&amp;&amp;3286&gt;=c||3298&lt;=c&amp;&amp;3299&gt;=c||3328&lt;=c&amp;&amp;3329&gt;=c||3387&lt;=c&amp;&amp;3388&gt;=c||3390==c||3393&lt;=c&amp;&amp;3396&gt;=c||3405==c||3415==c||3426&lt;=c&amp;&amp;3427&gt;=c||3530==c||3535==c||3538&lt;=c&amp;&amp;3540&gt;=c||3542==c||3551==c||3633==c||3636&lt;=c&amp;&amp;3642&gt;=
c||3655&lt;=c&amp;&amp;3662&gt;=c||3761==c||3764&lt;=c&amp;&amp;3769&gt;=c||3771&lt;=c&amp;&amp;3772&gt;=c||3784&lt;=c&amp;&amp;3789&gt;=c||3864&lt;=c&amp;&amp;3865&gt;=c||3893==c||3895==c||3897==c||3953&lt;=c&amp;&amp;3966&gt;=c||3968&lt;=c&amp;&amp;3972&gt;=c||3974&lt;=c&amp;&amp;3975&gt;=c||3981&lt;=c&amp;&amp;3991&gt;=c||3993&lt;=c&amp;&amp;4028&gt;=c||4038==c||4141&lt;=c&amp;&amp;4144&gt;=c||4146&lt;=c&amp;&amp;4151&gt;=c||4153&lt;=c&amp;&amp;4154&gt;=c||4157&lt;=c&amp;&amp;4158&gt;=c||4184&lt;=c&amp;&amp;4185&gt;=c||4190&lt;=c&amp;&amp;4192&gt;=c||4209&lt;=c&amp;&amp;4212&gt;=c||4226==c||4229&lt;=c&amp;&amp;4230&gt;=c||4237==c||4253==c||4957&lt;=c&amp;&amp;4959&gt;=c||5906&lt;=c&amp;&amp;5908&gt;=c||5938&lt;=c&amp;&amp;5940&gt;=c||5970&lt;=c&amp;&amp;5971&gt;=c||6002&lt;=c&amp;&amp;6003&gt;=c||6068&lt;=c&amp;&amp;6069&gt;=
c||6071&lt;=c&amp;&amp;6077&gt;=c||6086==c||6089&lt;=c&amp;&amp;6099&gt;=c||6109==c||6155&lt;=c&amp;&amp;6157&gt;=c||6277&lt;=c&amp;&amp;6278&gt;=c||6313==c||6432&lt;=c&amp;&amp;6434&gt;=c||6439&lt;=c&amp;&amp;6440&gt;=c||6450==c||6457&lt;=c&amp;&amp;6459&gt;=c||6679&lt;=c&amp;&amp;6680&gt;=c||6683==c||6742==c||6744&lt;=c&amp;&amp;6750&gt;=c||6752==c||6754==c||6757&lt;=c&amp;&amp;6764&gt;=c||6771&lt;=c&amp;&amp;6780&gt;=c||6783==c||6832&lt;=c&amp;&amp;6845&gt;=c||6846==c||6912&lt;=c&amp;&amp;6915&gt;=c||6964==c||6966&lt;=c&amp;&amp;6970&gt;=c||6972==c||6978==c||7019&lt;=c&amp;&amp;7027&gt;=c||7040&lt;=c&amp;&amp;7041&gt;=c||7074&lt;=c&amp;&amp;7077&gt;=c||7080&lt;=c&amp;&amp;7081&gt;=c||7083&lt;=c&amp;&amp;7085&gt;=c||7142==c||7144&lt;=c&amp;&amp;7145&gt;=c||7149==c||7151&lt;=
c&amp;&amp;7153&gt;=c||7212&lt;=c&amp;&amp;7219&gt;=c||7222&lt;=c&amp;&amp;7223&gt;=c||7376&lt;=c&amp;&amp;7378&gt;=c||7380&lt;=c&amp;&amp;7392&gt;=c||7394&lt;=c&amp;&amp;7400&gt;=c||7405==c||7412==c||7416&lt;=c&amp;&amp;7417&gt;=c||7616&lt;=c&amp;&amp;7673&gt;=c||7675&lt;=c&amp;&amp;7679&gt;=c||8204==c||8400&lt;=c&amp;&amp;8412&gt;=c||8413&lt;=c&amp;&amp;8416&gt;=c||8417==c||8418&lt;=c&amp;&amp;8420&gt;=c||8421&lt;=c&amp;&amp;8432&gt;=c||11503&lt;=c&amp;&amp;11505&gt;=c||11647==c||11744&lt;=c&amp;&amp;11775&gt;=c||12330&lt;=c&amp;&amp;12333&gt;=c||12334&lt;=c&amp;&amp;12335&gt;=c||12441&lt;=c&amp;&amp;12442&gt;=c||42607==c||42608&lt;=c&amp;&amp;42610&gt;=c||42612&lt;=c&amp;&amp;42621&gt;=c||42654&lt;=c&amp;&amp;42655&gt;=c||42736&lt;=c&amp;&amp;42737&gt;=c||43010==c||43014==c||43019==c||43045&lt;=
c&amp;&amp;43046&gt;=c||43204&lt;=c&amp;&amp;43205&gt;=c||43232&lt;=c&amp;&amp;43249&gt;=c||43302&lt;=c&amp;&amp;43309&gt;=c||43335&lt;=c&amp;&amp;43345&gt;=c||43392&lt;=c&amp;&amp;43394&gt;=c||43443==c||43446&lt;=c&amp;&amp;43449&gt;=c||43452==c||43493==c||43561&lt;=c&amp;&amp;43566&gt;=c||43569&lt;=c&amp;&amp;43570&gt;=c||43573&lt;=c&amp;&amp;43574&gt;=c||43587==c||43596==c||43644==c||43696==c||43698&lt;=c&amp;&amp;43700&gt;=c||43703&lt;=c&amp;&amp;43704&gt;=c||43710&lt;=c&amp;&amp;43711&gt;=c||43713==c||43756&lt;=c&amp;&amp;43757&gt;=c||43766==c||44005==c||44008==c||44013==c||64286==c||65024&lt;=c&amp;&amp;65039&gt;=c||65056&lt;=c&amp;&amp;65071&gt;=c||65438&lt;=c&amp;&amp;65439&gt;=c||66045==c||66272==c||66422&lt;=c&amp;&amp;66426&gt;=c||
68097&lt;=c&amp;&amp;68099&gt;=c||68101&lt;=c&amp;&amp;68102&gt;=c||68108&lt;=c&amp;&amp;68111&gt;=c||68152&lt;=c&amp;&amp;68154&gt;=c||68159==c||68325&lt;=c&amp;&amp;68326&gt;=c||69633==c||69688&lt;=c&amp;&amp;69702&gt;=c||69759&lt;=c&amp;&amp;69761&gt;=c||69811&lt;=c&amp;&amp;69814&gt;=c||69817&lt;=c&amp;&amp;69818&gt;=c||69888&lt;=c&amp;&amp;69890&gt;=c||69927&lt;=c&amp;&amp;69931&gt;=c||69933&lt;=c&amp;&amp;69940&gt;=c||70003==c||70016&lt;=c&amp;&amp;70017&gt;=c||70070&lt;=c&amp;&amp;70078&gt;=c||70090&lt;=c&amp;&amp;70092&gt;=c||70191&lt;=c&amp;&amp;70193&gt;=c||70196==c||70198&lt;=c&amp;&amp;70199&gt;=c||70206==c||70367==c||70371&lt;=c&amp;&amp;70378&gt;=c||70400&lt;=c&amp;&amp;70401&gt;=c||70460==c||70462==c||70464==c||70487==c||70502&lt;=c&amp;&amp;70508&gt;=c||70512&lt;=
c&amp;&amp;70516&gt;=c||70712&lt;=c&amp;&amp;70719&gt;=c||70722&lt;=c&amp;&amp;70724&gt;=c||70726==c||70832==c||70835&lt;=c&amp;&amp;70840&gt;=c||70842==c||70845==c||70847&lt;=c&amp;&amp;70848&gt;=c||70850&lt;=c&amp;&amp;70851&gt;=c||71087==c||71090&lt;=c&amp;&amp;71093&gt;=c||71100&lt;=c&amp;&amp;71101&gt;=c||71103&lt;=c&amp;&amp;71104&gt;=c||71132&lt;=c&amp;&amp;71133&gt;=c||71219&lt;=c&amp;&amp;71226&gt;=c||71229==c||71231&lt;=c&amp;&amp;71232&gt;=c||71339==c||71341==c||71344&lt;=c&amp;&amp;71349&gt;=c||71351==c||71453&lt;=c&amp;&amp;71455&gt;=c||71458&lt;=c&amp;&amp;71461&gt;=c||71463&lt;=c&amp;&amp;71467&gt;=c||72193&lt;=c&amp;&amp;72198&gt;=c||72201&lt;=c&amp;&amp;72202&gt;=c||72243&lt;=c&amp;&amp;72248&gt;=c||72251&lt;=c&amp;&amp;72254&gt;=c||72263==c||72273&lt;=c&amp;&amp;
72278&gt;=c||72281&lt;=c&amp;&amp;72283&gt;=c||72330&lt;=c&amp;&amp;72342&gt;=c||72344&lt;=c&amp;&amp;72345&gt;=c||72752&lt;=c&amp;&amp;72758&gt;=c||72760&lt;=c&amp;&amp;72765&gt;=c||72767==c||72850&lt;=c&amp;&amp;72871&gt;=c||72874&lt;=c&amp;&amp;72880&gt;=c||72882&lt;=c&amp;&amp;72883&gt;=c||72885&lt;=c&amp;&amp;72886&gt;=c||73009&lt;=c&amp;&amp;73014&gt;=c||73018==c||73020&lt;=c&amp;&amp;73021&gt;=c||73023&lt;=c&amp;&amp;73029&gt;=c||73031==c||92912&lt;=c&amp;&amp;92916&gt;=c||92976&lt;=c&amp;&amp;92982&gt;=c||94095&lt;=c&amp;&amp;94098&gt;=c||113821&lt;=c&amp;&amp;113822&gt;=c||119141==c||119143&lt;=c&amp;&amp;119145&gt;=c||119150&lt;=c&amp;&amp;119154&gt;=c||119163&lt;=c&amp;&amp;119170&gt;=c||119173&lt;=c&amp;&amp;119179&gt;=c||119210&lt;=c&amp;&amp;119213&gt;=c||119362&lt;=c&amp;&amp;119364&gt;=
c||121344&lt;=c&amp;&amp;121398&gt;=c||121403&lt;=c&amp;&amp;121452&gt;=c||121461==c||121476==c||121499&lt;=c&amp;&amp;121503&gt;=c||121505&lt;=c&amp;&amp;121519&gt;=c||122880&lt;=c&amp;&amp;122886&gt;=c||122888&lt;=c&amp;&amp;122904&gt;=c||122907&lt;=c&amp;&amp;122913&gt;=c||122915&lt;=c&amp;&amp;122916&gt;=c||122918&lt;=c&amp;&amp;122922&gt;=c||125136&lt;=c&amp;&amp;125142&gt;=c||125252&lt;=c&amp;&amp;125258&gt;=c||917536&lt;=c&amp;&amp;917631&gt;=c||917760&lt;=c&amp;&amp;917999&gt;=c?3:127462&lt;=c&amp;&amp;127487&gt;=c?4:2307==c||2363==c||2366&lt;=c&amp;&amp;2368&gt;=c||2377&lt;=c&amp;&amp;2380&gt;=c||2382&lt;=c&amp;&amp;2383&gt;=c||2434&lt;=c&amp;&amp;2435&gt;=c||2495&lt;=c&amp;&amp;2496&gt;=c||2503&lt;=c&amp;&amp;2504&gt;=c||2507&lt;=c&amp;&amp;2508&gt;=c||2563==c||2622&lt;=c&amp;&amp;2624&gt;=
c||2691==c||2750&lt;=c&amp;&amp;2752&gt;=c||2761==c||2763&lt;=c&amp;&amp;2764&gt;=c||2818&lt;=c&amp;&amp;2819&gt;=c||2880==c||2887&lt;=c&amp;&amp;2888&gt;=c||2891&lt;=c&amp;&amp;2892&gt;=c||3007==c||3009&lt;=c&amp;&amp;3010&gt;=c||3014&lt;=c&amp;&amp;3016&gt;=c||3018&lt;=c&amp;&amp;3020&gt;=c||3073&lt;=c&amp;&amp;3075&gt;=c||3137&lt;=c&amp;&amp;3140&gt;=c||3202&lt;=c&amp;&amp;3203&gt;=c||3262==c||3264&lt;=c&amp;&amp;3265&gt;=c||3267&lt;=c&amp;&amp;3268&gt;=c||3271&lt;=c&amp;&amp;3272&gt;=c||3274&lt;=c&amp;&amp;3275&gt;=c||3330&lt;=c&amp;&amp;3331&gt;=c||3391&lt;=c&amp;&amp;3392&gt;=c||3398&lt;=c&amp;&amp;3400&gt;=c||3402&lt;=c&amp;&amp;3404&gt;=c||3458&lt;=c&amp;&amp;3459&gt;=c||3536&lt;=c&amp;&amp;3537&gt;=c||3544&lt;=c&amp;&amp;3550&gt;=c||3570&lt;=c&amp;&amp;3571&gt;=c||3635==c||3763==c||3902&lt;=c&amp;&amp;3903&gt;=c||3967==
c||4145==c||4155&lt;=c&amp;&amp;4156&gt;=c||4182&lt;=c&amp;&amp;4183&gt;=c||4228==c||6070==c||6078&lt;=c&amp;&amp;6085&gt;=c||6087&lt;=c&amp;&amp;6088&gt;=c||6435&lt;=c&amp;&amp;6438&gt;=c||6441&lt;=c&amp;&amp;6443&gt;=c||6448&lt;=c&amp;&amp;6449&gt;=c||6451&lt;=c&amp;&amp;6456&gt;=c||6681&lt;=c&amp;&amp;6682&gt;=c||6741==c||6743==c||6765&lt;=c&amp;&amp;6770&gt;=c||6916==c||6965==c||6971==c||6973&lt;=c&amp;&amp;6977&gt;=c||6979&lt;=c&amp;&amp;6980&gt;=c||7042==c||7073==c||7078&lt;=c&amp;&amp;7079&gt;=c||7082==c||7143==c||7146&lt;=c&amp;&amp;7148&gt;=c||7150==c||7154&lt;=c&amp;&amp;7155&gt;=c||7204&lt;=c&amp;&amp;7211&gt;=c||7220&lt;=c&amp;&amp;7221&gt;=c||7393==c||7410&lt;=c&amp;&amp;7411&gt;=c||7415==c||43043&lt;=c&amp;&amp;43044&gt;=c||43047==c||43136&lt;=c&amp;&amp;
43137&gt;=c||43188&lt;=c&amp;&amp;43203&gt;=c||43346&lt;=c&amp;&amp;43347&gt;=c||43395==c||43444&lt;=c&amp;&amp;43445&gt;=c||43450&lt;=c&amp;&amp;43451&gt;=c||43453&lt;=c&amp;&amp;43456&gt;=c||43567&lt;=c&amp;&amp;43568&gt;=c||43571&lt;=c&amp;&amp;43572&gt;=c||43597==c||43755==c||43758&lt;=c&amp;&amp;43759&gt;=c||43765==c||44003&lt;=c&amp;&amp;44004&gt;=c||44006&lt;=c&amp;&amp;44007&gt;=c||44009&lt;=c&amp;&amp;44010&gt;=c||44012==c||69632==c||69634==c||69762==c||69808&lt;=c&amp;&amp;69810&gt;=c||69815&lt;=c&amp;&amp;69816&gt;=c||69932==c||70018==c||70067&lt;=c&amp;&amp;70069&gt;=c||70079&lt;=c&amp;&amp;70080&gt;=c||70188&lt;=c&amp;&amp;70190&gt;=c||70194&lt;=c&amp;&amp;70195&gt;=c||70197==c||70368&lt;=c&amp;&amp;70370&gt;=c||70402&lt;=c&amp;&amp;70403&gt;=c||70463==
c||70465&lt;=c&amp;&amp;70468&gt;=c||70471&lt;=c&amp;&amp;70472&gt;=c||70475&lt;=c&amp;&amp;70477&gt;=c||70498&lt;=c&amp;&amp;70499&gt;=c||70709&lt;=c&amp;&amp;70711&gt;=c||70720&lt;=c&amp;&amp;70721&gt;=c||70725==c||70833&lt;=c&amp;&amp;70834&gt;=c||70841==c||70843&lt;=c&amp;&amp;70844&gt;=c||70846==c||70849==c||71088&lt;=c&amp;&amp;71089&gt;=c||71096&lt;=c&amp;&amp;71099&gt;=c||71102==c||71216&lt;=c&amp;&amp;71218&gt;=c||71227&lt;=c&amp;&amp;71228&gt;=c||71230==c||71340==c||71342&lt;=c&amp;&amp;71343&gt;=c||71350==c||71456&lt;=c&amp;&amp;71457&gt;=c||71462==c||72199&lt;=c&amp;&amp;72200&gt;=c||72249==c||72279&lt;=c&amp;&amp;72280&gt;=c||72343==c||72751==c||72766==c||72873==c||72881==c||72884==c||94033&lt;=c&amp;&amp;94078&gt;=c||
119142==c||119149==c?5:4352&lt;=c&amp;&amp;4447&gt;=c||43360&lt;=c&amp;&amp;43388&gt;=c?6:4448&lt;=c&amp;&amp;4519&gt;=c||55216&lt;=c&amp;&amp;55238&gt;=c?7:4520&lt;=c&amp;&amp;4607&gt;=c||55243&lt;=c&amp;&amp;55291&gt;=c?8:44032==c||44060==c||44088==c||44116==c||44144==c||44172==c||44200==c||44228==c||44256==c||44284==c||44312==c||44340==c||44368==c||44396==c||44424==c||44452==c||44480==c||44508==c||44536==c||44564==c||44592==c||44620==c||44648==c||44676==c||44704==c||44732==c||44760==c||44788==c||44816==c||44844==c||44872==c||44900==c||44928==c||44956==c||44984==c||45012==c||45040==
c||45068==c||45096==c||45124==c||45152==c||45180==c||45208==c||45236==c||45264==c||45292==c||45320==c||45348==c||45376==c||45404==c||45432==c||45460==c||45488==c||45516==c||45544==c||45572==c||45600==c||45628==c||45656==c||45684==c||45712==c||45740==c||45768==c||45796==c||45824==c||45852==c||45880==c||45908==c||45936==c||45964==c||45992==c||46020==c||46048==c||46076==c||46104==c||46132==c||46160==c||46188==c||46216==c||46244==c||46272==c||46300==c||46328==c||46356==c||46384==c||46412==c||46440==c||
46468==c||46496==c||46524==c||46552==c||46580==c||46608==c||46636==c||46664==c||46692==c||46720==c||46748==c||46776==c||46804==c||46832==c||46860==c||46888==c||46916==c||46944==c||46972==c||47E3==c||47028==c||47056==c||47084==c||47112==c||47140==c||47168==c||47196==c||47224==c||47252==c||47280==c||47308==c||47336==c||47364==c||47392==c||47420==c||47448==c||47476==c||47504==c||47532==c||47560==c||47588==c||47616==c||47644==c||47672==c||47700==c||47728==c||47756==c||47784==c||47812==c||47840==c||47868==
c||47896==c||47924==c||47952==c||47980==c||48008==c||48036==c||48064==c||48092==c||48120==c||48148==c||48176==c||48204==c||48232==c||48260==c||48288==c||48316==c||48344==c||48372==c||48400==c||48428==c||48456==c||48484==c||48512==c||48540==c||48568==c||48596==c||48624==c||48652==c||48680==c||48708==c||48736==c||48764==c||48792==c||48820==c||48848==c||48876==c||48904==c||48932==c||48960==c||48988==c||49016==c||49044==c||49072==c||49100==c||49128==c||49156==c||49184==c||49212==c||49240==c||49268==c||
49296==c||49324==c||49352==c||49380==c||49408==c||49436==c||49464==c||49492==c||49520==c||49548==c||49576==c||49604==c||49632==c||49660==c||49688==c||49716==c||49744==c||49772==c||49800==c||49828==c||49856==c||49884==c||49912==c||49940==c||49968==c||49996==c||50024==c||50052==c||50080==c||50108==c||50136==c||50164==c||50192==c||50220==c||50248==c||50276==c||50304==c||50332==c||50360==c||50388==c||50416==c||50444==c||50472==c||50500==c||50528==c||50556==c||50584==c||50612==c||50640==c||50668==c||50696==
c||50724==c||50752==c||50780==c||50808==c||50836==c||50864==c||50892==c||50920==c||50948==c||50976==c||51004==c||51032==c||51060==c||51088==c||51116==c||51144==c||51172==c||51200==c||51228==c||51256==c||51284==c||51312==c||51340==c||51368==c||51396==c||51424==c||51452==c||51480==c||51508==c||51536==c||51564==c||51592==c||51620==c||51648==c||51676==c||51704==c||51732==c||51760==c||51788==c||51816==c||51844==c||51872==c||51900==c||51928==c||51956==c||51984==c||52012==c||52040==c||52068==c||52096==c||
52124==c||52152==c||52180==c||52208==c||52236==c||52264==c||52292==c||52320==c||52348==c||52376==c||52404==c||52432==c||52460==c||52488==c||52516==c||52544==c||52572==c||52600==c||52628==c||52656==c||52684==c||52712==c||52740==c||52768==c||52796==c||52824==c||52852==c||52880==c||52908==c||52936==c||52964==c||52992==c||53020==c||53048==c||53076==c||53104==c||53132==c||53160==c||53188==c||53216==c||53244==c||53272==c||53300==c||53328==c||53356==c||53384==c||53412==c||53440==c||53468==c||53496==c||53524==
c||53552==c||53580==c||53608==c||53636==c||53664==c||53692==c||53720==c||53748==c||53776==c||53804==c||53832==c||53860==c||53888==c||53916==c||53944==c||53972==c||54E3==c||54028==c||54056==c||54084==c||54112==c||54140==c||54168==c||54196==c||54224==c||54252==c||54280==c||54308==c||54336==c||54364==c||54392==c||54420==c||54448==c||54476==c||54504==c||54532==c||54560==c||54588==c||54616==c||54644==c||54672==c||54700==c||54728==c||54756==c||54784==c||54812==c||54840==c||54868==c||54896==c||54924==c||
54952==c||54980==c||55008==c||55036==c||55064==c||55092==c||55120==c||55148==c||55176==c?9:44033&lt;=c&amp;&amp;44059&gt;=c||44061&lt;=c&amp;&amp;44087&gt;=c||44089&lt;=c&amp;&amp;44115&gt;=c||44117&lt;=c&amp;&amp;44143&gt;=c||44145&lt;=c&amp;&amp;44171&gt;=c||44173&lt;=c&amp;&amp;44199&gt;=c||44201&lt;=c&amp;&amp;44227&gt;=c||44229&lt;=c&amp;&amp;44255&gt;=c||44257&lt;=c&amp;&amp;44283&gt;=c||44285&lt;=c&amp;&amp;44311&gt;=c||44313&lt;=c&amp;&amp;44339&gt;=c||44341&lt;=c&amp;&amp;44367&gt;=c||44369&lt;=c&amp;&amp;44395&gt;=c||44397&lt;=c&amp;&amp;44423&gt;=c||44425&lt;=c&amp;&amp;44451&gt;=c||44453&lt;=c&amp;&amp;44479&gt;=c||44481&lt;=c&amp;&amp;44507&gt;=c||44509&lt;=c&amp;&amp;44535&gt;=c||44537&lt;=c&amp;&amp;44563&gt;=c||44565&lt;=c&amp;&amp;44591&gt;=c||44593&lt;=c&amp;&amp;
44619&gt;=c||44621&lt;=c&amp;&amp;44647&gt;=c||44649&lt;=c&amp;&amp;44675&gt;=c||44677&lt;=c&amp;&amp;44703&gt;=c||44705&lt;=c&amp;&amp;44731&gt;=c||44733&lt;=c&amp;&amp;44759&gt;=c||44761&lt;=c&amp;&amp;44787&gt;=c||44789&lt;=c&amp;&amp;44815&gt;=c||44817&lt;=c&amp;&amp;44843&gt;=c||44845&lt;=c&amp;&amp;44871&gt;=c||44873&lt;=c&amp;&amp;44899&gt;=c||44901&lt;=c&amp;&amp;44927&gt;=c||44929&lt;=c&amp;&amp;44955&gt;=c||44957&lt;=c&amp;&amp;44983&gt;=c||44985&lt;=c&amp;&amp;45011&gt;=c||45013&lt;=c&amp;&amp;45039&gt;=c||45041&lt;=c&amp;&amp;45067&gt;=c||45069&lt;=c&amp;&amp;45095&gt;=c||45097&lt;=c&amp;&amp;45123&gt;=c||45125&lt;=c&amp;&amp;45151&gt;=c||45153&lt;=c&amp;&amp;45179&gt;=c||45181&lt;=c&amp;&amp;45207&gt;=c||45209&lt;=c&amp;&amp;45235&gt;=c||45237&lt;=c&amp;&amp;45263&gt;=c||45265&lt;=c&amp;&amp;45291&gt;=c||45293&lt;=c&amp;&amp;45319&gt;=
c||45321&lt;=c&amp;&amp;45347&gt;=c||45349&lt;=c&amp;&amp;45375&gt;=c||45377&lt;=c&amp;&amp;45403&gt;=c||45405&lt;=c&amp;&amp;45431&gt;=c||45433&lt;=c&amp;&amp;45459&gt;=c||45461&lt;=c&amp;&amp;45487&gt;=c||45489&lt;=c&amp;&amp;45515&gt;=c||45517&lt;=c&amp;&amp;45543&gt;=c||45545&lt;=c&amp;&amp;45571&gt;=c||45573&lt;=c&amp;&amp;45599&gt;=c||45601&lt;=c&amp;&amp;45627&gt;=c||45629&lt;=c&amp;&amp;45655&gt;=c||45657&lt;=c&amp;&amp;45683&gt;=c||45685&lt;=c&amp;&amp;45711&gt;=c||45713&lt;=c&amp;&amp;45739&gt;=c||45741&lt;=c&amp;&amp;45767&gt;=c||45769&lt;=c&amp;&amp;45795&gt;=c||45797&lt;=c&amp;&amp;45823&gt;=c||45825&lt;=c&amp;&amp;45851&gt;=c||45853&lt;=c&amp;&amp;45879&gt;=c||45881&lt;=c&amp;&amp;45907&gt;=c||45909&lt;=c&amp;&amp;45935&gt;=c||45937&lt;=c&amp;&amp;45963&gt;=c||45965&lt;=c&amp;&amp;45991&gt;=c||45993&lt;=c&amp;&amp;46019&gt;=c||
46021&lt;=c&amp;&amp;46047&gt;=c||46049&lt;=c&amp;&amp;46075&gt;=c||46077&lt;=c&amp;&amp;46103&gt;=c||46105&lt;=c&amp;&amp;46131&gt;=c||46133&lt;=c&amp;&amp;46159&gt;=c||46161&lt;=c&amp;&amp;46187&gt;=c||46189&lt;=c&amp;&amp;46215&gt;=c||46217&lt;=c&amp;&amp;46243&gt;=c||46245&lt;=c&amp;&amp;46271&gt;=c||46273&lt;=c&amp;&amp;46299&gt;=c||46301&lt;=c&amp;&amp;46327&gt;=c||46329&lt;=c&amp;&amp;46355&gt;=c||46357&lt;=c&amp;&amp;46383&gt;=c||46385&lt;=c&amp;&amp;46411&gt;=c||46413&lt;=c&amp;&amp;46439&gt;=c||46441&lt;=c&amp;&amp;46467&gt;=c||46469&lt;=c&amp;&amp;46495&gt;=c||46497&lt;=c&amp;&amp;46523&gt;=c||46525&lt;=c&amp;&amp;46551&gt;=c||46553&lt;=c&amp;&amp;46579&gt;=c||46581&lt;=c&amp;&amp;46607&gt;=c||46609&lt;=c&amp;&amp;46635&gt;=c||46637&lt;=c&amp;&amp;46663&gt;=c||46665&lt;=c&amp;&amp;46691&gt;=c||46693&lt;=c&amp;&amp;46719&gt;=c||46721&lt;=
c&amp;&amp;46747&gt;=c||46749&lt;=c&amp;&amp;46775&gt;=c||46777&lt;=c&amp;&amp;46803&gt;=c||46805&lt;=c&amp;&amp;46831&gt;=c||46833&lt;=c&amp;&amp;46859&gt;=c||46861&lt;=c&amp;&amp;46887&gt;=c||46889&lt;=c&amp;&amp;46915&gt;=c||46917&lt;=c&amp;&amp;46943&gt;=c||46945&lt;=c&amp;&amp;46971&gt;=c||46973&lt;=c&amp;&amp;46999&gt;=c||47001&lt;=c&amp;&amp;47027&gt;=c||47029&lt;=c&amp;&amp;47055&gt;=c||47057&lt;=c&amp;&amp;47083&gt;=c||47085&lt;=c&amp;&amp;47111&gt;=c||47113&lt;=c&amp;&amp;47139&gt;=c||47141&lt;=c&amp;&amp;47167&gt;=c||47169&lt;=c&amp;&amp;47195&gt;=c||47197&lt;=c&amp;&amp;47223&gt;=c||47225&lt;=c&amp;&amp;47251&gt;=c||47253&lt;=c&amp;&amp;47279&gt;=c||47281&lt;=c&amp;&amp;47307&gt;=c||47309&lt;=c&amp;&amp;47335&gt;=c||47337&lt;=c&amp;&amp;47363&gt;=c||47365&lt;=c&amp;&amp;47391&gt;=c||47393&lt;=c&amp;&amp;47419&gt;=c||47421&lt;=c&amp;&amp;
47447&gt;=c||47449&lt;=c&amp;&amp;47475&gt;=c||47477&lt;=c&amp;&amp;47503&gt;=c||47505&lt;=c&amp;&amp;47531&gt;=c||47533&lt;=c&amp;&amp;47559&gt;=c||47561&lt;=c&amp;&amp;47587&gt;=c||47589&lt;=c&amp;&amp;47615&gt;=c||47617&lt;=c&amp;&amp;47643&gt;=c||47645&lt;=c&amp;&amp;47671&gt;=c||47673&lt;=c&amp;&amp;47699&gt;=c||47701&lt;=c&amp;&amp;47727&gt;=c||47729&lt;=c&amp;&amp;47755&gt;=c||47757&lt;=c&amp;&amp;47783&gt;=c||47785&lt;=c&amp;&amp;47811&gt;=c||47813&lt;=c&amp;&amp;47839&gt;=c||47841&lt;=c&amp;&amp;47867&gt;=c||47869&lt;=c&amp;&amp;47895&gt;=c||47897&lt;=c&amp;&amp;47923&gt;=c||47925&lt;=c&amp;&amp;47951&gt;=c||47953&lt;=c&amp;&amp;47979&gt;=c||47981&lt;=c&amp;&amp;48007&gt;=c||48009&lt;=c&amp;&amp;48035&gt;=c||48037&lt;=c&amp;&amp;48063&gt;=c||48065&lt;=c&amp;&amp;48091&gt;=c||48093&lt;=c&amp;&amp;48119&gt;=c||48121&lt;=c&amp;&amp;48147&gt;=
c||48149&lt;=c&amp;&amp;48175&gt;=c||48177&lt;=c&amp;&amp;48203&gt;=c||48205&lt;=c&amp;&amp;48231&gt;=c||48233&lt;=c&amp;&amp;48259&gt;=c||48261&lt;=c&amp;&amp;48287&gt;=c||48289&lt;=c&amp;&amp;48315&gt;=c||48317&lt;=c&amp;&amp;48343&gt;=c||48345&lt;=c&amp;&amp;48371&gt;=c||48373&lt;=c&amp;&amp;48399&gt;=c||48401&lt;=c&amp;&amp;48427&gt;=c||48429&lt;=c&amp;&amp;48455&gt;=c||48457&lt;=c&amp;&amp;48483&gt;=c||48485&lt;=c&amp;&amp;48511&gt;=c||48513&lt;=c&amp;&amp;48539&gt;=c||48541&lt;=c&amp;&amp;48567&gt;=c||48569&lt;=c&amp;&amp;48595&gt;=c||48597&lt;=c&amp;&amp;48623&gt;=c||48625&lt;=c&amp;&amp;48651&gt;=c||48653&lt;=c&amp;&amp;48679&gt;=c||48681&lt;=c&amp;&amp;48707&gt;=c||48709&lt;=c&amp;&amp;48735&gt;=c||48737&lt;=c&amp;&amp;48763&gt;=c||48765&lt;=c&amp;&amp;48791&gt;=c||48793&lt;=c&amp;&amp;48819&gt;=c||48821&lt;=c&amp;&amp;48847&gt;=c||
48849&lt;=c&amp;&amp;48875&gt;=c||48877&lt;=c&amp;&amp;48903&gt;=c||48905&lt;=c&amp;&amp;48931&gt;=c||48933&lt;=c&amp;&amp;48959&gt;=c||48961&lt;=c&amp;&amp;48987&gt;=c||48989&lt;=c&amp;&amp;49015&gt;=c||49017&lt;=c&amp;&amp;49043&gt;=c||49045&lt;=c&amp;&amp;49071&gt;=c||49073&lt;=c&amp;&amp;49099&gt;=c||49101&lt;=c&amp;&amp;49127&gt;=c||49129&lt;=c&amp;&amp;49155&gt;=c||49157&lt;=c&amp;&amp;49183&gt;=c||49185&lt;=c&amp;&amp;49211&gt;=c||49213&lt;=c&amp;&amp;49239&gt;=c||49241&lt;=c&amp;&amp;49267&gt;=c||49269&lt;=c&amp;&amp;49295&gt;=c||49297&lt;=c&amp;&amp;49323&gt;=c||49325&lt;=c&amp;&amp;49351&gt;=c||49353&lt;=c&amp;&amp;49379&gt;=c||49381&lt;=c&amp;&amp;49407&gt;=c||49409&lt;=c&amp;&amp;49435&gt;=c||49437&lt;=c&amp;&amp;49463&gt;=c||49465&lt;=c&amp;&amp;49491&gt;=c||49493&lt;=c&amp;&amp;49519&gt;=c||49521&lt;=c&amp;&amp;49547&gt;=c||49549&lt;=
c&amp;&amp;49575&gt;=c||49577&lt;=c&amp;&amp;49603&gt;=c||49605&lt;=c&amp;&amp;49631&gt;=c||49633&lt;=c&amp;&amp;49659&gt;=c||49661&lt;=c&amp;&amp;49687&gt;=c||49689&lt;=c&amp;&amp;49715&gt;=c||49717&lt;=c&amp;&amp;49743&gt;=c||49745&lt;=c&amp;&amp;49771&gt;=c||49773&lt;=c&amp;&amp;49799&gt;=c||49801&lt;=c&amp;&amp;49827&gt;=c||49829&lt;=c&amp;&amp;49855&gt;=c||49857&lt;=c&amp;&amp;49883&gt;=c||49885&lt;=c&amp;&amp;49911&gt;=c||49913&lt;=c&amp;&amp;49939&gt;=c||49941&lt;=c&amp;&amp;49967&gt;=c||49969&lt;=c&amp;&amp;49995&gt;=c||49997&lt;=c&amp;&amp;50023&gt;=c||50025&lt;=c&amp;&amp;50051&gt;=c||50053&lt;=c&amp;&amp;50079&gt;=c||50081&lt;=c&amp;&amp;50107&gt;=c||50109&lt;=c&amp;&amp;50135&gt;=c||50137&lt;=c&amp;&amp;50163&gt;=c||50165&lt;=c&amp;&amp;50191&gt;=c||50193&lt;=c&amp;&amp;50219&gt;=c||50221&lt;=c&amp;&amp;50247&gt;=c||50249&lt;=c&amp;&amp;
50275&gt;=c||50277&lt;=c&amp;&amp;50303&gt;=c||50305&lt;=c&amp;&amp;50331&gt;=c||50333&lt;=c&amp;&amp;50359&gt;=c||50361&lt;=c&amp;&amp;50387&gt;=c||50389&lt;=c&amp;&amp;50415&gt;=c||50417&lt;=c&amp;&amp;50443&gt;=c||50445&lt;=c&amp;&amp;50471&gt;=c||50473&lt;=c&amp;&amp;50499&gt;=c||50501&lt;=c&amp;&amp;50527&gt;=c||50529&lt;=c&amp;&amp;50555&gt;=c||50557&lt;=c&amp;&amp;50583&gt;=c||50585&lt;=c&amp;&amp;50611&gt;=c||50613&lt;=c&amp;&amp;50639&gt;=c||50641&lt;=c&amp;&amp;50667&gt;=c||50669&lt;=c&amp;&amp;50695&gt;=c||50697&lt;=c&amp;&amp;50723&gt;=c||50725&lt;=c&amp;&amp;50751&gt;=c||50753&lt;=c&amp;&amp;50779&gt;=c||50781&lt;=c&amp;&amp;50807&gt;=c||50809&lt;=c&amp;&amp;50835&gt;=c||50837&lt;=c&amp;&amp;50863&gt;=c||50865&lt;=c&amp;&amp;50891&gt;=c||50893&lt;=c&amp;&amp;50919&gt;=c||50921&lt;=c&amp;&amp;50947&gt;=c||50949&lt;=c&amp;&amp;50975&gt;=
c||50977&lt;=c&amp;&amp;51003&gt;=c||51005&lt;=c&amp;&amp;51031&gt;=c||51033&lt;=c&amp;&amp;51059&gt;=c||51061&lt;=c&amp;&amp;51087&gt;=c||51089&lt;=c&amp;&amp;51115&gt;=c||51117&lt;=c&amp;&amp;51143&gt;=c||51145&lt;=c&amp;&amp;51171&gt;=c||51173&lt;=c&amp;&amp;51199&gt;=c||51201&lt;=c&amp;&amp;51227&gt;=c||51229&lt;=c&amp;&amp;51255&gt;=c||51257&lt;=c&amp;&amp;51283&gt;=c||51285&lt;=c&amp;&amp;51311&gt;=c||51313&lt;=c&amp;&amp;51339&gt;=c||51341&lt;=c&amp;&amp;51367&gt;=c||51369&lt;=c&amp;&amp;51395&gt;=c||51397&lt;=c&amp;&amp;51423&gt;=c||51425&lt;=c&amp;&amp;51451&gt;=c||51453&lt;=c&amp;&amp;51479&gt;=c||51481&lt;=c&amp;&amp;51507&gt;=c||51509&lt;=c&amp;&amp;51535&gt;=c||51537&lt;=c&amp;&amp;51563&gt;=c||51565&lt;=c&amp;&amp;51591&gt;=c||51593&lt;=c&amp;&amp;51619&gt;=c||51621&lt;=c&amp;&amp;51647&gt;=c||51649&lt;=c&amp;&amp;51675&gt;=c||
51677&lt;=c&amp;&amp;51703&gt;=c||51705&lt;=c&amp;&amp;51731&gt;=c||51733&lt;=c&amp;&amp;51759&gt;=c||51761&lt;=c&amp;&amp;51787&gt;=c||51789&lt;=c&amp;&amp;51815&gt;=c||51817&lt;=c&amp;&amp;51843&gt;=c||51845&lt;=c&amp;&amp;51871&gt;=c||51873&lt;=c&amp;&amp;51899&gt;=c||51901&lt;=c&amp;&amp;51927&gt;=c||51929&lt;=c&amp;&amp;51955&gt;=c||51957&lt;=c&amp;&amp;51983&gt;=c||51985&lt;=c&amp;&amp;52011&gt;=c||52013&lt;=c&amp;&amp;52039&gt;=c||52041&lt;=c&amp;&amp;52067&gt;=c||52069&lt;=c&amp;&amp;52095&gt;=c||52097&lt;=c&amp;&amp;52123&gt;=c||52125&lt;=c&amp;&amp;52151&gt;=c||52153&lt;=c&amp;&amp;52179&gt;=c||52181&lt;=c&amp;&amp;52207&gt;=c||52209&lt;=c&amp;&amp;52235&gt;=c||52237&lt;=c&amp;&amp;52263&gt;=c||52265&lt;=c&amp;&amp;52291&gt;=c||52293&lt;=c&amp;&amp;52319&gt;=c||52321&lt;=c&amp;&amp;52347&gt;=c||52349&lt;=c&amp;&amp;52375&gt;=c||52377&lt;=
c&amp;&amp;52403&gt;=c||52405&lt;=c&amp;&amp;52431&gt;=c||52433&lt;=c&amp;&amp;52459&gt;=c||52461&lt;=c&amp;&amp;52487&gt;=c||52489&lt;=c&amp;&amp;52515&gt;=c||52517&lt;=c&amp;&amp;52543&gt;=c||52545&lt;=c&amp;&amp;52571&gt;=c||52573&lt;=c&amp;&amp;52599&gt;=c||52601&lt;=c&amp;&amp;52627&gt;=c||52629&lt;=c&amp;&amp;52655&gt;=c||52657&lt;=c&amp;&amp;52683&gt;=c||52685&lt;=c&amp;&amp;52711&gt;=c||52713&lt;=c&amp;&amp;52739&gt;=c||52741&lt;=c&amp;&amp;52767&gt;=c||52769&lt;=c&amp;&amp;52795&gt;=c||52797&lt;=c&amp;&amp;52823&gt;=c||52825&lt;=c&amp;&amp;52851&gt;=c||52853&lt;=c&amp;&amp;52879&gt;=c||52881&lt;=c&amp;&amp;52907&gt;=c||52909&lt;=c&amp;&amp;52935&gt;=c||52937&lt;=c&amp;&amp;52963&gt;=c||52965&lt;=c&amp;&amp;52991&gt;=c||52993&lt;=c&amp;&amp;53019&gt;=c||53021&lt;=c&amp;&amp;53047&gt;=c||53049&lt;=c&amp;&amp;53075&gt;=c||53077&lt;=c&amp;&amp;
53103&gt;=c||53105&lt;=c&amp;&amp;53131&gt;=c||53133&lt;=c&amp;&amp;53159&gt;=c||53161&lt;=c&amp;&amp;53187&gt;=c||53189&lt;=c&amp;&amp;53215&gt;=c||53217&lt;=c&amp;&amp;53243&gt;=c||53245&lt;=c&amp;&amp;53271&gt;=c||53273&lt;=c&amp;&amp;53299&gt;=c||53301&lt;=c&amp;&amp;53327&gt;=c||53329&lt;=c&amp;&amp;53355&gt;=c||53357&lt;=c&amp;&amp;53383&gt;=c||53385&lt;=c&amp;&amp;53411&gt;=c||53413&lt;=c&amp;&amp;53439&gt;=c||53441&lt;=c&amp;&amp;53467&gt;=c||53469&lt;=c&amp;&amp;53495&gt;=c||53497&lt;=c&amp;&amp;53523&gt;=c||53525&lt;=c&amp;&amp;53551&gt;=c||53553&lt;=c&amp;&amp;53579&gt;=c||53581&lt;=c&amp;&amp;53607&gt;=c||53609&lt;=c&amp;&amp;53635&gt;=c||53637&lt;=c&amp;&amp;53663&gt;=c||53665&lt;=c&amp;&amp;53691&gt;=c||53693&lt;=c&amp;&amp;53719&gt;=c||53721&lt;=c&amp;&amp;53747&gt;=c||53749&lt;=c&amp;&amp;53775&gt;=c||53777&lt;=c&amp;&amp;53803&gt;=
c||53805&lt;=c&amp;&amp;53831&gt;=c||53833&lt;=c&amp;&amp;53859&gt;=c||53861&lt;=c&amp;&amp;53887&gt;=c||53889&lt;=c&amp;&amp;53915&gt;=c||53917&lt;=c&amp;&amp;53943&gt;=c||53945&lt;=c&amp;&amp;53971&gt;=c||53973&lt;=c&amp;&amp;53999&gt;=c||54001&lt;=c&amp;&amp;54027&gt;=c||54029&lt;=c&amp;&amp;54055&gt;=c||54057&lt;=c&amp;&amp;54083&gt;=c||54085&lt;=c&amp;&amp;54111&gt;=c||54113&lt;=c&amp;&amp;54139&gt;=c||54141&lt;=c&amp;&amp;54167&gt;=c||54169&lt;=c&amp;&amp;54195&gt;=c||54197&lt;=c&amp;&amp;54223&gt;=c||54225&lt;=c&amp;&amp;54251&gt;=c||54253&lt;=c&amp;&amp;54279&gt;=c||54281&lt;=c&amp;&amp;54307&gt;=c||54309&lt;=c&amp;&amp;54335&gt;=c||54337&lt;=c&amp;&amp;54363&gt;=c||54365&lt;=c&amp;&amp;54391&gt;=c||54393&lt;=c&amp;&amp;54419&gt;=c||54421&lt;=c&amp;&amp;54447&gt;=c||54449&lt;=c&amp;&amp;54475&gt;=c||54477&lt;=c&amp;&amp;54503&gt;=c||
54505&lt;=c&amp;&amp;54531&gt;=c||54533&lt;=c&amp;&amp;54559&gt;=c||54561&lt;=c&amp;&amp;54587&gt;=c||54589&lt;=c&amp;&amp;54615&gt;=c||54617&lt;=c&amp;&amp;54643&gt;=c||54645&lt;=c&amp;&amp;54671&gt;=c||54673&lt;=c&amp;&amp;54699&gt;=c||54701&lt;=c&amp;&amp;54727&gt;=c||54729&lt;=c&amp;&amp;54755&gt;=c||54757&lt;=c&amp;&amp;54783&gt;=c||54785&lt;=c&amp;&amp;54811&gt;=c||54813&lt;=c&amp;&amp;54839&gt;=c||54841&lt;=c&amp;&amp;54867&gt;=c||54869&lt;=c&amp;&amp;54895&gt;=c||54897&lt;=c&amp;&amp;54923&gt;=c||54925&lt;=c&amp;&amp;54951&gt;=c||54953&lt;=c&amp;&amp;54979&gt;=c||54981&lt;=c&amp;&amp;55007&gt;=c||55009&lt;=c&amp;&amp;55035&gt;=c||55037&lt;=c&amp;&amp;55063&gt;=c||55065&lt;=c&amp;&amp;55091&gt;=c||55093&lt;=c&amp;&amp;55119&gt;=c||55121&lt;=c&amp;&amp;55147&gt;=c||55149&lt;=c&amp;&amp;55175&gt;=c||55177&lt;=c&amp;&amp;55203&gt;=c?10:
9757==c||9977==c||9994&lt;=c&amp;&amp;9997&gt;=c||127877==c||127938&lt;=c&amp;&amp;127940&gt;=c||127943==c||127946&lt;=c&amp;&amp;127948&gt;=c||128066&lt;=c&amp;&amp;128067&gt;=c||128070&lt;=c&amp;&amp;128080&gt;=c||128110==c||128112&lt;=c&amp;&amp;128120&gt;=c||128124==c||128129&lt;=c&amp;&amp;128131&gt;=c||128133&lt;=c&amp;&amp;128135&gt;=c||128170==c||128372&lt;=c&amp;&amp;128373&gt;=c||128378==c||128400==c||128405&lt;=c&amp;&amp;128406&gt;=c||128581&lt;=c&amp;&amp;128583&gt;=c||128587&lt;=c&amp;&amp;128591&gt;=c||128675==c||128692&lt;=c&amp;&amp;128694&gt;=c||128704==c||128716==c||129304&lt;=c&amp;&amp;129308&gt;=c||129310&lt;=c&amp;&amp;129311&gt;=c||129318==c||129328&lt;=c&amp;&amp;129337&gt;=c||129341&lt;=c&amp;&amp;129342&gt;=
c||129489&lt;=c&amp;&amp;129501&gt;=c?13:127995&lt;=c&amp;&amp;127999&gt;=c?14:8205==c?15:9792==c||9794==c||9877&lt;=c&amp;&amp;9878&gt;=c||9992==c||10084==c||127752==c||127806==c||127859==c||127891==c||127908==c||127912==c||127979==c||127981==c||128139==c||128187&lt;=c&amp;&amp;128188&gt;=c||128295==c||128300==c||128488==c||128640==c||128658==c?16:128102&lt;=c&amp;&amp;128105&gt;=c?17:11}this.nextBreak=function(c,e){void 0===e&amp;&amp;(e=0);if(0&gt;e)return 0;if(e&gt;=c.length-1)return c.length;var h=d(a(c,e)),k=[];for(e+=1;e&lt;c.length;e++){var m=c,p=e-1;if(!(55296&lt;=m.charCodeAt(p)&amp;&amp;
56319&gt;=m.charCodeAt(p)&amp;&amp;56320&lt;=m.charCodeAt(p+1)&amp;&amp;57343&gt;=m.charCodeAt(p+1))){m=d(a(c,e));if(b(h,k,m))return e;k.push(m)}}return c.length};this.splitGraphemes=function(c){for(var e=[],h=0,k;(k=this.nextBreak(c,h))&lt;c.length;)e.push(c.slice(h,k)),h=k;h&lt;c.length&amp;&amp;e.push(c.slice(h));return e};this.iterateGraphemes=function(c){var e=0,h={next:function(){var k;if((k=this.nextBreak(c,e))&lt;c.length){var m=c.slice(e,k);e=k;return{value:m,done:!1}}return e&lt;c.length?(m=c.slice(e),e=c.length,{value:m,done:!1}):
{value:void 0,done:!0}}.bind(this)};"undefined"!==typeof Symbol&amp;&amp;Symbol.iterator&amp;&amp;(h[Symbol.iterator]=function(){return h});return h};this.countGraphemes=function(c){for(var e=0,h=0,k;(k=this.nextBreak(c,h))&lt;c.length;)h=k,e++;h&lt;c.length&amp;&amp;e++;return e};return this};"use strict";
function lineInt(a,b,d){var c=[0,0];var e=a[1][1]-a[0][1];var h=a[0][0]-a[1][0];a=e*a[0][0]+h*a[0][1];var k=b[1][1]-b[0][1];var m=b[0][0]-b[1][0];b=k*b[0][0]+m*b[0][1];var p=e*m-k*h;scalar_eq(p,0,d||0)||(c[0]=(m*a-h*b)/p,c[1]=(e*b-k*a)/p);return c}function lineSegmentsIntersect(a,b,d,c){var e=b[0]-a[0];b=b[1]-a[1];var h=c[0]-d[0],k=c[1]-d[1];if(0===h*b-k*e)return!1;c=(e*(d[1]-a[1])+b*(a[0]-d[0]))/(h*b-k*e);a=(h*(a[1]-d[1])+k*(d[0]-a[0]))/(k*e-h*b);return 0&lt;=c&amp;&amp;1&gt;=c&amp;&amp;0&lt;=a&amp;&amp;1&gt;=a}
function triangleArea(a,b,d){return(b[0]-a[0])*(d[1]-a[1])-(d[0]-a[0])*(b[1]-a[1])}function isLeft(a,b,d){return 0&lt;triangleArea(a,b,d)}function isLeftOn(a,b,d){return 0&lt;=triangleArea(a,b,d)}function isRight(a,b,d){return 0&gt;triangleArea(a,b,d)}function isRightOn(a,b,d){return 0&gt;=triangleArea(a,b,d)}var tmpPoint1$$module$str$c3runtime=[],tmpPoint2$$module$str$c3runtime=[];
function collinear(a,b,d,c){if(c){var e=tmpPoint1$$module$str$c3runtime,h=tmpPoint2$$module$str$c3runtime;e[0]=b[0]-a[0];e[1]=b[1]-a[1];h[0]=d[0]-b[0];h[1]=d[1]-b[1];return Math.acos((e[0]*h[0]+e[1]*h[1])/(Math.sqrt(e[0]*e[0]+e[1]*e[1])*Math.sqrt(h[0]*h[0]+h[1]*h[1])))&lt;c}return 0===triangleArea(a,b,d)}function sqdist(a,b){var d=b[0]-a[0];a=b[1]-a[1];return d*d+a*a}function polygonAt(a,b){var d=a.length;return a[0&gt;b?b%d+d:b%d]}function polygonClear(a){a.length=0}
function polygonAppend(a,b,d,c){for(;d&lt;c;d++)a.push(b[d])}function polygonReverse(a){for(var b=[],d=a.length,c=0;c!==d;c++)b.push(a.pop());for(c=0;c!==d;c++)a[c]=b[c]}function polygonIsReflex(a,b){return isRight(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,b+1))}var tmpLine1$$module$str$c3runtime=[],tmpLine2$$module$str$c3runtime=[];
function polygonCanSee(a,b,d){var c=tmpLine1$$module$str$c3runtime,e=tmpLine2$$module$str$c3runtime;if(isLeftOn(polygonAt(a,b+1),polygonAt(a,b),polygonAt(a,d))&amp;&amp;isRightOn(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,d)))return!1;var h=sqdist(polygonAt(a,b),polygonAt(a,d));for(var k=0;k!==a.length;++k)if((k+1)%a.length!==b&amp;&amp;k!==b&amp;&amp;isLeftOn(polygonAt(a,b),polygonAt(a,d),polygonAt(a,k+1))&amp;&amp;isRightOn(polygonAt(a,b),polygonAt(a,d),polygonAt(a,k))){c[0]=polygonAt(a,b);c[1]=polygonAt(a,d);e[0]=polygonAt(a,
k);e[1]=polygonAt(a,k+1);var m=lineInt(c,e);if(sqdist(polygonAt(a,b),m)&lt;h)return!1}return!0}function polygonCanSee2(a,b,d){for(var c=0;c!==a.length;++c)if(c!==b&amp;&amp;c!==d&amp;&amp;(c+1)%a.length!==b&amp;&amp;(c+1)%a.length!==d&amp;&amp;lineSegmentsIntersect(polygonAt(a,b),polygonAt(a,d),polygonAt(a,c),polygonAt(a,c+1)))return!1;return!0}function polygonCopy(a,b,d,c){c=c||[];polygonClear(c);if(b&lt;d)for(var e=b;e&lt;=d;e++)c.push(a[e]);else{for(e=0;e&lt;=d;e++)c.push(a[e]);for(e=b;e&lt;a.length;e++)c.push(a[e])}return c}
function polygonGetCutEdges(a){for(var b=[],d,c,e=[],h=Number.MAX_VALUE,k=0;k&lt;a.length;++k)if(polygonIsReflex(a,k))for(var m=0;m&lt;a.length;++m)if(polygonCanSee(a,k,m)){d=polygonGetCutEdges(polygonCopy(a,k,m,e));c=polygonGetCutEdges(polygonCopy(a,m,k,e));for(var p=0;p&lt;c.length;p++)d.push(c[p]);d.length&lt;h&amp;&amp;(b=d,h=d.length,b.push([polygonAt(a,k),polygonAt(a,m)]))}return b}
function polygonSlice(a,b){if(0===b.length)return[a];if(b instanceof Array&amp;&amp;b.length&amp;&amp;b[0]instanceof Array&amp;&amp;2===b[0].length&amp;&amp;b[0][0]instanceof Array){a=[a];for(var d=0;d&lt;b.length;d++)for(var c=b[d],e=0;e&lt;a.length;e++){var h=polygonSlice(a[e],c);if(h){a.splice(e,1);a.push(h[0],h[1]);break}}return a}c=b;d=a.indexOf(c[0]);e=a.indexOf(c[1]);return-1!==d&amp;&amp;-1!==e?[polygonCopy(a,d,e),polygonCopy(a,e,d)]:!1}
function getIntersectionPoint(a,b,d,c,e){var h=b[1]-a[1];b=a[0]-b[0];a=h*a[0]+b*a[1];var k=c[1]-d[1];c=d[0]-c[0];d=k*d[0]+c*d[1];var m=h*c-k*b;return scalar_eq(m,0,e||0)?[0,0]:[(c*a-b*d)/m,(h*d-k*a)/m]}
function polygonQuickDecomp(a,b,d,c,e,h,k){h=h||100;k=k||0;e=e||25;b="undefined"!==typeof b?b:[];d=d||[];c=c||[];var m=[0,0],p=[0,0],q=[0,0],v,x=0,A=0,C=0,D=[],G=[];if(3&gt;a.length)return b;k++;if(k&gt;h)return console.warn("quickDecomp: max level ("+h+") reached."),b;for(var E=0;E&lt;a.length;++E)if(polygonIsReflex(a,E)){d.push(a[E]);var J=v=Number.MAX_VALUE;for(var L=0;L&lt;a.length;++L){if(isLeft(polygonAt(a,E-1),polygonAt(a,E),polygonAt(a,L))&amp;&amp;isRightOn(polygonAt(a,E-1),polygonAt(a,E),polygonAt(a,L-1))&amp;&amp;
(q=getIntersectionPoint(polygonAt(a,E-1),polygonAt(a,E),polygonAt(a,L),polygonAt(a,L-1)),isRight(polygonAt(a,E+1),polygonAt(a,E),q))){var O=sqdist(a[E],q);O&lt;v&amp;&amp;(v=O,p=q,A=L)}isLeft(polygonAt(a,E+1),polygonAt(a,E),polygonAt(a,L+1))&amp;&amp;isRightOn(polygonAt(a,E+1),polygonAt(a,E),polygonAt(a,L))&amp;&amp;(q=getIntersectionPoint(polygonAt(a,E+1),polygonAt(a,E),polygonAt(a,L),polygonAt(a,L+1)),isLeft(polygonAt(a,E-1),polygonAt(a,E),q)&amp;&amp;(O=sqdist(a[E],q),O&lt;J&amp;&amp;(J=O,m=q,x=L)))}if(A===(x+1)%a.length)q[0]=(p[0]+m[0])/
2,q[1]=(p[1]+m[1])/2,c.push(q),E&lt;x?(polygonAppend(D,a,E,x+1),D.push(q),G.push(q),0!==A&amp;&amp;polygonAppend(G,a,A,a.length),polygonAppend(G,a,0,E+1)):(0!==E&amp;&amp;polygonAppend(D,a,E,a.length),polygonAppend(D,a,0,x+1),D.push(q),G.push(q),polygonAppend(G,a,A,E+1));else{A&gt;x&amp;&amp;(x+=a.length);m=Number.MAX_VALUE;if(x&lt;A)return b;for(L=A;L&lt;=x;++L)isLeftOn(polygonAt(a,E-1),polygonAt(a,E),polygonAt(a,L))&amp;&amp;isRightOn(polygonAt(a,E+1),polygonAt(a,E),polygonAt(a,L))&amp;&amp;(O=sqdist(polygonAt(a,E),polygonAt(a,L)),O&lt;m&amp;&amp;polygonCanSee2(a,
E,L)&amp;&amp;(m=O,C=L%a.length));E&lt;C?(polygonAppend(D,a,E,C+1),0!==C&amp;&amp;polygonAppend(G,a,C,a.length),polygonAppend(G,a,0,E+1)):(0!==E&amp;&amp;polygonAppend(D,a,E,a.length),polygonAppend(D,a,0,C+1),polygonAppend(G,a,C,E+1))}D.length&lt;G.length?(polygonQuickDecomp(D,b,d,c,e,h,k),polygonQuickDecomp(G,b,d,c,e,h,k)):(polygonQuickDecomp(G,b,d,c,e,h,k),polygonQuickDecomp(D,b,d,c,e,h,k));return b}b.push(a);return b}function scalar_eq(a,b,d){return Math.abs(a-b)&lt;=(d||0)}
function points_eq(a,b,d){return scalar_eq(a[0],b[0],d)&amp;&amp;scalar_eq(a[1],b[1],d)}
self.polyDecomp={decomp:function(a){var b=polygonGetCutEdges(a);return 0&lt;b.length?polygonSlice(a,b):[a]},quickDecomp:polygonQuickDecomp,isSimple:function(a){var b;for(b=0;b&lt;a.length-1;b++)for(var d=0;d&lt;b-1;d++)if(lineSegmentsIntersect(a[b],a[b+1],a[d],a[d+1]))return!1;for(b=1;b&lt;a.length-2;b++)if(lineSegmentsIntersect(a[0],a[a.length-1],a[b],a[b+1]))return!1;return!0},removeCollinearPoints:function(a,b){for(var d=0,c=a.length-1;3&lt;a.length&amp;&amp;0&lt;=c;--c)collinear(polygonAt(a,c-1),polygonAt(a,c),polygonAt(a,
c+1),b)&amp;&amp;(a.splice(c%a.length,1),d++);return d},removeDuplicatePoints:function(a,b){for(var d=a.length-1;1&lt;=d;--d)for(var c=a[d],e=d-1;0&lt;=e;--e)points_eq(c,a[e],b)&amp;&amp;a.splice(d,1)},makeCCW:function(a){for(var b=0,d=1;d&lt;a.length;++d)if(a[d][1]&lt;a[b][1]||a[d][1]===a[b][1]&amp;&amp;a[d][0]&gt;a[b][0])b=d;if(isLeft(polygonAt(a,b-1),polygonAt(a,b),polygonAt(a,b+1)))return!1;polygonReverse(a);return!0}};"use strict";let isReady=!1,hasAppStarted=!1,buildMode="dev";
const C3$jscomp$1=self.C3=class{constructor(){throw TypeError("static class can't be instantiated");}static SetReady(){isReady=!0}static IsReady(){return isReady}static SetAppStarted(){hasAppStarted=!0}static HasAppStarted(){return hasAppStarted}static SetBuildMode(a){buildMode=a}static GetBuildMode(){return buildMode}static IsReleaseBuild(){return"final"===buildMode}};C3$jscomp$1.isDebug=!1;C3$jscomp$1.isDebugDefend=!1;C3$jscomp$1.hardwareConcurrency=navigator.hardwareConcurrency||2;self.C3X={};
"use strict";const C3$jscomp$3=self.C3;
C3$jscomp$3.QueryParser=class{constructor(a){this._queryString=a;this._parameters=new Map;this._Parse()}_Parse(){var a=this._queryString;if(a.startsWith("?")||a.startsWith("#"))a=a.substr(1);a=a.split("&amp;");for(const b of a)this._ParseParameter(b)}_ParseParameter(a){if(a)if(a.includes("=")){var b=a.indexOf("="),d=decodeURIComponent(a.substring(0,b));a=decodeURIComponent(a.substring(b+1));this._parameters.set(d,a)}else this._parameters.set(a,null)}LogAll(){for(const a of this._parameters)console.log("[QueryParser] Parameter '"+a[0]+
"' = "+(null===a[1]?"null":"'"+a[1]+"'"))}Has(a){return this._parameters.has(a)}Get(a){a=this._parameters.get(a);return"undefined"===typeof a?null:a}ClearHash(){history.replaceState("",document.title,location.pathname+location.search)}Reparse(a){this._queryString=a;this._parameters.clear();this._Parse()}};C3$jscomp$3.QueryString=new C3$jscomp$3.QueryParser(location.search);C3$jscomp$3.LocationHashString=new C3$jscomp$3.QueryParser(location.hash);
C3$jscomp$3.QueryString.Has("perf")&amp;&amp;(C3$jscomp$3.isPerformanceProfiling=!0);"dev"!==C3$jscomp$3.QueryString.Get("mode")&amp;&amp;C3$jscomp$3.SetBuildMode("final");"use strict";const C3$jscomp$4=self.C3;C3$jscomp$4.Platform={OS:"(unknown)",OSVersion:"(unknown)",Browser:"(unknown)",BrowserVersion:"(unknown)",BrowserVersionNumber:NaN,BrowserEngine:"(unknown)",Context:"browser",IsDesktop:!0,IsMobile:!1,IsAppleOS:!1,IsIpadOS:!1,GetDetailedInfo:async()=&gt;{}};
const windowsNTVerMap=new Map([[5,"2000"],[5.1,"XP"],[5.2,"XP"],[6,"Vista"],[6.1,"7"],[6.2,"8"],[6.3,"8.1"],[10,"10"]]);function GetWindowsNTVersionName(a){const b=parseFloat(a),d=windowsNTVerMap.get(b);return d?d:13&lt;=b?"11":"NT "+a}const uaStr=navigator.userAgent,uaData=navigator.userAgentData;
if(uaData&amp;&amp;0&lt;uaData.brands.length){C3$jscomp$4.Platform.OS=uaData.platform;C3$jscomp$4.Platform.IsMobile=uaData.mobile;C3$jscomp$4.Platform.IsDesktop=!C3$jscomp$4.Platform.IsMobile;const a=new Map([["Google Chrome","Chrome"],["Microsoft Edge","Edge"],["Opera","Opera"],["Opera GX","Opera GX"],["Mozilla Firefox","Firefox"],["Apple Safari","Safari"],["NW.js","NW.js"]]),b=new Map([["Chromium","Chromium"],["Gecko","Gecko"],["WebKit","WebKit"]]);function d(e){let h="",k="",m="",p="";for(const q of e)e=
a.get(q.brand),!h&amp;&amp;e&amp;&amp;(h=e,k=q.version),e=b.get(q.brand),!m&amp;&amp;e&amp;&amp;(m=e,p=q.version);h||"Chromium"!==m||(C3$jscomp$4.Platform.Browser="Chromium",C3$jscomp$4.Platform.BrowserVersion=p);C3$jscomp$4.Platform.Browser=h||"(unknown)";C3$jscomp$4.Platform.BrowserVersion=k||"(unknown)";C3$jscomp$4.Platform.BrowserEngine=m||"(unknown)"}d(uaData.brands);let c=!1;C3$jscomp$4.Platform.GetDetailedInfo=async()=&gt;{if(!c)try{const e=await navigator.userAgentData.getHighEntropyValues(["platformVersion","fullVersionList"]);
d(e.fullVersionList);C3$jscomp$4.Platform.OSVersion="Windows"===C3$jscomp$4.Platform.OS?GetWindowsNTVersionName(e.platformVersion):e.platformVersion;c=!0}catch(e){console.warn("Failed to get detailed user agent information: ",e)}}}else{function a(q,v){q=Array.isArray(q)?q:[q];for(const x of q)if(q=x.exec(uaStr)){v(q);break}}a(/windows\s+nt\s+([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.OS="Windows";C3$jscomp$4.Platform.OSVersion=GetWindowsNTVersionName(q[1])});a(/mac\s+os\s+x\s+([\d\._]+)/i,q=&gt;{C3$jscomp$4.Platform.OS=
"macOS";C3$jscomp$4.Platform.OSVersion=q[1].replace(/_/g,".")});a(/CrOS/,()=&gt;{C3$jscomp$4.Platform.OS="Chrome OS"});a(/linux|openbsd|freebsd|netbsd/i,()=&gt;{C3$jscomp$4.Platform.OS="Linux"});a(/android/i,()=&gt;{C3$jscomp$4.Platform.OS="Android"});a(/android\s+([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.OS="Android";C3$jscomp$4.Platform.OSVersion=q[1]});"(unknown)"===C3$jscomp$4.Platform.OS&amp;&amp;(a(/(iphone|ipod|ipad)/i,q=&gt;{C3$jscomp$4.Platform.OS="iOS"}),a([/iphone\s+os\s+([\d\._]+)/i,/ipad[^)]*os\s+([\d\._]+)/i],
q=&gt;{C3$jscomp$4.Platform.OS="iOS";C3$jscomp$4.Platform.OSVersion=q[1].replace(/_/g,".")}));const b=/chrome\//i.test(uaStr),d=/chromium\//i.test(uaStr),c=/edg\//i.test(uaStr),e=/OPR\//.test(uaStr),h=/nwjs/i.test(uaStr),k=/safari\//i.test(uaStr),m=/webkit/i.test(uaStr);c||e||a(/chrome\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Chrome";C3$jscomp$4.Platform.BrowserVersion=q[1];C3$jscomp$4.Platform.BrowserEngine="Chromium"});a(/edg\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Edge";C3$jscomp$4.Platform.BrowserVersion=
q[1];C3$jscomp$4.Platform.BrowserEngine="Chromium"});a(/OPR\/([\d\.]+)/,q=&gt;{C3$jscomp$4.Platform.Browser="Opera";C3$jscomp$4.Platform.BrowserVersion=q[1];C3$jscomp$4.Platform.BrowserEngine="Chromium"});a(/chromium\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Chromium";C3$jscomp$4.Platform.BrowserVersion=q[1];C3$jscomp$4.Platform.BrowserEngine="Chromium"});a(/nwjs\/[0-9.]+/i,q=&gt;{C3$jscomp$4.Platform.Browser="NW.js";C3$jscomp$4.Platform.BrowserVersion=q[1];C3$jscomp$4.Platform.BrowserEngine="Chromium";
C3$jscomp$4.Platform.Context="nwjs"});a(/firefox\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Firefox";C3$jscomp$4.Platform.BrowserVersion=q[1];C3$jscomp$4.Platform.BrowserEngine="Gecko"});!k||b||d||c||e||h||(C3$jscomp$4.Platform.Browser="Safari",C3$jscomp$4.Platform.BrowserEngine="WebKit",a(/version\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.BrowserVersion=q[1]}),a(/crios\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Chrome for iOS";C3$jscomp$4.Platform.BrowserVersion=q[1]}),a(/fxios\/([\d\.]+)/i,
q=&gt;{C3$jscomp$4.Platform.Browser="Firefox for iOS";C3$jscomp$4.Platform.BrowserVersion=q[1]}),a(/edgios\/([\d\.]+)/i,q=&gt;{C3$jscomp$4.Platform.Browser="Edge for iOS";C3$jscomp$4.Platform.BrowserVersion=q[1]}));"(unknown)"===C3$jscomp$4.Platform.BrowserEngine&amp;&amp;m&amp;&amp;(C3$jscomp$4.Platform.BrowserEngine="WebKit");"Android"===C3$jscomp$4.Platform.OS&amp;&amp;"Safari"===C3$jscomp$4.Platform.Browser&amp;&amp;(C3$jscomp$4.Platform.Browser="Stock");const p=(new Set(["Windows","macOS","Linux","Chrome OS"])).has(C3$jscomp$4.Platform.OS)||
"nwjs"===C3$jscomp$4.Platform.Context;C3$jscomp$4.Platform.IsDesktop=p;C3$jscomp$4.Platform.IsMobile=!p}"Chrome"===C3$jscomp$4.Platform.Browser&amp;&amp;"browser"===C3$jscomp$4.Platform.Context&amp;&amp;/wv\)/.test(uaStr)&amp;&amp;(C3$jscomp$4.Platform.Context="webview");"nwjs"!==C3$jscomp$4.Platform.Context&amp;&amp;"undefined"!==typeof window&amp;&amp;(window.matchMedia&amp;&amp;window.matchMedia("(display-mode: standalone)").matches||navigator.standalone)&amp;&amp;(C3$jscomp$4.Platform.Context="webapp");C3$jscomp$4.Platform.BrowserVersionNumber=parseFloat(C3$jscomp$4.Platform.BrowserVersion);
"macOS"===C3$jscomp$4.Platform.OS&amp;&amp;navigator.maxTouchPoints&amp;&amp;2&lt;navigator.maxTouchPoints&amp;&amp;(C3$jscomp$4.Platform.OS="iOS",C3$jscomp$4.Platform.OSVersion=C3$jscomp$4.Platform.BrowserVersion,C3$jscomp$4.Platform.IsDesktop=!1,C3$jscomp$4.Platform.IsMobile=!0,C3$jscomp$4.Platform.IsIpadOS=!0);C3$jscomp$4.Platform.IsAppleOS="macOS"===C3$jscomp$4.Platform.OS||"iOS"===C3$jscomp$4.Platform.OS;"use strict";
const DATABASE_PROMISE_MAP=new Map,SUPPORTS_GETALL="undefined"!==typeof IDBObjectStore&amp;&amp;"function"===typeof IDBObjectStore.prototype.getAll,SUPPORTS_GETALLKEYS="undefined"!==typeof IDBObjectStore&amp;&amp;"function"===typeof IDBObjectStore.prototype.getAllKeys;function asyncifyRequest(a){return new Promise((b,d)=&gt;{a.onsuccess=()=&gt;b(a.result);a.onerror=()=&gt;d(a.error)})}function asyncifyTransaction(a){return new Promise((b,d)=&gt;{a.oncomplete=()=&gt;b();a.onerror=()=&gt;d(a.error);a.onabort=()=&gt;d(a.error)})}
function openReadOnlyTransaction(a,b){return openTransaction(a,b)}function openWriteTransaction(a,b){return openTransaction(a,b,!0)}async function openTransaction(a,b,d=!1,c=!0){const e=await lazyOpenDatabase(a);try{const h=e.transaction(["keyvaluepairs"],d?"readwrite":"readonly");return b(h)}catch(h){if(c&amp;&amp;"InvalidStateError"===h.name)return DATABASE_PROMISE_MAP.delete(a),openTransaction(a,b,d,!1);throw h;}}
function lazyOpenDatabase(a){RequireString(a);let b=DATABASE_PROMISE_MAP.get(a);b instanceof Promise||(b=openDatabase$jscomp$1(a),DATABASE_PROMISE_MAP.set(a,b),b.catch(d=&gt;DATABASE_PROMISE_MAP.delete(a)));return b}async function openDatabase$jscomp$1(a){RequireString(a);const b=indexedDB.open(a,2);b.addEventListener("upgradeneeded",d=&gt;{try{d.target.result.createObjectStore("keyvaluepairs")}catch(c){console.error(`Failed to create objectstore for database ${a}`,c)}});return asyncifyRequest(b)}
function RequireString(a){if("string"!==typeof a)throw new TypeError("expected string");}function getEntriesFromCursor(a,b){const d=a.objectStore("keyvaluepairs").openCursor();return new Promise(c=&gt;{const e=[];d.onsuccess=h=&gt;{if(h=h.target.result){switch(b){case "entries":e.push([h.key,h.value]);break;case "keys":e.push(h.key);break;case "values":e.push(h.value)}h.continue()}else c(e)}})}
class KVStorageContainer{constructor(a){RequireString(a);this.name=a}async ready(){await lazyOpenDatabase(this.name)}set(a,b){RequireString(a);return openWriteTransaction(this.name,async d=&gt;{var c=d.objectStore("keyvaluepairs").put(b,a);c=asyncifyRequest(c);d=asyncifyTransaction(d);await Promise.all([d,c])})}get(a){RequireString(a);return openReadOnlyTransaction(this.name,async b=&gt;{var d=b.objectStore("keyvaluepairs").get(a);d=asyncifyRequest(d);b=asyncifyTransaction(b);[,b]=await Promise.all([b,
d]);return b})}delete(a){RequireString(a);return openWriteTransaction(this.name,async b=&gt;{var d=b.objectStore("keyvaluepairs").delete(a);d=asyncifyRequest(d);b=asyncifyTransaction(b);await Promise.all([b,d])})}clear(){return openWriteTransaction(this.name,async a=&gt;{var b=a.objectStore("keyvaluepairs").clear();b=asyncifyRequest(b);a=asyncifyTransaction(a);await Promise.all([a,b])})}keys(){return openReadOnlyTransaction(this.name,async a=&gt;{if(SUPPORTS_GETALLKEYS){var b=a.objectStore("keyvaluepairs").getAllKeys();
b=asyncifyRequest(b)}else b=getEntriesFromCursor(a,"keys");a=asyncifyTransaction(a);[,a]=await Promise.all([a,b]);return a})}values(){return openReadOnlyTransaction(this.name,async a=&gt;{if(SUPPORTS_GETALL){var b=a.objectStore("keyvaluepairs").getAll();b=asyncifyRequest(b)}else b=getEntriesFromCursor(a,"values");a=asyncifyTransaction(a);[,a]=await Promise.all([a,b]);return a})}entries(){return openReadOnlyTransaction(this.name,async a=&gt;{var b=getEntriesFromCursor(a,"entries");a=asyncifyTransaction(a);
[,b]=await Promise.all([a,b]);return b})}}self.KVStorageContainer=KVStorageContainer;"use strict";const KVStorageContainer$jscomp$1=self.KVStorageContainer,CRITICAL_ERRORS=[/no available storage method found/i,/an attempt was made to break through the security policy of the user agent/i,/the user denied permission to access the database/i,/a mutation operation was attempted on a database that did not allow mutations/i,/idbfactory\.open\(\) called in an invalid security context/i],memoryStorage=new WeakMap;
let isInMemory=!1;"undefined"===typeof indexedDB&amp;&amp;(isInMemory=!0,console.warn("Unable to use local storage because indexedDB is not defined"));function NOT_IMPLEMENTED(a){throw Error(`"${a}" is not implemented`);}function DISALLOW_CALLBACK(a){if("function"===typeof a)throw Error("localforage callback API is not implemented; please use the promise API instead");}
function StructuredClone(a){return"object"===typeof a?new Promise(b=&gt;{const {port1:d,port2:c}=new MessageChannel;c.onmessage=e=&gt;b(e.data);d.postMessage(a)}):Promise.resolve(a)}
class ForageAdaptor{constructor(a){this._inst=a;memoryStorage.set(this,new Map)}_MaybeSwitchToMemoryFallback(a){if(!isInMemory)for(const b of CRITICAL_ERRORS)if(a&amp;&amp;b.test(a.message)){console.error("Unable to use local storage, reverting to in-memory store: ",a,a.message);isInMemory=!0;break}}async _getItemFallback(a){a=memoryStorage.get(this).get(a);a=await StructuredClone(a);return"undefined"===typeof a?null:a}async _setItemFallback(a,b){b=await StructuredClone(b);memoryStorage.get(this).set(a,b)}_removeItemFallback(a){memoryStorage.get(this).delete(a)}_clearFallback(){memoryStorage.get(this).clear()}_keysFallback(){return Array.from(memoryStorage.get(this).keys())}IsUsingFallback(){return isInMemory}async getItem(a,
b){DISALLOW_CALLBACK(b);if(isInMemory)return await this._getItemFallback(a);let d;try{d=await this._inst.get(a)}catch(c){this._MaybeSwitchToMemoryFallback(c);if(isInMemory)return await this._getItemFallback(a);console.error(`Error reading '${a}' from storage, returning null: `,c);return null}return"undefined"===typeof d?null:d}async setItem(a,b,d){DISALLOW_CALLBACK(d);"undefined"===typeof b&amp;&amp;(b=null);if(isInMemory)await this._setItemFallback(a,b);else try{await this._inst.set(a,b)}catch(c){if(this._MaybeSwitchToMemoryFallback(c),
isInMemory)await this._setItemFallback(a,b);else throw c;}}async removeItem(a,b){DISALLOW_CALLBACK(b);if(isInMemory)this._removeItemFallback(a);else try{await this._inst.delete(a)}catch(d){this._MaybeSwitchToMemoryFallback(d),isInMemory?this._removeItemFallback(a):console.error(`Error removing '${a}' from storage: `,d)}}async clear(a){DISALLOW_CALLBACK(a);if(isInMemory)this._clearFallback();else try{await this._inst.clear()}catch(b){this._MaybeSwitchToMemoryFallback(b),isInMemory?this._clearFallback():
console.error("Error clearing storage: ",b)}}async keys(a){DISALLOW_CALLBACK(a);if(isInMemory)return this._keysFallback();a=[];try{a=await this._inst.keys()}catch(b){this._MaybeSwitchToMemoryFallback(b);if(isInMemory)return this._keysFallback();console.error("Error getting storage keys: ",b)}return a}ready(a){DISALLOW_CALLBACK(a);return isInMemory?Promise.resolve(!0):this._inst.ready()}createInstance(a){if("object"!==typeof a)throw new TypeError("invalid options object");a=a.name;if("string"!==typeof a)throw new TypeError("invalid store name");
a=new KVStorageContainer$jscomp$1(a);return new ForageAdaptor(a)}length(a){NOT_IMPLEMENTED("localforage.length()")}key(a,b){NOT_IMPLEMENTED("localforage.key()")}iterate(a,b){NOT_IMPLEMENTED("localforage.iterate()")}setDriver(a){NOT_IMPLEMENTED("localforage.setDriver()")}config(a){NOT_IMPLEMENTED("localforage.config()")}defineDriver(a){NOT_IMPLEMENTED("localforage.defineDriver()")}driver(){NOT_IMPLEMENTED("localforage.driver()")}supports(a){NOT_IMPLEMENTED("localforage.supports()")}dropInstance(){NOT_IMPLEMENTED("localforage.dropInstance()")}disableMemoryMode(){isInMemory=
!1}}self.localforage=new ForageAdaptor(new KVStorageContainer$jscomp$1("localforage"));"use strict";const C3$jscomp$5=self.C3;C3$jscomp$5.Supports={};C3$jscomp$5.Supports.WebAnimations=(()=&gt;{try{if("Safari"===C3$jscomp$5.Platform.Browser||"undefined"===typeof document)return!1;const a=document.createElement("div");return"undefined"===typeof a.animate?!1:"undefined"!==typeof a.animate([{opacity:"0"},{opacity:"1"}],1E3).reverse}catch(a){return!1}})();
C3$jscomp$5.Supports.DialogElement="undefined"!==typeof HTMLDialogElement;C3$jscomp$5.Supports.RequestIdleCallback=!!self.requestIdleCallback;C3$jscomp$5.Supports.ImageBitmap=!!self.createImageBitmap;C3$jscomp$5.Supports.ImageBitmapOptions=!1;C3$jscomp$5.Supports.ImageBitmapOptionsResize=!1;
if(C3$jscomp$5.Supports.ImageBitmap){try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:"none"}).then(()=&gt;{C3$jscomp$5.Supports.ImageBitmapOptions=!0}).catch(()=&gt;{C3$jscomp$5.Supports.ImageBitmapOptions=!1})}catch(a){C3$jscomp$5.Supports.ImageBitmapOptions=!1}try{self.createImageBitmap(new ImageData(32,32),{resizeWidth:10,resizeHeight:10}).then(a=&gt;{C3$jscomp$5.Supports.ImageBitmapOptionsResize=10===a.width&amp;&amp;10===a.height}).catch(()=&gt;{C3$jscomp$5.Supports.ImageBitmapOptionsResize=!1})}catch(a){C3$jscomp$5.Supports.ImageBitmapOptionsResize=
!1}}C3$jscomp$5.Supports.ClipboardReadText=!(!navigator.clipboard||!navigator.clipboard.readText||"Firefox"===C3$jscomp$5.Platform.Browser);C3$jscomp$5.Supports.PermissionsQuery=!(!navigator.permissions||!navigator.permissions.query);C3$jscomp$5.Supports.Proxies="undefined"!==typeof Proxy;C3$jscomp$5.Supports.DownloadAttribute=(()=&gt;"undefined"===typeof document?!1:"undefined"!==typeof document.createElement("a").download)();C3$jscomp$5.Supports.Fetch="function"===typeof fetch;
C3$jscomp$5.Supports.PersistentStorage=!!(self.isSecureContext&amp;&amp;"Opera"!==C3$jscomp$5.Platform.Browser&amp;&amp;navigator.storage&amp;&amp;navigator.storage.persist);C3$jscomp$5.Supports.StorageQuotaEstimate=!!(self.isSecureContext&amp;&amp;navigator.storage&amp;&amp;navigator.storage.estimate);C3$jscomp$5.Supports.Fullscreen=(()=&gt;{if("undefined"===typeof document||"iOS"===C3$jscomp$5.Platform.OS)return!1;const a=document.documentElement;return!!(a.requestFullscreen||a.msRequestFullscreen||a.mozRequestFullScreen||a.webkitRequestFullscreen)})();
C3$jscomp$5.Supports.ImageDecoder="undefined"!==typeof self.ImageDecoder;C3$jscomp$5.Supports.WebCodecs=!!self.VideoEncoder;C3$jscomp$5.Supports.NativeFileSystemAPI=!!self.showOpenFilePicker;C3$jscomp$5.Supports.QueryLocalFonts=!!self.queryLocalFonts;C3$jscomp$5.Supports.UserActivation=!!navigator.userActivation;C3$jscomp$5.Supports.CanvasToBlobWebP=!1;
(async()=&gt;{let a;"undefined"===typeof document?a=new OffscreenCanvas(32,32):(a=document.createElement("canvas"),a.width=32,a.height=32);var b=a.getContext("2d");b.fillStyle="blue";b.fillRect(0,0,32,32);b=null;try{a.toBlob?b=await new Promise(d=&gt;a.toBlob(d,"image/webp",1)):a.convertToBlob&amp;&amp;(b=await a.convertToBlob({type:"image/webp",quality:1})),C3$jscomp$5.Supports.CanvasToBlobWebP=b&amp;&amp;"image/webp"===b.type}catch(d){C3$jscomp$5.Supports.CanvasToBlobWebP=!1}})();"use strict";const C3$jscomp$6=self.C3;
if(!String.prototype.trimStart){const a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;String.prototype.trimStart=function(){return this.replace(a,"")}}if(!String.prototype.trimEnd){const a=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;String.prototype.trimEnd=function(){return this.replace(a,"")}}
String.prototype.replaceAll||(String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(C3$jscomp$6.EscapeRegex(a),"g"),b)});Array.prototype.values||(Array.prototype.values=function*(){for(const a of this)yield a});if(!Array.prototype.flat){function a(b,d){return b.reduce((c,e)=&gt;{0&lt;d&amp;&amp;Array.isArray(e)?Array.prototype.push.apply(c,a(e,d-1)):c.push(e);return c},[])}Array.prototype.flat=function(b=1){return a(this,b)}}
Array.prototype.at||(Array.prototype.at=function(a){a=Math.trunc(a)||0;0&gt;a&amp;&amp;(a+=this.length);if(!(0&gt;a||a&gt;=this.length))return this[a]});String.prototype.at||(String.prototype.at=function(a){a=Math.trunc(a)||0;0&gt;a&amp;&amp;(a+=this.length);if(!(0&gt;a||a&gt;=this.length))return this[a]});RegExp.escape||(RegExp.escape=function(a){return String(a).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&amp;")});
navigator.storage&amp;&amp;!navigator.storage.estimate&amp;&amp;navigator.webkitTemporaryStorage&amp;&amp;navigator.webkitTemporaryStorage.queryUsageAndQuota&amp;&amp;(navigator.storage.estimate=function(){return new Promise((a,b)=&gt;navigator.webkitTemporaryStorage.queryUsageAndQuota((d,c)=&gt;a({usage:d,quota:c}),b))});"undefined"===typeof self.isSecureContext&amp;&amp;(self.isSecureContext="https:"===location.protocol);"undefined"===typeof self.globalThis&amp;&amp;(self.globalThis=self);"use strict";const C3$jscomp$7=self.C3;
function assertFail(a){let b=C3$jscomp$7.GetCallStack();console.error("Assertion failure: "+a+"\n\nStack trace:\n"+b)}self.assert=function(a,b){a||assertFail(b)};"use strict";const C3$jscomp$8=self.C3,C3X=self.C3X;C3$jscomp$8.IsNumber=function(a){return"number"===typeof a};C3$jscomp$8.IsFiniteNumber=function(a){return C3$jscomp$8.IsNumber(a)&amp;&amp;isFinite(a)};C3$jscomp$8.RequireNumber=function(a){if(!C3$jscomp$8.IsNumber(a))throw new TypeError("expected number");};C3$jscomp$8.RequireOptionalNumber=function(a){C3$jscomp$8.IsNullOrUndefined(a)};
C3$jscomp$8.RequireNumberInRange=function(a,b,d){if(!C3$jscomp$8.IsNumber(a)||isNaN(a)||b&gt;a||d&lt;a)throw new RangeError("number outside of range");};C3$jscomp$8.RequireAllNumber=function(...a){for(let b of a);};C3$jscomp$8.RequireFiniteNumber=function(a){if(!C3$jscomp$8.IsFiniteNumber(a))throw new TypeError("expected finite number");};C3$jscomp$8.RequireOptionalFiniteNumber=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllFiniteNumber=function(...a){for(let b of a);};
C3$jscomp$8.IsString=function(a){return"string"===typeof a};C3$jscomp$8.RequireString=function(a){if(!C3$jscomp$8.IsString(a))throw new TypeError("expected string");};C3$jscomp$8.RequireOptionalString=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllString=function(...a){for(let b of a);};C3$jscomp$8.IsSimpleObject=function(a){return"object"!==typeof a||null===a?!1:(a=Object.getPrototypeOf(a))?a.constructor===Object:null===a};
C3$jscomp$8.RequireSimpleObject=function(a){if(!C3$jscomp$8.IsSimpleObject(a))throw new TypeError("expected simple object");};C3$jscomp$8.RequireOptionalSimpleObject=function(a){if(!C3$jscomp$8.IsNullOrUndefined(a)&amp;&amp;!C3$jscomp$8.IsSimpleObject(a))throw new TypeError("expected simple object");};C3$jscomp$8.IsObject=function(a){return"object"===typeof a&amp;&amp;null!==a&amp;&amp;!Array.isArray(a)};C3$jscomp$8.RequireObject=function(a){if(!C3$jscomp$8.IsObject(a))throw new TypeError("expected object");};
C3$jscomp$8.RequireOptionalObject=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllObject=function(...a){for(let b of a);};C3$jscomp$8.IsFileLike=function(a){return C3$jscomp$8.IsInstanceOf(a,Blob)&amp;&amp;"string"===typeof a.name};C3$jscomp$8.RequireFileLike=function(a){if(!C3$jscomp$8.IsFileLike(a))throw new TypeError("expected file");};C3$jscomp$8.RequireOptionalFileLike=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.IsArray=function(a){return Array.isArray(a)};
C3$jscomp$8.RequireArray=function(a){if(!C3$jscomp$8.IsArray(a))throw new TypeError("expected array");};C3$jscomp$8.RequireOptionalArray=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllArray=function(...a){for(let b of a);};C3$jscomp$8.Is2DArray=function(a){return C3$jscomp$8.IsArray(a)?a.length?C3$jscomp$8.IsArray(a[0])?!0:!1:!0:!1};
C3$jscomp$8.Require2DArray=function(a){if(!C3$jscomp$8.Is2DArray(a))throw new TypeError("expected 2d array");for(let b of a)if(!C3$jscomp$8.IsArray(b))throw new TypeError("expected 2d array");};C3$jscomp$8.RequireOptional2DArray=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.IsFunction=function(a){return"function"===typeof a};
C3$jscomp$8.RequireFunction=function(a,b){if(!C3$jscomp$8.IsFunction(a))throw new TypeError("expected function");if(!C3$jscomp$8.IsNullOrUndefined(b)&amp;&amp;a!==b)throw new TypeError("expected same function reference");};C3$jscomp$8.RequireOptionalFunction=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllFunction=function(...a){for(let b of a);};
C3$jscomp$8.RequireAnyFunction=function(a,...b){if(!C3$jscomp$8.IsFunction(a))throw new TypeError("expected function");if(!b.length)throw Error("missing comparison functions");for(let d of b)if(!C3$jscomp$8.IsNullOrUndefined(d)&amp;&amp;a===d)return;throw new TypeError("expected same function reference");};C3$jscomp$8.RequireOptionalAllFunction=function(...a){if(!C3$jscomp$8.IsNullOrUndefined(a))for(let b of a);};C3$jscomp$8.IsInstanceOf=function(a,b){return a instanceof b};
C3$jscomp$8.IsInstanceOfAny=function(a,...b){for(let d of b)if(C3$jscomp$8.IsInstanceOf(a,d))return!0;return!1};C3$jscomp$8.RequireInstanceOf=function(a,b){if(!C3$jscomp$8.IsInstanceOf(a,b))throw new TypeError("unexpected type");};C3$jscomp$8.RequireOptionalInstanceOf=function(a,b){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllInstanceOf=function(a,...b){for(let d of b);};
C3$jscomp$8.RequireAnyInstanceOf=function(a,...b){if(!C3$jscomp$8.IsInstanceOfAny(a,...b))throw new TypeError("unexpected type");};C3$jscomp$8.RequireAnyOptionalInstanceOf=function(a,...b){if(!C3$jscomp$8.IsNullOrUndefined(a)&amp;&amp;!C3$jscomp$8.IsInstanceOfAny(a,...b))throw new TypeError("unexpected type");};C3$jscomp$8.IsArrayOf=function(a,b){for(let d of a)if(!C3$jscomp$8.IsInstanceOf(d,b))return!1;return!0};
C3$jscomp$8.IsArrayOfFiniteNumbers=function(a){for(let b of a)if(!C3$jscomp$8.IsFiniteNumber(b))return!1;return!0};C3$jscomp$8.RequireArrayOf=function(a,b){for(let d of a);};C3$jscomp$8.RequireOptionalArrayOf=function(a,b){if(!C3$jscomp$8.IsNullOrUndefined(a))for(let d of a);};C3$jscomp$8.RequireArrayOfAny=function(a,...b){for(let d of a);};C3$jscomp$8.RequireOptionalArrayOfAny=function(a,...b){if(!C3$jscomp$8.IsNullOrUndefined(a))for(let d of a);};
C3$jscomp$8.IsDOMNode=function(a,b){return C3$jscomp$8.IsNullOrUndefined(a)||!C3$jscomp$8.IsString(a.nodeName)?!1:!b||C3$jscomp$8.equalsNoCase(a.nodeName,b)};C3$jscomp$8.RequireDOMNode=function(a,b){if(C3$jscomp$8.IsNullOrUndefined(a)||!C3$jscomp$8.IsString(a.nodeName))throw new TypeError("expected DOM node");if(b&amp;&amp;!C3$jscomp$8.equalsNoCase(a.nodeName,b))throw new TypeError(`expected DOM '${b}' node`);};C3$jscomp$8.RequireOptionalDOMNode=function(a,b){C3$jscomp$8.IsNullOrUndefined(a)};
C3$jscomp$8.IsHTMLElement=function(a,b){return C3$jscomp$8.IsNullOrUndefined(a)||!C3$jscomp$8.IsString(a.tagName)?!1:!b||C3$jscomp$8.equalsNoCase(a.tagName,b)};C3$jscomp$8.RequireHTMLElement=function(a,b){if(C3$jscomp$8.IsNullOrUndefined(a)||!C3$jscomp$8.IsString(a.tagName))throw new TypeError("expected HTML element");if(b&amp;&amp;!C3$jscomp$8.equalsNoCase(a.tagName,b))throw new TypeError(`expected HTML '${b}' element`);};C3$jscomp$8.RequireOptionalHTMLElement=function(a,b){C3$jscomp$8.IsNullOrUndefined(a)};
C3$jscomp$8.IsDrawable=function(a){return C3$jscomp$8.IsHTMLElement(a,"img")||C3$jscomp$8.IsHTMLElement(a,"canvas")||C3$jscomp$8.IsHTMLElement(a,"video")||"undefined"!==typeof OffscreenCanvas&amp;&amp;a instanceof OffscreenCanvas||"undefined"!==typeof ImageBitmap&amp;&amp;a instanceof ImageBitmap};C3$jscomp$8.RequireDrawable=function(a){if(!C3$jscomp$8.IsDrawable(a))throw new TypeError("expected drawable");};C3$jscomp$8.RequireOptionalDrawable=function(a){C3$jscomp$8.IsNullOrUndefined(a)};
C3$jscomp$8.IsDrawableOrImageData=function(a){return a instanceof ImageData?!0:C3$jscomp$8.IsDrawable(a)};C3$jscomp$8.RequireDrawableOrImageData=function(a){if(!C3$jscomp$8.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");};C3$jscomp$8.RequireOptionalDrawableOrImageData=function(a){if(!C3$jscomp$8.IsNullOrUndefined(a)&amp;&amp;!C3$jscomp$8.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");};
C3$jscomp$8.IsStringLike=function(a){return"string"===typeof a||C3$jscomp$8.HtmlString&amp;&amp;a instanceof C3$jscomp$8.HtmlString||a instanceof C3$jscomp$8.BBString};C3$jscomp$8.RequireStringLike=function(a){if(!C3$jscomp$8.IsStringLike(a))throw new TypeError("expected string-like");};C3$jscomp$8.RequireOptionalStringLike=function(a){C3$jscomp$8.IsNullOrUndefined(a)};C3$jscomp$8.RequireAllStringLike=function(...a){for(let b of a);};
C3$jscomp$8.RequireOverride=function(){throw Error("must be overridden");};C3$jscomp$8.NotYetImplemented=function(){throw Error("not yet implemented");};C3$jscomp$8.IsDefined=function(a,...b){if("undefined"===typeof a)return!1;for(let d of b){if("undefined"===typeof a[d])return!1;a=a[d]}return!0};C3$jscomp$8.IsNullOrUndefined=function(a){return"undefined"===typeof a||null===a};C3$jscomp$8.AreArrayElementsOfSameType=function(a){let b=a[0].constructor;for(let d of a)if(d.constructor!==b)return!1;return b};
C3$jscomp$8.AreArrayElementsOfType=function(a,b){for(let d of a)if(!(d instanceof b))return!1;return!0};const TypedArray$jscomp$1=Object.getPrototypeOf(Uint8Array);C3$jscomp$8.IsTypedArray=function(a){return C3$jscomp$8.IsInstanceOf(a,TypedArray$jscomp$1)};C3$jscomp$8.RequireTypedArray=function(a){};C3$jscomp$8.WeakRequireTypedArray=function(a){C3$jscomp$8.WeakRequireInstanceOf(a,TypedArray$jscomp$1)};
C3$jscomp$8.WeakRequireAnyInstanceOf=function(a,...b){if(!C3$jscomp$8.WeakIsAnyInstanceOf(a,...b))throw new TypeError("unexpected type");};C3$jscomp$8.WeakIsAnyInstanceOf=function(a,...b){for(const d of b)if(C3$jscomp$8.WeakIsInstanceOf(a,d))return!0;return!1};C3$jscomp$8.WeakRequireInstanceOf=function(a,b){if(!C3$jscomp$8.WeakIsInstanceOf(a,b))throw new TypeError("unexpected type");};
C3$jscomp$8.WeakIsInstanceOf=function(a,b){for(;a=Object.getPrototypeOf(a);)if(a.constructor.name===b.name)return!0;return!1};C3X.RequireNumber=C3$jscomp$8.RequireNumber;C3X.RequireOptionalNumber=C3$jscomp$8.RequireOptionalNumber;C3X.RequireFiniteNumber=C3$jscomp$8.RequireFiniteNumber;C3X.RequireOptionalFiniteNumber=C3$jscomp$8.RequireOptionalFiniteNumber;C3X.RequireString=C3$jscomp$8.RequireString;C3X.RequireOptionalString=C3$jscomp$8.RequireOptionalString;C3X.RequireObject=C3$jscomp$8.RequireObject;
C3X.RequireOptionalObject=C3$jscomp$8.RequireOptionalObject;C3X.RequireArray=C3$jscomp$8.RequireArray;C3X.RequireOptionalArray=C3$jscomp$8.RequireOptionalArray;C3X.RequireFunction=C3$jscomp$8.RequireFunction;C3X.RequireOptionalFunction=C3$jscomp$8.RequireOptionalFunction;C3X.RequireInstanceOf=C3$jscomp$8.RequireInstanceOf;C3X.RequireOptionalInstanceOf=C3$jscomp$8.RequireOptionalInstanceOf;C3X.IsNullOrUndefined=C3$jscomp$8.IsNullOrUndefined;"use strict";const C3$jscomp$9=self.C3,logRafIds=new Map;
C3$jscomp$9.ColorLog=function(a,b){console.log(`%c${a}`,`font-weight: bold; color:${b}`)};C3$jscomp$9.RafLog=function(a,...b){logRafIds.has(a)||logRafIds.set(a,-1);-1===logRafIds.get(a)&amp;&amp;logRafIds.set(a,requestAnimationFrame(()=&gt;{console.log(`%c${a}`,"font-weight: bold",...b);logRafIds.set(a,-1)}))};let measures;C3$jscomp$9.StartMeasure=function(a){performance.mark(a);measures||(measures=new Map);measures.has(a)||measures.set(a,{current:0,total:0,average:0,calls:1,toString:function(){return`current =&gt; ${this.current.toPrecision(3)} :: average =&gt; ${this.average.toPrecision(3)} :: calls =&gt; ${this.calls}`}})};
C3$jscomp$9.EndMeasure=function(a){performance.measure("measure",a);const b=performance.getEntriesByName("measure")[0];a=measures.get(a);a.current=b.duration;a.total+=a.current;a.average=a.total/a.calls;a.calls++;console.log(a.toString());performance.clearMarks();performance.clearMeasures()};C3$jscomp$9.GetCallStack=function(){return Error().stack};C3$jscomp$9.Debugger=function(){debugger};C3$jscomp$9.cast=function(a,b){return a&amp;&amp;a instanceof b?a:null};
C3$jscomp$9.getName=function(a){return"undefined"===typeof a?"undefined":null===a?"null":"boolean"===typeof a?"&lt;boolean&gt;":C3$jscomp$9.IsNumber(a)?"&lt;number&gt;":C3$jscomp$9.IsString(a)?"&lt;string&gt;":C3$jscomp$9.IsArray(a)?"&lt;array&gt;":"symbol"===typeof a?"&lt;"+a.toString()+"&gt;":C3$jscomp$9.IsFunction(a)?a.name&amp;&amp;"Function"!==a.name?a.name:"&lt;anonymous function&gt;":"object"===typeof a?a.constructor&amp;&amp;a.constructor.name&amp;&amp;"Object"!==a.constructor.name?a.constructor.name:"&lt;anonymous object&gt;":"&lt;unknown&gt;"};
C3$jscomp$9.getType=function(a){return null===a?"null":Array.isArray(a)?"array":typeof a};C3$jscomp$9.range=function*(a,b){if(!isFinite(Math.abs(a-b)))throw Error("Invalid parameters");if(a&gt;b)for(--a;a&gt;=b;a--)yield a;else for(;a&lt;b;a++)yield a};function isValidTypeChange(a,b){a=C3$jscomp$9.getType(a);b=C3$jscomp$9.getType(b);return"null"===a||"null"===b?!0:"undefined"===a||"undefined"===b?!1:a===b}let ctorObjectToProxy=new Map,ctorProxyToObject=new Map,proxyToObject=new WeakMap,releasedObjects=new WeakMap;
C3$jscomp$9.DefendHandler={};const VALID_GET_MISSING_KEYS=new Set(["then","splice"]);function logDefendedObjectWarning(a){console.warn("[Defence] "+a+" @",C3$jscomp$9.GetCallStack())}
C3$jscomp$9.DefendHandler.get=function(a,b){b in a||"symbol"===typeof b||VALID_GET_MISSING_KEYS.has(b)||logDefendedObjectWarning(`Accessed missing property '${b}' from defended object '${C3$jscomp$9.getName(a)}', returning undefined`);releasedObjects.has(a)&amp;&amp;"symbol"!==typeof b&amp;&amp;!VALID_GET_MISSING_KEYS.has(b)&amp;&amp;logDefendedObjectWarning(`Accessed property '${b}' on a released object '${C3$jscomp$9.getName(a)}'\nObject was originally released at: ${releasedObjects.get(a)})\nCall stack at access: `);return a[b]};
C3$jscomp$9.DefendHandler.set=function(a,b,d){b in a||ctorObjectToProxy.has(a)||logDefendedObjectWarning(`Set non-existent property '${b}' to '${d}' on defended object '${C3$jscomp$9.getName(a)}'`);isValidTypeChange(a[b],d)||ctorObjectToProxy.has(a)||logDefendedObjectWarning(`Set '${C3$jscomp$9.getType(a[b])}' property '${b}' to type '${C3$jscomp$9.getType(d)}' on defended object '${C3$jscomp$9.getName(a)}'`);releasedObjects.has(a)&amp;&amp;logDefendedObjectWarning(`Set property '${b}' on a released object '${C3$jscomp$9.getName(a)}'\nObject was originally released at: ${releasedObjects.get(a)})\nCall stack at access: `);
a[b]=d;return!0};C3$jscomp$9.DefendHandler.deleteProperty=function(a,b){throw new ReferenceError(`Cannot delete property '${b}' from defended object '${C3$jscomp$9.getName(a)}'`);};C3$jscomp$9.DefendHandler.defineProperty=function(a,b,d){throw new ReferenceError(`Cannot define property '${b}' on defended object '${C3$jscomp$9.getName(a)}'`);};C3$jscomp$9.DefendHandler.enumerate=function(a){throw new ReferenceError(`Cannot enumerate defended object '${C3$jscomp$9.getName(a)}'`);};let checkRafId=-1;
function CheckDefendedObjectsUsedCorrectly(){checkRafId=-1;if(0&lt;ctorObjectToProxy.size||0&lt;ctorProxyToObject.size){let a=[...(new Set([...ctorObjectToProxy.keys()].map(b=&gt;C3$jscomp$9.getName(b))))].join();console.warn(`An object derived from DefendedBase was not protected with debugDefend(). This will disable some checks. See the coding guidelines! Possible affected class names: ${a}`);ctorObjectToProxy.clear();ctorProxyToObject.clear()}}
C3$jscomp$9.DefendedBase=class{constructor(){if(C3$jscomp$9.isDebugDefend&amp;&amp;C3$jscomp$9.Supports.Proxies){var a=new.target;a=Object.create(a.prototype);var b=new Proxy(a,C3$jscomp$9.DefendHandler);ctorObjectToProxy.set(a,b);ctorProxyToObject.set(b,a);proxyToObject.set(b,a);-1===checkRafId&amp;&amp;(checkRafId=requestAnimationFrame(CheckDefendedObjectsUsedCorrectly));return b}}};
C3$jscomp$9.debugDefend=function(a){if(C3$jscomp$9.isDebugDefend&amp;&amp;C3$jscomp$9.Supports.Proxies&amp;&amp;a instanceof C3$jscomp$9.DefendedBase){if(!ctorProxyToObject.has(a))return a;let b=ctorProxyToObject.get(a);ctorProxyToObject.delete(a);ctorObjectToProxy.delete(b);return a}return C3$jscomp$9.isDebug?Object.seal(a):a};
C3$jscomp$9.New=function(a,...b){let d;try{d=new a(...b)}catch(c){throw ctorProxyToObject.clear(),ctorObjectToProxy.clear(),c;}C3$jscomp$9.isDebugDefend&amp;&amp;VerifyObjectPropertiesConsistent(a,d);return C3$jscomp$9.debugDefend(d)};C3$jscomp$9.Release=function(a){(a=proxyToObject.get(a))&amp;&amp;releasedObjects.set(a,C3$jscomp$9.GetCallStack())};C3$jscomp$9.WasReleased=function(a){return(a=proxyToObject.get(a))?!!releasedObjects.get(a):!1};let typeProperties=new Map;
function getObjectPropertySet(a){let b=new Set;for(let d in a)b.add(d);return b}function VerifyObjectPropertiesConsistent(a,b){b=getObjectPropertySet(b);let d=typeProperties.get(a);if(d){let c=[];for(let e of d.values())b.has(e)?b.delete(e):c.push(e);C3$jscomp$9.appendArray(c,[...b]);c.length&amp;&amp;console.warn(`[Defence] '${C3$jscomp$9.getName(a)}' constructor creates inconsistent properties: ${c.join(", ")}`)}else typeProperties.set(a,b)}
C3$jscomp$9.PerfMark=class{constructor(a){this._name="";a&amp;&amp;this.start(a)}start(a){C3$jscomp$9.isPerformanceProfiling&amp;&amp;(this._name=a,performance.mark(this._name+"-Start"))}end(){C3$jscomp$9.isPerformanceProfiling&amp;&amp;(performance.mark(this._name+"-End"),performance.measure(this._name,this._name+"-Start",this._name+"-End"))}next(a){C3$jscomp$9.isPerformanceProfiling&amp;&amp;(this.end(),this._name=a,performance.mark(this._name+"-Start"))}};"use strict";
const C3$jscomp$10=self.C3,TWO_PI=2*Math.PI,D_TO_R=Math.PI/180,R_TO_D=180/Math.PI;C3$jscomp$10.wrap=function(a,b,d){a=Math.floor(a);b=Math.floor(b);d=Math.floor(d);return a&lt;b?(a=d-(b-a)%(d-b),a===d?0:a):b+(a-b)%(d-b)};C3$jscomp$10.mapToRange=function(a,b,d,c,e){return(a-b)*(e-c)/(d-b)+c};C3$jscomp$10.normalize=function(a,b,d){return(a-b)/(d-b)};C3$jscomp$10.clamp=function(a,b,d){return a&lt;b?b:a&gt;d?d:a};C3$jscomp$10.clampAngle=function(a){a%=TWO_PI;0&gt;a&amp;&amp;(a+=TWO_PI);return a};
C3$jscomp$10.toRadians=function(a){return a*D_TO_R};C3$jscomp$10.toDegrees=function(a){return a*R_TO_D};C3$jscomp$10.distanceTo=function(a,b,d,c){return Math.hypot(d-a,c-b)};C3$jscomp$10.distanceSquared=function(a,b,d,c){a=d-a;b=c-b;return a*a+b*b};C3$jscomp$10.angleTo=function(a,b,d,c){return Math.atan2(c-b,d-a)};C3$jscomp$10.angleDiff=function(a,b){if(a===b)return 0;a=Math.sin(a)*Math.sin(b)+Math.cos(a)*Math.cos(b);return 1&lt;=a?0:-1&gt;=a?Math.PI:Math.acos(a)};
C3$jscomp$10.angleRotate=function(a,b,d){let c=Math.sin(a),e=Math.cos(a),h=Math.sin(b),k=Math.cos(b);return Math.acos(c*h+e*k)&gt;d?0&lt;e*h-c*k?C3$jscomp$10.clampAngle(a+d):C3$jscomp$10.clampAngle(a-d):C3$jscomp$10.clampAngle(b)};C3$jscomp$10.angleClockwise=function(a,b){return 0&gt;=Math.cos(a)*Math.sin(b)-Math.sin(a)*Math.cos(b)};
C3$jscomp$10.angleLerp=function(a,b,d,c=0){let e=C3$jscomp$10.angleDiff(a,b);c*=TWO_PI;return C3$jscomp$10.angleClockwise(b,a)?C3$jscomp$10.clampAngle(a+(e+c)*d):C3$jscomp$10.clampAngle(a-(e+c)*d)};C3$jscomp$10.angleLerpClockwise=function(a,b,d,c=0){const e=C3$jscomp$10.angleDiff(a,b);c*=TWO_PI;return C3$jscomp$10.angleClockwise(b,a)?C3$jscomp$10.clampAngle(a+(e+c)*d):C3$jscomp$10.clampAngle((TWO_PI-e+c)*d)};
C3$jscomp$10.angleLerpAntiClockwise=function(a,b,d,c=0){const e=C3$jscomp$10.angleDiff(a,b);c*=TWO_PI;return C3$jscomp$10.angleClockwise(b,a)?C3$jscomp$10.clampAngle((-TWO_PI+e-c)*d):C3$jscomp$10.clampAngle(a-(e+c)*d)};C3$jscomp$10.lerp=function(a,b,d){return a+d*(b-a)};C3$jscomp$10.unlerp=function(a,b,d){return a===b?0:(d-a)/(b-a)};C3$jscomp$10.relerp=function(a,b,d,c,e){return C3$jscomp$10.lerp(c,e,C3$jscomp$10.unlerp(a,b,d))};
C3$jscomp$10.qarp=function(a,b,d,c){return C3$jscomp$10.lerp(C3$jscomp$10.lerp(a,b,c),C3$jscomp$10.lerp(b,d,c),c)};C3$jscomp$10.cubic=function(a,b,d,c,e){return C3$jscomp$10.lerp(C3$jscomp$10.qarp(a,b,d,e),C3$jscomp$10.qarp(b,d,c,e),e)};C3$jscomp$10.cosp=function(a,b,d){return(a+b+(a-b)*Math.cos(d*Math.PI))/2};C3$jscomp$10.isPOT=function(a){return 0&lt;a&amp;&amp;0===(a-1&amp;a)};C3$jscomp$10.nextHighestPowerOfTwo=function(a){--a;for(let b=1;32&gt;b;b&lt;&lt;=1)a|=a&gt;&gt;b;return a+1};
C3$jscomp$10.roundToNearestFraction=function(a,b){return Math.round(a*b)/b};C3$jscomp$10.floorToNearestFraction=function(a,b){return Math.floor(a*b)/b};C3$jscomp$10.round6dp=function(a){return Math.round(1E6*a)/1E6};C3$jscomp$10.toFixed=function(a,b){a=a.toFixed(b);for(b=a.length-1;0&lt;=b&amp;&amp;"0"===a.charAt(b);--b);0&lt;=b&amp;&amp;"."===a.charAt(b)&amp;&amp;--b;return 0&gt;b?a:a.substr(0,b+1)};
C3$jscomp$10.PackRGB=function(a,b,d){return C3$jscomp$10.clamp(a,0,255)|C3$jscomp$10.clamp(b,0,255)&lt;&lt;8|C3$jscomp$10.clamp(d,0,255)&lt;&lt;16};const ALPHAEX_SHIFT=1024;
C3$jscomp$10.PackRGBAEx=function(a,b,d,c){a=C3$jscomp$10.clamp(Math.floor(1024*a),-8192,8191);b=C3$jscomp$10.clamp(Math.floor(1024*b),-8192,8191);d=C3$jscomp$10.clamp(Math.floor(1024*d),-8192,8191);c=C3$jscomp$10.clamp(Math.floor(1023*c),0,1023);0&gt;a&amp;&amp;(a+=16384);0&gt;b&amp;&amp;(b+=16384);0&gt;d&amp;&amp;(d+=16384);return-(268435456*a*ALPHAEX_SHIFT+16384*b*ALPHAEX_SHIFT+d*ALPHAEX_SHIFT+c)};C3$jscomp$10.PackRGBEx=function(a,b,d){return C3$jscomp$10.PackRGBAEx(a,b,d,1)};function isNegativeZero(a){return 0===a&amp;&amp;0&gt;1/a}
C3$jscomp$10.GetRValue=function(a){if(0&lt;=a)return(a&amp;255)/255;a=Math.floor(-a/(268435456*ALPHAEX_SHIFT));8191&lt;a&amp;&amp;(a-=16384);return a/1024};C3$jscomp$10.GetGValue=function(a){if(0&lt;=a)return((a&amp;65280)&gt;&gt;8)/255;a=Math.floor(-a%(268435456*ALPHAEX_SHIFT)/(16384*ALPHAEX_SHIFT));8191&lt;a&amp;&amp;(a-=16384);return a/1024};C3$jscomp$10.GetBValue=function(a){if(0&lt;=a)return((a&amp;16711680)&gt;&gt;16)/255;a=Math.floor(-a%(16384*ALPHAEX_SHIFT)/ALPHAEX_SHIFT);8191&lt;a&amp;&amp;(a-=16384);return a/1024};
C3$jscomp$10.GetAValue=function(a){return isNegativeZero(a)?0:0&lt;=a?1:Math.floor(-a%ALPHAEX_SHIFT)/1023};C3$jscomp$10.greatestCommonDivisor=function(a,b){a=Math.floor(a);for(b=Math.floor(b);0!==b;){let d=b;b=a%b;a=d}return a};const COMMON_ASPECT_RATIOS=[[3,2],[4,3],[5,4],[5,3],[6,5],[14,9],[16,9],[16,10],[21,9]];
C3$jscomp$10.getAspectRatio=function(a,b){a=Math.floor(a);b=Math.floor(b);if(a===b)return[1,1];for(var d of COMMON_ASPECT_RATIOS){let c=a/d[0]*d[1];if(1&gt;Math.abs(b-c))return d.slice(0);c=a/d[1]*d[0];if(1&gt;Math.abs(b-c))return[d[1],d[0]]}d=C3$jscomp$10.greatestCommonDivisor(a,b);return[a/d,b/d]};
C3$jscomp$10.segmentsIntersect=function(a,b,d,c,e,h,k,m){var p=Math.min(a,d),q=Math.max(e,k);if(Math.max(a,d)&lt;Math.min(e,k)||p&gt;q)return!1;p=Math.min(b,c);q=Math.max(h,m);if(Math.max(b,c)&lt;Math.min(h,m)||p&gt;q)return!1;p=e-a+k-d;q=h-b+m-c;a=d-a;b=c-b;e=k-e;h=m-h;m=Math.abs(b*e-h*a);return Math.abs(e*q-h*p)&gt;m?!1:Math.abs(a*q-b*p)&lt;=m};
C3$jscomp$10.segmentsIntersectPreCalc=function(a,b,d,c,e,h,k,m,p,q,v,x){const A=Math.max(p,v);if(h&lt;Math.min(p,v)||e&gt;A)return!1;e=Math.max(q,x);if(m&lt;Math.min(q,x)||k&gt;e)return!1;k=p-a+v-d;m=q-b+x-c;a=d-a;b=c-b;p=v-p;q=x-q;x=Math.abs(b*p-q*a);return Math.abs(p*m-q*k)&gt;x?!1:Math.abs(a*m-b*k)&lt;=x};
C3$jscomp$10.segmentIntersectsQuad=function(a,b,d,c,e){const h=Math.min(a,d),k=Math.max(a,d),m=Math.min(b,c),p=Math.max(b,c),q=e.getTlx(),v=e.getTly(),x=e.getTrx(),A=e.getTry(),C=e.getBrx(),D=e.getBry(),G=e.getBlx();e=e.getBly();return C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,q,v,x,A)||C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,x,A,C,D)||C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,C,D,G,e)||C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,G,e,q,v)};
C3$jscomp$10.segmentIntersectsAnyN=function(a,b,d,c,e){const h=Math.min(a,d),k=Math.max(a,d),m=Math.min(b,c),p=Math.max(b,c);let q=0;for(let v=e.length-4;q&lt;=v;q+=2)if(C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,e[q],e[q+1],e[q+2],e[q+3]))return!0;return C3$jscomp$10.segmentsIntersectPreCalc(a,b,d,c,h,k,m,p,e[q],e[q+1],e[0],e[1])};
C3$jscomp$10.rayIntersect=function(a,b,d,c,e,h,k,m){d-=a;h=m-h;const p=d*h-(c-b)*(k-e);if(0===p)return 2;c=((b-c)*(k-a)+d*(m-b))/p;return 0&lt;c&amp;&amp;1.000001&gt;c?(h*(k-a)+(e-k)*(m-b))/p:2};C3$jscomp$10.rayIntersectExtended=function(a,b,d,c,e,h,k,m,p){const q=(k-e)*p;p*=m-h;return C3$jscomp$10.rayIntersect(a,b,d,c,e-q,h-p,k+q,m+p)};
C3$jscomp$10.isPointInTriangleInclusive=function(a,b,d,c,e,h,k,m){e-=d;h-=c;k-=d;m-=c;a-=d;d=b-c;b=e*e+h*h;c=e*k+h*m;e=e*a+h*d;h=k*k+m*m;k=k*a+m*d;m=1/(b*h-c*c);h=(h*e-c*k)*m;e=(b*k-c*e)*m;return 0&lt;=h&amp;&amp;0&lt;=e&amp;&amp;1&gt;=h+e};C3$jscomp$10.triangleCartesianToBarycentric=function(a,b,d,c,e,h,k,m){e-=d;h-=c;k-=d;m-=c;a-=d;const p=b-c;b=e*e+h*h;c=e*k+h*m;d=k*k+m*m;e=a*e+p*h;h=a*k+p*m;k=b*d-c*c;m=(d*e-c*h)/k;e=(b*h-c*e)/k;return[1-m-e,m,e]};
C3$jscomp$10.triangleBarycentricToCartesian=function(a,b,d,c,e,h,k,m,p){return[a*c+b*h+d*m,a*e+b*k+d*p]};"use strict";const C3$jscomp$11=self.C3;let mainDocument=null,baseHref="";if("undefined"!==typeof document){mainDocument=document;const a=document.querySelector("base");if(baseHref=a&amp;&amp;a.hasAttribute("href")?a.getAttribute("href"):"")baseHref.startsWith("/")&amp;&amp;(baseHref=baseHref.substr(1)),baseHref.endsWith("/")||(baseHref+="/")}C3$jscomp$11.GetBaseHref=function(){return baseHref};
C3$jscomp$11.GetBaseURL=function(){if(!mainDocument)return"";const a=mainDocument.location;return C3$jscomp$11.GetPathFromURL(a.origin+a.pathname)+baseHref};C3$jscomp$11.GetPathFromURL=function(a){if(!a.length||a.endsWith("/")||a.endsWith("\\"))return a;const b=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));return-1===b?"":a.substr(0,b+1)};
C3$jscomp$11.GetFilenameFromURL=function(a){if(!a.length)return a;if(a.endsWith("/")||a.endsWith("\\"))return"";const b=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));return-1===b?a:a.substr(b+1)};C3$jscomp$11.GetFileExtension=function(a){let b=a.lastIndexOf(".");return 1&gt;b?"":a.substr(b)};C3$jscomp$11.GetFileNamePart=function(a){let b=a.lastIndexOf(".");return 1&gt;b?a:a.substr(0,b)};C3$jscomp$11.NormalizeFileSeparator=function(a){return a.replace(/\\/g,"/")};
C3$jscomp$11.IsFileExtension=function(a,b){a=a?C3$jscomp$11.GetFileExtension(a).slice(1):"";return b===a};C3$jscomp$11.FileNameEquals=function(a,b){let d,c;C3$jscomp$11.IsFileLike(a)&amp;&amp;(d=C3$jscomp$11.GetFileNamePart(a.name));C3$jscomp$11.IsString(a)&amp;&amp;(d=C3$jscomp$11.GetFileNamePart(a));C3$jscomp$11.IsFileLike(b)&amp;&amp;(c=C3$jscomp$11.GetFileNamePart(b.name));C3$jscomp$11.IsString(b)&amp;&amp;(c=C3$jscomp$11.GetFileNamePart(b));return d===c};
C3$jscomp$11.ParseFilePath=function(a){a=C3$jscomp$11.NormalizeFileSeparator(a);let b=/^\w:\//.exec(a);b?(b=b[0],a=a.slice(3),"/"!==a[0]&amp;&amp;(a="/"+a)):b="";a=a.replace(/\/{2,}/g,"/");1&lt;a.length&amp;&amp;"/"===a.slice(-1)&amp;&amp;(a=a.slice(0,-1));var d=a.lastIndexOf("/")+1;let c="",e=a,h="";0&lt;d&amp;&amp;(c=a.slice(0,d),e=a.slice(d));a=e;d=e.lastIndexOf(".");0&lt;d&amp;&amp;(h=e.slice(d),a=e.slice(0,-h.length));return{dir:c,base:e,name:a,root:b,ext:h,full:b+c+e}};
C3$jscomp$11.Wait=function(a,b){return new Promise((d,c)=&gt;{self.setTimeout(d,a,b)})};C3$jscomp$11.swallowException=function(a){try{a()}catch(b){C3$jscomp$11.isDebug&amp;&amp;console.warn("Swallowed exception: ",b)}};C3$jscomp$11.noop=function(){};C3$jscomp$11.equalsNoCase=function(a,b){return"string"!==typeof a||"string"!==typeof b?!1:a===b||a.normalize().toLowerCase()===b.normalize().toLowerCase()};
C3$jscomp$11.equalsCase=function(a,b){return"string"!==typeof a||"string"!==typeof b?!1:a===b?!0:a.normalize()===b.normalize()};C3$jscomp$11.typedArraySet16=function(a,b,d){a[d++]=b[0];a[d++]=b[1];a[d++]=b[2];a[d++]=b[3];a[d++]=b[4];a[d++]=b[5];a[d++]=b[6];a[d++]=b[7];a[d++]=b[8];a[d++]=b[9];a[d++]=b[10];a[d++]=b[11];a[d++]=b[12];a[d++]=b[13];a[d++]=b[14];a[d]=b[15]};C3$jscomp$11.truncateArray=function(a,b){a.length=b};
C3$jscomp$11.clearArray=function(a){a&amp;&amp;0!==a.length&amp;&amp;C3$jscomp$11.truncateArray(a,0)};C3$jscomp$11.clear2DArray=function(a){if(a){for(let b=0;b&lt;a.length;b++)C3$jscomp$11.truncateArray(a[b],0);C3$jscomp$11.truncateArray(a,0)}};C3$jscomp$11.extendArray=function(a,b,d){b|=0;var c=a.length;if(!(b&lt;=c))for(;c&lt;b;++c)a.push(d)};C3$jscomp$11.resizeArray=function(a,b,d){b|=0;const c=a.length;b&lt;c?C3$jscomp$11.truncateArray(a,b):b&gt;c&amp;&amp;C3$jscomp$11.extendArray(a,b,d)};
C3$jscomp$11.shallowAssignArray=function(a,b){C3$jscomp$11.clearArray(a);C3$jscomp$11.appendArray(a,b)};C3$jscomp$11.appendArray=function(a,b){if(1E4&gt;b.length)a.push(...b);else for(let d=0,c=b.length;d&lt;c;++d)a.push(b[d])};C3$jscomp$11.arrayRemove=function(a,b){b=Math.floor(b);if(!(0&gt;b||b&gt;=a.length)){for(var d=a.length-1;b&lt;d;++b)a[b]=a[b+1];C3$jscomp$11.truncateArray(a,d)}};C3$jscomp$11.arrayFindRemove=function(a,b){b=a.indexOf(b);0&lt;=b&amp;&amp;a.splice(b,1)};
C3$jscomp$11.arraysEqual=function(a,b){let d=a.length;if(b.length!==d)return!1;for(let c=0;c&lt;d;++c)if(a[c]!==b[c])return!1;return!0};C3$jscomp$11.arrayFilterOut=function(a,b){let d=[],c=0;for(let e=0,h=a.length;e&lt;h;++e){let k=a[e];b(k)?d.push(k):(a[c]=k,++c)}C3$jscomp$11.truncateArray(a,c);return d};C3$jscomp$11.arrayRemoveAllInSet=function(a,b){const d=a.length;let c=0;for(let e=0,h=a.length;e&lt;h;++e){let k=a[e];b.has(k)||(a[c++]=k)}C3$jscomp$11.truncateArray(a,c);return d-c};
C3$jscomp$11.isArrayIndexInBounds=function(a,b){return a!==Math.floor(a)?!1:0&lt;=a&amp;&amp;a&lt;b.length};C3$jscomp$11.validateArrayIndex=function(a,b){if(!C3$jscomp$11.isArrayIndexInBounds(a,b))throw new RangeError("array index out of bounds");};C3$jscomp$11.cloneArray=function(a){return a.slice()};
C3$jscomp$11.deepCloneArray=function(a,b){let d=[];for(let c of a)if(C3$jscomp$11.IsObject(c)){a=b(c);if(!a)throw Error("missing clone");if(a.constructor!==c.constructor)throw Error("object is not a clone");d.push(a)}else C3$jscomp$11.IsArray(c)?d.push(C3$jscomp$11.deepCloneArray(c,b)):d.push(c);return d};C3$jscomp$11.clone2DArray=function(a){let b=[];for(let d of a)b.push(d.slice());return b};C3$jscomp$11.mergeSets=function(a,b){return new Set([...a,...b])};
C3$jscomp$11.mergeSetsInPlace=function(a,b){for(const d of b)a.add(d);return a};C3$jscomp$11.first=function(a){for(let b of a)return b;return null};C3$jscomp$11.xor=function(a,b){return!a!==!b};C3$jscomp$11.compare=function(a,b,d){switch(b){case 0:return a===d;case 1:return a!==d;case 2:return a&lt;d;case 3:return a&lt;=d;case 4:return a&gt;d;case 5:return a&gt;=d;default:return!1}};C3$jscomp$11.hasAnyOwnProperty=function(a){for(let b in a)if(a.hasOwnProperty(b))return!0;return!1};
C3$jscomp$11.PromiseAllWithProgress=function(a,b){return a.length?new Promise((d,c)=&gt;{const e=[];let h=0,k=!1;for(let m=0,p=a.length;m&lt;p;++m)e.push(void 0),a[m].then(q=&gt;{k||(e[m]=q,++h,h===a.length?d(e):b(h,a.length))}).catch(q=&gt;{k=!0;c(q)})}):Promise.resolve([])};let memoryCallbacks=[];C3$jscomp$11.AddLibraryMemoryCallback=function(a){memoryCallbacks.push(a)};C3$jscomp$11.GetEstimatedLibraryMemoryUsage=function(){let a=0;for(let b of memoryCallbacks){let d=b();a+=d}return Math.floor(a)};
let nextTaskId=1;const activeTaskIds=new Map,taskMessageChannel=new MessageChannel;taskMessageChannel.port2.onmessage=function(a){a=a.data;const b=activeTaskIds.get(a);activeTaskIds.delete(a);b&amp;&amp;b(performance.now())};C3$jscomp$11.RequestUnlimitedAnimationFrame=function(a){const b=nextTaskId++;activeTaskIds.set(b,a);taskMessageChannel.port1.postMessage(b);return b};C3$jscomp$11.CancelUnlimitedAnimationFrame=function(a){activeTaskIds.delete(a)};C3$jscomp$11.PostTask=C3$jscomp$11.RequestUnlimitedAnimationFrame;
C3$jscomp$11.WaitForNextTask=function(){return new Promise(a=&gt;C3$jscomp$11.PostTask(a))};const activeRPAFids=new Set;C3$jscomp$11.RequestPostAnimationFrame=function(a){const b=self.requestAnimationFrame(async d=&gt;{await C3$jscomp$11.WaitForNextTask();activeRPAFids.has(b)&amp;&amp;(activeRPAFids.delete(b),a(d))});activeRPAFids.add(b);return b};C3$jscomp$11.CancelPostAnimationFrame=function(a){activeRPAFids.has(a)&amp;&amp;(self.cancelAnimationFrame(a),activeRPAFids.delete(a))};"use strict";const C3$jscomp$12=self.C3;
C3$jscomp$12.IsAbsoluteURL=function(a){return/^(?:[a-z\-]+:)?\/\//.test(a)||"data:"===a.substr(0,5)||"blob:"===a.substr(0,5)};C3$jscomp$12.IsRelativeURL=function(a){return!C3$jscomp$12.IsAbsoluteURL(a)};C3$jscomp$12.ThrowIfNotOk=function(a){if(!a.ok)throw Error(`fetch '${a.url}' response returned ${a.status} ${a.statusText}`);};C3$jscomp$12.FetchOk=function(a,b){return fetch(a,b).then(d=&gt;{C3$jscomp$12.ThrowIfNotOk(d);return d})};
C3$jscomp$12.FetchText=function(a){return C3$jscomp$12.FetchOk(a).then(b=&gt;b.text())};C3$jscomp$12.FetchJson=function(a){return C3$jscomp$12.FetchOk(a).then(b=&gt;b.json())};C3$jscomp$12.FetchBlob=function(a){return C3$jscomp$12.FetchOk(a).then(b=&gt;b.blob())};C3$jscomp$12.FetchArrayBuffer=function(a){return C3$jscomp$12.FetchOk(a).then(b=&gt;b.arrayBuffer())};C3$jscomp$12.FetchImage=function(a){return new Promise((b,d)=&gt;{const c=new Image;c.onload=()=&gt;b(c);c.onerror=e=&gt;d(e);c.src=a})};
C3$jscomp$12.BlobToArrayBuffer=function(a){return"function"===typeof a.arrayBuffer?a.arrayBuffer():new Promise((b,d)=&gt;{const c=new FileReader;c.onload=()=&gt;b(c.result);c.onerror=()=&gt;d(c.error);c.readAsArrayBuffer(a)})};C3$jscomp$12.BlobToString=function(a){return"function"===typeof a.text?a.text():new Promise((b,d)=&gt;{const c=new FileReader;c.onload=()=&gt;b(c.result);c.onerror=()=&gt;d(c.error);c.readAsText(a)})};C3$jscomp$12.BlobToJson=function(a){return C3$jscomp$12.BlobToString(a).then(b=&gt;JSON.parse(b))};
C3$jscomp$12.BlobToImage=async function(a,b){a=URL.createObjectURL(a);try{const d=await C3$jscomp$12.FetchImage(a);URL.revokeObjectURL(a);a="";b&amp;&amp;"function"===typeof d.decode&amp;&amp;await d.decode();return d}finally{a&amp;&amp;URL.revokeObjectURL(a)}};C3$jscomp$12.CreateCanvas=function(a,b){if("undefined"!==typeof document&amp;&amp;"function"===typeof document.createElement){const d=document.createElement("canvas");d.width=a;d.height=b;return d}return new OffscreenCanvas(a,b)};
C3$jscomp$12.CanvasToBlob=function(a,b,d){"number"!==typeof d&amp;&amp;(d=1);b=b||"image/png";d=C3$jscomp$12.clamp(d,0,1);if(a.toBlob)return new Promise(c=&gt;a.toBlob(c,b,d));if(a.convertToBlob)return a.convertToBlob({type:b,quality:d});throw Error("could not convert canvas to blob");};C3$jscomp$12.DrawableToBlob=function(a,b,d){const c=C3$jscomp$12.CreateCanvas(a.width,a.height);c.getContext("2d").drawImage(a,0,0);return C3$jscomp$12.CanvasToBlob(c,b,d)};
C3$jscomp$12.ImageDataToBlob=function(a,b,d){if(C3$jscomp$12.Supports.ImageBitmapOptions)return createImageBitmap(a,{premultiplyAlpha:"none"}).then(e=&gt;C3$jscomp$12.DrawableToBlob(e,b,d));if(C3$jscomp$12.Supports.ImageBitmap)return createImageBitmap(a).then(e=&gt;C3$jscomp$12.DrawableToBlob(e,b,d));const c=C3$jscomp$12.CreateCanvas(a.width,a.height);c.getContext("2d").putImageData(a,0,0);return C3$jscomp$12.CanvasToBlob(c,b,d)};C3$jscomp$12.CopySet=function(a,b){a.clear();for(const d of b)a.add(d)};
C3$jscomp$12.MapToObject=function(a){const b=Object.create(null);for(const [d,c]of a.entries())b[d]=c;return b};C3$jscomp$12.ObjectToMap=function(a,b){b.clear();for(const [d,c]of Object.entries(a))b.set(d,c)};
C3$jscomp$12.ToSuperJSON=function ToSuperJSON(a){if("object"===typeof a&amp;&amp;null!==a){if(a instanceof Set)return{_c3type_:"set",data:[...a].map(c=&gt;ToSuperJSON(c))};if(a instanceof Map)return{_c3type_:"map",data:[...a].map(c=&gt;[c[0],ToSuperJSON(c[1])])};const d=Object.create(null);for(const [c,e]of Object.entries(a))d[c]=ToSuperJSON(e);return d}return a};
C3$jscomp$12.FromSuperJSON=function FromSuperJSON(a){if("object"===typeof a&amp;null!==a){if("set"===a._c3type_)return new Set(a.data.map(c=&gt;FromSuperJSON(c)));if("map"===a._c3type_)return new Map(a.data.map(c=&gt;[c[0],FromSuperJSON(c[1])]));const d=Object.create(null);for(const [c,e]of Object.entries(a))d[c]=FromSuperJSON(e);return d}return a};C3$jscomp$12.CSSToCamelCase=function(a){let b="",d=!1;for(const c of a)"-"===c?d=!0:d?(b+=c.toUpperCase(),d=!1):b+=c;return b};
C3$jscomp$12.IsIterator=function(a){return"object"===typeof a&amp;&amp;"function"===typeof a.next};C3$jscomp$12.MakeFilledArray=function(a,b){const d=[];if("function"===typeof b)for(var c=0;c&lt;a;++c)d.push(b());else for(c=0;c&lt;a;++c)d.push(b);return d};"use strict";const C3$jscomp$13=self.C3,HSL_TEST=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?/i,HSLA_TEST=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?,([0-9.])/i;function padTwoDigits(a){return 0===a.length?"00":1===a.length?"0"+a:a}
function hueToRGB(a,b,d){0&gt;d&amp;&amp;(d+=1);1&lt;d&amp;&amp;--d;return d&lt;1/6?a+6*(b-a)*d:.5&gt;d?b:d&lt;2/3?a+(b-a)*(2/3-d)*6:a}
C3$jscomp$13.Color=class{constructor(a,b,d,c){this._a=this._b=this._g=this._r=0;a instanceof C3$jscomp$13.Color?this.set(a):this.setRgba(a||0,b||0,d||0,c||0)}setRgb(a,b,d){this._r=+a;this._g=+b;this._b=+d;this.clamp();return this}setRgba(a,b,d,c){this._r=+a;this._g=+b;this._b=+d;this._a=+c;this.clamp();return this}set(a){this._r=a._r;this._g=a._g;this._b=a._b;this._a=a._a;return this}copy(a){return this.set(a)}add(a){this._r+=a._r;this._g+=a._g;this._b+=a._b;this._a+=a._a;this.clamp()}addRgb(a,b,
d,c=0){this._r+=+a;this._g+=+b;this._b+=+d;this._a+=+c;this.clamp()}diff(a){this.setR(Math.max(this._r,a._r)-Math.min(this._r,a._r));this.setG(Math.max(this._g,a._g)-Math.min(this._g,a._g));this.setB(Math.max(this._b,a._b)-Math.min(this._b,a._b));this.setA(Math.max(this._a,a._a)-Math.min(this._a,a._a));this.clamp()}copyRgb(a){this._r=a._r;this._g=a._g;this._b=a._b}setR(a){this._r=C3$jscomp$13.clamp(+a,0,1)}getR(){return this._r}setG(a){this._g=C3$jscomp$13.clamp(+a,0,1)}getG(){return this._g}setB(a){this._b=
C3$jscomp$13.clamp(+a,0,1)}getB(){return this._b}setA(a){this._a=C3$jscomp$13.clamp(+a,0,1)}getA(){return this._a}clone(){return C3$jscomp$13.New(C3$jscomp$13.Color,this._r,this._g,this._b,this._a)}toArray(){return[this._r,this._g,this._b,this._a]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a,b){a[b++]=this._r;a[b++]=this._g;a[b++]=this._b;a[b]=this._a}writeRGBToTypedArray(a,b){a[b++]=this._r;a[b++]=this._g;a[b]=this._b}equals(a){return this._r===a._r&amp;&amp;this._g===a._g&amp;&amp;
this._b===a._b&amp;&amp;this._a===a._a}equalsIgnoringAlpha(a){return this._r===a._r&amp;&amp;this._g===a._g&amp;&amp;this._b===a._b}equalsRgb(a,b,d){return this._r===a&amp;&amp;this._g===b&amp;&amp;this._b===d}equalsRgba(a,b,d,c){return this._r===a&amp;&amp;this._g===b&amp;&amp;this._b===d&amp;&amp;this._a===c}equalsF32Array(a,b){return a[b]===Math.fround(this._r)&amp;&amp;a[b+1]===Math.fround(this._g)&amp;&amp;a[b+2]===Math.fround(this._b)&amp;&amp;a[b+3]===Math.fround(this._a)}equalsRGBF32Array(a,b){return a[b]===Math.fround(this._r)&amp;&amp;a[b+1]===Math.fround(this._g)&amp;&amp;a[b+2]===Math.fround(this._b)}multiply(a){this._r*=
a._r;this._g*=a._g;this._b*=a._b;this._a*=a._a}multiplyAlpha(a){this._r*=a;this._g*=a;this._b*=a;this._a*=a}premultiply(){this._r*=this._a;this._g*=this._a;this._b*=this._a;return this}unpremultiply(){this._r/=this._a;this._g/=this._a;this._b/=this._a;return this}clamp(){this._r=C3$jscomp$13.clamp(this._r,0,1);this._g=C3$jscomp$13.clamp(this._g,0,1);this._b=C3$jscomp$13.clamp(this._b,0,1);this._a=C3$jscomp$13.clamp(this._a,0,1);return this}setFromRgbValue(a){this._r=C3$jscomp$13.GetRValue(a);this._g=
C3$jscomp$13.GetGValue(a);this._b=C3$jscomp$13.GetBValue(a);this._a=C3$jscomp$13.GetAValue(a)}getCssRgb(a,b,d){a=C3$jscomp$13.IsFiniteNumber(a)?a:this.getR();b=C3$jscomp$13.IsFiniteNumber(b)?b:this.getG();d=C3$jscomp$13.IsFiniteNumber(d)?d:this.getB();return`rgb(${100*a}%, ${100*b}%, ${100*d}%)`}getCssRgba(a,b,d,c){a=C3$jscomp$13.IsFiniteNumber(a)?a:this.getR();b=C3$jscomp$13.IsFiniteNumber(b)?b:this.getG();d=C3$jscomp$13.IsFiniteNumber(d)?d:this.getB();c=C3$jscomp$13.IsFiniteNumber(c)?c:this.getA();
return`rgba(${100*a}%, ${100*b}%, ${100*d}%, ${c})`}toHexString(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),d=Math.round(255*this.getB());return"#"+padTwoDigits(a.toString(16))+padTwoDigits(b.toString(16))+padTwoDigits(d.toString(16))}parseHexString(a){if("string"!==typeof a)return!1;a=a.trim();"#"===a.charAt(0)&amp;&amp;(a=a.substr(1));let b,d;if(3===a.length)b=parseInt(a[0],16)/15,d=parseInt(a[1],16)/15,a=parseInt(a[2],16)/15;else if(6===a.length)b=parseInt(a.substr(0,2),16)/255,
d=parseInt(a.substr(2,2),16)/255,a=parseInt(a.substr(4,2),16)/255;else return!1;isFinite(b)&amp;&amp;this.setR(b);isFinite(d)&amp;&amp;this.setG(d);isFinite(a)&amp;&amp;this.setB(a);this.setA(1);return!0}toCommaSeparatedRgb(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),d=Math.round(255*this.getB());return`${a}, ${b}, ${d}`}toRgbArray(){const a=Math.round(255*this.getR()),b=Math.round(255*this.getG()),d=Math.round(255*this.getB());return[a,b,d]}parseCommaSeparatedRgb(a){if("string"!==typeof a)return!1;
a=a.replace(/^rgb\(|\)|%/,"");var b=a.split(",");if(3&gt;b.length)return!1;a=parseInt(b[0].trim(),10)/255;const d=parseInt(b[1].trim(),10)/255;b=parseInt(b[2].trim(),10)/255;isFinite(a)&amp;&amp;this.setR(a);isFinite(d)&amp;&amp;this.setG(d);isFinite(b)&amp;&amp;this.setB(b);this.setA(1);return!0}parseCommaSeparatedPercentageRgb(a){if("string"!==typeof a)return!1;a=a.replace(/^rgb\(|\)|%/,"");var b=a.split(",");if(3&gt;b.length)return!1;a=parseInt(b[0].trim(),10)/100;const d=parseInt(b[1].trim(),10)/100;b=parseInt(b[2].trim(),
10)/100;isFinite(a)&amp;&amp;this.setR(a);isFinite(d)&amp;&amp;this.setG(d);isFinite(b)&amp;&amp;this.setB(b);this.setA(1);return!0}parseCommaSeparatedRgba(a){if("string"!==typeof a)return!1;a=a.replace(/^rgba\(|\)|%/,"");var b=a.split(",");if(4&gt;b.length)return!1;a=parseInt(b[0].trim(),10)/255;const d=parseInt(b[1].trim(),10)/255,c=parseInt(b[2].trim(),10)/255;b=parseFloat(b[3].trim());isFinite(a)&amp;&amp;this.setR(a);isFinite(d)&amp;&amp;this.setG(d);isFinite(c)&amp;&amp;this.setB(c);isFinite(b)&amp;&amp;this.setA(b);return!0}parseCommaSeparatedPercentageRgba(a){if("string"!==
typeof a)return!1;a=a.replace(/^rgba\(|\)|%/,"");var b=a.split(",");if(4&gt;b.length)return!1;a=parseInt(b[0].trim(),10)/100;const d=parseInt(b[1].trim(),10)/100,c=parseInt(b[2].trim(),10)/100;b=parseFloat(b[3].trim());isFinite(a)&amp;&amp;this.setR(a);isFinite(d)&amp;&amp;this.setG(d);isFinite(c)&amp;&amp;this.setB(c);isFinite(b)&amp;&amp;this.setA(b);return!0}parseString(a){if("string"!==typeof a)return!1;a=a.replace(/\s+/,"");if(a.includes(",")){if(a.startsWith("rgb("))return a.includes("%")?this.parseCommaSeparatedPercentageRgb(a):
this.parseCommaSeparatedRgb(a);if(a.startsWith("rgba("))return a.includes("%")?this.parseCommaSeparatedPercentageRgba(a):this.parseCommaSeparatedRgba(a);if(a.startsWith("hsl(")||a.startsWith("hsla("))return this.parseHSLString(a);const b=a.split(",");if(a.includes("%")){if(3===b.length)return this.parseCommaSeparatedPercentageRgb(a);if(4===b.length)return this.parseCommaSeparatedPercentageRgba(a)}else{if(3===b.length)return this.parseCommaSeparatedRgb(a);if(4===b.length)return this.parseCommaSeparatedRgba(a)}return!1}return this.parseHexString(a)}toJSON(){return[this._r,
this._g,this._b,this._a]}setFromHSLA(a,b,d,c){a%=360;b=C3$jscomp$13.clamp(b,0,100);d=C3$jscomp$13.clamp(d,0,100);c=C3$jscomp$13.clamp(c,0,1);a/=360;b/=100;d/=100;if(0===b)d=b=a=d;else{const e=.5&gt;d?d*(1+b):d+b-d*b,h=2*d-e;d=hueToRGB(h,e,a+1/3);b=hueToRGB(h,e,a);a=hueToRGB(h,e,a-1/3)}this.setR(d);this.setG(b);this.setB(a);this.setA(c);return this}parseHSLString(a){var b=a.replace(/ |hsl|hsla|\(|\)|;/gi,"");a=HSL_TEST.exec(b);b=HSLA_TEST.exec(b);return a&amp;&amp;4===a.length?(this.setFromHSLA(+a[1],+a[2],+a[3],
1),!0):b&amp;&amp;5===b.length?(this.setFromHSLA(+a[1],+a[2],+a[3],+a[4]),!0):!1}toHSLAString(){var a=this._r;const b=this._g,d=this._b,c=this._a,e=C3$jscomp$13.Color.GetHue(a,b,d),h=C3$jscomp$13.Color.GetSaturation(a,b,d);a=C3$jscomp$13.Color.GetLuminosity(a,b,d);return`hsla(${e}, ${h}%, ${a}%, ${c})`}toHSLAArray(){const a=this._r,b=this._g,d=this._b;return[C3$jscomp$13.Color.GetHue(a,b,d),C3$jscomp$13.Color.GetSaturation(a,b,d),C3$jscomp$13.Color.GetLuminosity(a,b,d),this._a]}setFromJSON(a){!Array.isArray(a)||
3&gt;a.length||(this._r=a[0],this._g=a[1],this._b=a[2],this._a=4&lt;=a.length?a[3]:1)}set r(a){this.setR(a)}get r(){return this.getR()}set g(a){this.setG(a)}get g(){return this.getG()}set b(a){this.setB(a)}get b(){return this.getB()}set a(a){this.setA(a)}get a(){return this.getA()}setAtIndex(a,b){switch(a){case 0:this.setR(b);break;case 1:this.setG(b);break;case 2:this.setB(b);break;case 3:this.setA(b);break;default:throw new RangeError("invalid color index");}}getAtIndex(a){switch(a){case 0:return this.getR();
case 1:return this.getG();case 2:return this.getB();case 3:return this.getA();default:throw new RangeError("invalid color index");}}static Equals(a,b){let d;if(Array.isArray(a))d=new C3$jscomp$13.Color,d.setFromJSON(a);else if(a instanceof C3$jscomp$13.Color)d=a;else throw Error("unexpected type");if(Array.isArray(b))a=new C3$jscomp$13.Color,a.setFromJSON(b);else if(b instanceof C3$jscomp$13.Color)a=b;else throw Error("unexpected type");return d.equals(a)}static DiffChannel(a,b){return C3$jscomp$13.clamp(Math.max(a,
b)-Math.min(a,b),0,1)}static Diff(a,b){const d=new C3$jscomp$13.Color;d.setR(Math.max(a._r,b._r)-Math.min(a._r,b._r));d.setG(Math.max(a._g,b._g)-Math.min(a._g,b._g));d.setB(Math.max(a._b,b._b)-Math.min(a._b,b._b));d.setA(Math.max(a._a,b._a)-Math.min(a._a,b._a));return d}static DiffNoAlpha(a,b){const d=new C3$jscomp$13.Color(0,0,0,1);d.setR(Math.max(a._r,b._r)-Math.min(a._r,b._r));d.setG(Math.max(a._g,b._g)-Math.min(a._g,b._g));d.setB(Math.max(a._b,b._b)-Math.min(a._b,b._b));return d}static GetHue(a,
b,d){const c=Math.max(a,b,d),e=Math.min(a,b,d);if(c===e)return 0;let h=0;switch(c){case a:h=(b-d)/(c-e)+(b&lt;d?6:0);break;case b:h=(d-a)/(c-e)+2;break;case d:h=(a-b)/(c-e)+4}return Math.round(h/6*360)}static GetSaturation(a,b,d){const c=Math.max(a,b,d);a=Math.min(a,b,d);if(c===a)return 0;b=c-a;return Math.round(100*(.5&lt;(c+a)/2?b/(2-c-a):b/(c+a)))}static GetLuminosity(a,b,d){const c=Math.max(a,b,d);return c?Math.round((c+Math.min(a,b,d))/2*100):0}};
C3$jscomp$13.Color.White=Object.freeze(C3$jscomp$13.New(C3$jscomp$13.Color,1,1,1,1));C3$jscomp$13.Color.Black=Object.freeze(C3$jscomp$13.New(C3$jscomp$13.Color,0,0,0,1));C3$jscomp$13.Color.TransparentBlack=Object.freeze(C3$jscomp$13.New(C3$jscomp$13.Color,0,0,0,0));"use strict";const C3$jscomp$14=self.C3;
C3$jscomp$14.Vector2=class{constructor(a,b){this._y=this._x=0;a instanceof C3$jscomp$14.Vector2?this.copy(a):this.set(a||0,b||0)}set(a,b){this._x=+a;this._y=+b}copy(a){this._x=a._x;this._y=a._y}equals(a){return this._x===a._x&amp;&amp;this._y===a._y}equalsValues(a,b){return this._x===a&amp;&amp;this._y===b}equalsF32Array(a,b){return a[b]===Math.fround(this._x)&amp;&amp;a[b+1]===Math.fround(this._y)}setX(a){this._x=+a}getX(){return this._x}setY(a){this._y=+a}getY(){return this._y}toArray(){return[this._x,this._y]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a,
b){a[b++]=this._x;a[b]=this._y}offset(a,b){this._x+=+a;this._y+=+b}scale(a,b){this._x*=a;this._y*=b}divide(a,b){this._x/=a;this._y/=b}round(){this._x=Math.round(this._x);this._y=Math.round(this._y)}floor(){this._x=Math.floor(this._x);this._y=Math.floor(this._y)}ceil(){this._x=Math.ceil(this._x);this._y=Math.ceil(this._y)}angle(){return C3$jscomp$14.angleTo(0,0,this._x,this._y)}lengthSquared(){return this._x*this._x+this._y*this._y}length(){return Math.hypot(this._x,this._y)}rotatePrecalc(a,b){const d=
this._x*b-this._y*a;this._y=this._y*b+this._x*a;this._x=d}rotate(a){0!==a&amp;&amp;this.rotatePrecalc(Math.sin(a),Math.cos(a))}rotateAbout(a,b,d){0===a||b===this._x&amp;&amp;d===this._y||(this._x-=b,this._y-=d,this.rotatePrecalc(Math.sin(a),Math.cos(a)),this._x+=+b,this._y+=+d)}move(a,b){0!==b&amp;&amp;(this._x+=Math.cos(a)*b,this._y+=Math.sin(a)*b)}normalize(){const a=this.length();0!==a&amp;&amp;1!==a&amp;&amp;(this._x/=a,this._y/=a)}clamp(a,b){this._x=C3$jscomp$14.clamp(this._x,a,b);this._y=C3$jscomp$14.clamp(this._y,a,b)}};"use strict";
const C3$jscomp$15=self.C3;
C3$jscomp$15.Rect=class{constructor(a,b,d,c){this._bottom=this._right=this._top=this._left=0;a instanceof C3$jscomp$15.Rect?this.copy(a):this.set(a||0,b||0,d||0,c||0)}set(a,b,d,c){this._left=+a;this._top=+b;this._right=+d;this._bottom=+c}setWH(a,b,d,c){a=+a;b=+b;this._left=a;this._top=b;this._right=a+ +d;this._bottom=b+ +c}copy(a){this._left=+a._left;this._top=+a._top;this._right=+a._right;this._bottom=+a._bottom}clone(){return new C3$jscomp$15.Rect(this._left,this._top,this._right,this._bottom)}static Merge(a,
b){const d=new C3$jscomp$15.Rect;d.setLeft(Math.min(a._left,b._left));d.setTop(Math.min(a._top,b._top));d.setRight(Math.max(a._right,b._right));d.setBottom(Math.max(a._bottom,b._bottom));return d}static FromObject(a){return new C3$jscomp$15.Rect(a.left,a.top,a.right,a.bottom)}equals(a){return this._left===a._left&amp;&amp;this._top===a._top&amp;&amp;this._right===a._right&amp;&amp;this._bottom===a._bottom}equalsWH(a,b,d,c){return this._left===a&amp;&amp;this._top===b&amp;&amp;this.width()===d&amp;&amp;this.height()===c}equalsF32Array(a,b){return a[b]===
Math.fround(this._left)&amp;&amp;a[b+1]===Math.fround(this._top)&amp;&amp;a[b+2]===Math.fround(this._right)&amp;&amp;a[b+3]===Math.fround(this._bottom)}setLeft(a){this._left=+a}getLeft(){return this._left}setTop(a){this._top=+a}getTop(){return this._top}setRight(a){this._right=+a}getRight(){return this._right}setBottom(a){this._bottom=+a}getBottom(){return this._bottom}toArray(){return[this._left,this._top,this._right,this._bottom]}toTypedArray(){return new Float64Array(this.toArray())}toDOMRect(){return new DOMRect(this._left,
this._top,this.width(),this.height())}writeToTypedArray(a,b){a[b++]=this._left;a[b++]=this._top;a[b++]=this._right;a[b]=this._bottom}writeAsQuadToTypedArray(a,b){a[b++]=this._left;a[b++]=this._top;a[b++]=this._right;a[b++]=this._top;a[b++]=this._right;a[b++]=this._bottom;a[b++]=this._left;a[b]=this._bottom}writeAsQuadToTypedArray3D(a,b,d){a[b++]=this._left;a[b++]=this._top;a[b++]=d;a[b++]=this._right;a[b++]=this._top;a[b++]=d;a[b++]=this._right;a[b++]=this._bottom;a[b++]=d;a[b++]=this._left;a[b++]=
this._bottom;a[b]=d}width(){return this._right-this._left}height(){return this._bottom-this._top}midX(){return(this._left+this._right)/2}midY(){return(this._top+this._bottom)/2}offset(a,b){a=+a;b=+b;this._left+=a;this._top+=b;this._right+=a;this._bottom+=b}offsetLeft(a){this._left+=+a}offsetTop(a){this._top+=+a}offsetRight(a){this._right+=+a}offsetBottom(a){this._bottom+=+a}toSquare(a){if("x"!==a)throw Error("invalid axis, only 'x' supported");this._bottom=this._top&lt;this._bottom?this._left&lt;this._right?
this._top+this.width():this._top-this.width():this._left&lt;this._right?this._top-this.width():this._top+this.width()}inflate(a,b){a=+a;b=+b;this._left-=a;this._top-=b;this._right+=a;this._bottom+=b}deflate(a,b){a=+a;b=+b;this._left+=a;this._top+=b;this._right-=a;this._bottom-=b}multiply(a,b){this._left*=a;this._top*=b;this._right*=a;this._bottom*=b}divide(a,b){this._left/=a;this._top/=b;this._right/=a;this._bottom/=b}mirrorAround(a){this._left=+a-this._left;this._right=+a-this._right}flipAround(a){this._top=
+a-this._top;this._bottom=+a-this._bottom}rotate90DegreesAround(a,b){const d=this.width(),c=this.height(),e=this.getLeft()+d*a,h=this.getTop()+c*b;this.setWH(e-c*b,h-d*a,c,d)}swapLeftRight(){const a=this._left;this._left=this._right;this._right=a}swapTopBottom(){const a=this._top;this._top=this._bottom;this._bottom=a}shuntY(a){const b=this._top;this._top=+a-this._bottom;this._bottom=+a-b}round(){this._left=Math.round(this._left);this._top=Math.round(this._top);this._right=Math.round(this._right);
this._bottom=Math.round(this._bottom)}roundInner(){this._left=Math.ceil(this._left);this._top=Math.ceil(this._top);this._right=Math.floor(this._right);this._bottom=Math.floor(this._bottom)}roundOuter(){this._left=Math.floor(this._left);this._top=Math.floor(this._top);this._right=Math.ceil(this._right);this._bottom=Math.ceil(this._bottom)}floor(){this._left=Math.floor(this._left);this._top=Math.floor(this._top);this._right=Math.floor(this._right);this._bottom=Math.floor(this._bottom)}ceil(){this._left=
Math.ceil(this._left);this._top=Math.ceil(this._top);this._right=Math.ceil(this._right);this._bottom=Math.ceil(this._bottom)}clamp(a,b,d,c){this._left&lt;a&amp;&amp;(this._left=+a);this._top&lt;b&amp;&amp;(this._top=+b);this._right&gt;d&amp;&amp;(this._right=+d);this._bottom&gt;c&amp;&amp;(this._bottom=+c)}clampFlipped(a,b,d,c){this._left&lt;a&amp;&amp;(this._left=+a);this._top&gt;b&amp;&amp;(this._top=+b);this._right&gt;d&amp;&amp;(this._right=+d);this._bottom&lt;c&amp;&amp;(this._bottom=+c)}normalize(){this._left&gt;this._right&amp;&amp;this.swapLeftRight();this._top&gt;this._bottom&amp;&amp;this.swapTopBottom()}intersectsRect(a){return!(a._right&lt;
this._left||a._bottom&lt;this._top||a._left&gt;this._right||a._top&gt;this._bottom)}intersectsRectOffset(a,b,d){return!(a._right+b&lt;this._left||a._bottom+d&lt;this._top||a._left+b&gt;this._right||a._top+d&gt;this._bottom)}containsPoint(a,b){return a&gt;=this._left&amp;&amp;a&lt;=this._right&amp;&amp;b&gt;=this._top&amp;&amp;b&lt;=this._bottom}containsRect(a){return a._left&gt;=this._left&amp;&amp;a._top&gt;=this._top&amp;&amp;a._right&lt;=this._right&amp;&amp;a._bottom&lt;=this._bottom}expandToContain(a){a._left&lt;this._left&amp;&amp;(this._left=+a._left);a._top&lt;this._top&amp;&amp;(this._top=+a._top);a._right&gt;
this._right&amp;&amp;(this._right=+a._right);a._bottom&gt;this._bottom&amp;&amp;(this._bottom=+a._bottom)}lerpInto(a){this._left=C3$jscomp$15.lerp(a._left,a._right,this._left);this._top=C3$jscomp$15.lerp(a._top,a._bottom,this._top);this._right=C3$jscomp$15.lerp(a._left,a._right,this._right);this._bottom=C3$jscomp$15.lerp(a._top,a._bottom,this._bottom)}};"use strict";const C3$jscomp$16=self.C3;
C3$jscomp$16.Quad=class{constructor(a,b,d,c,e,h,k,m){this._bly=this._blx=this._bry=this._brx=this._try=this._trx=this._tly=this._tlx=0;a instanceof C3$jscomp$16.Quad?this.copy(a):this.set(a||0,b||0,d||0,c||0,e||0,h||0,k||0,m||0)}set(a,b,d,c,e,h,k,m){this._tlx=+a;this._tly=+b;this._trx=+d;this._try=+c;this._brx=+e;this._bry=+h;this._blx=+k;this._bly=+m}setRect(a,b,d,c){this.set(a,b,d,b,d,c,a,c)}copy(a){this._tlx=a._tlx;this._tly=a._tly;this._trx=a._trx;this._try=a._try;this._brx=a._brx;this._bry=a._bry;
this._blx=a._blx;this._bly=a._bly}equals(a){return this._tlx===a._tlx&amp;&amp;this._tly===a._tly&amp;&amp;this._trx===a._trx&amp;&amp;this._try===a._try&amp;&amp;this._brx===a._brx&amp;&amp;this._bry===a._bry&amp;&amp;this._blx===a._blx&amp;&amp;this._bly===a._bly}setTlx(a){this._tlx=+a}getTlx(){return this._tlx}setTly(a){this._tly=+a}getTly(){return this._tly}setTrx(a){this._trx=+a}getTrx(){return this._trx}setTry(a){this._try=+a}getTry(){return this._try}setBrx(a){this._brx=+a}getBrx(){return this._brx}setBry(a){this._bry=+a}getBry(){return this._bry}setBlx(a){this._blx=
+a}getBlx(){return this._blx}setBly(a){this._bly=+a}getBly(){return this._bly}toDOMQuad(){return new DOMQuad(new DOMPoint(this._tlx,this._tly),new DOMPoint(this._trx,this._try),new DOMPoint(this._brx,this._bry),new DOMPoint(this._blx,this._bly))}toArray(){return[this._tlx,this._tly,this._trx,this._try,this._brx,this._bry,this._blx,this._bly]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(a,b){a[b++]=this._tlx;a[b++]=this._tly;a[b++]=this._trx;a[b++]=this._try;a[b++]=this._brx;
a[b++]=this._bry;a[b++]=this._blx;a[b]=this._bly}writeToTypedArray3D(a,b,d){a[b++]=this._tlx;a[b++]=this._tly;a[b++]=d;a[b++]=this._trx;a[b++]=this._try;a[b++]=d;a[b++]=this._brx;a[b++]=this._bry;a[b++]=d;a[b++]=this._blx;a[b++]=this._bly;a[b]=d}offset(a,b){a=+a;b=+b;this._tlx+=a;this._tly+=b;this._trx+=a;this._try+=b;this._brx+=a;this._bry+=b;this._blx+=a;this._bly+=b}round(){this._tlx=Math.round(this._tlx);this._tly=Math.round(this._tly);this._trx=Math.round(this._trx);this._try=Math.round(this._try);
this._brx=Math.round(this._brx);this._bry=Math.round(this._bry);this._blx=Math.round(this._blx);this._bly=Math.round(this._bly)}floor(){this._tlx=Math.floor(this._tlx);this._tly=Math.floor(this._tly);this._trx=Math.floor(this._trx);this._try=Math.floor(this._try);this._brx=Math.floor(this._brx);this._bry=Math.floor(this._bry);this._blx=Math.floor(this._blx);this._bly=Math.floor(this._bly)}ceil(){this._tlx=Math.ceil(this._tlx);this._tly=Math.ceil(this._tly);this._trx=Math.ceil(this._trx);this._try=
Math.ceil(this._try);this._brx=Math.ceil(this._brx);this._bry=Math.ceil(this._bry);this._blx=Math.ceil(this._blx);this._bly=Math.ceil(this._bly)}setFromRect(a){this._tlx=a._left;this._tly=a._top;this._trx=a._right;this._try=a._top;this._brx=a._right;this._bry=a._bottom;this._blx=a._left;this._bly=a._bottom}setFromRotatedRect(a,b){0===b?this.setFromRect(a):this.setFromRotatedRectPrecalc(a,Math.sin(b),Math.cos(b))}setFromRotatedRectPrecalc(a,b,d){const c=a._left*b,e=a._top*b,h=a._right*b;b*=a._bottom;
const k=a._left*d,m=a._top*d,p=a._right*d;a=a._bottom*d;this._tlx=k-e;this._tly=m+c;this._trx=p-e;this._try=m+h;this._brx=p-b;this._bry=a+h;this._blx=k-b;this._bly=a+c}getBoundingBox(a){a.set(Math.min(this._tlx,this._trx,this._brx,this._blx),Math.min(this._tly,this._try,this._bry,this._bly),Math.max(this._tlx,this._trx,this._brx,this._blx),Math.max(this._tly,this._try,this._bry,this._bly))}containsPoint(a,b){var d=this._trx-this._tlx,c=this._try-this._tly;const e=this._brx-this._tlx,h=this._bry-this._tly;
a-=this._tlx;b-=this._tly;var k=d*d+c*c;let m=d*e+c*h;c=d*a+c*b;const p=e*e+h*h,q=e*a+h*b;let v=1/(k*p-m*m);d=(p*c-m*q)*v;k=(k*q-m*c)*v;if(0&lt;=d&amp;&amp;0&lt;k&amp;&amp;1&gt;d+k)return!0;d=this._blx-this._tlx;c=this._bly-this._tly;k=d*d+c*c;m=d*e+c*h;c=d*a+c*b;v=1/(k*p-m*m);d=(p*c-m*q)*v;k=(k*q-m*c)*v;return 0&lt;=d&amp;&amp;0&lt;k&amp;&amp;1&gt;d+k}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(a,b,d,c){return this.containsPoint(a,b)||this.containsPoint(d,c)?
!0:C3$jscomp$16.segmentIntersectsQuad(a,b,d,c,this)}intersectsQuad(a){var b=a.midX(),d=a.midY();if(this.containsPoint(b,d))return!0;b=this.midX();d=this.midY();if(a.containsPoint(b,d))return!0;b=this._tlx;d=this._tly;const c=this._trx,e=this._try,h=this._brx,k=this._bry,m=this._blx,p=this._bly;return C3$jscomp$16.segmentIntersectsQuad(b,d,c,e,a)||C3$jscomp$16.segmentIntersectsQuad(c,e,h,k,a)||C3$jscomp$16.segmentIntersectsQuad(h,k,m,p,a)||C3$jscomp$16.segmentIntersectsQuad(m,p,b,d,a)}rotatePointsAnticlockwise(){const a=
this._tlx,b=this._tly;this._tlx=this._trx;this._tly=this._try;this._trx=this._brx;this._try=this._bry;this._brx=this._blx;this._bry=this._bly;this._blx=a;this._bly=b}mirror(){this._swap(0,2);this._swap(1,3);this._swap(6,4);this._swap(7,5)}flip(){this._swap(0,6);this._swap(1,7);this._swap(2,4);this._swap(3,5)}diag(){this._swap(2,6);this._swap(3,7)}_swap(a,b){const d=this._getAtIndex(a);this._setAtIndex(a,this._getAtIndex(b));this._setAtIndex(b,d)}_getAtIndex(a){switch(a){case 0:return this._tlx;case 1:return this._tly;
case 2:return this._trx;case 3:return this._try;case 4:return this._brx;case 5:return this._bry;case 6:return this._blx;case 7:return this._bly;default:throw new RangeError("invalid quad point index");}}_setAtIndex(a,b){b=+b;switch(a){case 0:this._tlx=b;break;case 1:this._tly=b;break;case 2:this._trx=b;break;case 3:this._try=b;break;case 4:this._brx=b;break;case 5:this._bry=b;break;case 6:this._blx=b;break;case 7:this._bly=b;break;default:throw new RangeError("invalid quad point index");}}};"use strict";
const C3$jscomp$17=self.C3,DEFAULT_POLY_POINTS=[0,0,1,0,1,1,0,1],tempQuad=C3$jscomp$17.New(C3$jscomp$17.Quad);
C3$jscomp$17.CollisionPoly=class extends C3$jscomp$17.DefendedBase{constructor(a,b=!0){super();a||(a=DEFAULT_POLY_POINTS);this._ptsArr=Float64Array.from(a);this._bbox=new C3$jscomp$17.Rect;this._isBboxChanged=!0;this._enabled=b}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(a){this._ptsArr.length===a.length?this._ptsArr.set(a):this._ptsArr=Float64Array.from(a);this._isBboxChanged=!0}setDefaultPoints(){this.setPoints(DEFAULT_POLY_POINTS)}copy(a){this.setPoints(a._ptsArr)}setBboxChanged(){this._isBboxChanged=
!0}_updateBbox(){if(this._isBboxChanged){var a=this._ptsArr,b=a[0],d=a[1],c=b,e=d;for(let h=0,k=a.length;h&lt;k;h+=2){const m=a[h],p=a[h+1];m&lt;b&amp;&amp;(b=m);m&gt;c&amp;&amp;(c=m);p&lt;d&amp;&amp;(d=p);p&gt;e&amp;&amp;(e=p)}this._bbox.set(b,d,c,e);this._isBboxChanged=!1}}setFromRect(a,b,d){let c=this._ptsArr;8!==c.length&amp;&amp;(this._ptsArr=c=new Float64Array(8));c[0]=a.getLeft()-b;c[1]=a.getTop()-d;c[2]=a.getRight()-b;c[3]=a.getTop()-d;c[4]=a.getRight()-b;c[5]=a.getBottom()-d;c[6]=a.getLeft()-b;c[7]=a.getBottom()-d;this._bbox.copy(a);0===b&amp;&amp;0===
d||this._bbox.offset(-b,-d);this._isBboxChanged=!1}setFromQuad(a,b,d){tempQuad.copy(a);tempQuad.offset(b,d);this.setPoints(tempQuad.toArray());this._isBboxChanged=!0}transform(a,b,d){let c=0,e=1;0!==d&amp;&amp;(c=Math.sin(d),e=Math.cos(d));this.transformPrecalc(a,b,c,e)}transformPrecalc(a,b,d,c){const e=this._ptsArr;for(let h=0,k=e.length;h&lt;k;h+=2){const m=h+1,p=e[h]*a,q=e[m]*b;e[h]=p*c-q*d;e[m]=q*c+p*d}this._isBboxChanged=!0}offset(a,b){const d=this._ptsArr;for(let c=0,e=d.length;c&lt;e;c+=2)d[c]+=a,d[c+1]+=
b}containsPoint(a,b){const d=this._ptsArr;if(a===d[0]&amp;&amp;b===d[1])return!0;this._updateBbox();var c=this._bbox;const e=c.getLeft()-110,h=c.getTop()-101,k=c.getRight()+131;c=c.getBottom()+120;let m,p,q,v,x,A,C,D;e&lt;a?(m=e,q=a):(m=a,q=e);h&lt;b?(p=h,v=b):(p=b,v=h);k&lt;a?(x=k,C=a):(x=a,C=k);c&lt;b?(A=c,D=b):(A=b,D=c);let G=0,E=0;for(let L=0,O=d.length;L&lt;O;L+=2){var J=(L+2)%O;const V=d[L],W=d[L+1],ca=d[J];J=d[J+1];C3$jscomp$17.segmentsIntersectPreCalc(e,h,a,b,m,q,p,v,V,W,ca,J)&amp;&amp;++G;C3$jscomp$17.segmentsIntersectPreCalc(k,
c,a,b,x,C,A,D,V,W,ca,J)&amp;&amp;++E}return 1===G%2||1===E%2}intersectsPoly(a,b,d){const c=a._ptsArr,e=this._ptsArr;if(this.containsPoint(c[0]+b,c[1]+d)||a.containsPoint(e[0]-b,e[1]-d))return!0;for(let k=0,m=e.length;k&lt;m;k+=2){var h=(k+2)%m;a=e[k];const p=e[k+1],q=e[h];h=e[h+1];let v,x,A,C;a&lt;q?(v=a,A=q):(v=q,A=a);p&lt;h?(x=p,C=h):(x=h,C=p);for(let D=0,G=c.length;D&lt;G;D+=2){const E=(D+2)%G;if(C3$jscomp$17.segmentsIntersectPreCalc(a,p,q,h,v,A,x,C,c[D]+b,c[D+1]+d,c[E]+b,c[E+1]+d))return!0}}return!1}intersectsSegment(a,
b,d,c,e,h){if(this.containsPoint(d-a,c-b)||this.containsPoint(e-a,h-b))return!0;let k,m,p,q;d&lt;e?(k=d,p=e):(k=e,p=d);c&lt;h?(m=c,q=h):(m=h,q=c);const v=this._ptsArr;for(let x=0,A=v.length;x&lt;A;x+=2){const C=(x+2)%A;if(C3$jscomp$17.segmentsIntersectPreCalc(d,c,e,h,k,p,m,q,v[x]+a,v[x+1]+b,v[C]+a,v[C+1]+b))return!0}return!1}mirror(a){const b=this._ptsArr;for(let d=0,c=b.length;d&lt;c;d+=2)b[d]=2*a-b[d];this._isBboxChanged=!0}flip(a){const b=this._ptsArr;for(let d=0,c=b.length;d&lt;c;d+=2){const e=d+1;b[e]=2*a-
b[e]}this._isBboxChanged=!0}diag(){const a=this._ptsArr;for(let b=0,d=a.length;b&lt;d;b+=2){const c=b+1,e=a[b];a[b]=a[c];a[c]=e}this._isBboxChanged=!0}GetMidX(){const a=this._ptsArr;let b=0;for(let d=0,c=a.length;d&lt;c;d+=2)b+=a[d];return b/this.pointCount()}GetMidY(){const a=this._ptsArr;let b=0;for(let d=0,c=a.length;d&lt;c;d+=2)b+=a[d+1];return b/this.pointCount()}GetPointsArray(){return this._ptsArr}GetPointCount(){return this.pointCount()}IsEnabled(){return this._enabled}};"use strict";
const C3$jscomp$18=self.C3;
C3$jscomp$18.PairMap=class extends C3$jscomp$18.DefendedBase{constructor(a){super();this._firstMap=new Map;if(a)for(const [b,d,c]of a)this.Set(b,d,c)}Release(){this.Clear();this._firstMap=null}Clear(){const a=this._firstMap;for(const b of a.values())b.clear();a.clear()}Set(a,b,d){const c=this._firstMap;let e=c.get(a);e||(e=new Map,c.set(a,e));e.set(b,d)}Get(a,b){return(a=this._firstMap.get(a))?a.get(b):a}Has(a,b){return(a=this._firstMap.get(a))?a.has(b):!1}Delete(a,b){const d=this._firstMap,c=d.get(a);
if(!c)return!1;(b=c.delete(b))&amp;&amp;0===c.size&amp;&amp;d.delete(a);return b}DeleteEither(a){const b=this._firstMap,d=b.get(a);d&amp;&amp;(d.clear(),b.delete(a));for(const [c,e]of b.entries())e.delete(a)&amp;&amp;0===e.size&amp;&amp;b.delete(c)}GetSize(){let a=0;for(const b of this._firstMap.values())a+=b.size;return a}*values(){for(const a of this._firstMap.values())yield*a.values()}*keyPairs(){for(const [a,b]of this._firstMap.entries())for(const d of b.keys())yield[a,d]}*entries(){for(const [a,b]of this._firstMap.entries())for(const [d,
c]of b.entries())yield[a,d,c]}};"use strict";const C3$jscomp$19=self.C3;
C3$jscomp$19.ArraySet=class extends C3$jscomp$19.DefendedBase{constructor(){super();this._set=new Set;this._arr=[];this._needToRebuildArray=!1}Release(){this.Clear()}Clear(){this._set.clear();C3$jscomp$19.clearArray(this._arr);this._needToRebuildArray=!1}Add(a){this._set.has(a)||(this._set.add(a),this._needToRebuildArray||this._arr.push(a))}Has(a){return this._set.has(a)}Delete(a){this._set.delete(a)&amp;&amp;(this._needToRebuildArray=!0)}GetSize(){return this._set.size}IsEmpty(){return 0===this._set.size}GetArray(){this._needToRebuildArray&amp;&amp;
(this._RebuildArray(),this._needToRebuildArray=!1);return this._arr}_RebuildArray(){const a=this._arr;C3$jscomp$19.clearArray(a);for(const b of this._set)a.push(b)}};"use strict";const EASE_MAP=new Map,PREDEFINED_EASE_MAP=new Map,CUSTOM_EASE_EDITOR_MAP=new Map,CUSTOM_EASE_RUNTIME_MAP=new Map,PRIVATE_EASE_MAP=new Map,ALIAS_MAP=new Map;ALIAS_MAP.set("linear","noease");ALIAS_MAP.set("default","noease");
self.Ease=class a{constructor(){}static InheritEase(){return"default"}static DefaultEase(){return"noease"}static GetEditorEaseNames(b,...d){this._CreateEaseMap();b?(CUSTOM_EASE_EDITOR_MAP.has(b)||CUSTOM_EASE_EDITOR_MAP.set(b,new Map),b=CUSTOM_EASE_EDITOR_MAP.get(b)):b=CUSTOM_EASE_RUNTIME_MAP;b=[...b.keys()];b.sort();return[...PREDEFINED_EASE_MAP.keys()].concat(b).filter(c=&gt;!d.includes(c))}static GetRuntimeEaseNames(){this._CreateEaseMap();const b=[...CUSTOM_EASE_RUNTIME_MAP.keys()];b.sort();return[...PREDEFINED_EASE_MAP.keys()].concat(b)}static GetCustomRuntimeEaseNames(){this._CreateEaseMap();
const b=[...CUSTOM_EASE_RUNTIME_MAP.keys()];b.sort();return b}static IsNamePredefined(b){this._CreateEaseMap();return[...PREDEFINED_EASE_MAP.keys()].includes(b)}static _GetEase(b){const d=ALIAS_MAP.get(b);if(d)return EASE_MAP.get(d);if(a.IsNamePredefined(b))return EASE_MAP.get(b);if(PRIVATE_EASE_MAP.has(b))return PRIVATE_EASE_MAP.get(b)}static GetEditorEase(b,d){this._CreateEaseMap();const c=a._GetEase(b);return c?c:CUSTOM_EASE_EDITOR_MAP.get(d).get(b)}static GetRuntimeEase(b){this._CreateEaseMap();
const d=a._GetEase(b);return d?d:CUSTOM_EASE_RUNTIME_MAP.get(b)}static GetEaseFromIndex(b){this._CreateEaseMap();return this.GetRuntimeEaseNames()[b]}static GetIndexForEase(b,d){this._CreateEaseMap();return this.GetEditorEaseNames(d).indexOf(b)}static GetIndexForEaseAtRuntime(b){return this.GetIndexForEase(b)}static _CreateEaseMap(){0===EASE_MAP.size&amp;&amp;(this._AddPredifinedEase("default",()=&gt;{}),this._AddPredifinedEase("noease",this.NoEase),this._AddPredifinedEase("easeinsine",this.EaseInSine),this._AddPredifinedEase("easeoutsine",
this.EaseOutSine),this._AddPredifinedEase("easeinoutsine",this.EaseInOutSine),this._AddPredifinedEase("easeinelastic",this.EaseInElastic),this._AddPredifinedEase("easeoutelastic",this.EaseOutElastic),this._AddPredifinedEase("easeinoutelastic",this.EaseInOutElastic),this._AddPredifinedEase("easeinback",this.EaseInBack),this._AddPredifinedEase("easeoutback",this.EaseOutBack),this._AddPredifinedEase("easeinoutback",this.EaseInOutBack),this._AddPredifinedEase("easeinbounce",this.EaseInBounce),this._AddPredifinedEase("easeoutbounce",
this.EaseOutBounce),this._AddPredifinedEase("easeinoutbounce",this.EaseInOutBounce),this._AddPredifinedEase("easeincubic",this.EaseInCubic),this._AddPredifinedEase("easeoutcubic",this.EaseOutCubic),this._AddPredifinedEase("easeinoutcubic",this.EaseInOutCubic),this._AddPredifinedEase("easeinquad",this.EaseInQuad),this._AddPredifinedEase("easeoutquad",this.EaseOutQuad),this._AddPredifinedEase("easeinoutquad",this.EaseInOutQuad),this._AddPredifinedEase("easeinquart",this.EaseInQuart),this._AddPredifinedEase("easeoutquart",
this.EaseOutQuart),this._AddPredifinedEase("easeinoutquart",this.EaseInOutQuart),this._AddPredifinedEase("easeinquint",this.EaseInQuint),this._AddPredifinedEase("easeoutquint",this.EaseOutQuint),this._AddPredifinedEase("easeinoutquint",this.EaseInOutQuint),this._AddPredifinedEase("easeincirc",this.EaseInCirc),this._AddPredifinedEase("easeoutcirc",this.EaseOutCirc),this._AddPredifinedEase("easeinoutcirc",this.EaseInOutCirc),this._AddPredifinedEase("easeinexpo",this.EaseInExpo),this._AddPredifinedEase("easeoutexpo",
this.EaseOutExpo),this._AddPredifinedEase("easeinoutexpo",this.EaseInOutExpo),this._AddPrivateCustomEase("cubicbezier",this.EaseCubicBezier),this._AddPrivateCustomEase("spline",this.EaseSpline))}static _AddPredifinedEase(b,d){a._AddEase(b,d,"predefined")}static _AddPrivateCustomEase(b,d){a._AddEase(b,d,"private")}static AddCustomEase(b,d,c){this._CreateEaseMap();a._AddEase(b,d,"custom",c)}static RemoveCustomEase(b,d){this.IsNamePredefined(b)||[...PRIVATE_EASE_MAP.keys()].includes(b)||(d=CUSTOM_EASE_EDITOR_MAP.get(d))&amp;&amp;
d.delete(b)}static _AddEase(b,d,c,e){switch(c){case "predefined":EASE_MAP.set(b,d);PREDEFINED_EASE_MAP.set(b,d);break;case "custom":e?(CUSTOM_EASE_EDITOR_MAP.has(e)||CUSTOM_EASE_EDITOR_MAP.set(e,new Map),CUSTOM_EASE_EDITOR_MAP.get(e).set(b,d)):CUSTOM_EASE_RUNTIME_MAP.set(b,d);break;case "private":EASE_MAP.set(b,d);PRIVATE_EASE_MAP.set(b,d);break;default:throw Error("unexpected ease mode");}}static NoEase(b,d,c,e){return c*b/e+d}static EaseInQuad(b,d,c,e){return c*(b/=e)*b+d}static EaseOutQuad(b,d,
c,e){return-c*(b/=e)*(b-2)+d}static EaseInOutQuad(b,d,c,e){return 1&gt;(b/=e/2)?c/2*b*b+d:-c/2*(--b*(b-2)-1)+d}static EaseInCubic(b,d,c,e){return c*(b/=e)*b*b+d}static EaseOutCubic(b,d,c,e){return c*((b=b/e-1)*b*b+1)+d}static EaseInOutCubic(b,d,c,e){return 1&gt;(b/=e/2)?c/2*b*b*b+d:c/2*((b-=2)*b*b+2)+d}static EaseInQuart(b,d,c,e){return c*(b/=e)*b*b*b+d}static EaseOutQuart(b,d,c,e){return-c*((b=b/e-1)*b*b*b-1)+d}static EaseInOutQuart(b,d,c,e){return 1&gt;(b/=e/2)?c/2*b*b*b*b+d:-c/2*((b-=2)*b*b*b-2)+d}static EaseInQuint(b,
d,c,e){return c*(b/=e)*b*b*b*b+d}static EaseOutQuint(b,d,c,e){return c*((b=b/e-1)*b*b*b*b+1)+d}static EaseInOutQuint(b,d,c,e){return 1&gt;(b/=e/2)?c/2*b*b*b*b*b+d:c/2*((b-=2)*b*b*b*b+2)+d}static EaseInSine(b,d,c,e){return-c*Math.cos(b/e*(Math.PI/2))+c+d}static EaseOutSine(b,d,c,e){return c*Math.sin(b/e*(Math.PI/2))+d}static EaseInOutSine(b,d,c,e){return-c/2*(Math.cos(Math.PI*b/e)-1)+d}static EaseInExpo(b,d,c,e){return 0===b?d:c*Math.pow(2,10*(b/e-1))+d}static EaseOutExpo(b,d,c,e){return b===e?d+c:c*
(-Math.pow(2,-10*b/e)+1)+d}static EaseInOutExpo(b,d,c,e){return 0===b?d:b===e?d+c:1&gt;(b/=e/2)?c/2*Math.pow(2,10*(b-1))+d:c/2*(-Math.pow(2,-10*--b)+2)+d}static EaseInCirc(b,d,c,e){return-c*(Math.sqrt(1-(b/=e)*b)-1)+d}static EaseOutCirc(b,d,c,e){return c*Math.sqrt(1-(b=b/e-1)*b)+d}static EaseInOutCirc(b,d,c,e){return 1&gt;(b/=e/2)?-c/2*(Math.sqrt(1-b*b)-1)+d:c/2*(Math.sqrt(1-(b-=2)*b)+1)+d}static EaseInElastic(b,d,c,e){let h=0,k=c;if(0===b)return d;if(1===(b/=e))return d+c;h||(h=.3*e);k&lt;Math.abs(c)?(k=
c,c=h/4):c=h/(2*Math.PI)*Math.asin(c/k);return-(k*Math.pow(2,10*--b)*Math.sin(2*(b*e-c)*Math.PI/h))+d}static EaseOutElastic(b,d,c,e){let h,k=0,m=c;if(0===b)return d;if(1===(b/=e))return d+c;k||(k=.3*e);m&lt;Math.abs(c)?(m=c,h=k/4):h=k/(2*Math.PI)*Math.asin(c/m);return m*Math.pow(2,-10*b)*Math.sin(2*(b*e-h)*Math.PI/k)+c+d}static EaseInOutElastic(b,d,c,e){let h,k=0,m=c;if(0===b)return d;if(2===(b/=e/2))return d+c;k||(k=.3*e*1.5);m&lt;Math.abs(c)?(m=c,h=k/4):h=k/(2*Math.PI)*Math.asin(c/m);return 1&gt;b?-.5*m*
Math.pow(2,10*--b)*Math.sin(2*(b*e-h)*Math.PI/k)+d:m*Math.pow(2,-10*--b)*Math.sin(2*(b*e-h)*Math.PI/k)*.5+c+d}static EaseInBack(b,d,c,e,h){void 0===h&amp;&amp;(h=1.70158);return c*(b/=e)*b*((h+1)*b-h)+d}static EaseOutBack(b,d,c,e,h){void 0===h&amp;&amp;(h=1.70158);return c*((b=b/e-1)*b*((h+1)*b+h)+1)+d}static EaseInOutBack(b,d,c,e,h){void 0===h&amp;&amp;(h=1.70158);return 1&gt;(b/=e/2)?c/2*b*b*(((h*=1.525)+1)*b-h)+d:c/2*((b-=2)*b*(((h*=1.525)+1)*b+h)+2)+d}static EaseInBounce(b,d,c,e){return c-a.EaseOutBounce(e-b,0,c,e)+d}static EaseOutBounce(b,
d,c,e){return(b/=e)&lt;1/2.75?7.5625*c*b*b+d:b&lt;2/2.75?c*(7.5625*(b-=1.5/2.75)*b+.75)+d:b&lt;2.5/2.75?c*(7.5625*(b-=2.25/2.75)*b+.9375)+d:c*(7.5625*(b-=2.625/2.75)*b+.984375)+d}static EaseInOutBounce(b,d,c,e){return b&lt;e/2?.5*a.EaseInBounce(2*b,0,c,e)+d:.5*a.EaseOutBounce(2*b-e,0,c,e)+.5*c+d}static EaseCubicBezier(b,d,c,e,h){return d+3*b*(c-d)+3*b**2*(d+e-2*c)+b**3*(h-d+3*c-3*e)}static EaseSpline(b,d,c,e,h,k,m,p,q,v){if(e===h&amp;&amp;k===m)return b;b=get_t_for_x(b,d,e,k,p,v);d=a$jscomp$281(c,h,m,q);e=b$jscomp$150(c,
h,m,q);c=c$jscomp$42(c,h,m,q);return calc_bezier(b,d,e,c)}static GetBezierSamples(b,d,c,e){const h=[],k=a$jscomp$281(b,d,c,e),m=b$jscomp$150(b,d,c,e);b=c$jscomp$42(b,d,c,e);for(d=0;11&gt;d;++d)c=calc_bezier(d*SAMPLE_STEP,k,m,b),h.push(c);return h}};
const SAMPLE_STEP=.1,a$jscomp$281=(a,b,d,c)=&gt;c-3*d+3*b-a,b$jscomp$150=(a,b,d,c)=&gt;3*d-6*b+3*a,c$jscomp$42=(a,b,d,c)=&gt;3*(b-a),calc_bezier=(a,b,d,c)=&gt;((b*a+d)*a+c)*a,get_slope=(a,b,d,c)=&gt;3*b*a*a+2*d*a+c,get_t_for_x=(a,b,d,c,e,h)=&gt;{if(1==a)return 1;for(var k=0,m=1,p=h[m];10!=m&amp;&amp;p&lt;=a;)m++,p=h[m],k+=SAMPLE_STEP;m--;p=h[m];h=k+(a-p)/(h[m+1]-p)*SAMPLE_STEP;m=a$jscomp$281(b,d,c,e);p=b$jscomp$150(b,d,c,e);b=c$jscomp$42(b,d,c,e);d=get_slope(h,m,p,b);if(0!==d)if(.02&lt;=d)for(k=0;4&gt;k;++k)d=calc_bezier(h,m,p,b)-
a,c=get_slope(h,m,p,b),h-=d/c;else{d=k;k+=SAMPLE_STEP;c=0;let q;do h=d+(k-d)/2,e=calc_bezier(h,m,p,b)-a,0&lt;e?k=h:d=h,e=1E-7&lt;Math.abs(e),q=10&gt;++c;while(e&amp;&amp;q)}return h};"use strict";const C3$jscomp$21=self.C3;function RequireStringOrNumber(a){C3$jscomp$21.IsString(a)}
C3$jscomp$21.ProbabilityTable=class{constructor(){this._items=[];this._totalWeight=0}Release(){this.Clear();this._items=null}Clear(){C3$jscomp$21.clear2DArray(this._items);this._totalWeight=0}GetTotalWeight(){return this._totalWeight}Sample(a=Math.random()*this.GetTotalWeight()){let b=0;for(const [d,c]of this._items)if(b+=d,a&lt;b)return c;return 0}AddItem(a,b){RequireStringOrNumber(b);this._totalWeight+=a;this._items.push([a,b])}RemoveItem(a,b){RequireStringOrNumber(b);const d=0===a;for(let c=0;c&lt;this._items.length;c++){const e=
this._items[c],h=e[1]===b;if((d||e[0]===a)&amp;&amp;h){this._items.splice(c,1);this._totalWeight-=e[0];break}}}asJSON(){return JSON.stringify(this._items)}static fromJSON(a){const b=new C3$jscomp$21.ProbabilityTable;a=JSON.parse(a);for(const d of a)b.AddItem(d[0],d[1]);return b}};"use strict";
self.C3.Event=class{constructor(a,b){this.type=a;this.cancelable=!!b;this.isAsync=this.propagationStopped=this.defaultPrevented=!1}preventDefault(){if(!this.cancelable)throw Error(`event '${this.type}' is not cancelable`);this.defaultPrevented=!0}stopPropagation(){if(!this.cancelable)throw Error(`event '${this.type}' cannot be stopped`);if(this.isAsync)throw Error(`cannot stop async event '${this.type}' propagation`);this.propagationStopped=!0}};"use strict";const C3$jscomp$23=self.C3;
C3$jscomp$23.Event.Handler=class extends C3$jscomp$23.DefendedBase{constructor(a){super();this._type=a;this._captureListeners=[];this._captureListenersSet=new Set;this._listeners=[];this._listenersSet=new Set;this._fireDepth=0;this._queueModifyListeners=[]}Release(){0&lt;this._fireDepth||(C3$jscomp$23.clearArray(this._captureListeners),this._captureListenersSet.clear(),C3$jscomp$23.clearArray(this._listeners),this._listenersSet.clear(),C3$jscomp$23.clearArray(this._queueModifyListeners),C3$jscomp$23.Release(this))}_AddListener(a,
b){this._IsFiring()?this._queueModifyListeners.push({op:"add",func:a,capture:b}):b?this._captureListenersSet.has(a)||(this._captureListeners.push(a),this._captureListenersSet.add(a)):this._listenersSet.has(a)||(this._listeners.push(a),this._listenersSet.add(a))}_RemoveListener(a,b){this._IsFiring()?this._queueModifyListeners.push({op:"remove",func:a,capture:b}):b?this._captureListenersSet.has(a)&amp;&amp;(this._captureListenersSet.delete(a),C3$jscomp$23.arrayFindRemove(this._captureListeners,a)):this._listenersSet.has(a)&amp;&amp;
(this._listenersSet.delete(a),C3$jscomp$23.arrayFindRemove(this._listeners,a))}_IsEmpty(){return!this._captureListeners.length&amp;&amp;!this._listeners.length}_IsFiring(){return 0&lt;this._fireDepth}_ProcessQueuedListeners(){const a=new Set,b=new Set;for(const d of this._queueModifyListeners)if("add"===d.op)this._AddListener(d.func,d.capture),d.capture?b.delete(d.func):a.delete(d.func);else if("remove"===d.op)d.capture?(this._captureListenersSet.delete(d.func),b.add(d.func)):(this._listenersSet.delete(d.func),
a.add(d.func));else throw Error("invalid op");C3$jscomp$23.arrayRemoveAllInSet(this._listeners,a);C3$jscomp$23.arrayRemoveAllInSet(this._captureListeners,b);C3$jscomp$23.clearArray(this._queueModifyListeners)}_FireCancellable(a){this._IncreaseFireDepth();let b=!1;for(let d=0,c=this._captureListeners.length;d&lt;c;++d)if(this._captureListeners[d](a),a.propagationStopped){b=!0;break}if(!b)for(let d=0,c=this._listeners.length;d&lt;c&amp;&amp;(this._listeners[d](a),!a.propagationStopped);++d);this._DecreaseFireDepth();
return!a.defaultPrevented}_FireNonCancellable(a){this._IncreaseFireDepth();for(let b=0,d=this._captureListeners.length;b&lt;d;++b)this._captureListeners[b](a);for(let b=0,d=this._listeners.length;b&lt;d;++b)this._listeners[b](a);this._DecreaseFireDepth();return!0}_IncreaseFireDepth(){this._fireDepth++}_DecreaseFireDepth(){this._fireDepth--;0===this._fireDepth&amp;&amp;0&lt;this._queueModifyListeners.length&amp;&amp;this._ProcessQueuedListeners()}SetDelayRemoveEventsEnabled(a){a?this._IncreaseFireDepth():this._DecreaseFireDepth()}_FireAsync(a){let b=
[];for(let d=0,c=this._captureListeners.length;d&lt;c;++d){let e=this._captureListeners[d];b.push(C3$jscomp$23.Asyncify(()=&gt;e(a)))}for(let d=0,c=this._listeners.length;d&lt;c;++d){let e=this._listeners[d];b.push(C3$jscomp$23.Asyncify(()=&gt;e(a)))}return Promise.all(b).then(()=&gt;!a.defaultPrevented)}_FireAndWait_AsyncOptional(a){const b=[];this._IncreaseFireDepth();for(let c=0,e=this._captureListeners.length;c&lt;e;++c){var d=this._captureListeners[c](a);d instanceof Promise&amp;&amp;b.push(d)}for(let c=0,e=this._listeners.length;c&lt;
e;++c)d=this._listeners[c](a),d instanceof Promise&amp;&amp;b.push(d);this._DecreaseFireDepth();return b.length?Promise.all(b).then(()=&gt;!a.defaultPrevented):!a.defaultPrevented}async _FireAndWaitAsync(a){return await this._FireAndWait_AsyncOptional(a)}async _FireAndWaitAsyncSequential(a){this._IncreaseFireDepth();for(let d=0,c=this._captureListeners.length;d&lt;c;++d){var b=this._captureListeners[d](a);b instanceof Promise&amp;&amp;await b}for(let d=0,c=this._listeners.length;d&lt;c;++d)b=this._listeners[d](a),b instanceof
Promise&amp;&amp;await b;this._DecreaseFireDepth();return!a.defaultPrevented}*_FireAsGenerator(a){this._IncreaseFireDepth();for(let d=0,c=this._captureListeners.length;d&lt;c;++d){var b=this._captureListeners[d](a);C3$jscomp$23.IsIterator(b)&amp;&amp;(yield*b)}for(let d=0,c=this._listeners.length;d&lt;c;++d)b=this._listeners[d](a),C3$jscomp$23.IsIterator(b)&amp;&amp;(yield*b);this._DecreaseFireDepth()}};"use strict";const C3$jscomp$24=self.C3;
C3$jscomp$24.Event.Dispatcher=class extends C3$jscomp$24.DefendedBase{constructor(){super();this._eventHandlers=new Map;this._dispatcherWasReleased=!1}Release(){if(this._dispatcherWasReleased)throw Error("already released");this.ClearEvents();this._dispatcherWasReleased=!0;C3$jscomp$24.Release(this)}WasReleased(){return this._dispatcherWasReleased}ClearEvents(){for(let a of this._eventHandlers.values())a.Release();this._eventHandlers.clear()}_GetHandlerByType(a,b){let d=this._eventHandlers.get(a);
return d?d:b?(d=C3$jscomp$24.New(C3$jscomp$24.Event.Handler,a),this._eventHandlers.set(a,d),d):null}HasAnyHandlerFor(a){return this._eventHandlers.has(a)}addEventListener(a,b,d){this._GetHandlerByType(a,!0)._AddListener(b,!!d)}removeEventListener(a,b,d){let c=this._GetHandlerByType(a,!1);c&amp;&amp;(c._RemoveListener(b,!!d),c._IsEmpty()&amp;&amp;this._eventHandlers.delete(a))}dispatchEvent(a){const b=this._GetHandlerByType(a.type,!1);return b?a.cancelable?b._FireCancellable(a):b._FireNonCancellable(a):!0}dispatchEventAsync(a){const b=
this._GetHandlerByType(a.type,!1);if(!b)return Promise.resolve(!0);a.isAsync=!0;return b._FireAsync(a)}async dispatchEventAndClearAsync(a){const b=this._GetHandlerByType(a.type,!1);if(!b)return!0;this._eventHandlers.delete(a.type);a.isAsync=!0;a=await b._FireAsync(a);b.Release();return a}async dispatchEventAndWaitAsync(a){const b=this._GetHandlerByType(a.type,!1);return b?await b._FireAndWaitAsync(a):!0}dispatchEventAndWait_AsyncOptional(a){const b=this._GetHandlerByType(a.type,!1);return b?b._FireAndWait_AsyncOptional(a):
!0}async dispatchEventAndWaitAsyncSequential(a){const b=this._GetHandlerByType(a.type,!1);return b?await b._FireAndWaitAsyncSequential(a):!0}dispatchGeneratorEvent(a){const b=this._GetHandlerByType(a.type,!1);if(!b)return null;if(a.cancelable)throw Error("not supported");return b._FireAsGenerator(a)}SetDelayRemoveEventsEnabled(a){for(const b of this._eventHandlers.values())b.SetDelayRemoveEventsEnabled(a)}};"use strict";
const C3$jscomp$25=self.C3,SETTIMEOUT_INTERVAL=16,SUPPORTS_RIC="undefined"!==typeof requestIdleCallback;let workQueue=[],callbackId=-1,highThroughputMode=0;function SetNewCallback(a){callbackId=SUPPORTS_RIC&amp;&amp;0===highThroughputMode?requestIdleCallback(DoAsyncifiedWork,{timeout:35}):setTimeout(DoAsyncifiedWork,0&lt;highThroughputMode?1:a)}
function DoAsyncifiedWork(a){callbackId=-1;if(workQueue.length){var b=performance.now(),d=0;do{DoNextAsyncifiedJob(workQueue.shift());var c=performance.now();++d;var e=(c-b)/d*1.1}while(workQueue.length&amp;&amp;(SUPPORTS_RIC&amp;&amp;0===highThroughputMode&amp;&amp;"undefined"!==typeof a?e&lt;a.timeRemaining():12&gt;c-b+e));-1===callbackId&amp;&amp;workQueue.length&amp;&amp;SetNewCallback(Math.max(SETTIMEOUT_INTERVAL-(c-b),4))}}function DoNextAsyncifiedJob(a){let b;try{b=a.func()}catch(d){a.reject(d);return}a.resolve(b)}
let asyncifyDisabled=C3$jscomp$25.QueryString.Has("disable-asyncify");asyncifyDisabled&amp;&amp;console.warn("[Asyncify] Asyncify has been disabled due to disable-asyncify in the query string. Some work will now be done synchronously.");C3$jscomp$25.Asyncify=function(a){let b=null;C3$jscomp$25.isDebug&amp;&amp;(b=C3$jscomp$25.GetCallStack());return new Promise((d,c)=&gt;{workQueue.push({func:a,resolve:d,reject:c,stack:b});asyncifyDisabled?DoNextAsyncifiedJob(workQueue.pop()):-1===callbackId&amp;&amp;SetNewCallback(SETTIMEOUT_INTERVAL)})};
C3$jscomp$25.Asyncify.SetHighThroughputMode=function(a){if(a)++highThroughputMode;else if(--highThroughputMode,0&gt;highThroughputMode)throw Error("already turned off high throughput mode");};"use strict";const C3$jscomp$26=self.C3,IDLE_CHECK_MIN_INTERVAL=1E3,IDLE_CHECK_TIMER_OVERSHOOT=100;let cachedNowTime=-1;function ClearTimeCache(){cachedNowTime=-1}C3$jscomp$26.FastGetDateNow=function(){-1===cachedNowTime&amp;&amp;(cachedNowTime=Date.now(),self.setTimeout(ClearTimeCache,16));return cachedNowTime};
let timerId=-1,nextDeadline=-1,activeIdleTimeouts=new Set;function CheckActiveIdleTimeouts(){nextDeadline=timerId=-1;let a=Date.now();for(let b of activeIdleTimeouts)if(b._CheckTimeout(a)){let d=b._GetDeadline();if(-1===nextDeadline||d&lt;nextDeadline)nextDeadline=d}else activeIdleTimeouts.delete(b);-1!==nextDeadline&amp;&amp;(timerId=self.setTimeout(CheckActiveIdleTimeouts,Math.max(nextDeadline-a+IDLE_CHECK_TIMER_OVERSHOOT,IDLE_CHECK_MIN_INTERVAL)))}
C3$jscomp$26.IdleTimeout=class{constructor(a,b){this._callback=a;this._timeout=1E3*b;this._deadline=0;this._isActive=!1}Reset(){let a=C3$jscomp$26.FastGetDateNow();this._deadline=a+this._timeout;this._isActive||(activeIdleTimeouts.add(this),this._isActive=!0);-1===timerId?(nextDeadline=this._deadline,timerId=self.setTimeout(CheckActiveIdleTimeouts,this._timeout+IDLE_CHECK_TIMER_OVERSHOOT)):this._deadline&lt;nextDeadline&amp;&amp;nextDeadline&gt;a+IDLE_CHECK_MIN_INTERVAL&amp;&amp;(self.clearTimeout(timerId),nextDeadline=
this._deadline,timerId=self.setTimeout(CheckActiveIdleTimeouts,this._timeout+IDLE_CHECK_TIMER_OVERSHOOT))}_CheckTimeout(a){return a&gt;=this._deadline?this._callback()?(this._deadline=a+this._timeout,!0):this._isActive=!1:!0}_GetDeadline(){return this._deadline}Cancel(){this._isActive&amp;&amp;(activeIdleTimeouts.delete(this),this._isActive=!1,0===activeIdleTimeouts.size&amp;&amp;-1!==timerId&amp;&amp;(self.clearTimeout(timerId),nextDeadline=timerId=-1))}Release(){this.Cancel();this._callback=null}};"use strict";
const C3$jscomp$27=self.C3;
C3$jscomp$27.Disposable=class a{constructor(b){this._disposed=!1;this._disposeAction=b}Dispose(){this._disposed||(this._disposed=!0,this._disposeAction&amp;&amp;(this._disposeAction(),this._disposeAction=null))}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(b){return new a(()=&gt;b.Release())}static From(b,d,c,e,h){if("undefined"===typeof e||null===e)e=!1;else if("boolean"!==typeof e&amp;&amp;"object"!==typeof e)throw new TypeError("invalid event listener options");h&amp;&amp;(c=c.bind(h));if(d.includes(" ")){d=
d.split(" ");h=new C3$jscomp$27.CompositeDisposable;for(let k of d)b.addEventListener(k,c,e),h.Add(C3$jscomp$27.New(C3$jscomp$27.Disposable,()=&gt;b.removeEventListener(k,c,e)));return h}b.addEventListener(d,c,e);return C3$jscomp$27.New(C3$jscomp$27.Disposable,()=&gt;b.removeEventListener(d,c,e))}};C3$jscomp$27.StubDisposable=class extends C3$jscomp$27.Disposable{SetAction(a){this._disposeAction=a}};
C3$jscomp$27.CompositeDisposable=class extends C3$jscomp$27.Disposable{constructor(...a){super();this._disposables=new Set;for(let b of a)this.Add(b)}Add(...a){if(this._disposed)throw Error("already disposed");for(let b of a)this._disposables.add(b)}Remove(a){if(this._disposed)throw Error("already disposed");this._disposables.delete(a)}RemoveAll(){if(this._disposed)throw Error("already disposed");if(this._disposables){for(let a of this._disposables)a.Dispose();this._disposables.clear()}}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw Error("already disposed");
this._disposed=!0;for(let a of this._disposables)a.Dispose();this._disposables.clear();this._disposables=null}Release(){this.Dispose()}};"use strict";const C3$jscomp$28=self.C3;
C3$jscomp$28.KahanSum=class extends C3$jscomp$28.DefendedBase{constructor(){super();this._sum=this._t=this._y=this._c=0}Add(a){this._y=+a-this._c;this._t=this._sum+this._y;this._c=this._t-this._sum-this._y;this._sum=this._t}Subtract(a){this._sum-=+a}Get(){return this._sum}Reset(){this._sum=this._t=this._y=this._c=0}Set(a){this._t=this._y=this._c=0;this._sum=+a}Copy(a){this._c=a._c;this._y=a._y;this._t=a._t;this._sum=a._sum}Release(){}};"use strict";
const C3$jscomp$29=self.C3,js_cols={RBnode:function(a){this.tree=a;this.left=this.right=this.tree.sentinel;this.parent=null;this.color=!1;this.key=null},RedBlackSet:function(a){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel;this.compare=a||this.default_compare}};js_cols.RedBlackSet.prototype.default_compare=function(a,b){return a&lt;b?-1:b&lt;a?1:0};
js_cols.RedBlackSet.prototype.clone=function(){var a=new js_cols.RedBlackSet(this.compare);a.insertAll(this);return a};js_cols.RedBlackSet.prototype.clear=function(){this.size=0;this.sentinel=new js_cols.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel};
js_cols.RedBlackSet.prototype.leftRotate=function(a){var b=a.right;a.right=b.left;b.left!=this.sentinel&amp;&amp;(b.left.parent=a);b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.left?a.parent.left=b:a.parent.right=b;b.left=a;a.parent=b};js_cols.RedBlackSet.prototype.rightRotate=function(a){var b=a.left;a.left=b.right;b.right!=this.sentinel&amp;&amp;(b.right.parent=a);b.parent=a.parent;a.parent==this.sentinel?this.root=b:a==a.parent.right?a.parent.right=b:a.parent.left=b;b.right=a;a.parent=b};
js_cols.RedBlackSet.prototype.insert=function(a){if(this.contains(a))this.get_(a).key=a;else{var b=new js_cols.RBnode(this);b.key=a;a=this.sentinel;for(var d=this.root;d!=this.sentinel;)a=d,d=0&gt;this.compare(b.key,d.key)?d.left:d.right;b.parent=a;a==this.sentinel?this.root=b:0&gt;this.compare(b.key,a.key)?a.left=b:a.right=b;b.left=this.sentinel;b.right=this.sentinel;b.color=!0;this.insertFixup(b);this.size++}};
js_cols.RedBlackSet.prototype.insertFixup=function(a){for(;a!=this.sentinel&amp;&amp;a!=this.root&amp;&amp;1==a.parent.color;)if(a.parent==a.parent.parent.left){var b=a.parent.parent.right;1==b.color?(a.parent.color=!1,b.color=!1,a.parent.parent.color=!0,a=a.parent.parent):(a==a.parent.right&amp;&amp;(a=a.parent,this.leftRotate(a)),a.parent.color=!1,a.parent.parent.color=!0,a.parent.parent!=this.sentinel&amp;&amp;this.rightRotate(a.parent.parent))}else b=a.parent.parent.left,1==b.color?(a.parent.color=!1,b.color=!1,a.parent.parent.color=
!0,a=a.parent.parent):(a==a.parent.left&amp;&amp;(a=a.parent,this.rightRotate(a)),a.parent.color=!1,a.parent.parent.color=!0,a.parent.parent!=this.sentinel&amp;&amp;this.leftRotate(a.parent.parent));this.root.color=!1};
js_cols.RedBlackSet.prototype.delete_=function(a){var b=a.left==this.sentinel||a.right==this.sentinel?a:this.successor_(a);var d=b.left!=this.sentinel?b.left:b.right;d.parent=b.parent;b.parent==this.sentinel?this.root=d:b==b.parent.left?b.parent.left=d:b.parent.right=d;b!=a&amp;&amp;(a.key=b.key);0==b.color&amp;&amp;this.deleteFixup(d);this.size--};
js_cols.RedBlackSet.prototype.deleteFixup=function(a){for(;a!=this.root&amp;&amp;0==a.color;)if(a==a.parent.left){var b=a.parent.right;1==b.color&amp;&amp;(b.color=!1,a.parent.color=!0,this.leftRotate(a.parent),b=a.parent.right);0==b.left.color&amp;&amp;0==b.right.color?(b.color=!0,a=a.parent):(0==b.right.color&amp;&amp;(b.left.color=!1,b.color=!0,this.rightRotate(b),b=a.parent.right),b.color=a.parent.color,a.parent.color=!1,b.right.color=!1,this.leftRotate(a.parent),a=this.root)}else b=a.parent.left,1==b.color&amp;&amp;(b.color=!1,a.parent.color=
!0,this.rightRotate(a.parent),b=a.parent.left),0==b.right.color&amp;&amp;0==b.left.color?(b.color=!0,a=a.parent):(0==b.left.color&amp;&amp;(b.right.color=!1,b.color=!0,this.leftRotate(b),b=a.parent.left),b.color=a.parent.color,a.parent.color=!1,b.left.color=!1,this.rightRotate(a.parent),a=this.root);a.color=!1};js_cols.RedBlackSet.prototype.remove=function(a){a=this.get_(a);if(a!=this.sentinel){var b=a.key;this.delete_(a);return b}return null};js_cols.RedBlackSet.prototype.removeSwapped=function(a,b){this.remove(b)};
js_cols.RedBlackSet.prototype.min=function(a){for(;a.left!=this.sentinel;)a=a.left;return a};js_cols.RedBlackSet.prototype.max=function(a){for(;a.right!=this.sentinel;)a=a.right;return a};js_cols.RedBlackSet.prototype.successor_=function(a){if(a.right!=this.sentinel)return this.min(a.right);for(var b=a.parent;b!=this.sentinel&amp;&amp;a==b.right;)a=b,b=b.parent;return b};
js_cols.RedBlackSet.prototype.predeccessor_=function(a){if(a.left!=this.sentinel)return this.max(a.left);for(var b=a.parent;b!=this.sentinel&amp;&amp;a==b.left;)a=b,b=b.parent;return b};js_cols.RedBlackSet.prototype.successor=function(a){if(0&lt;this.size){a=this.get_(a);if(a==this.sentinel)return null;if(a.right!=this.sentinel)return this.min(a.right).key;for(var b=a.parent;b!=this.sentinel&amp;&amp;a==b.right;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}return null};
js_cols.RedBlackSet.prototype.predecessor=function(a){if(0&lt;this.size){a=this.get_(a);if(a==this.sentinel)return null;if(a.left!=this.sentinel)return this.max(a.left).key;for(var b=a.parent;b!=this.sentinel&amp;&amp;a==b.left;)a=b,b=b.parent;return b!=this.sentinel?b.key:null}return null};js_cols.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key};js_cols.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key};
js_cols.RedBlackSet.prototype.get_=function(a){for(var b=this.root;b!=this.sentinel&amp;&amp;0!=this.compare(b.key,a);)b=0&gt;this.compare(a,b.key)?b.left:b.right;return b};js_cols.RedBlackSet.prototype.contains=function(a){return null!=this.get_(a).key};js_cols.RedBlackSet.prototype.getValues=function(){var a=[];this.forEach(function(b){a.push(b)});return a};
js_cols.RedBlackSet.prototype.insertAll=function(a){if("array"==js_cols.typeOf(a))for(var b=0;b&lt;a.length;b++)this.insert(a[b]);else if("function"==js_cols.typeOf(a.forEach))a.forEach(this.insert,this);else if("function"==js_cols.typeOf(a.getValues))for(a=a.getValues(),b=0;b&lt;a.length;b++)this.insert(a[b]);else if("object"==js_cols.typeOf(a))for(b in a)this.insert(a[b])};
js_cols.RedBlackSet.prototype.removeAll=function(a){if("array"==js_cols.typeOf(a))for(var b=0;b&lt;a.length;b++)this.remove(a[b]);else if("function"==js_cols.typeOf(a.forEach))a.forEach(this.removeSwapped,this);else if("function"==js_cols.typeOf(a.getValues))for(a=a.getValues(),b=0;b&lt;a.length;b++)this.remove(a[b]);else if("object"==js_cols.typeOf(a))for(b in a)this.remove(a[b])};
js_cols.RedBlackSet.prototype.containsAll=function(a){if("array"==js_cols.typeOf(a)){for(var b=0;b&lt;a.length;b++)if(!this.contains(a[b]))return!1;return!0}if("function"==js_cols.typeOf(a.forEach))return a.every(this.contains,this);if("function"==js_cols.typeOf(a.getValues)){a=a.getValues();for(b=0;b&lt;a.length;b++)if(!this.contains(a[b]))return!1;return!0}if("object"==js_cols.typeOf(a)){for(b in a)if(!this.contains(a[b]))return!1;return!0}};
js_cols.RedBlackSet.prototype.range=function(a,b){var d=[];this.traverseFromTo(function(c){d.push(c)},a,b);return d};js_cols.RedBlackSet.prototype.traverse=function(a,b){if(!this.isEmpty())for(var d=this.min(this.root);d!=this.sentinel&amp;&amp;!a.call(b,d.key,this);)d=this.successor_(d)};js_cols.RedBlackSet.prototype.traverseFrom=function(a,b,d){if(!this.isEmpty())for(b=this.get_(b);b!=this.sentinel&amp;&amp;!a.call(d,b.key,this);)b=this.successor_(b)};
js_cols.RedBlackSet.prototype.traverseTo=function(a,b,d){if(!this.isEmpty()){var c=this.min(this.root);for(b=this.get_(b);c!=b&amp;&amp;!a.call(d,c.key,this);)c=this.successor_(c)}};js_cols.RedBlackSet.prototype.traverseFromTo=function(a,b,d,c){if(!this.isEmpty())for(b=this.get_(b),d=this.get_(d);b!=d&amp;&amp;!a.call(c,b.key,this);)b=this.successor_(b)};js_cols.RedBlackSet.prototype.traverseBackwards=function(a,b){if(!this.isEmpty())for(var d=this.max(this.root);d!=this.sentinel&amp;&amp;!a.call(b,d.key,this);)d=this.predeccessor_(d)};
js_cols.RedBlackSet.prototype.forEach=function(a,b){if(!this.isEmpty())for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.call(b,d.key,d.key,this)};js_cols.RedBlackSet.prototype.some=function(a,b){if(this.isEmpty())return!1;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))if(a.call(b,d.key,d.key,this))return!0;return!1};
js_cols.RedBlackSet.prototype.every=function(a,b){if(this.isEmpty())return!1;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))if(!a.call(b,d.key,d.key,this))return!1;return!0};js_cols.RedBlackSet.prototype.map=function(a,b){var d=[];if(this.isEmpty())return d;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))d.push(a.call(b,c.key,c.key,this));return d};
js_cols.RedBlackSet.prototype.filter=function(a,b){var d=[];if(this.isEmpty())return d;for(var c=this.min(this.root);c!=this.sentinel;c=this.successor_(c))a.call(b,c.key,c.key,this)&amp;&amp;d.push(c.key);return d};js_cols.RedBlackSet.prototype.getCount=function(){return this.size};js_cols.RedBlackSet.prototype.isEmpty=function(){return 0==this.size};
js_cols.RedBlackSet.prototype.isSubsetOf=function(a){var b=js_cols.getCount(a);if(this.getCount()&gt;b)return!1;b=0;if(this.isEmpty())return!0;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))js_cols.contains.call(a,a,d.key)&amp;&amp;b++;return b==this.getCount()};
js_cols.RedBlackSet.prototype.intersection=function(a){var b=new js_cols.RedBlackSet(this.compare);if(this.isEmpty())return b;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.contains.call(a,d.key,d.key,this)&amp;&amp;b.insert(d.key);return b};
C3$jscomp$29.RedBlackSet=class extends C3$jscomp$29.DefendedBase{constructor(a){super();this._rbSet=new js_cols.RedBlackSet(a);this._enableQueue=!1;this._queueInsert=new Set;this._queueRemove=new Set}Add(a){this._enableQueue?this._rbSet.contains(a)?this._queueRemove.delete(a):this._queueInsert.add(a):this._rbSet.insert(a)}Remove(a){this._enableQueue?this._rbSet.contains(a)?this._queueRemove.add(a):this._queueInsert.delete(a):this._rbSet.remove(a)}Has(a){return this._enableQueue?this._queueInsert.has(a)?
!0:!this._queueRemove.has(a)&amp;&amp;this._rbSet.contains(a):this._rbSet.contains(a)}Clear(){this._rbSet.clear();this._queueInsert.clear();this._queueRemove.clear()}toArray(){if(this._enableQueue)throw Error("cannot be used in queueing mode");return this._rbSet.getValues()}GetSize(){return this._rbSet.getCount()+this._queueInsert.size-this._queueRemove.size}IsEmpty(){return 0===this.GetSize()}Front(){if(this.IsEmpty())throw Error("empty set");if(this._enableQueue)throw Error("cannot be used in queueing mode");
const a=this._rbSet;return a.min(a.root).key}Shift(){if(this.IsEmpty())throw Error("empty set");if(this._enableQueue)throw Error("cannot be used in queueing mode");const a=this.Front();this.Remove(a);return a}SetQueueingEnabled(a){a=!!a;if(this._enableQueue!==a&amp;&amp;(this._enableQueue=a,!a)){for(const b of this._queueRemove)this._rbSet.remove(b);this._queueRemove.clear();for(const b of this._queueInsert)this._rbSet.insert(b);this._queueInsert.clear()}}ForEach(a){this._rbSet.forEach(a)}*values(){if(!this.IsEmpty()){var a=
this._rbSet;for(let b=a.min(a.root);b!=a.sentinel;b=a.successor_(b))yield b.key}}[Symbol.iterator](){return this.values()}};"use strict";const C3$jscomp$30=self.C3;
C3$jscomp$30.PromiseThrottle=class{constructor(a=C3$jscomp$30.hardwareConcurrency){this._maxParallel=a;this._queue=[];this._activeCount=0}Add(a){return new Promise((b,d)=&gt;{this._queue.push({func:a,resolve:b,reject:d});this._MaybeStartNext()})}_FindInQueue(a){for(let b=0,d=this._queue.length;b&lt;d;++b)if(this._queue[b].func===a)return b;return-1}RemoveAndResolve(a,b){a=this._FindInQueue(a);if(-1===a)throw Error("cannot find promise to resolve");this._queue[a].resolve(b);this._queue.splice(a,1)}RemoveAndReject(a,
b){a=this._FindInQueue(a);if(-1===a)throw Error("cannot find promise to reject");this._queue[a].reject(b);this._queue.splice(a,1)}async _MaybeStartNext(){if(this._queue.length&amp;&amp;!(this._activeCount&gt;=this._maxParallel)){this._activeCount++;var a=this._queue.shift();try{const b=await a.func();a.resolve(b)}catch(b){a.reject(b)}this._activeCount--;this._MaybeStartNext()}}static async Batch(a,b){const d=[];let c=!1;const e=async k=&gt;{for(;(k=b.pop())&amp;&amp;!c;)try{d.push(await k())}catch(m){throw c=!0,m;}},h=
[];for(;a--;)h.push(e());await Promise.all(h);return d}};"use strict";const C3$jscomp$31=self.C3;
C3$jscomp$31.RateLimiter=class{constructor(a,b,d){this._callback=a;this._interval=b;this._intervalOnBattery=d||2*b;this._timerId=-1;this._lastCallTime=-Infinity;this._timerCallFunc=()=&gt;this._OnTimer();this._canRunImmediate=this._ignoreReset=!1;this._callbackArguments=null}SetCanRunImmediate(a){this._canRunImmediate=!!a}_GetInterval(){return"undefined"!==typeof C3$jscomp$31.Battery&amp;&amp;C3$jscomp$31.Battery.IsOnBatteryPower()?this._intervalOnBattery:this._interval}Call(...a){if(-1===this._timerId){this._callbackArguments=
a;a=C3$jscomp$31.FastGetDateNow();var b=a-this._lastCallTime,d=this._GetInterval();b&gt;=d&amp;&amp;this._canRunImmediate?(this._lastCallTime=a,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(d-b,4))}}_RunCallback(){this._ignoreReset=!0;const a=this._callbackArguments;this._callbackArguments=null;a?this._callback(...a):this._callback();this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._callbackArguments=null,this._lastCallTime=C3$jscomp$31.FastGetDateNow())}_OnTimer(){this._timerId=
-1;this._lastCallTime=C3$jscomp$31.FastGetDateNow();this._RunCallback()}_CancelTimer(){-1!==this._timerId&amp;&amp;(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer();this._timerCallFunc=this._callbackArguments=this._callback=null}};"use strict";const C3$jscomp$32=self.C3;
C3$jscomp$32.SVGRasterManager=class{constructor(){this._images=new Map;this._allowNpotSurfaces=!1;this._redrawCallback=this._releaseResultCallback=this._rasterAtSizeCallback=this._getBaseSizeCallback=null}SetNpotSurfaceAllowed(a){this._allowNpotSurfaces=!!a}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(a){this._getBaseSizeCallback=a}GetBaseSize(a){if(!this._getBaseSizeCallback)throw Error("no get base size callback set");return this._getBaseSizeCallback(a)}SetRasterAtSizeCallback(a){this._rasterAtSizeCallback=
a}RasterAtSize(a,b,d,c,e,h){if(!this._rasterAtSizeCallback)throw Error("no raster at size callback set");return this._rasterAtSizeCallback(a,b,d,c,e,h)}SetReleaseResultCallback(a){this._releaseResultCallback=a}ReleaseResult(a){if(!this._releaseResultCallback)throw Error("no release result callback set");this._releaseResultCallback(a)}SetRedrawCallback(a){this._redrawCallback=a}Redraw(){if(!this._redrawCallback)throw Error("no redraw callback set");this._redrawCallback()}AddImage(a){let b=this._images.get(a);
b||(b=C3$jscomp$32.New(C3$jscomp$32.SVGRasterImage,this,a),this._images.set(a,b));b.IncReference();return b}_RemoveImage(a){this._images.delete(a.GetDataSource())}OnTexturesChanged(){for(const a of this._images.values())a.ReleaseRasterizedResult(),a.ForceRasterAgain()}};"use strict";const C3$jscomp$33=self.C3;
C3$jscomp$33.SVGRasterImage=class{constructor(a,b){this._manager=a;this._dataSource=b;this._baseHeight=this._baseWidth=this._refCount=0;this._getBaseSizePromise=this._manager.GetBaseSize(b).then(d=&gt;{this._baseWidth=d[0];this._baseHeight=d[1];this._manager.Redraw()}).catch(d=&gt;{console.error("[SVG] Error loading SVG: ",d);this._hadError=!0;this._manager.Redraw()});this._rasterImageHeight=this._rasterImageWidth=this._rasterSurfaceHeight=this._rasterSurfaceWidth=0;this._isRasterizing=!1;this._rasterizedResult=
null;this._hadError=this._forceRaster=!1}Release(){if(0&gt;=this._refCount)throw Error("already released");this._refCount--;0===this._refCount&amp;&amp;this._Release()}ReleaseRasterizedResult(){this._rasterizedResult&amp;&amp;(this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=null)}_Release(){this.ReleaseRasterizedResult();this._manager._RemoveImage(this);this._manager=null}GetDataSource(){return this._dataSource}IncReference(){this._refCount++}HasReferences(){return 0&lt;this._refCount}GetRasterizedResult(){return this._rasterizedResult}ForceRasterAgain(){this._forceRaster=
!0}async StartRasterForSize(a,b,d){if(0!==b&amp;&amp;0!==d&amp;&amp;!this._hadError&amp;&amp;!this._isRasterizing){var c=C3$jscomp$33.nextHighestPowerOfTwo(Math.ceil(b)),e=C3$jscomp$33.nextHighestPowerOfTwo(Math.ceil(d)),h=Math.max(c,e);4096&lt;h&amp;&amp;(h=4096/h,b*=h,d*=h,c=Math.min(Math.ceil(c*h),4096),e=Math.min(Math.ceil(e*h),4096));b&lt;c&amp;&amp;d&lt;e&amp;&amp;(d=b/d,c/e&gt;d?(b=e*d,d=e):(b=c,d=c/d));this._manager.IsNpotSurfaceAllowed()&amp;&amp;(c=Math.ceil(b),e=Math.ceil(d));c&lt;=this._rasterSurfaceWidth&amp;&amp;e&lt;=this._rasterSurfaceHeight&amp;&amp;!this._forceRaster||
(this._isRasterizing=!0,this._rasterSurfaceWidth=c,this._rasterSurfaceHeight=e,a=await this._manager.RasterAtSize(this._dataSource,a,this._rasterSurfaceWidth,this._rasterSurfaceHeight,b,d),this._manager&amp;&amp;(this.ReleaseRasterizedResult(),this._rasterizedResult=a,this._rasterImageWidth=b,this._rasterImageHeight=d,this._forceRaster=this._isRasterizing=!1,this._manager.Redraw()))}}WhenBaseSizeReady(){return this._getBaseSizePromise}GetBaseWidth(){return this._baseWidth}GetBaseHeight(){return this._baseHeight}GetRasterWidth(){return this._rasterImageWidth}GetRasterHeight(){return this._rasterImageHeight}HadError(){return this._hadError}};
"use strict";const C3$jscomp$34=self.C3;C3$jscomp$34.UTF8_BOM="\ufeff";const NUMERIC_CHARS=new Set([..."0123456789"]);C3$jscomp$34.IsNumericChar=function(a){return NUMERIC_CHARS.has(a)};const WHITESPACE_CHARS=new Set([..." \t\n\r\u00a0\u0085\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000"]);C3$jscomp$34.IsWhitespaceChar=function(a){return WHITESPACE_CHARS.has(a)};C3$jscomp$34.FilterWhitespace=function(a){return[...a].filter(b=&gt;!C3$jscomp$34.IsWhitespaceChar(b)).join("")};
C3$jscomp$34.IsStringAllWhitespace=function(a){for(const b of a)if(!C3$jscomp$34.IsWhitespaceChar(b))return!1;return!0};C3$jscomp$34.IsCharArrayAllWhitespace=function(a){for(const b of a)if(!C3$jscomp$34.IsWhitespaceChar(b))return!1;return!0};C3$jscomp$34.IsUnprintableChar=function(a){return 1===a.length&amp;&amp;32&gt;a.charCodeAt(0)};C3$jscomp$34.FilterUnprintableChars=function(a){return[...a].filter(b=&gt;!C3$jscomp$34.IsUnprintableChar(b)).join("")};const NUMERIC_STRING_CHARS=new Set([..."0123456789.+-e"]);
C3$jscomp$34.IsStringNumber=function(a){a=a.trim();if(!a.length)return!1;let b=a.charAt(0);if("-"!==b&amp;&amp;!NUMERIC_CHARS.has(b))return!1;for(let d of a)if(!NUMERIC_STRING_CHARS.has(d))return!1;return!0};C3$jscomp$34.RemoveTrailingDigits=function(a){let b=a.length;for(;0&lt;b;){let d=a.charAt(b-1);if(!C3$jscomp$34.IsNumericChar(d))break;--b}return a.substr(0,b)};
C3$jscomp$34.IncrementNumberAtEndOf=function(a){let b=C3$jscomp$34.RemoveTrailingDigits(a);a=(a=a.substr(b.length))?(parseInt(a,10)+1).toString():"2";return b+a};const HTML_ENTITY_MAP=new Map([["&amp;","&amp;amp;"],["&lt;","&amp;lt;"],["&gt;","&amp;gt;"],['"',"&amp;quot;"],["'","&amp;#39;"]]);function lookupHtmlEntity(a){return HTML_ENTITY_MAP.get(a)}const HTML_ENTITY_REGEX=/[&amp;&lt;&gt;"']/g;C3$jscomp$34.EscapeHTML=function(a){return a.replace(HTML_ENTITY_REGEX,lookupHtmlEntity)};
C3$jscomp$34.EscapeJS=function(a){a=C3$jscomp$34.ReplaceAll(a,"\\","\\\\");a=C3$jscomp$34.ReplaceAll(a,'"','\\"');a=C3$jscomp$34.ReplaceAll(a,"\t","\\t");a=C3$jscomp$34.ReplaceAll(a,"\r","");return C3$jscomp$34.ReplaceAll(a,"\n","\\n")};C3$jscomp$34.EscapeXML=function(a){a=C3$jscomp$34.ReplaceAll(a,"&amp;","&amp;amp;");a=C3$jscomp$34.ReplaceAll(a,"&lt;","&amp;lt;");a=C3$jscomp$34.ReplaceAll(a,"&gt;","&amp;gt;");return C3$jscomp$34.ReplaceAll(a,'"',"&amp;quot;")};const ESCAPE_REGEX=/[-[\]{}()*+?.,\\^$|#\s]/g;
C3$jscomp$34.EscapeRegex=function(a){return a.replace(ESCAPE_REGEX,"\\$&amp;")};C3$jscomp$34.FindAll=function(a,b,d=!1){if(!b)return[];d||(a=a.toLowerCase(),b=b.toLowerCase());d=b.length;var c=0;let e=[];for(;-1&lt;(c=a.indexOf(b,c));)e.push(c),c+=d;return e};C3$jscomp$34.ReplaceAll=function(a,b,d){return a.replaceAll(b,()=&gt;d)};C3$jscomp$34.ReplaceAllCaseInsensitive=function(a,b,d){return a.replace(new RegExp(C3$jscomp$34.EscapeRegex(b),"gi"),()=&gt;d)};
C3$jscomp$34.SetElementContent=function(a,b){"string"===typeof b?a.textContent=b:b.isPlainText()?a.textContent=b.toString():(a.innerHTML=b.toHTML(),b instanceof C3$jscomp$34.BBString&amp;&amp;b.attachLinkHandlers(a))};C3$jscomp$34.StringLikeEquals=function(a,b){return a instanceof C3$jscomp$34.HtmlString||a instanceof C3$jscomp$34.BBString?a.equals(b):b instanceof C3$jscomp$34.HtmlString||b instanceof C3$jscomp$34.BBString?b.equals(a):a===b};
C3$jscomp$34.StringSubstitute=function(a,...b){let d=a;for(let c=0,e=b.length;c&lt;e;++c){const h=`{${c}}`;if(!a.includes(h))throw Error(`missing placeholder '${h}' in string substitution`);d=d.replace(h,b[c].toString())}return d};
C3$jscomp$34.StringSubstituteAllowMissing=function(a,...b){let d=a,c=-1,e=-1;for(let h=0,k=b.length;h&lt;k;++h){const m=`{${h}}`;a.includes(m)?(e=h,d=d.replace(m,b[h].toString())):-1===c&amp;&amp;(c=h)}if(0&lt;=c&amp;&amp;0&lt;=e&amp;&amp;c&lt;e)throw Error(`missing placeholder '${c}' in string substitution`);return d};C3$jscomp$34.StringSubstituteMap=function(a,b){for(let [d,c]of Object.entries(b))a=a.replaceAll(d,c.toString());return a};C3$jscomp$34.SortAZ=function(a,b){return a&gt;b?1:a&lt;b?-1:0};
C3$jscomp$34.SortAZCaseInsensitive=function(a,b){a=a.toLowerCase();b=b.toLowerCase();return a&gt;b?1:a&lt;b?-1:0};let intlSegmenter=null,graphemeSplitter=null;self.Intl&amp;&amp;self.Intl.Segmenter?intlSegmenter=new self.Intl.Segmenter:graphemeSplitter=new self.GraphemeSplitter;C3$jscomp$34.SplitGraphemes=function(a){if(intlSegmenter){const b=[];for(const d of intlSegmenter.segment(a))b.push(d.segment);return b}return graphemeSplitter.splitGraphemes(a)};
C3$jscomp$34.IterateGraphemes=function*(a){if(intlSegmenter)for(const b of intlSegmenter.segment(a))yield b.segment;else yield*graphemeSplitter.iterateGraphemes(a)};C3$jscomp$34.CountGraphemes=function(a){if(intlSegmenter){let b=0;for(const d of intlSegmenter.segment(a))++b;return b}return graphemeSplitter.countGraphemes(a)};const MEGABYTE=1048576,GIGABYTE=1024*MEGABYTE,TERABYTE=1024*GIGABYTE;
C3$jscomp$34.FormatDataSize=function(a,b){b="common."+(b?"dataRates":"dataSizes")+".";const d=self.langSub;if(1024&gt;a)return d(b+"bytes",a);if(a&lt;MEGABYTE)return a/=1024,a=10&gt;a?Math.round(10*a)/10:Math.round(a),d(b+"kilobytes",a);if(a&lt;GIGABYTE)return a/=MEGABYTE,a=10&gt;a?Math.round(10*a)/10:Math.round(a),d(b+"megabytes",a);if(a&lt;TERABYTE)return a/=GIGABYTE,a=10&gt;a?Math.round(10*a)/10:Math.round(a),d(b+"gigabytes",a);a/=TERABYTE;a=10&gt;a?Math.round(10*a)/10:Math.round(a);return d(b+"terabytes",a)};
const DEFAULT_FORMATTIME_OPTS={approximate:!1,days:!0,hours:!0,minutes:!0,seconds:!0};
C3$jscomp$34.FormatTime=function(a,b){b=Object.assign({},DEFAULT_FORMATTIME_OPTS,b);C3$jscomp$34.Lang.PushContext("common.time");const d=[],c=self.lang,e=self.langPluralSub;if(b.days){var h=Math.floor(a/86400);0&lt;h&amp;&amp;(a-=86400*h,d.push(e(".days",null,h)))}b.hours&amp;&amp;(h=Math.floor(a/3600),0&lt;h||d.length)&amp;&amp;(a-=3600*h,d.push(e(".hours",null,h)));b.minutes&amp;&amp;(h=Math.floor(a/60),0&lt;h||d.length||!b.seconds)&amp;&amp;(a-=60*h,d.push(e(".minutes",null,h)));b.seconds&amp;&amp;d.push(e(".seconds",null,Math.floor(a%60)));a=(b.approximate?
c(".approx-prefix"):"")+d.join(c(".separator"));C3$jscomp$34.Lang.PopContext();return a};C3$jscomp$34.ZeroPad=function(a,b){let d=0&gt;a?"-":"";a=Math.abs(a);a=a.toString();b-=a.length;for(let c=0;c&lt;b;++c)d+="0";return d+a};C3$jscomp$34.StringToTitleCase=function(a){return a.toLowerCase().replace(/\b\w/g,b=&gt;b.toUpperCase())};
C3$jscomp$34.CompareVersionStrings=function(a,b){a=a.split(".").map(d=&gt;d.trim());b=b.split(".").map(d=&gt;d.trim());C3$jscomp$34.resizeArray(a,4,"0");C3$jscomp$34.resizeArray(b,4,"0");a=a.map(d=&gt;parseInt(d,10));b=b.map(d=&gt;parseInt(d,10));for(let d=0;4&gt;d;++d){const c=a[d]-b[d];if(0!==c)return 0&gt;c?-1:1}return 0};C3$jscomp$34.CreateGUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=&gt;{const b=Math.floor(16*Math.random());return("x"===a?b:b&amp;3|8).toString(16)})};
C3$jscomp$34.StringHammingDistance=function(a,b){if(a.length!==b.length)throw Error("strings must be same length");let d=0;for(let c=0,e=a.length;c&lt;e;++c)a.charAt(c)!==b.charAt(c)&amp;&amp;++d;return d};
C3$jscomp$34.StringLevenshteinDistance=function(a,b){if(0===a.length)return b.length;if(0===b.length)return a.length;let d,c,e,h;if(a.length&gt;b.length){var k=a;a=b;b=k}h=Array(a.length+1);for(k=0;k&lt;=a.length;k++)h[k]=k;for(k=1;k&lt;=b.length;k++){c=k;for(d=1;d&lt;=a.length;d++)e=b[k-1]===a[d-1]?h[d-1]:Math.min(h[d-1]+1,Math.min(c+1,h[d]+1)),h[d-1]=c,c=e;h[a.length]=c}return h[a.length]};"use strict";
const C3$jscomp$35=self.C3,BB_CODE_MAP=new Map([["b","strong"],["i","em"],["s","s"],["u","u"],["sub","sub"],["sup","sup"],["small","small"],["mark","mark"],["code","code"],["a1","a"],["a2","a"],["a3","a"],["a4","a"],["a5","a"],["a6","a"],["a7","a"],["a8","a"],["a9","a"],["tip1","abbr"],["tip2","abbr"],["tip3","abbr"],["tip4","abbr"],["tip5","abbr"],["tip6","abbr"],["tip7","abbr"],["tip8","abbr"],["tip9","abbr"],["bad",["span","bbCodeBad"]],["good",["span","bbCodeGood"]],["info",["span","bbCodeInfo"]],
["h1",["span","bbCodeH1"]],["h2",["span","bbCodeH2"]],["h3",["span","bbCodeH3"]],["h4",["span","bbCodeH4"]],["item",["span","bbCodeItem"]]]),BBREGEX=/\[(\/?)([a-zA-Z0-9]+)\]/g,CUSTOM_BBREGEX=/\[(\/?)([^\[\n]*?)\]/g;let linkActions=null,tipList=null,classIndex=0;
function bbToHtmlReplacerFunc(a,b,d){var c=BB_CODE_MAP.get(d);if(c){if("string"===typeof c){if("a"===c&amp;&amp;0===linkActions.length||"abbr"===c&amp;&amp;0===tipList.length)return a;if("a"!==c||b){if("abbr"!==c||b)return"&lt;"+b+c+"&gt;";b=parseInt(d.substring(3),10)-1;if(0&gt;b||b&gt;=tipList.length)throw Error("invalid bbcode tip substitution");b=tipList[b];c="";"string"===typeof b?c=b:"function"===typeof b&amp;&amp;(c=b());if("string"!==typeof c)throw new TypeError("invalid bbcode tip");return`&lt;abbr title="${C3$jscomp$35.ReplaceAll(c,
'"',"&amp;quot;")}"&gt;`}b=parseInt(d.substring(1),10)-1;if(0&gt;b||b&gt;=linkActions.length)throw Error("invalid bbcode link substitution");c=linkActions[b];if("string"===typeof c)return`&lt;a href="${linkActions[b]}"&gt;`;if("function"===typeof c)return`&lt;a class="bblink${b}"&gt;`;throw new TypeError("invalid bbcode link action");}if(Array.isArray(c))return a=c[0],c=c[1],b?"&lt;/"+a+"&gt;":`&lt;${a} class="${c}"&gt;`}else return"class"===d?b?"&lt;/span&gt;":`&lt;span class="bbclass${classIndex++}"&gt;`:a}const LINEBREAK_REGEX=/\n/g;
C3$jscomp$35.BBString=class{constructor(a,b){this._bbstr=b&amp;&amp;b.noEscape?a:C3$jscomp$35.EscapeHTML(a);this._htmlstr="";this._convertLineBreaks=!1;this._linkActions=[];this._tipList=[];if(b){this._convertLineBreaks=!!b.convertLineBreaks;if(b.links){if(9&lt;b.links.length)throw Error("too many links");this._linkActions=b.links}if(b.tips){if(9&lt;b.tips.length)throw Error("too many tips");this._tipList=b.tips}}this._hasAnyBBtags=this._bbstr.includes("[");this._needsLineBreakConversion=this._convertLineBreaks&amp;&amp;
this._bbstr.includes("\n");this._isPlain=!this._hasAnyBBtags&amp;&amp;!this._needsLineBreakConversion&amp;&amp;!this._bbstr.includes("&amp;");this._hasParsedFragments=!1;this._fragments=[]}toString(){return this._bbstr}valueOf(){return this._bbstr}isPlainText(){return this._isPlain}toPlainText(){return this._hasAnyBBtags?this._bbstr.replace(BBREGEX,""):this._bbstr}toHTML(){if(this._isPlain)return this._bbstr;if(!this._htmlstr&amp;&amp;this._bbstr){let a=this._bbstr;this._hasAnyBBtags&amp;&amp;(classIndex=0,linkActions=this._linkActions,
tipList=this._tipList,a=a.replace(BBREGEX,bbToHtmlReplacerFunc),tipList=linkActions=null);this._needsLineBreakConversion&amp;&amp;(a=a.replace(LINEBREAK_REGEX,"&lt;br&gt;"));this._htmlstr=a}return this._htmlstr}attachLinkHandlers(a){if(this._linkActions.length)for(let b=0,d=this._linkActions.length;b&lt;d;++b){const c=this._linkActions[b];if("function"!==typeof c)continue;const e=a.querySelector(".bblink"+b);if(!e)throw Error("unable to attach BBString link handler");e.onclick=c}}equals(a){return a instanceof C3$jscomp$35.HtmlString?
this.toHTML()===a.toHTML():a instanceof C3$jscomp$35.BBString?this._bbstr===a._bbstr:this._bbstr===a}toFragmentList(){if(this._hasParsedFragments)return this._fragments;const a=this._bbstr,b=[];let d=CUSTOM_BBREGEX.lastIndex=0;for(var c;null!==(c=CUSTOM_BBREGEX.exec(a));){var e=c.index;if(0&lt;e&amp;&amp;"\\"===a.charAt(e-1))continue;var h=c[0],k=c[1];c=c[2];const m=a.substring(d,e);d=e+h.length;m&amp;&amp;this._fragments.push({text:m,styles:b.slice(0)});if(c)if(k)for(c=c.toLowerCase(),e=b.length-1;0&lt;=e;--e){if(b[e].tag===
c){b.splice(e,1);break}}else e=c,h=null,k=c.indexOf("="),-1!==k?(e=c.substring(0,k).toLowerCase(),h=c.substring(k+1)):e=e.toLowerCase(),b.push({tag:e,param:h})}d&lt;a.length&amp;&amp;this._fragments.push({text:a.substring(d),styles:b.slice(0)});for(const m of this._fragments)m.text=this._ProcessBBCodeEscapeSequences(m.text);this._hasParsedFragments=!0;return this._fragments}_ProcessBBCodeEscapeSequences(a){a=C3$jscomp$35.ReplaceAll(a,"\\[","[");return C3$jscomp$35.ReplaceAll(a,"\\\\","\\")}static StripTags(a){return C3$jscomp$35.New(C3$jscomp$35.BBString,
a,{noEscape:!0}).toPlainText()}static StripAnyTags(a){return a.replace(CUSTOM_BBREGEX,"")}};"use strict";const C3$jscomp$36=self.C3;function IsWordBreakWhiteSpace(a){return"\u00a0"===a||"\u202f"===a?!1:C3$jscomp$36.IsWhitespaceChar(a)}function WordBreakTrimEnd(a){for(;0&lt;a.length&amp;&amp;IsWordBreakWhiteSpace(a.at(-1));)a.pop()}function IsNewline(a){return"\n"===a||"\r\n"===a}
C3$jscomp$36.WordWrap=class{constructor(){this._lines=[]}GetLines(){return this._lines}GetLineCount(){return this._lines.length}_MeasureLine(a,b){let d=0,c=0,e=0,h=0,k=0;for(const m of a)-1===m.width&amp;&amp;(a=b(m.chArr,m.styles),m.width=a.width,m.height=a.height,m.fontBoundingBoxAscent=a.fontBoundingBoxAscent||0,m.fontBoundingBoxDescent=a.fontBoundingBoxDescent||0,m.topToAlphabeticDistance=a.topToAlphabeticDistance||0),d+=m.width,c=Math.max(c,m.height),e=Math.max(e,m.fontBoundingBoxAscent),h=Math.max(h,
m.fontBoundingBoxDescent),k=Math.max(k,m.topToAlphabeticDistance);return{width:d,height:c,fontBoundingBoxAscent:e,fontBoundingBoxDescent:h,topToAlphabeticDistance:k}}_AddLine(a,b,d,c,e,h){this._lines.push({fragments:a,width:b,height:d,fontBoundingBoxAscent:c,fontBoundingBoxDescent:e,topToAlphabeticDistance:h})}WordWrap(a,b,d,c,e){"string"===typeof a&amp;&amp;(a=[{text:a,styles:[]}]);C3$jscomp$36.clearArray(this._lines);if(!(!a.length||1===a.length&amp;&amp;!a[0].text.length||2&gt;d)){a=a.map(k=&gt;({chArr:C3$jscomp$36.SplitGraphemes(k.text),
styles:k.styles}));if(1===a.length){var h=a[0];const k=h.chArr;h=h.styles;if(100&gt;=k.length&amp;&amp;!k.includes("\n")){let {width:m,height:p,fontBoundingBoxAscent:q,fontBoundingBoxDescent:v,topToAlphabeticDistance:x}=b(k,h);m+=e;q=q||0;v=v||0;x=x||0;if(m&lt;=d){this._AddLine([{chArr:k,styles:h,width:m,height:p,fontBoundingBoxAscent:q,fontBoundingBoxDescent:v,topToAlphabeticDistance:x}],m,p,q,v,x);return}}}if("word"===c)c=this._TokeniseWords(a);else{c=[];for(const k of a)C3$jscomp$36.appendArray(c,k.chArr.map(m=&gt;
[{chArr:[m],styles:k.styles}]))}this._WrapText(c,b,d,e)}}_TokeniseWords(a){const b=[];let d=[],c=!1;for(const h of a){var e=h.chArr;a=h.styles;for(const k of e)IsNewline(k)?(0&lt;d.length&amp;&amp;b.push(d),b.push([{chArr:["\n"],styles:a}]),d=[]):0===d.length?(d.push({chArr:[k],styles:a}),c=IsWordBreakWhiteSpace(k)):(e=IsWordBreakWhiteSpace(k),e===c?(e=d.at(-1),e.styles===a?e.chArr.push(k):d.push({chArr:[k],styles:a})):(b.push(d),d=[],d.push({chArr:[k],styles:a}),c=e))}0&lt;d.length&amp;&amp;b.push(d);return b}_CopyLine(a){return a.map(b=&gt;
({chArr:b.chArr.slice(0),styles:b.styles,width:b.width,height:b.height,fontBoundingBoxAscent:b.fontBoundingBoxAscent,fontBoundingBoxDescent:b.fontBoundingBoxDescent,topToAlphabeticDistance:b.topToAlphabeticDistance}))}_AddWordToLine(a,b){var d=a.length?a.at(-1):null;let c=0;d&amp;&amp;b[0].styles===d.styles&amp;&amp;(C3$jscomp$36.appendArray(d.chArr,b[0].chArr),d.width=-1,d.height=-1,d.fontBoundingBoxAscent=-1,d.fontBoundingBoxDescent=-1,d.topToAlphabeticDistance=-1,c=1);for(d=b.length;c&lt;d;++c){const e=b[c];a.push({chArr:e.chArr.slice(0),
styles:e.styles,width:-1,height:-1,fontBoundingBoxAscent:-1,fontBoundingBoxDescent:-1,topToAlphabeticDistance:-1})}}_WrapText(a,b,d,c){let e=[],h=0,k=0,m=0,p=0;var q=0;for(const v of a){if(1===v.length&amp;&amp;1===v[0].chArr.length&amp;&amp;IsNewline(v[0].chArr[0])){0===k&amp;&amp;(q=b([" "],v[0].styles),k=q.height,m=q.fontBoundingBoxAscent||0,p=q.fontBoundingBoxDescent||0,q=q.topToAlphabeticDistance||0);this._AddLine(e,h,k,m,p,q);e=[];q=p=m=k=h=0;continue}a=this._CopyLine(e);this._AddWordToLine(a,v);const x=this._MeasureLine(a,
b),A=x.width;A&gt;=d?(0&lt;e.length&amp;&amp;this._AddLine(e,h,k,m,p,q),e=[],C3$jscomp$36.IsCharArrayAllWhitespace(v[0].chArr)?q=p=m=k=h=0:(this._AddWordToLine(e,v),q=this._MeasureLine(e,b),h=q.width,k=q.height,m=q.fontBoundingBoxAscent,p=q.fontBoundingBoxDescent,q=q.topToAlphabeticDistance)):(e=a,h=A,k=x.height,m=x.fontBoundingBoxAscent,p=x.fontBoundingBoxDescent,q=x.topToAlphabeticDistance)}0&lt;e.length&amp;&amp;this._AddLine(e,h,k,m,p,q);this._TrimLinesTrailingWhitespace(b,c)}_TrimLinesTrailingWhitespace(a,b){for(const c of this._lines){const e=
c.fragments;if(!e.length)continue;let h=e.at(-1);var d=h.chArr;const k=d.slice(0);WordBreakTrimEnd(k);if(0===k.length)c.width-=h.width,e.pop();else if(k.length&lt;d.length){d=a(k,h.styles).width;const m=h.width-d;h.width=d;h.chArr=k;c.width-=m}0!==b&amp;&amp;0&lt;e.length&amp;&amp;(h=e.at(-1),h.width+=b,c.width+=b)}}Clear(){C3$jscomp$36.clearArray(this._lines)}GetMaxLineWidth(){return this._lines.reduce((a,b)=&gt;Math.max(a,b.width),0)}GetTotalLineHeight(){return this._lines.reduce((a,b)=&gt;a+b.height,0)}};"use strict";
const C3$jscomp$37=self.C3,glMatrix=self.glMatrix,vec3$jscomp$1=glMatrix.vec3,vec4$jscomp$1=glMatrix.vec4,mat4$jscomp$1=glMatrix.mat4,tempVec3a=vec3$jscomp$1.create(),tempVec3b=vec3$jscomp$1.create(),tempVec3c=vec3$jscomp$1.create(),tempVec4=vec4$jscomp$1.create(),tempMat4=mat4$jscomp$1.create(),neartl=vec3$jscomp$1.create(),neartr=vec3$jscomp$1.create(),nearbl=vec3$jscomp$1.create(),nearbr=vec3$jscomp$1.create(),fartl=vec3$jscomp$1.create(),fartr=vec3$jscomp$1.create(),farbl=vec3$jscomp$1.create(),
farbr=vec3$jscomp$1.create(),unitViewport=vec4$jscomp$1.fromValues(0,0,1,1);
C3$jscomp$37.Gfx={Project(a,b,d,c,e,h,k){const m=c[0]*a+c[4]*b+c[8]*d+c[12],p=c[1]*a+c[5]*b+c[9]*d+c[13],q=c[2]*a+c[6]*b+c[10]*d+c[14];c=c[3]*a+c[7]*b+c[11]*d+c[15];a=e[0]*m+e[4]*p+e[8]*q+e[12]*c;b=e[1]*m+e[5]*p+e[9]*q+e[13]*c;d=e[2]*m+e[6]*p+e[10]*q+e[14]*c;e=e[3]*m+e[7]*p+e[11]*q+e[15]*c;if(0===e)return!1;e=1/e;k[0]=(a*e*.5+.5)*h[2]+h[0];k[1]=(b*e*.5+.5)*h[3]+h[1];k[2]=.5*(1+d*e);return!0},Unproject(a,b,d,c,e,h,k){mat4$jscomp$1.multiply(tempMat4,e,c);if(null===mat4$jscomp$1.invert(tempMat4,tempMat4))return!1;
tempVec4[0]=(a-h[0])/h[2]*2-1;tempVec4[1]=(b-h[1])/h[3]*2-1;tempVec4[2]=2*d-1;tempVec4[3]=1;vec4$jscomp$1.transformMat4(tempVec4,tempVec4,tempMat4);if(0===tempVec4[3])return!1;tempVec4[3]=1/tempVec4[3];k[0]=tempVec4[0]*tempVec4[3];k[1]=tempVec4[1]*tempVec4[3];k[2]=tempVec4[2]*tempVec4[3];return!0},UnprojectScreenToWorldZ(a,b,d,c,e,h,k){const m=tempVec3a;if(!C3$jscomp$37.Gfx.Unproject(a,b,0,c,e,h,m)||!C3$jscomp$37.Gfx.Unproject(a,b,1,c,e,h,tempVec3b))return!1;vec3$jscomp$1.subtract(tempVec3b,tempVec3b,
m);a=tempVec3c;vec3$jscomp$1.set(a,0,0,1);d=-d;b=vec3$jscomp$1.dot(a,tempVec3b);c=0;if(0===b){if(0!==vec3$jscomp$1.dot(a,m)+d)return!1}else if(c=-(vec3$jscomp$1.dot(m,a)+d)/b,0&gt;c)return!1;vec3$jscomp$1.scaleAndAdd(k,m,tempVec3b,c);return!0}};
function PlaneFromPoints(a,b,d,c){vec3$jscomp$1.subtract(tempVec3a,d,b);vec3$jscomp$1.subtract(tempVec3b,a,b);vec3$jscomp$1.cross(tempVec3c,tempVec3a,tempVec3b);vec3$jscomp$1.normalize(tempVec3c,tempVec3c);c.set(tempVec3c[0],tempVec3c[1],tempVec3c[2],vec3$jscomp$1.dot(a,tempVec3c))}function IsInFrontOfPlane(a,b,d,c,e,h,k){const m=k.x,p=k.y,q=k.z,v=k.w,x=k.xF,A=k.yF;k=k.zF;const C=1-x,D=1-A,G=1-k;return m*a*x+m*c*C+p*b*A+p*e*D+q*d*k+q*h*G&gt;=v?!0:m*c*x+m*a*C+p*e*A+p*b*D+q*h*k+q*d*G&gt;v}
function IsPointInFrontOfPlane(a,b,d,c){return c.x*a+c.y*b+c.z*d&gt;=c.w}class Plane{constructor(){this.zF=this.yF=this.xF=this.w=this.z=this.y=this.x=NaN}set(a,b,d,c){this.x=a;this.y=b;this.z=d;this.w=c;this.xF=0&lt;a?1:0;this.yF=0&lt;b?1:0;this.zF=0&lt;d?1:0}}
C3$jscomp$37.Gfx.ViewFrustum=class{constructor(){this._leftP=new Plane;this._topP=new Plane;this._rightP=new Plane;this._bottomP=new Plane;this._nearP=new Plane;this._farP=new Plane}CalculatePlanes(a,b){C3$jscomp$37.Gfx.Unproject(0,1,0,a,b,unitViewport,neartl);C3$jscomp$37.Gfx.Unproject(1,1,0,a,b,unitViewport,neartr);C3$jscomp$37.Gfx.Unproject(0,0,0,a,b,unitViewport,nearbl);C3$jscomp$37.Gfx.Unproject(1,0,0,a,b,unitViewport,nearbr);C3$jscomp$37.Gfx.Unproject(0,1,1,a,b,unitViewport,fartl);C3$jscomp$37.Gfx.Unproject(1,
1,1,a,b,unitViewport,fartr);C3$jscomp$37.Gfx.Unproject(0,0,1,a,b,unitViewport,farbl);C3$jscomp$37.Gfx.Unproject(1,0,1,a,b,unitViewport,farbr);PlaneFromPoints(nearbl,neartl,fartl,this._leftP);PlaneFromPoints(neartl,neartr,fartr,this._topP);PlaneFromPoints(neartr,nearbr,farbr,this._rightP);PlaneFromPoints(nearbr,nearbl,farbl,this._bottomP);PlaneFromPoints(farbl,fartl,fartr,this._farP);PlaneFromPoints(nearbr,neartr,neartl,this._nearP)}ContainsAABB(a,b,d,c,e,h){return IsInFrontOfPlane(a,b,d,c,e,h,this._leftP)&amp;&amp;
IsInFrontOfPlane(a,b,d,c,e,h,this._topP)&amp;&amp;IsInFrontOfPlane(a,b,d,c,e,h,this._rightP)&amp;&amp;IsInFrontOfPlane(a,b,d,c,e,h,this._bottomP)&amp;&amp;IsInFrontOfPlane(a,b,d,c,e,h,this._nearP)&amp;&amp;IsInFrontOfPlane(a,b,d,c,e,h,this._farP)}IsBehindNearPlane(a,b,d){return!IsPointInFrontOfPlane(a,b,d,this._nearP)}};"use strict";
const C3$jscomp$38=self.C3,glMatrix$jscomp$1=self.glMatrix,vec3$jscomp$2=glMatrix$jscomp$1.vec3,vec4$jscomp$2=glMatrix$jscomp$1.vec4,mat4$jscomp$2=glMatrix$jscomp$1.mat4,tempMat4$jscomp$1=mat4$jscomp$2.create(),tmpVec3a=vec3$jscomp$2.fromValues(0,0,0),tmpVec3b=vec3$jscomp$2.fromValues(0,0,0),tmpVec3c=vec3$jscomp$2.fromValues(0,0,0),defaultUpVector=vec3$jscomp$2.fromValues(0,1,0);vec4$jscomp$2.fromValues(0,0,0,0);
const tmpQuad=new C3$jscomp$38.Quad,tmpRect=new C3$jscomp$38.Rect,defaultTexCoordsQuad=new C3$jscomp$38.Quad(0,0,1,0,1,1,0,1);
C3$jscomp$38.Gfx.RendererBase=class{constructor(){this._height=this._width=0;this._fovY=C3$jscomp$38.toRadians(45);this._tan_fovY_2=Math.tan(this._fovY/2);this._matP=mat4$jscomp$2.create();this._matMV=mat4$jscomp$2.create();this._zAxisScale=!1;this._allShaderPrograms=[];this._shaderProgramsByName=new Map;this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=this._spHardEllipseFill=this._spPenumbraFill=this._spLinearGradientFill=this._spColorFill=
this._spTilemapFill=this._spPoints=this._spTextureFill=null;this._stateGroups=new Map;this._currentStateGroup=null;this._blendModeTable=[];this._namedBlendModeMap=new Map;this._currentZ=this._baseZ=0;this._lineWidth=1;this._lineWidthStack=[this._lineWidth];this._lineCap=1;this._lineCapStack=[this._lineCap];this._lineOffset=.5;this._lineOffsetStack=[this._lineOffset];this._frameNumber=0;this._enableMipmaps=!0;this._hasMajorPerformanceCaveat=!1}FillIndexBufferData(a){let b=0,d=a.length,c=0;for(;b&lt;d;)a[b++]=
c,a[b++]=c+1,a[b++]=c+2,a[b++]=c,a[b++]=c+2,a[b++]=c+3,c+=4}_ClearState(){this._currentZ=this._baseZ=0;this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=this._spHardEllipseFill=this._spPenumbraFill=this._spLinearGradientFill=this._spColorFill=this._spTilemapFill=this._spPoints=this._spTextureFill=null;this._ClearAllShaderPrograms()}InitState(){this._ClearState();this._currentStateGroup=null}OnDeviceOrContextLost(){for(const a of this._allShaderPrograms)a.Release();
this._ClearState()}GetWidth(){return this._width}GetHeight(){return this._height}GetDefaultCameraZ(a){return this.IsZAxisScaleNormalized()?100:a/(2*this._GetTanFovYDiv2())}GetZAxisScaleFactor(a){return this.IsZAxisScaleNormalized()?a/(2*this._GetTanFovYDiv2())/this.GetDefaultCameraZ(a):1}GetNearZ(){return 1}GetFarZ(){return 1E4}SetFovY(a){this._fovY=a;this._tan_fovY_2=Math.tan(this._fovY/2)}GetFovY(){return this._fovY}_GetTanFovYDiv2(){return this._tan_fovY_2}SetZAxisScaleNormalized(){this._zAxisScale=
!1}SetZAxisScaleRegular(){this._zAxisScale=!0}IsZAxisScaleNormalized(){return!this._zAxisScale}IsZAxisScaleRegular(){return this._zAxisScale}CalculatePerspectiveMatrix(a,b,d=.5,c=.5){const e=this.GetNearZ(),h=this.GetFarZ();var k=this.GetFovY();if(.5===d&amp;&amp;.5===c)this.IsWebGPU()?mat4$jscomp$2.perspectiveZO(a,k,b,e,h):mat4$jscomp$2.perspective(a,k,b,e,h);else{d=1-d;k=2*d-2;d*=2;const m=2*c-2;c*=2;const p=this._GetTanFovYDiv2()*e;b*=p;mat4$jscomp$2.frustum(a,k*b,d*b,m*p,c*p,e,h)}}CalculateOrthographicMatrix(a,
b,d,c=1){var e=self.devicePixelRatio;const h=2*this.GetDefaultCameraZ(d)*e*this._GetTanFovYDiv2()/d;b=b*h/(2*e*c);d=d*h/(2*e*c);c=-b;e=-d;this.IsWebGPU()?mat4$jscomp$2.orthoZO(a,c,b,e,d,this.GetNearZ(),this.GetFarZ()):mat4$jscomp$2.ortho(a,c,b,e,d,this.GetNearZ(),this.GetFarZ())}CalculateLookAtModelView(a,b,d,c,e,h=1){let k=1;this.IsZAxisScaleNormalized()&amp;&amp;(k=200*this._GetTanFovYDiv2()/e);vec3$jscomp$2.set(tmpVec3c,k,-k,1);vec3$jscomp$2.multiply(tmpVec3a,b,tmpVec3c);vec3$jscomp$2.multiply(tmpVec3b,
d,tmpVec3c);mat4$jscomp$2.lookAt(a,tmpVec3a,tmpVec3b,c||defaultUpVector);tmpVec3c[2]=h;mat4$jscomp$2.scale(a,a,tmpVec3c)}CalculateLookAtModelView2(a,b,d,c,e,h,k,m){vec3$jscomp$2.set(tmpVec3a,a,b,d);vec3$jscomp$2.set(tmpVec3b,c,e,h);this.CalculateLookAtModelView(tempMat4$jscomp$1,tmpVec3a,tmpVec3b,defaultUpVector,k,m);return tempMat4$jscomp$1}_AddShaderProgram(a){this._allShaderPrograms.push(a);this._shaderProgramsByName.set(a.GetName(),a)}_RemoveShaderProgram(a){const b=this._allShaderPrograms.indexOf(a);
-1!==b&amp;&amp;this._allShaderPrograms.splice(b,1);this._shaderProgramsByName.delete(a.GetName())}_ClearAllShaderPrograms(){C3$jscomp$38.clearArray(this._allShaderPrograms);this._shaderProgramsByName.clear()}GetShaderProgramByName(a){return this._shaderProgramsByName.get(a)||null}GetTextureFillShaderProgram(){return this._spTextureFill}SetTextureFillMode(){this.SetProgram(this._spTextureFill)}GetPointsRenderingProgram(){return this._spPoints}SetPointsRenderingProgram(){this.SetProgram(this._spPoints)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetColorFillMode(){this.SetProgram(this._spColorFill)}SetLinearGradientFillMode(){this.SetProgram(this._spLinearGradientFill)}SetPenumbraFillMode(){this.SetProgram(this._spPenumbraFill)}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}_SetCurrentStateGroup(a){this._currentStateGroup=
a}GetCurrentStateGroup(){return this._currentStateGroup}AcquireStateGroup(a,b,d,c){const e=C3$jscomp$38.Gfx.StateGroup.MakeKey(a,b,d,c);let h=this._stateGroups.get(e);h||(h=C3$jscomp$38.New(C3$jscomp$38.Gfx.StateGroup,this,a,b,d,c),this._stateGroups.set(e,h));h.AddRef();return h}ReleaseStateGroup(a){a.DecRef();0===a._GetRefCount()&amp;&amp;(this._currentStateGroup===a&amp;&amp;(this._currentStateGroup=null),this._stateGroups.delete(a.GetKey()),a.Release())}_InitBlendModeData(a){C3$jscomp$38.clearArray(this._blendModeTable);
this._namedBlendModeMap.clear();let b=0;for(const d of a){a=d[0];const c=d[1],e=d[2];this._blendModeTable.push([c,e]);this._namedBlendModeMap.set(a,{number:b,srcBlend:c,destBlend:e});b++}}_GetBlendByIndex(a){return this._blendModeTable[a]}GetSrcBlendByIndex(a){return this._GetBlendByIndex(a)[0]}GetDestBlendByIndex(a){return this._GetBlendByIndex(a)[1]}GetNamedBlend(a){a=this._namedBlendModeMap.get(a);if("undefined"===typeof a)throw Error("invalid blend name");return a}NamedBlendToNumber(a){a=this._namedBlendModeMap.get(a);
if("undefined"===typeof a)throw Error("invalid blend name");return a.number}SetBaseZ(a){this._baseZ=a}GetBaseZ(){return this._baseZ}SetCurrentZ(a){this._currentZ=a;this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}Line(a,b,d,c){var e=C3$jscomp$38.angleTo(a,b,d,c),h=.5*this._lineWidth;const k=Math.sin(e)*h;e=Math.cos(e)*h;h=this._lineCap;2===h?this.LinePreCalc_LineCap2(a,b,0,d,c,0,k,e):1===h?this.LinePreCalc_LineCap1(a,b,0,d,c,0,k,e):this.LinePreCalc_LineCap0(a,b,0,d,c,0,k,e)}Line3D(a,
b,d,c,e,h){var k=C3$jscomp$38.angleTo(a,b,c,e),m=.5*this._lineWidth;const p=Math.sin(k)*m;k=Math.cos(k)*m;m=this._lineCap;2===m?this.LinePreCalc_LineCap2(a,b,d,c,e,h,p,k):1===m?this.LinePreCalc_LineCap1(a,b,d,c,e,h,p,k):this.LinePreCalc_LineCap0(a,b,d,c,e,h,p,k)}LinePreCalc_LineCap2(a,b,d,c,e,h,k,m){var p=this._lineOffset;a=a+p-m;b=b+p-k;c=c+p+m;e=e+p+k;p=2*m;const q=2*k;this.Quad3D2(a+k,b-m,d,c+k,e-m,h,c-k-p,e+m-q,h,a-k+p,b+m+q,d,defaultTexCoordsQuad)}LinePreCalc_LineCap1(a,b,d,c,e,h,k,m){const p=
this._lineOffset;a=a+p-m;b=b+p-k;c=c+p+m;e=e+p+k;this.Quad3D2(a+k,b-m,d,c+k,e-m,h,c-k,e+m,h,a-k,b+m,d,defaultTexCoordsQuad)}LinePreCalc_LineCap0(a,b,d,c,e,h,k,m){const p=this._lineOffset;a+=p;b+=p;c+=p;e+=p;this.Quad3D2(a+k,b-m,d,c+k,e-m,h,c-k,e+m,h,a-k,b+m,d,defaultTexCoordsQuad)}TexturedLine(a,b,d,c,e,h){var k=C3$jscomp$38.angleTo(a,b,d,c),m=.5*this._lineWidth;const p=Math.sin(k)*m;k=Math.cos(k)*m;m=this._lineCap;2===m?this.TexturedLinePreCalc_LineCap2(a,b,d,c,p,k,e,h):1===m?this.TexturedLinePreCalc_LineCap1(a,
b,d,c,p,k,e,h):this.TexturedLinePreCalc_LineCap0(a,b,d,c,p,k,e,h)}TexturedLinePreCalc_LineCap2(a,b,d,c,e,h,k,m){var p=this._lineOffset;a=a+p-h;b=b+p-e;d=d+p+h;c=c+p+e;p=2*h;const q=2*e;tmpQuad.set(a+e,b-h,d+e,c-h,d-e-p,c+h-q,a-e+p,b+h+q);tmpRect.set(k,0,m,0);this.Quad3(tmpQuad,tmpRect)}TexturedLinePreCalc_LineCap1(a,b,d,c,e,h,k,m){const p=this._lineOffset;a=a+p-h;b=b+p-e;d=d+p+h;c=c+p+e;tmpQuad.set(a+e,b-h,d+e,c-h,d-e,c+h,a-e,b+h);tmpRect.set(k,0,m,0);this.Quad3(tmpQuad,tmpRect)}TexturedLinePreCalc_LineCap0(a,
b,d,c,e,h,k,m){const p=this._lineOffset;a+=p;b+=p;d+=p;c+=p;tmpQuad.set(a+e,b-h,d+e,c-h,d-e,c+h,a-e,b+h);tmpRect.set(k,0,m,0);this.Quad3(tmpQuad,tmpRect)}LineRect(a,b,d,c){const e=.5*this._lineWidth,h=this._lineCap;2===h?this._LineRectPreCalc_LineCap2(a,b,d,c,e):1===h?this._LineRectPreCalc_LineCap1(a,b,d,c,e):this._LineRectPreCalc_LineCap0(a,b,d,c,e)}_LineRectPreCalc_LineCap2(a,b,d,c,e){this.LinePreCalc_LineCap2(a,b,0,d,b,0,0,e);this.LinePreCalc_LineCap2(d,b,0,d,c,0,e,0);this.LinePreCalc_LineCap2(d,
c,0,a,c,0,0,-e);this.LinePreCalc_LineCap2(a,c,0,a,b,0,-e,0)}_LineRectPreCalc_LineCap1(a,b,d,c,e){this.LinePreCalc_LineCap1(a,b,0,d,b,0,0,e);this.LinePreCalc_LineCap1(d,b,0,d,c,0,e,0);this.LinePreCalc_LineCap1(d,c,0,a,c,0,0,-e);this.LinePreCalc_LineCap1(a,c,0,a,b,0,-e,0)}_LineRectPreCalc_LineCap0(a,b,d,c,e){this.LinePreCalc_LineCap0(a,b,0,d,b,0,0,e);this.LinePreCalc_LineCap0(d,b,0,d,c,0,e,0);this.LinePreCalc_LineCap0(d,c,0,a,c,0,0,-e);this.LinePreCalc_LineCap0(a,c,0,a,b,0,-e,0)}LineRect2(a){this.LineRect(a.getLeft(),
a.getTop(),a.getRight(),a.getBottom())}LineQuad(a){var b=C3$jscomp$38.angleTo(a.getTlx(),a.getTly(),a.getTrx(),a.getTry()),d=.5*this._lineWidth;const c=Math.sin(b)*d;b=Math.cos(b)*d;d=this._lineCap;2===d?this._LineQuadPreCalc_LineCap2(a,c,b):1===d?this._LineQuadPreCalc_LineCap1(a,c,b):this._LineQuadPreCalc_LineCap0(a,c,b)}_LineQuadPreCalc_LineCap2(a,b,d){this.LinePreCalc_LineCap2(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,d);this.LinePreCalc_LineCap2(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(),
0,d,-b);this.LinePreCalc_LineCap2(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-d);this.LinePreCalc_LineCap2(a.getBlx(),a.getBly(),0,a.getTlx(),a.getTly(),0,-d,b)}_LineQuadPreCalc_LineCap1(a,b,d){this.LinePreCalc_LineCap1(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,d);this.LinePreCalc_LineCap1(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(),0,d,-b);this.LinePreCalc_LineCap1(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-d);this.LinePreCalc_LineCap1(a.getBlx(),a.getBly(),0,a.getTlx(),
a.getTly(),0,-d,b)}_LineQuadPreCalc_LineCap0(a,b,d){this.LinePreCalc_LineCap0(a.getTlx(),a.getTly(),0,a.getTrx(),a.getTry(),0,b,d);this.LinePreCalc_LineCap0(a.getTrx(),a.getTry(),0,a.getBrx(),a.getBry(),0,d,-b);this.LinePreCalc_LineCap0(a.getBrx(),a.getBry(),0,a.getBlx(),a.getBly(),0,-b,-d);this.LinePreCalc_LineCap0(a.getBlx(),a.getBly(),0,a.getTlx(),a.getTly(),0,-d,b)}SetLineWidth(a){this._lineWidth=a;this._lineWidthStack[this._lineWidthStack.length-1]=a}GetLineWidth(){return this._lineWidth}PushLineWidth(a){if(100&lt;=
this._lineWidthStack.length)throw Error("pushed too many line widths - check push/pop pairs");this._lineWidthStack.push(a);this._lineWidth=a}PopLineWidth(){if(1&gt;=this._lineWidthStack.length)throw Error("cannot pop last line width - check push/pop pairs");this._lineWidthStack.pop();this._lineWidth=this._lineWidthStack.at(-1)}SetLineCapButt(){this._lineCap=0;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapSquare(){this._lineCap=1;this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapZag(){this._lineCap=
2;this._lineCapStack[this._lineCapStack.length-1]=0}PushLineCap(a){if("butt"===a)this.PushLineCapButt();else if("square"===a)this.PushLineCapSquare();else if("zag"===a)this.PushLineCapZag();else throw Error("invalid line cap");}PushLineCapButt(){if(100&lt;=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(0);this._lineCap=0}PushLineCapSquare(){if(100&lt;=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs");
this._lineCapStack.push(1);this._lineCap=1}PushLineCapZag(){if(100&lt;=this._lineCapStack.length)throw Error("pushed too many line caps - check push/pop pairs");this._lineCapStack.push(2);this._lineCap=2}PopLineCap(){if(1&gt;=this._lineCapStack.length)throw Error("cannot pop last line cap - check push/pop pairs");this._lineCapStack.pop();this._lineCap=this._lineCapStack.at(-1)}SetLineOffset(a){this._lineOffset=a;this._lineOffsetStack[this._lineOffsetStack.length-1]=a}GetLineOffset(){return this._lineOffset}PushLineOffset(a){if(100&lt;=
this._lineOffsetStack.length)throw Error("pushed too many line offsets - check push/pop pairs");this._lineOffsetStack.push(a);this._lineOffset=a}PopLineOffset(){if(1&gt;=this._lineOffsetStack.length)throw Error("cannot pop last line offset - check push/pop pairs");this._lineOffsetStack.pop();this._lineOffset=this._lineOffsetStack.at(-1)}ConvexPoly(a){var b=a.length/2;if(3&gt;b)throw Error("need at least 3 points");b-=2;const d=b-1,c=a[0],e=a[1];for(let h=0;h&lt;b;h+=2){const k=2*h,m=a[k+2],p=a[k+3],q=a[k+
4],v=a[k+5];h===d?this.Quad2(c,e,m,p,q,v,q,v):this.Quad2(c,e,m,p,q,v,a[k+6],a[k+7])}}GetNumVertexComponents(){return 3}Finish(){this.EndBatch(!0);this._frameNumber++}GetFrameNumber(){return this._frameNumber}IncrementFrameNumber(){this._frameNumber++}SetMipmapsEnabled(a){this._enableMipmaps=!!a}AreMipmapsEnabled(){return this._enableMipmaps}SetHasMajorPerformanceCaveat(a){this._hasMajorPerformanceCaveat=!!a}HasMajorPerformanceCaveat(){return this._hasMajorPerformanceCaveat}IsWebGL(){return!1}IsWebGPU(){return!1}};
"use strict";
self.C3.Gfx.ShaderProgramBase=class{constructor(a,b,d){this._name=b;this._renderer=a;this._extendBoxHorizontal=d.extendBoxHorizontal||0;this._extendBoxVertical=d.extendBoxVertical||0;this._crossSampling=!!d.crossSampling;this._mustPreDraw=!!d.mustPreDraw;this._preservesOpaqueness=!!d.preservesOpaqueness;this._animated=!!d.animated;this._blendsBackground=!!d.blendsBackground;this._usesDepth=!!d.usesDepth;this._usesAnySrcRectOrPixelSize=!1;this._needsPostDrawOrExtendBox=this._crossSampling||this._blendsBackground||
0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}Release(){this._renderer=null}GetRenderer(){return this._renderer}GetName(){return this._name}ExtendsBox(){return 0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesCrossSampling(){return this._crossSampling}MustPreDraw(){return this._mustPreDraw}PreservesOpaqueness(){return this._preservesOpaqueness}IsAnimated(){return this._animated}BlendsBackground(){return this._blendsBackground}UsesDepth(){return this._usesDepth}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}UsesIsSrcTexRotated(){return!1}};
"use strict";const C3$jscomp$40=self.C3;
C3$jscomp$40.Gfx.StateGroup=class{constructor(a,b,d,c,e){this._renderer=a;this._refCount=0;this._shaderProgram=null;this._shaderProgramName="";this._blendMode=d;this._color=C3$jscomp$40.New(C3$jscomp$40.Color);this._color.set(c);this._zElevation=e;"string"===typeof b?this._shaderProgramName=b:(this._shaderProgram=b,this._shaderProgramName=this._shaderProgram.GetName())}Release(){if(0&lt;this._refCount)throw Error("releasing state group still in use");this._shaderProgram=this._renderer=null;this._shaderProgramName=
""}Apply(){const a=this._renderer;a.SetProgram(this._shaderProgram);a.SetBlendMode(this._blendMode);a.SetColor(this._color);a.SetCurrentZ(this._zElevation);a._SetCurrentStateGroup(this)}GetKey(){return C3$jscomp$40.Gfx.StateGroup.MakeKey(this._shaderProgramName,this._blendMode,this._color,this._zElevation)}AddRef(){++this._refCount}DecRef(){--this._refCount}_GetRefCount(){return this._refCount}OnContextLost(){this._shaderProgram=null}OnContextRestored(a){this._shaderProgram=a.GetShaderProgramByName(this._shaderProgramName);
if(!this._shaderProgram)throw Error("failed to restore shader program");}static MakeKey(a,b,d,c){return("string"===typeof a?a:a.GetName())+","+b+","+d.getR()+","+d.getG()+","+d.getB()+","+d.getA()+","+c}};"use strict";const C3$jscomp$41=self.C3,tempQuadTex=C3$jscomp$41.New(C3$jscomp$41.Quad);function interpolateQuad(a,b,d){const c=d.getTlx(),e=d.getTly(),h=d.getTrx()-c,k=d.getTry()-e,m=d.getBlx()-c;d=d.getBly()-e;return[c+h*a+m*b,e+k*a+d*b]}
C3$jscomp$41.Gfx.MeshPoint=class{constructor(a,b,d){this._mesh=a;this._col=b;this._row=d;this._v=this._u=this._zElevation=this._y=this._x=0}_Init(a,b,d,c){this._x=a;this._y=b;this._u=d;this._v=c}GetX(){return this._x}SetX(a){this._x!==a&amp;&amp;(this._x=a,this._mesh._SetPointsChanged())}GetY(){return this._y}SetY(a){this._y!==a&amp;&amp;(this._y=a,this._mesh._SetPointsChanged())}GetZElevation(){return this._zElevation}SetZElevation(a){this._zElevation!==a&amp;&amp;(this._zElevation=Math.max(a,0),this._mesh._SetPointsChanged())}GetU(){return this._u}SetU(a){this._u=
a}GetV(){return this._v}SetV(a){this._v=a}_Interpolate_TexRect(a,b,d){[this._x,this._y]=interpolateQuad(a._x,a._y,b);this._zElevation=a._zElevation;this._u=C3$jscomp$41.lerp(d.getLeft(),d.getRight(),a._u);this._v=C3$jscomp$41.lerp(d.getTop(),d.getBottom(),a._v)}_Interpolate_TexQuad(a,b,d){[this._x,this._y]=interpolateQuad(a._x,a._y,b);this._zElevation=a._zElevation;[this._u,this._v]=interpolateQuad(a._u,a._v,d)}SaveToJson(){return{x:this.GetX(),y:this.GetY(),z:this.GetZElevation(),u:this.GetU(),v:this.GetV()}}LoadFromJson(a){this.SetX(a.x);
this.SetY(a.y);a.hasOwnProperty("z")&amp;&amp;this.SetZElevation(a.z);this.SetU(a.u);this.SetV(a.v)}GetMesh(){return this._mesh}GetColumn(){return this._col}GetRow(){return this._row}};
C3$jscomp$41.Gfx.Mesh=class{constructor(a,b,d){if(2&gt;a||2&gt;b)throw Error("invalid mesh size");this._hsize=a;this._vsize=b;this._owner=d||null;this._pts=[];this._minY=this._minX=0;this._maxY=this._maxX=1;this._maxZ=0;this._pointsChanged=!1;d=a-1;const c=b-1;for(let e=0;e&lt;b;++e){const h=[];for(let k=0;k&lt;a;++k){const m=C3$jscomp$41.New(C3$jscomp$41.Gfx.MeshPoint,this,k,e),p=k/d,q=e/c;m._Init(p,q,p,q);h.push(m)}this._pts.push(h)}}Release(){C3$jscomp$41.clearArray(this._pts)}GetHSize(){return this._hsize}GetVSize(){return this._vsize}GetOwner(){return this._owner}_GetPoints(){return this._pts}_SetPointsChanged(){this._pointsChanged=
!0}_MaybeComputeBounds(){if(this._pointsChanged){var a=Infinity,b=Infinity,d=-Infinity,c=-Infinity,e=0;for(const h of this._pts)for(const k of h){const m=k.GetX(),p=k.GetY();a=Math.min(a,m);b=Math.min(b,p);d=Math.max(d,m);c=Math.max(c,p);e=Math.max(e,k.GetZElevation())}this._minX=a;this._minY=b;this._maxX=d;this._maxY=c;this._maxZ=e;this._pointsChanged=!1}}GetMinX(){this._MaybeComputeBounds();return this._minX}GetMinY(){this._MaybeComputeBounds();return this._minY}GetMaxX(){this._MaybeComputeBounds();
return this._maxX}GetMaxY(){this._MaybeComputeBounds();return this._maxY}GetMaxZ(){this._MaybeComputeBounds();return this._maxZ}HasAnyZElevation(){return 0&lt;this.GetMaxZ()}GetMeshPointAt(a,b){a=Math.floor(a);b=Math.floor(b);return 0&gt;a||a&gt;=this._hsize||0&gt;b||b&gt;=this._vsize?null:this._pts[b][a]}CalculateTransformedMesh(a,b,d){const c=d instanceof C3$jscomp$41.Rect;if(a.GetHSize()!==this.GetHSize()||a.GetVSize()!==this.GetVSize())throw Error("source mesh wrong size");a=a._pts;const e=this._pts;for(let h=
0,k=e.length;h&lt;k;++h){const m=a[h],p=e[h];for(let q=0,v=p.length;q&lt;v;++q){const x=m[q],A=p[q];c?A._Interpolate_TexRect(x,b,d):A._Interpolate_TexQuad(x,b,d)}}}Draw(a){const b=this._pts;let d=b[0];for(let c=1,e=b.length;c&lt;e;++c){const h=b[c];let k=d[0],m=h[0];for(let p=1,q=h.length;p&lt;q;++p){const v=d[p],x=h[p];tempQuadTex.set(k.GetU(),k.GetV(),v.GetU(),v.GetV(),x.GetU(),x.GetV(),m.GetU(),m.GetV());a.Quad3D2(k.GetX(),k.GetY(),k.GetZElevation(),v.GetX(),v.GetY(),v.GetZElevation(),x.GetX(),x.GetY(),x.GetZElevation(),
m.GetX(),m.GetY(),m.GetZElevation(),tempQuadTex);k=v;m=x}d=h}}Outline(a,b){b||(b=(e,h,k)=&gt;[e,h,k]);const d=this._pts;let c=d[0];for(let e=1,h=d.length;e&lt;h;++e){const k=d[e];let m=c[0],p=k[0];for(let q=1,v=k.length;q&lt;v;++q){const x=c[q],A=k[q],[C,D,G]=b(m.GetX(),m.GetY(),m.GetZElevation()),[E,J,L]=b(x.GetX(),x.GetY(),x.GetZElevation()),[O,V,W]=b(A.GetX(),A.GetY(),A.GetZElevation()),[ca,la,ma]=b(p.GetX(),p.GetY(),p.GetZElevation());a.Line3D(C,D,G,E,J,L);a.Line3D(C,D,G,O,V,W);a.Line3D(C,D,G,ca,la,ma);
q===v-1&amp;&amp;a.Line3D(E,J,L,O,V,W);e===h-1&amp;&amp;a.Line3D(ca,la,ma,O,V,W);m=x;p=A}c=k}}InsertPolyMeshVertices(a){a=a.pointsArr();const b=[],d=this.GetHSize()-1,c=this.GetVSize()-1,e=1/d,h=1/c,k=d-1,m=c-1;let p=a[0],q=a[1],v=C3$jscomp$41.clamp(Math.floor(p*d),0,k),x=C3$jscomp$41.clamp(Math.floor(q*c),0,m),A=0,C=0,D=0;var G=-1;const E=()=&gt;{p=C3$jscomp$41.clamp(C3$jscomp$41.lerp(p,A,D),0,1);q=C3$jscomp$41.clamp(C3$jscomp$41.lerp(q,C,D),0,1);b.push(p,q)};for(let J=0,L=a.length;J&lt;L;J+=2)for(p=a[J],q=a[J+1],b.push(p,
q),v=C3$jscomp$41.clamp(Math.floor(p*d),0,k),x=C3$jscomp$41.clamp(Math.floor(q*c),0,m),G=(J+2)%L,A=a[G],C=a[G+1],G=-1;;){if(1E6&lt;b.length)throw Error("Too many mesh poly points");const O=v*e,V=x*h,W=(v+1)*e,ca=(x+1)*h;C3$jscomp$41.isPointInTriangleInclusive(p,q,O,V,W,V,W,ca);if(0!==G&amp;&amp;(D=C3$jscomp$41.rayIntersectExtended(p,q,A,C,O,V,W,ca,-.001),0&lt;=D&amp;&amp;.99999999&gt;=D)){E();G=0;continue}if(0&lt;x&amp;&amp;2!==G&amp;&amp;(D=C3$jscomp$41.rayIntersectExtended(p,q,A,C,O,V,W,V,.001),0&lt;=D&amp;&amp;.99999999&gt;=D)){E();x--;G=4;continue}if(v&lt;
k&amp;&amp;3!==G&amp;&amp;(D=C3$jscomp$41.rayIntersectExtended(p,q,A,C,W,V,W,ca,.001),0&lt;=D&amp;&amp;.99999999&gt;=D)){E();v++;G=1;continue}if(0&lt;v&amp;&amp;1!==G&amp;&amp;(D=C3$jscomp$41.rayIntersectExtended(p,q,A,C,O,V,O,ca,.001),0&lt;=D&amp;&amp;.99999999&gt;=D)){E();v--;G=3;continue}if(x&lt;m&amp;&amp;4!==G&amp;&amp;(D=C3$jscomp$41.rayIntersectExtended(p,q,A,C,O,ca,W,ca,.001),0&lt;=D&amp;&amp;.99999999&gt;=D)){E();x++;G=2;continue}break}return C3$jscomp$41.New(C3$jscomp$41.CollisionPoly,b)}TransformCollisionPoly(a,b){a=this._TransformPolyPoints(a);this._SimplifyPoly(a);b.setPoints(a)}_TransformPolyPoints(a){const b=
[];a=a.pointsArr();for(let d=0,c=a.length;d&lt;c;d+=2){const [e,h]=this.TransformPoint(a[d],a[d+1]);b.push(e,h)}return b}TransformPoint(a,b){var d=this.GetHSize()-1,c=this.GetVSize()-1,e=1/d,h=1/c;d=C3$jscomp$41.clamp(Math.floor(a*d),0,d-1);const k=C3$jscomp$41.clamp(Math.floor(b*c),0,c-1);c=d*e;const m=k*h,p=(d+1)*e,q=(k+1)*h,v=this.GetMeshPointAt(d,k),x=this.GetMeshPointAt(d+1,k+1),A=C3$jscomp$41.isPointInTriangleInclusive(a,b,c,m,p,m,p,q);e=A?c+e:c;h=A?m:m+h;d=this.GetMeshPointAt(d+(A?1:0),k+(A?0:
1));const [C,D,G]=C3$jscomp$41.triangleCartesianToBarycentric(a,b,c,m,e,h,p,q);return C3$jscomp$41.triangleBarycentricToCartesian(C,D,G,v.GetX(),v.GetY(),d.GetX(),d.GetY(),x.GetX(),x.GetY())}_SimplifyPoly(a){const b=[];let d=a[0],c=a[1],e=d-a.at(-2),h=c-a.at(-1);for(let m=0,p=a.length;m&lt;p;m+=2){var k=(m+2)%p;const q=a[k];k=a[k+1];const v=q-d,x=k-c,A=1E-7&gt;Math.abs(x)&amp;&amp;1E-7&gt;Math.abs(h)&amp;&amp;Math.sign(v)===Math.sign(e);(!(1E-7&gt;Math.abs(v)&amp;&amp;1E-7&gt;Math.abs(e)&amp;&amp;Math.sign(x)===Math.sign(h)||A)&amp;&amp;.001&lt;Math.abs(v/
e-x/h)||0==v&amp;&amp;0===x)&amp;&amp;b.push(d,c);d=q;c=k;e=v;h=x}6&lt;=b.length&amp;&amp;b.length&lt;a.length&amp;&amp;C3$jscomp$41.shallowAssignArray(a,b)}SaveToJson(){return{cols:this.GetHSize(),rows:this.GetVSize(),points:this._pts.map(a=&gt;a.map(b=&gt;b.SaveToJson()))}}LoadFromJson(a){const b=this.GetHSize(),d=this.GetVSize();if(a.cols!==b||a.rows!==d)throw Error("mesh data wrong size");a=a.points;for(let c=0;c&lt;d;++c){const e=a[c];for(let h=0;h&lt;b;++h)this.GetMeshPointAt(h,c).LoadFromJson(e[h])}}};"use strict";
const C3$jscomp$42=self.C3,VALID_PIXEL_FORMATS=new Set(["rgba8","rgb8","rgba4","rgb5_a1","rgb565"]),VALID_SAMPLINGS=new Set(["nearest","bilinear","trilinear"]),VALID_MIPMAP_QUALITIES=new Set(["default","low","high"]),VALID_WRAP_MODES=new Set(["clamp-to-edge","repeat","mirror-repeat"]);
function GetFormatSpecifiers(a,b){let d,c;switch(a){case "rgba8":a=b.RGBA8;c=d=b.RGBA;b=b.UNSIGNED_BYTE;break;case "rgb8":a=b.RGB8;c=d=b.RGB;b=b.UNSIGNED_BYTE;break;case "rgba4":a=b.RGBA4;c=d=b.RGBA;b=b.UNSIGNED_SHORT_4_4_4_4;break;case "rgb5_a1":a=b.RGB5_A1;c=d=b.RGBA;b=b.UNSIGNED_SHORT_5_5_5_1;break;case "rgb565":a=b.RGB565;c=d=b.RGB;b=b.UNSIGNED_SHORT_5_6_5;break;default:throw Error("invalid pixel format");}return{sizedinternalformat:a,internalformat:d,format:c,type:b}}
const CREATEFROM_DEFAULT_OPTIONS={wrapX:"clamp-to-edge",wrapY:"clamp-to-edge",sampling:"trilinear",anisotropy:0,pixelFormat:"rgba8",mipMap:!0,mipMapQuality:"default",premultiplyAlpha:!0,isSvg:!1,width:-1,height:-1},UPDATE_DEFAULT_OPTIONS={premultiplyAlpha:!0,flipY:!1},allTextures=new Set;
C3$jscomp$42.Gfx.WebGLRendererTexture=class{constructor(a){this._renderer=a;this._texture=null;this._height=this._width=0;this._isStatic=!0;this._wrapY=this._wrapX="clamp-to-edge";this._sampling="trilinear";this._anisotropy=0;this._pixelFormat="rgba8";this._isMipMapped=!1;this._mipMapQuality="default";this._refCount=0}_CreateStatic(a,b){if(!("undefined"!==typeof HTMLImageElement&amp;&amp;a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&amp;&amp;a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&amp;&amp;
a instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&amp;&amp;a instanceof OffscreenCanvas||a instanceof ImageData||a instanceof ArrayBuffer)&amp;&amp;null!==a)throw Error("invalid texture source");b=Object.assign({},CREATEFROM_DEFAULT_OPTIONS,b);if(this._texture)throw Error("already created texture");this._wrapX=b.wrapX;this._wrapY=b.wrapY;this._sampling=b.sampling;this._anisotropy=b.anisotropy;this._pixelFormat=b.pixelFormat;this._isMipMapped=!!b.mipMap&amp;&amp;this._renderer.AreMipmapsEnabled();this._mipMapQuality=
b.mipMapQuality;if(!VALID_WRAP_MODES.has(this._wrapX)||!VALID_WRAP_MODES.has(this._wrapY))throw Error("invalid wrap mode");if(!VALID_SAMPLINGS.has(this._sampling))throw Error("invalid sampling");if(!VALID_PIXEL_FORMATS.has(this._pixelFormat))throw Error("invalid pixel format");if(!VALID_MIPMAP_QUALITIES.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!0;if(a instanceof ArrayBuffer||null===a||b.isSvg){if(this._width=b.width,this._height=b.height,a instanceof ArrayBuffer&amp;&amp;
a.byteLength!==this._width*this._height*4)throw Error("ArrayBuffer wrong size");}else this._width=a.width,this._height=a.height;if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid texture data size");if(b.isSvg){var d=C3$jscomp$42.CreateCanvas(this._width,this._height);d.getContext("2d").drawImage(a,0,0,this._width,this._height);a=d}var c=C3$jscomp$42.isPOT(this._width)&amp;&amp;C3$jscomp$42.isPOT(this._height);d=this._renderer.GetMaxTextureSize();if(this._width&gt;d||this._height&gt;d)throw Error("texture data exceeds maximum texture size");
d=this._renderer.GetContext();var e=this._renderer.GetWebGLVersionNumber();this._texture=d.createTexture();d.bindTexture(d.TEXTURE_2D,this._texture);d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1);b=GetFormatSpecifiers(this._pixelFormat,d);if(this._renderer.SupportsNPOTTextures()||c||!this._IsTiled())2&lt;=e?(d.texStorage2D(d.TEXTURE_2D,this._isMipMapped?Math.floor(Math.log2(Math.max(this._width,this._height))+1):1,b.sizedinternalformat,this._width,
this._height),a instanceof ArrayBuffer?d.texSubImage2D(d.TEXTURE_2D,0,0,0,this._width,this._height,b.format,b.type,new Uint8Array(a)):null!==a&amp;&amp;d.texSubImage2D(d.TEXTURE_2D,0,0,0,b.format,b.type,a)):a instanceof ArrayBuffer?d.texImage2D(d.TEXTURE_2D,0,b.internalformat,this._width,this._height,0,b.format,b.type,new Uint8Array(a)):null===a?d.texImage2D(d.TEXTURE_2D,0,b.internalformat,this._width,this._height,0,b.format,b.type,null):d.texImage2D(d.TEXTURE_2D,0,b.internalformat,b.format,b.type,a);else{if(null===
a)throw Error("cannot pass null data when creating a NPOT tiled texture without NPOT support");a instanceof ArrayBuffer&amp;&amp;(a=new ImageData(new Uint8ClampedArray(a),this._width,this._height));a instanceof ImageData&amp;&amp;(c=C3$jscomp$42.CreateCanvas(this._width,this._height),c.getContext("2d").putImageData(a,0,0),a=c);c=C3$jscomp$42.CreateCanvas(C3$jscomp$42.nextHighestPowerOfTwo(this._width),C3$jscomp$42.nextHighestPowerOfTwo(this._height));e=c.getContext("2d");e.imageSmoothingEnabled="nearest"!==this._sampling;
e.drawImage(a,0,0,this._width,this._height,0,0,c.width,c.height);d.texImage2D(d.TEXTURE_2D,0,b.internalformat,b.format,b.type,c)}null!==a&amp;&amp;this._SetTextureParameters(d);d.bindTexture(d.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;allTextures.add(this)}_CreateDynamic(a,b,d){d=Object.assign({},CREATEFROM_DEFAULT_OPTIONS,d);if(this._texture)throw Error("already created texture");this._wrapX=d.wrapX;this._wrapY=d.wrapY;this._sampling=d.sampling;this._pixelFormat=d.pixelFormat;
this._isMipMapped=!!d.mipMap&amp;&amp;this._renderer.AreMipmapsEnabled();this._mipMapQuality=d.mipMapQuality;if(!VALID_WRAP_MODES.has(this._wrapX)||!VALID_WRAP_MODES.has(this._wrapY))throw Error("invalid wrap mode");if(!VALID_SAMPLINGS.has(this._sampling))throw Error("invalid sampling");if(!VALID_PIXEL_FORMATS.has(this._pixelFormat))throw Error("invalid pixel format");if(!VALID_MIPMAP_QUALITIES.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!1;this._width=Math.floor(a);this._height=
Math.floor(b);a=C3$jscomp$42.isPOT(this._width)&amp;&amp;C3$jscomp$42.isPOT(this._height);b=this._renderer.GetMaxTextureSize();if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid texture size");if(this._width&gt;b||this._height&gt;b)throw Error("texture exceeds maximum texture size");if(!this._renderer.SupportsNPOTTextures()&amp;&amp;this._IsTiled()&amp;&amp;!a)throw Error("non-power-of-two tiled textures not supported");a=this._renderer.GetContext();b=this._renderer.GetWebGLVersionNumber();this._texture=a.createTexture();
a.bindTexture(a.TEXTURE_2D,this._texture);a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.premultiplyAlpha);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1);d=GetFormatSpecifiers(this._pixelFormat,a);a.texImage2D(a.TEXTURE_2D,0,2&lt;=b?d.sizedinternalformat:d.internalformat,this._width,this._height,0,d.format,d.type,null);this._SetTextureParameters(a);a.bindTexture(a.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;allTextures.add(this)}_GetMipMapHint(a){if("default"===this._mipMapQuality)return this._isStatic?
a.NICEST:a.FASTEST;if("low"===this._mipMapQuality)return a.FASTEST;if("high"===this._mipMapQuality)return a.NICEST;throw Error("invalid mipmap quality");}_IsTiled(){return"clamp-to-edge"!==this._wrapX||"clamp-to-edge"!==this._wrapY}_GetTextureWrapMode(a,b){if("clamp-to-edge"===b)return a.CLAMP_TO_EDGE;if("repeat"===b)return a.REPEAT;if("mirror-repeat"===b)return a.MIRRORED_REPEAT;throw Error("invalid wrap mode");}_SetTextureParameters(a){var b=C3$jscomp$42.isPOT(this._width)&amp;&amp;C3$jscomp$42.isPOT(this._height);
a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,this._GetTextureWrapMode(a,this._wrapX));a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,this._GetTextureWrapMode(a,this._wrapY));"nearest"===this._sampling?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),this._isMipMapped=!1):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),(b||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped?(a.hint(a.GENERATE_MIPMAP_HINT,this._GetMipMapHint(a)),
a.generateMipmap(a.TEXTURE_2D),b="trilinear"===this._sampling&amp;&amp;!this._renderer.HasMajorPerformanceCaveat(),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,b?a.LINEAR_MIPMAP_LINEAR:a.LINEAR_MIPMAP_NEAREST)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),this._isMipMapped=!1));(b=this._renderer._GetAnisotropicExtension())&amp;&amp;0&lt;this._anisotropy&amp;&amp;"nearest"!==this._sampling&amp;&amp;a.texParameterf(a.TEXTURE_2D,b.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this._anisotropy,this._renderer._GetMaxAnisotropy()))}_Update(a,
b){if(!("undefined"!==typeof HTMLImageElement&amp;&amp;a instanceof HTMLImageElement||"undefined"!==typeof HTMLVideoElement&amp;&amp;a instanceof HTMLVideoElement||"undefined"!==typeof HTMLCanvasElement&amp;&amp;a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&amp;&amp;a instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&amp;&amp;a instanceof OffscreenCanvas||a instanceof ImageData))throw Error("invalid texture source");if(!this._texture||0&gt;=this._refCount)throw Error("texture not created");if(this._isStatic)throw Error("cannot update static texture");
b=Object.assign({},UPDATE_DEFAULT_OPTIONS,b);const d=a.width||a.videoWidth,c=a.height||a.videoHeight;var e=this._renderer.GetWebGLVersionNumber();const h=this._renderer.GetContext();h.bindTexture(h.TEXTURE_2D,this._texture);h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha);h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!!b.flipY);b=GetFormatSpecifiers(this._pixelFormat,h);e=2&lt;=e?b.sizedinternalformat:b.internalformat;try{if(this._width===d&amp;&amp;this._height===c){const k=C3$jscomp$42.isPOT(this._width)&amp;&amp;
C3$jscomp$42.isPOT(this._height);h.texSubImage2D(h.TEXTURE_2D,0,0,0,b.format,b.type,a);(k||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped&amp;&amp;(h.hint(h.GENERATE_MIPMAP_HINT,this._GetMipMapHint(h)),h.generateMipmap(h.TEXTURE_2D))}else{this._width=d;this._height=c;const k=C3$jscomp$42.isPOT(this._width)&amp;&amp;C3$jscomp$42.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&amp;&amp;this._IsTiled()&amp;&amp;!k)throw Error("non-power-of-two tiled textures not supported");h.texImage2D(h.TEXTURE_2D,0,e,b.format,
b.type,a);(k||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped&amp;&amp;(h.hint(h.GENERATE_MIPMAP_HINT,this._GetMipMapHint(h)),h.generateMipmap(h.TEXTURE_2D))}}catch(k){console.error("Error updating WebGL texture: ",k)}h.bindTexture(h.TEXTURE_2D,null);this._renderer._ResetLastTexture()}_Delete(){if(0&lt;this._refCount)throw Error("texture still has references");if(!this._texture)throw Error("already deleted texture");allTextures.delete(this);this._renderer.GetContext().deleteTexture(this._texture);
this._texture=null}IsValid(){return!!this._texture}_GetTexture(){return this._texture}GetRenderer(){return this._renderer}AddReference(){this._refCount++}SubtractReference(){if(0&gt;=this._refCount)throw Error("no more references");this._refCount--}GetReferenceCount(){return this._refCount}GetWidth(){return this._width}GetHeight(){return this._height}IsStatic(){return this._isStatic}GetEstimatedMemoryUsage(){let a=this._width*this._height;switch(this._pixelFormat){case "rgba8":a*=4;break;case "rgb8":a*=
3;break;case "rgba4":case "rgb5_a1":case "rgb565":a*=2}this._isMipMapped&amp;&amp;(a+=Math.floor(a/3));return a}static OnContextLost(){allTextures.clear()}static allTextures(){return allTextures.values()}};"use strict";
const C3$jscomp$43=self.C3,glMatrix$jscomp$2=self.glMatrix,mat4$jscomp$3=glMatrix$jscomp$2.mat4,VALID_SAMPLINGS$jscomp$1=new Set(["nearest","bilinear","trilinear"]),DEFAULT_RENDERTARGET_OPTIONS={sampling:"trilinear",alpha:!0,depth:!1,isSampled:!0,isDefaultSize:!0,multisampling:0},allRenderTargets=new Set;
C3$jscomp$43.Gfx.WebGLRenderTarget=class{constructor(a){this._renderer=a;this._renderBuffer=this._texture=this._frameBufferNoDepth=this._frameBuffer=null;this._height=this._width=0;this._isDefaultSize=!0;this._sampling="trilinear";this._alpha=!0;this._depth=!1;this._isSampled=!0;this._multisampling=0;this._projectionMatrix=mat4$jscomp$3.create();this._lastFov=0}_Create(a,b,d){d=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,d);const c=this._renderer.GetWebGLVersionNumber();if(this._texture||this._renderBuffer)throw Error("already created render target");
this._sampling=d.sampling;this._alpha=!!d.alpha;this._depth=!!d.depth;this._isSampled=!!d.isSampled;this._isDefaultSize=!!d.isDefaultSize;this._multisampling=d.multisampling;if(!VALID_SAMPLINGS$jscomp$1.has(this._sampling))throw Error("invalid sampling");if(0&lt;this._multisampling&amp;&amp;(2&gt;c||this._isSampled))throw Error("invalid use of multisampling");2&gt;c&amp;&amp;(this._isSampled=!0);this._width=a;this._height=b;if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid render target size");this._CalculateProjection();
a=this._renderer.GetContext();this._frameBuffer=a.createFramebuffer();this._depth&amp;&amp;(this._frameBufferNoDepth=a.createFramebuffer());this._isSampled?(this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling,pixelFormat:this._alpha?"rgba8":"rgb8",mipMap:!1}),b=this._texture._GetTexture(),a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,b,0),this._depth&amp;&amp;(a.bindFramebuffer(a.FRAMEBUFFER,
this._frameBufferNoDepth),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,b,0))):(this._renderBuffer=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),b=this._alpha?a.RGBA8:a.RGB8,0&lt;this._multisampling&amp;&amp;((d=a.getInternalformatParameter(a.RENDERBUFFER,b,a.SAMPLES))&amp;&amp;d[0]?(d=d[0],this._multisampling&gt;d&amp;&amp;(this._multisampling=d)):this._multisampling=0),0===this._multisampling?a.renderbufferStorage(a.RENDERBUFFER,b,this._width,this._height):a.renderbufferStorageMultisample(a.RENDERBUFFER,
this._multisampling,b,this._width,this._height),a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,this._renderBuffer),this._depth&amp;&amp;(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,this._renderBuffer)),a.bindRenderbuffer(a.RENDERBUFFER,null));b=this._renderer._GetDepthBuffer();this._depth&amp;&amp;b&amp;&amp;(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),
this._renderer._CanSampleDepth()?a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,b,0):a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b));a.bindFramebuffer(a.FRAMEBUFFER,null);allRenderTargets.add(this)}_Resize(a,b){if(this._width!==a||this._height!==b)this._width=a,this._height=b,this._CalculateProjection(),a=this._renderer.GetContext(),a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),this._texture?this._texture._Update(new ImageData(this._width,
this._height)):(a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),a.renderbufferStorage(a.RENDERBUFFER,this._alpha?a.RGBA8:a.RGB8,this._width,this._height),a.bindRenderbuffer(a.RENDERBUFFER,null)),b=this._renderer._GetDepthBuffer(),this._depth&amp;&amp;b&amp;&amp;(this._renderer._CanSampleDepth()?a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,b,0):a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b)),a.bindFramebuffer(a.FRAMEBUFFER,null)}_Delete(){if(!this._texture&amp;&amp;
!this._renderBuffer)throw Error("already deleted render target");allRenderTargets.delete(this);var a=this._renderer.GetContext();this._texture?(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0),this._depth&amp;&amp;(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0)),this._renderer.DeleteTexture(this._texture),this._texture=null):this._renderBuffer&amp;&amp;
(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,null),this._depth&amp;&amp;(a.bindFramebuffer(a.FRAMEBUFFER,this._frameBufferNoDepth),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,null)),a.deleteRenderbuffer(this._renderBuffer),this._renderBuffer=null);a.bindFramebuffer(a.FRAMEBUFFER,null);2&lt;=this._renderer.GetWebGLVersionNumber()&amp;&amp;(a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,
null));a.deleteFramebuffer(this._frameBuffer);this._depth&amp;&amp;a.deleteFramebuffer(this._frameBufferNoDepth);a=this._renderer.GetBatchState();a.currentFramebuffer=null;this._frameBuffer=a.currentFramebufferNoDepth=null}_CalculateProjection(){this._renderer.CalculatePerspectiveMatrix(this._projectionMatrix,this._width/this._height);this._lastFov=this._renderer.GetFovY()}_GetFramebuffer(){return this._frameBuffer}_GetFramebufferNoDepth(){return this._frameBufferNoDepth}GetRenderer(){return this._renderer}GetTexture(){return this._texture}GetProjectionMatrix(){this._renderer.GetFovY()!==
this._lastFov&amp;&amp;this._CalculateProjection();return this._projectionMatrix}IsLinearSampling(){return"nearest"!==this._sampling}HasAlpha(){return this._alpha}IsSampled(){return this._isSampled}HasDepthBuffer(){return this._depth}GetWidth(){return this._width}GetHeight(){return this._height}IsDefaultSize(){return this._isDefaultSize}GetMultisampling(){return this._multisampling}GetOptions(){const a={sampling:this._sampling,alpha:this._alpha,isSampled:this._isSampled};this._isDefaultSize||(a.width=this._width,
a.height=this._height);return a}IsCompatibleWithOptions(a){a=Object.assign({},DEFAULT_RENDERTARGET_OPTIONS,a);return"nearest"!==a.sampling!==this.IsLinearSampling()||!!a.alpha!==this.HasAlpha()||!!a.depth!==this.HasDepthBuffer()||2&lt;=this._renderer.GetWebGLVersionNumber()&amp;&amp;!!a.isSampled!==this.IsSampled()?!1:"number"===typeof a.width||"number"===typeof a.height?!this.IsDefaultSize()&amp;&amp;this.GetWidth()===a.width&amp;&amp;this.GetHeight()===a.height:this.IsDefaultSize()}_GetWebGLTexture(){return this._texture?
this._texture._GetTexture():null}GetEstimatedMemoryUsage(){return this._texture?this._texture.GetEstimatedMemoryUsage():this._width*this._height*(this._alpha?4:3)}static async DebugReadPixelsToBlob(a,b){a=await a.ReadBackRenderTargetToImageData(b,!0);return await C3$jscomp$43.ImageDataToBlob(a)}static OnContextLost(){allRenderTargets.clear()}static allRenderTargets(){return allRenderTargets.values()}static ResizeAll(a,b){for(const d of allRenderTargets)d.IsDefaultSize()&amp;&amp;d._Resize(a,b)}};"use strict";
const C3$jscomp$44=self.C3,RESERVED_UNIFORM_NAMES=new Set("aPos aTex aPoints matP matMV samplerFront samplerBack samplerDepth destStart destEnd srcStart srcEnd srcOriginStart srcOriginEnd pixelSize seconds devicePixelRatio layerScale layerAngle layoutStart layoutEnd color color2_ pointTexStart pointTexEnd zElevation tileSize tileSpacing outlineThickness".split(" "));
C3$jscomp$44.Gfx.WebGLShaderProgram=class extends C3$jscomp$44.Gfx.ShaderProgramBase{static async Compile(a,b,d,c){const e=a.GetContext(),h=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(h,b);e.compileShader(h);b=e.createShader(e.VERTEX_SHADER);e.shaderSource(b,d);e.compileShader(b);const k=e.createProgram();e.attachShader(k,h);e.attachShader(k,b);e.bindAttribLocation(k,0,"aPos");e.bindAttribLocation(k,1,"aTex");e.bindAttribLocation(k,2,"aPoints");e.linkProgram(k);const m=a._GetParallelShaderCompileExtension();
m?await a._WaitForObjectReady(()=&gt;e.getProgramParameter(k,m.COMPLETION_STATUS_KHR)):await C3$jscomp$44.Wait(5);if(!e.getShaderParameter(h,e.COMPILE_STATUS))throw c=e.getShaderInfoLog(h),e.deleteShader(h),e.deleteShader(b),e.deleteProgram(k),Error("Error compiling fragment shader: "+c);if(!e.getShaderParameter(b,e.COMPILE_STATUS))throw c=e.getShaderInfoLog(b),e.deleteShader(h),e.deleteShader(b),e.deleteProgram(k),Error("Error compiling vertex shader: "+c);if(!e.getProgramParameter(k,e.LINK_STATUS))throw c=
e.getProgramInfoLog(k),e.deleteShader(h),e.deleteShader(b),e.deleteProgram(k),Error("Error linking shader program: "+c);(a=C3$jscomp$44.FilterUnprintableChars(e.getProgramInfoLog(k)||"").trim())&amp;&amp;!C3$jscomp$44.IsStringAllWhitespace(a)&amp;&amp;console.info(`[WebGL] Shader program '${c}' compilation log: `,a);e.deleteShader(h);e.deleteShader(b);return k}static async Create(a,b,d,c){d=await C3$jscomp$44.Gfx.WebGLShaderProgram.Compile(a,b.src,d,c);return new C3$jscomp$44.Gfx.WebGLShaderProgram(a,d,b,c)}constructor(a,
b,d,c){super(a,c,d);const e=a.GetContext();var h=a.GetBatchState();a.EndBatch();e.useProgram(b);this._gl=e;this._shaderProgram=b;this._isDeviceTransform="&lt;default-device-transform&gt;"===c;c=e.getAttribLocation(b,"aPos");const k=e.getAttribLocation(b,"aTex");this._locAPoints=e.getAttribLocation(b,"aPoints");-1!==c&amp;&amp;(e.bindBuffer(e.ARRAY_BUFFER,a._vertexBuffer),e.vertexAttribPointer(c,a.GetNumVertexComponents(),e.FLOAT,!1,0,0),e.enableVertexAttribArray(c));-1!==k&amp;&amp;(e.bindBuffer(e.ARRAY_BUFFER,a._texcoordBuffer),
e.vertexAttribPointer(k,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(k));-1!==this._locAPoints&amp;&amp;(e.bindBuffer(e.ARRAY_BUFFER,a._pointBuffer),e.vertexAttribPointer(this._locAPoints,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(this._locAPoints));e.bindBuffer(e.ARRAY_BUFFER,null);this._uMatP=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"matP","mat4");this._uMatMV=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"matMV","mat4");this._uColor=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"color","vec4");this._uSamplerFront=
new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"samplerFront","sampler");this._uPointTexStart=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"pointTexStart","vec2");this._uPointTexEnd=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"pointTexEnd","vec2");this._uZElevation=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"zElevation","float");this._uTileSize=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"tileSize","vec2");this._uTileSpacing=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"tileSpacing","vec2");this._uColor2=
new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"color2_","vec4");this._uOutlineThickness=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"outlineThickness","float");this._uSamplerBack=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"samplerBack","sampler");this._uSamplerDepth=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"samplerDepth","sampler");this._uDestStart=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"destStart","vec2");this._uDestEnd=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"destEnd","vec2");this._uSrcStart=
new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"srcStart","vec2");this._uSrcEnd=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"srcEnd","vec2");this._uSrcOriginStart=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"srcOriginStart","vec2");this._uSrcOriginEnd=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"srcOriginEnd","vec2");this._uPixelSize=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"pixelSize","vec2");this._uSeconds=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"seconds","float");this._uDevicePixelRatio=
new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"devicePixelRatio","float");this._uLayerScale=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"layerScale","float");this._uLayerAngle=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"layerAngle","float");this._uLayoutStart=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"layoutStart","vec2");this._uLayoutEnd=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,"layoutEnd","vec2");this._hasAnyOptionalUniforms=!!(this._uPixelSize.IsUsed()||this._uSeconds.IsUsed()||this._uSamplerBack.IsUsed()||
this._uDestStart.IsUsed()||this._uDestEnd.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed()||this._uDevicePixelRatio.IsUsed()||this._uLayerScale.IsUsed()||this._uLayerAngle.IsUsed()||this._uLayoutStart.IsUsed()||this._uLayoutEnd.IsUsed());a=d.parameters||[];this._uCustomParameters=[];this._usesAnySrcRectOrPixelSize=this._uPixelSize.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed();
this._hasCurrentMatMV=this._hasCurrentMatP=!1;this._uColor.Init4f(1,1,1,1);this._uColor2.Init4f(1,1,1,1);this._uSamplerFront.Init1i(0);this._uSamplerBack.Init1i(1);this._uSamplerDepth.Init1i(2);this._uPointTexStart.Init2f(0,0);this._uPointTexEnd.Init2f(1,1);this._uZElevation.Init1f(0);this._uTileSize.Init2f(0,0);this._uTileSpacing.Init2f(0,0);this._uDestStart.Init2f(0,0);this._uDestEnd.Init2f(1,1);this._uSrcStart.Init2f(0,0);this._uSrcEnd.Init2f(0,0);this._uSrcOriginStart.Init2f(0,0);this._uSrcOriginEnd.Init2f(0,
0);this._uPixelSize.Init2f(0,0);this._uDevicePixelRatio.Init1f(1);this._uLayerScale.Init1f(1);this._uLayerAngle.Init1f(0);this._uSeconds.Init1f(0);this._uLayoutStart.Init2f(0,0);this._uLayoutEnd.Init2f(0,0);this._uOutlineThickness.Init1f(1);for(const m of a)a=m[2],b=new C3$jscomp$44.Gfx.WebGLShaderUniform(this,m[0],a),"color"===a?b.Init3f(0,0,0):b.Init1f(0),this._uCustomParameters.push(b);this._isDeviceTransform?this._UpdateDeviceTransformUniforms(h.currentMatP):(this.UpdateMatP(h.currentMatP,!0),
this.UpdateMatMV(h.currentMV,!0));h=h.currentShader;e.useProgram(h?h._shaderProgram:null)}Release(){this._gl.deleteProgram(this._shaderProgram);this._shaderProgram=null;this._renderer._RemoveShaderProgram(this);this._gl=null;super.Release()}GetWebGLContext(){return this._gl}GetShaderProgram(){return this._shaderProgram}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(a){return 0&gt;a||a&gt;=this._uCustomParameters.length?null:this._uCustomParameters[a].GetType()}AreCustomParametersAlreadySetInBatch(a){for(let b=
0,d=a.length;b&lt;d;++b)if(!this._uCustomParameters[b].IsSetToCustomInBatch(a[b]))return!1;return!0}SetCustomParametersInBatch(a){for(let b=0,d=a.length;b&lt;d;++b)this._uCustomParameters[b].SetBatchValueCustom(a[b])}AreOptionalUniformsAlreadySetInBatch(a,b,d,c,e,h,k,m,p,q){return this._uSamplerBack.IsUsed()||this._uPixelSize.IsUsed()&amp;&amp;!this._uPixelSize.IsSetTo2InBatch(e,h)||this._uDestStart.IsUsed()&amp;&amp;!this._uDestStart.IsSetTo2InBatch(a.getLeft(),a.getTop())||this._uDestEnd.IsUsed()&amp;&amp;!this._uDestEnd.IsSetTo2InBatch(a.getRight(),
a.getBottom())||this._uDevicePixelRatio.IsUsed()&amp;&amp;!this._uDevicePixelRatio.IsSetTo1InBatch(k)||this._uLayerScale.IsUsed()&amp;&amp;!this._uLayerScale.IsSetTo1InBatch(m)||this._uLayerAngle.IsUsed()&amp;&amp;!this._uLayerAngle.IsSetTo1InBatch(p)||this._uSrcStart.IsUsed()&amp;&amp;!this._uSrcStart.IsSetTo2InBatch(b.getLeft(),b.getTop())||this._uSrcEnd.IsUsed()&amp;&amp;!this._uSrcEnd.IsSetTo2InBatch(b.getRight(),b.getBottom())||this._uSrcOriginStart.IsUsed()&amp;&amp;!this._uSrcOriginStart.IsSetTo2InBatch(d.getLeft(),d.getTop())||this._uSrcOriginEnd.IsUsed()&amp;&amp;
!this._uSrcOriginEnd.IsSetTo2InBatch(d.getRight(),d.getBottom())||this._uLayoutStart.IsUsed()&amp;&amp;!this._uLayoutStart.IsSetTo2InBatch(c.getLeft(),c.getTop())||this._uLayoutEnd.IsUsed()&amp;&amp;!this._uLayoutEnd.IsSetTo2InBatch(c.getTop(),c.getBottom())||this._uSeconds.IsUsed()&amp;&amp;!this._uSeconds.IsSetTo1InBatch(q)?!1:!0}SetOptionalUniformsInBatch(a,b,d,c,e,h,k,m,p,q){this._uSamplerBack.IsUsed()||(this._uPixelSize.IsUsed()&amp;&amp;this._uPixelSize.SetBatch2(e,h),this._uDestStart.IsUsed()&amp;&amp;this._uDestStart.SetBatch2(a.getLeft(),
a.getTop()),this._uDestEnd.IsUsed()&amp;&amp;this._uDestEnd.SetBatch2(a.getRight(),a.getBottom()),this._uDevicePixelRatio.IsUsed()&amp;&amp;this._uDevicePixelRatio.SetBatch1(k),this._uLayerScale.IsUsed()&amp;&amp;this._uLayerScale.SetBatch1(m),this._uLayerAngle.IsUsed()&amp;&amp;this._uLayerAngle.SetBatch1(p),this._uSrcStart.IsUsed()&amp;&amp;this._uSrcStart.SetBatch2(b.getLeft(),b.getTop()),this._uSrcEnd.IsUsed()&amp;&amp;this._uSrcEnd.SetBatch2(b.getRight(),b.getBottom()),this._uSrcOriginStart.IsUsed()&amp;&amp;this._uSrcOriginStart.SetBatch2(d.getLeft(),
d.getTop()),this._uSrcOriginEnd.IsUsed()&amp;&amp;this._uSrcOriginEnd.SetBatch2(d.getRight(),d.getBottom()),this._uLayoutStart.IsUsed()&amp;&amp;this._uLayoutStart.SetBatch2(c.getLeft(),c.getTop()),this._uLayoutEnd.IsUsed()&amp;&amp;this._uLayoutEnd.SetBatch2(c.getTop(),c.getBottom()),this._uSeconds.IsUsed()&amp;&amp;this._uSeconds.SetBatch1(q))}UpdateMatP(a,b){this._hasCurrentMatP&amp;&amp;!b||this._isDeviceTransform||(this._uMatP.IsUsed()&amp;&amp;this._uMatP.UpdateMatrix4fv(a),this._hasCurrentMatP=!0)}SetMatPStale(){this._hasCurrentMatP=!1}UpdateMatMV(a,
b){this._hasCurrentMatMV&amp;&amp;!b||this._isDeviceTransform||(this._uMatMV.IsUsed()&amp;&amp;this._uMatMV.UpdateMatrix4fv(a),this._hasCurrentMatMV=!0)}SetMatMVStale(){this._hasCurrentMatMV=!1}_UpdateDeviceTransformUniforms(a){if(!this._isDeviceTransform)throw Error("not device transform shader");this._uMatP.UpdateMatrix4fv(a);a=this._renderer;const b=a.GetWidth()/2,d=a.GetHeight()/2;a=a.CalculateLookAtModelView2(b,d,a.GetDefaultCameraZ(a.GetHeight()),b,d,0,a.GetHeight());this._uMatMV.UpdateMatrix4fv(a)}UpdateColor(a){this._uColor.IsUsed()&amp;&amp;
this._uColor.Update4f(a[0],a[1],a[2],a[3])}static GetReservedUniformNames(){return RESERVED_UNIFORM_NAMES}static GetDefaultVertexShaderSource(a){a=a?"highmedp":"mediump";return["#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nattribute highp vec3 aPos;",`attribute ${a} vec2 aTex;`,`varying ${a} vec2 vTex;`,"uniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos, 1.0);\n\tvTex = aTex;\n}"].join("\n")}static GetDefaultVertexShaderSource_WebGL2(a){a=
a?"highp":"mediump";return["#version 300 es\nin highp vec3 aPos;",`in ${a} vec2 aTex;`,`out ${a} vec2 vTex;`,"uniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos, 1.0);\n\tvTex = aTex;\n}"].join("\n")}static GetTextureFillFragmentShaderSource_WebGL1_NoFragDepth(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, vTex) * color;\n}"}static GetTextureFillFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\nvarying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, vTex) * color;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTextureFillFragmentShaderSource_WebGL2(){return"#version 300 es\nin mediump vec2 vTex;\nout lowp vec4 outColor;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\toutColor = texture(samplerFront, vTex) * color;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTilemapFragmentShaderSource_WebGL1_NoFragDepth(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying highmedp vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highmedp vec2 srcStart;\nuniform highmedp vec2 pixelSize;\nuniform highmedp vec2 tileSize;\nuniform highmedp vec2 tileSpacing;\nvoid main(void) {\n\thighmedp vec2 tile = floor(vTex);\n\thighmedp vec2 tex = fract(vTex);\n\thighmedp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighmedp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighmedp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\tgl_FragColor = texture2D(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n}"}static GetTilemapFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\n#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nvarying highmedp vec2 vTex;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highmedp vec2 srcStart;\nuniform highmedp vec2 pixelSize;\nuniform highmedp vec2 tileSize;\nuniform highmedp vec2 tileSpacing;\nvoid main(void) {\n\thighmedp vec2 tile = floor(vTex);\n\thighmedp vec2 tex = fract(vTex);\n\thighmedp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighmedp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighmedp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\tgl_FragColor = texture2D(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetTilemapFragmentShaderSource_WebGL2(){return"#version 300 es\nin highp vec2 vTex;\nout lowp vec4 outColor;\nuniform lowp vec4 color;\nuniform lowp sampler2D samplerFront;\nuniform highp vec2 srcStart;\nuniform highp vec2 pixelSize;\nuniform highp vec2 tileSize;\nuniform highp vec2 tileSpacing;\nvoid main(void) {\n\thighp vec2 tile = floor(vTex);\n\thighp vec2 tex = fract(vTex);\n\thighp vec2 tileOrigin = srcStart + tile * (tileSize + tileSpacing);\n\thighp vec2 lowerBound = tileOrigin + pixelSize / 2.0;\n\thighp vec2 upperBound = tileOrigin + tileSize - pixelSize / 2.0;\n\toutColor = texture(samplerFront, clamp(tex, lowerBound, upperBound), -16.0) * color;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetPointVertexShaderSource_WebGL1(){return"attribute vec4 aPoints;\nvarying float pointOpacity;\nuniform float zElevation;\nuniform mat4 matP;\nuniform mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPoints.xy, zElevation, 1.0);\n\tgl_PointSize = aPoints.z;\n\tpointOpacity = aPoints.w;\n}"}static GetPointVertexShaderSource_WebGL2(){return"#version 300 es\nin vec4 aPoints;\nout float pointOpacity;\nuniform float zElevation;\nuniform mat4 matP;\nuniform mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPoints.xy, zElevation, 1.0);\n\tgl_PointSize = aPoints.z;\n\tpointOpacity = aPoints.w;\n}"}static GetPointFragmentShaderSource_WebGL1_NoFragDepth(){return"uniform lowp sampler2D samplerFront;\nvarying lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, mix(pointTexStart, pointTexEnd, gl_PointCoord)) * color * pointOpacity;\n}"}static GetPointFragmentShaderSource_WebGL1_FragDepthEXT(){return"#extension GL_EXT_frag_depth : enable\nuniform lowp sampler2D samplerFront;\nvarying lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, mix(pointTexStart, pointTexEnd, gl_PointCoord)) * color * pointOpacity;\n\tgl_FragDepthEXT = (gl_FragColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetPointFragmentShaderSource_WebGL2(){return"#version 300 es\nuniform lowp sampler2D samplerFront;\nin lowp float pointOpacity;\nuniform mediump vec2 pointTexStart;\nuniform mediump vec2 pointTexEnd;\nuniform lowp vec4 color;\nout lowp vec4 outColor;\nvoid main(void) {\n\toutColor = texture(samplerFront, mix(pointTexStart, pointTexEnd, gl_PointCoord)) * color * pointOpacity;\n\tgl_FragDepth = (outColor.a == 0.0 ? 1.0 : gl_FragCoord.z);\n}"}static GetColorFillFragmentShaderSource(){return"uniform lowp vec4 color;\nvoid main(void) {\n\tgl_FragColor = color;\n}"}static GetLinearGradientFillFragmentShaderSource(){return"precision lowp float;\nvarying mediump vec2 vTex;\nuniform vec4 color;\nuniform vec4 color2_;\nvec3 fromLinear(vec3 linearRGB)\n{\n\tbvec3 cutoff = lessThan(linearRGB, vec3(0.0031308));\n\tvec3 higher = vec3(1.055) * pow(abs(linearRGB), vec3(1.0/2.4)) - vec3(0.055);\n\tvec3 lower = linearRGB * vec3(12.92);\n\treturn mix(higher, lower, vec3(cutoff));\n}\nvec3 toLinear(vec3 sRGB)\n{\n\tbvec3 cutoff = lessThan(sRGB, vec3(0.04045));\n\tvec3 higher = pow(abs((sRGB + vec3(0.055))/vec3(1.055)), vec3(2.4));\n\tvec3 lower = sRGB/vec3(12.92);\n\treturn mix(higher, lower, vec3(cutoff));\n}\nvoid main(void) {\n\tvec3 linearGrad = mix(toLinear(color.rgb), toLinear(color2_.rgb), vTex.x);\n\tfloat a = mix(color.a, color2_.a, vTex.x);\n\tgl_FragColor = vec4(fromLinear(linearGrad) * a, a);\n}"}static GetPenumbraFillFragmentShaderSource(){return"#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif\nprecision lowp float;\nvarying highmedp vec2 vTex;\nuniform vec4 color;\nvoid main(void) {\n\thighmedp float grad = vTex.x / (1.0 - vTex.y);\n\tgl_FragColor = color * (1.0 - (cos(grad * 3.141592653589793) + 1.0) / 2.0);\n}"}static GetSmoothLineFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nvoid main(void) {\n\tlowp float f = 1.0 - abs(vTex.y - 0.5) * 2.0;\n\tgl_FragColor = color * f;\n}"}static GetHardEllipseFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float f = step(diffSq.x + diffSq.y, 0.25);\n\tgl_FragColor = color * f;\n}"}static GetHardEllipseOutlineFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nuniform mediump float outlineThickness;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float distSq = diffSq.x + diffSq.y;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump float innerF = step(distSq, 0.25);\n\tmediump vec2 innerEdge = halfNorm - pixelSize * norm * outlineThickness;\n\tmediump vec2 innerEdgeSq = innerEdge * innerEdge;\n\tmediump float outerF = step(innerEdgeSq.x + innerEdgeSq.y, distSq);\n\tgl_FragColor = color * innerF * outerF;\n}"}static GetSmoothEllipseFillFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump vec2 halfNormSq = halfNorm * halfNorm;\n\tmediump vec2 innerEdge = halfNorm - pixelSize * norm;\n\tmediump vec2 innerEdgeSq = innerEdge * innerEdge;\n\tmediump float f = smoothstep(halfNormSq.x + halfNormSq.y, innerEdgeSq.x + innerEdgeSq.y, diffSq.x + diffSq.y);\n\tgl_FragColor = color * f;\n}"}static GetSmoothEllipseOutlineFragmentShaderSource(){return"varying mediump vec2 vTex;\nuniform lowp vec4 color;\nuniform mediump vec2 pixelSize;\nuniform mediump float outlineThickness;\nvoid main(void) {\n\tmediump vec2 diff = vTex - vec2(0.5, 0.5);\n\tmediump vec2 diffSq = diff * diff;\n\tmediump float distSq = diffSq.x + diffSq.y;\n\tmediump vec2 norm = normalize(diff);\n\tmediump vec2 halfNorm = norm * 0.5;\n\tmediump vec2 halfNormSq = halfNorm * halfNorm;\n\tmediump vec2 pxNorm = pixelSize * norm;\n\tmediump vec2 innerEdge1 = halfNorm - pxNorm;\n\tmediump vec2 innerEdge1Sq = innerEdge1 * innerEdge1;\n\tmediump float innerF = smoothstep(halfNormSq.x + halfNormSq.y, innerEdge1Sq.x + innerEdge1Sq.y, distSq);\n\tmediump vec2 innerEdge2 = halfNorm - pxNorm * outlineThickness;\n\tmediump vec2 innerEdge2Sq = innerEdge2 * innerEdge2;\n\tmediump vec2 innerEdge3 = halfNorm - pxNorm * (outlineThickness + 1.0);\n\tmediump vec2 innerEdge3Sq = innerEdge3 * innerEdge3;\n\tmediump float outerF = smoothstep(innerEdge3Sq.x + innerEdge3Sq.y, innerEdge2Sq.x + innerEdge2Sq.y, distSq);\n\tgl_FragColor = color * innerF * outerF;\n}"}};
"use strict";const C3$jscomp$45=self.C3,mat4$jscomp$5=self.glMatrix.mat4,TYPE_SIZES=new Map([["float",1],["percent",1],["sampler",1],["vec2",2],["vec3",3],["color",3],["vec4",4],["mat4",16]]);
C3$jscomp$45.Gfx.WebGLShaderUniform=class{constructor(a,b,d){if(!TYPE_SIZES.has(d))throw Error("invalid uniform type");this._owner=a;this._gl=this._owner.GetWebGLContext();this._name=b;this._type=d;this._isColorType="color"===this._type;this._location=this._gl.getUniformLocation(this._owner.GetShaderProgram(),b);this._isUsed=!!this._location;a=TYPE_SIZES.get(d);this._lastValue=new Float32Array(a);this._lastBatchValue=new Float32Array(a)}Release(){this._location=this._gl=this._owner=null}IsUsed(){return this._isUsed}GetType(){return this._type}IsColorType(){return this._isColorType}Init1f(a){this.IsUsed()&amp;&amp;
(this._lastValue[0]=a,this._lastBatchValue.set(this._lastValue),this._gl.uniform1f(this._location,a))}Init1i(a){this.IsUsed()&amp;&amp;(this._lastValue[0]=a,this._lastBatchValue.set(this._lastValue),this._gl.uniform1i(this._location,a))}Init2f(a,b){this.IsUsed()&amp;&amp;(this._lastValue[0]=a,this._lastValue[1]=b,this._lastBatchValue.set(this._lastValue),this._gl.uniform2f(this._location,a,b))}Init3f(a,b,d){this.IsUsed()&amp;&amp;(this._lastValue[0]=a,this._lastValue[1]=b,this._lastValue[2]=d,this._lastBatchValue.set(this._lastValue),
this._gl.uniform3f(this._location,a,b,d))}Init4f(a,b,d,c){this.IsUsed()&amp;&amp;(this._lastValue[0]=a,this._lastValue[1]=b,this._lastValue[2]=d,this._lastValue[3]=c,this._lastBatchValue.set(this._lastValue),this._gl.uniform4f(this._location,a,b,d,c))}Update1f(a){a=Math.fround(a);const b=this._lastValue;b[0]!==a&amp;&amp;(b[0]=a,this._gl.uniform1f(this._location,a))}Update1i(a){const b=this._lastValue;b[0]!==a&amp;&amp;(b[0]=a,this._gl.uniform1i(this._location,a))}Update2f(a,b){a=Math.fround(a);b=Math.fround(b);const d=
this._lastValue;if(d[0]!==a||d[1]!==b)d[0]=a,d[1]=b,this._gl.uniform2f(this._location,a,b)}Update3f(a,b,d){a=Math.fround(a);b=Math.fround(b);d=Math.fround(d);const c=this._lastValue;if(c[0]!==a||c[1]!==b||c[2]!==d)c[0]=a,c[1]=b,c[2]=d,this._gl.uniform3f(this._location,a,b,d)}Update4f(a,b,d,c){a=Math.fround(a);b=Math.fround(b);d=Math.fround(d);c=Math.fround(c);const e=this._lastValue;if(e[0]!==a||e[1]!==b||e[2]!==d||e[3]!==c)e[0]=a,e[1]=b,e[2]=d,e[3]=c,this._gl.uniform4f(this._location,a,b,d,c)}UpdateMatrix4fv(a){const b=
this._lastValue;mat4$jscomp$5.exactEquals(b,a)||(C3$jscomp$45.typedArraySet16(b,a,0),this._gl.uniformMatrix4fv(this._location,!1,a))}IsSetToCustomInBatch(a){const b=this._lastBatchValue;return this.IsColorType()?b[0]===Math.fround(a.getR())&amp;&amp;b[1]===Math.fround(a.getG())&amp;&amp;b[2]===Math.fround(a.getB()):b[0]===Math.fround(a)}SetBatchValueCustom(a){const b=this._lastBatchValue;this.IsColorType()?(b[0]=a.getR(),b[1]=a.getG(),b[2]=a.getB()):b[0]=a}IsSetTo1InBatch(a){return this._lastBatchValue[0]===Math.fround(a)}IsSetTo2InBatch(a,
b){const d=this._lastBatchValue;return d[0]===Math.fround(a)&amp;&amp;d[1]===Math.fround(b)}SetBatch1(a){this._lastBatchValue[0]=a}SetBatch2(a,b){const d=this._lastBatchValue;d[0]=a;d[1]=b}};"use strict";const C3$jscomp$46=self.C3,glMatrix$jscomp$5=self.glMatrix,vec4$jscomp$3=glMatrix$jscomp$5.vec4,mat4$jscomp$6=glMatrix$jscomp$5.mat4;
C3$jscomp$46.Gfx.BatchState=class{constructor(a){this.renderer=a;this.currentMV=mat4$jscomp$6.create();this.currentMatP=mat4$jscomp$6.create();this.currentFramebufferNoDepth=this.currentFramebuffer=null;this.isDepthSamplingEnabled=!1;this.currentColor=vec4$jscomp$3.fromValues(1,1,1,1);this.currentShader=null;this.pointTexCoords=new C3$jscomp$46.Rect;this.clearColor=C3$jscomp$46.New(C3$jscomp$46.Color,0,0,0,0)}};
C3$jscomp$46.Gfx.WebGLBatchJob=class{constructor(a){const b=new ArrayBuffer(96);this._type=0;this._batchState=a;this._gl=a.renderer.GetContext();this._indexCount=this._startIndex=0;this._texParam=null;this._mat4param=new Float32Array(b,0,16);this._colorParam=new Float32Array(b,64,4);this._srcOriginRect=new Float32Array(b,80,4);this._shaderParams=[]}InitQuad(a,b){this._type=1;this._startIndex=a;this._indexCount=b}DoQuad(){const a=this._gl;a.drawElements(a.TRIANGLES,this._indexCount,a.UNSIGNED_SHORT,
this._startIndex)}InitSetTexture(a){this._type=2;this._texParam=a}DoSetTexture(){const a=this._gl,b=this._texParam;a.bindTexture(a.TEXTURE_2D,b?b._GetTexture():null)}InitSetColor(a){this._type=3;a.writeToTypedArray(this._colorParam,0)}DoSetColor(){const a=this._colorParam,b=this._batchState;vec4$jscomp$3.copy(b.currentColor,a);b.currentShader.UpdateColor(a)}InitSetGradientColor(a){this._type=21;a.writeToTypedArray(this._colorParam,0)}DoSetGradientColor(){const a=this._colorParam,b=this._batchState.currentShader;
b._uColor2.IsUsed()&amp;&amp;b._uColor2.Update4f(a[0],a[1],a[2],a[3])}InitSetBlend(a,b){this._type=4;this._startIndex=a;this._indexCount=b}DoSetBlend(){this._gl.blendFunc(this._startIndex,this._indexCount)}InitSetViewport(a,b,d,c){this._type=5;const e=this._colorParam;e[0]=a;e[1]=b;e[2]=d;e[3]=c}DoSetViewport(){const a=this._colorParam;this._gl.viewport(a[0],a[1],a[2],a[3])}InitSetProjection(a){this._type=6;mat4$jscomp$6.copy(this._mat4param,a)}DoSetProjection(){const a=this._batchState,b=a.renderer._allShaderPrograms,
d=a.currentShader,c=this._mat4param;for(let e=0,h=b.length;e&lt;h;++e){const k=b[e];k===d?k.UpdateMatP(c,!0):k.SetMatPStale()}mat4$jscomp$6.copy(a.currentMatP,c)}InitSetModelView(a){this._type=7;mat4$jscomp$6.copy(this._mat4param,a)}DoSetModelView(){const a=this._batchState,b=a.renderer._allShaderPrograms,d=a.currentShader,c=this._mat4param;for(let e=0,h=b.length;e&lt;h;++e){const k=b[e];k===d?k.UpdateMatMV(c,!0):k.SetMatMVStale()}mat4$jscomp$6.copy(a.currentMV,c)}InitSetRenderTarget(a){this._type=8;this._texParam=
a}DoSetRenderTarget(){const a=this._gl,b=this._texParam,d=this._batchState;b?(d.currentFramebuffer=b._GetFramebuffer(),d.currentFramebufferNoDepth=b._GetFramebufferNoDepth(),d.isDepthSamplingEnabled&amp;&amp;d.currentFramebufferNoDepth?a.bindFramebuffer(a.FRAMEBUFFER,d.currentFramebufferNoDepth):a.bindFramebuffer(a.FRAMEBUFFER,d.currentFramebuffer)):(d.currentFramebuffer=null,d.currentFramebufferNoDepth=null,a.bindFramebuffer(a.FRAMEBUFFER,null))}InitClearSurface(a){this._type=9;a.writeToTypedArray(this._mat4param,
0)}InitClearSurface2(a,b,d,c){this._type=9;const e=this._mat4param;e[0]=a;e[1]=b;e[2]=d;e[3]=c}DoClearSurface(){const a=this._gl;var b=this._mat4param;const d=this._batchState.clearColor,c=b[0],e=b[1],h=b[2];b=b[3];d.equalsRgba(c,e,h,b)||(a.clearColor(c,e,h,b),d.setRgba(c,e,h,b));a.clear(a.COLOR_BUFFER_BIT)}InitSetPointTexCoords(a){this._type=15;a.writeToTypedArray(this._mat4param,0)}DoSetPointTextureCoords(){const a=this._mat4param;this._batchState.pointTexCoords.set(a[0],a[1],a[2],a[3])}InitPoints(a,
b){this._type=10;this._startIndex=a;this._indexCount=1;this._mat4param[0]=b}DoPoints(){const a=this._gl,b=this._batchState,d=b.renderer._spPoints;a.useProgram(d._shaderProgram);d.UpdateMatP(b.currentMatP,!1);d.UpdateMatMV(b.currentMV,!1);var c=b.pointTexCoords;d._uPointTexStart.IsUsed()&amp;&amp;d._uPointTexStart.Update2f(c.getLeft(),c.getTop());d._uPointTexEnd.IsUsed()&amp;&amp;d._uPointTexEnd.Update2f(c.getRight(),c.getBottom());c=this._mat4param[0];d._uZElevation.IsUsed()&amp;&amp;d._uZElevation.Update1f(c);d._uColor.IsUsed()&amp;&amp;
(c=b.currentColor,d._uColor.Update4f(c[0],c[1],c[2],c[3]));a.drawArrays(a.POINTS,this._startIndex/4,this._indexCount);a.useProgram(b.currentShader._shaderProgram)}InitSetProgram(a){this._type=11;this._texParam=a}DoSetProgram(){var a=this._gl;const b=this._batchState,d=this._texParam;b.currentShader=d;a.useProgram(d._shaderProgram);d.UpdateMatP(b.currentMatP,!1);d.UpdateMatMV(b.currentMV,!1);d._uColor.IsUsed()&amp;&amp;(a=b.currentColor,d._uColor.Update4f(a[0],a[1],a[2],a[3]))}InitSetProgramParameters(){this._type=
12}DoSetProgramParameters(){const a=this._batchState.currentShader,b=this._gl,d=this._mat4param,c=this._colorParam,e=this._srcOriginRect;if(a._uSamplerBack.IsUsed()){const h=this._batchState.renderer,k=this._texParam;h._lastTexture1!==k&amp;&amp;(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k?k._GetTexture():null),h._lastTexture1=k,b.activeTexture(b.TEXTURE0))}a._uPixelSize.IsUsed()&amp;&amp;a._uPixelSize.Update2f(d[0],d[1]);a._uDestStart.IsUsed()&amp;&amp;a._uDestStart.Update2f(d[2],d[3]);a._uDestEnd.IsUsed()&amp;&amp;
a._uDestEnd.Update2f(d[4],d[5]);a._uDevicePixelRatio.IsUsed()&amp;&amp;a._uDevicePixelRatio.Update1f(this._indexCount);a._uLayerScale.IsUsed()&amp;&amp;a._uLayerScale.Update1f(d[6]);a._uLayerAngle.IsUsed()&amp;&amp;a._uLayerAngle.Update1f(d[7]);a._uSrcStart.IsUsed()&amp;&amp;a._uSrcStart.Update2f(d[12],d[13]);a._uSrcEnd.IsUsed()&amp;&amp;a._uSrcEnd.Update2f(d[14],d[15]);a._uSrcOriginStart.IsUsed()&amp;&amp;a._uSrcOriginStart.Update2f(e[0],e[1]);a._uSrcOriginEnd.IsUsed()&amp;&amp;a._uSrcOriginEnd.Update2f(e[2],e[3]);a._uLayoutStart.IsUsed()&amp;&amp;a._uLayoutStart.Update2f(c[0],
c[1]);a._uLayoutEnd.IsUsed()&amp;&amp;a._uLayoutEnd.Update2f(c[2],c[3]);a._uSeconds.IsUsed()&amp;&amp;a._uSeconds.Update1f(this._startIndex)}InitSetProgramCustomParameters(){this._type=13}DoSetProgramCustomParameters(){const a=this._batchState.currentShader._uCustomParameters,b=this._shaderParams;for(let d=0,c=a.length;d&lt;c;++d){const e=a[d],h=b[d];e.IsColorType()?e.Update3f(h.getR(),h.getG(),h.getB()):e.Update1f(h)}}InitInvalidateFramebuffer(a){this._type=14;this._texParam=a}DoInvalidateFramebuffer(){const a=this._gl,
b=this._texParam,d=this._batchState.currentFramebuffer;b!==d&amp;&amp;a.bindFramebuffer(a.FRAMEBUFFER,b);a.invalidateFramebuffer(a.FRAMEBUFFER,[a.COLOR_ATTACHMENT0]);b!==d&amp;&amp;a.bindFramebuffer(a.FRAMEBUFFER,d)}InitBlitFramebuffer(a,b,d){this._type=17;const c=this._mat4param,e=this._batchState.renderer;c[0]=a.GetWidth();c[1]=a.GetHeight();c[2]=b?b.GetWidth():e.GetWidth();c[3]=b?b.GetHeight():e.GetHeight();c[4]=a.IsLinearSampling()?1:0;c[5]="stretch"===d;d=this._shaderParams;C3$jscomp$46.clearArray(d);d.push(a._GetFramebuffer());
d.push(b?b._GetFramebuffer():null)}DoBlitFramebuffer(){var a=this._mat4param,b=this._shaderParams;const d=this._gl;var c=a[0],e=a[1],h=a[2];const k=a[3],m=0!==a[4];a=0!==a[5];const p=b[1];d.bindFramebuffer(d.READ_FRAMEBUFFER,b[0]);d.bindFramebuffer(d.DRAW_FRAMEBUFFER,p);a?d.blitFramebuffer(0,0,c,e,0,0,h,k,d.COLOR_BUFFER_BIT,m?d.LINEAR:d.NEAREST):(b=Math.min(c,h),c=Math.min(e,k),h=Math.max(e-k,0),e=Math.max(k-e,0),d.blitFramebuffer(0,h,b,c+h,0,e,b,c+e,d.COLOR_BUFFER_BIT,d.NEAREST))}InitStartQuery(a){this._type=
18;this._texParam=a}DoStartQuery(){this._texParam.BeginTimeElapsed();this._texParam=null}InitEndQuery(a){this._type=19;this._texParam=a}DoEndQuery(){this._texParam.EndTimeElapsed();this._texParam=null}InitSetEllipseParams(a,b,d){this._type=20;const c=this._mat4param;c[0]=a;c[1]=b;c[2]=d}DoSetEllipseParams(){const a=this._batchState.currentShader,b=this._mat4param;a._uPixelSize.IsUsed()&amp;&amp;a._uPixelSize.Update2f(b[0],b[1]);a._uOutlineThickness.IsUsed()&amp;&amp;a._uOutlineThickness.Update1f(b[2])}InitSetTilemapInfo(a,
b,d,c,e,h,k){this._type=16;const m=this._mat4param;a.writeToTypedArray(m,0);m[4]=1/b;m[5]=1/d;m[6]=c/b;m[7]=e/d;m[8]=h/b;m[9]=k/d}DoSetTilemapInfo(){const a=this._batchState.currentShader,b=this._mat4param;a._uSrcStart.IsUsed()&amp;&amp;a._uSrcStart.Update2f(b[0],b[1]);a._uPixelSize.IsUsed()&amp;&amp;a._uPixelSize.Update2f(b[4],b[5]);a._uTileSize.IsUsed()&amp;&amp;a._uTileSize.Update2f(b[6],b[7]);a._uTileSpacing.IsUsed()&amp;&amp;a._uTileSpacing.Update2f(b[8],b[9])}InitClearDepth(a){this._type=22;this._startIndex=a?1:0}DoClearDepth(){const a=
this._gl,b=0!==this._startIndex;b||a.depthMask(!0);a.clear(a.DEPTH_BUFFER_BIT);b||a.depthMask(!1)}InitSetDepthEnabled(a){this._type=23;this._startIndex=a?1:0}DoSetDepthEnabled(){const a=this._gl;0===this._startIndex?(a.disable(a.DEPTH_TEST),a.depthMask(!1)):(a.enable(a.DEPTH_TEST),a.depthMask(!0))}InitSetDepthSamplingEnabled(a){this._type=24;this._startIndex=a?1:0}DoSetDepthSamplingEnabled(){const a=this._gl,b=this._batchState,d=b.renderer,c=0!==this._startIndex;b.isDepthSamplingEnabled=c;a.activeTexture(a.TEXTURE2);
c?(b.currentFramebufferNoDepth&amp;&amp;a.bindFramebuffer(a.FRAMEBUFFER,b.currentFramebufferNoDepth),a.bindTexture(a.TEXTURE_2D,d._GetDepthBuffer())):(a.bindTexture(a.TEXTURE_2D,null),b.currentFramebufferNoDepth&amp;&amp;a.bindFramebuffer(a.FRAMEBUFFER,b.currentFramebuffer));a.activeTexture(a.TEXTURE0)}InitCoplanarStartStencilPass(){this._type=25}DoCoplanarStartStencilPass(){const a=this._gl;a.clear(a.STENCIL_BUFFER_BIT);a.enable(a.STENCIL_TEST);a.stencilFunc(a.ALWAYS,1,1);a.stencilOp(a.KEEP,a.KEEP,a.REPLACE);a.colorMask(!1,
!1,!1,!1)}InitCoplanarStartColorPass(){this._type=26}DoCoplanarStartColorPass(){const a=this._gl;a.colorMask(!0,!0,!0,!0);a.stencilFunc(a.EQUAL,1,1);a.stencilOp(a.KEEP,a.KEEP,a.KEEP)}InitCoplanarRestore(){this._type=27}DoCoplanarRestore(){const a=this._gl;a.disable(a.STENCIL_TEST)}InitSetScissor(a,b,d,c,e){this._type=28;this._startIndex=a?1:0;a=this._mat4param;a[0]=b;a[1]=d;a[2]=c;a[3]=e}DoSetScissor(){const a=this._gl,b=this._mat4param;1===this._startIndex?(a.enable(a.SCISSOR_TEST),a.scissor(b[0],
b[1],b[2],b[3])):a.disable(a.SCISSOR_TEST)}Run(){switch(this._type){case 1:this.DoQuad();break;case 2:this.DoSetTexture();break;case 3:this.DoSetColor();break;case 4:this.DoSetBlend();break;case 5:this.DoSetViewport();break;case 6:this.DoSetProjection();break;case 7:this.DoSetModelView();break;case 8:this.DoSetRenderTarget();break;case 9:this.DoClearSurface();break;case 10:this.DoPoints();break;case 11:this.DoSetProgram();break;case 12:this.DoSetProgramParameters();break;case 13:this.DoSetProgramCustomParameters();
break;case 14:this.DoInvalidateFramebuffer();break;case 15:this.DoSetPointTextureCoords();break;case 16:this.DoSetTilemapInfo();break;case 17:this.DoBlitFramebuffer();break;case 18:this.DoStartQuery();break;case 19:this.DoEndQuery();break;case 20:this.DoSetEllipseParams();break;case 21:this.DoSetGradientColor();break;case 22:this.DoClearDepth();break;case 23:this.DoSetDepthEnabled();break;case 24:this.DoSetDepthSamplingEnabled();break;case 25:this.DoCoplanarStartStencilPass();break;case 26:this.DoCoplanarStartColorPass();
break;case 27:this.DoCoplanarRestore();break;case 28:this.DoSetScissor()}}};"use strict";
const C3$jscomp$47=self.C3,GENERIC_FONT_FAMILIES=new Set("serif sans-serif monospace cursive fantasy system-ui ui-serif ui-sans-serif ui-monospace ui-rounded math emoji fangsong".split(" ")),DEFAULT_OPTS={timeout:60},tempColor=new C3$jscomp$47.Color(0,0,0,1),VALID_HORIZ_ALIGNMENTS=new Set(["left","center","right"]),VALID_VERT_ALIGNMENTS=new Set(["top","center","bottom"]),VALID_WORD_WRAP_MODES=new Set(["word","character"]),allRendererTexts=new Set;
C3$jscomp$47.FontManager&amp;&amp;C3$jscomp$47.FontManager.addEventListener("fontload",a=&gt;{a=a.font.GetName();for(const b of allRendererTexts)(b.IsBBCodeEnabled()||C3$jscomp$47.equalsNoCase(b.GetFontName(),a))&amp;&amp;b._SetTextChanged()});function fillOrStrokeText(a,b,d,c,e,h){b?"Gecko"===C3$jscomp$47.Platform.BrowserEngine?a.strokeText(d,c,e,h):a.strokeText(d,c,e):"Gecko"===C3$jscomp$47.Platform.BrowserEngine?a.fillText(d,c,e,h):a.fillText(d,c,e)}
function fillOrStrokeRect(a,b,d,c,e,h){b?a.strokeRect(d,c,e,h):a.fillRect(d,c,e,h)}function ptToPx(a){return 4/3*a}let didCheckFoundBoundingBoxSupport=!1,supportsFontBoundingBoxMeasurements=!1;
C3$jscomp$47.Gfx.RendererText=class{constructor(a,b){b=Object.assign({},DEFAULT_OPTS,b);this._renderer=a;this._fontName="Arial";this._fontSize=16;this._fontSizeScale=1;this._lineHeight=0;this._isItalic=this._isBold=!1;this._colorStr="black";this._isBBcodeEnabled=!1;this.onloadfont=null;this._alreadyLoadedFonts=new Set;this._horizontalAlign="left";this._verticalAlign="top";this._text="";this._bbString=null;this._wrappedText=C3$jscomp$47.New(C3$jscomp$47.WordWrap);this._wrapMode="word";this._isUpdating=
this._textChanged=!1;this._isAsync=!0;this._drawMaxCharCount=-1;this._height=this._width=this._cssHeight=this._cssWidth=this._drawCharCount=0;this._zoom=1;this._changed=!1;this._measureContextTop=this._measureContext=this._textContext=this._textCanvas=null;this._lastCanvasHeight=this._lastCanvasWidth=-1;this._lastTextCanvasFillStyle=this._lastMeasureCanvasFont=this._lastTextCanvasFont="";this._lastTextCanvasLineWidth=this._lastTextCanvasOpacity=1;this._measureTextCallback=(d,c)=&gt;this._MeasureText(d,
c);this._texture=null;this._textureHeight=this._textureWidth=0;this._rcTex=new C3$jscomp$47.Rect;this._scaleFactor=1;this._needToRecreateTexture=!1;this._textureTimeout=new C3$jscomp$47.IdleTimeout(()=&gt;{this.ReleaseTexture();this._SetTextCanvasSize(8,8)},b.timeout);this.ontextureupdate=null;this._wasReleased=!1;allRendererTexts.add(this)}Release(){this.onloadfont=null;this._alreadyLoadedFonts.clear();this._measureTextCallback=this._measureContextTop=this._measureContext=this._textContext=this._textCanvas=
this._bbString=null;this._textureTimeout.Release();this.ontextureupdate=null;this.ReleaseTexture();this._wrappedText.Clear();this._renderer=this._wrappedText=null;this._wasReleased=!0;allRendererTexts.delete(this)}_SetChanged(){this._changed=!0}_SetTextChanged(){this._SetChanged();this._wrappedText.Clear();this._textChanged=!0}SetIsAsync(a){this._isAsync=!!a}IsAsync(){return this._isAsync}SetBBCodeEnabled(a){a=!!a;this._isBBcodeEnabled!==a&amp;&amp;(a=(this._isBBcodeEnabled=a)?"alphabetic":"top",this._textContext&amp;&amp;
(this._textContext.textBaseline=a),this._measureContext&amp;&amp;(this._measureContext.textBaseline=a),this._SetTextChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetFontName(a){a||(a="serif");this._fontName!==a&amp;&amp;(this._fontName=a,this._SetTextChanged())}GetFontName(){return this._fontName}SetFontSize(a){.1&gt;a&amp;&amp;(a=.1);this._fontSize!==a&amp;&amp;(this._fontSize=a,this._SetTextChanged())}SetFontSizeScale(a){this._fontSizeScale!==a&amp;&amp;(this._fontSizeScale=a,this._SetTextChanged())}SetLineHeight(a){this._lineHeight!==
a&amp;&amp;(this._lineHeight=a,this._SetChanged())}SetBold(a){a=!!a;this._isBold!==a&amp;&amp;(this._isBold=a,this._SetTextChanged())}SetItalic(a){a=!!a;this._isItalic!==a&amp;&amp;(this._isItalic=a,this._SetTextChanged())}SetDrawMaxCharacterCount(a){a=Math.floor(a);this._drawMaxCharCount!==a&amp;&amp;(this._drawMaxCharCount=a,this._SetChanged())}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(a,b){for(let d=a.length-1;0&lt;=d;--d){const c=a[d];if(c.tag===b)return c}return null}_HasStyleTag(a,b){return!!this._GetStyleTag(a,
b)}_GetFontString(a,b){let d=[];(this._isBold||this._HasStyleTag(b,"b"))&amp;&amp;d.push("bold");(this._isItalic||this._HasStyleTag(b,"i"))&amp;&amp;d.push("italic");var c=this._GetStyleTag(b,"size");c=(c?parseFloat(c.param):this._fontSize)*this._fontSizeScale;a?d.push(c+"pt"):d.push(c*this._scaleFactor*this._zoom*self.devicePixelRatio+"pt");a=this._fontName;(b=this._GetStyleTag(b,"font"))&amp;&amp;b.param&amp;&amp;(a=b.param,this.onloadfont&amp;&amp;!this._alreadyLoadedFonts.has(a)&amp;&amp;(this.onloadfont(a),this._alreadyLoadedFonts.add(a)));
a&amp;&amp;(GENERIC_FONT_FAMILIES.has(a)?d.push(a):d.push('"'+a+'"'));return d.join(" ")}SetColor(a){a instanceof C3$jscomp$47.Color&amp;&amp;(a=a.getCssRgb());this._colorStr!==a&amp;&amp;(this._colorStr=a,this._SetChanged())}SetColorRgb(a,b,d){tempColor.setRgb(a,b,d);this.SetColor(tempColor)}SetHorizontalAlignment(a){if(!VALID_HORIZ_ALIGNMENTS.has(a))throw Error("invalid horizontal alignment");this._horizontalAlign!==a&amp;&amp;(this._horizontalAlign=a,this._SetChanged())}SetVerticalAlignment(a){if(!VALID_VERT_ALIGNMENTS.has(a))throw Error("invalid vertical alignment");
this._verticalAlign!==a&amp;&amp;(this._verticalAlign=a,this._SetChanged())}SetWordWrapMode(a){if(!VALID_WORD_WRAP_MODES.has(a))throw Error("invalid word wrap mode");this._wrapMode!==a&amp;&amp;(this._wrapMode=a,this._SetTextChanged())}SetText(a){this._text!==a&amp;&amp;(this._text=a,this._SetTextChanged())}SetSize(a,b,d){"undefined"===typeof d&amp;&amp;(d=1);if(!(0&gt;=a||0&gt;=a||this._cssWidth===a&amp;&amp;this._cssHeight===b&amp;&amp;this._zoom===d)){1===this._zoom!==(1===d)&amp;&amp;(this._needToRecreateTexture=!0);var c=this._cssWidth,e=this._zoom;this._cssWidth=
a;this._cssHeight=b;this._zoom=d;a=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*a;this._height=this._cssHeight*this._zoom*a;a=Math.max(this._width,this._height);b=Math.min(this._renderer.GetMaxTextureSize(),4096);d=1;a&gt;b&amp;&amp;(d=b/a,this._width=Math.min(this._width*d,b),this._height=Math.min(this._height*d,b));this._scaleFactor=d;0&lt;this._textureWidth&amp;&amp;0&lt;this._textureHeight&amp;&amp;this._zoom===e&amp;&amp;this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight);this._cssWidth!==
c?this._SetTextChanged():this._SetChanged()}}GetWidth(){return this._width}GetHeight(){return this._height}GetTextWidth(){this._MaybeWrapText();return this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();return this._wrappedText.GetTotalLineHeight()+this._wrappedText.GetLineCount()*(this._lineHeight+4)-this._lineHeight}GetTexture(){this._textureTimeout.Reset();this._MaybeUpdate();return this._texture}_MaybeUpdate(){this._texture&amp;&amp;!this._changed&amp;&amp;!this._textChanged||this._isUpdating||
0&gt;=this._width||0&gt;=this._height||(this._changed=!1,this._isUpdating=!0,this._isAsync?C3$jscomp$47.Asyncify(()=&gt;this._DoUpdate()):this._DoUpdate())}_DoUpdate(){this._wasReleased||(this._SetTextCanvasSize(Math.ceil(this._width),Math.ceil(this._height)),this._MaybeWrapText(),this._DrawTextToCanvas(),this._UpdateTexture(),this._textureTimeout.Reset(),this._isUpdating=!1)}_SetTextCanvasSize(a,b){this._textCanvas||(this._textCanvas=C3$jscomp$47.CreateCanvas(16,16));let d=!1;if(this._lastCanvasWidth!==a||
this._lastCanvasHeight!==b)this._lastCanvasWidth=a,this._lastCanvasHeight=b,this._textCanvas.width=a,this._textCanvas.height=b,d=!0;this._textContext||(this._textContext=this._textCanvas.getContext("2d"),d=!0);d?(this._textContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top",this._textContext.font=this._lastTextCanvasFont,this._textContext.fillStyle=this._lastTextCanvasFillStyle,this._textContext.strokeStyle=this._lastTextCanvasFillStyle,this._textContext.globalAlpha=this._lastTextCanvasOpacity,
this._textContext.lineWidth=this._lastTextCanvasLineWidth):this._textContext.clearRect(0,0,a,b)}_MaybeCreateMeasureContext(){this._measureContext||(this._measureContext=C3$jscomp$47.CreateCanvas(16,16).getContext("2d"),this._measureContextTop=C3$jscomp$47.CreateCanvas(16,16).getContext("2d"),this._measureContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top",this._measureContextTop.textBaseline="top")}_SetMeasureFontString(a){this._lastMeasureCanvasFont!==a&amp;&amp;(this._lastMeasureCanvasFont=a,
this._measureContext.font=a,this._measureContextTop.font=a)}_SupportsFontBoundingBoxMeasurements(){if(!didCheckFoundBoundingBoxSupport){didCheckFoundBoundingBoxSupport=!0;this._MaybeCreateMeasureContext();const a=this._measureContext.measureText("test");supportsFontBoundingBoxMeasurements="number"===typeof a.fontBoundingBoxAscent&amp;&amp;"number"===typeof a.fontBoundingBoxDescent}return supportsFontBoundingBoxMeasurements}_MaybeWrapText(){this._textChanged&amp;&amp;(this._MaybeCreateMeasureContext(),!this._isBBcodeEnabled||
this._bbString&amp;&amp;this._bbString.toString()===this._text||(this._bbString=new C3$jscomp$47.BBString(this._text,{noEscape:!0})),this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,0),this._textChanged=!1)}_MeasureText(a,b){a=a.join("");this._SetMeasureFontString(this._GetFontString(!0,b));b=this._GetStyleTag(b,"size");b=(b?parseFloat(b.param):this._fontSize)*this._fontSizeScale;const d=this._measureContext.measureText(a);
let c=0;this._isBBcodeEnabled&amp;&amp;this._SupportsFontBoundingBoxMeasurements()&amp;&amp;(a=this._measureContextTop.measureText(a),c=d.fontBoundingBoxAscent-a.fontBoundingBoxAscent);return{width:d.width,height:ptToPx(b),fontBoundingBoxAscent:d.fontBoundingBoxAscent||0,fontBoundingBoxDescent:d.fontBoundingBoxDescent||0,topToAlphabeticDistance:c}}_SetDrawFontString(a){this._lastTextCanvasFont!==a&amp;&amp;(this._lastTextCanvasFont=a,this._textContext.font=a)}_SetDrawCanvasColor(a){this._lastTextCanvasFillStyle!==a&amp;&amp;(this._lastTextCanvasFillStyle=
a,this._textContext.fillStyle=a,this._textContext.strokeStyle=a)}_SetDrawCanvasOpacity(a){this._lastTextCanvasOpacity!==a&amp;&amp;(this._lastTextCanvasOpacity=a,this._textContext.globalAlpha=a)}_SetDrawCanvasLineWith(a){this._lastTextCanvasLineWidth!==a&amp;&amp;(this._lastTextCanvasLineWidth=a,this._textContext.lineWidth=a)}_DrawTextToCanvas(){this._drawCharCount=0;const a=this._scaleFactor*this._zoom*self.devicePixelRatio,b=(4+this._lineHeight)*a;var d=0;const c=this._wrappedText.GetLines();if(0!==c.length){var e=
this._isBBcodeEnabled&amp;&amp;this._SupportsFontBoundingBoxMeasurements(),h=c[0].height*a;"center"===this._verticalAlign?(d=c.reduce((k,m)=&gt;k+m.height*a+b,0)-b,d=Math.max(this._height/2-d/2,0),e&amp;&amp;(h=c[0].topToAlphabeticDistance*a)):"bottom"===this._verticalAlign&amp;&amp;(d=c.reduce((k,m)=&gt;k+m.height*a+b,0)-this._lineHeight*a,e=e?c.at(-1).fontBoundingBoxDescent*a:0,d=this._height-d-e-2);for(let k=0,m=c.length;k&lt;m;++k){e=c[k];const p=e.height*a,q=d;if(this._isBBcodeEnabled){if(d+=0===k?h:p,0&lt;k&amp;&amp;d&gt;this._height-4*
a)break}else if(0&lt;k&amp;&amp;d&gt;=this._height-p)break;0&lt;=q&amp;&amp;this._DrawTextLine(e,d,a);this._isBBcodeEnabled||(d+=p);d+=b}}}_DrawTextLine(a,b,d){let c=0;"center"===this._horizontalAlign?c=(this._width-a.width*d)/2:"right"===this._horizontalAlign&amp;&amp;(c=this._width-a.width*d);for(const e of a.fragments)this._DrawTextFragment(e,c,b,d,a.height),c+=e.width*d}_DrawTextFragment(a,b,d,c,e){const h=this._textContext,k=e/16;e=a.width*c;const m=a.height*c,p=a.height/16;var q=(4+this._lineHeight)*c,v=a.styles,x=a.chArr;
if(-1!==this._drawMaxCharCount){if(this._drawCharCount&gt;=this._drawMaxCharCount)return;this._drawCharCount+x.length&gt;this._drawMaxCharCount&amp;&amp;(x=x.slice(0,this._drawMaxCharCount-this._drawCharCount),e=this._MeasureText(x,v).width*c);this._drawCharCount+=x.length}var A=this._GetStyleTag(v,"background");a=this._HasStyleTag(v,"u");const C=this._HasStyleTag(v,"s");if((!C3$jscomp$47.IsCharArrayAllWhitespace(x)||A||a||C)&amp;&amp;!this._HasStyleTag(v,"hide")){x=x.join("");var D=this._GetStyleTag(v,"offsetx");b+=D?
parseFloat(D.param)*c:0;D=this._GetStyleTag(v,"offsety");d+=D?parseFloat(D.param)*c:0;A&amp;&amp;(this._SetDrawCanvasColor(A.param),h.fillRect(b,d-m,e,m+q));q=this._GetStyleTag(v,"color");this._SetDrawCanvasColor(q?q.param:this._colorStr);A=this._GetStyleTag(v,"opacity");this._SetDrawCanvasOpacity(A?parseFloat(A.param)/100:1);A=(A=this._GetStyleTag(v,"linethickness"))?parseFloat(A.param):1;(D=this._HasStyleTag(v,"stroke"))&amp;&amp;this._SetDrawCanvasLineWith(.5*p*A*this._scaleFactor*this._zoom*self.devicePixelRatio);
this._SetDrawFontString(this._GetFontString(!1,v));fillOrStrokeText(h,D,x,b,d,e);!D&amp;&amp;(this._SetDrawCanvasLineWith(.5*p*A*this._scaleFactor*this._zoom*self.devicePixelRatio),v=this._GetStyleTag(v,"outline"))&amp;&amp;(this._SetDrawCanvasColor(v.param),fillOrStrokeText(h,!0,x,b,d,e));this._SetDrawCanvasColor(q?q.param:this._colorStr);a&amp;&amp;fillOrStrokeRect(h,D,b,d+c*k,e,c*k*A);C&amp;&amp;(c*=p,h.fillRect(b,d-m/4+c/2-c*A/2,e,c*A))}}_UpdateTexture(){if(!this._renderer.IsContextLost()&amp;&amp;(this._textureWidth=Math.ceil(this._width),
this._textureHeight=Math.ceil(this._height),this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight),this._needToRecreateTexture&amp;&amp;(this.ReleaseTexture(),this._needToRecreateTexture=!1),this._texture||(this._texture=this._renderer.CreateDynamicTexture(this._textureWidth,this._textureHeight,{mipMap:1===this._zoom,mipMapQuality:"high"})),this._renderer.UpdateTexture(this._textCanvas,this._texture),this.ontextureupdate))this.ontextureupdate()}GetTexRect(){return this._rcTex}ReleaseTexture(){this._texture&amp;&amp;
(this._renderer.IsContextLost()||this._renderer.DeleteTexture(this._texture),this._texture=null)}static OnContextLost(){for(const a of allRendererTexts)a.ReleaseTexture()}static GetAll(){return allRendererTexts.values()}};"use strict";const C3$jscomp$48=self.C3;
class WebGLRealTimeElapsedQuery{constructor(a){this._gl=a.GetContext();this._version=a.GetWebGLVersionNumber();this._timerExt=a._GetDisjointTimerQueryExtension();this._query=null;this._hasResult=this._isActive=!1;this._result=0;this._query=1===this._version?this._timerExt.createQueryEXT():this._gl.createQuery()}Release(){this._DeleteQueryObject();this._timerExt=this._gl=null;this._hasResult=!1}_DeleteQueryObject(){this._query&amp;&amp;(1===this._version?this._timerExt.deleteQueryEXT(this._query):this._gl.deleteQuery(this._query),
this._query=null)}BeginTimeElapsed(){if(this._isActive)throw Error("query already active");1===this._version?this._timerExt.beginQueryEXT(this._timerExt.TIME_ELAPSED_EXT,this._query):this._gl.beginQuery(this._timerExt.TIME_ELAPSED_EXT,this._query);this._isActive=!0}EndTimeElapsed(){if(!this._isActive)throw Error("query not active");1===this._version?this._timerExt.endQueryEXT(this._timerExt.TIME_ELAPSED_EXT):this._gl.endQuery(this._timerExt.TIME_ELAPSED_EXT);this._isActive=!1}CheckForResult(){if(this._query&amp;&amp;
!this._hasResult&amp;&amp;!this._isActive){var a=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_AVAILABLE_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT_AVAILABLE);var b=this._gl.getParameter(this._timerExt.GPU_DISJOINT_EXT);a&amp;&amp;!b&amp;&amp;(this._result=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT),this._result/=1E9,this._hasResult=!0);(a||
b)&amp;&amp;this._DeleteQueryObject()}}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw Error("no result available");return this._result}}
C3$jscomp$48.Gfx.WebGLTimeElapsedQuery=class{constructor(a){this._renderer=a;this._frameNumber=a.GetFrameNumber();this._isActive=!1;this._parentQuery=null;this._isNested=!1;this._realQuery=null;this._queries=[]}Release(){for(const a of this._queries)a instanceof WebGLRealTimeElapsedQuery&amp;&amp;a.Release();C3$jscomp$48.clearArray(this._queries);this._renderer=this._realQuery=this._parentQuery=null}BeginTimeElapsed(){if(this._isActive)throw Error("query already active");const a=this._renderer._GetTimeQueryStack();
0&lt;a.length?(this._isNested=!0,this._parentQuery=a.at(-1),this._parentQuery._EndReal(),this._parentQuery._queries.push(this)):(this._isNested=!1,this._parentQuery=null);this._isActive=!0;a.push(this);this._StartReal()}EndTimeElapsed(){if(!this._isActive)throw Error("query not active");if(this._renderer._GetTimeQueryStack().pop()!==this)throw Error("can only end most nested query");this._isActive=!1;this._EndReal();this._parentQuery&amp;&amp;(this._parentQuery._StartReal(),this._parentQuery=null)}_StartReal(){this._realQuery=
C3$jscomp$48.New(WebGLRealTimeElapsedQuery,this._renderer);this._queries.push(this._realQuery);this._realQuery.BeginTimeElapsed()}_EndReal(){this._realQuery.EndTimeElapsed();this._realQuery=null}CheckForResult(){for(const a of this._queries)a.CheckForResult()}IsNested(){return this._isNested}HasResult(){return this._queries.every(a=&gt;a.HasResult())}GetResult(){return this._queries.reduce((a,b)=&gt;a+b.GetResult(),0)}GetFrameNumber(){return this._frameNumber}};"use strict";const C3$jscomp$49=self.C3;
C3$jscomp$49.Gfx.WebGLQueryResultBuffer=class{constructor(a,b=1E3){this._renderer=a;this._maxQueries=b;this._buffer=[];this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear();this._renderer._RemoveQueryResultBuffer(this);this._renderer=null}Clear(){for(const a of this._buffer)a.Release();C3$jscomp$49.clearArray(this._buffer)}AddTimeElapsedQuery(){const a=new C3$jscomp$49.Gfx.WebGLTimeElapsedQuery(this._renderer);this._buffer.push(a);this._buffer.length&gt;this._maxQueries&amp;&amp;this._buffer.shift().Release();
return a}CheckForResults(a){for(const b of this._buffer){if(b.GetFrameNumber()&gt;=a)break;if(b.IsNested())break;b.CheckForResult()}}GetFrameRangeResultSum(a,b){if(b&lt;=a)return NaN;let d=0;for(const c of this._buffer){if(c.GetFrameNumber()&gt;=b)break;if(!(c.GetFrameNumber()&lt;a))if(c.HasResult())d+=c.GetResult();else return NaN}return d}DeleteAllBeforeFrameNumber(a){for(let b=0,d=this._buffer.length;b&lt;d;++b){const c=this._buffer[b];if(c.GetFrameNumber()&lt;a)c.Release();else{0&lt;b&amp;&amp;this._buffer.splice(0,b);break}}}};
"use strict";
const C3$jscomp$50=self.C3,glMatrix$jscomp$6=self.glMatrix,vec4$jscomp$4=glMatrix$jscomp$6.vec4,mat4$jscomp$7=glMatrix$jscomp$6.mat4,DEFAULT_WEBGLRENDERER_OPTS={powerPreference:"default",enableGpuProfiling:!0,alpha:!1,lowLatency:!1,depth:!1,canSampleDepth:!1,maxWebGLVersion:2,failIfMajorPerformanceCaveat:!1},VALID_POWER_PREFERENCES=new Set(["default","low-power","high-performance"]),MAX_INDICES=12E3,LAST_POINT=7996,defaultTexCoordsQuad$jscomp$1=new C3$jscomp$50.Quad(0,0,1,0,1,1,0,1),tmpProjection=
mat4$jscomp$7.create(),tmpModelView=mat4$jscomp$7.create(),tmpQuad$jscomp$1=new C3$jscomp$50.Quad,tmpRect$jscomp$1=new C3$jscomp$50.Rect;let loseContextExtension=null;C3$jscomp$50.isDebug&amp;&amp;(self.debug_lose_context=function(){loseContextExtension?loseContextExtension.loseContext():console.warn("WEBGL_lose_context not supported")},self.debug_restore_context=function(){loseContextExtension?loseContextExtension.restoreContext():console.warn("WEBGL_lose_context not supported")});const pendingPolls=new Set;
let pollRafId=-1;function CheckPendingPolls(){pollRafId=-1;for(const a of pendingPolls)a.checkFunc()&amp;&amp;(a.resolve(),pendingPolls.delete(a));0&lt;pendingPolls.size&amp;&amp;(pollRafId=self.requestAnimationFrame(CheckPendingPolls))}
C3$jscomp$50.Gfx.WebGLRenderer=class extends C3$jscomp$50.Gfx.RendererBase{constructor(a,b){super();b=Object.assign({},DEFAULT_WEBGLRENDERER_OPTS,b);if(!VALID_POWER_PREFERENCES.has(b.powerPreference))throw Error("invalid power preference");const d={alpha:!!b.alpha,depth:!1,antialias:!1,powerPreference:b.powerPreference,failIfMajorPerformanceCaveat:!!b.failIfMajorPerformanceCaveat};b.lowLatency&amp;&amp;(d.desynchronized=!0,d.preserveDrawingBuffer=!0);let c=null,e=0;2&lt;=b.maxWebGLVersion&amp;&amp;(c=a.getContext("webgl2",
d),e=2);c||(c=a.getContext("webgl",d),e=1);if(!c)throw Error("failed to initialise WebGL context");this._gl=c;this._attribs=c.getContextAttributes();b.lowLatency&amp;&amp;!this._attribs.desynchronized&amp;&amp;console.info("[WebGLRenderer] Low-latency mode specified but is not supported here");this._versionString=c.getParameter(c.VERSION);this._version=e;this._viewport=vec4$jscomp$4.create();this._didChangeTransform=!1;this._bbProjectionMatrix=mat4$jscomp$7.create();this._usesDepthBuffer=!!b.depth;this._canSampleDepth=
!(!b.depth||!b.canSampleDepth);this._isDepthEnabled=this._usesDepthBuffer;this._isDepthSamplingEnabled=!1;this._depthBuffer=null;this._isAutoSizeDepthBuffer=!0;this._depthBufferHeight=this._depthBufferWidth=0;this._pointBuffer=this._indexBuffer=this._texcoordBuffer=this._vertexBuffer=null;this._vertexData=new Float32Array(8E3*this.GetNumVertexComponents());this._indexData=new Uint16Array(MAX_INDICES);this._texcoordData=new Float32Array(16E3);this._pointData=new Float32Array(32E3);this._lastVertexPtr=
this._pointPtr=this._texPtr=this._vertexPtr=0;this._spDeviceTransformTextureFill=this._lastProgram=null;this._batch=[];this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=null;this._lastPointZ=0;this._batchState=C3$jscomp$50.New(C3$jscomp$50.Gfx.BatchState,this);this._lastColor=C3$jscomp$50.New(C3$jscomp$50.Color,1,1,1,1);this._lastTexture1=this._lastTexture0=null;this._lastDestBlend=this._lastSrcBlend=0;this._lastPointTexCoords=new C3$jscomp$50.Rect;this._lastScissorRect=C3$jscomp$50.New(C3$jscomp$50.Rect,
0,0,-1,-1);this._maxTextureSize=-1;this._highpPrecision=this._maxPointSize=this._minPointSize=0;this._unmaskedRenderer=this._unmaskedVendor="(unavailable)";this._extensions=[];this._isInitialisingAfterContextRestored=!1;this._fragDepthExt=this._depthTextureExt=this._anisotropicExt=this._parallelShaderCompileExt=null;this._maxAnisotropy=0;this._isGpuProfilingEnabled=!!b.enableGpuProfiling;this._timerExt=null;this._allQueryResultBuffers=new Set;this._timeQueryStack=[];this.FillIndexBufferData(this._indexData)}IsWebGL(){return!0}async InitState(){super.InitState();
var a=this._gl,b=this.GetNumVertexComponents();this._lastColor.setRgba(1,1,1,1);this._lastTexture1=this._lastTexture0=null;this._pointPtr=this._vertexPtr=0;this._lastVertexPtr=8E3*b-4*b;C3$jscomp$50.clearArray(this._batch);this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=this._lastProgram=null;this._lastPointTexCoords.set(0,0,1,1);this._lastPointZ=0;b=this._batchState;b.currentShader=null;b.currentFramebuffer=null;b.currentFramebufferNoDepth=null;vec4$jscomp$4.set(b.currentColor,1,1,1,
1);b.clearColor.setRgba(0,0,0,0);b.pointTexCoords.set(0,0,1,1);a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.BLEND);a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA);this._lastSrcBlend=a.ONE;this._lastDestBlend=a.ONE_MINUS_SRC_ALPHA;this._InitBlendModes(a);a.disable(a.CULL_FACE);a.disable(a.STENCIL_TEST);a.disable(a.DITHER);this._usesDepthBuffer?(a.enable(a.DEPTH_TEST),a.depthMask(!0),a.depthFunc(a.LEQUAL)):(a.disable(a.DEPTH_TEST),a.depthMask(!1));this._isDepthEnabled=this._usesDepthBuffer;
this._isDepthSamplingEnabled=!1;this._pointBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this._pointBuffer);a.bufferData(a.ARRAY_BUFFER,this._pointData.byteLength,a.DYNAMIC_DRAW);this._vertexBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this._vertexBuffer);a.bufferData(a.ARRAY_BUFFER,this._vertexData.byteLength,a.DYNAMIC_DRAW);this._texcoordBuffer=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this._texcoordBuffer);a.bufferData(a.ARRAY_BUFFER,this._texcoordData.byteLength,a.DYNAMIC_DRAW);
this._indexBuffer=a.createBuffer();a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indexBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indexData,a.STATIC_DRAW);a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,null);this._maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE);b=a.getParameter(a.ALIASED_POINT_SIZE_RANGE);this._minPointSize=b[0];this._maxPointSize=b[1];b=a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT);var d=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);this._highpPrecision=
b&amp;&amp;d?Math.min(b.precision,d.precision):0;2048&lt;this._maxPointSize&amp;&amp;(this._maxPointSize=2048);this._extensions=a.getSupportedExtensions();if(b=a.getExtension("WEBGL_debug_renderer_info"))this._unmaskedVendor=a.getParameter(b.UNMASKED_VENDOR_WEBGL),this._unmaskedRenderer=a.getParameter(b.UNMASKED_RENDERER_WEBGL);this._parallelShaderCompileExt=a.getExtension("KHR_parallel_shader_compile");C3$jscomp$50.isDebug&amp;&amp;(loseContextExtension=a.getExtension("WEBGL_lose_context"));if(this._isGpuProfilingEnabled)if(1===
this.GetWebGLVersionNumber()){if("Chromium"!==C3$jscomp$50.Platform.BrowserEngine||81&lt;=C3$jscomp$50.Platform.BrowserVersionNumber||"undefined"!==typeof document)this._timerExt=a.getExtension("EXT_disjoint_timer_query")}else this._timerExt=a.getExtension("EXT_disjoint_timer_query_webgl2")||a.getExtension("EXT_disjoint_timer_query");this._maxAnisotropy=(this._anisotropicExt=a.getExtension("EXT_texture_filter_anisotropic"))?a.getParameter(this._anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0;if(2&gt;this.GetWebGLVersionNumber()&amp;&amp;
this._usesDepthBuffer&amp;&amp;this._canSampleDepth&amp;&amp;(this._depthTextureExt=a.getExtension("WEBGL_depth_texture"),!this._depthTextureExt))throw Error("no depth texture support");2&gt;this.GetWebGLVersionNumber()&amp;&amp;(this._fragDepthExt=a.getExtension("EXT_frag_depth"));a=C3$jscomp$50.Gfx.WebGLShaderProgram;b=a.GetDefaultVertexShaderSource(!1);d=a.GetTextureFillFragmentShaderSource_WebGL1_NoFragDepth();let c=b,e=a.GetPointFragmentShaderSource_WebGL1_NoFragDepth(),h=a.GetPointVertexShaderSource_WebGL1(),k=a.GetTilemapFragmentShaderSource_WebGL1_NoFragDepth(),
m=a.GetDefaultVertexShaderSource(!0);this._usesDepthBuffer&amp;&amp;("Safari"!==C3$jscomp$50.Platform.Browser||15.5&lt;=C3$jscomp$50.Platform.BrowserVersionNumber)&amp;&amp;(2&gt;this.GetWebGLVersionNumber()?this._fragDepthExt&amp;&amp;(d=a.GetTextureFillFragmentShaderSource_WebGL1_FragDepthEXT(),e=a.GetPointFragmentShaderSource_WebGL1_FragDepthEXT(),k=a.GetTilemapFragmentShaderSource_WebGL1_FragDepthEXT()):(c=a.GetDefaultVertexShaderSource_WebGL2(),d=a.GetTextureFillFragmentShaderSource_WebGL2(),e=a.GetPointFragmentShaderSource_WebGL2(),
h=a.GetPointVertexShaderSource_WebGL2(),k=a.GetTilemapFragmentShaderSource_WebGL2(),m=a.GetDefaultVertexShaderSource_WebGL2(!0)));a=[[d,c,"&lt;default&gt;"],[d,c,"&lt;default-device-transform&gt;"],[e,h,"&lt;point&gt;"],[a.GetColorFillFragmentShaderSource(),b,"&lt;fill&gt;"],[a.GetLinearGradientFillFragmentShaderSource(),b,"&lt;lineargradient&gt;"],[a.GetPenumbraFillFragmentShaderSource(),b,"&lt;penumbra&gt;"],[a.GetHardEllipseFillFragmentShaderSource(),b,"&lt;hardellipse&gt;"],[a.GetHardEllipseOutlineFragmentShaderSource(),b,"&lt;hardellipseoutline&gt;"],
[a.GetSmoothEllipseFillFragmentShaderSource(),b,"&lt;smoothellipse&gt;"],[a.GetSmoothEllipseOutlineFragmentShaderSource(),b,"&lt;smoothellipseoutline&gt;"],[a.GetSmoothLineFillFragmentShaderSource(),b,"&lt;smoothline&gt;"],[k,m,"&lt;tilemap&gt;"]];a=await Promise.all(a.map(p=&gt;this.CreateShaderProgram({src:p[0]},p[1],p[2])));this._spTextureFill=a[0];this._spDeviceTransformTextureFill=a[1];this._spPoints=a[2];this._spColorFill=a[3];this._spLinearGradientFill=a[4];this._spPenumbraFill=a[5];this._spHardEllipseFill=a[6];this._spHardEllipseOutline=
a[7];this._spSmoothEllipseFill=a[8];this._spSmoothEllipseOutline=a[9];this._spSmoothLineFill=a[10];this._spTilemapFill=a[11];this.SetTextureFillMode()}async CreateShaderProgram(a,b,d){a=await C3$jscomp$50.Gfx.WebGLShaderProgram.Create(this,a,b,d);this._AddShaderProgram(a);return a}ResetLastProgram(){this._lastProgram=null}SetSize(a,b,d){if(this._width!==a||this._height!==b||d){this.EndBatch();d=this._gl;var c=this._batchState;this._width=a;this._height=b;this._SetViewport(0,0,a,b);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix,
a/b);this.SetProjectionMatrix(this._bbProjectionMatrix);this._spDeviceTransformTextureFill&amp;&amp;(d.useProgram(this._spDeviceTransformTextureFill.GetShaderProgram()),this._spDeviceTransformTextureFill._UpdateDeviceTransformUniforms(this._matP),this._lastProgram=this._spDeviceTransformTextureFill,this._batchState.currentShader=this._spDeviceTransformTextureFill);d.bindTexture(d.TEXTURE_2D,null);d.activeTexture(d.TEXTURE1);d.bindTexture(d.TEXTURE_2D,null);d.activeTexture(d.TEXTURE0);this._lastTexture1=this._lastTexture0=
null;this._usesDepthBuffer&amp;&amp;this._isAutoSizeDepthBuffer&amp;&amp;this._SetDepthBufferSize(this._width,this._height);this._currentRenderTarget&amp;&amp;this._currentRenderTarget._Resize(this._width,this._height);d.bindFramebuffer(d.FRAMEBUFFER,null);this._currentRenderTarget=null;c.currentFramebuffer=null;c.currentFramebufferNoDepth=null}}_SetDepthBufferSize(a,b){const d=this._gl;this._depthBuffer&amp;&amp;this._depthBufferWidth===a&amp;&amp;this._depthBufferHeight===b||(this._canSampleDepth?(this._depthBuffer&amp;&amp;d.deleteTexture(this._depthBuffer),
this._depthBuffer=d.createTexture(),d.bindTexture(d.TEXTURE_2D,this._depthBuffer),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),2&lt;=this.GetWebGLVersionNumber()?d.texImage2D(d.TEXTURE_2D,0,d.DEPTH24_STENCIL8,a,b,0,d.DEPTH_STENCIL,d.UNSIGNED_INT_24_8,null):this._depthTextureExt&amp;&amp;d.texImage2D(d.TEXTURE_2D,
0,d.DEPTH_STENCIL,a,b,0,d.DEPTH_STENCIL,this._depthTextureExt.UNSIGNED_INT_24_8_WEBGL,null),d.bindTexture(d.TEXTURE_2D,null)):(this._depthBuffer&amp;&amp;d.deleteRenderbuffer(this._depthBuffer),this._depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,this._depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,2&lt;=this._version?d.DEPTH24_STENCIL8:d.DEPTH_STENCIL,a,b),d.bindRenderbuffer(d.RENDERBUFFER,null)),this._depthBufferWidth=a,this._depthBufferHeight=b)}SetFixedSizeDepthBuffer(a,b){this._usesDepthBuffer&amp;&amp;
(this._isAutoSizeDepthBuffer=!1,this._SetDepthBufferSize(a,b))}SetAutoSizeDepthBuffer(){this._usesDepthBuffer&amp;&amp;(this._isAutoSizeDepthBuffer=!0,this._SetDepthBufferSize(this._width,this._height))}_SetViewport(a,b,d,c){const e=this._viewport;if(e[0]!==a||e[1]!==b||e[2]!==d||e[3]!==c)this.PushBatch().InitSetViewport(a,b,d,c),vec4$jscomp$4.set(e,a,b,d,c),this._topOfBatch=0}SetFovY(a){super.SetFovY(a);this.CalculatePerspectiveMatrix(this._bbProjectionMatrix,this._width/this._height)}SetProjectionMatrix(a){mat4$jscomp$7.exactEquals(this._matP,
a)||(this.PushBatch().InitSetProjection(a),mat4$jscomp$7.copy(this._matP,a),this._topOfBatch=0,this._didChangeTransform=!0)}SetDefaultRenderTargetProjectionState(){let a,b;var d=this._currentRenderTarget;null===d?(a=this._bbProjectionMatrix,b=this.GetWidth(),d=this.GetHeight()):(a=d.GetProjectionMatrix(),b=d.GetWidth(),d=d.GetHeight());this.SetProjectionMatrix(a);this._SetViewport(0,0,b,d)}SetModelViewMatrix(a){mat4$jscomp$7.exactEquals(this._matMV,a)||(this.PushBatch().InitSetModelView(a),mat4$jscomp$7.copy(this._matMV,
a),this._topOfBatch=0,this._didChangeTransform=!0)}ResetDidChangeTransformFlag(){this._didChangeTransform=!1}DidChangeTransform(){return this._didChangeTransform}GetBatchState(){return this._batchState}PushBatch(){const a=this._batch;this._batchPtr===a.length&amp;&amp;a.push(new C3$jscomp$50.Gfx.WebGLBatchJob(this._batchState));return a[this._batchPtr++]}EndBatch(){0===this._batchPtr||this.IsContextLost()||(this._WriteBuffers(),this._ExecuteBatch(),this._topOfBatch=this._pointPtr=this._texPtr=this._vertexPtr=
this._batchPtr=0)}_WriteBuffers(){const a=this._gl;0&lt;this._pointPtr&amp;&amp;(a.bindBuffer(a.ARRAY_BUFFER,this._pointBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._pointData.subarray(0,this._pointPtr)));0&lt;this._vertexPtr&amp;&amp;(a.bindBuffer(a.ARRAY_BUFFER,this._vertexBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._vertexData.subarray(0,this._vertexPtr)),a.bindBuffer(a.ARRAY_BUFFER,this._texcoordBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this._texcoordData.subarray(0,this._texPtr)))}_ExecuteBatch(){const a=this._batch;
for(let b=0,d=this._batchPtr;b&lt;d;++b)a[b].Run()}GetOpacity(){return this._lastColor.getA()}SetColorRgba(a,b,d,c){const e=this._lastColor;e.equalsRgba(a,b,d,c)||(e.setRgba(a,b,d,c),this.PushBatch().InitSetColor(e),this._topOfBatch=0,this._currentStateGroup=null)}SetOpacity(a){const b=this._lastColor;b.getA()!==a&amp;&amp;(b.setA(a),this.PushBatch().InitSetColor(b),this._topOfBatch=0,this._currentStateGroup=null)}SetColor(a){const b=this._lastColor;b.equals(a)||(b.set(a),this.PushBatch().InitSetColor(b),this._topOfBatch=
0,this._currentStateGroup=null)}ResetColor(){this.SetColorRgba(1,1,1,1)}GetColor(){return this._lastColor}SetTexture(a){a!==this._lastTexture0&amp;&amp;(this.PushBatch().InitSetTexture(a),this._lastTexture0=a,this._topOfBatch=0)}_ResetLastTexture(){this._lastTexture0=null}SetBlendMode(a){a=this._GetBlendByIndex(a);this._SetBlend(a[0],a[1])}SetNamedBlendMode(a){a=this.GetNamedBlend(a);this._SetBlend(a.srcBlend,a.destBlend)}_SetBlend(a,b){if(a!==this._lastSrcBlend||b!==this._lastDestBlend)this.PushBatch().InitSetBlend(a,
b),this._lastSrcBlend=a,this._lastDestBlend=b,this._topOfBatch=0,this._currentStateGroup=null}IsPremultipliedAlphaBlend(){return this._lastSrcBlend===this._gl.ONE&amp;&amp;this._lastDestBlend===this._gl.ONE_MINUS_SRC_ALPHA}SetAlphaBlend(){this._SetBlend(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA)}SetNoPremultiplyAlphaBlend(){this._SetBlend(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA)}SetCopyBlend(){this._SetBlend(this._gl.ONE,this._gl.ZERO)}Rect(a){this.Rect2(a.getLeft(),a.getTop(),a.getRight(),a.getBottom())}Rect2(a,
b,d,c){this.Quad2(a,b,d,b,d,c,a,c)}_ExtendQuadBatch(){let a=this._vertexPtr;a&gt;=this._lastVertexPtr&amp;&amp;(this.EndBatch(),a=0);1===this._topOfBatch?this._batch[this._batchPtr-1]._indexCount+=6:(this.PushBatch().InitQuad(a,6),this._topOfBatch=1)}_WriteQuadToVertexBuffer(a){a.writeToTypedArray3D(this._vertexData,this._vertexPtr,this._baseZ+this._currentZ);this._vertexPtr+=12}Quad(a){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);defaultTexCoordsQuad$jscomp$1.writeToTypedArray(this._texcoordData,
this._texPtr);this._texPtr+=8}Quad2(a,b,d,c,e,h,k,m){this._ExtendQuadBatch();const p=this._vertexData;let q=this._vertexPtr;const v=this._baseZ+this._currentZ;p[q++]=a;p[q++]=b;p[q++]=v;p[q++]=d;p[q++]=c;p[q++]=v;p[q++]=e;p[q++]=h;p[q++]=v;p[q++]=k;p[q++]=m;p[q++]=v;this._vertexPtr=q;defaultTexCoordsQuad$jscomp$1.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3(a,b){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);b.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);
this._texPtr+=8}Quad4(a,b){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(a);b.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3D(a,b,d,c,e,h,k,m,p,q,v,x,A){this._ExtendQuadBatch();const C=this._vertexData;let D=this._vertexPtr;const G=this._baseZ+this._currentZ;C[D++]=a;C[D++]=b;C[D++]=G+d;C[D++]=c;C[D++]=e;C[D++]=G+h;C[D++]=k;C[D++]=m;C[D++]=G+p;C[D++]=q;C[D++]=v;C[D++]=G+x;this._vertexPtr=D;A.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3D2(a,
b,d,c,e,h,k,m,p,q,v,x,A){this._ExtendQuadBatch();const C=this._vertexData;let D=this._vertexPtr;const G=this._baseZ+this._currentZ;C[D++]=a;C[D++]=b;C[D++]=G+d;C[D++]=c;C[D++]=e;C[D++]=G+h;C[D++]=k;C[D++]=m;C[D++]=G+p;C[D++]=q;C[D++]=v;C[D++]=G+x;this._vertexPtr=D;A.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}FullscreenQuad(a,b){mat4$jscomp$7.copy(tmpProjection,this._matP);mat4$jscomp$7.copy(tmpModelView,this._matMV);this.SetDefaultRenderTargetProjectionState();const [d,c]=
this.GetRenderTargetSize(this._currentRenderTarget);var e=this.CalculateLookAtModelView2(0,0,this.GetDefaultCameraZ(c),0,0,0,c);this.SetModelViewMatrix(e);if("crop"===a&amp;&amp;this._currentRenderTarget&amp;&amp;b){a=this._width/2;e=this._height/2;const m=b.GetWidth();b=b.GetHeight();var h=this._currentRenderTarget.GetWidth(),k=this._currentRenderTarget.GetHeight();h=Math.min(h,m);const p=Math.min(k,b),q=Math.max(b-k,0);k=Math.max(k-b,0);tmpRect$jscomp$1.set(-a,e-k,-a+h,e-p-k);tmpQuad$jscomp$1.setFromRect(tmpRect$jscomp$1);
tmpRect$jscomp$1.set(0,q,h,p+q);tmpRect$jscomp$1.divide(m,b);this.Quad3(tmpQuad$jscomp$1,tmpRect$jscomp$1)}else a=d/2,e=c/2,this.Rect2(-a,e,a,-e);this.SetProjectionMatrix(tmpProjection);this.SetModelViewMatrix(tmpModelView)}StartRenderingPoints(a){this._lastPointTexCoords.equals(a)||(this._lastPointTexCoords.copy(a),this.PushBatch().InitSetPointTexCoords(a),this._topOfBatch=0)}FinishRenderingPoints(){}Point(a,b,d,c){this._pointPtr&gt;=LAST_POINT&amp;&amp;this.EndBatch();let e=this._pointPtr;var h=this._baseZ+
this._currentZ;2===this._topOfBatch&amp;&amp;this._lastPointZ===h?this._batch[this._batchPtr-1]._indexCount++:(this.PushBatch().InitPoints(e,h),this._topOfBatch=2,this._lastPointZ=h);h=this._pointData;h[e++]=a;h[e++]=b;h[e++]=d;h[e++]=c;this._pointPtr=e}SetProgram(a){this._lastProgram!==a&amp;&amp;(this.PushBatch().InitSetProgram(a),this._lastProgram=a,this._topOfBatch=0,this._currentStateGroup=null)}SetDeviceTransformTextureFillMode(){this.SetProgram(this._spDeviceTransformTextureFill)}SetGradientColor(a){this.PushBatch().InitSetGradientColor(a);
this._topOfBatch=0}SetEllipseParams(a,b,d=1){this.PushBatch().InitSetEllipseParams(a,b,d);this._topOfBatch=0}SetTilemapInfo(a,b,d,c,e,h,k){if(this._lastProgram!==this._spTilemapFill)throw Error("must set tilemap fill mode first");this.PushBatch().InitSetTilemapInfo(a,b,d,c,e,h,k);this._topOfBatch=0}SetProgramParameters(a,b,d,c,e,h,k,m,p,q,v){const x=this._lastProgram;if(x._hasAnyOptionalUniforms&amp;&amp;!x.AreOptionalUniformsAlreadySetInBatch(b,d,c,e,h,k,m,p,q,v)){var A=this.PushBatch();A.InitSetProgramParameters();
x.SetOptionalUniformsInBatch(b,d,c,e,h,k,m,p,q,v);var C=A._mat4param;C[0]=h;C[1]=k;b.writeToTypedArray(C,2);C[6]=p;C[7]=q;d.writeToTypedArray(C,12);b=A._colorParam;e.writeToTypedArray(b,0);e=b[1];b[1]=b[3];b[3]=e;c.writeToTypedArray(A._srcOriginRect,0);A._startIndex=v;A._indexCount=m;x._uSamplerBack.IsUsed()?A._texParam=a?a.GetTexture():null:A._texParam=null;this._topOfBatch=0}}SetProgramCustomParameters(a){const b=this._lastProgram;if(0!==a.length&amp;&amp;!b.AreCustomParametersAlreadySetInBatch(a)){var d=
this.PushBatch();d.InitSetProgramCustomParameters();b.SetCustomParametersInBatch(a);C3$jscomp$50.shallowAssignArray(d._shaderParams,a);this._topOfBatch=0}}ClearRgba(a,b,d,c){this.PushBatch().InitClearSurface2(a,b,d,c);this._topOfBatch=0}Clear(a){this.PushBatch().InitClearSurface(a);this._topOfBatch=0}Start(){}Finish(){super.Finish();this._gl.flush()}ClearDepth(){this._usesDepthBuffer&amp;&amp;this._currentRenderTarget&amp;&amp;this._currentRenderTarget.HasDepthBuffer()&amp;&amp;(this.PushBatch().InitClearDepth(this._isDepthEnabled),
this._topOfBatch=0)}SetDepthEnabled(a){a=!!a;this._isDepthEnabled!==a&amp;&amp;this._usesDepthBuffer&amp;&amp;(this._isDepthEnabled=a,this.PushBatch().InitSetDepthEnabled(a),this._topOfBatch=0)}IsDepthEnabled(){return this._isDepthEnabled}_GetDepthBuffer(){return this._depthBuffer}_CanSampleDepth(){return this._canSampleDepth}SetDepthSamplingEnabled(a){a=!!a;if(this._canSampleDepth&amp;&amp;this._isDepthSamplingEnabled!==a){if(a&amp;&amp;this.IsDepthEnabled())throw Error("depth still enabled");this._isDepthSamplingEnabled=a;this.PushBatch().InitSetDepthSamplingEnabled(a);
this._topOfBatch=0}}SetScissorRect(a,b,d,c,e=0){a=Math.floor(a);b=Math.floor(b);d=Math.floor(d);c=Math.floor(c);this._lastScissorRect.equalsWH(a,b,d,c)||(this._lastScissorRect.setWH(a,b,d,c),b=(e||this.GetRenderTargetSize(this.GetRenderTarget())[1])-b-c,this.PushBatch().InitSetScissor(!0,a,b,d,c),this._topOfBatch=0)}RemoveScissorRect(){-1!==this._lastScissorRect.getRight()&amp;&amp;(this._lastScissorRect.set(0,0,-1,-1),this.PushBatch().InitSetScissor(!1,0,0,0,0),this._topOfBatch=0)}CheckForQueryResults(){for(const a of this._allQueryResultBuffers)a.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl||
this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){super.OnDeviceOrContextLost();C3$jscomp$50.Gfx.WebGLRendererTexture.OnContextLost();C3$jscomp$50.Gfx.WebGLRenderTarget.OnContextLost();C3$jscomp$50.Gfx.RendererText.OnContextLost();for(const a of this._allQueryResultBuffers)a.Clear();this._extensions=[];this._fragDepthExt=this._depthTextureExt=this._anisotropicExt=this._parallelShaderCompileExt=this._timerExt=null;this._maxAnisotropy=0;this._unmaskedRenderer=this._unmaskedVendor=
"(unavailable)";this._depthBuffer=this._spDeviceTransformTextureFill=this._lastProgram=null;for(const a of this._stateGroups.values())a.OnContextLost()}async OnContextRestored(){this._isInitialisingAfterContextRestored=!0;await this.InitState();this._isInitialisingAfterContextRestored=!1;for(const a of this._stateGroups.values())a.OnContextRestored(this);this.SetSize(this._width,this._height,!0)}CreateStaticTexture(a,b){if(this.IsContextLost())throw Error("context lost");this.EndBatch();const d=C3$jscomp$50.New(C3$jscomp$50.Gfx.WebGLRendererTexture,
this);d._CreateStatic(a,b);return d}async CreateStaticTextureAsync(a,b){if(this.IsContextLost())throw Error("context lost");b=Object.assign({},b);if(!C3$jscomp$50.Supports.ImageBitmapOptions||"Safari"===C3$jscomp$50.Platform.Browser&amp;&amp;a instanceof ImageData&amp;&amp;"undefined"!==typeof Image){if(a instanceof Blob){if("undefined"===typeof Image)throw Error("texture upload variant not supported in worker");a=await C3$jscomp$50.BlobToImage(a)}return await C3$jscomp$50.Asyncify(()=&gt;this.CreateStaticTexture(a,
b))}let d=await createImageBitmap(a,{premultiplyAlpha:"premultiply"});const c=b.wrapX&amp;&amp;"clamp-to-edge"!==b.wrapX||b.wrapY&amp;&amp;"clamp-to-edge"!==b.wrapY,e=C3$jscomp$50.isPOT(d.width)&amp;&amp;C3$jscomp$50.isPOT(d.height);this.SupportsNPOTTextures()||e||!c?b.premultiplyAlpha=!1:C3$jscomp$50.Supports.ImageBitmapOptionsResize?(d=await createImageBitmap(a,{premultiplyAlpha:"premultiply",resizeWidth:C3$jscomp$50.nextHighestPowerOfTwo(d.width),resizeHeight:C3$jscomp$50.nextHighestPowerOfTwo(d.height)}),b.premultiplyAlpha=
!1):d=await createImageBitmap(a,{premultiplyAlpha:"none"});return await C3$jscomp$50.Asyncify(()=&gt;this.CreateStaticTexture(d,b))}CreateDynamicTexture(a,b,d){this.EndBatch();const c=C3$jscomp$50.New(C3$jscomp$50.Gfx.WebGLRendererTexture,this);c._CreateDynamic(a,b,d);return c}UpdateTexture(a,b,d){this.EndBatch();b._Update(a,d)}DeleteTexture(a){a&amp;&amp;(a.SubtractReference(),0&lt;a.GetReferenceCount()||(this.EndBatch(),a===this._lastTexture0&amp;&amp;(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=
null),a===this._lastTexture1&amp;&amp;(this._gl.activeTexture(this._gl.TEXTURE1),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.activeTexture(this._gl.TEXTURE0),this._lastTexture1=null),a._Delete()))}CreateRenderTarget(a){let b=this._width,d=this._height,c=!0;a&amp;&amp;("number"===typeof a.width&amp;&amp;(b=a.width,c=!1),"number"===typeof a.height&amp;&amp;(d=a.height,c=!1));if(0&gt;=b||0&gt;=d)throw Error("invalid size");this.EndBatch();const e=C3$jscomp$50.New(C3$jscomp$50.Gfx.WebGLRenderTarget,this);e._Create(b,d,Object.assign({isDefaultSize:c},
a));this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;this._batchState.currentFramebufferNoDepth=null;return e}SetRenderTarget(a,b=!0){a!==this._currentRenderTarget&amp;&amp;(a&amp;&amp;a.IsDefaultSize()&amp;&amp;a._Resize(this._width,this._height),this.PushBatch().InitSetRenderTarget(a),this._currentRenderTarget=a,this._topOfBatch=0,b&amp;&amp;this.SetDefaultRenderTargetProjectionState())}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(a){return a?[a.GetWidth(),a.GetHeight()]:[this._width,
this._height]}CopyRenderTarget(a,b="stretch"){2&gt;this._version||this._currentRenderTarget&amp;&amp;0&lt;this._currentRenderTarget.GetMultisampling()?(this.SetCopyBlend(),this.ResetColor(),this.DrawRenderTarget(a,b)):(this.PushBatch().InitBlitFramebuffer(a,this._currentRenderTarget,b),this._topOfBatch=0)}DrawRenderTarget(a,b="stretch"){a=a.GetTexture();if(!a)throw Error("not a texture-backed render target");this.SetTexture(a);this.FullscreenQuad(b,a)}InvalidateRenderTarget(a){2&gt;this._version||(this.PushBatch().InitInvalidateFramebuffer(a._GetFramebuffer()),
this._topOfBatch=0)}DeleteRenderTarget(a){this.SetRenderTarget(null);this.EndBatch();const b=a.GetTexture();b===this._lastTexture0&amp;&amp;(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=null);b===this._lastTexture1&amp;&amp;(this._gl.activeTexture(this._gl.TEXTURE1),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.activeTexture(this._gl.TEXTURE0),this._lastTexture1=null);a._Delete()}async ReadBackRenderTargetToImageData(a,b,d){this.EndBatch();const c=this._currentRenderTarget;if(a){var e=
a.GetWidth();var h=a.GetHeight();var k=a._GetFramebuffer()}else e=this.GetWidth(),h=this.GetHeight(),k=null;let m=a=0;var p=e,q=h;d&amp;&amp;(a=C3$jscomp$50.clamp(Math.floor(d.getLeft()),0,e-1),m=C3$jscomp$50.clamp(Math.floor(d.getTop()),0,h-1),p=d.width(),p=0===p?e-a:C3$jscomp$50.clamp(Math.floor(p),0,e-a),q=d.height(),q=0===q?h-m:C3$jscomp$50.clamp(Math.floor(q),0,h-m),m=h-(m+q));const v=this._gl;v.bindFramebuffer(v.FRAMEBUFFER,k);h=()=&gt;{v.bindFramebuffer(v.FRAMEBUFFER,null);this._currentRenderTarget=null;
this._batchState.currentFramebuffer=null;this._batchState.currentFramebufferNoDepth=null;this.SetRenderTarget(c)};if(!b&amp;&amp;2&lt;=this.GetWebGLVersionNumber()){v.bindFramebuffer(v.READ_FRAMEBUFFER,k);k=v.createBuffer();d=p*q*4;e=v.PIXEL_PACK_BUFFER;v.bindBuffer(e,k);v.bufferData(e,d,v.STREAM_READ);v.readPixels(a,m,p,q,v.RGBA,v.UNSIGNED_BYTE,0);v.bindFramebuffer(v.READ_FRAMEBUFFER,null);v.bindBuffer(e,null);h();const x=v.fenceSync(v.SYNC_GPU_COMMANDS_COMPLETE,0);await this._WaitForObjectReady(()=&gt;v.getSyncParameter(x,
v.SYNC_STATUS)===v.SIGNALED);v.deleteSync(x);b=new ImageData(p,q);v.bindBuffer(e,k);v.getBufferSubData(e,0,new Uint8Array(b.data.buffer),0,d);v.bindBuffer(e,null);v.deleteBuffer(k)}else b=new ImageData(p,q),v.readPixels(a,m,p,q,v.RGBA,v.UNSIGNED_BYTE,new Uint8Array(b.data.buffer)),h();return b}CoplanarStartStencilPass(){this.SetDepthEnabled(!0);this.PushBatch().InitCoplanarStartStencilPass();this._topOfBatch=0}CoplanarStartColorPass(){this.SetDepthEnabled(!1);this.PushBatch().InitCoplanarStartColorPass();
this._topOfBatch=0}CoplanarRestoreStandardRendering(){this.SetDepthEnabled(!0);this.PushBatch().InitCoplanarRestore();this._topOfBatch=0}StartQuery(a){this.SupportsGPUProfiling()&amp;&amp;(this.PushBatch().InitStartQuery(a),this._topOfBatch=0)}EndQuery(a){this.SupportsGPUProfiling()&amp;&amp;(this.PushBatch().InitEndQuery(a),this._topOfBatch=0)}_WaitForObjectReady(a){const b=new Promise(d=&gt;pendingPolls.add({resolve:d,checkFunc:a}));-1===pollRafId&amp;&amp;(pollRafId=self.requestAnimationFrame(CheckPendingPolls));return b}IsDesynchronized(){return!!this._attribs.desynchronized}GetEstimatedBackBufferMemoryUsage(){return this._width*
this._height*(this._attribs.alpha?4:3)}GetEstimatedRenderBufferMemoryUsage(){let a=0;for(const b of C3$jscomp$50.Gfx.WebGLRenderTarget.allRenderTargets())b.GetTexture()||(a+=b.GetEstimatedMemoryUsage());return a}GetEstimatedTextureMemoryUsage(){let a=0;for(const b of C3$jscomp$50.Gfx.WebGLRendererTexture.allTextures())a+=b.GetEstimatedMemoryUsage();return a}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}GetDisplayName(){return"webgl"+
this.GetWebGLVersionNumber()}SupportsNPOTTextures(){return 2&lt;=this.GetWebGLVersionNumber()}GetMaxTextureSize(){return this._maxTextureSize}GetMinPointSize(){return this._minPointSize}GetMaxPointSize(){return this._maxPointSize}SupportsHighP(){return 0!==this._highpPrecision}GetHighPPrecision(){return this._highpPrecision}GetUnmaskedVendor(){return this._unmaskedVendor}GetUnmaskedRenderer(){return this._unmaskedRenderer}GetExtensions(){return this._extensions}SupportsGPUProfiling(){return!!this._timerExt}_GetDisjointTimerQueryExtension(){return this._timerExt}_GetParallelShaderCompileExtension(){return this._parallelShaderCompileExt}_GetAnisotropicExtension(){return this._anisotropicExt}_GetMaxAnisotropy(){return this._maxAnisotropy}_AddQueryResultBuffer(a){this._allQueryResultBuffers.add(a)}_RemoveQueryResultBuffer(a){this._allQueryResultBuffers.delete(a)}_GetTimeQueryStack(){return this._timeQueryStack}GetContext(){return this._gl}_InitBlendModes(a){this._InitBlendModeData([["normal",
a.ONE,a.ONE_MINUS_SRC_ALPHA],["additive",a.ONE,a.ONE],["xor",a.ONE,a.ONE_MINUS_SRC_ALPHA],["copy",a.ONE,a.ZERO],["destination-over",a.ONE_MINUS_DST_ALPHA,a.ONE],["source-in",a.DST_ALPHA,a.ZERO],["destination-in",a.ZERO,a.SRC_ALPHA],["source-out",a.ONE_MINUS_DST_ALPHA,a.ZERO],["destination-out",a.ZERO,a.ONE_MINUS_SRC_ALPHA],["source-atop",a.DST_ALPHA,a.ONE_MINUS_SRC_ALPHA],["destination-atop",a.ONE_MINUS_DST_ALPHA,a.SRC_ALPHA]])}CreateRendererText(){return C3$jscomp$50.New(C3$jscomp$50.Gfx.RendererText,
this)}CreateWebGLText(){return this.CreateRendererText()}};"use strict";const DEFAULT_CTOR_OPTS={getDrawSize:null,getRenderTarget:null,releaseRenderTarget:null,getTime:null,redraw:null};
self.C3.Gfx.EffectChainManager=class{constructor(a){a=Object.assign({},DEFAULT_CTOR_OPTS,a);this._cbGetDrawSize=a.getDrawSize;this._cbGetRenderTarget=a.getRenderTarget;this._cbReleaseRenderTarget=a.releaseRenderTarget;this._cbGetTime=a.getTime;this._cbRedraw=a.redraw;this._webgpuBackTexture=null}GetDrawSize(a){return this._cbGetDrawSize?this._cbGetDrawSize(a):[a.GetWidth(),a.GetHeight()]}GetRenderTarget(a){return this._cbGetRenderTarget(a)}ReleaseRenderTarget(a,b){this._cbReleaseRenderTarget(a,b)}GetTime(){return this._cbGetTime()}Redraw(a){this._cbRedraw(a)}_GetWebGPUBackTexture(a,
b,d){!this._webgpuBackTexture||this._webgpuBackTexture.GetWidth()===b&amp;&amp;this._webgpuBackTexture.GetHeight()===d||(a.DeleteTexture(this._webgpuBackTexture),this._webgpuBackTexture=null);null===this._webgpuBackTexture&amp;&amp;(this._webgpuBackTexture=a.CreateStaticTexture(null,{width:b,height:d,sampling:"nearest",mipMap:!1}));return this._webgpuBackTexture}};"use strict";
const C3$jscomp$52=self.C3,mat4$jscomp$8=self.glMatrix.mat4,tempRect=C3$jscomp$52.New(C3$jscomp$52.Rect),tempRect2=C3$jscomp$52.New(C3$jscomp$52.Rect),tempRect3=C3$jscomp$52.New(C3$jscomp$52.Rect),tempRect4=C3$jscomp$52.New(C3$jscomp$52.Rect),tempMat4a=mat4$jscomp$8.create(),tempMat4b$jscomp$1=mat4$jscomp$8.create(),DEFAULT_CTOR_OPTS$jscomp$1={drawContent:null,getSourceTextureInfo:null,getShaderParameters:null,invalidateRenderTargets:!1},DEFAULT_BUILDSTEPS_OPTS={indexMap:null,forcePreDraw:!1,forcePostDraw:!1,
is3D:!1,isSourceTextureRotated:!1,isRotatedOrNegativeSizeInstance:!1,useFullSurface:!1};
C3$jscomp$52.Gfx.EffectChain=class{constructor(a,b){b=Object.assign({},DEFAULT_CTOR_OPTS$jscomp$1,b);this._manager=a;this._cbDrawContent=b.drawContent;this._cbGetSourceTextureInfo=b.getSourceTextureInfo;this._cbGetShaderParameters=b.getShaderParameters;this._cbDrawContentHook=null;this._shaderProgramList=[];this._shaderProgramIndices=[];this._steps=[];this._blendMode=0;this._isSourceTextureRotated=this._useFullSurface=this._canUseFastPath=this._depthEnabledAtStart=this._didChangeTransform=this._useCopyTextureBackgroundSampling=
this._isAnyIsSrcTexRotated=this._isAnyShaderCrossSampling=this._isAnyShaderBackgroundBlending=this._isAnyShaderDepthSampling=this._isAnyShaderAnimated=!1;this._numTempSurfacesRequired=0;this._renderTargets=[null,null,null];this._invalidateRenderTargets=!!b.invalidateRenderTargets;this._drawHeight=this._drawWidth=this._boxExtendVertical=this._boxExtendHorizontal=0;this._contextObject=this._contentObject=null;this._layoutRect=C3$jscomp$52.New(C3$jscomp$52.Rect);this._drawSurfaceRect=C3$jscomp$52.New(C3$jscomp$52.Rect);
this._rcTexOriginal=C3$jscomp$52.New(C3$jscomp$52.Rect);this._rcTexBounce=C3$jscomp$52.New(C3$jscomp$52.Rect);this._rcTexDest=C3$jscomp$52.New(C3$jscomp$52.Rect);this._layerScale=this._devicePixelRatio=1;this._time=this._layerAngle=0;this._backTex=this._destRenderTarget=null;this._compositOffY=this._compositOffX=0;this._updateOwnProjection=!1;this._projectionMatrix=mat4$jscomp$8.create();this._modelViewMatrix=mat4$jscomp$8.create()}Release(){C3$jscomp$52.clearArray(this._steps);C3$jscomp$52.clearArray(this._shaderProgramList);
C3$jscomp$52.clearArray(this._shaderProgramIndices);this._cbGetShaderParameters=this._cbGetSourceTextureInfo=this._cbDrawContent=this._contextObject=this._contentObject=null}BuildSteps(a,b){b=Object.assign({},DEFAULT_BUILDSTEPS_OPTS,b);C3$jscomp$52.clearArray(this._steps);this._boxExtendVertical=this._boxExtendHorizontal=0;this._useCopyTextureBackgroundSampling=this._isAnyIsSrcTexRotated=this._isAnyShaderCrossSampling=this._isAnyShaderBackgroundBlending=this._isAnyShaderDepthSampling=this._isAnyShaderAnimated=
!1;this._numTempSurfacesRequired=0;this._isSourceTextureRotated=!!b.isSourceTextureRotated;this._useFullSurface=!!b.useFullSurface;C3$jscomp$52.shallowAssignArray(this._shaderProgramList,a);if(0!==a.length){if(b.indexMap){if(b.indexMap.length!==a.length)throw Error("incorrect indexMap length");C3$jscomp$52.shallowAssignArray(this._shaderProgramIndices,b.indexMap)}else{C3$jscomp$52.clearArray(this._shaderProgramIndices);for(let e=0,h=a.length;e&lt;h;++e)this._shaderProgramIndices.push(e)}for(var d of a)this._boxExtendHorizontal+=
d.GetBoxExtendHorizontal(),this._boxExtendVertical+=d.GetBoxExtendVertical(),d.IsAnimated()&amp;&amp;(this._isAnyShaderAnimated=!0),d.UsesDepth()&amp;&amp;(this._isAnyShaderDepthSampling=!0),d.BlendsBackground()&amp;&amp;(this._isAnyShaderBackgroundBlending=!0),d.UsesCrossSampling()&amp;&amp;(this._isAnyShaderCrossSampling=!0),d.UsesIsSrcTexRotated()&amp;&amp;(this._isAnyIsSrcTexRotated=!0);this._useCopyTextureBackgroundSampling=this._ShouldUseCopyTextureBackgroundSampling(a[0].GetRenderer());d=this._ShouldPreDraw(a[0],b);b=this._ShouldPostDraw(a.at(-1),
b);if(1!==a.length||d||b){this._canUseFastPath=!1;var c=0;d&amp;&amp;(this._numTempSurfacesRequired=1,this._steps.push(C3$jscomp$52.New(C3$jscomp$52.Gfx.EffectChain.Step.PreDraw,this,-1,1)),c=1);for(let e=0,h=a.length;e&lt;h;++e)0!==e||d?(a=1===c?2:1,e!==h-1||b||(a=0),this._numTempSurfacesRequired=Math.max(this._numTempSurfacesRequired,a),this._steps.push(C3$jscomp$52.New(C3$jscomp$52.Gfx.EffectChain.Step.Bounce,this,c,a,e)),c=a):(this._numTempSurfacesRequired=1,this._steps.push(C3$jscomp$52.New(C3$jscomp$52.Gfx.EffectChain.Step.FirstBounce,
this,-1,1,e)),c=1);b&amp;&amp;this._steps.push(C3$jscomp$52.New(C3$jscomp$52.Gfx.EffectChain.Step.PostDraw,this,c,0))}else this._canUseFastPath=!0}}_ShouldPreDraw(a,b){return b.forcePreDraw||a.MustPreDraw()||b.is3D||a.UsesDepth()&amp;&amp;!this._useFullSurface||(0!==this._boxExtendHorizontal||0!==this._boxExtendVertical)&amp;&amp;!this._useFullSurface?!0:a.GetRenderer().IsWebGL()?a.BlendsBackground()&amp;&amp;(b.isRotatedOrNegativeSizeInstance||b.isSourceTextureRotated)||a.UsesAnySrcRectOrPixelSize()&amp;&amp;b.isSourceTextureRotated:!1}_ShouldPostDraw(a,
b){return b.forcePostDraw?!0:a.GetRenderer().IsWebGL()?a.BlendsBackground()||a.UsesCrossSampling():(a.BlendsBackground()||a.UsesCrossSampling())&amp;&amp;this._UseRenderTargetBackgroundSampling()}_ShouldUseCopyTextureBackgroundSampling(a){return a.IsWebGPU()&amp;&amp;this._isAnyShaderBackgroundBlending&amp;&amp;!this._isAnyShaderCrossSampling}Render(a,b,d){a.IsWebGPU()&amp;&amp;null===b&amp;&amp;(b=a.GetBackbufferRenderTarget());this._destRenderTarget=b;this._contentObject=d.contentObject||null;this._contextObject=d.contextObject||null;
this._blendMode=d.blendMode||0;this._devicePixelRatio=d.devicePixelRatio||1;this._layerScale=d.layerScale||1;this._layerAngle=d.layerAngle||0;this._time="number"===typeof d.time?d.time:this._manager.GetTime();this._didChangeTransform=!1;a.ResetDidChangeTransformFlag();this._isAnyShaderAnimated&amp;&amp;this._Redraw();let c=!1;this._UseCopyTextureBackgroundSampling()&amp;&amp;(this._CalculateDrawSizeAndRectangles(a,d),c=!0,this._backTex=this._manager._GetWebGPUBackTexture(a,this._drawWidth,this._drawHeight),tempRect.copy(this._drawSurfaceRect),
tempRect.roundOuter(),a.CopyTextureToTexture(this._destRenderTarget.GetTexture(),this._backTex,tempRect.getLeft(),tempRect.getTop(),tempRect.width(),tempRect.height()));if(this._canUseFastPath)this._Render_FastPath(a,d);else{c||this._CalculateDrawSizeAndRectangles(a,d);a.ResetColor();a.SetBaseZ(0);a.SetCurrentZ(0);this._cbDrawContentHook=d.drawContentHook||null;this._compositOffX=d.compositOffX||0;this._compositOffY=d.compositOffY||0;this._updateOwnProjection=!!d.updateOwnProjection;this._OnBeforeStartEffectChain(a);
this._renderTargets[0]=b;this._renderTargets[1]=1&lt;=this._numTempSurfacesRequired?this._GetRenderTarget():null;this._renderTargets[2]=2===this._numTempSurfacesRequired?this._GetRenderTarget():null;for(const e of this._steps)b=this._GetRenderTargetForId(e.GetSrcTargetId()),d=this._GetRenderTargetForId(e.GetDestTargetId()),a.IsWebGPU()?e.Run_WebGPU(a,b,d):e.Run_WebGL(a,b,d);this._renderTargets[1]&amp;&amp;this._ReleaseRenderTarget(this._renderTargets[1]);this._renderTargets[2]&amp;&amp;this._ReleaseRenderTarget(this._renderTargets[2]);
this._renderTargets.fill(null);this._OnAfterEndEffectChain(a);this._cbDrawContentHook=this._contextObject=this._contentObject=this._backTex=this._destRenderTarget=null}}_CalculateDrawSizeAndRectangles(a,b){const [d,c]=this._manager.GetDrawSize(a);this._SetDrawSize(a,d,c);this._CalculateRectangles(b)}_SetDrawSize(a,b,d){if(0&gt;=b||0&gt;=d)throw Error("invalid draw size");this._drawWidth===b&amp;&amp;this._drawHeight===d||this._CalculateDeviceTransformMatrices(a,b,d,0,0,this._projectionMatrix,this._modelViewMatrix);
this._drawWidth=b;this._drawHeight=d}_CalculateDeviceTransformMatrices(a,b,d,c,e,h,k){c=b/2+c;e=d/2+e;a.CalculatePerspectiveMatrix(h,b/d);a=a.CalculateLookAtModelView2(c,e,a.GetDefaultCameraZ(d),c,e,0,d);mat4$jscomp$8.copy(k,a)}_CalculateRectangles(a){this._layoutRect.copy(a.layoutRect);a.drawSurfaceRect?this._drawSurfaceRect.copy(a.drawSurfaceRect):this._drawSurfaceRect.set(0,0,this._drawWidth,this._drawHeight);this._rcTexOriginal.copy(this._drawSurfaceRect);this._rcTexOriginal.divide(this._drawWidth,
this._drawHeight);a=this._layerScale*this._devicePixelRatio;this._drawSurfaceRect.inflate(this._boxExtendHorizontal*a,this._boxExtendVertical*a);this._rcTexDest.copy(this._drawSurfaceRect);this._rcTexDest.divide(this._drawWidth,this._drawHeight);this._drawSurfaceRect.clamp(0,0,this._drawWidth,this._drawHeight);this._rcTexBounce.copy(this._drawSurfaceRect);this._rcTexBounce.divide(this._drawWidth,this._drawHeight)}_OnBeforeStartEffectChain(a){this._depthEnabledAtStart=a.IsDepthEnabled();if(this._useFullSurface)a.SetDepthEnabled(!1),
this._isAnyShaderDepthSampling&amp;&amp;a.SetDepthSamplingEnabled(!0);else{tempRect.copy(this._drawSurfaceRect);if(a.IsWebGL()){const b=this._layerScale*this._devicePixelRatio;tempRect.inflate(Math.max(this._boxExtendHorizontal,1)*b,Math.max(this._boxExtendVertical,1)*b);tempRect.roundOuter();tempRect.clamp(0,0,this._drawWidth,this._drawHeight)}else tempRect.roundOuter();a.SetScissorRect(tempRect.getLeft(),tempRect.getTop(),tempRect.width(),tempRect.height(),this._drawHeight)}}_OnAfterEffectChainDrawContent(a){a.ResetColor();
this._useFullSurface||(a.SetDepthEnabled(!1),this._isAnyShaderDepthSampling&amp;&amp;a.SetDepthSamplingEnabled(!0));a.IsWebGPU()&amp;&amp;a.SetNormalizedCoordsProgramVariant(!0)}_OnAfterEndEffectChain(a){a.SetDepthSamplingEnabled(!1);a.SetDepthEnabled(this._depthEnabledAtStart);this._useFullSurface||a.RemoveScissorRect();a.IsWebGPU()&amp;&amp;a.SetNormalizedCoordsProgramVariant(!1);this._didChangeTransform=a.DidChangeTransform()}_ClampRcTexDest(){this._rcTexDest.clamp(0,0,1,1)}_GetRenderTargetForId(a){return 0&gt;a?null:this._renderTargets[a]}_GetRenderTarget(){return this._manager.GetRenderTarget(this)}_GetDestRenderTarget(){return this._destRenderTarget}_ReleaseRenderTarget(a){this._manager.ReleaseRenderTarget(a,
this)}_GetShaderProgramAt(a){return this._shaderProgramList[a]}_DrawContent(a){this._cbDrawContentHook?this._cbDrawContentHook(this,a,()=&gt;this._cbDrawContent(a,this)):this._cbDrawContent(a,this);this._canUseFastPath||this._OnAfterEffectChainDrawContent(a)}_IsRenderTargetSameSizeAndOffset(a){if(this._useFullSurface)return!0;if(0!==this._compositOffX||0!==this._compositOffY)return!1;const [b,d]=a.GetRenderTargetSize(a.GetRenderTarget());return b!==this._drawWidth||d!==this._drawHeight?!1:!0}_SetDeviceTransform(a,
b){let d=this._projectionMatrix,c=this._modelViewMatrix;if(b&amp;&amp;!this._IsRenderTargetSameSizeAndOffset(a)){d=tempMat4a;c=tempMat4b$jscomp$1;const [e,h]=a.GetRenderTargetSize(a.GetRenderTarget());this._CalculateDeviceTransformMatrices(a,e,h,this._compositOffX,this._compositOffY,d,c);this._useFullSurface||a.RemoveScissorRect()}a.SetProjectionMatrix(d);a.SetModelViewMatrix(c)}_Redraw(){this._manager.Redraw(this)}_GetShaderParameters(a){return this._cbGetShaderParameters(this._shaderProgramIndices[a])}_SetProgramParameters(a,
b){let d=this._rcTexDest,c=this._rcTexBounce,e=this._rcTexOriginal;a.IsWebGL()&amp;&amp;(tempRect2.copy(d),tempRect2.flipAround(1),d=tempRect2,tempRect3.copy(c),tempRect3.flipAround(1),c=tempRect3,tempRect4.copy(e),tempRect4.flipAround(1),e=tempRect4);this._DoSetProgramParameters(a,b,c,e,d,1/this._drawWidth,1/this._drawHeight)}_SetFirstBounceProgramParameters(a,b){let d=this._rcTexBounce,c=this._rcTexOriginal,e=1/this._drawWidth,h=1/this._drawHeight;if(this._cbGetSourceTextureInfo){let {srcTexRect:m,srcWidth:p,
srcHeight:q}=this._cbGetSourceTextureInfo(this._contentObject);m||(tempRect.set(0,0,0,0),m=tempRect);p||(p=this._drawWidth);q||(q=this._drawHeight);c=d=m;e=1/p;h=1/q}else a.IsWebGL()&amp;&amp;(tempRect3.copy(d),tempRect3.flipAround(1),d=tempRect3,tempRect4.copy(c),tempRect4.flipAround(1),c=tempRect4);let k=this._rcTexDest;a.IsWebGL()&amp;&amp;(k=tempRect2,k.copy(this._rcTexDest),k.flipAround(1));this._DoSetProgramParameters(a,b,d,c,k,e,h);a.IsWebGPU()&amp;&amp;this._isAnyIsSrcTexRotated&amp;&amp;a.SetProgramParameter_IsSrcTexRotated(this._isSourceTextureRotated)}_GetBackTex(a){return this._isAnyShaderBackgroundBlending?
a.IsWebGPU()?this._UseCopyTextureBackgroundSampling()?this._backTex:this._destRenderTarget.GetTexture():this._destRenderTarget:null}_DoSetProgramParameters(a,b,d,c,e,h,k){a.SetProgramParameters(this._GetBackTex(a),e,d,c,this._layoutRect,h,k,this._devicePixelRatio,this._layerScale,this._layerAngle,this._time);a.SetProgramCustomParameters(this._GetShaderParameters(b))}_Render_FastPath(a,b){var d=this._shaderProgramList[0];const c=a.IsDepthEnabled(),e=d.UsesDepth();e&amp;&amp;(a.SetDepthEnabled(!1),a.SetDepthSamplingEnabled(!0),
this._rcTexDest.set(0,0,1,1),this._rcTexOriginal.set(0,0,1,1));a.SetProgram(d);a.SetBlendMode(this._blendMode);a.SetRenderTarget(this._destRenderTarget);let h;this._rcTexOriginal.set(0,0,1,1);if(d.UsesAnySrcRectOrPixelSize()&amp;&amp;this._cbGetSourceTextureInfo){const {srcTexRect:k,srcWidth:m,srcHeight:p}=this._cbGetSourceTextureInfo(this._contentObject);k&amp;&amp;this._rcTexOriginal.copy(k);d=Number.isFinite(m)?1/m:0;h=Number.isFinite(p)?1/p:0}else{const [k,m]=this._manager.GetDrawSize(a);d=1/k;h=1/m}b.layoutRect?
this._layoutRect.copy(b.layoutRect):this._layoutRect.set(0,0,0,0);a.SetProgramParameters(this._GetBackTex(a),this._rcTexDest,this._rcTexOriginal,this._rcTexOriginal,this._layoutRect,d,h,this._devicePixelRatio,this._layerScale,this._layerAngle,this._time);a.SetProgramCustomParameters(this._GetShaderParameters(0));a.IsWebGPU()&amp;&amp;this._isAnyIsSrcTexRotated&amp;&amp;a.SetProgramParameter_IsSrcTexRotated(this._isSourceTextureRotated);a.SetBaseZ(0);this._DrawContent(a);e&amp;&amp;(a.SetDepthSamplingEnabled(!1),a.SetDepthEnabled(c))}_UseCopyTextureBackgroundSampling(){return this._useCopyTextureBackgroundSampling}_UseRenderTargetBackgroundSampling(){return!this._useCopyTextureBackgroundSampling}IsAnyShaderBackgroundBlending(){return this._isAnyShaderBackgroundBlending}CanSkipCalculatingDrawSurfaceRect(){return!this._canUseFastPath||
this._UseCopyTextureBackgroundSampling()?!1:!0}UseFullSurface(){return this._useFullSurface}GetContentObject(){return this._contentObject}GetContextObject(){return this._contextObject}_GetBlendMode(){return this._blendMode}_UpdateOwnProjection(){return this._updateOwnProjection}DidChangeTransform(){return this._didChangeTransform}_GetDrawSurfaceRect(){return this._drawSurfaceRect}_GetRcTexBounce(){return this._rcTexBounce}_ShouldInvalidateRenderTargets(){return this._invalidateRenderTargets}async DebugLogRenderTargetContents(a,
b,d){}};"use strict";self.C3.Gfx.EffectChain.Step=class{constructor(a,b,d,c=-1){this._effectChain=a;this._srcTargetId=b;this._destTargetId=d;this._index=c}GetEffectChain(){return this._effectChain}GetSrcTargetId(){return this._srcTargetId}GetDestTargetId(){return this._destTargetId}GetIndex(){return this._index}GetShaderProgram(){return this.GetEffectChain()._GetShaderProgramAt(this.GetIndex())}Run_WebGL(a,b,d){}Run_WebGPU(a,b,d){}};"use strict";const C3$jscomp$54=self.C3;
C3$jscomp$54.Gfx.EffectChain.Step.PreDraw=class extends C3$jscomp$54.Gfx.EffectChain.Step{constructor(a,b,d,c){super(a,b,d,c)}Run_WebGL(a,b,d){b=this.GetEffectChain();a.SetAlphaBlend();a.SetTextureFillMode();a.SetRenderTarget(d,b._UpdateOwnProjection());a.ClearRgba(0,0,0,0);b._DrawContent(a);b._ClampRcTexDest()}Run_WebGPU(a,b,d){b=this.GetEffectChain();a.SetAlphaBlend();a.SetTextureFillMode();a.SetRenderTarget(d,!1);a.ClearRgba(0,0,0,0);b._DrawContent(a);b._ClampRcTexDest()}};"use strict";
const C3$jscomp$55=self.C3,tempRect$jscomp$1=C3$jscomp$55.New(C3$jscomp$55.Rect),tempQuad$jscomp$1=C3$jscomp$55.New(C3$jscomp$55.Quad);
C3$jscomp$55.Gfx.EffectChain.Step.PostDraw=class extends C3$jscomp$55.Gfx.EffectChain.Step{constructor(a,b,d,c){super(a,b,d,c)}Run_WebGL(a,b,d){const c=this.GetEffectChain();a.SetTextureFillMode();a.SetRenderTarget(d);c._SetDeviceTransform(a,!0);a.SetBlendMode(c._GetBlendMode());a.SetTexture(b.GetTexture());tempQuad$jscomp$1.setFromRect(c._GetDrawSurfaceRect());tempRect$jscomp$1.copy(c._GetRcTexBounce());tempRect$jscomp$1.flipAround(1);a.Quad3(tempQuad$jscomp$1,tempRect$jscomp$1);c._ShouldInvalidateRenderTargets()&amp;&amp;
a.InvalidateRenderTarget(b)}Run_WebGPU(a,b,d){const c=this.GetEffectChain();a.SetTextureFillMode();a.SetRenderTarget(d,!1);c._IsRenderTargetSameSizeAndOffset(a)?tempQuad$jscomp$1.setFromRect(c._GetRcTexBounce()):(a.SetNormalizedCoordsProgramVariant(!1),c._SetDeviceTransform(a,!0),tempQuad$jscomp$1.setFromRect(c._GetDrawSurfaceRect()));a.SetBackTexture(null);a.SetBlendMode(c._GetBlendMode());a.SetTexture(b.GetTexture());c.UseFullSurface()?a.FullscreenQuad():a.Quad3(tempQuad$jscomp$1,c._GetRcTexBounce())}};
"use strict";const C3$jscomp$56=self.C3;
C3$jscomp$56.Gfx.EffectChain.Step.FirstBounce=class extends C3$jscomp$56.Gfx.EffectChain.Step{constructor(a,b,d,c){super(a,b,d,c)}Run_WebGL(a,b,d){b=this.GetEffectChain();a.SetRenderTarget(d,b._UpdateOwnProjection());a.ClearRgba(0,0,0,0);a.SetCopyBlend();a.SetProgram(this.GetShaderProgram());b._SetFirstBounceProgramParameters(a,this.GetIndex());b._DrawContent(a);b._ClampRcTexDest()}Run_WebGPU(a,b,d){b=this.GetEffectChain();a.SetRenderTarget(d,!1);a.ClearRgba(0,0,0,0);a.SetCopyBlend();a.SetProgram(this.GetShaderProgram());
b._SetFirstBounceProgramParameters(a,this.GetIndex());b._DrawContent(a);b._ClampRcTexDest()}};"use strict";const C3$jscomp$57=self.C3,tempRect$jscomp$2=C3$jscomp$57.New(C3$jscomp$57.Rect),tempQuad$jscomp$2=C3$jscomp$57.New(C3$jscomp$57.Quad);
C3$jscomp$57.Gfx.EffectChain.Step.Bounce=class extends C3$jscomp$57.Gfx.EffectChain.Step{constructor(a,b,d,c){super(a,b,d,c)}Run_WebGL(a,b,d){const c=this.GetEffectChain();a.SetRenderTarget(d);(d=0===this.GetDestTargetId())?a.SetBlendMode(c._GetBlendMode()):(a.ClearRgba(0,0,0,0),a.SetCopyBlend());a.SetProgram(this.GetShaderProgram());c._SetProgramParameters(a,this.GetIndex());a.SetTexture(b.GetTexture());c._SetDeviceTransform(a,d);tempQuad$jscomp$2.setFromRect(c._GetDrawSurfaceRect());tempRect$jscomp$2.copy(c._GetRcTexBounce());
tempRect$jscomp$2.flipAround(1);a.Quad3(tempQuad$jscomp$2,tempRect$jscomp$2);c._ShouldInvalidateRenderTargets()&amp;&amp;a.InvalidateRenderTarget(b)}Run_WebGPU(a,b,d){const c=this.GetEffectChain();a.SetRenderTarget(d,!1);0===this.GetDestTargetId()?(a.SetBlendMode(c._GetBlendMode()),a.SetBackTexture(null),c._IsRenderTargetSameSizeAndOffset(a)?tempQuad$jscomp$2.setFromRect(c._GetRcTexBounce()):(a.SetNormalizedCoordsProgramVariant(!1),c._SetDeviceTransform(a,!0),tempQuad$jscomp$2.setFromRect(c._GetDrawSurfaceRect()))):
(a.ClearRgba(0,0,0,0),a.SetCopyBlend(),tempQuad$jscomp$2.setFromRect(c._GetRcTexBounce()));a.SetProgram(this.GetShaderProgram());c._SetProgramParameters(a,this.GetIndex());a.SetTexture(b.GetTexture());c.UseFullSurface()?a.FullscreenQuad():a.Quad3(tempQuad$jscomp$2,c._GetRcTexBounce())}};"use strict";const C3$jscomp$58=self.C3,C3X$jscomp$1=self.C3X;let runtime=null;const keysDownByKey=new Set;function SortZOrderList(a,b){const d=a[0]-b[0];return 0!==d?d:a[1]-b[1]}
const tempZOrderList=[],tempInstances=[];let didWarnInAlertPolyfill=!1;
self.IRuntime=class{constructor(a,b){runtime=a;Object.defineProperties(this,{assets:{value:runtime.GetAssetManager().GetIAssetManager(),writable:!1},objects:{value:b,writable:!1},globalVars:{value:{},writable:!1},projectName:{value:runtime.GetProjectName(),writable:!1},projectVersion:{value:runtime.GetProjectVersion(),writable:!1},storage:{value:new self.IStorage(runtime),writable:!1},isInWorker:{value:runtime.IsInWorker(),writable:!1}});runtime.UserScriptDispatcher().addEventListener("keydown",d=&gt;
{keysDownByKey.has(d.key)?d.stopPropagation():keysDownByKey.add(d.key)});runtime.UserScriptDispatcher().addEventListener("keyup",d=&gt;keysDownByKey.delete(d.key));runtime.Dispatcher().addEventListener("window-blur",()=&gt;keysDownByKey.clear());runtime.IsInWorker()&amp;&amp;(self.alert=d=&gt;{didWarnInAlertPolyfill||(didWarnInAlertPolyfill=!0,console.warn("[Construct] alert() was called from a Web Worker, because the project 'Use worker' setting is enabled. This method is not normally available in a Web Worker. Construct has implemented the alert for you, but note that other features may be missing in worker mode. You may wish to disable 'Use worker', or use a more convenient function like console.log(). For more information please refer to the scripting section of the manual."));
return this.alert(d)})}_InitGlobalVars(a){Object.defineProperties(this.globalVars,a)}addEventListener(a,b){runtime.UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){runtime.UserScriptDispatcher().removeEventListener(a,b)}callFunction(a,...b){C3X$jscomp$1.RequireString(a);const d=runtime.GetEventSheetManager(),c=d.GetFunctionBlockByName(a);if(!c)throw Error(`cannot find function name '${a}'`);if(!c.IsEnabled())return c.GetDefaultReturnValue();if(b.length&lt;c.GetFunctionParameterCount())throw Error(`not enough function parameters passed for '${a}' (${b.length} passed, ${c.GetFunctionParameterCount()} expected)`);
const e=c.GetEventBlock();a=null;var h=d.GetCurrentEvent();h&amp;&amp;(h=h.GetSolModifiersIncludingParents(),0&lt;h.length&amp;&amp;(a=h,c.IsCopyPicked()?d.PushCopySol(h):d.PushCleanSol(h)));b=e.RunAsExpressionFunctionCall(e.GetSolModifiersIncludingParents(),c.IsCopyPicked(),c.GetReturnType(),c.GetDefaultReturnValue(),...b);a&amp;&amp;d.PopSol(a);return b}setReturnValue(a){const b=runtime.GetEventStack().GetCurrentExpFuncStackFrame();if(!b)throw Error("not in a function which returns a value");switch(b.GetFunctionReturnType()){case 1:"number"===
typeof a&amp;&amp;b.SetFunctionReturnValue(a);break;case 2:"string"===typeof a&amp;&amp;b.SetFunctionReturnValue(a);break;case 3:"number"!==typeof a&amp;&amp;"string"!==typeof a||b.SetFunctionReturnValue(a)}}get dt(){return runtime.GetDt()}get gameTime(){return runtime.GetGameTime()}get wallTime(){return runtime.GetWallTime()}random(){return runtime.Random()}get layout(){return runtime.GetMainRunningLayout().GetILayout()}getLayout(a){const b=runtime.GetLayoutManager();if("number"===typeof a||"string"===typeof a)a=b.GetLayout(a);
else throw new TypeError("expected string or number");if(!a)throw Error("invalid layout");return a.GetILayout()}getAllLayouts(){return runtime.GetLayoutManager().GetAllLayouts().map(a=&gt;a.GetILayout())}goToLayout(a){const b=runtime.GetLayoutManager();if("number"===typeof a||"string"===typeof a)a=b.GetLayout(a);else throw new TypeError("expected string or number");if(!a)throw Error("invalid layout");b.IsPendingChangeMainLayout()||b.ChangeMainLayout(a)}get keyboard(){const a=runtime._GetCommonScriptInterfaces().keyboard;
if(!a)throw Error("runtime.keyboard used but Keyboard object missing - add it to your project first");return a}get mouse(){const a=runtime._GetCommonScriptInterfaces().mouse;if(!a)throw Error("runtime.mouse used but Mouse object missing - add it to your project first");return a}get touch(){const a=runtime._GetCommonScriptInterfaces().touch;if(!a)throw Error("runtime.touch used but Touch object missing - add it to your project first");return a}invokeDownload(a,b){C3X$jscomp$1.RequireString(a);C3X$jscomp$1.RequireString(b);
runtime.InvokeDownload(a,b)}getInstanceByUid(a){C3X$jscomp$1.RequireFiniteNumber(a);return(a=runtime.GetInstanceByUID(a))?a.GetInterfaceClass():null}sortZOrder(a,b){C3X$jscomp$1.RequireFunction(b);const d=runtime.GetCurrentLayout();for(var c of a){a=runtime._UnwrapIWorldInstance(c);var e=a.GetWorldInfo();tempZOrderList.push([e.GetLayer().GetIndex(),e.GetZIndex()]);tempInstances.push(a)}if(0!==tempZOrderList.length){tempZOrderList.sort(SortZOrderList);tempInstances.sort((h,k)=&gt;b(h.GetInterfaceClass(),
k.GetInterfaceClass()));c=!1;for(let h=0,k=tempZOrderList.length;h&lt;k;++h){a=tempInstances[h];e=d.GetLayerByIndex(tempZOrderList[h][0]);const m=tempZOrderList[h][1],p=e._GetInstances();p[m]!==a&amp;&amp;(p[m]=a,a.GetWorldInfo()._SetLayer(e),e.SetZIndicesChanged(),c=!0)}c&amp;&amp;runtime.UpdateRender();C3$jscomp$58.clearArray(tempZOrderList);C3$jscomp$58.clearArray(tempInstances)}}alert(a){return runtime.PostComponentMessageToDOMAsync("runtime","alert",{message:a+(runtime.IsInWorker()?" [via Web Worker]":"")})}};
"use strict";const C3$jscomp$59=self.C3;let assetManager=null;
self.IAssetManager=class{constructor(a){assetManager=a;Object.defineProperties(this,{isWebMOpusSupported:{value:assetManager.IsAudioFormatSupported("audio/webm; codecs=opus"),writable:!1}})}fetchText(a){return assetManager.FetchText(a)}fetchJson(a){return assetManager.FetchJson(a)}fetchBlob(a){return assetManager.FetchBlob(a)}fetchArrayBuffer(a){return assetManager.FetchArrayBuffer(a)}getProjectFileUrl(a){return assetManager.GetProjectFileUrl(a)}getMediaFileUrl(a){C3$jscomp$59.IsRelativeURL(a)&amp;&amp;(a=
a.toLowerCase());return assetManager.GetMediaFileUrl(a,assetManager.GetMediaSubfolder())}get mediaFolder(){return assetManager.GetMediaSubfolder()}async decodeWebMOpus(a,b){if(this.isWebMOpusSupported)throw Error("decodeWebMOpus(): not supported because WebM Opus is supported by the platform");b=await assetManager.GetRuntime()._WasmDecodeWebMOpus(b);b=new Float32Array(b);a=a.createBuffer(1,b.length,48E3);a.getChannelData(0).set(b);return a}loadScripts(...a){return assetManager.LoadScripts(...a)}compileWebAssembly(a){return assetManager.CompileWebAssembly(a)}loadStyleSheet(a){return assetManager.LoadStyleSheet(a)}};
"use strict";const C3X$jscomp$3=self.C3X;self.IStorage=class{constructor(a){this._storage=a._GetProjectStorage()}getItem(a){C3X$jscomp$3.RequireString(a);return this._storage.getItem(a)}setItem(a,b){C3X$jscomp$3.RequireString(a);return this._storage.setItem(a,b)}removeItem(a){C3X$jscomp$3.RequireString(a);return this._storage.removeItem(a)}clear(){return this._storage.clear()}keys(){return this._storage.keys()}};"use strict";const C3$jscomp$61=self.C3,C3X$jscomp$4=self.C3X,map$jscomp$2=new WeakMap;
self.IObjectClass=class{constructor(a){map$jscomp$2.set(this,a);Object.defineProperties(this,{name:{value:a.GetName(),writable:!1}});a.GetRuntime()._MapScriptInterface(this,a)}addEventListener(a,b){C3X$jscomp$4.RequireString(a);C3X$jscomp$4.RequireFunction(b);map$jscomp$2.get(this).UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){C3X$jscomp$4.RequireString(a);C3X$jscomp$4.RequireFunction(b);map$jscomp$2.get(this).UserScriptDispatcher().removeEventListener(a,b)}getAllInstances(){return[...this.instances()]}getFirstInstance(){return C3$jscomp$61.first(this.instances())}getPickedInstances(){return[...this.pickedInstances()]}getFirstPickedInstance(){return C3$jscomp$61.first(this.pickedInstances())}*instances(){for(const a of map$jscomp$2.get(this).instancesIncludingPendingCreate())yield a.GetInterfaceClass()}*pickedInstances(){for(const a of map$jscomp$2.get(this).GetCurrentSol().GetInstances())yield a.GetInterfaceClass()}setInstanceClass(a){C3X$jscomp$4.RequireFunction(a);
if(0&lt;map$jscomp$2.get(this).GetInstanceCount())throw Error("setInstanceClass() called too late, because instances have already been created - call in runOnStartup");map$jscomp$2.get(this)._SetUserScriptInstanceClass(a)}createInstance(a,b,d,c,e){C3X$jscomp$4.RequireNumber(b);C3X$jscomp$4.RequireNumber(d);if("number"!==typeof a&amp;&amp;"string"!==typeof a)throw new TypeError("invalid layer parameter");const h=map$jscomp$2.get(this),k=h.GetRuntime();a=k.GetMainRunningLayout().GetLayer(a);if(!a)throw Error("invalid layer");
b=k.CreateInstance(h,a,b,d,c,e);c&amp;&amp;a.SortAndAddInstancesByZIndex(b);c=k.GetEventSheetManager();c.BlockFlushingInstances(!0);b._TriggerOnCreatedOnSelfAndRelated();c.BlockFlushingInstances(!1);c.IsInEventEngine()||k.FlushPendingInstances();return b.GetInterfaceClass()}};"use strict";const C3X$jscomp$5=self.C3X,map$jscomp$3=new WeakMap;
self.ILayout=class{constructor(a){map$jscomp$3.set(this,a);const b=[],d=a.GetEffectList(),c=d.GetAllEffectTypes().length;for(let e=0;e&lt;c;++e)b.push(new self.IEffectInstance(d,e));Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},index:{value:a.GetIndex(),writable:!1},effects:{value:b,writable:!1}})}addEventListener(a,b){C3X$jscomp$5.RequireString(a);C3X$jscomp$5.RequireFunction(b);map$jscomp$3.get(this).UserScriptDispatcher().addEventListener(a,b)}removeEventListener(a,b){C3X$jscomp$5.RequireString(a);
C3X$jscomp$5.RequireFunction(b);map$jscomp$3.get(this).UserScriptDispatcher().removeEventListener(a,b)}get width(){return map$jscomp$3.get(this).GetWidth()}set width(a){map$jscomp$3.get(this).SetWidth(a)}get height(){return map$jscomp$3.get(this).GetHeight()}set height(a){map$jscomp$3.get(this).SetHeight(a)}set scale(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetScale(a)}get scale(){return map$jscomp$3.get(this).GetScale()}set angle(a){C3X$jscomp$5.RequireFiniteNumber(a);map$jscomp$3.get(this).SetAngle(a)}get angle(){return map$jscomp$3.get(this).GetAngle()}set scrollX(a){C3X$jscomp$5.RequireNumber(a);
map$jscomp$3.get(this).SetScrollX(a)}get scrollX(){return map$jscomp$3.get(this).GetScrollX()}set scrollY(a){C3X$jscomp$5.RequireNumber(a);map$jscomp$3.get(this).SetScrollY(a)}get scrollY(){return map$jscomp$3.get(this).GetScrollY()}scrollTo(a,b){C3X$jscomp$5.RequireNumber(a);C3X$jscomp$5.RequireNumber(b);const d=map$jscomp$3.get(this);d.SetScrollX(a);d.SetScrollY(b)}getLayer(a){const b=map$jscomp$3.get(this);if("number"===typeof a||"string"===typeof a)a=b.GetLayer(a);else throw new TypeError("expected string or number");
return a?a.GetILayer():null}getAllLayers(){return map$jscomp$3.get(this).GetLayers().map(a=&gt;a.GetILayer())}*allLayers(){for(const a of map$jscomp$3.get(this).allLayers())yield a.GetILayer()}setVanishingPoint(a,b){C3X$jscomp$5.RequireFiniteNumber(a);C3X$jscomp$5.RequireFiniteNumber(b);map$jscomp$3.get(this).SetVanishingPointXY(a,b)}getVanishingPoint(){return map$jscomp$3.get(this)._GetVanishingPoint()}set projection(a){C3X$jscomp$5.RequireString(a);const b=map$jscomp$3.get(this);if("perspective"===
a)b.SetPerspectiveProjection();else if("orthographic"===a)b.SetOrthographicProjection();else throw Error("invalid projection");}get projection(){return map$jscomp$3.get(this).IsOrthographicProjection()?"orthographic":"perspective"}};"use strict";
const C3$jscomp$63=self.C3,C3X$jscomp$6=self.C3X,map$jscomp$4=new WeakMap,BLEND_MODE_TO_INDEX=new Map([["normal",0],["additive",1],["copy",3],["destination-over",4],["source-in",5],["destination-in",6],["source-out",7],["destination-out",8],["source-atop",9],["destination-atop",10]]),INDEX_TO_BLEND_MODE=new Map([...BLEND_MODE_TO_INDEX.entries()].map(a=&gt;[a[1],a[0]])),tempColor$jscomp$1=C3$jscomp$63.New(C3$jscomp$63.Color);
self.ILayer=class{constructor(a){map$jscomp$4.set(this,a);const b=[],d=a.GetEffectList(),c=d.GetAllEffectTypes().length;for(let e=0;e&lt;c;++e)b.push(new self.IEffectInstance(d,e));Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},index:{value:a.GetIndex(),writable:!1},layout:{value:a.GetLayout().GetILayout(),writable:!1},effects:{value:b,writable:!1}})}static _Unwrap(a){return map$jscomp$4.get(a)}get parentLayer(){const a=map$jscomp$4.get(this).GetParentLayer();return a?a.GetILayer():
null}*parentLayers(){for(const a of map$jscomp$4.get(this).parentLayers())yield a.GetILayer()}*subLayers(){for(const a of map$jscomp$4.get(this).GetSubLayers())yield a.GetILayer()}*allSubLayers(){for(const a of map$jscomp$4.get(this).GetSubLayers())for(const b of a.selfAndAllSubLayers())yield b.GetILayer()}get isVisible(){return map$jscomp$4.get(this)._IsVisibleFlagSet()}set isVisible(a){map$jscomp$4.get(this).SetVisible(a)}get isSelfAndParentsVisible(){return map$jscomp$4.get(this).IsVisible()}get isInteractive(){return map$jscomp$4.get(this).IsInteractive()}set isInteractive(a){map$jscomp$4.get(this).SetInteractive(a)}get isSelfAndParentsInteractive(){return map$jscomp$4.get(this).IsSelfAndParentsInteractive()}get opacity(){return map$jscomp$4.get(this).GetOpacity()}set opacity(a){a=
C3$jscomp$63.clamp(+a,0,1);isNaN(a)||map$jscomp$4.get(this).SetOpacity(a)}set scale(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetOwnScale(a)}get scale(){return map$jscomp$4.get(this).GetOwnScale()}set scaleRate(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetScaleRate(a)}get scaleRate(){return map$jscomp$4.get(this).GetScaleRate()}set angle(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetAngle(a)}get angle(){return map$jscomp$4.get(this).GetOwnAngle()}set parallaxX(a){C3X$jscomp$6.RequireFiniteNumber(a);
map$jscomp$4.get(this).SetParallaxX(a)}get parallaxX(){return map$jscomp$4.get(this).GetParallaxX()}set parallaxY(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetParallaxY(a)}get parallaxY(){return map$jscomp$4.get(this).GetParallaxY()}set zElevation(a){C3X$jscomp$6.RequireFiniteNumber(a);map$jscomp$4.get(this).SetZElevation(a)}get zElevation(){return map$jscomp$4.get(this).GetZElevation()}set isTransparent(a){map$jscomp$4.get(this).SetTransparent(a)}get isTransparent(){return map$jscomp$4.get(this).IsTransparent()}set isForceOwnTexture(a){map$jscomp$4.get(this).SetForceOwnTexture(a)}get isForceOwnTexture(){return map$jscomp$4.get(this).IsForceOwnTexture()}set blendMode(a){C3X$jscomp$6.RequireString(a);
a=BLEND_MODE_TO_INDEX.get(a);if("number"!==typeof a)throw Error("invalid blend mode");map$jscomp$4.get(this).SetBlendMode(a)}get blendMode(){return INDEX_TO_BLEND_MODE.get(map$jscomp$4.get(this).GetBlendMode())}set backgroundColor(a){C3X$jscomp$6.RequireArray(a);if(3&gt;a.length)throw Error("expected 3 elements");tempColor$jscomp$1.setRgb(a[0],a[1],a[2]);a=map$jscomp$4.get(this);const b=a.GetBackgroundColor();b.equalsIgnoringAlpha(tempColor$jscomp$1)||(b.copyRgb(tempColor$jscomp$1),a.GetRuntime().UpdateRender())}get backgroundColor(){const a=
map$jscomp$4.get(this).GetBackgroundColor();return[a.getR(),a.getG(),a.getB()]}set scrollX(a){C3X$jscomp$6.RequireNumber(a);const b=map$jscomp$4.get(this);b.SetOwnScrollPositionEnabled(!0);b.SetScrollX(a)}get scrollX(){return map$jscomp$4.get(this).GetScrollX()}set scrollY(a){C3X$jscomp$6.RequireNumber(a);const b=map$jscomp$4.get(this);b.SetOwnScrollPositionEnabled(!0);b.SetScrollY(a)}get scrollY(){return map$jscomp$4.get(this).GetScrollY()}scrollTo(a,b){C3X$jscomp$6.RequireNumber(a);C3X$jscomp$6.RequireNumber(b);
const d=map$jscomp$4.get(this);d.SetOwnScrollPositionEnabled(!0);d.SetScrollX(a);d.SetScrollY(b)}restoreScrollPosition(){map$jscomp$4.get(this).SetOwnScrollPositionEnabled(!1)}getViewport(){return map$jscomp$4.get(this).GetViewport().toDOMRect()}cssPxToLayer(a,b,d=0){C3X$jscomp$6.RequireNumber(a);C3X$jscomp$6.RequireNumber(b);C3X$jscomp$6.RequireNumber(d);const c=map$jscomp$4.get(this),e=c.GetRuntime();return c.CanvasCssToLayer(a-e.GetCanvasClientX(),b-e.GetCanvasClientY(),d)}layerToCssPx(a,b,d=0){C3X$jscomp$6.RequireNumber(a);
C3X$jscomp$6.RequireNumber(b);C3X$jscomp$6.RequireNumber(d);const c=map$jscomp$4.get(this),e=c.GetRuntime(),[h,k]=c.LayerToCanvasCss(a,b,d);return[h+e.GetCanvasClientX(),k+e.GetCanvasClientY()]}};"use strict";const C3$jscomp$64=self.C3,C3X$jscomp$7=self.C3X,map$jscomp$5=new WeakMap,dispatchers=new WeakMap;function GetDispatcher(a){let b=dispatchers.get(a);if(b)return b;b=C3$jscomp$64.New(C3$jscomp$64.Event.Dispatcher);dispatchers.set(a,b);return b}let initInst=null;
self.IInstance=class{constructor(){map$jscomp$5.set(this,initInst);const a={runtime:{value:initInst.GetRuntime().GetIRuntime(),writable:!1},objectType:{value:initInst.GetObjectClass().GetIObjectClass(),writable:!1},uid:{value:initInst.GetUID(),writable:!1}};initInst._GetInstVarsScriptDescriptor(a);initInst._GetBehaviorsScriptDescriptor(a);Object.defineProperties(this,a);initInst.GetRuntime()._MapScriptInterface(this,initInst)}static _Init(a){initInst=a}static _GetInitInst(){return initInst}_Release(){const a=
dispatchers.get(this);a&amp;&amp;(a.Release(),dispatchers.delete(this));map$jscomp$5.delete(this)}addEventListener(a,b,d){C3X$jscomp$7.RequireString(a);C3X$jscomp$7.RequireFunction(b);GetDispatcher(this).addEventListener(a,b,d)}removeEventListener(a,b,d){C3X$jscomp$7.RequireString(a);C3X$jscomp$7.RequireFunction(b);GetDispatcher(this).removeEventListener(a,b,d)}dispatchEvent(a){GetDispatcher(this).dispatchEvent(a)}destroy(){const a=map$jscomp$5.get(this),b=a.GetRuntime();b.DestroyInstance(a);b.GetEventSheetManager().IsInEventEngine()||
b.FlushPendingInstances()}getOtherContainerInstances(){const a=map$jscomp$5.get(this).GetSiblings();return a?a.map(b=&gt;b.GetInterfaceClass()):[]}*otherContainerInstances(){const a=map$jscomp$5.get(this);if(a.IsInContainer())for(const b of a.siblings())yield b.GetInterfaceClass()}};"use strict";
const C3$jscomp$65=self.C3,C3X$jscomp$8=self.C3X,IInstance$jscomp$1=self.IInstance,ILayer$jscomp$1=self.ILayer,map$jscomp$6=new WeakMap,BLEND_MODE_TO_INDEX$jscomp$1=new Map([["normal",0],["additive",1],["copy",3],["destination-over",4],["source-in",5],["destination-in",6],["source-out",7],["destination-out",8],["source-atop",9],["destination-atop",10]]),INDEX_TO_BLEND_MODE$jscomp$1=new Map([...BLEND_MODE_TO_INDEX$jscomp$1.entries()].map(a=&gt;[a[1],a[0]])),tempColor$jscomp$2=C3$jscomp$65.New(C3$jscomp$65.Color);
self.IWorldInstance=class a extends IInstance$jscomp$1{constructor(){super();var b=IInstance$jscomp$1._GetInitInst();map$jscomp$6.set(this,b);const d=[];var c=b.GetWorldInfo();if(b=c.GetInstanceEffectList()){c=c.GetObjectClass().GetEffectList().GetAllEffectTypes().length;for(let e=0;e&lt;c;++e)d.push(new self.IEffectInstance(b,e))}Object.defineProperties(this,{effects:{value:d,writable:!1}})}get layout(){return map$jscomp$6.get(this).GetWorldInfo().GetLayout().GetILayout()}get layer(){return map$jscomp$6.get(this).GetWorldInfo().GetLayer().GetILayer()}get x(){return map$jscomp$6.get(this).GetWorldInfo().GetX()}set x(b){b=
+b;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||d.GetX()===b||(d.SetX(b),d.SetBboxChanged())}get y(){return map$jscomp$6.get(this).GetWorldInfo().GetY()}set y(b){b=+b;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||d.GetY()===b||(d.SetY(b),d.SetBboxChanged())}get zElevation(){return map$jscomp$6.get(this).GetWorldInfo().GetZElevation()}set zElevation(b){b=+b;const d=map$jscomp$6.get(this),c=d.GetWorldInfo();isNaN(b)||c.GetZElevation()===b||(c.SetZElevation(b),d.GetRuntime().UpdateRender())}get totalZElevation(){return map$jscomp$6.get(this).GetWorldInfo().GetTotalZElevation()}get width(){return map$jscomp$6.get(this).GetWorldInfo().GetWidth()}set width(b){b=
+b;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||d.GetWidth()===b||(d.SetWidth(b),d.SetBboxChanged())}get height(){return map$jscomp$6.get(this).GetWorldInfo().GetHeight()}set height(b){b=+b;const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||d.GetHeight()===b||(d.SetHeight(b),d.SetBboxChanged())}get angle(){return map$jscomp$6.get(this).GetWorldInfo().GetAngle()}set angle(b){b=C3$jscomp$65.clampAngle(+b);const d=map$jscomp$6.get(this).GetWorldInfo();isNaN(b)||d.GetAngle()===b||(d.SetAngle(b),
d.SetBboxChanged())}get angleDegrees(){return C3$jscomp$65.toDegrees(this.angle)}set angleDegrees(b){this.angle=C3$jscomp$65.toRadians(b)}getBoundingBox(){return map$jscomp$6.get(this).GetWorldInfo().GetBoundingBox().toDOMRect()}getBoundingQuad(){return map$jscomp$6.get(this).GetWorldInfo().GetBoundingQuad().toDOMQuad()}get isVisible(){return map$jscomp$6.get(this).GetWorldInfo().IsVisible()}set isVisible(b){b=!!b;const d=map$jscomp$6.get(this),c=d.GetWorldInfo();c.IsVisible()!==b&amp;&amp;(c.SetVisible(b),
d.GetRuntime().UpdateRender())}get opacity(){return map$jscomp$6.get(this).GetWorldInfo().GetOpacity()}set opacity(b){b=C3$jscomp$65.clamp(+b,0,1);const d=map$jscomp$6.get(this),c=d.GetWorldInfo();isNaN(b)||c.GetOpacity()===b||(c.SetOpacity(b),d.GetRuntime().UpdateRender())}set colorRgb(b){C3X$jscomp$8.RequireArray(b);if(3&gt;b.length)throw Error("expected 3 elements");tempColor$jscomp$2.setRgb(b[0],b[1],b[2]);b=map$jscomp$6.get(this);const d=b.GetWorldInfo();d.GetUnpremultipliedColor().equalsIgnoringAlpha(tempColor$jscomp$2)||
(d.SetUnpremultipliedColor(tempColor$jscomp$2),b.GetRuntime().UpdateRender())}get colorRgb(){const b=map$jscomp$6.get(this).GetWorldInfo().GetUnpremultipliedColor();return[b.getR(),b.getG(),b.getB()]}set blendMode(b){C3X$jscomp$8.RequireString(b);b=BLEND_MODE_TO_INDEX$jscomp$1.get(b);if("number"!==typeof b)throw Error("invalid blend mode");const d=map$jscomp$6.get(this);d.GetWorldInfo().SetBlendMode(b);d.GetRuntime().UpdateRender()}get blendMode(){return INDEX_TO_BLEND_MODE$jscomp$1.get(map$jscomp$6.get(this).GetWorldInfo().GetBlendMode())}moveToTop(){map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToTop()}moveToBottom(){map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToBottom()}moveToLayer(b){C3X$jscomp$8.RequireInstanceOf(b,
ILayer$jscomp$1);b=ILayer$jscomp$1._Unwrap(b);if(!b)throw Error("invalid layer");map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveToLayer(b)}moveAdjacentToInstance(b,d){C3X$jscomp$8.RequireInstanceOf(b,a);map$jscomp$6.get(this).GetWorldInfo().ZOrderMoveAdjacentToInstance(map$jscomp$6.get(b),d)}get zIndex(){return map$jscomp$6.get(this).GetWorldInfo().GetZIndex()}containsPoint(b,d){C3X$jscomp$8.RequireNumber(b);C3X$jscomp$8.RequireNumber(d);return map$jscomp$6.get(this).GetWorldInfo().ContainsPoint(+b,
+d)}testOverlap(b){C3X$jscomp$8.RequireInstanceOf(b,a);const d=map$jscomp$6.get(this);b=map$jscomp$6.get(b);return d.GetRuntime().GetCollisionEngine().TestOverlap(d,b)}testOverlapSolid(){var b=map$jscomp$6.get(this);return(b=b.GetRuntime().GetCollisionEngine().TestOverlapSolid(b))?b.GetInterfaceClass():null}getParent(){const b=map$jscomp$6.get(this).GetParent();return b?b.GetInterfaceClass():null}getTopParent(){const b=map$jscomp$6.get(this).GetTopParent();return b?b.GetInterfaceClass():null}*parents(){for(const b of map$jscomp$6.get(this).parents())yield b.GetInterfaceClass()}getChildCount(){return map$jscomp$6.get(this).GetChildCount()}getChildAt(b){return(b=
map$jscomp$6.get(this).GetChildAt(b))?b.GetInterfaceClass():null}*children(){for(const b of map$jscomp$6.get(this).children())yield b.GetInterfaceClass()}*allChildren(){for(const b of map$jscomp$6.get(this).allChildren())yield b.GetInterfaceClass()}addChild(b,d){C3X$jscomp$8.RequireInstanceOf(b,a);C3X$jscomp$8.RequireOptionalObject(d);d||(d={});const c=map$jscomp$6.get(this);b=map$jscomp$6.get(b);c.AddChild(b,d)}removeChild(b){C3X$jscomp$8.RequireInstanceOf(b,a);const d=map$jscomp$6.get(this);b=map$jscomp$6.get(b);
d.RemoveChild(b)}removeFromParent(){const b=map$jscomp$6.get(this);b.HasParent()&amp;&amp;b.GetParent().RemoveChild(b)}createMesh(b,d){C3X$jscomp$8.RequireFiniteNumber(b);C3X$jscomp$8.RequireFiniteNumber(d);map$jscomp$6.get(this).GetWorldInfo().CreateMesh(b,d)}releaseMesh(){const b=map$jscomp$6.get(this).GetWorldInfo();b.ReleaseMesh();b.SetBboxChanged()}setMeshPoint(b,d,c){C3X$jscomp$8.RequireFiniteNumber(b);C3X$jscomp$8.RequireFiniteNumber(d);C3X$jscomp$8.RequireObject(c);const e=map$jscomp$6.get(this).GetWorldInfo();
e.SetMeshPoint(b,d,c)&amp;&amp;e.SetBboxChanged()}getMeshSize(){var b=map$jscomp$6.get(this).GetWorldInfo();if(!b.HasMesh())return[0,0];b=b.GetSourceMesh();return[b.GetHSize(),b.GetVSize()]}};"use strict";const C3X$jscomp$9=self.C3X,map$jscomp$7=new WeakMap;
self.IDOMInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$7.set(this,self.IInstance._GetInitInst())}getElement(){return map$jscomp$7.get(this).GetSdkInstance()._GetElementInDOMMode()}focus(){map$jscomp$7.get(this).GetSdkInstance().FocusElement()}blur(){map$jscomp$7.get(this).GetSdkInstance().BlurElement()}setCssStyle(a,b){C3X$jscomp$9.RequireString(a);map$jscomp$7.get(this).GetSdkInstance().SetElementCSSStyle(a,b)}};"use strict";
const C3$jscomp$67=self.C3,C3X$jscomp$10=self.C3X,map$jscomp$8=new WeakMap,dispatchers$jscomp$1=new WeakMap;function GetDispatcher$jscomp$1(a){let b=dispatchers$jscomp$1.get(a);if(b)return b;b=C3$jscomp$67.New(C3$jscomp$67.Event.Dispatcher);dispatchers$jscomp$1.set(a,b);return b}let initBehInst=null;
self.IBehaviorInstance=class{constructor(){map$jscomp$8.set(this,initBehInst);const a={runtime:{value:initBehInst.GetRuntime().GetIRuntime(),writable:!1},behavior:{value:initBehInst.GetBehavior().GetIBehavior(),writable:!1}};Object.defineProperties(this,a)}static _Init(a){initBehInst=a}static _GetInitInst(){return initBehInst}get instance(){return map$jscomp$8.get(this).GetObjectInstance().GetInterfaceClass()}_Release(){const a=dispatchers$jscomp$1.get(this);a&amp;&amp;(a.Release(),dispatchers$jscomp$1.delete(this));
map$jscomp$8.delete(this)}addEventListener(a,b,d){C3X$jscomp$10.RequireString(a);C3X$jscomp$10.RequireFunction(b);GetDispatcher$jscomp$1(this).addEventListener(a,b,d)}removeEventListener(a,b,d){C3X$jscomp$10.RequireString(a);C3X$jscomp$10.RequireFunction(b);GetDispatcher$jscomp$1(this).removeEventListener(a,b,d)}dispatchEvent(a){GetDispatcher$jscomp$1(this).dispatchEvent(a)}};"use strict";const map$jscomp$9=new WeakMap;
self.IBehavior=class{constructor(a){map$jscomp$9.set(this,a);a={runtime:{value:a.GetRuntime().GetIRuntime(),writable:!1}};Object.defineProperties(this,a)}getAllInstances(){return map$jscomp$9.get(this).GetInstances().map(a=&gt;a.GetInterfaceClass())}};"use strict";const C3$jscomp$69=self.C3,C3X$jscomp$12=self.C3X,map$jscomp$10=new WeakMap,tempColor$jscomp$3=C3$jscomp$69.New(C3$jscomp$69.Color);
self.IEffectInstance=class{constructor(a,b){map$jscomp$10.set(this,a);Object.defineProperties(this,{index:{value:b,writable:!1}})}get name(){return map$jscomp$10.get(this).GetAllEffectTypes()[this.index].GetName()}get isActive(){return map$jscomp$10.get(this).IsEffectIndexActive(this.index)}set isActive(a){a=!!a;const b=map$jscomp$10.get(this);b.IsEffectIndexActive(this.index)!==a&amp;&amp;(b.SetEffectIndexActive(this.index,a),b.UpdateActiveEffects(),b.GetRuntime().UpdateRender())}setParameter(a,b){C3X$jscomp$12.RequireFiniteNumber(a);
a=Math.floor(+a);const d=map$jscomp$10.get(this),c=d.GetEffectParameter(this.index,a);if(null===c)throw new RangeError("invalid index");if(c instanceof C3$jscomp$69.Color){if(!Array.isArray(b)||3&gt;b.length)throw new TypeError("expected array with 3 elements");tempColor$jscomp$3.setRgb(b[0],b[1],b[2]);b=tempColor$jscomp$3}else if("number"!==typeof b)throw new TypeError("expected number");d.SetEffectParameter(this.index,a,b)&amp;&amp;d.IsEffectIndexActive(this.index)&amp;&amp;d.GetRuntime().UpdateRender()}getParameter(a){C3X$jscomp$12.RequireFiniteNumber(a);
a=Math.floor(+a);a=map$jscomp$10.get(this).GetEffectParameter(this.index,a);if(null===a)throw new RangeError("invalid index");return a instanceof C3$jscomp$69.Color?[a.getR(),a.getG(),a.getB()]:a}};"use strict";const map$jscomp$11=new WeakMap;
self.IAnimation=class{constructor(a){map$jscomp$11.set(this,a);Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},speed:{value:a.GetSpeed(),writable:!1},isLooping:{value:a.IsLooping(),writable:!1},repeatCount:{value:a.GetRepeatCount(),writable:!1},repeatTo:{value:a.GetRepeatTo(),writable:!1},isPingPong:{value:a.IsPingPong(),writable:!1},frameCount:{value:a.GetFrameCount(),writable:!1}})}getFrames(){return map$jscomp$11.get(this).GetFrames().map(a=&gt;a.GetIAnimationFrame())}*frames(){for(const a of map$jscomp$11.get(this).GetFrames())yield a.GetIAnimationFrame()}};
"use strict";const map$jscomp$12=new WeakMap;self.IImageInfo=class{constructor(a){map$jscomp$12.set(this,a)}get width(){return map$jscomp$12.get(this).GetWidth()}get height(){return map$jscomp$12.get(this).GetHeight()}};"use strict";const map$jscomp$13=new WeakMap;
self.IAnimationFrame=class extends self.IImageInfo{constructor(a){super(a.GetImageInfo());map$jscomp$13.set(this,a);Object.defineProperties(this,{duration:{value:a.GetDuration(),writable:!1},originX:{value:a.GetOriginX(),writable:!1},originY:{value:a.GetOriginY(),writable:!1}})}};"use strict";const C3X$jscomp$16=self.C3X,map$jscomp$14=new WeakMap;function GetTimelineState(a){a=map$jscomp$14.get(a);if(a.IsReleased())throw Error("timeline/tween was released and is no longer valid");return a}
self.ITimelineState=class{constructor(a){map$jscomp$14.set(this,a)}pause(){GetTimelineState(this).Stop()}resume(){GetTimelineState(this).Resume()}hasTags(a){return GetTimelineState(this).HasTags(a)}set time(a){C3X$jscomp$16.RequireFiniteNumber(a);GetTimelineState(this).SetTime(a)}get time(){return GetTimelineState(this).GetTime()}set totalTime(a){C3X$jscomp$16.RequireFiniteNumber(a);GetTimelineState(this).SetTotalTime(a)}get totalTime(){return GetTimelineState(this).GetTotalTime()}set isLooping(a){GetTimelineState(this).SetLoop(!!a)}get isLooping(){return GetTimelineState(this).GetLoop()}set isPingPong(a){GetTimelineState(this).SetPingPong(!!a)}get isPingPong(){return GetTimelineState(this).GetPingPong()}set playbackRate(a){C3X$jscomp$16.RequireFiniteNumber(a);
GetTimelineState(this).SetPlaybackRate(a)}get playbackRate(){return GetTimelineState(this).GetPlaybackRate()}get progress(){const a=GetTimelineState(this);return a.GetTime()/a.GetTotalTime()}get tags(){return GetTimelineState(this).GetTags()}get finished(){return GetTimelineState(this).GetPlayPromise()}get isPlaying(){return GetTimelineState(this).IsPlaying()}get isPaused(){return GetTimelineState(this).IsPaused()}get isReleased(){return map$jscomp$14.get(this).IsReleased()}};"use strict";
const C3X$jscomp$17=self.C3X,map$jscomp$15=new WeakMap,behInstMap=new WeakMap;let easeToIndexFunc=null;function GetTweenState(a){a=map$jscomp$15.get(a);if(a.IsReleased())throw Error("timeline/tween was released and is no longer valid");return a}
self.ITweenState=class extends self.ITimelineState{constructor(a,b,d){super(a);easeToIndexFunc||(easeToIndexFunc=d.easeToIndexFunc);map$jscomp$15.set(this,a);b&amp;&amp;behInstMap.set(this,b)}stop(){const a=GetTweenState(this);behInstMap.get(this).ReleaseTween(a)}setEase(a){C3X$jscomp$17.RequireString(a);a=self.Ease.GetEaseFromIndex(easeToIndexFunc(a));GetTweenState(this).SetEase(a)}get instance(){const a=GetTweenState(this).GetInstance();return a?a.GetInterfaceClass():null}get isDestroyOnComplete(){return GetTweenState(this).GetDestroyInstanceOnComplete()}set isDestroyOnComplete(a){GetTweenState(this).SetDestroyInstanceOnComplete(!!a)}get value(){const a=
GetTweenState(this);if("value"!==a.GetId())throw Error("not a value tween");return a.GetPropertyTrack("value").GetSourceAdapterValue()}};"use strict";const C3$jscomp$75=self.C3,VALID_LOAD_POLICIES=new Set(["local","remote"]),EXT_TO_TYPE=new Map([["mp4","video/mp4"],["webm","video/webm"],["m4a","audio/mp4"],["mp3","audio/mpeg"],["js","application/javascript"],["wasm","application/wasm"],["svg","image/svg+xml"],["html","text/html"]]);
function GetTypeFromFileExtension(a){if(!a)return"";a=a.split(".");if(2&gt;a.length)return"";a=a.at(-1).toLowerCase();return EXT_TO_TYPE.get(a)||""}function AddScript(a){return new Promise((b,d)=&gt;{const c=document.createElement("script");c.onload=b;c.onerror=d;c.async=!1;c.type="module";c.src=a;document.head.appendChild(c)})}
C3$jscomp$75.AssetManager=class extends C3$jscomp$75.DefendedBase{constructor(a,b){super();var d=b.exportType;this._runtime=a;this._localUrlBlobs=new Map;this._localBlobUrlCache=new Map;this._localBlobSWUrls=new Map;this._isCordova="cordova"===d;this._isiOSCordova=!!b.isiOSCordova;this._isFileProtocol=!!b.isFileProtocol;this._swClientId=b.swClientId;this._supportedAudioFormats=b.supportedAudioFormats||{};this._audioFiles=new Map;this._preloadSounds=!1;this._iconsSubfolder=this._fontsSubfolder=this._mediaSubfolder=
"";this._defaultLoadPolicy="html5"===d||"scirra-arcade"===d||"instant-games"===d?"remote":"local";this._allAssets=[];this._assetsByUrl=new Map;this._webFonts=[];this._loadPromises=[];this._hasFinishedInitialLoad=!1;this._lastLoadProgress=this._assetSizeLoaded=this._totalAssetSizeToLoad=0;this._hasHadErrorLoading=!1;this._loadingRateLimiter=C3$jscomp$75.New(C3$jscomp$75.RateLimiter,()=&gt;this._FireLoadingProgressEvent(),50);this._promiseThrottle=new C3$jscomp$75.PromiseThrottle(Math.max(C3$jscomp$75.hardwareConcurrency,
8));if(a=b.previewImageBlobs){(d=b.previewProjectFileBlobs)&amp;&amp;Object.assign(a,d);(d=b.projectData)&amp;&amp;(a["data.json"]=d);for(const [c,e]of Object.entries(a))this._localUrlBlobs.set(c.toLowerCase(),e)}if(b=b.previewProjectFileSWUrls)for(const [c,e]of Object.entries(b))this._localBlobSWUrls.set(c,e);this._iAssetManager=new self.IAssetManager(this)}Release(){this._localUrlBlobs.clear();for(const a of this._localBlobUrlCache.values())a.startsWith("blob:")&amp;&amp;URL.revokeObjectURL(a);this._localBlobUrlCache.clear();
for(const a of this._allAssets)a.Release();C3$jscomp$75.clearArray(this._allAssets);this._assetsByUrl.clear();C3$jscomp$75.clearArray(this._loadPromises);this._runtime=null}GetRuntime(){return this._runtime}_SetMediaSubfolder(a){this._mediaSubfolder=a}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(a){this._fontsSubfolder=a}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(a){this._iconsSubfolder=a}GetIconsSubfolder(){return this._iconsSubfolder}IsFileProtocol(){return this._isFileProtocol}_HasLocalUrlBlob(a){return this._localUrlBlobs.has(a.toLowerCase())}_GetLocalUrlBlob(a){return this._localUrlBlobs.get(a.toLowerCase())||
null}GetLocalUrlAsBlobUrl(a){if(!this._HasLocalUrlBlob(a))return a;a=a.toLowerCase();var b=this._localBlobUrlCache.get(a);b||(b=this._GetLocalUrlBlob(a),b=URL.createObjectURL(b),this._localBlobUrlCache.set(a,b));return b}FetchBlob(a,b){b=b||this._defaultLoadPolicy;const d=this._GetLocalUrlBlob(a);if(d)return Promise.resolve(d);if(C3$jscomp$75.IsRelativeURL(a)){const c=a.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsBlob(c):"local"===b?this._promiseThrottle.Add(()=&gt;
C3$jscomp$75.FetchBlob(c)):C3$jscomp$75.FetchBlob(c)}return C3$jscomp$75.FetchBlob(a)}FetchArrayBuffer(a){const b=this._GetLocalUrlBlob(a);if(b)return C3$jscomp$75.BlobToArrayBuffer(b);if(C3$jscomp$75.IsRelativeURL(a)){const d=a.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsArrayBuffer(d):"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=&gt;C3$jscomp$75.FetchArrayBuffer(d)):C3$jscomp$75.FetchArrayBuffer(d)}return C3$jscomp$75.FetchArrayBuffer(a)}FetchText(a){const b=
this._GetLocalUrlBlob(a);if(b)return C3$jscomp$75.BlobToString(b);if(C3$jscomp$75.IsRelativeURL(a)){const d=a.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsText(d):"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=&gt;C3$jscomp$75.FetchText(d)):C3$jscomp$75.FetchText(d)}return C3$jscomp$75.FetchText(a)}async FetchJson(a){a=await this.FetchText(a);return JSON.parse(a)}_CordovaFetchLocalFileAs(a,b){return this._runtime.PostComponentMessageToDOMAsync("runtime",
"cordova-fetch-local-file",{filename:a,as:b})}CordovaFetchLocalFileAsText(a){return this._CordovaFetchLocalFileAs(a,"text")}async CordovaFetchLocalFileAsBlob(a){const b=await this._CordovaFetchLocalFileAs(a,"buffer");a=GetTypeFromFileExtension(a);return new Blob([b],{type:a})}async CordovaFetchLocalFileAsBlobURL(a){a=a.toLowerCase();var b=this._localBlobUrlCache.get(a);if(b)return b;b=await this.CordovaFetchLocalFileAsBlob(a);b=URL.createObjectURL(b);this._localBlobUrlCache.set(a,b);return b}CordovaFetchLocalFileAsArrayBuffer(a){return this._CordovaFetchLocalFileAs(a,
"buffer")}GetMediaFileUrl(a){return this._HasLocalUrlBlob(a)?this.GetLocalUrlAsBlobUrl(a):this._mediaSubfolder+a.toLowerCase()}GetProjectFileUrl(a,b=""){if(C3$jscomp$75.IsAbsoluteURL(a)){if(b)throw Error("cannot specify subfolder with remote URL");return Promise.resolve(a)}return this._HasLocalUrlBlob(a)?Promise.resolve(this.GetLocalUrlAsBlobUrl(a)):this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsBlobURL(b+a):Promise.resolve(b+a.toLowerCase())}GetProjectFileIframeUrl(a){if(C3$jscomp$75.IsAbsoluteURL(a))return Promise.resolve(a);
var b=a.indexOf("?"),d=-1===b?"":a.substr(b);b=-1===b?a:a.substr(0,b);return this._HasLocalUrlBlob(b)?(a=this._localBlobSWUrls.get(b)||this.GetLocalUrlAsBlobUrl(b),!a.startsWith("blob:")&amp;&amp;this._swClientId&amp;&amp;(a=new URL(a),d=new URLSearchParams(d),d.set("__c3_client_id",this._swClientId),a.search=d.toString(),a=a.toString()),Promise.resolve(a)):this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsBlobURL(b):Promise.resolve(a.toLowerCase())}LoadProjectFileUrl(a){return this.GetProjectFileUrl(a)}LoadImage(a){if(a.loadPolicy&amp;&amp;
!VALID_LOAD_POLICIES.has(a.loadPolicy))throw Error("invalid load policy");let b=this._assetsByUrl.get(a.url);if(b)return b;b=C3$jscomp$75.New(C3$jscomp$75.ImageAsset,this,{url:a.url,size:a.size||0,loadPolicy:a.loadPolicy||this._defaultLoadPolicy});this._allAssets.push(b);this._assetsByUrl.set(b.GetURL(),b);this._hasFinishedInitialLoad||(this._totalAssetSizeToLoad+=b.GetSize(),this._loadPromises.push(b.Load().then(()=&gt;this._AddLoadedSize(b.GetSize()))));return b}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises),
this._lastLoadProgress=1}catch(a){console.error("Error loading: ",a),this._hasHadErrorLoading=!0,this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=!0}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(a){this._assetSizeLoaded+=a;this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const a=C3$jscomp$75.New(C3$jscomp$75.Event,"loadingprogress");this._lastLoadProgress=C3$jscomp$75.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1);
a.progress=this._lastLoadProgress;this._runtime.Dispatcher().dispatchEvent(a)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(a){C3$jscomp$75.shallowAssignArray(this._webFonts,a);this._webFonts.length&amp;&amp;this._loadPromises.push(this._LoadWebFonts())}_LoadWebFonts(){if("undefined"===typeof FontFace)return Promise.resolve();const a=[];for(const [b,d,c]of this._webFonts)this._totalAssetSizeToLoad+=c,a.push(this._LoadWebFont(b,d).then(()=&gt;this._AddLoadedSize(c)));return Promise.all(a)}async _LoadWebFont(a,
b){try{const d=await this.GetProjectFileUrl(b,this._fontsSubfolder),c=new FontFace(a,`url('${d}')`);this._runtime.IsInWorker()?self.fonts.add(c):document.fonts.add(c);await c.load()}catch(d){console.warn(`[C3 runtime] Failed to load web font '${a}': `,d)}}IsAudioFormatSupported(a){return!!this._supportedAudioFormats[a]}_SetAudioFiles(a,b){this._preloadSounds=!!b;for(const [d,c,e]of a)this._audioFiles.set(d,{fileName:d,formats:c.map(h=&gt;({type:h[0],fileExtension:h[1],fullName:d+h[1],fileSize:h[2]})),
isMusic:e})}GetPreferredAudioFile(a){a=this._audioFiles.get(a.toLowerCase());if(!a)return null;let b=null;for(const d of a.formats)if(b||"audio/webm; codecs=opus"!==d.type||(b=d),this.IsAudioFormatSupported(d.type))return d;return b}GetProjectAudioFileUrl(a){return(a=this.GetPreferredAudioFile(a))?{url:this.GetMediaFileUrl(a.fullName),type:a.type}:null}GetAudioToPreload(){if(this._preloadSounds){const a=[];for(const b of this._audioFiles.values()){if(b.isMusic)continue;const d=this.GetPreferredAudioFile(b.fileName);
d&amp;&amp;a.push({originalUrl:b.fileName,url:this.GetMediaFileUrl(d.fullName),type:d.type,fileSize:d.fileSize})}return a}return[]}GetIAssetManager(){return this._iAssetManager}async LoadScripts(...a){const b=await Promise.all(a.map(d=&gt;this.GetProjectFileUrl(d)));this._runtime.IsInWorker()?1===a.length?(a=a[0],await self.c3_import((C3$jscomp$75.IsRelativeURL(a)?"./":"")+a)):(a=a.map(d=&gt;`import "${C3$jscomp$75.IsRelativeURL(d)?"./":""}${d}";`).join("\n"),a=URL.createObjectURL(new Blob([a],{type:"application/javascript"})),
await self.c3_import(a)):await Promise.all(b.map(d=&gt;AddScript(d)))}async CompileWebAssembly(a){if(WebAssembly.compileStreaming)return a=await this.GetProjectFileUrl(a),await WebAssembly.compileStreaming(fetch(a));a=await C3$jscomp$75.FetchArrayBuffer(a);return await WebAssembly.compile(a)}async LoadStyleSheet(a){a=await this.GetProjectFileUrl(a);return await this._runtime.PostComponentMessageToDOMAsync("runtime","add-stylesheet",{url:a})}};"use strict";const C3$jscomp$76=self.C3;
C3$jscomp$76.Asset=class extends C3$jscomp$76.DefendedBase{constructor(a,b){super();this._assetManager=a;this._runtime=a.GetRuntime();this._url=b.url;this._size=b.size;this._loadPolicy=b.loadPolicy;this._blob=null;this._isLoaded=!1;this._loadPromise=null}Release(){this._blob=this._runtime=this._assetManager=this._loadPromise=null}GetURL(){return this._url}GetSize(){return this._size}Load(){return"local"===this._loadPolicy||this._blob?(this._isLoaded=!0,Promise.resolve()):this._loadPromise?this._loadPromise:
this._loadPromise=this._assetManager.FetchBlob(this._url,this._loadPolicy).then(a=&gt;{this._isLoaded=!0;this._loadPromise=null;return this._blob=a}).catch(a=&gt;console.error("Error loading resource: ",a))}IsLoaded(){return this._isLoaded}GetBlob(){return this._blob?Promise.resolve(this._blob):this._loadPromise?this._loadPromise:this._assetManager.FetchBlob(this._url,this._loadPolicy)}};"use strict";const C3$jscomp$77=self.C3,promiseThrottle=new C3$jscomp$77.PromiseThrottle,allImageAssets=new Set;
C3$jscomp$77.ImageAsset=class extends C3$jscomp$77.Asset{constructor(a,b){super(a,b);this._webglTexture=this._texturePromise=null;this._refCount=0;this._imageHeight=this._imageWidth=-1;allImageAssets.add(this)}Release(){this.ReleaseTexture();if(0!==this._refCount)throw Error("released image asset which still has texture references");this._texturePromise=null;allImageAssets.delete(this);super.Release()}static OnWebGLContextLost(){for(const a of allImageAssets)a._texturePromise=null,a._webglTexture=
null,a._refCount=0}LoadStaticTexture(a,b){b=b||{};this._refCount++;if(this._webglTexture)return Promise.resolve(this._webglTexture);if(this._texturePromise)return this._texturePromise;b.anisotropy=this._runtime.GetCanvasManager().GetTextureAnisotropy();return this._texturePromise=this.GetBlob().then(d=&gt;promiseThrottle.Add(()=&gt;a.CreateStaticTextureAsync(d,b).then(c=&gt;{this._texturePromise=null;if(0===this._refCount)return a.DeleteTexture(c),null;this._webglTexture=c;this._imageWidth=c.GetWidth();this._imageHeight=
c.GetHeight();return this._webglTexture}))).catch(d=&gt;{console.error("Failed to load texture: ",d);throw d;})}ReleaseTexture(){if(0&gt;=this._refCount)throw Error("texture released too many times");this._refCount--;0===this._refCount&amp;&amp;this._webglTexture&amp;&amp;(this._webglTexture.GetRenderer().DeleteTexture(this._webglTexture),this._webglTexture=null)}GetTexture(){return this._webglTexture}GetWidth(){return this._imageWidth}GetHeight(){return this._imageHeight}async LoadToDrawable(){const a=await this.GetBlob();
return C3$jscomp$77.Supports.ImageBitmapOptions?await createImageBitmap(a,{premultiplyAlpha:"none"}):C3$jscomp$77.Supports.ImageBitmap?await createImageBitmap(a):await C3$jscomp$77.BlobToImage(a)}};"use strict";const C3$jscomp$78=self.C3;function SortByInstLastCachedZIndex(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()}
C3$jscomp$78.RenderCell=class extends C3$jscomp$78.DefendedBase{constructor(a,b,d){super();this._grid=a;this._x=b;this._y=d;this._instances=[];this._isSorted=!0;this._pendingRemoval=new Set;this._isAnyPendingRemoval=!1}Release(){C3$jscomp$78.clearArray(this._instances);this._pendingRemoval.clear();this._grid=null}Reset(){C3$jscomp$78.clearArray(this._instances);this._isSorted=!0;this._pendingRemoval.clear();this._isAnyPendingRemoval=!1}SetChanged(){this._isSorted=!1}IsEmpty(){if(!this._instances.length)return!0;
if(this._instances.length&gt;this._pendingRemoval.size)return!1;this._FlushPending();return!0}Insert(a){this._pendingRemoval.has(a)?(this._pendingRemoval.delete(a),0===this._pendingRemoval.size&amp;&amp;(this._isAnyPendingRemoval=!1)):(this._instances.push(a),this._isSorted=1===this._instances.length)}Remove(a){this._pendingRemoval.add(a);this._isAnyPendingRemoval=!0;50&lt;=this._pendingRemoval.size&amp;&amp;this._FlushPending()}_FlushPending(){this._isAnyPendingRemoval&amp;&amp;(this._instances.length===this._pendingRemoval.size?
this.Reset():(C3$jscomp$78.arrayRemoveAllInSet(this._instances,this._pendingRemoval),this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1))}_EnsureSorted(){this._isSorted||(this._instances.sort(SortByInstLastCachedZIndex),this._isSorted=!0)}Dump(a){this._FlushPending();this._EnsureSorted();this._instances.length&amp;&amp;a.push(this._instances)}};"use strict";const C3$jscomp$79=self.C3;
C3$jscomp$79.RenderGrid=class extends C3$jscomp$79.DefendedBase{constructor(a,b){super();this._cellWidth=a;this._cellHeight=b;this._cells=C3$jscomp$79.New(C3$jscomp$79.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(a,b,d){let c=this._cells.Get(a,b);return c?c:d?(c=C3$jscomp$79.New(C3$jscomp$79.RenderCell,this,a,b),this._cells.Set(a,b,c),c):null}XToCell(a){return Math.floor(a/this._cellWidth)}YToCell(a){return Math.floor(a/this._cellHeight)}Update(a,b,d){if(b)for(let c=b.getLeft(),
e=b.getRight();c&lt;=e;++c)for(let h=b.getTop(),k=b.getBottom();h&lt;=k;++h){if(d&amp;&amp;d.containsPoint(c,h))continue;const m=this.GetCell(c,h,!1);m&amp;&amp;(m.Remove(a),m.IsEmpty()&amp;&amp;this._cells.Delete(c,h))}if(d)for(let c=d.getLeft(),e=d.getRight();c&lt;=e;++c)for(let h=d.getTop(),k=d.getBottom();h&lt;=k;++h)b&amp;&amp;b.containsPoint(c,h)||this.GetCell(c,h,!0).Insert(a)}QueryRange(a,b){let d=this.XToCell(a.getLeft());const c=this.YToCell(a.getTop()),e=this.XToCell(a.getRight());for(a=this.YToCell(a.getBottom());d&lt;=e;++d)for(let h=
c;h&lt;=a;++h){const k=this.GetCell(d,h,!1);k&amp;&amp;k.Dump(b)}}MarkRangeChanged(a){let b=a.getLeft();const d=a.getTop(),c=a.getRight();for(a=a.getBottom();b&lt;=c;++b)for(let e=d;e&lt;=a;++e){const h=this.GetCell(b,e,!1);h&amp;&amp;h.SetChanged()}}};"use strict";const C3$jscomp$80=self.C3,tmpRect$jscomp$2=new C3$jscomp$80.Rect,tmpQuad$jscomp$2=new C3$jscomp$80.Quad,renderCellArr=[];new C3$jscomp$80.Rect;new C3$jscomp$80.Rect;
const glMatrix$jscomp$8=self.glMatrix,vec3$jscomp$6=glMatrix$jscomp$8.vec3,vec4$jscomp$5=glMatrix$jscomp$8.vec4,mat4$jscomp$9=glMatrix$jscomp$8.mat4,tempMat4$jscomp$4=mat4$jscomp$9.create(),tempVec3=vec3$jscomp$6.create(),tempVec4$jscomp$1=vec4$jscomp$5.create(),camVector=vec3$jscomp$6.create(),lookVector=vec3$jscomp$6.create(),upVector=vec3$jscomp$6.create(),tempVec2=C3$jscomp$80.New(C3$jscomp$80.Vector2);C3$jscomp$80.New(C3$jscomp$80.Rect);
function SortByInstLastCachedZIndex$jscomp$1(a,b){return a.GetWorldInfo()._GetLastCachedZIndex()-b.GetWorldInfo()._GetLastCachedZIndex()}function SortByInstZElevation(a,b){return a.GetWorldInfo().GetZElevation()-b.GetWorldInfo().GetZElevation()}const tempInstanceList1=[],tempInstanceList2=[],tempInstancesByCameraDist=[];
C3$jscomp$80.Layer=class extends C3$jscomp$80.DefendedBase{constructor(a,b,d){super();this._layout=a;this._runtime=a.GetRuntime();this._parentLayer=b;this._name=d[0];this._index=-1;this._sid=d[2];this._isVisible=!!d[3];this._isInteractive=!!d[13];this._backgroundColor=C3$jscomp$80.New(C3$jscomp$80.Color);this._backgroundColor.setFromJSON(d[4].map(e=&gt;e/255));this._isTransparent=!!d[5];this._parallaxX=d[6];this._parallaxY=d[7];this._color=C3$jscomp$80.New(C3$jscomp$80.Color,1,1,1,d[8]);this._premultipliedColor=
C3$jscomp$80.New(C3$jscomp$80.Color);this._isForceOwnTexture=d[9];this._renderAs3d=d[17];this._useCameraDistanceDrawOrder=d[18];this._useRenderCells=d[10];this._scaleRate=d[11];this._blendMode=d[12];this._curRenderTarget=null;this._scale=1;this._zElevation=d[16];this._scrollY=this._scrollX=this._angle=0;this._hasOwnScrollPosition=!1;this._viewport=C3$jscomp$80.New(C3$jscomp$80.Rect);this._viewportZ0=C3$jscomp$80.New(C3$jscomp$80.Rect);this._viewport3D=C3$jscomp$80.New(C3$jscomp$80.Rect);this._isViewportChanged=
!0;this._projectionMatrix=mat4$jscomp$9.create();this._isProjectionMatrixChanged=!0;this._modelViewMatrix=mat4$jscomp$9.create();this._isMVMatrixChanged=!0;this._viewFrustum=C3$jscomp$80.New(C3$jscomp$80.Gfx.ViewFrustum);this._isViewFrustumChanged=!0;this._startupInitialInstances=[];this._initialInstancesData=d[14];this._initialInstances=[];this._createdGlobalUids=[];this._initialUIDsToInstanceData=new Map;this._instances=[];this._anyInstanceZElevated=this._zIndicesUpToDate=!1;const c=this._runtime.GetCanvasManager();
this._effectList=C3$jscomp$80.New(C3$jscomp$80.EffectList,this,d[15]);this._effectChain=C3$jscomp$80.New(C3$jscomp$80.Gfx.EffectChain,c.GetEffectChainManager(),{drawContent:(e,h)=&gt;{h=h.GetContentObject();const k=h.GetRenderTarget();e.SetColor(h.GetPremultipliedColor());e.DrawRenderTarget(k);e.InvalidateRenderTarget(k);c.ReleaseAdditionalRenderTarget(k)},getShaderParameters:e=&gt;this.GetEffectList()._GetEffectChainShaderParametersForIndex(e)});this._wasDefaultColor=this._needsRebuildEffectChainSteps=
!0;this._renderGrid=null;this._lastRenderList=[];this._isRenderListUpToDate=!1;this._lastRenderCells=C3$jscomp$80.New(C3$jscomp$80.Rect,0,0,-1,-1);this._curRenderCells=C3$jscomp$80.New(C3$jscomp$80.Rect,0,0,-1,-1);this._iLayer=null;this._UpdatePremultipliedColor();this.UsesRenderCells()&amp;&amp;(this._renderGrid=C3$jscomp$80.New(C3$jscomp$80.RenderGrid,this._runtime.GetOriginalViewportWidth(),this._runtime.GetOriginalViewportHeight()));this._subLayers=d[19].map(e=&gt;C3$jscomp$80.New(C3$jscomp$80.Layer,this._layout,
this,e))}_Init(){for(const a of this._initialInstancesData){const b=this._runtime.GetObjectClassByIndex(a[1]);this._layout._AddInitialObjectClass(b);b.GetDefaultInstanceData()||(b.SetDefaultInstanceData(a),b._SetDefaultLayerIndex(this._index));this._initialInstances.push(a);this._initialUIDsToInstanceData.set(a[2],a)}C3$jscomp$80.shallowAssignArray(this._startupInitialInstances,this._initialInstances);this._initialInstancesData=null;this._iLayer=new self.ILayer(this)}Release(){this._runtime=this._layout=
null}GetInitialInstanceData(a){return this._initialUIDsToInstanceData.get(a)}CreateInitialInstances(a){const b=this._layout.IsFirstVisit();let d=0;const c=this._initialInstances;for(let h=0,k=c.length;h&lt;k;++h){var e=c[h];const m=this._runtime.GetObjectClassByIndex(e[1]);let p=!0;if(!m.HasPersistBehavior()||b)e=this._runtime.CreateInstanceFromData(e,this,!0),a.push(e),m.IsGlobal()&amp;&amp;(p=!1,this._createdGlobalUids.push(e.GetUID()));p&amp;&amp;(c[d]=c[h],++d)}C3$jscomp$80.truncateArray(c,d);this._runtime.FlushPendingInstances();
this.SetZIndicesChanged()}_AddInstance(a,b){const d=a.GetWorldInfo();if(d.GetLayer()!==this)throw Error("instance added to wrong layer");this._instances.push(a);0!==d.GetZElevation()&amp;&amp;(this._anyInstanceZElevated=!0);b&amp;&amp;this.UsesRenderCells()&amp;&amp;a.GetWorldInfo().SetBboxChanged();this.SetZIndicesChanged()}_MaybeAddInstance(a){this._instances.includes(a)||(this._instances.push(a),0!==a.GetWorldInfo().GetZElevation()&amp;&amp;(this._anyInstanceZElevated=!0),this.SetZIndicesChanged())}_PrependInstance(a,b){const d=
a.GetWorldInfo();if(d.GetLayer()!==this)throw Error("instance added to wrong layer");this._instances.unshift(a);0!==d.GetZElevation()&amp;&amp;(this._anyInstanceZElevated=!0);this.SetZIndicesChanged();b&amp;&amp;this.UsesRenderCells()&amp;&amp;a.GetWorldInfo().SetBboxChanged()}_RemoveInstance(a,b){const d=this._instances.indexOf(a);0&gt;d||(b&amp;&amp;this.UsesRenderCells()&amp;&amp;a.GetWorldInfo()._RemoveFromRenderCells(),this._instances.splice(d,1),this.SetZIndicesChanged(),this._MaybeResetAnyInstanceZElevatedFlag())}_SetAnyInstanceZElevated(){this._anyInstanceZElevated=
!0}_MaybeResetAnyInstanceZElevatedFlag(){0===this._instances.length&amp;&amp;(this._anyInstanceZElevated=!1)}_SortInstancesByLastCachedZIndex(a){if(a){a=new Set;for(var b of this._instances){var d=b.GetWorldInfo()._GetLastCachedZIndex();0&lt;=d&amp;&amp;a.add(d)}b=-1;for(const c of this._instances)if(d=c.GetWorldInfo(),!(0&lt;=d._GetLastCachedZIndex())){for(++b;a.has(b);)++b;d._SetZIndex(b)}}this._instances.sort(SortByInstLastCachedZIndex$jscomp$1)}_Start(){}_End(){for(const a of this._instances)a.GetObjectClass().IsGlobal()||
this._runtime.DestroyInstance(a);this._runtime.FlushPendingInstances();C3$jscomp$80.clearArray(this._instances);this._anyInstanceZElevated=!1;this.SetZIndicesChanged()}RecreateInitialObjects(a,b,d,c,e){const h=this._runtime.GetEventSheetManager(),k=this._runtime.GetAllObjectClasses(),m=a.IsFamily(),p=[];for(const x of this._initialInstances){var q=x[0];if(b.containsPoint(q[0],q[1])){q=k[x[1]];if(q!==a)if(m){if(!a.FamilyHasMember(q))continue}else continue;q=this;var v=this._runtime.GetCurrentLayout();
this.GetLayout()!==v&amp;&amp;((q=v.GetLayerByName(this.GetName()))||(q=v.GetLayerByIndex(this.GetIndex())));v=this._runtime.CreateInstanceFromData(x,q,!1,void 0,void 0,!1,e);q.SortAndAddInstancesByZIndex(v);q=v.GetWorldInfo();q.OffsetXY(d,c);q.SetBboxChanged();h.BlockFlushingInstances(!0);v._TriggerOnCreatedOnSelfAndRelated();h.BlockFlushingInstances(!1);p.push(v)}}return p}GetInstanceCount(){return this._instances.length}GetLayout(){return this._layout}GetName(){return this._name}_SetIndex(a){this._index=
a}GetIndex(){return this._index}GetSID(){return this._sid}GetRuntime(){return this._runtime}GetDevicePixelRatio(){return this._runtime.GetDevicePixelRatio()}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps();return this._effectChain}_MaybeRebuildEffectChainSteps(){const a=this.HasDefaultColor();if(this._needsRebuildEffectChainSteps||a!==this._wasDefaultColor){var b=this.GetEffectList().GetActiveEffectTypes();this._effectChain.BuildSteps(b.map(d=&gt;d.GetShaderProgram()),
{indexMap:b.map(d=&gt;d.GetIndex()),forcePreDraw:!a,useFullSurface:!0});this._needsRebuildEffectChainSteps=!1;this._wasDefaultColor=a}}UpdateActiveEffects(){this.GetEffectList().UpdateActiveEffects();this._needsRebuildEffectChainSteps=!0}UsesRenderCells(){return this._useRenderCells&amp;&amp;!this._useCameraDistanceDrawOrder}GetRenderGrid(){return this._renderGrid}SetRenderListStale(){this._isRenderListUpToDate=!1}IsVisible(){for(const a of this.selfAndParentLayers())if(!a._IsVisibleFlagSet())return!1;return!0}_IsVisibleFlagSet(){return this._isVisible}SetVisible(a){a=
!!a;this._isVisible!==a&amp;&amp;(this._isVisible=a,this._runtime.UpdateRender())}SetInteractive(a){this._isInteractive=!!a}IsInteractive(){return this._isInteractive}IsSelfAndParentsInteractive(){for(const a of this.selfAndParentLayers())if(!a.IsInteractive())return!1;return!0}SetOwnScrollPositionEnabled(a){a=!!a;if(this._hasOwnScrollPosition!==a){if(this._hasOwnScrollPosition=a)a=this.GetLayout(),this._scrollX=a.GetScrollX(),this._scrollY=a.GetScrollY();this._SetMVMatrixChanged();this._runtime.UpdateRender()}}IsOwnScrollPositionEnabled(){return this._hasOwnScrollPosition}SetScrollX(a){var b=
this.GetLayout();const d=b.GetScrollLeftBound();b=b.GetScrollRightBound();a&gt;b&amp;&amp;(a=b);a&lt;d&amp;&amp;(a=d);this._scrollX!==a&amp;&amp;(this._scrollX=a,this.IsOwnScrollPositionEnabled()&amp;&amp;(this._SetMVMatrixChanged(),this._runtime.UpdateRender()))}SetScrollY(a){var b=this.GetLayout();const d=b.GetScrollTopBound();b=b.GetScrollBottomBound();a&gt;b&amp;&amp;(a=b);a&lt;d&amp;&amp;(a=d);this._scrollY!==a&amp;&amp;(this._scrollY=a,this.IsOwnScrollPositionEnabled()&amp;&amp;(this._SetMVMatrixChanged(),this._runtime.UpdateRender()))}GetScrollX(){return this.IsOwnScrollPositionEnabled()?
this._scrollX:this.GetLayout().GetScrollX()}GetScrollY(){return this.IsOwnScrollPositionEnabled()?this._scrollY:this.GetLayout().GetScrollY()}GetViewport(){this._MaybeUpdateViewport();return this._viewport}_GetViewportZ0(){this._MaybeUpdateViewport();return this._viewportZ0}GetViewport3D(){this._MaybeUpdateViewport();return this._viewport3D}_GetVanishingPoint(){const a=this.GetLayout();return[a.GetVanishingPointX(),a.GetVanishingPointY()]}GetDefaultCameraZ(a){return this._runtime.GetDefaultCameraZ(a)}GetViewportForZ(a,
b){var d=this._GetViewportZ0();if(0===a)b.copy(d);else{let k=d.midX(),m=d.midY();var c=this.Get2DScaleFactorToZ(a);const p=d.width()/c;d=d.height()/c;const [q,v]=this._GetVanishingPoint();if(.5!==q||.5!==v){const x=this.GetCameraZ();var e=this._runtime,h=this.GetDefaultCameraZ()/x;c=(q-.5)*e.GetViewportWidth()/h;e=(v-.5)*e.GetViewportHeight()/h;h=this.GetAngle();0!==h&amp;&amp;(tempVec2.set(c,e),tempVec2.rotate(h),c=tempVec2.getX(),e=tempVec2.getY());a=C3$jscomp$80.unlerp(x,0,a);k+=C3$jscomp$80.lerp(c,0,
a);m+=C3$jscomp$80.lerp(e,0,a)}b.set(k-p/2,m-d/2,k+p/2,m+d/2)}}GetOpacity(){return this._color.getA()}SetOpacity(a){a=C3$jscomp$80.clamp(a,0,1);this._color.getA()!==a&amp;&amp;(this._color.setA(a),this._UpdatePremultipliedColor(),this._runtime.UpdateRender())}_UpdatePremultipliedColor(){this._premultipliedColor.copy(this._color);this._premultipliedColor.premultiply()}GetPremultipliedColor(){return this._premultipliedColor}HasDefaultColor(){return this._color.equalsRgba(1,1,1,1)}GetScaleRate(){return this._scaleRate}SetScaleRate(a){this._scaleRate!==
a&amp;&amp;(this._scaleRate=a,this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(a,b){if(this._parallaxX!==a||this._parallaxY!==b)if(this._parallaxX=a,this._parallaxY=b,this._SetMVMatrixChanged(),this._runtime.UpdateRender(),1!==this._parallaxX||1!==this._parallaxY)for(const d of this._instances)d.GetObjectClass()._SetAnyInstanceParallaxed(!0)}SetParallaxX(a){this.SetParallax(a,this.GetParallaxY())}SetParallaxY(a){this.SetParallax(this.GetParallaxX(),
a)}SetZElevation(a){this._zElevation!==a&amp;&amp;(this._zElevation=a,this._runtime.UpdateRender())}GetZElevation(){return this._zElevation}SetAngle(a){a=C3$jscomp$80.clampAngle(a);this._angle!==a&amp;&amp;(this._angle=a,this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetAngle(){return C3$jscomp$80.clampAngle(this._layout.GetAngle()+this._angle)}GetOwnAngle(){return this._angle}HasInstances(){return 0&lt;this._instances.length}_GetInstances(){return this._instances}_GetInstancesInDrawOrder(){return this.RendersIn3DMode()&amp;&amp;
this._useCameraDistanceDrawOrder?(C3$jscomp$80.shallowAssignArray(tempInstancesByCameraDist,this._GetInstances()),tempInstancesByCameraDist.sort((a,b)=&gt;this._SortInstancesByCameraDistance(a,b)),tempInstancesByCameraDist):this._GetInstances()}_AppendAllInstancesIncludingSubLayersInDrawOrder(a){C3$jscomp$80.appendArray(a,this._GetInstancesInDrawOrder());for(const b of this._subLayers)b.IsVisible()&amp;&amp;0&lt;b.GetOpacity()&amp;&amp;b._AppendAllInstancesIncludingSubLayersInDrawOrder(a)}_SortInstancesByCameraDistance(a,
b){var d=this.GetLayout().Get3DCameraPosition(),c=d[0],e=d[1];d=d[2];var h=a.GetWorldInfo();const k=b.GetWorldInfo();b=h.GetX()-c;a=h.GetY()-e;h=h.GetZElevation()-d;c=k.GetX()-c;e=k.GetY()-e;d=k.GetZElevation()-d;return c*c+e*e+d*d-(b*b+a*a+h*h)}GetBackgroundColor(){return this._backgroundColor}IsTransparent(){return this._isTransparent}SetTransparent(a){a=!!a;this._isTransparent!==a&amp;&amp;(this._isTransparent=a,this._runtime.UpdateRender())}IsForceOwnTexture(){return this._isForceOwnTexture}SetForceOwnTexture(a){a=
!!a;this._isForceOwnTexture!==a&amp;&amp;(this._isForceOwnTexture=a,this._runtime.UpdateRender())}RendersIn2DMode(){return!this.GetRuntime().Uses3DFeatures()||!this._renderAs3d}RendersIn3DMode(){return!this.RendersIn2DMode()}Has3DCamera(){return this.RendersIn3DMode()&amp;&amp;this.GetLayout().Is3DCameraEnabled()}SelfAndAllSubLayersHave3DCamera(){if(!this.Has3DCamera())return!1;for(const a of this._subLayers)if(!a.SelfAndAllSubLayersHave3DCamera())return!1;return!0}SetBlendMode(a){this._blendMode!==a&amp;&amp;(this._blendMode=
a,this._runtime.UpdateRender())}GetBlendMode(){return this._blendMode}IsRootLayer(){return!this._parentLayer}GetParentLayer(){return this._parentLayer}GetSubLayers(){return this._subLayers}HasAnySubLayers(){return 0&lt;this._subLayers.length}HasAnyVisibleSubLayer(){for(const a of this._subLayers)if(a.ShouldDraw())return!0;return!1}*selfAndAllSubLayers(){for(const a of this._subLayers)yield*a.selfAndAllSubLayers();yield this}*parentLayers(){let a=this.GetParentLayer();for(;a;)yield a,a=a.GetParentLayer()}*selfAndParentLayers(){yield this;
yield*this.parentLayers()}IsTransformCompatibleWith(a){return this===a||this._parallaxX===a._parallaxX&amp;&amp;this._parallaxY===a._parallaxY&amp;&amp;this._scale===a._scale&amp;&amp;this._scaleRate===a._scaleRate&amp;&amp;this._angle===a._angle&amp;&amp;this.GetScrollX()===a.GetScrollX()&amp;&amp;this.GetScrollY()===a.GetScrollY()}SaveTransform(){return{parallaxX:this.GetParallaxX(),parallaxY:this.GetParallaxY(),scale:this.GetOwnScale(),scaleRate:this.GetScaleRate(),angle:this.GetOwnAngle(),hasOwnScroll:this.IsOwnScrollPositionEnabled(),scrollX:this.GetScrollX(),
scrollY:this.GetScrollY()}}RestoreTransform(a){this.SetParallax(a.parallaxX,a.parallaxY);this.SetOwnScale(a.scale);this.SetScaleRate(a.scaleRate);this.SetAngle(a.angle);this.SetOwnScrollPositionEnabled(a.hasOwnScroll);this.SetScrollX(a.scrollX);this.SetScrollY(a.scrollY);this._MaybeUpdateViewport()}_RemoveAllInstancesInSet(a){0!==a.size&amp;&amp;0&lt;C3$jscomp$80.arrayRemoveAllInSet(this._instances,a)&amp;&amp;(this._MaybeResetAnyInstanceZElevatedFlag(),this.SetZIndicesChanged())}SetZIndicesChanged(){this._isRenderListUpToDate=
this._zIndicesUpToDate=!1}_UpdateZIndices(){if(!this._zIndicesUpToDate){this._instances.sort(SortByInstZElevation);if(this.UsesRenderCells())for(let a=0,b=this._instances.length;a&lt;b;++a){const d=this._instances[a].GetWorldInfo();d._SetZIndex(a);this._renderGrid.MarkRangeChanged(d.GetRenderCellRange())}else for(let a=0,b=this._instances.length;a&lt;b;++a)this._instances[a].GetWorldInfo()._SetZIndex(a);this._zIndicesUpToDate=!0}}MoveInstanceAdjacent(a,b,d){var c=a.GetWorldInfo();b=b.GetWorldInfo();if(c.GetLayer()!==
this||b.GetLayer()!==this)throw Error("can't arrange Z order unless both objects on this layer");c=c.GetZIndex();b=b.GetZIndex();if(c===b+(d?1:-1))return!1;C3$jscomp$80.arrayRemove(this._instances,c);c&lt;b&amp;&amp;b--;d&amp;&amp;b++;b===this._instances.length?this._instances.push(a):this._instances.splice(b,0,a);this.SetZIndicesChanged();return!0}_MergeSortedZArrays(a,b){const d=[];let c=0,e=0,h=a.length,k=b.length;for(;c&lt;h&amp;&amp;e&lt;k;){const m=a[c],p=b[e];m.GetWorldInfo()._GetLastCachedZIndex()&lt;p.GetWorldInfo()._GetLastCachedZIndex()?
(d.push(m),++c):(d.push(p),++e)}for(;c&lt;h;++c)d.push(a[c]);for(;e&lt;k;++e)d.push(b[e]);return d}_MergeAllSortedZArrays_pass(a){const b=[],d=a.length;for(let c=0;c&lt;d-1;c+=2)b.push(this._MergeSortedZArrays(a[c],a[c+1]));1===d%2&amp;&amp;b.push(a[d-1]);return b}_MergeAllSortedZArrays(a){for(;1&lt;a.length;)a=this._MergeAllSortedZArrays_pass(a);return a[0]}_GetRenderCellInstancesToDraw(){this._UpdateZIndices();C3$jscomp$80.clearArray(renderCellArr);this._renderGrid.QueryRange(this.GetViewport(),renderCellArr);return renderCellArr.length?
1===renderCellArr.length?renderCellArr[0]:this._MergeAllSortedZArrays(renderCellArr):[]}ShouldDraw(){return this.IsVisible()&amp;&amp;0&lt;this.GetOpacity()&amp;&amp;this._DrawsAnyContentInSelfOrSubLayers()}_DrawsAnyContentInSelfOrSubLayers(){if(this.HasInstances()||!this.IsTransparent())return!0;for(const a of this._subLayers)if(a._DrawsAnyContentInSelfOrSubLayers())return!0;return!1}UsesOwnTexture(){return this.IsForceOwnTexture()||!this.HasDefaultColor()||0!==this.GetBlendMode()||this._effectList.HasAnyActiveEffect()}SelfOrAnySubLayerUsesOwnTexture(){if(this.UsesOwnTexture())return!0;
for(const a of this._subLayers)if(a.SelfOrAnySubLayerUsesOwnTexture())return!0;return!1}GetRenderTarget(){return this._curRenderTarget}Get2DScaleFactorToZ(a){if(this._layout.IsOrthographicProjection())return 1;const b=this.GetCameraZ();return b/(b-a)}GetCameraZ(a){return this.GetDefaultCameraZ(a)/this.GetNormalScale()}_SetMVMatrixChanged(){this._isViewportChanged=this._isViewFrustumChanged=this._isMVMatrixChanged=!0}_GetModelViewMatrix(a){this._isMVMatrixChanged&amp;&amp;(this._CalculateModelViewMatrix(a,
this._modelViewMatrix,0,0,null),this._isMVMatrixChanged=!1);return this._modelViewMatrix}GetCameraPosition(){if(this.Has3DCamera()){const a=this.GetLayout().Get3DCameraPosition();return[a[0],a[1],a[2]]}return this._Get2DCameraPosition()}_Get2DCameraPosition(a=0,b=0,d=0){var c=this._runtime,e=this.GetLayout(),h=c.GetParallaxXOrigin(),k=c.GetParallaxYOrigin();h=(this.GetScrollX()-h)*this._parallaxX+h;k=(this.GetScrollY()-k)*this._parallaxY+k;c.IsPixelRoundingEnabled()&amp;&amp;(h=Math.round(h),k=Math.round(k));
a=h+a;b=k+b;e=e.IsOrthographicProjection()?this.GetDefaultCameraZ(d):this.GetCameraZ(d);const [m,p]=this._GetVanishingPoint();if(.5!==m||.5!==p)k=this.GetDefaultCameraZ(d)/e,d=(m-.5)*c.GetViewportWidth()/k,c=(p-.5)*c.GetViewportHeight()/k,k=this.GetAngle(),0!==k&amp;&amp;(tempVec2.set(d,c),tempVec2.rotate(k),d=tempVec2.getX(),c=tempVec2.getY()),a+=d,b+=c;return[a,b,e]}_CalculateModelViewMatrix(a,b,d,c,e){const h=this._runtime;var k=this.GetLayout();if(this.Has3DCamera()){vec3$jscomp$6.copy(camVector,k.Get3DCameraPosition());
vec3$jscomp$6.copy(lookVector,k.Get3DCameraLookAt());vec3$jscomp$6.copy(upVector,k.Get3DCameraUpVector());d=h.GetParallaxXOrigin();c=h.GetParallaxYOrigin();k=lookVector[0]-camVector[0];const m=lookVector[1]-camVector[1],p=lookVector[2]-camVector[2];camVector[0]=(camVector[0]-d)*this._parallaxX+d;camVector[1]=(camVector[1]-c)*this._parallaxY+c;camVector[2]*=Math.max(this._parallaxX,this._parallaxY);lookVector[0]=camVector[0]+k;lookVector[1]=camVector[1]+m;lookVector[2]=camVector[2]+p}else{const [m,
p,q]=this._Get2DCameraPosition(d,c,e);vec3$jscomp$6.set(camVector,m,p,q);vec3$jscomp$6.set(lookVector,m,p,q-100);d=this.GetAngle();0===d?vec3$jscomp$6.set(upVector,0,1,0):vec3$jscomp$6.set(upVector,Math.sin(d),Math.cos(d),0)}a.CalculateLookAtModelView(b,camVector,lookVector,upVector,e||h.GetViewportHeight())}_SetProjectionMatrixChanged(){this._isViewportChanged=this._isViewFrustumChanged=this._isProjectionMatrixChanged=!0}_GetProjectionMatrix(a){this._isProjectionMatrixChanged&amp;&amp;(this._CalculateProjectionMatrix(a),
this._isProjectionMatrixChanged=!1);return this._projectionMatrix}_CalculateProjectionMatrix(a){var b=this._runtime.GetCanvasManager();const [d,c]=this._GetVanishingPoint();if(this._layout.IsOrthographicProjection())a.CalculateOrthographicMatrix(this._projectionMatrix,b.GetDrawWidth(),b.GetDrawHeight());else if(.5===d&amp;&amp;.5===c)mat4$jscomp$9.copy(this._projectionMatrix,b.GetDefaultProjectionMatrix());else{const e=b.GetDrawWidth();b=b.GetDrawHeight();a.CalculatePerspectiveMatrix(this._projectionMatrix,
e/b,d,c)}}_SetTransform(a,b=!0,d=0,c=0,e=0){b&amp;&amp;a.SetProjectionMatrix(this._GetProjectionMatrix(a));0===d&amp;&amp;0===c&amp;&amp;0===e?b=this._GetModelViewMatrix(a):(this._CalculateModelViewMatrix(a,tempMat4$jscomp$4,d,c,e),b=tempMat4$jscomp$4);a.SetModelViewMatrix(b)}PrepareForDraw(a){this._SetTransform(a);a.SetBaseZ(this.GetZElevation())}Draw(a,b,d){var c=this._runtime.GetCanvasManager();const e=this.UsesOwnTexture();var h=null;let k=null;if(this._runtime.IsGPUProfiling())if(a.IsWebGL()){const m=c.GetLayerTimingsBuffer(this);
m&amp;&amp;(k=m.AddTimeElapsedQuery(),a.StartQuery(k))}else a.IsWebGPU()&amp;&amp;a.WriteTimestamp(2*(this.GetIndex()+1));e?(h={sampling:this._runtime.GetSampling(),isSampled:!0,canReadPixels:a.IsWebGPU()?this._runtime.UsesAnyBackgroundBlending():!1},"low"===c.GetCurrentFullscreenScalingQuality()&amp;&amp;(h.width=c.GetDrawWidth(),h.height=c.GetDrawHeight()),this._curRenderTarget=h=this._runtime.GetAdditionalRenderTarget(h),a.SetRenderTarget(h),this.IsTransparent()&amp;&amp;a.ClearRgba(0,0,0,0)):(this._curRenderTarget=b,a.SetRenderTarget(b));
this.IsTransparent()||a.Clear(this._backgroundColor);this._layout._DrawLayerList(a,this._curRenderTarget,this._subLayers,e&amp;&amp;this.IsTransparent());this._SetTransform(a);a.SetBaseZ(this.GetZElevation());a.SetDepthEnabled(this.RendersIn3DMode());this.GetNormalScale()&gt;Number.EPSILON&amp;&amp;(this._UpdateZIndices(),c=this.UsesRenderCells()&amp;&amp;0===this.GetZElevation()&amp;&amp;!this._anyInstanceZElevated,this.Has3DCamera()?this._DrawInstances_3DCamera(a):c?this._DrawInstances_RenderCells(a):this._DrawInstances(a,this._GetInstancesInDrawOrder()));
a.SetBaseZ(0);a.SetCurrentZ(0);e&amp;&amp;(a.SetDepthEnabled(!1),this._DrawLayerOwnTextureToRenderTarget(a,h,b,d));k&amp;&amp;a.EndQuery(k);this._runtime.IsGPUProfiling()&amp;&amp;a.IsWebGPU()&amp;&amp;a.WriteTimestamp(2*(this.GetIndex()+1)+1);this._curRenderTarget=null}_DrawInstances(a,b){const d=this.GetViewport(),c=this._curRenderTarget,e=this.GetLayout().IsOrthographicProjection(),h=this.GetLayout().HasVanishingPointOutsideViewport();let k=null;for(let m=0,p=b.length;m&lt;p;++m){const q=b[m];if(q===k)continue;k=q;const v=q.GetWorldInfo();
v.IsVisible()&amp;&amp;v.IsInViewport(d,h,e)&amp;&amp;this._DrawInstanceMaybeWithEffects(q,v,a,c)}}_DrawInstances_3DCamera(a){const b=this._curRenderTarget,d=this._GetViewFrustum(),c=this._GetInstancesInDrawOrder();for(let m=0,p=c.length;m&lt;p;){var e=c[m],h=e.GetWorldInfo();if(!h.IsVisible()||!h.IsInViewport3D(d)){++m;continue}(!e.RendersToOwnZPlane()||0&lt;h.GetDepth())&amp;&amp;tempInstanceList2.push(e);var k=e.GetWorldInfo().GetTotalZElevation();tempInstanceList1.push(e);let q=m+1;for(;q&lt;p;++q){const v=c[q],x=v.GetWorldInfo();
if(x.IsVisible()&amp;&amp;x.IsInViewport3D(d)){if(x.GetTotalZElevation()!==k)break;v.RendersToOwnZPlane()?(0&lt;x.GetDepth()&amp;&amp;tempInstanceList2.push(v),tempInstanceList1.push(v)):tempInstanceList2.push(v)}}if(1!==tempInstanceList1.length||tempInstanceList1[0].MustMitigateZFighting()){this._DrawCoplanarInstances_3DCamera(a,tempInstanceList1);for(let v=0,x=tempInstanceList2.length;v&lt;x;++v)e=tempInstanceList2[v],h=e.GetWorldInfo(),h._SetDrawNonBackFacesOnly(!0),this._DrawInstanceMaybeWithEffects(e,h,a,b),h._SetDrawNonBackFacesOnly(!1)}else{this._DrawInstanceMaybeWithEffects(e,
h,a,b);for(let v=0,x=tempInstanceList2.length;v&lt;x;++v)h=tempInstanceList2[v],h!==e&amp;&amp;(k=h.GetWorldInfo(),k.GetLayer()._DrawInstanceMaybeWithEffects(h,k,a,b))}m=q;C3$jscomp$80.clearArray(tempInstanceList1);C3$jscomp$80.clearArray(tempInstanceList2)}}_DrawCoplanarInstances_3DCamera(a,b){const d=this._curRenderTarget;a.CoplanarStartStencilPass();for(let h=0,k=b.length;h&lt;k;++h){var c=b[h],e=c.GetWorldInfo();e._SetDrawBackFaceOnly(!0);this._DrawInstance(c,e,a)}a.CoplanarStartColorPass();for(let h=0,k=b.length;h&lt;
k;++h)c=b[h],e=c.GetWorldInfo(),this._DrawInstanceMaybeWithEffects(c,e,a,d),e._SetDrawBackFaceOnly(!1);a.CoplanarRestoreStandardRendering()}_DrawInstances_RenderCells(a){var b=this._renderGrid;const d=this._curRenderCells,c=this._lastRenderCells,e=this.GetViewport();d.set(b.XToCell(e.getLeft()),b.YToCell(e.getTop()),b.XToCell(e.getRight()),b.YToCell(e.getBottom()));this._isRenderListUpToDate&amp;&amp;d.equals(c)?b=this._lastRenderList:(b=this._GetRenderCellInstancesToDraw(),this._isRenderListUpToDate=!0,
c.copy(d));this._DrawInstances(a,b);b!==this._lastRenderList&amp;&amp;C3$jscomp$80.shallowAssignArray(this._lastRenderList,b)}_DrawInstanceMaybeWithEffects(a,b,d,c){b.HasAnyActiveEffect()?this._DrawInstanceWithEffectsAndRestore(a,b,d,c):this._DrawInstance(a,b,d)}_DrawInstance(a,b,d){b=b.GetRendererStateGroup();d.GetCurrentStateGroup()!==b&amp;&amp;b.Apply();a.Draw(d)}_DrawInstanceWithEffectsAndRestore(a,b,d,c){this._DrawInstanceWithEffects(a,b,d,c,null)&amp;&amp;this._SetTransform(d)}_DrawInstanceWithEffects(a,b,d,c,e){const h=
b.GetInstanceEffectList().GetEffectChain();h.Render(d,c,{contentObject:a,blendMode:b.GetBlendMode(),devicePixelRatio:this._runtime.GetEffectDevicePixelRatioParam(),time:a.GetInstanceGameTime(),layerScale:this._runtime.GetEffectLayerScaleParam()*this.GetNormalScale(),layerAngle:this.GetAngle(),layoutRect:b.GetBoundingBox(),drawSurfaceRect:h.CanSkipCalculatingDrawSurfaceRect()?null:this._InstanceBoxToDrawSurface(b),drawContentHook:e&amp;&amp;e.drawContentHook,compositOffX:e&amp;&amp;e.compositOffX,compositOffY:e&amp;&amp;
e.compositOffY,updateOwnProjection:e&amp;&amp;e.updateOwnProjection});d.SetBaseZ(this.GetZElevation());return h.DidChangeTransform()}_DrawLayerOwnTextureToRenderTarget(a,b,d,c){const e=this._effectList.GetActiveEffectTypes(),h=this._runtime;0===e.length?(a.SetRenderTarget(d),a.SetTextureFillMode(),c&amp;&amp;0===this._blendMode&amp;&amp;this.HasDefaultColor()?a.CopyRenderTarget(b):(a.SetBlendMode(this._blendMode),a.SetColor(this._premultipliedColor),a.DrawRenderTarget(b)),a.InvalidateRenderTarget(b),h.ReleaseAdditionalRenderTarget(b)):
this.GetEffectChain().Render(a,d,{contentObject:this,blendMode:this.GetBlendMode(),devicePixelRatio:h.GetEffectDevicePixelRatioParam(),layerScale:h.GetEffectLayerScaleParam()*this.GetNormalScale(),layerAngle:this.GetAngle(),layoutRect:this.GetViewport(),drawSurfaceRect:null,invalidateRenderTargets:!0})}GetOwnScale(){return this._scale}SetOwnScale(a){this._scale!==a&amp;&amp;(this._scale=a,this._layout.BoundScrolling(),this._SetMVMatrixChanged(),this._runtime.UpdateRender())}GetRenderScale(){return this.GetNormalScale()*
this._runtime.GetRenderScale()}GetDisplayScale(){return this.GetNormalScale()*this._runtime.GetDisplayScale()}GetNormalScale(){return(this._scale*this._layout.GetScale()-1)*this._scaleRate+1}_MaybeUpdateViewport(){if(this._isViewportChanged){this._isViewportChanged=!1;var a=this._runtime.GetParallaxXOrigin(),b=this._runtime.GetParallaxYOrigin(),d=(this.GetScrollX()-a)*this._parallaxX+a,c=(this.GetScrollY()-b)*this._parallaxY+b;a=this.GetNormalScale();b=this._runtime.GetViewportWidth()/a;a=this._runtime.GetViewportHeight()/
a;d-=b/2;var e=c-a/2;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(d=Math.round(d),e=Math.round(e));c=this._viewportZ0;c.set(d,e,d+b,e+a);b=this.GetAngle();0!==b&amp;&amp;(tmpRect$jscomp$2.copy(c),tmpRect$jscomp$2.offset(-c.midX(),-c.midY()),tmpQuad$jscomp$2.setFromRotatedRect(tmpRect$jscomp$2,b),tmpQuad$jscomp$2.getBoundingBox(tmpRect$jscomp$2),tmpRect$jscomp$2.offset(c.midX(),c.midY()),c.copy(tmpRect$jscomp$2));b=this._zElevation;this.GetViewportForZ(b,this._viewport);this.Has3DCamera()?this.CalculateViewport3D(b,
this._viewport3D):this._viewport3D.copy(this._viewport)}}CalculateViewport3D(a,b){var d=this._runtime.GetCanvasManager(),c=d.GetCssWidth();d=d.GetCssHeight();const [e,h]=this.CanvasCssToLayer(0,0,a),[k,m]=this.CanvasCssToLayer(c,0,a),[p,q]=this.CanvasCssToLayer(c,d,a),[v,x]=this.CanvasCssToLayer(0,d,a);a=Math.min(e,k,p,v);c=Math.min(h,m,q,x);d=Math.max(e,k,p,v);let A=Math.max(h,m,q,x);isFinite(a)||(a=-Infinity);isFinite(c)||(c=-Infinity);isFinite(d)||(d=Infinity);isFinite(A)||(A=Infinity);b.set(a,
c,d,A)}CanvasCssToLayer(a,b,d=0){return this._CanvasToLayer(a,b,d,this.GetDisplayScale())}DrawSurfaceToLayer(a,b,d=0){return this._CanvasToLayer(a,b,d,this.GetRenderScale()*this.GetDevicePixelRatio())}_CanvasToLayer(a,b,d,c){var e=this._runtime,h=e.GetRenderer(),k=this.GetNormalScale(),m=e.GetViewportWidth()/k;k=e.GetViewportHeight()/k;e=tempVec4$jscomp$1;vec4$jscomp$5.set(e,0,0,m,k);a/=c;b=e[3]-b/c;c=this._GetProjectionMatrix(h);h=this._GetModelViewMatrix(h);m=tempVec3;return C3$jscomp$80.Gfx.UnprojectScreenToWorldZ(a,
b,d,h,c,e,m)?[m[0],m[1]]:[NaN,NaN]}CanvasCssToLayer_DefaultTransform(a,b){const d=this._scale,c=this._scaleRate,e=this._parallaxX,h=this._parallaxY,k=this._angle;this._parallaxY=this._parallaxX=this._scaleRate=this._scale=1;this._angle=0;this._SetMVMatrixChanged();a=this.CanvasCssToLayer(a,b);this._scale=d;this._scaleRate=c;this._parallaxX=e;this._parallaxY=h;this._angle=k;this._SetMVMatrixChanged();return a}LayerToCanvasCss(a,b,d=0){return this._LayerToCanvas(a,b,d,this.GetDisplayScale())}LayerToDrawSurface(a,
b,d=0){return this._LayerToCanvas(a,b,d,this.GetRenderScale()*this.GetDevicePixelRatio())}_LayerToCanvas(a,b,d,c){var e=this._runtime,h=e.GetRenderer(),k=this.GetNormalScale(),m=e.GetViewportWidth()/k;k=e.GetViewportHeight()/k;e=tempVec4$jscomp$1;vec4$jscomp$5.set(e,0,0,m,k);m=this._GetProjectionMatrix(h);h=this._GetModelViewMatrix(h);k=tempVec3;return C3$jscomp$80.Gfx.Project(a,b,d,h,m,e,k)?[k[0]*c,(e[3]-k[1])*c]:[NaN,NaN]}_GetLayerToDrawSurfaceScale(a,b){a*=this.GetRenderScale()*this.GetDevicePixelRatio();
0!==b&amp;&amp;(a*=this.Get2DScaleFactorToZ(b));return a}_InstanceBoxToDrawSurface(a){var b=a.GetBoundingBox(),d=a.GetTotalZElevation();a=a.GetDepth();const c=d+a,e=b.getLeft(),h=b.getTop(),k=b.getRight();b=b.getBottom();if(this.Has3DCamera()){if(this._IsPointBehindNearPlane(e,h,d)||this._IsPointBehindNearPlane(k,h,d)||this._IsPointBehindNearPlane(k,b,d)||this._IsPointBehindNearPlane(e,b,d)||0&lt;a&amp;&amp;(this._IsPointBehindNearPlane(e,h,c)||this._IsPointBehindNearPlane(k,h,c)||this._IsPointBehindNearPlane(k,b,c)||
this._IsPointBehindNearPlane(e,b,c)))return null}else if(c&gt;=this.GetCameraZ())return null;let [m,p]=this.LayerToDrawSurface(e,h,d),[q,v]=this.LayerToDrawSurface(k,b,d);if(0!==this.GetAngle()||0&lt;a||this.Has3DCamera()){const [x,A]=this.LayerToDrawSurface(k,h,d),[C,D]=this.LayerToDrawSurface(e,b,d);if(0&lt;a){const [G,E]=this.LayerToDrawSurface(e,h,c),[J,L]=this.LayerToDrawSurface(k,h,c),[O,V]=this.LayerToDrawSurface(k,b,c),[W,ca]=this.LayerToDrawSurface(e,b,c);d=Math.min(m,q,x,C,G,J,O,W);q=Math.max(m,
q,x,C,G,J,O,W);m=d;d=Math.min(p,v,A,D,E,L,V,ca);v=Math.max(p,v,A,D,E,L,V,ca);p=d}else d=Math.min(m,q,x,C),q=Math.max(m,q,x,C),m=d,d=Math.min(p,v,A,D),v=Math.max(p,v,A,D),p=d}tmpRect$jscomp$2.set(m,p,q,v);return tmpRect$jscomp$2}_GetViewFrustum(){this._isViewFrustumChanged&amp;&amp;(this._UpdateViewFrustum(),this._isViewFrustumChanged=!1);return this._viewFrustum}_UpdateViewFrustum(){var a=this._runtime.GetRenderer();const b=this._GetProjectionMatrix(a);a=this._GetModelViewMatrix(a);this._viewFrustum.CalculatePlanes(a,
b)}_IsPointBehindNearPlane(a,b,d){return this._GetViewFrustum().IsBehindNearPlane(a,b,d)}_SaveToJson(){return{s:this.GetOwnScale(),a:this.GetOwnAngle(),v:this._IsVisibleFlagSet(),i:this.IsInteractive(),bc:this._backgroundColor.toJSON(),t:this.IsTransparent(),sx:this._scrollX,sy:this._scrollY,hosp:this._hasOwnScrollPosition,px:this.GetParallaxX(),py:this.GetParallaxY(),c:this._color.toJSON(),sr:this.GetScaleRate(),fx:this._effectList.SaveToJson(),cg:this._createdGlobalUids}}_LoadFromJson(a){this._scale=
a.s;this._angle=a.a;this._isVisible=!!a.v;this._isInteractive=a.hasOwnProperty("i")?a.i:!0;this._backgroundColor.setFromJSON(a.bc);this._isTransparent=!!a.t;a.hasOwnProperty("sx")&amp;&amp;(this._scrollX=a.sx);a.hasOwnProperty("sy")&amp;&amp;(this._scrollY=a.sy);a.hasOwnProperty("hosp")&amp;&amp;(this._hasOwnScrollPosition=!!a.hosp);this._parallaxX=a.px;this._parallaxY=a.py;this._color.setFromJSON(a.c);this._scaleRate=a.sr;C3$jscomp$80.shallowAssignArray(this._createdGlobalUids,a.cg);C3$jscomp$80.shallowAssignArray(this._initialInstances,
this._startupInitialInstances);const b=new Set(this._createdGlobalUids);let d=0;for(let c=0,e=this._initialInstances.length;c&lt;e;++c)b.has(this._initialInstances[c][2])||(this._initialInstances[d]=this._initialInstances[c],++d);C3$jscomp$80.truncateArray(this._initialInstances,d);this._effectList.LoadFromJson(a.fx);this._needsRebuildEffectChainSteps=!0;this._SortInstancesByLastCachedZIndex(!1);this.SetZIndicesChanged();this._SetMVMatrixChanged();this._SetProjectionMatrixChanged()}GetILayer(){return this._iLayer}SortAndAddInstancesByZIndex(a){if(!this._instances.includes(a))if(a.HasChildren()){var b=
[...a.allChildren()];b.push(a);b.sort((c,e)=&gt;{c=c.GetWorldInfo().GetSceneGraphZIndex();e=e.GetWorldInfo().GetSceneGraphZIndex();return c-e});for(var d of b)if(d.IsInContainer())for(const c of d.siblings())b.includes(c)||(a=[...c.allChildren()],a.push(c),a.sort((e,h)=&gt;{e=e.GetWorldInfo().GetSceneGraphZIndex();h=h.GetWorldInfo().GetSceneGraphZIndex();return e-h}),a&amp;&amp;a.length&amp;&amp;b.splice(b.length,0,...a));for(const c of b)this._AddInstance(c,!0)}else if(this._AddInstance(a,!0),a.IsInContainer())for(b of a.siblings())if(d=
[...b.allChildren()],d.push(b),d.sort((c,e)=&gt;{c=c.GetWorldInfo().GetSceneGraphZIndex();e=e.GetWorldInfo().GetSceneGraphZIndex();return c-e}),d&amp;&amp;d.length)for(const c of d)this._AddInstance(c,!0)}};"use strict";const C3$jscomp$81=self.C3,C3Debugger=self.C3Debugger;C3$jscomp$81.New(C3$jscomp$81.Rect);C3$jscomp$81.New(C3$jscomp$81.Rect);
const tempLayoutRect=C3$jscomp$81.New(C3$jscomp$81.Rect),tempColor$jscomp$4=C3$jscomp$81.New(C3$jscomp$81.Color),vec3$jscomp$7=self.glMatrix.vec3,tempRender3dList=[],tempInstanceList1$jscomp$1=[],tempInstanceList2$jscomp$1=[],tempInstanceList3=[];function vec3EqualsXYZ(a,b,d,c){return a[0]===Math.fround(b)&amp;&amp;a[1]===Math.fround(d)&amp;&amp;a[2]===Math.fround(c)}let lastLayerPreparedForDrawing=null;
function MaybePrepareLayerDraw(a,b){lastLayerPreparedForDrawing!==a&amp;&amp;(a.PrepareForDraw(b),lastLayerPreparedForDrawing=a)}
C3$jscomp$81.Layout=class extends C3$jscomp$81.DefendedBase{constructor(a,b,d){super();this._layoutManager=a;this._runtime=a.GetRuntime();this._name=d[0];this._originalWidth=d[1];this._originalHeight=d[2];this._width=d[1];this._height=d[2];this._isUnboundedScrolling=!!d[3];this._isOrthographicProjection=!!d[4];this._vanishingPointX=d[5];this._vanishingPointY=d[6];this._eventSheetName=d[7];this._eventSheet=null;this._sid=d[8];this._index=b;this._scrollY=this._scrollX=0;this._scale=1;this._angle=0;
this._initialObjectClasses=new Set;this._textureLoadedTypes=new Set;this._textureLoadPendingPromises=new Set;this._createdInstances=[];this._initialNonWorld=[];this._is3dCameraEnabled=!1;this._cam3dposition=vec3$jscomp$7.create();this._cam3dlook=vec3$jscomp$7.create();this._cam3dup=vec3$jscomp$7.create();this._rootLayers=[];this._allLayersFlat=[];this._layersByName=new Map;this._layersBySid=new Map;const c=this._runtime.GetCanvasManager();this._effectList=C3$jscomp$81.New(C3$jscomp$81.EffectList,
this,d[11]);this._effectChain=C3$jscomp$81.New(C3$jscomp$81.Gfx.EffectChain,c.GetEffectChainManager(),{drawContent:(e,h)=&gt;{h=h.GetContentObject().GetRenderTarget();e.ResetColor();e.DrawRenderTarget(h);e.InvalidateRenderTarget(h);c.ReleaseAdditionalRenderTarget(h)},getShaderParameters:e=&gt;this.GetEffectList()._GetEffectChainShaderParametersForIndex(e)});this._needsRebuildEffectChainSteps=!0;this._wasFullScreenQualityLow=!1;this._curRenderTarget=null;this._persistData={};this._isFirstVisit=!0;this._iLayout=
new self.ILayout(this);this._userScriptDispatcher=C3$jscomp$81.New(C3$jscomp$81.Event.Dispatcher);for(const e of d[9])this._rootLayers.push(C3$jscomp$81.New(C3$jscomp$81.Layer,this,null,e));this._allLayersFlat=[...this.allLayers()];for(let e=0,h=this._allLayersFlat.length;e&lt;h;++e)a=this._allLayersFlat[e],a._SetIndex(e),a._Init(),this._layersByName.set(a.GetName().toLowerCase(),a),this._layersBySid.set(a.GetSID(),a);for(const e of d[10]){d=this._runtime.GetObjectClassByIndex(e[1]);if(!d)throw Error("missing nonworld object class");
d.GetDefaultInstanceData()||d.SetDefaultInstanceData(e);this._initialNonWorld.push(e);this._AddInitialObjectClass(d)}}Release(){for(const a of this._allLayersFlat)a.Release();C3$jscomp$81.clearArray(this._allLayersFlat);this._textureLoadPendingPromises.clear();this._runtime=this._layoutManager=this._eventSheet=null}GetRuntime(){return this._runtime}GetName(){return this._name}GetSID(){return this._sid}GetIndex(){return this._index}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps();
return this._effectChain}_MaybeRebuildEffectChainSteps(){const a="low"===this._runtime.GetCanvasManager().GetCurrentFullscreenScalingQuality();if(this._needsRebuildEffectChainSteps||this._wasFullScreenQualityLow!==a){var b=this.GetEffectList().GetActiveEffectTypes();this._effectChain.BuildSteps(b.map(d=&gt;d.GetShaderProgram()),{indexMap:b.map(d=&gt;d.GetIndex()),forcePostDraw:a,useFullSurface:!0});this._needsRebuildEffectChainSteps=!1;this._wasFullScreenQualityLow=a}}UpdateActiveEffects(){this.GetEffectList().UpdateActiveEffects();
this._needsRebuildEffectChainSteps=!0}GetMinLayerScale(){let a=this._allLayersFlat[0].GetNormalScale();for(let b=1,d=this._allLayersFlat.length;b&lt;d;++b){const c=this._allLayersFlat[b];if(0!==c.GetParallaxX()||0!==c.GetParallaxY())a=Math.min(a,c.GetNormalScale())}return a}_GetScrollBoundMarginHorizontal(){return.5*this._runtime.GetViewportWidth()/this.GetMinLayerScale()}_GetScrollBoundMarginVertical(){return.5*this._runtime.GetViewportHeight()/this.GetMinLayerScale()}GetScrollLeftBound(){return this.IsUnboundedScrolling()?
-Infinity:this._GetScrollBoundMarginHorizontal()}GetScrollRightBound(){return this.IsUnboundedScrolling()?Infinity:this.GetWidth()-this._GetScrollBoundMarginHorizontal()}GetScrollTopBound(){return this.IsUnboundedScrolling()?-Infinity:this._GetScrollBoundMarginVertical()}GetScrollBottomBound(){return this.IsUnboundedScrolling()?Infinity:this.GetHeight()-this._GetScrollBoundMarginVertical()}SetScrollX(a){const b=this.GetScrollLeftBound(),d=this.GetScrollRightBound();a&gt;d&amp;&amp;(a=d);a&lt;b&amp;&amp;(a=b);this._scrollX!==
a&amp;&amp;(this._scrollX=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetScrollX(){return this._scrollX}SetScrollY(a){const b=this.GetScrollTopBound(),d=this.GetScrollBottomBound();a&gt;d&amp;&amp;(a=d);a&lt;b&amp;&amp;(a=b);this._scrollY!==a&amp;&amp;(this._scrollY=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetScrollY(){return this._scrollY}IsUnboundedScrolling(){return this._isUnboundedScrolling}BoundScrolling(){this.SetScrollX(this.GetScrollX());this.SetScrollY(this.GetScrollY());for(const a of this._allLayersFlat)a.IsOwnScrollPositionEnabled()&amp;&amp;
(a.SetScrollX(a.GetScrollX()),a.SetScrollY(a.GetScrollY()))}SetVanishingPointXY(a,b){if(this._vanishingPointX!==a||this._vanishingPointY!==b)this._vanishingPointX=a,this._vanishingPointY=b,this.IsPerspectiveProjection()&amp;&amp;(this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetVanishingPointX(){return this.IsOrthographicProjection()?.5:this._vanishingPointX}GetVanishingPointY(){return this.IsOrthographicProjection()?.5:this._vanishingPointY}HasVanishingPointOutsideViewport(){const a=
this.GetVanishingPointX(),b=this.GetVanishingPointY();return 0&gt;a||1&lt;a||0&gt;b||1&lt;b}SetPerspectiveProjection(){this._isOrthographicProjection&amp;&amp;(this._isOrthographicProjection=!1,this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}SetOrthographicProjection(){this._isOrthographicProjection||(this._isOrthographicProjection=!0,this._SetAllLayersProjectionChanged(),this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}IsOrthographicProjection(){return this._isOrthographicProjection}IsPerspectiveProjection(){return!this.IsOrthographicProjection()}Set3DCameraEnabled(a){a=
!!a;this._is3dCameraEnabled!==a&amp;&amp;(this._is3dCameraEnabled=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}Is3DCameraEnabled(){return this._is3dCameraEnabled}Set3DCameraOrientation(a,b,d,c,e,h,k,m,p){vec3EqualsXYZ(this._cam3dposition,a,b,d)&amp;&amp;vec3EqualsXYZ(this._cam3dlook,c,e,h)&amp;&amp;vec3EqualsXYZ(this._cam3dup,k,m,p)||(vec3$jscomp$7.set(this._cam3dposition,a,b,d),vec3$jscomp$7.set(this._cam3dlook,c,e,h),vec3$jscomp$7.set(this._cam3dup,k,m,p),this.Set3DCameraChanged())}Set3DCameraChanged(){this._SetAllLayersMVChanged();
this._runtime.UpdateRender()}Get3DCameraPosition(){return this._cam3dposition}Get3DCameraLookAt(){return this._cam3dlook}Get3DCameraUpVector(){return this._cam3dup}GetScale(){return this._scale}SetScale(a){this._scale!==a&amp;&amp;(this._scale=a,this._SetAllLayersMVChanged(),this.BoundScrolling(),this._runtime.UpdateRender())}SetAngle(a){a=C3$jscomp$81.clampAngle(a);this._angle!==a&amp;&amp;(this._angle=a,this._SetAllLayersMVChanged(),this._runtime.UpdateRender())}GetAngle(){return this._angle}GetWidth(){return this._width}SetWidth(a){!isFinite(a)||
1&gt;a||(this._width=a)}GetHeight(){return this._height}SetHeight(a){!isFinite(a)||1&gt;a||(this._height=a)}GetEventSheet(){return this._eventSheet}*allLayers(){for(const a of this._rootLayers)yield*a.selfAndAllSubLayers()}GetLayers(){return this._allLayersFlat}GetLayerCount(){return this._allLayersFlat.length}GetLayer(a){return"number"===typeof a?this.GetLayerByIndex(a):this.GetLayerByName(a.toString())}GetLayerByIndex(a){a=C3$jscomp$81.clamp(Math.floor(a),0,this._allLayersFlat.length-1);return this._allLayersFlat[a]}GetLayerByName(a){return this._layersByName.get(a.toLowerCase())||
null}GetLayerBySID(a){return this._layersBySid.get(a)||null}_SetAllLayersProjectionChanged(){for(const a of this._allLayersFlat)a._SetProjectionMatrixChanged()}_SetAllLayersMVChanged(){for(const a of this._allLayersFlat)a._SetMVMatrixChanged()}SaveTransform(){return{scrollX:this.GetScrollX(),scrollY:this.GetScrollY(),scale:this.GetScale(),angle:this.GetAngle(),vpX:this.GetVanishingPointX(),vpY:this.GetVanishingPointY()}}RestoreTransform(a){this.SetScrollX(a.scrollX);this.SetScrollY(a.scrollY);this.SetScale(a.scale);
this.SetAngle(a.angle);this.SetVanishingPointXY(a.vpX,a.vpY)}GetLayoutBackgroundColor(){let a=this._rootLayers.filter(b=&gt;b.ShouldDraw())[0];for(;a;){if(!a.IsTransparent())return tempColor$jscomp$4.copyRgb(a.GetBackgroundColor()),tempColor$jscomp$4.setA(1),tempColor$jscomp$4;if(a.UsesOwnTexture())return tempColor$jscomp$4.setRgba(0,0,0,0),tempColor$jscomp$4;a=a.GetSubLayers().filter(b=&gt;b.ShouldDraw())[0]}tempColor$jscomp$4.setRgba(0,0,0,0);return tempColor$jscomp$4}IsFirstVisit(){return this._isFirstVisit}_GetInitialObjectClasses(){return[...this._initialObjectClasses]}_AddInitialObjectClass(a){if(a.IsInContainer())for(const b of a.GetContainer().GetObjectTypes())this._initialObjectClasses.add(b);
else this._initialObjectClasses.add(a)}_GetTextureLoadedObjectTypes(){return[...this._textureLoadedTypes]}_Load(a,b){if(a===this||!b)return Promise.resolve();a&amp;&amp;(C3$jscomp$81.CopySet(this._textureLoadedTypes,a._textureLoadedTypes),a._textureLoadedTypes.clear());a=[];for(const d of this._initialObjectClasses)this._textureLoadedTypes.has(d)||(a.push(d.LoadTextures(b)),this._textureLoadedTypes.add(d));return Promise.all(a)}async MaybeLoadTexturesFor(a){if(a.IsFamily())throw Error("cannot load textures for family");
var b=this._runtime.GetRenderer();!b||b.IsContextLost()||this._textureLoadedTypes.has(a)||(this._textureLoadedTypes.add(a),b=a.LoadTextures(b),this._AddPendingTextureLoadPromise(b),await b,a.OnDynamicTextureLoadComplete(),this._runtime.UpdateRender())}_AddPendingTextureLoadPromise(a){this._textureLoadPendingPromises.add(a);a.then(()=&gt;this._textureLoadPendingPromises.delete(a)).catch(()=&gt;this._textureLoadPendingPromises.delete(a))}WaitForPendingTextureLoadsToComplete(){return Promise.all([...this._textureLoadPendingPromises])}MaybeUnloadTexturesFor(a){if(a.IsFamily()||
0&lt;a.GetInstanceCount())throw Error("cannot unload textures");const b=this._runtime.GetRenderer();b&amp;&amp;this._textureLoadedTypes.has(a)&amp;&amp;(this._textureLoadedTypes.delete(a),a.ReleaseTextures(b))}_Unload(a,b){if(a!==this&amp;&amp;b)for(const d of this._textureLoadedTypes)d.IsGlobal()||a._initialObjectClasses.has(d)||(d.ReleaseTextures(),this._textureLoadedTypes.delete(d))}_OnWebGLContextLost(){this._textureLoadedTypes.clear()}async _StartRunning(a){const b=this._runtime,d=this._layoutManager,c=b.GetEventSheetManager();
this._eventSheetName&amp;&amp;(this._eventSheet=c.GetEventSheetByName(this._eventSheetName),this._eventSheet._UpdateDeepIncludes());d._SetMainRunningLayout(this);this._width=this._originalWidth;this._height=this._originalHeight;this._scrollX=b.GetOriginalViewportWidth()/2;this._scrollY=b.GetOriginalViewportHeight()/2;this.BoundScrolling();this._SetAllLayersProjectionChanged();this._SetAllLayersMVChanged();this._MoveGlobalObjectsToThisLayout(a);this._runtime.SetUsingCreatePromises(!0);this._CreateInitialInstances();
this._isFirstVisit||this._CreatePersistedInstances();this._CreateAndLinkContainerInstances(this._createdInstances);this._CreateInitialNonWorldInstances();d.ClearPendingChangeLayout();b.FlushPendingInstances();this._runtime.SetUsingCreatePromises(!1);const e=this._runtime.GetCreatePromises();await Promise.all(e);C3$jscomp$81.clearArray(e);if(!b.IsLoadingState()){for(const h of this._createdInstances)h.SetupInitialSceneGraphConnections();for(const h of this._createdInstances)h._TriggerOnCreated()}C3$jscomp$81.clearArray(this._createdInstances);
await Promise.all([...this._initialObjectClasses].map(h=&gt;h.PreloadTexturesWithInstances(this._runtime.GetRenderer())));a&amp;&amp;(b.Dispatcher().dispatchEvent(new C3$jscomp$81.Event("beforefirstlayoutstart")),await b.DispatchUserScriptEventAsyncWait(new C3$jscomp$81.Event("beforeprojectstart")));await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$81.Event("beforelayoutstart"));b.IsLoadingState()||await b.TriggerAsync(C3$jscomp$81.Plugins.System.Cnds.OnLayoutStart,null,null);b.Dispatcher().dispatchEvent(new C3$jscomp$81.Event("afterlayoutstart"));
await this.DispatchUserScriptEventAsyncWait(new C3$jscomp$81.Event("afterlayoutstart"));a&amp;&amp;(b.Dispatcher().dispatchEvent(new C3$jscomp$81.Event("afterfirstlayoutstart")),await b.DispatchUserScriptEventAsyncWait(new C3$jscomp$81.Event("afterprojectstart")));c._RunQueuedTriggers(d);await this.WaitForPendingTextureLoadsToComplete();this._isFirstVisit=!1}_MoveGlobalObjectsToThisLayout(a){for(const d of this._runtime.GetAllObjectClasses())if(!d.IsFamily()&amp;&amp;d.IsWorldType())for(const c of d.GetInstances()){const e=
c.GetWorldInfo();var b=e.GetLayer();b=C3$jscomp$81.clamp(b.GetIndex(),0,this._allLayersFlat.length-1);b=this._allLayersFlat[b];e._SetLayer(b);b._MaybeAddInstance(c)}if(!a)for(const d of this._allLayersFlat)d._SortInstancesByLastCachedZIndex(!1)}_CreateInitialInstances(){for(const a of this._allLayersFlat)a.CreateInitialInstances(this._createdInstances),a._Start()}_CreatePersistedInstances(){let a=!1;for(const [d,c]of Object.entries(this._persistData)){const e=this._runtime.GetObjectClassBySID(parseInt(d,
10));if(e&amp;&amp;!e.IsFamily()&amp;&amp;e.HasPersistBehavior()){for(const h of c){var b=null;if(e.IsWorldType()&amp;&amp;(b=this.GetLayerBySID(h.w.l),!b))continue;b=this._runtime.CreateInstanceFromData(e,b,!1,0,0,!0);b.LoadFromJson(h);a=!0;this._createdInstances.push(b)}C3$jscomp$81.clearArray(c)}}for(const d of this._allLayersFlat)d._SortInstancesByLastCachedZIndex(!0),d.SetZIndicesChanged();a&amp;&amp;(this._runtime.FlushPendingInstances(),this._runtime._RefreshUidMap())}_CreateAndLinkContainerInstances(a){for(const d of a){if(!d.IsInContainer())continue;
const c=d.GetWorldInfo(),e=d.GetIID();for(const h of d.GetObjectClass().GetContainer().objectTypes())if(h!==d.GetObjectClass()){var b=h.GetInstances();b.length&gt;e?d._AddSibling(b[e]):(b=c?this._runtime.CreateInstanceFromData(h,c.GetLayer(),!0,c.GetX(),c.GetY(),!0):this._runtime.CreateInstanceFromData(h,null,!0,0,0,!0),this._runtime.FlushPendingInstances(),h._UpdateIIDs(),d._AddSibling(b),a.push(b))}}}_CreateInitialNonWorldInstances(){for(const a of this._initialNonWorld)this._runtime.GetObjectClassByIndex(a[1]).IsInContainer()||
this._runtime.CreateInstanceFromData(a,null,!0)}_CreateGlobalNonWorlds(){const a=[],b=this._initialNonWorld;let d=0;for(let c=0,e=b.length;c&lt;e;++c){const h=b[c],k=this._runtime.GetObjectClassByIndex(h[1]);k.IsGlobal()?k.IsInContainer()&amp;&amp;k.GetContainer().HasAnyWorldType()||a.push(this._runtime.CreateInstanceFromData(h,null,!0)):(b[d]=h,++d)}C3$jscomp$81.truncateArray(b,d);this._runtime.FlushPendingInstances();this._CreateAndLinkContainerInstances(a)}RecreateInitialObjects(a,b,d,c,e,h){if(d)return d.RecreateInitialObjects(a,
b,c,e,h);d=[];for(const k of this._allLayersFlat)d.push(k.RecreateInitialObjects(a,b,c,e,h));return d.flat()}async _StopRunning(){const a=this._layoutManager;this._runtime.IsLoadingState()||await this._runtime.TriggerAsync(C3$jscomp$81.Plugins.System.Cnds.OnLayoutEnd,null,null);a.SetIsEndingLayout(!0);this._runtime.GetEventSheetManager().ClearAllScheduledWaits();this._isFirstVisit||this._SavePersistData();for(const b of this._allLayersFlat)b._End();for(const b of this._runtime.GetAllObjectClasses())if(!(b.IsGlobal()||
b.IsWorldType()||b.GetPlugin().IsSingleGlobal()||b.IsFamily())){for(const d of b.GetInstances())this._runtime.DestroyInstance(d);this._runtime.FlushPendingInstances()}a.SetIsEndingLayout(!1);a.GetMainRunningLayout()===this&amp;&amp;a._SetMainRunningLayout(null)}_SaveInstanceToPersist(a){const b=a.GetObjectClass().GetSID().toString();this._persistData.hasOwnProperty(b)||(this._persistData[b]=[]);this._persistData[b].push(a.SaveToJson())}_SavePersistData(){for(const a of this._allLayersFlat){a._UpdateZIndices();
for(const b of a._GetInstances()){const d=b.GetObjectClass();!d.IsGlobal()&amp;&amp;d.HasPersistBehavior()&amp;&amp;this._SaveInstanceToPersist(b)}}}ResetPersistData(){this._persistData={};this._isFirstVisit=!0}GetRenderTarget(){return this._curRenderTarget}UsesOwnTexture(){const a=this._runtime,b=a.GetRenderer().IsWebGL();return"low"===a.GetCanvasManager().GetCurrentFullscreenScalingQuality()||b&amp;&amp;a.UsesAnyBackgroundBlending()||"low-latency"===a.GetCompositingMode()||this._effectList.HasAnyActiveEffect()||b&amp;&amp;a.Uses3DFeatures()}Draw(a){const b=
this._runtime.GetCanvasManager(),d=this.UsesOwnTexture();if(d){"low-latency"!==this._runtime.GetCompositingMode()&amp;&amp;(a.SetRenderTarget(null),a.ClearRgba(0,0,0,0));const c={sampling:this._runtime.GetSampling(),isSampled:a.IsWebGPU()||this._runtime.UsesAnyBackgroundBlending()||this._effectList.HasAnyActiveEffect(),canReadPixels:a.IsWebGPU()?this._runtime.UsesAnyBackgroundBlending():!1};"low"===b.GetCurrentFullscreenScalingQuality()&amp;&amp;(c.width=b.GetDrawWidth(),c.height=b.GetDrawHeight());this._curRenderTarget=
this._runtime.GetAdditionalRenderTarget(c)}else this._curRenderTarget=null;a.SetRenderTarget(this._curRenderTarget);a.Clear(this.GetLayoutBackgroundColor());this._runtime.Uses3DFeatures()&amp;&amp;a.ClearDepth();this._DrawLayerList(a,this._curRenderTarget,this._rootLayers,!0);d&amp;&amp;(a.SetDepthEnabled(!1),this._DrawLayoutOwnTextureToRenderTarget(a,this._curRenderTarget));this._curRenderTarget=null}_DrawLayerList(a,b,d,c){d=d.filter(e=&gt;e.ShouldDraw());for(let e=0,h=d.length;e&lt;h;){const k=d[e];if(k.SelfAndAllSubLayersHave3DCamera()&amp;&amp;
!k.SelfOrAnySubLayerUsesOwnTexture()){tempRender3dList.push(k);for(let m=e+1;m&lt;h;++m){const p=d[m];if(p.SelfAndAllSubLayersHave3DCamera()&amp;&amp;!p.SelfOrAnySubLayerUsesOwnTexture())tempRender3dList.push(d[m]);else break}if(2&lt;=tempRender3dList.length||1===tempRender3dList.length&amp;&amp;tempRender3dList[0].HasAnyVisibleSubLayer()){this._Draw3DLayers(a,b,tempRender3dList);e+=tempRender3dList.length;C3$jscomp$81.clearArray(tempRender3dList);continue}C3$jscomp$81.clearArray(tempRender3dList)}k.Draw(a,b,c&amp;&amp;0===e);
++e}}_DrawLayoutOwnTextureToRenderTarget(a,b){const d=this._effectList.GetActiveEffectTypes(),c=this._runtime;0===d.length?(a.SetRenderTarget(null),a.SetTextureFillMode(),a.CopyRenderTarget(b),a.InvalidateRenderTarget(b),c.ReleaseAdditionalRenderTarget(b)):(tempLayoutRect.set(0,0,c.GetViewportWidth(),c.GetViewportHeight()),this.GetEffectChain().Render(a,null,{contentObject:this,blendMode:3,devicePixelRatio:this._runtime.GetEffectDevicePixelRatioParam(),layerScale:this._runtime.GetEffectLayerScaleParam()*
this.GetScale(),layerAngle:this.GetAngle(),layoutRect:tempLayoutRect,drawSurfaceRect:null,invalidateRenderTargets:!0}))}_Draw3DLayers(a,b,d){d[0].IsTransparent()||(tempColor$jscomp$4.copyRgb(d[0].GetBackgroundColor()),tempColor$jscomp$4.setA(1),a.Clear(tempColor$jscomp$4));var c=this._runtime.GetCanvasManager();a.SetDepthEnabled(!0);for(var e of d)e._UpdateZIndices(),e._AppendAllInstancesIncludingSubLayersInDrawOrder(tempInstanceList1$jscomp$1);d=d[0];e=null;if(this._runtime.IsGPUProfiling())if(a.IsWebGL()){if(c=
c.GetLayerTimingsBuffer(d))e=c.AddTimeElapsedQuery(),a.StartQuery(e)}else a.IsWebGPU()&amp;&amp;a.WriteTimestamp(2*(d.GetIndex()+1));for(let q=0,v=tempInstanceList1$jscomp$1.length;q&lt;v;){var h=tempInstanceList1$jscomp$1[q],k=h.GetWorldInfo(),m=k.GetLayer();if(k.IsVisible()&amp;&amp;k.IsInViewport3D(m._GetViewFrustum())){(!h.RendersToOwnZPlane()||0&lt;k.GetDepth())&amp;&amp;tempInstanceList3.push(h);var p=h.GetWorldInfo().GetTotalZElevation();tempInstanceList2$jscomp$1.push(h);for(c=q+1;c&lt;v;++c){const x=tempInstanceList1$jscomp$1[c],
A=x.GetWorldInfo();if(A.IsVisible()&amp;&amp;A.IsInViewport3D(A.GetLayer()._GetViewFrustum())){if(A.GetTotalZElevation()!==p)break;x.RendersToOwnZPlane()?(0&lt;A.GetDepth()&amp;&amp;tempInstanceList3.push(x),tempInstanceList2$jscomp$1.push(x)):tempInstanceList3.push(x)}}if(1!==tempInstanceList2$jscomp$1.length||tempInstanceList2$jscomp$1[0].MustMitigateZFighting()){this._Draw3DLayersCoplanarInstances(a,b,tempInstanceList2$jscomp$1);for(let x=0,A=tempInstanceList3.length;x&lt;A;++x)h=tempInstanceList3[x],k=h.GetWorldInfo(),
m=k.GetLayer(),k._SetDrawNonBackFacesOnly(!0),MaybePrepareLayerDraw(m,a),m._DrawInstanceMaybeWithEffects(h,k,a,b),k._SetDrawNonBackFacesOnly(!1)}else{MaybePrepareLayerDraw(m,a);m._DrawInstanceMaybeWithEffects(h,k,a,b);for(let x=0,A=tempInstanceList3.length;x&lt;A;++x)k=tempInstanceList3[x],k!==h&amp;&amp;(m=k.GetWorldInfo(),p=m.GetLayer(),MaybePrepareLayerDraw(p,a),p._DrawInstanceMaybeWithEffects(k,m,a,b))}q=c;C3$jscomp$81.clearArray(tempInstanceList2$jscomp$1);C3$jscomp$81.clearArray(tempInstanceList3)}else++q}e&amp;&amp;
a.EndQuery(e);this._runtime.IsGPUProfiling()&amp;&amp;a.IsWebGPU()&amp;&amp;a.WriteTimestamp(2*(d.GetIndex()+1)+1);C3$jscomp$81.clearArray(tempInstanceList1$jscomp$1);lastLayerPreparedForDrawing=null}_Draw3DLayersCoplanarInstances(a,b,d){a.CoplanarStartStencilPass();for(let k=0,m=d.length;k&lt;m;++k){var c=d[k],e=c.GetWorldInfo(),h=e.GetLayer();e._SetDrawBackFaceOnly(!0);MaybePrepareLayerDraw(h,a);h._DrawInstance(c,e,a)}a.CoplanarStartColorPass();for(let k=0,m=d.length;k&lt;m;++k)c=d[k],e=c.GetWorldInfo(),h=e.GetLayer(),
MaybePrepareLayerDraw(h,a),h._DrawInstanceMaybeWithEffects(c,e,a,b),e._SetDrawBackFaceOnly(!1);a.CoplanarRestoreStandardRendering()}_SaveToJson(){const a={sx:this.GetScrollX(),sy:this.GetScrollY(),s:this.GetScale(),a:this.GetAngle(),w:this.GetWidth(),h:this.GetHeight(),ortho:this.IsOrthographicProjection(),vpX:this.GetVanishingPointX(),vpY:this.GetVanishingPointY(),fv:this._isFirstVisit,persist:this._persistData,fx:this._effectList.SaveToJson(),layers:{}};for(const b of this._allLayersFlat)a.layers[b.GetSID().toString()]=
b._SaveToJson();return a}_LoadFromJson(a){this._scrollX=a.sx;this._scrollY=a.sy;this._scale=a.s;this._angle=a.a;this._width=a.w;this._height=a.h;this._isOrthographicProjection=!!a.ortho;a.hasOwnProperty("vpX")&amp;&amp;(this._vanishingPointX=a.vpX);a.hasOwnProperty("vpY")&amp;&amp;(this._vanishingPointY=a.vpY);this._isFirstVisit=!!a.fv;this._persistData=a.persist;this._effectList.LoadFromJson(a.fx);this._needsRebuildEffectChainSteps=!0;for(const [b,d]of Object.entries(a.layers))a=parseInt(b,10),(a=this.GetLayerBySID(a))&amp;&amp;
a._LoadFromJson(d);this._SetAllLayersProjectionChanged();this._SetAllLayersMVChanged()}GetILayout(){return this._iLayout}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(a){a.layout=this.GetILayout();var b=this._runtime;(b=b.IsDebug()&amp;&amp;!b.GetEventSheetManager().IsInEventEngine())&amp;&amp;C3Debugger.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(a);b&amp;&amp;C3Debugger.AddScriptTime()}DispatchUserScriptEventAsyncWait(a){a.layout=this.GetILayout();return this._userScriptDispatcher.dispatchEventAndWaitAsync(a)}};
"use strict";const C3$jscomp$82=self.C3;
C3$jscomp$82.LayoutManager=class extends C3$jscomp$82.DefendedBase{constructor(a){super();this._runtime=a;this._allLayouts=[];this._layoutsByName=new Map;this._layoutsBySid=new Map;this._mainRunningLayout=null;this._runningSubLayouts=[];this._firstLayout=null;this._isEndingLayout=0;this._pendingChangeLayout=null}Release(){this._pendingChangeLayout=this._firstLayout=this._mainRunningLayout=this._runtime=null;C3$jscomp$82.clearArray(this._allLayouts);this._layoutsByName.clear();this._layoutsBySid.clear();
C3$jscomp$82.clearArray(this._runningSubLayouts)}Create(a){a=C3$jscomp$82.New(C3$jscomp$82.Layout,this,this._allLayouts.length,a);this._allLayouts.push(a);this._layoutsByName.set(a.GetName().toLowerCase(),a);this._layoutsBySid.set(a.GetSID(),a)}GetRuntime(){return this._runtime}SetFirstLayout(a){this._firstLayout=a}GetFirstLayout(){if(this._firstLayout)return this._firstLayout;if(this._allLayouts.length)return this._allLayouts[0];throw Error("no first layout");}GetLayoutByName(a){return this._layoutsByName.get(a.toLowerCase())||
null}GetLayoutBySID(a){return this._layoutsBySid.get(a)||null}GetLayoutByIndex(a){a=C3$jscomp$82.clamp(Math.floor(a),0,this._allLayouts.length-1);return this._allLayouts[a]}GetLayout(a){return"number"===typeof a?this.GetLayoutByIndex(a):this.GetLayoutByName(a.toString())}GetAllLayouts(){return this._allLayouts}_SetMainRunningLayout(a){this._mainRunningLayout=a}GetMainRunningLayout(){return this._mainRunningLayout}_AddRunningSubLayout(a){if(this._runningSubLayouts.includes(a))throw Error("layout already running");
this._runningSubLayouts.push(a)}_RemoveRunningSubLayout(a){a=this._runningSubLayouts.indexOf(a);if(-1===a)throw Error("layout not running");this._runningSubLayouts.splice(a,1)}*runningLayouts(){this._mainRunningLayout&amp;&amp;(yield this._mainRunningLayout);this._runningSubLayouts.length&amp;&amp;(yield*this._runningSubLayouts)}IsLayoutRunning(a){return this._mainRunningLayout===a||this._runningSubLayouts.includes(a)}SetIsEndingLayout(a){if(a)this._isEndingLayout++;else{if(0&gt;=this._isEndingLayout)throw Error("already unset");
this._isEndingLayout--}}IsEndingLayout(){return 0&lt;this._isEndingLayout}ChangeMainLayout(a){this._pendingChangeLayout=a}ClearPendingChangeLayout(){this._pendingChangeLayout=null}IsPendingChangeMainLayout(){return!!this._pendingChangeLayout}GetPendingChangeMainLayout(){return this._pendingChangeLayout}SetAllLayerProjectionChanged(){const a=this.GetMainRunningLayout();a&amp;&amp;a._SetAllLayersProjectionChanged()}SetAllLayerMVChanged(){const a=this.GetMainRunningLayout();a&amp;&amp;a._SetAllLayersMVChanged()}};"use strict";
const C3$jscomp$83=self.C3,NAMES_REGEXP=RegExp("&lt;(.+?)&gt;","g");
C3$jscomp$83.TimelineManager=class extends C3$jscomp$83.DefendedBase{constructor(a){super();this._runtime=a;this._timelineDataManager=C3$jscomp$83.New(C3$jscomp$83.TimelineDataManager);this._pluginInstance=null;this._timelines=[];this._timelinesByName=new Map;this._objectClassToTimelineMap=new Map;this._timelinesCreatedByTemplate=new Map;this._scheduledTimelines=[];this._playingTimelines=[];this._markedForRemovalTimelines=[];this._isTickingTimelines=this._changingLayout=this._hasRuntimeListeners=
!1;this._tickFunc=()=&gt;this._OnTick();this._tick2Func=()=&gt;this._OnTick2();this._beforeLayoutChange=()=&gt;this._OnBeforeChangeLayout();this._layoutChange=()=&gt;this._OnAfterChangeLayout();this._instanceDestroy=b=&gt;this._OnInstanceDestroy(b.instance);this._beforeLoad=b=&gt;this._OnBeforeLoad();this._afterLoad=b=&gt;this._OnAfterLoad();this._afterLayoutStart=b=&gt;this._OnAfterLayoutStart();this._destroyedWhileLoadingState=[];this._renderChange=0}Release(){this.RemoveRuntimeListeners();this._afterLoad=this._instanceDestroy=
this._layoutChange=this._beforeLayoutChange=this._tick2Func=this._tickFunc=null;for(const a of this._timelines)a.Stop(),a.Release();C3$jscomp$83.clearArray(this._timelines);this._timelines=null;this._timelineDataManager.Release();this._timelineDataManager=null;C3$jscomp$83.clearArray(this._scheduledTimelines);this._scheduledTimelines=null;C3$jscomp$83.clearArray(this._playingTimelines);this._playingTimelines=null;C3$jscomp$83.clearArray(this._markedForRemovalTimelines);this._markedForRemovalTimelines=
null;this._timelinesByName.clear();this._timelinesByName=null;this._objectClassToTimelineMap.clear();this._objectClassToTimelineMap=null;this._timelinesCreatedByTemplate.clear();this._timelinesCreatedByTemplate=null;C3$jscomp$83.clearArray(this._destroyedWhileLoadingState);this._runtime=this._destroyedWhileLoadingState=null}AddRuntimeListeners(){const a=this._runtime.Dispatcher();a.addEventListener("pretick",this._tickFunc);a.addEventListener("tick2",this._tick2Func);a.addEventListener("beforelayoutchange",
this._beforeLayoutChange);a.addEventListener("layoutchange",this._layoutChange);a.addEventListener("instancedestroy",this._instanceDestroy);a.addEventListener("beforeload",this._beforeLoad);a.addEventListener("afterload",this._afterLoad);a.addEventListener("afterlayoutstart",this._afterLayoutStart)}RemoveRuntimeListeners(){const a=this._runtime.Dispatcher();a.removeEventListener("pretick",this._tickFunc);a.removeEventListener("tick2",this._tick2Func);a.removeEventListener("beforelayoutchange",this._beforeLayoutChange);
a.removeEventListener("layoutchange",this._layoutChange);a.removeEventListener("instancedestroy",this._instanceDestroy);a.removeEventListener("beforeload",this._beforeLoad);a.removeEventListener("afterload",this._afterLoad);a.removeEventListener("afterlayoutstart",this._afterLayoutStart)}Create(a){this._timelineDataManager.Add(a);a=C3$jscomp$83.TimelineState.CreateInitial(a,this);this.Add(a);this.SetTimelineObjectClassesToMap(a);this._timelinesCreatedByTemplate.set(a.GetName(),0)}CreateFromTemplate(a){var b=
this.GetTimelineDataManager();a=a.GetTemplateName();b=b.Get(a);b=C3$jscomp$83.TimelineState.CreateFromTemplate(`${a}:${this._timelinesCreatedByTemplate.get(a)}`,b,this);this._IncreaseTemplateTimelinesCount(a);this.Add(b);return b}_IncreaseTemplateTimelinesCount(a){this._timelinesCreatedByTemplate.set(a,this._timelinesCreatedByTemplate.get(a)+1)}_SetCreatedTemplateTimelinesCount(){for(const a of this._timelines){if(a.IsTemplate())continue;const b=a.GetTemplateName();this._IncreaseTemplateTimelinesCount(b)}}_ClearCreatedTemplateTimelinesCount(){for(const a of this._timelinesCreatedByTemplate.keys())this._timelinesCreatedByTemplate.set(a,
0)}Add(a){this._timelines.push(a);this._timelinesByName.set(a.GetName().toLowerCase(),a)}Remove(a){a.Removed();a.IsTemplate()||(C3$jscomp$83.arrayFindRemove(this._timelines,a),C3$jscomp$83.arrayFindRemove(this._scheduledTimelines,a),C3$jscomp$83.arrayFindRemove(this._playingTimelines,a),C3$jscomp$83.arrayFindRemove(this._markedForRemovalTimelines,a),this._timelinesByName.delete(a.GetName().toLowerCase()),this.RemoveTimelineFromObjectClassMap(a),a.IsReleased()||a.Release())}Trigger(a){this._runtime.Trigger(a,
this._pluginInstance,null)}GetRuntime(){return this._runtime}GetTimelineDataManager(){return this._timelineDataManager}SetPluginInstance(a){this._pluginInstance=a}GetPluginInstance(){return this._pluginInstance}*GetTimelines(){for(const a of this._timelines)yield a}SetTimelineObjectClassToMap(a,b){this._objectClassToTimelineMap.has(a)||this._objectClassToTimelineMap.set(a,new Set);this._objectClassToTimelineMap.get(a).add(b)}SetTimelineObjectClassesToMap(a){for(const b of a.GetObjectClasses())this.SetTimelineObjectClassToMap(b,
a)}RemoveTimelineFromObjectClassMap(a){for(const [b,d]of this._objectClassToTimelineMap.entries())d.has(a)&amp;&amp;(d.delete(a),0===d.size&amp;&amp;this._objectClassToTimelineMap.delete(b))}GetTimelinesForObjectClass(a){if(this._objectClassToTimelineMap.has(a))return this._objectClassToTimelineMap.get(a)}GetTimelineOfTemplateForInstances(a,b){if(b)for(const d of this._timelines)if(b.every(c=&gt;d.HasTrackInstance(c.instance,c.trackId))&amp;&amp;d.GetName().includes(a.GetName()))return d}GetTimelineByName(a){return this._timelinesByName.get(a.toLowerCase())||
null}GetScheduledOrPlayingTimelineByName(a){for(const b of this._scheduledTimelines)if(b.GetName()===a)return b;for(const b of this._playingTimelines)if(b.GetName()===a)return b;return null}*GetTimelinesByName(a){if(NAMES_REGEXP.test(a)){NAMES_REGEXP.lastIndex=0;let d;var b=new Set;do if(d=NAMES_REGEXP.exec(a)){const c=d[1].split(",");for(const e of c)b.add(e)}while(d);for(const c of b.values())(a=this.GetTimelineByName(c))&amp;&amp;(yield a);b.clear()}else(b=this.GetTimelineByName(a))&amp;&amp;(yield b)}*GetTimelinesByTags(a){for(const b of this._timelines)b.HasTags(a)&amp;&amp;
(yield b)}AddScheduledTimeline(a){this._scheduledTimelines.includes(a)||this._scheduledTimelines.push(a);this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(a){C3$jscomp$83.arrayFindRemove(this._playingTimelines,a);this._MaybeDisableRuntimeListeners()}ScheduleTimeline(a){this._playingTimelines.includes(a)?(a.SetPlaying(!0),a.SetScheduled(!1),a.SetMarkedForRemoval(!1)):(a.SetPlaying(!1),a.SetScheduled(!0),a.SetMarkedForRemoval(!1),this._scheduledTimelines.includes(a)||this._scheduledTimelines.push(a));
this._MaybeEnableRuntimeListeners()}DeScheduleTimeline(a){a.SetPlaying(!1);a.SetScheduled(!1);a.ResolvePlayPromise();C3$jscomp$83.arrayFindRemove(this._scheduledTimelines,a);this._MaybeDisableRuntimeListeners()}CompleteTimeline(a){a.SetPlaying(!1);a.SetScheduled(!1);this._playingTimelines.includes(a)&amp;&amp;(a.SetMarkedForRemoval(!0),this._markedForRemovalTimelines.push(a),C3$jscomp$83.arrayFindRemove(this._playingTimelines,a))}CompleteTimelineBeforeChangeOfLayout(a){a.SetPlaying(!1);a.SetScheduled(!1);
a.SetMarkedForRemoval(!1);a.SetPlaybackRate(1);C3$jscomp$83.arrayFindRemove(this._playingTimelines,a)}CompleteTimelineAndResolve(a){this.CompleteTimeline(a);a.ResolvePlayPromise()}_OnTick(){if(!this.GetRuntime().IsLoadingState()&amp;&amp;this._hasRuntimeListeners&amp;&amp;!this._changingLayout){for(this._isTickingTimelines=!0;this._scheduledTimelines.length;){var a=this._scheduledTimelines.pop();a.SetInitialState();0!==a.GetRenderChange()&amp;&amp;(this._renderChange=1);this._playingTimelines.push(a)}a=this._runtime._GetDtFast();
var b=this._runtime.GetDt1(),d=this._runtime.GetTimeScale();for(let c=this._playingTimelines.length-1;0&lt;=c;c--)this._playingTimelines[c].Tick(a,d,b);this._isTickingTimelines=!1;0!==this._renderChange&amp;&amp;this.GetRuntime().UpdateRender()}}_OnTick2(){if(!this.GetRuntime().IsLoadingState()&amp;&amp;this._hasRuntimeListeners&amp;&amp;!this._changingLayout){var a;for(let b=0,d=this._markedForRemovalTimelines.length;b&lt;d;b++){const c=this._markedForRemovalTimelines[b];a||(a=new Set);c.Removed();this._MaybeExecuteTimelineFinishTriggers(c);
a.add(c)}if(a){C3$jscomp$83.arrayRemoveAllInSet(this._markedForRemovalTimelines,a);this._renderChange=0;for(let b=0,d=this._playingTimelines.length;b&lt;d;b++)if(0!==this._playingTimelines[b].GetRenderChange()){this._renderChange=1;break}}this._MaybeDisableRuntimeListeners()}}_MaybeExecuteTimelineFinishTriggers(a){a.IsReleased()||a.HasValidTracks()&amp;&amp;a.IsComplete()&amp;&amp;a.InitialStateSet()&amp;&amp;a.FinishTriggers()}_MaybeEnableRuntimeListeners(){this._hasRuntimeListeners||(this._hasRuntimeListeners=!0)}_MaybeDisableRuntimeListeners(){this._markedForRemovalTimelines.length||
this._playingTimelines.length||this._scheduledTimelines.length||this._isTickingTimelines||(this._hasRuntimeListeners=!1)}_OnBeforeChangeLayout(){for(this._changingLayout=!0;this._scheduledTimelines.length;)this.DeScheduleTimeline(this._scheduledTimelines.pop());const a=new Set;for(const b of this._playingTimelines)b._OnBeforeChangeLayout()&amp;&amp;(b.Removed(),a.add(b));C3$jscomp$83.arrayRemoveAllInSet(this._playingTimelines,a);a.clear();for(const b of this._markedForRemovalTimelines)b._OnBeforeChangeLayout()&amp;&amp;
(b.Removed(),a.add(b));C3$jscomp$83.arrayRemoveAllInSet(this._markedForRemovalTimelines,a);this._MaybeDisableRuntimeListeners();for(const b of this._timelines)b.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=!1}_OnInstanceDestroy(a){var b=a.GetObjectClass();if(b=this.GetTimelinesForObjectClass(b))if(this._runtime.IsLoadingState())this._destroyedWhileLoadingState.push(a);else for(const d of b)d.IsTemplate()||(d.IsReleased()?this.Remove(d):d.HasValidTracks()||(this._MaybeExecuteTimelineFinishTriggers(d),
this.Remove(d)))}_OnBeforeLoad(){for(const a of this._scheduledTimelines.map(b=&gt;b))this._MaybeExecuteTimelineFinishTriggers(a),this.Remove(a);for(const a of this._playingTimelines.map(b=&gt;b))this._MaybeExecuteTimelineFinishTriggers(a),this.Remove(a)}_OnAfterLoad(){for(const a of this._destroyedWhileLoadingState)this._OnInstanceDestroy(a);C3$jscomp$83.clearArray(this._destroyedWhileLoadingState)}_OnAfterLayoutStart(){const a=this._runtime.GetLayoutManager().GetMainRunningLayout();if(a)for(const b of this._timelines){const d=
b.GetStartOnLayout();d&amp;&amp;a.GetName()===d&amp;&amp;this.ScheduleTimeline(b)}}_SaveToJson(){return{timelinesJson:this._SaveTimelinesToJson(),scheduledTimelinesJson:this._SaveScheduledTimelinesToJson(),playingTimelinesJson:this._SavePlayingTimelinesToJson(),markedForRemovalTimelinesJson:this._SaveMarkedForRemovalTimelinesToJson(),hasRuntimeListeners:this._hasRuntimeListeners,changingLayout:this._changingLayout,isTickingTimelines:this._isTickingTimelines}}_LoadFromJson(a){a&amp;&amp;(this._ClearCreatedTemplateTimelinesCount(),
this._LoadTimelinesFromJson(a.timelinesJson),this._LoadScheduledTimelinesFromJson(a.scheduledTimelinesJson),this._LoadPlayingTimelinesFromJson(a.playingTimelinesJson),this._LoadMarkedForRemovalTimelinesFromJson(a.markedForRemovalTimelinesJson),this._hasRuntimeListeners=!a.hasRuntimeListeners,this._changingLayout=!!a.changingLayout,this._isTickingTimelines=!!a.isTickingTimelines,this._SetCreatedTemplateTimelinesCount(),this._MaybeEnableRuntimeListeners(),this._MaybeDisableRuntimeListeners())}_SaveTimelinesToJson(){return this._timelines.map(a=&gt;
a._SaveToJson())}_LoadTimelinesFromJson(a){for(const b of a){a=this.GetTimelineByName(b.name);if(!a){a=this._GetTemplateNameFromJson(b);if(!a)continue;a=this.GetTimelineByName(a);a=this.CreateFromTemplate(a)}a._LoadFromJson(b);a.HasTracks()||this.Remove(a)}}_GetTemplateNameFromJson(a){return(a=a.name.split(":"))&amp;&amp;2===a.length?a[0]:null}_SaveScheduledTimelinesToJson(){return this._SaveTimelines(this._scheduledTimelines)}_LoadScheduledTimelinesFromJson(a){this._LoadTimelines(a,this._scheduledTimelines)}_SavePlayingTimelinesToJson(){return this._SaveTimelines(this._playingTimelines)}_LoadPlayingTimelinesFromJson(a){this._LoadTimelines(a,
this._playingTimelines)}_SaveMarkedForRemovalTimelinesToJson(){return this._SaveTimelines(this._markedForRemovalTimelines)}_LoadMarkedForRemovalTimelinesFromJson(a){this._LoadTimelines(a,this._markedForRemovalTimelines)}_IsTimelineInJson(a,b){if(!b)return!1;for(const d of b)if(d===a.GetName())return!0;return!1}_SaveTimelines(a){return a.map(b=&gt;b.GetName())}_LoadTimelines(a,b){var d=new Set;for(const c of b)this._IsTimelineInJson(c,a)||d.add(c);C3$jscomp$83.arrayRemoveAllInSet(b,d);if(a){d=c=&gt;e=&gt;e.GetName()===
c;for(const c of a)(a=this.GetTimelineByName(c))&amp;&amp;(b.find(d(c))||b.push(a))}}};"use strict";const C3$jscomp$84=self.C3;
C3$jscomp$84.TimelineState=class extends C3$jscomp$84.DefendedBase{constructor(a,b,d){super();this._runtime=d.GetRuntime();this._timelineManager=d;this._timelineDataItem=b;this._name=a;this._tracks=[];this._tracksLength=0;this._beforeAndAfterTracks=null;this._beforeAndAfterTracksLength=0;this.CreateTrackStates();this._playResolve=this._playPromise=null;this._playheadTime=0;this._playbackRate=1;this._pingPongState=0;this._currentRepeatCount=1;this._initialStateSet=this._isScheduled=this._isPlaying=
!1;this._complete=!0;this._markedForRemoval=this._released=!1;this._completedTick=-1;this._firstTick=this._finishedTriggers=this._isTemplate=this._implicitPause=!1;this._lastDelta=NaN;this._tags=[""];this._stringTags="";this._tagsChanged=!1;this._hasNestedContent=this._renderChange=0;this._iTimelineState=null}static CreateInitial(a,b){var d=b.GetTimelineDataManager();const c=d.GetNameId();d=d.Get(a[c]);a=C3$jscomp$84.New(C3$jscomp$84.TimelineState,a[c],d,b);a.SetIsTemplate(!0);return a}static CreateFromTemplate(a,
b,d){return C3$jscomp$84.New(C3$jscomp$84.TimelineState,a,b,d)}Release(){if(!this.IsReleased()){var a=this._runtime.Dispatcher();this._timelineManager.DeScheduleTimeline(this);this._timelineManager.CompleteTimelineAndResolve(this);for(const b of this._tracks)b.Release();C3$jscomp$84.clearArray(this._tracks);this._timelineDataItem=this._timelineManager=this._runtime=this._tracks=null;this._released=!0;this._playResolve=this._playPromise=null;this.FireReleaseEvent(a)}}FireReleaseEvent(a){const b=C3$jscomp$84.New(C3$jscomp$84.Event,
"timelinestatereleased");b.timelineState=this;a.dispatchEvent(b)}CreateTrackStates(){for(const a of this._timelineDataItem.GetTrackData().trackDataItems())this._tracksLength=this._tracks.push(C3$jscomp$84.TrackState.Create(this,a))}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}GetSimilarPropertyTracks(a,b,d){if(this._hasNestedContent){var c;for(let h=0;h&lt;this._tracks.length;h++){var e=this._tracks[h];a===e.GetInstance()&amp;&amp;(e=e.GetPropertyTrack(d))&amp;&amp;
b.constructor===e.GetSourceAdapter().constructor&amp;&amp;(c||(c=[]),c.push(e))}return c}}HasTracks(){return!!this._tracks.length}GetTrackById(a){for(const b of this._tracks)if(C3$jscomp$84.equalsNoCase(b.GetId(),a))return b;return null}GetTrackByName(a){for(const b of this._tracks)if(!b.IsInstanceTrack()&amp;&amp;C3$jscomp$84.equalsNoCase(b.GetName(),a))return b;return null}SetName(a){this._name=a}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(a){this._timelineDataItem.SetTotalTime(a)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(a){this._timelineDataItem.SetStep(a)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._timelineDataItem.SetInterpolationMode(a)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(a){this._timelineDataItem.GetResultMode(a)}SetEase(a){for(const b of this.GetTracks())b.SetEase(a)}GetLoop(){return this._timelineDataItem.GetLoop()}SetLoop(a){return this._timelineDataItem.SetLoop(a)}GetPingPong(){return this._timelineDataItem.GetPingPong()}SetPingPong(a){return this._timelineDataItem.SetPingPong(a)}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetPlaybackRate(a){return this._playbackRate=
a}GetPlaybackRate(){return this._playbackRate}GetStartOnLayout(){return this._timelineDataItem.GetStartOnLayout()}GetTransformWithSceneGraph(){return this._timelineDataItem.GetTransformWithSceneGraph()}IsForwardPlayBack(){return this.IsPlaying()?0&lt;this._playbackRate:!0}GetPlayPromise(){return this._playPromise?this._playPromise:this._playPromise=new Promise(a=&gt;{this._playResolve=a})}ResolvePlayPromise(){this._playPromise&amp;&amp;(this._playResolve(),this._playResolve=this._playPromise=null)}SetTags(a){this._tags=
C3$jscomp$84.TimelineState._GetTagArray(a);this._tagsChanged=!0}GetTags(){return this._tags}GetStringTags(){this._tagsChanged&amp;&amp;(this._stringTags=this._tags.join(" "));this._tagsChanged=!1;return this._stringTags}HasTags(a){return this._tags&amp;&amp;this._tags.length?(a=C3$jscomp$84.TimelineState._GetTagArray(a))&amp;&amp;a.length?a.every(C3$jscomp$84.TimelineState._HasTag,this):!1:!1}OnStarted(){C3$jscomp$84.Plugins.Timeline&amp;&amp;this.constructor===C3$jscomp$84.TimelineState&amp;&amp;(C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(this),
this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineStarted),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineStartedByName),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineStartedByTags),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnAnyTimelineStarted),C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(null))}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){this._finishedTriggers||
(this._finishedTriggers=!0,C3$jscomp$84.Plugins.Timeline&amp;&amp;this.constructor===C3$jscomp$84.TimelineState&amp;&amp;(C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineFinished),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineFinishedByName),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimelineFinishedByTags),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnAnyTimelineFinished),
C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(null)))}SetPlaying(a){this._isPlaying=a}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(a=!1){return this.IsCompletedTick()||this.IsScheduled()&amp;&amp;!a?!0:this._isPlaying}_IsPlaying(){return this.IsPlaying(!0)}IsPaused(){return this._IsPaused()}_IsPaused(){return this.IsReleased()||this.IsScheduled()||this._IsPlaying()||this.IsComplete()?!1:!0}SetScheduled(a){this._isScheduled=a}IsScheduled(){return this._isScheduled}SetComplete(a){this._complete=
a;a=this.GetTime();if(0&gt;=a||a&gt;=this.GetTotalTime())this._complete=!0}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(a){this._markedForRemoval=a}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(a){this._implicitPause=a}IsImplicitPause(){return this._implicitPause}SetIsTemplate(a){this._isTemplate=!!a}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime}SetTime(a){const b=
this.GetTime();this._SetTime(a);this.SetComplete(!1);this.IsComplete()||this.SetImplicitPause(!0);if(this._IsPlaying()||this.IsScheduled()||!this._initialStateSet)this._IsPlaying()||this.IsScheduled()||this._initialStateSet?this._IsPlaying()?this.Stop():this.IsScheduled()&amp;&amp;(this._timelineManager.DeScheduleTimeline(this),this.SetInitialStateFromSetTime()):this.SetInitialStateFromSetTime();this._SetUpdateStateBefore();this._Interpolate(this.GetTime(),!1,!0,!0,b);this._SetUpdateStateAfter();this._renderChange&amp;&amp;
this.GetRuntime().UpdateRender();this._OnSetTime()}_SetTime(a){C3$jscomp$84.IsFiniteNumber(a)||(a=this.GetTotalTime());0&gt;a?this._playheadTime=0:a&gt;=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a}_SetTimeAndReset(a){C3$jscomp$84.IsFiniteNumber(a)||(a=this.GetTotalTime());0&gt;a?this._playheadTime=0:a&gt;=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a;for(const b of this._tracks)b.SetResetState()}_OnSetTime(){C3$jscomp$84.Plugins.Timeline&amp;&amp;
this.constructor===C3$jscomp$84.TimelineState&amp;&amp;(C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimeSet),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimeSetByName),this._timelineManager.Trigger(C3$jscomp$84.Plugins.Timeline.Cnds.OnTimeSetByTags),C3$jscomp$84.Plugins.Timeline.Cnds.SetTriggerTimeline(null))}_CanResume(){if(!this.GetLoop())if(this.GetPingPong()&amp;&amp;1===this._pingPongState)if(this.IsForwardPlayBack()){if(this.GetTime()&gt;=
this.GetTotalTime())return!1}else{if(0&gt;=this.GetTime())return!1}else if(!this.GetLoop()&amp;&amp;!this.GetPingPong())if(this.IsForwardPlayBack()){if(this.GetTime()&gt;=this.GetTotalTime())return!1}else if(0&gt;=this.GetTime())return!1;return!0}Resume(){this.IsReleased()||this._CanResume()&amp;&amp;this.Play(!0)}Play(a=!1){return this.IsReleased()||this.IsScheduled()?!1:this._IsPlaying()&amp;&amp;this.IsCompletedTick()?this._SchedulePlayingTimeline():this._IsPlaying()||!this.IsComplete()&amp;&amp;!a&amp;&amp;!this.IsImplicitPause()?!1:this._ScheduleStoppedTimeline()}_SchedulePlayingTimeline(){this.SetImplicitPause(!1);
this._timelineManager.RemovePlayingTimeline(this);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return!0}_ScheduleStoppedTimeline(){this.SetImplicitPause(!1);this._timelineManager.ScheduleTimeline(this);this.GetPlayPromise();return!0}Stop(a=!1){this.IsReleased()||(this.SetComplete(a),this._timelineManager.CompleteTimeline(this),this.IsComplete()&amp;&amp;this.ResolvePlayPromise())}Reset(a=!0,b=!1){if(!this.IsReleased()){if(!this._IsPlaying()&amp;&amp;this.IsScheduled())return this._timelineManager.DeScheduleTimeline(this);
if(!this.IsComplete()){this.Stop(!0);this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());var d=this.GetTime();this._SetUpdateStateBefore();b?this._InterpolateBeforeChangeLayout(d):this._Interpolate(d,!1,!1,!0);a&amp;&amp;this._OnSetTime();this._SetUpdateStateAfter();this._renderChange&amp;&amp;a&amp;&amp;this.GetRuntime().UpdateRender()}}}ResetBeforeChangeLayout(){this.Reset(!1,!0)}_InterpolateBeforeChangeLayout(a){this._Interpolate(a,!1,!1,!0,NaN,!1,!0)}_OnBeforeChangeLayout(){if(this.IsReleased())return!0;
if(!this.GetRuntime().IsLoadingState()&amp;&amp;this.HasValidGlobalTracks())return!1;this._timelineManager.CompleteTimelineBeforeChangeOfLayout(this);this.GetRuntime().IsLoadingState()||this.ResetBeforeChangeLayout();return!0}SetInitialStateFromSetTime(){this.SetInitialState(!0)}SetInitialState(a){if(!this.IsMarkedForRemoval()){if(a){this._firstTick=this._initialStateSet=!0;this._SetUpdateStateBefore();for(const b of this._tracks)b.SetInitialState()}else if(this.SetPlaying(!0),this.SetScheduled(!1),this.OnStarted(),
this.IsComplete()){this._completedTick=-1;0!==this._pingPongState&amp;&amp;(this._playbackRate=Math.abs(this._playbackRate));this._pingPongState=0;this._currentRepeatCount=1;this._finishedTriggers=this._complete=!1;this._firstTick=this._initialStateSet=!0;this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());this._SetUpdateStateBefore();for(const b of this._tracks)b.SetInitialState()}else{this._firstTick=!0;this._SetUpdateStateBefore();for(const b of this._tracks)b.SetResumeState()}this._SetUpdateStateAfter()}}GetRenderChange(){return this._renderChange}_SetUpdateStateBefore(){this._hasNestedContent=
0;for(const a of this._tracks)a.IsNested()&amp;&amp;(this._hasNestedContent=1)}_SetUpdateStateAfter(){this._renderChange=0;for(const a of this._tracks)a._SetUpdateState(),0===this._renderChange&amp;&amp;1===a.GetRenderChange()&amp;&amp;(this._renderChange=1),this._beforeAndAfterTracks||1!==a.GetNeedsBeforeAndAfter()||(this._beforeAndAfterTracks||(this._beforeAndAfterTracks=[]),this._beforeAndAfterTracksLength=this._beforeAndAfterTracks.push(a))}Tick(a,b,d){if(0!==a||0!==this._lastDelta){this._lastDelta=a;d=this._playheadTime;
b=d+a*b*this._playbackRate;a=this._timelineDataItem._totalTime;this._playheadTime=0&gt;b?0:b&gt;=a?a:b;var c=!1;b=!1;var e=this.GetLoop(),h=this.GetPingPong();e||h?e&amp;&amp;!h?0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTimeAndReset(0),b=!0):0&gt;=this._playheadTime&amp;&amp;(this._SetTimeAndReset(a),b=!0):!e&amp;&amp;h?0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,
this._pingPongState=0):c=!0:0===this._pingPongState&amp;&amp;(this._pingPongState=1)):0&gt;=this._playheadTime&amp;&amp;(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=0):c=!0:0===this._pingPongState&amp;&amp;(this._pingPongState=1)):e&amp;&amp;h&amp;&amp;(0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$84.wrap(this._pingPongState,
0,2)):0&gt;=this._playheadTime&amp;&amp;(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$84.wrap(this._pingPongState,0,2))):0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(0),b=!0):(this._SetTime(a),c=!0)):0&gt;=this._playheadTime&amp;&amp;(this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(a),b=!0):(this._SetTime(0),c=!0));e=this._tracksLength;
if(c){for(c=0;c&lt;e;c++)this._tracks[c].SetEndState();this.Stop(!0);this.OnCompleted()}else{h=this._beforeAndAfterTracksLength;for(c=0;c&lt;h;c++)this._beforeAndAfterTracks[c].BeforeInterpolate();if(1===this._hasNestedContent)for(c=0;c&lt;e;c++){const k=this._tracks[c],m=k.GetStartOffset(),p=d-m;0&gt;this._playheadTime-m&amp;&amp;0&lt;p?(this._playheadTime=0&gt;m?0:m&gt;=a?a:m,k.Interpolate(m,!0,!1,b,this._firstTick,!1)):k.Interpolate(this._playheadTime,!0,!1,b,this._firstTick,!1)}else for(c=0;c&lt;e;c++)this._tracks[c].Interpolate(this._playheadTime,
!0,!1,b,this._firstTick,!1);for(c=0;c&lt;h;c++)this._beforeAndAfterTracks[c].AfterInterpolate();this._firstTick&amp;&amp;(this._firstTick=!1)}}}_Interpolate(a,b=!1,d=!1,c=!1,e=NaN,h=!1,k=!1){for(var m of this._tracks)m.BeforeInterpolate();for(const p of this._tracks){m=a;if("number"===typeof e&amp;&amp;!isNaN(e)){const q=this.GetTime()-p.GetStartOffset(),v=e-p.GetStartOffset();0&gt;q&amp;&amp;0&lt;v&amp;&amp;(m=p.GetStartOffset(),this._SetTime(m))}p.Interpolate(m,b,d,c,this._firstTick,k)}for(const p of this._tracks)p.AfterInterpolate();
this._firstTick&amp;&amp;h&amp;&amp;(this._firstTick=!1)}AddTrack(){var a=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();a=C3$jscomp$84.TrackState.Create(this,a);this._tracksLength=this._tracks.push(a);return a}Removed(){if(!this.IsReleased())for(const a of this._tracks)a.TimelineRemoved()}CleanCaches(){for(const a of this._tracks)a.CleanCaches()}ClearTrackInstances(){for(const a of this._tracks)a.ClearInstance()}SetTrackInstance(a,b){if(b)for(const d of this._tracks)if(d.IsInstanceTrack()){if(a){if(d.GetId()!==
a)continue}else if(d.HasInstance())continue;d.SetInstance(b);this._timelineManager.SetTimelineObjectClassToMap(b.GetObjectClass(),this);break}}HasTrackInstance(a,b){for(const d of this._tracks)if(d.IsInstanceTrack())if(b){if(b===d.GetId()&amp;&amp;a===d.GetInstance())return!0}else if(a===d.GetInstance())return!0;return!1}HasValidTracks(){return this._tracks.some(a=&gt;a.IsInstanceTrack()?a.CanInstanceBeValid():!0)}HasValidGlobalTracks(){return this._tracks.some(a=&gt;a.IsInstanceTrack()?a.CanInstanceBeValid()?
(a=a.GetObjectClass())?a.IsGlobal():!1:!1:!1)}GetPropertyTrack(a){for(const b of this.GetTracks())for(const d of b.GetPropertyTracks())if(d.GetPropertyName()===a)return d}GetTrackFromInstance(a){for(const b of this._tracks)if(a===b.GetInstance())return b;return null}GetKeyframeWithTags(a){a=a?a.split(" "):[];a=[...(new Set(a.map(b=&gt;b.toLowerCase().trim()))).values()];for(const b of this.GetTracks())for(const d of b.GetKeyframeDataItems())if(a.every(c=&gt;d.HasTag(c)))return d}GetObjectClasses(){const a=
[];for(const b of this.GetTracks())a.push(b.GetObjectClass());return a.filter(b=&gt;b)}_SaveToJson(){return{tracksJson:this._SaveTracksToJson(),name:this._name,playheadTime:this.GetTime(),playbackRate:this._playbackRate,pingPongState:this._pingPongState,currentRepeatCount:this._currentRepeatCount,isPlaying:this._isPlaying,isScheduled:this._isScheduled,initialStateSet:this._initialStateSet,finishedTriggers:this._finishedTriggers,complete:this._complete,released:this._released,markedForRemoval:this._markedForRemoval,
completedTick:this._completedTick,implicitPause:this._implicitPause,isTemplate:this._isTemplate,tags:this._tags.join(" "),stringTags:this._stringTags,tagsChanged:this._tagsChanged,firstTick:this._firstTick}}_LoadFromJson(a){a&amp;&amp;(this._LoadTracksFromJson(a.tracksJson),this._name=a.name,this._playheadTime=a.playheadTime,this._playbackRate=a.playbackRate,this._pingPongState=a.pingPongState,this._currentRepeatCount=a.currentRepeatCount,this._isPlaying=!!a.isPlaying,this._isScheduled=!!a.isScheduled,this._initialStateSet=
!!a.initialStateSet,this._finishedTriggers=a.hasOwnProperty("finishedTriggers")?!!a.finishedTriggers:!1,this._complete=!!a.complete,this._released=!!a.released,this._markedForRemoval=!!a.markedForRemoval,this._completedTick=a.completedTick,this._implicitPause=!!a.implicitPause,this._isTemplate=!!a.isTemplate,this._tags=a.tags.split(" "),this._stringTags=a.stringTags,this._tagsChanged=!!a.tagsChanged,this._firstTick=!!a.firstTick)}_SaveTracksToJson(){return this._tracks.map(a=&gt;a._SaveToJson())}_LoadTracksFromJson(a){a.forEach((b,
d)=&gt;{this._tracks[d]._LoadFromJson(b)});this._tracks.filter(b=&gt;b.CanInstanceBeValid())}static _HasTag(a){const b=this.GetTags();return""===a?1===b.length&amp;&amp;""===b[0]:b.map(d=&gt;d.toLowerCase()).includes(a.toLowerCase())}static _GetTagArray(a){if(C3$jscomp$84.IsArray(a))return a.slice(0);if(C3$jscomp$84.IsString(a))return a.split(" ")}GetITimelineState(){this._iTimelineState||(this._iTimelineState=C3$jscomp$84.New(self.ITimelineState,this));return this._iTimelineState}};"use strict";
const C3$jscomp$85=self.C3;
C3$jscomp$85.TrackState=class extends C3$jscomp$85.DefendedBase{constructor(a,b){super();this._timeline=a;this._trackDataItem=b;this._trackData=b.GetTrackData();this._objectClassIndex=this._instanceUid=NaN;this._worldInfo=this._instance=null;this._isNested=0&lt;b.GetStartOffset();this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this._lastKeyframeDataItem=null;this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray();this._propertyTracks=[];this.CreatePropertyTrackStates();
this._needsBeforeAndAfter=this._renderChange=this._worldInfoChange=0}static Create(a,b){return C3$jscomp$85.New(C3$jscomp$85.TrackState,a,b)}Release(){this._keyframeDataItems=null;for(const a of this._propertyTracks)a.Release();C3$jscomp$85.clearArray(this._propertyTracks);this._lastKeyframeDataItem=this._trackDataItem=this._worldInfo=this._instance=this._timeline=this._propertyTracks=null}CreatePropertyTrackStates(){for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3$jscomp$85.PropertyTrackState.Create(this,
a))}TimelineRemoved(){for(const a of this._propertyTracks)a.TimelineRemoved()}CleanCaches(){for(const a of this._propertyTracks)a.CleanCaches();this._worldInfo=this._instance=null}GetTimeline(){return this._timeline}GetRuntime(){return this._timeline.GetRuntime()}GetKeyframeDataItems(){return this._keyframeDataItems?this._keyframeDataItems:this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray()}GetPropertyTracks(){return this._propertyTracks}GetPropertyTrack(a){for(let b=
0;b&lt;this._propertyTracks.length;b++){const d=this._propertyTracks[b];if(d.GetPropertyName()===a)return d}}MaybeGetInstance(){this._instance||this.GetInstance()}IsInstanceValid(){return this._instance?!this._instance.IsDestroyed():!1}CanInstanceBeValid(){if(!this.IsInstanceTrack())return!1;var a=this.GetInstanceUID();return(a=this.GetRuntime().GetInstanceByUID(a))?!a.IsDestroyed():!1}GetObjectClass(){if(this.IsInstanceTrack()){var a=this.GetObjectClassIndex();if(-1!==a)return this.GetRuntime().GetObjectClassByIndex(a)}}ClearInstance(){this._instance=
null;this._instanceUid=-1;this._worldInfo=null;this._objectClassIndex=-1}HasInstance(){return!!this._instance}GetInstance(){if(this._instance&amp;&amp;this.IsInstanceValid())return this._instance;const a=this.GetInstanceUID();return this._instance=this.GetRuntime().GetInstanceByUID(a)}SetInstance(a){if(this._instance!==a){this.CleanCaches();this._instance=a;this._objectClassIndex=a.GetObjectClass().GetIndex();this._instanceUid=a.GetUID();this._worldInfo=a.GetWorldInfo();for(const h of this.propertyTrackItems()){const k=
h.sourceAdapter;switch(h.propertyTrack.GetSourceAdapterId()){case "instance-variable":k.GetEditorIndex();var b=a.GetObjectClass(),d=b.GetInstanceVariableIndexByName(h.name),c=b.GetInstanceVariableName(d);b=b.GetInstanceVariableType(d);c===h.name&amp;&amp;b===h.type&amp;&amp;k.UpdateInstanceVariableIndex(d);break;case "behavior":var e=h.behaviorType;d=this.GetObjectClass();c=a.GetObjectClass();b=k.GetBehaviorType(c);e&amp;&amp;b&amp;&amp;(e=e.GetName(),d.GetBehaviorIndexByName(e),c.GetBehaviorIndexByName(e),k.GetEditorIndex(),k.UpdateBehaviorTypeSid(b.GetSID()))}}}}*propertyTrackItems(){for(const d of this._propertyTracks){var a=
d.GetSourceAdapter(),b=this.GetObjectClass();const c={propertyTrack:d,sourceAdapter:a};switch(d.GetSourceAdapterId()){case "world-instance":c.property=d.GetPropertyName();break;case "instance-variable":a=a.GetEditorIndex();c.name=b.GetInstanceVariableName(a);c.type=b.GetInstanceVariableType(a);break;case "effect":b=b.GetEffectList();a=a.GetEffectType(b);c.effectType=a;break;case "behavior":a=a.GetBehaviorType(b);c.behaviorType=a;break;case "plugin":c.plugin=b.GetPlugin()}yield c}}GetWorldInfo(){if(this._worldInfo&amp;&amp;
this.IsInstanceValid())return this._worldInfo;const a=this.GetInstance();a&amp;&amp;(this._worldInfo=a.GetWorldInfo());return this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){return this._instanceUid?this._instanceUid:this._trackDataItem.GetInstanceUID()}SetInstanceUID(a){this._trackDataItem.SetInstanceUID(a)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._trackDataItem.SetInterpolationMode(a)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}GetStartOffset(){return this._trackDataItem.GetStartOffset()}GetLocalTotalTime(){return this._trackDataItem.GetLocalTotalTime()}SetLocalTotalTime(a){this._trackDataItem.SetLocalTotalTime(a)}SetResultMode(a){this._trackDataItem.SetResultMode(a)}SetEase(a){for(const b of this.GetKeyframeDataItems())b.SetEase(a);
for(const b of this.GetPropertyTracks())b.SetEase(a)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(a){this._trackDataItem.SetEnable(a)}GetObjectClassIndex(){return isNaN(this._objectClassIndex)?this._trackDataItem.GetObjectClassIndex():this._objectClassIndex}SetObjectClassIndex(a){this._trackDataItem.SetObjectClassIndex(a)}SetOriginalWidth(a){this._trackDataItem.SetOriginalWidth(a)}GetOriginalWidth(){const a=this.GetInstance();return a&amp;&amp;a.GetSdkInstance().IsOriginalSizeKnown()?a.GetSdkInstance().GetOriginalWidth():
this._trackDataItem.GetOriginalWidth()}SetOriginalHeight(a){this._trackDataItem.SetOriginalHeight(a)}GetOriginalHeight(){const a=this.GetInstance();return a&amp;&amp;a.GetSdkInstance().IsOriginalSizeKnown()?a.GetSdkInstance().GetOriginalHeight():this._trackDataItem.GetOriginalHeight()}GetType(){return this._trackDataItem.GetType()}GetName(){return this._trackDataItem.GetName()}IsInstanceTrack(){return 0===this.GetType()}IsValueTrack(){return 1===this.GetType()}IsAudioTrack(){return 2===this.GetType()}GetWorldInfoChange(){return this._worldInfoChange}GetRenderChange(){return this._renderChange}GetNeedsBeforeAndAfter(){return this._needsBeforeAndAfter}IsNested(){return this._isNested}SetResetState(){for(const a of this._propertyTracks)a.SetResetState()}SetInitialState(){this.MaybeGetInstance();
if(this.IsInstanceValid()||!this.IsInstanceTrack()){var a=this.GetTimeline().IsForwardPlayBack()?0:this.GetLocalTotalTime();for(const b of this._propertyTracks)b.SetInitialState(a),0===this._worldInfoChange&amp;&amp;1===b.GetWorldInfoChange()&amp;&amp;(this._worldInfoChange=1),0===this._renderChange&amp;&amp;1===b.GetRenderChange()&amp;&amp;(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=&gt;b.GetNeedsBeforeAndAfter())&amp;&amp;(this._needsBeforeAndAfter=1);this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a);
this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this.Interpolate(a);this.OnKeyframeReached(this._GetLastKeyFrameBeforeTime(a))}}SetResumeState(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack()){this._timeline.IsForwardPlayBack();var a=this._timeline.GetTime()-this.GetStartOffset();this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a);for(const b of this._propertyTracks)b.SetResumeState(a)}}SetEndState(){if(!(this.GetTimeline().IsComplete()||(this.MaybeGetInstance(),
!this.IsInstanceValid()&amp;&amp;this.IsInstanceTrack()||this._isNested))){const a=this._timeline.GetTime(),b=this.GetStartOffset()+this.GetLocalTotalTime();a&gt;=b?this.Interpolate(this.GetLocalTotalTime(),!0,!1,!0):0&gt;=a&amp;&amp;this.Interpolate(0,!0,!1,!0)}}_SetUpdateState(){for(let a=0,b=this._propertyTracks.length;a&lt;b;a++){const d=this._propertyTracks[a];d._SetUpdateState();0===this._worldInfoChange&amp;&amp;1===d.GetWorldInfoChange()&amp;&amp;(this._worldInfoChange=1);0===this._renderChange&amp;&amp;1===d.GetRenderChange()&amp;&amp;(this._renderChange=
1)}}BeforeInterpolate(){const a=this._propertyTracks.length;for(let b=0;b&lt;a;b++)this._propertyTracks[b].BeforeInterpolate()}Interpolate(a,b=!1,d=!1,c=!1,e=!1,h=!1){this._instance||this.GetInstance();const k=this._instance&amp;&amp;!this._instance.IsDestroyed(),m=0===this._trackDataItem._type;if(!(!k&amp;&amp;m||h&amp;&amp;m&amp;&amp;this.GetObjectClass().IsGlobal()||(a-=this.GetStartOffset(),0&gt;a))){this.MaybeSetInitialStateOfNestedTrack(a,b);this.MaybeTriggerKeyframeReachedConditions(a,b,e);for(let p=0,q=this._propertyTracks.length;p&lt;
q;p++)this._propertyTracks[p].Interpolate(a,d,c);this.MaybeSetEndStateOfNestedTrack(a,b);0!==this._worldInfoChange&amp;&amp;(this._worldInfo||(this._worldInfo=this._instance.GetWorldInfo()),this._worldInfo&amp;&amp;this._worldInfo.SetBboxChanged())}}AfterInterpolate(){const a=this._propertyTracks.length;for(let b=0;b&lt;a;b++)this._propertyTracks[b].AfterInterpolate()}MaybeSetInitialStateOfNestedTrack(a,b){if(b&amp;&amp;this._isNested&amp;&amp;!this._initialStateOfNestedSet){if(this.GetTimeline().IsForwardPlayBack()){if(0&gt;a)return;
for(const d of this._propertyTracks)d.Interpolate(0,!1,!0)}else{if(a&gt;this.GetLocalTotalTime())return;for(const d of this._propertyTracks)d.Interpolate(this.GetLocalTotalTime(),!1,!0)}for(const d of this._propertyTracks)d.SetInitialState();this._initialStateOfNestedSet=!0}}MaybeSetEndStateOfNestedTrack(a,b){if(b&amp;&amp;this._isNested&amp;&amp;!this._endStateOfNestedSet)if(this.GetTimeline().IsForwardPlayBack()){if(a&gt;=this.GetLocalTotalTime()){for(const d of this._propertyTracks)d.Interpolate(this.GetLocalTotalTime(),
!1,!0);this._endStateOfNestedSet=!0}}else if(0&gt;=a){for(const d of this._propertyTracks)d.Interpolate(0,!1,!0);this._endStateOfNestedSet=!0}}MaybeTriggerKeyframeReachedConditions(a,b,d){if(!d&amp;&amp;b&amp;&amp;C3$jscomp$85.Plugins.Timeline){b=this.GetTimeline();d=this._lastKeyframeDataItem.GetNext();var c=this._lastKeyframeDataItem.GetTime(),e=d?d.GetTime():b.GetTotalTime();if(a&lt;=c||a&gt;=e)this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(a,this._trackDataItem),b.IsForwardPlayBack()?
d&amp;&amp;this.OnKeyframeReached(this._lastKeyframeDataItem):(a=this._lastKeyframeDataItem.GetNext())&amp;&amp;this.OnKeyframeReached(a)}}_GetLastKeyFrameBeforeTime(a){const b=this._trackData.GetKeyFrameDataItemAtTime(a,this._trackDataItem);return b?b:this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(a,this._trackDataItem)}OnKeyframeReached(a){const b=this.GetTimeline();C3$jscomp$85.Plugins.Timeline.Cnds.SetTriggerTimeline(b);C3$jscomp$85.Plugins.Timeline.Cnds.SetTriggerKeyframe(a);a=b.GetTimelineManager();
a.Trigger(C3$jscomp$85.Plugins.Timeline.Cnds.OnAnyKeyframeReached);a.Trigger(C3$jscomp$85.Plugins.Timeline.Cnds.OnKeyframeReached);C3$jscomp$85.Plugins.Timeline.Cnds.SetTriggerTimeline(null);C3$jscomp$85.Plugins.Timeline.Cnds.SetTriggerKeyframe(null)}AddKeyframe(){return this._trackDataItem.GetKeyframeData().AddEmptyKeyframeDataItem()}AddPropertyTrack(){var a=this._trackDataItem.GetPropertyTrackData().AddEmptyPropertyTrackDataItem();a=C3$jscomp$85.PropertyTrackState.Create(this,a);this._propertyTracks.push(a);
return a}DeleteKeyframes(a){this._trackDataItem.GetKeyframeData().DeleteKeyframeDataItems(a)}DeletePropertyKeyframes(a){for(const b of this._propertyTracks)b.DeletePropertyKeyframes(a)}SaveState(){for(const a of this._propertyTracks)a.SaveState()}CompareInitialStateWithCurrent(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack())for(const a of this._propertyTracks)a.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){this.MaybeGetInstance();if(this.IsInstanceValid()||
!this.IsInstanceTrack()){var a=!1;for(const b of this._propertyTracks){const d=b.CompareSaveStateWithCurrent();!a&amp;&amp;d&amp;&amp;(a=!0)}a&amp;&amp;(a=this.AddKeyframe(),a.SetTime(this.GetTimeline().GetTime()),a.SetEase("noease"),a.SetEnable(!0),a.SetTags(""))}}_SaveToJson(){var a=this.GetInstance();a=a?a.GetUID():this.GetInstanceUID();return{propertyTracksJson:this._SavePropertyTracksToJson(),lastKeyframeDataItemJson:this._SaveLastKeyframeDataItemToJson(),initialStateOfNestedSet:this._initialStateOfNestedSet,endStateOfNestedSet:this._endStateOfNestedSet,
instanceUid:a}}_LoadFromJson(a){if(a){this._LoadPropertyTracksFromJson(a.propertyTracksJson);this._LoadLastKeyframeDataItemFromJson(a.lastKeyframeDataItemJson);this._LoadInstanceFromJson(a.instanceUid);this._initialStateOfNestedSet=!1;a.hasOwnProperty.initialStateOfNestedSet&amp;&amp;(this._initialStateOfNestedSet=a.initialStateOfNestedSet);this._endStateOfNestedSet=!1;a.hasOwnProperty.endStateOfNestedSet&amp;&amp;(this._endStateOfNestedSet=a.endStateOfNestedSet);for(const b of this._propertyTracks)0===this._worldInfoChange&amp;&amp;
1===b.GetWorldInfoChange()&amp;&amp;(this._worldInfoChange=1),0===this._renderChange&amp;&amp;1===b.GetRenderChange()&amp;&amp;(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=&gt;b.GetNeedsBeforeAndAfter())&amp;&amp;(this._needsBeforeAndAfter=1)}}_SaveLastKeyframeDataItemToJson(){return this._trackDataItem.GetKeyframeData().GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(a=&gt;a._SaveToJson())}_LoadPropertyTracksFromJson(a){a.forEach((b,d)=&gt;
{this._propertyTracks[d]._LoadFromJson(b)})}_LoadInstanceFromJson(a){if(C3$jscomp$85.IsFiniteNumber(a)&amp;&amp;(a=this.GetRuntime().GetInstanceByUID(a))){var b=this.GetTimeline();b.ClearTrackInstances();b.SetTrackInstance(this._trackDataItem.GetId(),a)}}_LoadLastKeyframeDataItemFromJson(a){this._lastKeyframeDataItem=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemFromIndex(a)}};"use strict";const C3$jscomp$86=self.C3;
C3$jscomp$86.PropertyTrackState=class extends C3$jscomp$86.DefendedBase{constructor(a,b){super();this._track=a;this._propertyTrackDataItem=b;this._propertyTrackData=b.GetPropertyTrackData();this._needsBeforeAndAfter=this._renderChange=this._worldInfoChange=0;this._sourceAdapter=this.GetSourceAdapter();this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();this._absoluteValueObject=this._lastPropertyKeyframeDataItem=null}static Create(a,
b){return C3$jscomp$86.New(C3$jscomp$86.PropertyTrackState,a,b)}Release(){this._track=null;this._sourceAdapter&amp;&amp;(this._sourceAdapter.Release(),this._sourceAdapter=null);this._propertyTrackData=this._propertyTrackDataItem=this._propertyKeyframeDataItems=null}GetWorldInfoChange(){return this._worldInfoChange}GetRenderChange(){return this._renderChange}GetNeedsBeforeAndAfter(){return this._needsBeforeAndAfter}HasAbsoluteValueObject(){return!!this._absoluteValueObject}SetAbsoluteValueObject(a){this._absoluteValueObject=
a}GetAbsoluteValueObject(){return this._absoluteValueObject}GetTrack(){return this._track}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyTrackData(){return this._propertyTrackData}GetTimeline(){return this._track.GetTimeline()}GetRuntime(){return this._track.GetRuntime()}GetInstance(){return this._track.GetInstance()}GetSourceAdapter(){if(this._sourceAdapter)return this._sourceAdapter;let a;switch(this._propertyTrackDataItem.GetSourceAdapterId()){case "behavior":a=new C3$jscomp$86.PropertyTrackState.BehaviorSourceAdapter(this);
break;case "effect":a=new C3$jscomp$86.PropertyTrackState.EffectSourceAdapter(this);this._renderChange=1;break;case "instance-variable":a=new C3$jscomp$86.PropertyTrackState.InstanceVariableSourceAdapter(this);break;case "plugin":a=new C3$jscomp$86.PropertyTrackState.PluginSourceAdapter(this);this._renderChange=1;break;case "world-instance":a=new C3$jscomp$86.PropertyTrackState.PropertySourceAdapter(this);this._worldInfoChange=this._renderChange=1;break;case "value":a=new C3$jscomp$86.PropertyTrackState.ValueSourceAdapter(this);
break;case "audio":a=new C3$jscomp$86.PropertyTrackState.AudioSourceAdapter(this)}return this._sourceAdapter=a}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(a){this._propertyTrackDataItem.SetSourceAdapterId(a)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(a){this._propertyTrackDataItem.SetSourceAdapterArguments(a)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(a){this._propertyTrackDataItem.SetProperty(a)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(a){this._propertyTrackDataItem.SetType(a)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(a){this._propertyTrackDataItem.SetMin(a)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(a){this._propertyTrackDataItem.SetMax(a)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(a){this._propertyTrackDataItem.SetEnable(a)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(a){this._propertyTrackDataItem.SetInterpolationMode(a)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(a){this._propertyTrackDataItem.SetResultMode(a)}SetEase(a){for(const b of this.GetPropertyKeyframeDataItems())b.SetEase(a)}CanHavePropertyKeyframes(){return this._propertyTrackDataItem.CanHavePropertyKeyframes()}GetPropertyKeyframeDataItems(){return this._propertyKeyframeDataItems?
this._propertyKeyframeDataItems:this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}*GetPropertyKeyframeValues(){for(const a of this.GetPropertyKeyframeDataItems())yield a.GetValueWithResultMode()}TimelineRemoved(){this.GetSourceAdapter().TimelineRemoved()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}GetCurrentState(){return this.GetSourceAdapter().GetCurrentState()}SetResetState(){this.GetSourceAdapter().SetResetState()}SetInitialState(a){this.GetSourceAdapter().SetInitialState();
this._lastPropertyKeyframeDataItem=this._GetLastPropertyKeyFrameBeforeTime(a);this._SetUpdateState()}SetResumeState(a){this.GetSourceAdapter().SetResumeState();this._lastPropertyKeyframeDataItem=this._GetLastPropertyKeyFrameBeforeTime(a)}_SetUpdateState(){var a=this.GetTrack();this._needsBeforeAndAfter=0;if(a.IsInstanceTrack()){var b=this.GetTimeline();a=a.GetInstance();const d=this.GetSourceAdapter(),c=this.GetPropertyName();d.MayNeedBeforeAndAfterInterpolate()?(b=b.GetSimilarPropertyTracks(a,d,
c))&amp;&amp;b.length&amp;&amp;(this._needsBeforeAndAfter=1):this._needsBeforeAndAfter=0}}_GetLastPropertyKeyFrameBeforeTime(a){const b=this.GetTimeline(),d=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(a,this._propertyTrackDataItem);return d?d:b.IsForwardPlayBack()?this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem):this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,this._propertyTrackDataItem)}BeforeInterpolate(){this._sourceAdapter.BeforeInterpolate()}Interpolate(a,
b=!1,d=!1){let c;if(b)var e=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);else{if(this._lastPropertyKeyframeDataItem){var h=this.GetTimeline();const k=this._lastPropertyKeyframeDataItem.GetNext();e=this._lastPropertyKeyframeDataItem.GetTime();h=k?k.GetTime():h.GetTotalTime();if(a&lt;=e||a&gt;=h)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem)}else this._lastPropertyKeyframeDataItem=
this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);e=this._lastPropertyKeyframeDataItem}e&amp;&amp;(c=e.GetNext());this._sourceAdapter.Interpolate(a,e,c,b,d)}GetInterpolatedValue(a){if(this._lastPropertyKeyframeDataItem){var b=this.GetTimeline();const c=this._lastPropertyKeyframeDataItem.GetNext();var d=this._lastPropertyKeyframeDataItem.GetTime();b=c?c.GetTime():b.GetTotalTime();if(a&lt;=d||a&gt;=b)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,
this._propertyTrackDataItem)}else this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);d=this._lastPropertyKeyframeDataItem;b=d.GetNext();return this._sourceAdapter.GetInterpolatedValue(a,d,b)}AfterInterpolate(){this._sourceAdapter.AfterInterpolate()}static GetStartPropertyKeyframeForTime(a,b){const d=b.GetPropertyTrackDataItem();return b._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,d)}static GetEndPropertyKeyframeForTime(a,
b){const d=b.GetPropertyTrackDataItem();return b._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,d)}AddPropertyKeyframe(){const a=this._propertyTrackDataItem.GetPropertyKeyframeData().AddEmptyPropertyKeyframeDataItem();this._lastPropertyKeyframeDataItem=null;return a}DeletePropertyKeyframes(a){this._lastPropertyKeyframeDataItem=null;this._propertyTrackDataItem.GetPropertyKeyframeData().DeletePropertyKeyframeDataItems(a)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){if(this.GetSourceAdapter().CompareInitialStateWithCurrent()){const a=
this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem),b=this.GetSourceAdapter().GetCurrentState();a.SetAbsoluteValue(b)}}CompareSaveStateWithCurrent(){const a=this.GetSourceAdapter().CompareSaveStateWithCurrent();a&amp;&amp;this.AddPropertyKeyframeAtCurrentTime();this.GetSourceAdapter().ClearSaveState();return a}AddPropertyKeyframeAtCurrentTime(){const a=this.GetTimeline().GetTime(),b=this.GetSourceAdapter(),d=C3$jscomp$86.PropertyTrackState.GetStartPropertyKeyframeForTime(a,
this),c=this.AddPropertyKeyframe();c.SetType(d.GetType());c.SetTime(a);c.SetEase(d.GetEase());c.SetEnable(!0);c.SetValue(b.GetValueAtTime());c.SetAbsoluteValue(b.GetCurrentState())}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(a){a&amp;&amp;this.GetSourceAdapter()._LoadFromJson(a.sourceAdapterJson)}};"use strict";const NS=self.C3.PropertyTrackState;
NS.PropertySourceAdapter=class{constructor(a){this._propertyTrack=a;this._propertyAdapter=null;this.GetPropertyAdapter()}Release(){this._propertyAdapter&amp;&amp;(this._propertyAdapter.Release(),this._propertyAdapter=null);this._propertyTrack=null}MayNeedBeforeAndAfterInterpolate(){return this._propertyAdapter.MayNeedBeforeAndAfterInterpolate()}GetPropertyTrack(){return this._propertyTrack}TimelineRemoved(){this._propertyAdapter&amp;&amp;this._propertyAdapter.TimelineRemoved()}CleanCaches(){this._propertyAdapter&amp;&amp;
this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){return this._propertyAdapter?this._propertyAdapter:this._propertyAdapter=this._CreatePropertyAdapter()}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetResetState(){this.GetPropertyAdapter().SetResetState()}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}BeforeInterpolate(){this._propertyAdapter.BeforeChangeProperty()}Interpolate(a,b,d,c,e){let h;
switch(this._propertyTrack.GetPropertyKeyframeType()){case "numeric":h=NS.NumericTypeAdapter.Interpolate(a,b,d,this._propertyTrack);break;case "angle":h=NS.AngleTypeAdapter.Interpolate(a,b,d,this._propertyTrack);break;case "boolean":h=NS.BooleanTypeAdapter.Interpolate(a,b,d,this._propertyTrack);break;case "color":h=NS.ColorTypeAdapter.Interpolate(a,b,d,this._propertyTrack);break;case "text":h=NS.TextTypeAdapter.Interpolate(a,b,d,this._propertyTrack)}this._propertyAdapter.ChangeProperty(a,h,b,d,c,
e)}GetInterpolatedValue(a,b,d){switch(this._propertyTrack.GetPropertyKeyframeType()){case "numeric":return NS.NumericTypeAdapter.Interpolate(a,b,d,this._propertyTrack);case "angle":return NS.AngleTypeAdapter.Interpolate(a,b,d,this._propertyTrack);case "boolean":return NS.BooleanTypeAdapter.Interpolate(a,b,d,this._propertyTrack);case "color":return NS.ColorTypeAdapter.Interpolate(a,b,d,this._propertyTrack);case "text":return NS.TextTypeAdapter.Interpolate(a,b,d,this._propertyTrack)}}AfterInterpolate(){this._propertyAdapter.AfterChangeProperty()}SaveState(){this.GetPropertyAdapter().SetSaveState()}ClearSaveState(){this.GetPropertyAdapter().ClearSaveState()}GetCurrentState(){return this.GetPropertyAdapter().GetCurrentState()}CompareInitialStateWithCurrent(){return this.GetPropertyAdapter().CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){return this.GetPropertyAdapter().CompareSaveStateWithCurrent()}GetValueAtTime(){const a=
this._propertyTrack,b=a.GetTrack().GetTimeline().GetTime(),d=NS.GetStartPropertyKeyframeForTime(b,a),c=d.GetNext();switch(a.GetPropertyKeyframeType()){case "numeric":return NS.NumericTypeAdapter.Interpolate(b,d,c,a);case "angle":return NS.AngleTypeAdapter.Interpolate(b,d,c,a);case "boolean":return NS.BooleanTypeAdapter.Interpolate(b,d,c,a);case "color":return NS.ColorTypeAdapter.Interpolate(b,d,c,a);case "text":return NS.TextTypeAdapter.Interpolate(b,d,c,a)}}_CreatePropertyAdapter(){const a=this._propertyTrack;
switch(a.CanHavePropertyKeyframes()?a.GetPropertyKeyframeType():""){case "combo":case "boolean":case "text":case "string":return new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this);case "numeric":case "number":case "angle":return"combo"===this._propertyTrack.GetPropertyType()?new NS.PropertyInterpolationAdapter.NoInterpolationAdapter(this):new NS.PropertyInterpolationAdapter.NumericInterpolationAdapter(this);case "color":case "offsetColor":return new NS.PropertyInterpolationAdapter.ColorInterpolationAdapter(this);
default:return new NS.PropertyInterpolationAdapter.NumericInterpolationAdapter(this)}}_SaveToJson(){return{propertyAdapterJson:this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(a){a&amp;&amp;this.GetPropertyAdapter()._LoadFromJson(a.propertyAdapterJson)}};"use strict";const C3$jscomp$88=self.C3,INDEX=0;
class InstanceVariableSourceAdapter extends C3$jscomp$88.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]}GetIndex(){return this._updatedIndex?this._updatedIndex:super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[INDEX]!==
a&amp;&amp;(this._updatedIndex=a)}Interpolate(a,b,d,c,e){this.GetPropertyAdapter().CanChange(b.GetValue())&amp;&amp;super.Interpolate(a,b,d,c,e)}GetInterpolatedValue(a,b,d){if(this.GetPropertyAdapter().CanChange(b.GetValue()))return super.GetInterpolatedValue(a,b,d)}_SaveToJson(){return Object.assign(super._SaveToJson(),{index:this._updatedIndex})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._updatedIndex=a.index)}}C3$jscomp$88.PropertyTrackState.InstanceVariableSourceAdapter=InstanceVariableSourceAdapter;"use strict";
const C3$jscomp$89=self.C3;
class BehaviorSourceAdapter extends C3$jscomp$89.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._sid=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){var a=this._propertyTrack.GetPropertyTrackDataItem(),b=this._propertyTrack.GetTrack();a=this._sid?this._sid:a.GetSourceAdapterArguments()[0];b=b.GetInstance();a=b.GetBehaviorIndexBySID(a);return b.GetBehaviorInstances()[a].GetSdkInstance()}GetBehaviorType(a){const b=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[2];
return a.GetBehaviorTypeByName(b)}UpdateBehaviorTypeSid(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]!==a&amp;&amp;(this._sid=a)}Interpolate(a,b,d,c,e){const h=this._propertyTrack.GetTrack().GetInstance();this.GetBehaviorType(h.GetObjectClass())&amp;&amp;super.Interpolate(a,b,d,c,e)}GetInterpolatedValue(a,b,d){const c=this._propertyTrack.GetTrack().GetInstance();if(this.GetBehaviorType(c.GetObjectClass()))return super.GetInterpolatedValue(a,b,d)}_SaveToJson(){return Object.assign(super._SaveToJson(),
{sid:this._sid})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._sid=a.sid)}}C3$jscomp$89.PropertyTrackState.BehaviorSourceAdapter=BehaviorSourceAdapter;"use strict";const C3$jscomp$90=self.C3;
class EffectSourceAdapter extends C3$jscomp$90.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var b=a.GetEffectList();b=this.GetEffectType(b).GetIndex();return a.IsEffectIndexActive(b)?a.GetEffectParametersForIndex(b):null}GetEffectType(a){const b=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0];
return a.GetEffectTypeByName(b)}Interpolate(a,b,d,c,e){this._IsEffectActive()&amp;&amp;super.Interpolate(a,b,d,c,e)}GetInterpolatedValue(a,b,d){if(this._IsEffectActive())return super.GetInterpolatedValue(a,b,d)}_IsEffectActive(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var b=a.GetEffectList();if(b=this.GetEffectType(b))return b=b.GetIndex(),a.IsEffectIndexActive(b)}}C3$jscomp$90.PropertyTrackState.EffectSourceAdapter=EffectSourceAdapter;"use strict";
const C3$jscomp$91=self.C3;
class PluginSourceAdapter extends C3$jscomp$91.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(a,b,d,c,e){var h=this._propertyTrack.GetTrack();const k=h.GetObjectClass().GetPlugin();h=h.GetInstance().GetObjectClass().GetPlugin();k===h&amp;&amp;super.Interpolate(a,b,d,c,e)}GetInterpolatedValue(a,b,
d){var c=this._propertyTrack.GetTrack();const e=c.GetObjectClass().GetPlugin();c=c.GetInstance().GetObjectClass().GetPlugin();if(e===c)return super.GetInterpolatedValue(a,b,d)}}C3$jscomp$91.PropertyTrackState.PluginSourceAdapter=PluginSourceAdapter;"use strict";const C3$jscomp$92=self.C3;
class ValueSourceAdapter extends C3$jscomp$92.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._value=0;this._init=!1}MayNeedBeforeAndAfterInterpolate(){return!1}SetInitialState(){const a=this._propertyTrack.GetPropertyTrackData();let b=this._propertyTrack.GetPropertyTrackDataItem();b=a.GetFirstPropertyKeyframeDataItem(b);this._value=b.GetValueWithResultMode()}SetResumeState(){}GetValue(){this._init||this._propertyTrack.Interpolate(0);return this._value}Interpolate(a,b,d,c,e){this._value=
C3$jscomp$92.PropertyTrackState.NumericTypeAdapter.Interpolate(a,b,d,this._propertyTrack);this._init=!0}SaveState(){}ClearSaveState(){}GetCurrentState(){return this._value}CompareInitialStateWithCurrent(){return!1}CompareSaveStateWithCurrent(){return!1}_SaveToJson(){return{value:this._value,init:this._init}}_LoadFromJson(a){a&amp;&amp;(this._value=a.value,this._init=a.hasOwnProperty("init")?a.init:!0)}}C3$jscomp$92.PropertyTrackState.ValueSourceAdapter=ValueSourceAdapter;"use strict";const C3$jscomp$93=self.C3;
class AudioSourceAdapter extends C3$jscomp$93.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._audioPlaybackStarted=!1;this._expressions=this._actions=this._sdkInstance=null;this._timeline=this._propertyTrack.GetTimeline();this._track=this._propertyTrack.GetTrack();this._sourceAdapterArgs=this._propertyTrack.GetSourceAdapterArgs();this._fileArgs=this._sourceAdapterArgs[0];this._startOffsetTime=this._sourceAdapterArgs[1];this._audioTag=this._sourceAdapterArgs[3]?this._sourceAdapterArgs[3]:
Math.random().toString(36).slice(2);this._volume=this._pauseVolume=this._pauseTime=NaN;this._audioSource=null;this._Initialize()}Release(){super.Release();this._audioSource=this._fileArgs=this._sourceAdapterArgs=this._track=this._timeline=this._expressions=this._actions=this._sdkInstance=null}_Initialize(){if(self.C3.Plugins.Audio){var a=this._propertyTrack.GetRuntime().GetObjectClassByName("audio");a&amp;&amp;(this._sdkInstance=a.GetSingleGlobalInstance().GetSdkInstance());this._actions=self.C3.Plugins.Audio.Acts;
this._expressions=self.C3.Plugins.Audio.Exps}}_MaybeSetAudioSource(){if(!this._audioSource){var a=this._propertyTrack.GetTrack().GetPropertyTrack("audioSource");a&amp;&amp;(this._audioSource=a.GetSourceAdapter())}}_GetPauseVolume(){const a=this._propertyTrack.GetTrack().GetPropertyTrack("volume");return a?a.GetSourceAdapter()._pauseVolume:this._pauseVolume}TimelineRemoved(){super.TimelineRemoved();this._audioPlaybackStarted=!1;this._sdkInstance&amp;&amp;(this._expressions&amp;&amp;(this._pauseTime=this._expressions.PlaybackTime.call(this._sdkInstance,
this._audioTag),this._pauseVolume=this._expressions.Volume.call(this._sdkInstance,this._audioTag)),this._actions&amp;&amp;this._actions.Stop.call(this._sdkInstance,this._audioTag))}GetAudioTag(){return this._audioTag}GetVolume(){return this._volume}SetVolume(a){this._volume=a}SetInitialState(){super.SetInitialState();this._pauseTime=NaN;this._audioPlaybackStarted=!1}SetResumeState(){super.SetResumeState();const a=this._propertyTrack.GetTimeline().GetTime();this._pauseTime=a-this._startOffsetTime;switch(this._propertyTrack.GetPropertyName()){case "volume":this._pauseVolume=
this._propertyTrack.GetInterpolatedValue(a)}this._audioPlaybackStarted=!1}Interpolate(a,b,d,c,e){if(this._sdkInstance)switch(this._propertyTrack.GetPropertyName()){case "audioSource":if(!this._timeline.IsForwardPlayBack())break;if(c){this._actions&amp;&amp;this._actions.Stop.call(this._sdkInstance,this._audioTag);break}if(a&lt;this._startOffsetTime){this._audioPlaybackStarted=!1;break}b=this._expressions.PlaybackRate.call(this._sdkInstance,this._audioTag);d=this._timeline.GetPlaybackRate();d!==b&amp;&amp;this._actions.SetPlaybackRate.call(this._sdkInstance,
this._audioTag,d);if(this._audioPlaybackStarted)break;this._audioPlaybackStarted=!0;isNaN(this._pauseTime)?(b=self.performance.now(),a-=this._startOffsetTime,"suspended"===this._sdkInstance.GetAudioContextState()?this._audioPlaybackStarted=!1:(b=(self.performance.now()-b)/1E3,a+=b,this._actions&amp;&amp;(b=this.GetVolume(),isNaN(b)?(this.SetVolume(0),b=0):this.SetVolume(b),this._actions.Play.call(this._sdkInstance,this._fileArgs,0,b,this._audioTag,a)))):(a=this._pauseTime,this._pauseTime=NaN,b=this._GetPauseVolume(),
this._pauseVolume=NaN,"suspended"===this._sdkInstance.GetAudioContextState()?this._audioPlaybackStarted=!1:this._actions&amp;&amp;(this.SetVolume(b),this._actions.Play.call(this._sdkInstance,this._fileArgs,0,b,this._audioTag,a)));break;case "volume":this._MaybeSetAudioSource(),super.Interpolate(a,b,d,c,e)}}GetInterpolatedValue(a,b,d){if(this._sdkInstance)switch(this._propertyTrack.GetPropertyName()){case "volume":return this._MaybeSetAudioSource(),super.GetInterpolatedValue(a,b,d)}}Getter(a,b){return this._audioSource?
this._audioSource.GetVolume():0}Setter(a,b,d,c){this._audioSource&amp;&amp;this._audioSource.SetVolume(this.Getter()+b);this._actions&amp;&amp;this._audioSource&amp;&amp;this._actions.SetVolume.call(this._sdkInstance,this._audioSource.GetAudioTag(),this._audioSource.GetVolume())}AbsoluteSetter(a,b,d){this._audioSource&amp;&amp;this._audioSource.SetVolume(b);this._actions&amp;&amp;this._audioSource&amp;&amp;this._actions.SetVolume.call(this._sdkInstance,this._audioSource.GetAudioTag(),this._audioSource.GetVolume())}DoesRounding(){return!0}_SaveToJson(){return{audioPlaybackStarted:this._audioPlaybackStarted,
audioTag:this._audioTag,pauseTime:this._pauseTime,pauseVolume:this._pauseVolume,volume:this._volume}}_LoadFromJson(a){a&amp;&amp;(this._audioPlaybackStarted=a.audioPlaybackStarted,this._audioTag=a.audioTag,this._pauseTime=a.pauseTime,this._pauseVolume=a.pauseVolume,this._volume=a.volume,this._Initialize())}}C3$jscomp$93.PropertyTrackState.AudioSourceAdapter=AudioSourceAdapter;"use strict";
self.C3.PropertyTrackState.PropertyInterpolationAdapter=class{constructor(a){this._sourceAdapter=a;this._propertyTrack=a.GetPropertyTrack();this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo();this._property=this._propertyTrack.GetPropertyName();this._firstAbsoluteUpdate=!1;this._target=this._saveState=null}Release(){this._target=this._saveState=this._worldInfo=this._propertyTrack=this._sourceAdapter=null}MayNeedBeforeAndAfterInterpolate(){return!1}TimelineRemoved(){}CleanCaches(){this._target=
this._saveState=this._worldInfo=null}GetSourceAdapter(){return this._sourceAdapter}GetPropertyTrack(){return this._propertyTrack}GetWorldInfo(){return this._worldInfo?this._worldInfo:this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo()}SetFirstAbsoluteUpdate(a){this._firstAbsoluteUpdate=!!a}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetResetState(){}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState=null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(a){return typeof this._Getter()===
typeof a}BeforeChangeProperty(){}ChangeProperty(a,b,d,c,e){}AfterChangeProperty(){}_FirstKeyframeGetter(){return this._PickTimelinePlaybackMode(()=&gt;{const a=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(a)},()=&gt;{const a=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a)}).GetAbsoluteValue()}_CurrentKeyframeGetter(){const a=this._propertyTrack.GetTimeline().GetTime()-
this._propertyTrack.GetTrack().GetStartOffset();return this._PickTimelinePlaybackMode(()=&gt;{const b=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,b)},()=&gt;{const b=this._propertyTrack.GetPropertyTrackDataItem(),d=this._propertyTrack.GetPropertyTrackData(),c=d.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,b);return c?c:d.GetLastPropertyKeyframeDataItem(b)}).GetAbsoluteValue()}_PickTimelinePlaybackMode(a,
b){return this._propertyTrack.GetTimeline().IsForwardPlayBack()?a():b()}_PickResultMode(a,b){return"relative"===this._propertyTrack.GetResultMode()?a():b()}_PickFirstAbsoluteUpdate(a,b){return this.GetFirstAbsoluteUpdate()?(this.SetFirstAbsoluteUpdate(!1),a()):b()}_GetAbsoluteInitialValue(a){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){return this._target?this._target:this._target=this._sourceAdapter.GetTarget()}_PickSource(a,b,d,c,e,h){switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":return a();
case "effect":return b();case "instance-variable":return d();case "plugin":return c();case "world-instance":return e();case "audio":return h()}}_SaveToJson(){return{firstAbsoluteUpdate:this._firstAbsoluteUpdate,saveState:this._saveState}}_LoadFromJson(a){a&amp;&amp;(this._firstAbsoluteUpdate=a.firstAbsoluteUpdate,this._saveState=a.saveState)}_GetPropertyKeyframeStubs(a,b=!1){const d=[];for(const c of a){a=c.GetTrack().GetStartOffset();for(const e of c.GetPropertyKeyframeDataItems())b&amp;&amp;0===e.GetTime()?d.push({time:a+
e.GetTime(),value:e.GetAbsoluteValue()}):b||d.push({time:a+e.GetTime(),value:e.GetAbsoluteValue()})}return d.sort((c,e)=&gt;c.time-e.time)}_GetLastPropertyKeyframeStub(a,b,d){return this._GetPropertyKeyframeStubLowerThanPlayhead(b,d)}_GetPropertyKeyframeStubLowerThanPlayhead(a,b){for(let d=b.length-1;0&lt;=d;d--)if(b[d].time&lt;=a)return b[d];return null}};"use strict";const C3$jscomp$95=self.C3,TMP_COLORS_MAP=new Map,TMP_COLOR=[0,0,0];
class ColorInterpolationAdapter extends C3$jscomp$95.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a)}SetResetState(){}SetInitialState(){}SetResumeState(){}GetCurrentState(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),d=this._GetIndex();switch(a){case "behavior":return this._ToColorArray(b.GetPropertyValueByIndex(d));case "effect":return this._ToColorArray(b[d]);case "plugin":return this._ToColorArray(b.GetPropertyValueByIndex(d));case "world-instance":return this._ToColorArray(this._Getter())}}CompareInitialStateWithCurrent(){const a=
this._FirstKeyframeGetter();return!this._CompareColors(a,this._Getter())}CompareSaveStateWithCurrent(){return C3$jscomp$95.IsNullOrUndefined(this._saveState)?!1:!this._CompareColors(this._saveState,this._Getter())}_CompareColors(a,b){a=this._GetColorFromArray(a);b=this._GetColorFromArray(b);return a.equalsIgnoringAlpha(b)}_FirstKeyframeGetter(){const a=super._FirstKeyframeGetter();return this._GetColorFromArray(a)}_CurrentKeyframeGetter(){const a=super._CurrentKeyframeGetter();return this._GetColorFromArray(a)}_GetAbsoluteInitialValue(a){}_ToColorArray(a){return C3$jscomp$95.IsInstanceOf(a,
C3$jscomp$95.Color)?a.toArray().slice(0,3):a.slice(0,3)}_GetColorFromArray(a){return C3$jscomp$95.IsInstanceOf(a,C3$jscomp$95.Color)?a:new C3$jscomp$95.Color(a[0],a[1],a[2],1)}CanChange(a){return!0}MayNeedBeforeAndAfterInterpolate(){return!0}BeforeChangeProperty(){var a=this._propertyTrack.GetTimeline(),b=this._propertyTrack.GetInstance();const d=this._propertyTrack.GetSourceAdapter();(a=a.GetSimilarPropertyTracks(b,d,this._property))&amp;&amp;1&lt;a.length&amp;&amp;(TMP_COLORS_MAP.has(b)||TMP_COLORS_MAP.set(b,new Map),
b=TMP_COLORS_MAP.get(b),a=this._propertyTrack.GetSourceAdapterId(),b.has(a)||b.set(a,new Map),b=b.get(a),b.has(this._property)||b.set(this._property,{used:!1,color:new C3$jscomp$95.Color(0,0,0,1)}))}_GetTmpColor(a,b,d){a=TMP_COLORS_MAP.get(a).get(b).get(d);a.used=!0;return a.color}ChangeProperty(a,b,d,c,e){e=this._propertyTrack.GetTimeline();c=this._propertyTrack.GetTrack();a=this._propertyTrack.GetInstance();var h=this._propertyTrack.GetSourceAdapter();d=this._propertyTrack.GetSourceAdapterId();
if((h=e.GetSimilarPropertyTracks(a,h,this._property))&amp;&amp;1&lt;h.length){if(h=this._GetPropertyKeyframeStubs(h,!0),e=this._GetLastPropertyKeyframeStub(e,e.GetTime(),h))c=c.GetStartOffset(),h=e.time-c,0===h?this._GetTmpColor(a,d,this._property).addRgb(b[0],b[1],b[2]):0&gt;h||(e=b[0],c=b[1],b=b[2],h=this._propertyTrack.Interpolate(h,!1,!0),e=C3$jscomp$95.Color.DiffChannel(e,h[0]),c=C3$jscomp$95.Color.DiffChannel(c,h[1]),b=C3$jscomp$95.Color.DiffChannel(b,h[2]),this._GetTmpColor(a,d,this._property).addRgb(e,
c,b))}else this._Setter(b[0],b[1],b[2])}AfterChangeProperty(){const a=this._propertyTrack.GetInstance();if(TMP_COLORS_MAP.has(a)){var b=TMP_COLORS_MAP.get(a),d=this._propertyTrack.GetSourceAdapterId();if(b.has(d)){var c=b.get(d);if(c.has(this._property)){var e=c.get(this._property),h=e.color;e.used&amp;&amp;this._Setter(h.getR(),h.getG(),h.getB());0===c.size&amp;&amp;b.delete(d);0===b.size&amp;&amp;TMP_COLORS_MAP.delete(a)}}}}_Getter(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),d=this._GetIndex();
switch(a){case "behavior":return this._GetColorFromArray(b.GetPropertyValueByIndex(d));case "effect":return b[d].clone();case "plugin":return this._GetColorFromArray(b.GetPropertyValueByIndex(d));case "world-instance":return this.GetWorldInfo().GetUnpremultipliedColor().clone()}}_Setter(a,b,d){const c=this._propertyTrack.GetSourceAdapterId(),e=this._GetTarget(),h=this._GetIndex();switch(c){case "behavior":TMP_COLOR[0]=a;TMP_COLOR[1]=b;TMP_COLOR[2]=d;e.SetPropertyValueByIndex(h,TMP_COLOR);break;case "effect":e[h].setRgb(a,
b,d);break;case "plugin":TMP_COLOR[0]=a;TMP_COLOR[1]=b;TMP_COLOR[2]=d;e.SetPropertyValueByIndex(h,TMP_COLOR);break;case "world-instance":this.GetWorldInfo().SetUnpremultipliedColorRGB(a,b,d)}}_SaveToJson(){}_LoadFromJson(a){}}C3$jscomp$95.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=ColorInterpolationAdapter;"use strict";const C3$jscomp$96=self.C3,NS$jscomp$1=C3$jscomp$96.PropertyTrackState;
class NoInterpolationAdapter extends C3$jscomp$96.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a)}SetResetState(){}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return C3$jscomp$96.IsNullOrUndefined(this._saveState)?!1:this._saveState!==this.GetCurrentState()}MayNeedBeforeAndAfterInterpolate(){return!1}ChangeProperty(a,b,
d,c,e){d=this._propertyTrack;const h=d.GetTrack();c=d.GetSourceAdapterId();e=d.GetTimeline();var k=h.GetInstance();const m=d.GetSourceAdapter();(k=e.GetSimilarPropertyTracks(k,m,this._property))&amp;&amp;1&lt;k.length&amp;&amp;(k=this._GetPropertyKeyframeStubs(k),a+=h.GetStartOffset(),a=this._GetLastPropertyKeyframeStub(e,a,k))&amp;&amp;(b=a.value);switch(d.GetPropertyKeyframeType()){case "numeric":if(!NS$jscomp$1.NumericTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,c))return;break;case "angle":if(!NS$jscomp$1.AngleTypeAdapter.WillChange(this._GetIndex(),
this._GetTarget(),b,c))return;break;case "boolean":if(!NS$jscomp$1.BooleanTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,c))return;break;case "color":if(!NS$jscomp$1.ColorTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,c))return;break;case "text":if(!NS$jscomp$1.TextTypeAdapter.WillChange(this._GetIndex(),this._GetTarget(),b,c))return}this._Setter(b)}_Getter(){const a=this._propertyTrack.GetSourceAdapterId(),b=this._GetTarget(),d=this._GetIndex();switch(a){case "behavior":return b.GetPropertyValueByIndex(d);
case "effect":return b[d];case "instance-variable":return b.GetInstanceVariableValue(d);case "plugin":return b.GetPropertyValueByIndex(d)}}_Setter(a){const b=this._propertyTrack.GetSourceAdapterId(),d=this._GetTarget(),c=this._GetIndex();switch(b){case "behavior":d.SetPropertyValueByIndex(c,a);break;case "effect":d[c]=a;break;case "instance-variable":d.SetInstanceVariableValue(c,a);break;case "plugin":d.SetPropertyValueByIndex(c,a)}}}
C3$jscomp$96.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=NoInterpolationAdapter;"use strict";const C3$jscomp$97=self.C3,INSTANCE_FUNC_MAP=new Map,add$jscomp$1=(a,b,d,c,e,h=!1,k=null,m=null)=&gt;{INSTANCE_FUNC_MAP.set(a,{setter:b,absolute_setter:d,getter:c,round:e,fRound:h,init:k,reset:m})};add$jscomp$1("offsetX",(a,b,d,c)=&gt;{"relative"===c._propertyTrack.GetResultMode()?a.OffsetX(b,d.GetTimeline().GetTransformWithSceneGraph()):a.OffsetX(b)},(a,b)=&gt;a.SetX(b),a=&gt;a.GetX(),!0);
add$jscomp$1("offsetY",(a,b,d,c)=&gt;{"relative"===c._propertyTrack.GetResultMode()?a.OffsetY(b,d.GetTimeline().GetTransformWithSceneGraph()):a.OffsetY(b)},(a,b)=&gt;a.SetY(b),a=&gt;a.GetY(),!0);
add$jscomp$1("offsetWidth",(a,b,d,c,e)=&gt;{if(0!==b)if("relative"===c._propertyTrack.GetResultMode()&amp;&amp;a.HasParent()&amp;&amp;a.GetTransformWithParentWidth()){if(isNaN(c._absoluteToFactor)){const p=[];for(var h=a.GetParent();h;)p.push(h),h=h.GetParent();p.reverse();h=(x,A)=&gt;{if(A=A.GetTimeline().GetTrackFromInstance(x.GetInstance()))return A.GetOriginalWidth();A=x.GetInstance().GetSdkInstance();return A.IsOriginalSizeKnown()?A.GetOriginalWidth():x._GetSceneGraphInfo()._GetStartWidth()};const q=(x,A,C)=&gt;{x=A.GetTimeline().GetTrackFromInstance(x.GetInstance());
if(!x)return 0;C=x.GetPropertyTrack(C);if(!C)return 0;C=C.GetPropertyTrackDataItem().GetPropertyKeyframeData();return C?(C=C.GetLastPropertyKeyframeDataItem())?C.GetValue():0:0};let v=p[0];var k=v._GetSceneGraphInfo()._GetStartWidth(),m=v._GetSceneGraphInfo().GetStartScaleX();k*=m;k+=q(v,d,"offsetWidth");k+=h(v,d)*q(v,d,"offsetScaleX");for(m=1;m&lt;p.length;m++)v=p[m],k*=v._GetSceneGraphInfo().GetStartScaleX(),k+=q(v,d,"offsetWidth"),k+=h(v,d)*q(v,d,"offsetScaleX");c._absoluteToFactor=0===k?Number.EPSILON:
k}e||a.OffsetWidth(b/c._absoluteToFactor,!0)}else a.OffsetWidth(b)},(a,b)=&gt;a.SetWidth(b),a=&gt;a.GetWidth(),!0);
add$jscomp$1("offsetHeight",(a,b,d,c,e)=&gt;{if(0!==b)if("relative"===c._propertyTrack.GetResultMode()&amp;&amp;a.HasParent()&amp;&amp;a.GetTransformWithParentHeight()){if(isNaN(c._absoluteToFactor)){const p=[];for(var h=a.GetParent();h;)p.push(h),h=h.GetParent();p.reverse();h=(x,A)=&gt;{if(A=A.GetTimeline().GetTrackFromInstance(x.GetInstance()))return A.GetOriginalHeight();A=x.GetInstance().GetSdkInstance();return A.IsOriginalSizeKnown()?A.GetOriginalHeight():x._GetSceneGraphInfo()._GetStartHeight()};const q=(x,A,C)=&gt;
{x=A.GetTimeline().GetTrackFromInstance(x.GetInstance());if(!x)return 0;C=x.GetPropertyTrack(C);if(!C)return 0;C=C.GetPropertyTrackDataItem().GetPropertyKeyframeData();return C?(C=C.GetLastPropertyKeyframeDataItem())?C.GetValue():0:0};let v=p[0];var k=v._GetSceneGraphInfo()._GetStartHeight(),m=v._GetSceneGraphInfo().GetStartScaleY();k*=m;k+=q(v,d,"offsetHeight");k+=h(v,d)*q(v,d,"offsetScaleY");for(m=1;m&lt;p.length;m++)v=p[m],k*=v._GetSceneGraphInfo().GetStartScaleY(),k+=q(v,d),k+=h(v,d)*q(v,d,"offsetScaleY");
c._absoluteToFactor=0===k?Number.EPSILON:k}e||a.OffsetHeight(b/c._absoluteToFactor,!0)}else a.OffsetHeight(b)},(a,b)=&gt;a.SetHeight(b),a=&gt;a.GetHeight(),!0);add$jscomp$1("offsetAngle",(a,b)=&gt;a.OffsetAngle(b),(a,b)=&gt;a.SetAngle(b),a=&gt;a.GetAngle(),!1);
add$jscomp$1("offsetOpacity",(a,b,d,c)=&gt;{d=a.GetOpacity()+b;0===c._clampAccumulator?(1&lt;d?c._clampAccumulator+=d-1:0&gt;d&amp;&amp;(c._clampAccumulator+=d),a.OffsetOpacity(b)):(a=a.GetOpacity()+b,0&lt;b&amp;&amp;0&lt;c._clampAccumulator?1&lt;a&amp;&amp;(c._clampAccumulator+=a-1):0&lt;b&amp;&amp;0&gt;c._clampAccumulator?(c._clampAccumulator+=b,0&lt;c._clampAccumulator&amp;&amp;(c._clampAccumulator=0)):0&gt;b&amp;&amp;0&lt;c._clampAccumulator?(c._clampAccumulator+=b,0&gt;c._clampAccumulator&amp;&amp;(c._clampAccumulator=0)):0&gt;b&amp;&amp;0&gt;c._clampAccumulator&amp;&amp;0&gt;a&amp;&amp;(c._clampAccumulator+=a))},
(a,b)=&gt;{a.SetOpacity(b)},a=&gt;a.GetOpacity(),!1,!0,a=&gt;{a._clampAccumulator=0;switch(a._propertyTrack.GetResultMode()){case "relative":a._propertyTrack.GetPropertyTrackData();const e=a._propertyTrack.GetPropertyTrackDataItem().GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();var b=a.GetWorldInfo().GetOpacity(),d=b;for(var c of e)d=c.GetTime(),d=a._propertyTrack.GetInterpolatedValue(d),d=b+d,d=C3$jscomp$97.clamp(d,0,1);a._totalForewardOpacityDelta=b-d;a._totalForewardOpacityDelta=Math.round(100*
(a._totalForewardOpacityDelta+Number.EPSILON))/100;d=b;for(b=e.length-1;0&lt;=b;b--)c=e[b].GetTime(),c=a._propertyTrack.GetInterpolatedValue(c),d-=c,d=C3$jscomp$97.clamp(d,0,1);a._totalBackwardOpacityDelta=d;a._totalBackwardOpacityDelta=Math.round(100*(a._totalBackwardOpacityDelta+Number.EPSILON))/100}},a=&gt;{switch(a._propertyTrack.GetResultMode()){case "relative":a._clampAccumulator=0;const b=a.GetWorldInfo();let d=b.GetOpacity();d=Math.round(100*(d+Number.EPSILON))/100;a._propertyTrack.GetTimeline().IsForwardPlayBack()?
(b.SetOpacity(d+a._totalForewardOpacityDelta),a._lastValue=0):(b.SetOpacity(d-a._totalBackwardOpacityDelta),a._lastValue=a.GetSourceAdapter().GetValueAtTime())}});add$jscomp$1("offsetOriginX",(a,b)=&gt;a.OffsetOriginX(b),(a,b)=&gt;a.SetOriginX(b),a=&gt;a.GetOriginX(),!1);add$jscomp$1("offsetOriginY",(a,b)=&gt;a.OffsetOriginY(b),(a,b)=&gt;a.SetOriginY(b),a=&gt;a.GetOriginY(),!1);add$jscomp$1("offsetZElevation",(a,b)=&gt;a.OffsetZElevation(b),(a,b)=&gt;a.SetZElevation(b),a=&gt;a.GetZElevation(),!0);
add$jscomp$1("offsetScaleX",(a,b,d,c)=&gt;{if(0!==b){var e=0&gt;a.GetWidth()?-1:1;"relative"===c._propertyTrack.GetResultMode()&amp;&amp;a.HasParent()&amp;&amp;a.GetTransformWithParentWidth()?(b*=d.GetOriginalWidth()*e,isNaN(c._absoluteToFactor)&amp;&amp;INSTANCE_FUNC_MAP.get("offsetWidth").setter(a,1,d,c,!0),a.OffsetWidth(b/c._absoluteToFactor,!0)):a.OffsetWidth(d.GetOriginalWidth()*e*b)}},(a,b,d)=&gt;{a.SetWidth(d.GetOriginalWidth()*b)},(a,b)=&gt;{const d=0&gt;a.GetWidth()?-1:1;if(a.GetTransformWithParentWidth()){var c=a.GetParent(),
e=b.GetTimeline().GetTrackFromInstance(c.GetInstance());e?c=c.GetWidth()/e.GetOriginalWidth():(e=c.GetInstance().GetSdkInstance(),c=e.IsOriginalSizeKnown()?c.GetWidth()/e.GetOriginalWidth():1);return a.GetWidth()*d/(b.GetOriginalWidth()*c)}return a.GetWidth()*d/b.GetOriginalWidth()},!1);
add$jscomp$1("offsetScaleY",(a,b,d,c)=&gt;{if(0!==b){var e=0&gt;a.GetHeight()?-1:1;"relative"===c._propertyTrack.GetResultMode()&amp;&amp;a.HasParent()&amp;&amp;a.GetTransformWithParentHeight()?(b*=d.GetOriginalHeight()*e,isNaN(c._absoluteToFactor)&amp;&amp;INSTANCE_FUNC_MAP.get("offsetHeight").setter(a,1,d,c,!0),a.OffsetHeight(b/c._absoluteToFactor,!0)):a.OffsetHeight(d.GetOriginalHeight()*e*b)}},(a,b,d)=&gt;{a.SetHeight(d.GetOriginalHeight()*b)},(a,b)=&gt;{const d=0&gt;a.GetHeight()?-1:1;if(a.GetTransformWithParentHeight()){var c=a.GetParent(),
e=b.GetTimeline().GetTrackFromInstance(c.GetInstance());e?c=c.GetHeight()/e.GetOriginalHeight():(e=c.GetInstance().GetSdkInstance(),c=e.IsOriginalSizeKnown()?c.GetHeight()/e.GetOriginalHeight():1);return a.GetHeight()*d/(b.GetOriginalHeight()*c)}return a.GetHeight()*d/b.GetOriginalHeight()},!1);
class NumericInterpolationAdapter extends C3$jscomp$97.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a);this._totalBackwardOpacityDelta=this._totalForewardOpacityDelta=this._clampAccumulator=this._lastValue=0;this._absoluteToFactor=NaN;this._source_adapter_absolute_setter=this._source_adapter_setter=this._source_adapter_getter=this._init_action=this._reset_action=this._instance_absolute_setter=this._instance_setter=this._instance_getter=null;this._fRound=this._round=!1;C3$jscomp$97.IsInstanceOf(this._propertyTrack.GetTimeline(),
C3$jscomp$97.TweenState)?this._typeAdapter=new C3$jscomp$97.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween(this):this._typeAdapter=new C3$jscomp$97.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline(this);const b=this._propertyTrack.GetPropertyName();switch(this._propertyTrack.GetSourceAdapterId()){case "world-instance":a=INSTANCE_FUNC_MAP.get(b);this._instance_getter=a.getter;this._instance_setter=a.setter;this._instance_absolute_setter=
a.absolute_setter;this._round=a.round;this._fRound=a.fRound;this._init_action=a.init;this._reset_action=a.reset;break;case "audio":this._source_adapter_getter=a.Getter,this._source_adapter_setter=a.Setter,this._source_adapter_absolute_setter=a.AbsoluteSetter,this._round=!!a.DoesRounding(),this._fRound=!1}}Release(){this._instance_absolute_setter=this._instance_setter=this._instance_getter=this._typeAdapter=null;this._absoluteToFactor=NaN;super.Release()}MayNeedBeforeAndAfterInterpolate(){return this._typeAdapter.MayNeedBeforeAndAfterInterpolate()}GetLastValue(){return this._lastValue}SetLastValue(a){this._lastValue=
a}SetResetState(){this._reset_action&amp;&amp;this._reset_action(this)}SetInitialState(){const a=this._typeAdapter.SetInitialState();"number"===typeof a&amp;&amp;(this._lastValue=a);this._init_action&amp;&amp;this._init_action(this)}SetResumeState(){const a=this._typeAdapter.SetResumeState();"number"===typeof a&amp;&amp;(this._lastValue=a)}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return C3$jscomp$97.IsNullOrUndefined(this._saveState)?
!1:this._saveState!==this.GetCurrentState()}BeforeChangeProperty(){this._typeAdapter.BeforeChangeProperty()}ChangeProperty(a,b,d,c,e,h,k){return this._typeAdapter.ChangeProperty(a,b,d,c,e,h,k)}AfterChangeProperty(){this._typeAdapter.AfterChangeProperty()}_Getter(){const a=this._GetTarget(),b=this._GetIndex(),d=this.GetWorldInfo(),c=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":return a.GetPropertyValueByIndex(b);case "effect":return a[b];case "instance-variable":return a.GetInstanceVariableValue(b);
case "plugin":return a.GetPropertyValueByIndex(b);case "world-instance":return this._instance_getter(d,c);case "audio":return this._source_adapter_getter.call(this.GetSourceAdapter(),d,c)}}_Setter(a,b,d){b=this._GetTarget();d=this._GetIndex();const c=this.GetWorldInfo(),e=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":b.OffsetPropertyValueByIndex(d,a);break;case "effect":b[d]+=a;break;case "instance-variable":b.SetInstanceVariableOffset(d,a);break;
case "plugin":b.OffsetPropertyValueByIndex(d,a);break;case "world-instance":this._instance_setter(c,a,e,this);break;case "audio":this._source_adapter_setter.call(this.GetSourceAdapter(),c,a,e,this)}}_SetterAbsolute(a,b,d){b=this._GetTarget();d=this._GetIndex();const c=this.GetWorldInfo(),e=this._propertyTrack.GetTrack();switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":b.SetPropertyValueByIndex(d,a);break;case "effect":b[d]=a;break;case "instance-variable":b.SetInstanceVariableValue(d,
a);break;case "plugin":b.SetPropertyValueByIndex(d,a);break;case "world-instance":this._instance_absolute_setter(c,a,e);break;case "audio":this._source_adapter_absolute_setter.call(this.GetSourceAdapter(),c,a,e)}}_MaybeEnsureValue(a,b,d,c,e,h){this._typeAdapter._MaybeEnsureValue(a,b,d,c,e,h)}_AddDelta(a,b,d){var c=(a.toString().split(".")[1]||"").length;a=this._Getter();c=0===c?this._round?Math.round(a):this._fRound?Math.round(100*(a+Number.EPSILON))/100:a:this._round?Number(C3$jscomp$97.toFixed(a,
c)):a;this._Setter(c-a,b,d)}_SaveToJson(){return Object.assign(super._SaveToJson(),{v:this._lastValue,a:this._clampAccumulator,fod:this._totalForewardOpacityDelta,bod:this._totalBackwardOpacityDelta})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._lastValue=a.v,this._clampAccumulator=a.a,this._totalForewardOpacityDelta=C3$jscomp$97.IsFiniteNumber(a.fod)?a.fod:0,this._totalBackwardOpacityDelta=C3$jscomp$97.IsFiniteNumber(a.bod)?a.bod:0)}}
C3$jscomp$97.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=NumericInterpolationAdapter;"use strict";
class AbsoluteValueObject{constructor(a){this._used=!1;this._value=0;this._propertyTracks=a;for(let b=0,d=this._propertyTracks.length;b&lt;d;b++)this._propertyTracks[b].SetAbsoluteValueObject(this)}GetPropertyTracks(){return this._propertyTracks}SetUsed(){this._used=!0}GetUsed(){return this._used}SetValue(a){this._value=a}GetValue(){return this._value}Reset(){this._used=!1;this._value=0}}
class NumericInterpolationAdapterForTimeline{constructor(a){this._numericInterpolationAdapter=a}Release(){this._numericInterpolationAdapter=null}SetInitialState(){const a=this._numericInterpolationAdapter;this._numericInterpolationAdapter.GetPropertyTrack();return a._PickResultMode(()=&gt;a._PickTimelinePlaybackMode(()=&gt;0,()=&gt;a.GetSourceAdapter().GetValueAtTime()),()=&gt;{})}SetResumeState(){}MayNeedBeforeAndAfterInterpolate(){switch(this._numericInterpolationAdapter.GetPropertyTrack().GetResultMode()){case "relative":return!1;
case "absolute":return!0}}BeforeChangeProperty(){var a=this._numericInterpolationAdapter.GetPropertyTrack(),b=a.GetPropertyName();switch(a.GetResultMode()){case "absolute":if(a.HasAbsoluteValueObject())a.GetAbsoluteValueObject().Reset();else{const d=a.GetTimeline(),c=a.GetInstance();a=a.GetSourceAdapter();(b=d.GetSimilarPropertyTracks(c,a,b))&amp;&amp;1&lt;b.length&amp;&amp;new AbsoluteValueObject(b)}}}ChangeProperty(a,b,d,c,e,h){var k=this._numericInterpolationAdapter,m=this._numericInterpolationAdapter.GetPropertyTrack();
switch(m.GetResultMode()){case "relative":m=k.GetLastValue();k._Setter(b-m,d,c);h&amp;&amp;this._MaybeEnsureValue(a,d,c,e,m,b);k.SetLastValue(b);break;case "absolute":if(c=m.GetTimeline(),d=m.GetTrack(),m.GetInstance(),m.GetSourceAdapter(),m.HasAbsoluteValueObject()){if(a=m.GetAbsoluteValueObject(),e=a.GetPropertyTracks(),e=k._GetPropertyKeyframeStubs(e,!0),k=k._GetLastPropertyKeyframeStub(c,c.GetTime(),e))d=d.GetStartOffset(),k=k.time-d,0===k?(a.SetUsed(),a.SetValue(a.GetValue()+b)):0&gt;k||(m=m.GetInterpolatedValue(k),
a.SetUsed(),a.SetValue(a.GetValue()+(b-m)))}else k._SetterAbsolute(b)}}AfterChangeProperty(){const a=this._numericInterpolationAdapter;var b=this._numericInterpolationAdapter.GetPropertyTrack();switch(b.GetResultMode()){case "absolute":b.HasAbsoluteValueObject()&amp;&amp;(b=b.GetAbsoluteValueObject(),b.GetUsed()&amp;&amp;a._SetterAbsolute(b.GetValue()))}}_MaybeEnsureValue(a,b,d,c,e,h){const k=this._numericInterpolationAdapter;c||(b&amp;&amp;a===b.GetTime()?k._AddDelta(b.GetValueWithResultMode(),b,d):d&amp;&amp;a===d.GetTime()?k._AddDelta(d.GetValueWithResultMode(),
b,d):0===h-e&amp;&amp;k._AddDelta(b.GetValueWithResultMode(),b,d))}}self.C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline=NumericInterpolationAdapterForTimeline;"use strict";
class NumericInterpolationAdapterForTween{constructor(a){this._numericInterpolationAdapter=a}Release(){this._numericInterpolationAdapter=null}SetInitialState(){const a=this._numericInterpolationAdapter;a.SetFirstAbsoluteUpdate(!0);return this._GetAbsoluteInitialValue(a._FirstKeyframeGetter())}SetResumeState(){const a=this._numericInterpolationAdapter;if(a._FirstKeyframeGetter()!==a._CurrentKeyframeGetter())return a.SetFirstAbsoluteUpdate(!0),this._GetAbsoluteInitialValue(a._CurrentKeyframeGetter())}MayNeedBeforeAndAfterInterpolate(){return!1}BeforeChangeProperty(){}ChangeProperty(a,
b,d,c,e,h){const k=this._numericInterpolationAdapter,m=k.GetLastValue();switch(k.GetPropertyTrack().GetResultMode()){case "relative":k._Setter(b-m,d,c);h&amp;&amp;this._MaybeEnsureValue(a,d,c,e,m,b);break;case "absolute":k.GetFirstAbsoluteUpdate()?(k.SetFirstAbsoluteUpdate(!1),k._Setter(m,d,c)):(k._Setter(b-m,d,c),h&amp;&amp;this._MaybeEnsureValue(a,d,c,e,m,b))}k.SetLastValue(b)}AfterChangeProperty(){}_GetAbsoluteInitialValue(a){return a-this._numericInterpolationAdapter.GetCurrentState()}_MaybeEnsureValue(a,b,d,
c,e,h){const k=this._numericInterpolationAdapter;c?b&amp;&amp;a===b.GetTime()?k._AddDelta(b.GetValueWithResultMode(),b,d):d&amp;&amp;a===d.GetTime()?k._AddDelta(d.GetValueWithResultMode(),b,d):d||k._AddDelta(b.GetValueWithResultMode(),b,d):b&amp;&amp;a===b.GetTime()?k._AddDelta(b.GetValueWithResultMode(),b,d):d&amp;&amp;a===d.GetTime()?k._AddDelta(d.GetValueWithResultMode(),b,d):0===h-e&amp;&amp;k._AddDelta(b.GetValueWithResultMode(),b,d)}}self.C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween=NumericInterpolationAdapterForTween;
"use strict";const C3$jscomp$100=self.C3,Ease$jscomp$1=self.Ease;
C3$jscomp$100.PropertyTrackState.NumericTypeAdapter=class{constructor(){}static WillChange(a,b,d,c){let e;switch(c){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===d?!1:!0}static Interpolate(a,b,d,c){if(!d)return b=c.GetPropertyTrackDataItem(),b=c.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(b),b.GetValueWithResultMode();var e=c.GetInterpolationMode();
"default"===e&amp;&amp;(e="continuous");"combo"===c.GetPropertyType()&amp;&amp;(e="discrete");if("discrete"===e)return b.GetValueWithResultMode();if("continuous"===e||"step"===e){"step"===e&amp;&amp;(e=c.GetTimeline().GetStep(),0!==e&amp;&amp;(e=1/e,a=Math.floor(a*e)/e));e=b.GetValueWithResultMode();const h=d.GetValueWithResultMode(),k=b.GetAddOn("cubic-bezier"),m=d.GetAddOn("cubic-bezier"),p=k&amp;&amp;k.GetStartEnable()&amp;&amp;m&amp;&amp;m.GetEndEnable();if(!p&amp;&amp;e===h)return e;const q=b.GetTime();d=d.GetTime();a=C3$jscomp$100.normalize(a,q,d);b=b.GetEase();
p?(d-=q,b=Ease$jscomp$1.GetRuntimeEase(b)(d*a,0,1,d),b=Ease$jscomp$1.GetRuntimeEase("cubicbezier")(b,e,e+k.GetStartAnchor(),h+m.GetEndAnchor(),h)):b=Ease$jscomp$1.GetRuntimeEase(b)((d-q)*a,e,h-e,d-q);return"integer"===c.GetPropertyType()?Math.floor(b):b}}};"use strict";const C3$jscomp$101=self.C3;
C3$jscomp$101.PropertyTrackState.AngleTypeAdapter=class{constructor(){}static WillChange(a,b,d,c){let e;switch(c){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===d?!1:!0}static Interpolate(a,b,d,c){if(!d)return b=c.GetPropertyTrackDataItem(),b=c.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(b),b.GetValueWithResultMode();var e=c.GetInterpolationMode();
"default"===e&amp;&amp;(e="continuous");"combo"===c.GetPropertyType()&amp;&amp;(e="discrete");if("discrete"===e)return b.GetValueWithResultMode();if("continuous"===e||"step"===e){"step"===e&amp;&amp;(c=c.GetTimeline().GetStep(),0!==c&amp;&amp;(c=1/c,a=Math.floor(a*c)/c));const h=b.GetTime(),k=d.GetTime();c=b.GetValueWithResultMode();d=d.GetValueWithResultMode();if(e=b.GetAddOn("angle")){const m=e.GetRevolutions();if(c===d&amp;&amp;0===m)return c;a=C3$jscomp$101.normalize(a,h,k);b=self.Ease.GetRuntimeEase(b.GetEase())(a,0,1,1);switch(e.GetDirection()){case "closest":return C3$jscomp$101.angleLerp(c,
d,b,m);case "clockwise":return C3$jscomp$101.angleLerpClockwise(c,d,b,m);case "anti-clockwise":return C3$jscomp$101.angleLerpAntiClockwise(c,d,b,m)}}else{if(c===d)return c;a=C3$jscomp$101.normalize(a,h,k);b=self.Ease.GetRuntimeEase(b.GetEase());return C3$jscomp$101.angleLerp(c,d,b(a,0,1,1))}}}};"use strict";
self.C3.PropertyTrackState.BooleanTypeAdapter=class{constructor(){}static WillChange(a,b,d,c){let e;switch(c){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return!!e===!!d?!1:!0}static Interpolate(a,b,d,c){return d?b.GetValueWithResultMode()?1:0:(a=c.GetPropertyTrackDataItem(),a=c.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a),a.GetValueWithResultMode()?
1:0)}};"use strict";const C3$jscomp$103=self.C3,TEMP_COLOR_ARRAY=[0,0,0],TEMP_COLOR_ARRAY_2=[0,0,0],TEMP_COLOR_ARRAY_3=[0,0,0];
C3$jscomp$103.PropertyTrackState.ColorTypeAdapter=class{constructor(){}static WillChange(a,b,d,c){let e;switch(c){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}Array.isArray(d)?(TEMP_COLOR_ARRAY[0]=d[0],TEMP_COLOR_ARRAY[1]=d[1],TEMP_COLOR_ARRAY[2]=d[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(d),TEMP_COLOR_ARRAY[0]=Math.floor(255*TEMP_COLOR_ARRAY_3.getR()),
TEMP_COLOR_ARRAY[1]=Math.floor(255*TEMP_COLOR_ARRAY_3.getG()),TEMP_COLOR_ARRAY[2]=Math.floor(255*TEMP_COLOR_ARRAY_3.getB()));Array.isArray(e)?(TEMP_COLOR_ARRAY_2[0]=e[0],TEMP_COLOR_ARRAY_2[1]=e[1],TEMP_COLOR_ARRAY_2[2]=e[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(e),TEMP_COLOR_ARRAY_2[0]=Math.floor(255*TEMP_COLOR_ARRAY_3.getR()),TEMP_COLOR_ARRAY_2[1]=Math.floor(255*TEMP_COLOR_ARRAY_3.getG()),TEMP_COLOR_ARRAY_2[2]=Math.floor(255*TEMP_COLOR_ARRAY_3.getB()));return TEMP_COLOR_ARRAY[0]!==TEMP_COLOR_ARRAY_2[0]||
TEMP_COLOR_ARRAY[1]!==TEMP_COLOR_ARRAY_2[1]||TEMP_COLOR_ARRAY[2]!==TEMP_COLOR_ARRAY_2[2]?!0:!1}static Interpolate(a,b,d,c){if(!d){var e=c.GetPropertyTrackDataItem();e=c.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(e);c=e.GetValueWithResultMode();TEMP_COLOR_ARRAY[0]=c[0];TEMP_COLOR_ARRAY[1]=c[1];TEMP_COLOR_ARRAY[2]=c[2];return TEMP_COLOR_ARRAY}e=c.GetInterpolationMode();"default"===e&amp;&amp;(e="continuous");if("discrete"===e)return c=b.GetValueWithResultMode(),TEMP_COLOR_ARRAY[0]=c[0],TEMP_COLOR_ARRAY[1]=
c[1],TEMP_COLOR_ARRAY[2]=c[2],TEMP_COLOR_ARRAY;if("continuous"===e||"step"===e){"step"===e&amp;&amp;(c=c.GetTimeline().GetStep(),0!==c&amp;&amp;(c=1/c,a=Math.floor(a*c)/c));c=b.GetTime();e=d.GetTime();var h=b.GetValueWithResultMode(),k=d.GetValueWithResultMode();a=C3$jscomp$103.normalize(a,c,e);var m=b.GetEase();b=h[0];d=h[1];h=h[2];const p=k[0],q=k[1];k=k[2];m=self.Ease.GetRuntimeEase(m);c=e-c;e=c*a;TEMP_COLOR_ARRAY[0]=b===p?b:m(e,b,p-b,c);TEMP_COLOR_ARRAY[1]=d===q?d:m(e,d,q-d,c);TEMP_COLOR_ARRAY[2]=h===k?h:m(e,
h,k-h,c);return TEMP_COLOR_ARRAY}}};"use strict";
self.C3.PropertyTrackState.TextTypeAdapter=class{constructor(){}static WillChange(a,b,d,c){let e;switch(c){case "behavior":e=b.GetPropertyValueByIndex(a);break;case "effect":e=b[a];break;case "instance-variable":e=b.GetInstanceVariableValue(a);break;case "plugin":e=b.GetPropertyValueByIndex(a)}return e===d?!1:!0}static Interpolate(a,b,d,c){return d?b.GetValueWithResultMode():(a=c.GetPropertyTrackDataItem(),a=c.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a),a.GetValueWithResultMode())}};
"use strict";const C3$jscomp$105=self.C3;
C3$jscomp$105.TimelineDataManager=class{constructor(){this._timelineDataItems=new Map}Release(){for(const a of this._timelineDataItems.values())a.Release();this._timelineDataItems.clear();this._timelineDataItems=null}Add(a){a=new C3$jscomp$105.TimelineDataItem(a);const b=a.GetName();this._timelineDataItems.set(b,a)}Get(a){return this._timelineDataItems.get(a)}GetNameId(){return 0}static _CreateDataItems(a,b,d,c){if(b)for(const e of b)C3$jscomp$105.TimelineDataManager._CreateDataItem("create",e,a,
d,c)}static _LoadDataItemsFromJson(a,b,d,c){a.length?b.forEach((e,h)=&gt;{a[h]._LoadFromJson(e)}):b.forEach(e=&gt;{C3$jscomp$105.TimelineDataManager._CreateDataItem("load",e,a,d,c)})}static _CreateDataItem(a,b,d,c,e){let h;if("function"===typeof c)switch(a){case "load":h=new c(null,e);break;case "create":h=new c(b,e)}else if("object"===typeof c)switch(c=c.map.get(b[c.prop]),a){case "load":h=new c(null,e);break;case "create":h=new c(b,e)}switch(a){case "load":h._LoadFromJson(b);d.push(h);break;case "create":if("function"===
typeof h.GetEnable&amp;&amp;!h.GetEnable())return h.Release();d.push(h)}}};"use strict";const C3$jscomp$106=self.C3;
C3$jscomp$106.TimelineDataItem=class{constructor(a){this._name="";this._totalTime=NaN;this._step=0;this._resultMode=this._interpolationMode="default";this._pingPong=this._loop=!1;this._repeatCount=1;this._trackData=null;this._startOnLayout="";this._transformWithSceneGraph=!1;a&amp;&amp;(this._name=a[0],this._totalTime=a[1],this._step=a[2],this._interpolationMode=a[3],this._resultMode=a[4],this._loop=!!a[6],this._pingPong=!!a[7],this._repeatCount=a[8],this._startOnLayout=a[9],this._transformWithSceneGraph=
!!a[10],this._trackData=new C3$jscomp$106.TrackData(a[5],this))}Release(){this._trackData.Release();this._trackData=null}GetTrackData(){this._trackData||(this._trackData=new C3$jscomp$106.TrackData(null,this));return this._trackData}GetName(){return this._name}SetName(a){this._name=a}GetTotalTime(){return this._totalTime}SetTotalTime(a){this._totalTime=a}GetStep(){return this._step}SetStep(a){this._step=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode=
a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode=a}GetLoop(){return this._loop}SetLoop(a){this._loop=a}GetPingPong(){return this._pingPong}SetPingPong(a){this._pingPong=a}GetRepeatCount(){return this._repeatCount}GetStartOnLayout(){return this._startOnLayout}GetTransformWithSceneGraph(){return this._transformWithSceneGraph}_SaveToJson(){return{trackDataJson:this._trackData._SaveToJson(),name:this._name,totalTime:this._totalTime,step:this._step,interpolationMode:this._interpolationMode,
resultMode:this._resultMode,loop:this._loop,pingPong:this._pingPong,repeatCount:this._repeatCount,startOnLayout:this._startOnLayout,transformWithSceneGraph:!!this._transformWithSceneGraph}}_LoadFromJson(a){a&amp;&amp;(this.GetTrackData()._LoadFromJson(a.trackDataJson),this._name=a.name,this._totalTime=a.totalTime,this._step=a.step,this._interpolationMode=a.interpolationMode,this._resultMode=a.resultMode,this._loop=a.loop,this._pingPong=a.pingPong,this._repeatCount=a.repeatCount,this._startOnLayout=a.startOnLayout,
this._transformWithSceneGraph=!!a.transformWithSceneGraph)}};"use strict";const C3$jscomp$107=self.C3;
class TrackDataItem{constructor(a,b){this._trackData=b;this._additionalInstanceData=this._instanceData=null;this._objectClassIndex=this._instanceUid=NaN;this._resultMode=this._interpolationMode="default";this._enabled=!1;this._propertyTrackData=this._keyframeData=null;this._id="";this._nestedData=null;this._startOffset=0;this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime();this._type=0;this._name="";a&amp;&amp;(a[0]&amp;&amp;(this._instanceData=a[0],this._instanceUid=a[0][2],this._objectClassIndex=
a[0][1]),this._interpolationMode=a[1],this._resultMode=a[2],this._enabled=!!a[3],a[6]&amp;&amp;(this._id=a[6]),a[7]&amp;&amp;(this._nestedData=a[7],this._startOffset=a[7][0],this._localTotalTime=a[7][1]),a[8]&amp;&amp;(this._additionalInstanceData=a[8]),a[8]&amp;&amp;(this._additionalInstanceData=a[8]),a[9]&amp;&amp;(this._type=a[9]),a[10]&amp;&amp;(this._name=a[10]),this._keyframeData=new C3$jscomp$107.KeyframeData(a[4],this),this._propertyTrackData=new C3$jscomp$107.PropertyTrackData(a[5],this))}Release(){this._trackData=this._instanceData=null;
this._keyframeData&amp;&amp;(this._keyframeData.Release(),this._keyframeData=null);this._propertyTrackData&amp;&amp;(this._propertyTrackData.Release(),this._propertyTrackData=null);this._nestedData=null}GetTrackData(){return this._trackData}GetKeyframeData(){this._keyframeData||(this._keyframeData=new C3$jscomp$107.KeyframeData(null,this));return this._keyframeData}GetPropertyTrackData(){this._propertyTrackData||(this._propertyTrackData=new C3$jscomp$107.PropertyTrackData(null,this));return this._propertyTrackData}GetInstanceData(){return this._instanceData}GetObjectClassIndex(){return this._objectClassIndex}SetObjectClassIndex(a){this._objectClassIndex=
a}GetInstanceUID(){return this._instanceUid}SetInstanceUID(a){this._instanceUid=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode=a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode=a}GetEnable(){return this._enabled}SetEnable(a){this._enabled=!!a}GetId(){return this._id}GetStartOffset(){return this._startOffset}GetLocalTotalTime(){return this._localTotalTime}SetLocalTotalTime(a){this._localTotalTime=a}GetOriginalWidth(){return this._additionalInstanceData[0]}SetOriginalWidth(a){this._additionalInstanceData||
(this._additionalInstanceData=[]);this._additionalInstanceData[0]=a}GetOriginalHeight(){this._additionalInstanceData||(this._additionalInstanceData=[]);return this._additionalInstanceData[1]}SetOriginalHeight(a){this._additionalInstanceData||(this._additionalInstanceData=[]);this._additionalInstanceData[1]=a}GetType(){return this._type}GetName(){return this._name}_SaveToJson(){return{keyframeDataJson:this._keyframeData._SaveToJson(),propertyTrackDataJson:this._propertyTrackData._SaveToJson(),instanceData:this._instanceData,
additionalInstanceData:this._additionalInstanceData,instanceUid:this._instanceUid,objectClassIndex:this._objectClassIndex,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,id:this._id,nestedData:this._nestedData,type:this._type,name:this._name}}_LoadFromJson(a){a&amp;&amp;(this._instanceData=a.instanceData,this._instanceUid=a.instanceUid,this._objectClassIndex=a.objectClassIndex,this._interpolationMode=a.interpolationMode,this._resultMode=a.resultMode,this._enabled=
a.enabled,this._id=a.id,this._type=a.type?a.type:0,this._name=a.name?a.name:"",this._localTotalTime=this._trackData.GetTimelineDataItem().GetTotalTime(),a.nestedData&amp;&amp;(this._nestedData=a.nestedData,this._startOffset=this._nestedData[0],this._localTotalTime=this._nestedData[1]),a.additionalInstanceData&amp;&amp;(this._additionalInstanceData=a.additionalInstanceData),this.GetKeyframeData()._LoadFromJson(a.keyframeDataJson),this.GetPropertyTrackData()._LoadFromJson(a.propertyTrackDataJson))}}
C3$jscomp$107.TrackData=class{constructor(a,b){this._timelineDataItem=b;this._trackDataItems=[];C3$jscomp$107.TimelineDataManager._CreateDataItems(this._trackDataItems,a,TrackDataItem,this)}Release(){this._timelineDataItem=null;for(const a of this._trackDataItems)a.Release();C3$jscomp$107.clearArray(this._trackDataItems);this._trackDataItems=null}GetTimelineDataItem(){return this._timelineDataItem}AddEmptyTrackDataItem(){const a=new TrackDataItem(null,this);this._trackDataItems.push(a);return a}GetFirstKeyframeDataItem(a){return a.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(a){return a.GetKeyframeData().GetKeyframeDataItemArray().at(-1)}GetKeyFrameDataItemAtTime(a,
b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()===a)return e}}GetFirstKeyFrameDataItemHigherThan(a,b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()&gt;a)return e}}GetFirstKeyFrameDataItemHigherOrEqualThan(a,b){b=b.GetKeyframeData().GetKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()&gt;=a)return e}}GetFirstKeyFrameDataItemLowerOrEqualThan(a,
b){b=b.GetKeyframeData().GetKeyframeDataItemArray();for(let d=b.length-1;0&lt;=d;d--){const c=b[d];if(c.GetTime()&lt;=a)return c}}*trackDataItems(){for(const a of this._trackDataItems)yield a}_SaveToJson(){return{trackDataItemsJson:this._trackDataItems.map(a=&gt;a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;C3$jscomp$107.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,a.trackDataItemsJson,TrackDataItem,this)}};"use strict";const C3$jscomp$108=self.C3;
class PropertyTrackDataItem{constructor(a,b){this._propertyTrackData=b;this._sourceAdapterId="";this._type=this._property=this._sourceAdapterArguments=null;this._max=this._min=NaN;this._resultMode=this._interpolationMode="default";this._enabled=!1;this._propertyKeyframeData=null;this._canHavePropertyKeyframes=!0;a&amp;&amp;(this._sourceAdapterId=a[0][0],this._sourceAdapterArguments=a[0].slice(1),this._property=a[1],this._type=a[2],this._min=a[3],this._max=a[4],this._interpolationMode=a[5],this._resultMode=
a[6],this._enabled=!!a[7],this._propertyKeyframeData=new C3$jscomp$108.PropertyKeyframeData(a[8],this),this._canHavePropertyKeyframes=a[9])}Release(){this._propertyKeyframeData.Release();this._sourceAdapterArguments=this._propertyTrackData=this._propertyKeyframeData=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){this._propertyKeyframeData||(this._propertyKeyframeData=new C3$jscomp$108.PropertyKeyframeData(null,this));return this._propertyKeyframeData}GetSourceAdapterId(){return this._sourceAdapterId}SetSourceAdapterId(a){this._sourceAdapterId=
a}GetSourceAdapterArguments(){return this._sourceAdapterArguments}SetSourceAdapterArguments(a){this._sourceAdapterArguments=a}GetProperty(){return this._property}SetProperty(a){this._property=a}GetType(){return this._type}SetType(a){this._type=a}GetMin(){return this._min}SetMin(a){this._min=a}GetMax(){return this._max}SetMax(a){this._max=a}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(a){this._interpolationMode=a}GetResultMode(){return this._resultMode}SetResultMode(a){this._resultMode=
a}GetEnable(){return this._enabled}SetEnable(a){this._enabled=!!a}CanHavePropertyKeyframes(){return!!this._canHavePropertyKeyframes}_SaveToJson(){return{propertyKeyframeDataJson:this._propertyKeyframeData._SaveToJson(),sourceAdapterId:this._sourceAdapterId,sourceAdapterArguments:this._sourceAdapterArguments,property:this._property,type:this._type,min:this._min,max:this._max,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,canHavePropertyKeyframes:this._canHavePropertyKeyframes}}_LoadFromJson(a){a&amp;&amp;
(this._sourceAdapterId=a.sourceAdapterId,this._sourceAdapterArguments=a.sourceAdapterArguments,this._property=a.property,this._type=a.type,this._min=a.min,this._max=a.max,this._interpolationMode=a.interpolationMode,this._resultMode=a.resultMode,this._enabled=a.enabled,this._canHavePropertyKeyframes=a.canHavePropertyKeyframes,this.GetPropertyKeyframeData()._LoadFromJson(a.propertyKeyframeDataJson))}}
C3$jscomp$108.PropertyTrackData=class{constructor(a,b){this._trackDataItem=b;this._propertyTrackDataItems=[];C3$jscomp$108.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems,a,PropertyTrackDataItem,this)}Release(){this._trackDataItem=null;for(const a of this._propertyTrackDataItems)a.Release();C3$jscomp$108.clearArray(this._propertyTrackDataItems);this._propertyTrackDataItems=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const a=new PropertyTrackDataItem(null,
this);this._propertyTrackDataItems.push(a);return a}GetFirstPropertyKeyframeDataItem(a){return a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(a){return a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray().at(-1)}GetPropertyKeyFrameDataItemAtTime(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()===a)return e}}GetFirstPropertyKeyFrameDataItemHigherThan(a,
b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()&gt;a)return e}}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();const d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetTime()&gt;=a)return e}}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,b){b=b.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();for(let d=b.length-1;0&lt;=d;d--){const c=
b[d];if(c.GetTime()&lt;=a)return c}}*propertyTrackDataItems(){for(const a of this._propertyTrackDataItems)yield a}_SaveToJson(){return{propertyTrackDataItemsJson:this._propertyTrackDataItems.map(a=&gt;a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;C3$jscomp$108.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,a.propertyTrackDataItemsJson,PropertyTrackDataItem,this)}};"use strict";const C3$jscomp$109=self.C3;
class KeyframeDataItem{constructor(a,b){this._keyframeData=b;this._time=-1;this._ease="noease";this._enable=!1;this._lowerTags=this._tags=null;a&amp;&amp;(this._time=a[0],this._ease=a[1],this._enable=!!a[2],this._tags=(a=a[3])?a.split(" "):[],this._lowerTags=new Set(this._tags.map(d=&gt;d.toLowerCase())),this._next=null)}Release(){this._keyframeData=null;C3$jscomp$109.clearArray(this._tags);this._tags=null;this._lowerTags.clear();this._lowerTags=null}GetKeyframeData(){return this._keyframeData}GetNext(){return this._next}SetNext(a){this._next=
a}GetTime(){return this._time}SetTime(a){this._time=a;this._keyframeData._LinkKeyframeDataItems()}GetEase(){return this._ease}SetEase(a){this._ease=a}GetEnable(){return this._enable}SetEnable(a){this._enable=!!a}GetTags(){return this._tags}SetTags(a){this._tags=a?a.split(" "):[];this._lowerTags=new Set(this._tags.map(b=&gt;b.toLowerCase()))}GetLowerTags(){return this._lowerTags}HasTag(a){return this._lowerTags.has(a.toLowerCase())}_SaveToJson(){return{time:this._time,ease:this._ease,enable:this._enable,
tags:this._tags}}_LoadFromJson(a){a&amp;&amp;(this._time=a.time,this._ease=a.ease,this._enable=a.enable,this._tags=a.tags,this._lowerTags=new Set(this._tags.map(b=&gt;b.toLowerCase())))}}
C3$jscomp$109.KeyframeData=class{constructor(a,b){this._trackDataItem=b;this._keyframeDataItems=[];C3$jscomp$109.TimelineDataManager._CreateDataItems(this._keyframeDataItems,a,KeyframeDataItem,this);this._LinkKeyframeDataItems()}Release(){this._trackDataItem=null;for(const a of this._keyframeDataItems)a.Release();C3$jscomp$109.clearArray(this._keyframeDataItems);this._keyframeDataItems=null}_LinkKeyframeDataItems(){this._keyframeDataItems.sort((a,b)=&gt;a.GetTime()-b.GetTime());for(let a=0;a&lt;this._keyframeDataItems.length;a++)this._keyframeDataItems[a].SetNext(this._keyframeDataItems[a+
1])}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const a=new KeyframeDataItem(null,this);this._keyframeDataItems.push(a);this._LinkKeyframeDataItems();return a}DeleteKeyframeDataItems(a){for(const b of this._keyframeDataItems){if(!a(b))continue;const d=this._keyframeDataItems.indexOf(b);-1!==d&amp;&amp;(b.Release(),this._keyframeDataItems.splice(d,1))}this.SortKeyframeDataItems();
this._LinkKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((a,b)=&gt;a.GetTime()-b.GetTime())}GetKeyframeDataItemIndex(a){return this._keyframeDataItems.indexOf(a)}GetKeyframeDataItemFromIndex(a){return this._keyframeDataItems[a]}*keyframeDataItems(){for(const a of this._keyframeDataItems)yield a}*keyframeDataItemsReverse(){for(let a=this._keyframeDataItems.length-1;0&lt;=a;a--)yield this._keyframeDataItems[a]}_SaveToJson(){return{keyframeDataItemsJson:this._keyframeDataItems.map(a=&gt;
a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;(C3$jscomp$109.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,a.keyframeDataItemsJson,KeyframeDataItem,this),this._LinkKeyframeDataItems())}};"use strict";const C3$jscomp$110=self.C3;
class PropertyKeyframeDataItem{constructor(a,b){this._propertyKeyframeData=b;this._aValue=this._value=null;this._type="";this._time=NaN;this._ease="noease";this._enable=!1;this._addonData=null;this._addonInstance=void 0;a&amp;&amp;(this._value=a[0][0],this._aValue=a[0][1],this._type=a[0][2],this._time=a[1],this._ease=a[2],this._enable=!!a[3],this._addonData=null,a[4]&amp;&amp;(this._addonData=new C3$jscomp$110.AddonData(a[4],this)),this._next=null)}Release(){this._propertyKeyframeData=null;this._addonData&amp;&amp;(this._addonData.Release(),
this._addonData=null)}GetAddonData(){return this._addonData}SetNext(a){this._next=a}GetNext(){return this._next}GetValue(){return this._value}SetValue(a){"color"===this._type&amp;&amp;C3$jscomp$110.IsFiniteNumber(a)?(this._value[0]=C3$jscomp$110.GetRValue(a),this._value[1]=C3$jscomp$110.GetGValue(a),this._value[2]=C3$jscomp$110.GetBValue(a)):this._value=a}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(a){"color"===this._type&amp;&amp;C3$jscomp$110.IsFiniteNumber(a)?(this._aValue[0]=C3$jscomp$110.GetRValue(a),
this._aValue[1]=C3$jscomp$110.GetGValue(a),this._aValue[2]=C3$jscomp$110.GetBValue(a)):this._aValue=a}GetValueWithResultMode(){const a=this._propertyKeyframeData.GetPropertyTrackDataItem().GetResultMode();if("relative"===a)return this.GetValue();if("absolute"===a)return this.GetAbsoluteValue()}GetType(){return this._type}SetType(a){this._type=a}GetTime(){return this._time}SetTime(a){this._time=a;this._propertyKeyframeData._LinkPropertyKeyframeDataItems()}GetEase(){return this._ease}SetEase(a){this._ease=
a}GetEnable(){return this._enable}SetEnable(a){this._enable=!!a}GetAddOn(a){if(this._addonData){if(this._addonInstance||null===this._addonInstance)return this._addonInstance;var b=this._addonData.GetAddDataItemArray();if(!b)return this._addonInstance=null;var d=b.length;for(let c=0;c&lt;d;c++){const e=b[c];if(e.GetId()===a)return this._addonInstance=e}return this._addonInstance=null}}_SaveToJson(){const a=this._addonData;return{addonDataJson:a?a._SaveToJson():a,value:this._value,aValue:this._aValue,
type:this._type,time:this._time,ease:this._ease,enable:this._enable}}_LoadFromJson(a){a&amp;&amp;(a.addonDataJson&amp;&amp;this._addonData._SetFromJson(a.addonDataJson),this._value=a.value,this._aValue=a.aValue,this._type=a.type,this._time=a.time,this._ease=a.ease,this._enable=a.enable)}}
C3$jscomp$110.PropertyKeyframeData=class{constructor(a,b){this._propertyTrackDataItem=b;this._propertyKeyframeDataItems=[];C3$jscomp$110.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,a,PropertyKeyframeDataItem,this);this._LinkPropertyKeyframeDataItems()}Release(){this._propertyTrackDataItem=null;for(const a of this._propertyKeyframeDataItems)a.Release();C3$jscomp$110.clearArray(this._propertyKeyframeDataItems);this._propertyKeyframeDataItems=null}_LinkPropertyKeyframeDataItems(){this._propertyKeyframeDataItems.sort((a,
b)=&gt;a.GetTime()-b.GetTime());for(let a=0;a&lt;this._propertyKeyframeDataItems.length;a++)this._propertyKeyframeDataItems[a].SetNext(this._propertyKeyframeDataItems[a+1])}AddEmptyPropertyKeyframeDataItem(){const a=new PropertyKeyframeDataItem(null,this);this._propertyKeyframeDataItems.push(a);this._LinkPropertyKeyframeDataItems();return a}DeletePropertyKeyframeDataItems(a){for(const b of this._propertyKeyframeDataItems){if(!a(b))continue;const d=this._propertyKeyframeDataItems.indexOf(b);-1!==d&amp;&amp;(b.Release(),
this._propertyKeyframeDataItems.splice(d,1))}this.SortPropertyKeyFrameDataItems();this._LinkPropertyKeyframeDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((a,b)=&gt;a.GetTime()-b.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){return this._propertyKeyframeDataItems.length}GetLastPropertyKeyframeDataItem(){return this._propertyKeyframeDataItems[this._propertyKeyframeDataItems.length-1]}GetPropertyKeyframeDataItemArray(){return this._propertyKeyframeDataItems}*propertyKeyframeDataItems(){for(const a of this._propertyKeyframeDataItems)yield a}*propertyKeyframeDataItemsReverse(){for(let a=
this._propertyKeyframeDataItems.length-1;0&lt;=a;a--)yield this._propertyKeyframeDataItems[a]}_SaveToJson(){return{propertyKeyframeDataItemsJson:this._propertyKeyframeDataItems.map(a=&gt;a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;(C3$jscomp$110.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,a.propertyKeyframeDataItemsJson,PropertyKeyframeDataItem,this),this._LinkPropertyKeyframeDataItems())}};"use strict";const C3$jscomp$111=self.C3;
class AddonDataItem{constructor(a,b){this._addonData=b;this._id=a[0];this._data=a[1]}Release(){this._data=this._addonData=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{id:this._id,data:this._data}}_LoadFromJson(a){a&amp;&amp;(this._id=a.id,this._data=a.data)}}
class AddonDataCubicBezierItem extends AddonDataItem{constructor(a,b){super(a,b);this._startAnchor=this._data[0];this._startEnable=!!this._data[1];this._endAnchor=this._data[2];this._endEnable=!!this._data[3]}Release(){super.Release()}GetStartAnchor(){return this._startAnchor}GetStartEnable(){return this._startEnable}GetEndAnchor(){return this._endAnchor}GetEndEnable(){return this._endEnable}_SaveToJson(){return Object.assign(super._SaveToJson(),{startAnchor:this._startAnchor,startEnable:!!this._startEnable,
endAnchor:this._endAnchor,endEnable:!!this._endEnable})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._startAnchor=a.startAnchor,this._startEnable=!!a.startEnable,this._endAnchor=a.endAnchor,this._endEnable=!!a.endEnable)}}
class AddonDataAngleItem extends AddonDataItem{constructor(a,b){super(a,b);this._direction=this._data[0];this._revolutions=this._data[1]}Release(){super.Release()}GetDirection(){return this._direction}GetRevolutions(){return this._revolutions}_SaveToJson(){return Object.assign(super._SaveToJson(),{direction:this._direction,revolutions:this._revolutions})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._direction=a.direction,this._revolutions=a.revolutions)}}
C3$jscomp$111.AddonData=class{constructor(a,b){this._propertyKeyframeDataItem=b;this._addonDataItems=[];C3$jscomp$111.TimelineDataManager._CreateDataItems(this._addonDataItems,a,{prop:0,map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const a of this._addonDataItems)a.Release();C3$jscomp$111.clearArray(this._addonDataItems);this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}GetAddDataItemArray(){return this._addonDataItems}*addonDataItems(){for(const a of this._addonDataItems)yield a}_SaveToJson(){return{addonDataItemsJson:this._addonDataItems.map(a=&gt;
a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;C3$jscomp$111.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,a.addonDataItemsJson,{prop:"id",map:new Map([["cubic-bezier",AddonDataCubicBezierItem],["angle",AddonDataAngleItem]])},this)}};"use strict";const C3$jscomp$112=self.C3;let createdTweens=0;
C3$jscomp$112.TweenState=class extends C3$jscomp$112.TimelineState{constructor(a,b){super(`tween-${createdTweens++}`,a,b);this._id="";this._destroyInstanceOnComplete=!1;this._initialValueMode="start-value";this._iTweenState=this._track=this._on_started_callbacks=this._on_completed_callbacks=this._instance=null}FireReleaseEvent(a){const b=C3$jscomp$112.New(C3$jscomp$112.Event,"tweenstatereleased");b.tweenState=this;a.dispatchEvent(b)}CreateTrackStates(){for(const a of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(C3$jscomp$112.TweenTrackState.Create(this,
a));this._track=this._tracks[0]}AddTrack(){var a=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();a=C3$jscomp$112.TweenTrackState.Create(this,a);this._tracks.push(a);this._track=this._tracks[0];return a}GetPropertyTrack(a){return this._track.GetPropertyTracks()[0]}SetPropertyType(a){this._propertyType=a}GetInstance(){var a=this.GetTracks();if(a&amp;&amp;a.length&amp;&amp;(this._track=a=a[0])){var b=a.GetInstance();return a.IsInstanceValid()?b:void 0}}AddStartedCallback(a){this._on_started_callbacks||
(this._on_started_callbacks=[]);this._on_started_callbacks.push(a)}AddCompletedCallback(a){this._on_completed_callbacks||(this._on_completed_callbacks=[]);this._on_completed_callbacks.push(a)}RemoveStartedCallback(a){this._on_started_callbacks&amp;&amp;(a=this._on_started_callbacks.indexOf(a),-1!==a&amp;&amp;this._on_started_callbacks.splice(a,1))}RemoveCompletedCallback(a){this._on_completed_callbacks&amp;&amp;(a=this._on_completed_callbacks.indexOf(a),-1!==a&amp;&amp;this._on_completed_callbacks.splice(a,1))}SetStartValue(a,b){for(const c of this._tracks)for(const e of c._propertyTracks){if(e.GetPropertyName()!==
b)continue;var d=e.GetPropertyTrackData();const h=e.GetPropertyTrackDataItem();d=d.GetFirstPropertyKeyframeDataItem(h);d.SetValue(a);d.SetAbsoluteValue(a)}}_GetPropertyTrackState(a){for(const b of this._tracks)for(const d of b._propertyTracks)if(d.GetPropertyName()===a)return d}BeforeSetEndValues(a){for(const c of a)a=this._GetPropertyTrackState(c),this.SetStartValue(a.GetCurrentState(),c);if(this.IsForwardPlayBack()){var b=this.GetTotalTime()-this.GetTime();this.SetTotalTime(b);for(var d of this._tracks)d.SetLocalTotalTime(b);
this._SetTime(0)}else{d=this.GetTime();this.SetTotalTime(d);for(b of this._tracks)b.SetLocalTotalTime(d);this._SetTime(d)}this.SetInitialStateFromSetTime()}SetEndValue(a,b){var d=this._GetPropertyTrackState(b);b=d.GetPropertyTrackData();d=d.GetPropertyTrackDataItem();b=b.GetLastPropertyKeyframeDataItem(d);b.SetTime(this.GetTotalTime());b.SetValue(a);b.SetAbsoluteValue(a)}SetId(a){this._id=a}GetId(){return this._id}SetInitialValueMode(a){this._initialValueMode=a}GetInitialValueMode(){return this._initialValueMode}SetDestroyInstanceOnComplete(a){this._destroyInstanceOnComplete=
a}GetDestroyInstanceOnComplete(){return this._destroyInstanceOnComplete}OnStarted(){if(this._on_started_callbacks)for(const a of this._on_started_callbacks)a(this);if(!this.IsComplete())for(const a of this._tracks)a.CompareSaveStateWithCurrent()}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(!this._finishedTriggers&amp;&amp;(this._finishedTriggers=!0,this._on_completed_callbacks))for(const a of this._on_completed_callbacks)a(this)}SetTime(a){this._DeleteIntermediateKeyframes();
super.SetTime(a)}_SetTimeAndReset(a){C3$jscomp$112.IsFiniteNumber(a)||(a=this.GetTotalTime());0&gt;a?this._playheadTime=0:a&gt;=this.GetTotalTime()?this._playheadTime=this.GetTotalTime():this._playheadTime=a;this._track.SetResetState()}SetInitialState(a){if(!this.InitialStateSet()&amp;&amp;"current-state"===this.GetInitialValueMode())for(const b of this._tracks)b.CompareInitialStateWithCurrent();super.SetInitialState(a)}Stop(a=!1){super.Stop(a);if(!this.IsComplete())for(const b of this._tracks)b.SaveState()}Reset(a=
!0,b=!1){this._DeleteIntermediateKeyframes();super.Reset(a,b)}_DeleteIntermediateKeyframes(){for(const a of this._tracks){const b=d=&gt;{d=d.GetTime();const c=this.GetTotalTime();return 0!==d&amp;&amp;d!==c};a.DeleteKeyframes(b);a.DeletePropertyKeyframes(b)}}_OnBeforeChangeLayout(){if(this.IsReleased())return!0;const a=this.GetInstance();if(a&amp;&amp;a.GetObjectClass().IsGlobal())return!1;this._timelineManager.CompleteTimelineBeforeChangeOfLayout(this);this.ResetBeforeChangeLayout();return!0}Tick(a,b,d){this._instance||
(this._instance=this.GetInstance());if(!this._instance||this._instance.IsDestroyed())this.Stop(!0),this.OnCompleted();else if(b=this._instance.GetTimeScale(),-1!==b&amp;&amp;(a=d*b),0!==a||0!==this._lastDelta){this._lastDelta=a;d=this._playheadTime+a*this._playbackRate;a=this._timelineDataItem._totalTime;this._playheadTime=0&gt;d?0:d&gt;=a?a:d;b=d=!1;var c=this.GetLoop(),e=this.GetPingPong();c||e?c&amp;&amp;!e?0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTimeAndReset(0),b=!0):0&gt;=this._playheadTime&amp;&amp;(this._SetTimeAndReset(a),
b=!0):!c&amp;&amp;e?0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=0):d=!0:0===this._pingPongState&amp;&amp;(this._pingPongState=1)):0&gt;=this._playheadTime&amp;&amp;(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,1===this._pingPongState?this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._pingPongState=
0):d=!0:0===this._pingPongState&amp;&amp;(this._pingPongState=1)):c&amp;&amp;e&amp;&amp;(0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._SetTime(a),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$112.wrap(this._pingPongState,0,2)):0&gt;=this._playheadTime&amp;&amp;(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),b=!0,this._pingPongState++,C3$jscomp$112.wrap(this._pingPongState,0,2))):0&lt;this._playbackRate?this._playheadTime&gt;=a&amp;&amp;(this._currentRepeatCount&lt;this.GetRepeatCount()?
(this._currentRepeatCount++,this._SetTimeAndReset(0),b=!0):(this._SetTime(a),d=!0)):0&gt;=this._playheadTime&amp;&amp;(this._currentRepeatCount&lt;this.GetRepeatCount()?(this._currentRepeatCount++,this._SetTimeAndReset(a),b=!0):(this._SetTime(0),d=!0));d?(this._track.SetEndState(),this.Stop(!0),this.OnCompleted()):(this._track.Interpolate(this._playheadTime,!0,!1,b,this._firstTick,!1),this._firstTick&amp;&amp;(this._firstTick=!1))}}_SaveToJson(){const a=super._SaveToJson(),b=this.GetTimelineDataItem();return Object.assign(a,
{tweenDataItemJson:b._SaveToJson(),id:this._id,destroyInstanceOnComplete:this._destroyInstanceOnComplete,initialValueMode:this._initialValueMode})}_LoadFromJson(a){a&amp;&amp;(this.GetTimelineDataItem()._LoadFromJson(a.tweenDataItemJson),super._LoadFromJson(a),this._id=a.id,this._destroyInstanceOnComplete=a.destroyInstanceOnComplete,this._initialValueMode=a.initialValueMode)}static IsPlaying(a){return a.IsPlaying()}static IsPaused(a){return a.IsPaused()}static Build(a){var b=a.runtime.GetTimelineManager(),
d=new C3$jscomp$112.TimelineDataItem;if(a.json){d._LoadFromJson(a.json.tweenDataItemJson);var c=new C3$jscomp$112.TweenState(d,b);c._LoadFromJson(a.json);return c}b=new C3$jscomp$112.TweenState(d,b);C3$jscomp$112.IsArray(a.propertyTracksConfig)||(a.propertyTracksConfig=[a.propertyTracksConfig]);b.SetId(a.id);b.SetTags(a.tags);b.SetInitialValueMode(a.initialValueMode);b.SetDestroyInstanceOnComplete(a.releaseOnComplete);b.SetLoop(a.loop);b.SetPingPong(a.pingPong);b.SetTotalTime(a.time);b.SetStep(0);
b.SetInterpolationMode("default");b.SetResultMode(a.propertyTracksConfig[0].resultMode);d=b.AddTrack();d.SetInstanceUID(a.instance.GetUID());d.SetInterpolationMode("default");d.SetResultMode(a.propertyTracksConfig[0].resultMode);d.SetEnable(!0);d.SetObjectClassIndex(a.instance.GetObjectClass().GetIndex());var e=a.instance.GetSdkInstance(),h=e.IsOriginalSizeKnown()?e.GetOriginalWidth():a.instance.GetWorldInfo().GetWidth();e=e.IsOriginalSizeKnown()?e.GetOriginalHeight():a.instance.GetWorldInfo().GetHeight();
d.SetOriginalWidth(h);d.SetOriginalHeight(e);h=d.AddKeyframe();h.SetTime(0);h.SetEase("noease");h.SetEnable(!0);h.SetTags("");h=d.AddKeyframe();h.SetTime(a.time);h.SetEase("noease");h.SetEnable(!0);h.SetTags("");for(c of a.propertyTracksConfig)h=d.AddPropertyTrack(),h.SetSourceAdapterId(c.sourceId),h.SetSourceAdapterArgs(c.sourceArgs),h.SetPropertyName(c.property),h.SetPropertyType(c.type),h.SetMin(NaN),h.SetMax(NaN),h.SetInterpolationMode("default"),h.SetResultMode(c.resultMode),h.SetEnable(!0),
e=h.AddPropertyKeyframe(),e.SetType(c.valueType),e.SetTime(0),e.SetEase(c.ease),e.SetEnable(!0),e.SetValue(c.startValue),e.SetAbsoluteValue(c.startValue),e=h.AddPropertyKeyframe(),e.SetType(c.valueType),e.SetTime(a.time),e.SetEase(c.ease),e.SetEnable(!0),e.SetValue(c.endValue),e.SetAbsoluteValue(c.endValue),h.GetSourceAdapter();return b}GetITweenState(a,b){this._iTweenState||(this._iTweenState=C3$jscomp$112.New(self.ITweenState,this,a,b));return this._iTweenState}};"use strict";
const C3$jscomp$113=self.C3;
C3$jscomp$113.TweenTrackState=class extends C3$jscomp$113.TrackState{constructor(a,b){super(a,b);this._secondPropertyTrack=this._firstPropertyTrack=null}static Create(a,b){return C3$jscomp$113.New(C3$jscomp$113.TweenTrackState,a,b)}_CachePropertyTracks(){1===this._propertyTracks.length?this._firstPropertyTrack=this._propertyTracks[0]:(this._firstPropertyTrack=this._propertyTracks[0],this._secondPropertyTrack=this._propertyTracks[1])}CreatePropertyTrackStates(){for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3$jscomp$113.TweenPropertyTrackState.Create(this,a));
this._CachePropertyTracks()}AddPropertyTrack(){var a=this._trackDataItem.GetPropertyTrackData().AddEmptyPropertyTrackDataItem();a=C3$jscomp$113.TweenPropertyTrackState.Create(this,a);this._propertyTracks.push(a);this._CachePropertyTracks();return a}SetInitialState(){this.MaybeGetInstance();if(this.IsInstanceValid()||!this.IsInstanceTrack()){var a=this.GetTimeline().IsForwardPlayBack()?0:this.GetLocalTotalTime();for(const b of this._propertyTracks)b.SetInitialState(a),0===this._worldInfoChange&amp;&amp;1===
b.GetWorldInfoChange()&amp;&amp;(this._worldInfoChange=1),0===this._renderChange&amp;&amp;1===b.GetRenderChange()&amp;&amp;(this._renderChange=1);this._needsBeforeAndAfter=0;this._propertyTracks.some(b=&gt;b.GetNeedsBeforeAndAfter())&amp;&amp;(this._needsBeforeAndAfter=1);this._lastKeyframeDataItem=this._GetLastKeyFrameBeforeTime(a);this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this.Interpolate(a)}}BeforeInterpolate(){}Interpolate(a,b,d=!1,c=!1,e,h=!1){this._instance||this.GetInstance();if(this._instance){if(this._instance.IsDestroyed()||
h&amp;&amp;this.GetObjectClass().IsGlobal())return!1;this._secondPropertyTrack?(this._firstPropertyTrack.Interpolate(a,d,c),this._secondPropertyTrack.Interpolate(a,d,c)):this._firstPropertyTrack.Interpolate(a,d,c);0!==this._firstPropertyTrack.GetWorldInfoChange()&amp;&amp;(this._worldInfo||(this._worldInfo=this._instance.GetWorldInfo()),this._worldInfo&amp;&amp;this._worldInfo.SetBboxChanged())}}AfterInterpolate(){}_LoadFromJson(a){super._LoadFromJson(a);this._CachePropertyTracks()}};"use strict";const C3$jscomp$114=self.C3;
C3$jscomp$114.TweenPropertyTrackState=class extends C3$jscomp$114.PropertyTrackState{constructor(a,b){super(a,b);this._basic=!1}static Create(a,b){return C3$jscomp$114.New(C3$jscomp$114.TweenPropertyTrackState,a,b)}Interpolate(a,b=!1,d=!1){if(this._basic){var c=this._propertyKeyframeDataItems[0];var e=this._propertyKeyframeDataItems[1]}else{if(b)c=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);else{if(this._lastPropertyKeyframeDataItem){e=this.GetTimeline();
const h=this._lastPropertyKeyframeDataItem.GetNext();c=this._lastPropertyKeyframeDataItem.GetTime();e=h?h.GetTime():e.GetTotalTime();if(a&lt;=c||a&gt;=e)this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem)}else this._lastPropertyKeyframeDataItem=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,this._propertyTrackDataItem);c=this._lastPropertyKeyframeDataItem}e=c.GetNext()}this._sourceAdapter.Interpolate(a,
c,e,b,d)}AddPropertyKeyframe(){const a=this._propertyTrackDataItem.GetPropertyKeyframeData().AddEmptyPropertyKeyframeDataItem();this._lastPropertyKeyframeDataItem=null;this._basic=2&gt;=this.GetPropertyKeyframeDataItems().length;return a}DeletePropertyKeyframes(a){this._lastPropertyKeyframeDataItem=null;this._propertyTrackDataItem.GetPropertyKeyframeData().DeletePropertyKeyframeDataItems(a);this._basic=2&gt;=this.GetPropertyKeyframeDataItems().length}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson(),
basic:this._basic}}_LoadFromJson(a){a&amp;&amp;(this.GetSourceAdapter()._LoadFromJson(a.sourceAdapterJson),this._basic=a.basic)}};"use strict";const C3$jscomp$115=self.C3,Ease$jscomp$2=self.Ease;
C3$jscomp$115.Transition=class extends C3$jscomp$115.DefendedBase{constructor(a){super();this._name=a[0];this._transitionKeyframes=[];for(var b of a[1])a=C3$jscomp$115.TransitionKeyframe.Create(this,b),this._transitionKeyframes.push(a);for(b=0;b&lt;this._transitionKeyframes.length;b++)this._transitionKeyframes[b].SetNext(this._transitionKeyframes[b+1]);this._precalculatedSamples=new Map;this._transitionKeyframeCache=new Map;this._PreCalcSamples();Ease$jscomp$2.AddCustomEase(this._name,(d,c,e,h)=&gt;this.Interpolate(d,
c,e,h))}static Create(a){return C3$jscomp$115.New(C3$jscomp$115.Transition,a)}Release(){for(const a of this._transitionKeyframes)a.Release();C3$jscomp$115.clearArray(this._transitionKeyframes);this._transitionKeyframes=null;this._precalculatedSamples.clear();this._precalculatedSamples=null;this._transitionKeyframeCache.clear();this._transitionKeyframeCache=null}GetTransitionKeyFrameAt(a){const b=this._transitionKeyframeCache.get(a);if(b)return b;for(const d of this._transitionKeyframes)if(d.GetValueX()===
a)return this._transitionKeyframeCache.set(a,d),d}GetFirstTransitionKeyFrameHigherThan(a){for(const b of this._transitionKeyframes)if(b.GetValueX()&gt;a)return b}GetFirstTransitionKeyFrameHigherOrEqualThan(a){for(const b of this._transitionKeyframes)if(b.GetValueX()&gt;=a)return b}GetFirstTransitionKeyFrameLowerThan(a){for(let b=this._transitionKeyframes.length-1;0&lt;=b;b--){const d=this._transitionKeyframes[b];if(d.GetValueX()&lt;a)return d}}GetFirstTransitionKeyFrameLowerOrEqualThan(a){for(let b=this._transitionKeyframes.length-
1;0&lt;=b;b--){const d=this._transitionKeyframes[b];if(d.GetValueX()&lt;=a)return d}}Interpolate(a,b,d,c){var e=a/c;a=this.GetFirstTransitionKeyFrameLowerOrEqualThan(e);c=a.GetNext();c||(a=this.GetFirstTransitionKeyFrameLowerThan(e),c=a.GetNext());var h=c.GetValueX()-a.GetValueX();e=C3$jscomp$115.mapToRange(e,a.GetValueX(),c.GetValueX(),0,h);h=a.GetValueX();const k=a.GetValueY(),m=a.GetValueX()+a.GetStartAnchorX(),p=a.GetValueY()+a.GetStartAnchorY(),q=c.GetValueX()+c.GetEndAnchorX(),v=c.GetValueY()+c.GetEndAnchorY(),
x=c.GetValueX();c=c.GetValueY();c=Ease$jscomp$2.GetRuntimeEase("spline")(e,h,k,m,p,q,v,x,c,this._precalculatedSamples.get(a));c+=a.GetValueY();return(1-c)*b+c*(b+d)}_PreCalcSamples(){this._precalculatedSamples.clear();for(let d=0;d&lt;this._transitionKeyframes.length-1;d++){var a=this._transitionKeyframes[d];if(!a.GetStartEnable())continue;var b=this._transitionKeyframes[d+1];const c=a.GetValueX(),e=a.GetValueX()+a.GetStartAnchorX(),h=b.GetValueX()+b.GetEndAnchorX();b=b.GetValueX();this._precalculatedSamples.set(a,
Ease$jscomp$2.GetBezierSamples(c,e,h,b))}}};"use strict";const C3$jscomp$116=self.C3;
C3$jscomp$116.TransitionKeyframe=class extends C3$jscomp$116.DefendedBase{constructor(a,b){super();this._transition=a;this._valueX=b[0];this._valueY=b[1];this._startAnchorX=b[2];this._startAnchorY=b[3];this._endAnchorX=b[4];this._endAnchorY=b[5];this._startEnable=b[6];this._endEnable=b[7];this._next=null}Release(){this._transition=null}static Create(a,b){return C3$jscomp$116.New(C3$jscomp$116.TransitionKeyframe,a,b)}SetNext(a){this._next=a}GetNext(){return this._next}GetValueX(){return this._valueX}GetValueY(){return this._valueY}GetStartAnchorX(){return this._startAnchorX}GetStartAnchorY(){return this._startAnchorY}GetEndAnchorX(){return this._endAnchorX}GetEndAnchorY(){return this._endAnchorY}GetStartEnable(){return this._startEnable}GetEndEnable(){return this._endEnable}};
"use strict";const C3$jscomp$117=self.C3;C3$jscomp$117.TransitionManager=class extends C3$jscomp$117.DefendedBase{constructor(a){super();this._runtime=a;this._transitions=[]}Release(){for(const a of this._transitions)a.Release();C3$jscomp$117.clearArray(this._transitions);this._transitions=null}Create(a){this._transitions.push(C3$jscomp$117.Transition.Create(a))}};"use strict";const C3$jscomp$118=self.C3;
C3$jscomp$118.TemplateManager=class extends C3$jscomp$118.DefendedBase{constructor(a){super();this._runtime=a;this._instanceToTemplateNameMap=this._templateDataMap=null;this._instanceDestroy=b=&gt;this._OnInstanceDestroy(b.instance)}Release(){this.RemoveRuntimeListeners();if(this._templateDataMap){for(const a of this._templateDataMap.values())a.clear();this._templateDataMap.clear()}this._runtime=this._templateDataMap=null}Create(a){this._templateDataMap||(this._templateDataMap=new Map);if(a){var b=a[0][16][0],
d=a[1];this._templateDataMap.has(d)||this._templateDataMap.set(d,new Map);this._templateDataMap.get(d).set(b,a)}}AddRuntimeListeners(){const a=this._runtime.Dispatcher();a&amp;&amp;a.addEventListener("instancedestroy",this._instanceDestroy)}RemoveRuntimeListeners(){const a=this._runtime.Dispatcher();a&amp;&amp;a.removeEventListener("instancedestroy",this._instanceDestroy)}HasTemplates(){return this._templateDataMap?0!==this._templateDataMap.size:!1}GetTemplateData(a,b){a=a instanceof C3$jscomp$118.ObjectClass?a.GetIndex():
a;if(this._templateDataMap.has(a)&amp;&amp;(b=this._templateDataMap.get(a).get(b)))return JSON.parse(JSON.stringify(b))}MapInstanceToTemplateName(a,b){this._instanceToTemplateNameMap||(this._instanceToTemplateNameMap=new WeakMap);this._instanceToTemplateNameMap.has(a)||this._instanceToTemplateNameMap.set(a,b)}GetInstanceTemplateName(a){return this._instanceToTemplateNameMap?(a=this._instanceToTemplateNameMap.get(a))?a:"":""}_OnInstanceDestroy(a){this._instanceToTemplateNameMap&amp;&amp;this._instanceToTemplateNameMap.has(a)&amp;&amp;
this._instanceToTemplateNameMap.delete(a)}};"use strict";const C3$jscomp$119=self.C3;
C3$jscomp$119.SolStack=class extends C3$jscomp$119.DefendedBase{constructor(a){super();this._objectClass=a;this._stack=[];this._stack.push(C3$jscomp$119.New(C3$jscomp$119.Sol,this));this._index=0;this._current=this._stack[0]}Release(){for(const a of this._stack)a.Release();C3$jscomp$119.clearArray(this._stack);this._objectClass=this._current=null}GetObjectClass(){return this._objectClass}GetCurrentSol(){return this._current}Clear(){this.GetCurrentSol().Clear()}PushClean(){var a=this._stack,b=++this._index;
b===a.length?(b=C3$jscomp$119.New(C3$jscomp$119.Sol,this),a.push(b),this._current=b):(a=a[b],a.Reset(),this._current=a)}PushCopy(){const a=this._stack,b=++this._index;b===a.length&amp;&amp;a.push(C3$jscomp$119.New(C3$jscomp$119.Sol,this));const d=a[b];d.Copy(a[b-1]);this._current=d}Pop(){this._current=this._stack[--this._index]}RemoveInstances(a){const b=this._stack;for(let d=0,c=b.length;d&lt;c;++d)b[d].RemoveInstances(a)}};"use strict";const C3$jscomp$120=self.C3;
C3$jscomp$120.Sol=class extends C3$jscomp$120.DefendedBase{constructor(a){super();this._stack=a;this._objectClass=this._stack.GetObjectClass();this._eventStack=this._objectClass.GetRuntime().GetEventStack();this._selectAll=!0;this._instances=[];this._elseInstances=[]}Release(){this.ClearArrays();this._eventStack=this._objectClass=this._stack=null}ClearArrays(){C3$jscomp$120.clearArray(this._instances);C3$jscomp$120.clearArray(this._elseInstances)}GetObjectClass(){return this._objectClass}IsSelectAll(){return this._selectAll}HasAnyInstances(){return this._selectAll?
!!this._objectClass.GetInstanceCount():!!this._instances.length}GetInstances(){return this._selectAll?this._objectClass.GetInstances():this._instances}HasAnyElseInstances(){return!!this._elseInstances.length}GetElseInstances(){return this._elseInstances}GetExpressionInstances(){const a=this.GetInstances();return a.length?a:this._elseInstances}Reset(){this._selectAll=!0;C3$jscomp$120.clearArray(this._elseInstances)}Clear(){this._selectAll=!0}Copy(a){a.IsSelectAll()?this.Reset():(this._selectAll=!1,
C3$jscomp$120.shallowAssignArray(this._instances,a._instances),C3$jscomp$120.clearArray(this._elseInstances))}_PushInstance(a){this._instances.push(a)}_PushElseInstance(a){this._elseInstances.push(a)}_SetSelectAll(a){this._selectAll=!!a}_GetOwnInstances(){return this._instances}_GetOwnElseInstances(){return this._elseInstances}SetSinglePicked(a){this._selectAll=!1;C3$jscomp$120.clearArray(this._instances);this._instances.push(a)}SetArrayPicked(a){this._selectAll=!1;C3$jscomp$120.shallowAssignArray(this._instances,
a)}SetSetPicked(a){this._selectAll=!1;C3$jscomp$120.clearArray(this._instances);for(const b of a)this._instances.push(b)}AddElseInstances(a,b){for(const d of b)a.has(d)||this._elseInstances.push(d)}TransferElseInstancesToOwn(a){for(const b of a)this._instances.push(b);C3$jscomp$120.arrayRemoveAllInSet(this._elseInstances,a)}PickOne(a){a&amp;&amp;(this._eventStack.GetCurrentStackFrame().GetCurrentEvent().IsOrBlock()?(this.IsSelectAll()&amp;&amp;(C3$jscomp$120.clearArray(this._instances),C3$jscomp$120.shallowAssignArray(this._elseInstances,
a.GetObjectClass().GetInstances()),this._selectAll=!1),a=this._elseInstances.indexOf(a),-1!==a&amp;&amp;(this._instances.push(this._elseInstances[a]),this._elseInstances.splice(a,1))):this.SetSinglePicked(a))}RemoveInstances(a){C3$jscomp$120.arrayRemoveAllInSet(this._instances,a);C3$jscomp$120.arrayRemoveAllInSet(this._elseInstances,a)}};"use strict";const C3$jscomp$121=self.C3;
C3$jscomp$121.EventStack=class extends C3$jscomp$121.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._stack.push(C3$jscomp$121.New(C3$jscomp$121.EventStackFrame,this,null));this._index=0;this._expFuncStack=[]}Release(){for(const a of this._stack)a.Release();C3$jscomp$121.clearArray(this._stack);C3$jscomp$121.clearArray(this._expFuncStack);this._runtime=this._eventSheetManager=null}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrentStackFrame(){return this._stack[this._index]}Push(a){var b=
this._stack;const d=++this._index;if(d===b.length)return a=C3$jscomp$121.New(C3$jscomp$121.EventStackFrame,this,a),b.push(a),a;b=b[d];b.Reset(a);return b}Pop(){--this._index}PushExpFunc(a){this._expFuncStack.push(a)}PopExpFunc(){this._expFuncStack.pop()}GetCurrentExpFuncStackFrame(){const a=this._expFuncStack;return 0===a.length?null:a.at(-1)}};"use strict";const C3$jscomp$122=self.C3;
C3$jscomp$122.EventStackFrame=class extends C3$jscomp$122.DefendedBase{constructor(a,b){super();this._stack=a;this._runtime=this._stack.GetRuntime();this._currentEvent=b;this._actIndex=this._cndIndex=0;this._elseBranchRan=this._lastEventTrue=!1;this._expressionObjectClass=null;this._functionReturnValue=this._functionReturnType=0}Release(){this.Reset(null);this._runtime=this._stack=null}Reset(a){this._currentEvent=a;this._actIndex=this._cndIndex=0;this._elseBranchRan=this._lastEventTrue=!1}_Restore(a,
b){this._currentEvent=a;this._cndIndex=0;this._actIndex=b}ResetQuick(){this._actIndex=this._cndIndex=0}GetCurrentEvent(){return this._currentEvent}SetCurrentEvent(a){this._currentEvent=a}GetConditionIndex(){return this._cndIndex}SetConditionIndex(a){this._cndIndex=a}GetActionIndex(){return this._actIndex}SetActionIndex(a){this._actIndex=a}SetLastEventTrue(a){this._lastEventTrue=!!a}GetLastEventTrue(){return this._lastEventTrue}SetElseBranchRan(a){this._elseBranchRan=!!a}GetElseBranchRan(){return this._elseBranchRan}SetExpressionObjectClass(a){this._expressionObjectClass=
a}GetExpressionObjectClass(){return this._expressionObjectClass}InitCallFunctionExpression(a,b){this._functionReturnType=a;this._functionReturnValue=b}GetFunctionReturnType(){return this._functionReturnType}SetFunctionReturnValue(a){this._functionReturnValue=a}GetFunctionReturnValue(){return this._functionReturnValue}IsSolModifierAfterCnds(){const a=this._currentEvent;return a.IsSolWriterAfterCnds()?!0:this._cndIndex&lt;a.GetConditionCount()-1?!!a.GetSolModifiers().length:!1}};"use strict";
const C3$jscomp$123=self.C3;
C3$jscomp$123.LocalVarStack=class extends C3$jscomp$123.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1;this._current=null;this._initialValues=[]}Release(){C3$jscomp$123.clearArray(this._stack);this._runtime=this._eventSheetManager=null}_SetInitialValues(a){this._initialValues=a;a=this._initialValues.slice(0);this._stack.push(a);this._index=0;this._current=a}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrent(){return this._current}Push(){const a=++this._index,
b=this._stack;a===b.length?b.push(this._initialValues.slice(0)):C3$jscomp$123.shallowAssignArray(b[a],this._initialValues);this._current=b[a]}Pop(){this._current=this._stack[--this._index]}};"use strict";const C3$jscomp$124=self.C3;
C3$jscomp$124.LoopStack=class extends C3$jscomp$124.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1}Release(){C3$jscomp$124.clearArray(this._stack);this._runtime=this._eventSheetManager=null}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}IsInLoop(){return 0&lt;=this._index}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){var a=
C3$jscomp$124.New(C3$jscomp$124.Loop,this);this._stack.push(a);return a}a=this._stack[this._index];a.Reset();return a}Pop(){--this._index}FindByName(a){const b=this._stack;for(let d=this._index;0&lt;=d;--d){const c=b[d];if(c.GetName()===a)return c}return null}_GetStack(){return this._stack.slice(0,this._index+1)}};"use strict";const C3$jscomp$125=self.C3;
C3$jscomp$125.Loop=class extends C3$jscomp$125.DefendedBase{constructor(a){super();this._loopStack=a;this._name="";this._index=0;this._isStopped=!1;this._end=NaN}Reset(){this._name="";this._index=0;this._isStopped=!1;this._end=NaN}SetName(a){this._name=a}GetName(){return this._name}SetIndex(a){this._index=a}GetIndex(){return this._index}Stop(){this._isStopped=!0}IsStopped(){return this._isStopped}SetEnd(a){this._end=a}GetEnd(){return this._end}};"use strict";const C3$jscomp$126=self.C3;
C3$jscomp$126.ArrayStack=class extends C3$jscomp$126.DefendedBase{constructor(){super();this._stack=[];this._index=-1}Release(){C3$jscomp$126.clearArray(this._stack)}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){const a=[];this._stack.push(a);return a}return this._stack[this._index]}Pop(){--this._index}};"use strict";const C3$jscomp$127=self.C3;function SortSolArray(a,b){return a.GetIndex()-b.GetIndex()}
function IsSolArrayIdentical(a,b){for(let d=0,c=a.length;d&lt;c;++d)if(a[d]!==b[d])return!1;return!0}
C3$jscomp$127.EventSheetManager=class extends C3$jscomp$127.DefendedBase{constructor(a){super();this._runtime=a;this._allSheets=[];this._sheetsByName=new Map;this._allGroups=[];this._groupsByName=new Map;this._blocksBySid=new Map;this._cndsBySid=new Map;this._actsBySid=new Map;this._allUniqueSolModifiers=new Map;this._eventVarsBySid=new Map;this._nextLocalVarIndex=0;this._allGlobalVars=[];this._allLocalVars=[];this._localVarInitialValues=[];this._functionBlocksByName=new Map;this._eventStack=C3$jscomp$127.New(C3$jscomp$127.EventStack,
this);this._localVarStack=C3$jscomp$127.New(C3$jscomp$127.LocalVarStack,this);this._loopStack=C3$jscomp$127.New(C3$jscomp$127.LoopStack,this);this._triggersToPostInit=[];this._queuedTriggers=[];this._queuedDebugTriggers=[];this._blockFlushingDepth=this._executingTriggerDepth=this._runningEventsDepth=0;this._scheduledWaits=[];this._asyncActionPromises=[];self.c3_callFunction=(b,d)=&gt;this._InvokeFunctionFromJS(b,d)}Release(){this.ClearAllScheduledWaits();this._eventStack.Release();this._eventStack=null;
this._localVarStack.Release();this._localVarStack=null;C3$jscomp$127.clearArray(this._queuedTriggers);C3$jscomp$127.clearArray(this._queuedDebugTriggers);this._runtime=null;C3$jscomp$127.clearArray(this._allSheets);this._sheetsByName.clear()}Create(a){a=C3$jscomp$127.New(C3$jscomp$127.EventSheet,this,a);this._allSheets.push(a);this._sheetsByName.set(a.GetName().toLowerCase(),a)}_AddTriggerToPostInit(a){this._triggersToPostInit.push(a)}_PostInit(){for(const a of this._functionBlocksByName.values())a._PostInit(!1);
for(const a of this._allSheets)a._PostInit();for(const a of this._allSheets)a._UpdateDeepIncludes();for(const a of this._triggersToPostInit)a._PostInit(!1);C3$jscomp$127.clearArray(this._triggersToPostInit);this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(a){return this._sheetsByName.get(a.toLowerCase())||null}_RegisterGroup(a){this._allGroups.push(a);this._groupsByName.set(a.GetGroupName(),a)}_RegisterEventBlock(a){this._blocksBySid.set(a.GetSID(),
a)}_RegisterCondition(a){this._cndsBySid.set(a.GetSID(),a)}_RegisterAction(a){this._actsBySid.set(a.GetSID(),a)}_RegisterFunctionBlock(a){this._functionBlocksByName.set(a.GetFunctionName().toLowerCase(),a)}_RegisterEventVariable(a){this._eventVarsBySid.set(a.GetSID(),a);a.IsGlobal()?this._allGlobalVars.push(a):this._allLocalVars.push(a)}_DeduplicateSolModifierList(a){2&lt;=a.length&amp;&amp;a.sort(SortSolArray);let b=this._allUniqueSolModifiers.get(a.length);b||(b=[],this._allUniqueSolModifiers.set(a.length,
b));for(let d=0,c=b.length;d&lt;c;++d){const e=b[d];if(IsSolArrayIdentical(a,e))return e}b.push(a);return a}_GetNextLocalVarIndex(a){this._localVarInitialValues.push(a.GetInitialValue());return this._nextLocalVarIndex++}GetEventStack(){return this._eventStack}GetCurrentEventStackFrame(){return this.GetEventStack().GetCurrentStackFrame()}GetCurrentEvent(){return this.GetCurrentEventStackFrame().GetCurrentEvent()}GetCurrentCondition(){const a=this.GetCurrentEventStackFrame();return a.GetCurrentEvent().GetConditionAt(a.GetConditionIndex())}GetCurrentAction(){const a=
this.GetCurrentEventStackFrame();return a.GetCurrentEvent().GetActionAt(a.GetActionIndex())}GetLocalVarStack(){return this._localVarStack}GetLoopStack(){return this._loopStack}GetAllLocalVariablesInScope(a){const b=[];for(a=a.GetScopeParent();a;)C3$jscomp$127.appendArray(b,a._GetAllLocalVariablesInScope()),a=a.GetScopeParent();return b}_GetLocalVariablesScriptInterface(a){const b={};for(const d of this.GetAllLocalVariablesInScope(a))b[d.GetJsPropName()]=d._GetScriptInterfaceDescriptor();return Object.create(Object.prototype,
b)}GetEventVariableBySID(a){return this._eventVarsBySid.get(a)||null}GetEventBlockBySID(a){return this._blocksBySid.get(a)||null}GetConditionBySID(a){return this._cndsBySid.get(a)||null}GetActionBySID(a){return this._actsBySid.get(a)||null}GetFunctionBlockByName(a){return this._functionBlocksByName.get(a.toLowerCase())||null}GetAllGlobalVariables(){return this._allGlobalVars}GetAllLocalVariables(){return this._allLocalVars}ResetAllGlobalsToInitialValue(){for(const a of this._allGlobalVars)a.ResetToInitialValue()}GetEventGroupByName(a){return this._groupsByName.get(a.toLowerCase())||
null}GetEventGroupBySID(a){return(a=this._blocksBySid.get(a))&amp;&amp;a.IsGroup()?a:null}GetAllGroups(){return this._allGroups}ResetAllGroupsInitialActivation(){for(const a of this._allGroups)a.ResetInitialActivation()}_ResetAllHasRunFlags(){for(const a of this._allSheets)a._ResetHasRunFlag()}RunEvents(a){this._ResetAllHasRunFlags();this._runningEventsDepth++;for(const b of a.runningLayouts())if(a=b.GetEventSheet())this._runtime.PushCurrentLayout(b),a.Run(),this._runtime.PopCurrentLayout();this._runningEventsDepth--}async DebugRunEvents(a){this._ResetAllHasRunFlags();
this._runningEventsDepth++;for(const b of this._DebugRunEventsGen(a))await this._runtime.DebugBreak(b);this._runningEventsDepth--}*_DebugRunEventsGen(a){for(const b of a.runningLayouts())if(a=b.GetEventSheet())this._runtime.PushCurrentLayout(b),yield*a.DebugRun(),this._runtime.PopCurrentLayout()}_Trigger(a,b,d,c){let e=!1;if(!a.GetMainRunningLayout())return this.QueueTrigger(b,d,c);this._executingTriggerDepth++;for(const h of a.runningLayouts())if(a=h.GetEventSheet()){this._runtime.PushCurrentLayout(h);
for(const k of a.deepIncludes()){const m=k._Trigger(b,d,c);e=e||m}a=a._Trigger(b,d,c);e=e||a;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--;return e}*_DebugTrigger(a,b,d,c){let e=!1;if(!a.GetMainRunningLayout())return this.QueueTrigger(b,d,c);this._executingTriggerDepth++;for(const h of a.runningLayouts())if(a=h.GetEventSheet()){this._runtime.PushCurrentLayout(h);for(const k of a.deepIncludes()){const m=yield*k._DebugTrigger(b,d,c);e=e||m}a=yield*a._DebugTrigger(b,d,c);e=e||a;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--;
return e}QueueTrigger(a,b,d){this._queuedTriggers.push([a,b,d]);return!1}QueueDebugTrigger(a,b,d){let c=null;const e=new Promise(h=&gt;c=h);this._queuedDebugTriggers.push([a,b,d,c]);return e}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw Error("should not be in breakpoint");const a=this._runtime.GetLayoutManager();for(;this._queuedDebugTriggers.length;){const [b,d,c,e]=this._queuedDebugTriggers.shift(),h=yield*this._DebugTrigger(a,b,d,c);e(h)}}async RunQueuedDebugTriggersAsync(){for(const a of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(a)}_FastTrigger(a,
b,d,c){let e=!1;var h=a.GetMainRunningLayout();if(a=h.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(h);h=a.deepIncludes();for(let k=0,m=h.length;k&lt;m;++k){const p=h[k]._FastTrigger(b,d,c);e=e||p}b=a._FastTrigger(b,d,c);e=e||b;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return e}}*_DebugFastTrigger(a,b,d,c){let e=!1;var h=a.GetMainRunningLayout();if(a=h.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(h);h=a.deepIncludes();
for(let k=0,m=h.length;k&lt;m;++k){const p=yield*h[k]._DebugFastTrigger(b,d,c);e=e||p}b=yield*a._DebugFastTrigger(b,d,c);e=e||b;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return e}}GetTriggerDepth(){return this._executingTriggerDepth}IsInTrigger(){return 0&lt;this.GetTriggerDepth()}_IncTriggerDepth(){return++this._executingTriggerDepth}_DecTriggerDepth(){--this._executingTriggerDepth}IsRunningEvents(){return 0&lt;this._runningEventsDepth}IsInEventEngine(){return this.IsRunningEvents()||
this.IsInTrigger()}_RunQueuedTriggers(a){for(const [b,d,c]of this._queuedTriggers)this._Trigger(a,b,d,c);C3$jscomp$127.clearArray(this._queuedTriggers)}BlockFlushingInstances(a){a?this._blockFlushingDepth++:this._blockFlushingDepth--}IsFlushingBlocked(){return 0&lt;this._blockFlushingDepth}ClearSol(a){for(let b=0,d=a.length;b&lt;d;++b)a[b].GetSolStack().Clear()}PushCleanSol(a){for(let b=0,d=a.length;b&lt;d;++b)a[b].GetSolStack().PushClean()}PushCopySol(a){for(let b=0,d=a.length;b&lt;d;++b)a[b].GetSolStack().PushCopy()}PopSol(a){for(let b=
0,d=a.length;b&lt;d;++b)a[b].GetSolStack().Pop()}AddScheduledWait(){const a=C3$jscomp$127.New(C3$jscomp$127.ScheduledWait,this);this._scheduledWaits.push(a);return a}scheduledWaits(){return this._scheduledWaits}RunScheduledWaits(){if(this._scheduledWaits.length){var a=this.GetCurrentEventStackFrame(),b=!1;this._runningEventsDepth++;for(let d=0,c=this._scheduledWaits.length;d&lt;c;++d){const e=this._scheduledWaits[d];e._ShouldRun()&amp;&amp;e._Run(a);e.ShouldRelease()&amp;&amp;(b=!0)}b&amp;&amp;(this._FilterScheduledWaitsToRelease(),
a.Reset(null));this._runningEventsDepth--}}async DebugRunScheduledWaits(){if(this._scheduledWaits.length){var a=this.GetCurrentEventStackFrame(),b=!1;this._runningEventsDepth++;for(let d=0,c=this._scheduledWaits.length;d&lt;c;++d){const e=this._scheduledWaits[d];e._ShouldRun()&amp;&amp;await e._DebugRun(a);e.ShouldRelease()&amp;&amp;(b=!0)}b&amp;&amp;(this._FilterScheduledWaitsToRelease(),a.Reset(null));this._runningEventsDepth--}}_FilterScheduledWaitsToRelease(){const a=C3$jscomp$127.arrayFilterOut(this._scheduledWaits,b=&gt;
b.ShouldRelease());for(const b of a)b.Release()}ClearAllScheduledWaits(){for(const a of this._scheduledWaits)a.Release();C3$jscomp$127.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(a){for(const b of this._scheduledWaits)b.RemoveInstances(a)}AddAsyncActionPromise(a){this._asyncActionPromises.push(a)}ClearAsyncActionPromises(){C3$jscomp$127.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const a=Promise.all(this._asyncActionPromises);this._asyncActionPromises=
[];return a}_SaveToJson(){return{groups:this._SaveGroupsToJson(),cnds:this._SaveCndsToJson(),acts:this._SaveActsToJson(),vars:this._SaveVarsToJson(),waits:this._SaveScheduledWaitsToJson()}}_LoadFromJson(a){this._LoadGroupsFromJson(a.groups);this._LoadCndsFromJson(a.cnds);this._LoadActsFromJson(a.acts);this._LoadVarsFromJson(a.vars);this._LoadScheduledWaitsFromJson(a.waits)}_SaveGroupsToJson(){const a={};for(const b of this.GetAllGroups())a[b.GetSID().toString()]=b.IsGroupActive();return a}_LoadGroupsFromJson(a){for(const [b,
d]of Object.entries(a))a=parseInt(b,10),(a=this.GetEventGroupBySID(a))&amp;&amp;a.SetGroupActive(d)}_SaveCndsToJson(){const a={};for(const [b,d]of this._cndsBySid){const c=d._SaveToJson();c&amp;&amp;(a[b.toString()]=c)}return a}_LoadCndsFromJson(a){const b=new Map;for(const [d,c]of Object.entries(a))b.set(parseInt(d,10),c);for(const [d,c]of this._cndsBySid)c._LoadFromJson(b.get(d)||null)}_SaveActsToJson(){const a={};for(const [b,d]of this._actsBySid){const c=d._SaveToJson();c&amp;&amp;(a[b.toString()]=c)}return a}_LoadActsFromJson(a){const b=
new Map;for(const [d,c]of Object.entries(a))b.set(parseInt(d,10),c);for(const [d,c]of this._actsBySid)c._LoadFromJson(b.get(d)||null)}_SaveVarsToJson(){const a={};for(const [b,d]of this._eventVarsBySid)d.IsConstant()||!d.IsGlobal()&amp;&amp;!d.IsStatic()||(a[b.toString()]=d.GetValue());return a}_LoadVarsFromJson(a){for(const [b,d]of Object.entries(a))a=parseInt(b,10),(a=this.GetEventVariableBySID(a))&amp;&amp;a.SetValue(d)}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(a=&gt;!a.IsPromise()).map(a=&gt;a._SaveToJson())}_LoadScheduledWaitsFromJson(a){this.ClearAllScheduledWaits();
for(const b of a)(a=C3$jscomp$127.ScheduledWait._CreateFromJson(this,b))&amp;&amp;this._scheduledWaits.push(a)}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(a=&gt;a.GetEventSheet()).filter(a=&gt;a).map(a=&gt;a._GetPerfRecord())}FindFirstFunctionBlockParent(a){for(;a;)if(a=a.GetScopeParent(),a instanceof C3$jscomp$127.FunctionBlock)return a;return null}_InvokeFunctionFromJS(a,b){Array.isArray(b)||(b=[]);a=this.GetFunctionBlockByName(a.toLowerCase());if(!a)return null;if(!a.IsEnabled())return a.GetDefaultReturnValue();
var d=a.GetFunctionParameters();if(b.length&lt;d.length){b=b.slice(0);do b.push(d[b.length].GetInitialValue());while(b.length&lt;d.length)}d=a.GetEventBlock();return d.RunAsExpressionFunctionCall(d.GetSolModifiersIncludingParents(),!1,a.GetReturnType(),a.GetDefaultReturnValue(),...b)}};"use strict";const C3$jscomp$128=self.C3;
C3$jscomp$128.EventSheet=class extends C3$jscomp$128.DefendedBase{constructor(a,b){super();this._eventSheetManager=a;this._runtime=a.GetRuntime();this._name=b[0];this._events=[];this._triggers=new Map;this._fastTriggers=new Map;this._eventsByDisplayNumber=new Map;this._hasRun=!1;this._shallowIncludes=[];this._deepIncludes=[];this._alreadyIncludedSheets=new Set;for(const d of b[1])this._CreateEvent(d,null,this._events);this._perfRecord=this._runtime.IsDebug()?{type:"sheet",name:this._name,totalTimeCounter:0,
children:[]}:null}Release(){this._runtime=this._eventSheetManager=null}_CreateEvent(a,b,d){switch(a[0]){case 0:case 3:this._CreateEventBlock(a,b,d);break;case 1:this._CreateEventVariable(a,b,d);break;case 2:this._CreateInclude(a,b,d);break;case 4:this._CreateFunctionBlock(a,b);break;case 5:this._CreateScriptBlock(a,b,d);break;default:throw Error("invalid event type");}}_CreateEventBlock(a,b,d){a=C3$jscomp$128.EventBlock.Create(this,b,a);if(a.IsOrBlock()){d.push(a);d=a.GetConditions();for(let c=0,
e=d.length;c&lt;e;++c)d[c].IsTrigger()&amp;&amp;this._InitTrigger(a,c)}else a.IsTrigger()?this._InitTrigger(a,0):d.push(a)}_CreateFunctionBlock(a,b){a=C3$jscomp$128.FunctionBlock.Create(this,b,a);this._eventSheetManager._RegisterFunctionBlock(a)}_CreateEventVariable(a,b,d){a=C3$jscomp$128.EventVariable.Create(this,b,a);d.push(a)}_CreateInclude(a,b,d){a=C3$jscomp$128.EventInclude.Create(this,b,a);d.push(a)}_CreateScriptBlock(a,b,d){a=C3$jscomp$128.EventScript.Create(this,b,a);d.push(a)}_InitTrigger(a,b){a.IsOrBlock()||
this._eventSheetManager._AddTriggerToPostInit(a);var d=a.GetConditionAt(b),c=d._GetFunc(),e=d.GetObjectClass();if(d.IsFastTrigger()){var h=this._fastTriggers.get(e);h||(h=new Map,this._fastTriggers.set(e,h));d=d.GetFastTriggerValue().toLowerCase();e=h.get(c);e||(e=new Map,h.set(c,e));c=e.get(d);c||(c=[],e.set(d,c));c.push([a,b])}else h=this._triggers.get(e),h||(h={methodMap:new Map,behaviors:new Map},this._triggers.set(e,h)),(e=d.GetBehaviorType())?(d=h.behaviors.get(e),d||(d=new Map,h.behaviors.set(e,
d))):d=h.methodMap,h=d.get(c),h||(h=[],d.set(c,h)),h.push([a,b])}_PostInit(){const a=this._events;for(let b=0,d=a.length;b&lt;d;++b){const c=b&lt;d-1&amp;&amp;a[b+1]instanceof C3$jscomp$128.EventBlock&amp;&amp;a[b+1].IsElseBlock();a[b]._PostInit(c)}}_AddShallowInclude(a){this._shallowIncludes.push(a)}_UpdateDeepIncludes(){C3$jscomp$128.clearArray(this._deepIncludes);this._AddDeepIncludes(this);this._alreadyIncludedSheets.clear()}_AddDeepIncludes(a){const b=a._deepIncludes,d=a._alreadyIncludedSheets;for(const c of this._shallowIncludes){const e=
c.GetIncludeSheet();c.IsActive()&amp;&amp;a!==e&amp;&amp;!d.has(e)&amp;&amp;(d.add(e),e._AddDeepIncludes(a),b.push(e))}}deepIncludes(){return this._deepIncludes}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetName(){return this._name}_RegisterEventByDisplayNumber(a,b){this._eventsByDisplayNumber.set(b,a)}_GetEventByDisplayNumber(a){return this._eventsByDisplayNumber.get(a)||null}_ResetHasRunFlag(){this._hasRun=!1}Run(){if(!this._hasRun){var a=this._runtime,b=a.IsCPUProfiling(),
d=b?performance.now():0;this._hasRun=!0;var c=this.GetEventSheetManager(),e=c.GetCurrentEventStackFrame();for(const h of this._events)h.Run(e),c.ClearSol(h.GetSolModifiers()),c.ClearAsyncActionPromises(),a.FlushPendingInstances();e.Reset(null);b&amp;&amp;(this._perfRecord.totalTimeCounter+=performance.now()-d)}}*DebugRun(){if(!this._hasRun){this._hasRun=!0;var a=this._runtime,b=this.GetEventSheetManager(),d=b.GetCurrentEventStackFrame();for(const c of this._events)yield*c.DebugRun(d),b.ClearSol(c.GetSolModifiers()),
b.ClearAsyncActionPromises(),a.FlushPendingInstances();d.Reset(null)}}_Trigger(a,b,d){if(b){const c=b.GetObjectClass();this._TriggerForClass(a,b,c,d);for(const e of c.GetFamilies())this._TriggerForClass(a,b,e,d)}else return this._TriggerForClass(a,b,null,null)}_TriggerForClass(a,b,d,c){d=this._triggers.get(d);if(!d)return!1;c=c?d.behaviors.get(c):d.methodMap;if(!c)return!1;c=c.get(a);if(!c)return!1;a=!1;for(const [e,h]of c)c=this._ExecuteTrigger(b,e,h),a=a||c;return a}*_DebugTrigger(a,b,d){if(b){const c=
b.GetObjectClass();yield*this._DebugTriggerForClass(a,b,c,d);for(const e of c.GetFamilies())yield*this._DebugTriggerForClass(a,b,e,d)}else return yield*this._DebugTriggerForClass(a,b,null,null)}*_DebugTriggerForClass(a,b,d,c){d=this._triggers.get(d);if(!d)return!1;c=c?d.behaviors.get(c):d.methodMap;if(!c)return!1;c=c.get(a);if(!c)return!1;a=!1;for(const [e,h]of c)c=e.DebugCanRunFast()?this._ExecuteTrigger(b,e,h):yield*this._DebugExecuteTrigger(b,e,h),a=a||c;return a}_FastTrigger(a,b,d){b=b.GetObjectClass();
b=this._fastTriggers.get(b);if(!b)return!1;a=b.get(a);if(!a)return!1;d=a.get(d);if(!d)return!1;a=!1;for(let c=0,e=d.length;c&lt;e;++c)b=d[c],b=this._ExecuteTrigger(null,b[0],b[1]),a=a||b;return a}*_DebugFastTrigger(a,b,d){b=b.GetObjectClass();b=this._fastTriggers.get(b);if(!b)return!1;a=b.get(a);if(!a)return!1;d=a.get(d);if(!d)return!1;a=!1;for(let e=0,h=d.length;e&lt;h;++e){var c=d[e];b=c[0];c=c[1];b=b.DebugCanRunFast()?this._ExecuteTrigger(null,b,c):yield*this._DebugExecuteTrigger(null,b,c);a=a||b}return a}_ExecuteTrigger(a,
b,d){const c=this._runtime,e=this._eventSheetManager,h=e.GetCurrentEvent(),k=e.GetEventStack(),m=e.GetTriggerDepth();let p=!1;h&amp;&amp;e.PushCleanSol(h.GetSolModifiersIncludingParents());e.PushCleanSol(b.GetSolModifiersIncludingParents());const q=1&lt;m;q&amp;&amp;e.GetLocalVarStack().Push();const v=k.Push(b);a&amp;&amp;(b.GetConditions()[d].GetObjectClass().GetCurrentSol().SetSinglePicked(a),a.IsInContainer()&amp;&amp;a.SetSiblingsSinglePicked());a=!0;if(b.GetParent()){const x=b.GetTriggerParents();for(let A=0,C=x.length;A&lt;C;++A)if(!x[A].RunPreTrigger(v)){a=
!1;break}}a&amp;&amp;(b.IsOrBlock()?b.RunOrBlockTrigger(v,d):b.Run(v),p=v.GetLastEventTrue());k.Pop();q&amp;&amp;e.GetLocalVarStack().Pop();e.PopSol(b.GetSolModifiersIncludingParents());h&amp;&amp;e.PopSol(h.GetSolModifiersIncludingParents());h||1!==m||(e.ClearAsyncActionPromises(),e.IsFlushingBlocked()||c.FlushPendingInstances());return p}*_DebugExecuteTrigger(a,b,d){const c=this._runtime,e=this._eventSheetManager,h=e.GetCurrentEvent(),k=e.GetEventStack(),m=e.GetTriggerDepth();let p=!1;h&amp;&amp;e.PushCleanSol(h.GetSolModifiersIncludingParents());
e.PushCleanSol(b.GetSolModifiersIncludingParents());const q=1&lt;m;q&amp;&amp;e.GetLocalVarStack().Push();const v=k.Push(b);a&amp;&amp;(b.GetConditions()[d].GetObjectClass().GetCurrentSol().SetSinglePicked(a),a.IsInContainer()&amp;&amp;a.SetSiblingsSinglePicked());a=!0;if(b.GetParent()){const x=b.GetTriggerParents();for(let A=0,C=x.length;A&lt;C;++A)if(!(yield*x[A].DebugRunPreTrigger(v))){a=!1;break}}a&amp;&amp;(b.IsOrBlock()?yield*b.DebugRunOrBlockTrigger(v,d):yield*b.DebugRun(v),p=v.GetLastEventTrue());k.Pop();q&amp;&amp;e.GetLocalVarStack().Pop();
e.PopSol(b.GetSolModifiersIncludingParents());h&amp;&amp;e.PopSol(h.GetSolModifiersIncludingParents());h||1!==m||(e.ClearAsyncActionPromises(),e.IsFlushingBlocked()||c.FlushPendingInstances());return p}_GetPerfRecord(){return this._perfRecord}};"use strict";const C3$jscomp$129=self.C3,EMPTY_ARRAY=[];function NoActions(a,b){return!0}function*DebugNoActions(a,b){return!0}
C3$jscomp$129.EventBlock=class extends C3$jscomp$129.DefendedBase{constructor(a,b,d){super();this._eventSheet=a;this._runtime=a.GetRuntime();this._parent=b;this._scopeParent=null;this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._solModifiers=[];this._solModifiersIncludingParents=[];this._hasElseBlock=this._isTopLevelGroup=this._isSolWriterAfterCnds=this._hasGotSolModifiersIncludingParents=!1;this._isOrBlock=!!d[2];this._isElseBlock=!1;this._triggerParents=null;this._conditions=
[];this._actions=[];this._subEvents=[];this._RunActions=NoActions;this._DebugRunActions=DebugNoActions;this._isInitiallyActive=this._isGroup=!1;this._groupName="";this._isGroupActive=!1;this._perfRecord=this._containedIncludes=null;this._sid=d[4];this._displayNumber=d[5];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=this._runtime.IsDebug()?{isBreakpoint:d[3][0],isBreakable:d[3][1],canRunAllConditionsFast:!1,canRunAllActionsFast:!1,canRunAllSubEventsFast:!1,
canRunSelfFast:!1}:null;this.GetEventSheetManager()._RegisterEventBlock(this);3===d[0]&amp;&amp;this._InitGroup(d[1]);a=0;for(var c of d[6])b=C3$jscomp$129.Condition.Create(this,c,a++),this._conditions.push(b),this._AddSolModifier(b.GetObjectClass());a=0;for(const e of d[7])c=C3$jscomp$129.Action.Create(this,e,a++),this._actions.push(c);if(9===d.length){d=d[8];for(const e of d)this._eventSheet._CreateEvent(e,this,this._subEvents)}this._conditions.length&amp;&amp;(this._isElseBlock=null===this._conditions[0].GetObjectClass()&amp;&amp;
this._conditions[0]._GetFunc()===C3$jscomp$129.Plugins.System.Cnds.Else);0===this._conditions.length&amp;&amp;(this._conditions=EMPTY_ARRAY);0===this._actions.length&amp;&amp;(this._actions=EMPTY_ARRAY);0===this._subEvents.length&amp;&amp;(this._subEvents=EMPTY_ARRAY)}static Create(a,b,d){return C3$jscomp$129.New(C3$jscomp$129.EventBlock,a,b,d)}_InitGroup(a){this._isGroup=!0;this._isGroupActive=this._isInitiallyActive=!!a[0];this._groupName=a[1].toLowerCase();this._containedIncludes=[];this.GetEventSheetManager()._RegisterGroup(this);
this._runtime.IsDebug()&amp;&amp;(this._perfRecord={type:"group",name:a[1],totalTimeCounter:0,children:[]})}_AddContainedInclude(a){this._containedIncludes.push(a)}_AddContainerSolModifierToList(a,b){for(const d of a.GetContainer().objectTypes())b.includes(d)||b.push(d)}_AddSolModifierToList(a,b){if(a)if(b.includes(a)||b.push(a),a.IsFamily())for(const d of a.GetFamilyMembers())d.IsInContainer()&amp;&amp;this._AddContainerSolModifierToList(d,b);else a.IsInContainer()&amp;&amp;this._AddContainerSolModifierToList(a,b)}_AddSolModifier(a){this._AddSolModifierToList(a,
this._solModifiers)}_AddParentSolModifier(a){this._AddSolModifierToList(a,this._solModifiersIncludingParents)}SetAllSolModifiers(){this._solModifiers=this._runtime.GetAllObjectClasses()}_PostInit(a){this._hasElseBlock=!!a;this._IdentifyTopLevelGroup();this._IdentifyTriggerParents();for(const d of this._conditions)d._PostInit();if(0&lt;this._actions.length){a=!1;for(var b of this._actions)b._PostInit(),b.HasReturnType()&amp;&amp;(a=!0);a?(this._RunActions=this._RunActions_ReturnValue,this._DebugRunActions=this._DebugRunActions_ReturnValue):
(this._RunActions=this._RunActions_Fast,this._DebugRunActions=this._DebugRunActions_Fast)}b=this._subEvents;for(let d=0,c=b.length;d&lt;c;++d)a=d&lt;c-1&amp;&amp;b[d+1]instanceof C3$jscomp$129.EventBlock&amp;&amp;b[d+1].IsElseBlock(),b[d]._PostInit(a);this._debugData&amp;&amp;this._UpdateCanRunFast();this._perfRecord&amp;&amp;this._GetPerfRecordParent()._GetPerfRecord().children.push(this._perfRecord)}_GetPerfRecord(){return this._perfRecord}_GetPerfRecordParent(){let a=this.GetParent();for(;a;){if(a.IsGroup())return a;a=a.GetParent()}return this._eventSheet}_UpdateCanRunFast(){const a=
this._debugData;a.canRunAllConditionsFast=this._conditions.every(b=&gt;b.DebugCanRunFast());a.canRunAllActionsFast=this._actions.every(b=&gt;b.DebugCanRunFast());a.canRunAllSubEventsFast=this._subEvents.every(b=&gt;b.DebugCanRunFast());a.canRunSelfFast=a.canRunAllConditionsFast&amp;&amp;a.canRunAllActionsFast&amp;&amp;a.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let a=this;do a._UpdateCanRunFast(),a=a.GetParent();while(a)}_IdentifyTopLevelGroup(){if(this.IsGroup()){var a=this.GetParent();for(this._isTopLevelGroup=
!0;a;){if(!a.IsGroup()){this._isTopLevelGroup=!1;break}a=a.GetParent()}}}_IdentifySolModifiersIncludingParents(){var a=this._runtime.GetAllObjectClasses();if(this._solModifiers===a)this._solModifiersIncludingParents=a;else{this._solModifiersIncludingParents=C3$jscomp$129.cloneArray(this._solModifiers);for(a=this.GetParent();a;){for(var b of a._solModifiers)this._AddParentSolModifier(b);a=a.GetParent()}b=this.GetEventSheetManager();this._solModifiers=b._DeduplicateSolModifierList(this._solModifiers);
this._solModifiersIncludingParents=b._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(this.HasAnyTriggeredCondition()){this._triggerParents=[];for(var a=this.GetParent();a;)this._triggerParents.push(a),a=a.GetParent();this._triggerParents.reverse()}}SetSolWriterAfterCnds(){this._isSolWriterAfterCnds=!0;this._parent&amp;&amp;this._parent.SetSolWriterAfterCnds()}IsSolWriterAfterCnds(){return this._isSolWriterAfterCnds}GetSolModifiers(){return this._solModifiers}GetSolModifiersIncludingParents(){this._hasGotSolModifiersIncludingParents||
(this._hasGotSolModifiersIncludingParents=!0,this._IdentifySolModifiersIncludingParents());return this._solModifiersIncludingParents}HasSolModifier(a){return this._solModifiers.includes(a)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(a){this._scopeParent=a}GetScopeParent(){return this._scopeParent||this._parent}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&amp;&amp;
this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&amp;&amp;this._debugData.isBreakpoint}_SetDebugBreakpoint(a){this._debugData.isBreakpoint=!!a;this._UpdateCanRunFastRecursive()}IsGroup(){return this._isGroup}IsTopLevelGroup(){return this._isTopLevelGroup}IsElseBlock(){return this._isElseBlock}HasElseBlock(){return this._hasElseBlock}GetGroupName(){return this._groupName}IsGroupActive(){return this._isGroupActive}ResetInitialActivation(){this.SetGroupActive(this._isInitiallyActive)}SetGroupActive(a){a=
!!a;if(!this._isGroup)throw Error("not a group");if(this._isGroupActive!==a){this._isGroupActive=a;for(const b of this._containedIncludes)b.UpdateActive();this._containedIncludes.length&amp;&amp;(a=this._runtime.GetCurrentLayout().GetEventSheet())&amp;&amp;a._UpdateDeepIncludes()}}GetSID(){return this._sid}IsOrBlock(){return this._isOrBlock}IsTrigger(){return this._conditions.length&amp;&amp;this._conditions[0].IsTrigger()}IsForFunctionBlock(){return this._scopeParent&amp;&amp;this._scopeParent instanceof C3$jscomp$129.FunctionBlock}HasAnyTriggeredCondition(){return this.IsForFunctionBlock()||
this._conditions.some(a=&gt;a.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(a){a=Math.floor(a);if(0&gt;a||a&gt;=this._conditions.length)throw new RangeError("invalid condition index");return this._conditions[a]}GetConditionByDebugIndex(a){return this.GetConditionAt(a)}IsFirstConditionOfType(a){let b=a.GetIndex();if(0===b)return!0;for(--b;0&lt;=b;--b)if(this._conditions[b].GetObjectClass()===a.GetObjectClass())return!1;return!0}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(a){a=
Math.floor(a);if(0&gt;a||a&gt;=this._actions.length)throw new RangeError("invalid action index");return this._actions[a]}GetActionByDebugIndex(a){a=Math.floor(a);const b=this._actions.find(d=&gt;d.GetDebugIndex()===a);if(!b)throw new RangeError("invalid action debug index");return b}_HasActionIndex(a){a=Math.floor(a);return 0&lt;=a&amp;&amp;a&lt;this._actions.length}GetSubEvents(){return this._subEvents}_GetAllLocalVariablesInScope(){return this._subEvents.filter(a=&gt;a instanceof C3$jscomp$129.EventVariable)}RunPreTrigger(a){a.SetCurrentEvent(this);
let b=!1;const d=this._conditions;for(let c=0,e=d.length;c&lt;e;++c){const h=d[c];a.SetConditionIndex(c);if(h.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(h.Run())b=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?b:!0}RunOrBlockTrigger(a,b){a.SetCurrentEvent(this);this._conditions[b].Run()&amp;&amp;(this._RunActions(a,0)&amp;&amp;this._RunSubEvents(a),a.SetLastEventTrue(!0))}*DebugRunPreTrigger(a){a.SetCurrentEvent(this);let b=!1;const d=this._conditions;for(let c=0,e=d.length;c&lt;
e;++c){const h=d[c];a.SetConditionIndex(c);if(h.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(h.DebugCanRunFast()?h.Run():yield*h.DebugRun())b=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?b:!0}*DebugRunOrBlockTrigger(a,b){a.SetCurrentEvent(this);b=this._conditions[b];if(b.DebugCanRunFast()?b.Run():yield*b.DebugRun())(this.DebugCanRunActionsFast()?this._RunActions(a,0):yield*this._DebugRunActions(a,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?this._RunSubEvents():
yield*this._DebugRunSubEvents()),a.SetLastEventTrue(!0)}Run(a){a.SetCurrentEvent(this);this._isElseBlock||a.SetElseBranchRan(!1);this._isOrBlock?this._RunOrBlock(a):this._RunAndBlock(a)}*DebugRun(a){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;a.SetCurrentEvent(this);this._isElseBlock||a.SetElseBranchRan(!1);this._isOrBlock?yield*this._DebugRunOrBlock(a):yield*this._DebugRunAndBlock(a)}_RunOrBlock(a){const b=this._conditions;let d=0===b.length;for(let e=0,h=b.length;e&lt;h;++e){var c=
b[e];c.IsTrigger()||(a.SetConditionIndex(e),c=c.Run(),d=d||c)}a.SetLastEventTrue(d);d&amp;&amp;(this._RunActions(a,0)&amp;&amp;this._RunSubEvents(a),this._hasElseBlock&amp;&amp;a.SetElseBranchRan(!0))}*_DebugRunOrBlock(a){const b=this._conditions;let d=0===b.length;for(let e=0,h=b.length;e&lt;h;++e){var c=b[e];c.IsTrigger()||(a.SetConditionIndex(e),c=c.DebugCanRunFast()?c.Run():yield*c.DebugRun(),d=d||c)}a.SetLastEventTrue(d);d&amp;&amp;((this.DebugCanRunActionsFast()?this._RunActions(a,0):yield*this._DebugRunActions(a,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?
this._RunSubEvents():yield*this._DebugRunSubEvents()),this._hasElseBlock&amp;&amp;a.SetElseBranchRan(!0))}_RunAndBlock(a){const b=this._conditions;for(let d=0,c=b.length;d&lt;c;++d){const e=b[d];a.SetConditionIndex(d);if(!e.Run()){a.SetLastEventTrue(!1);return}}a.SetLastEventTrue(!0);this._RunActions(a,0)&amp;&amp;this._RunSubEvents(a);a.GetLastEventTrue()&amp;&amp;this._hasElseBlock&amp;&amp;a.SetElseBranchRan(!0)}*_DebugRunAndBlock(a){const b=this._conditions;for(let d=0,c=b.length;d&lt;c;++d){const e=b[d];a.SetConditionIndex(d);if(e.DebugCanRunFast()?
!e.Run():!(yield*e.DebugRun())){a.SetLastEventTrue(!1);return}}a.SetLastEventTrue(!0);(this.DebugCanRunActionsFast()?this._RunActions(a,0):yield*this._DebugRunActions(a,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents());a.GetLastEventTrue()&amp;&amp;this._hasElseBlock&amp;&amp;a.SetElseBranchRan(!0)}_RunActions_Fast(a,b){const d=this._actions;for(let c=b,e=d.length;c&lt;e;++c)b=d[c],a.SetActionIndex(c),b.Run();return!0}*_DebugRunActions_Fast(a,b){const d=this._actions;for(let c=
b,e=d.length;c&lt;e;++c)b=d[c],a.SetActionIndex(c),b.DebugCanRunFast()?b.Run():yield*b.DebugRun();return!0}_RunActions_ReturnValue(a,b){const d=this.GetEventSheetManager(),c=this._actions;for(let e=b,h=c.length;e&lt;h;++e){b=c[e];a.SetActionIndex(e);const k=b.Run();if(b.CanBailOut()&amp;&amp;!0===k)return!1;b.IsAsync()&amp;&amp;k instanceof Promise&amp;&amp;d.AddAsyncActionPromise(k)}return!0}*_DebugRunActions_ReturnValue(a,b){const d=this.GetEventSheetManager(),c=this._actions;for(let e=b,h=c.length;e&lt;h;++e){b=c[e];a.SetActionIndex(e);
let k;k=b.DebugCanRunFast()?b.Run():yield*b.DebugRun();if(b.CanBailOut()&amp;&amp;!0===k)return!1;b.IsAsync()&amp;&amp;k instanceof Promise&amp;&amp;d.AddAsyncActionPromise(k)}return!0}_ResumeActionsAndSubEvents(a){this._RunActions(a,a.GetActionIndex())&amp;&amp;this._RunSubEvents()}*_DebugResumeActionsAndSubEvents(a){if(yield*this._DebugRunActions(a,a.GetActionIndex()))yield*this._DebugRunSubEvents()}_RunSubEvents(){if(this._subEvents.length){var a=this.IsGroup()&amp;&amp;this._runtime.IsCPUProfiling(),b=a?performance.now():0,d=this._eventStack,
c=d.Push(this);this._isSolWriterAfterCnds?this._RunSubEvents_SolWriterAfterCnds(c):this._RunSubEvents_Fast(c);d.Pop();a&amp;&amp;(this._perfRecord.totalTimeCounter+=performance.now()-b)}}_RunSubEvents_SolWriterAfterCnds(a){const b=this._isGroup,d=this._isTopLevelGroup,c=this.GetEventSheetManager(),e=this._subEvents;for(let h=0,k=e.length,m=k-1;h&lt;k;++h){const p=e[h],q=p.GetSolModifiers(),v=!d||!b&amp;&amp;h&lt;m;v&amp;&amp;c.PushCopySol(q);p.Run(a);v?c.PopSol(q):c.ClearSol(q)}}_RunSubEvents_Fast(a){const b=this._subEvents;for(let d=
0,c=b.length;d&lt;c;++d)b[d].Run(a)}*_DebugRunSubEvents(){if(this._subEvents.length){var a=this._eventStack,b=a.Push(this);this._isSolWriterAfterCnds?yield*this._DebugRunSubEvents_SolWriterAfterCnds(b):yield*this._DebugRunSubEvents_Fast(b);a.Pop()}}*_DebugRunSubEvents_SolWriterAfterCnds(a){const b=this._isGroup,d=this._isTopLevelGroup,c=this.GetEventSheetManager(),e=this._subEvents;for(let h=0,k=e.length,m=k-1;h&lt;k;++h){const p=e[h],q=p.GetSolModifiers(),v=!d||!b&amp;&amp;h&lt;m;v&amp;&amp;c.PushCopySol(q);yield*p.DebugRun(a);
v?c.PopSol(q):c.ClearSol(q)}}*_DebugRunSubEvents_Fast(a){const b=this._subEvents;for(let d=0,c=b.length;d&lt;c;++d)yield*b[d].DebugRun(a)}Retrigger(a,b){b.ResetQuick();const d=this._conditions;if(!this.IsOrBlock())for(let c=a.GetConditionIndex()+1,e=d.length;c&lt;e;++c)if(a=d[c],b.SetConditionIndex(c),!a.Run())return!1;this._RunActions(b,0)&amp;&amp;this._RunSubEvents(b);return!0}*DebugRetrigger(a,b){b.ResetQuick();const d=this._conditions;if(!this.IsOrBlock())for(let c=a.GetConditionIndex()+1,e=d.length;c&lt;e;++c)if(a=
d[c],b.SetConditionIndex(c),a.DebugCanRunFast()?!a.Run():!(yield*a.DebugRun()))return!1;(this.DebugCanRunActionsFast()?this._RunActions(b,0):yield*this._DebugRunActions(b,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents());return!0}DebugCanRunFast(){return!this.IsDebugBreakpoint()&amp;&amp;!this._runtime.DebugBreakNext()&amp;&amp;this._debugData.canRunSelfFast}DebugCanRunActionsFast(){return!this._runtime.DebugBreakNext()&amp;&amp;this._debugData.canRunAllActionsFast}DebugCanRunSubEventsFast(){return!this._runtime.DebugBreakNext()&amp;&amp;
this._debugData.canRunAllSubEventsFast}_CheckParentsOKToRun(a){if(this.GetParent()){const b=this.GetTriggerParents();for(let d=0,c=b.length;d&lt;c;++d)if(!b[d].RunPreTrigger(a))return!1}return!0}*_DebugCheckParentsOKToRun(a){if(this.GetParent()){const b=this.GetTriggerParents();for(let d=0,c=b.length;d&lt;c;++d)if(!(yield*b[d].DebugRunPreTrigger(a)))return!1}return!0}_EvaluateFunctionCallParameters(a,b,d){0&lt;b.length?d?(b=b.map(c=&gt;c.Get(0)),a.GetLocalVarStack().Push(),this._scopeParent.SetFunctionParameters(b)):
this._scopeParent.EvaluateFunctionParameters(b):d&amp;&amp;a.GetLocalVarStack().Push()}RunAsFunctionCall(a,b,d){let c,e;const h=0&lt;a.length,k=this._eventStack,m=this._runtime.GetEventSheetManager(),p=1&lt;m._IncTriggerDepth();this._EvaluateFunctionCallParameters(m,b,p);h&amp;&amp;(d?m.PushCopySol(a):m.PushCleanSol(a));b=k.Push(this);this._CheckParentsOKToRun(b)&amp;&amp;(b.SetCurrentEvent(this),(d=this._scopeParent.IsAsync())&amp;&amp;([e,c]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(b),d&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(e));
k.Pop();p&amp;&amp;m.GetLocalVarStack().Pop();h&amp;&amp;m.PopSol(a);m._DecTriggerDepth();return c}*DebugRunAsFunctionCall(a,b,d){let c,e;if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const h=0&lt;a.length,k=this._eventStack,m=this._runtime.GetEventSheetManager(),p=1&lt;m._IncTriggerDepth();this._EvaluateFunctionCallParameters(m,b,p);h&amp;&amp;(d?m.PushCopySol(a):m.PushCleanSol(a));b=k.Push(this);if(yield*this._DebugCheckParentsOKToRun(b))b.SetCurrentEvent(this),(d=this._scopeParent.IsAsync())&amp;&amp;([e,c]=
this._scopeParent.StartAsyncFunctionCall()),yield*this._DebugRunAndBlock(b),d&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(e);k.Pop();p&amp;&amp;m.GetLocalVarStack().Pop();h&amp;&amp;m.PopSol(a);m._DecTriggerDepth();return c}RunAsMappedFunctionCall(a,b){const d=this.GetSolModifiersIncludingParents(),c=0&lt;d.length,e=this._eventStack,h=this._runtime.GetEventSheetManager(),k=1&lt;h._IncTriggerDepth();k&amp;&amp;h.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(a);c&amp;&amp;(b?h.PushCopySol(d):h.PushCleanSol(d));a=
e.Push(this);this._CheckParentsOKToRun(a)&amp;&amp;(a.SetCurrentEvent(this),this._RunAndBlock(a));e.Pop();k&amp;&amp;h.GetLocalVarStack().Pop();c&amp;&amp;h.PopSol(d);h._DecTriggerDepth()}*DebugRunAsMappedFunctionCall(a,b){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const d=this.GetSolModifiersIncludingParents(),c=0&lt;d.length,e=this._eventStack,h=this._runtime.GetEventSheetManager(),k=1&lt;h._IncTriggerDepth();k&amp;&amp;h.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(a);c&amp;&amp;(b?h.PushCopySol(d):
h.PushCleanSol(d));a=e.Push(this);if(yield*this._DebugCheckParentsOKToRun(a))a.SetCurrentEvent(this),yield*this._DebugRunAndBlock(a);e.Pop();k&amp;&amp;h.GetLocalVarStack().Pop();c&amp;&amp;h.PopSol(d);h._DecTriggerDepth()}RunAsExpressionFunctionCall(a,b,d,c,...e){let h,k;const m=0&lt;a.length,p=this._runtime,q=this._eventStack,v=p.GetEventSheetManager(),x=1&lt;v._IncTriggerDepth();x&amp;&amp;v.GetLocalVarStack().Push();0&lt;e.length&amp;&amp;this._scopeParent.SetFunctionParameters(e);m&amp;&amp;(b?v.PushCopySol(a):v.PushCleanSol(a));b=q.Push(this);
b.InitCallFunctionExpression(d,c);q.PushExpFunc(b);p.SetDebuggingEnabled(!1);this._CheckParentsOKToRun(b)&amp;&amp;(b.SetCurrentEvent(this),(d=this._scopeParent.IsAsync())&amp;&amp;([k,h]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(b),d&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(k));p.SetDebuggingEnabled(!0);q.Pop();q.PopExpFunc();x&amp;&amp;v.GetLocalVarStack().Pop();m&amp;&amp;v.PopSol(a);v._DecTriggerDepth();return h||b.GetFunctionReturnValue()}};"use strict";
const C3$jscomp$130=self.C3,EMPTY_SOL_MODIFIERS=[];let hadUserScriptException=!1;
C3$jscomp$130.EventScript=class extends C3$jscomp$130.DefendedBase{constructor(a,b,d){super();const c=a.GetRuntime(),e=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=e;this._runtime=a.GetRuntime();this._parent=b;this._func=c.GetObjectReference(d[1]);this._displayNumber=d[2];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=c.IsDebug()?{isBreakpoint:d[3][0],isBreakable:d[3][1]}:null}static Create(a,b,d){return C3$jscomp$130.New(C3$jscomp$130.EventScript,
a,b,d)}_PostInit(){const a=this._func,b=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this);this._func=a.bind(null,this._runtime.GetIRuntime(),b)}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetEventSheet(){return this._eventSheet}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&amp;&amp;this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&amp;&amp;this._debugData.isBreakpoint}_SetDebugBreakpoint(a){this._debugData.isBreakpoint=
!!a}IsElseBlock(){return!1}GetSolModifiers(){return EMPTY_SOL_MODIFIERS}GetSolModifiersIncludingParents(){return this._parent?this._parent.GetSolModifiersIncludingParents():EMPTY_SOL_MODIFIERS}Run(a){a.SetCurrentEvent(this);this._eventSheetManager.AddAsyncActionPromise(this._RunUserScript())}async _RunUserScript(){try{await this._func()}catch(a){console.error(`Unhandled exception running script %c${this.GetEventSheet().GetName()}, event ${this.GetDisplayNumber()}:`,"font-size: 1.2em; font-weight: bold;",
a),self.C3Debugger&amp;&amp;self.C3Debugger._SetLastErrorScript(this),hadUserScriptException||(console.info("%cTip:%c run this to highlight in Construct the last script that had an error: %cgoToLastErrorScript()","font-weight: bold; text-decoration: underline","","font-weight: bold"),hadUserScriptException=!0)}}*DebugRun(a){a.SetCurrentEvent(this);if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;this.Run(a)}DebugCanRunFast(){return!this.IsDebugBreakpoint()&amp;&amp;!this._runtime.DebugBreakNext()}static HadUserScriptException(){return hadUserScriptException}static SetHadUserScriptException(){hadUserScriptException=
!0}};"use strict";const C3$jscomp$131=self.C3;
C3$jscomp$131.FunctionBlock=class extends C3$jscomp$131.DefendedBase{constructor(a,b,d){super();this._eventSheet=a;this._runtime=a.GetRuntime();this._parent=b;const c=d[1];this._functionName=c[0];this._returnType=c[1];this._functionParameters=c[2].map(e=&gt;C3$jscomp$131.EventVariable.Create(a,this,e));this._isEnabled=c[3];this._innerLocalVariables=[];this._isCopyPicked=c[5];this._isAsync=c[4];this._nextAsyncId=0;this._currentAsyncId=-1;this._asyncMap=new Map;this._eventBlock=C3$jscomp$131.EventBlock.Create(a,
b,d);this._eventBlock._SetScopeParent(this)}static Create(a,b,d){return C3$jscomp$131.New(C3$jscomp$131.FunctionBlock,a,b,d)}_PostInit(){for(const a of this._functionParameters)a._PostInit();this._eventBlock._PostInit(!1)}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}_RegisterLocalVariable(a){this._innerLocalVariables.push(a)}_GetAllInnerLocalVariables(){return this._innerLocalVariables}EvaluateFunctionParameters(a){const b=
this._functionParameters;for(let d=0,c=b.length;d&lt;c;++d)b[d].SetValue(a[d].Get(0))}SetFunctionParameters(a){const b=this._functionParameters;for(let d=0,c=b.length;d&lt;c;++d)b[d].SetValue(a[d])}CaptureFunctionParameters(){return this._functionParameters.map(a=&gt;a.GetValue())}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetFunctionName(){return this._functionName}GetReturnType(){return this._returnType}IsEnabled(){return this._isEnabled}GetDefaultReturnValue(){switch(this._returnType){case 0:return null;
case 2:return"";default:return 0}}GetEventBlock(){return this._eventBlock}IsCopyPicked(){return this._isCopyPicked}IsAsync(){return this._isAsync}StartAsyncFunctionCall(){const a=this._nextAsyncId++;this._currentAsyncId=a;let b;const d=new Promise(c=&gt;b=c);this._asyncMap.set(a,{resolve:b,pauseCount:0});return[a,d]}MaybeFinishAsyncFunctionCall(a){const b=this._asyncMap.get(a);0===b.pauseCount&amp;&amp;(b.resolve(),this._asyncMap.delete(a));this._currentAsyncId=-1}PauseCurrentAsyncFunction(){this._asyncMap.get(this._currentAsyncId).pauseCount++;
return this._currentAsyncId}ResumeAsyncFunction(a){this._currentAsyncId=a;this._asyncMap.get(a).pauseCount--}};"use strict";const C3$jscomp$132=self.C3,EMPTY_SOL_MODIFIERS$jscomp$1=[];
C3$jscomp$132.EventVariable=class extends C3$jscomp$132.DefendedBase{constructor(a,b,d){super();const c=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=c;this._runtime=a.GetRuntime();this._parent=b;this._localVarStack=c.GetLocalVarStack();this._name=d[1];this._type=d[2];this._initialValue=d[3];this._isStatic=!!d[4];this._isConstant=!!d[5];this._isFunctionParameter=b instanceof C3$jscomp$132.FunctionBlock;this._sid=d[6];this._jsPropName=this._runtime.GetJsPropName(d[8]);this._scriptSetter=
e=&gt;this.SetValue(e);this._scriptGetter=()=&gt;this.GetValue();this._hasSingleValue=!this._parent||this._isStatic||this._isConstant;this._value=this._initialValue;this._localIndex=-1;this.IsBoolean()&amp;&amp;(this._value=this._value?1:0);!this.IsLocal()||this.IsStatic()||this.IsConstant()||(this._localIndex=c._GetNextLocalVarIndex(this));c._RegisterEventVariable(this)}static Create(a,b,d){return C3$jscomp$132.New(C3$jscomp$132.EventVariable,a,b,d)}_PostInit(){if(this.IsLocal()&amp;&amp;!this.IsStatic()&amp;&amp;!this.IsConstant()&amp;&amp;
!this.IsFunctionParameter()){const a=this._eventSheetManager.FindFirstFunctionBlockParent(this);a&amp;&amp;a._RegisterLocalVariable(this)}}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}GetScopeParent(){return this.GetParent()}IsGlobal(){return!this.GetParent()}IsLocal(){return!this.IsGlobal()}IsFunctionParameter(){return this._isFunctionParameter}IsStatic(){return this._isStatic}IsConstant(){return this._isConstant}IsNumber(){return 0===this._type}IsString(){return 1===
this._type}IsBoolean(){return 2===this._type}IsElseBlock(){return!1}GetSID(){return this._sid}GetInitialValue(){return this._initialValue}GetSolModifiers(){return EMPTY_SOL_MODIFIERS$jscomp$1}Run(a){!this.IsLocal()||this.IsStatic()||this.IsConstant()||this.SetValue(this.GetInitialValue())}DebugCanRunFast(){return!0}*DebugRun(a){this.Run(a)}SetValue(a){this.IsNumber()?"number"!==typeof a&amp;&amp;(a=parseFloat(a)):this.IsString()?"string"!==typeof a&amp;&amp;(a=a.toString()):this.IsBoolean()&amp;&amp;(a=a?1:0);this._hasSingleValue?
this._value=a:this._localVarStack.GetCurrent()[this._localIndex]=a}GetValue(){return this._hasSingleValue?this._value:this._localVarStack.GetCurrent()[this._localIndex]}GetTypedValue(){let a=this.GetValue();this.IsBoolean()&amp;&amp;(a=!!a);return a}ResetToInitialValue(){this._value=this._initialValue}_GetScriptInterfaceDescriptor(){return{configurable:!1,enumerable:!0,get:this._scriptGetter,set:this._scriptSetter}}};"use strict";const C3$jscomp$133=self.C3,EMPTY_SOL_MODIFIERS$jscomp$2=[];
C3$jscomp$133.EventInclude=class extends C3$jscomp$133.DefendedBase{constructor(a,b,d){super();const c=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=c;this._runtime=a.GetRuntime();this._parent=b;this._includeSheet=null;this._includeSheetName=d[1];this._isActive=!0}static Create(a,b,d){return C3$jscomp$133.New(C3$jscomp$133.EventInclude,a,b,d)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName);this._eventSheet._AddShallowInclude(this);
let a=this.GetParent();for(;a;)a instanceof C3$jscomp$133.EventBlock&amp;&amp;a.IsGroup()&amp;&amp;a._AddContainedInclude(this),a=a.GetParent();this.UpdateActive();this._runtime.IsDebug()&amp;&amp;this._eventSheet._GetPerfRecord().children.push(this._includeSheet._GetPerfRecord())}GetParent(){return this._parent}GetSolModifiers(){return EMPTY_SOL_MODIFIERS$jscomp$2}GetIncludeSheet(){return this._includeSheet}Run(a){a=!!this.GetParent();const b=this._runtime.GetAllObjectClasses();a&amp;&amp;this._eventSheetManager.PushCleanSol(b);
this._includeSheet.Run();a&amp;&amp;this._eventSheetManager.PopSol(b)}*DebugRun(a){a=!!this.GetParent();const b=this._runtime.GetAllObjectClasses();a&amp;&amp;this._eventSheetManager.PushCleanSol(b);yield*this._includeSheet.DebugRun();a&amp;&amp;this._eventSheetManager.PopSol(b)}DebugCanRunFast(){return!1}IsActive(){return this._isActive}UpdateActive(){let a=this.GetParent();for(;a;){if(a instanceof C3$jscomp$133.EventBlock&amp;&amp;a.IsGroup()&amp;&amp;!a.IsGroupActive()){this._isActive=!1;return}a=a.GetParent()}this._isActive=!0}};"use strict";
const C3$jscomp$134=self.C3;C3$jscomp$134.ExpNode=class extends C3$jscomp$134.DefendedBase{constructor(a){super();this._owner=a;this._runtime=a.GetRuntime()}_PostInit(){}static CreateNode(a,b){return C3$jscomp$134.New([BehaviorExpressionNode,ObjectExpressionNode,InstVarExpressionNode,EventVarExpNode,SystemExpressionExpNode,CallFunctionExpressionExpNode][b[0]],a,b)}};
class SystemExpressionExpNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._systemPlugin=this._runtime.GetSystemPlugin();this._func=this._runtime.GetObjectReference(b[1]);this._func!==C3$jscomp$134.Plugins.System.Exps.random&amp;&amp;this._func!==C3$jscomp$134.Plugins.System.Exps.choose||this._owner.SetVariesPerInstance()}GetBoundMethod(){return this._systemPlugin._GetBoundACEMethod(this._func,this._systemPlugin)}}
class CallFunctionExpressionExpNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._functionBlock=null;this._functionName=b[1];this._owner.SetVariesPerInstance()}_PostInit(){const a=this._runtime.GetEventSheetManager();this._functionBlock=a.GetFunctionBlockByName(this._functionName);this._functionName=null;const b=this._owner.GetEventBlock(),d=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...(new Set([...b.GetSolModifiersIncludingParents(),...d.GetSolModifiersIncludingParents()]))];
this._combinedSolModifiers=a._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const a=this._functionBlock;if(a.IsEnabled()){const d=a.GetEventBlock();return C3$jscomp$134.EventBlock.prototype.RunAsExpressionFunctionCall.bind(d,this._combinedSolModifiers,a.IsCopyPicked(),a.GetReturnType(),a.GetDefaultReturnValue())}const b=a.GetDefaultReturnValue();return()=&gt;b}}function WrapIndex(a,b){if(a&gt;=b)return a%b;0&gt;a&amp;&amp;(a&lt;=-b&amp;&amp;(a%=b),0&gt;a&amp;&amp;(a+=b));return a}
class ObjectExpressionNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._func=this._runtime.GetObjectReference(b[2]);this._returnsString=!!b[3];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}GetBoundMethod(){return this._objectClass.GetPlugin()._GetBoundACEMethod(this._func,this._objectClass.GetSingleGlobalInstance().GetSdkInstance())}ExpObject(...a){const b=
this._objectClass,d=b.GetCurrentSol().GetExpressionInstances();var c=d.length;if(0===c)return this._returnsString?"":0;c=WrapIndex(this._owner.GetSolIndex(),c);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(b);return this._func.apply(d[c].GetSdkInstance(),a)}ExpObject_InstExpr(a,...b){const d=this._objectClass,c=d.GetInstances(),e=c.length;if(0===e)return this._returnsString?"":0;a=WrapIndex(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(d);return this._func.apply(c[a].GetSdkInstance(),
b)}}
class InstVarExpressionNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._varIndex=b[3];this._returnsString=!!b[2];this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const a=this._objectClass.GetCurrentSol().GetExpressionInstances();var b=a.length;if(0===b)return this._returnsString?"":0;b=WrapIndex(this._owner.GetSolIndex(),b);return a[b]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){var a=this._objectClass,
b=a.GetCurrentSol().GetExpressionInstances(),d=b.length;if(0===d)return this._returnsString?"":0;d=WrapIndex(this._owner.GetSolIndex(),d);b=b[d];a=b.GetObjectClass().GetFamilyInstanceVariableOffset(a.GetFamilyIndex());return b._GetInstanceVariableValueUnchecked(this._varIndex+a)}ExpInstVar_InstExpr(a){const b=this._objectClass;var d=b.GetInstances();const c=d.length;if(0===c)return this._returnsString?"":0;a=WrapIndex(a,c);d=d[a];a=0;b.IsFamily()&amp;&amp;(a=d.GetObjectClass().GetFamilyInstanceVariableOffset(b.GetFamilyIndex()));
return d._GetInstanceVariableValueUnchecked(this._varIndex+a)}}
class BehaviorExpressionNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._objectClass=this._runtime.GetObjectClassByIndex(b[1]);this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]);this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2]);this._func=this._runtime.GetObjectReference(b[3]);this._returnsString=!!b[4];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...a){const b=this._objectClass;
var d=b.GetCurrentSol().GetExpressionInstances(),c=d.length;if(0===c)return this._returnsString?"":0;c=WrapIndex(this._owner.GetSolIndex(),c);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(b);d=d[c];c=0;b.IsFamily()&amp;&amp;(c=d.GetObjectClass().GetFamilyBehaviorOffset(b.GetFamilyIndex()));return this._func.apply(d.GetBehaviorInstances()[this._behaviorIndex+c].GetSdkInstance(),a)}ExpBehavior_InstExpr(a,...b){const d=this._objectClass;var c=d.GetInstances();const e=c.length;if(0===e)return this._returnsString?
"":0;a=WrapIndex(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(d);c=c[a];a=0;d.IsFamily()&amp;&amp;(a=c.GetObjectClass().GetFamilyBehaviorOffset(d.GetFamilyIndex()));return this._func.apply(c.GetBehaviorInstances()[this._behaviorIndex+a].GetSdkInstance(),b)}}
class EventVarExpNode extends C3$jscomp$134.ExpNode{constructor(a,b){super(a);this._eventVar=null;this._eventVarSid=b[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetVar(){return this._eventVar}}"use strict";const C3$jscomp$135=self.C3;
C3$jscomp$135.Parameter=class extends C3$jscomp$135.DefendedBase{constructor(a,b,d){super();this._owner=a;this._index=d;this._type=b;this.Get=null;this._isConstant=this._variesPerInstance=!1}static Create(a,b,d){const c=b[0];return C3$jscomp$135.New([ExpressionParameter,StringExpressionParameter,FileParameter,ComboParameter,ObjectParameter,LayerExpressionParameter,LayoutParameter,ExpressionParameter,ComboParameter,ComboParameter,InstVarParameter,EventVarParameter,FileParameter,VariadicParameter,StringExpressionParameter,
TimelineParameter,BooleanParameter,FunctionParameter,EaseParameter,TilemapBrushParameter,TemplateExpressionParameter][c],a,c,d,b)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=!0}_MaybeVaryFor(a){this._variesPerInstance||!a||a.GetPlugin().IsSingleGlobal()||(this._variesPerInstance=!0)}VariesPerInstance(){return this._variesPerInstance}GetIndex(){return this._index}GetRuntime(){return this._owner.GetRuntime()}GetEventBlock(){return this._owner.GetEventBlock()}IsConstant(){return this._isConstant}};
function GetExpressionFunc(a){a=self.C3_ExpressionFuncs[a];if(!a)throw Error("invalid expression number");return a}
class ExpressionParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._solIndex=0;a=c[1];this._expressionNumber=a[0];this._numberedNodes=[];this._expressionFunc=null;for(let e=1,h=a.length;e&lt;h;++e)this._numberedNodes.push(C3$jscomp$135.ExpNode.CreateNode(this,a[e]));this._numberedNodes.length?this.Get=this.GetExpression:(this.Get=GetExpressionFunc(this._expressionNumber),this._isConstant=!0)}_GetNode(a){if(0&gt;a||a&gt;=this._numberedNodes.length)throw new RangeError("invalid numbered node");
return this._numberedNodes[a]}_PostInit(){for(var a of this._numberedNodes)a._PostInit();a=GetExpressionFunc(this._expressionNumber);this._expressionFunc=this._numberedNodes.length?a(this):a}GetSolIndex(){return this._solIndex}GetExpression(a){this._solIndex=a;return this._expressionFunc()}}
class StringExpressionParameter extends ExpressionParameter{constructor(a,b,d,c){super(a,b,d,c);this.Get=this.GetStringExpression;14===b&amp;&amp;(this.GetEventBlock().SetAllSolModifiers(),this._owner instanceof C3$jscomp$135.Action&amp;&amp;this.GetEventBlock().SetSolWriterAfterCnds())}GetStringExpression(a){this._solIndex=a;a=this._expressionFunc();return"string"===typeof a?a:""}_GetFastTriggerValue(){return GetExpressionFunc(this._expressionNumber)()}}
class LayerExpressionParameter extends ExpressionParameter{constructor(a,b,d,c){super(a,b,d,c);this.Get=this.GetLayer;this._isConstant=!1}GetLayer(a){this._solIndex=a;a=this._expressionFunc();return this.GetRuntime().GetCurrentLayout().GetLayer(a)}}class ComboParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._combo=c[1];this.Get=this.GetCombo;this._isConstant=!0}GetCombo(){return this._combo}}
class BooleanParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._bool=c[1];this.Get=this.GetBoolean;this._isConstant=!0}GetBoolean(){return this._bool}}
class ObjectParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._objectClass=this.GetRuntime().GetObjectClassByIndex(c[1]);this.Get=this.GetObjectClass;a=this.GetEventBlock();a._AddSolModifier(this._objectClass);this._owner instanceof C3$jscomp$135.Action?a.SetSolWriterAfterCnds():a.GetParent()&amp;&amp;a.GetParent().SetSolWriterAfterCnds();this._isConstant=!0}GetObjectClass(){return this._objectClass}}
class LayoutParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(c[1]);this.Get=this.GetLayout;this._isConstant=!0}GetLayout(){return this._layout}}class TimelineParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(c[1]);this.Get=this.GetTimeline;this._isConstant=!0}GetTimeline(){return this._timeline}}
class FileParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._fileInfo=c[1];this.Get=this.GetFile;this._isConstant=!0}GetFile(){return this._fileInfo}}
class InstVarParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._instVarIndex=c[1];(a=this._owner.GetObjectClass())&amp;&amp;a.IsFamily()?(this.Get=this.GetFamilyInstanceVariable,this.SetVariesPerInstance()):(this.Get=this.GetInstanceVariable,this._isConstant=!0)}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(a){a=a||0;const b=this._owner.GetObjectClass();var d=b.GetCurrentSol();const c=d.GetInstances();if(c.length)a=c[a%c.length].GetObjectClass();
else if(d.HasAnyElseInstances())d=d.GetElseInstances(),a=d[a%d.length].GetObjectClass();else if(0&lt;b.GetInstanceCount())d=b.GetInstances(),a=d[a%d.length].GetObjectClass();else return 0;return this._instVarIndex+a.GetFamilyInstanceVariableOffset(b.GetFamilyIndex())}}
class EventVarParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._eventVarSid=c[1];this._eventVar=null;this.Get=this.GetEventVariable;this._isConstant=!0}_PostInit(){this._eventVar=this.GetRuntime().GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetEventVariable(){return this._eventVar}}
class FunctionParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._functionBlockName=c[1];this._functionBlock=null;this.Get=this.GetFunction;this._isConstant=!0}_PostInit(){this._functionBlock=this.GetRuntime().GetEventSheetManager().GetFunctionBlockByName(this._functionBlockName);this._functionBlockName=null}GetFunction(){return this._functionBlock}}
class VariadicParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._subParams=[];this._variadicRet=[];this._isConstant=!0;for(let e=1,h=c.length;e&lt;h;++e)a=C3$jscomp$135.Parameter.Create(this._owner,c[e],0),this._subParams.push(a),this._variadicRet.push(0),a.IsConstant()||(this._isConstant=!1);this.Get=this.GetVariadic}_PostInit(){for(const a of this._subParams)a._PostInit()}GetVariadic(){const a=this._subParams,b=this._variadicRet;for(let d=0,c=a.length;d&lt;c;++d)b[d]=a[d].Get(0);
return b}}class EaseParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._easeIndex=c[1];this.Get=this.GetEase;this._isConstant=!0}GetEase(){return this._easeIndex}}class TilemapBrushParameter extends C3$jscomp$135.Parameter{constructor(a,b,d,c){super(a,b,d);this._brushIndex=c[1];this.Get=this.GetTilemapBrush;this._isConstant=!0}GetTilemapBrush(){return this._brushIndex}}
class TemplateExpressionParameter extends ExpressionParameter{constructor(a,b,d,c){super(a,b,d,c);this.Get=this.GetTemplateName;this._isConstant=!1}GetTemplateName(){return this._expressionFunc()}}"use strict";const C3$jscomp$136=self.C3;function EvalParams(a,b){for(let d=0,c=a.length;d&lt;c;++d)b[d]=a[d].Get(0)}const EMPTY_PARAMS_ARRAY=[],noop$jscomp$1=function(){};
C3$jscomp$136.Condition=class extends C3$jscomp$136.DefendedBase{constructor(a,b,d){super();this._eventBlock=a;this._runtime=a.GetRuntime();this._index=d;this._func=this._runtime.GetObjectReference(b[1]);this._isTrigger=0&lt;b[3];this._isFastTrigger=2===b[3];this._isLooping=!!b[4];this._isInverted=!!b[5];this._isStatic=!!b[6];this._sid=b[7];this._isInOrBlock=this._eventBlock.IsOrBlock();this._behaviorType=this._objectClass=null;this._behaviorIndex=-1;this._systemPlugin=null;this.DebugRun=this.Run=noop$jscomp$1;
this._parameters=[];this._results=[];this._anyParamVariesPerInstance=!1;this._unsavedData=this._savedData=null;this._debugData=this._runtime.IsDebug()?{isBreakpoint:b[8][0],canDebug:b[8][1]}:null;-1===b[0]?this._systemPlugin=this._runtime.GetSystemPlugin():(this._objectClass=this._runtime.GetObjectClassByIndex(b[0]),b[2]&amp;&amp;(this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2])),this._eventBlock.GetParent()&amp;&amp;this._eventBlock.GetParent().SetSolWriterAfterCnds());
if(10===b.length){a=b[9];for(let c of a)this._parameters.push(C3$jscomp$136.Parameter.Create(this,c,this._parameters.length)),this._results.push(0)}0===this._parameters.length&amp;&amp;(this._results=this._parameters=EMPTY_PARAMS_ARRAY);this._eventBlock.GetEventSheetManager()._RegisterCondition(this)}static Create(a,b,d){return C3$jscomp$136.New(C3$jscomp$136.Condition,a,b,d)}_PostInit(){for(const a of this._parameters)a._PostInit(),a.VariesPerInstance()&amp;&amp;(this._anyParamVariesPerInstance=!0);this._isFastTrigger?
(this.Run=this._RunFastTrigger,this.DebugRun=this._DebugRunFastTrigger):this._systemPlugin?(this._SetSystemRunMethod(),this.DebugRun=this._DebugRunSystem):this._objectClass.GetPlugin().IsSingleGlobal()?(this._SetSingleGlobalRunMethod(),this.DebugRun=this._DebugRunSingleGlobal):this._isStatic?(this.Run=this._RunStatic,this.DebugRun=this._DebugRunStatic):(this.Run=this._RunObject,this.DebugRun=this._DebugRunObject)}_SetSystemRunMethod(){this._SetRunMethodForBoundFunc(this._systemPlugin,this._systemPlugin,
this._RunSystem)}_SetSingleGlobalRunMethod(){const a=this._objectClass.GetPlugin(),b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(a,b,this._RunSingleGlobal)}_SetRunMethodForBoundFunc(a,b,d){const c=this._func,e=this._isInverted,h=this._parameters;if(0===h.length){const k=a._GetBoundACEMethod(c,b);this.Run=e?function(){return C3$jscomp$136.xor(k(),e)}:k}else if(1===h.length){const k=h[0];if(!e&amp;&amp;k.IsConstant())this.Run=a._GetBoundACEMethod_1param(c,b,k.Get(0));
else{const m=a._GetBoundACEMethod(c,b);this.Run=function(){return C3$jscomp$136.xor(m(k.Get(0)),e)}}}else if(2===h.length){const k=h[0],m=h[1];if(!e&amp;&amp;k.IsConstant()&amp;&amp;m.IsConstant())this.Run=a._GetBoundACEMethod_2params(c,b,k.Get(0),m.Get(0));else{const p=a._GetBoundACEMethod(c,b);this.Run=function(){return C3$jscomp$136.xor(p(k.Get(0),m.Get(0)),e)}}}else if(3===h.length){const k=h[0],m=h[1],p=h[2];if(!e&amp;&amp;k.IsConstant()&amp;&amp;m.IsConstant()&amp;&amp;p.IsConstant())this.Run=a._GetBoundACEMethod_3params(c,b,k.Get(0),
m.Get(0),p.Get(0));else{const q=a._GetBoundACEMethod(c,b);this.Run=function(){return C3$jscomp$136.xor(q(k.Get(0),m.Get(0),p.Get(0)),e)}}}else this.Run=d}GetSID(){return this._sid}_GetFunc(){return this._func}GetObjectClass(){return this._objectClass}GetBehaviorType(){return this._behaviorType}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this.GetIndex()}IsTrigger(){return this._isTrigger}IsFastTrigger(){return this._isFastTrigger}IsInverted(){return this._isInverted}IsLooping(){return this._isLooping}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(a){this._debugData.isBreakpoint=
!!a;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&amp;&amp;!this._runtime.DebugBreakNext()&amp;&amp;!this._DebugReturnsGenerator()}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData||(this._unsavedData=new Map);return this._unsavedData}_RunSystem(){const a=this._results;EvalParams(this._parameters,a);return C3$jscomp$136.xor(this._func.apply(this._systemPlugin,
a),this._isInverted)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._systemPlugin,a);C3$jscomp$136.IsIterator(a)&amp;&amp;(a=yield*a);return C3$jscomp$136.xor(a,this._isInverted)}return this.Run()}_RunSingleGlobal(){const a=this._results;EvalParams(this._parameters,a);const b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();return C3$jscomp$136.xor(this._func.apply(b,
a),this._isInverted)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);const b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();a=this._func.apply(b,a);C3$jscomp$136.IsIterator(a)&amp;&amp;(a=yield*a);return C3$jscomp$136.xor(a,this._isInverted)}return this.Run()}_RunFastTrigger(){return!0}*_DebugRunFastTrigger(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;
return!0}_RunStatic(){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._behaviorType||this._objectClass,a);this._objectClass.ApplySolToContainer();return a}*_DebugRunStatic(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._results;EvalParams(this._parameters,a);a=this._func.apply(this._behaviorType||this._objectClass,a);C3$jscomp$136.IsIterator(a)&amp;&amp;(a=yield*a);this._objectClass.ApplySolToContainer();return a}return this.Run()}_RunObject(){const a=
this._parameters,b=this._results,d=this._objectClass.GetCurrentSol();for(let c=0,e=a.length;c&lt;e;++c){const h=a[c];h.VariesPerInstance()||(b[c]=h.Get(0))}return d.IsSelectAll()?this._RunObject_FirstFilter(d):this._RunObject_NextFilter(d)}*_DebugRunObject(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this._RunObject()}_EvaluateVaryingParameters(a){const b=this._parameters,d=this._results;for(let c=0,e=b.length;c&lt;e;++c){const h=b[c];h.VariesPerInstance()&amp;&amp;(d[c]=h.Get(a))}}_RunObject_FirstFilter(a){const b=
this._objectClass,d=b.IsFamily(),c=b.GetFamilyIndex(),e=this._behaviorIndex,h=0&lt;=e,k=b.GetInstances(),m=this._anyParamVariesPerInstance,p=this._results,q=this._func,v=this._isInverted,x=this._isInOrBlock&amp;&amp;!this._isTrigger;a.ClearArrays();for(let C=0,D=k.length;C&lt;D;++C){const G=k[C];m&amp;&amp;this._EvaluateVaryingParameters(C);var A=void 0;h?(A=d?G.GetObjectClass().GetFamilyBehaviorOffset(c):0,A=q.apply(G.GetBehaviorInstances()[e+A].GetSdkInstance(),p)):A=q.apply(G.GetSdkInstance(),p);C3$jscomp$136.xor(A,
v)?a._PushInstance(G):x&amp;&amp;a._PushElseInstance(G)}b.FinishCondition(!0);a._SetSelectAll(!1);b.ApplySolToContainer();return a.HasAnyInstances()}_RunObject_NextFilter(a){const b=this._objectClass;var d=b.IsFamily();const c=b.GetFamilyIndex(),e=b.IsInContainer(),h=this._behaviorIndex,k=0&lt;=h,m=this._anyParamVariesPerInstance,p=this._results,q=this._func,v=this._isInverted,x=this._isInOrBlock&amp;&amp;!this._isTrigger,A=a._GetOwnInstances(),C=a._GetOwnElseInstances(),D=x&amp;&amp;!this._eventBlock.IsFirstConditionOfType(this),
G=D?C:A;let E=0,J=!1;for(let O=0,V=G.length;O&lt;V;++O){const W=G[O];m&amp;&amp;this._EvaluateVaryingParameters(O);var L=void 0;k?(L=d?W.GetObjectClass().GetFamilyBehaviorOffset(c):0,L=q.apply(W.GetBehaviorInstances()[h+L].GetSdkInstance(),p)):L=q.apply(W.GetSdkInstance(),p);C3$jscomp$136.xor(L,v)?(J=!0,D?(A.push(W),e&amp;&amp;W._PushSiblingsToSolInstances()):(G[E]=W,e&amp;&amp;W._SetSiblingsToSolInstancesIndex(E),++E)):D?(G[E]=W,e&amp;&amp;W._SetSiblingsToSolElseInstancesIndex(E),++E):x&amp;&amp;(C.push(W),e&amp;&amp;W._PushSiblingsToSolElseInstances())}C3$jscomp$136.truncateArray(G,
E);e&amp;&amp;b._TruncateContainerSols(D,E);d=J;D&amp;&amp;!J&amp;&amp;(J=this._OrBlockCheckInstances(A));b.FinishCondition(d||x);return x?J:a.HasAnyInstances()}_OrBlockCheckInstances(a){var b=this._objectClass;const d=b.IsFamily();b=b.GetFamilyIndex();const c=this._anyParamVariesPerInstance,e=this._behaviorIndex,h=0&lt;=e,k=this._results,m=this._func,p=this._isInverted;for(let v=0,x=a.length;v&lt;x;++v){var q=a[v];c&amp;&amp;this._EvaluateVaryingParameters(v);if(h){const A=d?q.GetObjectClass().GetFamilyBehaviorOffset(b):0;q=m.apply(q.GetBehaviorInstances()[e+
A].GetSdkInstance(),k)}else q=m.apply(q.GetSdkInstance(),k);if(C3$jscomp$136.xor(q,p))return!0}return!1}ReevaluateParameter(a,b){return this._parameters[a].Get(b)}GetFastTriggerValue(){const a=this._parameters;if(!a.length)throw Error("no parameters");return a[0]._GetFastTriggerValue()}_SaveToJson(){if(!this._savedData||!this._savedData.size)return null;const a={};for(const [b,d]of this._savedData.entries()){let c=d;"collmemory"===b&amp;&amp;(c=[...d.entries()].map(e=&gt;[e[0].GetUID(),e[1].GetUID(),e[2]]));
a[b]=c}return{ex:a}}_LoadFromJson(a){this._savedData&amp;&amp;(this._savedData.clear(),this._savedData=null);if(a){var b=this._runtime,d=a.ex;if(d){a=this.GetSavedDataMap();a.clear();for(const [c,e]of Object.entries(d))d=e,"collmemory"===c&amp;&amp;(d=C3$jscomp$136.New(C3$jscomp$136.PairMap,e.map(h=&gt;[b.GetInstanceByUID(h[0]),b.GetInstanceByUID(h[1]),h[2]]).filter(h=&gt;h[0]&amp;&amp;h[1]))),a.set(c,d)}}}};"use strict";const C3$jscomp$137=self.C3;
function EvalParams$jscomp$1(a,b){for(let d=0,c=a.length;d&lt;c;++d)b[d]=a[d].Get(0)}const EMPTY_PARAMS_ARRAY$jscomp$1=[],noop$jscomp$2=function(){},noopGenerator=function*(){};
C3$jscomp$137.Action=class extends C3$jscomp$137.DefendedBase{constructor(a,b,d){super();this._eventBlock=a;this._runtime=a=a.GetRuntime();this._index=d;this._sid=4&lt;=b.length?b[3]:-1;this._actionType=5&lt;=b.length?b[4]&amp;255:0;this._flags=5&lt;=b.length?b[4]&gt;&gt;8:0;this._behaviorType=this._objectClass=this._func=null;this._behaviorIndex=-1;this._systemPlugin=null;this._callFunctionName="";this._callEventBlock=null;this.DebugRun=this.Run=noop$jscomp$2;this._parameters=[];this._results=[];this._anyParamVariesPerInstance=
!1;this._unsavedData=this._savedData=null;const c=(d=-3===b[0])?b[2]:b[5];this._debugData=a.IsDebug()||d?{isBreakpoint:c[0],canDebug:c[1],index:c[2]}:null;-1===b[0]?(this._systemPlugin=a.GetSystemPlugin(),this._func=a.GetObjectReference(b[1])):-2===b[0]?this._callFunctionName=b[1]:d?(this._func=a.GetObjectReference(b[1]),this.Run=this.RunUserScript,this.DebugRun=this.DebugRunUserScript,this._actionType=1):(this._func=a.GetObjectReference(b[1]),this._objectClass=a.GetObjectClassByIndex(b[0]),b[2]&amp;&amp;
(this._behaviorType=this._objectClass.GetBehaviorTypeByName(b[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(b[2])));if(7===b.length){b=b[6];for(const e of b)this._parameters.push(C3$jscomp$137.Parameter.Create(this,e,this._parameters.length)),this._results.push(0)}0===this._parameters.length&amp;&amp;(this._results=this._parameters=EMPTY_PARAMS_ARRAY$jscomp$1);this.CanPickAnyObjectClass()&amp;&amp;(this._eventBlock.SetAllSolModifiers(),this._eventBlock.SetSolWriterAfterCnds());this._eventBlock.GetEventSheetManager()._RegisterAction(this)}static Create(a,
b,d){return C3$jscomp$137.New(C3$jscomp$137.Action,a,b,d)}_PostInit(){for(var a of this._parameters)a._PostInit(),a.VariesPerInstance()&amp;&amp;(this._anyParamVariesPerInstance=!0);if(this._systemPlugin)this._SetSystemRunMethod(),this.DebugRun=this._DebugRunSystem;else if(this._callFunctionName)this._SetCallFunctionRunMethod(),this._callFunctionName="";else if(this.Run===this.RunUserScript){a=this._func;const b=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this._eventBlock);this._func=
a.bind(null,this._runtime.GetIRuntime(),b)}else this._behaviorType?this.IsAsync()?(this.Run=this._RunBehavior_Async,this.DebugRun=this._DebugRunBehavior_Async):(this.Run=this._RunBehavior,this.DebugRun=this._DebugRunBehavior):this._objectClass.GetPlugin().IsSingleGlobal()?(this._SetSingleGlobalRunMethod(),this.DebugRun=this._DebugRunSingleGlobal):this.IsAsync()?(this.Run=this._RunObject_Async,this.DebugRun=this._DebugRunObject_Async):this.CallBeforeAfterHooks()?(this.Run=this._RunObject_BeforeAfterHooks,
this.DebugRun=this._DebugRunObject_BeforeAfterHooks):this._parameters.length?this._parameters.every(b=&gt;b.VariesPerInstance())?(this.Run=this._RunObject_AllParamsVary,this.DebugRun=this._DebugRunObject_AllParamsVary):this._anyParamVariesPerInstance?(this.Run=this._RunObject_SomeParamsVary,this.DebugRun=this._DebugRunObject_SomeParamsVary):this._parameters.every(b=&gt;b.IsConstant())?(EvalParams$jscomp$1(this._parameters,this._results),this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst):
(this.Run=this._RunObject_ParamsDontVary,this.DebugRun=this._DebugRunObject_ParamsDontVary):(this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst)}_SetSystemRunMethod(){this._SetRunMethodForBoundFunc(this._systemPlugin,this._systemPlugin,this._RunSystem)}_SetSingleGlobalRunMethod(){const a=this._objectClass.GetPlugin(),b=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(a,b,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const a=
this._eventBlock.GetEventSheetManager(),b=a.GetFunctionBlockByName(this._callFunctionName);if(b.IsEnabled()){const d=0!==(this._flags&amp;2);this._callEventBlock=b.GetEventBlock();let c=[...(new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()]))];c=a._DeduplicateSolModifierList(c);this.Run=C3$jscomp$137.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,c,this._parameters,d);if(this._runtime.IsDebug()){const e=this;this.DebugRun=
function*(){if(e.IsBreakpoint()||e._runtime.DebugBreakNext())yield e;return yield*e._callEventBlock.DebugRunAsFunctionCall(c,e._parameters,d)}}else this.DebugRun=noopGenerator}else this.Run=noop$jscomp$2,this.DebugRun=noopGenerator}_SetRunMethodForBoundFunc(a,b,d){const c=this._func,e=this._parameters;if(0===e.length)this.Run=a._GetBoundACEMethod(c,b);else if(1===e.length){const h=e[0];if(h.IsConstant())this.Run=a._GetBoundACEMethod_1param(c,b,h.Get(0));else{const k=a._GetBoundACEMethod(c,b);this.Run=
function(){return k(h.Get(0))}}}else if(2===e.length){const h=e[0],k=e[1];if(h.IsConstant()&amp;&amp;k.IsConstant())this.Run=a._GetBoundACEMethod_2params(c,b,h.Get(0),k.Get(0));else{const m=a._GetBoundACEMethod(c,b);this.Run=function(){return m(h.Get(0),k.Get(0))}}}else if(3===e.length){const h=e[0],k=e[1],m=e[2];if(h.IsConstant()&amp;&amp;k.IsConstant()&amp;&amp;m.IsConstant())this.Run=a._GetBoundACEMethod_3params(c,b,h.Get(0),k.Get(0),m.Get(0));else{const p=a._GetBoundACEMethod(c,b);this.Run=function(){return p(h.Get(0),
k.Get(0),m.Get(0))}}}else this.Run=d}GetSID(){return this._sid}IsAsync(){return 1===this._actionType}CanBailOut(){return 2===this._actionType}CallBeforeAfterHooks(){return 3===this._actionType}CanPickAnyObjectClass(){return 0!==(this._flags&amp;1)}HasReturnType(){return this.IsAsync()||this.CanBailOut()}GetObjectClass(){return this._objectClass}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this._debugData.index}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(a){this._debugData.isBreakpoint=
!!a;this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&amp;&amp;!this._runtime.DebugBreakNext()&amp;&amp;!this._DebugReturnsGenerator()}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData||(this._unsavedData=new Map);return this._unsavedData}_RunSystem(){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return this._func.apply(this._systemPlugin,
a)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return yield*this._func.apply(this._systemPlugin,a)}return this.Run()}_RunSingleGlobal(){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),a)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;
if(this._DebugReturnsGenerator()){const a=this._results;EvalParams$jscomp$1(this._parameters,a);return yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),a)}return this.Run()}_RunObject_ParamsConst(){const a=this._results,b=this._objectClass.GetCurrentSol().GetInstances();for(let d=0,c=b.length;d&lt;c;++d)this._func.apply(b[d].GetSdkInstance(),a)}*_DebugRunObject_ParamsConst(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=
this._results,b=this._objectClass.GetCurrentSol().GetInstances();for(let d=0,c=b.length;d&lt;c;++d)yield*this._func.apply(b[d].GetSdkInstance(),a)}else this._RunObject_ParamsConst()}_RunObject_ParamsDontVary(){const a=this._results;EvalParams$jscomp$1(this._parameters,a);const b=this._objectClass.GetCurrentSol().GetInstances();for(let d=0,c=b.length;d&lt;c;++d)this._func.apply(b[d].GetSdkInstance(),a)}*_DebugRunObject_ParamsDontVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=
this._results;EvalParams$jscomp$1(this._parameters,a);const b=this._objectClass.GetCurrentSol().GetInstances();for(let d=0,c=b.length;d&lt;c;++d)yield*this._func.apply(b[d].GetSdkInstance(),a)}else this._RunObject_ParamsDontVary()}_RunObject_AllParamsVary(){const a=this._parameters,b=this._results,d=this._func,c=this._objectClass.GetCurrentSol().GetInstances();for(let e=0,h=c.length;e&lt;h;++e){const k=c[e];for(let m=0,p=a.length;m&lt;p;++m)b[m]=a[m].Get(e);d.apply(k.GetSdkInstance(),b)}}*_DebugRunObject_AllParamsVary(){if(this.IsBreakpoint()||
this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const a=this._parameters,b=this._results,d=this._func,c=this._objectClass.GetCurrentSol().GetInstances();for(let e=0,h=c.length;e&lt;h;++e){const k=c[e];for(let m=0,p=a.length;m&lt;p;++m)b[m]=a[m].Get(e);yield*d.apply(k.GetSdkInstance(),b)}}else this._RunObject_AllParamsVary()}_RunObject_SomeParamsVary(){const a=this._parameters,b=this._results,d=this._func,c=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,k=a.length;h&lt;
k;++h){var e=a[h];e.VariesPerInstance()||(b[h]=e.Get(0))}for(let h=0,k=c.length;h&lt;k;++h){e=c[h];for(let m=0,p=a.length;m&lt;p;++m){const q=a[m];q.VariesPerInstance()&amp;&amp;(b[m]=q.Get(h))}d.apply(e.GetSdkInstance(),b)}}*_DebugRunObject_SomeParamsVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const b=this._parameters,d=this._results,c=this._func,e=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,k=b.length;h&lt;k;++h){var a=b[h];a.VariesPerInstance()||
(d[h]=a.Get(0))}for(let h=0,k=e.length;h&lt;k;++h){a=e[h];for(let m=0,p=b.length;m&lt;p;++m){const q=b[m];q.VariesPerInstance()&amp;&amp;(d[m]=q.Get(h))}yield*c.apply(a.GetSdkInstance(),d)}}else this._RunObject_SomeParamsVary()}_RunObject_BeforeAfterHooks(){const a=this._parameters,b=this._results,d=this._func;var c=this._objectClass;const e=c.GetSdkType();c=c.GetCurrentSol().GetInstances();e.BeforeRunAction(d);for(let h=0,k=c.length;h&lt;k;++h){const m=c[h];for(let p=0,q=a.length;p&lt;q;++p)b[p]=a[p].Get(h);d.apply(m.GetSdkInstance(),
b)}e.AfterRunAction(d)}*_DebugRunObject_BeforeAfterHooks(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const b=this._parameters,d=this._results,c=this._func;var a=this._objectClass;const e=a.GetSdkType();a=a.GetCurrentSol().GetInstances();e.BeforeRunAction(c);for(let h=0,k=a.length;h&lt;k;++h){const m=a[h];for(let p=0,q=b.length;p&lt;q;++p)d[p]=b[p].Get(h);yield*c.apply(m.GetSdkInstance(),d)}e.AfterRunAction(c)}else this._RunObject_BeforeAfterHooks()}_RunBehavior(){var a=
this._objectClass;const b=a.IsFamily(),d=a.GetFamilyIndex(),c=this._parameters,e=this._anyParamVariesPerInstance,h=this._results,k=this._func,m=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();for(let v=0,x=c.length;v&lt;x;++v){var p=c[v];p.VariesPerInstance()||(h[v]=p.Get(0))}for(let v=0,x=a.length;v&lt;x;++v){p=a[v];if(e)for(let A=0,C=c.length;A&lt;C;++A){var q=c[A];q.VariesPerInstance()&amp;&amp;(h[A]=q.Get(v))}q=b?p.GetObjectClass().GetFamilyBehaviorOffset(d):0;k.apply(p.GetBehaviorInstances()[m+q].GetSdkInstance(),
h)}}*_DebugRunBehavior(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._objectClass;const c=a.IsFamily(),e=a.GetFamilyIndex(),h=this._parameters,k=this._anyParamVariesPerInstance,m=this._results,p=this._func,q=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();for(let v=0,x=h.length;v&lt;x;++v){var b=h[v];b.VariesPerInstance()||(m[v]=b.Get(0))}for(let v=0,x=a.length;v&lt;x;++v){b=a[v];if(k)for(let A=0,C=h.length;A&lt;C;++A){var d=h[A];d.VariesPerInstance()&amp;&amp;
(m[A]=d.Get(v))}d=c?b.GetObjectClass().GetFamilyBehaviorOffset(e):0;yield*p.apply(b.GetBehaviorInstances()[q+d].GetSdkInstance(),m)}}else this._RunBehavior()}_RunObject_Async(){const a=this._parameters,b=this._results,d=this._func,c=this._objectClass.GetCurrentSol().GetInstances(),e=[];for(let h=0,k=c.length;h&lt;k;++h){const m=c[h];for(let p=0,q=a.length;p&lt;q;++p)b[p]=a[p].Get(h);e.push(d.apply(m.GetSdkInstance(),b))}return Promise.all(e)}*_DebugRunObject_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;
if(this._DebugReturnsGenerator()){const a=this._parameters,b=this._results,d=this._func,c=this._objectClass.GetCurrentSol().GetInstances(),e=[];for(let h=0,k=c.length;h&lt;k;++h){const m=c[h];for(let p=0,q=a.length;p&lt;q;++p)b[p]=a[p].Get(h);e.push(yield*d.apply(m.GetSdkInstance(),b))}return Promise.all(e)}return this._RunObject_Async()}_RunBehavior_Async(){var a=this._objectClass;const b=a.IsFamily(),d=a.GetFamilyIndex(),c=this._parameters,e=this._results,h=this._func,k=this._behaviorIndex;a=a.GetCurrentSol().GetInstances();
const m=[];for(let p=0,q=a.length;p&lt;q;++p){const v=a[p];for(let A=0,C=c.length;A&lt;C;++A)e[A]=c[A].Get(p);const x=b?v.GetObjectClass().GetFamilyBehaviorOffset(d):0;m.push(h.apply(v.GetBehaviorInstances()[k+x].GetSdkInstance(),e))}return Promise.all(m)}*_DebugRunBehavior_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var a=this._objectClass;const b=a.IsFamily(),d=a.GetFamilyIndex(),c=this._parameters,e=this._results,h=this._func,k=this._behaviorIndex;
a=a.GetCurrentSol().GetInstances();const m=[];for(let p=0,q=a.length;p&lt;q;++p){const v=a[p];for(let A=0,C=c.length;A&lt;C;++A)e[A]=c[A].Get(p);const x=b?v.GetObjectClass().GetFamilyBehaviorOffset(d):0;m.push(yield*h.apply(v.GetBehaviorInstances()[k+x].GetSdkInstance(),e))}return Promise.all(m)}return this._RunBehavior_Async()}async RunUserScript(){try{await this._func()}catch(a){console.error(`Unhandled exception running script %c${this._eventBlock.GetEventSheet().GetName()}, event ${this._eventBlock.GetDisplayNumber()}, action ${this.GetDebugIndex()+
1}:`,"font-size: 1.2em; font-weight: bold;",a),self.C3Debugger&amp;&amp;self.C3Debugger._SetLastErrorScript(this),C3$jscomp$137.EventScript.HadUserScriptException()||(console.info("%cTip:%c run this to highlight in Construct the last script that had an error: %cgoToLastErrorScript()","font-weight: bold; text-decoration: underline","","font-weight: bold"),C3$jscomp$137.EventScript.SetHadUserScriptException())}}*DebugRunUserScript(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this.RunUserScript()}_SaveToJson(){return this._savedData&amp;&amp;
this._savedData.size?{ex:C3$jscomp$137.ToSuperJSON(this._savedData)}:null}_LoadFromJson(a){this._savedData&amp;&amp;(this._savedData.clear(),this._savedData=null);a&amp;&amp;(a=a.ex)&amp;&amp;(this._savedData=C3$jscomp$137.FromSuperJSON(a))}};"use strict";const C3$jscomp$138=self.C3,tempColor$jscomp$5=new C3$jscomp$138.Color;function CompareX(a,b){return C3$jscomp$138.compare(this.GetWorldInfo().GetX(),a,b)}function CompareY(a,b){return C3$jscomp$138.compare(this.GetWorldInfo().GetY(),a,b)}
function IsOnScreen(){const a=this.GetWorldInfo(),b=a.GetLayer();return b.Has3DCamera()?a.IsInViewport3D(b._GetViewFrustum()):a.IsInViewport(b.GetViewport(),a.GetLayout().HasVanishingPointOutsideViewport(),a.GetLayout().IsOrthographicProjection())}function IsOutsideLayout(){var a=this.GetWorldInfo();const b=a.GetLayout();a=a.GetBoundingBox();return 0&gt;a.getRight()||0&gt;a.getBottom()||a.getLeft()&gt;b.GetWidth()||a.getTop()&gt;b.GetHeight()}
function PickDistance(a,b,d){const c=this.GetCurrentSol(),e=c.GetInstances();if(!e.length)return!1;let h=e[0];var k=h.GetWorldInfo();let m=h,p=C3$jscomp$138.distanceSquared(k.GetX(),k.GetY(),b,d);for(let q=1,v=e.length;q&lt;v;++q)if(h=e[q],k=h.GetWorldInfo(),k=C3$jscomp$138.distanceSquared(k.GetX(),k.GetY(),b,d),0===a&amp;&amp;k&lt;p||1===a&amp;&amp;k&gt;p)p=k,m=h;c.PickOne(m);return!0}function SetX(a){const b=this.GetWorldInfo();b.GetX()!==a&amp;&amp;(b.SetX(a),b.SetBboxChanged())}
function SetY(a){const b=this.GetWorldInfo();b.GetY()!==a&amp;&amp;(b.SetY(a),b.SetBboxChanged())}function SetPos(a,b){const d=this.GetWorldInfo();d.EqualsXY(a,b)||(d.SetXY(a,b),d.SetBboxChanged())}function SetPosToObject(a,b){if(a&amp;&amp;(a=a.GetPairedInstance(this._inst))){var [d,c]=a.GetImagePoint(b);b=this.GetWorldInfo();if(b.GetX()!==d||b.GetY()!==c)b.SetXY(d,c),b.SetBboxChanged()}}
function MoveForward(a){if(0!==a){var b=this.GetWorldInfo();b.OffsetXY(b.GetCosAngle()*a,b.GetSinAngle()*a);b.SetBboxChanged()}}function MoveAtAngle(a,b){if(0!==b){var d=this.GetWorldInfo();a=C3$jscomp$138.toRadians(a);d.OffsetXY(Math.cos(a)*b,Math.sin(a)*b);d.SetBboxChanged()}}function GetX(){return this.GetWorldInfo().GetX()}function GetY(){return this.GetWorldInfo().GetY()}function GetDt(){return this._runtime.GetDt(this._inst)}
function CompareWidth(a,b){return C3$jscomp$138.compare(this.GetWorldInfo().GetWidth(),a,b)}function CompareHeight(a,b){return C3$jscomp$138.compare(this.GetWorldInfo().GetHeight(),a,b)}function SetWidth(a){const b=this.GetWorldInfo();b.GetWidth()!==a&amp;&amp;(b.SetWidth(a),b.SetBboxChanged())}function SetHeight(a){const b=this.GetWorldInfo();b.GetHeight()!==a&amp;&amp;(b.SetHeight(a),b.SetBboxChanged())}
function SetSize(a,b){const d=this.GetWorldInfo();if(d.GetWidth()!==a||d.GetHeight()!==b)d.SetSize(a,b),d.SetBboxChanged()}function GetWidth(){return this.GetWorldInfo().GetWidth()}function GetHeight(){return this.GetWorldInfo().GetHeight()}function GetBboxLeft(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function GetBboxTop(){return this.GetWorldInfo().GetBoundingBox().getTop()}function GetBboxRight(){return this.GetWorldInfo().GetBoundingBox().getRight()}
function GetBboxBottom(){return this.GetWorldInfo().GetBoundingBox().getBottom()}function IsAngleWithin(a,b){return C3$jscomp$138.angleDiff(this.GetWorldInfo().GetAngle(),C3$jscomp$138.toRadians(b))&lt;=C3$jscomp$138.toRadians(a)}function IsAngleClockwiseFrom(a){return C3$jscomp$138.angleClockwise(this.GetWorldInfo().GetAngle(),C3$jscomp$138.toRadians(a))}
function IsBetweenAngles(a,b){a=C3$jscomp$138.toRadians(a);b=C3$jscomp$138.toRadians(b);const d=this.GetWorldInfo().GetAngle();return C3$jscomp$138.angleClockwise(b,a)?C3$jscomp$138.angleClockwise(d,a)&amp;&amp;!C3$jscomp$138.angleClockwise(d,b):!(!C3$jscomp$138.angleClockwise(d,a)&amp;&amp;C3$jscomp$138.angleClockwise(d,b))}function SetAngle(a){const b=this.GetWorldInfo();a=C3$jscomp$138.clampAngle(C3$jscomp$138.toRadians(a));isNaN(a)||b.GetAngle()===a||(b.SetAngle(a),b.SetBboxChanged())}
function RotateClockwise(a){if(!isNaN(a)&amp;&amp;0!==a){var b=this.GetWorldInfo();b.SetAngle(b.GetAngle()+C3$jscomp$138.toRadians(a));b.SetBboxChanged()}}function RotateCounterclockwise(a){if(!isNaN(a)&amp;&amp;0!==a){var b=this.GetWorldInfo();b.SetAngle(b.GetAngle()-C3$jscomp$138.toRadians(a));b.SetBboxChanged()}}
function RotateTowardAngle(a,b){const d=this.GetWorldInfo(),c=d.GetAngle();a=C3$jscomp$138.angleRotate(c,C3$jscomp$138.toRadians(b),C3$jscomp$138.toRadians(a));isNaN(a)||c===a||(d.SetAngle(a),d.SetBboxChanged())}function RotateTowardPosition(a,b,d){const c=this.GetWorldInfo(),e=c.GetAngle();b-=c.GetX();d-=c.GetY();a=C3$jscomp$138.angleRotate(e,Math.atan2(d,b),C3$jscomp$138.toRadians(a));isNaN(a)||e===a||(c.SetAngle(a),c.SetBboxChanged())}
function SetTowardPosition(a,b){const d=this.GetWorldInfo(),c=d.GetAngle();a-=d.GetX();b-=d.GetY();b=Math.atan2(b,a);isNaN(b)||c===b||(d.SetAngle(b),d.SetBboxChanged())}function GetAngle(){return C3$jscomp$138.toDegrees(this.GetWorldInfo().GetAngle())}function CompareOpacity(a,b){return C3$jscomp$138.compare(C3$jscomp$138.round6dp(100*this.GetWorldInfo().GetOpacity()),a,b)}function IsVisible(){return this.GetWorldInfo().IsVisible()}
function SetVisible(a){const b=this.GetWorldInfo();a=2===a?!b.IsVisible():0!==a;b.IsVisible()!==a&amp;&amp;(b.SetVisible(a),this._runtime.UpdateRender())}function SetOpacity(a){a=C3$jscomp$138.clamp(a/100,0,1);const b=this.GetWorldInfo();b.GetOpacity()!==a&amp;&amp;(b.SetOpacity(a),this._runtime.UpdateRender())}
function SetDefaultColor(a){tempColor$jscomp$5.setFromRgbValue(a);a=this.GetWorldInfo();a.GetUnpremultipliedColor().equalsIgnoringAlpha(tempColor$jscomp$5)||(a.SetUnpremultipliedColor(tempColor$jscomp$5),this._runtime.UpdateRender())}function GetColor(){const a=this.GetWorldInfo().GetUnpremultipliedColor();return C3$jscomp$138.PackRGBAEx(a.getR(),a.getG(),a.getB(),a.getA())}function GetOpacity(){return C3$jscomp$138.round6dp(100*this.GetWorldInfo().GetOpacity())}
function IsOnLayer(a){return a?this.GetWorldInfo().GetLayer()===a:!1}function PickTopBottom(a){const b=this.GetCurrentSol(),d=b.GetInstances();if(!d.length)return!1;let c=d[0];for(let e=1,h=d.length;e&lt;h;++e){const k=d[e],m=k.GetWorldInfo(),p=c.GetWorldInfo(),q=m.GetLayer().GetIndex(),v=p.GetLayer().GetIndex();if(0===a){if(q&gt;v||q===v&amp;&amp;m.GetZIndex()&gt;p.GetZIndex())c=k}else if(q&lt;v||q===v&amp;&amp;m.GetZIndex()&lt;p.GetZIndex())c=k}b.PickOne(c);return!0}
function CompareZElevation(a,b,d){const c=this.GetWorldInfo();a=0===a?c.GetZElevation():c.GetTotalZElevation();return C3$jscomp$138.compare(a,b,d)}function MoveToTop(){this.GetWorldInfo().ZOrderMoveToTop()}function MoveToBottom(){this.GetWorldInfo().ZOrderMoveToBottom()}function MoveToLayer(a){a&amp;&amp;this.GetWorldInfo().ZOrderMoveToLayer(a)}function ZMoveToObject(a,b){a=0===a;b&amp;&amp;(b=b.GetFirstPicked(this.GetInstance()))&amp;&amp;this.GetWorldInfo().ZOrderMoveAdjacentToInstance(b,a)}
function SetZElevation(a){const b=this.GetWorldInfo();b.GetZElevation()!==a&amp;&amp;(b.SetZElevation(a),this._runtime.UpdateRender())}function LayerNumber(){return this.GetWorldInfo().GetLayer().GetIndex()}function LayerName(){return this.GetWorldInfo().GetLayer().GetName()}function ZIndex(){return this.GetWorldInfo().GetZIndex()}function ZElevation(){return this.GetWorldInfo().GetZElevation()}function TotalZElevation(){return this.GetWorldInfo().GetTotalZElevation()}
function IsEffectEnabled(a){if(a=this.GetObjectClass().GetEffectList().GetEffectTypeByName(a))return a=a.GetIndex(),this.GetWorldInfo().GetInstanceEffectList().IsEffectIndexActive(a)}function SetEffectEnabled(a,b){if(b=this.GetObjectClass().GetEffectList().GetEffectTypeByName(b)){b=b.GetIndex();a=1===a;var d=this.GetWorldInfo().GetInstanceEffectList();d.IsEffectIndexActive(b)!==a&amp;&amp;(d.SetEffectIndexActive(b,a),d.UpdateActiveEffects(),this._runtime.UpdateRender())}}
function SetEffectParam(a,b,d){if(a=this.GetObjectClass().GetEffectList().GetEffectTypeByName(a)){b=Math.floor(b);var c=a.GetShaderProgram().GetParameterType(b);c&amp;&amp;("color"===c?(tempColor$jscomp$5.setFromRgbValue(d),d=tempColor$jscomp$5):"percent"===c&amp;&amp;(d/=100),a=a.GetIndex(),c=this.GetWorldInfo().GetInstanceEffectList(),c.SetEffectParameter(a,b,d)&amp;&amp;c.IsEffectIndexActive(a)&amp;&amp;this._runtime.UpdateRender())}}
const tempRect$jscomp$4=C3$jscomp$138.New(C3$jscomp$138.Rect),tempCandidates1=[],tempCandidates2=[];let needsCollisionFinish=!1,rPickType=null,rPickFromElseInstances=!1;const rToPick=new Set;function CollMemory_Add(a,b,d,c){const e=b.GetUID(),h=d.GetUID();e&lt;h?a.Set(b,d,c):a.Set(d,b,c)}function CollMemory_Remove(a,b,d){const c=b.GetUID(),e=d.GetUID();c&lt;e?a.Delete(b,d):a.Delete(d,b)}function CollMemory_RemoveInstance(a,b){a.DeleteEither(b)}
function CollMemory_Get(a,b,d){const c=b.GetUID(),e=d.GetUID();return c&lt;e?a.Get(b,d):a.Get(d,b)}
function DoOverlapCondition(a,b,d,c){if(!b)return!1;a=a.GetInstance();const e=0!==d||0!==c,h=a.GetWorldInfo(),k=a.GetRuntime(),m=k.GetCollisionEngine();var p=k.GetCurrentCondition();const q=p.GetEventBlock().IsOrBlock();var v=p.GetObjectClass();p=p.IsInverted();const x=b.GetCurrentSol();v=v!==b;rPickType=b;needsCollisionFinish=v&amp;&amp;!p;rPickFromElseInstances=!1;let A=0,C=0,D=!1;x.IsSelectAll()?(tempRect$jscomp$4.copy(h.GetBoundingBox()),tempRect$jscomp$4.offset(d,c),m.GetCollisionCandidates(h.GetLayer(),
b,tempRect$jscomp$4,tempCandidates2),b=tempCandidates2):q?k.IsCurrentConditionFirst()&amp;&amp;!x._GetOwnElseInstances().length&amp;&amp;x._GetOwnInstances().length?b=x._GetOwnInstances():(b=x._GetOwnElseInstances(),rPickFromElseInstances=!0):b=x._GetOwnInstances();e&amp;&amp;(A=h.GetX(),C=h.GetY(),h.OffsetXY(d,c),h.SetBboxChanged());for(const G of b)if(m.TestOverlap(a,G)){D=!0;if(p)break;v&amp;&amp;rToPick.add(G)}e&amp;&amp;(h.SetXY(A,C),h.SetBboxChanged());C3$jscomp$138.clearArray(tempCandidates2);return D}
function FinishCollisionConditionPicking(a){a=a.GetRuntime().GetCurrentEvent().IsOrBlock();const b=rPickType.GetCurrentSol(),d=b._GetOwnInstances(),c=b._GetOwnElseInstances();b.IsSelectAll()?(b.SetSetPicked(rToPick),a&amp;&amp;(C3$jscomp$138.clearArray(c),b.AddElseInstances(rToPick,rPickType.GetInstances()))):a?rPickFromElseInstances?b.TransferElseInstancesToOwn(rToPick):(b.AddElseInstances(rToPick,d),b.SetSetPicked(rToPick)):b.SetSetPicked(rToPick);rPickType.ApplySolToContainer()}
function FinishCollisionCondition(a,b){needsCollisionFinish&amp;&amp;(b&amp;&amp;FinishCollisionConditionPicking(a),rToPick.clear(),rPickType=null,needsCollisionFinish=!1)}
function OnCollision(a){if(this._runtime.IsDebugging())return DebugOnCollision.call(this,a);if(!a)return!1;var b=this._runtime;const d=b.GetCollisionEngine(),c=b.GetEventSheetManager(),e=c.GetEventStack();var h=c.GetCurrentCondition();const k=h.GetObjectClass();var m=h.GetSavedDataMap(),p=h.GetUnsavedDataMap();h=e.GetCurrentStackFrame();const q=b.GetTickCount(),v=q-1,x=h.GetCurrentEvent(),A=e.Push(x);let C=m.get("collmemory");C||(C=C3$jscomp$138.New(C3$jscomp$138.PairMap),m.set("collmemory",C));p.get("collisionCreatedDestroyCallback")||
(p.set("collisionCreatedDestroyCallback",!0),b.Dispatcher().addEventListener("instancedestroy",J=&gt;CollMemory_RemoveInstance(C,J.instance)));m=k.GetCurrentSol();b=a.GetCurrentSol();m=m.GetInstances();p=null;for(let J=0;J&lt;m.length;++J){const L=m[J];b.IsSelectAll()?(d.GetCollisionCandidates(L.GetWorldInfo().GetLayer(),a,L.GetWorldInfo().GetBoundingBox(),tempCandidates1),p=tempCandidates1,d.AddRegisteredCollisionCandidates(L,a,p)):p=b.GetInstances();for(let O=0;O&lt;p.length;++O){const V=p[O];if(d.TestOverlap(L,
V)||d.CheckRegisteredCollision(L,V)){var D=CollMemory_Get(C,L,V),G=!1,E=-2;"number"===typeof D&amp;&amp;(G=!0,E=D);D=!G||E&lt;v;CollMemory_Add(C,L,V,q);D&amp;&amp;(D=x.GetSolModifiers(),c.PushCopySol(D),E=k.GetCurrentSol(),G=a.GetCurrentSol(),E._SetSelectAll(!1),G._SetSelectAll(!1),k===a?(G=E._GetOwnInstances(),C3$jscomp$138.clearArray(G),G.push(L),G.push(V),k.ApplySolToContainer()):(E=E._GetOwnInstances(),G=G._GetOwnInstances(),C3$jscomp$138.clearArray(E),C3$jscomp$138.clearArray(G),E.push(L),G.push(V),k.ApplySolToContainer(),
a.ApplySolToContainer()),x.Retrigger(h,A),c.PopSol(D))}else CollMemory_Remove(C,L,V)}C3$jscomp$138.clearArray(tempCandidates1)}e.Pop();return!1}
function*DebugOnCollision(a){if(!a)return!1;var b=this._runtime;const d=b.GetCollisionEngine(),c=b.GetEventSheetManager(),e=c.GetEventStack();var h=c.GetCurrentCondition();const k=h.GetObjectClass();var m=h.GetSavedDataMap(),p=h.GetUnsavedDataMap();h=e.GetCurrentStackFrame();const q=b.GetTickCount(),v=q-1,x=h.GetCurrentEvent(),A=e.Push(x);let C=m.get("collmemory");C||(C=C3$jscomp$138.New(C3$jscomp$138.PairMap),m.set("collmemory",C));p.get("collisionCreatedDestroyCallback")||(p.set("collisionCreatedDestroyCallback",
!0),b.Dispatcher().addEventListener("instancedestroy",J=&gt;CollMemory_RemoveInstance(C,J.instance)));m=k.GetCurrentSol();b=a.GetCurrentSol();m=m.GetInstances();p=null;for(let J=0;J&lt;m.length;++J){const L=m[J];b.IsSelectAll()?(d.GetCollisionCandidates(L.GetWorldInfo().GetLayer(),a,L.GetWorldInfo().GetBoundingBox(),tempCandidates1),p=tempCandidates1,d.AddRegisteredCollisionCandidates(L,a,p)):p=b.GetInstances();for(let O=0;O&lt;p.length;++O){const V=p[O];if(d.TestOverlap(L,V)||d.CheckRegisteredCollision(L,
V)){var D=CollMemory_Get(C,L,V),G=!1,E=-2;"number"===typeof D&amp;&amp;(G=!0,E=D);D=!G||E&lt;v;CollMemory_Add(C,L,V,q);D&amp;&amp;(D=x.GetSolModifiers(),c.PushCopySol(D),E=k.GetCurrentSol(),G=a.GetCurrentSol(),E._SetSelectAll(!1),G._SetSelectAll(!1),k===a?(G=E._GetOwnInstances(),C3$jscomp$138.clearArray(G),G.push(L),G.push(V),k.ApplySolToContainer()):(E=E._GetOwnInstances(),G=G._GetOwnInstances(),C3$jscomp$138.clearArray(E),C3$jscomp$138.clearArray(G),E.push(L),G.push(V),k.ApplySolToContainer(),a.ApplySolToContainer()),
yield*x.DebugRetrigger(h,A),c.PopSol(D))}else CollMemory_Remove(C,L,V)}C3$jscomp$138.clearArray(tempCandidates1)}e.Pop();return!1}function IsOverlapping(a){return DoOverlapCondition(this,a,0,0)}function IsOverlappingOffset(a,b,d){return DoOverlapCondition(this,a,b,d)}function HasParent(){return this.GetWorldInfo().HasParent()}function HasChildren(){return this.GetWorldInfo().HasChildren()}
function PickParent(a,b){const d=this.GetCurrentSol().GetInstances();if(0===d.length)return!1;const c=a.GetCurrentSol();var e=c.GetInstances();if(0===e.length)return!1;e=new Set(e);const h=new Set;for(let m=0,p=d.length;m&lt;p;++m){var k=d[m];if(1===b)for(const q of k.parents())q.BelongsToObjectClass(a)&amp;&amp;e.has(q)&amp;&amp;h.add(q);else{if(0===b){if(k=k.GetParent(),null===k)continue}else k=k.GetTopParent();k.BelongsToObjectClass(a)&amp;&amp;e.has(k)&amp;&amp;h.add(k)}}if(0===h.size)return!1;c.SetSetPicked(h);a.ApplySolToContainer();
return!0}
function PickChildren(a,b){const d=this.GetCurrentSol().GetInstances();if(0===d.length)return!1;const c=a.GetCurrentSol();var e=c.GetInstances();if(c.IsSelectAll()){var h=[...this._runtime.instancesPendingCreateForObjectClass(a)];0&lt;h.length&amp;&amp;(e=e.concat(h))}if(0===e.length)return!1;e=new Set(e);h=new Set;for(let k=0,m=d.length;k&lt;m;++k){const p=d[k];2===b&amp;&amp;!p.HasChildren()&amp;&amp;p.BelongsToObjectClass(a)&amp;&amp;e.has(p)&amp;&amp;h.add(p);for(const q of 0===b?p.children():p.allChildren())2===b&amp;&amp;q.HasChildren()||q.BelongsToObjectClass(a)&amp;&amp;
e.has(q)&amp;&amp;h.add(q)}if(0===h.size)return!1;c.SetSetPicked(h);a.ApplySolToContainer();return!0}
function PickNthChild(a,b){const d=this.GetCurrentSol().GetInstances();if(0===d.length)return!1;const c=a.GetCurrentSol();var e=c.GetInstances();if(c.IsSelectAll()){var h=[...this._runtime.instancesPendingCreateForObjectClass(a)];0&lt;h.length&amp;&amp;(e=e.concat(h))}if(0===e.length)return!1;e=new Set(e);h=[];for(let k=0,m=d.length;k&lt;m;++k){const p=d[k].GetChildAt(b);null!==p&amp;&amp;p.BelongsToObjectClass(a)&amp;&amp;e.has(p)&amp;&amp;h.push(p)}if(0===h.length)return!1;c.SetArrayPicked(h);a.ApplySolToContainer();return!0}
function CompareChildCount(a,b,d){switch(a){default:return C3$jscomp$138.compare(this._inst.GetChildCount(),b,d);case 1:return C3$jscomp$138.compare(this._inst.GetAllChildCount(),b,d)}}
function AddChild(a,b,d,c,e,h,k,m){const p=this._inst,q=this._runtime.GetCurrentAction().GetObjectClass();for(const v of a.allCorrespondingInstances(p,q)){if(!v.GetPlugin().SupportsSceneGraph())break;p.AddChild(v,{transformX:b,transformY:d,transformWidth:c,transformHeight:e,transformAngle:h,transformZElevation:k,destroyWithParent:m})}}function RemoveChild(a){const b=this._inst,d=this._runtime.GetCurrentAction().GetObjectClass();for(const c of a.allCorrespondingInstances(b,d))b.RemoveChild(c)}
function RemoveFromParent(){this._inst.HasParent()&amp;&amp;this._inst.GetParent().RemoveChild(this._inst)}function ChildCount(){return this._inst.GetChildCount()}function AllChildCount(){return this._inst.GetAllChildCount()}function SetMeshSize(a,b){a=Math.floor(a);b=Math.floor(b);const d=this.GetWorldInfo();2&gt;a||2&gt;b||!isFinite(a)||!isFinite(b)?(d.ReleaseMesh(),d.SetBboxChanged()):d.CreateMesh(a,b)}
function SetMeshPoint(a,b,d,c,e,h,k,m){const p=this.GetWorldInfo();p.SetMeshPoint(a,b,{mode:0===d?"absolute":"relative",x:c,y:e,zElevation:h,u:k,v:m})&amp;&amp;p.SetBboxChanged()}function MeshColumns(){const a=this.GetWorldInfo();return a.HasMesh()?a.GetSourceMesh().GetHSize():0}function MeshRows(){const a=this.GetWorldInfo();return a.HasMesh()?a.GetSourceMesh().GetVSize():0}function SetElementVisible(a){const b=this.GetWorldInfo();a=2===a?!b.IsVisible():0!==a;b.IsVisible()!==a&amp;&amp;b.SetVisible(a)}
function SetElementCSSStyle(a,b){this.SetElementCSSStyle(a,b)}function SetElementAttribute(a,b){this.SetElementAttribute(a,""+b)}function RemoveElementAttribute(a){this.RemoveElementAttribute(a)}function SetElementFocus(){this.FocusElement()}function SetElementBlur(){this.BlurElement()}function IsElementFocused(){return this.IsElementFocused()}function SetElementEnabled(a){this._SetEnabled(0!==a)}function IsElementEnabled(){return this._IsEnabled()}
function CompareInstanceVar(a,b,d){return C3$jscomp$138.compare(this.GetInstance().GetInstanceVariableValue(a),b,d)}function IsBoolInstanceVarSet(a){return!!this.GetInstance().GetInstanceVariableValue(a)}function TemplateName(){const a=this._runtime.GetTemplateManager();return a?a.GetInstanceTemplateName(this.GetInstance()):""}
function PickInstVarHiLow(a,b){const d=this.GetCurrentSol(),c=d.GetInstances();if(!c.length)return!1;let e=c[0],h=e,k=e.GetInstanceVariableValue(b);for(let m=1,p=c.length;m&lt;p;++m){e=c[m];const q=e.GetInstanceVariableValue(b);if(0===a&amp;&amp;q&lt;k||1===a&amp;&amp;q&gt;k)k=q,h=e}d.PickOne(h);return!0}function PickByUID(a){return this._runtime.GetCurrentCondition().IsInverted()?PickByUID_Inverted(this,a):PickByUID_Normal(this,a)}
function PickByUID_Normal(a,b){b=a.GetRuntime().GetInstanceByUID(b);if(!b)return!1;const d=a.GetCurrentSol();if(!d.IsSelectAll()&amp;&amp;!d._GetOwnInstances().includes(b))return!1;if(a.IsFamily()){if(b.GetObjectClass().BelongsToFamily(a))return d.PickOne(b),a.ApplySolToContainer(),!0}else if(b.GetObjectClass()===a)return d.PickOne(b),a.ApplySolToContainer(),!0;return!1}
function PickByUID_Inverted(a,b){const d=a.GetCurrentSol();if(d.IsSelectAll()){d._SetSelectAll(!1);d.ClearArrays();var c=a.GetInstances();for(let h=0,k=c.length;h&lt;k;++h){var e=c[h];e.GetUID()===b?d._PushElseInstance(e):d._PushInstance(e)}a.ApplySolToContainer();return!!d._GetOwnInstances().length}c=d._GetOwnInstances();e=0;for(let h=0,k=c.length;h&lt;k;++h){const m=c[h];c[e]=m;m.GetUID()===b?d._PushElseInstance(m):++e}C3$jscomp$138.truncateArray(c,e);a.ApplySolToContainer();return!!c.length}
function Destroy(){this._runtime.DestroyInstance(this._inst)}function OnCreated(){return!0}function OnDestroyed(){return!0}function SetInstanceVar(a,b){this.GetInstance().SetInstanceVariableValue(a,b)}function AddInstanceVar(a,b){const d=this.GetInstance(),c=d.GetInstanceVariableValue(a);"number"===typeof c&amp;&amp;"number"!==typeof b?b=parseFloat(b):"string"===typeof c&amp;&amp;"string"!==typeof b&amp;&amp;(b=b.toString());d.SetInstanceVariableValue(a,c+b)}
function SubInstanceVar(a,b){const d=this.GetInstance(),c=d.GetInstanceVariableValue(a);"number"===typeof c&amp;&amp;("number"!==typeof b&amp;&amp;(b=parseFloat(b)),d.SetInstanceVariableValue(a,c-b))}function SetBoolInstanceVar(a,b){this.GetInstance().SetInstanceVariableValue(a,b?1:0)}function ToggleBoolInstanceVar(a){const b=this.GetInstance();b.SetInstanceVariableValue(a,0===b.GetInstanceVariableValue(a)?1:0)}
function LoadFromJsonString(a){try{var b=JSON.parse(a)}catch(d){console.error("Failed to load from JSON string: ",d);return}a=this.GetInstance();a._OnBeforeLoad("state");a.LoadFromJson(b,"state");b=C3$jscomp$138.New(C3$jscomp$138.Event,"afterloadinstance");b.instance=a;this._runtime.Dispatcher().dispatchEvent(b)}function AsJSON(){return JSON.stringify(this.GetInstance().SaveToJson("state"))}function ObjectTypeName(){return this.GetInstance().GetObjectClass().GetName()}
function Count(){const a=this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass();let b=a.GetInstanceCount();for(const d of this._runtime.instancesPendingCreateForObjectClass(a))++b;return b}function PickedCount(){return this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass().GetCurrentSol().GetInstances().length}function GetIID(){return this._inst.GetIID()}function GetUID(){return this._inst.GetUID()}
C3$jscomp$138.AddCommonACEs=function(a,b){const d=a[1],c=a[4],e=a[5],h=a[6],k=a[7],m=a[8],p=a[10],q=a[11],v=a[12],x=a[13],A=a[14],C=a[15],D=a[16],G=b.Cnds,E=b.Acts,J=b.Exps;a[3]&amp;&amp;(G.CompareX=CompareX,G.CompareY=CompareY,G.IsOnScreen=IsOnScreen,G.IsOutsideLayout=IsOutsideLayout,G.PickDistance=PickDistance,E.SetX=SetX,E.SetY=SetY,E.SetPos=SetPos,E.SetPosToObject=SetPosToObject,E.MoveForward=MoveForward,E.MoveAtAngle=MoveAtAngle,J.X=GetX,J.Y=GetY,J.dt=GetDt);c&amp;&amp;(G.CompareWidth=CompareWidth,G.CompareHeight=
CompareHeight,E.SetWidth=SetWidth,E.SetHeight=SetHeight,E.SetSize=SetSize,J.Width=GetWidth,J.Height=GetHeight,J.BBoxLeft=GetBboxLeft,J.BBoxTop=GetBboxTop,J.BBoxRight=GetBboxRight,J.BBoxBottom=GetBboxBottom);e&amp;&amp;(G.AngleWithin=IsAngleWithin,G.IsClockwiseFrom=IsAngleClockwiseFrom,G.IsBetweenAngles=IsBetweenAngles,E.SetAngle=SetAngle,E.RotateClockwise=RotateClockwise,E.RotateCounterclockwise=RotateCounterclockwise,E.RotateTowardAngle=RotateTowardAngle,E.RotateTowardPosition=RotateTowardPosition,E.SetTowardPosition=
SetTowardPosition,J.Angle=GetAngle);h&amp;&amp;(G.IsVisible=IsVisible,G.CompareOpacity=CompareOpacity,E.SetVisible=SetVisible,E.SetOpacity=SetOpacity,E.SetDefaultColor=SetDefaultColor,J.Opacity=GetOpacity,J.ColorValue=GetColor);k&amp;&amp;(G.IsOnLayer=IsOnLayer,G.PickTopBottom=PickTopBottom,G.CompareZElevation=CompareZElevation,E.MoveToTop=MoveToTop,E.MoveToBottom=MoveToBottom,E.MoveToLayer=MoveToLayer,E.ZMoveToObject=ZMoveToObject,E.SetZElevation=SetZElevation,J.LayerNumber=LayerNumber,J.LayerName=LayerName,J.ZIndex=
ZIndex,J.ZElevation=ZElevation,J.TotalZElevation=TotalZElevation);m&amp;&amp;(G.IsEffectEnabled=IsEffectEnabled,E.SetEffectEnabled=SetEffectEnabled,E.SetEffectParam=SetEffectParam);x&amp;&amp;(G.HasParent=HasParent,G.HasChildren=HasChildren,G.PickParent=PickParent,G.PickChildren=PickChildren,G.PickNthChild=PickNthChild,G.CompareChildCount=CompareChildCount,E.AddChild=AddChild,E.RemoveChild=RemoveChild,E.RemoveFromParent=RemoveFromParent,J.ChildCount=ChildCount,J.AllChildCount=AllChildCount);A&amp;&amp;(E.SetMeshSize=SetMeshSize,
E.SetMeshPoint=SetMeshPoint,J.MeshColumns=MeshColumns,J.MeshRows=MeshRows);p&amp;&amp;(G.IsVisible=IsVisible,E.SetVisible=SetElementVisible,E.SetCSSStyle=SetElementCSSStyle,E.SetElemAttribute=SetElementAttribute,E.RemoveElemAttribute=RemoveElementAttribute);q&amp;&amp;(G.IsFocused=IsElementFocused,E.SetFocus=SetElementFocus,E.SetBlur=SetElementBlur);v&amp;&amp;(G.IsEnabled=IsElementEnabled,E.SetEnabled=SetElementEnabled);C&amp;&amp;(G.OnCollision=OnCollision,G.IsOverlapping=IsOverlapping,G.IsOverlappingOffset=IsOverlappingOffset,
b.FinishCollisionCondition=FinishCollisionCondition);d||(G.CompareInstanceVar=CompareInstanceVar,G.IsBoolInstanceVarSet=IsBoolInstanceVarSet,G.PickInstVarHiLow=PickInstVarHiLow,G.PickByUID=PickByUID,E.SetInstanceVar=SetInstanceVar,E.AddInstanceVar=AddInstanceVar,E.SubInstanceVar=SubInstanceVar,E.SetBoolInstanceVar=SetBoolInstanceVar,E.ToggleBoolInstanceVar=ToggleBoolInstanceVar,G.OnCreated=OnCreated,G.OnDestroyed=OnDestroyed,E.Destroy=Destroy,E.LoadFromJsonString||(E.LoadFromJsonString=LoadFromJsonString),
J.AsJSON||(J.AsJSON=AsJSON),J.Count=Count,J.PickedCount=PickedCount,J.IID=GetIID,J.UID=GetUID,J.ObjectTypeName=ObjectTypeName);D&amp;&amp;(J.TemplateName=TemplateName)};"use strict";const C3$jscomp$139=self.C3;
C3$jscomp$139.ScheduledWait=class extends C3$jscomp$139.DefendedBase{constructor(a){super();this._eventSheetManager=a;this._type="";this._time=-1;this._signalTag="";this._isSignalled=!1;this._event=null;this._actIndex=0;this._solModifiers=[];this._sols=new Map;this._callingFunctionBlock=null;this._asyncId=-1;this._functionInnerLocalVars=this._functionParameters=null;this._shouldRelease=!1}Release(){this._type="";this._time=-1;this._signalTag="";this._functionInnerLocalVars=this._functionParameters=
this._callingFunctionBlock=this._event=null;this._asyncId=-1;C3$jscomp$139.clearArray(this._solModifiers);for(const a of this._sols.values())a.Release();this._sols.clear()}_Init(){var a=this._eventSheetManager,b=a.GetRuntime().GetAllObjectClasses();const d=a.GetCurrentEventStackFrame();this._event=d.GetCurrentEvent();this._actIndex=d.GetActionIndex()+1;if(a=a.FindFirstFunctionBlockParent(this._event))this._callingFunctionBlock=a,this._functionParameters=a.CaptureFunctionParameters(),this._functionInnerLocalVars=
a._GetAllInnerLocalVariables().map(c=&gt;c.GetValue()),a.IsAsync()&amp;&amp;(this._asyncId=a.PauseCurrentAsyncFunction());for(const c of b)if(b=c.GetCurrentSol(),!b.IsSelectAll()||this._event.HasSolModifier(c))this._solModifiers.push(c),this._sols.set(c,C3$jscomp$139.New(C3$jscomp$139.SolState,b))}InitTimer(a){this._type="timer";this._Init();this._time=this._eventSheetManager.GetRuntime().GetGameTime()+a}InitSignal(a){this._type="signal";this._Init();this._signalTag=a.toLowerCase()}InitPromise(a){this._type=
"promise";this._Init();a.then(()=&gt;this.SetSignalled()).catch(b=&gt;{console.warn("[C3 runtime] Promise rejected in 'Wait for previous actions to complete': ",b);this.SetSignalled()})}IsTimer(){return"timer"===this._type}IsSignal(){return"signal"===this._type}IsPromise(){return"promise"===this._type}GetSignalTag(){return this._signalTag}IsSignalled(){return this._isSignalled}SetSignalled(){this._isSignalled=!0}_ShouldRun(){return this.IsTimer()?this._time&lt;=this._eventSheetManager.GetRuntime().GetGameTime():
this.IsSignalled()}_RestoreState(a){a._Restore(this._event,this._actIndex);for(const [b,d]of this._sols.entries())a=b.GetCurrentSol(),d._Restore(a);if(a=this._callingFunctionBlock)a.SetFunctionParameters(this._functionParameters),a._GetAllInnerLocalVariables().map((b,d)=&gt;b.SetValue(this._functionInnerLocalVars[d])),a.IsAsync()&amp;&amp;a.ResumeAsyncFunction(this._asyncId)}_Run(a){this._RestoreState(a);this._event._ResumeActionsAndSubEvents(a);this._callingFunctionBlock&amp;&amp;this._callingFunctionBlock.IsAsync()&amp;&amp;
this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=!0}async _DebugRun(a){this._RestoreState(a);for(const b of this._event._DebugResumeActionsAndSubEvents(a))await this._eventSheetManager.GetRuntime().DebugBreak(b);this._callingFunctionBlock&amp;&amp;this._callingFunctionBlock.IsAsync()&amp;&amp;this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=
!0}ShouldRelease(){return this._shouldRelease}RemoveInstances(a){for(const b of this._sols.values())b.RemoveInstances(a)}_SaveToJson(){const a={},b={t:this._time,st:this._signalTag,s:this._isSignalled,ev:this._event.GetSID(),sm:this._solModifiers.map(d=&gt;d.GetSID()),sols:a};this._event._HasActionIndex(this._actIndex)&amp;&amp;(b.act=this._event.GetActionAt(this._actIndex).GetSID());for(const [d,c]of this._sols)a[d.GetSID().toString()]=c._SaveToJson();return b}static _CreateFromJson(a,b){const d=a.GetRuntime();
var c=a.GetEventBlockBySID(b.ev);if(!c)return null;let e=0;if(b.hasOwnProperty("act")){var h=a.GetActionBySID(b.act);if(!h)return null;e=h.GetIndex()}h=C3$jscomp$139.New(C3$jscomp$139.ScheduledWait,a);h._time=b.t;h._type=-1===h._time?"signal":"timer";h._signalTag=b.st;h._isSignalled=b.s;h._event=c;h._actIndex=e;for(var k of b.sm)(c=d.GetObjectClassBySID(k))&amp;&amp;h._solModifiers.push(c);for(const [m,p]of Object.entries(b.sols))if(b=parseInt(m,10),b=d.GetObjectClassBySID(b))k=C3$jscomp$139.New(C3$jscomp$139.SolState,
null),k._LoadFromJson(a,p),h._sols.set(b,k);return h}};"use strict";const C3$jscomp$140=self.C3;
C3$jscomp$140.SolState=class extends C3$jscomp$140.DefendedBase{constructor(a){super();this._objectClass=null;this._isSelectAll=!0;this._instances=[];a&amp;&amp;(this._objectClass=a.GetObjectClass(),this._isSelectAll=a.IsSelectAll(),C3$jscomp$140.shallowAssignArray(this._instances,a._GetOwnInstances()))}Release(){this._objectClass=null;C3$jscomp$140.clearArray(this._instances)}_Restore(a){a._SetSelectAll(this._isSelectAll);C3$jscomp$140.shallowAssignArray(a._GetOwnInstances(),this._instances)}RemoveInstances(a){C3$jscomp$140.arrayRemoveAllInSet(this._instances,
a)}_SaveToJson(){return{sa:this._isSelectAll,insts:this._instances.map(a=&gt;a.GetUID())}}_LoadFromJson(a,b){a=a.GetRuntime();this._isSelectAll=!!b.sa;C3$jscomp$140.clearArray(this._instances);for(const d of b.insts)(b=a.GetInstanceByUID(d))&amp;&amp;this._instances.push(b)}};"use strict";const C3$jscomp$141=self.C3;function GetNextParamMap(a,b){let d=a.get(b);d||(d=new Map,a.set(b,d));return d}
C3$jscomp$141.SDKPluginBase=class extends C3$jscomp$141.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._isSingleGlobal=!!a.isSingleGlobal;this._isWorldType=!!a.isWorld;this._isRotatable=!!a.isRotatable;this._mustPredraw=!!a.mustPredraw;this._hasEffects=!!a.hasEffects;this._supportsSceneGraph=!!a.supportsSceneGraph;this._supportsMesh=!!a.supportsMesh;this._singleGlobalObjectClass=null;this._boundACEMethodCache=new Map;this._boundACEMethodCache_1param=new Map;this._boundACEMethodCache_2params=
new Map;this._boundACEMethodCache_3params=new Map}Release(){this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}IsSingleGlobal(){return this._isSingleGlobal}IsWorldType(){return this._isWorldType}IsRotatable(){return this._isRotatable}MustPreDraw(){return this._mustPredraw}HasEffects(){return this._hasEffects}SupportsSceneGraph(){return this._supportsSceneGraph}SupportsMesh(){return this._supportsMesh}_GetBoundACEMethod(a,b){if(!b)throw Error("missing 'this' binding");let d=this._boundACEMethodCache.get(a);
if(d)return d;d=a.bind(b);this._boundACEMethodCache.set(a,d);return d}_GetBoundACEMethod_1param(a,b,d){if(!b)throw Error("missing 'this' binding");const c=GetNextParamMap(this._boundACEMethodCache_1param,a);let e=c.get(d);if(e)return e;e=a.bind(b,d);c.set(d,e);return e}_GetBoundACEMethod_2params(a,b,d,c){if(!b)throw Error("missing 'this' binding");var e=GetNextParamMap(this._boundACEMethodCache_2params,a);e=GetNextParamMap(e,d);let h=e.get(c);if(h)return h;h=a.bind(b,d,c);e.set(c,h);return h}_GetBoundACEMethod_3params(a,
b,d,c,e){if(!b)throw Error("missing 'this' binding");var h=GetNextParamMap(this._boundACEMethodCache_3params,a);h=GetNextParamMap(h,d);h=GetNextParamMap(h,c);let k=h.get(e);if(k)return k;k=a.bind(b,d,c,e);h.set(e,k);return k}_SetSingleGlobalObjectClass(a){if(!this.IsSingleGlobal())throw Error("must be single-global plugin");this._singleGlobalObjectClass=a}GetSingleGlobalObjectClass(){if(!this.IsSingleGlobal())throw Error("must be single-global plugin");return this._singleGlobalObjectClass}GetSingleGlobalInstance(){if(!this.IsSingleGlobal())throw Error("must be single-global plugin");
return this._singleGlobalObjectClass.GetSingleGlobalInstance()}};"use strict";const C3$jscomp$142=self.C3;
C3$jscomp$142.SDKDOMPluginBase=class extends C3$jscomp$142.SDKPluginBase{constructor(a,b){super(a);this._domComponentId=b;this._nextElementId=0;this._instMap=new Map;this.AddElementMessageHandler("elem-focused",d=&gt;d._OnElemFocused());this.AddElementMessageHandler("elem-blurred",d=&gt;{d&amp;&amp;d._OnElemBlurred()})}Release(){super.Release()}_AddElement(a){const b=this._nextElementId++;this._instMap.set(b,a);return b}_RemoveElement(a){this._instMap.delete(a)}AddElementMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,
a,d=&gt;{const c=this._instMap.get(d.elementId);b(c,d)})}};"use strict";const C3$jscomp$143=self.C3;C3$jscomp$143.SDKTypeBase=class extends C3$jscomp$143.DefendedBase{constructor(a){super();this._objectClass=a;this._runtime=a.GetRuntime();this._plugin=a.GetPlugin()}Release(){this._plugin=this._runtime=this._objectClass=null}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetImageInfo(){return this._objectClass.GetImageInfo()}FinishCondition(a){}BeforeRunAction(a){}AfterRunAction(a){}LoadTextures(a){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(a){}LoadTilemapData(){}GetScriptInterfaceClass(){return null}};
"use strict";const C3$jscomp$144=self.C3;
C3$jscomp$144.SDKInstanceBase=class extends C3$jscomp$144.DefendedBase{constructor(a,b){super();this._inst=a;this._domComponentId=b;this._runtime=a.GetRuntime();this._objectClass=this._inst.GetObjectClass();this._sdkType=this._objectClass.GetSdkType();this._tick2Func=this._tickFunc=null;this._isTicking2=this._isTicking=!1;this._disposables=null;this._wasReleased=!1}Release(){this._wasReleased=!0;this._StopTicking();this._StopTicking2();this._tick2Func=this._tickFunc=null;this._disposables&amp;&amp;(this._disposables.Release(),
this._disposables=null);this._sdkType=this._objectClass=this._runtime=this._inst=null}WasReleased(){return this._wasReleased}GetInstance(){return this._inst}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetPlugin(){return this._sdkType.GetPlugin()}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._inst.GetInterfaceClass()}Trigger(a){return this._runtime.Trigger(a,this._inst,null)}DebugTrigger(a){return this._runtime.DebugTrigger(a,this._inst,null)}TriggerAsync(a){return this._runtime.TriggerAsync(a,
this._inst,null)}FastTrigger(a,b){return this._runtime.FastTrigger(a,this._inst,b)}DebugFastTrigger(a,b){return this._runtime.DebugFastTrigger(a,this._inst,b)}ScheduleTriggers(a){return this._runtime.ScheduleTriggers(a)}AddDOMMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,a,b)}AddDOMMessageHandlers(a){for(const [b,d]of a)this.AddDOMMessageHandler(b,d)}PostToDOM(a,b){this._runtime.PostComponentMessageToDOM(this._domComponentId,a,b)}PostToDOMAsync(a,b){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId,
a,b)}_PostToDOMMaybeSync(a,b){if(this._runtime.IsInWorker())this.PostToDOM(a,b);else return window.c3_runtimeInterface._OnMessageFromRuntime({type:"event",component:this._domComponentId,handler:a,data:b,responseId:null})}Tick(){}Tick2(){}_StartTicking(){this._isTicking||(this._tickFunc||(this._tickFunc=()=&gt;this.Tick()),this._runtime.Dispatcher().addEventListener("tick",this._tickFunc),this._isTicking=!0)}_StopTicking(){this._isTicking&amp;&amp;(this._runtime.Dispatcher().removeEventListener("tick",this._tickFunc),
this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._tick2Func||(this._tick2Func=()=&gt;this.Tick2()),this._runtime.Dispatcher().addEventListener("tick2",this._tick2Func),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&amp;&amp;(this._runtime.Dispatcher().removeEventListener("tick2",this._tick2Func),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}GetDebuggerProperties(){return[]}SaveToJson(){return null}LoadFromJson(a){}GetPropertyValueByIndex(a){}SetPropertyValueByIndex(a,
b){}OffsetPropertyValueByIndex(a,b){if(0!==b){var d=this.GetPropertyValueByIndex(a);if("number"!==typeof d)throw Error("expected number");this.SetPropertyValueByIndex(a,d+b)}}SetPropertyColorOffsetValueByIndex(a,b,d,c){}CallAction(a,...b){a.call(this,...b)}CallExpression(a,...b){return a.call(this,...b)}GetScriptInterfaceClass(){return null}DispatchScriptEvent(a,b,d){const c=this.GetScriptInterface();a=C3$jscomp$144.New(C3$jscomp$144.Event,a,b);a.instance=c;d&amp;&amp;Object.assign(a,d);c.dispatchEvent(a)}};
"use strict";const C3$jscomp$145=self.C3;
C3$jscomp$145.SDKWorldInstanceBase=class extends C3$jscomp$145.SDKInstanceBase{constructor(a,b){super(a,b);this._worldInfo=a.GetWorldInfo();this._webglcontextrestored_handler=this._webglcontextlost_handler=null}Release(){if(this._webglcontextlost_handler){const a=this._runtime.Dispatcher();a.removeEventListener("webglcontextlost",this._webglcontextlost_handler);a.removeEventListener("webglcontextrestored",this._webglcontextrestored_handler);this._webglcontextrestored_handler=this._webglcontextlost_handler=
null}this._worldInfo=null;super.Release()}HandleWebGLContextLoss(){if(!this._webglcontextlost_handler){this._webglcontextlost_handler=()=&gt;this.OnWebGLContextLost();this._webglcontextrestored_handler=()=&gt;this.OnWebGLContextRestored();var a=this._runtime.Dispatcher();a.addEventListener("webglcontextlost",this._webglcontextlost_handler);a.addEventListener("webglcontextrestored",this._webglcontextrestored_handler)}}OnWebGLContextLost(){}OnWebGLContextRestored(){}GetWorldInfo(){return this._worldInfo}IsOriginalSizeKnown(){return!1}GetOriginalWidth(){if(!this.IsOriginalSizeKnown())throw Error("original size not known");
const a=this.GetCurrentImageInfo();if(a)return a.GetWidth()}GetOriginalHeight(){if(!this.IsOriginalSizeKnown())throw Error("original size not known");const a=this.GetCurrentImageInfo();if(a)return a.GetHeight()}GetCurrentImageInfo(){return null}GetCurrentSurfaceSize(){var a=this.GetCurrentImageInfo();return a&amp;&amp;(a=a.GetTexture())?[a.GetWidth(),a.GetHeight()]:[100,100]}GetCurrentTexRect(){const a=this.GetCurrentImageInfo();return a?a.GetTexRect():null}GetCurrentTexQuad(){const a=this.GetCurrentImageInfo();
return a?a.GetTexQuad():null}IsCurrentTexRotated(){const a=this.GetCurrentImageInfo();return a?a.IsRotated():!1}GetImagePoint(a){a=this._inst.GetWorldInfo();return[a.GetX(),a.GetY()]}LoadTilemapData(a,b,d){}TestPointOverlapTile(a,b){}RendersToOwnZPlane(){return!0}};"use strict";const C3$jscomp$146=self.C3,tempRect$jscomp$5=C3$jscomp$146.New(C3$jscomp$146.Rect);
C3$jscomp$146.SDKDOMInstanceBase=class extends C3$jscomp$146.SDKWorldInstanceBase{constructor(a,b){super(a,b);this._elementId=this.GetPlugin()._AddElement(this);this._isElementShowing=!0;this._autoFontSize=this._elemHasFocus=!1;this._autoFontSizeOffset=-.2;this._lastRect=C3$jscomp$146.New(C3$jscomp$146.Rect,0,0,-1,-1);a=this._runtime.GetCanvasManager();this._lastWindowWidth=a.GetLastWidth();this._lastWindowHeight=a.GetLastHeight();this._isPendingUpdateState=!1;this._StartTicking()}Release(){this.GetPlugin()._RemoveElement(this._elementId);
this.PostToDOMElement("destroy");this._elementId=-1;super.Release()}_GetElementInDOMMode(){if(this._runtime.IsInWorker())throw Error("not valid in worker mode");return this._PostToDOMElementMaybeSync("get-element")}PostToDOMElement(a,b){b||(b={});b.elementId=this._elementId;this.PostToDOM(a,b)}_PostToDOMElementMaybeSync(a,b){b||(b={});b.elementId=this._elementId;return this._PostToDOMMaybeSync(a,b)}PostToDOMElementAsync(a,b){b||(b={});b.elementId=this._elementId;return this.PostToDOMAsync(a,b)}CreateElement(a){a||
(a={});const b=this.GetWorldInfo().IsVisible();a.elementId=this._elementId;a.isVisible=b;Object.assign(a,this.GetElementState());this._isElementShowing=!!a.isVisible;this._PostToDOMMaybeSync("create",a);this._UpdatePosition(!0)}SetElementVisible(a){a=!!a;this._isElementShowing!==a&amp;&amp;(this._isElementShowing=a,this.PostToDOMElement("set-visible",{isVisible:a}))}Tick(){this._UpdatePosition(!1)}_ShouldPreserveElement(){const a=this._runtime.GetCanvasManager().GetFullscreenMode();return"Android"===C3$jscomp$146.Platform.OS&amp;&amp;
("scale-inner"===a||"scale-outer"===a||"crop"===a)}_UpdatePosition(a){var b=this.GetWorldInfo();const d=b.GetLayer();var c=b.GetBoundingBox();let [e,h]=d.LayerToCanvasCss(c.getLeft(),c.getTop()),[k,m]=d.LayerToCanvasCss(c.getRight(),c.getBottom());c=this._runtime.GetCanvasManager();var p=c.GetCssWidth();const q=c.GetCssHeight();if(b.IsVisible()&amp;&amp;d.IsVisible()){if(!this._ShouldPreserveElement()){if(0&gt;=k||0&gt;=m||e&gt;=p||h&gt;=q){this.SetElementVisible(!1);return}1&gt;e&amp;&amp;(e=1);1&gt;h&amp;&amp;(h=1);k&gt;=p&amp;&amp;(k=p-1);m&gt;=q&amp;&amp;
(m=q-1)}tempRect$jscomp$5.set(e,h,k,m);b=c.GetLastWidth();p=c.GetLastHeight();!a&amp;&amp;tempRect$jscomp$5.equals(this._lastRect)&amp;&amp;this._lastWindowWidth===b&amp;&amp;this._lastWindowHeight===p?this.SetElementVisible(!0):(this._lastRect.copy(tempRect$jscomp$5),this._lastWindowWidth=b,this._lastWindowHeight=p,this.SetElementVisible(!0),a=null,this._autoFontSize&amp;&amp;(a=d.GetDisplayScale()+this._autoFontSizeOffset),this.PostToDOMElement("update-position",{left:Math.round(this._lastRect.getLeft())+c.GetCanvasClientX(),
top:Math.round(this._lastRect.getTop())+c.GetCanvasClientY(),width:Math.round(this._lastRect.width()),height:Math.round(this._lastRect.height()),fontSize:a}))}else this.SetElementVisible(!1)}FocusElement(){this._PostToDOMElementMaybeSync("focus",{focus:!0})}BlurElement(){this._PostToDOMElementMaybeSync("focus",{focus:!1})}_OnElemFocused(){this._elemHasFocus=!0}_OnElemBlurred(){this._elemHasFocus=!1}IsElementFocused(){return this._elemHasFocus}SetElementCSSStyle(a,b){this.PostToDOMElement("set-css-style",
{prop:C3$jscomp$146.CSSToCamelCase(a),val:b})}SetElementAttribute(a,b){this.PostToDOMElement("set-attribute",{name:a,val:b})}RemoveElementAttribute(a){this.PostToDOMElement("remove-attribute",{name:a})}UpdateElementState(){this._isPendingUpdateState||(this._isPendingUpdateState=!0,Promise.resolve().then(()=&gt;{this._isPendingUpdateState=!1;this.PostToDOMElement("update-state",this.GetElementState())}))}GetElementState(){}GetElementId(){return this._elementId}};"use strict";
const C3$jscomp$147=self.C3,IBehavior$jscomp$1=self.IBehavior;
C3$jscomp$147.SDKBehaviorBase=class extends C3$jscomp$147.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._myObjectClasses=C3$jscomp$147.New(C3$jscomp$147.ArraySet);this._myInstances=C3$jscomp$147.New(C3$jscomp$147.ArraySet);this._iBehavior=null;this._scriptInterfaceClass=a.scriptInterfaceClass||null}Release(){this._myInstances.Release();this._myObjectClasses.Release();this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}_AddObjectClass(a){this._myObjectClasses.Add(a)}GetObjectClasses(){return this._myObjectClasses.GetArray()}_AddInstance(a){this._myInstances.Add(a)}_RemoveInstance(a){this._myInstances.Delete(a)}GetInstances(){return this._myInstances.GetArray()}GetIBehavior(){if(null===this._iBehavior){const a=
this._scriptInterfaceClass;if(a){if(this._iBehavior=new a(this),!(this._iBehavior instanceof IBehavior$jscomp$1))throw new TypeError("script interface class must derive from IBehavior");}else this._iBehavior=new IBehavior$jscomp$1(this)}return this._iBehavior}};"use strict";const C3$jscomp$148=self.C3;
C3$jscomp$148.SDKBehaviorTypeBase=class extends C3$jscomp$148.DefendedBase{constructor(a){super();this._runtime=a.GetRuntime();this._behaviorType=a;this._objectClass=a.GetObjectClass();this._behavior=a.GetBehavior();this._behavior._AddObjectClass(this._objectClass)}Release(){this._behavior=this._objectClass=this._behaviorType=this._runtime=null}GetBehaviorType(){return this._behaviorType}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetBehavior(){return this._behavior}};
"use strict";const C3$jscomp$149=self.C3;
C3$jscomp$149.SDKBehaviorInstanceBase=class extends C3$jscomp$149.DefendedBase{constructor(a,b){super();this._behInst=a;this._domComponentId=b;this._inst=a.GetObjectInstance();this._runtime=a.GetRuntime();this._behaviorType=a.GetBehaviorType();this._sdkType=this._behaviorType.GetSdkType();this._isPostTicking=this._isTicking2=this._isTicking=!1;this._disposables=null}Release(){this._StopTicking();this._StopTicking2();this._StopPostTicking();this._disposables&amp;&amp;(this._disposables.Release(),this._disposables=
null);this._sdkType=this._behaviorType=this._runtime=this._inst=this._behInst=null}GetBehavior(){return this._behaviorType.GetBehavior()}GetBehaviorInstance(){return this._behInst}GetObjectInstance(){return this._inst}GetObjectClass(){return this._inst.GetObjectClass()}GetWorldInfo(){return this._inst.GetWorldInfo()}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._behInst.GetScriptInterface()}Trigger(a){return this._runtime.Trigger(a,
this._inst,this._behaviorType)}DebugTrigger(a){return this._runtime.DebugTrigger(a,this._inst,this._behaviorType)}TriggerAsync(a){return this._runtime.TriggerAsync(a,this._inst,this._behaviorType)}PostCreate(){}Tick(){}Tick2(){}PostTick(){}_StartTicking(){this._isTicking||(this._runtime._AddBehInstToTick(this),this._isTicking=!0)}_StopTicking(){this._isTicking&amp;&amp;(this._runtime._RemoveBehInstToTick(this),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._runtime._AddBehInstToTick2(this),
this._isTicking2=!0)}_StopTicking2(){this._isTicking2&amp;&amp;(this._runtime._RemoveBehInstToTick2(this),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}_StartPostTicking(){this._isPostTicking||(this._runtime._AddBehInstToPostTick(this),this._isPostTicking=!0)}_StopPostTicking(){this._isPostTicking&amp;&amp;(this._runtime._RemoveBehInstToPostTick(this),this._isPostTicking=!1)}IsPostTicking(){return this._isPostTicking}GetDebuggerProperties(){return[]}AddDOMMessageHandler(a,b){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,
a,b)}OnSpriteFrameChanged(a,b){}SaveToJson(){return null}LoadFromJson(a){}GetPropertyValueByIndex(a){}SetPropertyValueByIndex(a,b){}OffsetPropertyValueByIndex(a,b){if(0!==b){var d=this.GetPropertyValueByIndex(a);if("number"!==typeof d)throw Error("expected number");this.SetPropertyValueByIndex(a,d+b)}}SetPropertyColorOffsetValueByIndex(a,b,d,c){}CallAction(a,...b){a.call(this,...b)}CallExpression(a,...b){return a.call(this,...b)}GetScriptInterfaceClass(){return null}DispatchScriptEvent(a,b,d){const c=
this.GetScriptInterface();a=C3$jscomp$149.New(C3$jscomp$149.Event,a,b);a.behaviorInstance=c;a.instance=c.instance;d&amp;&amp;Object.assign(a,d);c.dispatchEvent(a)}};"use strict";const C3$jscomp$150=self.C3;C3$jscomp$150.Plugins={};C3$jscomp$150.Behaviors={};
C3$jscomp$150.PluginManager=class extends C3$jscomp$150.DefendedBase{constructor(a){super();this._runtime=a;this._allPlugins=[];this._pluginsByCtor=new Map;this._systemPlugin=null;this._allBehaviors=[];this._behaviorsByCtor=new Map;this._jumpthruBehavior=this._solidBehavior=null}CreatePlugin(a){const b=this._runtime.GetObjectReference(a[0]);if(!b)throw Error("missing plugin");C3$jscomp$150.AddCommonACEs(a,b);a=C3$jscomp$150.New(b,{runtime:this._runtime,isSingleGlobal:a[1],isWorld:a[2],isRotatable:a[5],
hasEffects:a[8],mustPredraw:a[9],supportsSceneGraph:a[13],supportsMesh:a[14]});a.OnCreate();this._allPlugins.push(a);this._pluginsByCtor.set(b,a)}CreateSystemPlugin(){this._systemPlugin=C3$jscomp$150.New(C3$jscomp$150.Plugins.System,{runtime:this._runtime,isSingleGlobal:!0});this._systemPlugin.OnCreate()}CreateBehavior(a){a=this._runtime.GetObjectReference(a[1]);if(!a)throw Error("missing behavior");const b=C3$jscomp$150.New(a,{runtime:this._runtime});b.OnCreate();this._allBehaviors.push(b);this._behaviorsByCtor.set(a,
b);!this._solidBehavior&amp;&amp;C3$jscomp$150.Behaviors.solid&amp;&amp;b instanceof C3$jscomp$150.Behaviors.solid?this._solidBehavior=b:!this._jumpthruBehavior&amp;&amp;C3$jscomp$150.Behaviors.jumpthru&amp;&amp;b instanceof C3$jscomp$150.Behaviors.jumpthru&amp;&amp;(this._jumpthruBehavior=b)}GetPluginByConstructorFunction(a){return this._pluginsByCtor.get(a)||null}HasBehaviorByConstructorFunction(a){return this._behaviorsByCtor.has(a)}GetBehaviorByConstructorFunction(a){return this._behaviorsByCtor.get(a)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}};
"use strict";const C3$jscomp$151=self.C3,allImageInfos=new Set;
C3$jscomp$151.ImageInfo=class extends C3$jscomp$151.DefendedBase{constructor(){super();this._url="";this._height=this._width=this._offsetY=this._offsetX=this._size=0;this._hasMetaData=this._isRotated=!1;this._imageAsset=null;this._textureState="";this._rcTex=C3$jscomp$151.New(C3$jscomp$151.Rect);this._quadTex=C3$jscomp$151.New(C3$jscomp$151.Quad);this._blobUrl="";this._iImageInfo=new self.IImageInfo(this);allImageInfos.add(this)}Release(){this.ReleaseTexture();this._imageAsset=null;allImageInfos.delete(this);
this.ReleaseBlobURL()}static OnWebGLContextLost(){for(const a of allImageInfos)a._textureState="",a._rcTex.set(0,0,0,0),a._quadTex.setFromRect(a._rcTex)}LoadData(a){this._url=a[0];this._size=a[1];this._offsetX=a[2];this._offsetY=a[3];this._width=a[4];this._height=a[5];this._isRotated=a[6];this._hasMetaData=!0}LoadDynamicAsset(a,b){if(this._imageAsset)throw Error("already loaded asset");this._url=b;const d={};C3$jscomp$151.IsAbsoluteURL(b)&amp;&amp;(d.loadPolicy="remote");this.LoadAsset(a,d);return this._imageAsset.Load()}ReplaceWith(a){if(a===
this)throw Error("cannot replace with self");this.ReleaseTexture();this._url=a._url;this._size=a._size;this._offsetX=a._offsetX;this._offsetY=a._offsetY;this._width=a._width;this._height=a._height;this._isRotated=a._isRotated;this._hasMetaData=a._hasMetaData;this._imageAsset=a._imageAsset;this._textureState=a._textureState;this._rcTex=a._rcTex;this._quadTex=a._quadTex;this.ReleaseBlobURL()}GetURL(){return this._url}GetSize(){return this._size}GetOffsetX(){return this._offsetX}GetOffsetY(){return this._offsetY}IsRotated(){return this._isRotated}GetWidth(){return this._width}GetHeight(){return this._height}GetSheetWidth(){return this._imageAsset.GetWidth()}GetSheetHeight(){return this._imageAsset.GetHeight()}LoadAsset(a,
b){if(this._imageAsset)throw Error("already got asset");b=Object.assign({},b,{url:this.GetURL(),size:this.GetSize()});this._imageAsset=a.LoadImage(b)}IsLoaded(){return this._imageAsset&amp;&amp;this._imageAsset.IsLoaded()}async LoadStaticTexture(a,b){if(!this._imageAsset)throw Error("no asset");if(this._textureState)throw Error("already loaded texture");this._textureState="loading";a=await this._imageAsset.LoadStaticTexture(a,b);if(!a)return this._textureState="",null;this._textureState="loaded";this._hasMetaData||
(this._width=a.GetWidth(),this._height=a.GetHeight(),this._hasMetaData=!0);this._rcTex.set(this._offsetX,this._offsetY,this._offsetX+(this._isRotated?this._height:this._width),this._offsetY+(this._isRotated?this._width:this._height));this._rcTex.divide(a.GetWidth(),a.GetHeight());this._quadTex.setFromRect(this._rcTex);this._isRotated&amp;&amp;this._quadTex.rotatePointsAnticlockwise();return a}ReleaseTexture(){this._textureState&amp;&amp;(this._imageAsset&amp;&amp;this._imageAsset.ReleaseTexture(),this._textureState="",this._rcTex.set(0,
0,0,0),this._quadTex.setFromRect(this._rcTex))}GetTexture(){return this._imageAsset?this._imageAsset.GetTexture():null}GetTexRect(){return this._rcTex}GetTexQuad(){return this._quadTex}GetIImageInfo(){return this._iImageInfo}async ExtractImageToCanvas(){const a=await this._imageAsset.LoadToDrawable(),b=C3$jscomp$151.CreateCanvas(this._width,this._height),d=b.getContext("2d");this._isRotated?(d.rotate(Math.PI/-2),d.translate(-this._height,0),d.drawImage(a,this._offsetX,this._offsetY,this._height,this._width,
0,0,this._height,this._width)):d.drawImage(a,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height);return b}async ExtractImageToBlobURL(){if(this._blobUrl)return this._blobUrl;var a=await this.ExtractImageToCanvas();a=await C3$jscomp$151.CanvasToBlob(a);return this._blobUrl=URL.createObjectURL(a)}ReleaseBlobURL(){this._blobUrl&amp;&amp;(URL.revokeObjectURL(this._blobUrl),this._blobUrl="")}};"use strict";const C3$jscomp$152=self.C3;
C3$jscomp$152.AnimationInfo=class extends C3$jscomp$152.DefendedBase{constructor(a){super();this._name=a[0];this._speed=a[1];this._isLooping=!!a[2];this._repeatCount=a[3];this._repeatTo=a[4];this._isPingPong=!!a[5];this._sid=a[6];this._frames=a[7].map(b=&gt;C3$jscomp$152.New(C3$jscomp$152.AnimationFrameInfo,b));this._iAnimation=new self.IAnimation(this)}Release(){for(const a of this._frames)a.Release();C3$jscomp$152.clearArray(this._frames)}LoadAllAssets(a){for(const b of this._frames)b.GetImageInfo().LoadAsset(a)}LoadAllTextures(a,
b){return Promise.all(this._frames.map(d=&gt;d.GetImageInfo().LoadStaticTexture(a,b)))}ReleaseAllTextures(){for(const a of this._frames)a.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(a){a=Math.floor(a);if(0&gt;a||a&gt;=this._frames.length)throw new RangeError("invalid frame");return this._frames[a]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}GetIAnimation(){return this._iAnimation}};
"use strict";const C3$jscomp$153=self.C3;
C3$jscomp$153.AnimationFrameInfo=class extends C3$jscomp$153.DefendedBase{constructor(a){super();this._imageInfo=C3$jscomp$153.New(C3$jscomp$153.ImageInfo);this._imageInfo.LoadData(a);this._duration=a[7];this._origin=C3$jscomp$153.New(C3$jscomp$153.Vector2,a[8],a[9]);this._imagePoints=a[10].map(b=&gt;C3$jscomp$153.New(C3$jscomp$153.ImagePoint,this,b));this._imagePointsByName=new Map;for(const b of this._imagePoints)this._imagePointsByName.set(b.GetName().toLowerCase(),b);this._collisionPoly=null;a=a[11];
6&lt;=a.length&amp;&amp;(this._collisionPoly=C3$jscomp$153.New(C3$jscomp$153.CollisionPoly,a));this._iAnimationFrame=new self.IAnimationFrame(this)}Release(){this._collisionPoly&amp;&amp;(this._collisionPoly.Release(),this._collisionPoly=null);this._imageInfo.Release();this._imageInfo=null}GetImageInfo(){return this._imageInfo}GetDuration(){return this._duration}GetOriginX(){return this._origin.getX()}GetOriginY(){return this._origin.getY()}GetCollisionPoly(){return this._collisionPoly}GetImagePointByName(a){return this._imagePointsByName.get(a.toLowerCase())||
null}GetImagePointByIndex(a){a=Math.floor(a);return 0&gt;a||a&gt;=this._imagePoints.length?null:this._imagePoints[a]}GetImagePointCount(){return this._imagePoints.length}GetIAnimationFrame(){return this._iAnimationFrame}};"use strict";const C3$jscomp$154=self.C3;C3$jscomp$154.ImagePoint=class extends C3$jscomp$154.DefendedBase{constructor(a,b){super();this._afi=a;this._name=b[0];this._pos=C3$jscomp$154.New(C3$jscomp$154.Vector2,b[1],b[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}};
"use strict";const C3$jscomp$155=self.C3,C3Debugger$jscomp$1=self.C3Debugger,IObjectClass$jscomp$1=self.IObjectClass;
C3$jscomp$155.ObjectClass=class extends C3$jscomp$155.DefendedBase{constructor(a,b,d){super();const c=a.GetObjectReference(d[1]);this._runtime=a;this._plugin=a.GetPluginManager().GetPluginByConstructorFunction(c);this._sdkType=null;this._instSdkCtor=c.Instance;this._index=b;this._sid=d[11];this._name=d[0];this._jsPropName=this._runtime.GetJsPropName(d[14]);this._isGlobal=!!d[9];this._isFamily=!!d[2];this._isOnLoaderLayout=!!d[10];this._instVars=d[3].map(e=&gt;({sid:e[0],type:e[1],name:e[2],jsPropName:a.GetJsPropName(e[3])}));
this._behaviorsCount=d[4];this._effectsCount=d[5];this._isWorldType=this._plugin.IsWorldType();this._effectList=null;this._collisionGrid=C3$jscomp$155.New(C3$jscomp$155.SparseGrid,a.GetOriginalViewportWidth(),a.GetOriginalViewportHeight());this._anyCollisionCellChanged=!0;this._anyInstanceParallaxed=!1;this._familyMembersSet=this._familyMembers=null;this._familyIndex=-1;this._familyEffectMap=this._familyBehaviorMap=this._familyInstVarMap=this._familiesSet=this._families=null;this._isInContainer=!1;
this._container=null;this._behaviorTypes=d[8].map(e=&gt;C3$jscomp$155.BehaviorType.Create(this,e));this._behaviorTypesIncludingInherited=[];this._behaviorsByName=new Map;this._behaviorNameToIndex=new Map;this._usedBehaviorCtors=new Set;this._solStack=C3$jscomp$155.New(C3$jscomp$155.SolStack,this);this._defaultInstanceData=null;this._defaultLayerIndex=0;this._isContained=!1;this._animationsBySid=this._animationsByName=this._animations=this._imageInfo=this._container=null;this._textureRefCount=0;this._savedData=
new Map;this._unsavedData=new Map;this._instances=[];this._iidsStale=!0;this._plugin.HasEffects()&amp;&amp;(this._effectList=C3$jscomp$155.New(C3$jscomp$155.EffectList,this,d[12]));d[6]&amp;&amp;(this._imageInfo=C3$jscomp$155.New(C3$jscomp$155.ImageInfo),this._imageInfo.LoadData(d[6]));if(d[7]){this._animations=d[7].map(e=&gt;C3$jscomp$155.New(C3$jscomp$155.AnimationInfo,e));this._animationsByName=new Map;this._animationsBySid=new Map;for(const e of this._animations)this._animationsByName.set(e.GetName().toLowerCase(),
e),this._animationsBySid.set(e.GetSID(),e)}this._isFamily?(this._familyMembers=[],this._familyMembersSet=new Set,this._familyIndex=this._runtime._GetNextFamilyIndex()):(this._families=[],this._familiesSet=new Set,this._familyInstVarMap=[],this._familyBehaviorMap=[],this._familyEffectMap=[]);this._sdkType=C3$jscomp$155.New(c.Type,this,d[15]);this._instanceUserScriptClass=this._iObjectClass=null;this._userScriptDispatcher=C3$jscomp$155.New(C3$jscomp$155.Event.Dispatcher);if(b=this._sdkType.GetScriptInterfaceClass()){if(this._iObjectClass=
new b(this),!(this._iObjectClass instanceof IObjectClass$jscomp$1))throw new TypeError("script interface class must derive from IObjectClass");}else this._iObjectClass=new IObjectClass$jscomp$1(this);d[13]&amp;&amp;(b=d[13])&amp;&amp;this._sdkType.LoadTilemapData(b[0],b[1],b[2]);this._runtime.UsesLoaderLayout()&amp;&amp;!this._isFamily&amp;&amp;!this._isOnLoaderLayout&amp;&amp;this._isWorldType||this.OnCreate();this._plugin.IsSingleGlobal()&amp;&amp;(this._plugin._SetSingleGlobalObjectClass(this),this._CreateSingleGlobalInstance(d))}static Create(a,
b,d){return C3$jscomp$155.New(C3$jscomp$155.ObjectClass,a,b,d)}Release(){this._imageInfo&amp;&amp;(this._imageInfo.Release(),this._imageInfo=null);if(this._animations){for(const a of this._animations)a.Release();C3$jscomp$155.clearArray(this._animations);this._animationsByName.clear();this._animationsBySid.clear()}this._solStack.Release();this._solStack=null;this._savedData.clear();this._unsavedData.clear();this._runtime=this._container=null}_LoadFamily(a){for(let b=1,d=a.length;b&lt;d;++b){const c=this._runtime.GetObjectClassByIndex(a[b]);
this._familyMembers.push(c);this._familyMembersSet.add(c);c._families.push(this);c._familiesSet.add(this)}}_SetContainer(a){this._isInContainer=!0;this._container=a}IsInContainer(){return this._isInContainer}GetContainer(){return this._container}_OnAfterCreate(){var a=0;if(!this._isFamily)for(var b of this._families)for(var d of b.GetBehaviorTypes()){const h=d.GetName().toLowerCase();this._behaviorsByName.set(h,d);this._behaviorNameToIndex.set(h,a);this._behaviorTypesIncludingInherited.push(d);++a}for(var c of this.GetBehaviorTypes())b=
c.GetName().toLowerCase(),this._behaviorsByName.set(b,c),this._behaviorNameToIndex.set(b,a),this._behaviorTypesIncludingInherited.push(c),++a;for(var e of this._behaviorTypesIncludingInherited)this._usedBehaviorCtors.add(e.GetBehavior().constructor);if(!this._isFamily&amp;&amp;this._families.length){a=this._runtime.GetFamilyCount();C3$jscomp$155.extendArray(this._familyInstVarMap,a,0);C3$jscomp$155.extendArray(this._familyBehaviorMap,a,0);C3$jscomp$155.extendArray(this._familyEffectMap,a,0);a=[];b=e=c=0;
for(const h of this._families)if(d=h.GetFamilyIndex(),this._familyInstVarMap[d]=c,c+=h.GetInstanceVariablesCount(),this._familyBehaviorMap[d]=e,e+=h.GetBehaviorTypesCount(),this._familyEffectMap[d]=b,b+=h.GetEffectTypesCount(),(d=h.GetEffectList())&amp;&amp;this._effectList)for(const k of d.GetAllEffectTypes())a.push(k.Clone(this._effectList));this._effectList&amp;&amp;this._effectList.PrependEffectTypes(a)}}_CreateSingleGlobalInstance(a){const b=this._runtime._GetNewUID(),d=C3$jscomp$155.New(C3$jscomp$155.Instance,
{runtime:this._runtime,objectType:this,uid:b});d._CreateSdkInstance(a[16],[]);this._runtime._MapInstanceByUID(b,d);this._instances.push(d)}GetSdkType(){return this._sdkType}IsOnLoaderLayout(){return this._isOnLoaderLayout}OnCreate(){this._isFamily||this._sdkType.OnCreate()}HasLoadedTextures(){return 0&lt;this._textureRefCount}LoadTextures(a){if(this._isFamily)return Promise.resolve();this._textureRefCount++;return 1===this._textureRefCount?this._sdkType.LoadTextures(a)||Promise.resolve():Promise.resolve()}ReleaseTextures(){if(!this._isFamily){this._textureRefCount--;
if(0&gt;this._textureRefCount)throw Error("released textures too many times");0===this._textureRefCount&amp;&amp;this._sdkType.ReleaseTextures()}}OnDynamicTextureLoadComplete(){if(this._isFamily)throw Error("not applicable to family");this._sdkType.OnDynamicTextureLoadComplete()}PreloadTexturesWithInstances(a){return this._isFamily?Promise.resolve():this._sdkType.PreloadTexturesWithInstances(a)}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetIndex(){return this._index}GetSID(){return this._sid}IsFamily(){return this._isFamily}IsGlobal(){return this._isGlobal}IsWorldType(){return this._isWorldType}GetFamilyIndex(){return this._familyIndex}GetBehaviorTypes(){return this._behaviorTypes}GetBehaviorTypesCount(){return this._behaviorsCount}UsesBehaviorByCtor(a){return a&amp;&amp;
this._usedBehaviorCtors.has(a)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(a=&gt;a.sid)}GetInstanceVariableIndexBySID(a){return this._instVars.findIndex(b=&gt;b.sid===a)}GetInstanceVariableIndexByName(a){return this._instVars.findIndex(b=&gt;b.name===a)}_GetAllInstanceVariableNames(){return this._instVars.map(a=&gt;a.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(a=&gt;a.jsPropName)}GetInstanceVariableType(a){a=Math.floor(a);
if(0&gt;a||a&gt;=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[a].type}GetInstanceVariableName(a){a=Math.floor(a);if(0&gt;a||a&gt;=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[a].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(a){return this._behaviorsByName.get(a.toLowerCase())||null}GetBehaviorIndexByName(a){a=
this._behaviorNameToIndex.get(a.toLowerCase());return"undefined"===typeof a?-1:a}GetEffectList(){return this._effectList}HasEffects(){return this._plugin.HasEffects()}UsesEffects(){return this._effectList&amp;&amp;this._effectList.HasAnyEffectType()}GetSolStack(){return this._solStack}GetCurrentSol(){return this._solStack.GetCurrentSol()}GetImageInfo(){return this._imageInfo}SetDefaultInstanceData(a){this._defaultInstanceData=a}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(a){this._defaultLayerIndex=
a}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(a){return this._familiesSet.has(a)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(a){return this._familyMembersSet.has(a)}GetFamilyBehaviorOffset(a){return this._familyBehaviorMap[a]}GetFamilyInstanceVariableOffset(a){return this._familyInstVarMap[a]}GetAnimationByName(a){if(!this._animations)throw Error("no animations");
return this._animationsByName.get(a.toLowerCase())||null}GetAnimationBySID(a){if(!this._animations)throw Error("no animations");return this._animationsBySid.get(a)||null}GetFirstAnimationFrame(){if(!this._animations)throw Error("no animations");return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const a=this.GetFirstAnimationFrame().GetImageInfo();return[a.GetWidth(),a.GetHeight()]}return this._imageInfo?[this._imageInfo.GetWidth(),this._imageInfo.GetHeight()]:[100,
100]}GetSingleGlobalInstance(){if(!this._plugin.IsSingleGlobal())throw Error("not a single-global plugin");return this._instances[0]}GetInstances(){return this._instances}*instances(){yield*this._instances}*instancesIncludingPendingCreate(){yield*this._instances;yield*this._runtime.instancesPendingCreateForObjectClass(this)}GetInstanceCount(){return this._instances.length}_AddInstance(a){this._instances.push(a)}_SetIIDsStale(){this._iidsStale=!0}_UpdateIIDs(){if(this._iidsStale&amp;&amp;!this._isFamily){var a=
this._instances,b=0;for(let d=a.length;b&lt;d;++b)a[b]._SetIID(b);a=this._runtime._GetInstancesPendingCreate();for(const d of a)d.GetObjectClass()===this&amp;&amp;d._SetIID(b++);this._iidsStale=!1}}GetInstanceByIID(a){var b=this._instances;if(a&lt;b.length)return b[a];a-=b.length;b=this._runtime._GetInstancesPendingCreate();for(const d of b)if(d.GetObjectClass()===this){if(0===a)return d;--a}return null}GetFirstPicked(a){if(a&amp;&amp;a.IsInContainer()&amp;&amp;a.GetObjectClass()!==this)for(const b of a.siblings())if(b.GetObjectClass()===
this)return b;a=this.GetCurrentSol().GetInstances();return a.length?a[0]:null}GetPairedInstance(a){const b=this.GetCurrentSol().GetInstances();return 0&lt;b.length?b[a.GetIID()%b.length]:null}*allCorrespondingInstances(a,b){const d=this.GetCurrentSol().GetInstances();var c=d.length;const e=b.GetCurrentSol(),h=b.GetCurrentSol().GetInstances(),k=h.length;var m=a.GetIID();if(b.IsFamily()||!e.IsSelectAll())m=h.indexOf(a);a=Math.ceil(c/k);c%=k;0===c||m&lt;c?(m*=a,c=a):(m=c*a+(m-c)*(a-1),c=a-1);for(let p=m,q=
m+c;p&lt;q;++p)yield d[p]}FinishCondition(a){this._sdkType.FinishCondition(a)}ApplySolToContainer(){if(this._isInContainer&amp;&amp;!this._isFamily){this._UpdateIIDs();var a=this.GetCurrentSol(),b=a._GetOwnInstances(),d=a.IsSelectAll(),c=this._runtime.GetCurrentEventStackFrame();c=c&amp;&amp;c.GetCurrentEvent()&amp;&amp;c.GetCurrentEvent().IsOrBlock();for(const k of this._container.objectTypes())if(k!==this){k._UpdateIIDs();var e=k.GetCurrentSol();e._SetSelectAll(d);if(!d){var h=e._GetOwnInstances();C3$jscomp$155.clearArray(h);
for(const m of b)h.push(k.GetInstanceByIID(m.GetIID()));if(c){h=a._GetOwnElseInstances();e=e._GetOwnElseInstances();C3$jscomp$155.clearArray(e);for(const m of h)e.push(k.GetInstanceByIID(m.GetIID()))}}}}}_TruncateContainerSols(a,b){for(const d of this.GetContainer().objectTypes()){const c=d.GetCurrentSol();a?C3$jscomp$155.truncateArray(c._GetOwnElseInstances(),b):C3$jscomp$155.truncateArray(c._GetOwnInstances(),b)}}_GetCollisionCellGrid(){return this._collisionGrid}_SetAnyCollisionCellChanged(a){this._anyCollisionCellChanged=
!!a}_SetAnyInstanceParallaxed(a){this._anyInstanceParallaxed=!!a}IsAnyInstanceParallaxed(){return this._anyInstanceParallaxed}_UpdateAllCollisionCells(){if(this._anyCollisionCellChanged&amp;&amp;this._isWorldType){for(const a of this._instances)a.GetWorldInfo()._UpdateCollisionCell();for(const a of this._runtime._GetInstancesPendingCreate())a.GetObjectClass()===this&amp;&amp;a.GetWorldInfo()._UpdateCollisionCell();this._anyCollisionCellChanged=!1}}GetSavedDataMap(){this._savedData||(this._savedData=new Map);return this._savedData}GetUnsavedDataMap(){this._unsavedData||
(this._unsavedData=new Map);return this._unsavedData}HasSolidBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$155.Behaviors.solid)}HasJumpthruBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$155.Behaviors.jumpthru)}HasNoSaveBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$155.Behaviors.NoSave)}HasPersistBehavior(){return this.UsesBehaviorByCtor(C3$jscomp$155.Behaviors.Persist)}_SaveToJson(){const a={instances:this._instances.map(b=&gt;b.SaveToJson())};this._savedData&amp;&amp;this._savedData.size&amp;&amp;
(a.ex=C3$jscomp$155.ToSuperJSON(this._savedData));return a}_LoadFromJson(a){this._savedData&amp;&amp;(this._savedData.clear(),this._savedData=null);var b=a.ex;b&amp;&amp;(this._savedData=C3$jscomp$155.FromSuperJSON(b));b=this._instances;a=a.instances;for(let d=0,c=Math.min(b.length,a.length);d&lt;c;++d)b[d].LoadFromJson(a[d]);for(let d=a.length,c=b.length;d&lt;c;++d)this._runtime.DestroyInstance(b[d]);for(let d=b.length,c=a.length;d&lt;c;++d){b=a[d];let e=null;if(this.IsWorldType()&amp;&amp;(e=this._runtime.GetMainRunningLayout().GetLayerBySID(b.w.l),
!e))continue;this._runtime.CreateInstanceFromData(this._defaultInstanceData||this,e,!1,0,0,!0).LoadFromJson(b)}this._SetIIDsStale()}GetIObjectClass(){return this._iObjectClass}UserScriptDispatcher(){return this._userScriptDispatcher}_GetUserScriptInstanceClass(){return this._instanceUserScriptClass}_SetUserScriptInstanceClass(a){this._instanceUserScriptClass=a}DispatchUserScriptEvent(a){var b=this._runtime;(b=b.IsDebug()&amp;&amp;!b.GetEventSheetManager().IsInEventEngine())&amp;&amp;C3Debugger$jscomp$1.StartMeasuringScriptTime();
this._userScriptDispatcher.dispatchEvent(a);b&amp;&amp;C3Debugger$jscomp$1.AddScriptTime()}};"use strict";const C3$jscomp$156=self.C3;
C3$jscomp$156.Container=class extends C3$jscomp$156.DefendedBase{constructor(a,b){super();this._runtime=a;this._objectTypes=b;for(const d of this._objectTypes)d._SetContainer(this)}Release(){this._runtime=null}GetRuntime(){return this._runtime}GetObjectTypes(){return this._objectTypes}objectTypes(){return this._objectTypes}HasAnyWorldType(){return this._objectTypes.some(a=&gt;a.IsWorldType())}};"use strict";
const C3$jscomp$157=self.C3,C3Debugger$jscomp$2=self.C3Debugger,IInstance$jscomp$2=self.IInstance,EMPTY_ARRAY$jscomp$1=[];let nextPuid=0;const savedDataMaps=new WeakMap,unsavedDataMaps=new WeakMap,FLAG_DESTROYED=1,FLAG_TILEMAP=2,FLAG_MUST_PREDRAW=4,FLAG_SOLID_ENABLED=8,FLAG_JUMPTHRU_ENABLED=16,FLAG_MUST_MITIGATE_Z_FIGHTING=32,FLAG_IS_DRAWING_WITH_EFFECTS=64;
C3$jscomp$157.Instance=class extends C3$jscomp$157.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._objectType=a.objectType;this._iScriptInterface=this._sdkInst=this._worldInfo=null;this._iid=0;this._uid=a.uid;this._puid=nextPuid++;this._flags=0;this._behaviorInstances=this._instVarValues=EMPTY_ARRAY$jscomp$1;var b=this._objectType.GetBehaviorTypesIncludingInherited();0&lt;b.length&amp;&amp;(this._behaviorInstances=b.map((d,c)=&gt;C3$jscomp$157.New(C3$jscomp$157.BehaviorInstance,{runtime:this._runtime,
behaviorType:d,instance:this,index:c})));this._siblings=this._objectType.IsInContainer()?[]:null;this._timeScale=-1;this._dispatcher=null;b=this.GetPlugin();b.MustPreDraw()&amp;&amp;(this._flags|=FLAG_MUST_PREDRAW);if(b.IsWorldType())if(this._worldInfo=C3$jscomp$157.New(C3$jscomp$157.WorldInfo,this,a.layer),a.worldData)this._worldInfo.Init(a.worldData);else{this._worldInfo.InitNoData();const [d,c]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(d,c);this.GetObjectClass().UsesEffects()&amp;&amp;
this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}a.instVarData?this._LoadInstanceVariableData(a.instVarData):this._LoadDefaultInstanceVariables()}Release(){this._iScriptInterface&amp;&amp;(this._iScriptInterface._Release(),this._iScriptInterface=null);if(0&lt;this._behaviorInstances.length){for(var a of this._behaviorInstances)a.Release();C3$jscomp$157.clearArray(this._behaviorInstances)}this._sdkInst.Release();this._sdkInst=null;if(a=savedDataMaps.get(this))a.clear(),savedDataMaps.delete(this);
if(a=unsavedDataMaps.get(this))a.clear(),unsavedDataMaps.delete(this);this._siblings&amp;&amp;C3$jscomp$157.clearArray(this._siblings);this._dispatcher&amp;&amp;(this._dispatcher.Release(),this._dispatcher=null);this._objectType=this._runtime=null;0&lt;this._instVarValues.length&amp;&amp;C3$jscomp$157.clearArray(this._instVarValues);this._worldInfo&amp;&amp;(this._worldInfo.Release(),this._worldInfo=null)}_LoadInstanceVariableData(a){0&lt;a.length&amp;&amp;(this._instVarValues=[],C3$jscomp$157.shallowAssignArray(this._instVarValues,a))}_LoadDefaultInstanceVariables(){const a=
this._objectType.GetInstanceVariablesCount();if(0!==a){this._instVarValues=[];var b=[0,0,""];for(let d=0;d&lt;a;++d)this._instVarValues.push(b[this._objectType.GetInstanceVariableType(d)])}}_CreateSdkInstance(a,b){if(this._sdkInst)throw Error("already got sdk instance");for(let d=0,c=this._behaviorInstances.length;d&lt;c;++d)this._behaviorInstances[d]._CreateSdkInstance(b?b[d]:null);this._sdkInst=C3$jscomp$157.New(this._objectType.GetInstanceSdkCtor(),this,a);if(!(this._sdkInst instanceof C3$jscomp$157.SDKInstanceBase))throw Error("sdk type must derive from SDKInstanceBase");
for(let d=0,c=this._behaviorInstances.length;d&lt;c;++d)this._behaviorInstances[d].PostCreate();this._objectType._GetUserScriptInstanceClass()&amp;&amp;this._InitUserScriptInterface()}GetSdkInstance(){return this._sdkInst}GetWorldInfo(){return this._worldInfo}GetRuntime(){return this._runtime}GetTimeScale(){return this._timeScale}GetActiveTimeScale(){const a=this._timeScale;return-1===a?this.GetRuntime().GetTimeScale():a}SetTimeScale(a){a=+a;if(0&gt;a||!isFinite(a))a=0;this._timeScale=a;this.GetObjectClass().UsesEffects()&amp;&amp;
this._runtime._SetTrackingInstanceTime(this,!0)}RestoreTimeScale(){this._timeScale=-1;this.GetObjectClass().UsesEffects()&amp;&amp;this._runtime._SetTrackingInstanceTime(this,!1)}GetInstanceGameTime(){return this._runtime._GetInstanceGameTime(this)}Dispatcher(){this._dispatcher||(this._dispatcher=C3$jscomp$157.New(C3$jscomp$157.Event.Dispatcher));return this._dispatcher}Draw(a){this._sdkInst.Draw(a)}OnCreate(a){this._sdkInst.OnCreate(a)}_SetHasTilemap(){this._flags|=FLAG_TILEMAP}HasTilemap(){return 0!==(this._flags&amp;
FLAG_TILEMAP)}_MarkDestroyed(){this._flags|=FLAG_DESTROYED}IsDestroyed(){return 0!==(this._flags&amp;FLAG_DESTROYED)}MustPreDraw(){return 0!==(this._flags&amp;FLAG_MUST_PREDRAW)}SetMustMitigateZFighting(){this._flags|=FLAG_MUST_MITIGATE_Z_FIGHTING}MustMitigateZFighting(){return 0!==(this._flags&amp;FLAG_MUST_MITIGATE_Z_FIGHTING)}_IsSolidEnabled(){return 0!==(this._flags&amp;FLAG_SOLID_ENABLED)}_SetSolidEnabled(a){this._flags=a?this._flags|FLAG_SOLID_ENABLED:this._flags&amp;~FLAG_SOLID_ENABLED}_IsJumpthruEnabled(){return 0!==
(this._flags&amp;FLAG_JUMPTHRU_ENABLED)}_SetJumpthruEnabled(a){this._flags=a?this._flags|FLAG_JUMPTHRU_ENABLED:this._flags&amp;~FLAG_JUMPTHRU_ENABLED}_IsDrawingWithEffects(){return 0!==(this._flags&amp;FLAG_IS_DRAWING_WITH_EFFECTS)}_SetIsDrawingWithEffects(a){this._flags=a?this._flags|FLAG_IS_DRAWING_WITH_EFFECTS:this._flags&amp;~FLAG_IS_DRAWING_WITH_EFFECTS}SetFlag(a,b){a&lt;&lt;=16;this._flags=b?this._flags|a:this._flags&amp;~a}GetFlag(a){return 0!==(this._flags&amp;a&lt;&lt;16)}GetCurrentImageInfo(){return this._sdkInst.GetCurrentImageInfo()}GetCurrentSurfaceSize(){return this._sdkInst.GetCurrentSurfaceSize()}GetCurrentTexRect(){return this._sdkInst.GetCurrentTexRect()}GetCurrentTexQuad(){return this._sdkInst.GetCurrentTexQuad()}IsCurrentTexRotated(){return this._sdkInst.IsCurrentTexRotated()}GetImagePoint(a){return this._sdkInst.GetImagePoint(a)}GetObjectClass(){return this._objectType}RendersToOwnZPlane(){return this._sdkInst.RendersToOwnZPlane()}BelongsToObjectClass(a){return a.IsFamily()?
a.FamilyHasMember(this.GetObjectClass()):this.GetObjectClass()===a}CollectInstancesToPick(a,b,d){const c=(e,h)=&gt;{h=h||e.GetObjectClass();const k=a.get(h);k?k.add(e):a.set(h,new Set([e]))};c(this,b);if(this.IsInContainer())for(const e of this.siblings())c(e);if(d)for(const e of this.allChildren())c(e)}VerifySupportsSceneGraph(){if(!this.GetPlugin().SupportsSceneGraph())throw Error("object does not support scene graph");}HasParent(){return null!==this.GetParent()}GetParent(){var a=this.GetWorldInfo();
return a?(a=a.GetParent())?a.GetInstance():null:null}GetTopParent(){var a=this.GetWorldInfo();return a?(a=a.GetTopParent())?a.GetInstance():null:null}*parents(){const a=this.GetWorldInfo();if(a)for(const b of a.parents())yield b.GetInstance()}HasChild(a){if(!a)return!1;for(const b of this.children())if(b===a)return!0;return!1}HasChildren(){const a=this.GetWorldInfo();return a?a.HasChildren():!1}GetChildrenOfObjectClass(a){const b=this.GetWorldInfo();if(!b)return[];const d=a.GetName();return b.GetChildren().map(c=&gt;
c.GetInstance()).filter(c=&gt;c.GetObjectClass().GetName()===d)}GetChildren(){const a=this.GetWorldInfo();return a?a.GetChildren().map(b=&gt;b.GetInstance()):[]}*children(){const a=this.GetWorldInfo();if(a)for(const b of a.children())yield b.GetInstance()}*allChildren(){const a=this.GetWorldInfo();if(a)for(const b of a.allChildren())yield b.GetInstance()}GetChildCount(){const a=this.GetWorldInfo();return a?a.GetChildCount():0}GetParentCount(){return[...this.parents()].length}GetAllChildCount(){const a=
this.GetWorldInfo();return a?a.GetAllChildCount():0}GetChildAt(a){const b=this.GetWorldInfo();return b?(a=b.GetChildAt(a))?a.GetInstance():null:null}AddChild(a,b){this.VerifySupportsSceneGraph();a.VerifySupportsSceneGraph();this.GetWorldInfo().AddChild(a.GetWorldInfo(),b||{})}RemoveChild(a){const b=this.GetWorldInfo();b&amp;&amp;b.RemoveChild(a.GetWorldInfo())}GetDestroyWithParent(){const a=this.GetWorldInfo();return a?a.GetDestroyWithParent():!1}SetupInitialSceneGraphConnections(){var a=this.GetWorldInfo();
if(a&amp;&amp;(a=a.GetSceneGraphChildrenExportData()))for(const b of a)if(a=this._runtime.GetInstanceByUID(b[2])){const d=b[3];this.AddChild(a,{transformX:!!(d&gt;&gt;0&amp;1),transformY:!!(d&gt;&gt;1&amp;1),transformWidth:!!(d&gt;&gt;2&amp;1),transformHeight:!!(d&gt;&gt;3&amp;1),transformAngle:!!(d&gt;&gt;4&amp;1),destroyWithParent:!!(d&gt;&gt;5&amp;1),transformZElevation:!!(d&gt;&gt;6&amp;1)})}}IsInContainer(){return null!==this._siblings}_AddSibling(a){this._siblings.push(a)}GetSiblings(){return this._siblings}HasSibling(a){return!!this.GetSibling(a)}GetSibling(a){const b=
this.siblings();if(null===b||0===b.length)return!1;for(const d of b)if(d.GetObjectClass()===a)return d;return null}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol().SetSinglePicked(a)}_PushSiblingsToSolInstances(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol()._PushInstance(a)}_SetSiblingsToSolInstancesIndex(a){for(const b of this.siblings())b.GetObjectClass().GetCurrentSol()._GetOwnInstances()[a]=b}_PushSiblingsToSolElseInstances(){for(const a of this.siblings())a.GetObjectClass().GetCurrentSol()._PushElseInstance(a)}_SetSiblingsToSolElseInstancesIndex(a){for(const b of this.siblings())b.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[a]=
b}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(a){this._iid=a}GetIID(){this._objectType._UpdateIIDs();return this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(a){if(!a)return null;for(const b of this._behaviorInstances)if(b.GetBehavior()instanceof a)return b;return null}GetBehaviorSdkInstanceFromCtor(a){return a?(a=this.GetBehaviorInstanceFromCtor(a))?a.GetSdkInstance():null:null}GetBehaviorIndexBySID(a){const b=
this._behaviorInstances;for(let d=0,c=b.length;d&lt;c;++d)if(b[d].GetBehaviorType().GetSID()===a)return d;return-1}GetAllInstanceVariableValues(){return this._instVarValues}_GetAllInstanceVariableNames(){return this._objectType._GetAllInstanceVariableNames()}GetInstanceVariableCount(){return this._instVarValues.length}GetInstanceVariableValue(a){a|=0;const b=this._instVarValues;if(0&gt;a||a&gt;=b.length)throw new RangeError("invalid instance variable");return b[a]}_GetInstanceVariableValueUnchecked(a){return this._instVarValues[a]}_GetInstanceVariableTypedValue(a){const b=
this._instVarValues[a];return 0===this._objectType.GetInstanceVariableType(a)?!!b:b}SetInstanceVariableValue(a,b){a|=0;const d=this._instVarValues;if(0&gt;a||a&gt;=d.length)throw new RangeError("invalid instance variable");switch(this._objectType.GetInstanceVariableType(a)){case 0:d[a]=b?1:0;break;case 1:d[a]="number"===typeof b?b:parseFloat(b);break;case 2:d[a]="string"===typeof b?b:b.toString();break;default:throw Error("unknown instance variable type");}}SetInstanceVariableOffset(a,b){if(0!==b){a|=0;
var d=this._instVarValues;if(0&gt;a||a&gt;=d.length)throw new RangeError("invalid instance variable");var c=d[a];if("number"===typeof c)d[a]="number"===typeof b?d[a]+b:d[a]+parseFloat(b);else{if("boolean"===typeof c)throw Error("can not set offset of boolean variable");if("string"===typeof c)throw Error("can not set offset of string variable");throw Error("unknown instance variable type");}}}GetSavedDataMap(){let a=savedDataMaps.get(this);if(a)return a;a=new Map;savedDataMaps.set(this,a);return a}GetUnsavedDataMap(){let a=
unsavedDataMaps.get(this);if(a)return a;a=new Map;unsavedDataMaps.set(this,a);return a}_HasAnyCreateDestroyHandler(a){const b=this.GetObjectClass();if(b.UserScriptDispatcher().HasAnyHandlerFor(a))return!0;for(const d of b.GetFamilies())if(d.UserScriptDispatcher().HasAnyHandlerFor(a))return!0;return this._runtime.UserScriptDispatcher().HasAnyHandlerFor(a)?!0:!1}_TriggerOnCreatedOnSelfAndRelated(){const a=new Set;a.add(this);const b=this.GetWorldInfo();if(b&amp;&amp;b.HasChildren())for(const d of this.allChildren())if(a.add(d),
d.IsInContainer())for(const c of d.siblings())a.add(c);if(this.IsInContainer())for(const d of this.siblings())a.add(d);for(const d of a.values())d._TriggerOnCreated()}_TriggerOnCreated(){if(this._HasAnyCreateDestroyHandler("instancecreate")){const a=this.GetObjectClass(),b=new C3$jscomp$157.Event("instancecreate");b.instance=this.GetInterfaceClass();a.DispatchUserScriptEvent(b);for(const d of a.GetFamilies())d.DispatchUserScriptEvent(b);this._runtime.DispatchUserScriptEvent(b)}this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,
this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_FireDestroyedScriptEvents(a){if(this._iScriptInterface){var b=new C3$jscomp$157.Event("destroy");b.isEndingLayout=a;this.DispatchUserScriptEvent(b)}if(this._HasAnyCreateDestroyHandler("instancedestroy")){b=this.GetObjectClass();var d=new C3$jscomp$157.Event("instancedestroy");d.instance=this.GetInterfaceClass();d.isEndingLayout=a;b.DispatchUserScriptEvent(d);for(const c of b.GetFamilies())c.DispatchUserScriptEvent(d);
this._runtime.DispatchUserScriptEvent(d)}}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(a="full"){const b={};"full"===a?b.uid=this.GetUID():b.c3=!0;if("visual-state"!==a){var d=savedDataMaps.get(this);d&amp;&amp;d.size&amp;&amp;(b.ex=C3$jscomp$157.ToSuperJSON(d));-1!==this.GetTimeScale()&amp;&amp;(b.mts=this.GetTimeScale());if(0&lt;this._objectType.GetInstanceVariablesCount()){d={};var c=this._objectType.GetInstanceVariableSIDs();for(let e=0,h=this._instVarValues.length;e&lt;h;++e)d[c[e].toString()]=
this._instVarValues[e];b.ivs=d}if(this._behaviorInstances.length){d={};for(const e of this._behaviorInstances)(c=e.SaveToJson())&amp;&amp;(d[e.GetBehaviorType().GetSID().toString()]=c);b.behs=d}}this._worldInfo&amp;&amp;(b.w=this._worldInfo._SaveToJson(a));(a=this._sdkInst.SaveToJson())&amp;&amp;(b.data=a);return b}_OnBeforeLoad(a="full"){this._worldInfo&amp;&amp;this._worldInfo._OnBeforeLoad(a)}LoadFromJson(a,b="full"){if("full"===b)this._uid=a.uid;else if(!a.c3)return;if("visual-state"!==b){var d=savedDataMaps.get(this);d&amp;&amp;(d.clear(),
savedDataMaps.delete(this));if(d=a.ex)d=C3$jscomp$157.FromSuperJSON(d),savedDataMaps.set(this,d);this._timeScale=a.hasOwnProperty("mts")?a.mts:-1;if(d=a.ivs)for(const [h,k]of Object.entries(d))if(d=parseInt(h,10),d=this._objectType.GetInstanceVariableIndexBySID(d),!(0&gt;d||d&gt;=this._instVarValues.length)){var c=k;null===c&amp;&amp;(c=NaN);this._instVarValues[d]=c}}if(this.GetPlugin().IsWorldType()){d=a.w;var e=d.l;this._worldInfo.GetLayer().GetSID()!==e&amp;&amp;(c=this._worldInfo.GetLayer(),(e=c.GetLayout().GetLayerBySID(e))?
(this._worldInfo._SetLayer(e),c._RemoveInstance(this,!0),e._AddInstance(this,!0),e.SetZIndicesChanged(),this._worldInfo.SetBboxChanged()):"full"===b&amp;&amp;this._runtime.DestroyInstance(this));this._worldInfo._LoadFromJson(d,b)}if("visual-state"!==b&amp;&amp;(b=a.behs))for(const [h,k]of Object.entries(b))b=parseInt(h,10),b=this.GetBehaviorIndexBySID(b),0&gt;b||b&gt;=this._behaviorInstances.length||this._behaviorInstances[b].LoadFromJson(k);(a=a.data)&amp;&amp;this._sdkInst.LoadFromJson(a)}GetInterfaceClass(){return this._iScriptInterface||
this._InitUserScriptInterface()}_InitUserScriptInterface(){var a=this._worldInfo?self.IWorldInstance:IInstance$jscomp$2;const b=this._sdkInst.GetScriptInterfaceClass(),d=this._objectType._GetUserScriptInstanceClass(),c=d||b||a;IInstance$jscomp$2._Init(this);this._iScriptInterface=new c;IInstance$jscomp$2._Init(null);if(b&amp;&amp;!(this._iScriptInterface instanceof a))throw new TypeError(`script interface class '${b.name}' does not extend the right base class '${a.name}'`);if(d&amp;&amp;(a=b||a,!(this._iScriptInterface instanceof
a)))throw new TypeError(`setInstanceClass(): class '${d.name}' does not extend the right base class '${a.name}'`);return this._iScriptInterface}_GetInstVarsScriptDescriptor(a){if(0!==this._instVarValues.length){var b={},d=this._objectType._GetAllInstanceVariableJsPropNames();for(let c=0,e=d.length;c&lt;e;++c)b[d[c]]={configurable:!1,enumerable:!0,get:C3$jscomp$157.Instance.prototype._GetInstanceVariableTypedValue.bind(this,c),set:C3$jscomp$157.Instance.prototype.SetInstanceVariableValue.bind(this,c)};
b=Object.create(Object.prototype,b);a.instVars={value:b,writable:!1}}}_GetBehaviorsScriptDescriptor(a){var b=this._behaviorInstances;if(0!==b.length){var d={};for(const c of b)d[c.GetBehaviorType().GetJsPropName()]={value:c.GetScriptInterface(),writable:!1};b=Object.create(Object.prototype,d);a.behaviors={value:b,writable:!1}}}DispatchUserScriptEvent(a){a.instance=this.GetInterfaceClass();var b=this._runtime;(b=b.IsDebug()&amp;&amp;!b.GetEventSheetManager().IsInEventEngine())&amp;&amp;C3Debugger$jscomp$2.StartMeasuringScriptTime();
this.GetInterfaceClass().dispatchEvent(a);b&amp;&amp;C3Debugger$jscomp$2.AddScriptTime()}};"use strict";const C3$jscomp$158=self.C3;
C3$jscomp$158.SceneGraphInfo=class extends C3$jscomp$158.DefendedBase{constructor(a){super();this._owner=a;this._parent=null;this._children=[];this._startWidth=a.GetWidth();this._startHeight=a.GetHeight();this._startScaleY=this._startScaleX=1;this._parentStartAngle=0;this._tmpSceneGraphChildren=null}Release(){this._tmpSceneGraphChildren=this._parent=null;C3$jscomp$158.clearArray(this._children)}SetParent(a){this._parentStartAngle=(this._parent=a)?a.GetAngle():0}GetParent(){return this._parent}HasChildren(){return 0&lt;
this._children.length}GetChildren(){return this._children}GetStartScaleX(){return this._startScaleX}SetStartScaleX(a){this._startScaleX=a}GetStartScaleY(){return this._startScaleY}SetStartScaleY(a){this._startScaleY=a}_GetStartWidth(){return 0===this._startWidth?Number.EPSILON:this._startWidth}_GetStartHeight(){return 0===this._startHeight?Number.EPSILON:this._startHeight}GetParentScaleX(){if(this._owner.GetTransformWithParentWidth()){var a=this._parent;let b=a.GetWidth(),d=a._GetSceneGraphInfo()._GetStartWidth();
0===b&amp;&amp;(b=Number.EPSILON);return d===Number.EPSILON&amp;&amp;b===Number.EPSILON?1:d===Number.EPSILON&amp;&amp;b!==Number.EPSILON&amp;&amp;(a=a.GetInstance().GetSdkInstance(),a.IsOriginalSizeKnown())?1+b/a.GetOriginalWidth():b/d}return 1}GetParentScaleY(){if(this._owner.GetTransformWithParentHeight()){var a=this._parent;let b=a.GetHeight(),d=a._GetSceneGraphInfo()._GetStartHeight();0===b&amp;&amp;(b=Number.EPSILON);return d===Number.EPSILON&amp;&amp;b===Number.EPSILON?1:d===Number.EPSILON&amp;&amp;b!==Number.EPSILON&amp;&amp;(a=a.GetInstance().GetSdkInstance(),
a.IsOriginalSizeKnown())?1+b/a.GetOriginalHeight():b/d}return 1}GetParentStartAngle(){return this._parentStartAngle}_SaveToJson(a){return{sw:this._startWidth,sh:this._startHeight,sx:this._startScaleX,sy:this._startScaleY,psa:this._parentStartAngle,p:this._GetParentJson(a),c:this._GetChildrenJson(a)}}_GetFlagsString(a){let b="";a.GetTransformWithParentX()&amp;&amp;(b+="x");a.GetTransformWithParentY()&amp;&amp;(b+="y");a.GetTransformWithParentWidth()&amp;&amp;(b+="w");a.GetTransformWithParentHeight()&amp;&amp;(b+="h");a.GetTransformWithParentAngle()&amp;&amp;
(b+="a");a.GetTransformWithParentZElevation()&amp;&amp;(b+="z");a.GetDestroyWithParent()&amp;&amp;(b+="d");return b}_GetParentJson(a){return this._parent&amp;&amp;this._parent.GetInstance()&amp;&amp;!this._parent.GetInstance().IsDestroyed()?this._GetInstanceJson(this._parent,this._owner,a):null}_GetChildrenJson(a){return this._children.map(b=&gt;this._GetInstanceJson(b,b,a))}_GetInstanceJson(a,b,d){a=a.GetInstance();const c={};c.uid=a.GetUID();c.f=this._GetFlagsString(b);c.offsets=b._SaveSceneGraphPropertiesToJson();"state"===d&amp;&amp;(c.oci=
a.GetObjectClass().GetIndex(),c.inst=a.SaveToJson());return c}_LoadFromJson(a){this._startWidth=a.sw;this._startHeight=a.sh;this._startScaleX=a.sx;this._startScaleY=a.sy;this._parentStartAngle=a.psa}_SetTmpSceneGraphChildren(a){this._tmpSceneGraphChildren=a}_OnAfterLoad(a,b){const d=this._owner,c=d.GetRuntime();if(a.p&amp;&amp;!this._parent){var e=c.GetInstanceByUID(a.p.uid);if(e){var h=e.GetWorldInfo();e.HasChild(this._owner.GetInstance())?this._parent=h:(e.AddChild(this._owner.GetInstance(),this._GetFlagsObj(a.p.f)),
this._owner._LoadSceneGraphPropertiesFromJson(a.p.offsets))}else C3$jscomp$158.IsFiniteNumber(a.p.oci)&amp;&amp;(e=c.GetObjectClassByIndex(a.p.oci),c.GetSystemPlugin(),e=c.CreateInstance(e,d.GetLayer(),0,0,!0))&amp;&amp;(e.LoadFromJson(a.p.inst),e.GetWorldInfo().GetLayer().SortAndAddInstancesByZIndex(e),e.AddChild(d.GetInstance(),this._GetFlagsObj(a.p.f)))}e=[];for(var k of a.c)(h=c.GetInstanceByUID(k.uid))&amp;&amp;e.push(h);k=0;for(const p of a.c){if(a=c.GetInstanceByUID(p.uid)){if(this._tmpSceneGraphChildren&amp;&amp;this._tmpSceneGraphChildren[k]){h=
this._tmpSceneGraphChildren[k];if(h.GetObjectClass()!==a.GetObjectClass()){k++;continue}if(h.IsDestroyed()){k++;continue}this._AddAndSetChildInstance(h.GetWorldInfo(),p);k++;continue}var m=a.GetObjectClass();h=this._GetInstancesOfObjectClassCount(e,m);m=d.GetInstance().GetChildrenOfObjectClass(m).length;if(h===m){(a=d.GetInstance().GetChildAt(k).GetWorldInfo())&amp;&amp;a._LoadSceneGraphPropertiesFromJson(p.offsets);k++;continue}if(a.HasParent()){a=this._CreateNewChildInstance(p,b);this._AddAndSetChildInstance(a,
p);k++;continue}this._AddAndSetChildInstance(a.GetWorldInfo(),p)}else a=this._CreateNewChildInstance(p,b),this._AddAndSetChildInstance(a,p);k++}}_GetFlagsObj(a){const b={};b.transformX=a.includes("x");b.transformY=a.includes("y");b.transformWidth=a.includes("w");b.transformHeight=a.includes("h");b.transformAngle=a.includes("a");b.transformZElevation=a.includes("z");b.destroyWithParent=a.includes("d");return b}_CreateNewChildInstance(a,b){if(C3$jscomp$158.IsFiniteNumber(a.oci)){b=this._owner;var d=
b.GetRuntime(),c=d.GetObjectClassByIndex(a.oci);d.GetSystemPlugin();if(b=d.CreateInstance(c,b.GetLayer(),0,0,!0))return b.LoadFromJson(a.inst),a=b.GetWorldInfo(),a.GetLayer().SortAndAddInstancesByZIndex(b),a}}_AddAndSetChildInstance(a,b){this._owner.AddChild(a,this._GetFlagsObj(b.f));a._LoadSceneGraphPropertiesFromJson(b.offsets)}_GetInstancesOfObjectClassCount(a,b){return a.filter(d=&gt;d.GetObjectClass().GetName()===b.GetName()).length}};"use strict";
const C3$jscomp$159=self.C3,tempRect$jscomp$6=C3$jscomp$159.New(C3$jscomp$159.Rect),tempQuad$jscomp$3=C3$jscomp$159.New(C3$jscomp$159.Quad),bboxChangeEvent=C3$jscomp$159.New(C3$jscomp$159.Event,"bboxchange",!1),tempColor$jscomp$6=C3$jscomp$159.New(C3$jscomp$159.Color,0,0,0,0),tempCollisionPoly=C3$jscomp$159.New(C3$jscomp$159.CollisionPoly),DEFAULT_COLOR=C3$jscomp$159.New(C3$jscomp$159.Color,1,1,1,1),DEFAULT_RENDER_CELLS=C3$jscomp$159.New(C3$jscomp$159.Rect,0,0,-1,-1),DEFAULT_COLLISION_CELLS=C3$jscomp$159.New(C3$jscomp$159.Rect,
0,0,-1,-1),VALID_SET_MESH_POINT_MODES=new Set(["absolute","relative"]),EMPTY_ARRAY$jscomp$2=[];let enableUpdateRendererStateGroup=!0;
const FLAG_IS_VISIBLE=1,FLAG_BBOX_CHANGED=2,FLAG_ENABLE_BBOX_CHANGED_EVENT=4,FLAG_COLLISION_ENABLED=8,FLAG_COLLISION_CELL_CHANGED=16,FLAG_SOLID_FILTER_INCLUSIVE=32,FLAG_HAS_ANY_ACTIVE_EFFECT=64,FLAG_IS_ROTATABLE=128,FLAG_DESTROYED$jscomp$1=256,FLAG_DESTROY_WITH_PARENT=512,FLAG_TRANSFORM_WITH_PARENT_X=1024,FLAG_TRANSFORM_WITH_PARENT_Y=2048,FLAG_TRANSFORM_WITH_PARENT_W=4096,FLAG_TRANSFORM_WITH_PARENT_H=8192,FLAG_TRANSFORM_WITH_PARENT_A=16384,FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION=32768,MASK_ALL_SCENE_GRAPH_FLAGS=
FLAG_DESTROY_WITH_PARENT|FLAG_TRANSFORM_WITH_PARENT_X|FLAG_TRANSFORM_WITH_PARENT_Y|FLAG_TRANSFORM_WITH_PARENT_W|FLAG_TRANSFORM_WITH_PARENT_H|FLAG_TRANSFORM_WITH_PARENT_A|FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION,FLAG_MESH_CHANGED=65536,FLAG_PHYSICS_BODY_CHANGED=131072,FLAG_SIN_COS_ANGLE_CHANGED=262144,FLAG_USE_POINTS_SHADER_PROGRAM=524288,FLAG_DRAW_BACK_FACE_ONLY=1048576,FLAG_DRAW_NON_BACK_FACES_ONLY=2097152,FLAG_BLEND_MODE_MASK=2080374784,sceneGraphExportDataMap=new WeakMap,sceneGraphZIndexMap=new WeakMap;
C3$jscomp$159.WorldInfo=class extends C3$jscomp$159.DefendedBase{constructor(a,b){super();this._inst=a;this._objectClass=a.GetObjectClass();this._runtime=a.GetRuntime();this._layer=b;this._zIndex=-1;this._flags=FLAG_IS_VISIBLE|FLAG_BBOX_CHANGED|FLAG_COLLISION_ENABLED|FLAG_COLLISION_CELL_CHANGED|FLAG_MESH_CHANGED|FLAG_PHYSICS_BODY_CHANGED;this._objectClass.GetPlugin().IsRotatable()&amp;&amp;(this._flags|=FLAG_IS_ROTATABLE);this._oy=this._ox=this._cosA=this._sinA=this._a=this._depth=this._h=this._w=this._zElevation=
this._y=this._x=NaN;this._boundingBox=C3$jscomp$159.New(C3$jscomp$159.Rect);this._boundingQuad=C3$jscomp$159.New(C3$jscomp$159.Quad);this._collisionCells=DEFAULT_COLLISION_CELLS;this._renderCells=DEFAULT_RENDER_CELLS;this._solidFilterTags=this._transformedPolyInfo=this._sourceCollisionPoly=null;this._colorPremultiplied=this._color=DEFAULT_COLOR;this._instanceEffectList=this._stateGroup=null;this._inst.GetObjectClass().UsesEffects()&amp;&amp;(this._instanceEffectList=C3$jscomp$159.New(C3$jscomp$159.InstanceEffectList,
this._inst,this));this._meshInfo=this._tmpSceneGraphParent=this._tmpSceneGraphChildren=this._sceneGraphInfo=null}_MarkDestroyed(){this._flags|=FLAG_DESTROYED$jscomp$1}Release(){this._stateGroup&amp;&amp;(this._runtime.GetRenderer().ReleaseStateGroup(this._stateGroup),this._stateGroup=null);this._sourceCollisionPoly=null;this._transformedPolyInfo&amp;&amp;(this._transformedPolyInfo.poly.Release(),this._transformedPolyInfo=null);this._solidFilterTags&amp;&amp;(this._solidFilterTags.clear(),this._solidFilterTags=null);this.ReleaseMesh();
this.HasParent()&amp;&amp;this.GetParent().RemoveChild(this);if(this.HasChildren()){const a=[...this.GetChildren()];for(const b of a)this.RemoveChild(b)}this._ReleaseSceneGraphInfo();this._ReleaseTmpSceneGraphInfo();sceneGraphExportDataMap.delete(this);sceneGraphZIndexMap.delete(this);this._layer=this._runtime=this._objectClass=this._inst=null}Init(a){enableUpdateRendererStateGroup=!1;this.SetXY(a[0],a[1]);this.SetZElevation(a[2]);this.SetSize(a[3],a[4]);this._depth=0;this.IsRotatable()?this.SetAngle(a[6]):
this._a=0;tempColor$jscomp$6.setFromJSON(a[7]);this._SetColor(tempColor$jscomp$6);this.SetOriginX(a[8]);this.SetOriginY(a[9]);this.SetBlendMode(a[10]);this._instanceEffectList&amp;&amp;this._instanceEffectList._LoadEffectParameters(a[12]);a[14]&amp;&amp;sceneGraphExportDataMap.set(this,{childrenData:a[14][1],zIndexData:a[14][2]});if(a[15]){var b=a[15];this.CreateMesh(b[0],b[1]);var d=this.GetSourceMesh();b=b[2];for(let c=0,e=b.length;c&lt;e;++c){const h=b[c];for(let k=0,m=h.length;k&lt;m;++k){const p=h[k],q=d.GetMeshPointAt(k,
c);q.SetX(p[0]);q.SetY(p[1]);q.SetZElevation(p[2]);q.SetU(p[3]);q.SetV(p[4])}}}a[16]&amp;&amp;(a=a[16][1],d=!!a,b=this._runtime.GetTemplateManager(),d&amp;&amp;b&amp;&amp;b.MapInstanceToTemplateName(this.GetInstance(),a));enableUpdateRendererStateGroup=!0;this._UpdateRendererStateGroup()}InitNoData(){this._sinA=this._a=this._depth=this._h=this._w=this._zElevation=this._y=this._x=0;this._cosA=1;this._oy=this._ox=0;this._UpdateRendererStateGroup()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetInstance(){return this._inst}_GetParentOffsetAngle(){return this.GetTransformWithParentAngle()?
this.GetParent().GetAngle()-this._sceneGraphInfo.GetParentStartAngle():0}SetX(a){a=+a;if(this.GetTransformWithParentX()){const b=this._sceneGraphInfo;a-=this.GetX();const d=-this._GetParentOffsetAngle();0===d?this._x+=a/b.GetParentScaleX():(this._x+=Math.cos(d)*a/b.GetParentScaleX(),this.GetTransformWithParentY()&amp;&amp;(this._y+=Math.sin(d)*a/b.GetParentScaleY()))}else this._x=a}OffsetX(a,b=!1){a=+a;b?this._x+=a:this.GetTransformWithParentX()?this.SetX(this.GetX()+a):this._x+=a}GetX(){if(this.GetTransformWithParentX()){let a=
this._x;const b=this._sceneGraphInfo,d=this.GetParent(),c=this._GetParentOffsetAngle();0===c?a*=b.GetParentScaleX():(a=a*b.GetParentScaleX()*Math.cos(c),this.GetTransformWithParentY()&amp;&amp;(a-=this._y*b.GetParentScaleY()*Math.sin(c)));return d.GetX()+a}return this._x}SetY(a){a=+a;if(this.GetTransformWithParentY()){const b=this._sceneGraphInfo;a-=this.GetY();const d=-this._GetParentOffsetAngle();0===d?this._y+=a/b.GetParentScaleY():(this.GetTransformWithParentX()&amp;&amp;(this._x-=Math.sin(d)*a/b.GetParentScaleX()),
this._y+=Math.cos(d)*a/b.GetParentScaleY())}else this._y=a}OffsetY(a,b=!1){a=+a;b?this._y+=a:this.GetTransformWithParentY()?this.SetY(this.GetY()+a):this._y+=a}GetY(){if(this.GetTransformWithParentY()){let a=this._y;const b=this._sceneGraphInfo,d=this.GetParent(),c=this._GetParentOffsetAngle();0===c?a*=b.GetParentScaleY():(a=a*b.GetParentScaleY()*Math.cos(c),this.GetTransformWithParentX()&amp;&amp;(a+=this._x*b.GetParentScaleX()*Math.sin(c)));return d.GetY()+a}return this._y}SetXY(a,b){a=+a;b=+b;if(this.GetTransformWithParentXOrY()){const c=
this.GetTransformWithParentX(),e=this.GetTransformWithParentY(),h=this._sceneGraphInfo,k=a-this.GetX(),m=b-this.GetY();var d=-this._GetParentOffsetAngle();if(0===d)this._x=c?this._x+k/h.GetParentScaleX():a,this._y=e?this._y+m/h.GetParentScaleY():b;else{const p=Math.sin(d);d=Math.cos(d);this._x=c?e?this._x+(d*k-p*m)/h.GetParentScaleX():this._x+d*k/h.GetParentScaleX():a;this._y=e?c?this._y+(p*k+d*m)/h.GetParentScaleY():this._y+d*m/h.GetParentScaleY():b}}else this._x=a,this._y=b}OffsetXY(a,b){a=+a;b=
+b;this.GetTransformWithParentXOrY()?this.SetXY(this.GetX()+a,this.GetY()+b):(this._x+=a,this._y+=b)}EqualsXY(a,b){return this.GetX()===a&amp;&amp;this.GetY()===b}SetZElevation(a){a=+a;this.GetTransformWithParentZElevation()&amp;&amp;(a-=this.GetParent().GetZElevation());this._zElevation!==a&amp;&amp;(this._zElevation=a,this._UpdateZElevation(),a=this.GetLayer(),0!==this._zElevation&amp;&amp;a._SetAnyInstanceZElevated(),a.SetZIndicesChanged())}_UpdateZElevation(){this._UpdateRendererStateGroup();if(this.HasChildren()){const a=this.GetChildren();
for(let b=0,d=a.length;b&lt;d;b++){const c=a[b];c.GetTransformWithParentZElevation()&amp;&amp;c._UpdateZElevation()}}}OffsetZElevation(a){this.SetZElevation(this.GetZElevation()+a)}GetZElevation(){return this.GetTransformWithParentZElevation()?this.GetParent().GetZElevation()+this._zElevation:this._zElevation}GetTotalZElevation(){return this.GetLayer().GetZElevation()+this.GetZElevation()}SetWidth(a){a=+a;if(this.GetTransformWithParentWidth()){const b=this.GetWidth();this._w=0===b?Number.EPSILON:a/b*this._w}else this._w=
a}OffsetWidth(a,b){a=+a;b?this._w+=a:this.GetTransformWithParentWidth()?this.SetWidth(this.GetWidth()+a):this._w+=a}GetWidth(){if(this.GetTransformWithParentWidth()){const a=this.GetParent(),b=a.GetWidth();return a._GetSceneGraphInfo()._GetStartWidth()===Number.EPSILON?(this._GetSceneGraphInfo()._GetStartWidth()+b)*this._w:b*this._w}return this._w}SetHeight(a){a=+a;if(this.GetTransformWithParentHeight()){const b=this.GetHeight();this._h=0===b?Number.EPSILON:a/b*this._h}else this._h=a}OffsetHeight(a,
b){a=+a;b?this._h+=a:this.GetTransformWithParentHeight()?this.SetHeight(this.GetHeight()+a):this._h+=a}GetHeight(){if(this.GetTransformWithParentHeight()){const a=this.GetParent(),b=a.GetHeight();return a._GetSceneGraphInfo()._GetStartHeight()===Number.EPSILON?(this._GetSceneGraphInfo()._GetStartHeight()+b)*this._h:b*this._h}return this._h}SetSize(a,b){a=+a;b=+b;if(this.GetTransformWithParentWidth()){const d=this.GetWidth();this._w=0===d?Number.EPSILON:a/d*this._w}else this._w=a;this.GetTransformWithParentHeight()?
(a=this.GetHeight(),this._h=0===a?Number.EPSILON:b/a*this._h):this._h=b}GetDepth(){return this._depth}SetDepth(a){if(0&gt;a)throw new RangeError("invalid depth");this._depth=a}GetSceneGraphScale(){if(this.HasParent()){const a=this._sceneGraphInfo;return Math.min(a.GetParentScaleX(),a.GetParentScaleY())}return 1}IsRotatable(){return 0!==(this._flags&amp;FLAG_IS_ROTATABLE)}SetAngle(a){a=+a;this.IsRotatable()&amp;&amp;(this.GetTransformWithParentAngle()&amp;&amp;(a-=this.GetParent().GetAngle()),a=C3$jscomp$159.clampAngle(a),
this._a!==a&amp;&amp;(this._a=a,this._MarkSinCosAngleChanged()))}OffsetAngle(a){a=+a;0!==a&amp;&amp;this.IsRotatable()&amp;&amp;(this._a=C3$jscomp$159.clampAngle(this._a+a),this._MarkSinCosAngleChanged())}_MarkSinCosAngleChanged(){this._flags|=FLAG_SIN_COS_ANGLE_CHANGED;if(this.HasChildren()){const a=this.GetChildren();for(let b=0,d=a.length;b&lt;d;b++)a[b]._MarkSinCosAngleChanged()}}GetAngle(){return this.GetTransformWithParentAngle()?C3$jscomp$159.clampAngle(this.GetParent().GetAngle()+this._a):this._a}_MaybeUpdateSinCosAngle(){const a=
this._flags;if(0!==(a&amp;FLAG_SIN_COS_ANGLE_CHANGED)){var b=this.GetAngle();this._sinA=Math.sin(b);this._cosA=Math.cos(b);this._flags=a&amp;~FLAG_SIN_COS_ANGLE_CHANGED}}GetSinAngle(){this._MaybeUpdateSinCosAngle();return this._sinA}GetCosAngle(){this._MaybeUpdateSinCosAngle();return this._cosA}SetOriginX(a){this._ox=+a}OffsetOriginX(a){this._ox+=+a}GetOriginX(){return this._ox}SetOriginY(a){this._oy=+a}OffsetOriginY(a){this._oy+=+a}GetOriginY(){return this._oy}_SetColor(a){this._color.equals(a)||(this._color===
DEFAULT_COLOR?(this._color=C3$jscomp$159.New(C3$jscomp$159.Color,a),this._colorPremultiplied=C3$jscomp$159.New(C3$jscomp$159.Color,a),this._colorPremultiplied.premultiply()):a.equalsRgba(1,1,1,1)?this._colorPremultiplied=this._color=DEFAULT_COLOR:(this._color.set(a),this._colorPremultiplied.set(a),this._colorPremultiplied.premultiply()),this._UpdateRendererStateGroup())}SetOpacity(a){a=C3$jscomp$159.clamp(+a,0,1);this._color.a!==a&amp;&amp;(tempColor$jscomp$6.copyRgb(this._color),tempColor$jscomp$6.a=a,this._SetColor(tempColor$jscomp$6))}OffsetOpacity(a){this.SetOpacity(this.GetOpacity()+
a)}GetOpacity(){return this._color.a}SetUnpremultipliedColor(a){this._color.equalsIgnoringAlpha(a)||(tempColor$jscomp$6.copyRgb(a),tempColor$jscomp$6.a=this._color.a,this._SetColor(tempColor$jscomp$6))}SetUnpremultipliedColorRGB(a,b,d){tempColor$jscomp$6.setRgb(a,b,d);this.SetUnpremultipliedColor(tempColor$jscomp$6)}OffsetUnpremultipliedColorRGB(a,b,d){if(0!==a||0!==b||0!==d)tempColor$jscomp$6.copyRgb(this._color),tempColor$jscomp$6.r+=a,tempColor$jscomp$6.g+=b,tempColor$jscomp$6.b+=d,this.SetUnpremultipliedColor(tempColor$jscomp$6)}GetUnpremultipliedColor(){return this._color}GetPremultipliedColor(){return this._colorPremultiplied}GetDestroyWithParent(){return 0!==
(this._flags&amp;FLAG_DESTROY_WITH_PARENT)}SetDestroyWithParent(a){this._SetFlag(FLAG_DESTROY_WITH_PARENT,a)}GetTransformWithParentX(){return 0!==(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_X)}SetTransformWithParentX(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_X,a)}GetTransformWithParentY(){return 0!==(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_Y)}GetTransformWithParentXOrY(){return 0!==(this._flags&amp;(FLAG_TRANSFORM_WITH_PARENT_X|FLAG_TRANSFORM_WITH_PARENT_Y))}SetTransformWithParentY(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_Y,
a)}GetTransformWithParentWidth(){return 0!==(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_W)}SetTransformWithParentWidth(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_W,a)}GetTransformWithParentHeight(){return 0!==(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_H)}SetTransformWithParentHeight(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_H,a)}GetTransformWithParentAngle(){return 0!==(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_A)}SetTransformWithParentAngle(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_A,a)}GetTransformWithParentZElevation(){return 0!==
(this._flags&amp;FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION)}SetTransformWithParentZElevation(a){this._SetFlag(FLAG_TRANSFORM_WITH_PARENT_Z_ELEVATION,a)}_ClearAllSceneGraphFlags(){this._flags&amp;=~MASK_ALL_SCENE_GRAPH_FLAGS}AddChild(a,b){if(a!==this&amp;&amp;!a.HasParent()&amp;&amp;!this._HasChildRecursive(a)&amp;&amp;!this._HasAnyParent(a)){var d=a.GetX(),c=a.GetY(),e=a.GetWidth(),h=a.GetHeight(),k=a.GetAngle(),m=a.GetZElevation();a._SetParent(this);a.SetTransformWithParentX(b.transformX);a.SetTransformWithParentY(b.transformY);a.SetTransformWithParentWidth(b.transformWidth);
a.SetTransformWithParentHeight(b.transformHeight);a.SetTransformWithParentAngle(b.transformAngle);a.SetTransformWithParentZElevation(b.transformZElevation);a.SetDestroyWithParent(b.destroyWithParent);b.transformX&amp;&amp;(a._x=d-this.GetX(),b.transformWidth&amp;&amp;(a._x/=this.GetWidth()/this._sceneGraphInfo._GetStartWidth()));b.transformY&amp;&amp;(a._y=c-this.GetY(),b.transformHeight&amp;&amp;(a._y/=this.GetHeight()/this._sceneGraphInfo._GetStartHeight()));b.transformWidth&amp;&amp;(d=this.GetWidth(),0===d||d===Number.EPSILON?(a._w=
1,a._sceneGraphInfo.SetStartScaleX(1)):(a._w=e/this.GetWidth(),a._sceneGraphInfo.SetStartScaleX(a._w)));b.transformHeight&amp;&amp;(e=this.GetHeight(),0===e||e===Number.EPSILON?(a._h=1,a._sceneGraphInfo.SetStartScaleY(1)):(a._h=h/this.GetHeight(),a._sceneGraphInfo.SetStartScaleY(a._h)));b.transformAngle&amp;&amp;(a._a=k-this.GetAngle());b.transformZElevation&amp;&amp;(a._zElevation=m-this.GetZElevation());this._AddChildToSceneGraphInfo(a);this.SetBboxChanged()}}RemoveChild(a){if(a.GetParent()===this){var b=a.GetX(),d=a.GetY(),
c=a.GetWidth(),e=a.GetHeight(),h=a.GetAngle(),k=a.GetZElevation();a._SetParent(null);a._ClearAllSceneGraphFlags();a.SetXY(b,d);a.SetSize(c,e);a.SetAngle(h);a.SetZElevation(k);this._RemoveChildFromSceneGraphInfo(a);this.SetBboxChanged()}}_ResetAllSceneGraphState(){this._BuildTmpSceneGraphChildren();var a=[...this.children()];for(const b of a)this.RemoveChild(b);if(a=this.GetParent())a.RemoveChild(this),this._tmpSceneGraphParent=a;this._ClearAllSceneGraphFlags()}_BuildTmpSceneGraphChildren(){if(!this._tmpSceneGraphChildren){var a=
[...this.children()];a.length&amp;&amp;(this._tmpSceneGraphChildren=[]);for(const b of a)this._tmpSceneGraphChildren.push(b.GetInstance())}(a=this.GetParent())&amp;&amp;a._BuildTmpSceneGraphChildren()}_ReleaseTmpSceneGraphInfo(){this._tmpSceneGraphParent=this._tmpSceneGraphChildren=null}HasParent(){return null!==this.GetParent()}GetParent(){const a=this._sceneGraphInfo;return null!==a?a.GetParent():null}GetTopParent(){let a=this;for(;a.HasParent();)a=a.GetParent();return a}*parents(){let a=this.GetParent();for(;a;)yield a,
a=a.GetParent()}HasChild(a){return this.GetChildren().includes(a)}HasChildren(){const a=this._sceneGraphInfo;return null!==a?a.HasChildren():!1}GetChildren(){const a=this._sceneGraphInfo;return null!==a?a.GetChildren():EMPTY_ARRAY$jscomp$2}children(){return this.GetChildren()}*allChildren(){for(const a of this.children())yield a,yield*a.allChildren()}GetChildCount(){return this.GetChildren().length}GetAllChildCount(){return[...this.allChildren()].length}GetChildAt(a){const b=this.GetChildren();a=
Math.floor(+a);return 0&gt;a||a&gt;=b.length?null:b[a]}_CreateSceneGraphInfo(a){this._sceneGraphInfo||(this._sceneGraphInfo=C3$jscomp$159.New(C3$jscomp$159.SceneGraphInfo,this));a&amp;&amp;this._sceneGraphInfo.SetParent(a)}_GetSceneGraphInfo(){return this._sceneGraphInfo}_ReleaseSceneGraphInfo(){this._sceneGraphInfo&amp;&amp;(this._sceneGraphInfo.Release(),this._sceneGraphInfo=null)}_SetParent(a){a?(a._CreateSceneGraphInfo(null),this._CreateSceneGraphInfo(a)):(this._sceneGraphInfo&amp;&amp;this._sceneGraphInfo.SetParent(null),
this.HasChildren()||this._ReleaseSceneGraphInfo())}_HasAnyParent(a){if(!this.HasParent())return!1;const b=this.GetParent();return b===a?!0:b._HasAnyParent(a)}_HasChildRecursive(a){if(this.HasChild(a))return!0;for(const b of this.GetChildren())if(b._HasChildRecursive(a))return!0;return!1}_AddChildToSceneGraphInfo(a){this._sceneGraphInfo.GetChildren().push(a)}_RemoveChildFromSceneGraphInfo(a){const b=this._sceneGraphInfo.GetChildren(),d=b.indexOf(a);-1!==d&amp;&amp;b.splice(d,1);0!==b.length||this.HasParent()||
this._ReleaseSceneGraphInfo();a.HasChildren()||a._ReleaseSceneGraphInfo()}GetSceneGraphChildrenExportData(){const a=sceneGraphExportDataMap.get(this);return a?a.childrenData:null}GetSceneGraphZIndexExportData(){const a=sceneGraphExportDataMap.get(this);return a?a.zIndexData:NaN}GetSceneGraphZIndex(){const a=sceneGraphZIndexMap.get(this);return C3$jscomp$159.IsFiniteNumber(a)?a:NaN}SetSceneGraphZIndex(a){sceneGraphZIndexMap.set(this,a)}SetUsePointsShaderProgram(){this._SetFlag(FLAG_USE_POINTS_SHADER_PROGRAM,
!0);this._UpdateRendererStateGroup()}_UpdateRendererStateGroup(){if(enableUpdateRendererStateGroup){var a=this._runtime.GetRenderer();this._stateGroup&amp;&amp;a.ReleaseStateGroup(this._stateGroup);var b=0!==(this._flags&amp;FLAG_USE_POINTS_SHADER_PROGRAM)?a.GetPointsRenderingProgram()||"&lt;point&gt;":a.GetTextureFillShaderProgram()||"&lt;default&gt;";this._stateGroup=a.AcquireStateGroup(b,this.GetBlendMode(),this._colorPremultiplied,this.GetZElevation())}}GetRendererStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===
DEFAULT_COLOR}SetBlendMode(a){a|=0;if(0&gt;a||31&lt;a)throw new RangeError("invalid blend mode");this.GetBlendMode()!==a&amp;&amp;(this._flags=this._flags&amp;~FLAG_BLEND_MODE_MASK|a&lt;&lt;26,this._UpdateRendererStateGroup())}GetBlendMode(){return(this._flags&amp;FLAG_BLEND_MODE_MASK)&gt;&gt;26}_SetLayer(a){this._layer=a;0!==this.GetZElevation()&amp;&amp;this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(a){this._zIndex=a|0}GetZIndex(){this._layer._UpdateZIndices();
return this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(a,b){this._flags=b?this._flags|a:this._flags&amp;~a}IsVisible(){return 0!==(this._flags&amp;FLAG_IS_VISIBLE)}SetVisible(a){this._SetFlag(FLAG_IS_VISIBLE,a)}IsCollisionEnabled(){return 0!==(this._flags&amp;FLAG_COLLISION_ENABLED)}SetCollisionEnabled(a){a=!!a;this.IsCollisionEnabled()!==a&amp;&amp;(this._SetFlag(FLAG_COLLISION_ENABLED,a),a?this.SetBboxChanged():this._RemoveFromCollisionCells())}SetSolidCollisionFilter(a,b){this._SetFlag(FLAG_SOLID_FILTER_INCLUSIVE,
a);this._solidFilterTags&amp;&amp;this._solidFilterTags.clear();if(b.trim()){this._solidFilterTags||(this._solidFilterTags=new Set);for(const d of b.split(" "))d&amp;&amp;this._solidFilterTags.add(d.toLowerCase())}else this._solidFilterTags=null}IsSolidCollisionAllowed(a){const b=0!==(this._flags&amp;FLAG_SOLID_FILTER_INCLUSIVE),d=this._solidFilterTags;if(!a||!d)return!b;for(const c of d)if(a.has(c))return b;return!b}SetBboxChanged(){this._flags=this._flags|FLAG_BBOX_CHANGED|FLAG_COLLISION_CELL_CHANGED|FLAG_MESH_CHANGED;
this._objectClass._SetAnyCollisionCellChanged(!0);this._runtime.UpdateRender();this._layer.UsesRenderCells()&amp;&amp;(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags&amp;=~FLAG_BBOX_CHANGED,this._UpdateRenderCell());0!==(this._flags&amp;FLAG_ENABLE_BBOX_CHANGED_EVENT)&amp;&amp;this._inst.Dispatcher().dispatchEvent(bboxChangeEvent);if(null!==this._sceneGraphInfo){const a=this._sceneGraphInfo.GetChildren();for(let b=0,d=a.length;b&lt;d;++b)a[b].SetBboxChanged()}}CalculateBbox(a,b,d){const c=this.GetX(),
e=this.GetY(),h=this.GetWidth(),k=this.GetHeight(),m=this.GetAngle();a.setWH(c-this._ox*h,e-this._oy*k,h,k);d&amp;&amp;this.HasMesh()&amp;&amp;this._ExpandBboxForMesh(a);0===m?b.setFromRect(a):(a.offset(-c,-e),b.setFromRotatedRectPrecalc(a,this.GetSinAngle(),this.GetCosAngle()),b.offset(c,e),b.getBoundingBox(a));a.normalize()}_UpdateBbox(){const a=this._flags;0!==(a&amp;FLAG_BBOX_CHANGED)&amp;&amp;(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags=a&amp;~FLAG_BBOX_CHANGED)}GetBoundingBox(){this._UpdateBbox();
return this._boundingBox}GetBoundingQuad(){this._UpdateBbox();return this._boundingQuad}PixelRoundQuad(a){var b=this.GetX(),d=this.GetY();b=Math.round(b)-b;d=Math.round(d)-d;if(0===b&amp;&amp;0===d)return a;tempQuad$jscomp$3.copy(a);tempQuad$jscomp$3.offset(b,d);return tempQuad$jscomp$3}OverwriteBoundingBox(a){this._boundingBox.copy(a);this._boundingQuad.setFromRect(this._boundingBox);this._flags&amp;=~FLAG_BBOX_CHANGED;this._UpdateCollisionCell();this._UpdateRenderCell()}SetBboxChangeEventEnabled(a){this._SetFlag(FLAG_ENABLE_BBOX_CHANGED_EVENT,
a)}IsBboxChangeEventEnabled(){return 0!==(this._flags&amp;FLAG_ENABLE_BBOX_CHANGED_EVENT)}IsInViewport(a,b,d){return b&amp;&amp;0!==this.GetDepth()?this.IsInViewport3D(this.GetLayer()._GetViewFrustum()):0===this.GetZElevation()||d?a.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const a=this.GetLayer(),b=this.GetTotalZElevation();if(b&gt;=a.GetCameraZ())return!1;a.GetViewportForZ(b,tempRect$jscomp$6);return tempRect$jscomp$6.intersectsRect(this.GetBoundingBox())}IsInViewport3D(a){var b=
this.GetBoundingBox();const d=b.getLeft(),c=b.getRight(),e=b.getTop();b=b.getBottom();const h=this.GetTotalZElevation(),k=h+this.GetDepth();return a.ContainsAABB(d,e,h,c,b,k)}_SetDrawBackFaceOnly(a){this._SetFlag(FLAG_DRAW_BACK_FACE_ONLY,a)}_SetDrawNonBackFacesOnly(a){this._SetFlag(FLAG_DRAW_NON_BACK_FACES_ONLY,a)}IsDrawBackFaceOnly(){return 0!==(this._flags&amp;FLAG_DRAW_BACK_FACE_ONLY)}IsDrawNonBackFacesOnly(){return 0!==(this._flags&amp;FLAG_DRAW_NON_BACK_FACES_ONLY)}SetSourceCollisionPoly(a){this._sourceCollisionPoly=
a;this._DiscardTransformedCollisionPoly();this.HasMesh()&amp;&amp;(this._meshInfo.meshPoly=null)}GetSourceCollisionPoly(){return this._sourceCollisionPoly}HasOwnCollisionPoly(){return null!==this._sourceCollisionPoly||this.HasMesh()}GetTransformedCollisionPoly(){return this._GetCustomTransformedCollisionPolyPrecalc(this.GetWidth(),this.GetHeight(),this.GetAngle(),this.GetSinAngle(),this.GetCosAngle())}GetCustomTransformedCollisionPoly(a,b,d){let c=0,e=1;0!==d&amp;&amp;(c=Math.sin(d),e=Math.cos(d));return this._GetCustomTransformedCollisionPolyPrecalc(a,
b,d,c,e)}_GetCustomTransformedCollisionPolyPrecalc(a,b,d,c,e){let h=this._transformedPolyInfo;null===h&amp;&amp;(this._transformedPolyInfo=h={poly:C3$jscomp$159.New(C3$jscomp$159.CollisionPoly),width:NaN,height:NaN,angle:NaN});const k=h.poly;if(h.width===a&amp;&amp;h.height===b&amp;&amp;h.angle===d)return k;const m=this._sourceCollisionPoly;if(this.HasMesh()){const p=this.GetOriginX(),q=this.GetOriginY(),v=this.GetSourceMesh();let x=this._meshInfo.meshPoly;x||(m?(tempCollisionPoly.copy(m),tempCollisionPoly.offset(p,q)):
tempCollisionPoly.setDefaultPoints(),x=v.InsertPolyMeshVertices(tempCollisionPoly),this._meshInfo.meshPoly=x);v.TransformCollisionPoly(x,k);k.offset(-p,-q);k.transformPrecalc(a,b,c,e)}else m?(k.copy(m),k.transformPrecalc(a,b,c,e)):k.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY());h.width=a;h.height=b;h.angle=d;return k}_DiscardTransformedCollisionPoly(){this.SetPhysicsBodyChanged(!0);const a=this._transformedPolyInfo;null!==a&amp;&amp;(a.width=NaN)}CreateMesh(a,b){a=Math.floor(a);b=Math.floor(b);
if(!this.GetInstance().GetPlugin().SupportsMesh())throw Error("object does not support mesh");this.ReleaseMesh();this._meshInfo={sourceMesh:C3$jscomp$159.New(C3$jscomp$159.Gfx.Mesh,a,b),transformedMesh:C3$jscomp$159.New(C3$jscomp$159.Gfx.Mesh,a,b),meshPoly:null}}HasMesh(){return null!==this._meshInfo}GetSourceMesh(){if(!this.HasMesh())throw Error("no mesh");return this._meshInfo.sourceMesh}GetTransformedMesh(){if(!this.HasMesh())throw Error("no mesh");return this._meshInfo.transformedMesh}SetMeshChanged(a){this._SetFlag(FLAG_MESH_CHANGED,
a)}IsMeshChanged(){return 0!==(this._flags&amp;FLAG_MESH_CHANGED)}SetPhysicsBodyChanged(a){this._SetFlag(FLAG_PHYSICS_BODY_CHANGED,a)}IsPhysicsBodyChanged(){return 0!==(this._flags&amp;FLAG_PHYSICS_BODY_CHANGED)}_ExpandBboxForMesh(a){const b=this._meshInfo.sourceMesh,d=Math.min(b.GetMinX(),0),c=Math.min(b.GetMinY(),0),e=Math.max(b.GetMaxX(),1),h=Math.max(b.GetMaxY(),1),k=a.width(),m=a.height();a.offsetLeft(d*k);a.offsetTop(c*m);a.offsetRight((e-1)*k);a.offsetBottom((h-1)*m);this._depth=b.GetMaxZ()}ReleaseMesh(){this._meshInfo&amp;&amp;
(this._meshInfo.sourceMesh.Release(),this._meshInfo.transformedMesh.Release(),this._meshInfo=null,this._DiscardTransformedCollisionPoly())}SetMeshPoint(a,b,d){a=Math.floor(a);b=Math.floor(b);var c=d.mode||"absolute";if(!VALID_SET_MESH_POINT_MODES.has(c))throw Error("invalid mode");c="relative"===c;let e=d.x,h=d.y;const k=d.zElevation;let m="number"===typeof d.u?d.u:c?0:-1;d="number"===typeof d.v?d.v:c?0:-1;if(!this.HasMesh())return!1;const p=this.GetSourceMesh(),q=p.GetMeshPointAt(a,b);if(null===
q)return!1;let v=!1;"number"===typeof k&amp;&amp;q.GetZElevation()!==k&amp;&amp;(q.SetZElevation(k),v=!0);c&amp;&amp;(e+=a/(p.GetHSize()-1),h+=b/(p.GetVSize()-1));-1!==m||c?(c&amp;&amp;(m+=a/(p.GetHSize()-1)),m=C3$jscomp$159.clamp(m,0,1)):m=q.GetU();-1!==d||c?(c&amp;&amp;(d+=b/(p.GetVSize()-1)),d=C3$jscomp$159.clamp(d,0,1)):d=q.GetV();if(q.GetX()===e&amp;&amp;q.GetY()===h&amp;&amp;q.GetU()===m&amp;&amp;q.GetV()===d)return v;q.SetX(e);q.SetY(h);q.SetU(m);q.SetV(d);this._DiscardTransformedCollisionPoly();return!0}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(a,
b){return this.GetBoundingBox().containsPoint(a,b)&amp;&amp;this.GetBoundingQuad().containsPoint(a,b)?this.HasTilemap()?this._inst.GetSdkInstance().TestPointOverlapTile(a,b):this.HasOwnCollisionPoly()?this.GetTransformedCollisionPoly().containsPoint(a-this.GetX(),b-this.GetY()):!0:!1}_IsCollisionCellChanged(){return 0!==(this._flags&amp;FLAG_COLLISION_CELL_CHANGED)}_UpdateCollisionCell(){if(this._IsCollisionCellChanged()&amp;&amp;this.IsCollisionEnabled()&amp;&amp;0===(this._flags&amp;FLAG_DESTROYED$jscomp$1)){var a=this.GetBoundingBox(),
b=this._objectClass._GetCollisionCellGrid(),d=this._collisionCells;tempRect$jscomp$6.set(b.XToCell(a.getLeft()),b.YToCell(a.getTop()),b.XToCell(a.getRight()),b.YToCell(a.getBottom()));d.equals(tempRect$jscomp$6)||(a=this._inst,d===DEFAULT_COLLISION_CELLS?(b.Update(a,null,tempRect$jscomp$6),this._collisionCells=C3$jscomp$159.New(C3$jscomp$159.Rect,tempRect$jscomp$6)):(b.Update(a,d,tempRect$jscomp$6),d.copy(tempRect$jscomp$6)),this._flags&amp;=~FLAG_COLLISION_CELL_CHANGED)}}_RemoveFromCollisionCells(){const a=
this._collisionCells;a!==DEFAULT_COLLISION_CELLS&amp;&amp;(this._objectClass._GetCollisionCellGrid().Update(this._inst,a,null),this._collisionCells=DEFAULT_COLLISION_CELLS)}_UpdateRenderCell(){const a=this.GetLayer();if(a.UsesRenderCells()&amp;&amp;0===(this._flags&amp;FLAG_DESTROYED$jscomp$1)){var b=a.GetRenderGrid(),d=this.GetBoundingBox(),c=this._renderCells;tempRect$jscomp$6.set(b.XToCell(d.getLeft()),b.YToCell(d.getTop()),b.XToCell(d.getRight()),b.YToCell(d.getBottom()));c.equals(tempRect$jscomp$6)||(d=this._inst,
c===DEFAULT_RENDER_CELLS?(b.Update(d,null,tempRect$jscomp$6),this._renderCells=C3$jscomp$159.New(C3$jscomp$159.Rect,tempRect$jscomp$6)):(b.Update(d,c,tempRect$jscomp$6),c.copy(tempRect$jscomp$6)),a.SetRenderListStale())}}_RemoveFromRenderCells(){const a=this._renderCells;a!==DEFAULT_RENDER_CELLS&amp;&amp;(this.GetLayer().GetRenderGrid().Update(this._inst,a,null),this._renderCells=DEFAULT_RENDER_CELLS)}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const a=this._inst,b=this._layer,d=b._GetInstances();
d.length&amp;&amp;d.at(-1)===a||(b._RemoveInstance(a,!1),b._AddInstance(a,!1),this._runtime.UpdateRender())}ZOrderMoveToBottom(){const a=this._inst,b=this._layer,d=b._GetInstances();d.length&amp;&amp;d[0]===a||(b._RemoveInstance(a,!1),b._PrependInstance(a,!1),this._runtime.UpdateRender())}ZOrderMoveToLayer(a){const b=this._inst,d=this._layer;if(d.GetLayout()!==a.GetLayout())throw Error("layer from different layout");a!==d&amp;&amp;(d._RemoveInstance(b,!0),this._SetLayer(a),a._AddInstance(b,!0),this._runtime.UpdateRender())}ZOrderMoveAdjacentToInstance(a,
b){const d=this._inst;let c=!1;const e=this._layer;if(a.GetUID()!==d.GetUID()){var h=a.GetWorldInfo();if(!h)throw Error("expected world instance");h=h.GetLayer();e.GetIndex()!==h.GetIndex()&amp;&amp;(e._RemoveInstance(d,!0),this._SetLayer(h),h._AddInstance(d,!0),c=!0);a=h.MoveInstanceAdjacent(d,a,!!b);(c||a)&amp;&amp;this._runtime.UpdateRender()}}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(a){this._SetFlag(FLAG_HAS_ANY_ACTIVE_EFFECT,a)}HasAnyActiveEffect(){return 0!==(this._flags&amp;
FLAG_HAS_ANY_ACTIVE_EFFECT)}_SaveToJson(a){const b={x:this.GetX(),y:this.GetY(),w:this.GetWidth(),h:this.GetHeight(),l:this.GetLayer().GetSID(),zi:this.GetZIndex()};0!==this.GetZElevation()&amp;&amp;(b.ze=this.GetZElevation());0!==this.GetAngle()&amp;&amp;(b.a=this.GetAngle());this.HasDefaultColor()||(b.c=this._color.toJSON());.5!==this.GetOriginX()&amp;&amp;(b.oX=this.GetOriginX());.5!==this.GetOriginY()&amp;&amp;(b.oY=this.GetOriginY());0!==this.GetBlendMode()&amp;&amp;(b.bm=this.GetBlendMode());this.IsVisible()||(b.v=this.IsVisible());
this.IsCollisionEnabled()||(b.ce=this.IsCollisionEnabled());this.IsBboxChangeEventEnabled()&amp;&amp;(b.be=this.IsBboxChangeEventEnabled());this._instanceEffectList&amp;&amp;(b.fx=this._instanceEffectList._SaveToJson());const d=0!==(this._flags&amp;FLAG_SOLID_FILTER_INCLUSIVE);d&amp;&amp;(b.sfi=d);this._solidFilterTags&amp;&amp;(b.sft=[...this._solidFilterTags].join(" "));this._sceneGraphInfo&amp;&amp;"visual-state"!==a&amp;&amp;(b.sgi=this._sceneGraphInfo._SaveToJson(a),sceneGraphExportDataMap.has(this)&amp;&amp;(b.sgcd=sceneGraphExportDataMap.get(this).childrenData,
b.sgzid=sceneGraphExportDataMap.get(this).zIndexData));this.HasMesh()&amp;&amp;(b.mesh=this.GetSourceMesh().SaveToJson());return b}_SaveSceneGraphPropertiesToJson(){return{x:this._x,y:this._y,z:this._zElevation,w:this._w,h:this._h,a:this._a,sa:this._sinA,ca:this._cosA}}_LoadSceneGraphPropertiesFromJson(a){a&amp;&amp;(this._x=a.x,this._y=a.y,this._zElevation=a.z,this._w=a.w,this._h=a.h,this._a=a.a,this._sinA=a.sa,this._cosA=a.ca,this.SetBboxChanged())}_OnBeforeLoad(a){"visual-state"!==a&amp;&amp;this._ResetAllSceneGraphState()}_LoadFromJson(a,
b){enableUpdateRendererStateGroup=!1;this.SetX(a.x);this.SetY(a.y);this.SetWidth(a.w);this.SetHeight(a.h);this._SetZIndex(a.zi);this.SetZElevation(a.hasOwnProperty("ze")?a.ze:0);this.SetAngle(a.hasOwnProperty("a")?a.a:0);a.hasOwnProperty("c")?tempColor$jscomp$6.setFromJSON(a.c):a.hasOwnProperty("o")?(tempColor$jscomp$6.copyRgb(this._color),tempColor$jscomp$6.a=a.o):tempColor$jscomp$6.setRgba(1,1,1,1);this._SetColor(tempColor$jscomp$6);this.SetOriginX(a.hasOwnProperty("oX")?a.oX:.5);this.SetOriginY(a.hasOwnProperty("oY")?
a.oY:.5);this.SetBlendMode(a.hasOwnProperty("bm")?a.bm:0);this.SetVisible(a.hasOwnProperty("v")?a.v:!0);this.SetCollisionEnabled(a.hasOwnProperty("ce")?a.ce:!0);this.SetBboxChangeEventEnabled(a.hasOwnProperty("be")?a.be:!1);this.SetSolidCollisionFilter(a.hasOwnProperty("sfi")?a.sfi:!1,a.hasOwnProperty("sft")?a.sft:"");this._instanceEffectList&amp;&amp;a.hasOwnProperty("fx")&amp;&amp;this._instanceEffectList._LoadFromJson(a.fx);if(!a.hasOwnProperty("sgi")&amp;&amp;"visual-state"!==b&amp;&amp;this._tmpSceneGraphChildren)for(const d of this._tmpSceneGraphChildren)this._runtime.DestroyInstance(d);
if(a.hasOwnProperty("sgi")&amp;&amp;"visual-state"!==b){this._CreateSceneGraphInfo(null);const d=this._sceneGraphInfo,c=a.sgi;d._LoadFromJson(c);d._SetTmpSceneGraphChildren(this._tmpSceneGraphChildren);const e=this.GetRuntime().Dispatcher(),h=(m,p)=&gt;{e.removeEventListener("afterload",h);e.removeEventListener("afterloadinstance",k);0===(this._flags&amp;FLAG_DESTROYED$jscomp$1)&amp;&amp;(d._OnAfterLoad(c,p),d._SetTmpSceneGraphChildren(null),this._tmpSceneGraphParent&amp;&amp;this._tmpSceneGraphParent._ReleaseTmpSceneGraphInfo(),
this._ReleaseTmpSceneGraphInfo())},k=m=&gt;{m.instance===this.GetInstance()&amp;&amp;h(m,{ignoreMissingInstances:!0})};e.addEventListener("afterload",h);e.addEventListener("afterloadinstance",k);a.sgcd&amp;&amp;C3$jscomp$159.IsFiniteNumber(a.sgzid)&amp;&amp;sceneGraphExportDataMap.set(this,{childrenData:a.sgcd,zIndexData:a.sgzid})}a.hasOwnProperty("mesh")?(a=a.mesh,this.CreateMesh(a.cols,a.rows),this.GetSourceMesh().LoadFromJson(a)):this.ReleaseMesh();this.SetBboxChanged();enableUpdateRendererStateGroup=!0;this._UpdateRendererStateGroup()}};
"use strict";const C3$jscomp$160=self.C3;
C3$jscomp$160.BehaviorType=class extends C3$jscomp$160.DefendedBase{constructor(a,b){super();const d=a.GetRuntime(),c=d.GetPluginManager(),e=d.GetObjectReference(b[1]);c.HasBehaviorByConstructorFunction(e)||c.CreateBehavior(b);this._runtime=d;this._objectClass=a;this._behavior=c.GetBehaviorByConstructorFunction(e);this._sdkType=null;this._instSdkCtor=e.Instance;this._sid=b[2];this._name=b[0];this._jsPropName=this._runtime.GetJsPropName(b[3]);this._sdkType=C3$jscomp$160.New(e.Type,this);this.OnCreate()}static Create(a,
b){return C3$jscomp$160.New(C3$jscomp$160.BehaviorType,a,b)}Release(){this._behavior=this._runtime=null;this._sdkType.Release();this._instSdkCtor=this._sdkType=null}GetSdkType(){return this._sdkType}OnCreate(){this._sdkType.OnCreate()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetBehavior(){return this._behavior}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetSID(){return this._sid}GetJsPropName(){return this._jsPropName}};"use strict";
const C3$jscomp$161=self.C3,IBehaviorInstance$jscomp$1=self.IBehaviorInstance;
C3$jscomp$161.BehaviorInstance=class extends C3$jscomp$161.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._behaviorType=a.behaviorType;this._behavior=this._behaviorType.GetBehavior();this._inst=a.instance;this._index=a.index;this._iScriptInterface=this._sdkInst=null;this._behavior._AddInstance(this._inst)}Release(){this._iScriptInterface&amp;&amp;(this._iScriptInterface._Release(),this._iScriptInterface=null);this._behavior._RemoveInstance(this._inst);this._sdkInst.Release();this._inst=
this._behavior=this._behaviorType=this._runtime=this._iScriptInterface=this._sdkInst=null}_CreateSdkInstance(a){if(this._sdkInst)throw Error("already got sdk instance");this._sdkInst=C3$jscomp$161.New(this._behaviorType.GetInstanceSdkCtor(),this,a);this._InitScriptInterface()}GetSdkInstance(){return this._sdkInst}GetObjectInstance(){return this._inst}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetBehavior(){return this._behavior}_GetIndex(){return this._index}PostCreate(){this._sdkInst.PostCreate()}OnSpriteFrameChanged(a,
b){this._sdkInst.OnSpriteFrameChanged(a,b)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(a){return this._sdkInst.LoadFromJson(a)}static SortByTickSequence(a,b){var d=a.GetObjectInstance(),c=b.GetObjectInstance();const e=d.GetObjectClass().GetIndex(),h=c.GetObjectClass().GetIndex();if(e!==h)return e-h;d=d.GetPUID();c=c.GetPUID();return d!==c?d-c:a.GetBehaviorInstance()._GetIndex()-b.GetBehaviorInstance()._GetIndex()}_InitScriptInterface(){const a=
this._sdkInst.GetScriptInterfaceClass(),b=a||IBehaviorInstance$jscomp$1;IBehaviorInstance$jscomp$1._Init(this);this._iScriptInterface=new b;IBehaviorInstance$jscomp$1._Init(null);if(a&amp;&amp;!(this._iScriptInterface instanceof IBehaviorInstance$jscomp$1))throw new TypeError(`script interface class '${a.name}' does not extend the right base class '${IBehaviorInstance$jscomp$1.name}'`);}GetScriptInterface(){return this._iScriptInterface}};"use strict";const C3$jscomp$162=self.C3;
C3$jscomp$162.EffectList=class extends C3$jscomp$162.DefendedBase{constructor(a,b){super();this._owner=a;this._allEffectTypes=[];this._activeEffectTypes=[];this._effectTypesByName=new Map;this._effectParams=[];this._effectParamBuffers=[];this._preservesOpaqueness=!0;for(const d of b)a=C3$jscomp$162.New(C3$jscomp$162.EffectType,this,d,this._allEffectTypes.length),this._allEffectTypes.push(a),this._effectTypesByName.set(a.GetName().toLowerCase(),a),3&lt;=d.length&amp;&amp;this._effectParams.push(this._LoadSingleEffectParameters(a,
d[2]));this.GetRuntime()._AddEffectList(this)}Release(){for(const a of this._effectParamBuffers)a.Release();C3$jscomp$162.clearArray(this._effectParamBuffers);C3$jscomp$162.clearArray(this._allEffectTypes);C3$jscomp$162.clearArray(this._activeEffectTypes);this._effectTypesByName.clear();C3$jscomp$162.clearArray(this._effectParams);this._owner=null}_InitRenderer(a){a.IsWebGPU()&amp;&amp;(this._effectParamBuffers=this._allEffectTypes.map(b=&gt;{b=b.GetShaderProgram();return 0&lt;b.GetCustomParametersByteSize()?C3$jscomp$162.New(C3$jscomp$162.Gfx.WebGPUEffectCustomParamsBuffer,
b):null}),this._UpdateAllEffectParamBuffers())}PrependEffectTypes(a){if(a.length){this._allEffectTypes=a.concat(this._allEffectTypes);for(const b of a)this._effectTypesByName.set(b.GetName().toLowerCase(),b);for(let b=0,d=this._allEffectTypes.length;b&lt;d;++b)this._allEffectTypes[b]._SetIndex(b)}}_LoadSingleEffectParameters(a,b){a.SetActive(b[0]);a=b.slice(1);for(let d=0,c=a.length;d&lt;c;++d)if(b=a[d],Array.isArray(b)){const e=C3$jscomp$162.New(C3$jscomp$162.Color);e.setFromJSON(b);a[d]=e}return a}GetOwner(){return this._owner}GetRuntime(){return this._owner.GetRuntime()}UpdateActiveEffects(){C3$jscomp$162.clearArray(this._activeEffectTypes);
let a=!0;for(const b of this._allEffectTypes)b.IsActive()&amp;&amp;(this._activeEffectTypes.push(b),b.GetShaderProgram().PreservesOpaqueness()||(a=!1));this._preservesOpaqueness=a}GetAllEffectTypes(){return this._allEffectTypes}HasAnyEffectType(){return 0&lt;this._allEffectTypes.length}GetEffectTypeByName(a){return this._effectTypesByName.get(a.toLowerCase())||null}GetEffectTypeByIndex(a){a=Math.floor(+a);if(0&gt;a||a&gt;=this._allEffectTypes.length)throw new RangeError("invalid effect type index");return this._allEffectTypes[a]}IsEffectIndexActive(a){return this.GetEffectTypeByIndex(a).IsActive()}SetEffectIndexActive(a,
b){this.GetEffectTypeByIndex(a).SetActive(b)}GetActiveEffectTypes(){return this._activeEffectTypes}HasAnyActiveEffect(){return 0&lt;this._activeEffectTypes.length}PreservesOpaqueness(){return this._preservesOpaqueness}GetEffectParametersForIndex(a){return this._effectParams[a]}_GetEffectChainShaderParametersForIndex(a){return a&lt;this._effectParamBuffers.length?this._effectParamBuffers[a]:this._effectParams[a]}GetEffectParameter(a,b){if(0&gt;a||a&gt;=this._effectParams.length)return null;a=this._effectParams[a];
return 0&gt;b||b&gt;=a.length?null:a[b]}SetEffectParameter(a,b,d){if(0&gt;a||a&gt;=this._effectParams.length)return!1;const c=this._effectParams[a];if(0&gt;b||b&gt;=c.length)return!1;const e=c[b];if(e instanceof C3$jscomp$162.Color){if(e.equalsIgnoringAlpha(d))return!1;e.copyRgb(d)}else{if(e===d)return!1;c[b]=d}a&lt;this._effectParamBuffers.length&amp;&amp;this._effectParamBuffers[a].SetParameterValue(b,d);return!0}_UpdateAllEffectParamBuffers(){const a=this._effectParams,b=this._effectParamBuffers;for(let d=0,c=Math.min(a.length,
b.length);d&lt;c;++d){const e=b[d],h=a[d];for(let k=0,m=h.length;k&lt;m;++k)e.SetParameterValue(k,h[k])}}static SaveFxParamToJson(a){return a&amp;&amp;a instanceof C3$jscomp$162.Color?{t:"color",v:a.toJSON()}:a}static LoadFxParamFromJson(a){if(null===a)return NaN;if("object"===typeof a){if("color"===a.t){const b=C3$jscomp$162.New(C3$jscomp$162.Color);b.setFromJSON(a.v);return b}throw Error("invalid effect parameter type");}return a}static SaveFxParamsToJson(a){return a.map(C3$jscomp$162.EffectList.SaveFxParamToJson)}static LoadFxParamsFromJson(a){return a.map(C3$jscomp$162.EffectList.LoadFxParamFromJson)}SaveToJson(){return this._allEffectTypes.map(a=&gt;
({name:a.GetName(),active:a.IsActive(),params:C3$jscomp$162.EffectList.SaveFxParamsToJson(this._effectParams[a.GetIndex()])}))}LoadFromJson(a){for(const b of a)if(a=this.GetEffectTypeByName(b.name))a.SetActive(b.active),this._effectParams[a.GetIndex()]=C3$jscomp$162.EffectList.LoadFxParamsFromJson(b.params);this.UpdateActiveEffects();this._UpdateAllEffectParamBuffers()}};"use strict";const C3$jscomp$163=self.C3;
C3$jscomp$163.EffectType=class extends C3$jscomp$163.DefendedBase{constructor(a,b,d){super();this._effectList=a;this._id=b[0];this._name=b[1];this._index=d;this._shaderProgram=null;this._isActive=!0}Release(){this._shaderProgram=this._effectList=null}Clone(a){a=C3$jscomp$163.New(C3$jscomp$163.EffectType,a,[this._id,this._name],-1);a._shaderProgram=this._shaderProgram;a._isActive=this._isActive;return a}_InitRenderer(a){a=a.GetShaderProgramByName(this._id);if(!a)throw Error("failed to find shader program '"+
this._id+"'");this._shaderProgram=a}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(a){this._index=a}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(a){this._isActive=!!a}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const a=[];for(let b=0,d=this._shaderProgram.GetParameterCount();b&lt;d;++b){const c=this._shaderProgram.GetParameterType(b);
if("float"===c||"percent"===c)a.push(0);else if("color"===c)a.push(C3$jscomp$163.New(C3$jscomp$163.Color,1,1,1,1));else throw new TypeError("unknown effect parameter type");}return a}};"use strict";const C3$jscomp$164=self.C3;
C3$jscomp$164.InstanceEffectList=class extends C3$jscomp$164.DefendedBase{constructor(a,b){super();this._inst=a;this._wi=b;this._effectList=a.GetObjectClass().GetEffectList();this._wasDefaultColor=this._needsRebuildSteps=!0;this._wasTexRotated=this._wasRotatedOrNegativeSize=this._was3D=!1;this._effectChain=C3$jscomp$164.New(C3$jscomp$164.Gfx.EffectChain,a.GetRuntime().GetCanvasManager().GetEffectChainManager(),{drawContent:(d,c)=&gt;{c=c.GetContentObject();const e=c.GetWorldInfo();d.SetColor(e.GetPremultipliedColor());
d.SetCurrentZ(e.GetTotalZElevation());c.Draw(d);d.SetCurrentZ(0)},getSourceTextureInfo:d=&gt;{const c=d.GetCurrentTexRect(),[e,h]=d.GetCurrentSurfaceSize();return{srcTexRect:c,srcWidth:e,srcHeight:h}},getShaderParameters:d=&gt;this._GetEffectChainShaderParametersForIndex(d)});this._activeEffectFlags=[];this._activeEffectTypes=[];this._preservesOpaqueness=!0;this._effectParams=[];this._effectParamBuffers=[];a.GetRuntime().GetRenderer().IsWebGPU()&amp;&amp;(this._effectParamBuffers=this._effectList.GetAllEffectTypes().map(d=&gt;
{d=d.GetShaderProgram();return 0&lt;d.GetCustomParametersByteSize()?C3$jscomp$164.New(C3$jscomp$164.Gfx.WebGPUEffectCustomParamsBuffer,d):null}));for(let d=0,c=this._effectList.GetAllEffectTypes().length;d&lt;c;++d)this._activeEffectFlags.push(!0);this.UpdateActiveEffects()}Release(){for(const a of this._effectParamBuffers)a.Release();C3$jscomp$164.clearArray(this._effectParamBuffers);this._effectChain.Release();this._effectChain=null;C3$jscomp$164.clearArray(this._activeEffectFlags);C3$jscomp$164.clearArray(this._activeEffectTypes);
C3$jscomp$164.clearArray(this._effectParams);this._effectList=this._inst=null}_LoadEffectParameters(a){let b=0;for(const d of a)this._effectParams.push(this._LoadSingleEffectParameters(b,d)),++b;this._UpdateAllEffectParamBuffers();this.UpdateActiveEffects()}_LoadSingleEffectParameters(a,b){this._activeEffectFlags[a]=b[0];a=b.slice(1);for(let d=0,c=a.length;d&lt;c;++d)if(b=a[d],Array.isArray(b)){const e=C3$jscomp$164.New(C3$jscomp$164.Color);e.setFromJSON(b);a[d]=e}return a}LoadDefaultEffectParameters(){for(const a of this._effectList.GetAllEffectTypes())this._effectParams.push(a.GetDefaultParameterValues());
this._UpdateAllEffectParamBuffers()}GetOwner(){return this._owner}GetEffectList(){return this._effectList}GetEffectChain(){this._MaybeRebuildEffectChainSteps();return this._effectChain}GetRuntime(){return this._inst.GetRuntime()}UpdateActiveEffects(){C3$jscomp$164.clearArray(this._activeEffectTypes);const a=this._wi,b=this._effectList.GetAllEffectTypes(),d=this._activeEffectTypes,c=this._activeEffectFlags;let e=!0;for(let h=0,k=b.length;h&lt;k;++h)if(c[h]){const m=b[h];d.push(m);m.GetShaderProgram().PreservesOpaqueness()||
(e=!1)}this._preservesOpaqueness=e;a._SetHasAnyActiveEffect(!!d.length);this._needsRebuildSteps=!0}_MaybeRebuildEffectChainSteps(){const a=this._inst;var b=this._wi;const d=b.HasDefaultColor(),c=0&lt;b.GetDepth();b=0!==b.GetAngle()||0&gt;b.GetWidth()||0&gt;b.GetHeight();const e=a.IsCurrentTexRotated();if(this._needsRebuildSteps||d!==this._wasDefaultColor||c!==this._was3D||b!==this._wasRotatedOrNegativeSize||e!==this._wasTexRotated)this._effectChain.BuildSteps(this._activeEffectTypes.map(h=&gt;h.GetShaderProgram()),
{indexMap:this._activeEffectTypes.map(h=&gt;h.GetIndex()),forcePreDraw:!d||a.MustPreDraw(),is3D:c,isSourceTextureRotated:e,isRotatedOrNegativeSizeInstance:b}),this._needsRebuildSteps=!1,this._wasDefaultColor=d,this._was3D=c,this._wasRotatedOrNegativeSize=b,this._wasTexRotated=e}GetActiveEffectTypes(){return this._activeEffectTypes}GetEffectParametersForIndex(a){return this._effectParams[a]}_GetEffectChainShaderParametersForIndex(a){return a&lt;this._effectParamBuffers.length?this._effectParamBuffers[a]:
this._effectParams[a]}GetEffectParameter(a,b){if(0&gt;a||a&gt;=this._effectParams.length)return null;a=this._effectParams[a];return 0&gt;b||b&gt;=a.length?null:a[b]}SetEffectParameter(a,b,d){if(0&gt;a||a&gt;=this._effectParams.length)return!1;const c=this._effectParams[a];if(0&gt;b||b&gt;=c.length)return!1;const e=c[b];if(e instanceof C3$jscomp$164.Color){if(e.equalsIgnoringAlpha(d))return!1;e.copyRgb(d)}else{if(e===d)return!1;c[b]=d}a&lt;this._effectParamBuffers.length&amp;&amp;this._effectParamBuffers[a].SetParameterValue(b,d);return!0}_UpdateAllEffectParamBuffers(){const a=
this._effectParams,b=this._effectParamBuffers;for(let d=0,c=b.length;d&lt;c;++d){const e=b[d],h=a[d];for(let k=0,m=h.length;k&lt;m;++k)e.SetParameterValue(k,h[k])}}PreservesOpaqueness(){return this._preservesOpaqueness}HasAnyActiveBackgroundBlendingEffect(){return this._activeEffectTypes.some(a=&gt;a.GetShaderProgram().BlendsBackground())}IsEffectIndexActive(a){return this._activeEffectFlags[a]}SetEffectIndexActive(a,b){this._activeEffectFlags[a]=!!b}GetAllEffectTypes(){return this._effectList.GetAllEffectTypes()}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(a=&gt;
({name:a.GetName(),active:this._activeEffectFlags[a.GetIndex()],params:C3$jscomp$164.EffectList.SaveFxParamsToJson(this._effectParams[a.GetIndex()])}))}_LoadFromJson(a){for(const b of a)if(a=this._effectList.GetEffectTypeByName(b.name))this._activeEffectFlags[a.GetIndex()]=b.active,this._effectParams[a.GetIndex()]=C3$jscomp$164.EffectList.LoadFxParamsFromJson(b.params);this.UpdateActiveEffects();this._UpdateAllEffectParamBuffers()}};"use strict";
const C3$jscomp$165=self.C3,tempCandidates=[],tileCollRectCandidates=[],tempJumpthruRet=[],tempPolyA=C3$jscomp$165.New(C3$jscomp$165.CollisionPoly),tempPolyB=C3$jscomp$165.New(C3$jscomp$165.CollisionPoly),tempQuad$jscomp$4=C3$jscomp$165.New(C3$jscomp$165.Quad),tempRect$jscomp$7=C3$jscomp$165.New(C3$jscomp$165.Rect),tempRect2$jscomp$1=C3$jscomp$165.New(C3$jscomp$165.Rect);let tempPolyC=null,tempRect3$jscomp$1=null,tempQuadB=null;
C3$jscomp$165.CollisionEngine=class extends C3$jscomp$165.DefendedBase{constructor(a){super();this._runtime=a;this._registeredCollisions=[];this._polyCheckSec=this._polyCheckCount=this._collisionCheckSec=this._collisionCheckCount=0}Release(){this._runtime=null}_Update1sStats(){this._collisionCheckSec=this._collisionCheckCount;this._collisionCheckCount=0;this._polyCheckSec=this._polyCheckCount;this._polyCheckCount=0}Get1secCollisionChecks(){return this._collisionCheckSec}Get1secPolyChecks(){return this._polyCheckSec}RegisterCollision(a,
b){const d=a.GetWorldInfo(),c=b.GetWorldInfo();d&amp;&amp;c&amp;&amp;d.IsCollisionEnabled()&amp;&amp;c.IsCollisionEnabled()&amp;&amp;this._registeredCollisions.push([a,b])}AddRegisteredCollisionCandidates(a,b,d){for(const [c,e]of this._registeredCollisions){let h;if(a===c)h=e;else if(a===e)h=c;else continue;h.BelongsToObjectClass(b)&amp;&amp;(d.includes(h)||d.push(h))}}CheckRegisteredCollision(a,b){if(!this._registeredCollisions.length)return!1;for(const [d,c]of this._registeredCollisions)if(a===d&amp;&amp;b===c||a===c&amp;&amp;b===d)return!0;return!1}ClearRegisteredCollisions(){C3$jscomp$165.clearArray(this._registeredCollisions)}TestOverlap(a,
b){if(!a||!b||a===b)return!1;a=a.GetWorldInfo();b=b.GetWorldInfo();if(!a.IsCollisionEnabled()||!b.IsCollisionEnabled())return!1;this._collisionCheckCount++;const d=a.GetLayer(),c=b.GetLayer();return d.IsTransformCompatibleWith(c)?this._TestOverlap_SameLayers(a,b):this._TestOverlap_DifferentLayers(a,b)}_TestOverlap_SameLayers(a,b){if(!a.GetBoundingBox().intersectsRect(b.GetBoundingBox()))return!1;this._polyCheckCount++;if(!a.GetBoundingQuad().intersectsQuad(b.GetBoundingQuad())||a.HasTilemap()&amp;&amp;b.HasTilemap())return!1;
if(a.HasTilemap())return this.TestTilemapOverlap(a,b);if(b.HasTilemap())return this.TestTilemapOverlap(b,a);if(!a.HasOwnCollisionPoly()&amp;&amp;!b.HasOwnCollisionPoly())return!0;const d=a.GetTransformedCollisionPoly(),c=b.GetTransformedCollisionPoly();return d.intersectsPoly(c,b.GetX()-a.GetX(),b.GetY()-a.GetY())}_TestOverlap_DifferentLayers(a,b){var d=a.HasTilemap(),c=b.HasTilemap();if(d&amp;&amp;!c)return this.TestTilemapOverlapDifferentLayers(a,b);if(c&amp;&amp;!d)return this.TestTilemapOverlapDifferentLayers(b,a);if(c||
d)return!1;c=a.GetLayer();d=b.GetLayer();tempPolyA.copy(a.GetTransformedCollisionPoly());tempPolyB.copy(b.GetTransformedCollisionPoly());var e=tempPolyA.pointsArr();for(let h=0,k=e.length;h&lt;k;h+=2){const m=h+1,p=e[m],[q,v]=c.LayerToCanvasCss(e[h]+a.GetX(),p+a.GetY());e[h]=q;e[m]=v}a=tempPolyB.pointsArr();for(let h=0,k=a.length;h&lt;k;h+=2){c=h+1;e=a[c];const [m,p]=d.LayerToCanvasCss(a[h]+b.GetX(),e+b.GetY());a[h]=m;a[c]=p}tempPolyA.setBboxChanged();tempPolyB.setBboxChanged();this._polyCheckCount++;return tempPolyA.intersectsPoly(tempPolyB,
0,0)}TestTilemapOverlapDifferentLayers(a,b){var d=a.GetLayer(),c=b.GetLayer();tempPolyC||(tempPolyC=C3$jscomp$165.New(C3$jscomp$165.CollisionPoly));tempRect3$jscomp$1||(tempRect3$jscomp$1=C3$jscomp$165.New(C3$jscomp$165.Rect));tempQuadB||(tempQuadB=C3$jscomp$165.New(C3$jscomp$165.Quad));var e=b.GetX(),h=b.GetY();const [k,m]=c.LayerToCanvasCss(e,h),[p,q]=d.CanvasCssToLayer(k,m);d=p-e;h=q-h;tempRect3$jscomp$1.copy(b.GetBoundingBox());tempRect3$jscomp$1.offset(d,h);if(!a.GetBoundingBox().intersectsRect(tempRect3$jscomp$1))return!1;
tempQuadB.copy(b.GetBoundingQuad());tempQuadB.offset(d,h);this._polyCheckCount++;if(!a.GetBoundingQuad().intersectsQuad(tempQuadB))return!1;tempPolyC.copy(b.GetTransformedCollisionPoly());c=tempPolyC.pointsArr();for(let v=0,x=c.length;v&lt;x;v+=2)e=v+1,c[v]+=d,c[e]+=h;tempPolyC.setBboxChanged();return this.TestTilemapOverlap(a,b,p,q,tempPolyC,tempRect3$jscomp$1,tempQuadB)}TestTilemapOverlap(a,b,d,c,e,h,k){h=void 0!==h?h:b.GetBoundingBox();const m=a.GetX(),p=a.GetY();var q=a.GetInstance().GetSdkInstance();
d=void 0!==d?d:b.GetX();c=void 0!==c?c:b.GetY();a=b.HasOwnCollisionPoly();k=void 0!==k?k:b.GetBoundingQuad();q.GetCollisionRectCandidates(h,tileCollRectCandidates);for(let A=0,C=tileCollRectCandidates.length;A&lt;C;++A){var v=tileCollRectCandidates[A];q=v.GetRect();this._collisionCheckCount++;if(h.intersectsRectOffset(q,m,p)&amp;&amp;(tempQuad$jscomp$4.setFromRect(q),tempQuad$jscomp$4.offset(m,p),tempQuad$jscomp$4.intersectsQuad(k)))if(a){var x=void 0!==e?e:b.GetTransformedCollisionPoly();if(v=v.GetPoly()){if(this._polyCheckCount++,
v.intersectsPoly(x,d-(m+q.getLeft()),c-(p+q.getTop())))return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}else if(tempPolyA.setFromQuad(tempQuad$jscomp$4,0,0),tempPolyA.intersectsPoly(x,d,c))return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}else if(x=v.GetPoly()){if(tempPolyA.setFromQuad(k,0,0),x.intersectsPoly(tempPolyA,-(m+q.getLeft()),-(p+q.getTop())))return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}else return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}C3$jscomp$165.clearArray(tileCollRectCandidates);
return!1}TestAndSelectCanvasPointOverlap(a,b,d,c){const e=a.GetCurrentSol();var h=this._runtime.GetCurrentEvent();if(!h)throw Error("cannot call outside event");h=h.IsOrBlock();if(e.IsSelectAll()){c||(e._SetSelectAll(!1),C3$jscomp$165.clearArray(e._GetOwnInstances()));for(var k of a.GetInstances()){var m=k.GetWorldInfo(),p=m.GetLayer();const [q,v]=p.CanvasCssToLayer(b,d,m.GetTotalZElevation());if(p.IsSelfAndParentsInteractive()&amp;&amp;m.ContainsPoint(q,v)){if(c)return!1;e._PushInstance(k)}else h&amp;&amp;e._PushElseInstance(k)}}else{m=
!1;h?this._runtime.IsCurrentConditionFirst()&amp;&amp;!e._GetOwnElseInstances().length&amp;&amp;e._GetOwnInstances().length?k=e._GetOwnInstances():(k=e._GetOwnElseInstances(),m=!0):k=e._GetOwnInstances();p=0;for(let q=0,v=k.length;q&lt;v;++q){const x=k[q],A=x.GetWorldInfo(),C=A.GetLayer(),[D,G]=C.CanvasCssToLayer(b,d,A.GetTotalZElevation());if(C.IsSelfAndParentsInteractive()&amp;&amp;A.ContainsPoint(D,G)){if(c)return!1;m?e._PushInstance(x):k[p++]=x}else m?k[p++]=x:h&amp;&amp;e._PushElseInstance(x)}c||(k.length=p)}a.ApplySolToContainer();
return c?!0:e.HasAnyInstances()}GetCollisionCandidates(a,b,d,c){a=a?1!==a.GetParallaxX()||1!==a.GetParallaxY():!1;if(b.IsFamily())for(const e of b.GetFamilyMembers())a||e.IsAnyInstanceParallaxed()?C3$jscomp$165.appendArray(c,e.GetInstances()):(e._UpdateAllCollisionCells(),e._GetCollisionCellGrid().QueryRange(d,c));else a||b.IsAnyInstanceParallaxed()?C3$jscomp$165.appendArray(c,b.GetInstances()):(b._UpdateAllCollisionCells(),b._GetCollisionCellGrid().QueryRange(d,c))}GetObjectClassesCollisionCandidates(a,
b,d,c){for(const e of b)this.GetCollisionCandidates(a,e,d,c)}GetSolidCollisionCandidates(a,b,d){const c=this._runtime.GetSolidBehavior();c&amp;&amp;this.GetObjectClassesCollisionCandidates(a,c.GetObjectClasses(),b,d)}GetJumpthruCollisionCandidates(a,b,d){const c=this._runtime.GetJumpthruBehavior();c&amp;&amp;this.GetObjectClassesCollisionCandidates(a,c.GetObjectClasses(),b,d)}IsSolidCollisionAllowed(a,b){return a._IsSolidEnabled()&amp;&amp;(!b||b.GetWorldInfo().IsSolidCollisionAllowed(a.GetSavedDataMap().get("solidTags")))}TestOverlapSolid(a){const b=
a.GetWorldInfo();this.GetSolidCollisionCandidates(b.GetLayer(),b.GetBoundingBox(),tempCandidates);for(const d of tempCandidates)if(this.IsSolidCollisionAllowed(d,a)&amp;&amp;this.TestOverlap(a,d))return C3$jscomp$165.clearArray(tempCandidates),d;C3$jscomp$165.clearArray(tempCandidates);return null}TestRectOverlapSolid(a,b){this.GetSolidCollisionCandidates(null,a,tempCandidates);for(const d of tempCandidates)if(this.IsSolidCollisionAllowed(d,b)&amp;&amp;this.TestRectOverlap(a,d))return C3$jscomp$165.clearArray(tempCandidates),
d;C3$jscomp$165.clearArray(tempCandidates);return null}TestOverlapJumpthru(a,b){let d=null;b&amp;&amp;(d=tempJumpthruRet,C3$jscomp$165.clearArray(d));const c=a.GetWorldInfo();this.GetJumpthruCollisionCandidates(c.GetLayer(),c.GetBoundingBox(),tempCandidates);for(const e of tempCandidates)if(e._IsJumpthruEnabled()&amp;&amp;this.TestOverlap(a,e))if(b)d.push(e);else return C3$jscomp$165.clearArray(tempCandidates),e;C3$jscomp$165.clearArray(tempCandidates);return d}PushOut(a,b,d,c,e){c=c||50;const h=a.GetWorldInfo(),
k=h.GetX(),m=h.GetY();for(let p=0;p&lt;c;++p)if(h.SetXY(k+b*p,m+d*p),h.SetBboxChanged(),!this.TestOverlap(a,e))return!0;h.SetXY(k,m);h.SetBboxChanged();return!1}PushOutSolid(a,b,d,c,e,h){c=c||50;const k=a.GetWorldInfo(),m=k.GetX(),p=k.GetY();let q=null,v=null;for(let x=0;x&lt;c;++x)if(k.SetXY(m+b*x,p+d*x),k.SetBboxChanged(),!this.TestOverlap(a,q))if(q=this.TestOverlapSolid(a))v=q;else if(e&amp;&amp;(q=h?this.TestOverlap(a,h)?h:null:this.TestOverlapJumpthru(a))&amp;&amp;(v=q),!q)return v&amp;&amp;this.PushInFractional(a,b,d,v,
16,!0),!0;k.SetXY(m,p);k.SetBboxChanged();return!1}PushOutSolidAxis(a,b,d,c){c=c||50;const e=a.GetWorldInfo(),h=e.GetX(),k=e.GetY();let m=null,p=null;for(let q=0;q&lt;c;++q)for(let v=0;2&gt;v;++v){const x=2*v-1;e.SetXY(h+b*q*x,k+d*q*x);e.SetBboxChanged();if(!this.TestOverlap(a,m))if(m=this.TestOverlapSolid(a))p=m;else return p&amp;&amp;this.PushInFractional(a,b*x,d*x,p,16,!0),!0}e.SetXY(h,k);e.SetBboxChanged();return!1}PushInFractional(a,b,d,c,e,h){let k=2,m=!1;var p=!1;const q=a.GetWorldInfo();let v=q.GetX(),
x=q.GetY();for(;k&lt;=e;)p=1/k,k*=2,q.OffsetXY(b*p*(m?1:-1),d*p*(m?1:-1)),q.SetBboxChanged(),this.TestOverlap(a,c)||h&amp;&amp;this.TestOverlapSolid(a)?p=m=!0:(p=m=!1,v=q.GetX(),x=q.GetY());p&amp;&amp;(q.SetXY(v,x),q.SetBboxChanged())}PushOutSolidNearest(a,b=100){let d=0;const c=a.GetWorldInfo(),e=c.GetX(),h=c.GetY();let k=0,m=this.TestOverlapSolid(a);if(!m)return!0;for(;d&lt;=b;){let p=0,q=0;switch(k){case 0:p=0;q=-1;d++;break;case 1:p=1;q=-1;break;case 2:p=1;q=0;break;case 3:q=p=1;break;case 4:p=0;q=1;break;case 5:p=
-1;q=1;break;case 6:p=-1;q=0;break;case 7:q=p=-1}k=(k+1)%8;c.SetXY(Math.floor(e+p*d),Math.floor(h+q*d));c.SetBboxChanged();if(!this.TestOverlap(a,m)&amp;&amp;(m=this.TestOverlapSolid(a),!m))return!0}c.SetXY(e,h);c.SetBboxChanged();return!1}CalculateBounceAngle(a,b,d,c){const e=a.GetWorldInfo(),h=e.GetX(),k=e.GetY(),m=Math.max(10,C3$jscomp$165.distanceTo(b,d,h,k));var p=C3$jscomp$165.angleTo(b,d,h,k),q=c||this.TestOverlapSolid(a);if(!q)return C3$jscomp$165.clampAngle(p+Math.PI);let v=q;var x=0,A=0;const C=
C3$jscomp$165.toRadians(5);let D;for(D=1;36&gt;D;++D){const G=p-D*C;e.SetXY(b+Math.cos(G)*m,d+Math.sin(G)*m);e.SetBboxChanged();if(!this.TestOverlap(a,v)&amp;&amp;(v=c?null:this.TestOverlapSolid(a),!v)){x=G;break}}36===D&amp;&amp;(x=C3$jscomp$165.clampAngle(p+Math.PI));v=q;for(D=1;36&gt;D;++D)if(q=p+D*C,e.SetXY(b+Math.cos(q)*m,d+Math.sin(q)*m),e.SetBboxChanged(),!this.TestOverlap(a,v)&amp;&amp;(v=c?null:this.TestOverlapSolid(a),!v)){A=q;break}36===D&amp;&amp;(A=C3$jscomp$165.clampAngle(p+Math.PI));e.SetXY(h,k);e.SetBboxChanged();if(A===
x)return A;a=C3$jscomp$165.angleDiff(A,x)/2;a=C3$jscomp$165.angleClockwise(A,x)?C3$jscomp$165.clampAngle(x+a+Math.PI):C3$jscomp$165.clampAngle(A+a);x=Math.cos(p);p=Math.sin(p);A=Math.cos(a);a=Math.sin(a);b=x*A+p*a;return C3$jscomp$165.angleTo(0,0,x-2*b*A,p-2*b*a)}TestSegmentOverlap(a,b,d,c,e){if(!e)return!1;const h=e.GetWorldInfo();if(!h.IsCollisionEnabled())return!1;this._collisionCheckCount++;tempRect$jscomp$7.set(Math.min(a,d),Math.min(b,c),Math.max(a,d),Math.max(b,c));if(!h.GetBoundingBox().intersectsRect(tempRect$jscomp$7))return!1;
if(e.HasTilemap())return this._TestSegmentOverlapTilemap(a,b,d,c,e,h);this._polyCheckCount++;return h.GetBoundingQuad().intersectsSegment(a,b,d,c)?h.HasOwnCollisionPoly()?h.GetTransformedCollisionPoly().intersectsSegment(h.GetX(),h.GetY(),a,b,d,c):!0:!1}_TestSegmentOverlapTilemap(a,b,d,c,e,h){const k=h.GetX();h=h.GetY();e=e.GetSdkInstance();tempRect2$jscomp$1.set(a,b,d,c);tempRect2$jscomp$1.normalize();e.GetCollisionRectCandidates(tempRect2$jscomp$1,tileCollRectCandidates);for(let p=0,q=tileCollRectCandidates.length;p&lt;
q;++p){var m=tileCollRectCandidates[p];e=m.GetRect();this._collisionCheckCount++;if(tempRect$jscomp$7.intersectsRectOffset(e,k,h)&amp;&amp;(tempQuad$jscomp$4.setFromRect(e),tempQuad$jscomp$4.offset(k,h),tempQuad$jscomp$4.intersectsSegment(a,b,d,c)))if(m=m.GetPoly()){if(this._polyCheckCount++,m.intersectsSegment(k+e.getLeft(),h+e.getTop(),a,b,d,c))return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}else return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}C3$jscomp$165.clearArray(tileCollRectCandidates);
return!1}TestRectOverlap(a,b){if(!b)return!1;const d=b.GetWorldInfo();if(!d.IsCollisionEnabled())return!1;this._collisionCheckCount++;if(!d.GetBoundingBox().intersectsRect(a))return!1;if(b.HasTilemap())return this._TestRectOverlapTilemap(a,b,d);this._polyCheckCount++;tempQuad$jscomp$4.setFromRect(a);if(!d.GetBoundingQuad().intersectsQuad(tempQuad$jscomp$4))return!1;if(!d.HasOwnCollisionPoly())return!0;tempPolyA.setFromRect(a,d.GetX(),d.GetY());a=d.GetTransformedCollisionPoly();return tempPolyA.intersectsPoly(a,
0,0)}_TestRectOverlapTilemap(a,b,d){const c=d.GetX();d=d.GetY();b.GetSdkInstance().GetCollisionRectCandidates(a,tileCollRectCandidates);for(let h=0,k=tileCollRectCandidates.length;h&lt;k;++h){var e=tileCollRectCandidates[h];b=e.GetRect();this._collisionCheckCount++;if(a.intersectsRectOffset(b,c,d))if(e=e.GetPoly()){if(this._polyCheckCount++,tempPolyA.setFromRect(a,0,0),e.intersectsPoly(tempPolyA,-(c+b.getLeft()),-(d+b.getTop())))return C3$jscomp$165.clearArray(tileCollRectCandidates),!0}else return C3$jscomp$165.clearArray(tileCollRectCandidates),
!0}C3$jscomp$165.clearArray(tileCollRectCandidates);return!1}TestRayIntersectsInstance(a,b){if(a){var d=a.GetWorldInfo();d.IsCollisionEnabled()&amp;&amp;(this._collisionCheckCount++,d.GetBoundingBox().intersectsRect(b.rect)&amp;&amp;(a.HasTilemap()?this._TestRayIntersectsTilemap(a,d,b):(this._polyCheckCount++,d.HasOwnCollisionPoly()?b.TestInstancePoly(a,d.GetX(),d.GetY(),d.GetTransformedCollisionPoly()):b.TestInstanceQuad(a,d.GetBoundingQuad()))))}}_TestRayIntersectsTilemap(a,b,d){const c=b.GetX(),e=b.GetY();a.GetSdkInstance().GetCollisionRectCandidates(d.rect,
tileCollRectCandidates);for(let k=0,m=tileCollRectCandidates.length;k&lt;m;k++){var h=tileCollRectCandidates[k];const p=h.GetRect();this._collisionCheckCount++;d.rect.intersectsRectOffset(p,c,e)&amp;&amp;(h=h.GetPoly(),this._polyCheckCount++,h?d.TestInstancePoly(a,c+p.getLeft(),e+p.getTop(),h):d.TestInstanceRect(a,b.GetX(),b.GetY(),p))}C3$jscomp$165.clearArray(tileCollRectCandidates)}};"use strict";const C3$jscomp$166=self.C3;
C3$jscomp$166.SparseGrid=class extends C3$jscomp$166.DefendedBase{constructor(a,b){super();this._cellWidth=a;this._cellHeight=b;this._cells=C3$jscomp$166.New(C3$jscomp$166.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(a,b,d){let c=this._cells.Get(a,b);return c?c:d?(c=C3$jscomp$166.New(C3$jscomp$166.GridCell,this,a,b),this._cells.Set(a,b,c),c):null}XToCell(a){a=Math.floor(a/this._cellWidth);return isFinite(a)?a:0}YToCell(a){a=Math.floor(a/this._cellHeight);return isFinite(a)?a:
0}Update(a,b,d){if(b)for(let c=b.getLeft(),e=b.getRight();c&lt;=e;++c)for(let h=b.getTop(),k=b.getBottom();h&lt;=k;++h){if(d&amp;&amp;d.containsPoint(c,h))continue;const m=this.GetCell(c,h,!1);m&amp;&amp;(m.Remove(a),m.IsEmpty()&amp;&amp;this._cells.Delete(c,h))}if(d)for(let c=d.getLeft(),e=d.getRight();c&lt;=e;++c)for(let h=d.getTop(),k=d.getBottom();h&lt;=k;++h)b&amp;&amp;b.containsPoint(c,h)||this.GetCell(c,h,!0).Insert(a)}QueryRange(a,b){let d=this.XToCell(a.getLeft());const c=this.YToCell(a.getTop()),e=this.XToCell(a.getRight());a=this.YToCell(a.getBottom());
if(isFinite(e)&amp;&amp;isFinite(a))for(;d&lt;=e;++d)for(let h=c;h&lt;=a;++h){const k=this.GetCell(d,h,!1);k&amp;&amp;k.Dump(b)}}};"use strict";const C3$jscomp$167=self.C3;
C3$jscomp$167.GridCell=class extends C3$jscomp$167.DefendedBase{constructor(a,b,d){super();this._grid=a;this._x=b;this._y=d;this._instances=C3$jscomp$167.New(C3$jscomp$167.ArraySet)}Release(){this._instances.Release();this._grid=this._instances=null}IsEmpty(){return this._instances.IsEmpty()}Insert(a){this._instances.Add(a)}Remove(a){this._instances.Delete(a)}Dump(a){C3$jscomp$167.appendArray(a,this._instances.GetArray())}};"use strict";const C3$jscomp$168=self.C3;
C3$jscomp$168.Ray=class{constructor(){this.dy=this.dx=this.y2=this.x2=this.y1=this.x1=0;this.rect=new C3$jscomp$168.Rect;this.hitFraction=2;this.hitUid=null;this.distance=this.hitY=this.hitX=this.hitNormalDy=this.hitNormalDx=this.hitNormal=0;this.normalX=1;this.normalY=0;this.reflectionX=1;this.reflectionY=0}DidCollide(){return 1.000001&gt;this.hitFraction}Set(a,b,d,c){this.x1=a;this.y1=b;this.x2=d;this.y2=c;this.dx=d-a;this.dy=c-b;this.rect.set(a,b,d,c);this.rect.normalize();this.hitFraction=2;this.hitUid=
null;this.distance=this.hitY=this.hitX=this.hitNormalDy=this.hitNormalDx=this.hitNormal=0;this.normalX=1;this.normalY=0;this.reflectionX=1;this.reflectionY=0;return this}Complete(){if(!1!==this.DidCollide()){var a=this.dx*this.hitFraction,b=this.dy*this.hitFraction,d=Math.hypot(a,b);a/=d;b/=d;this.distance=d-1E-6;this.hitX=this.x1+a*this.distance;this.hitY=this.y1+b*this.distance;this.hitNormal=Math.atan2(this.hitNormalDy,this.hitNormalDx)+Math.PI/2;this.normalX=Math.cos(this.hitNormal);this.normalY=
Math.sin(this.hitNormal);d=a*this.normalX+b*this.normalY;this.reflectionX=a-2*this.normalX*d;this.reflectionY=b-2*this.normalY*d;0&lt;d&amp;&amp;(this.hitNormal=C3$jscomp$168.clampAngle(this.hitNormal+Math.PI),this.normalX=-this.normalX,this.normalY=-this.normalY)}}TestInstanceSegment(a,b,d,c,e){const h=C3$jscomp$168.rayIntersect(this.x1,this.y1,this.x2,this.y2,b,d,c,e);0&lt;=h&amp;&amp;h&lt;this.hitFraction&amp;&amp;(this.hitFraction=h,this.hitUid=a.GetUID(),this.hitNormalDx=b-c,this.hitNormalDy=d-e)}TestInstanceRect(a,b,d,c){const e=
b+c.getLeft();b+=c.getRight();const h=d+c.getTop();d+=c.getBottom();this.TestInstanceSegment(a,e,h,b,h);this.TestInstanceSegment(a,b,h,b,d);this.TestInstanceSegment(a,b,d,e,d);this.TestInstanceSegment(a,e,d,e,h)}TestInstanceQuad(a,b){const d=b.getTlx(),c=b.getTly(),e=b.getTrx(),h=b.getTry(),k=b.getBrx(),m=b.getBry(),p=b.getBlx();b=b.getBly();this.TestInstanceSegment(a,d,c,e,h);this.TestInstanceSegment(a,e,h,k,m);this.TestInstanceSegment(a,k,m,p,b);this.TestInstanceSegment(a,p,b,d,c)}TestInstancePoly(a,
b,d,c){c=c.pointsArr();for(let e=0,h=c.length;e&lt;h;e+=2){const k=(e+2)%h;this.TestInstanceSegment(a,c[e]+b,c[e+1]+d,c[k]+b,c[k+1]+d)}}};"use strict";
const C3$jscomp$169=self.C3,VALID_FULLSCREEN_MODES=new Set("off crop scale-inner scale-outer letterbox-scale letterbox-integer-scale".split(" ")),VALID_FULLSCREEN_SCALING_QUALITIES=new Set(["high","low"]),glMatrix$jscomp$11=self.glMatrix,mat4$jscomp$10=glMatrix$jscomp$11.mat4,tempProjection=mat4$jscomp$10.create(),tempQuad$jscomp$5=C3$jscomp$169.New(C3$jscomp$169.Quad),tempRect$jscomp$8=C3$jscomp$169.New(C3$jscomp$169.Rect);
C3$jscomp$169.CanvasManager=class extends C3$jscomp$169.DefendedBase{constructor(a){super();this._runtime=a;this._canvas=null;this._isWebGPUEnabled=!1;this._webgpuRenderer=this._webglRenderer=null;this._gpuPreference="high-performance";this._canvasCssOffsetY=this._canvasCssOffsetX=this._canvasDeviceHeight=this._canvasDeviceWidth=this._canvasCssHeight=this._canvasCssWidth=this._windowInnerHeight=this._windowInnerWidth=0;this._zAxisScale="normalized";this._fieldOfView=0;this._enableMipmaps=!0;this._drawHeight=
this._drawWidth=this._textureAnisotropy=0;this._documentFullscreenMode=this._fullscreenMode="letterbox-scale";this._deviceTransformOffY=this._deviceTransformOffX=0;this._defaultProjectionMatrix=mat4$jscomp$10.create();this._fullscreenScalingQuality=this._wantFullscreenScalingQuality="high";this._isDocumentFullscreen=!1;this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets=new Set;this._shaderData=self.C3_Shaders;this._effectChainManager=C3$jscomp$169.New(C3$jscomp$169.Gfx.EffectChainManager,
{getDrawSize:()=&gt;[this.GetDrawWidth(),this.GetDrawHeight()],getRenderTarget:()=&gt;this.GetEffectCompositorRenderTarget(),releaseRenderTarget:b=&gt;this.ReleaseEffectCompositorRenderTarget(b),getTime:()=&gt;this.GetRuntime().GetGameTime(),redraw:()=&gt;this.GetRuntime().UpdateRender()});this._gpuTimeEndFrame=this._gpuTimeStartFrame=0;this._gpuLastUtilisation=NaN;this._gpuFrameTimingsBuffer=null;this._layersGpuProfile=new Map;this._gpuCurUtilisation=NaN;this._webgpuFrameTimings=new Map;this._snapshotFormat="";
this._snapshotQuality=1;this._snapshotArea=C3$jscomp$169.New(C3$jscomp$169.Rect);this._snapshotUrl="";this._snapshotResolve=this._snapshotPromise=null;this._loaderStartTime=this._isPastingToDrawingCanvas=0;this._rafId=-1;this._loadingProgress=0;this._loadingprogress_handler=b=&gt;this._loadingProgress=b.progress;this._percentText=null;this._splashTextures={logo:null,powered:null,website:null};this._splashFadeOutStartTime=this._splashFadeInFinishTime=this._splashFrameNumber=0;this._splashState="fade-in";
this._splashDoneResolve=null;this._splashDonePromise=new Promise(b=&gt;this._splashDoneResolve=b)}_SetGPUPowerPreference(a){this._gpuPreference=a}_SetWebGPUEnabled(a){this._isWebGPUEnabled=!!a}_SetZAxisScale(a){this._zAxisScale=a}_SetFieldOfView(a){this._fieldOfView=a}async CreateCanvas(a){this._canvas=a.canvas;this._runtime.AddDOMComponentMessageHandler("runtime","window-resize",c=&gt;this._OnWindowResize(c));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenchange",c=&gt;this._OnFullscreenChange(c));
this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenerror",c=&gt;this._OnFullscreenError(c));this._canvas.addEventListener("webglcontextlost",c=&gt;this._OnWebGLContextLost(c));this._canvas.addEventListener("webglcontextrestored",c=&gt;this._OnWebGLContextRestored(c));this._isDocumentFullscreen=!!a.isFullscreen;var b=navigator.gpu&amp;&amp;this._isWebGPUEnabled;let d=!1;if(b)try{await this._InitWebGPUContext(!0)}catch(c){this._webgpuRenderer=null}if(!this.GetRenderer())try{await this._InitWebGLContext(!0)}catch(c){this._webglRenderer=
null}this.GetRenderer()||(d=!0);if(!this.GetRenderer()&amp;&amp;b)try{await this._InitWebGPUContext(!1)}catch(c){this._webgpuRenderer=null}if(!this.GetRenderer())try{await this._InitWebGLContext(!1)}catch(c){this._webglRenderer=null}b=this.GetRenderer();if(!b)throw Error("failed to acquire a renderer - check WebGL or WebGPU is supported");b.SetHasMajorPerformanceCaveat(d);"normalized"===this._zAxisScale?b.SetZAxisScaleNormalized():(b.SetZAxisScaleRegular(),b.SetFovY(this._fieldOfView));this.SetSize(a.windowInnerWidth,
a.windowInnerHeight,!0);this._webgpuRenderer?await this._InitWebGPU():this._webglRenderer&amp;&amp;await this._InitWebGL();b.SetMipmapsEnabled(this._enableMipmaps);b.SupportsGPUProfiling()&amp;&amp;(this._gpuLastUtilisation=0);for(const c of this._runtime._GetAllEffectLists()){for(const e of c.GetAllEffectTypes())e._InitRenderer(b);c._InitRenderer(b);c.UpdateActiveEffects()}}async _InitWebGPUContext(a){a={powerPreference:this._gpuPreference,depth:this._runtime.Uses3DFeatures(),failIfMajorPerformanceCaveat:a,usesBackgroundBlending:this._runtime.UsesAnyBackgroundBlending(),
canSampleBackbuffer:this._runtime.UsesAnyCrossSampling(),canSampleDepth:this._runtime.UsesAnyDepthSampling()};this._webgpuRenderer=C3$jscomp$169.New(C3$jscomp$169.Gfx.WebGPURenderer);await this._webgpuRenderer.Create(this._canvas,a)}async _InitWebGLContext(a){a={powerPreference:this._gpuPreference,enableGpuProfiling:!0,depth:this._runtime.Uses3DFeatures(),canSampleDepth:this._runtime.UsesAnyDepthSampling(),failIfMajorPerformanceCaveat:a};"Android"===C3$jscomp$169.Platform.OS&amp;&amp;"Chromium"===C3$jscomp$169.Platform.BrowserEngine&amp;&amp;
75&gt;C3$jscomp$169.Platform.BrowserVersionNumber&amp;&amp;(console.warn("[Construct] Disabling WebGL 2 because this device appears to be affected by crbug.com/934823. Install software updates to avoid this."),a.maxWebGLVersion=1);"standard"===this._runtime.GetCompositingMode()?a.alpha=!0:(a.alpha=!1,a.lowLatency=!0);this._webglRenderer=C3$jscomp$169.New(C3$jscomp$169.Gfx.WebGLRenderer,this._canvas,a);await this._webglRenderer.InitState()}async _InitWebGPU(){if(this._shaderData){const a=[];for(const [b,d]of Object.entries(this._shaderData)){d.src=
d.wgsl;const c=C3$jscomp$169.Gfx.WebGPUShaderProgram.GetDefaultVertexShaderSource();a.push(this._webgpuRenderer.CreateShaderProgram(d,c,b))}await Promise.all(a)}}async _InitWebGL(){if(this._shaderData){const a=[];for(const [b,d]of Object.entries(this._shaderData)){d.src=d.glsl;const c=C3$jscomp$169.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource();a.push(this._webglRenderer.CreateShaderProgram(d,c,b))}await Promise.all(a);this._webglRenderer.ResetLastProgram();this._webglRenderer.SetTextureFillMode()}this._webglRenderer.SupportsGPUProfiling()&amp;&amp;
(this._gpuFrameTimingsBuffer=C3$jscomp$169.New(C3$jscomp$169.Gfx.WebGLQueryResultBuffer,this._webglRenderer))}Release(){this._canvas=this._webglRenderer=this._runtime=null}_OnWindowResize(a){const b=this._runtime;if(!b.IsExportToVideo()){var d=a.devicePixelRatio;b.IsInWorker()&amp;&amp;(self.devicePixelRatio=d);b._SetDevicePixelRatio(d);this._isDocumentFullscreen=!!a.isFullscreen;this.SetSize(a.innerWidth,a.innerHeight);b.UpdateRender();d=new C3$jscomp$169.Event("window-resize");d.data=a;b.Dispatcher().dispatchEventAndWaitAsyncSequential(d);
a=new C3$jscomp$169.Event("resize");a.cssWidth=this.GetCssWidth();a.cssHeight=this.GetCssHeight();a.deviceWidth=this.GetDeviceWidth();a.deviceHeight=this.GetDeviceHeight();b.DispatchUserScriptEvent(a);b.IsDebug()&amp;&amp;(b.HitBreakpoint()||self.C3Debugger.IsDebuggerPaused())&amp;&amp;b.Render()}}_OnFullscreenChange(a){this._isDocumentFullscreen=!!a.isFullscreen;this.SetSize(a.innerWidth,a.innerHeight,!0);this._runtime.UpdateRender()}_OnFullscreenError(a){this._isDocumentFullscreen=!!a.isFullscreen;this.SetSize(a.innerWidth,
a.innerHeight,!0);this._runtime.UpdateRender()}SetSize(a,b,d=!1){a=Math.floor(a);b=Math.floor(b);if(0&gt;=a||0&gt;=b)throw Error("invalid size");if(this._windowInnerWidth!==a||this._windowInnerHeight!==b||d){this._windowInnerWidth=a;this._windowInnerHeight=b;d=this.GetCurrentFullscreenMode();"letterbox-scale"===d?this._CalculateLetterboxScale(a,b):"letterbox-integer-scale"===d?this._CalculateLetterboxIntegerScale(a,b):"off"===d?this._CalculateFixedSizeCanvas(a,b):this._CalculateFullsizeCanvas(a,b);this._UpdateFullscreenScalingQuality(d);
this._canvas.width=this._canvasDeviceWidth;this._canvas.height=this._canvasDeviceHeight;this._runtime.PostComponentMessageToDOM("canvas","update-size",{marginLeft:this._canvasCssOffsetX,marginTop:this._canvasCssOffsetY,styleWidth:this._canvasCssWidth,styleHeight:this._canvasCssHeight});a=this.GetRenderer();a.SetSize(this._canvasDeviceWidth,this._canvasDeviceHeight,!0);for(var c of this._availableAdditionalRenderTargets)a.DeleteRenderTarget(c);C3$jscomp$169.clearArray(this._availableAdditionalRenderTargets);
a.CalculatePerspectiveMatrix(this._defaultProjectionMatrix,this.GetDrawWidth()/this.GetDrawHeight());c=this._runtime.GetLayoutManager();c.SetAllLayerProjectionChanged();c.SetAllLayerMVChanged()}}GetDefaultProjectionMatrix(){return this._defaultProjectionMatrix}_CalculateLetterboxScale(a,b){const d=this._runtime.GetDevicePixelRatio(),c=this._runtime.GetOriginalViewportWidth(),e=this._runtime.GetOriginalViewportHeight(),h=c/e;a/b&gt;h?(this._canvasCssWidth=Math.round(b*h),this._canvasCssHeight=b,this._canvasCssOffsetX=
Math.floor((a-this._canvasCssWidth)/2),this._canvasCssOffsetY=0):(this._canvasCssWidth=a,this._canvasCssHeight=Math.round(a/h),this._canvasCssOffsetX=0,this._canvasCssOffsetY=Math.floor((b-this._canvasCssHeight)/2));this._canvasDeviceWidth=Math.round(this._canvasCssWidth*d);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*d);this._runtime.SetViewportSize(c,e)}_CalculateLetterboxIntegerScale(a,b){const d=this._runtime.GetDevicePixelRatio();1!==d&amp;&amp;(a+=1,b+=1);const c=this._runtime.GetOriginalViewportWidth(),
e=this._runtime.GetOriginalViewportHeight();var h=c/e;h=a/b&gt;h?b*h*d/c:a/h*d/e;1&lt;h?h=Math.floor(h):1&gt;h&amp;&amp;(h=1/Math.ceil(1/h));this._canvasDeviceWidth=Math.round(c*h);this._canvasDeviceHeight=Math.round(e*h);this._canvasCssWidth=this._canvasDeviceWidth/d;this._canvasCssHeight=this._canvasDeviceHeight/d;this._canvasCssOffsetX=Math.max(Math.floor((a-this._canvasCssWidth)/2),0);this._canvasCssOffsetY=Math.max(Math.floor((b-this._canvasCssHeight)/2),0);this._runtime.SetViewportSize(c,e)}_CalculateFullsizeCanvas(a,
b){const d=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=a;this._canvasCssHeight=b;this._canvasDeviceWidth=Math.round(this._canvasCssWidth*d);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*d);this._canvasCssOffsetY=this._canvasCssOffsetX=0;a=this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/a,this._canvasCssHeight/a)}_CalculateFixedSizeCanvas(a,b){const d=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth();this._canvasCssHeight=
this._runtime.GetViewportHeight();this._canvasDeviceWidth=Math.round(this._canvasCssWidth*d);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*d);this.IsDocumentFullscreen()?(this._canvasCssOffsetX=Math.floor((a-this._canvasCssWidth)/2),this._canvasCssOffsetY=Math.floor((b-this._canvasCssHeight)/2)):this._canvasCssOffsetY=this._canvasCssOffsetX=0;this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(a){if("high"===
this._wantFullscreenScalingQuality)this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality="high";else{let d;if("off"===this.GetCurrentFullscreenMode()){var b=this._runtime.GetViewportWidth();d=this._runtime.GetViewportHeight()}else b=this._runtime.GetOriginalViewportWidth(),d=this._runtime.GetOriginalViewportHeight();this._canvasDeviceWidth&lt;b||this._canvasDeviceHeight&lt;d?(this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,
this._fullscreenScalingQuality="high"):(this._drawWidth=b,this._drawHeight=d,this._fullscreenScalingQuality="low","scale-inner"===a?(a=b/d,b=this._windowInnerWidth/this._windowInnerHeight,b&lt;a?this._drawWidth=this._drawHeight*b:b&gt;a&amp;&amp;(this._drawHeight=this._drawWidth/b)):"scale-outer"===a&amp;&amp;(a=b/d,b=this._windowInnerWidth/this._windowInnerHeight,b&gt;a?this._drawWidth=this._drawHeight*b:b&lt;a&amp;&amp;(this._drawHeight=this._drawWidth/b)))}}GetRuntime(){return this._runtime}GetCanvas(){return this._canvas}GetEffectChainManager(){return this._effectChainManager}IsDocumentFullscreen(){return this._isDocumentFullscreen}SetFullscreenMode(a){if(!VALID_FULLSCREEN_MODES.has(a))throw Error("invalid fullscreen mode");
this._fullscreenMode=a;a=this._runtime.GetLayoutManager();a.SetAllLayerProjectionChanged();a.SetAllLayerMVChanged()}GetFullscreenMode(){return this._fullscreenMode}SetDocumentFullscreenMode(a){if(!VALID_FULLSCREEN_MODES.has(a))throw Error("invalid fullscreen mode");this._documentFullscreenMode=a;a=this._runtime.GetLayoutManager();a.SetAllLayerProjectionChanged();a.SetAllLayerMVChanged()}GetDocumentFullscreenMode(){return this._documentFullscreenMode}GetCurrentFullscreenMode(){return this.IsDocumentFullscreen()?
this.GetDocumentFullscreenMode():this.GetFullscreenMode()}SetFullscreenScalingQuality(a){if(!VALID_FULLSCREEN_SCALING_QUALITIES.has(a))throw Error("invalid fullscreen scaling quality");this._wantFullscreenScalingQuality=a;this._runtime.GetLayoutManager().SetAllLayerProjectionChanged()}GetSetFullscreenScalingQuality(){return this._wantFullscreenScalingQuality}GetCurrentFullscreenScalingQuality(){return this._fullscreenScalingQuality}static _FullscreenModeNumberToString(a){switch(a){case 0:return"off";
case 1:return"crop";case 2:return"scale-inner";case 3:return"scale-outer";case 4:return"letterbox-scale";case 5:return"letterbox-integer-scale";default:throw Error("invalid fullscreen mode");}}GetLastWidth(){return this._windowInnerWidth}GetLastHeight(){return this._windowInnerHeight}GetDrawWidth(){return this._drawWidth}GetDrawHeight(){return this._drawHeight}SetMipmapsEnabled(a){this._enableMipmaps=!!a}_SetTextureAnisotropy(a){this._textureAnisotropy=a}GetTextureAnisotropy(){return this._textureAnisotropy}IsRendererContextLost(){return this.GetRenderer().IsContextLost()}_OnWebGLContextLost(a){console.log("[Construct] WebGL context lost");
a.preventDefault();this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets.clear();this._webglRenderer.OnContextLost();this._runtime._OnWebGLContextLost()}async _OnWebGLContextRestored(a){await this._webglRenderer.OnContextRestored();await this._LoadWebGLShaderPrograms();for(const b of this._runtime._GetAllEffectLists()){for(const d of b.GetAllEffectTypes())d._InitRenderer(this._webglRenderer);b._InitRenderer(this._webglRenderer)}await this._runtime._OnWebGLContextRestored();console.log("[Construct] WebGL context restored")}GetWebGLRenderer(){return this._webglRenderer}GetWebGPURenderer(){return this._webgpuRenderer}GetRenderer(){return this._webgpuRenderer||
this._webglRenderer}GetRenderScale(){return"low"===this._fullscreenScalingQuality?1/this._runtime.GetDevicePixelRatio():this.GetDisplayScale()}GetDisplayScale(){const a=this.GetCurrentFullscreenMode();if("off"===a||"crop"===a)return 1;const b=this._runtime.GetOriginalViewportWidth(),d=this._runtime.GetOriginalViewportHeight(),c=b/d,e=this._canvasDeviceWidth/this._canvasDeviceHeight;return"scale-inner"!==a&amp;&amp;e&gt;c||"scale-inner"===a&amp;&amp;e&lt;c?this._canvasCssHeight/d:this._canvasCssWidth/b}GetEffectLayerScaleParam(){return"low"===
this.GetCurrentFullscreenScalingQuality()?1:this.GetDisplayScale()}GetEffectDevicePixelRatioParam(){return"low"===this.GetCurrentFullscreenScalingQuality()?1:this._runtime.GetDevicePixelRatio()}SetDeviceTransformOffset(a,b){this._deviceTransformOffX=a;this._deviceTransformOffY=b}SetDeviceTransform(a,b,d,c=!0){b=b||this._drawWidth;d=d||this._drawHeight;const e=b/2+this._deviceTransformOffX,h=d/2+this._deviceTransformOffY;if(c){c=this.GetDefaultProjectionMatrix();if(b!==this._drawWidth||d!==this._drawHeight)a.CalculatePerspectiveMatrix(tempProjection,
b/d),c=tempProjection;a.SetProjectionMatrix(c)}b=a.CalculateLookAtModelView2(e,h,a.GetDefaultCameraZ(d),e,h,0,d);a.SetModelViewMatrix(b)}SetCssTransform(a,b=!0){var d=this.GetCssWidth();const c=this.GetCssHeight();d/=2;const e=c/2;b&amp;&amp;a.SetProjectionMatrix(this.GetDefaultProjectionMatrix());b=a.CalculateLookAtModelView2(d,e,a.GetDefaultCameraZ(c),d,e,0,c);a.SetModelViewMatrix(b)}GetDeviceWidth(){return this._canvasDeviceWidth}GetDeviceHeight(){return this._canvasDeviceHeight}GetCssWidth(){return this._canvasCssWidth}GetCssHeight(){return this._canvasCssHeight}GetCanvasClientX(){return this._canvasCssOffsetX}GetCanvasClientY(){return this._canvasCssOffsetY}GetAdditionalRenderTarget(a){a.depth=
this._runtime.Uses3DFeatures();const b=this._availableAdditionalRenderTargets,d=b.findIndex(e=&gt;e.IsCompatibleWithOptions(a));let c;-1!==d?(c=b[d],b.splice(d,1)):c=this.GetRenderer().CreateRenderTarget(a);this._usedAdditionalRenderTargets.add(c);return c}ReleaseAdditionalRenderTarget(a){if(!this._usedAdditionalRenderTargets.has(a))throw Error("render target not in use");this._usedAdditionalRenderTargets.delete(a);this._availableAdditionalRenderTargets.push(a)}GetEffectCompositorRenderTarget(){const a=
{sampling:this._runtime.GetSampling()};"low"===this.GetCurrentFullscreenScalingQuality()&amp;&amp;(a.width=this.GetDrawWidth(),a.height=this.GetDrawHeight());return this.GetAdditionalRenderTarget(a)}ReleaseEffectCompositorRenderTarget(a){this.ReleaseAdditionalRenderTarget(a)}*activeLayersGpuProfiles(){for(const a of this._runtime.GetLayoutManager().runningLayouts())for(const b of a.GetLayers()){const d=this._layersGpuProfile.get(b);d&amp;&amp;(yield d)}}GetLayerTimingsBuffer(a){if(!this.GetRenderer().SupportsGPUProfiling())return null;
let b=this._layersGpuProfile.get(a);b||(b={name:a.GetName(),timingsBuffer:C3$jscomp$169.New(C3$jscomp$169.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0},this._layersGpuProfile.set(a,b));return b.timingsBuffer}_Update1sFrameRange(){const a=this.GetRenderer();if(a.SupportsGPUProfiling()&amp;&amp;0===this._gpuTimeEndFrame){this._gpuTimeEndFrame=a.GetFrameNumber();this._gpuCurUtilisation=NaN;for(const b of this.activeLayersGpuProfiles())b.curUtilisation=NaN}}_UpdateTick(){this._webglRenderer&amp;&amp;
this._webglRenderer.SupportsGPUProfiling()&amp;&amp;this._UpdateTick_WebGL();this._webgpuRenderer&amp;&amp;this._webgpuRenderer.SupportsGPUProfiling()&amp;&amp;this._UpdateTick_WebGPU()}_UpdateTick_WebGL(){if(isNaN(this._gpuCurUtilisation)&amp;&amp;(this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),!isNaN(this._gpuCurUtilisation))){if(this._runtime.IsDebug())for(const a of this.activeLayersGpuProfiles())if(a.curUtilisation=a.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,
this._gpuTimeEndFrame),isNaN(a.curUtilisation))return;this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame);this._gpuLastUtilisation=Math.min(this._gpuCurUtilisation,1);if(this._runtime.IsDebug()){for(const a of this.activeLayersGpuProfiles())a.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),a.lastUtilisation=Math.min(a.curUtilisation,1);self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame=this._gpuTimeEndFrame;
this._gpuTimeEndFrame=0}}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}_UpdateTick_WebGPU(){if(0!==this._gpuTimeEndFrame){for(var a=this._gpuTimeStartFrame;a&lt;this._gpuTimeEndFrame;++a){var b=this._webgpuFrameTimings.get(a);if(b&amp;&amp;!b.HasResult())return}b=this._runtime.GetMainRunningLayout();a=C3$jscomp$169.MakeFilledArray(b.GetLayerCount()+1,0);for(var d=this._gpuTimeStartFrame;d&lt;this._gpuTimeEndFrame;++d){var c=this._webgpuFrameTimings.get(d);if(c){c=c.GetResult();for(let e=0,h=Math.min(a.length,
c.length/2);e&lt;h;++e){const k=c[2*e],m=c[2*e+1];a[e]=0===Number(k)||0===Number(m)?NaN:a[e]+Number(m-k)/1E9}}}this._gpuLastUtilisation=C3$jscomp$169.clamp(a[0],0,1);if(this._runtime.IsDebug()){d=[];b=b.GetLayers();for(let e=0,h=Math.min(b.length,a.length-1);e&lt;h;++e)d.push({name:b[e].GetName(),lastUtilisation:C3$jscomp$169.clamp(a[e+1],0,1)});self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,d)}for(a=this._gpuTimeStartFrame;a&lt;this._gpuTimeEndFrame;++a)this._webgpuFrameTimings.delete(a);this._gpuTimeStartFrame=
this._gpuTimeEndFrame;this._gpuTimeEndFrame=0}}_AddWebGPUFrameTiming(a){this._webgpuFrameTimings.set(this._webgpuRenderer.GetFrameNumber(),a)}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(a,b,d,c,e,h){this._snapshotFormat=a;this._snapshotQuality=b;this._snapshotArea.setWH(d,c,e,h);return this._snapshotPromise?this._snapshotPromise:this._snapshotPromise=new Promise(k=&gt;{this._snapshotResolve=k})}_MaybeTakeSnapshot(){if(this._snapshotFormat){var a=this._canvas,b=this._snapshotArea,
d=C3$jscomp$169.clamp(Math.floor(b.getLeft()),0,a.width),c=C3$jscomp$169.clamp(Math.floor(b.getTop()),0,a.height),e=b.width();e=0===e?a.width-d:C3$jscomp$169.clamp(Math.floor(e),0,a.width-d);b=b.height();b=0===b?a.height-c:C3$jscomp$169.clamp(Math.floor(b),0,a.height-c);(0!==d||0!==c||e!==a.width||b!==a.height)&amp;&amp;0&lt;e&amp;&amp;0&lt;b&amp;&amp;(a=C3$jscomp$169.CreateCanvas(e,b),a.getContext("2d").drawImage(this._canvas,d,c,e,b,0,0,e,b));C3$jscomp$169.CanvasToBlob(a,this._snapshotFormat,this._snapshotQuality).then(h=&gt;{this._snapshotUrl&amp;&amp;
URL.revokeObjectURL(this._snapshotUrl);this._snapshotUrl=URL.createObjectURL(h);this._snapshotPromise=null;this._snapshotResolve(this._snapshotUrl)});this._snapshotFormat="";this._snapshotQuality=1}}GetCanvasSnapshotUrl(){return this._snapshotUrl}SetIsPastingToDrawingCanvas(a){a?this._isPastingToDrawingCanvas++:this._isPastingToDrawingCanvas--}IsPastingToDrawingCanvas(){return 0&lt;this._isPastingToDrawingCanvas}InitLoadingScreen(a){this._webglRenderer&amp;&amp;(2===a?(this._percentText=C3$jscomp$169.New(C3$jscomp$169.Gfx.RendererText,
this.GetRenderer()),this._percentText.SetIsAsync(!1),this._percentText.SetFontName("Arial"),this._percentText.SetFontSize(16),this._percentText.SetHorizontalAlignment("center"),this._percentText.SetVerticalAlignment("center"),this._percentText.SetSize(300,200)):0===a?(a=this._runtime.GetLoadingLogoAsset())&amp;&amp;a.LoadStaticTexture(this._webglRenderer).catch(b=&gt;console.warn("[C3 runtime] Failed to create texture for loading logo: ",b)):4===a&amp;&amp;(this._LoadSvgSplashImage("splash-images/splash-logo.svg").then(b=&gt;
{"done"===this._splashState?this._webglRenderer.DeleteTexture(b):this._splashTextures.logo=b}).catch(b=&gt;console.warn("Failed to load splash image: ",b)),this._LoadBitmapSplashImage("splash-images/splash-poweredby-512.png").then(b=&gt;{"done"===this._splashState?this._webglRenderer.DeleteTexture(b):this._splashTextures.powered=b}).catch(b=&gt;console.warn("Failed to load splash image: ",b)),this._LoadBitmapSplashImage("splash-images/splash-website-512.png").then(b=&gt;{"done"===this._splashState?this._webglRenderer.DeleteTexture(b):
this._splashTextures.website=b}).catch(b=&gt;console.warn("Failed to load splash image: ",b))))}async _LoadSvgSplashImage(a){a=(new URL(a,this._runtime.GetRuntimeBaseURL())).toString();a=await C3$jscomp$169.FetchBlob(a);a=await this._runtime.RasterSvgImage(a,2048,2048);return await this._webglRenderer.CreateStaticTextureAsync(a,{mipMapQuality:"high"})}async _LoadBitmapSplashImage(a){a=(new URL(a,this._runtime.GetRuntimeBaseURL())).toString();a=await C3$jscomp$169.FetchBlob(a);return await this._webglRenderer.CreateStaticTextureAsync(a,
{mipMapQuality:"high"})}HideCordovaSplashScreen(){this._runtime.PostComponentMessageToDOM("runtime","hide-cordova-splash")}StartLoadingScreen(){this._loaderStartTime=Date.now();this._runtime.Dispatcher().addEventListener("loadingprogress",this._loadingprogress_handler);this._rafId=requestAnimationFrame(()=&gt;this._DrawLoadingScreen());3!==this._runtime.GetLoaderStyle()&amp;&amp;this.HideCordovaSplashScreen()}async EndLoadingScreen(){if(this._webglRenderer){this._loadingProgress=1;var a=this._runtime.GetLoaderStyle();
4===a&amp;&amp;await this._splashDonePromise;this._splashDonePromise=this._splashDoneResolve=null;-1!==this._rafId&amp;&amp;(cancelAnimationFrame(this._rafId),this._rafId=-1);this._runtime.Dispatcher().removeEventListener("loadingprogress",this._loadingprogress_handler);this._loadingprogress_handler=null;this._percentText&amp;&amp;(this._percentText.Release(),this._percentText=null);this._runtime.ReleaseLoadingLogoAsset();this._webglRenderer.Start();this._splashTextures.logo&amp;&amp;(this._webglRenderer.DeleteTexture(this._splashTextures.logo),
this._splashTextures.logo=null);this._splashTextures.powered&amp;&amp;(this._webglRenderer.DeleteTexture(this._splashTextures.powered),this._splashTextures.powered=null);this._splashTextures.website&amp;&amp;(this._webglRenderer.DeleteTexture(this._splashTextures.website),this._splashTextures.website=null);this._webglRenderer.ClearRgba(0,0,0,0);this._webglRenderer.Finish();this._splashState="done";this._gpuTimeStartFrame=this._webglRenderer.GetFrameNumber();3===a&amp;&amp;this.HideCordovaSplashScreen()}}_DrawLoadingScreen(){if(-1!==
this._rafId){var a=this._webglRenderer;if(a){a.Start();this._rafId=-1;var b=this._runtime.GetAssetManager().HasHadErrorLoading(),d=this._runtime.GetLoaderStyle();3!==d&amp;&amp;(this.SetCssTransform(a),a.ClearRgba(0,0,0,0),a.ResetColor(),a.SetTextureFillMode(),a.SetTexture(null));if(0===d)this._DrawProgressBarAndLogoLoadingScreen(b);else if(1===d)this._DrawProgressBarLoadingScreen(b,120,0);else if(2===d)this._DrawPercentTextLoadingScreen(b);else if(3===d)C3$jscomp$169.noop();else if(4===d)this._DrawSplashLoadingScreen(b);
else throw Error("invalid loader style");a.Finish();this._rafId=requestAnimationFrame(()=&gt;this._DrawLoadingScreen())}}}_DrawPercentTextLoadingScreen(a){a?this._percentText.SetColorRgb(1,0,0):this._percentText.SetColorRgb(.6,.6,.6);this._percentText.SetText(Math.round(100*this._loadingProgress)+"%");a=this._canvasCssWidth/2;const b=this._canvasCssHeight/2;tempQuad$jscomp$5.setRect(a-150,b-100,a+150,b+100);this._webglRenderer.SetTexture(this._percentText.GetTexture());this._webglRenderer.Quad3(tempQuad$jscomp$5,
this._percentText.GetTexRect())}_DrawProgressBarLoadingScreen(a,b,d){const c=this._webglRenderer;c.SetColorFillMode();a?c.SetColorRgba(1,0,0,1):c.SetColorRgba(.118,.565,1,1);a=this._canvasCssWidth/2;const e=this._canvasCssHeight/2,h=b/2;tempRect$jscomp$8.setWH(a-h,e-4+d,Math.floor(b*this._loadingProgress),8);c.Rect(tempRect$jscomp$8);tempRect$jscomp$8.setWH(a-h,e-4+d,b,8);tempRect$jscomp$8.offset(-.5,-.5);tempRect$jscomp$8.inflate(.5,.5);c.SetColorRgba(0,0,0,1);c.LineRect2(tempRect$jscomp$8);tempRect$jscomp$8.inflate(1,
1);c.SetColorRgba(1,1,1,1);c.LineRect2(tempRect$jscomp$8)}_DrawProgressBarAndLogoLoadingScreen(a){var b=this._runtime.GetLoadingLogoAsset();if(b)if(b=b.GetTexture()){var d=b.GetWidth(),c=b.GetHeight(),e=this._canvasCssWidth/2,h=this._canvasCssHeight/2,k=d/2;c/=2;tempQuad$jscomp$5.setRect(e-k,h-c,e+k,h+c);this._webglRenderer.SetTexture(b);this._webglRenderer.Quad(tempQuad$jscomp$5);this._DrawProgressBarLoadingScreen(a,d,c+16)}else this._DrawProgressBarLoadingScreen(a,120,0);else this._DrawProgressBarLoadingScreen(a,
120,0)}_DrawSplashLoadingScreen(a){const b=this._webglRenderer,d=this._splashTextures.logo,c=this._splashTextures.powered,e=this._splashTextures.website,h=Date.now();0===this._splashFrameNumber&amp;&amp;(this._loaderStartTime=h);const k=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&amp;&amp;!this._runtime.IsCordova(),m=k?0:200,p=k?0:3E3;let q=1;"fade-in"===this._splashState?q=Math.min((h-this._loaderStartTime)/300,1):"fade-out"===this._splashState&amp;&amp;(q=Math.max(1-(h-this._splashFadeOutStartTime)/
300,0));b.SetColorFillMode();b.SetColorRgba(.231*q,.251*q,.271*q,q);tempRect$jscomp$8.set(0,0,this._canvasCssWidth,this._canvasCssHeight);b.Rect(tempRect$jscomp$8);const v=Math.ceil(this._canvasCssWidth),x=Math.ceil(this._canvasCssHeight);let A;256&lt;this._canvasCssHeight?(b.SetColorRgba(.302*q,.334*q,.365*q,q),A=Math.max(.005*x,2),tempRect$jscomp$8.setWH(0,.8*x-A/2,v,A),b.Rect(tempRect$jscomp$8),a?b.SetColorRgba(q,0,0,q):b.SetColorRgba(.161*q,.953*q,.816*q,q),a=v*this._loadingProgress,tempRect$jscomp$8.setWH(.5*
v-a/2,.8*x-A/2,a,A),b.Rect(tempRect$jscomp$8),b.SetColorRgba(q,q,q,q),b.SetTextureFillMode(),c&amp;&amp;(a=1.5*C3$jscomp$169.clamp(.22*x,105,.6*v),A=a/8,tempRect$jscomp$8.setWH(.5*v-a/2,.2*x-A/2,a,A),b.SetTexture(c),b.Rect(tempRect$jscomp$8)),d&amp;&amp;(A=a=Math.min(.395*x,.95*v),tempRect$jscomp$8.setWH(.5*v-a/2,.485*x-A/2,a,A),b.SetTexture(d),b.Rect(tempRect$jscomp$8)),e&amp;&amp;(a=1.5*C3$jscomp$169.clamp(.22*x,105,.6*v),A=a/8,tempRect$jscomp$8.setWH(.5*v-a/2,.868*x-A/2,a,A),b.SetTexture(e),b.Rect(tempRect$jscomp$8))):
(b.SetColorRgba(.302*q,.334*q,.365*q,q),A=Math.max(.005*x,2),tempRect$jscomp$8.setWH(0,.85*x-A/2,v,A),b.Rect(tempRect$jscomp$8),a?b.SetColorRgba(q,0,0,q):b.SetColorRgba(.161*q,.953*q,.816*q,q),a=v*this._loadingProgress,tempRect$jscomp$8.setWH(.5*v-a/2,.85*x-A/2,a,A),b.Rect(tempRect$jscomp$8),b.SetColorRgba(q,q,q,q),b.SetTextureFillMode(),d&amp;&amp;(A=a=.55*x,tempRect$jscomp$8.setWH(.5*v-a/2,.45*x-A/2,a,A),b.SetTexture(d),b.Rect(tempRect$jscomp$8)));this._splashFrameNumber++;"fade-in"===this._splashState&amp;&amp;
300&lt;=h-this._loaderStartTime&amp;&amp;2&lt;=this._splashFrameNumber&amp;&amp;(this._splashState="wait",this._splashFadeInFinishTime=h);"wait"===this._splashState&amp;&amp;h-this._splashFadeInFinishTime&gt;=p&amp;&amp;1&lt;=this._loadingProgress&amp;&amp;(this._splashState="fade-out",this._splashFadeOutStartTime=h);("fade-out"===this._splashState&amp;&amp;h-this._splashFadeOutStartTime&gt;=300+m||k&amp;&amp;1&lt;=this._loadingProgress&amp;&amp;500&gt;h-this._loaderStartTime)&amp;&amp;this._splashDoneResolve()}};"use strict";
const C3$jscomp$170=self.C3,C3Debugger$jscomp$3=self.C3Debugger,DEFAULT_RUNTIME_OPTS={messagePort:null,runtimeBaseUrl:"",headless:!1,hasDom:!0,isInWorker:!1,useAudio:!0,projectData:"",exportType:""};let ife=!0;
C3$jscomp$170.Runtime=class extends C3$jscomp$170.DefendedBase{constructor(a){a=Object.assign({},DEFAULT_RUNTIME_OPTS,a);super();this._messagePort=a.messagePort;this._runtimeBaseUrl=a.runtimeBaseUrl;this._previewUrl=a.previewUrl;this._isHeadless=!!a.headless;this._hasDom=!!a.hasDom;this._isInWorker=!!a.isInWorker;ife=a.ife;this._useAudio=!!a.useAudio;this._exportType=a.exportType;this._isiOSCordova=!!a.isiOSCordova;this._isiOSWebView=!!a.isiOSWebView;this._isFBInstantAvailable=!!a.isFBInstantAvailable;
this._opusWasmScriptUrl=a.opusWasmScriptUrl;this._opusWasmBinaryUrl=a.opusWasmBinaryUrl;this._isDebugging=this._breakpointsEnabled=this._isDebug=!("preview"!==this._exportType||!a.isDebug);this._debuggingDisabled=0;this._additionalLoadPromises=[];this._additionalCreatePromises=[];this._isUsingCreatePromises=!1;this._appId=this._projectUniqueId=this._projectVersion=this._projectName="";this._originalViewportHeight=this._originalViewportWidth=0;this._devicePixelRatio=self.devicePixelRatio;this._loaderStyle=
this._viewportHeight=this._viewportWidth=this._parallaxYorigin=this._parallaxXorigin=0;this._usesLoaderLayout=!1;this._isLoading=!0;this._usesAnyDepthSampling=this._usesAnyCrossSampling=this._usesAnyBackgroundBlending=!1;this._loadingLogoAsset=null;this._assetManager=C3$jscomp$170.New(C3$jscomp$170.AssetManager,this,a);this._layoutManager=C3$jscomp$170.New(C3$jscomp$170.LayoutManager,this);this._eventSheetManager=C3$jscomp$170.New(C3$jscomp$170.EventSheetManager,this);this._pluginManager=C3$jscomp$170.New(C3$jscomp$170.PluginManager,
this);this._collisionEngine=C3$jscomp$170.New(C3$jscomp$170.CollisionEngine,this);this._timelineManager=C3$jscomp$170.New(C3$jscomp$170.TimelineManager,this);this._transitionManager=C3$jscomp$170.New(C3$jscomp$170.TransitionManager,this);this._templateManager=C3$jscomp$170.New(C3$jscomp$170.TemplateManager,this);this._allObjectClasses=[];this._objectClassesByName=new Map;this._objectClassesBySid=new Map;this._familyCount=0;this._allContainers=[];this._allEffectLists=[];this._currentLayoutStack=[];
this._instancesPendingCreate=[];this._instancesPendingDestroy=new Map;this._isFlushingPendingInstances=this._hasPendingInstances=!1;this._nextUid=this._objectCount=0;this._instancesByUid=new Map;this._instancesToReleaseAtEndOfTick=new Set;this._instancesToReleaseAffectedObjectClasses=new Set;this._objectReferenceTable=[];this._jsPropNameTable=[];this._canvasManager=null;this._uses3dFeatures=!1;this._framerateMode="vsync";this._compositingMode="standard";this._sampling="trilinear";this._isPixelRoundingEnabled=
!1;this._needRender=!0;this._isPausedOnBlur=this._pauseOnBlur=!1;this._exportToVideo=null;this._tickCallbacks={normal:b=&gt;{this._ruafId=this._rafId=-1;this.Tick(b)},tickOnly:b=&gt;{this._ruafId=-1;this.Tick(b,!1,"skip-render")},renderOnly:()=&gt;{this._rafId=-1;this.Render()}};this._ruafId=this._rafId=-1;this._tickCountNoSave=this._tickCount=0;this._hasStartedTicking=this._isInTick=this._hasStarted=!1;this._isLayoutFirstTick=!0;this._suspendCount=0;this._scheduleTriggersThrottle=new C3$jscomp$170.PromiseThrottle(1);
this._randomNumberCallback=()=&gt;Math.random();this._dt=this._dt1=this._lastTickTime=this._startTime=0;this._timeScale=1;this._minimumFramerate=30;this._gameTime=C3$jscomp$170.New(C3$jscomp$170.KahanSum);this._gameTimeRaw=C3$jscomp$170.New(C3$jscomp$170.KahanSum);this._wallTime=C3$jscomp$170.New(C3$jscomp$170.KahanSum);this._instanceTimes=new Map;this._fpsFrameCount=-1;this._mainThreadTime=this._mainThreadTimeCounter=this._fps=this._fpsLastTime=0;this._isLoadingState=!1;this._loadFromSlotName=this._saveToSlotName=
"";this._loadFromJson=null;this._lastSaveJson="";this._savegamesStorage=this._projectStorage=null;this._dispatcher=C3$jscomp$170.New(C3$jscomp$170.Event.Dispatcher);this._domEventHandlers=new Map;this._pendingResponsePromises=new Map;this._nextDomResponseId=0;this._isReadyToHandleEvents=this._didRequestDeviceMotionEvent=this._didRequestDeviceOrientationEvent=!1;this._waitingToHandleEvents=[];this._eventObjects={pretick:C3$jscomp$170.New(C3$jscomp$170.Event,"pretick",!1),tick:C3$jscomp$170.New(C3$jscomp$170.Event,
"tick",!1),tick2:C3$jscomp$170.New(C3$jscomp$170.Event,"tick2",!1),instancedestroy:C3$jscomp$170.New(C3$jscomp$170.Event,"instancedestroy",!1),beforelayoutchange:C3$jscomp$170.New(C3$jscomp$170.Event,"beforelayoutchange",!1),layoutchange:C3$jscomp$170.New(C3$jscomp$170.Event,"layoutchange",!1)};this._eventObjects.instancedestroy.instance=null;this._userScriptDispatcher=C3$jscomp$170.New(C3$jscomp$170.Event.Dispatcher);this._userScriptEventObjects=null;this._behInstsToTick=C3$jscomp$170.New(C3$jscomp$170.RedBlackSet,
C3$jscomp$170.BehaviorInstance.SortByTickSequence);this._behInstsToPostTick=C3$jscomp$170.New(C3$jscomp$170.RedBlackSet,C3$jscomp$170.BehaviorInstance.SortByTickSequence);this._behInstsToTick2=C3$jscomp$170.New(C3$jscomp$170.RedBlackSet,C3$jscomp$170.BehaviorInstance.SortByTickSequence);this._jobScheduler=C3$jscomp$170.New(C3$jscomp$170.JobSchedulerRuntime,this,a.jobScheduler);a.canvas&amp;&amp;(this._canvasManager=C3$jscomp$170.New(C3$jscomp$170.CanvasManager,this));this._messagePort.onmessage=b=&gt;this._OnMessageFromDOM(b.data);
this.AddDOMComponentMessageHandler("runtime","visibilitychange",b=&gt;this._OnVisibilityChange(b));this.AddDOMComponentMessageHandler("runtime","opus-decode",b=&gt;this._WasmDecodeWebMOpus(b.arrayBuffer));this.AddDOMComponentMessageHandler("runtime","get-remote-preview-status-info",()=&gt;this._GetRemotePreviewStatusInfo());this.AddDOMComponentMessageHandler("runtime","js-invoke-function",b=&gt;this._InvokeFunctionFromJS(b));this.AddDOMComponentMessageHandler("runtime","go-to-last-error-script",self.goToLastErrorScript);
this.AddDOMComponentMessageHandler("runtime","offline-audio-render-completed",b=&gt;this._OnOfflineAudioRenderCompleted(b));this._dispatcher.addEventListener("window-blur",b=&gt;this._OnWindowBlur(b));this._dispatcher.addEventListener("window-focus",()=&gt;this._OnWindowFocus());this._timelineManager.AddRuntimeListeners();this._templateManager.AddRuntimeListeners();this._iRuntime=null;this._interfaceMap=new WeakMap;this._commonScriptInterfaces={keyboard:null,mouse:null,touch:null}}static Create(a){return C3$jscomp$170.New(C3$jscomp$170.Runtime,
a)}Release(){C3$jscomp$170.clearArray(this._allObjectClasses);this._objectClassesByName.clear();this._objectClassesBySid.clear();this._layoutManager.Release();this._layoutManager=null;this._eventSheetManager.Release();this._eventSheetManager=null;this._pluginManager.Release();this._pluginManager=null;this._assetManager.Release();this._assetManager=null;this._collisionEngine.Release();this._collisionEngine=null;this._timelineManager.Release();this._timelineManager=null;this._transitionManager.Release();
this._transitionManager=null;this._templateManager.Release();this._templateManager=null;this._canvasManager&amp;&amp;(this._canvasManager.Release(),this._canvasManager=null);this._dispatcher.Release();this._tickEvent=this._dispatcher=null}_OnMessageFromDOM(a){const b=a.type;if("event"===b)this._OnEventFromDOM(a);else if("result"===b)this._OnResultFromDOM(a);else throw Error(`unknown message '${b}'`);}_OnEventFromDOM(a){if(this._isReadyToHandleEvents){var b=a.component,d=a.handler,c=a.data,e=a.dispatchOpts,
h=!(!e||!e.dispatchRuntimeEvent);e=!(!e||!e.dispatchUserScriptEvent);var k=a.responseId;if("runtime"===b&amp;&amp;(h&amp;&amp;(a=new C3$jscomp$170.Event(d),a.data=c,this._dispatcher.dispatchEventAndWaitAsyncSequential(a)),e)){a=new C3$jscomp$170.Event(d,!0);for(const [m,p]of Object.entries(c))a[m]=p;this.DispatchUserScriptEvent(a)}if(a=this._domEventHandlers.get(b))if(a=a.get(d)){h=null;try{h=a(c)}catch(m){console.error(`Exception in '${b}' handler '${d}':`,m);null!==k&amp;&amp;this._PostResultToDOM(k,!1,""+m);return}null!==
k&amp;&amp;(h&amp;&amp;h.then?h.then(m=&gt;this._PostResultToDOM(k,!0,m)).catch(m=&gt;{console.error(`Rejection from '${b}' handler '${d}':`,m);this._PostResultToDOM(k,!1,""+m)}):this._PostResultToDOM(k,!0,h))}else h||e||console.warn(`[Runtime] No DOM handler '${d}' for component '${b}'`);else h||e||console.warn(`[Runtime] No DOM event handlers for component '${b}'`)}else this._waitingToHandleEvents.push(a)}_PostResultToDOM(a,b,d){this._messagePort.postMessage({type:"result",responseId:a,isOk:b,result:d})}_OnResultFromDOM(a){const b=
a.responseId,d=a.isOk;a=a.result;const c=this._pendingResponsePromises.get(b);d?c.resolve(a):c.reject(a);this._pendingResponsePromises.delete(b)}AddDOMComponentMessageHandler(a,b,d){let c=this._domEventHandlers.get(a);c||(c=new Map,this._domEventHandlers.set(a,c));if(c.has(b))throw Error(`[Runtime] Component '${a}' already has handler '${b}'`);c.set(b,d)}PostComponentMessageToDOM(a,b,d){this._messagePort.postMessage({type:"event",component:a,handler:b,data:d,responseId:null})}PostComponentMessageToDOMAsync(a,
b,d){const c=this._nextDomResponseId++,e=new Promise((h,k)=&gt;{this._pendingResponsePromises.set(c,{resolve:h,reject:k})});this._messagePort.postMessage({type:"event",component:a,handler:b,data:d,responseId:c});return e}PostToDebugger(a){if(!this.IsDebug())throw Error("not in debug mode");this.PostComponentMessageToDOM("runtime","post-to-debugger",a)}async Init(a){this.IsDebug()?await C3Debugger$jscomp$3.Init(this):self.C3Debugger&amp;&amp;self.C3Debugger.InitPreview(this);var [b]=await Promise.all([this._assetManager.FetchJson("data.json"),
this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);await this._LoadDataJson(b);await this._InitialiseCanvas(a);this.IsPreview()||console.info("Made with Construct, the game and app creator :: https://www.construct.net");this.GetWebGLRenderer()?(b=this.GetWebGLRenderer(),console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, rendering with WebGL ${b.GetWebGLVersionNumber()} [${b.GetUnmaskedRenderer()}] (${b.IsDesynchronized()?"desynchronized":"standard"} compositing)`)):this.GetWebGPURenderer()&amp;&amp;
console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, rendering with experimental WebGPU`);this.GetRenderer().HasMajorPerformanceCaveat()&amp;&amp;console.warn("[C3 runtime] The renderer indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance.");this._isReadyToHandleEvents=!0;for(const d of this._waitingToHandleEvents)this._OnEventFromDOM(d);C3$jscomp$170.clearArray(this._waitingToHandleEvents);this._canvasManager&amp;&amp;
this._canvasManager.StartLoadingScreen();for(const d of a.runOnStartupFunctions)this._additionalLoadPromises.push(this._RunOnStartupFunction(d));await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]);C3$jscomp$170.clearArray(this._additionalLoadPromises);if(this._assetManager.HasHadErrorLoading())this._canvasManager&amp;&amp;this._canvasManager.HideCordovaSplashScreen();else return this._canvasManager&amp;&amp;await this._canvasManager.EndLoadingScreen(),await this._dispatcher.dispatchEventAndWaitAsync(new C3$jscomp$170.Event("beforeruntimestart")),
await this.Start(),this._messagePort.postMessage({type:"runtime-ready"}),this}async _RunOnStartupFunction(a){try{await a(this._iRuntime)}catch(b){console.error("[C3 runtime] Error in runOnStartup function: ",b)}}async _LoadDataJson(a){a=a.project;this._projectName=a[0];this._projectVersion=a[16];this._projectUniqueId=a[31];this._appId=a[38];var b=a[39]||"loading-logo.png";this._isPixelRoundingEnabled=!!a[9];this._originalViewportWidth=this._viewportWidth=a[10];this._originalViewportHeight=this._viewportHeight=
a[11];this._parallaxXorigin=this._originalViewportWidth/2;this._parallaxYorigin=this._originalViewportHeight/2;this._compositingMode=a[36];this._framerateMode=a[37];"low-latency"===this._compositingMode&amp;&amp;this.IsAndroidWebView()&amp;&amp;77&gt;=C3$jscomp$170.Platform.BrowserVersionNumber&amp;&amp;(console.warn("[C3 runtime] Desynchronized (low-latency) compositing is enabled, but is disabled in the Android WebView &lt;=77 due to crbug.com/1008842. Reverting to synchronized (standard) compositing."),this._compositingMode=
"standard");this._uses3dFeatures=!!a[40];this._sampling=a[14];this._usesAnyBackgroundBlending=a[15];this._usesAnyCrossSampling=a[42];this._usesAnyDepthSampling=a[17];this._usesLoaderLayout=!!a[18];this._loaderStyle=a[19];this._nextUid=a[21];this._pauseOnBlur=a[22];const d=this._assetManager;d._SetAudioFiles(a[7],a[25]);d._SetMediaSubfolder(a[8]);d._SetFontsSubfolder(a[32]);d._SetIconsSubfolder(a[28]);d._SetWebFonts(a[29]);if(0===this._loaderStyle){let m="";this.IsPreview()?d._HasLocalUrlBlob(b)&amp;&amp;
(m=d.GetLocalUrlAsBlobUrl(b)):m=d.GetIconsSubfolder()+b;m&amp;&amp;(this._loadingLogoAsset=d.LoadImage({url:m}))}this._canvasManager&amp;&amp;(this._canvasManager.SetFullscreenMode(C3$jscomp$170.CanvasManager._FullscreenModeNumberToString(a[12])),this._canvasManager.SetFullscreenScalingQuality(a[23]?"high":"low"),this._canvasManager.SetMipmapsEnabled(0!==a[24]),this._canvasManager._SetGPUPowerPreference(a[34]),this._canvasManager._SetTextureAnisotropy(a[41]),this._canvasManager._SetWebGPUEnabled(a[13]),this._canvasManager._SetZAxisScale(a[30]),
this._canvasManager._SetFieldOfView(a[26]));(b=a[43])&amp;&amp;await this._LoadExportToVideoData(b);this._pluginManager.CreateSystemPlugin();this._objectReferenceTable=self.C3_GetObjectRefTable();for(var c of a[2])this._pluginManager.CreatePlugin(c);this._objectReferenceTable=self.C3_GetObjectRefTable();this._LoadJsPropNameTable();for(var e of a[3])c=C3$jscomp$170.ObjectClass.Create(this,this._allObjectClasses.length,e),this._allObjectClasses.push(c),this._objectClassesByName.set(c.GetName().toLowerCase(),
c),this._objectClassesBySid.set(c.GetSID(),c);for(const m of a[4])this._allObjectClasses[m[0]]._LoadFamily(m);for(var h of a[27])e=h.map(m=&gt;this._allObjectClasses[m]),this._allContainers.push(C3$jscomp$170.New(C3$jscomp$170.Container,this,e));for(const m of this._allObjectClasses)m._OnAfterCreate();for(const m of a[5])this._layoutManager.Create(m);(h=a[1])&amp;&amp;(h=this._layoutManager.GetLayoutByName(h))&amp;&amp;this._layoutManager.SetFirstLayout(h);for(var k of a[33])this._timelineManager.Create(k);for(const m of a[35])this._transitionManager.Create(m);
for(const m of a[44])this._templateManager.Create(m);this._templateManager.HasTemplates()||(this._templateManager.Release(),this._templateManager=null);this._InitScriptInterfaces();for(const m of a[6])this._eventSheetManager.Create(m);this._eventSheetManager._PostInit();this._InitGlobalVariableScriptInterface();C3$jscomp$170.clearArray(this._objectReferenceTable);this.FlushPendingInstances();k="any";a=a[20];1===a?k="portrait":2===a&amp;&amp;(k="landscape");this.PostComponentMessageToDOM("runtime","set-target-orientation",
{targetOrientation:k})}async _LoadExportToVideoData(a){const b=a.format;"image-sequence"===b?this._exportToVideo=new self.C3ExportToImageSequence(this,a):"image-sequence-gif"===b?this._exportToVideo=new self.C3ExportToGIF(this,a):"webm"===b?this._exportToVideo=new self.C3ExportToWebMVideo(this,a):"mp4"===b&amp;&amp;(this._exportToVideo=new self.C3ExportToMP4Video(this,a));this._framerateMode="unlimited-frame";this._canvasManager.SetFullscreenMode("off");this._devicePixelRatio=1;self.devicePixelRatio=1;await this.PostComponentMessageToDOMAsync("runtime",
"set-exporting-to-video",{message:this._exportToVideo.GetExportingMessageForPercent(0),duration:this._exportToVideo.GetDuration()})}GetLoaderStyle(){return this._loaderStyle}IsExportToVideo(){return null!==this._exportToVideo}GetExportVideoDuration(){return this._exportToVideo.GetDuration()}GetExportVideoFramerate(){return this._exportToVideo.GetFramerate()}_InitExportToVideo(){return this._exportToVideo.Init({width:this._canvasManager.GetDeviceWidth(),height:this._canvasManager.GetDeviceHeight()})}_ExportToVideoAddFrame(){const a=
this._tickCount/this.GetExportVideoFramerate();return this._exportToVideo.AddFrame(this._canvasManager.GetCanvas(),a)}_ExportToVideoAddKeyframe(){this._exportToVideo&amp;&amp;this._exportToVideo.AddKeyframe()}_OnOfflineAudioRenderCompleted(a){this._exportToVideo.OnOfflineAudioRenderCompleted(a)}_ExportToVideoFinish(){return this._exportToVideo.Finish()}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(a){this._additionalLoadPromises.push(a)}SetUsingCreatePromises(a){this._isUsingCreatePromises=
!!a}AddCreatePromise(a){this._isUsingCreatePromises&amp;&amp;this._additionalCreatePromises.push(a)}GetCreatePromises(){return this._additionalCreatePromises}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(a){this._allEffectLists.push(a)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(a){this._canvasManager&amp;&amp;(await this._canvasManager.CreateCanvas(a),this._canvasManager.InitLoadingScreen(this._loaderStyle))}async _MaybeLoadOpusDecoder(){if(!this._assetManager.IsAudioFormatSupported("audio/webm; codecs=opus")){var a=
null;try{a=this.IsiOSCordova()&amp;&amp;this._assetManager.IsFileProtocol()?await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl):await this._assetManager.FetchArrayBuffer(this._opusWasmBinaryUrl)}catch(b){console.info("Failed to fetch Opus decoder WASM; assuming project has no Opus audio.",b);return}a?this.AddJobWorkerBuffer(a,"opus-decoder-wasm"):this.AddJobWorkerBlob(null,"opus-decoder-wasm");await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}}async _WasmDecodeWebMOpus(a){return await this.AddJob("OpusDecode",
{arrayBuffer:a},[a])}async Start(){this._hasStarted=!0;this._startTime=Date.now();if(this._usesLoaderLayout){for(var a of this._allObjectClasses)a.IsFamily()||a.IsOnLoaderLayout()||!a.IsWorldType()||a.OnCreate();this._assetManager.WaitForAllToLoad().then(()=&gt;{this._isLoading=!1;this._OnLoadFinished()})}else this._isLoading=!1;this._assetManager.SetInitialLoadFinished();this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.RuntimeInit(ife);for(const b of this._layoutManager.GetAllLayouts())b._CreateGlobalNonWorlds();
this.IsExportToVideo()&amp;&amp;await this._InitExportToVideo();a=this._layoutManager.GetFirstLayout();await a._Load(null,this.GetRenderer());await a._StartRunning(!0);this._fpsLastTime=performance.now();this._usesLoaderLayout||this._OnLoadFinished();(await this.PostComponentMessageToDOMAsync("runtime","before-start-ticking")).isSuspended&amp;&amp;!this.IsExportToVideo()?this._suspendCount++:this.Tick()}_OnLoadFinished(){this.Trigger(C3$jscomp$170.Plugins.System.Cnds.OnLoadFinished,null,null);this.PostComponentMessageToDOM("runtime",
"register-sw")}GetObjectReference(a){a=Math.floor(a);const b=this._objectReferenceTable;if(0&gt;a||a&gt;=b.length)throw Error("invalid object reference");return b[a]}_LoadJsPropNameTable(){for(const a of self.C3_JsPropNameTable){const b=C3$jscomp$170.first(Object.keys(a));this._jsPropNameTable.push(b)}}GetJsPropName(a){a=Math.floor(a);const b=this._jsPropNameTable;if(0&gt;a||a&gt;=b.length)throw Error("invalid prop reference");return b[a]}HasDOM(){return this._hasDom}IsHeadless(){return this._isHeadless}IsInWorker(){return this._isInWorker}GetRuntimeBaseURL(){return this._runtimeBaseUrl}GetPreviewURL(){return this._previewUrl}GetEventSheetManager(){return this._eventSheetManager}GetEventStack(){return this._eventSheetManager.GetEventStack()}GetCurrentEventStackFrame(){return this._eventSheetManager.GetCurrentEventStackFrame()}GetCurrentEvent(){return this._eventSheetManager.GetCurrentEvent()}GetCurrentCondition(){return this._eventSheetManager.GetCurrentCondition()}IsCurrentConditionFirst(){return 0===
this.GetCurrentEventStackFrame().GetConditionIndex()}GetCurrentAction(){return this._eventSheetManager.GetCurrentAction()}GetPluginManager(){return this._pluginManager}GetSystemPlugin(){return this._pluginManager.GetSystemPlugin()}GetObjectClassByIndex(a){a=Math.floor(a);if(0&gt;a||a&gt;=this._allObjectClasses.length)throw new RangeError("invalid index");return this._allObjectClasses[a]}GetObjectClassByName(a){return this._objectClassesByName.get(a.toLowerCase())||null}GetObjectClassBySID(a){return this._objectClassesBySid.get(a)||
null}GetSingleGlobalObjectClassByCtor(a){return(a=this._pluginManager.GetPluginByConstructorFunction(a))?a.GetSingleGlobalObjectClass():null}GetAllObjectClasses(){return this._allObjectClasses}*allInstances(){for(const a of this._allObjectClasses)a.IsFamily()||(yield*a.instances())}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(a){a.runtime=this.GetIRuntime();const b=this.IsDebug()&amp;&amp;!this._eventSheetManager.IsInEventEngine();b&amp;&amp;
C3Debugger$jscomp$3.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(a);b&amp;&amp;C3Debugger$jscomp$3.AddScriptTime()}DispatchUserScriptEventAsyncWait(a){a.runtime=this.GetIRuntime();return this._userScriptDispatcher.dispatchEventAndWaitAsync(a)}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(a,b){if(this._originalViewportWidth!==a||this._originalViewportHeight!==b)this._originalViewportWidth=
a,this._originalViewportHeight=b,a=this.GetLayoutManager(),a.SetAllLayerProjectionChanged(),a.SetAllLayerMVChanged()}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(a,b){if(this._viewportWidth!==a||this._viewportHeight!==b)this._viewportWidth=a,this._viewportHeight=b,a=this.GetLayoutManager(),a.SetAllLayerProjectionChanged(),a.SetAllLayerMVChanged()}_SetDevicePixelRatio(a){this.IsExportToVideo()||(this._devicePixelRatio=a)}GetDevicePixelRatio(){return this._devicePixelRatio}GetParallaxXOrigin(){return this._parallaxXorigin}GetParallaxYOrigin(){return this._parallaxYorigin}GetCanvasManager(){return this._canvasManager}GetDrawWidth(){return this._canvasManager?
this._canvasManager.GetDrawWidth():this._viewportWidth}GetDrawHeight(){return this._canvasManager?this._canvasManager.GetDrawHeight():this._viewportHeight}GetRenderScale(){return this._canvasManager?this._canvasManager.GetRenderScale():1}GetDisplayScale(){return this._canvasManager?this._canvasManager.GetDisplayScale():1}GetEffectLayerScaleParam(){return this._canvasManager?this._canvasManager.GetEffectLayerScaleParam():1}GetEffectDevicePixelRatioParam(){return this._canvasManager?this._canvasManager.GetEffectDevicePixelRatioParam():
1}GetCanvasClientX(){return this._canvasManager?this._canvasManager.GetCanvasClientX():0}GetCanvasClientY(){return this._canvasManager?this._canvasManager.GetCanvasClientY():0}GetCanvasCssWidth(){return this._canvasManager?this._canvasManager.GetCssWidth():0}GetCanvasCssHeight(){return this._canvasManager?this._canvasManager.GetCssHeight():0}GetFullscreenMode(){return this._canvasManager?this._canvasManager.GetFullscreenMode():"off"}GetAdditionalRenderTarget(a){return this._canvasManager?this._canvasManager.GetAdditionalRenderTarget(a):
null}ReleaseAdditionalRenderTarget(a){this._canvasManager&amp;&amp;this._canvasManager.ReleaseAdditionalRenderTarget(a)}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}UsesAnyCrossSampling(){return this._usesAnyCrossSampling}UsesAnyDepthSampling(){return this._usesAnyDepthSampling}GetGPUUtilisation(){return this._canvasManager?this._canvasManager.GetGPUUtilisation():NaN}IsLinearSampling(){return"nearest"!==this.GetSampling()}GetFramerateMode(){return this._framerateMode}GetCompositingMode(){return this._compositingMode}GetSampling(){return this._sampling}UsesLoaderLayout(){return this._usesLoaderLayout}GetLoadingLogoAsset(){return this._loadingLogoAsset}ReleaseLoadingLogoAsset(){this._loadingLogoAsset&amp;&amp;
(this._loadingLogoAsset.Release(),this._loadingLogoAsset=null)}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetTemplateManager(){return this._templateManager}GetAssetManager(){return this._assetManager}LoadImage(a){return this._assetManager.LoadImage(a)}CreateInstance(a,b,d,c,e,h){if(h&amp;&amp;this._templateManager){const k=this._templateManager.GetTemplateData(a,
h);if(k)return a=this.CreateInstanceFromData(k,b,!1,d,c,!1,e,void 0,e),this._templateManager.MapInstanceToTemplateName(a,h),a}return this.CreateInstanceFromData(a,b,!1,d,c,!1,e,void 0,e)}CreateInstanceFromData(a,b,d,c,e,h,k,m,p){var q=null;let v=null;if(a instanceof C3$jscomp$170.ObjectClass){v=a;if(v.IsFamily()){a=v.GetFamilyMembers();var x=Math.floor(this.Random()*a.length);v=a[x]}q=v.GetDefaultInstanceData()}else q=a,v=this.GetObjectClassByIndex(q[1]);var A=v.GetPlugin().IsWorldType();if(this._isLoading&amp;&amp;
A&amp;&amp;!v.IsOnLoaderLayout())return null;const C=b;A||(b=null);var D=d&amp;&amp;!h&amp;&amp;q&amp;&amp;!this._instancesByUid.has(q[2])?q[2]:this._nextUid++;x=q?q[0]:null;a=C3$jscomp$170.New(C3$jscomp$170.Instance,{runtime:this,objectType:v,layer:b,worldData:x,instVarData:q?q[3]:null,uid:D});this._instancesByUid.set(D,a);D=null;A&amp;&amp;(D=a.GetWorldInfo(),"undefined"!==typeof c&amp;&amp;"undefined"!==typeof e&amp;&amp;(D.SetX(c),D.SetY(e)),v._SetAnyCollisionCellChanged(!0));b&amp;&amp;(p||b._AddInstance(a,!0),1===b.GetParallaxX()&amp;&amp;1===b.GetParallaxY()||
v._SetAnyInstanceParallaxed(!0),b.GetLayout().MaybeLoadTexturesFor(v));this._objectCount++;let G=!0;if(m){var E=m.GetObjectClass();E.IsInContainer()&amp;&amp;v.IsInContainer()&amp;&amp;(m=v.GetContainer(),E=E.GetContainer(),m===E&amp;&amp;(G=!1))}if(v.IsInContainer()&amp;&amp;!d&amp;&amp;!h&amp;&amp;G){for(var J of v.GetContainer().objectTypes())J!==v&amp;&amp;(m=this.CreateInstanceFromData(J,C,!1,D?D.GetX():c,D?D.GetY():e,!0,!1,void 0,p),a._AddSibling(m));for(var L of a.siblings()){L._AddSibling(a);for(const O of a.siblings())L!==O&amp;&amp;L._AddSibling(O)}}A&amp;&amp;
!d&amp;&amp;k&amp;&amp;this._CreateChildInstancesFromData(a,x,D,b,c,e,p);if(v.IsInContainer()&amp;&amp;!d&amp;&amp;!h&amp;&amp;k)for(const O of a.siblings())if(d=O.GetWorldInfo())J=O.GetPlugin(),L=O.GetObjectClass().GetDefaultInstanceData()[0],J.IsWorldType()?this._CreateChildInstancesFromData(O,L,d,b,d.GetX(),d.GetY(),p):this._CreateChildInstancesFromData(O,L,d,b,void 0,void 0,p);!h&amp;&amp;k&amp;&amp;("undefined"===typeof c&amp;&amp;(c=x[0]),"undefined"===typeof e&amp;&amp;(e=x[1]),b=D.GetTopParent(),c=c-D.GetX()+b.GetX(),e=e-D.GetY()+b.GetY(),b.SetXY(c,e));v._SetIIDsStale();
e=q?C3$jscomp$170.cloneArray(q[5]):null;q=q?q[4].map(O=&gt;C3$jscomp$170.cloneArray(O)):null;(A=A&amp;&amp;x&amp;&amp;x[13])&amp;&amp;a._SetHasTilemap();a._CreateSdkInstance(e,q);A&amp;&amp;(x=x[13],a.GetSdkInstance().LoadTilemapData(x[2],x[0],x[1]));this._instancesPendingCreate.push(a);this._hasPendingInstances=!0;this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.InstanceCreated(a);return a}_CreateChildInstancesFromData(a,b,d,c,e,h,k){var m=d.GetSceneGraphZIndexExportData(),p=d.GetSceneGraphChildrenExportData();a.GetWorldInfo().SetSceneGraphZIndex(m);
if(p){"undefined"===typeof e&amp;&amp;(e=b[0]);"undefined"===typeof h&amp;&amp;(h=b[1]);m=new Set;d=b[0];b=b[1];for(const C of p){var q=C[1],v=C[2];p=C[3];var x=!!C[4];const D=C[5];v=this._layoutManager.GetLayoutBySID(C[0]).GetLayer(q).GetInitialInstanceData(v);q=this.GetObjectClassByIndex(v[1]);var A=a.HasSibling(q);const G=m.has(q);A&amp;&amp;!G&amp;&amp;x?(x=a.GetSibling(q),A=e+v[0][0]-d,v=h+v[0][1]-b,x.GetWorldInfo().SetXY(A,v),x.GetWorldInfo().SetSceneGraphZIndex(D),a.AddChild(x,{transformX:!!(p&gt;&gt;0&amp;1),transformY:!!(p&gt;&gt;1&amp;1),
transformWidth:!!(p&gt;&gt;2&amp;1),transformHeight:!!(p&gt;&gt;3&amp;1),transformAngle:!!(p&gt;&gt;4&amp;1),destroyWithParent:!!(p&gt;&gt;5&amp;1),transformZElevation:!!(p&gt;&gt;6&amp;1)}),m.add(q)):(q=this.CreateInstanceFromData(v,c,!1,e+v[0][0]-d,h+v[0][1]-b,!1,!0,a,k),q.GetWorldInfo().SetSceneGraphZIndex(D),a.AddChild(q,{transformX:!!(p&gt;&gt;0&amp;1),transformY:!!(p&gt;&gt;1&amp;1),transformWidth:!!(p&gt;&gt;2&amp;1),transformHeight:!!(p&gt;&gt;3&amp;1),transformAngle:!!(p&gt;&gt;4&amp;1),destroyWithParent:!!(p&gt;&gt;5&amp;1),transformZElevation:!!(p&gt;&gt;6&amp;1)}))}}}DestroyInstance(a){if(!this._instancesToReleaseAtEndOfTick.has(a)){var b=
a.GetObjectClass(),d=this._instancesPendingDestroy.get(b);if(d){if(d.has(a))return;d.add(a)}else d=new Set,d.add(a),this._instancesPendingDestroy.set(b,d);this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.InstanceDestroyed(a);a._MarkDestroyed();this._hasPendingInstances=!0;if(a.IsInContainer())for(const c of a.siblings())this.DestroyInstance(c);for(const c of a.children())c.GetDestroyWithParent()&amp;&amp;this.DestroyInstance(c);this._layoutManager.IsEndingLayout()||this._isLoadingState||(b=this.GetEventSheetManager(),
b.BlockFlushingInstances(!0),a._TriggerOnDestroyed(),b.BlockFlushingInstances(!1));a._FireDestroyedScriptEvents(this._layoutManager.IsEndingLayout())}}FlushPendingInstances(){this._hasPendingInstances&amp;&amp;(this._isFlushingPendingInstances=!0,this._FlushInstancesPendingCreate(),this._FlushInstancesPendingDestroy(),this._hasPendingInstances=this._isFlushingPendingInstances=!1,this.UpdateRender())}_FlushInstancesPendingCreate(){for(const a of this._instancesPendingCreate){const b=a.GetObjectClass();b._AddInstance(a);
for(const d of b.GetFamilies())d._AddInstance(a),d._SetIIDsStale()}C3$jscomp$170.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(!0);for(const [a,b]of this._instancesPendingDestroy.entries())this._FlushInstancesPendingDestroyForObjectClass(a,b),b.clear();this._instancesPendingDestroy.clear();this._dispatcher.SetDelayRemoveEventsEnabled(!1)}_FlushInstancesPendingDestroyForObjectClass(a,b){for(const c of b){var d=this._eventObjects.instancedestroy;
d.instance=c;this._dispatcher.dispatchEvent(d);this._instancesByUid.delete(c.GetUID());this._instanceTimes.delete(c);if(d=c.GetWorldInfo())d._RemoveFromCollisionCells(),d._RemoveFromRenderCells(),d._MarkDestroyed();this._instancesToReleaseAtEndOfTick.add(c);this._objectCount--}C3$jscomp$170.arrayRemoveAllInSet(a.GetInstances(),b);a._SetIIDsStale();this._instancesToReleaseAffectedObjectClasses.add(a);0===a.GetInstances().length&amp;&amp;a._SetAnyInstanceParallaxed(!1);for(const c of a.GetFamilies())C3$jscomp$170.arrayRemoveAllInSet(c.GetInstances(),
b),c._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(c);if(a.GetPlugin().IsWorldType()){a=new Set([...b].map(c=&gt;c.GetWorldInfo().GetLayer()));for(const c of a)c._RemoveAllInstancesInSet(b)}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}*instancesPendingCreateForObjectClass(a){for(const b of this._GetInstancesPendingCreate())a.IsFamily()?b.GetObjectClass().BelongsToFamily(a)&amp;&amp;(yield b):b.GetObjectClass()===a&amp;&amp;(yield b)}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(a,
b){this._instancesByUid.set(a,b)}_OnWebGLContextLost(){this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,"webglcontextlost"));this.SetSuspended(!0);for(var a of this._allObjectClasses)!a.IsFamily()&amp;&amp;a.HasLoadedTextures()&amp;&amp;a.ReleaseTextures();(a=this.GetMainRunningLayout())&amp;&amp;a._OnWebGLContextLost();C3$jscomp$170.ImageInfo.OnWebGLContextLost();C3$jscomp$170.ImageAsset.OnWebGLContextLost()}async _OnWebGLContextRestored(){await this.GetMainRunningLayout()._Load(null,this.GetWebGLRenderer());
this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,"webglcontextrestored"));this.SetSuspended(!1);this.UpdateRender()}_OnVisibilityChange(a){this.SetSuspended(a.hidden)}_OnWindowBlur(a){this.IsPreview()&amp;&amp;this._pauseOnBlur&amp;&amp;!C3$jscomp$170.Platform.IsMobile&amp;&amp;!a.data.parentHasFocus&amp;&amp;(this.SetSuspended(!0),this._isPausedOnBlur=!0)}_OnWindowFocus(){this._isPausedOnBlur&amp;&amp;(this.SetSuspended(!1),this._isPausedOnBlur=!1)}_RequestAnimationFrame(){const a=this._tickCallbacks;"vsync"===this._framerateMode?
-1===this._rafId&amp;&amp;(this._rafId=self.requestAnimationFrame(a.normal)):"unlimited-tick"===this._framerateMode?(-1===this._ruafId&amp;&amp;(this._ruafId=C3$jscomp$170.RequestUnlimitedAnimationFrame(a.tickOnly)),-1===this._rafId&amp;&amp;(this._rafId=self.requestAnimationFrame(a.renderOnly))):-1===this._ruafId&amp;&amp;(this._ruafId=C3$jscomp$170.RequestUnlimitedAnimationFrame(a.normal))}_CancelAnimationFrame(){-1!==this._rafId&amp;&amp;(self.cancelAnimationFrame(this._rafId),this._rafId=-1);-1!==this._ruafId&amp;&amp;(C3$jscomp$170.CancelUnlimitedAnimationFrame(this._ruafId),
this._ruafId=-1)}IsSuspended(){return 0&lt;this._suspendCount}SetSuspended(a){if(!this.IsExportToVideo()){var b=this.IsSuspended();this._suspendCount+=a?1:-1;0&gt;this._suspendCount&amp;&amp;(this._suspendCount=0);a=this.IsSuspended();!b&amp;&amp;a?(console.log("[Construct] Suspending"),this._CancelAnimationFrame(),this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,"suspend")),this.Trigger(C3$jscomp$170.Plugins.System.Cnds.OnSuspend,null,null)):b&amp;&amp;!a&amp;&amp;(console.log("[Construct] Resuming"),this._fpsLastTime=
this._lastTickTime=b=performance.now(),this._mainThreadTimeCounter=this._mainThreadTime=this._fps=this._fpsFrameCount=0,this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,"resume")),this.Trigger(C3$jscomp$170.Plugins.System.Cnds.OnResume,null,null),this.HitBreakpoint()||this.Tick(b))}}_AddBehInstToTick(a){this._behInstsToTick.Add(a)}_AddBehInstToPostTick(a){this._behInstsToPostTick.Add(a)}_AddBehInstToTick2(a){this._behInstsToTick2.Add(a)}_RemoveBehInstToTick(a){this._behInstsToTick.Remove(a)}_RemoveBehInstToPostTick(a){this._behInstsToPostTick.Remove(a)}_RemoveBehInstToTick2(a){this._behInstsToTick2.Remove(a)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);
for(const a of this._behInstsToTick)a.Tick();this._behInstsToTick.SetQueueingEnabled(!1)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const a of this._behInstsToPostTick)a.PostTick();this._behInstsToPostTick.SetQueueingEnabled(!1)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const a of this._behInstsToTick2)a.Tick2();this._behInstsToTick2.SetQueueingEnabled(!1)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const a of this._behInstsToTick){const b=
a.Tick();C3$jscomp$170.IsIterator(b)&amp;&amp;(yield*b)}this._behInstsToTick.SetQueueingEnabled(!1)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const a of this._behInstsToPostTick){const b=a.PostTick();C3$jscomp$170.IsIterator(b)&amp;&amp;(yield*b)}this._behInstsToPostTick.SetQueueingEnabled(!1)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const a of this._behInstsToTick2){const b=a.Tick2();C3$jscomp$170.IsIterator(b)&amp;&amp;(yield*b)}this._behInstsToTick2.SetQueueingEnabled(!1)}async Tick(a,
b,d){this._hasStartedTicking=!0;const c="background-wake"===d;d="background-wake"!==d&amp;&amp;"skip-render"!==d;if(this._hasStarted&amp;&amp;(!this.IsSuspended()||b||c)){b=performance.now();this._isInTick=!0;this._MeasureDt(a||0);a=this.Step_BeforePreTick();this.IsDebugging()&amp;&amp;await a;a=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects.pretick);a instanceof Promise&amp;&amp;await a;a=this.Step_AfterPreTick();this.IsDebugging()&amp;&amp;await a;this._NeedsHandleSaveOrLoad()&amp;&amp;await this._HandleSaveOrLoad();this.GetLayoutManager().IsPendingChangeMainLayout()&amp;&amp;
await this._MaybeChangeLayout();a=this.Step_RunEventsEtc();this.IsDebugging()&amp;&amp;await a;d&amp;&amp;this.Render();if(this.IsExportToVideo()&amp;&amp;(await this._ExportToVideoAddFrame(),this.GetGameTime()&gt;=this.GetExportVideoDuration())){this._ExportToVideoFinish();return}this.IsSuspended()||c||this._RequestAnimationFrame();this._tickCount++;this._tickCountNoSave++;this._isInTick=!1;this._mainThreadTimeCounter+=performance.now()-b}}async Step_BeforePreTick(){const a=this._eventSheetManager,b=this.IsDebug();this.FlushPendingInstances();
a.BlockFlushingInstances(!0);this.PushCurrentLayout(this.GetMainRunningLayout());b&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();this.IsDebugging()?await a.DebugRunScheduledWaits():a.RunScheduledWaits();b&amp;&amp;C3Debugger$jscomp$3.AddEventsTime();this.PopCurrentLayout();a.BlockFlushingInstances(!1);this.FlushPendingInstances();a.BlockFlushingInstances(!0)}async Step_AfterPreTick(){const a=this.IsDebug(),b=this.IsDebugging(),d=this._dispatcher,c=this._eventObjects,e=this._userScriptEventObjects;a&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();
b?await this.DebugIterateAndBreak(this._DebugBehaviorTick()):this._BehaviorTick();b?await this.DebugIterateAndBreak(this._DebugBehaviorPostTick()):this._BehaviorPostTick();a&amp;&amp;C3Debugger$jscomp$3.AddBehaviorTickTime();a&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();b?await this.DebugFireGeneratorEventAndBreak(c.tick):d.dispatchEvent(c.tick);a&amp;&amp;C3Debugger$jscomp$3.AddPluginTickTime();this._eventSheetManager.BlockFlushingInstances(!1);this.DispatchUserScriptEvent(e.tick)}async Step_RunEventsEtc(){const a=
this._eventSheetManager,b=this._dispatcher,d=this._eventObjects,c=this.IsDebug(),e=this.IsDebugging();c&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();e?await a.DebugRunEvents(this._layoutManager):a.RunEvents(this._layoutManager);c&amp;&amp;C3Debugger$jscomp$3.AddEventsTime();this._collisionEngine.ClearRegisteredCollisions();this._ReleaseInstancesAtEndOfTick();this._isLayoutFirstTick=!1;a.BlockFlushingInstances(!0);c&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();e?await this.DebugIterateAndBreak(this._DebugBehaviorTick2()):
this._BehaviorTick2();c&amp;&amp;C3Debugger$jscomp$3.AddBehaviorTickTime();c&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();e?await this.DebugFireGeneratorEventAndBreak(d.tick2):b.dispatchEvent(d.tick2);c&amp;&amp;C3Debugger$jscomp$3.AddPluginTickTime();a.BlockFlushingInstances(!1);e&amp;&amp;await a.RunQueuedDebugTriggersAsync()}_ReleaseInstancesAtEndOfTick(){if(0!==this._instancesToReleaseAtEndOfTick.size){var a=this._dispatcher;a.SetDelayRemoveEventsEnabled(!0);for(const b of this._instancesToReleaseAffectedObjectClasses)b.GetSolStack().RemoveInstances(this._instancesToReleaseAtEndOfTick);
this._instancesToReleaseAffectedObjectClasses.clear();this._eventSheetManager.RemoveInstancesFromScheduledWaits(this._instancesToReleaseAtEndOfTick);for(const b of this._instancesToReleaseAtEndOfTick)b.Release();this._instancesToReleaseAtEndOfTick.clear();a.SetDelayRemoveEventsEnabled(!1)}}async _MaybeChangeLayout(){const a=this.GetLayoutManager();let b=0;for(;a.IsPendingChangeMainLayout()&amp;&amp;10&gt;b++;)await this._DoChangeLayout(a.GetPendingChangeMainLayout())}_MeasureDt(a){let b=0;this.IsExportToVideo()?
this._dt1=b=1/this.GetExportVideoFramerate():0!==this._lastTickTime&amp;&amp;(b=Math.max(a-this._lastTickTime,0)/1E3,.5&lt;b&amp;&amp;(b=0),this._dt1=Math.min(b,1/this._minimumFramerate));this._lastTickTime=a;this._dt=this._dt1*this._timeScale;this._gameTime.Add(this._dt);this._gameTimeRaw.Add(b*this._timeScale);this._wallTime.Add(this._dt1);for(const [d,c]of this._instanceTimes)c.Add(this._dt1*d.GetTimeScale());this._canvasManager&amp;&amp;this._canvasManager._UpdateTick();1E3&lt;=a-this._fpsLastTime&amp;&amp;(this._fpsLastTime+=1E3,
1E3&lt;=a-this._fpsLastTime&amp;&amp;(this._fpsLastTime=a),this._fps=this._fpsFrameCount,this._fpsFrameCount=0,this._mainThreadTime=Math.min(this._mainThreadTimeCounter/1E3,1),this._mainThreadTimeCounter=0,this._canvasManager&amp;&amp;this._canvasManager._Update1sFrameRange(),this._collisionEngine._Update1sStats(),this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.Update1sPerfStats());this._fpsFrameCount++}_SetTrackingInstanceTime(a,b){b?this._instanceTimes.has(a)||(b=C3$jscomp$170.New(C3$jscomp$170.KahanSum),b.Copy(this._gameTime),
this._instanceTimes.set(a,b)):this._instanceTimes.delete(a)}_GetInstanceGameTime(a){return(a=this._instanceTimes.get(a))?a.Get():this.GetGameTime()}async _DoChangeLayout(a){const b=this._dispatcher,d=this.GetLayoutManager().GetMainRunningLayout();await d._StopRunning();d._Unload(a,this.GetRenderer());d===a&amp;&amp;this._eventSheetManager.ClearAllScheduledWaits();this._collisionEngine.ClearRegisteredCollisions();this._ReleaseInstancesAtEndOfTick();b.dispatchEvent(this._eventObjects.beforelayoutchange);C3$jscomp$170.Asyncify.SetHighThroughputMode(!0);
await a._Load(d,this.GetRenderer());C3$jscomp$170.Asyncify.SetHighThroughputMode(!1);await a._StartRunning(!1);b.dispatchEvent(this._eventObjects.layoutchange);this.UpdateRender();this._isLayoutFirstTick=!0;this.FlushPendingInstances();this._ExportToVideoAddKeyframe()}UpdateRender(){this._needRender=!0}GetWebGLRenderer(){return this._canvasManager?this._canvasManager.GetWebGLRenderer():null}GetWebGPURenderer(){return this._canvasManager?this._canvasManager.GetWebGPURenderer():null}GetRenderer(){return this._canvasManager?
this._canvasManager.GetRenderer():null}Render(){const a=this._canvasManager;if(a&amp;&amp;!a.IsRendererContextLost()){var b=this.GetRenderer(),d=b.SupportsGPUProfiling(),c=d&amp;&amp;b.IsWebGL();d=d&amp;&amp;b.IsWebGPU();c&amp;&amp;b.CheckForQueryResults();if(this._needRender||this.IsExportToVideo()){var e=this._layoutManager.GetMainRunningLayout();b.Start();var h=this.IsDebug();h&amp;&amp;C3Debugger$jscomp$3.StartMeasuringTime();this._needRender=!1;var k=null;c&amp;&amp;(k=a.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery(),b.StartQuery(k));c=
null;d&amp;&amp;(c=b.StartFrameTiming(2*(1+e.GetLayerCount())),b.WriteTimestamp(0));this.Uses3DFeatures()&amp;&amp;"low"===a.GetCurrentFullscreenScalingQuality()?b.SetFixedSizeDepthBuffer(a.GetDrawWidth(),a.GetDrawHeight()):b.SetAutoSizeDepthBuffer();this._Render(this.GetRenderer(),e);k&amp;&amp;b.EndQuery(k);d&amp;&amp;(b.WriteTimestamp(1),this._canvasManager._AddWebGPUFrameTiming(c));b.Finish();h&amp;&amp;(C3Debugger$jscomp$3.AddDrawCallsTime(),C3Debugger$jscomp$3.UpdateInspectHighlight());a&amp;&amp;a._MaybeTakeSnapshot()}else b.IncrementFrameNumber()}}_Render(a,
b){a.SetTextureFillMode();a.SetAlphaBlend();a.SetColorRgba(1,1,1,1);a.SetRenderTarget(null);a.SetTexture(null);a.SetDepthEnabled(this.Uses3DFeatures());b.Draw(a)}Trigger(a,b,d){if(!this._hasStarted)return!1;var c=!this._isInTick&amp;&amp;!this._eventSheetManager.IsInTrigger();let e=0;c&amp;&amp;(e=performance.now());const h=this.IsDebug();h&amp;&amp;this.SetDebuggingEnabled(!1);a=this._eventSheetManager._Trigger(this._layoutManager,a,b,d);c&amp;&amp;(c=performance.now()-e,this._mainThreadTimeCounter+=c,h&amp;&amp;C3Debugger$jscomp$3.AddTriggersTime(c));
h&amp;&amp;this.SetDebuggingEnabled(!0);return a}DebugTrigger(a,b,d){if(!this.IsDebug())return this.Trigger(a,b,d);if(this.HitBreakpoint())throw Error("called DebugTrigger() while stopped on breakpoint");if(!this._isInTick&amp;&amp;!this._eventSheetManager.IsInTrigger())throw Error("called DebugTrigger() outside of event code - use TriggerAsync() instead");return this._eventSheetManager._DebugTrigger(this._layoutManager,a,b,d)}async TriggerAsync(a,b,d){if(!this.IsDebugging())return this.Trigger(a,b,d);if(!this._hasStarted)return!1;
if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(a,b,d);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(a,b,d);const c=performance.now();a=this._eventSheetManager._DebugTrigger(this._layoutManager,a,b,d);for(b=a.next();!b.done;)await this.DebugBreak(b.value),b=a.next();this.IsSuspended()||this._eventSheetManager.IsInTrigger()||(await this._eventSheetManager.RunQueuedDebugTriggersAsync(),this._hasStartedTicking&amp;&amp;!this._isInTick&amp;&amp;this._RequestAnimationFrame());
this._mainThreadTimeCounter+=performance.now()-c;return b.value}FastTrigger(a,b,d){const c=this.IsDebug();c&amp;&amp;this.SetDebuggingEnabled(!1);a=this._eventSheetManager._FastTrigger(this._layoutManager,a,b,d);c&amp;&amp;this.SetDebuggingEnabled(!0);return a}DebugFastTrigger(a,b,d){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,a,b,d)}ScheduleTriggers(a){return this._scheduleTriggersThrottle.Add(a)}PushCurrentLayout(a){this._currentLayoutStack.push(a)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw Error("layout stack empty");
this._currentLayoutStack.pop()}GetCurrentLayout(){return this._currentLayoutStack.length?this._currentLayoutStack.at(-1):this.GetMainRunningLayout()}GetDt(a){return a&amp;&amp;-1!==a.GetTimeScale()?this._dt1*a.GetTimeScale():this._dt}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetTimeScale(){return this._timeScale}SetTimeScale(a){if(isNaN(a)||0&gt;a)a=0;this._timeScale=a}SetMinimumFramerate(a){this._minimumFramerate=C3$jscomp$170.clamp(a,1,120)}GetMinimumFramerate(){return this._minimumFramerate}GetFPS(){return this._fps}GetMainThreadTime(){return this._mainThreadTime}GetStartTime(){return this._startTime}GetGameTime(){return this._gameTime.Get()}GetGameTimeRaw(){return this._gameTimeRaw.Get()}GetWallTime(){return this._wallTime.Get()}GetTickCount(){return this._tickCount}GetTickCountNoSave(){return this._tickCountNoSave}GetObjectCount(){return this._objectCount}GetProjectName(){return this._projectName}GetProjectVersion(){return this._projectVersion}GetProjectUniqueId(){return this._projectUniqueId}GetAppId(){return this._appId}GetInstanceByUID(a){if(this._isLoadingState)throw Error("cannot call while loading state - wait until afterload event");
return this._instancesByUid.get(a)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const a of this._allObjectClasses)if(!a.IsFamily())for(const b of a.GetInstances())this._instancesByUid.set(b.GetUID(),b)}IsPreview(){return"preview"===this._exportType}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return"cordova"===this._exportType}IsAndroidWebView(){return"Android"===C3$jscomp$170.Platform.OS&amp;&amp;("cordova"===this._exportType||"playable-ad"===this._exportType||
"instant-games"===this._exportType)}IsiOSCordova(){return this._isiOSCordova}IsiOSWebView(){return this._isiOSWebView}GetCollisionEngine(){return this._collisionEngine}GetSolidBehavior(){return this._pluginManager.GetSolidBehavior()}GetJumpthruBehavior(){return this._pluginManager.GetJumpthruBehavior()}Uses3DFeatures(){return this._uses3dFeatures}GetZScaleFactor(){return this.GetRenderer().GetZAxisScaleFactor(this.GetViewportHeight())}GetDefaultCameraZ(a){return this.GetRenderer().GetDefaultCameraZ(a||
this.GetViewportHeight())}IsLayoutFirstTick(){return this._isLayoutFirstTick}SetPixelRoundingEnabled(a){a=!!a;this._isPixelRoundingEnabled!==a&amp;&amp;(this._isPixelRoundingEnabled=a,this.GetLayoutManager().SetAllLayerMVChanged(),this.UpdateRender())}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}SaveToSlot(a){this._saveToSlotName=a}LoadFromSlot(a){this._loadFromSlotName=a}LoadFromJsonString(a){this._loadFromJson=a}GetLastSaveJsonString(){return this._lastSaveJson}_NeedsHandleSaveOrLoad(){return!(!this._saveToSlotName&amp;&amp;
!this._loadFromSlotName&amp;&amp;null===this._loadFromJson)}async _HandleSaveOrLoad(){this._saveToSlotName&amp;&amp;(this.FlushPendingInstances(),await this._DoSaveToSlot(this._saveToSlotName),this._ClearSaveOrLoad());this._loadFromSlotName&amp;&amp;(await this._DoLoadFromSlot(this._loadFromSlotName),this._ClearSaveOrLoad(),this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.StepIfPausedInDebugger());if(null!==this._loadFromJson){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson),this._lastSaveJson=this._loadFromJson,
await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=""}catch(a){console.error("[Construct] Failed to load state from JSON string: ",a),await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnLoadFailed,null)}this._ClearSaveOrLoad()}}_ClearSaveOrLoad(){this._loadFromSlotName=this._saveToSlotName="";this._loadFromJson=null}_GetProjectStorage(){this._projectStorage||(this._projectStorage=localforage.createInstance({name:"c3-localstorage-"+this.GetProjectUniqueId(),
description:this.GetProjectName()}));return this._projectStorage}_GetSavegamesStorage(){this._savegamesStorage||(this._savegamesStorage=localforage.createInstance({name:"c3-savegames-"+this.GetProjectUniqueId(),description:this.GetProjectName()}));return this._savegamesStorage}async _DoSaveToSlot(a){const b=await this._SaveToJsonString();try{await this._GetSavegamesStorage().setItem(a,b),console.log("[Construct] Saved state to storage ("+b.length+" chars)"),this._lastSaveJson=b,await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnSaveComplete,
null),this._lastSaveJson=""}catch(d){console.error("[Construct] Failed to save state to storage: ",d),await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(a){try{const b=await this._GetSavegamesStorage().getItem(a);if(!b)throw Error("empty slot");console.log("[Construct] Loaded state from storage ("+b.length+" chars)");await this._DoLoadFromJsonString(b);this._lastSaveJson=b;await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnLoadComplete,null);
this._lastSaveJson=""}catch(b){console.error("[Construct] Failed to load state from storage: ",b),await this.TriggerAsync(C3$jscomp$170.Plugins.System.Cnds.OnLoadFailed,null)}}async _SaveToJsonString(){const a={c3save:!0,version:1,rt:{time:this.GetGameTime(),timeRaw:this.GetGameTimeRaw(),walltime:this.GetWallTime(),timescale:this.GetTimeScale(),tickcount:this.GetTickCount(),next_uid:this._nextUid,running_layout:this.GetMainRunningLayout().GetSID(),start_time_offset:Date.now()-this._startTime},types:{},
layouts:{},events:this._eventSheetManager._SaveToJson(),timelines:this._timelineManager._SaveToJson(),user_script_data:null};for(var b of this._allObjectClasses)b.IsFamily()||b.HasNoSaveBehavior()||(a.types[b.GetSID().toString()]=b._SaveToJson());for(const d of this._layoutManager.GetAllLayouts())a.layouts[d.GetSID().toString()]=d._SaveToJson();b=this._CreateUserScriptEvent("save");b.saveData=null;await this.DispatchUserScriptEventAsyncWait(b);a.user_script_data=b.saveData;return JSON.stringify(a)}IsLoadingState(){return this._isLoadingState}async _DoLoadFromJsonString(a){var b=
this.GetLayoutManager();a=JSON.parse(a);if(a.c2save)throw Error("C2 saves are incompatible with C3 runtime");if(!a.c3save)throw Error("not valid C3 save data");if(1&lt;a.version)throw Error("C3 save data from future version");this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,"beforeload"));for(var d of this.allInstances())d._OnBeforeLoad();this._isLoadingState=!0;d=a.rt;this._gameTime.Set(d.time);d.hasOwnProperty("timeRaw")&amp;&amp;this._gameTimeRaw.Set(d.timeRaw);this._wallTime.Set(d.walltime);
this._timeScale=d.timescale;this._tickCount=d.tickcount;this._startTime=Date.now()-d.start_time_offset;var c=d.running_layout;if(c!==this.GetMainRunningLayout().GetSID())if(c=b.GetLayoutBySID(c))await this._DoChangeLayout(c);else return;for(const [e,h]of Object.entries(a.types))c=parseInt(e,10),c=this.GetObjectClassBySID(c),!c||c.IsFamily()||c.HasNoSaveBehavior()||c._LoadFromJson(h);this.FlushPendingInstances();this._RefreshUidMap();this._isLoadingState=!1;this._nextUid=d.next_uid;for(const [e,h]of Object.entries(a.layouts))d=
parseInt(e,10),(d=b.GetLayoutBySID(d))&amp;&amp;d._LoadFromJson(h);this._eventSheetManager._LoadFromJson(a.events);for(const e of this._allObjectClasses)if(!e.IsFamily()&amp;&amp;e.IsInContainer())for(const h of e.GetInstances()){d=h.GetIID();for(const k of e.GetContainer().objectTypes())if(k!==e){c=k.GetInstances();if(0&gt;d||d&gt;=c.length)throw Error("missing sibling instance");h._AddSibling(c[d])}}this._timelineManager._LoadFromJson(a.timelines);b.SetAllLayerProjectionChanged();b.SetAllLayerMVChanged();this._dispatcher.dispatchEvent(C3$jscomp$170.New(C3$jscomp$170.Event,
"afterload"));b=this._CreateUserScriptEvent("load");b.saveData=a.user_script_data;await this.DispatchUserScriptEventAsyncWait(b);this.UpdateRender()}async AddJobWorkerScripts(a){a=await Promise.all(a.map(async b=&gt;{const d=C3$jscomp$170.IsAbsoluteURL(b)&amp;&amp;(new URL(b)).origin!==location.origin,c=this.IsCordova()&amp;&amp;this._assetManager.IsFileProtocol();return d||c||this.IsPreview()||"playable-ad"===this.GetExportType()?(b=await this._assetManager.FetchBlob(b),URL.createObjectURL(b)):C3$jscomp$170.IsRelativeURL(b)?
(new URL(b,this._runtimeBaseUrl)).toString():b}));this._jobScheduler.ImportScriptsToJobWorkers(a)}AddJobWorkerBlob(a,b){this._jobScheduler.SendBlobToJobWorkers(a,b)}AddJobWorkerBuffer(a,b){this._jobScheduler.SendBufferToJobWorkers(a,b)}AddJob(a,b,d){return this._jobScheduler.AddJob(a,b,d)}BroadcastJob(a,b,d){return this._jobScheduler.BroadcastJob(a,b,d)}InvokeDownload(a,b){this.PostComponentMessageToDOM("runtime","invoke-download",{url:a,filename:b})}async RasterSvgImage(a,b,d,c,e,h){c=c||b;e=e||
d;if(this.IsInWorker())return(await this.PostComponentMessageToDOMAsync("runtime","raster-svg-image",{blob:a,imageWidth:b,imageHeight:d,surfaceWidth:c,surfaceHeight:e,imageBitmapOpts:h})).imageBitmap;a=await self.C3_RasterSvgImageBlob(a,b,d,c,e);return h?await self.createImageBitmap(a,h):a}async GetSvgImageSize(a){return this.IsInWorker()?await this.PostComponentMessageToDOMAsync("runtime","get-svg-image-size",{blob:a}):await self.C3_GetSvgImageSize(a)}RequestDeviceOrientationEvent(){this._didRequestDeviceOrientationEvent||
(this._didRequestDeviceOrientationEvent=!0,this.PostComponentMessageToDOM("runtime","enable-device-orientation"))}RequestDeviceMotionEvent(){this._didRequestDeviceMotionEvent||(this._didRequestDeviceMotionEvent=!0,this.PostComponentMessageToDOM("runtime","enable-device-motion"))}Random(){return this._randomNumberCallback()}SetRandomNumberGeneratorCallback(a){this._randomNumberCallback=a}_GetRemotePreviewStatusInfo(){const a=this.GetWebGLRenderer();return{fps:this.GetFPS(),cpu:this.GetMainThreadTime(),
gpu:this.GetGPUUtilisation(),layout:this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():"",renderer:a?a.GetUnmaskedRenderer():"&lt;unavailable&gt;"}}HitBreakpoint(){return this.IsDebug()?C3Debugger$jscomp$3.HitBreakpoint():!1}DebugBreak(a){return this.IsDebugging()?C3Debugger$jscomp$3.DebugBreak(a):Promise.resolve()}DebugBreakNext(){return this.IsDebugging()?C3Debugger$jscomp$3.BreakNext():!1}SetDebugBreakpointsEnabled(a){this._breakpointsEnabled=!!a;this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(a){a?
this._debuggingDisabled--:this._debuggingDisabled++;this._UpdateDebuggingFlag()}_UpdateDebuggingFlag(){this._isDebugging=this.IsDebug()&amp;&amp;this._breakpointsEnabled&amp;&amp;0===this._debuggingDisabled}IsCPUProfiling(){return this.IsDebug()&amp;&amp;C3Debugger$jscomp$3.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&amp;&amp;this.GetRenderer().SupportsGPUProfiling()&amp;&amp;C3Debugger$jscomp$3.IsGPUProfiling()}async DebugIterateAndBreak(a){if(a)for(const b of a)await this.DebugBreak(b)}DebugFireGeneratorEventAndBreak(a){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(a))}_InvokeFunctionFromJS(a){return this._eventSheetManager._InvokeFunctionFromJS(a.name,
a.params)}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(a){a=C3$jscomp$170.New(C3$jscomp$170.Event,a,!1);a.runtime=this._iRuntime;return a}_InitScriptInterfaces(){var a={};for(const b of this._allObjectClasses)a[b.GetJsPropName()]={value:b.GetIObjectClass(),enumerable:!0,writable:!1};a=Object.create(Object.prototype,a);this._iRuntime=new self.IRuntime(this,a);this._userScriptEventObjects={tick:this._CreateUserScriptEvent("tick")}}_InitGlobalVariableScriptInterface(){const a={};for(const b of this.GetEventSheetManager().GetAllGlobalVariables())a[b.GetJsPropName()]=
b._GetScriptInterfaceDescriptor();this._iRuntime._InitGlobalVars(a)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}_MapScriptInterface(a,b){this._interfaceMap.set(a,b)}_UnwrapScriptInterface(a){return this._interfaceMap.get(a)}_UnwrapIObjectClass(a){if(!(a instanceof self.IObjectClass))throw new TypeError("expected IObjectClass");a=this._UnwrapScriptInterface(a);if(!(a&amp;&amp;a instanceof C3$jscomp$170.ObjectClass))throw Error("invalid IObjectClass");return a}_UnwrapIWorldInstance(a){if(!(a instanceof
self.IWorldInstance))throw new TypeError("expected IWorldInstance");a=this._UnwrapScriptInterface(a);if(!(a&amp;&amp;a instanceof C3$jscomp$170.Instance))throw Error("invalid IInstance");return a}};self.C3_CreateRuntime=C3$jscomp$170.Runtime.Create;self.C3_InitRuntime=(a,b)=&gt;a.Init(b);"use strict";const C3$jscomp$171=self.C3;
C3$jscomp$171.JobSchedulerRuntime=class extends C3$jscomp$171.DefendedBase{constructor(a,b){super();this._runtime=a;this._jobPromises=new Map;this._nextJobId=0;this._inputPort=b.inputPort;b.outputPort.onmessage=d=&gt;this._OnJobWorkerMessage(d);this._maxNumWorkers=b.maxNumWorkers;this._jobWorkerCount=1;this._hadErrorCreatingWorker=this._isCreatingWorker=!1}async Init(){}ImportScriptsToJobWorkers(a){this._inputPort.postMessage({type:"_import_scripts",scripts:a})}SendBlobToJobWorkers(a,b){this._inputPort.postMessage({type:"_send_blob",
blob:a,id:b})}SendBufferToJobWorkers(a,b){this._inputPort.postMessage({type:"_send_buffer",buffer:a,id:b},[a])}AddJob(a,b,d,c,e){d||(d=[]);const h=this._nextJobId++;a={type:a,isBroadcast:!1,jobId:h,params:b,transferables:d};b=new Promise((k,m)=&gt;{this._jobPromises.set(h,{resolve:k,progress:c,reject:m,cancelled:!1})});e&amp;&amp;e.SetAction(()=&gt;this._CancelJob(h));this._inputPort.postMessage(a,d);this._MaybeCreateExtraWorker();return b}BroadcastJob(a,b,d){d||(d=[]);const c=this._nextJobId++;this._inputPort.postMessage({type:a,
isBroadcast:!0,jobId:c,params:b,transferables:d},d)}_CancelJob(a){const b=this._jobPromises.get(a);b&amp;&amp;(b.cancelled=!0,b.resolve=null,b.progress=null,b.reject=null,this._inputPort.postMessage({type:"_cancel",jobId:a}))}_OnJobWorkerMessage(a){a=a.data;const b=a.type,d=a.jobId;switch(b){case "result":this._OnJobResult(d,a.result);break;case "progress":this._OnJobProgress(d,a.progress);break;case "error":this._OnJobError(d,a.error);break;case "ready":this._OnJobWorkerReady();break;default:throw Error(`unknown message from worker '${b}'`);
}}_OnJobResult(a,b){const d=this._jobPromises.get(a);if(!d)throw Error("invalid job ID");d.cancelled||d.resolve(b);this._jobPromises.delete(a)}_OnJobProgress(a,b){a=this._jobPromises.get(a);if(!a)throw Error("invalid job ID");!a.cancelled&amp;&amp;a.progress&amp;&amp;a.progress(b)}_OnJobError(a,b){const d=this._jobPromises.get(a);if(!d)throw Error("invalid job ID");d.cancelled||d.reject(b);this._jobPromises.delete(a)}_OnJobWorkerReady(){this._isCreatingWorker&amp;&amp;(this._isCreatingWorker=!1,this._jobWorkerCount++,this._jobWorkerCount&lt;
this._maxNumWorkers?this._MaybeCreateExtraWorker():this._inputPort.postMessage({type:"_no_more_workers"}))}async _MaybeCreateExtraWorker(){if(!(this._jobWorkerCount&gt;=this._maxNumWorkers||this._isCreatingWorker||this._hadErrorCreatingWorker||this._jobPromises.size&lt;=this._jobWorkerCount))try{this._isCreatingWorker=!0,(await this._runtime.PostComponentMessageToDOMAsync("runtime","create-job-worker")).outputPort.onmessage=a=&gt;this._OnJobWorkerMessage(a)}catch(a){this._hadErrorCreatingWorker=!0,this._isCreatingWorker=
!1,console.error(`[Construct] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,a)}}};self.C3_Shaders={};"use strict";const C3$jscomp$172=self.C3;let cacheRegex=null,lastRegex="",lastFlags="",regexMatches=[],lastMatchesStr="",lastMatchesRegex="",lastMatchesFlags="";const forEachStack=C3$jscomp$172.New(C3$jscomp$172.ArrayStack);
function ForEachOrdered_SortInstances(a,b){a=a[1];b=b[1];if("number"===typeof a&amp;&amp;"number"===typeof b)return a-b;a=""+a;b=""+b;return a&lt;b?-1:a&gt;b?1:0}
C3$jscomp$172.Plugins.System=class extends C3$jscomp$172.SDKPluginBase{constructor(a){super(a);this._loopStack=this._runtime.GetEventSheetManager().GetLoopStack();this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._imagesLoadingComplete=this._imagesLoadingTotal=0;this._functionMaps=new Map}Release(){super.Release()}UpdateRender(){this._runtime.UpdateRender()}Trigger(a){this._runtime.Trigger(a,null,null)}GetRegex(a,b){cacheRegex&amp;&amp;a===lastRegex&amp;&amp;b===lastFlags||(cacheRegex=new RegExp(a,
b),lastRegex=a,lastFlags=b);cacheRegex.lastIndex=0;return cacheRegex}GetRegexMatches(a,b,d){if(a===lastMatchesStr&amp;&amp;b===lastMatchesRegex&amp;&amp;d===lastMatchesFlags)return regexMatches;const c=this.GetRegex(b,d);regexMatches=a.match(c);lastMatchesStr=a;lastMatchesRegex=b;lastMatchesFlags=d;return regexMatches}async _LoadTexturesForObjectClasses(a,b){if(b.length){this._imagesLoadingTotal+=b.length;var d=[];for(const c of b)d.push(a.MaybeLoadTexturesFor(c));await C3$jscomp$172.PromiseAllWithProgress(d,()=&gt;
{this._imagesLoadingComplete++});this._imagesLoadingComplete++;this._imagesLoadingComplete===this._imagesLoadingTotal&amp;&amp;(this._imagesLoadingTotal=this._imagesLoadingComplete=0,this._runtime.Trigger(C3$jscomp$172.Plugins.System.Cnds.OnImageLoadingComplete,null,null))}}_UnloadTexturesForObjectClasses(a,b){for(const d of b)0===d.GetInstanceCount()&amp;&amp;a.MaybeUnloadTexturesFor(d)}_GetForEachStack(){return forEachStack}_Repeat(a){var b=this._runtime.GetEventSheetManager();const d=b.GetEventStack(),c=d.GetCurrentStackFrame(),
e=c.GetCurrentEvent(),h=e.GetSolModifiers();var k=c.IsSolModifierAfterCnds();const m=d.Push(e),p=b.GetLoopStack(),q=p.Push();q.SetEnd(a);if(k)for(k=0;k&lt;a&amp;&amp;!q.IsStopped();++k)b.PushCopySol(h),q.SetIndex(k),e.Retrigger(c,m),b.PopSol(h);else for(b=0;b&lt;a&amp;&amp;!q.IsStopped();++b)q.SetIndex(b),e.Retrigger(c,m);d.Pop();p.Pop();return!1}*_DebugRepeat(a){var b=this._runtime.GetEventSheetManager();const d=b.GetEventStack(),c=d.GetCurrentStackFrame(),e=c.GetCurrentEvent(),h=e.GetSolModifiers();var k=c.IsSolModifierAfterCnds();
const m=d.Push(e),p=b.GetLoopStack(),q=p.Push();q.SetEnd(a);if(k)for(k=0;k&lt;a&amp;&amp;!q.IsStopped();++k)b.PushCopySol(h),q.SetIndex(k),yield*e.DebugRetrigger(c,m),b.PopSol(h);else for(b=0;b&lt;a&amp;&amp;!q.IsStopped();++b)q.SetIndex(b),yield*e.DebugRetrigger(c,m);d.Pop();p.Pop();return!1}_While(){var a=this._runtime.GetEventSheetManager();const b=a.GetEventStack(),d=b.GetCurrentStackFrame(),c=d.GetCurrentEvent(),e=c.GetSolModifiers();var h=d.IsSolModifierAfterCnds();const k=b.Push(c),m=a.GetLoopStack(),p=m.Push();
if(h)for(h=0;!p.IsStopped();++h)a.PushCopySol(e),p.SetIndex(h),c.Retrigger(d,k)||p.Stop(),a.PopSol(e);else for(a=0;!p.IsStopped();++a)p.SetIndex(a),c.Retrigger(d,k)||p.Stop();b.Pop();m.Pop();return!1}*_DebugWhile(){var a=this._runtime.GetEventSheetManager();const b=a.GetEventStack(),d=b.GetCurrentStackFrame(),c=d.GetCurrentEvent(),e=c.GetSolModifiers();var h=d.IsSolModifierAfterCnds();const k=b.Push(c),m=a.GetLoopStack(),p=m.Push();if(h)for(h=0;!p.IsStopped();++h)a.PushCopySol(e),p.SetIndex(h),(yield*c.DebugRetrigger(d,
k))||p.Stop(),a.PopSol(e);else for(a=0;!p.IsStopped();++a)p.SetIndex(a),(yield*c.DebugRetrigger(d,k))||p.Stop();b.Pop();m.Pop();return!1}_For(a,b,d){var c=this._runtime.GetEventSheetManager();const e=c.GetEventStack(),h=e.GetCurrentStackFrame(),k=h.GetCurrentEvent(),m=k.GetSolModifiers(),p=h.IsSolModifierAfterCnds(),q=e.Push(k),v=c.GetLoopStack(),x=v.Push();x.SetName(a);x.SetEnd(d);if(d&lt;b)if(p)for(a=b;a&gt;=d&amp;&amp;!x.IsStopped();--a)c.PushCopySol(m),x.SetIndex(a),k.Retrigger(h,q),c.PopSol(m);else for(c=
b;c&gt;=d&amp;&amp;!x.IsStopped();--c)x.SetIndex(c),k.Retrigger(h,q);else if(p)for(a=b;a&lt;=d&amp;&amp;!x.IsStopped();++a)c.PushCopySol(m),x.SetIndex(a),k.Retrigger(h,q),c.PopSol(m);else for(c=b;c&lt;=d&amp;&amp;!x.IsStopped();++c)x.SetIndex(c),k.Retrigger(h,q);e.Pop();v.Pop();return!1}*_DebugFor(a,b,d){var c=this._runtime.GetEventSheetManager();const e=c.GetEventStack(),h=e.GetCurrentStackFrame(),k=h.GetCurrentEvent(),m=k.GetSolModifiers(),p=h.IsSolModifierAfterCnds(),q=e.Push(k),v=c.GetLoopStack(),x=v.Push();x.SetName(a);x.SetEnd(d);
if(d&lt;b)if(p)for(a=b;a&gt;=d&amp;&amp;!x.IsStopped();--a)c.PushCopySol(m),x.SetIndex(a),yield*k.DebugRetrigger(h,q),c.PopSol(m);else for(c=b;c&gt;=d&amp;&amp;!x.IsStopped();--c)x.SetIndex(c),yield*k.DebugRetrigger(h,q);else if(p)for(a=b;a&lt;=d&amp;&amp;!x.IsStopped();++a)c.PushCopySol(m),x.SetIndex(a),yield*k.DebugRetrigger(h,q),c.PopSol(m);else for(c=b;c&lt;=d&amp;&amp;!x.IsStopped();++c)x.SetIndex(c),yield*k.DebugRetrigger(h,q);e.Pop();v.Pop();return!1}_ForEach(a){var b=this._runtime.GetEventSheetManager();const d=b.GetEventStack(),c=d.GetCurrentStackFrame(),
e=c.GetCurrentEvent(),h=e.GetSolModifiers();var k=c.IsSolModifierAfterCnds();const m=d.Push(e),p=b.GetLoopStack(),q=p.Push(),v=a.IsInContainer(),x=a.GetCurrentSol(),A=forEachStack.Push();C3$jscomp$172.shallowAssignArray(A,x.GetInstances());q.SetEnd(A.length);if(k)for(let C=0,D=A.length;C&lt;D&amp;&amp;!q.IsStopped();++C)b.PushCopySol(h),k=A[C],a.GetCurrentSol().SetSinglePicked(k),v&amp;&amp;k.SetSiblingsSinglePicked(),q.SetIndex(C),e.Retrigger(c,m),b.PopSol(h);else{x._SetSelectAll(!1);a=x._GetOwnInstances();C3$jscomp$172.clearArray(a);
a.push(null);for(let C=0,D=A.length;C&lt;D&amp;&amp;!q.IsStopped();++C)b=A[C],a[0]=b,v&amp;&amp;b.SetSiblingsSinglePicked(),q.SetIndex(C),e.Retrigger(c,m)}d.Pop();p.Pop();C3$jscomp$172.clearArray(A);forEachStack.Pop();return!1}*_DebugForEach(a){var b=this._runtime.GetEventSheetManager();const d=b.GetEventStack(),c=d.GetCurrentStackFrame(),e=c.GetCurrentEvent(),h=e.GetSolModifiers();var k=c.IsSolModifierAfterCnds();const m=d.Push(e),p=b.GetLoopStack(),q=p.Push(),v=a.IsInContainer(),x=a.GetCurrentSol(),A=forEachStack.Push();
C3$jscomp$172.shallowAssignArray(A,x.GetInstances());q.SetEnd(A.length);if(k)for(let C=0,D=A.length;C&lt;D&amp;&amp;!q.IsStopped();++C)b.PushCopySol(h),k=A[C],a.GetCurrentSol().SetSinglePicked(k),v&amp;&amp;k.SetSiblingsSinglePicked(),q.SetIndex(C),yield*e.DebugRetrigger(c,m),b.PopSol(h);else{x._SetSelectAll(!1);a=x._GetOwnInstances();C3$jscomp$172.clearArray(a);a.push(null);for(let C=0,D=A.length;C&lt;D&amp;&amp;!q.IsStopped();++C)b=A[C],a[0]=b,v&amp;&amp;b.SetSiblingsSinglePicked(),q.SetIndex(C),yield*e.DebugRetrigger(c,m)}d.Pop();
p.Pop();C3$jscomp$172.clearArray(A);forEachStack.Pop();return!1}_ForEachOrdered(a,b){var d=this._runtime.GetEventSheetManager();const c=d.GetEventStack(),e=d.GetCurrentCondition(),h=c.GetCurrentStackFrame(),k=h.GetCurrentEvent(),m=k.GetSolModifiers(),p=h.IsSolModifierAfterCnds(),q=c.Push(k),v=d.GetLoopStack(),x=v.Push(),A=a.IsInContainer(),C=a.GetCurrentSol(),D=forEachStack.Push();C3$jscomp$172.clearArray(D);const G=C.GetInstances();x.SetEnd(G.length);for(let E=0,J=G.length;E&lt;J;++E)D.push([G[E],e.ReevaluateParameter(1,
E)]);D.sort(ForEachOrdered_SortInstances);1===b&amp;&amp;D.reverse();if(p)for(let E=0,J=D.length;E&lt;J&amp;&amp;!x.IsStopped();++E)d.PushCopySol(m),b=D[E][0],a.GetCurrentSol().SetSinglePicked(b),A&amp;&amp;b.SetSiblingsSinglePicked(),x.SetIndex(E),k.Retrigger(h,q),d.PopSol(m);else{C._SetSelectAll(!1);a=C._GetOwnInstances();C3$jscomp$172.clearArray(a);a.push(null);for(let E=0,J=D.length;E&lt;J&amp;&amp;!x.IsStopped();++E)d=D[E][0],a[0]=d,A&amp;&amp;d.SetSiblingsSinglePicked(),x.SetIndex(E),k.Retrigger(h,q)}c.Pop();v.Pop();C3$jscomp$172.clearArray(D);
forEachStack.Pop();return!1}*_DebugForEachOrdered(a,b){var d=this._runtime.GetEventSheetManager();const c=d.GetEventStack(),e=d.GetCurrentCondition(),h=c.GetCurrentStackFrame(),k=h.GetCurrentEvent(),m=k.GetSolModifiers(),p=h.IsSolModifierAfterCnds(),q=c.Push(k),v=d.GetLoopStack(),x=v.Push(),A=a.IsInContainer(),C=a.GetCurrentSol(),D=forEachStack.Push();C3$jscomp$172.clearArray(D);const G=C.GetInstances();x.SetEnd(G.length);for(let E=0,J=G.length;E&lt;J;++E)D.push([G[E],e.ReevaluateParameter(1,E)]);D.sort(ForEachOrdered_SortInstances);
1===b&amp;&amp;D.reverse();if(p)for(let E=0,J=D.length;E&lt;J&amp;&amp;!x.IsStopped();++E)d.PushCopySol(m),b=D[E][0],a.GetCurrentSol().SetSinglePicked(b),A&amp;&amp;b.SetSiblingsSinglePicked(),x.SetIndex(E),yield*k.DebugRetrigger(h,q),d.PopSol(m);else{C._SetSelectAll(!1);a=C._GetOwnInstances();C3$jscomp$172.clearArray(a);a.push(null);for(let E=0,J=D.length;E&lt;J&amp;&amp;!x.IsStopped();++E)d=D[E][0],a[0]=d,A&amp;&amp;d.SetSiblingsSinglePicked(),x.SetIndex(E),yield*k.DebugRetrigger(h,q)}c.Pop();v.Pop();C3$jscomp$172.clearArray(D);forEachStack.Pop();
return!1}_GetFunctionMap(a,b){let d=this._functionMaps.get(a);if(d)return d;if(!b)return null;d={defaultFunc:null,strMap:new Map};this._functionMaps.set(a,d);return d}_DoCallMappedFunction(a,b,d,c,e){b.GetEventBlock().RunAsMappedFunctionCall(d,b.IsCopyPicked());c&amp;&amp;a.PopSol(e)}*_DebugDoCallMappedFunction(a,b,d,c,e){yield*b.GetEventBlock().DebugRunAsMappedFunctionCall(d,b.IsCopyPicked());c&amp;&amp;a.PopSol(e)}};const C3$jscomp$173=self.C3;
C3$jscomp$173.Plugins.System.Type=class extends C3$jscomp$173.DefendedBase{constructor(a){super();this._objectClass=a;this._runtime=a.GetRuntime();this._plugin=a.GetPlugin()}OnCreate(){}Release(){this._plugin=this._runtime=this._objectClass=null}};const C3$jscomp$174=self.C3;
C3$jscomp$174.Plugins.System.Instance=class extends C3$jscomp$174.DefendedBase{constructor(a,b){super();this._inst=a;this._objectClass=this._inst.GetObjectClass();this._sdkType=this._objectClass.GetSdkType();this._runtime=this._inst.GetRuntime()}Release(){this._runtime=this._sdkType=this._objectClass=this._inst=null}};const C3$jscomp$175=self.C3,tmpPickArray=[];
C3$jscomp$175.Plugins.System.Cnds={EveryTick(){return!0},OnLayoutStart(){return!0},OnLayoutEnd(){return!0},OnSuspend(){return!0},OnResume(){return!0},IsSuspended(){return this._runtime.IsSuspended()},Else(){const a=this._runtime.GetCurrentEventStackFrame();return a.GetElseBranchRan()?!1:!a.GetLastEventTrue()},TriggerOnce(){const a=this._runtime.GetCurrentCondition().GetSavedDataMap();let b=a.get("TriggerOnce_lastTick");"undefined"===typeof b&amp;&amp;(b=-1,a.set("TriggerOnce_lastTick",-1));const d=this._runtime.GetTickCount();
a.set("TriggerOnce_lastTick",d);return this._runtime.IsLayoutFirstTick()||b!==d-1},Every(a){const b=this._runtime.GetCurrentCondition().GetSavedDataMap(),d=b.get("Every_lastTime")||0,c=this._runtime.GetGameTime();b.has("Every_seconds")||b.set("Every_seconds",a);const e=b.get("Every_seconds");if(c&gt;=d+e)return b.set("Every_lastTime",d+e),c&gt;=b.get("Every_lastTime")+.04&amp;&amp;b.set("Every_lastTime",c),b.set("Every_seconds",a),!0;c&lt;d-.1&amp;&amp;b.set("Every_lastTime",c);return!1},IsGroupActive(a){return(a=this._runtime.GetEventSheetManager().GetEventGroupByName(a))&amp;&amp;
a.IsGroupActive()},IsPreview(){return this._runtime.IsPreview()},IsMobile(){return C3$jscomp$175.Platform.IsMobile},OnLoadFinished(){return!0},OnCanvasSnapshot(){return!0},EffectsSupported(){return!0},OnSaveComplete(){return!0},OnSaveFailed(){return!0},OnLoadComplete(){return!0},OnLoadFailed(){return!0},ObjectUIDExists(a){return!!this._runtime.GetInstanceByUID(a)},IsOnPlatform(a){switch(a){case 0:return"browser"===C3$jscomp$175.Platform.Context;case 1:return"iOS"===C3$jscomp$175.Platform.OS;case 2:return"Android"===
C3$jscomp$175.Platform.OS;case 8:return"cordova"===C3$jscomp$175.Platform.Context;case 9:return"scirra-arcade"===this._runtime.GetExportType();case 10:return"nwjs"===C3$jscomp$175.Platform.Context;case 13:return"windows-uwp"===this._runtime.GetExportType();default:return!1}},RegexTest(a,b,d){return this.GetRegex(b,d).test(a)},Compare(a,b,d){return C3$jscomp$175.compare(a,b,d)},CompareBetween(a,b,d){return a&gt;=b&amp;&amp;a&lt;=d},CompareVar(a,b,d){return C3$jscomp$175.compare(a.GetValue(),b,d)},CompareBoolVar(a){return!!a.GetValue()},
CompareTime(a,b){const d=this._runtime.GetGameTime();return 0===a?(a=this._runtime.GetCurrentCondition().GetSavedDataMap(),!a.get("CompareTime_executed")&amp;&amp;d&gt;=b?(a.set("CompareTime_executed",!0),!0):!1):C3$jscomp$175.compare(d,a,b)},IsNaN(a){return isNaN(a)},AngleWithin(a,b,d){return C3$jscomp$175.angleDiff(C3$jscomp$175.toRadians(a),C3$jscomp$175.toRadians(d))&lt;=C3$jscomp$175.toRadians(b)},IsClockwiseFrom(a,b){return C3$jscomp$175.angleClockwise(C3$jscomp$175.toRadians(a),C3$jscomp$175.toRadians(b))},
IsBetweenAngles(a,b,d){a=C3$jscomp$175.toRadians(a);b=C3$jscomp$175.toRadians(b);d=C3$jscomp$175.toRadians(d);return C3$jscomp$175.angleClockwise(d,b)?C3$jscomp$175.angleClockwise(a,b)&amp;&amp;!C3$jscomp$175.angleClockwise(a,d):!(!C3$jscomp$175.angleClockwise(a,b)&amp;&amp;C3$jscomp$175.angleClockwise(a,d))},IsValueType(a,b){return"number"===typeof a?0===b:1===b},EvaluateExpression(a){return!!a},PickByComparison(a,b,d,c){if(!a)return!1;const e=this._GetForEachStack(),h=e.Push(),k=a.GetCurrentSol();C3$jscomp$175.shallowAssignArray(h,
k.GetInstances());k.IsSelectAll()&amp;&amp;C3$jscomp$175.clearArray(k._GetOwnElseInstances());const m=this._runtime.GetCurrentCondition();let p=0;for(let q=0,v=h.length;q&lt;v;++q){const x=h[q];h[p]=x;b=m.ReevaluateParameter(1,q);c=m.ReevaluateParameter(3,q);C3$jscomp$175.compare(b,d,c)?++p:k._PushElseInstance(x)}C3$jscomp$175.truncateArray(h,p);k.SetArrayPicked(h);b=!!h.length;C3$jscomp$175.clearArray(h);e.Pop();a.ApplySolToContainer();return b},PickByEvaluate(a,b){if(!a)return!1;const d=this._GetForEachStack(),
c=d.Push(),e=a.GetCurrentSol();C3$jscomp$175.shallowAssignArray(c,e.GetInstances());e.IsSelectAll()&amp;&amp;C3$jscomp$175.clearArray(e._GetOwnElseInstances());const h=this._runtime.GetCurrentCondition();let k=0;for(let m=0,p=c.length;m&lt;p;++m){const q=c[m];c[k]=q;(b=h.ReevaluateParameter(1,m))?++k:e._PushElseInstance(q)}C3$jscomp$175.truncateArray(c,k);e.SetArrayPicked(c);b=!!c.length;C3$jscomp$175.clearArray(c);d.Pop();a.ApplySolToContainer();return b},PickNth(a,b){if(!a)return!1;const d=a.GetCurrentSol(),
c=d.GetInstances();b=Math.floor(b);if(b&gt;=c.length)return!1;d.PickOne(c[b]);a.ApplySolToContainer();return!0},PickRandom(a){if(!a)return!1;const b=a.GetCurrentSol(),d=b.GetInstances(),c=Math.floor(this._runtime.Random()*d.length);if(c&gt;=d.length)return!1;b.PickOne(d[c]);a.ApplySolToContainer();return!0},PickAll(a){if(!a||!a.GetInstanceCount())return!1;a.GetCurrentSol()._SetSelectAll(!0);a.ApplySolToContainer();return!0},PickOverlappingPoint(a,b,d){if(!a)return!1;const c=a.GetCurrentSol();var e=c.GetInstances();
const h=this._runtime.GetCurrentEvent().IsOrBlock(),k=this._runtime.GetCurrentCondition().IsInverted();c.IsSelectAll()?(C3$jscomp$175.shallowAssignArray(tmpPickArray,e),c.ClearArrays(),c._SetSelectAll(!1)):h?(C3$jscomp$175.shallowAssignArray(tmpPickArray,c._GetOwnElseInstances()),C3$jscomp$175.clearArray(c._GetOwnElseInstances())):(C3$jscomp$175.shallowAssignArray(tmpPickArray,c._GetOwnInstances()),C3$jscomp$175.clearArray(c._GetOwnInstances()));for(let m=0,p=tmpPickArray.length;m&lt;p;++m)e=tmpPickArray[m],
C3$jscomp$175.xor(e.GetWorldInfo().ContainsPoint(b,d),k)?c._PushInstance(e):c._PushElseInstance(e);a.ApplySolToContainer();return C3$jscomp$175.xor(!!c._GetOwnInstances().length,k)},PickLastCreated(a){if(!a)return!1;var b=a.IsFamily();let d=null;const c=this._runtime._GetInstancesPendingCreate();for(let e=c.length-1;0&lt;=e;--e){const h=c[e];if(b){if(h.GetObjectClass().BelongsToFamily(a)){d=h;break}}else if(h.GetObjectClass()===a){d=h;break}}d||(b=a.GetInstances(),b.length&amp;&amp;(d=b.at(-1)));if(!d)return!1;
a.GetCurrentSol().PickOne(d);a.ApplySolToContainer();return!0},Repeat(a){return this._runtime.IsDebugging()?this._DebugRepeat(a):this._Repeat(a)},While(){return this._runtime.IsDebugging()?this._DebugWhile():this._While()},For(a,b,d){return this._runtime.IsDebugging()?this._DebugFor(a,b,d):this._For(a,b,d)},ForEach(a){return this._runtime.IsDebugging()?this._DebugForEach(a):this._ForEach(a)},ForEachOrdered(a,b,d){return this._runtime.IsDebugging()?this._DebugForEachOrdered(a,d):this._ForEachOrdered(a,
d)},LayerVisible(a){return a?a.IsVisible():!1},LayerInteractive(a){return a?a.IsSelfAndParentsInteractive():!1},LayerEmpty(a){return a?!a.GetInstanceCount():!1},LayerCmpOpacity(a,b,d){return a?C3$jscomp$175.compare(100*a.GetOpacity(),b,d):!1},OnImageLoadingComplete(){return!0},IsLoadingImages(){return 0&lt;this._imagesLoadingTotal},TemplateExists(a,b){const d=this._runtime.GetTemplateManager();return d&amp;&amp;b?!!d.GetTemplateData(a,b):!1}};const C3$jscomp$176=self.C3;
function SortZOrderList$jscomp$1(a,b){const d=a[0]-b[0];return 0!==d?d:a[1]-b[1]}function SortInstancesByValue(a,b){return a[1]-b[1]}const tempZOrderList$jscomp$1=[],tempInstValues=[],tempRect$jscomp$9=C3$jscomp$176.New(C3$jscomp$176.Rect),tempColor$jscomp$7=C3$jscomp$176.New(C3$jscomp$176.Color);
C3$jscomp$176.Plugins.System.Acts={SetVar(a,b){a.SetValue(b)},AddVar(a,b){a.IsNumber()&amp;&amp;"number"!==typeof b&amp;&amp;(b=parseFloat(b));a.SetValue(a.GetValue()+b)},SubVar(a,b){a.IsNumber()&amp;&amp;a.SetValue(a.GetValue()-b)},SetBoolVar(a,b){a.SetValue(!!b)},ToggleBoolVar(a){a.SetValue(!a.GetValue())},ResetGlobals(){this._runtime.GetEventSheetManager().ResetAllGlobalsToInitialValue()},CreateObject(a,b,d,c,e,h){if(a&amp;&amp;b&amp;&amp;(d=this._runtime.CreateInstance(a,b,d,c,e,h))){e&amp;&amp;b.SortAndAddInstancesByZIndex(d);b=this._runtime.GetEventSheetManager();
b.BlockFlushingInstances(!0);d._TriggerOnCreatedOnSelfAndRelated();b.BlockFlushingInstances(!1);b=new Map;d.CollectInstancesToPick(b,a,e);for(const [k,m]of b)k.GetCurrentSol().SetSetPicked(m)}},CreateObjectByName(a,b,d,c,e,h){a&amp;&amp;b&amp;&amp;(a=this._runtime.GetObjectClassByName(a))&amp;&amp;C3$jscomp$176.Plugins.System.Acts.CreateObject.call(this,a,b,d,c,e,h)},RecreateInitialObjects(a,b,d,c,e,h,k,m,p,q){if(a){var v=this._runtime.GetCurrentLayout();if(h&amp;&amp;(v=this._runtime.GetLayoutManager().GetLayoutByName(h),!v))return;
h=null;if("number"!==typeof k||0&lt;=k)if(h=v.GetLayer(k),!h)return;tempRect$jscomp$9.set(b,d,c,e);b=v.RecreateInitialObjects(a,tempRect$jscomp$9,h,m,p,q);a.GetCurrentSol().SetArrayPicked(b);a.ApplySolToContainer()}},StopLoop(){const a=this._loopStack;a.IsInLoop()&amp;&amp;a.GetCurrent().Stop()},SetGroupActive(a,b){(a=this._runtime.GetEventSheetManager().GetEventGroupByName(a))&amp;&amp;(0===b?a.SetGroupActive(!1):1===b?a.SetGroupActive(!0):a.SetGroupActive(!a.IsGroupActive()))},SetTimescale(a){this._runtime.SetTimeScale(a)},
SetObjectTimescale(a,b){0&gt;b&amp;&amp;(b=0);if(a){a=a.GetCurrentSol().GetInstances();for(const d of a)d.SetTimeScale(b)}},RestoreObjectTimescale(a){if(a){a=a.GetCurrentSol().GetInstances();for(const b of a)b.RestoreTimeScale()}},Wait(a){if(!(0&gt;a))return this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(a),!0},WaitForSignal(a){this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(a);return!0},WaitForPreviousActions(){const a=this._runtime.GetEventSheetManager();a.AddScheduledWait().InitPromise(a.GetPromiseForAllAsyncActions());
return!0},Signal(a){a=a.toLowerCase();for(const b of this._runtime.GetEventSheetManager().scheduledWaits())b.IsSignal()&amp;&amp;b.GetSignalTag()===a&amp;&amp;b.SetSignalled()},async SnapshotCanvas(a,b,d,c,e,h){const k=this._runtime.GetCanvasManager();k&amp;&amp;(this.UpdateRender(),await k.SnapshotCanvas(0===a?"image/png":"image/jpeg",b/100,d,c,e,h),await this._runtime.TriggerAsync(C3$jscomp$176.Plugins.System.Cnds.OnCanvasSnapshot,null))},SetCanvasSize(a,b){if(!(0&gt;=a||0&gt;=b)){this._runtime.SetViewportSize(a,b);this._runtime.GetCurrentLayout().BoundScrolling();
var d=this._runtime.GetCanvasManager();d&amp;&amp;("off"!==d.GetCurrentFullscreenMode()&amp;&amp;this._runtime.SetOriginalViewportSize(a,b),d.SetSize(d.GetLastWidth(),d.GetLastHeight(),!0),this._runtime.UpdateRender())}},SetFullscreenQuality(a){const b=this._runtime.GetCanvasManager();b&amp;&amp;"off"!==b.GetCurrentFullscreenMode()&amp;&amp;(b.SetFullscreenScalingQuality(0!==a?"high":"low"),b.SetSize(b.GetLastWidth(),b.GetLastHeight(),!0))},SaveState(a){this._runtime.SaveToSlot(a)},LoadState(a){this._runtime.LoadFromSlot(a)},LoadStateJSON(a){this._runtime.LoadFromJsonString(a)},
SetHalfFramerateMode(a){},ResetPersisted(){for(const a of this._runtime.GetLayoutManager().GetAllLayouts())a.ResetPersistData()},SetPixelRounding(a){this._runtime.SetPixelRoundingEnabled(0!==a)},SetMinimumFramerate(a){this._runtime.SetMinimumFramerate(a)},SortZOrderByInstVar(a,b){if(a){var d=a.GetCurrentSol().GetInstances(),c=this._runtime.GetCurrentLayout(),e=a.IsFamily();a=a.GetFamilyIndex();for(let k=0,m=d.length;k&lt;m;++k){var h=d[k];const p=h.GetWorldInfo();if(!p)continue;let q;q=e?h.GetInstanceVariableValue(b+
h.GetObjectClass().GetFamilyInstanceVariableOffset(a)):h.GetInstanceVariableValue(b);tempZOrderList$jscomp$1.push([p.GetLayer().GetIndex(),p.GetZIndex()]);tempInstValues.push([h,q])}if(tempZOrderList$jscomp$1.length){tempZOrderList$jscomp$1.sort(SortZOrderList$jscomp$1);tempInstValues.sort(SortInstancesByValue);b=!1;for(let k=0,m=tempZOrderList$jscomp$1.length;k&lt;m;++k)d=tempInstValues[k][0],e=c.GetLayerByIndex(tempZOrderList$jscomp$1[k][0]),a=tempZOrderList$jscomp$1[k][1],h=e._GetInstances(),h[a]!==
d&amp;&amp;(h[a]=d,d.GetWorldInfo()._SetLayer(e),e.SetZIndicesChanged(),b=!0);b&amp;&amp;this._runtime.UpdateRender();C3$jscomp$176.clearArray(tempZOrderList$jscomp$1);C3$jscomp$176.clearArray(tempInstValues)}}},GoToLayout(a){if(!this._runtime.IsLoading()){var b=this._runtime.GetLayoutManager();b.IsPendingChangeMainLayout()||b.ChangeMainLayout(a)}},GoToLayoutByName(a){if(!this._runtime.IsLoading()){var b=this._runtime.GetLayoutManager();b.IsPendingChangeMainLayout()||(a=b.GetLayoutByName(a))&amp;&amp;b.ChangeMainLayout(a)}},
NextPrevLayout(a){if(!this._runtime.IsLoading()){var b=this._runtime.GetLayoutManager();if(!b.IsPendingChangeMainLayout()){var d=b.GetAllLayouts(),c=d.indexOf(b.GetMainRunningLayout());a&amp;&amp;0===c||(a||c!==d.length-1)&amp;&amp;b.ChangeMainLayout(d[c+(a?-1:1)])}}},RestartLayout(){if(!this._runtime.IsLoading()){var a=this._runtime.GetLayoutManager();a.IsPendingChangeMainLayout()||(a.ChangeMainLayout(a.GetMainRunningLayout()),this._runtime.GetEventSheetManager().ResetAllGroupsInitialActivation())}},SetLayerVisible(a,
b){a&amp;&amp;a.SetVisible(b)},SetLayerInteractive(a,b){a&amp;&amp;a.SetInteractive(b)},SetLayerOpacity(a,b){a&amp;&amp;a.SetOpacity(b/100)},SetLayerScale(a,b){a&amp;&amp;a.SetOwnScale(b)},SetLayerScaleRate(a,b){a&amp;&amp;a.SetScaleRate(b)},SetLayerAngle(a,b){a&amp;&amp;a.SetAngle(C3$jscomp$176.toRadians(+b))},SetLayerScroll(a,b,d){a&amp;&amp;(a.SetOwnScrollPositionEnabled(!0),a.SetScrollX(b),a.SetScrollY(d))},RestoreLayerScroll(a){a&amp;&amp;a.SetOwnScrollPositionEnabled(!1)},SetLayerParallax(a,b,d){a&amp;&amp;a.SetParallax(b/100,d/100)},SetLayerZElevation(a,b){a&amp;&amp;
a.SetZElevation(+b)},SetLayerBackground(a,b){a&amp;&amp;(tempColor$jscomp$7.setFromRgbValue(b),tempColor$jscomp$7.clamp(),a=a.GetBackgroundColor(),a.equalsIgnoringAlpha(tempColor$jscomp$7)||(a.copyRgb(tempColor$jscomp$7),this.UpdateRender()))},SetLayerTransparent(a,b){a&amp;&amp;a.SetTransparent(b)},SetLayerBlendMode(a,b){a&amp;&amp;a.SetBlendMode(b)},SetLayerEffectEnabled(a,b,d){a&amp;&amp;(d=a.GetEffectList().GetEffectTypeByName(d))&amp;&amp;(b=1===b,d.IsActive()!==b&amp;&amp;(d.SetActive(b),a.UpdateActiveEffects(),this._runtime.UpdateRender()))},
SetLayerEffectParam(a,b,d,c){if(a&amp;&amp;(a=a.GetEffectList(),b=a.GetEffectTypeByName(b))){d=Math.floor(d);var e=b.GetShaderProgram().GetParameterType(d);e&amp;&amp;("color"===e?(tempColor$jscomp$7.setFromRgbValue(c),c=tempColor$jscomp$7):"percent"===e&amp;&amp;(c/=100),a.SetEffectParameter(b.GetIndex(),d,c)&amp;&amp;b.IsActive()&amp;&amp;this._runtime.UpdateRender())}},SetLayerForceOwnTexture(a,b){a&amp;&amp;a.SetForceOwnTexture(b)},SetLayoutScale(a){this._runtime.GetCurrentLayout().SetScale(+a)},SetLayoutAngle(a){this._runtime.GetCurrentLayout().SetAngle(C3$jscomp$176.toRadians(+a))},
SetLayoutEffectEnabled(a,b){const d=this._runtime.GetCurrentLayout();if(b=d.GetEffectList().GetEffectTypeByName(b))a=1===a,b.IsActive()!==a&amp;&amp;(b.SetActive(a),d.UpdateActiveEffects(),this._runtime.UpdateRender())},SetLayoutEffectParam(a,b,d){const c=this._runtime.GetCurrentLayout().GetEffectList();if(a=c.GetEffectTypeByName(a)){b=Math.floor(b);var e=a.GetShaderProgram().GetParameterType(b);e&amp;&amp;("color"===e?(tempColor$jscomp$7.setFromRgbValue(d),d=tempColor$jscomp$7):"percent"===e&amp;&amp;(d/=100),c.SetEffectParameter(a.GetIndex(),
b,d)&amp;&amp;a.IsActive()&amp;&amp;this._runtime.UpdateRender())}},SetLayoutVanishingPoint(a,b){this._runtime.GetCurrentLayout().SetVanishingPointXY(a/100,b/100)},SetLayoutProjection(a){const b=this._runtime.GetCurrentLayout();0===a?b.SetPerspectiveProjection():b.SetOrthographicProjection()},ScrollX(a){this._runtime.GetCurrentLayout().SetScrollX(a)},ScrollY(a){this._runtime.GetCurrentLayout().SetScrollY(a)},Scroll(a,b){const d=this._runtime.GetCurrentLayout();d.SetScrollX(a);d.SetScrollY(b)},ScrollToObject(a){if(a&amp;&amp;
(a=a.GetFirstPicked())&amp;&amp;(a=a.GetWorldInfo())){var b=this._runtime.GetCurrentLayout();b.SetScrollX(a.GetX());b.SetScrollY(a.GetY())}},async LoadObjectTextures(a){const b=this._runtime.GetMainRunningLayout();b&amp;&amp;a&amp;&amp;!this._runtime.IsLoading()&amp;&amp;(a=a.IsFamily()?a.GetFamilyMembers():[a],await this._LoadTexturesForObjectClasses(b,a))},async LoadObjectTexturesByName(a){await C3$jscomp$176.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(a))},UnloadObjectTextures(a){const b=
this._runtime.GetMainRunningLayout();b&amp;&amp;a&amp;&amp;(a=a.IsFamily()?a.GetFamilyMembers():[a],this._UnloadTexturesForObjectClasses(b,a))},UnloadObjectTexturesByName(a){C3$jscomp$176.Plugins.System.Acts.UnloadObjectTextures.call(this,this._runtime.GetObjectClassByName(a))},UnloadUnusedTextures(){const a=this._runtime.GetMainRunningLayout();if(a){var b=a._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(a,b)}},async LoadLayoutTextures(a){const b=this._runtime.GetMainRunningLayout();a&amp;&amp;b&amp;&amp;!this._runtime.IsLoading()&amp;&amp;
await this._LoadTexturesForObjectClasses(b,a._GetInitialObjectClasses())},async LoadLayoutTexturesByName(a){const b=this._runtime.GetMainRunningLayout();(a=this._runtime.GetLayoutManager().GetLayoutByName(a))&amp;&amp;b&amp;&amp;!this._runtime.IsLoading()&amp;&amp;await this._LoadTexturesForObjectClasses(b,a._GetInitialObjectClasses())},SetFunctionReturnValue(a){const b=this._eventStack.GetCurrentExpFuncStackFrame();if(b)switch(b.GetFunctionReturnType()){case 1:"number"===typeof a&amp;&amp;b.SetFunctionReturnValue(a);break;case 2:"string"===
typeof a&amp;&amp;b.SetFunctionReturnValue(a);break;case 3:b.SetFunctionReturnValue(a)}},MapFunction(a,b,d){var c=this._GetFunctionMap(a.toLowerCase(),!0);const e=c.strMap,h=b.toLowerCase();e.has(h)&amp;&amp;console.warn(`[Construct] Function map '${a}' string '${b}' already in map; overwriting entry`);if(c=C3$jscomp$176.first(e.values())||c.defaultFunc){c=0!==c.GetReturnType();const k=0!==d.GetReturnType();if(c!==k){console.error(`[Construct] Function map '${a}' string '${b}' function return type not compatible with other functions in the map; entry ignored`);
return}}e.set(h,d)},MapFunctionDefault(a,b){const d=this._GetFunctionMap(a.toLowerCase(),!0);d.defaultFunc&amp;&amp;console.warn(`[Construct] Function map '${a}' already has a default; overwriting entry`);var c=C3$jscomp$176.first(d.strMap.values())||d.defaultFunc;if(c){c=0!==c.GetReturnType();const e=0!==b.GetReturnType();if(c!==e){console.error(`[Construct] Function map '${a}' default: function return type not compatible with other functions in the map; entry ignored`);return}}d.defaultFunc=b},CallMappedFunction(a,
b,d){d=Math.floor(d);var c=this._GetFunctionMap(a.toLowerCase(),!1);if(c){var e=c.strMap.get(b.toLowerCase());if(!e)if(c.defaultFunc)e=c.defaultFunc,d=0;else{console.warn(`[Construct] Call mapped function: no function associated with map '${a}' string '${b}'; call ignored (consider setting a default)`);return}if(e.IsEnabled())if(0!==e.GetReturnType())console.warn(`[Construct] Call mapped function: map '${a}' string '${b}' has a return type so cannot be called`);else{a=this._runtime;b=a.GetEventSheetManager();
var h=b.GetCurrentEvent();c=h.GetSolModifiersIncludingParents();var k=0&lt;c.length;k&amp;&amp;(e.IsCopyPicked()?b.PushCopySol(c):b.PushCleanSol(c));var m=[];if(h=b.FindFirstFunctionBlockParent(h)){h=h.GetFunctionParameters();for(let p=d,q=h.length;p&lt;q;++p)m.push(h[p].GetValue())}d=e.GetFunctionParameters();for(let p=m.length,q=d.length;p&lt;q;++p)m.push(d[p].GetInitialValue());return a.IsDebugging()?this._DebugDoCallMappedFunction(b,e,m,k,c):this._DoCallMappedFunction(b,e,m,k,c)}}else console.warn(`[Construct] Call mapped function: map name '${a}' not found; call ignored`)}};
const C3$jscomp$177=self.C3;
C3$jscomp$177.Plugins.System.Exps={int:function(a){"string"===typeof a&amp;&amp;(a=parseInt(a,10),isNaN(a)&amp;&amp;(a=0));return Math.floor(a)},float:function(a){"string"===typeof a&amp;&amp;(a=parseFloat(a),isNaN(a)&amp;&amp;(a=0));return a},str(a){return a.toString()},len(a){return"string"===typeof a?a.length:0},random(a,b){return"undefined"===typeof b?this._runtime.Random()*a:this._runtime.Random()*(b-a)+a},choose(...a){const b=Math.floor(this._runtime.Random()*a.length);return a[b]},pi(){return Math.PI},infinity(){return Infinity},
sqrt(a){return Math.sqrt(a)},abs(a){return Math.abs(a)},round(a){return Math.round(a)},roundtodp(a,b){b=Math.max(Math.floor(b),0);b=Math.pow(10,b);return Math.round((a+Number.EPSILON)*b)/b},floor(a){return Math.floor(a)},ceil(a){return Math.ceil(a)},sign(a){return Math.sign(a)},sin(a){return Math.sin(C3$jscomp$177.toRadians(a))},cos(a){return Math.cos(C3$jscomp$177.toRadians(a))},tan(a){return Math.tan(C3$jscomp$177.toRadians(a))},asin(a){return C3$jscomp$177.toDegrees(Math.asin(a))},acos(a){return C3$jscomp$177.toDegrees(Math.acos(a))},
atan(a){return C3$jscomp$177.toDegrees(Math.atan(a))},exp(a){return Math.exp(a)},ln(a){return Math.log(a)},log10(a){return Math.log(a)/Math.LN10},max(...a){let b=a[0];"number"!==typeof b&amp;&amp;(b=0);for(let d=1,c=a.length;d&lt;c;++d){let e=a[d];"number"===typeof e&amp;&amp;b&lt;e&amp;&amp;(b=e)}return b},min(...a){let b=a[0];"number"!==typeof b&amp;&amp;(b=0);for(let d=1,c=a.length;d&lt;c;++d){let e=a[d];"number"===typeof e&amp;&amp;b&gt;e&amp;&amp;(b=e)}return b},clamp(a,b,d){return C3$jscomp$177.clamp(a,b,d)},distance(a,b,d,c){return C3$jscomp$177.distanceTo(a,
b,d,c)},angle(a,b,d,c){return C3$jscomp$177.toDegrees(C3$jscomp$177.angleTo(a,b,d,c))},lerp(a,b,d){return C3$jscomp$177.lerp(a,b,d)},unlerp(a,b,d){return C3$jscomp$177.unlerp(a,b,d)},qarp(a,b,d,c){return C3$jscomp$177.qarp(a,b,d,c)},cubic(a,b,d,c,e){return C3$jscomp$177.cubic(a,b,d,c,e)},cosp(a,b,d){return C3$jscomp$177.cosp(a,b,d)},anglediff(a,b){return C3$jscomp$177.toDegrees(C3$jscomp$177.angleDiff(C3$jscomp$177.toRadians(a),C3$jscomp$177.toRadians(b)))},anglelerp(a,b,d){return C3$jscomp$177.toDegrees(C3$jscomp$177.angleLerp(C3$jscomp$177.toRadians(a),
C3$jscomp$177.toRadians(b),d))},anglerotate(a,b,d){return C3$jscomp$177.toDegrees(C3$jscomp$177.angleRotate(C3$jscomp$177.toRadians(a),C3$jscomp$177.toRadians(b),C3$jscomp$177.toRadians(d)))},setbit(a,b,d){b|=0;return(a|0)&amp;~(1&lt;&lt;b)|(0!==d?1:0)&lt;&lt;b},togglebit(a,b){return(a|0)^1&lt;&lt;(b|0)},getbit(a,b){return(a|0)&amp;1&lt;&lt;(b|0)?1:0},newline(){return"\n"},uppercase(a){return"string"===typeof a?a.toUpperCase():""},lowercase(a){return"string"===typeof a?a.toLowerCase():""},left(a,b){return"string"===typeof a?a.substr(0,
b):""},mid(a,b,d){return"string"!==typeof a?"":0&gt;d?a.substr(b):a.substr(b,d)},right(a,b){return"string"===typeof a?a.substr(Math.max(a.length-b,0)):""},trim(a){return"string"===typeof a?a.trim():""},tokenat(a,b,d){if("string"!==typeof a||"string"!==typeof d)return"";a=a.split(d);b=Math.floor(b);return 0&gt;b||b&gt;=a.length?"":a[b]},tokencount(a,b){return"string"===typeof a&amp;&amp;"string"===typeof b&amp;&amp;a.length?a.split(b).length:0},find(a,b){return"string"===typeof a&amp;&amp;"string"===typeof b?a.search(new RegExp(C3$jscomp$177.EscapeRegex(b),
"i")):-1},findcase(a,b){return"string"===typeof a&amp;&amp;"string"===typeof b?a.search(new RegExp(C3$jscomp$177.EscapeRegex(b),"")):-1},replace(a,b,d){return"string"===typeof a&amp;&amp;"string"===typeof b&amp;&amp;"string"===typeof d?a.replace(new RegExp(C3$jscomp$177.EscapeRegex(b),"gi"),d):"string"===typeof a?a:""},regexsearch(a,b,d){b=this.GetRegex(b,d);return a?a.search(b):-1},regexreplace(a,b,d,c){b=this.GetRegex(b,d);return a?a.replace(b,c):""},regexmatchcount(a,b,d){return(a=this.GetRegexMatches(a.toString(),b,
d))?a.length:0},regexmatchat(a,b,d,c){c=Math.floor(c);a=this.GetRegexMatches(a.toString(),b,d);return!a||0&gt;c||c&gt;=a.length?"":a[c]},zeropad(a,b){let d=0&gt;a?"-":"";0&gt;a&amp;&amp;(a=-a);d+="0".repeat(Math.max(b-a.toString().length,0));return d+a.toString()},urlencode(a){return encodeURIComponent(a)},urldecode(a){return decodeURIComponent(a)},dt(){return this._runtime._GetDtFast()},timescale(){return this._runtime.GetTimeScale()},wallclocktime(){return(Date.now()-this._runtime.GetStartTime())/1E3},unixtime(){return Date.now()},
time(){return this._runtime.GetGameTime()},tickcount(){return this._runtime.GetTickCount()},objectcount(){return this._runtime.GetObjectCount()},fps(){return this._runtime.GetFPS()},cpuutilisation(){return this._runtime.GetMainThreadTime()},gpuutilisation(){return this._runtime.GetGPUUtilisation()},windowwidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},windowheight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},originalwindowwidth(){return this._runtime.GetOriginalViewportWidth()},
originalwindowheight(){return this._runtime.GetOriginalViewportHeight()},originalviewportwidth(){return this._runtime.GetOriginalViewportWidth()},originalviewportheight(){return this._runtime.GetOriginalViewportHeight()},scrollx(){return this._runtime.GetCurrentLayout().GetScrollX()},scrolly(){return this._runtime.GetCurrentLayout().GetScrollY()},layoutname(){return this._runtime.GetCurrentLayout().GetName()},layoutscale(){return this._runtime.GetCurrentLayout().GetScale()},layoutangle(){return C3$jscomp$177.toDegrees(this._runtime.GetCurrentLayout().GetAngle())},
layoutwidth(){return this._runtime.GetCurrentLayout().GetWidth()},layoutheight(){return this._runtime.GetCurrentLayout().GetHeight()},vanishingpointx(){return 100*this._runtime.GetCurrentLayout().GetVanishingPointX()},vanishingpointy(){return 100*this._runtime.GetCurrentLayout().GetVanishingPointY()},viewportleft(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getLeft():0},viewporttop(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getTop():
0},viewportright(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getRight():0},viewportbottom(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().getBottom():0},viewportwidth(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().width():0},viewportheight(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetViewport3D().height():0},canvastolayerx(a,b,d){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.CanvasCssToLayer(b,
d)[0]:0},canvastolayery(a,b,d){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.CanvasCssToLayer(b,d)[1]:0},layertocanvasx(a,b,d){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.LayerToCanvasCss(b,d)[0]:0},layertocanvasy(a,b,d){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.LayerToCanvasCss(b,d)[1]:0},layerscale(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetOwnScale():0},layerangle(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?C3$jscomp$177.toDegrees(a.GetOwnAngle()):
0},layeropacity(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?100*a.GetOpacity():0},layerscalerate(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScaleRate():0},layerscrollx(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScrollX():0},layerscrolly(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetScrollY():0},layerparallaxx(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?100*a.GetParallaxX():0},layerparallaxy(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?
100*a.GetParallaxY():0},layerzelevation(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetZElevation():0},layerindex(a){return(a=this._runtime.GetCurrentLayout().GetLayer(a))?a.GetIndex():-1},canvassnapshot(){const a=this._runtime.GetCanvasManager();return a?a.GetCanvasSnapshotUrl():""},loopindex(a){const b=this._loopStack;return b.IsInLoop()?a?(a=b.FindByName(a))?a.GetIndex():0:b.GetCurrent().GetIndex():0},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(a,b,
...d){var c=this._GetFunctionMap(a.toLowerCase(),!1);if(!c)return console.warn(`[Construct] Call mapped function: map name '${a}' not found; returning 0`),0;let e=c.strMap.get(b.toLowerCase());if(!e)if(c.defaultFunc)e=c.defaultFunc;else return console.warn(`[Construct] Call mapped function: no function associated with map '${a}' string '${b}'; returning 0 (consider setting a default)`),0;c=e.GetReturnType();const h=e.GetDefaultReturnValue();if(0===c)return console.warn(`[Construct] Call mapped function: map '${a}' string '${b}' has no return type so cannot be called from an expression; returning 0`),
0;if(!e.IsEnabled())return h;a=this._runtime.GetEventSheetManager();b=a.GetCurrentEvent().GetSolModifiersIncludingParents();const k=0&lt;b.length;k&amp;&amp;(e.IsCopyPicked()?a.PushCopySol(b):a.PushCleanSol(b));var m=e.GetFunctionParameters();for(let p=d.length,q=m.length;p&lt;q;++p)d.push(m[p].GetInitialValue());m=e.GetEventBlock();d=m.RunAsExpressionFunctionCall(m.GetSolModifiersIncludingParents(),e.IsCopyPicked(),c,h,...d);k&amp;&amp;a.PopSol(b);return d},loadingprogress(){return this._runtime.GetAssetManager().GetLoadProgress()},
imageloadingprogress(){return 0===this._imagesLoadingTotal?1:this._imagesLoadingComplete/this._imagesLoadingTotal},renderer(){return this._runtime.GetWebGPURenderer()?"webgpu":"webgl"},rendererdetail(){return this._runtime.GetWebGPURenderer()?"&lt;unavailable&gt;":this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},imagememoryusage(){let a=this._runtime.GetRenderer().GetEstimatedTextureMemoryUsage();return Math.round(100*a/1048576)/100},rgb(a,b,d){return C3$jscomp$177.PackRGB(a,b,d)},rgbex(a,b,d){return C3$jscomp$177.PackRGBEx(a/
100,b/100,d/100)},rgba(a,b,d,c){return C3$jscomp$177.PackRGBAEx(a/100,b/100,d/100,c/100)},rgbex255(a,b,d){return C3$jscomp$177.PackRGBEx(a/255,b/255,d/255)},rgba255(a,b,d,c){return C3$jscomp$177.PackRGBAEx(a/255,b/255,d/255,c/255)},projectname(){return this._runtime.GetProjectName()},projectversion(){return this._runtime.GetProjectVersion()},currenteventsheetname(){return this._runtime.GetCurrentEvent().GetEventSheet().GetName()},currenteventnumber(){return this._runtime.GetCurrentEvent().GetDisplayNumber()}};
"use strict";const C3$jscomp$178=self.C3;C3$jscomp$178.Plugins.Sprite=class extends C3$jscomp$178.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$179=self.C3,spawnPickStack=[];
C3$jscomp$179.Plugins.Sprite.Type=class extends C3$jscomp$179.SDKTypeBase{constructor(a){super(a);this._animations=a.GetAnimations()}Release(){C3$jscomp$179.clearArray(this._animations);super.Release()}OnCreate(){for(const a of this._animations)a.LoadAllAssets(this._runtime)}LoadTextures(a){const b={sampling:this._runtime.GetSampling()};return Promise.all(this._animations.map(d=&gt;d.LoadAllTextures(a,b)))}ReleaseTextures(){for(const a of this._animations)a.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const a of this._objectClass.instancesIncludingPendingCreate())a.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(a){C3$jscomp$179.Plugins.Sprite.FinishCollisionCondition(this,
a)}BeforeRunAction(a){spawnPickStack.push({objectClass:null,createHierarchy:!1,instances:[]})}_SpawnPickInstance(a,b,d){const c=spawnPickStack.at(-1);c.objectClass=a;c.createHierarchy=d;c.instances.push(b)}AfterRunAction(a){a=spawnPickStack.pop();const b=a.objectClass,d=a.createHierarchy;if(b){var c=new Map;for(const e of a.instances)e.CollectInstancesToPick(c,b,d);for(const [e,h]of c)e.GetCurrentSol().SetSetPicked(h)}}};
const C3$jscomp$180=self.C3,C3X$jscomp$18=self.C3X,tempRect$jscomp$10=C3$jscomp$180.New(C3$jscomp$180.Rect),tempQuad$jscomp$6=C3$jscomp$180.New(C3$jscomp$180.Quad),tempVec2$jscomp$1=C3$jscomp$180.New(C3$jscomp$180.Vector2),FLAG_PLAYING_FORWARDS=1,FLAG_ANIMATION_PLAYING=2,FLAG_ANIMATION_TRIGGER=4;
C3$jscomp$180.Plugins.Sprite.Instance=class extends C3$jscomp$180.SDKWorldInstanceBase{constructor(a,b){super(a);let d=!0,c="",e=0,h=!0;b&amp;&amp;(d=!!b[0],c=b[1],e=b[2],h=b[3]);this._currentAnimation=this._objectClass.GetAnimationByName(c)||this._objectClass.GetAnimations()[0];this._currentFrameIndex=C3$jscomp$180.clamp(e,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);b=this._currentAnimationFrame.GetImageInfo();this._currentTexture=
b.GetTexture();this._currentRcTex=b.GetTexRect();this._currentQuadTex=b.GetTexQuad();this.HandleWebGLContextLoss();a.SetFlag(FLAG_ANIMATION_PLAYING,!0);a.SetFlag(FLAG_PLAYING_FORWARDS,0&lt;=this._currentAnimation.GetSpeed());this._currentAnimationSpeed=Math.abs(this._currentAnimation.GetSpeed());this._currentAnimationRepeatTo=this._currentAnimation.GetRepeatTo();this._animationTimer=C3$jscomp$180.New(C3$jscomp$180.KahanSum);this._animationRepeats=this._frameStartTime=0;this._animTriggerName="";this._changeAnimFrameIndex=
-1;this._changeAnimationName="";this._changeAnimationFrom=0;a=this.GetWorldInfo();this._bquadRef=a.GetBoundingQuad();a.SetVisible(d);a.SetCollisionEnabled(h);a.SetOriginX(this._currentAnimationFrame.GetOriginX());a.SetOriginY(this._currentAnimationFrame.GetOriginY());a.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly());a.SetBboxChanged();1===this._objectClass.GetAnimationCount()&amp;&amp;1===this._objectClass.GetAnimations()[0].GetFrameCount()||0===this._currentAnimationSpeed||this._StartTicking()}Release(){this._animationTimer=
this._currentTexture=this._currentAnimationFrame=this._currentAnimation=null;super.Release()}GetCurrentImageInfo(){return this._currentAnimationFrame.GetImageInfo()}IsOriginalSizeKnown(){return!0}OnWebGLContextLost(){this._currentTexture=null}OnWebGLContextRestored(){this._UpdateCurrentTexture()}Draw(a){var b=this._currentTexture;null!==b&amp;&amp;(a.SetTexture(b),b=this.GetWorldInfo(),b.HasMesh()?this._DrawMesh(b,a):this._DrawStandard(b,a))}_DrawStandard(a,b){let d=this._bquadRef;this._runtime.IsPixelRoundingEnabled()&amp;&amp;
(d=a.PixelRoundQuad(d));b.Quad4(d,this._currentQuadTex)}_DrawMesh(a,b){const d=a.GetTransformedMesh();if(a.IsMeshChanged()){a.CalculateBbox(tempRect$jscomp$10,tempQuad$jscomp$6,!1);let c=tempQuad$jscomp$6;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(c=a.PixelRoundQuad(c));d.CalculateTransformedMesh(a.GetSourceMesh(),c,this._currentQuadTex);a.SetMeshChanged(!1)}d.Draw(b)}GetAnimationTime(){return this._animationTimer.Get()}IsAnimationPlaying(){return this._inst.GetFlag(FLAG_ANIMATION_PLAYING)}SetAnimationPlaying(a){this._inst.SetFlag(FLAG_ANIMATION_PLAYING,
a)}IsPlayingForwards(){return this._inst.GetFlag(FLAG_PLAYING_FORWARDS)}SetPlayingForwards(a){this._inst.SetFlag(FLAG_PLAYING_FORWARDS,a)}IsInAnimationTrigger(){return this._inst.GetFlag(FLAG_ANIMATION_TRIGGER)}SetInAnimationTrigger(a){this._inst.SetFlag(FLAG_ANIMATION_TRIGGER,a)}Tick(){this._changeAnimationName&amp;&amp;this._DoChangeAnimation();0&lt;=this._changeAnimFrameIndex&amp;&amp;this._DoChangeAnimFrame();const a=this._currentAnimationSpeed;if(this.IsAnimationPlaying()&amp;&amp;0!==a){var b=this._runtime.GetDt(this._inst);
this._animationTimer.Add(b);b=this.GetAnimationTime();var d=this._currentAnimationFrame,c=d.GetDuration()/a;if(!(b&lt;this._frameStartTime+c)){var e=this._currentAnimation,h=this._currentAnimationRepeatTo,k=e.GetFrameCount(),m=e.GetRepeatCount(),p=e.IsLooping(),q=e.IsPingPong();this.IsPlayingForwards()?this._currentFrameIndex++:this._currentFrameIndex--;this._frameStartTime+=c;this._currentFrameIndex&gt;=k&amp;&amp;(q?(this.SetPlayingForwards(!1),this._currentFrameIndex=k-2):p?this._currentFrameIndex=h:(this._animationRepeats++,
this._animationRepeats&gt;=m?this._FinishAnimation(!1):this._currentFrameIndex=h));0&gt;this._currentFrameIndex&amp;&amp;(q?(this._currentFrameIndex=1,this.SetPlayingForwards(!0),p||(this._animationRepeats++,this._animationRepeats&gt;=m&amp;&amp;this._FinishAnimation(!0))):p?this._currentFrameIndex=h:(this._animationRepeats++,this._animationRepeats&gt;=m?this._FinishAnimation(!0):this._currentFrameIndex=h));this._currentFrameIndex=C3$jscomp$180.clamp(this._currentFrameIndex,0,k-1);c=e.GetFrameAt(this._currentFrameIndex);b&gt;this._frameStartTime+
c.GetDuration()/a&amp;&amp;(this._frameStartTime=b);this._OnFrameChanged(d,c)}}else this._StopTicking()}_FinishAnimation(a){this._currentFrameIndex=a?0:this._currentAnimation.GetFrameCount()-1;this.SetAnimationPlaying(!1);this._animTriggerName=this._currentAnimation.GetName();this.SetInAnimationTrigger(!0);this.DispatchScriptEvent("animationend",!1,{animationName:this._animTriggerName});this.Trigger(C3$jscomp$180.Plugins.Sprite.Cnds.OnAnyAnimFinished);this.Trigger(C3$jscomp$180.Plugins.Sprite.Cnds.OnAnimFinished);
this.SetInAnimationTrigger(!1);this._animationRepeats=0}_OnFrameChanged(a,b){if(a!==b){var d=this.GetWorldInfo(),c=a.GetImageInfo(),e=b.GetImageInfo(),h=c.GetWidth();c=c.GetHeight();var k=e.GetWidth(),m=e.GetHeight();h!==k&amp;&amp;d.SetWidth(d.GetWidth()*(k/h));c!==m&amp;&amp;d.SetHeight(d.GetHeight()*(m/c));d.SetOriginX(b.GetOriginX());d.SetOriginY(b.GetOriginY());d.SetSourceCollisionPoly(b.GetCollisionPoly());d.SetBboxChanged();this._currentAnimationFrame=b;this._currentTexture=e.GetTexture();this._currentRcTex=
e.GetTexRect();this._currentQuadTex=e.GetTexQuad();d=this.GetInstance().GetBehaviorInstances();for(let p=0,q=d.length;p&lt;q;++p)d[p].OnSpriteFrameChanged(a,b);this.DispatchScriptEvent("framechange",!1,{animationName:this._currentAnimation.GetName(),animationFrame:this._currentFrameIndex});this.Trigger(C3$jscomp$180.Plugins.Sprite.Cnds.OnFrameChanged);this._runtime.UpdateRender()}}_StartAnim(a){this.SetAnimationPlaying(!0);this._frameStartTime=this.GetAnimationTime();1===a&amp;&amp;0!==this._currentFrameIndex&amp;&amp;
(this._changeAnimFrameIndex=0,this.IsInAnimationTrigger()||this._DoChangeAnimFrame());this._StartTicking()}_SetAnim(a,b){this._changeAnimationName=a;this._changeAnimationFrom=b;this._StartTicking();this.IsInAnimationTrigger()||this._DoChangeAnimation()}_GetCurrentAnimation(){return this._currentAnimation}_GetCurrentAnimationName(){return this._changeAnimationName?this._changeAnimationName:this._currentAnimation.GetName()}_SetAnimFrame(a){isFinite(a)&amp;&amp;(this._changeAnimFrameIndex=a,this.IsInAnimationTrigger()||
this._DoChangeAnimFrame())}_GetAnimFrame(){return this._currentFrameIndex}_SetAnimSpeed(a){this._currentAnimationSpeed=Math.abs(a);this.SetPlayingForwards(0&lt;=a);0&lt;this._currentAnimationSpeed&amp;&amp;this._StartTicking()}_GetAnimSpeed(){return this.IsPlayingForwards()?this._currentAnimationSpeed:-this._currentAnimationSpeed}_SetAnimRepeatToFrame(a){this._currentAnimationRepeatTo=a=C3$jscomp$180.clamp(Math.floor(a),0,this._currentAnimation.GetFrameCount()-1)}_GetAnimRepeatToFrame(){return this._currentAnimationRepeatTo}_DoChangeAnimation(){const a=
this._currentAnimationFrame;var b=this._objectClass.GetAnimationByName(this._changeAnimationName);this._changeAnimationName="";!b||b===this._currentAnimation&amp;&amp;this.IsAnimationPlaying()||(this._currentAnimation=b,this.SetPlayingForwards(0&lt;=b.GetSpeed()),this._currentAnimationSpeed=Math.abs(b.GetSpeed()),this._currentAnimationRepeatTo=b.GetRepeatTo(),this._currentFrameIndex=C3$jscomp$180.clamp(this._currentFrameIndex,0,this._currentAnimation.GetFrameCount()-1),1===this._changeAnimationFrom&amp;&amp;(this._currentFrameIndex=
0),this.SetAnimationPlaying(!0),this._frameStartTime=this.GetAnimationTime(),b=this._currentAnimation.GetFrameAt(this._currentFrameIndex),this._OnFrameChanged(a,b))}_DoChangeAnimFrame(){const a=this._currentAnimationFrame;var b=this._currentFrameIndex;this._currentFrameIndex=C3$jscomp$180.clamp(Math.floor(this._changeAnimFrameIndex),0,this._currentAnimation.GetFrameCount()-1);this._changeAnimFrameIndex=-1;b!==this._currentFrameIndex&amp;&amp;(b=this._currentAnimation.GetFrameAt(this._currentFrameIndex),this._OnFrameChanged(a,
b),this._frameStartTime=this.GetAnimationTime())}_UpdateCurrentTexture(){const a=this._currentAnimationFrame.GetImageInfo();this._currentTexture=a.GetTexture();this._currentRcTex=a.GetTexRect();this._currentQuadTex=a.GetTexQuad();this.GetWorldInfo().SetMeshChanged(!0)}GetTexture(){return this._currentTexture}GetTexRect(){return this._currentRcTex}GetTexQuad(){return this._currentQuadTex}GetImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()}GetImagePoint(a){const b=this._currentAnimationFrame,
d=this.GetWorldInfo();if("string"===typeof a)a=b.GetImagePointByName(a);else if("number"===typeof a)a=b.GetImagePointByIndex(a-1);else throw new TypeError("expected string or number");if(!a)return[d.GetX(),d.GetY()];tempVec2$jscomp$1.copy(a.GetVec2());if(d.HasMesh()){const [c,e]=d.GetSourceMesh().TransformPoint(tempVec2$jscomp$1.getX(),tempVec2$jscomp$1.getY());tempVec2$jscomp$1.set(c,e)}tempVec2$jscomp$1.offset(-b.GetOriginX(),-b.GetOriginY());tempVec2$jscomp$1.scale(d.GetWidth(),d.GetHeight());
tempVec2$jscomp$1.rotate(d.GetAngle());tempVec2$jscomp$1.offset(d.GetX(),d.GetY());return[tempVec2$jscomp$1.getX(),tempVec2$jscomp$1.getY()]}GetCollisionPolyPointCount(){return this.GetWorldInfo().GetTransformedCollisionPoly().pointCount()}GetCollisionPolyPoint(a){a=Math.floor(a);const b=this.GetWorldInfo();var d=b.GetTransformedCollisionPoly();const c=d.pointCount();a===c&amp;&amp;(a=0);if(0&gt;a||a&gt;=c)return[0,0];d=d.pointsArr();return[d[2*a]+b.GetX(),d[2*a+1]+b.GetY()]}GetDebuggerProperties(){const a=C3$jscomp$180.Plugins.Sprite.Acts;
return[{title:"plugins.sprite.debugger.animation-properties.title",properties:[{name:"plugins.sprite.debugger.animation-properties.current-animation",value:this._currentAnimation.GetName(),onedit:b=&gt;this.CallAction(a.SetAnim,b,0)},{name:"plugins.sprite.debugger.animation-properties.current-frame",value:this._currentFrameIndex,onedit:b=&gt;this.CallAction(a.SetAnimFrame,b)},{name:"plugins.sprite.debugger.animation-properties.is-playing",value:this.IsAnimationPlaying(),onedit:b=&gt;b?this.CallAction(a.StartAnim,
0):this.CallAction(a.StopAnim)},{name:"plugins.sprite.debugger.animation-properties.speed",value:this._currentAnimationSpeed,onedit:b=&gt;this.CallAction(a.SetAnimSpeed,b)},{name:"plugins.sprite.debugger.animation-properties.repeats",value:this._animationRepeats,onedit:b=&gt;this._animationRepeats=b}]}]}SaveToJson(){const a={a:this._currentAnimation.GetSID()};0!==this._frameStartTime&amp;&amp;(a.fs=this._frameStartTime);var b=this.GetAnimationTime();0!==b&amp;&amp;(a.at=b);0!==this._currentFrameIndex&amp;&amp;(a.f=this._currentFrameIndex);
0!==this._currentAnimationSpeed&amp;&amp;(a.cas=this._currentAnimationSpeed);1!==this._animationRepeats&amp;&amp;(a.ar=this._animationRepeats);0!==this._currentAnimationRepeatTo&amp;&amp;(a.rt=this._currentAnimationRepeatTo);this.IsAnimationPlaying()||(a.ap=this.IsAnimationPlaying());this.IsPlayingForwards()||(a.af=this.IsPlayingForwards());b=this.GetWorldInfo();b.IsCollisionEnabled()&amp;&amp;(a.ce=b.IsCollisionEnabled());return a}LoadFromJson(a){var b=this.GetObjectClass().GetAnimationBySID(a.a);b&amp;&amp;(this._currentAnimation=b);
this._frameStartTime=a.hasOwnProperty("fs")?a.fs:0;this._animationTimer.Set(a.hasOwnProperty("at")?a.at:0);b=a.hasOwnProperty("f")?a.f:0;this._currentFrameIndex=C3$jscomp$180.clamp(b,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationSpeed=a.hasOwnProperty("cas")?a.cas:0;this._animationRepeats=a.hasOwnProperty("ar")?a.ar:1;b=a.hasOwnProperty("rt")?a.rt:0;this._currentAnimationRepeatTo=C3$jscomp$180.clamp(b,0,this._currentAnimation.GetFrameCount()-1);this.SetAnimationPlaying(a.hasOwnProperty("ap")?
!!a.ap:!0);this.SetPlayingForwards(a.hasOwnProperty("af")?!!a.af:!0);this._currentAnimationFrame=b=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._UpdateCurrentTexture();const d=this.GetWorldInfo();d.SetOriginX(b.GetOriginX());d.SetOriginY(b.GetOriginY());d.SetSourceCollisionPoly(b.GetCollisionPoly());d.SetCollisionEnabled(!!a.ce);this.IsAnimationPlaying()&amp;&amp;this._StartTicking()}GetPropertyValueByIndex(a){const b=this.GetWorldInfo();switch(a){case 3:return b.IsCollisionEnabled();case 2:return C3$jscomp$180.clamp(this._currentFrameIndex,
0,this._currentAnimation.GetFrameCount()-1)}}SetPropertyValueByIndex(a,b){var d=this.GetWorldInfo();switch(a){case 3:d.SetCollisionEnabled(!!b);break;case 2:this.SetAnimationPlaying(!1);a=this._currentAnimation.GetFrameCount()-1;d=b=C3$jscomp$180.clamp(b,0,a);b=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const c=this._currentAnimation.GetFrameAt(d);this._OnFrameChanged(b,c);this._currentFrameIndex=C3$jscomp$180.clamp(d,0,a)}}GetScriptInterfaceClass(){return self.ISpriteInstance}};
const map$jscomp$19=new WeakMap,ANIM_FROM_MODES=new Map([["current-frame",0],["beginning",1]]);
self.ISpriteInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$19.set(this,self.IInstance._GetInitInst().GetSdkInstance())}getImagePointCount(){return map$jscomp$19.get(this).GetImagePointCount()}getImagePointX(a){if("string"!==typeof a&amp;&amp;"number"!==typeof a)throw new TypeError("expected string or number");return map$jscomp$19.get(this).GetImagePoint(a)[0]}getImagePointY(a){if("string"!==typeof a&amp;&amp;"number"!==typeof a)throw new TypeError("expected string or number");return map$jscomp$19.get(this).GetImagePoint(a)[1]}getImagePoint(a){if("string"!==
typeof a&amp;&amp;"number"!==typeof a)throw new TypeError("expected string or number");return map$jscomp$19.get(this).GetImagePoint(a)}getPolyPointCount(){return map$jscomp$19.get(this).GetCollisionPolyPointCount()}getPolyPointX(a){C3X$jscomp$18.RequireFiniteNumber(a);return map$jscomp$19.get(this).GetCollisionPolyPoint(a)[0]}getPolyPointY(a){C3X$jscomp$18.RequireFiniteNumber(a);return map$jscomp$19.get(this).GetCollisionPolyPoint(a)[1]}getPolyPoint(a){C3X$jscomp$18.RequireFiniteNumber(a);return map$jscomp$19.get(this).GetCollisionPolyPoint(a)}stopAnimation(){map$jscomp$19.get(this).SetAnimationPlaying(!1)}startAnimation(a=
"current-frame"){C3X$jscomp$18.RequireString(a);a=ANIM_FROM_MODES.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$19.get(this)._StartAnim(a)}setAnimation(a,b="beginning"){C3X$jscomp$18.RequireString(a);C3X$jscomp$18.RequireString(b);b=ANIM_FROM_MODES.get(b);if("undefined"===typeof b)throw Error("invalid mode");const d=map$jscomp$19.get(this);if(!d.GetObjectClass().GetAnimationByName(a))throw Error(`animation name "${a}" does not exist`);d._SetAnim(a,b)}getAnimation(a){C3X$jscomp$18.RequireString(a);
return(a=map$jscomp$19.get(this).GetObjectClass().GetAnimationByName(a))?a.GetIAnimation():null}get animation(){return map$jscomp$19.get(this)._GetCurrentAnimation().GetIAnimation()}get animationName(){return map$jscomp$19.get(this)._GetCurrentAnimationName()}set animationFrame(a){C3X$jscomp$18.RequireFiniteNumber(a);map$jscomp$19.get(this)._SetAnimFrame(a)}get animationFrame(){return map$jscomp$19.get(this)._GetAnimFrame()}set animationSpeed(a){C3X$jscomp$18.RequireFiniteNumber(a);map$jscomp$19.get(this)._SetAnimSpeed(a)}get animationSpeed(){return map$jscomp$19.get(this)._GetAnimSpeed()}set animationRepeatToFrame(a){C3X$jscomp$18.RequireFiniteNumber(a);
map$jscomp$19.get(this)._SetAnimRepeatToFrame(a)}get animationRepeatToFrame(){return map$jscomp$19.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return map$jscomp$19.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return map$jscomp$19.get(this).GetCurrentImageInfo().GetHeight()}setSolidCollisionFilter(a,b){C3X$jscomp$18.RequireString(b);map$jscomp$19.get(this).GetWorldInfo().SetSolidCollisionFilter(!!a,b)}};const C3$jscomp$181=self.C3;
C3$jscomp$181.Plugins.Sprite.Cnds={IsAnimPlaying(a){return C3$jscomp$181.equalsNoCase(this._GetCurrentAnimationName(),a)},CompareFrame(a,b){return C3$jscomp$181.compare(this._currentFrameIndex,a,b)},CompareAnimSpeed(a,b){return C3$jscomp$181.compare(this._GetAnimSpeed(),a,b)},OnAnimFinished(a){return C3$jscomp$181.equalsNoCase(this._animTriggerName,a)},OnAnyAnimFinished(){return!0},OnFrameChanged(){return!0},IsMirrored(){return 0&gt;this.GetWorldInfo().GetWidth()},IsFlipped(){return 0&gt;this.GetWorldInfo().GetHeight()},
OnURLLoaded(){return!0},OnURLFailed(){return!0},IsCollisionEnabled(){return this.GetWorldInfo().IsCollisionEnabled()}};const C3$jscomp$182=self.C3;
C3$jscomp$182.Plugins.Sprite.Acts={Spawn(a,b,d,c){if(a&amp;&amp;b){var [e,h]=this.GetImagePoint(d);if(d=this._runtime.CreateInstance(a,b,e,h,c))c&amp;&amp;b.SortAndAddInstancesByZIndex(d),a.GetPlugin().IsRotatable()&amp;&amp;(b=d.GetWorldInfo(),b.SetAngle(this.GetWorldInfo().GetAngle()),b.SetBboxChanged()),b=this._runtime.GetEventSheetManager(),b.BlockFlushingInstances(!0),d._TriggerOnCreatedOnSelfAndRelated(),b.BlockFlushingInstances(!1),a!==this.GetObjectClass()&amp;&amp;this._sdkType._SpawnPickInstance(a,d,c)}},StopAnim(){this.SetAnimationPlaying(!1)},
StartAnim(a){this._StartAnim(a)},SetAnim(a,b){this._SetAnim(a,b)},SetAnimFrame(a){this._SetAnimFrame(a)},SetAnimSpeed(a){this._SetAnimSpeed(a)},SetAnimRepeatToFrame(a){this._SetAnimRepeatToFrame(a)},SetMirrored(a){const b=this.GetWorldInfo(),d=b.GetWidth();a=Math.abs(d)*(0===a?-1:1);d!==a&amp;&amp;(b.SetWidth(a),b.SetBboxChanged())},SetFlipped(a){const b=this.GetWorldInfo(),d=b.GetHeight();a=Math.abs(d)*(0===a?-1:1);d!==a&amp;&amp;(b.SetHeight(a),b.SetBboxChanged())},SetScale(a){const b=this._currentAnimationFrame.GetImageInfo(),
d=this.GetWorldInfo();var c=0&gt;d.GetWidth()?-1:1;const e=0&gt;d.GetHeight()?-1:1;c*=b.GetWidth()*a;a=b.GetHeight()*a*e;if(d.GetWidth()!==c||d.GetHeight()!==a)d.SetSize(c,a),d.SetBboxChanged()},async LoadURL(a,b,d){d=this._currentAnimationFrame.GetImageInfo();const c=this.GetWorldInfo(),e=this._runtime;if(d.GetURL()===a)0===b&amp;&amp;(c.SetSize(d.GetWidth(),d.GetHeight()),c.SetBboxChanged()),this.Trigger(C3$jscomp$182.Plugins.Sprite.Cnds.OnURLLoaded);else{var h=C3$jscomp$182.New(C3$jscomp$182.ImageInfo);try{await h.LoadDynamicAsset(e,
a);if(!h.IsLoaded())throw Error("image failed to load");await h.LoadStaticTexture(e.GetRenderer(),{sampling:this._runtime.GetSampling()})}catch(k){console.error("Load image from URL failed: ",k);this.Trigger(C3$jscomp$182.Plugins.Sprite.Cnds.OnURLFailed);return}d.ReplaceWith(h);this._sdkType._UpdateAllCurrentTexture();this.WasReleased()||0!==b||(c.SetSize(d.GetWidth(),d.GetHeight()),c.SetBboxChanged());e.UpdateRender();this.WasReleased()||await this.TriggerAsync(C3$jscomp$182.Plugins.Sprite.Cnds.OnURLLoaded)}},
SetCollisions(a){this.GetWorldInfo().SetCollisionEnabled(a)},SetSolidCollisionFilter(a,b){this.GetWorldInfo().SetSolidCollisionFilter(0===a,b)},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()}};
self.C3.Plugins.Sprite.Exps={AnimationFrame(){return this._currentFrameIndex},AnimationFrameCount(){return this._currentAnimation.GetFrameCount()},AnimationName(){return this._currentAnimation.GetName()},AnimationSpeed(){return this._GetAnimSpeed()},OriginalAnimationSpeed(){return this._currentAnimation.GetSpeed()},ImagePointX(a){return this.GetImagePoint(a)[0]},ImagePointY(a){return this.GetImagePoint(a)[1]},ImagePointCount(){return this.GetImagePointCount()},ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},
ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},PolyPointXAt(a){return this.GetCollisionPolyPoint(a)[0]},PolyPointYAt(a){return this.GetCollisionPolyPoint(a)[1]},PolyPointCount(){return this.GetCollisionPolyPointCount()}};"use strict";const C3$jscomp$184=self.C3;C3$jscomp$184.Plugins.Text=class extends C3$jscomp$184.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$185=self.C3;C3$jscomp$185.Plugins.Text.Type=class extends C3$jscomp$185.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}LoadTextures(a){}ReleaseTextures(){}};
const C3$jscomp$186=self.C3,C3X$jscomp$19=self.C3X,TEMP_COLOR_ARRAY$jscomp$1=[0,0,0],HORIZONTAL_ALIGNMENTS=["left","center","right"],VERTICAL_ALIGNMENTS=["top","center","bottom"],tempRect$jscomp$11=new C3$jscomp$186.Rect,tempQuad$jscomp$7=new C3$jscomp$186.Quad,tempColor$jscomp$8=new C3$jscomp$186.Color;
C3$jscomp$186.Plugins.Text.Instance=class extends C3$jscomp$186.SDKWorldInstanceBase{constructor(a,b){super(a);this._text="";this._enableBBcode=!0;this._faceName="Arial";this._ptSize=12;this._lineHeightOffset=0;this._isItalic=this._isBold=!1;this._color=C3$jscomp$186.New(C3$jscomp$186.Color);this._verticalAlign=this._horizontalAlign=0;this._wrapByWord=!0;this._typewriterEndTime=this._typewriterStartTime=-1;this._typewriterLength=0;this._rendererText=C3$jscomp$186.New(C3$jscomp$186.Gfx.RendererText,
this._runtime.GetRenderer(),{timeout:5});this._rendererText.ontextureupdate=()=&gt;this._runtime.UpdateRender();this._rendererText.SetIsAsync(!1);b&amp;&amp;(this._text=b[0],this._enableBBcode=!!b[1],this._faceName=b[2],this._ptSize=b[3],this._lineHeightOffset=b[4],this._isBold=!!b[5],this._isItalic=!!b[6],this._horizontalAlign=b[8],this._verticalAlign=b[9],this._wrapByWord=0===b[10],a=b[7],this._color.setRgb(a[0],a[1],a[2]),this.GetWorldInfo().SetVisible(b[11]));this._UpdateTextSettings()}Release(){this._CancelTypewriter();
this._rendererText.Release();this._rendererText=null;super.Release()}_UpdateTextSettings(){const a=this._rendererText;a.SetText(this._text);a.SetBBCodeEnabled(this._enableBBcode);a.SetFontName(this._faceName);a.SetLineHeight(this._lineHeightOffset);a.SetBold(this._isBold);a.SetItalic(this._isItalic);a.SetColor(this._color);a.SetHorizontalAlignment(HORIZONTAL_ALIGNMENTS[this._horizontalAlign]);a.SetVerticalAlignment(VERTICAL_ALIGNMENTS[this._verticalAlign]);a.SetWordWrapMode(this._wrapByWord?"word":
"character")}_UpdateTextSize(){const a=this.GetWorldInfo();this._rendererText.SetFontSize(this._ptSize);this._rendererText.SetFontSizeScale(a.GetSceneGraphScale());var b=a.GetLayer();b=b.GetRenderScale()*b.Get2DScaleFactorToZ(a.GetTotalZElevation());this._rendererText.SetSize(a.GetWidth(),a.GetHeight(),b)}Draw(a){var b=this.GetWorldInfo();this._UpdateTextSize();const d=this._rendererText.GetTexture();if(d){var c=b.GetLayer();if(0===b.GetAngle()&amp;&amp;0===c.GetAngle()&amp;&amp;0===b.GetTotalZElevation()&amp;&amp;!b.HasMesh()&amp;&amp;
c.RendersIn2DMode()){b=b.GetBoundingQuad();const [e,h]=c.LayerToDrawSurface(b.getTlx(),b.getTly()),[k,m]=c.LayerToDrawSurface(b.getBrx(),b.getBry());b=e-Math.round(e);const p=h-Math.round(h);tempRect$jscomp$11.set(e,h,k,m);tempRect$jscomp$11.offset(-b,-p);tempQuad$jscomp$7.setFromRect(tempRect$jscomp$11);const [q,v]=a.GetRenderTargetSize(a.GetRenderTarget());this._runtime.GetCanvasManager().SetDeviceTransform(a,q,v);a.SetTexture(d);a.Quad3(tempQuad$jscomp$7,this._rendererText.GetTexRect());c._SetTransform(a)}else a.SetTexture(d),
b.HasMesh()?this._DrawMesh(b,a):this._DrawStandard(b,a)}}_DrawStandard(a,b){a=a.GetBoundingQuad();this._runtime.IsPixelRoundingEnabled()&amp;&amp;(a=this._PixelRoundQuad(a));b.Quad3(a,this._rendererText.GetTexRect())}_DrawMesh(a,b){const d=a.GetTransformedMesh();if(a.IsMeshChanged()){a.CalculateBbox(tempRect$jscomp$11,tempQuad$jscomp$7,!1);let c=tempQuad$jscomp$7;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(c=this._PixelRoundQuad(c));d.CalculateTransformedMesh(a.GetSourceMesh(),c,this._rendererText.GetTexRect());
a.SetMeshChanged(!1)}d.Draw(b)}_PixelRoundQuad(a){const b=a.getTlx()-Math.round(a.getTlx()),d=a.getTly()-Math.round(a.getTly());if(0===b&amp;&amp;0===d)return a;tempQuad$jscomp$7.copy(a);tempQuad$jscomp$7.offset(-b,-d);return tempQuad$jscomp$7}GetCurrentSurfaceSize(){const a=this._rendererText.GetTexture();return a?[a.GetWidth(),a.GetHeight()]:[100,100]}GetCurrentTexRect(){return this._rendererText.GetTexRect()}IsCurrentTexRotated(){return!1}SaveToJson(){const a={t:this._text,c:this._color.toJSON(),fn:this._faceName,
ps:this._ptSize};this._enableBBcode&amp;&amp;(a.bbc=this._enableBBcode);0!==this._horizontalAlign&amp;&amp;(a.ha=this._horizontalAlign);0!==this._verticalAlign&amp;&amp;(a.va=this._verticalAlign);this._wrapByWord||(a.wr=this._wrapByWord);0!==this._lineHeightOffset&amp;&amp;(a.lho=this._lineHeightOffset);this._isBold&amp;&amp;(a.b=this._isBold);this._isItalic&amp;&amp;(a.i=this._isItalic);-1!==this._typewriterEndTime&amp;&amp;(a.tw={st:this._typewriterStartTime,en:this._typewriterEndTime,l:this._typewriterLength});return a}LoadFromJson(a){this._CancelTypewriter();
this._text=a.t;this._color.setFromJSON(a.c);this._faceName=a.fn;this._ptSize=a.ps;this._enableBBcode=a.hasOwnProperty("bbc")?a.bbc:!1;this._horizontalAlign=a.hasOwnProperty("ha")?a.ha:0;this._verticalAlign=a.hasOwnProperty("va")?a.va:0;this._wrapByWord=a.hasOwnProperty("wr")?a.wr:!0;this._lineHeightOffset=a.hasOwnProperty("lho")?a.lho:0;this._isBold=a.hasOwnProperty("b")?a.b:!1;this._isItalic=a.hasOwnProperty("i")?a.i:!1;a.hasOwnProperty("tw")&amp;&amp;(a=a.tw,this._typewriterStartTime=a.st,this._typewriterEndTime=
a.en,this._typewriterLength=a.l);this._UpdateTextSettings();-1!==this._typewriterEndTime&amp;&amp;this._StartTicking()}GetPropertyValueByIndex(a){switch(a){case 0:return this._text;case 1:return this._enableBBcode;case 2:return this._faceName;case 3:return this._ptSize;case 4:return this._lineHeightOffset;case 5:return this._isBold;case 6:return this._isItalic;case 7:return TEMP_COLOR_ARRAY$jscomp$1[0]=this._color.getR(),TEMP_COLOR_ARRAY$jscomp$1[1]=this._color.getG(),TEMP_COLOR_ARRAY$jscomp$1[2]=this._color.getB(),
TEMP_COLOR_ARRAY$jscomp$1;case 8:return this._horizontalAlign;case 9:return this._verticalAlign;case 10:return this._wrapByWord?1:0}}SetPropertyValueByIndex(a,b){switch(a){case 0:if(this._text===b)break;this._text=b;this._UpdateTextSettings();break;case 1:if(this._enableBBcode===!!b)break;this._enableBBcode=!!b;this._UpdateTextSettings();break;case 2:if(this._faceName===b)break;this._faceName=b;this._UpdateTextSettings();break;case 3:if(this._ptSize===b)break;this._ptSize=b;this._UpdateTextSettings();
break;case 4:if(this._lineHeightOffset===b)break;this._lineHeightOffset=b;this._UpdateTextSettings();break;case 5:if(this._isBold===!!b)break;this._isBold=!!b;this._UpdateTextSettings();break;case 6:if(this._isItalic===!!b)break;this._isItalic=!!b;this._UpdateTextSettings();break;case 7:a=this._color;if(a.getR()===b[0]&amp;&amp;a.getG()===b[1]&amp;&amp;a.getB()===b[2])break;this._color.setRgb(b[0],b[1],b[2]);this._UpdateTextSettings();break;case 8:if(this._horizontalAlign===b)break;this._horizontalAlign=b;this._UpdateTextSettings();
break;case 9:if(this._verticalAlign===b)break;this._verticalAlign=b;this._UpdateTextSettings();break;case 10:this._wrapByWord!==(0===b)&amp;&amp;(this._wrapByWord=0===b,this._UpdateTextSettings())}}SetPropertyColorOffsetValueByIndex(a,b,d,c){if(0!==b||0!==d||0!==c)switch(a){case 7:this._color.addRgb(b,d,c),this._UpdateTextSettings()}}_SetText(a){this._text!==a&amp;&amp;(this._text=a,this._rendererText.SetText(a),this._runtime.UpdateRender())}GetText(){return this._text}_StartTypewriter(a,b){this._SetText(a);this._typewriterStartTime=
this._runtime.GetWallTime();this._typewriterEndTime=this._typewriterStartTime+b/this.GetInstance().GetActiveTimeScale();this._typewriterLength=C3$jscomp$186.CountGraphemes(C3$jscomp$186.BBString.StripAnyTags(a));this._rendererText.SetDrawMaxCharacterCount(0);this._StartTicking()}_CancelTypewriter(){this._typewriterEndTime=this._typewriterStartTime=-1;this._typewriterLength=0;this._rendererText.SetDrawMaxCharacterCount(-1);this._StopTicking()}_FinishTypewriter(){-1!==this._typewriterEndTime&amp;&amp;(this._CancelTypewriter(),
this.Trigger(C3$jscomp$186.Plugins.Text.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender())}_SetFontFace(a){this._faceName!==a&amp;&amp;(this._faceName=a,this._rendererText.SetFontName(a),this._runtime.UpdateRender())}_GetFontFace(){return this._faceName}_SetBold(a){a=!!a;this._isBold!==a&amp;&amp;(this._isBold=a,this._rendererText.SetBold(a),this._runtime.UpdateRender())}_IsBold(){return this._isBold}_SetItalic(a){a=!!a;this._isItalic!==a&amp;&amp;(this._isItalic=a,this._rendererText.SetItalic(a),this._runtime.UpdateRender())}_IsItalic(){return this._isItalic}_SetFontSize(a){this._ptSize!==
a&amp;&amp;(this._ptSize=a,this._runtime.UpdateRender())}_GetFontSize(){return this._ptSize}_SetFontColor(a){this._color.equalsIgnoringAlpha(a)||(this._color.copyRgb(a),this._rendererText.SetColor(this._color),this._runtime.UpdateRender())}_GetFontColor(){return this._color}_SetLineHeight(a){this._lineHeightOffset!==a&amp;&amp;(this._lineHeightOffset=a,this._UpdateTextSettings(),this._runtime.UpdateRender())}_GetLineHeight(){return this._lineHeightOffset}_SetHAlign(a){this._horizontalAlign!==a&amp;&amp;(this._horizontalAlign=
a,this._UpdateTextSettings(),this._runtime.UpdateRender())}_GetHAlign(){return this._horizontalAlign}_SetVAlign(a){this._verticalAlign!==a&amp;&amp;(this._verticalAlign=a,this._UpdateTextSettings(),this._runtime.UpdateRender())}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(a){a=!!a;this._wrapByWord!==a&amp;&amp;(this._wrapByWord=a,this._UpdateTextSettings(),this._runtime.UpdateRender())}_IsWrapByWord(){return this._wrapByWord}_GetTextWidth(){this._UpdateTextSize();return this._rendererText.GetTextWidth()}_GetTextHeight(){this._UpdateTextSize();
return this._rendererText.GetTextHeight()}Tick(){var a=this._runtime.GetWallTime();a&gt;=this._typewriterEndTime?(this._CancelTypewriter(),this.Trigger(C3$jscomp$186.Plugins.Text.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender()):(a=C3$jscomp$186.relerp(this._typewriterStartTime,this._typewriterEndTime,a,0,this._typewriterLength),a=Math.floor(a),a!==this._rendererText.GetDrawMaxCharacterCount()&amp;&amp;(this._rendererText.SetDrawMaxCharacterCount(a),this._runtime.UpdateRender()))}GetDebuggerProperties(){return[{title:"plugins.text.name",
properties:[{name:"plugins.text.properties.text.name",value:this._text,onedit:a=&gt;this._SetText(a)}]}]}GetScriptInterfaceClass(){return self.ITextInstance}};const map$jscomp$20=new WeakMap,SCRIPT_HORIZONTAL_ALIGNMENTS=new Map([["left",0],["center",1],["right",2]]),SCRIPT_VERTICAL_ALIGNMENTS=new Map([["top",0],["center",1],["bottom",2]]),SCRIPT_WRAP_MODES=new Map([["word",!0],["character",!1]]);
self.ITextInstance=class extends self.IWorldInstance{constructor(){super();map$jscomp$20.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get text(){return map$jscomp$20.get(this).GetText()}set text(a){C3X$jscomp$19.RequireString(a);const b=map$jscomp$20.get(this);b._CancelTypewriter();b._SetText(a)}typewriterText(a,b){C3X$jscomp$19.RequireString(a);C3X$jscomp$19.RequireFiniteNumber(b);const d=map$jscomp$20.get(this);d._CancelTypewriter();d._StartTypewriter(a,b)}typewriterFinish(){map$jscomp$20.get(this)._FinishTypewriter()}set fontFace(a){C3X$jscomp$19.RequireString(a);
map$jscomp$20.get(this)._SetFontFace(a)}get fontFace(){return map$jscomp$20.get(this)._GetFontFace()}set isBold(a){map$jscomp$20.get(this)._SetBold(a)}get isBold(){return map$jscomp$20.get(this)._IsBold()}set isItalic(a){map$jscomp$20.get(this)._SetItalic(a)}get isItalic(){return map$jscomp$20.get(this)._IsItalic()}set sizePt(a){C3X$jscomp$19.RequireFiniteNumber(a);map$jscomp$20.get(this)._SetFontSize(a)}get sizePt(){return map$jscomp$20.get(this)._GetFontSize()}set fontColor(a){C3X$jscomp$19.RequireArray(a);
if(3&gt;a.length)throw Error("expected 3 elements");tempColor$jscomp$8.setRgb(a[0],a[1],a[2]);map$jscomp$20.get(this)._SetFontColor(tempColor$jscomp$8)}get fontColor(){const a=map$jscomp$20.get(this)._GetFontColor();return[a.getR(),a.getG(),a.getB()]}set lineHeight(a){C3X$jscomp$19.RequireFiniteNumber(a);map$jscomp$20.get(this)._SetLineHeight(a)}get lineHeight(){return map$jscomp$20.get(this)._GetLineHeight()}set horizontalAlign(a){C3X$jscomp$19.RequireString(a);a=SCRIPT_HORIZONTAL_ALIGNMENTS.get(a);
if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$20.get(this)._SetHAlign(a)}get horizontalAlign(){return HORIZONTAL_ALIGNMENTS[map$jscomp$20.get(this)._GetHAlign()]}set verticalAlign(a){C3X$jscomp$19.RequireString(a);a=SCRIPT_VERTICAL_ALIGNMENTS.get(a);if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$20.get(this)._SetVAlign(a)}get verticalAlign(){return VERTICAL_ALIGNMENTS[map$jscomp$20.get(this)._GetVAlign()]}set wordWrapMode(a){C3X$jscomp$19.RequireString(a);a=SCRIPT_WRAP_MODES.get(a);
if("undefined"===typeof a)throw Error("invalid mode");map$jscomp$20.get(this)._SetWrapByWord(a)}get wordWrapMode(){return map$jscomp$20.get(this)._IsWrapByWord()?"word":"character"}get textWidth(){return map$jscomp$20.get(this)._GetTextWidth()}get textHeight(){return map$jscomp$20.get(this)._GetTextHeight()}};const C3$jscomp$187=self.C3;
C3$jscomp$187.Plugins.Text.Cnds={CompareText(a,b){return b?this._text===a:C3$jscomp$187.equalsNoCase(this._text,a)},IsRunningTypewriterText(){return-1!==this._typewriterEndTime},OnTypewriterTextFinished(){return!0}};const C3$jscomp$188=self.C3,tempColor$jscomp$9=C3$jscomp$188.New(C3$jscomp$188.Color);
C3$jscomp$188.Plugins.Text.Acts={SetText(a){this._CancelTypewriter();"number"===typeof a&amp;&amp;1E9&gt;a&amp;&amp;(a=Math.round(1E10*a)/1E10);this._SetText(a.toString())},AppendText(a){this._CancelTypewriter();"number"===typeof a&amp;&amp;1E9&gt;a&amp;&amp;(a=Math.round(1E10*a)/1E10);(a=a.toString())&amp;&amp;this._SetText(this._text+a)},TypewriterText(a,b){this._CancelTypewriter();"number"===typeof a&amp;&amp;1E9&gt;a&amp;&amp;(a=Math.round(1E10*a)/1E10);this._StartTypewriter(a.toString(),b)},SetFontFace(a,b){let d=!1,c=!1;switch(b){case 1:d=!0;break;case 2:c=
!0;break;case 3:c=d=!0}if(a!==this._faceName||d!==this._isBold||c!==this._isItalic)this._SetFontFace(a),this._SetBold(d),this._SetItalic(c)},SetFontSize(a){this._SetFontSize(a)},SetFontColor(a){tempColor$jscomp$9.setFromRgbValue(a);tempColor$jscomp$9.clamp();this._SetFontColor(tempColor$jscomp$9)},SetWebFont(a,b){console.warn("[Text] 'Set web font' action is deprecated and no longer has any effect")},SetEffect(a){this.GetWorldInfo().SetBlendMode(a);this._runtime.UpdateRender()},TypewriterFinish(){this._FinishTypewriter()},
SetLineHeight(a){this._SetLineHeight(a)},SetHAlign(a){this._SetHAlign(a)},SetVAlign(a){this._SetVAlign(a)},SetWrapping(a){this._SetWrapByWord(0===a)}};const C3$jscomp$189=self.C3;C3$jscomp$189.Plugins.Text.Exps={Text(){return this._text},PlainText(){return this._enableBBcode?C3$jscomp$189.BBString.StripAnyTags(this._text):this._text},FaceName(){return this._faceName},FaceSize(){return this._ptSize},TextWidth(){return this._GetTextWidth()},TextHeight(){return this._GetTextHeight()},LineHeight(){return this._lineHeightOffset}};
"use strict";const C3$jscomp$190=self.C3;C3$jscomp$190.Plugins.Keyboard=class extends C3$jscomp$190.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$191=self.C3;C3$jscomp$191.Plugins.Keyboard.Type=class extends C3$jscomp$191.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IKeyboardObjectType}};let keyboardObjectType=null;
function GetKeyboardSdkInstance(){return keyboardObjectType.GetSingleGlobalInstance().GetSdkInstance()}self.IKeyboardObjectType=class extends self.IObjectClass{constructor(a){super(a);keyboardObjectType=a;a.GetRuntime()._GetCommonScriptInterfaces().keyboard=this}isKeyDown(a){const b=GetKeyboardSdkInstance();if("string"===typeof a)return b.IsKeyDown(a);if("number"===typeof a)return b.IsKeyCodeDown(a);throw new TypeError("expected string or number");}};const C3$jscomp$192=self.C3;
C3$jscomp$192.Plugins.Keyboard.Instance=class extends C3$jscomp$192.SDKInstanceBase{constructor(a,b){super(a);this._keysDownByString=new Set;this._keysDownByWhich=new Set;this._triggerWhich=0;this._triggerTypedKey=this._triggerString="";a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$192.CompositeDisposable(C3$jscomp$192.Disposable.From(a,"keydown",d=&gt;this._OnKeyDown(d.data)),C3$jscomp$192.Disposable.From(a,"keyup",d=&gt;this._OnKeyUp(d.data)),C3$jscomp$192.Disposable.From(a,"window-blur",
()=&gt;this._OnWindowOrKeyboardBlur()),C3$jscomp$192.Disposable.From(a,"keyboard-blur",()=&gt;this._OnWindowOrKeyboardBlur()))}Release(){super.Release()}_OnKeyDown(a){const b=a.which,d=a.code||b.toString();a=a.key;this._keysDownByString.has(d)||(this._keysDownByString.add(d),this._keysDownByWhich.add(b),this._triggerString=d,this._triggerWhich=b,this._triggerTypedKey=a,this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnAnyKey),this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKey),this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnLeftRightKeyPressed),
this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKeyCode))}_OnKeyUp(a){const b=a.which,d=a.code||b.toString();a=a.key;this._keysDownByString.delete(d);this._keysDownByWhich.delete(b);this._triggerString=d;this._triggerWhich=b;this._triggerTypedKey=a;this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnAnyKeyReleased);this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKeyReleased);this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnLeftRightKeyReleased);this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKeyCodeReleased)}_OnWindowOrKeyboardBlur(){for(const a of this._keysDownByWhich)this._keysDownByWhich.delete(a),
this._triggerWhich=a,this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnAnyKeyReleased),this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKeyReleased),this.Trigger(C3$jscomp$192.Plugins.Keyboard.Cnds.OnKeyCodeReleased);this._keysDownByString.clear()}IsKeyDown(a){return this._keysDownByString.has(a)}IsKeyCodeDown(a){return this._keysDownByWhich.has(a)}SaveToJson(){return{tk:this._triggerWhich,tkk:this._triggerTypedKey}}LoadFromJson(a){this._triggerWhich=a.tk;a.hasOwnProperty("tkk")&amp;&amp;(this._triggerTypedKey=
a.tkk)}GetDebuggerProperties(){return[{title:"plugins.keyboard.name",properties:[{name:"plugins.keyboard.debugger.last-key-code",value:this._triggerWhich},{name:"plugins.keyboard.debugger.last-key-string",value:C3$jscomp$192.Plugins.Keyboard.Exps.StringFromKeyCode(this._triggerWhich)},{name:"plugins.keyboard.debugger.last-typed-key",value:this._triggerTypedKey}]}]}};const LEFTRIGHT_KEY_STRINGS="ShiftLeft ShiftRight ControlLeft ControlRight AltLeft AltRight MetaLeft MetaRight".split(" ");
self.C3.Plugins.Keyboard.Cnds={IsKeyDown(a){return this._keysDownByWhich.has(a)},OnKey(a){return this._triggerWhich===a},OnAnyKey(){return!0},OnAnyKeyReleased(){return!0},OnKeyReleased(a){return this._triggerWhich===a},IsKeyCodeDown(a){a=Math.floor(a);return this._keysDownByWhich.has(a)},OnKeyCode(a){return this._triggerWhich===a},OnKeyCodeReleased(a){return this._triggerWhich===a},OnLeftRightKeyPressed(a){return this._triggerString===LEFTRIGHT_KEY_STRINGS[a]},OnLeftRightKeyReleased(a){return this._triggerString===
LEFTRIGHT_KEY_STRINGS[a]},IsLeftRightKeyDown(a){return this._keysDownByString.has(LEFTRIGHT_KEY_STRINGS[a])}};self.C3.Plugins.Keyboard.Acts={};
function StringFromCharCode(a){a=Math.floor(a);switch(a){case 8:return"backspace";case 9:return"tab";case 13:return"enter";case 16:return"shift";case 17:return"control";case 18:return"alt";case 19:return"pause";case 20:return"capslock";case 27:return"esc";case 33:return"pageup";case 34:return"pagedown";case 35:return"end";case 36:return"home";case 37:return"\u2190";case 38:return"\u2191";case 39:return"\u2192";case 40:return"\u2193";case 45:return"insert";case 46:return"del";case 91:return"left window key";
case 92:return"right window key";case 93:return"select";case 96:return"numpad 0";case 97:return"numpad 1";case 98:return"numpad 2";case 99:return"numpad 3";case 100:return"numpad 4";case 101:return"numpad 5";case 102:return"numpad 6";case 103:return"numpad 7";case 104:return"numpad 8";case 105:return"numpad 9";case 106:return"numpad *";case 107:return"numpad +";case 109:return"numpad -";case 110:return"numpad .";case 111:return"numpad /";case 112:return"F1";case 113:return"F2";case 114:return"F3";
case 115:return"F4";case 116:return"F5";case 117:return"F6";case 118:return"F7";case 119:return"F8";case 120:return"F9";case 121:return"F10";case 122:return"F11";case 123:return"F12";case 144:return"numlock";case 145:return"scroll lock";case 186:return";";case 187:return"=";case 188:return",";case 189:return"-";case 190:return".";case 191:return"/";case 192:return"'";case 219:return"[";case 220:return"\\";case 221:return"]";case 222:return"#";case 223:return"`";default:return String.fromCharCode(a)}}
self.C3.Plugins.Keyboard.Exps={LastKeyCode(){return this._triggerWhich},StringFromKeyCode(a){return StringFromCharCode(a)},TypedKey(){return this._triggerTypedKey}};"use strict";const C3$jscomp$196=self.C3;C3$jscomp$196.Plugins.Touch=class extends C3$jscomp$196.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$197=self.C3,C3X$jscomp$21=self.C3X;C3$jscomp$197.Plugins.Touch.Type=class extends C3$jscomp$197.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.ITouchObjectType}};
let touchObjectType=null;function GetTouchSdkInstance(){return touchObjectType.GetSingleGlobalInstance().GetSdkInstance()}self.ITouchObjectType=class extends self.IObjectClass{constructor(a){super(a);touchObjectType=a;a.GetRuntime()._GetCommonScriptInterfaces().touch=this}requestPermission(a){C3X$jscomp$21.RequireString(a);const b=GetTouchSdkInstance();if("orientation"===a)return b._RequestPermission(0);if("motion"===a)return b._RequestPermission(1);throw Error("invalid type");}};
const C3$jscomp$198=self.C3;
C3$jscomp$198.Plugins.Touch.Instance=class extends C3$jscomp$198.SDKInstanceBase{constructor(a,b){super(a,"touch");this._touches=new Map;this._isMouseDown=this._useMouseInput=!1;this._getTouchIndex=this._curTouchY=this._curTouchX=this._triggerPermission=this._triggerId=this._triggerIndex=this._accWithGZ=this._accWithGY=this._accWithGX=this._accZ=this._accY=this._accX=this._orientGamma=this._orientBeta=this._orientAlpha=this._orientCompassHeading=0;this._permissionPromises=[];b&amp;&amp;(this._useMouseInput=
b[0]);this.AddDOMMessageHandler("permission-result",d=&gt;this._OnPermissionResult(d));a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$198.CompositeDisposable(C3$jscomp$198.Disposable.From(a,"pointerdown",d=&gt;this._OnPointerDown(d.data)),C3$jscomp$198.Disposable.From(a,"pointermove",d=&gt;this._OnPointerMove(d.data)),C3$jscomp$198.Disposable.From(a,"pointerup",d=&gt;this._OnPointerUp(d.data,!1)),C3$jscomp$198.Disposable.From(a,"pointercancel",d=&gt;this._OnPointerUp(d.data,!0)),C3$jscomp$198.Disposable.From(a,
"deviceorientation",d=&gt;this._OnDeviceOrientation(d.data)),C3$jscomp$198.Disposable.From(a,"deviceorientationabsolute",d=&gt;this._OnDeviceOrientationAbsolute(d.data)),C3$jscomp$198.Disposable.From(a,"devicemotion",d=&gt;this._OnDeviceMotion(d.data)),C3$jscomp$198.Disposable.From(a,"tick2",d=&gt;this._OnTick2()))}Release(){this._touches.clear();super.Release()}_OnPointerDown(a){if("mouse"===a.pointerType)if(this._useMouseInput)this._isMouseDown=!0;else return;const b=a.pointerId;if(!this._touches.has(b)){var d=
a.pageX-this._runtime.GetCanvasClientX();a=a.pageY-this._runtime.GetCanvasClientY();var c=performance.now(),e=this._touches.size;this._triggerIndex=e;this._triggerId=b;var h=C3$jscomp$198.New(C3$jscomp$198.Plugins.Touch.TouchInfo);h.Init(c,d,a,b,e);this._touches.set(b,h);this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnNthTouchStart);this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnTouchStart);this._curTouchX=d;this._curTouchY=a;this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnTouchObject)}}_OnPointerMove(a){if("mouse"!==
a.pointerType||this._isMouseDown){var b=this._touches.get(a.pointerId);if(b){var d=performance.now();if(!(2&gt;d-b.GetTime())){var c=a.pageX-this._runtime.GetCanvasClientX(),e=a.pageY-this._runtime.GetCanvasClientY();b.Update(d,c,e,a.width,a.height,a.pressure)}}}}_OnPointerUp(a,b){if("mouse"===a.pointerType)if(this._isMouseDown)this._isMouseDown=!1;else return;const d=performance.now();a=a.pointerId;const c=this._touches.get(a);c&amp;&amp;(this._triggerIndex=c.GetStartIndex(),this._triggerId=c.GetId(),this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnNthTouchEnd),
this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnTouchEnd),b||(b=c.ShouldTriggerTap(d),"single-tap"===b?(this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnTapGesture),this._curTouchX=c.GetX(),this._curTouchY=c.GetY(),this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnTapGestureObject)):"double-tap"===b&amp;&amp;(this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnDoubleTapGesture),this._curTouchX=c.GetX(),this._curTouchY=c.GetY(),this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnDoubleTapGestureObject))),c.Release(),
this._touches.delete(a))}_RequestPermission(a){this._PostToDOMMaybeSync("request-permission",{type:a});return new Promise((b,d)=&gt;{this._permissionPromises.push({type:a,resolve:b,reject:d})})}_OnPermissionResult(a){const b=a.result,d=a.type;this._triggerPermission=d;a=this._permissionPromises.filter(c=&gt;c.type===d);for(const c of a)c.resolve(b?"granted":"denied");this._permissionPromises=this._permissionPromises.filter(c=&gt;c.type!==d);b?(this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnPermissionGranted),
0===d?this._runtime.RequestDeviceOrientationEvent():this._runtime.RequestDeviceMotionEvent()):this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(a){"number"===typeof a.webkitCompassHeading?this._orientCompassHeading=a.webkitCompassHeading:a.absolute&amp;&amp;(this._orientCompassHeading=a.alpha);this._orientAlpha=a.alpha;this._orientBeta=a.beta;this._orientGamma=a.gamma}_OnDeviceOrientationAbsolute(a){this._orientCompassHeading=a.alpha}_OnDeviceMotion(a){const b=a.acceleration;
b&amp;&amp;(this._accX=b.x,this._accY=b.y,this._accZ=b.z);if(a=a.accelerationIncludingGravity)this._accWithGX=a.x,this._accWithGY=a.y,this._accWithGZ=a.z}_OnTick2(){const a=performance.now();let b=0;for(const d of this._touches.values())d.GetTime()&lt;=a-50&amp;&amp;d._SetLastTime(a),d.ShouldTriggerHold(a)&amp;&amp;(this._triggerIndex=d.GetStartIndex(),this._triggerId=d.GetId(),this._getTouchIndex=b,this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnHoldGesture),this._curTouchX=d.GetX(),this._curTouchY=d.GetY(),this.Trigger(C3$jscomp$198.Plugins.Touch.Cnds.OnHoldGestureObject),
this._getTouchIndex=0),++b}_GetTouchByIndex(a){a=Math.floor(a);for(const b of this._touches.values()){if(0===a)return b;--a}return null}_IsClientPosOnCanvas(a,b){return 0&lt;=a&amp;&amp;0&lt;=b&amp;&amp;a&lt;this._runtime.GetCanvasCssWidth()&amp;&amp;b&lt;this._runtime.GetCanvasCssHeight()}GetDebuggerProperties(){return[{title:"plugins.touch.debugger.touches",properties:[...this._touches.values()].map(a=&gt;({name:"$"+a.GetId(),value:a.GetX()+", "+a.GetY()}))}]}};const C3$jscomp$199=self.C3,tempArr=[];
C3$jscomp$199.Plugins.Touch.Cnds={OnTouchStart(){return!0},OnTouchEnd(){return!0},IsInTouch(){return 0&lt;this._touches.size},OnTouchObject(a){return a&amp;&amp;this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},IsTouchingObject(a){if(!a)return!1;const b=a.GetCurrentSol();var d=b.GetInstances();for(const c of d){d=c.GetWorldInfo();const e=d.GetLayer();for(const h of this._touches.values()){if(!this._IsClientPosOnCanvas(h.GetX(),
h.GetY()))continue;const [k,m]=e.CanvasCssToLayer(h.GetX(),h.GetY(),d.GetTotalZElevation());if(e.IsSelfAndParentsInteractive()&amp;&amp;d.ContainsPoint(k,m)){tempArr.push(c);break}}}return tempArr.length?(b.SetArrayPicked(tempArr),a.ApplySolToContainer(),C3$jscomp$199.clearArray(tempArr),!0):!1},CompareTouchSpeed(a,b,d){return(a=this._GetTouchByIndex(a))?C3$jscomp$199.compare(a.GetSpeed(),b,d):!1},OrientationSupported(){return!0},MotionSupported(){return!0},CompareOrientation(a,b,d){this._runtime.RequestDeviceOrientationEvent();
return C3$jscomp$199.compare(0===a?this._orientAlpha:1===a?this._orientBeta:this._orientGamma,b,d)},CompareAcceleration(a,b,d){this._runtime.RequestDeviceMotionEvent();return C3$jscomp$199.compare(0===a?this._accWithGX:1===a?this._accWithGY:2===a?this._accWithGZ:3===a?this._accX:4===a?this._accY:this._accZ,b,d)},OnNthTouchStart(a){a=Math.floor(a);return a===this._triggerIndex},OnNthTouchEnd(a){a=Math.floor(a);return a===this._triggerIndex},HasNthTouch(a){a=Math.floor(a);return this._touches.size&gt;=
a+1},OnHoldGesture(){return!0},OnTapGesture(){return!0},OnDoubleTapGesture(){return!0},OnHoldGestureObject(a){return a&amp;&amp;this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnTapGestureObject(a){return a&amp;&amp;this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnDoubleTapGestureObject(a){return a&amp;&amp;
this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)?this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(a,this._curTouchX,this._curTouchY,!1):!1},OnPermissionGranted(a){return this._triggerPermission===a},OnPermissionDenied(a){return this._triggerPermission===a}};self.C3.Plugins.Touch.Acts={RequestPermission(a){this._RequestPermission(a)}};const C3$jscomp$201=self.C3;
C3$jscomp$201.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(a){const b=this._GetTouchByIndex(this._getTouchIndex);return b?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!0):0},Y(a){const b=this._GetTouchByIndex(this._getTouchIndex);return b?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!1):0},XAt(a,b){return(a=this._GetTouchByIndex(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!0):0},YAt(a,b){return(a=this._GetTouchByIndex(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),
b,!1):0},XForID(a,b){return(a=this._touches.get(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!0):0},YForID(a,b){return(a=this._touches.get(a))?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!1):0},AbsoluteX(){const a=this._GetTouchByIndex(0);return a?a.GetX():0},AbsoluteY(){const a=this._GetTouchByIndex(0);return a?a.GetY():0},AbsoluteXAt(a){return(a=this._GetTouchByIndex(a))?a.GetX():0},AbsoluteYAt(a){return(a=this._GetTouchByIndex(a))?a.GetY():0},AbsoluteXForID(a){return(a=
this._touches.get(a))?a.GetX():0},AbsoluteYForID(a){return(a=this._touches.get(a))?a.GetY():0},SpeedAt(a){return(a=this._GetTouchByIndex(a))?a.GetSpeed():0},SpeedForID(a){return(a=this._touches.get(a))?a.GetSpeed():0},AngleAt(a){return(a=this._GetTouchByIndex(a))?C3$jscomp$201.toDegrees(a.GetAngle()):0},AngleForID(a){return(a=this._touches.get(a))?C3$jscomp$201.toDegrees(a.GetAngle()):0},CompassHeading(){this._runtime.RequestDeviceOrientationEvent();return this._orientCompassHeading},Alpha(){this._runtime.RequestDeviceOrientationEvent();
return this._orientAlpha},Beta(){this._runtime.RequestDeviceOrientationEvent();return this._orientBeta},Gamma(){this._runtime.RequestDeviceOrientationEvent();return this._orientGamma},AccelerationXWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGX},AccelerationYWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGY},AccelerationZWithG(){this._runtime.RequestDeviceMotionEvent();return this._accWithGZ},AccelerationX(){this._runtime.RequestDeviceMotionEvent();return this._accX},
AccelerationY(){this._runtime.RequestDeviceMotionEvent();return this._accY},AccelerationZ(){this._runtime.RequestDeviceMotionEvent();return this._accZ},TouchIndex(){return this._triggerIndex},TouchID(){return this._triggerId},WidthForID(a){return(a=this._touches.get(a))?a.GetWidth():0},HeightForID(a){return(a=this._touches.get(a))?a.GetHeight():0},PressureForID(a){return(a=this._touches.get(a))?a.GetPressure():0}};"use strict";const C3$jscomp$202=self.C3;
let lastTapX=-1E3,lastTapY=-1E3,lastTapTime=-1E4;
C3$jscomp$202.Plugins.Touch.TouchInfo=class extends C3$jscomp$202.DefendedBase{constructor(){super();this._pressure=this._height=this._width=this._lastY=this._lastX=this._y=this._x=this._startY=this._startX=this._lastTime=this._time=this._startTime=this._startIndex=this._pointerId=0;this._isTooFarForHold=this._hasTriggeredHold=!1}Release(){}Init(a,b,d,c,e){this._pointerId=c;this._startIndex=e;this._startTime=this._lastTime=this._time=a;this._startX=b;this._startY=d;this._x=b;this._y=d;this._lastX=
b;this._lastY=d}Update(a,b,d,c,e,h){this._lastTime=this._time;this._time=a;this._lastX=this._x;this._lastY=this._y;this._x=b;this._y=d;this._width=c;this._height=e;this._pressure=h;!this._isTooFarForHold&amp;&amp;15&lt;=C3$jscomp$202.distanceTo(this._startX,this._startY,this._x,this._y)&amp;&amp;(this._isTooFarForHold=!0)}GetId(){return this._pointerId}GetStartIndex(){return this._startIndex}GetTime(){return this._time}_SetLastTime(a){this._lastTime=a}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const a=C3$jscomp$202.distanceTo(this._x,
this._y,this._lastX,this._lastY),b=(this._time-this._lastTime)/1E3;return 0&lt;b?a/b:0}GetAngle(){return C3$jscomp$202.angleTo(this._lastX,this._lastY,this._x,this._y)}GetWidth(){return this._width}GetHeight(){return this._height}GetPressure(){return this._pressure}ShouldTriggerHold(a){return this._hasTriggeredHold?!1:500&lt;=a-this._startTime&amp;&amp;!this._isTooFarForHold&amp;&amp;15&gt;C3$jscomp$202.distanceTo(this._startX,this._startY,this._x,this._y)?this._hasTriggeredHold=!0:!1}ShouldTriggerTap(a){if(this._hasTriggeredHold)return"";
if(333&gt;=a-this._startTime&amp;&amp;!this._isTooFarForHold&amp;&amp;15&gt;C3$jscomp$202.distanceTo(this._startX,this._startY,this._x,this._y)){if(666&gt;=a-lastTapTime&amp;&amp;25&gt;C3$jscomp$202.distanceTo(lastTapX,lastTapY,this._x,this._y))return lastTapY=lastTapX=-1E3,lastTapTime=-1E4,"double-tap";lastTapX=this._x;lastTapY=this._y;lastTapTime=a;return"single-tap"}return""}GetPositionForLayer(a,b,d){return"undefined"===typeof b?a.GetLayerByIndex(0).CanvasCssToLayer_DefaultTransform(this._x,this._y)[d?0:1]:(a=a.GetLayer(b))?a.CanvasCssToLayer(this._x,
this._y)[d?0:1]:0}};"use strict";const C3$jscomp$203=self.C3;C3$jscomp$203.Plugins.LocalStorage=class extends C3$jscomp$203.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$204=self.C3;C3$jscomp$204.Plugins.LocalStorage.Type=class extends C3$jscomp$204.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$205=self.C3;
C3$jscomp$205.Plugins.LocalStorage.Instance=class extends C3$jscomp$205.SDKInstanceBase{constructor(a,b){super(a);this._lastValue=this._currentKey="";this._keyNamesList=[];this._errorMessage="";this._pendingSets=this._pendingGets=0;this._storage=this._runtime._GetProjectStorage();this._debugCache=new Map;this._isLoadingDebugCache=!1}Release(){super.Release()}async _TriggerStorageError(a){this._errorMessage=this._GetErrorString(a);await this.TriggerAsync(C3$jscomp$205.Plugins.LocalStorage.Cnds.OnError)}_GetErrorString(a){return a?
"string"===typeof a?a:"string"===typeof a.message?a.message:"string"===typeof a.name?a.name:"string"===typeof a.data?a.data:"unknown error":"unknown error"}GetDebuggerProperties(){this._isLoadingDebugCache||this._DebugCacheStorage();return[{title:"plugins.localstorage.name",properties:[...this._debugCache.entries()].map(a=&gt;({name:"$"+a[0],value:a[1],onedit:b=&gt;this._storage.setItem(a[0],b)}))}]}async _DebugCacheStorage(){this._isLoadingDebugCache=!0;try{const a=await this._storage.keys();a.sort((d,
c)=&gt;{d=d.toLowerCase();c=c.toLowerCase();return d&lt;c?-1:c&lt;d?1:0});const b=await Promise.all(a.map(d=&gt;this._storage.getItem(d)));this._debugCache.clear();for(let d=0,c=a.length;d&lt;c;++d)this._debugCache.set(a[d],b[d])}catch(a){console.warn("[C3 debugger] Error displaying local storage: ",a)}finally{this._isLoadingDebugCache=!1}}};const C3$jscomp$206=self.C3;
C3$jscomp$206.Plugins.LocalStorage.Cnds={OnItemSet(a){return this._currentKey===a},OnAnyItemSet(){return!0},OnItemGet(a){return this._currentKey===a},OnAnyItemGet(){return!0},OnItemRemoved(a){return this._currentKey===a},OnAnyItemRemoved(){return!0},OnCleared(){return!0},OnAllKeyNamesLoaded(){return!0},OnError(){return!0},OnItemExists(a){return this._currentKey===a},OnItemMissing(a){return this._currentKey===a},CompareKey(a,b){return C3$jscomp$206.compare(this._currentKey,a,b)},CompareValue(a,b){return C3$jscomp$206.compare(this._lastValue,
a,b)},IsProcessingSets(){return 0&lt;this._pendingSets},IsProcessingGets(){return 0&lt;this._pendingGets},OnAllSetsComplete(){return!0},OnAllGetsComplete(){return!0}};const C3$jscomp$207=self.C3;function IsExpressionType(a){return"string"===typeof a||"number"===typeof a}
C3$jscomp$207.Plugins.LocalStorage.Acts={async SetItem(a,b){this._pendingSets++;try{const d=await this._storage.setItem(a,b);await this.ScheduleTriggers(async()=&gt;{this._currentKey=a;this._lastValue=d;await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAnyItemSet);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(d){await this._TriggerStorageError(d)}finally{this._pendingSets--,0===this._pendingSets&amp;&amp;await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAllSetsComplete)}},
async SetBinaryItem(a,b){if(b&amp;&amp;(b=b.GetFirstPicked(this._inst))&amp;&amp;(b=b.GetSdkInstance())){b=b.GetArrayBufferReadOnly();this._pendingSets++;try{await this._storage.setItem(a,b),await this.ScheduleTriggers(async()=&gt;{this._currentKey=a;this._lastValue="";await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAnyItemSet);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemSet)})}catch(d){await this._TriggerStorageError(d)}finally{this._pendingSets--,0===this._pendingSets&amp;&amp;
await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAllSetsComplete)}}},async GetItem(a){this._pendingGets++;try{const b=await this._storage.getItem(a);await this.ScheduleTriggers(async()=&gt;{this._currentKey=a;this._lastValue=IsExpressionType(b)?b:"";await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAnyItemGet);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(b){await this._TriggerStorageError(b)}finally{this._pendingGets--,0===this._pendingGets&amp;&amp;
await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAllGetsComplete)}},async GetBinaryItem(a,b){if(b&amp;&amp;(b=b.GetFirstPicked(this._inst))){var d=b.GetSdkInstance();this._pendingGets++;try{let c=await this._storage.getItem(a);c=c instanceof ArrayBuffer?c:new ArrayBuffer(0);await this.ScheduleTriggers(async()=&gt;{this._lastValue="";this._currentKey=a;d.SetArrayBufferTransfer(c);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAnyItemGet);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemGet)})}catch(c){await this._TriggerStorageError(c)}finally{this._pendingGets--,
0===this._pendingGets&amp;&amp;await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAllGetsComplete)}}},async CheckItemExists(a){try{const b=await this._storage.getItem(a);await this.ScheduleTriggers(async()=&gt;{this._currentKey=a;"undefined"===typeof b||null===b?(this._lastValue="",await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemMissing)):(this._lastValue=IsExpressionType(b)?b:"",await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemExists))})}catch(b){await this._TriggerStorageError(b)}},
async RemoveItem(a){try{await this._storage.removeItem(a),await this.ScheduleTriggers(async()=&gt;{this._currentKey=a;this._lastValue="";await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAnyItemRemoved);await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnItemRemoved)})}catch(b){await this._TriggerStorageError(b)}},async ClearStorage(){try{await this._storage.clear(),await this.ScheduleTriggers(async()=&gt;{this._lastValue=this._currentKey="";C3$jscomp$207.clearArray(this._keyNamesList);
await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnCleared)})}catch(a){await this._TriggerStorageError(a)}},async GetAllKeyNames(){try{const a=await this._storage.keys();await this.ScheduleTriggers(async()=&gt;{this._keyNamesList=a;await this.TriggerAsync(C3$jscomp$207.Plugins.LocalStorage.Cnds.OnAllKeyNamesLoaded)})}catch(a){await this._TriggerStorageError(a)}}};
self.C3.Plugins.LocalStorage.Exps={ItemValue(){return this._lastValue},Key(){return this._currentKey},KeyCount(){return this._keyNamesList.length},KeyAt(a){a=Math.floor(a);return 0&gt;a||a&gt;=this._keyNamesList.length?"":this._keyNamesList[a]},ErrorMessage(){return this._errorMessage}};"use strict";const C3$jscomp$209=self.C3;C3$jscomp$209.Plugins.Browser=class extends C3$jscomp$209.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$210=self.C3;
C3$jscomp$210.Plugins.Browser.Type=class extends C3$jscomp$210.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};const C3$jscomp$211=self.C3;
C3$jscomp$211.Plugins.Browser.Instance=class extends C3$jscomp$211.SDKInstanceBase{constructor(a,b){super(a,"browser");this._initLocationStr="";this._isOnline=!1;this._docTitle=this._referrer="";this._isCookieEnabled=!1;this._windowOuterHeight=this._windowOuterWidth=this._screenHeight=this._screenWidth=0;this._isConstructArcade=!1;this.AddDOMMessageHandlers([["online-state",d=&gt;this._OnOnlineStateChanged(d)],["backbutton",()=&gt;this._OnBackButton()],["sw-message",d=&gt;this._OnSWMessage(d)],["hashchange",
d=&gt;this._OnHashChange(d)]]);a=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$211.CompositeDisposable(C3$jscomp$211.Disposable.From(a,"afterfirstlayoutstart",()=&gt;this._OnAfterFirstLayoutStart()),C3$jscomp$211.Disposable.From(a,"window-resize",()=&gt;this._OnWindowResize()),C3$jscomp$211.Disposable.From(a,"suspend",()=&gt;this._OnSuspend()),C3$jscomp$211.Disposable.From(a,"resume",()=&gt;this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state",{exportType:this._runtime.GetExportType()}).then(d=&gt;
{this._initLocationStr=d.location;this._isOnline=d.isOnline;this._referrer=d.referrer;this._docTitle=d.title;this._isCookieEnabled=d.isCookieEnabled;this._screenWidth=d.screenWidth;this._screenHeight=d.screenHeight;this._windowOuterWidth=d.windowOuterWidth;this._windowOuterHeight=d.windowOuterHeight;this._isConstructArcade=d.isConstructArcade}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM("ready-for-sw-messages")}async _OnOnlineStateChanged(a){a=!!a.isOnline;this._isOnline!==
a&amp;&amp;((this._isOnline=a)?await this.TriggerAsync(C3$jscomp$211.Plugins.Browser.Cnds.OnOnline):await this.TriggerAsync(C3$jscomp$211.Plugins.Browser.Cnds.OnOffline))}async _OnWindowResize(){await this.TriggerAsync(C3$jscomp$211.Plugins.Browser.Cnds.OnResize)}_OnSuspend(){this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnPageHidden)}_OnResume(){this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnPageVisible)}async _OnBackButton(){await this.TriggerAsync(C3$jscomp$211.Plugins.Browser.Cnds.OnBackButton)}_OnSWMessage(a){a=
a.type;"downloading-update"===a?this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnUpdateFound):"update-ready"===a||"update-pending"===a?this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnUpdateReady):"offline-ready"===a&amp;&amp;this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnOfflineReady)}_OnHashChange(a){this._initLocationStr=a.location;this.Trigger(C3$jscomp$211.Plugins.Browser.Cnds.OnHashChange)}GetDebuggerProperties(){return[{title:"plugins.browser.name",properties:[{name:"plugins.browser.debugger.user-agent",
value:navigator.userAgent},{name:"plugins.browser.debugger.is-online",value:this._isOnline},{name:"plugins.browser.debugger.is-fullscreen",value:this._runtime.GetCanvasManager().IsDocumentFullscreen()}]}]}};
self.C3.Plugins.Browser.Cnds={IsOnline(){return this._isOnline},OnOnline(){return!0},OnOffline(){return!0},OnResize(){return!0},CookiesEnabled(){return this._isCookieEnabled},IsFullscreen(){return this._runtime.GetCanvasManager().IsDocumentFullscreen()},OnBackButton(){return!0},IsPortraitLandscape(a){const b=this._runtime.GetCanvasManager().GetLastWidth(),d=this._runtime.GetCanvasManager().GetLastHeight();return(b&lt;=d?0:1)===a},OnUpdateFound(){return!0},OnUpdateReady(){return!0},OnOfflineReady(){return!0},
OnHashChange(){return!0},PageVisible(){return!this._runtime.IsSuspended()},OnPageHidden(){return!0},OnPageVisible(){return!0},HasJava(){return!1},IsDownloadingUpdate(){return!1},OnMenuButton(){return!1},OnSearchButton(){return!1},IsMetered(){return!1},IsCharging(){return!0},SupportsFullscreen(){return!0}};const C3$jscomp$213=self.C3,ORIENTATIONS="portrait landscape portrait-primary portrait-secondary landscape-primary landscape-secondary".split(" ");
C3$jscomp$213.Plugins.Browser.Acts={Alert(a){this.PostToDOM("alert",{message:a.toString()})},Close(){this._isConstructArcade||(this._runtime.IsDebug()?self.C3Debugger.CloseWindow():this.PostToDOM("close"))},Focus(){this.PostToDOM("set-focus",{isFocus:!0})},Blur(){this.PostToDOM("set-focus",{isFocus:!1})},GoBack(){this._isConstructArcade||this.PostToDOM("navigate",{type:"back"})},GoForward(){this._isConstructArcade||this.PostToDOM("navigate",{type:"forward"})},GoHome(){},Reload(){this._isConstructArcade||
(this._runtime.IsDebug()?this._runtime.PostToDebugger({type:"reload"}):this.PostToDOM("navigate",{type:"reload"}))},GoToURL(a,b){this._PostToDOMMaybeSync("navigate",{type:"url",url:a,target:b,exportType:this._runtime.GetExportType()})},GoToURLWindow(a,b){this._PostToDOMMaybeSync("navigate",{type:"new-window",url:a,tag:b,exportType:this._runtime.GetExportType()})},RequestFullScreen(a,b){2&lt;=a&amp;&amp;(a+=1);6===a&amp;&amp;(a=2);1===a&amp;&amp;(a=0);a=C3$jscomp$213.CanvasManager._FullscreenModeNumberToString(a);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(a);
this._PostToDOMMaybeSync("request-fullscreen",{navUI:b})},CancelFullScreen(){this._PostToDOMMaybeSync("exit-fullscreen")},Vibrate(a){a=a.split(",");for(let b=0,d=a.length;b&lt;d;++b)a[b]=parseInt(a[b],10);this._PostToDOMMaybeSync("vibrate",{pattern:a})},async InvokeDownload(a,b){a&amp;&amp;b&amp;&amp;(a=await this._runtime.GetAssetManager().GetProjectFileUrl(a),this._runtime.InvokeDownload(a,b))},InvokeDownloadString(a,b,d){d&amp;&amp;(a=`data:${b},${encodeURIComponent(a)}`,this._runtime.InvokeDownload(a,d))},ConsoleLog(a,
b){b=b.toString();0===a?console.log(b):1===a?console.warn(b):2===a&amp;&amp;console.error(b)},ConsoleGroup(a){console.group(a)},ConsoleGroupEnd(){console.groupEnd()},ExecJs(a){try{eval(a)}catch(b){console.error("Error executing JavaScript: ",b)}},LockOrientation(a){a=Math.floor(a);0&gt;a||a&gt;=ORIENTATIONS.length||this._PostToDOMMaybeSync("lock-orientation",{orientation:ORIENTATIONS[a]})},UnlockOrientation(){this._PostToDOMMaybeSync("unlock-orientation")},LoadStyleSheet(a){this._runtime.GetAssetManager().LoadStyleSheet(a)},
SetHash(a){this.PostToDOM("set-hash",{hash:a})}};
self.C3.Plugins.Browser.Exps={URL(){return this._runtime.IsInWorker()?this._initLocationStr:location.toString()},Protocol(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).protocol:location.protocol},Domain(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).hostname:location.hostname},Port(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).port:location.port},PathName(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).pathname:
location.pathname},Hash(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).hash:location.hash},QueryString(){return this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search},QueryParam(a){const b=this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search;return(a=RegExp("[?&amp;]"+a+"=([^&amp;]*)").exec(b))?decodeURIComponent(a[1].replace(/\+/g," ")):""},Referrer(){return this._referrer},Title(){return this._docTitle},Language(){return navigator.language},
Platform(){return navigator.platform},UserAgent(){return navigator.userAgent},ExecJS(a){let b=0;try{b=eval(a)}catch(d){console.error("Error executing JavaScript: ",d)}return"number"===typeof b||"string"===typeof b?b:"boolean"===typeof b?b?1:0:0},Name(){return navigator.appName},Version(){return navigator.appVersion},Product(){return navigator.product},Vendor(){return navigator.vendor},BatteryLevel(){return 1},BatteryTimeLeft(){return Infinity},Bandwidth(){const a=navigator.connection;return a?a.downlink||
a.downlinkMax||a.bandwidth||Infinity:Infinity},ConnectionType(){const a=navigator.connection;return a?a.type||"unknown":"unknown"},DevicePixelRatio(){return self.devicePixelRatio},ScreenWidth(){return this._screenWidth},ScreenHeight(){return this._screenHeight},WindowInnerWidth(){return this._runtime.GetCanvasManager().GetLastWidth()},WindowInnerHeight(){return this._runtime.GetCanvasManager().GetLastHeight()},WindowOuterWidth(){return this._windowOuterWidth},WindowOuterHeight(){return this._windowOuterWidth}};
"use strict";const C3$jscomp$215=self.C3,actionPromises=[];C3$jscomp$215.Plugins.Audio=class extends C3$jscomp$215.SDKPluginBase{constructor(a){super(a)}_AddActionPromise(a){actionPromises.push(a)}static async WaitForAllActionPromises(){await Promise.all(actionPromises);C3$jscomp$215.clearArray(actionPromises)}Release(){super.Release()}};const C3$jscomp$216=self.C3;C3$jscomp$216.Plugins.Audio.Type=class extends C3$jscomp$216.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IAudioObjectType}};
function GetAudioDOMInterface(){if(self.C3Audio_DOMInterface)return self.C3Audio_DOMInterface;throw Error("audio scripting API cannot be used here - make sure the project is using DOM mode, not worker mode");}self.IAudioObjectType=class extends self.IObjectClass{constructor(a){super(a)}get audioContext(){return GetAudioDOMInterface().GetAudioContext()}get destinationNode(){return GetAudioDOMInterface().GetDestinationNode()}};const C3$jscomp$217=self.C3,LATENCY_HINTS=["interactive","balanced","playback"];
C3$jscomp$217.Plugins.Audio.Instance=class extends C3$jscomp$217.SDKInstanceBase{constructor(a,b){super(a,"audio");this._nextPlayTime=0;this._triggerTag="";this._saveLoadMode=this._timeScaleMode=0;this._playInBackground=!1;this._distanceModel=this._panningModel=1;this._listenerX=this._runtime.GetViewportWidth()/2;this._listenerY=this._runtime.GetViewportHeight()/2;this._listenerZ=-600;this._referenceDistance=600;this._maxDistance=1E4;this._rolloffFactor=1;this._listenerInst=null;this._loadListenerUid=
-1;this._masterVolume=1;this._isSilent=!1;this._sampleRate=0;this._audioContextState="suspended";this._outputLatency=0;this._effectCount=new Map;this._preloadCount=this._preloadTotal=0;this._bufferMetadata=new Map;this._remoteUrls=new Map;a="interactive";b&amp;&amp;(this._timeScaleMode=b[0],this._saveLoadMode=b[1],this._playInBackground=b[2],a=LATENCY_HINTS[b[3]],this._panningModel=b[4],this._distanceModel=b[5],this._listenerZ=-b[6],this._referenceDistance=b[7],this._maxDistance=b[8],this._rolloffFactor=
b[9]);this._lastAIState=[];this._lastFxState=[];this._lastAnalysersData=[];this.AddDOMMessageHandlers([["state",d=&gt;this._OnUpdateState(d)],["audiocontext-state",d=&gt;this._OnAudioContextStateChanged(d)],["fxstate",d=&gt;this._OnUpdateFxState(d)],["trigger",d=&gt;this._OnTrigger(d)],["buffer-metadata",d=&gt;this._OnBufferMetadata(d)]]);b=this.GetRuntime().Dispatcher();this._disposables=new C3$jscomp$217.CompositeDisposable(C3$jscomp$217.Disposable.From(b,"instancedestroy",d=&gt;this._OnInstanceDestroyed(d.instance)),
C3$jscomp$217.Disposable.From(b,"afterload",()=&gt;this._OnAfterLoad()),C3$jscomp$217.Disposable.From(b,"suspend",()=&gt;this._OnSuspend()),C3$jscomp$217.Disposable.From(b,"resume",()=&gt;this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("create-audio-context",{preloadList:this._runtime.GetAssetManager().GetAudioToPreload().map(d=&gt;({originalUrl:d.originalUrl,url:d.url,type:d.type,fileSize:d.fileSize})),isiOSCordova:this._runtime.IsiOSCordova(),timeScaleMode:this._timeScaleMode,latencyHint:a,
panningModel:this._panningModel,distanceModel:this._distanceModel,refDistance:this._referenceDistance,maxDistance:this._maxDistance,rolloffFactor:this._rolloffFactor,listenerPos:[this._listenerX,this._listenerY,this._listenerZ]}).then(d=&gt;{this._sampleRate=d.sampleRate;this._audioContextState=d.audioContextState;this._outputLatency=d.outputLatency}));this._StartTicking()}Release(){this._listenerInst=null;super.Release()}_AddActionPromise(a){this.GetPlugin()._AddActionPromise(a)}_OnInstanceDestroyed(a){this._listenerInst===
a&amp;&amp;(this._listenerInst=null)}DbToLinearNoCap(a){return Math.pow(10,a/20)}DbToLinear(a){a=this.DbToLinearNoCap(a);return isFinite(a)?Math.max(Math.min(a,1),0):0}LinearToDbNoCap(a){return Math.log(a)/Math.log(10)*20}LinearToDb(a){return this.LinearToDbNoCap(Math.max(Math.min(a,1),0))}_OnSuspend(){this._playInBackground||this.PostToDOM("set-suspended",{isSuspended:!0})}_OnResume(){this._playInBackground||this.PostToDOM("set-suspended",{isSuspended:!1})}_OnUpdateState(a){const b=a.tickCount;this._outputLatency=
a.outputLatency;const d=this._lastAIState.filter(c=&gt;c.hasOwnProperty("placeholder")&amp;&amp;(c.placeholder&gt;b||-1===c.placeholder));this._lastAIState=a.audioInstances;this._lastAnalysersData=a.analysers;0&lt;d.length&amp;&amp;C3$jscomp$217.appendArray(this._lastAIState,d)}_OnBufferMetadata(a){this._bufferMetadata.set(a.originalUrl,{duration:a.duration})}_OnAudioContextStateChanged(a){this._audioContextState=a.audioContextState}GetAudioContextState(){return this._runtime.IsExportToVideo()?"running":this._audioContextState}_OnUpdateFxState(a){this._lastFxState=
a.fxstate}_GetFirstAudioStateByTag(a){for(const b of this._lastAIState)if(C3$jscomp$217.equalsNoCase(b.tag,a))return b;return null}_IsTagPlaying(a){return this._lastAIState.some(b=&gt;C3$jscomp$217.equalsNoCase(a,b.tag)&amp;&amp;b.isPlaying)}_MaybeMarkAsPlaying(a,b,d,c,e){if(this._IsTagPlaying(b))return null;const h=this._bufferMetadata.get(a);a={tag:b,duration:h?h.duration:0,volume:e,isPlaying:!0,playbackTime:0,playbackRate:1,uid:-1,bufferOriginalUrl:a,bufferUrl:"",bufferType:"",isMusic:d,isLooping:c,isMuted:!1,
resumePosition:0,pan:null,placeholder:-1};this._lastAIState.push(a);return a}async _OnTrigger(a){const b=a.type;this._triggerTag=a.tag;a=a.aiid;if("ended"===b){for(const d of this._lastAIState)if(d.aiid===a){d.isPlaying=!1;break}await this.TriggerAsync(C3$jscomp$217.Plugins.Audio.Cnds.OnEnded)}else"fade-ended"===b&amp;&amp;await this.TriggerAsync(C3$jscomp$217.Plugins.Audio.Cnds.OnFadeEnded)}Tick(){const a={timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTimeRaw(),instPans:this.GetInstancePans(),
tickCount:this._runtime.GetTickCountNoSave()};if(this._listenerInst){const b=this._listenerInst.GetWorldInfo();this._listenerX=b.GetX();this._listenerY=b.GetY();a.listenerPos=[this._listenerX,this._listenerY,this._listenerZ]}this.PostToDOM("tick",a)}rotatePtAround(a,b,d,c,e){if(0===d)return[a,b];const h=Math.sin(d);d=Math.cos(d);a-=c;b-=e;const k=a*h;a=a*d-b*h;return[a+c,b*d+k+e]}GetInstancePans(){return this._lastAIState.filter(a=&gt;-1!==a.uid).map(a=&gt;this._runtime.GetInstanceByUID(a.uid)).filter(a=&gt;
a).map(a=&gt;{const b=a.GetWorldInfo(),d=b.GetLayer().GetAngle(),[c,e]=this.rotatePtAround(b.GetX(),b.GetY(),-d,this._listenerX,this._listenerY);return{uid:a.GetUID(),x:c,y:e,angle:b.GetAngle()-d}})}GetAnalyserData(a,b){for(const d of this._lastAnalysersData)if(d.index===b&amp;&amp;C3$jscomp$217.equalsNoCase(d.tag,a))return d;return null}_IncrementEffectCount(a){this._effectCount.set(a,(this._effectCount.get(a)||0)+1)}_ShouldSave(a){return a.hasOwnProperty("placeholder")||3===this._saveLoadMode?!1:a.isMusic&amp;&amp;
1===this._saveLoadMode?!1:a.isMusic||2!==this._saveLoadMode?!0:!1}SaveToJson(){return{isSilent:this._isSilent,masterVolume:this._masterVolume,listenerZ:this._listenerZ,listenerUid:this._listenerInst?this._listenerInst.GetUID():-1,remoteUrls:[...this._remoteUrls.entries()],playing:this._lastAIState.filter(a=&gt;this._ShouldSave(a)),effects:this._lastFxState,analysers:this._lastAnalysersData}}LoadFromJson(a){this._isSilent=a.isSilent;this._masterVolume=a.masterVolume;this._listenerZ=a.listenerZ;this._listenerInst=
null;this._loadListenerUid=a.listenerUid;this._remoteUrls.clear();if(a.remoteUrls)for(const [b,d]of a.remoteUrls)this._remoteUrls.set(b,d);this._lastAIState=a.playing;this._lastFxState=a.effects;this._lastAnalysersData=a.analysers}_OnAfterLoad(){if(-1!==this._loadListenerUid&amp;&amp;(this._listenerInst=this._runtime.GetInstanceByUID(this._loadListenerUid),this._loadListenerUid=-1,this._listenerInst)){var a=this._listenerInst.GetWorldInfo();this._listenerX=a.GetX();this._listenerY=a.GetY()}for(var b of this._lastAIState)(a=
this._runtime.GetAssetManager().GetProjectAudioFileUrl(b.bufferOriginalUrl))?(b.bufferUrl=a.url,b.bufferType=a.type):b.bufferUrl=null;for(const d of Object.values(this._lastFxState))for(const c of d)c.hasOwnProperty("bufferOriginalUrl")&amp;&amp;(b=this._runtime.GetAssetManager().GetProjectAudioFileUrl(c.bufferOriginalUrl))&amp;&amp;(c.bufferUrl=b.url,c.bufferType=b.type);this.PostToDOM("load-state",{saveLoadMode:this._saveLoadMode,timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTimeRaw(),listenerPos:[this._listenerX,
this._listenerY,this._listenerZ],isSilent:this._isSilent,masterVolume:this._masterVolume,playing:this._lastAIState.filter(d=&gt;null!==d.bufferUrl),effects:this._lastFxState})}GetDebuggerProperties(){const a=[];for(const [b,d]of Object.entries(this._lastFxState))a.push({name:"$"+b,value:d.map(c=&gt;c.type).join(", ")});return[{title:"plugins.audio.debugger.tag-effects",properties:a},{title:"plugins.audio.debugger.currently-playing",properties:[{name:"plugins.audio.debugger.currently-playing-count",value:this._lastAIState.length},
...this._lastAIState.map((b,d)=&gt;({name:"$#"+d,value:`${b.bufferOriginalUrl} ("${b.tag}") ${Math.round(10*b.playbackTime)/10} / ${Math.round(10*b.duration)/10}`}))]}]}};const C3$jscomp$218=self.C3;
C3$jscomp$218.Plugins.Audio.Cnds={OnEnded(a){return C3$jscomp$218.equalsNoCase(this._triggerTag,a)},OnFadeEnded(a){return C3$jscomp$218.equalsNoCase(this._triggerTag,a)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return!0},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const a of this._lastAIState)if(a.isPlaying)return!0;return!1},IsTagPlaying(a){return this._IsTagPlaying(a)}};const C3$jscomp$219=self.C3,FILTER_TYPES="lowpass highpass bandpass lowshelf highshelf peaking notch allpass".split(" ");
C3$jscomp$219.Plugins.Audio.Acts={Play(a,b,d,c,e){a=C3$jscomp$219.Plugins.Audio.Acts._DoPlay.call(this,a,b,d,c,e);this._AddActionPromise(a);return a},async _DoPlay(a,b,d,c,e){if(!this._isSilent){var h=a[1],k=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(k){e=e?e:0;var m=this._nextPlayTime;this._nextPlayTime=0;var p=this._MaybeMarkAsPlaying(a[0],c.toLowerCase(),h,0!==b,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:k.url,type:k.type,isMusic:h,tag:c.toLowerCase(),
isLooping:0!==b,vol:this.DbToLinear(d),pos:e,off:m,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{p&amp;&amp;(p.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPosition(a,b,d,c,e,h,k,m,p,q){if(!this._isSilent){var v=a[1],x=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(x){var A=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(a[0],q.toLowerCase(),v,0!==b,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:x.url,type:x.type,
isMusic:v,tag:q.toLowerCase(),isLooping:0!==b,vol:this.DbToLinear(d),pos:0,off:A,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:c,y:e,angle:C3$jscomp$219.toRadians(h),innerAngle:C3$jscomp$219.toRadians(k),outerAngle:C3$jscomp$219.toRadians(m),outerGain:this.DbToLinear(p)}})}finally{C&amp;&amp;(C.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObject(a,b,d,c,e,h,k,m){if(!this._isSilent&amp;&amp;c&amp;&amp;(c=c.GetFirstPicked())&amp;&amp;c.GetWorldInfo()){var p=c.GetWorldInfo(),q=p.GetLayer().GetAngle(),
[v,x]=this.rotatePtAround(p.GetX(),p.GetY(),-q,this._listenerX,this._listenerY),A=a[1],C=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(C){var D=this._nextPlayTime;this._nextPlayTime=0;var G=this._MaybeMarkAsPlaying(a[0],m.toLowerCase(),A,0!==b,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:C.url,type:C.type,isMusic:A,tag:m.toLowerCase(),isLooping:0!==b,vol:this.DbToLinear(d),pos:0,off:D,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:v,y:x,
angle:p.GetAngle()-q,innerAngle:C3$jscomp$219.toRadians(e),outerAngle:C3$jscomp$219.toRadians(h),outerGain:this.DbToLinear(k),uid:c.GetUID()}})}finally{G&amp;&amp;(G.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayByName(a,b,d,c,e){if(!this._isSilent){a=1===a;var h=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());if(h){var k=this._nextPlayTime;this._nextPlayTime=0;var m=this._MaybeMarkAsPlaying(b,e.toLowerCase(),a,0!==d,this.DbToLinear(c));try{await this.PostToDOMAsync("play",
{originalUrl:b,url:h.url,type:h.type,isMusic:a,tag:e.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(c),pos:0,off:k,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{m&amp;&amp;(m.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPositionByName(a,b,d,c,e,h,k,m,p,q,v){if(!this._isSilent){a=1===a;var x=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());if(x){var A=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(b,v.toLowerCase(),
a,0!==d,this.DbToLinear(c));try{await this.PostToDOMAsync("play",{originalUrl:b,url:x.url,type:x.type,isMusic:a,tag:v.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(c),pos:0,off:A,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:e,y:h,angle:C3$jscomp$219.toRadians(k),innerAngle:C3$jscomp$219.toRadians(m),outerAngle:C3$jscomp$219.toRadians(p),outerGain:this.DbToLinear(q)}})}finally{C&amp;&amp;(C.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObjectByName(a,b,d,c,e,h,k,m,p){if(!this._isSilent&amp;&amp;
!this._isSilent&amp;&amp;e&amp;&amp;(e=e.GetFirstPicked())&amp;&amp;e.GetWorldInfo()){var q=e.GetWorldInfo(),v=q.GetLayer().GetAngle(),[x,A]=this.rotatePtAround(q.GetX(),q.GetY(),-v,this._listenerX,this._listenerY);a=1===a;var C=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase());if(C){var D=this._nextPlayTime;this._nextPlayTime=0;var G=this._MaybeMarkAsPlaying(b,p.toLowerCase(),a,0!==d,this.DbToLinear(c));try{await this.PostToDOMAsync("play",{originalUrl:b,url:C.url,type:C.type,
isMusic:a,tag:p.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(c),pos:0,off:D,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x,y:A,angle:q.GetAngle()-v,innerAngle:C3$jscomp$219.toRadians(h),outerAngle:C3$jscomp$219.toRadians(k),outerGain:this.DbToLinear(m),uid:e.GetUID()}})}finally{G&amp;&amp;(G.placeholder=this._runtime.GetTickCountNoSave())}}}},SetLooping(a,b){this.PostToDOM("set-looping",{tag:a.toLowerCase(),isLooping:0===b})},SetMuted(a,b){this.PostToDOM("set-muted",{tag:a.toLowerCase(),isMuted:0===
b})},SetVolume(a,b){this.PostToDOM("set-volume",{tag:a.toLowerCase(),vol:this.DbToLinear(b)})},FadeVolume(a,b,d,c){this.PostToDOM("fade-volume",{tag:a.toLowerCase(),vol:this.DbToLinear(b),duration:d,stopOnEnd:0===c})},async Preload(a){const b=a[1],d=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);d&amp;&amp;(this._preloadTotal++,await this.PostToDOMAsync("preload",{originalUrl:a[0],url:d.url,type:d.type,isMusic:b}),this._preloadCount++)},async PreloadByName(a,b){a=1===a;const d=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||
this._remoteUrls.get(b.toLowerCase());d&amp;&amp;(this._preloadTotal++,await this.PostToDOMAsync("preload",{originalUrl:b,url:d.url,type:d.type,isMusic:a}),this._preloadCount++)},SetPlaybackRate(a,b){this.PostToDOM("set-playback-rate",{tag:a.toLowerCase(),rate:Math.max(b,0)})},Stop(a){this.PostToDOM("stop",{tag:a.toLowerCase()})},StopAll(){this.PostToDOM("stop-all")},SetPaused(a,b){this.PostToDOM("set-paused",{tag:a.toLowerCase(),paused:0===b})},Seek(a,b){this.PostToDOM("seek",{tag:a.toLowerCase(),pos:b})},
SetSilent(a){2===a&amp;&amp;(a=this._isSilent?1:0);a=0===a;this._isSilent!==a&amp;&amp;(this._isSilent=a,this.PostToDOM("set-silent",{isSilent:a}))},SetMasterVolume(a){a=this.DbToLinear(a);this._masterVolume!==a&amp;&amp;(this._masterVolume=a,this.PostToDOM("set-master-volume",{vol:a}))},AddFilterEffect(a,b,d,c,e,h,k){a=a.toLowerCase();b=FILTER_TYPES[b];this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"filter",tag:a,params:[b,d,c,e,h,C3$jscomp$219.clamp(k/100,0,1)]})},AddDelayEffect(a,b,d,c){a=a.toLowerCase();
this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"delay",tag:a,params:[b,this.DbToLinear(d),C3$jscomp$219.clamp(c/100,0,1)]})},AddFlangerEffect(a,b,d,c,e,h){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"flanger",tag:a,params:[b/1E3,d/1E3,c,e/100,C3$jscomp$219.clamp(h/100,0,1)]})},AddPhaserEffect(a,b,d,c,e,h,k){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"phaser",tag:a,params:[b,d,c,e,h,C3$jscomp$219.clamp(k/
100,0,1)]})},AddConvolutionEffect(a,b,d,c){a=a.toLowerCase();const e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b[0]);e&amp;&amp;(this._IncrementEffectCount(a),this.PostToDOM("add-effect",{type:"convolution",tag:a,bufferOriginalUrl:b[0],bufferUrl:e.url,bufferType:e.type,params:[0===d,C3$jscomp$219.clamp(c/100,0,1)]}))},AddGainEffect(a,b){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tag:a,params:[this.DbToLinear(b)]})},AddMuteEffect(a){a=a.toLowerCase();
this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tag:a,params:[0]})},AddTremoloEffect(a,b,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"tremolo",tag:a,params:[b,C3$jscomp$219.clamp(d/100,0,1)]})},AddRingModEffect(a,b,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"ringmod",tag:a,params:[b,C3$jscomp$219.clamp(d/100,0,1)]})},AddDistortionEffect(a,b,d,c,e,h){a=a.toLowerCase();this._IncrementEffectCount(a);
this.PostToDOM("add-effect",{type:"distortion",tag:a,params:[this.DbToLinearNoCap(b),this.DbToLinearNoCap(d),c,this.DbToLinearNoCap(e),C3$jscomp$219.clamp(h/100,0,1)]})},AddCompressorEffect(a,b,d,c,e,h){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"compressor",tag:a,params:[b,d,c,e/1E3,h/1E3]})},AddAnalyserEffect(a,b,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"analyser",tag:a,params:[b,d]})},RemoveEffects(a){a=a.toLowerCase();
this._effectCount.set(a,0);this.PostToDOM("remove-effects",{tag:a});this._lastFxState={}},SetEffectParameter(a,b,d,c,e,h){this.PostToDOM("set-effect-param",{tag:a.toLowerCase(),index:Math.floor(b),param:d,value:c,ramp:e,time:h})},SetListenerObject(a){a&amp;&amp;(a=a.GetFirstPicked())&amp;&amp;a.GetWorldInfo()&amp;&amp;(this._listenerInst=a)},SetListenerZ(a){this._listenerZ=a},ScheduleNextPlay(a){this._nextPlayTime=Math.max(a,0)},UnloadAudio(a){const b=a[1];(a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]))&amp;&amp;
this.PostToDOM("unload",{url:a.url,type:a.type,isMusic:b})},UnloadAudioByName(a,b){a=1===a;(b=this._runtime.GetAssetManager().GetProjectAudioFileUrl(b)||this._remoteUrls.get(b.toLowerCase()))&amp;&amp;this.PostToDOM("unload",{url:b.url,type:b.type,isMusic:a})},UnloadAll(){this.PostToDOM("unload-all")},AddRemoteURL(a,b,d){this._remoteUrls.set(d.toLowerCase(),{url:a,type:b})}};
self.C3.Plugins.Audio.Exps={Duration(a){return(a=this._GetFirstAudioStateByTag(a))?a.duration:0},PlaybackTime(a){return(a=this._GetFirstAudioStateByTag(a))?a.playbackTime:0},PlaybackRate(a){return(a=this._GetFirstAudioStateByTag(a))?a.playbackRate:0},Volume(a){return(a=this._GetFirstAudioStateByTag(a))?this.LinearToDb(a.volume):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(a){return this._effectCount.get(a.toLowerCase())||0},AnalyserFreqBinCount(a,b){return(a=this.GetAnalyserData(a,
Math.floor(b)))?a.binCount:0},AnalyserFreqBinAt(a,b,d){a=this.GetAnalyserData(a,Math.floor(b));if(!a)return 0;d=Math.floor(d);return 0&gt;d||d&gt;=a.binCount?0:a.freqBins[d]},AnalyserPeakLevel(a,b){return(a=this.GetAnalyserData(a,Math.floor(b)))?a.peak:0},AnalyserRMSLevel(a,b){return(a=this.GetAnalyserData(a,Math.floor(b)))?a.rms:0},SampleRate(){return this._sampleRate},CurrentTime(){return self.C3_GetAudioContextCurrentTime?self.C3_GetAudioContextCurrentTime():performance.now()/1E3},OutputLatency(){return this._outputLatency}};
"use strict";C3.Plugins.GM_SDK=class extends C3.SDKPluginBase{constructor(a){super(a)}Release(){super.Release()}};"use strict";C3.Plugins.GM_SDK.Type=class extends C3.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};"use strict";
C3.Plugins.GM_SDK.Instance=class extends C3.SDKInstanceBase{constructor(a,b){super(a);this._gameID="";this._preloadedAd=this._adViewed=this._adPlaying=this._sdkReady=!1;this._available_adtypes=["interstitial"];b&amp;&amp;(this._gameID=b[0]);window.SDK_OPTIONS={gameId:this._gameID,onEvent:d=&gt;{switch(d.name){case "SDK_GAME_START":this._adPlaying=!1;break;case "SDK_GAME_PAUSE":this._adPlaying=!0;break;case "COMPLETE":this._adViewed=!0;setTimeout(()=&gt;{this._adViewed=!1},5E3);break;case "SDK_READY":this._sdkReady=
!0}}};(function(d,c,e){var h=d.getElementsByTagName(c)[0];d.getElementById(e)||(d=d.createElement(c),d.id=e,d.src="//api.gamemonetize.com/sdk.js",h.parentNode.insertBefore(d,h))})(document,"script","gamemonetize-sdk")}Release(){super.Release()}SaveToJson(){return{}}LoadFromJson(a){}ShowAd(){var a=window.sdk;"undefined"!==a&amp;&amp;"undefined"!==a.showBanner&amp;&amp;a.showBanner()}};"use strict";
C3.Plugins.GM_SDK.Cnds={ResumeGame(){return!this._adPlaying},PauseGame(){return this._adPlaying},PreloadedAd(){return this._preloadedAd},AdViewed(){return this._adViewed}};"use strict";C3.Plugins.GM_SDK.Acts={ShowAd(){this.ShowAd()}};"use strict";C3.Plugins.GM_SDK.Exps={};"use strict";const C3$jscomp$221=self.C3;C3$jscomp$221.Behaviors.Sin=class extends C3$jscomp$221.SDKBehaviorBase{constructor(a){super(a)}Release(){super.Release()}};const C3$jscomp$222=self.C3;C3$jscomp$222.Behaviors.Sin.Type=class extends C3$jscomp$222.SDKBehaviorTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}};
const C3$jscomp$223=self.C3,C3X$jscomp$23=self.C3X,IBehaviorInstance$jscomp$2=self.IBehaviorInstance,_2pi=2*Math.PI,_pi_2=Math.PI/2,_3pi_2=3*Math.PI/2,MOVEMENT_LOOKUP=[0,1,8,3,4,2,5,6,9,7];
C3$jscomp$223.Behaviors.Sin.Instance=class extends C3$jscomp$223.SDKBehaviorInstanceBase{constructor(a,b){super(a);this._mag=this._period=this._wave=this._movement=this._i=0;this._isEnabled=!0;this._ratio=this._lastKnownValue2=this._lastKnownValue=this._initialValue2=this._initialValue=this._magnitudeRandom=this._periodOffsetRandom=this._periodRandom=this._baseMag=this._basePeriodOffset=this._basePeriod=0;b&amp;&amp;(this._movement=MOVEMENT_LOOKUP[b[0]],this._wave=b[1],this._periodRandom=this._runtime.Random()*
b[3],this._basePeriod=b[2],this._period=b[2],this._period+=this._periodRandom,this._basePeriodOffset=b[4],0!==this._period&amp;&amp;(this._periodOffsetRandom=this._runtime.Random()*b[5],this._i=b[4]/this._period*_2pi,this._i+=this._periodOffsetRandom/this._period*_2pi),this._magnitudeRandom=this._runtime.Random()*b[7],this._baseMag=b[6],this._mag=b[6],this._mag+=this._magnitudeRandom,this._isEnabled=!!b[8]);5===this._movement&amp;&amp;(this._mag=C3$jscomp$223.toRadians(this._mag));this.Init();this._isEnabled&amp;&amp;this._StartTicking()}Release(){super.Release()}SaveToJson(){return{i:this._i,
e:this._isEnabled,mv:this._movement,w:this._wave,p:this._period,mag:this._mag,iv:this._initialValue,iv2:this._initialValue2,r:this._ratio,lkv:this._lastKnownValue,lkv2:this._lastKnownValue2}}LoadFromJson(a){this._i=a.i;this._SetEnabled(a.e);this._movement=a.mv;this._wave=a.w;this._period=a.p;this._mag=a.mag;this._initialValue=a.iv;this._initialValue2=a.iv2;this._ratio=a.r;this._lastKnownValue=a.lkv;this._lastKnownValue2=a.lkv2}Init(){const a=this._inst.GetWorldInfo();switch(this._movement){case 0:this._initialValue=
a.GetX();break;case 1:this._initialValue=a.GetY();break;case 2:this._initialValue=a.GetWidth();this._ratio=a.GetHeight()/a.GetWidth();break;case 3:this._initialValue=a.GetWidth();break;case 4:this._initialValue=a.GetHeight();break;case 5:this._initialValue=a.GetAngle();break;case 6:this._initialValue=a.GetOpacity();break;case 7:this._initialValue=0;break;case 8:this._initialValue=a.GetX();this._initialValue2=a.GetY();break;case 9:this._initialValue=a.GetZElevation()}this._lastKnownValue=this._initialValue;
this._lastKnownValue2=this._initialValue2}WaveFunc(a){a%=_2pi;switch(this._wave){case 0:return Math.sin(a);case 1:return a&lt;=_pi_2?a/_pi_2:a&lt;=_3pi_2?1-2*(a-_pi_2)/Math.PI:(a-_3pi_2)/_pi_2-1;case 2:return 2*a/_2pi-1;case 3:return-2*a/_2pi+1;case 4:return a&lt;Math.PI?-1:1}return 0}Tick(){const a=this._runtime.GetDt(this._inst);this._isEnabled&amp;&amp;0!==a&amp;&amp;(this._i=0===this._period?0:(this._i+a/this._period*_2pi)%_2pi,this._UpdateFromPhase())}_UpdateFromPhase(){const a=this._inst.GetWorldInfo();switch(this._movement){case 0:a.GetX()!==
this._lastKnownValue&amp;&amp;(this._initialValue+=a.GetX()-this._lastKnownValue);a.SetX(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=a.GetX();break;case 1:a.GetY()!==this._lastKnownValue&amp;&amp;(this._initialValue+=a.GetY()-this._lastKnownValue);a.SetY(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=a.GetY();break;case 2:a.SetWidth(this._initialValue+this.WaveFunc(this._i)*this._mag);a.SetHeight(a.GetWidth()*this._ratio);break;case 3:a.SetWidth(this._initialValue+
this.WaveFunc(this._i)*this._mag);break;case 4:a.SetHeight(this._initialValue+this.WaveFunc(this._i)*this._mag);break;case 5:a.GetAngle()!==this._lastKnownValue&amp;&amp;(this._initialValue=C3$jscomp$223.clampAngle(this._initialValue+(a.GetAngle()-this._lastKnownValue)));a.SetAngle(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=a.GetAngle();break;case 6:a.SetOpacity(this._initialValue+this.WaveFunc(this._i)*this._mag/100);break;case 8:a.GetX()!==this._lastKnownValue&amp;&amp;(this._initialValue+=
a.GetX()-this._lastKnownValue);a.GetY()!==this._lastKnownValue2&amp;&amp;(this._initialValue2+=a.GetY()-this._lastKnownValue2);a.SetX(this._initialValue+Math.cos(a.GetAngle())*this.WaveFunc(this._i)*this._mag);a.SetY(this._initialValue2+Math.sin(a.GetAngle())*this.WaveFunc(this._i)*this._mag);this._lastKnownValue=a.GetX();this._lastKnownValue2=a.GetY();break;case 9:a.SetZElevation(this._initialValue+this.WaveFunc(this._i)*this._mag)}a.SetBboxChanged()}_OnSpriteFrameChanged(a,b){}_SetPeriod(a){this._period=
a}_GetPeriod(){return this._period}_SetMagnitude(a){this._mag=a}_SetMagnitude_ConvertAngle(a){5===this._movement&amp;&amp;(a=C3$jscomp$223.toRadians(a));this._SetMagnitude(a)}_GetMagnitude(){return this._mag}_GetMagnitude_ConvertAngle(){let a=this._GetMagnitude();5===this._movement&amp;&amp;(a=C3$jscomp$223.toDegrees(a));return a}_SetMovement(a){5===this._movement&amp;&amp;5!==a&amp;&amp;(this._mag=C3$jscomp$223.toDegrees(this._mag));this._movement=a;this.Init()}_GetMovement(){return this._movement}_SetWave(a){this._wave=a}_GetWave(){return this._wave}_SetPhase(a){this._i=
C3$jscomp$223.clamp(a,0,2*Math.PI);this._UpdateFromPhase()}_GetPhase(){return this._i}_SetEnabled(a){(this._isEnabled=!!a)?this._StartTicking():this._StopTicking()}_IsEnabled(){return this._isEnabled}GetPropertyValueByIndex(a){switch(a){case 0:return this._movement;case 1:return this._wave;case 2:return this._basePeriod;case 6:return this._baseMag;case 8:return this._isEnabled}}SetPropertyValueByIndex(a,b){switch(a){case 0:this._movement=MOVEMENT_LOOKUP[b];this.Init();break;case 1:this._wave=b;break;
case 2:this._basePeriod=b;this._period=this._basePeriod+this._periodRandom;this._isEnabled||(0!==this._period?(this._i=this._basePeriodOffset/this._period*_2pi,this._i+=this._periodOffsetRandom/this._period*_2pi):this._i=0);break;case 6:this._baseMag=b;this._mag=this._baseMag+this._magnitudeRandom;5===this._movement&amp;&amp;(this._mag=C3$jscomp$223.toRadians(this._mag));break;case 8:this._isEnabled=!!b}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.sin.properties.enabled.name",
value:this._IsEnabled(),onedit:a=&gt;this._SetEnabled(a)},{name:"behaviors.sin.properties.period.name",value:this._GetPeriod(),onedit:a=&gt;this._SetPeriod(a)},{name:"behaviors.sin.properties.magnitude.name",value:this._GetMagnitude_ConvertAngle(),onedit:a=&gt;this._SetMagnitude_ConvertAngle(a)},{name:"behaviors.sin.debugger.value",value:this.WaveFunc(this._GetPhase())*this._GetMagnitude_ConvertAngle()}]}]}GetScriptInterfaceClass(){return self.ISineBehaviorInstance}};
const map$jscomp$21=new WeakMap,VALID_MOVEMENTS="horizontal vertical size width height angle opacity value-only forwards-backwards z-elevation".split(" "),VALID_WAVES=["sine","triangle","sawtooth","reverse-sawtooth","square"];
self.ISineBehaviorInstance=class extends IBehaviorInstance$jscomp$2{constructor(){super();map$jscomp$21.set(this,IBehaviorInstance$jscomp$2._GetInitInst().GetSdkInstance())}set period(a){C3X$jscomp$23.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetPeriod(a)}get period(){return map$jscomp$21.get(this)._GetPeriod()}set magnitude(a){C3X$jscomp$23.RequireFiniteNumber(a);map$jscomp$21.get(this)._SetMagnitude(a)}get magnitude(){return map$jscomp$21.get(this)._GetMagnitude()}set phase(a){map$jscomp$21.get(this)._SetPhase(a)}get phase(){return map$jscomp$21.get(this)._GetPhase()}set movement(a){C3X$jscomp$23.RequireString(a);
a=VALID_MOVEMENTS.indexOf(a);if(-1===a)throw Error("invalid movement");map$jscomp$21.get(this)._SetMovement(a)}get movement(){return VALID_MOVEMENTS[map$jscomp$21.get(this)._GetMovement()]}set wave(a){C3X$jscomp$23.RequireString(a);a=VALID_WAVES.indexOf(a);if(-1===a)throw Error("invalid wave");map$jscomp$21.get(this)._SetWave(a)}get wave(){return VALID_WAVES[map$jscomp$21.get(this)._GetWave()]}get value(){const a=map$jscomp$21.get(this);return a.WaveFunc(a._GetPhase())*a._GetMagnitude()}updateInitialState(){map$jscomp$21.get(this).Init()}set isEnabled(a){map$jscomp$21.get(this)._SetEnabled(!!a)}get isEnabled(){return map$jscomp$21.get(this)._IsEnabled()}};
const C3$jscomp$224=self.C3;C3$jscomp$224.Behaviors.Sin.Cnds={IsEnabled(){return this._IsEnabled()},CompareMovement(a){return this._GetMovement()===a},ComparePeriod(a,b){return C3$jscomp$224.compare(this._GetPeriod(),a,b)},CompareMagnitude(a,b){return C3$jscomp$224.compare(this._GetMagnitude_ConvertAngle(),a,b)},CompareWave(a){return this._GetWave()===a}};
self.C3.Behaviors.Sin.Acts={SetEnabled(a){this._SetEnabled(0!==a)},SetPeriod(a){this._SetPeriod(a)},SetMagnitude(a){this._SetMagnitude_ConvertAngle(a)},SetMovement(a){this._SetMovement(a)},SetWave(a){this._wave=a},SetPhase(a){const b=2*Math.PI;this._SetPhase(a*b%b)},UpdateInitialState(){this.Init()}};
self.C3.Behaviors.Sin.Exps={CyclePosition(){return this._GetPhase()/(2*Math.PI)},Period(){return this._GetPeriod()},Magnitude(){return this._GetMagnitude_ConvertAngle()},Value(){return this.WaveFunc(this._GetPhase())*this._GetMagnitude_ConvertAngle()}};const C3$jscomp$227=self.C3;
self.C3_GetObjectRefTable=function(){return[C3$jscomp$227.Plugins.Sprite,C3$jscomp$227.Plugins.Text,C3$jscomp$227.Behaviors.Sin,C3$jscomp$227.Plugins.Keyboard,C3$jscomp$227.Plugins.Touch,C3$jscomp$227.Plugins.LocalStorage,C3$jscomp$227.Plugins.Browser,C3$jscomp$227.Plugins.Audio,C3$jscomp$227.Plugins.GM_SDK,C3$jscomp$227.Plugins.System.Cnds.OnLayoutStart,C3$jscomp$227.Plugins.LocalStorage.Acts.GetItem,C3$jscomp$227.Plugins.System.Acts.SetLayerVisible,C3$jscomp$227.Plugins.System.Acts.SetVar,C3$jscomp$227.Plugins.System.Acts.Wait,
C3$jscomp$227.Plugins.System.Acts.SetBoolVar,C3$jscomp$227.Plugins.LocalStorage.Cnds.OnItemGet,C3$jscomp$227.Plugins.System.Cnds.Compare,C3$jscomp$227.Plugins.LocalStorage.Exps.ItemValue,C3$jscomp$227.Plugins.Sprite.Acts.SetAnim,C3$jscomp$227.Plugins.System.Cnds.Else,C3$jscomp$227.Plugins.System.Cnds.IsGroupActive,C3$jscomp$227.Plugins.Keyboard.Cnds.OnKey,C3$jscomp$227.Plugins.System.Cnds.CompareBoolVar,C3$jscomp$227.ScriptsInEvents.Egame_Event7_Act1,C3$jscomp$227.ScriptsInEvents.Egame_Event8_Act1,
C3$jscomp$227.ScriptsInEvents.Egame_Event9_Act1,C3$jscomp$227.ScriptsInEvents.Egame_Event10_Act1,C3$jscomp$227.Plugins.Touch.Cnds.OnNthTouchStart,C3$jscomp$227.Plugins.Touch.Exps.X,C3$jscomp$227.Plugins.Touch.Exps.Y,C3$jscomp$227.Plugins.Touch.Cnds.OnNthTouchEnd,C3$jscomp$227.Plugins.Touch.Cnds.IsTouchingObject,C3$jscomp$227.ScriptsInEvents.Egame_Event14_Act1,C3$jscomp$227.ScriptsInEvents.Egame_Event15_Act1,C3$jscomp$227.ScriptsInEvents.Egame_Event17_Act1,C3$jscomp$227.ScriptsInEvents.Egame_Event18_Act1,
C3$jscomp$227.Plugins.System.Cnds.EveryTick,C3$jscomp$227.Plugins.Text.Acts.SetText,C3$jscomp$227.Plugins.System.Cnds.LayerVisible,C3$jscomp$227.Plugins.Touch.Cnds.OnTapGestureObject,C3$jscomp$227.Plugins.System.Acts.RestartLayout,C3$jscomp$227.Plugins.System.Acts.ToggleBoolVar,C3$jscomp$227.Plugins.LocalStorage.Acts.SetItem,C3$jscomp$227.Plugins.GM_SDK.Acts.ShowAd,C3$jscomp$227.Plugins.Sprite.Cnds.OnDestroyed,C3$jscomp$227.Plugins.Sprite.Cnds.CompareInstanceVar,C3$jscomp$227.Plugins.Audio.Acts.PlayByName,
C3$jscomp$227.Plugins.Touch.Cnds.OnTouchObject,C3$jscomp$227.Plugins.Sprite.Cnds.IsBoolInstanceVarSet,C3$jscomp$227.Plugins.Sprite.Acts.SetBoolInstanceVar,C3$jscomp$227.Plugins.System.Cnds.TriggerOnce,C3$jscomp$227.Plugins.Sprite.Exps.Width,C3$jscomp$227.Plugins.Sprite.Exps.Height,C3$jscomp$227.Plugins.Sprite.Acts.SetWidth,C3$jscomp$227.Plugins.Sprite.Acts.SetHeight,C3$jscomp$227.Plugins.Browser.Acts.RequestFullScreen,C3$jscomp$227.ScriptsInEvents.Emenu_Event2_Act3,C3$jscomp$227.Plugins.GM_SDK.Cnds.PauseGame,
C3$jscomp$227.Plugins.GM_SDK.Cnds.ResumeGame]};
self.C3_JsPropNameTable=[{GameOverBG:0},{GameOverScoreTxt:0},{GameOverTitle:0},{GameOverBestTxt:0},{Sine:0},{Sprite2:0},{GridBoxBG:0},{Number:0},{Keyboard:0},{Touch:0},{EventName:0},{SimpleEvent:0},{ScoreTitle:0},{ScoreText:0},{BestText:0},{LocalStorage:0},{Sprite:0},{RestartText:0},{is_touchable:0},{button_audio:0},{button_restart:0},{ScoreTitle2:0},{Browser:0},{name:0},{SoundEffect:0},{Audio:0},{background:0},{Sprite3:0},{Sprite4:0},{background_main_menu:0},{tittle:0},{button_play:0},{button_play_text:0},
{TileBG:0},{GameMonetizeSDK:0},{button_family:0},{TouchStartX:0},{TouchStartY:0},{BestScore:0},{Score:0},{Sound:0},{is_play_active:0},{width:0},{height:0},{is_preroll_done:0}];function and(a,b){return"string"===typeof a||"string"===typeof b?("number"===typeof a?(Math.round(1E10*a)/1E10).toString():a)+("number"===typeof b?(Math.round(1E10*b)/1E10).toString():b):a&amp;&amp;b?1:0}
self.C3_ExpressionFuncs=[()=&gt;"Best",()=&gt;2,()=&gt;0,()=&gt;"Sound",()=&gt;.256,a=&gt;{const b=a._GetNode(0).GetBoundMethod();return()=&gt;b()},a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;b.GetValue()?"On":"Off"},()=&gt;"Input Handling",a=&gt;{const b=a._GetNode(0).GetVar(),d=a._GetNode(1).GetBoundMethod();return()=&gt;Math.abs(b.GetValue()-d())},a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;b.GetValue()},()=&gt;"GamePlayPanel",a=&gt;{const b=a._GetNode(0).GetVar(),d=a._GetNode(1).GetVar(),c=a._GetNode(2).GetVar(),e=a._GetNode(3).GetVar();
return()=&gt;b.GetValue()&lt;d.GetValue()?c.GetValue():e.GetValue()},a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;b.GetValue()?0:1},()=&gt;"GameOverPanel",a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;and("Skor : ",b.GetValue())},a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;and("Tertinggi : ",b.GetValue())},()=&gt;"GameOver",()=&gt;1,a=&gt;{const b=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1).GetBoundMethod();return()=&gt;b()?d():0},a=&gt;{const b=a._GetNode(0);return()=&gt;b.ExpInstVar()},()=&gt;"",a=&gt;{const b=a._GetNode(0);
return()=&gt;b.ExpObject()},a=&gt;{const b=a._GetNode(0).GetVar();return()=&gt;1.1*b.GetValue()},()=&gt;.5,()=&gt;.3,()=&gt;.1];var module$str$c3runtime={};const colors$$module$str$Settings=[[1,0,0],[0,1,238/255],[1,234/255,0],[1,115/255,0],[122/255,205/255,240/255],[1,0,123/255],[225/255,0,1]],gridSize$$module$str$Settings=5,tileSpacing$$module$str$Settings=5,paddingSide$$module$str$Settings=40;var module$str$Settings={};module$str$Settings.colors=colors$$module$str$Settings;module$str$Settings.gridSize=gridSize$$module$str$Settings;module$str$Settings.paddingSide=paddingSide$$module$str$Settings;module$str$Settings.tileSpacing=tileSpacing$$module$str$Settings;function lerp$$module$str$Utils(a,b,d){return a+(b-a)*(1&lt;d?1:0&gt;d?0:d)}function clamp$$module$str$Utils(a,b,d){return a&lt;b?b:a&gt;d?d:a}function max$$module$str$Utils(a,b){return a&gt;b?a:b}function min$$module$str$Utils(a,b){return a&lt;b?a:b}function rand$$module$str$Utils(a,b){return Math.floor(Math.random()*(b-a))+a}function randomize$$module$str$Utils(a){a=a.slice();const b=[];for(;a.length;){const d=rand$$module$str$Utils(0,a.length);b.push(a[d]);a.splice(d,1)}return b}var module$str$Utils={};
module$str$Utils.clamp=clamp$$module$str$Utils;module$str$Utils.lerp=lerp$$module$str$Utils;module$str$Utils.max=max$$module$str$Utils;module$str$Utils.min=min$$module$str$Utils;module$str$Utils.rand=rand$$module$str$Utils;module$str$Utils.randomize=randomize$$module$str$Utils;class LinearMoveAnim$$module$str$LinearMoveAnim{constructor(a,b,d){this.normalized=0;this.speed=a;this.finished=!1;this.updateCallback=b;this.finishCallback=d}update(a){this.finished||(this.normalized=clamp$$module$str$Utils(this.normalized+a*this.speed,0,1),this.updateCallback&amp;&amp;this.updateCallback(this.normalized),1&lt;=this.normalized&amp;&amp;(this.finished=!0,this.finishCallback&amp;&amp;this.finishCallback()))}}var module$str$LinearMoveAnim={};module$str$LinearMoveAnim.default=LinearMoveAnim$$module$str$LinearMoveAnim;class LerpAnim$$module$str$LerpAnim{constructor(a,b,d,c,e){this.end=d;this.normalized=b;this.speed=a;this.finished=!1;this.updateCallback=c;this.finishCallback=e}update(a){this.finished||(this.normalized=clamp$$module$str$Utils(lerp$$module$str$Utils(this.normalized,this.end,a*this.speed),0,1),this.updateCallback&amp;&amp;this.updateCallback(this.normalized),1&lt;=this.normalized&amp;&amp;(this.finished=!0,this.finishCallback&amp;&amp;this.finishCallback()))}}var module$str$LerpAnim={};module$str$LerpAnim.default=LerpAnim$$module$str$LerpAnim;class WaitUntil$$module$str$WaitUntil{constructor(a,b){this.condition=a;this.completed=b;this.isCompelted=!1}update(a){!this.isCompleted&amp;&amp;this.condition()&amp;&amp;(this.isCompleted=!0,this.completed())}}var module$str$WaitUntil={};module$str$WaitUntil.default=WaitUntil$$module$str$WaitUntil;class MainScene$$module$str$MainScene{constructor(a){this.gameState="none";this.runtime=a;this.updatables=[];this.holders=[];this.startY=3*a.layout.height/4+60;this.tileWidth=(a.layout.width-2*paddingSide$$module$str$Settings-(gridSize$$module$str$Settings-1)*tileSpacing$$module$str$Settings)/gridSize$$module$str$Settings;for(let b=0;b&lt;gridSize$$module$str$Settings;b++)for(let d=0;d&lt;gridSize$$module$str$Settings;d++){const c=a.objects.GridBoxBG.createInstance(0,(d+.5)*this.tileWidth+d*tileSpacing$$module$str$Settings+
paddingSide$$module$str$Settings,this.startY-((b+.5)*this.tileWidth+b*tileSpacing$$module$str$Settings));this.holders.push(c);c.width=this.tileWidth;c.height=this.tileWidth;c.xCoordinate=d;c.yCoordinate=b}for(a=0;2&gt;a;a++)this.addRandom();this.startPlay()}addRandom(){var a=this.holders.filter(d=&gt;!d.tile);if(!a.length)return!1;a=a[rand$$module$str$Utils(0,a.length)];const b=this.runtime.objects.TileBG.createInstance(0,a.x,a.y);b.setSize(this.tileWidth,this.tileWidth);a.tile=b;b.holder=a;return!0}async applyMoves(a){this.animating=
!0;let b=0;a.length&amp;&amp;this.runtime.globalVars.Sound&amp;&amp;this.playSound("throw");for(const d of a){const c=this.getHolder(d.toX,d.toY),e=d.tile.holder;this.linearAnimAsync(7E3/Math.sqrt((c.x-e.x)*(c.x-e.x)+(c.y-e.y)*(c.y-e.y)),h=&gt;{d.tile.setPosition(lerp$$module$str$Utils(e.x,c.x,h),lerp$$module$str$Utils(e.y,c.y,h))}).then(()=&gt;{d.mergeTile?(d.tile.number.destroy(),d.tile.destroy(),d.mergeTile.doublePoints(),this.runtime.globalVars.Score+=d.mergeTile.value):(d.tile.x=c.x,d.tile.y=c.y);b++});d.mergeTile?
e.tile===d.tile&amp;&amp;(e.tile=null):(d.tile.holder.tile==d.tile&amp;&amp;(d.tile.holder.tile=null),d.tile.holder=c,c.tile=d.tile)}await this.waitUntil(()=&gt;b===a.length);this.animating=!1;this.hasMoves()||(this.gameState="over",sendEvent$$module$str$Main(this.runtime,"GameOver"),console.log("GameOver"))}hasMoves(){return this.holders.filter(a=&gt;!a.tile).length||[...Array(gridSize$$module$str$Settings).keys()].map(a=&gt;MainScene$$module$str$MainScene.findmoves(this.getRow(a))).flat().length||[...Array(gridSize$$module$str$Settings).keys()].map(a=&gt;
MainScene$$module$str$MainScene.findmoves(this.getColumn(a))).flat().length}getHolder(a,b){return this.holders[gridSize$$module$str$Settings*b+a]}async waitUntil(a){return new Promise((b,d)=&gt;{let c=null;c=new WaitUntil$$module$str$WaitUntil(a,()=&gt;{this.removeUpdatable(c);b()});this.addToUpdatable(c)})}async lerpAnimAsync(a,b,d,c){return new Promise((e,h)=&gt;{let k=null;k=new LerpAnim$$module$str$LerpAnim(a,b,d,c,()=&gt;{this.removeUpdatable(k);e()});this.addToUpdatable(k)})}async linearAnimAsync(a,b){return new Promise((d,
c)=&gt;{let e=null;e=new LinearMoveAnim$$module$str$LinearMoveAnim(a,b,()=&gt;{this.removeUpdatable(e);d()});this.addToUpdatable(e)})}playSound(a){if(this.runtime.globalVars.Sound){var b=this.runtime.objects.SoundEffect.createInstance(0,0,0);b.instVars.name=a;b.destroy()}}startPlay(){this.gameState="playing"}addToUpdatable(a){this.updatables.push(a)}removeUpdatable(a){this.updatables.splice(this.updatables.indexOf(a),1)}update(a){this.updatables.forEach(b=&gt;b.update(a.dt));if("playing"===this.gameState)for(const b of this.runtime.objects.TileBG.instances())b.update(a.dt)}slideLeft(){if("playing"===
this.gameState&amp;&amp;!this.animating){var a=[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;MainScene$$module$str$MainScene.findmoves(this.getRow(b))).flat();this.applyMoves(a);a.length&amp;&amp;this.addRandom()}}slideRight(){if("playing"===this.gameState&amp;&amp;!this.animating){var a=[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;MainScene$$module$str$MainScene.findmoves(this.getRow(b).reverse())).flat();this.applyMoves(a);a.length&amp;&amp;this.addRandom()}}slideUp(){if("playing"===this.gameState&amp;&amp;!this.animating){var a=
[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;MainScene$$module$str$MainScene.findmoves(this.getColumn(b).reverse())).flat();this.applyMoves(a);a.length&amp;&amp;this.addRandom()}}slideDown(){if("playing"===this.gameState&amp;&amp;!this.animating){var a=[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;MainScene$$module$str$MainScene.findmoves(this.getColumn(b))).flat();this.applyMoves(a);a.length&amp;&amp;this.addRandom()}}getRow(a){return[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;this.getHolder(b,
a))}getColumn(a){return[...Array(gridSize$$module$str$Settings).keys()].map(b=&gt;this.getHolder(a,b))}delay(a){return new Promise((b,d)=&gt;{setTimeout(b,a)})}static findmoves(a){let b=null,d=0;const c=[];for(let e=0;e&lt;a.length;e++)a[e].tile&amp;&amp;(null==b||b.tile.value!=a[e].tile.value?(d&lt;e&amp;&amp;c.push({tile:a[e].tile,mergeTile:null,toX:a[d].xCoordinate,toY:a[d].yCoordinate}),d++,b=a[e]):b.tile.value===a[e].tile.value&amp;&amp;(c.push({tile:a[e].tile,mergeTile:b.tile,toX:a[d-1].xCoordinate,toY:a[d-1].yCoordinate}),b=
null));return c}}var module$str$MainScene={};module$str$MainScene.default=MainScene$$module$str$MainScene;class Tile$$module$str$Tile extends ISpriteInstance{constructor(){super();this.numberOffsetY=9;this.number=this.runtime.objects.Number.createInstance(0,this.x,this.y+this.numberOffsetY);this.setValue(2);this.number.text=this.value+"";this.defaultFontSize=this.number.sizePt}update(a){this.number.x=this.x;this.number.y=this.y+this.numberOffsetY}doublePoints(){this.setValue(2*this.value)}setSize(a,b){this.width=a;this.height=b}setPosition(a,b){this.x=a;this.y=b;this.number.x=this.x;this.number.y=this.y+
this.numberOffsetY}setValue(a){this.value=a;this.number.text=this.value+"";4&lt;=this.number.text.length?this.number.sizePt=.65*this.defaultFontSize:3&lt;=this.number.text.length&amp;&amp;(this.number.sizePt=.75*this.defaultFontSize);this.animationFrame=Math.log(this.value)/Math.log(2)%colors$$module$str$Settings.length-1}}var module$str$Tile={};module$str$Tile.default=Tile$$module$str$Tile;let categories$$module$str$Main=[],scene$$module$str$Main=null;runOnStartup(async a=&gt;{a.addEventListener("beforeprojectstart",()=&gt;OnBeforeProjectStart$$module$str$Main(a))});function LoadGame$$module$str$Main(a){a.getLayout("Game").addEventListener("beforelayoutstart",()=&gt;{scene$$module$str$Main=new MainScene$$module$str$MainScene(a)});a.objects.TileBG.setInstanceClass(Tile$$module$str$Tile);a.goToLayout("Game")}
function sendEvent$$module$str$Main(a,b){a=a.objects.SimpleEvent.createInstance(0,0,0);a.instVars.EventName=b;a.destroy()}async function OnBeforeProjectStart$$module$str$Main(a){a.goToLayout("Menu");a.addEventListener("tick",()=&gt;Tick$$module$str$Main(a))}function Tick$$module$str$Main(a){scene$$module$str$Main&amp;&amp;scene$$module$str$Main.update(a)}var module$str$Main={get scene(){return scene$$module$str$Main}};module$str$Main.LoadGame=LoadGame$$module$str$Main;module$str$Main.categories=categories$$module$str$Main;
module$str$Main.sendEvent=sendEvent$$module$str$Main;const scriptsInEvents$$module$str$scriptsInEvents={async Egame_Event7_Act1(a,b){scene$$module$str$Main.slideLeft()},async Egame_Event8_Act1(a,b){scene$$module$str$Main.slideRight()},async Egame_Event9_Act1(a,b){scene$$module$str$Main.slideUp()},async Egame_Event10_Act1(a,b){scene$$module$str$Main.slideDown()},async Egame_Event14_Act1(a,b){scene$$module$str$Main.slideLeft()},async Egame_Event15_Act1(a,b){scene$$module$str$Main.slideRight()},async Egame_Event17_Act1(a,b){scene$$module$str$Main.slideUp()},
async Egame_Event18_Act1(a,b){scene$$module$str$Main.slideDown()},async Emenu_Event2_Act3(a,b){LoadGame$$module$str$Main(a)}};self.C3.ScriptsInEvents=scriptsInEvents$$module$str$scriptsInEvents;var module$str$scriptsInEvents={};var module$str$__c3root__={};
</pre></body></html>