<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Generated by Construct 3, the game and app creator :: https://www.construct.net
'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,b,a){if(c==Array.prototype||c==Object.prototype)return c;c[b]=a.value;return c};
$jscomp.getGlobal=function(c){c=["object"==typeof globalThis&amp;&amp;globalThis,c,"object"==typeof window&amp;&amp;window,"object"==typeof self&amp;&amp;self,"object"==typeof global&amp;&amp;global];for(var b=0;b&lt;c.length;++b){var a=c[b];if(a&amp;&amp;a.Math==Math)return a}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&amp;&amp;"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(c,b){var a=$jscomp.propertyToPolyfillSymbol[b];if(null==a)return c[b];a=c[a];return void 0!==a?a:c[b]};$jscomp.polyfill=function(c,b,a,f){b&amp;&amp;($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(c,b,a,f):$jscomp.polyfillUnisolated(c,b,a,f))};
$jscomp.polyfillUnisolated=function(c,b,a,f){a=$jscomp.global;c=c.split(".");for(f=0;f&lt;c.length-1;f++){var d=c[f];if(!(d in a))return;a=a[d]}c=c[c.length-1];f=a[c];b=b(f);b!=f&amp;&amp;null!=b&amp;&amp;$jscomp.defineProperty(a,c,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(c,b,a,f){var d=c.split(".");c=1===d.length;f=d[0];f=!c&amp;&amp;f in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var e=0;e&lt;d.length-1;e++){var g=d[e];if(!(g in f))return;f=f[g]}d=d[d.length-1];a=$jscomp.IS_SYMBOL_NATIVE&amp;&amp;"es6"===a?f[d]:null;b=b(a);null!=b&amp;&amp;(c?$jscomp.defineProperty($jscomp.polyfills,d,{configurable:!0,writable:!0,value:b}):b!==a&amp;&amp;($jscomp.propertyToPolyfillSymbol[d]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(d):$jscomp.POLYFILL_PREFIX+d,d=
$jscomp.propertyToPolyfillSymbol[d],$jscomp.defineProperty(f,d,{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("globalThis",function(c){return c||$jscomp.global},"es_2020","es3");
(function(c,b){"object"===typeof exports&amp;&amp;"undefined"!==typeof module?b(exports):"function"===typeof define&amp;&amp;define.amd?define(["exports"],b):(c=c||self,b(c.glMatrix={}))})(this,function(c){function b(k,p,v){var z=p[0],A=p[1],D=p[2];p=p[3];var F=v[0],I=v[1],K=v[2];v=v[3];k[0]=z*F+D*I;k[1]=A*F+p*I;k[2]=z*K+D*v;k[3]=A*K+p*v;return k}function a(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];k[3]=p[3]-v[3];return k}function f(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4];p=p[5];var K=v[0],M=v[1],
Q=v[2],S=v[3],X=v[4];v=v[5];k[0]=z*K+D*M;k[1]=A*K+F*M;k[2]=z*Q+D*S;k[3]=A*Q+F*S;k[4]=z*X+D*v+I;k[5]=A*X+F*v+p;return k}function d(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];k[3]=p[3]-v[3];k[4]=p[4]-v[4];k[5]=p[5]-v[5];return k}function e(){var k=new ma(9);ma!=Float32Array&amp;&amp;(k[1]=0,k[2]=0,k[3]=0,k[5]=0,k[6]=0,k[7]=0);k[0]=1;k[4]=1;k[8]=1;return k}function g(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7];p=p[8];var S=v[0],X=v[1],U=v[2],ca=v[3],ba=v[4],Z=v[5],ra=v[6],la=
v[7];v=v[8];k[0]=S*z+X*F+U*M;k[1]=S*A+X*I+U*Q;k[2]=S*D+X*K+U*p;k[3]=ca*z+ba*F+Z*M;k[4]=ca*A+ba*I+Z*Q;k[5]=ca*D+ba*K+Z*p;k[6]=ra*z+la*F+v*M;k[7]=ra*A+la*I+v*Q;k[8]=ra*D+la*K+v*p;return k}function h(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];k[3]=p[3]-v[3];k[4]=p[4]-v[4];k[5]=p[5]-v[5];k[6]=p[6]-v[6];k[7]=p[7]-v[7];k[8]=p[8]-v[8];return k}function l(k){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k}function m(k,
p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7],S=p[8],X=p[9],U=p[10],ca=p[11],ba=p[12],Z=p[13],ra=p[14];p=p[15];var la=v[0],oa=v[1],pa=v[2],na=v[3];k[0]=la*z+oa*I+pa*S+na*ba;k[1]=la*A+oa*K+pa*X+na*Z;k[2]=la*D+oa*M+pa*U+na*ra;k[3]=la*F+oa*Q+pa*ca+na*p;la=v[4];oa=v[5];pa=v[6];na=v[7];k[4]=la*z+oa*I+pa*S+na*ba;k[5]=la*A+oa*K+pa*X+na*Z;k[6]=la*D+oa*M+pa*U+na*ra;k[7]=la*F+oa*Q+pa*ca+na*p;la=v[8];oa=v[9];pa=v[10];na=v[11];k[8]=la*z+oa*I+pa*S+na*ba;k[9]=la*A+oa*K+pa*X+na*Z;k[10]=la*D+oa*
M+pa*U+na*ra;k[11]=la*F+oa*Q+pa*ca+na*p;la=v[12];oa=v[13];pa=v[14];na=v[15];k[12]=la*z+oa*I+pa*S+na*ba;k[13]=la*A+oa*K+pa*X+na*Z;k[14]=la*D+oa*M+pa*U+na*ra;k[15]=la*F+oa*Q+pa*ca+na*p;return k}function n(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=z+z,K=A+A,M=D+D;p=z*I;var Q=z*K;z*=M;var S=A*K;A*=M;D*=M;I*=F;K*=F;F*=M;k[0]=1-(S+D);k[1]=Q+F;k[2]=z-K;k[3]=0;k[4]=Q-F;k[5]=1-(p+D);k[6]=A+I;k[7]=0;k[8]=z+K;k[9]=A-I;k[10]=1-(p+S);k[11]=0;k[12]=v[0];k[13]=v[1];k[14]=v[2];k[15]=1;return k}function r(k,p){k[0]=
p[12];k[1]=p[13];k[2]=p[14];return k}function q(k,p){var v=p[4],z=p[5],A=p[6],D=p[8],F=p[9],I=p[10];k[0]=Math.hypot(p[0],p[1],p[2]);k[1]=Math.hypot(v,z,A);k[2]=Math.hypot(D,F,I);return k}function t(k,p){var v=new ma(3);q(v,p);var z=1/v[0],A=1/v[1],D=1/v[2],F=p[0]*z;v=p[1]*A;var I=p[2]*D,K=p[4]*z,M=p[5]*A,Q=p[6]*D;z*=p[8];A*=p[9];p=p[10]*D;D=F+M+p;0&lt;D?(F=2*Math.sqrt(D+1),k[3]=.25*F,k[0]=(Q-A)/F,k[1]=(z-I)/F,k[2]=(v-K)/F):F&gt;M&amp;&amp;F&gt;p?(F=2*Math.sqrt(1+F-M-p),k[3]=(Q-A)/F,k[0]=.25*F,k[1]=(v+K)/F,k[2]=(z+
I)/F):M&gt;p?(F=2*Math.sqrt(1+M-F-p),k[3]=(z-I)/F,k[0]=(v+K)/F,k[1]=.25*F,k[2]=(Q+A)/F):(F=2*Math.sqrt(1+p-F-M),k[3]=(v-K)/F,k[0]=(z+I)/F,k[1]=(Q+A)/F,k[2]=.25*F);return k}function u(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];k[3]=p[3]-v[3];k[4]=p[4]-v[4];k[5]=p[5]-v[5];k[6]=p[6]-v[6];k[7]=p[7]-v[7];k[8]=p[8]-v[8];k[9]=p[9]-v[9];k[10]=p[10]-v[10];k[11]=p[11]-v[11];k[12]=p[12]-v[12];k[13]=p[13]-v[13];k[14]=p[14]-v[14];k[15]=p[15]-v[15];return k}function w(){var k=new ma(3);ma!=Float32Array&amp;&amp;
(k[0]=0,k[1]=0,k[2]=0);return k}function y(k){return Math.hypot(k[0],k[1],k[2])}function C(k,p,v){var z=new ma(3);z[0]=k;z[1]=p;z[2]=v;return z}function G(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];return k}function x(k,p,v){k[0]=p[0]*v[0];k[1]=p[1]*v[1];k[2]=p[2]*v[2];return k}function B(k,p,v){k[0]=p[0]/v[0];k[1]=p[1]/v[1];k[2]=p[2]/v[2];return k}function H(k,p){return Math.hypot(p[0]-k[0],p[1]-k[1],p[2]-k[2])}function P(k,p){var v=p[0]-k[0],z=p[1]-k[1];k=p[2]-k[2];return v*v+z*z+k*k}function E(k){var p=
k[0],v=k[1];k=k[2];return p*p+v*v+k*k}function J(k,p){var v=p[0],z=p[1],A=p[2];v=v*v+z*z+A*A;0&lt;v&amp;&amp;(v=1/Math.sqrt(v));k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;return k}function O(k,p){return k[0]*p[0]+k[1]*p[1]+k[2]*p[2]}function R(k,p,v){var z=p[0],A=p[1];p=p[2];var D=v[0],F=v[1];v=v[2];k[0]=A*v-p*F;k[1]=p*D-z*v;k[2]=z*F-A*D;return k}function T(){var k=new ma(4);ma!=Float32Array&amp;&amp;(k[0]=0,k[1]=0,k[2]=0,k[3]=0);return k}function Y(k){var p=new ma(4);p[0]=k[0];p[1]=k[1];p[2]=k[2];p[3]=k[3];return p}function W(k,
p,v,z){var A=new ma(4);A[0]=k;A[1]=p;A[2]=v;A[3]=z;return A}function ea(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];return k}function qa(k,p,v,z,A){k[0]=p;k[1]=v;k[2]=z;k[3]=A;return k}function ja(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];return k}function xa(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];k[2]=p[2]-v[2];k[3]=p[3]-v[3];return k}function ua(k,p,v){k[0]=p[0]*v[0];k[1]=p[1]*v[1];k[2]=p[2]*v[2];k[3]=p[3]*v[3];return k}function Da(k,p,v){k[0]=p[0]/v[0];k[1]=p[1]/v[1];k[2]=
p[2]/v[2];k[3]=p[3]/v[3];return k}function Ea(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;return k}function Ba(k,p){return Math.hypot(p[0]-k[0],p[1]-k[1],p[2]-k[2],p[3]-k[3])}function Aa(k,p){var v=p[0]-k[0],z=p[1]-k[1],A=p[2]-k[2];k=p[3]-k[3];return v*v+z*z+A*A+k*k}function ia(k){return Math.hypot(k[0],k[1],k[2],k[3])}function Fa(k){var p=k[0],v=k[1],z=k[2];k=k[3];return p*p+v*v+z*z+k*k}function wa(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=v*v+z*z+A*A+p*p;0&lt;D&amp;&amp;(D=1/Math.sqrt(D));k[0]=
v*D;k[1]=z*D;k[2]=A*D;k[3]=p*D;return k}function Ca(k,p){return k[0]*p[0]+k[1]*p[1]+k[2]*p[2]+k[3]*p[3]}function Pa(k,p,v,z){var A=p[0],D=p[1],F=p[2];p=p[3];k[0]=A+z*(v[0]-A);k[1]=D+z*(v[1]-D);k[2]=F+z*(v[2]-F);k[3]=p+z*(v[3]-p);return k}function Qa(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]&amp;&amp;k[3]===p[3]}function Ra(k,p){var v=k[0],z=k[1],A=k[2];k=k[3];var D=p[0],F=p[1],I=p[2];p=p[3];return Math.abs(v-D)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(D))&amp;&amp;Math.abs(z-F)&lt;=.000001*Math.max(1,Math.abs(z),
Math.abs(F))&amp;&amp;Math.abs(A-I)&lt;=.000001*Math.max(1,Math.abs(A),Math.abs(I))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))}function Ja(){var k=new ma(4);ma!=Float32Array&amp;&amp;(k[0]=0,k[1]=0,k[2]=0);k[3]=1;return k}function Sa(k,p,v){v*=.5;var z=Math.sin(v);k[0]=z*p[0];k[1]=z*p[1];k[2]=z*p[2];k[3]=Math.cos(v);return k}function Ta(k,p,v){var z=p[0],A=p[1],D=p[2];p=p[3];var F=v[0],I=v[1],K=v[2];v=v[3];k[0]=z*v+p*F+A*K-D*I;k[1]=A*v+p*I+D*F-z*K;k[2]=D*v+p*K+z*I-A*F;k[3]=p*v-z*F-A*I-D*K;return k}
function Ua(k,p,v){v*=.5;var z=p[0],A=p[1],D=p[2];p=p[3];var F=Math.sin(v);v=Math.cos(v);k[0]=z*v+p*F;k[1]=A*v+D*F;k[2]=D*v-A*F;k[3]=p*v-z*F;return k}function Va(k,p,v){v*=.5;var z=p[0],A=p[1],D=p[2];p=p[3];var F=Math.sin(v);v=Math.cos(v);k[0]=z*v-D*F;k[1]=A*v+p*F;k[2]=D*v+z*F;k[3]=p*v-A*F;return k}function Wa(k,p,v){v*=.5;var z=p[0],A=p[1],D=p[2];p=p[3];var F=Math.sin(v);v=Math.cos(v);k[0]=z*v+A*F;k[1]=A*v-z*F;k[2]=D*v+p*F;k[3]=p*v-D*F;return k}function Xa(k,p){var v=p[0],z=p[1],A=p[2],D=Math.sqrt(v*
v+z*z+A*A);p=Math.exp(p[3]);var F=0&lt;D?p*Math.sin(D)/D:0;k[0]=v*F;k[1]=z*F;k[2]=A*F;k[3]=p*Math.cos(D);return k}function Za(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=Math.sqrt(v*v+z*z+A*A);D=0&lt;D?Math.atan2(D,p)/D:0;k[0]=v*D;k[1]=z*D;k[2]=A*D;k[3]=.5*Math.log(v*v+z*z+A*A+p*p);return k}function Ka(k,p,v,z){var A=p[0],D=p[1],F=p[2];p=p[3];var I=v[0],K=v[1],M=v[2];v=v[3];var Q=A*I+D*K+F*M+p*v;0&gt;Q&amp;&amp;(Q=-Q,I=-I,K=-K,M=-M,v=-v);if(.000001&lt;1-Q){var S=Math.acos(Q);var X=Math.sin(S);Q=Math.sin((1-z)*S)/X;z=
Math.sin(z*S)/X}else Q=1-z;k[0]=Q*A+z*I;k[1]=Q*D+z*K;k[2]=Q*F+z*M;k[3]=Q*p+z*v;return k}function $a(k,p){var v=p[0]+p[4]+p[8];if(0&lt;v)v=Math.sqrt(v+1),k[3]=.5*v,v=.5/v,k[0]=(p[5]-p[7])*v,k[1]=(p[6]-p[2])*v,k[2]=(p[1]-p[3])*v;else{var z=0;p[4]&gt;p[0]&amp;&amp;(z=1);p[8]&gt;p[3*z+z]&amp;&amp;(z=2);var A=(z+1)%3,D=(z+2)%3;v=Math.sqrt(p[3*z+z]-p[3*A+A]-p[3*D+D]+1);k[z]=.5*v;v=.5/v;k[3]=(p[3*A+D]-p[3*D+A])*v;k[A]=(p[3*A+z]+p[3*z+A])*v;k[D]=(p[3*D+z]+p[3*z+D])*v}return k}function ab(k,p,v){var z=.5*v[0],A=.5*v[1];v=.5*v[2];
var D=p[0],F=p[1],I=p[2];p=p[3];k[0]=D;k[1]=F;k[2]=I;k[3]=p;k[4]=z*p+A*I-v*F;k[5]=A*p+v*D-z*I;k[6]=v*p+z*F-A*D;k[7]=-z*D-A*F-v*I;return k}function bb(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];k[4]=p[4];k[5]=p[5];k[6]=p[6];k[7]=p[7];return k}function cb(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=v[4],K=v[5],M=v[6],Q=v[7],S=p[4],X=p[5],U=p[6];p=p[7];var ca=v[0],ba=v[1],Z=v[2];v=v[3];k[0]=z*v+F*ca+A*Z-D*ba;k[1]=A*v+F*ba+D*ca-z*Z;k[2]=D*v+F*Z+z*ba-A*ca;k[3]=F*v-z*ca-A*ba-D*Z;k[4]=z*Q+F*I+A*M-D*K+S*v+
p*ca+X*Z-U*ba;k[5]=A*Q+F*K+D*I-z*M+X*v+p*ba+U*ca-S*Z;k[6]=D*Q+F*M+z*K-A*I+U*v+p*Z+S*ba-X*ca;k[7]=F*Q-z*I-A*K-D*M+p*v-S*ca-X*ba-U*Z;return k}function db(){var k=new ma(2);ma!=Float32Array&amp;&amp;(k[0]=0,k[1]=0);return k}function eb(k,p,v){k[0]=p[0]-v[0];k[1]=p[1]-v[1];return k}function fb(k,p,v){k[0]=p[0]*v[0];k[1]=p[1]*v[1];return k}function gb(k,p,v){k[0]=p[0]/v[0];k[1]=p[1]/v[1];return k}function hb(k,p){return Math.hypot(p[0]-k[0],p[1]-k[1])}function ib(k,p){var v=p[0]-k[0];k=p[1]-k[1];return v*v+k*
k}function jb(k){return Math.hypot(k[0],k[1])}function kb(k){var p=k[0];k=k[1];return p*p+k*k}var ma="undefined"!==typeof Float32Array?Float32Array:Array,Ga=Math.random,lb=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var k=0,p=arguments.length;p--;)k+=arguments[p]*arguments[p];return Math.sqrt(k)});var mb=Object.freeze({__proto__:null,EPSILON:.000001,get ARRAY_TYPE(){return ma},RANDOM:Ga,setMatrixArrayType:function(k){ma=k},toRadian:function(k){return k*lb},equals:function(k,p){return Math.abs(k-
p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))}}),nb=Object.freeze({__proto__:null,create:function(){var k=new ma(4);ma!=Float32Array&amp;&amp;(k[1]=0,k[2]=0);k[0]=1;k[3]=1;return k},clone:function(k){var p=new ma(4);p[0]=k[0];p[1]=k[1];p[2]=k[2];p[3]=k[3];return p},copy:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];return k},identity:function(k){k[0]=1;k[1]=0;k[2]=0;k[3]=1;return k},fromValues:function(k,p,v,z){var A=new ma(4);A[0]=k;A[1]=p;A[2]=v;A[3]=z;return A},set:function(k,p,v,z,A){k[0]=p;
k[1]=v;k[2]=z;k[3]=A;return k},transpose:function(k,p){if(k===p){var v=p[1];k[1]=p[2];k[2]=v}else k[0]=p[0],k[1]=p[2],k[2]=p[1],k[3]=p[3];return k},invert:function(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=v*p-A*z;if(!D)return null;D=1/D;k[0]=p*D;k[1]=-z*D;k[2]=-A*D;k[3]=v*D;return k},adjoint:function(k,p){var v=p[0];k[0]=p[3];k[1]=-p[1];k[2]=-p[2];k[3]=v;return k},determinant:function(k){return k[0]*k[3]-k[2]*k[1]},multiply:b,rotate:function(k,p,v){var z=p[0],A=p[1],D=p[2];p=p[3];var F=Math.sin(v);
v=Math.cos(v);k[0]=z*v+D*F;k[1]=A*v+p*F;k[2]=z*-F+D*v;k[3]=A*-F+p*v;return k},scale:function(k,p,v){var z=p[1],A=p[2],D=p[3],F=v[0];v=v[1];k[0]=p[0]*F;k[1]=z*F;k[2]=A*v;k[3]=D*v;return k},fromRotation:function(k,p){var v=Math.sin(p);p=Math.cos(p);k[0]=p;k[1]=v;k[2]=-v;k[3]=p;return k},fromScaling:function(k,p){k[0]=p[0];k[1]=0;k[2]=0;k[3]=p[1];return k},str:function(k){return"mat2("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+")"},frob:function(k){return Math.hypot(k[0],k[1],k[2],k[3])},LDU:function(k,p,v,
z){k[2]=z[2]/z[0];v[0]=z[0];v[1]=z[1];v[3]=z[3]-k[2]*v[1];return[k,p,v]},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];return k},subtract:a,exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]&amp;&amp;k[3]===p[3]},equals:function(k,p){var v=k[0],z=k[1],A=k[2];k=k[3];var D=p[0],F=p[1],I=p[2];p=p[3];return Math.abs(v-D)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(D))&amp;&amp;Math.abs(z-F)&lt;=.000001*Math.max(1,Math.abs(z),Math.abs(F))&amp;&amp;Math.abs(A-I)&lt;=.000001*Math.max(1,
Math.abs(A),Math.abs(I))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},multiplyScalar:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;return k},multiplyScalarAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;k[3]=p[3]+v[3]*z;return k},mul:b,sub:a}),ob=Object.freeze({__proto__:null,create:function(){var k=new ma(6);ma!=Float32Array&amp;&amp;(k[1]=0,k[2]=0,k[4]=0,k[5]=0);k[0]=1;k[3]=1;return k},clone:function(k){var p=new ma(6);p[0]=k[0];p[1]=k[1];p[2]=
k[2];p[3]=k[3];p[4]=k[4];p[5]=k[5];return p},copy:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];k[4]=p[4];k[5]=p[5];return k},identity:function(k){k[0]=1;k[1]=0;k[2]=0;k[3]=1;k[4]=0;k[5]=0;return k},fromValues:function(k,p,v,z,A,D){var F=new ma(6);F[0]=k;F[1]=p;F[2]=v;F[3]=z;F[4]=A;F[5]=D;return F},set:function(k,p,v,z,A,D,F){k[0]=p;k[1]=v;k[2]=z;k[3]=A;k[4]=D;k[5]=F;return k},invert:function(k,p){var v=p[0],z=p[1],A=p[2],D=p[3],F=p[4];p=p[5];var I=v*D-z*A;if(!I)return null;I=1/I;k[0]=D*I;
k[1]=-z*I;k[2]=-A*I;k[3]=v*I;k[4]=(A*p-D*F)*I;k[5]=(z*F-v*p)*I;return k},determinant:function(k){return k[0]*k[3]-k[1]*k[2]},multiply:f,rotate:function(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4];p=p[5];var K=Math.sin(v);v=Math.cos(v);k[0]=z*v+D*K;k[1]=A*v+F*K;k[2]=z*-K+D*v;k[3]=A*-K+F*v;k[4]=I;k[5]=p;return k},scale:function(k,p,v){var z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=v[0];v=v[1];k[0]=p[0]*K;k[1]=z*K;k[2]=A*v;k[3]=D*v;k[4]=F;k[5]=I;return k},translate:function(k,p,v){var z=p[0],A=p[1],D=p[2],
F=p[3],I=p[4];p=p[5];var K=v[0];v=v[1];k[0]=z;k[1]=A;k[2]=D;k[3]=F;k[4]=z*K+D*v+I;k[5]=A*K+F*v+p;return k},fromRotation:function(k,p){var v=Math.sin(p);p=Math.cos(p);k[0]=p;k[1]=v;k[2]=-v;k[3]=p;k[4]=0;k[5]=0;return k},fromScaling:function(k,p){k[0]=p[0];k[1]=0;k[2]=0;k[3]=p[1];k[4]=0;k[5]=0;return k},fromTranslation:function(k,p){k[0]=1;k[1]=0;k[2]=0;k[3]=1;k[4]=p[0];k[5]=p[1];return k},str:function(k){return"mat2d("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+", "+k[4]+", "+k[5]+")"},frob:function(k){return Math.hypot(k[0],
k[1],k[2],k[3],k[4],k[5],1)},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];k[4]=p[4]+v[4];k[5]=p[5]+v[5];return k},subtract:d,multiplyScalar:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;k[4]=p[4]*v;k[5]=p[5]*v;return k},multiplyScalarAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;k[3]=p[3]+v[3]*z;k[4]=p[4]+v[4]*z;k[5]=p[5]+v[5]*z;return k},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]&amp;&amp;k[3]===
p[3]&amp;&amp;k[4]===p[4]&amp;&amp;k[5]===p[5]},equals:function(k,p){var v=k[0],z=k[1],A=k[2],D=k[3],F=k[4];k=k[5];var I=p[0],K=p[1],M=p[2],Q=p[3],S=p[4];p=p[5];return Math.abs(v-I)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(I))&amp;&amp;Math.abs(z-K)&lt;=.000001*Math.max(1,Math.abs(z),Math.abs(K))&amp;&amp;Math.abs(A-M)&lt;=.000001*Math.max(1,Math.abs(A),Math.abs(M))&amp;&amp;Math.abs(D-Q)&lt;=.000001*Math.max(1,Math.abs(D),Math.abs(Q))&amp;&amp;Math.abs(F-S)&lt;=.000001*Math.max(1,Math.abs(F),Math.abs(S))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},
mul:f,sub:d}),pb=Object.freeze({__proto__:null,create:e,fromMat4:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[4];k[4]=p[5];k[5]=p[6];k[6]=p[8];k[7]=p[9];k[8]=p[10];return k},clone:function(k){var p=new ma(9);p[0]=k[0];p[1]=k[1];p[2]=k[2];p[3]=k[3];p[4]=k[4];p[5]=k[5];p[6]=k[6];p[7]=k[7];p[8]=k[8];return p},copy:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];k[4]=p[4];k[5]=p[5];k[6]=p[6];k[7]=p[7];k[8]=p[8];return k},fromValues:function(k,p,v,z,A,D,F,I,K){var M=new ma(9);M[0]=k;M[1]=p;
M[2]=v;M[3]=z;M[4]=A;M[5]=D;M[6]=F;M[7]=I;M[8]=K;return M},set:function(k,p,v,z,A,D,F,I,K,M){k[0]=p;k[1]=v;k[2]=z;k[3]=A;k[4]=D;k[5]=F;k[6]=I;k[7]=K;k[8]=M;return k},identity:function(k){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=1;k[5]=0;k[6]=0;k[7]=0;k[8]=1;return k},transpose:function(k,p){if(k===p){var v=p[1],z=p[2],A=p[5];k[1]=p[3];k[2]=p[6];k[3]=v;k[5]=p[7];k[6]=z;k[7]=A}else k[0]=p[0],k[1]=p[3],k[2]=p[6],k[3]=p[1],k[4]=p[4],k[5]=p[7],k[6]=p[2],k[7]=p[5],k[8]=p[8];return k},invert:function(k,p){var v=
p[0],z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=p[6],M=p[7];p=p[8];var Q=p*F-I*M,S=-p*D+I*K,X=M*D-F*K,U=v*Q+z*S+A*X;if(!U)return null;U=1/U;k[0]=Q*U;k[1]=(-p*z+A*M)*U;k[2]=(I*z-A*F)*U;k[3]=S*U;k[4]=(p*v-A*K)*U;k[5]=(-I*v+A*D)*U;k[6]=X*U;k[7]=(-M*v+z*K)*U;k[8]=(F*v-z*D)*U;return k},adjoint:function(k,p){var v=p[0],z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=p[6],M=p[7];p=p[8];k[0]=F*p-I*M;k[1]=A*M-z*p;k[2]=z*I-A*F;k[3]=I*K-D*p;k[4]=v*p-A*K;k[5]=A*D-v*I;k[6]=D*M-F*K;k[7]=z*K-v*M;k[8]=v*F-z*D;return k},determinant:function(k){var p=
k[3],v=k[4],z=k[5],A=k[6],D=k[7],F=k[8];return k[0]*(F*v-z*D)+k[1]*(-F*p+z*A)+k[2]*(D*p-v*A)},multiply:g,translate:function(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7];p=p[8];var S=v[0];v=v[1];k[0]=z;k[1]=A;k[2]=D;k[3]=F;k[4]=I;k[5]=K;k[6]=S*z+v*F+M;k[7]=S*A+v*I+Q;k[8]=S*D+v*K+p;return k},rotate:function(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7];p=p[8];var S=Math.sin(v);v=Math.cos(v);k[0]=v*z+S*F;k[1]=v*A+S*I;k[2]=v*D+S*K;k[3]=v*F-S*z;k[4]=v*I-S*A;k[5]=
v*K-S*D;k[6]=M;k[7]=Q;k[8]=p;return k},scale:function(k,p,v){var z=v[0];v=v[1];k[0]=z*p[0];k[1]=z*p[1];k[2]=z*p[2];k[3]=v*p[3];k[4]=v*p[4];k[5]=v*p[5];k[6]=p[6];k[7]=p[7];k[8]=p[8];return k},fromTranslation:function(k,p){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=1;k[5]=0;k[6]=p[0];k[7]=p[1];k[8]=1;return k},fromRotation:function(k,p){var v=Math.sin(p);p=Math.cos(p);k[0]=p;k[1]=v;k[2]=0;k[3]=-v;k[4]=p;k[5]=0;k[6]=0;k[7]=0;k[8]=1;return k},fromScaling:function(k,p){k[0]=p[0];k[1]=0;k[2]=0;k[3]=0;k[4]=p[1];k[5]=
0;k[6]=0;k[7]=0;k[8]=1;return k},fromMat2d:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=0;k[3]=p[2];k[4]=p[3];k[5]=0;k[6]=p[4];k[7]=p[5];k[8]=1;return k},fromQuat:function(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=v+v,F=z+z,I=A+A;v*=D;var K=z*D;z*=F;var M=A*D,Q=A*F;A*=I;D*=p;F*=p;p*=I;k[0]=1-z-A;k[3]=K-p;k[6]=M+F;k[1]=K+p;k[4]=1-v-A;k[7]=Q-D;k[2]=M-F;k[5]=Q+D;k[8]=1-v-z;return k},normalFromMat4:function(k,p){var v=p[0],z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=p[6],M=p[7],Q=p[8],S=p[9],X=p[10],U=p[11],ca=p[12],
ba=p[13],Z=p[14];p=p[15];var ra=v*I-z*F,la=v*K-A*F,oa=v*M-D*F,pa=z*K-A*I,na=z*M-D*I,za=A*M-D*K,L=Q*ba-S*ca,N=Q*Z-X*ca;Q=Q*p-U*ca;var V=S*Z-X*ba;S=S*p-U*ba;X=X*p-U*Z;U=ra*X-la*S+oa*V+pa*Q-na*N+za*L;if(!U)return null;U=1/U;k[0]=(I*X-K*S+M*V)*U;k[1]=(K*Q-F*X-M*N)*U;k[2]=(F*S-I*Q+M*L)*U;k[3]=(A*S-z*X-D*V)*U;k[4]=(v*X-A*Q+D*N)*U;k[5]=(z*Q-v*S-D*L)*U;k[6]=(ba*za-Z*na+p*pa)*U;k[7]=(Z*oa-ca*za-p*la)*U;k[8]=(ca*na-ba*oa+p*ra)*U;return k},projection:function(k,p,v){k[0]=2/p;k[1]=0;k[2]=0;k[3]=0;k[4]=-2/v;k[5]=
0;k[6]=-1;k[7]=1;k[8]=1;return k},str:function(k){return"mat3("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+", "+k[4]+", "+k[5]+", "+k[6]+", "+k[7]+", "+k[8]+")"},frob:function(k){return Math.hypot(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],k[8])},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];k[4]=p[4]+v[4];k[5]=p[5]+v[5];k[6]=p[6]+v[6];k[7]=p[7]+v[7];k[8]=p[8]+v[8];return k},subtract:h,multiplyScalar:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;k[4]=p[4]*
v;k[5]=p[5]*v;k[6]=p[6]*v;k[7]=p[7]*v;k[8]=p[8]*v;return k},multiplyScalarAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;k[3]=p[3]+v[3]*z;k[4]=p[4]+v[4]*z;k[5]=p[5]+v[5]*z;k[6]=p[6]+v[6]*z;k[7]=p[7]+v[7]*z;k[8]=p[8]+v[8]*z;return k},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]&amp;&amp;k[3]===p[3]&amp;&amp;k[4]===p[4]&amp;&amp;k[5]===p[5]&amp;&amp;k[6]===p[6]&amp;&amp;k[7]===p[7]&amp;&amp;k[8]===p[8]},equals:function(k,p){var v=k[0],z=k[1],A=k[2],D=k[3],F=k[4],I=k[5],K=k[6],M=k[7];k=k[8];var Q=
p[0],S=p[1],X=p[2],U=p[3],ca=p[4],ba=p[5],Z=p[6],ra=p[7];p=p[8];return Math.abs(v-Q)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(Q))&amp;&amp;Math.abs(z-S)&lt;=.000001*Math.max(1,Math.abs(z),Math.abs(S))&amp;&amp;Math.abs(A-X)&lt;=.000001*Math.max(1,Math.abs(A),Math.abs(X))&amp;&amp;Math.abs(D-U)&lt;=.000001*Math.max(1,Math.abs(D),Math.abs(U))&amp;&amp;Math.abs(F-ca)&lt;=.000001*Math.max(1,Math.abs(F),Math.abs(ca))&amp;&amp;Math.abs(I-ba)&lt;=.000001*Math.max(1,Math.abs(I),Math.abs(ba))&amp;&amp;Math.abs(K-Z)&lt;=.000001*Math.max(1,Math.abs(K),Math.abs(Z))&amp;&amp;Math.abs(M-
ra)&lt;=.000001*Math.max(1,Math.abs(M),Math.abs(ra))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},mul:g,sub:h}),qb=Object.freeze({__proto__:null,create:function(){var k=new ma(16);ma!=Float32Array&amp;&amp;(k[1]=0,k[2]=0,k[3]=0,k[4]=0,k[6]=0,k[7]=0,k[8]=0,k[9]=0,k[11]=0,k[12]=0,k[13]=0,k[14]=0);k[0]=1;k[5]=1;k[10]=1;k[15]=1;return k},clone:function(k){var p=new ma(16);p[0]=k[0];p[1]=k[1];p[2]=k[2];p[3]=k[3];p[4]=k[4];p[5]=k[5];p[6]=k[6];p[7]=k[7];p[8]=k[8];p[9]=k[9];p[10]=k[10];p[11]=k[11];p[12]=
k[12];p[13]=k[13];p[14]=k[14];p[15]=k[15];return p},copy:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];k[4]=p[4];k[5]=p[5];k[6]=p[6];k[7]=p[7];k[8]=p[8];k[9]=p[9];k[10]=p[10];k[11]=p[11];k[12]=p[12];k[13]=p[13];k[14]=p[14];k[15]=p[15];return k},fromValues:function(k,p,v,z,A,D,F,I,K,M,Q,S,X,U,ca,ba){var Z=new ma(16);Z[0]=k;Z[1]=p;Z[2]=v;Z[3]=z;Z[4]=A;Z[5]=D;Z[6]=F;Z[7]=I;Z[8]=K;Z[9]=M;Z[10]=Q;Z[11]=S;Z[12]=X;Z[13]=U;Z[14]=ca;Z[15]=ba;return Z},set:function(k,p,v,z,A,D,F,I,K,M,Q,S,X,U,ca,ba,
Z){k[0]=p;k[1]=v;k[2]=z;k[3]=A;k[4]=D;k[5]=F;k[6]=I;k[7]=K;k[8]=M;k[9]=Q;k[10]=S;k[11]=X;k[12]=U;k[13]=ca;k[14]=ba;k[15]=Z;return k},identity:l,transpose:function(k,p){if(k===p){var v=p[1],z=p[2],A=p[3],D=p[6],F=p[7],I=p[11];k[1]=p[4];k[2]=p[8];k[3]=p[12];k[4]=v;k[6]=p[9];k[7]=p[13];k[8]=z;k[9]=D;k[11]=p[14];k[12]=A;k[13]=F;k[14]=I}else k[0]=p[0],k[1]=p[4],k[2]=p[8],k[3]=p[12],k[4]=p[1],k[5]=p[5],k[6]=p[9],k[7]=p[13],k[8]=p[2],k[9]=p[6],k[10]=p[10],k[11]=p[14],k[12]=p[3],k[13]=p[7],k[14]=p[11],k[15]=
p[15];return k},invert:function(k,p){var v=p[0],z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=p[6],M=p[7],Q=p[8],S=p[9],X=p[10],U=p[11],ca=p[12],ba=p[13],Z=p[14];p=p[15];var ra=v*I-z*F,la=v*K-A*F,oa=v*M-D*F,pa=z*K-A*I,na=z*M-D*I,za=A*M-D*K,L=Q*ba-S*ca,N=Q*Z-X*ca,V=Q*p-U*ca,aa=S*Z-X*ba,fa=S*p-U*ba,ha=X*p-U*Z,da=ra*ha-la*fa+oa*aa+pa*V-na*N+za*L;if(!da)return null;da=1/da;k[0]=(I*ha-K*fa+M*aa)*da;k[1]=(A*fa-z*ha-D*aa)*da;k[2]=(ba*za-Z*na+p*pa)*da;k[3]=(X*na-S*za-U*pa)*da;k[4]=(K*V-F*ha-M*N)*da;k[5]=(v*ha-A*V+
D*N)*da;k[6]=(Z*oa-ca*za-p*la)*da;k[7]=(Q*za-X*oa+U*la)*da;k[8]=(F*fa-I*V+M*L)*da;k[9]=(z*V-v*fa-D*L)*da;k[10]=(ca*na-ba*oa+p*ra)*da;k[11]=(S*oa-Q*na-U*ra)*da;k[12]=(I*N-F*aa-K*L)*da;k[13]=(v*aa-z*N+A*L)*da;k[14]=(ba*la-ca*pa-Z*ra)*da;k[15]=(Q*pa-S*la+X*ra)*da;return k},adjoint:function(k,p){var v=p[0],z=p[1],A=p[2],D=p[3],F=p[4],I=p[5],K=p[6],M=p[7],Q=p[8],S=p[9],X=p[10],U=p[11],ca=p[12],ba=p[13],Z=p[14];p=p[15];k[0]=I*(X*p-U*Z)-S*(K*p-M*Z)+ba*(K*U-M*X);k[1]=-(z*(X*p-U*Z)-S*(A*p-D*Z)+ba*(A*U-D*X));
k[2]=z*(K*p-M*Z)-I*(A*p-D*Z)+ba*(A*M-D*K);k[3]=-(z*(K*U-M*X)-I*(A*U-D*X)+S*(A*M-D*K));k[4]=-(F*(X*p-U*Z)-Q*(K*p-M*Z)+ca*(K*U-M*X));k[5]=v*(X*p-U*Z)-Q*(A*p-D*Z)+ca*(A*U-D*X);k[6]=-(v*(K*p-M*Z)-F*(A*p-D*Z)+ca*(A*M-D*K));k[7]=v*(K*U-M*X)-F*(A*U-D*X)+Q*(A*M-D*K);k[8]=F*(S*p-U*ba)-Q*(I*p-M*ba)+ca*(I*U-M*S);k[9]=-(v*(S*p-U*ba)-Q*(z*p-D*ba)+ca*(z*U-D*S));k[10]=v*(I*p-M*ba)-F*(z*p-D*ba)+ca*(z*M-D*I);k[11]=-(v*(I*U-M*S)-F*(z*U-D*S)+Q*(z*M-D*I));k[12]=-(F*(S*Z-X*ba)-Q*(I*Z-K*ba)+ca*(I*X-K*S));k[13]=v*(S*Z-
X*ba)-Q*(z*Z-A*ba)+ca*(z*X-A*S);k[14]=-(v*(I*Z-K*ba)-F*(z*Z-A*ba)+ca*(z*K-A*I));k[15]=v*(I*X-K*S)-F*(z*X-A*S)+Q*(z*K-A*I);return k},determinant:function(k){var p=k[0],v=k[1],z=k[2],A=k[3],D=k[4],F=k[5],I=k[6],K=k[7],M=k[8],Q=k[9],S=k[10],X=k[11],U=k[12],ca=k[13],ba=k[14];k=k[15];return(p*F-v*D)*(S*k-X*ba)-(p*I-z*D)*(Q*k-X*ca)+(p*K-A*D)*(Q*ba-S*ca)+(v*I-z*F)*(M*k-X*U)-(v*K-A*F)*(M*ba-S*U)+(z*K-A*I)*(M*ca-Q*U)},multiply:m,translate:function(k,p,v){var z=v[0],A=v[1];v=v[2];if(p===k)k[12]=p[0]*z+p[4]*
A+p[8]*v+p[12],k[13]=p[1]*z+p[5]*A+p[9]*v+p[13],k[14]=p[2]*z+p[6]*A+p[10]*v+p[14],k[15]=p[3]*z+p[7]*A+p[11]*v+p[15];else{var D=p[0];var F=p[1];var I=p[2];var K=p[3];var M=p[4];var Q=p[5];var S=p[6];var X=p[7];var U=p[8];var ca=p[9];var ba=p[10];var Z=p[11];k[0]=D;k[1]=F;k[2]=I;k[3]=K;k[4]=M;k[5]=Q;k[6]=S;k[7]=X;k[8]=U;k[9]=ca;k[10]=ba;k[11]=Z;k[12]=D*z+M*A+U*v+p[12];k[13]=F*z+Q*A+ca*v+p[13];k[14]=I*z+S*A+ba*v+p[14];k[15]=K*z+X*A+Z*v+p[15]}return k},scale:function(k,p,v){var z=v[0],A=v[1];v=v[2];k[0]=
p[0]*z;k[1]=p[1]*z;k[2]=p[2]*z;k[3]=p[3]*z;k[4]=p[4]*A;k[5]=p[5]*A;k[6]=p[6]*A;k[7]=p[7]*A;k[8]=p[8]*v;k[9]=p[9]*v;k[10]=p[10]*v;k[11]=p[11]*v;k[12]=p[12];k[13]=p[13];k[14]=p[14];k[15]=p[15];return k},rotate:function(k,p,v,z){var A=z[0],D=z[1];z=z[2];var F=Math.hypot(A,D,z);if(.000001&gt;F)return null;F=1/F;A*=F;D*=F;z*=F;var I=Math.sin(v);var K=Math.cos(v);var M=1-K;v=p[0];F=p[1];var Q=p[2];var S=p[3];var X=p[4];var U=p[5];var ca=p[6];var ba=p[7];var Z=p[8];var ra=p[9];var la=p[10];var oa=p[11];var pa=
A*A*M+K;var na=D*A*M+z*I;var za=z*A*M-D*I;var L=A*D*M-z*I;var N=D*D*M+K;var V=z*D*M+A*I;var aa=A*z*M+D*I;A=D*z*M-A*I;D=z*z*M+K;k[0]=v*pa+X*na+Z*za;k[1]=F*pa+U*na+ra*za;k[2]=Q*pa+ca*na+la*za;k[3]=S*pa+ba*na+oa*za;k[4]=v*L+X*N+Z*V;k[5]=F*L+U*N+ra*V;k[6]=Q*L+ca*N+la*V;k[7]=S*L+ba*N+oa*V;k[8]=v*aa+X*A+Z*D;k[9]=F*aa+U*A+ra*D;k[10]=Q*aa+ca*A+la*D;k[11]=S*aa+ba*A+oa*D;p!==k&amp;&amp;(k[12]=p[12],k[13]=p[13],k[14]=p[14],k[15]=p[15]);return k},rotateX:function(k,p,v){var z=Math.sin(v);v=Math.cos(v);var A=p[4],D=p[5],
F=p[6],I=p[7],K=p[8],M=p[9],Q=p[10],S=p[11];p!==k&amp;&amp;(k[0]=p[0],k[1]=p[1],k[2]=p[2],k[3]=p[3],k[12]=p[12],k[13]=p[13],k[14]=p[14],k[15]=p[15]);k[4]=A*v+K*z;k[5]=D*v+M*z;k[6]=F*v+Q*z;k[7]=I*v+S*z;k[8]=K*v-A*z;k[9]=M*v-D*z;k[10]=Q*v-F*z;k[11]=S*v-I*z;return k},rotateY:function(k,p,v){var z=Math.sin(v);v=Math.cos(v);var A=p[0],D=p[1],F=p[2],I=p[3],K=p[8],M=p[9],Q=p[10],S=p[11];p!==k&amp;&amp;(k[4]=p[4],k[5]=p[5],k[6]=p[6],k[7]=p[7],k[12]=p[12],k[13]=p[13],k[14]=p[14],k[15]=p[15]);k[0]=A*v-K*z;k[1]=D*v-M*z;k[2]=
F*v-Q*z;k[3]=I*v-S*z;k[8]=A*z+K*v;k[9]=D*z+M*v;k[10]=F*z+Q*v;k[11]=I*z+S*v;return k},rotateZ:function(k,p,v){var z=Math.sin(v);v=Math.cos(v);var A=p[0],D=p[1],F=p[2],I=p[3],K=p[4],M=p[5],Q=p[6],S=p[7];p!==k&amp;&amp;(k[8]=p[8],k[9]=p[9],k[10]=p[10],k[11]=p[11],k[12]=p[12],k[13]=p[13],k[14]=p[14],k[15]=p[15]);k[0]=A*v+K*z;k[1]=D*v+M*z;k[2]=F*v+Q*z;k[3]=I*v+S*z;k[4]=K*v-A*z;k[5]=M*v-D*z;k[6]=Q*v-F*z;k[7]=S*v-I*z;return k},fromTranslation:function(k,p){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;
k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=p[0];k[13]=p[1];k[14]=p[2];k[15]=1;return k},fromScaling:function(k,p){k[0]=p[0];k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=p[1];k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=p[2];k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},fromRotation:function(k,p,v){var z=v[0],A=v[1];v=v[2];var D=Math.hypot(z,A,v);if(.000001&gt;D)return null;D=1/D;z*=D;A*=D;v*=D;D=Math.sin(p);p=Math.cos(p);var F=1-p;k[0]=z*z*F+p;k[1]=A*z*F+v*D;k[2]=v*z*F-A*D;k[3]=0;k[4]=z*A*F-v*D;k[5]=A*A*F+p;k[6]=v*A*F+z*D;k[7]=
0;k[8]=z*v*F+A*D;k[9]=A*v*F-z*D;k[10]=v*v*F+p;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},fromXRotation:function(k,p){var v=Math.sin(p);p=Math.cos(p);k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=p;k[6]=v;k[7]=0;k[8]=0;k[9]=-v;k[10]=p;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},fromYRotation:function(k,p){var v=Math.sin(p);p=Math.cos(p);k[0]=p;k[1]=0;k[2]=-v;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=v;k[9]=0;k[10]=p;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},fromZRotation:function(k,p){var v=
Math.sin(p);p=Math.cos(p);k[0]=p;k[1]=v;k[2]=0;k[3]=0;k[4]=-v;k[5]=p;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},fromRotationTranslation:n,fromQuat2:function(k,p){var v=new ma(3),z=-p[0],A=-p[1],D=-p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7],S=z*z+A*A+D*D+F*F;0&lt;S?(v[0]=2*(I*F+Q*z+K*D-M*A)/S,v[1]=2*(K*F+Q*A+M*z-I*D)/S,v[2]=2*(M*F+Q*D+I*A-K*z)/S):(v[0]=2*(I*F+Q*z+K*D-M*A),v[1]=2*(K*F+Q*A+M*z-I*D),v[2]=2*(M*F+Q*D+I*A-K*z));n(k,p,v);return k},getTranslation:r,getScaling:q,
getRotation:t,fromRotationTranslationScale:function(k,p,v,z){var A=p[0],D=p[1],F=p[2],I=p[3],K=A+A,M=D+D,Q=F+F;p=A*K;var S=A*M;A*=Q;var X=D*M;D*=Q;F*=Q;K*=I;M*=I;I*=Q;Q=z[0];var U=z[1];z=z[2];k[0]=(1-(X+F))*Q;k[1]=(S+I)*Q;k[2]=(A-M)*Q;k[3]=0;k[4]=(S-I)*U;k[5]=(1-(p+F))*U;k[6]=(D+K)*U;k[7]=0;k[8]=(A+M)*z;k[9]=(D-K)*z;k[10]=(1-(p+X))*z;k[11]=0;k[12]=v[0];k[13]=v[1];k[14]=v[2];k[15]=1;return k},fromRotationTranslationScaleOrigin:function(k,p,v,z,A){var D=p[0],F=p[1],I=p[2],K=p[3],M=D+D,Q=F+F,S=I+I;p=
D*M;var X=D*Q,U=D*S;D=F*Q;F*=S;var ca=I*S;I=K*M;Q*=K;var ba=K*S,Z=z[0],ra=z[1];S=z[2];z=A[0];K=A[1];A=A[2];M=(1-(D+ca))*Z;var la=(X+ba)*Z;Z*=U-Q;X=(X-ba)*ra;ca=(1-(p+ca))*ra;ra*=F+I;U=(U+Q)*S;F=(F-I)*S;p=(1-(p+D))*S;k[0]=M;k[1]=la;k[2]=Z;k[3]=0;k[4]=X;k[5]=ca;k[6]=ra;k[7]=0;k[8]=U;k[9]=F;k[10]=p;k[11]=0;k[12]=v[0]+z-(M*z+X*K+U*A);k[13]=v[1]+K-(la*z+ca*K+F*A);k[14]=v[2]+A-(Z*z+ra*K+p*A);k[15]=1;return k},fromQuat:function(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=v+v,F=z+z,I=A+A;v*=D;var K=z*D;z*=
F;var M=A*D,Q=A*F;A*=I;D*=p;F*=p;p*=I;k[0]=1-z-A;k[1]=K+p;k[2]=M-F;k[3]=0;k[4]=K-p;k[5]=1-v-A;k[6]=Q+D;k[7]=0;k[8]=M+F;k[9]=Q-D;k[10]=1-v-z;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1;return k},frustum:function(k,p,v,z,A,D,F){var I=1/(v-p),K=1/(A-z),M=1/(D-F);k[0]=2*D*I;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=2*D*K;k[6]=0;k[7]=0;k[8]=(v+p)*I;k[9]=(A+z)*K;k[10]=(F+D)*M;k[11]=-1;k[12]=0;k[13]=0;k[14]=F*D*2*M;k[15]=0;return k},perspective:function(k,p,v,z,A){p=1/Math.tan(p/2);k[0]=p/v;k[1]=0;k[2]=0;k[3]=0;k[4]=
0;k[5]=p;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[11]=-1;k[12]=0;k[13]=0;k[15]=0;null!=A&amp;&amp;Infinity!==A?(v=1/(z-A),k[10]=(A+z)*v,k[14]=2*A*z*v):(k[10]=-1,k[14]=-2*z);return k},perspectiveFromFieldOfView:function(k,p,v,z){var A=Math.tan(p.upDegrees*Math.PI/180),D=Math.tan(p.downDegrees*Math.PI/180),F=Math.tan(p.leftDegrees*Math.PI/180);p=Math.tan(p.rightDegrees*Math.PI/180);var I=2/(F+p),K=2/(A+D);k[0]=I;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=K;k[6]=0;k[7]=0;k[8]=-((F-p)*I*.5);k[9]=(A-D)*K*.5;k[10]=z/(v-z);k[11]=-1;
k[12]=0;k[13]=0;k[14]=z*v/(v-z);k[15]=0;return k},ortho:function(k,p,v,z,A,D,F){var I=1/(p-v),K=1/(z-A),M=1/(D-F);k[0]=-2*I;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=-2*K;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=2*M;k[11]=0;k[12]=(p+v)*I;k[13]=(A+z)*K;k[14]=(F+D)*M;k[15]=1;return k},lookAt:function(k,p,v,z){var A=p[0],D=p[1];p=p[2];var F=z[0];var I=z[1];var K=z[2];var M=v[0];z=v[1];var Q=v[2];if(.000001&gt;Math.abs(A-M)&amp;&amp;.000001&gt;Math.abs(D-z)&amp;&amp;.000001&gt;Math.abs(p-Q))return l(k);v=A-M;z=D-z;M=p-Q;var S=1/Math.hypot(v,
z,M);v*=S;z*=S;M*=S;Q=I*M-K*z;K=K*v-F*M;F=F*z-I*v;(S=Math.hypot(Q,K,F))?(S=1/S,Q*=S,K*=S,F*=S):F=K=Q=0;I=z*F-M*K;var X=M*Q-v*F;var U=v*K-z*Q;(S=Math.hypot(I,X,U))?(S=1/S,I*=S,X*=S,U*=S):U=X=I=0;k[0]=Q;k[1]=I;k[2]=v;k[3]=0;k[4]=K;k[5]=X;k[6]=z;k[7]=0;k[8]=F;k[9]=U;k[10]=M;k[11]=0;k[12]=-(Q*A+K*D+F*p);k[13]=-(I*A+X*D+U*p);k[14]=-(v*A+z*D+M*p);k[15]=1;return k},targetTo:function(k,p,v,z){var A=p[0],D=p[1];p=p[2];var F=z[0],I=z[1],K=z[2];z=A-v[0];var M=D-v[1];v=p-v[2];var Q=z*z+M*M+v*v;0&lt;Q&amp;&amp;(Q=1/Math.sqrt(Q),
z*=Q,M*=Q,v*=Q);var S=I*v-K*M;K=K*z-F*v;F=F*M-I*z;Q=S*S+K*K+F*F;0&lt;Q&amp;&amp;(Q=1/Math.sqrt(Q),S*=Q,K*=Q,F*=Q);k[0]=S;k[1]=K;k[2]=F;k[3]=0;k[4]=M*F-v*K;k[5]=v*S-z*F;k[6]=z*K-M*S;k[7]=0;k[8]=z;k[9]=M;k[10]=v;k[11]=0;k[12]=A;k[13]=D;k[14]=p;k[15]=1;return k},str:function(k){return"mat4("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+", "+k[4]+", "+k[5]+", "+k[6]+", "+k[7]+", "+k[8]+", "+k[9]+", "+k[10]+", "+k[11]+", "+k[12]+", "+k[13]+", "+k[14]+", "+k[15]+")"},frob:function(k){return Math.hypot(k[0],k[1],k[2],k[3],k[4],
k[5],k[6],k[7],k[8],k[9],k[10],k[11],k[12],k[13],k[14],k[15])},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];k[4]=p[4]+v[4];k[5]=p[5]+v[5];k[6]=p[6]+v[6];k[7]=p[7]+v[7];k[8]=p[8]+v[8];k[9]=p[9]+v[9];k[10]=p[10]+v[10];k[11]=p[11]+v[11];k[12]=p[12]+v[12];k[13]=p[13]+v[13];k[14]=p[14]+v[14];k[15]=p[15]+v[15];return k},subtract:u,multiplyScalar:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;k[4]=p[4]*v;k[5]=p[5]*v;k[6]=p[6]*v;k[7]=p[7]*v;k[8]=p[8]*v;
k[9]=p[9]*v;k[10]=p[10]*v;k[11]=p[11]*v;k[12]=p[12]*v;k[13]=p[13]*v;k[14]=p[14]*v;k[15]=p[15]*v;return k},multiplyScalarAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;k[3]=p[3]+v[3]*z;k[4]=p[4]+v[4]*z;k[5]=p[5]+v[5]*z;k[6]=p[6]+v[6]*z;k[7]=p[7]+v[7]*z;k[8]=p[8]+v[8]*z;k[9]=p[9]+v[9]*z;k[10]=p[10]+v[10]*z;k[11]=p[11]+v[11]*z;k[12]=p[12]+v[12]*z;k[13]=p[13]+v[13]*z;k[14]=p[14]+v[14]*z;k[15]=p[15]+v[15]*z;return k},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;
k[2]===p[2]&amp;&amp;k[3]===p[3]&amp;&amp;k[4]===p[4]&amp;&amp;k[5]===p[5]&amp;&amp;k[6]===p[6]&amp;&amp;k[7]===p[7]&amp;&amp;k[8]===p[8]&amp;&amp;k[9]===p[9]&amp;&amp;k[10]===p[10]&amp;&amp;k[11]===p[11]&amp;&amp;k[12]===p[12]&amp;&amp;k[13]===p[13]&amp;&amp;k[14]===p[14]&amp;&amp;k[15]===p[15]},equals:function(k,p){var v=k[0],z=k[1],A=k[2],D=k[3],F=k[4],I=k[5],K=k[6],M=k[7],Q=k[8],S=k[9],X=k[10],U=k[11],ca=k[12],ba=k[13],Z=k[14];k=k[15];var ra=p[0],la=p[1],oa=p[2],pa=p[3],na=p[4],za=p[5],L=p[6],N=p[7],V=p[8],aa=p[9],fa=p[10],ha=p[11],da=p[12],sa=p[13],ta=p[14];p=p[15];return Math.abs(v-ra)&lt;=.000001*
Math.max(1,Math.abs(v),Math.abs(ra))&amp;&amp;Math.abs(z-la)&lt;=.000001*Math.max(1,Math.abs(z),Math.abs(la))&amp;&amp;Math.abs(A-oa)&lt;=.000001*Math.max(1,Math.abs(A),Math.abs(oa))&amp;&amp;Math.abs(D-pa)&lt;=.000001*Math.max(1,Math.abs(D),Math.abs(pa))&amp;&amp;Math.abs(F-na)&lt;=.000001*Math.max(1,Math.abs(F),Math.abs(na))&amp;&amp;Math.abs(I-za)&lt;=.000001*Math.max(1,Math.abs(I),Math.abs(za))&amp;&amp;Math.abs(K-L)&lt;=.000001*Math.max(1,Math.abs(K),Math.abs(L))&amp;&amp;Math.abs(M-N)&lt;=.000001*Math.max(1,Math.abs(M),Math.abs(N))&amp;&amp;Math.abs(Q-V)&lt;=.000001*Math.max(1,
Math.abs(Q),Math.abs(V))&amp;&amp;Math.abs(S-aa)&lt;=.000001*Math.max(1,Math.abs(S),Math.abs(aa))&amp;&amp;Math.abs(X-fa)&lt;=.000001*Math.max(1,Math.abs(X),Math.abs(fa))&amp;&amp;Math.abs(U-ha)&lt;=.000001*Math.max(1,Math.abs(U),Math.abs(ha))&amp;&amp;Math.abs(ca-da)&lt;=.000001*Math.max(1,Math.abs(ca),Math.abs(da))&amp;&amp;Math.abs(ba-sa)&lt;=.000001*Math.max(1,Math.abs(ba),Math.abs(sa))&amp;&amp;Math.abs(Z-ta)&lt;=.000001*Math.max(1,Math.abs(Z),Math.abs(ta))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},mul:m,sub:u}),La=function(){var k=w();return function(p,
v,z,A,D,F){v||(v=3);z||(z=0);for(A=A?Math.min(A*v+z,p.length):p.length;z&lt;A;z+=v)k[0]=p[z],k[1]=p[z+1],k[2]=p[z+2],D(k,k,F),p[z]=k[0],p[z+1]=k[1],p[z+2]=k[2];return p}}();La=Object.freeze({__proto__:null,create:w,clone:function(k){var p=new ma(3);p[0]=k[0];p[1]=k[1];p[2]=k[2];return p},length:y,fromValues:C,copy:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];return k},set:function(k,p,v,z){k[0]=p;k[1]=v;k[2]=z;return k},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];k[2]=p[2]+v[2];return k},subtract:G,
multiply:x,divide:B,ceil:function(k,p){k[0]=Math.ceil(p[0]);k[1]=Math.ceil(p[1]);k[2]=Math.ceil(p[2]);return k},floor:function(k,p){k[0]=Math.floor(p[0]);k[1]=Math.floor(p[1]);k[2]=Math.floor(p[2]);return k},min:function(k,p,v){k[0]=Math.min(p[0],v[0]);k[1]=Math.min(p[1],v[1]);k[2]=Math.min(p[2],v[2]);return k},max:function(k,p,v){k[0]=Math.max(p[0],v[0]);k[1]=Math.max(p[1],v[1]);k[2]=Math.max(p[2],v[2]);return k},round:function(k,p){k[0]=Math.round(p[0]);k[1]=Math.round(p[1]);k[2]=Math.round(p[2]);
return k},scale:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;return k},scaleAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;return k},distance:H,squaredDistance:P,squaredLength:E,negate:function(k,p){k[0]=-p[0];k[1]=-p[1];k[2]=-p[2];return k},inverse:function(k,p){k[0]=1/p[0];k[1]=1/p[1];k[2]=1/p[2];return k},normalize:J,dot:O,cross:R,lerp:function(k,p,v,z){var A=p[0],D=p[1];p=p[2];k[0]=A+z*(v[0]-A);k[1]=D+z*(v[1]-D);k[2]=p+z*(v[2]-p);return k},hermite:function(k,
p,v,z,A,D){var F=D*D,I=F*(2*D-3)+1,K=F*(D-2)+D,M=F*(D-1);D=F*(3-2*D);k[0]=p[0]*I+v[0]*K+z[0]*M+A[0]*D;k[1]=p[1]*I+v[1]*K+z[1]*M+A[1]*D;k[2]=p[2]*I+v[2]*K+z[2]*M+A[2]*D;return k},bezier:function(k,p,v,z,A,D){var F=1-D,I=F*F,K=D*D,M=I*F;I*=3*D;F*=3*K;D*=K;k[0]=p[0]*M+v[0]*I+z[0]*F+A[0]*D;k[1]=p[1]*M+v[1]*I+z[1]*F+A[1]*D;k[2]=p[2]*M+v[2]*I+z[2]*F+A[2]*D;return k},random:function(k,p){p=p||1;var v=2*Ga()*Math.PI,z=2*Ga()-1,A=Math.sqrt(1-z*z)*p;k[0]=Math.cos(v)*A;k[1]=Math.sin(v)*A;k[2]=z*p;return k},
transformMat4:function(k,p,v){var z=p[0],A=p[1];p=p[2];var D=v[3]*z+v[7]*A+v[11]*p+v[15];D=D||1;k[0]=(v[0]*z+v[4]*A+v[8]*p+v[12])/D;k[1]=(v[1]*z+v[5]*A+v[9]*p+v[13])/D;k[2]=(v[2]*z+v[6]*A+v[10]*p+v[14])/D;return k},transformMat3:function(k,p,v){var z=p[0],A=p[1];p=p[2];k[0]=z*v[0]+A*v[3]+p*v[6];k[1]=z*v[1]+A*v[4]+p*v[7];k[2]=z*v[2]+A*v[5]+p*v[8];return k},transformQuat:function(k,p,v){var z=v[0],A=v[1],D=v[2],F=p[0],I=p[1];p=p[2];var K=A*p-D*I,M=D*F-z*p,Q=z*I-A*F;v=2*v[3];k[0]=F+K*v+2*(A*Q-D*M);k[1]=
I+M*v+2*(D*K-z*Q);k[2]=p+Q*v+2*(z*M-A*K);return k},rotateX:function(k,p,v,z){var A=[],D=[];A[0]=p[0]-v[0];A[1]=p[1]-v[1];A[2]=p[2]-v[2];D[0]=A[0];D[1]=A[1]*Math.cos(z)-A[2]*Math.sin(z);D[2]=A[1]*Math.sin(z)+A[2]*Math.cos(z);k[0]=D[0]+v[0];k[1]=D[1]+v[1];k[2]=D[2]+v[2];return k},rotateY:function(k,p,v,z){var A=[],D=[];A[0]=p[0]-v[0];A[1]=p[1]-v[1];A[2]=p[2]-v[2];D[0]=A[2]*Math.sin(z)+A[0]*Math.cos(z);D[1]=A[1];D[2]=A[2]*Math.cos(z)-A[0]*Math.sin(z);k[0]=D[0]+v[0];k[1]=D[1]+v[1];k[2]=D[2]+v[2];return k},
rotateZ:function(k,p,v,z){var A=[],D=[];A[0]=p[0]-v[0];A[1]=p[1]-v[1];A[2]=p[2]-v[2];D[0]=A[0]*Math.cos(z)-A[1]*Math.sin(z);D[1]=A[0]*Math.sin(z)+A[1]*Math.cos(z);D[2]=A[2];k[0]=D[0]+v[0];k[1]=D[1]+v[1];k[2]=D[2]+v[2];return k},angle:function(k,p){var v=k[0],z=k[1],A=k[2],D=p[0],F=p[1],I=p[2];k=(v=Math.sqrt(v*v+z*z+A*A)*Math.sqrt(D*D+F*F+I*I))&amp;&amp;O(k,p)/v;return Math.acos(Math.min(Math.max(k,-1),1))},zero:function(k){k[0]=0;k[1]=0;k[2]=0;return k},str:function(k){return"vec3("+k[0]+", "+k[1]+", "+k[2]+
")"},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]},equals:function(k,p){var v=k[0],z=k[1];k=k[2];var A=p[0],D=p[1];p=p[2];return Math.abs(v-A)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(A))&amp;&amp;Math.abs(z-D)&lt;=.000001*Math.max(1,Math.abs(z),Math.abs(D))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},sub:G,mul:x,div:B,dist:H,sqrDist:P,len:y,sqrLen:E,forEach:La});var Ma=function(){var k=T();return function(p,v,z,A,D,F){v||(v=4);z||(z=0);for(A=A?Math.min(A*v+z,p.length):
p.length;z&lt;A;z+=v)k[0]=p[z],k[1]=p[z+1],k[2]=p[z+2],k[3]=p[z+3],D(k,k,F),p[z]=k[0],p[z+1]=k[1],p[z+2]=k[2],p[z+3]=k[3];return p}}();Ma=Object.freeze({__proto__:null,create:T,clone:Y,fromValues:W,copy:ea,set:qa,add:ja,subtract:xa,multiply:ua,divide:Da,ceil:function(k,p){k[0]=Math.ceil(p[0]);k[1]=Math.ceil(p[1]);k[2]=Math.ceil(p[2]);k[3]=Math.ceil(p[3]);return k},floor:function(k,p){k[0]=Math.floor(p[0]);k[1]=Math.floor(p[1]);k[2]=Math.floor(p[2]);k[3]=Math.floor(p[3]);return k},min:function(k,p,v){k[0]=
Math.min(p[0],v[0]);k[1]=Math.min(p[1],v[1]);k[2]=Math.min(p[2],v[2]);k[3]=Math.min(p[3],v[3]);return k},max:function(k,p,v){k[0]=Math.max(p[0],v[0]);k[1]=Math.max(p[1],v[1]);k[2]=Math.max(p[2],v[2]);k[3]=Math.max(p[3],v[3]);return k},round:function(k,p){k[0]=Math.round(p[0]);k[1]=Math.round(p[1]);k[2]=Math.round(p[2]);k[3]=Math.round(p[3]);return k},scale:Ea,scaleAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;k[2]=p[2]+v[2]*z;k[3]=p[3]+v[3]*z;return k},distance:Ba,squaredDistance:Aa,
length:ia,squaredLength:Fa,negate:function(k,p){k[0]=-p[0];k[1]=-p[1];k[2]=-p[2];k[3]=-p[3];return k},inverse:function(k,p){k[0]=1/p[0];k[1]=1/p[1];k[2]=1/p[2];k[3]=1/p[3];return k},normalize:wa,dot:Ca,cross:function(k,p,v,z){var A=v[0]*z[1]-v[1]*z[0],D=v[0]*z[2]-v[2]*z[0],F=v[0]*z[3]-v[3]*z[0],I=v[1]*z[2]-v[2]*z[1],K=v[1]*z[3]-v[3]*z[1];v=v[2]*z[3]-v[3]*z[2];z=p[0];var M=p[1],Q=p[2];p=p[3];k[0]=M*v-Q*K+p*I;k[1]=-(z*v)+Q*F-p*D;k[2]=z*K-M*F+p*A;k[3]=-(z*I)+M*D-Q*A;return k},lerp:Pa,random:function(k,
p){p=p||1;do{var v=2*Ga()-1;var z=2*Ga()-1;var A=v*v+z*z}while(1&lt;=A);do{var D=2*Ga()-1;var F=2*Ga()-1;var I=D*D+F*F}while(1&lt;=I);A=Math.sqrt((1-A)/I);k[0]=p*v;k[1]=p*z;k[2]=p*D*A;k[3]=p*F*A;return k},transformMat4:function(k,p,v){var z=p[0],A=p[1],D=p[2];p=p[3];k[0]=v[0]*z+v[4]*A+v[8]*D+v[12]*p;k[1]=v[1]*z+v[5]*A+v[9]*D+v[13]*p;k[2]=v[2]*z+v[6]*A+v[10]*D+v[14]*p;k[3]=v[3]*z+v[7]*A+v[11]*D+v[15]*p;return k},transformQuat:function(k,p,v){var z=p[0],A=p[1],D=p[2],F=v[0],I=v[1],K=v[2];v=v[3];var M=v*z+
I*D-K*A,Q=v*A+K*z-F*D,S=v*D+F*A-I*z;z=-F*z-I*A-K*D;k[0]=M*v+z*-F+Q*-K-S*-I;k[1]=Q*v+z*-I+S*-F-M*-K;k[2]=S*v+z*-K+M*-I-Q*-F;k[3]=p[3];return k},zero:function(k){k[0]=0;k[1]=0;k[2]=0;k[3]=0;return k},str:function(k){return"vec4("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+")"},exactEquals:Qa,equals:Ra,sub:xa,mul:ua,div:Da,dist:Ba,sqrDist:Aa,len:ia,sqrLen:Fa,forEach:Ma});var Na=function(){var k=w(),p=C(1,0,0),v=C(0,1,0);return function(z,A,D){var F=O(A,D);if(-.999999&gt;F)return R(k,p,A),.000001&gt;y(k)&amp;&amp;R(k,v,A),
J(k,k),Sa(z,k,Math.PI),z;if(.999999&lt;F)return z[0]=0,z[1]=0,z[2]=0,z[3]=1,z;R(k,A,D);z[0]=k[0];z[1]=k[1];z[2]=k[2];z[3]=1+F;return wa(z,z)}}(),Oa=function(){var k=Ja(),p=Ja();return function(v,z,A,D,F,I){Ka(k,z,F,I);Ka(p,A,D,I);Ka(v,k,p,2*I*(1-I));return v}}(),Ia=function(){var k=e();return function(p,v,z,A){k[0]=z[0];k[3]=z[1];k[6]=z[2];k[1]=A[0];k[4]=A[1];k[7]=A[2];k[2]=-v[0];k[5]=-v[1];k[8]=-v[2];return wa(p,$a(p,k))}}();Na=Object.freeze({__proto__:null,create:Ja,identity:function(k){k[0]=0;k[1]=
0;k[2]=0;k[3]=1;return k},setAxisAngle:Sa,getAxisAngle:function(k,p){var v=2*Math.acos(p[3]),z=Math.sin(v/2);.000001&lt;z?(k[0]=p[0]/z,k[1]=p[1]/z,k[2]=p[2]/z):(k[0]=1,k[1]=0,k[2]=0);return v},getAngle:function(k,p){k=Ca(k,p);return Math.acos(2*k*k-1)},multiply:Ta,rotateX:Ua,rotateY:Va,rotateZ:Wa,calculateW:function(k,p){var v=p[0],z=p[1];p=p[2];k[0]=v;k[1]=z;k[2]=p;k[3]=Math.sqrt(Math.abs(1-v*v-z*z-p*p));return k},exp:Xa,ln:Za,pow:function(k,p,v){Za(k,p);Ea(k,k,v);Xa(k,k);return k},slerp:Ka,random:function(k){var p=
Ga(),v=Ga(),z=Ga(),A=Math.sqrt(1-p);p=Math.sqrt(p);k[0]=A*Math.sin(2*Math.PI*v);k[1]=A*Math.cos(2*Math.PI*v);k[2]=p*Math.sin(2*Math.PI*z);k[3]=p*Math.cos(2*Math.PI*z);return k},invert:function(k,p){var v=p[0],z=p[1],A=p[2];p=p[3];var D=v*v+z*z+A*A+p*p;D=D?1/D:0;k[0]=-v*D;k[1]=-z*D;k[2]=-A*D;k[3]=p*D;return k},conjugate:function(k,p){k[0]=-p[0];k[1]=-p[1];k[2]=-p[2];k[3]=p[3];return k},fromMat3:$a,fromEuler:function(k,p,v,z){var A=.5*Math.PI/180;p*=A;v*=A;z*=A;A=Math.sin(p);p=Math.cos(p);var D=Math.sin(v);
v=Math.cos(v);var F=Math.sin(z);z=Math.cos(z);k[0]=A*v*z-p*D*F;k[1]=p*D*z+A*v*F;k[2]=p*v*F-A*D*z;k[3]=p*v*z+A*D*F;return k},str:function(k){return"quat("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+")"},clone:Y,fromValues:W,copy:ea,set:qa,add:ja,mul:Ta,scale:Ea,dot:Ca,lerp:Pa,length:ia,len:ia,squaredLength:Fa,sqrLen:Fa,normalize:wa,exactEquals:Qa,equals:Ra,rotationTo:Na,sqlerp:Oa,setAxes:Ia});Oa=Object.freeze({__proto__:null,create:function(){var k=new ma(8);ma!=Float32Array&amp;&amp;(k[0]=0,k[1]=0,k[2]=0,k[4]=0,
k[5]=0,k[6]=0,k[7]=0);k[3]=1;return k},clone:function(k){var p=new ma(8);p[0]=k[0];p[1]=k[1];p[2]=k[2];p[3]=k[3];p[4]=k[4];p[5]=k[5];p[6]=k[6];p[7]=k[7];return p},fromValues:function(k,p,v,z,A,D,F,I){var K=new ma(8);K[0]=k;K[1]=p;K[2]=v;K[3]=z;K[4]=A;K[5]=D;K[6]=F;K[7]=I;return K},fromRotationTranslationValues:function(k,p,v,z,A,D,F){var I=new ma(8);I[0]=k;I[1]=p;I[2]=v;I[3]=z;A*=.5;D*=.5;F*=.5;I[4]=A*z+D*v-F*p;I[5]=D*z+F*k-A*v;I[6]=F*z+A*p-D*k;I[7]=-A*k-D*p-F*v;return I},fromRotationTranslation:ab,
fromTranslation:function(k,p){k[0]=0;k[1]=0;k[2]=0;k[3]=1;k[4]=.5*p[0];k[5]=.5*p[1];k[6]=.5*p[2];k[7]=0;return k},fromRotation:function(k,p){k[0]=p[0];k[1]=p[1];k[2]=p[2];k[3]=p[3];k[4]=0;k[5]=0;k[6]=0;k[7]=0;return k},fromMat4:function(k,p){var v=Ja();t(v,p);var z=new ma(3);r(z,p);ab(k,v,z);return k},copy:bb,identity:function(k){k[0]=0;k[1]=0;k[2]=0;k[3]=1;k[4]=0;k[5]=0;k[6]=0;k[7]=0;return k},set:function(k,p,v,z,A,D,F,I,K){k[0]=p;k[1]=v;k[2]=z;k[3]=A;k[4]=D;k[5]=F;k[6]=I;k[7]=K;return k},getReal:ea,
getDual:function(k,p){k[0]=p[4];k[1]=p[5];k[2]=p[6];k[3]=p[7];return k},setReal:ea,setDual:function(k,p){k[4]=p[0];k[5]=p[1];k[6]=p[2];k[7]=p[3];return k},getTranslation:function(k,p){var v=p[4],z=p[5],A=p[6],D=p[7],F=-p[0],I=-p[1],K=-p[2];p=p[3];k[0]=2*(v*p+D*F+z*K-A*I);k[1]=2*(z*p+D*I+A*F-v*K);k[2]=2*(A*p+D*K+v*I-z*F);return k},translate:function(k,p,v){var z=p[0],A=p[1],D=p[2],F=p[3],I=.5*v[0],K=.5*v[1];v=.5*v[2];var M=p[4],Q=p[5],S=p[6];p=p[7];k[0]=z;k[1]=A;k[2]=D;k[3]=F;k[4]=F*I+A*v-D*K+M;k[5]=
F*K+D*I-z*v+Q;k[6]=F*v+z*K-A*I+S;k[7]=-z*I-A*K-D*v+p;return k},rotateX:function(k,p,v){var z=-p[0],A=-p[1],D=-p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7],S=I*F+Q*z+K*D-M*A,X=K*F+Q*A+M*z-I*D,U=M*F+Q*D+I*A-K*z;I=Q*F-I*z-K*A-M*D;Ua(k,p,v);z=k[0];A=k[1];D=k[2];F=k[3];k[4]=S*F+I*z+X*D-U*A;k[5]=X*F+I*A+U*z-S*D;k[6]=U*F+I*D+S*A-X*z;k[7]=I*F-S*z-X*A-U*D;return k},rotateY:function(k,p,v){var z=-p[0],A=-p[1],D=-p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7],S=I*F+Q*z+K*D-M*A,X=K*F+Q*A+M*z-I*D,U=M*F+Q*D+I*A-K*z;I=Q*F-
I*z-K*A-M*D;Va(k,p,v);z=k[0];A=k[1];D=k[2];F=k[3];k[4]=S*F+I*z+X*D-U*A;k[5]=X*F+I*A+U*z-S*D;k[6]=U*F+I*D+S*A-X*z;k[7]=I*F-S*z-X*A-U*D;return k},rotateZ:function(k,p,v){var z=-p[0],A=-p[1],D=-p[2],F=p[3],I=p[4],K=p[5],M=p[6],Q=p[7],S=I*F+Q*z+K*D-M*A,X=K*F+Q*A+M*z-I*D,U=M*F+Q*D+I*A-K*z;I=Q*F-I*z-K*A-M*D;Wa(k,p,v);z=k[0];A=k[1];D=k[2];F=k[3];k[4]=S*F+I*z+X*D-U*A;k[5]=X*F+I*A+U*z-S*D;k[6]=U*F+I*D+S*A-X*z;k[7]=I*F-S*z-X*A-U*D;return k},rotateByQuatAppend:function(k,p,v){var z=v[0],A=v[1],D=v[2];v=v[3];
var F=p[0],I=p[1],K=p[2],M=p[3];k[0]=F*v+M*z+I*D-K*A;k[1]=I*v+M*A+K*z-F*D;k[2]=K*v+M*D+F*A-I*z;k[3]=M*v-F*z-I*A-K*D;F=p[4];I=p[5];K=p[6];M=p[7];k[4]=F*v+M*z+I*D-K*A;k[5]=I*v+M*A+K*z-F*D;k[6]=K*v+M*D+F*A-I*z;k[7]=M*v-F*z-I*A-K*D;return k},rotateByQuatPrepend:function(k,p,v){var z=p[0],A=p[1],D=p[2];p=p[3];var F=v[0],I=v[1],K=v[2],M=v[3];k[0]=z*M+p*F+A*K-D*I;k[1]=A*M+p*I+D*F-z*K;k[2]=D*M+p*K+z*I-A*F;k[3]=p*M-z*F-A*I-D*K;F=v[4];I=v[5];K=v[6];M=v[7];k[4]=z*M+p*F+A*K-D*I;k[5]=A*M+p*I+D*F-z*K;k[6]=D*M+
p*K+z*I-A*F;k[7]=p*M-z*F-A*I-D*K;return k},rotateAroundAxis:function(k,p,v,z){if(.000001&gt;Math.abs(z))return bb(k,p);var A=Math.hypot(v[0],v[1],v[2]);z*=.5;var D=Math.sin(z),F=D*v[0]/A,I=D*v[1]/A;v=D*v[2]/A;z=Math.cos(z);A=p[0];D=p[1];var K=p[2],M=p[3];k[0]=A*z+M*F+D*v-K*I;k[1]=D*z+M*I+K*F-A*v;k[2]=K*z+M*v+A*I-D*F;k[3]=M*z-A*F-D*I-K*v;A=p[4];D=p[5];K=p[6];p=p[7];k[4]=A*z+p*F+D*v-K*I;k[5]=D*z+p*I+K*F-A*v;k[6]=K*z+p*v+A*I-D*F;k[7]=p*z-A*F-D*I-K*v;return k},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+
v[1];k[2]=p[2]+v[2];k[3]=p[3]+v[3];k[4]=p[4]+v[4];k[5]=p[5]+v[5];k[6]=p[6]+v[6];k[7]=p[7]+v[7];return k},multiply:cb,mul:cb,scale:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;k[2]=p[2]*v;k[3]=p[3]*v;k[4]=p[4]*v;k[5]=p[5]*v;k[6]=p[6]*v;k[7]=p[7]*v;return k},dot:Ca,lerp:function(k,p,v,z){var A=1-z;0&gt;Ca(p,v)&amp;&amp;(z=-z);k[0]=p[0]*A+v[0]*z;k[1]=p[1]*A+v[1]*z;k[2]=p[2]*A+v[2]*z;k[3]=p[3]*A+v[3]*z;k[4]=p[4]*A+v[4]*z;k[5]=p[5]*A+v[5]*z;k[6]=p[6]*A+v[6]*z;k[7]=p[7]*A+v[7]*z;return k},invert:function(k,p){var v=Fa(p);
k[0]=-p[0]/v;k[1]=-p[1]/v;k[2]=-p[2]/v;k[3]=p[3]/v;k[4]=-p[4]/v;k[5]=-p[5]/v;k[6]=-p[6]/v;k[7]=p[7]/v;return k},conjugate:function(k,p){k[0]=-p[0];k[1]=-p[1];k[2]=-p[2];k[3]=p[3];k[4]=-p[4];k[5]=-p[5];k[6]=-p[6];k[7]=p[7];return k},length:ia,len:ia,squaredLength:Fa,sqrLen:Fa,normalize:function(k,p){var v=Fa(p);if(0&lt;v){v=Math.sqrt(v);var z=p[0]/v,A=p[1]/v,D=p[2]/v,F=p[3]/v,I=p[4],K=p[5],M=p[6];p=p[7];var Q=z*I+A*K+D*M+F*p;k[0]=z;k[1]=A;k[2]=D;k[3]=F;k[4]=(I-z*Q)/v;k[5]=(K-A*Q)/v;k[6]=(M-D*Q)/v;k[7]=
(p-F*Q)/v}return k},str:function(k){return"quat2("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+", "+k[4]+", "+k[5]+", "+k[6]+", "+k[7]+")"},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]&amp;&amp;k[2]===p[2]&amp;&amp;k[3]===p[3]&amp;&amp;k[4]===p[4]&amp;&amp;k[5]===p[5]&amp;&amp;k[6]===p[6]&amp;&amp;k[7]===p[7]},equals:function(k,p){var v=k[0],z=k[1],A=k[2],D=k[3],F=k[4],I=k[5],K=k[6];k=k[7];var M=p[0],Q=p[1],S=p[2],X=p[3],U=p[4],ca=p[5],ba=p[6];p=p[7];return Math.abs(v-M)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(M))&amp;&amp;Math.abs(z-Q)&lt;=.000001*
Math.max(1,Math.abs(z),Math.abs(Q))&amp;&amp;Math.abs(A-S)&lt;=.000001*Math.max(1,Math.abs(A),Math.abs(S))&amp;&amp;Math.abs(D-X)&lt;=.000001*Math.max(1,Math.abs(D),Math.abs(X))&amp;&amp;Math.abs(F-U)&lt;=.000001*Math.max(1,Math.abs(F),Math.abs(U))&amp;&amp;Math.abs(I-ca)&lt;=.000001*Math.max(1,Math.abs(I),Math.abs(ca))&amp;&amp;Math.abs(K-ba)&lt;=.000001*Math.max(1,Math.abs(K),Math.abs(ba))&amp;&amp;Math.abs(k-p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))}});Ia=function(){var k=db();return function(p,v,z,A,D,F){v||(v=2);z||(z=0);for(A=A?Math.min(A*v+z,p.length):
p.length;z&lt;A;z+=v)k[0]=p[z],k[1]=p[z+1],D(k,k,F),p[z]=k[0],p[z+1]=k[1];return p}}();Ia=Object.freeze({__proto__:null,create:db,clone:function(k){var p=new ma(2);p[0]=k[0];p[1]=k[1];return p},fromValues:function(k,p){var v=new ma(2);v[0]=k;v[1]=p;return v},copy:function(k,p){k[0]=p[0];k[1]=p[1];return k},set:function(k,p,v){k[0]=p;k[1]=v;return k},add:function(k,p,v){k[0]=p[0]+v[0];k[1]=p[1]+v[1];return k},subtract:eb,multiply:fb,divide:gb,ceil:function(k,p){k[0]=Math.ceil(p[0]);k[1]=Math.ceil(p[1]);
return k},floor:function(k,p){k[0]=Math.floor(p[0]);k[1]=Math.floor(p[1]);return k},min:function(k,p,v){k[0]=Math.min(p[0],v[0]);k[1]=Math.min(p[1],v[1]);return k},max:function(k,p,v){k[0]=Math.max(p[0],v[0]);k[1]=Math.max(p[1],v[1]);return k},round:function(k,p){k[0]=Math.round(p[0]);k[1]=Math.round(p[1]);return k},scale:function(k,p,v){k[0]=p[0]*v;k[1]=p[1]*v;return k},scaleAndAdd:function(k,p,v,z){k[0]=p[0]+v[0]*z;k[1]=p[1]+v[1]*z;return k},distance:hb,squaredDistance:ib,length:jb,squaredLength:kb,
negate:function(k,p){k[0]=-p[0];k[1]=-p[1];return k},inverse:function(k,p){k[0]=1/p[0];k[1]=1/p[1];return k},normalize:function(k,p){var v=p[0],z=p[1];v=v*v+z*z;0&lt;v&amp;&amp;(v=1/Math.sqrt(v));k[0]=p[0]*v;k[1]=p[1]*v;return k},dot:function(k,p){return k[0]*p[0]+k[1]*p[1]},cross:function(k,p,v){p=p[0]*v[1]-p[1]*v[0];k[0]=k[1]=0;k[2]=p;return k},lerp:function(k,p,v,z){var A=p[0];p=p[1];k[0]=A+z*(v[0]-A);k[1]=p+z*(v[1]-p);return k},random:function(k,p){p=p||1;var v=2*Ga()*Math.PI;k[0]=Math.cos(v)*p;k[1]=Math.sin(v)*
p;return k},transformMat2:function(k,p,v){var z=p[0];p=p[1];k[0]=v[0]*z+v[2]*p;k[1]=v[1]*z+v[3]*p;return k},transformMat2d:function(k,p,v){var z=p[0];p=p[1];k[0]=v[0]*z+v[2]*p+v[4];k[1]=v[1]*z+v[3]*p+v[5];return k},transformMat3:function(k,p,v){var z=p[0];p=p[1];k[0]=v[0]*z+v[3]*p+v[6];k[1]=v[1]*z+v[4]*p+v[7];return k},transformMat4:function(k,p,v){var z=p[0];p=p[1];k[0]=v[0]*z+v[4]*p+v[12];k[1]=v[1]*z+v[5]*p+v[13];return k},rotate:function(k,p,v,z){var A=p[0]-v[0];p=p[1]-v[1];var D=Math.sin(z);z=
Math.cos(z);k[0]=A*z-p*D+v[0];k[1]=A*D+p*z+v[1];return k},angle:function(k,p){var v=k[0];k=k[1];var z=p[0];p=p[1];var A=Math.sqrt(v*v+k*k)*Math.sqrt(z*z+p*p);return Math.acos(Math.min(Math.max(A&amp;&amp;(v*z+k*p)/A,-1),1))},zero:function(k){k[0]=0;k[1]=0;return k},str:function(k){return"vec2("+k[0]+", "+k[1]+")"},exactEquals:function(k,p){return k[0]===p[0]&amp;&amp;k[1]===p[1]},equals:function(k,p){var v=k[0];k=k[1];var z=p[0];p=p[1];return Math.abs(v-z)&lt;=.000001*Math.max(1,Math.abs(v),Math.abs(z))&amp;&amp;Math.abs(k-
p)&lt;=.000001*Math.max(1,Math.abs(k),Math.abs(p))},len:jb,sub:eb,mul:fb,div:gb,dist:hb,sqrDist:ib,sqrLen:kb,forEach:Ia});c.glMatrix=mb;c.mat2=nb;c.mat2d=ob;c.mat3=pb;c.mat4=qb;c.quat=Na;c.quat2=Oa;c.vec2=Ia;c.vec3=La;c.vec4=Ma;Object.defineProperty(c,"__esModule",{value:!0})});"use strict";
{function c(E,J,O){var R=[0,0];var T=E[1][1]-E[0][1];var Y=E[0][0]-E[1][0];E=T*E[0][0]+Y*E[0][1];var W=J[1][1]-J[0][1];var ea=J[0][0]-J[1][0];J=W*J[0][0]+ea*J[0][1];var qa=T*ea-W*Y;H(qa,0,O||0)||(R[0]=(ea*E-Y*J)/qa,R[1]=(T*J-W*E)/qa);return R}function b(E,J,O,R){var T=J[0]-E[0];J=J[1]-E[1];var Y=R[0]-O[0],W=R[1]-O[1];if(0===Y*J-W*T)return!1;R=(T*(O[1]-E[1])+J*(E[0]-O[0]))/(Y*J-W*T);E=(Y*(E[1]-O[1])+W*(O[0]-E[0]))/(W*T-Y*J);return 0&lt;=R&amp;&amp;1&gt;=R&amp;&amp;0&lt;=E&amp;&amp;1&gt;=E}function a(E,J,O){return(J[0]-E[0])*(O[1]-E[1])-
(O[0]-E[0])*(J[1]-E[1])}function f(E,J,O){return 0&lt;a(E,J,O)}function d(E,J,O){return 0&lt;=a(E,J,O)}function e(E,J,O){return 0&gt;a(E,J,O)}function g(E,J,O){return 0&gt;=a(E,J,O)}var tmpPoint1=[],tmpPoint2=[];function h(E,J,O,R){if(R){var T=tmpPoint1,Y=tmpPoint2;T[0]=J[0]-E[0];T[1]=J[1]-E[1];Y[0]=O[0]-J[0];Y[1]=O[1]-J[1];return Math.acos((T[0]*Y[0]+T[1]*Y[1])/(Math.sqrt(T[0]*T[0]+T[1]*T[1])*Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])))&lt;R}return 0===a(E,J,O)}function l(E,J){var O=J[0]-E[0];E=J[1]-E[1];return O*O+E*E}function m(E,
J){var O=E.length;return E[0&gt;J?J%O+O:J%O]}function n(E){E.length=0}function r(E,J,O,R){for(;O&lt;R;O++)E.push(J[O])}function q(E){for(var J=[],O=E.length,R=0;R!==O;R++)J.push(E.pop());for(R=0;R!==O;R++)E[R]=J[R]}function t(E,J){return e(m(E,J-1),m(E,J),m(E,J+1))}var tmpLine1=[],tmpLine2=[];function u(E,J,O){var R=tmpLine1,T=tmpLine2;if(d(m(E,J+1),m(E,J),m(E,O))&amp;&amp;g(m(E,J-1),m(E,J),m(E,O)))return!1;var Y=l(m(E,J),m(E,O));for(var W=0;W!==E.length;++W)if((W+1)%E.length!==J&amp;&amp;W!==J&amp;&amp;d(m(E,J),m(E,O),m(E,W+
1))&amp;&amp;g(m(E,J),m(E,O),m(E,W))){R[0]=m(E,J);R[1]=m(E,O);T[0]=m(E,W);T[1]=m(E,W+1);var ea=c(R,T);if(l(m(E,J),ea)&lt;Y)return!1}return!0}function w(E,J,O){for(var R=0;R!==E.length;++R)if(R!==J&amp;&amp;R!==O&amp;&amp;(R+1)%E.length!==J&amp;&amp;(R+1)%E.length!==O&amp;&amp;b(m(E,J),m(E,O),m(E,R),m(E,R+1)))return!1;return!0}function y(E,J,O,R){R=R||[];n(R);if(J&lt;O)for(var T=J;T&lt;=O;T++)R.push(E[T]);else{for(T=0;T&lt;=O;T++)R.push(E[T]);for(T=J;T&lt;E.length;T++)R.push(E[T])}return R}function C(E){for(var J=[],O,R,T=[],Y=Number.MAX_VALUE,W=0;W&lt;E.length;++W)if(t(E,
W))for(var ea=0;ea&lt;E.length;++ea)if(u(E,W,ea)){O=C(y(E,W,ea,T));R=C(y(E,ea,W,T));for(var qa=0;qa&lt;R.length;qa++)O.push(R[qa]);O.length&lt;Y&amp;&amp;(J=O,Y=O.length,J.push([m(E,W),m(E,ea)]))}return J}function G(E,J){if(0===J.length)return[E];if(J instanceof Array&amp;&amp;J.length&amp;&amp;J[0]instanceof Array&amp;&amp;2===J[0].length&amp;&amp;J[0][0]instanceof Array){E=[E];for(var O=0;O&lt;J.length;O++)for(var R=J[O],T=0;T&lt;E.length;T++){var Y=G(E[T],R);if(Y){E.splice(T,1);E.push(Y[0],Y[1]);break}}return E}R=J;O=E.indexOf(R[0]);T=E.indexOf(R[1]);
return-1!==O&amp;&amp;-1!==T?[y(E,O,T),y(E,T,O)]:!1}function x(E,J,O,R,T){var Y=J[1]-E[1];J=E[0]-J[0];E=Y*E[0]+J*E[1];var W=R[1]-O[1];R=O[0]-R[0];O=W*O[0]+R*O[1];var ea=Y*R-W*J;return H(ea,0,T||0)?[0,0]:[(R*E-J*O)/ea,(Y*O-W*E)/ea]}function B(E,J,O,R,T,Y,W){Y=Y||100;W=W||0;T=T||25;J="undefined"!==typeof J?J:[];O=O||[];R=R||[];var ea=[0,0],qa=[0,0],ja=[0,0],xa,ua=0,Da=0,Ea=0,Ba=[],Aa=[];if(3&gt;E.length)return J;W++;if(W&gt;Y)return console.warn("quickDecomp: max level ("+Y+") reached."),J;for(var ia=0;ia&lt;E.length;++ia)if(t(E,
ia)){O.push(E[ia]);var Fa=xa=Number.MAX_VALUE;for(var wa=0;wa&lt;E.length;++wa){if(f(m(E,ia-1),m(E,ia),m(E,wa))&amp;&amp;g(m(E,ia-1),m(E,ia),m(E,wa-1))&amp;&amp;(ja=x(m(E,ia-1),m(E,ia),m(E,wa),m(E,wa-1)),e(m(E,ia+1),m(E,ia),ja))){var Ca=l(E[ia],ja);Ca&lt;xa&amp;&amp;(xa=Ca,qa=ja,Da=wa)}f(m(E,ia+1),m(E,ia),m(E,wa+1))&amp;&amp;g(m(E,ia+1),m(E,ia),m(E,wa))&amp;&amp;(ja=x(m(E,ia+1),m(E,ia),m(E,wa),m(E,wa+1)),f(m(E,ia-1),m(E,ia),ja)&amp;&amp;(Ca=l(E[ia],ja),Ca&lt;Fa&amp;&amp;(Fa=Ca,ea=ja,ua=wa)))}if(Da===(ua+1)%E.length)ja[0]=(qa[0]+ea[0])/2,ja[1]=(qa[1]+ea[1])/2,R.push(ja),
ia&lt;ua?(r(Ba,E,ia,ua+1),Ba.push(ja),Aa.push(ja),0!==Da&amp;&amp;r(Aa,E,Da,E.length),r(Aa,E,0,ia+1)):(0!==ia&amp;&amp;r(Ba,E,ia,E.length),r(Ba,E,0,ua+1),Ba.push(ja),Aa.push(ja),r(Aa,E,Da,ia+1));else{Da&gt;ua&amp;&amp;(ua+=E.length);ea=Number.MAX_VALUE;if(ua&lt;Da)return J;for(wa=Da;wa&lt;=ua;++wa)d(m(E,ia-1),m(E,ia),m(E,wa))&amp;&amp;g(m(E,ia+1),m(E,ia),m(E,wa))&amp;&amp;(Ca=l(m(E,ia),m(E,wa)),Ca&lt;ea&amp;&amp;w(E,ia,wa)&amp;&amp;(ea=Ca,Ea=wa%E.length));ia&lt;Ea?(r(Ba,E,ia,Ea+1),0!==Ea&amp;&amp;r(Aa,E,Ea,E.length),r(Aa,E,0,ia+1)):(0!==ia&amp;&amp;r(Ba,E,ia,E.length),r(Ba,E,0,Ea+1),r(Aa,
E,Ea,ia+1))}Ba.length&lt;Aa.length?(B(Ba,J,O,R,T,Y,W),B(Aa,J,O,R,T,Y,W)):(B(Aa,J,O,R,T,Y,W),B(Ba,J,O,R,T,Y,W));return J}J.push(E);return J}function H(E,J,O){return Math.abs(E-J)&lt;=(O||0)}function P(E,J,O){return H(E[0],J[0],O)&amp;&amp;H(E[1],J[1],O)}self.polyDecomp={decomp:function(E){var J=C(E);return 0&lt;J.length?G(E,J):[E]},quickDecomp:B,isSimple:function(E){var J;for(J=0;J&lt;E.length-1;J++)for(var O=0;O&lt;J-1;O++)if(b(E[J],E[J+1],E[O],E[O+1]))return!1;for(J=1;J&lt;E.length-2;J++)if(b(E[0],E[E.length-1],E[J],E[J+
1]))return!1;return!0},removeCollinearPoints:function(E,J){for(var O=0,R=E.length-1;3&lt;E.length&amp;&amp;0&lt;=R;--R)h(m(E,R-1),m(E,R),m(E,R+1),J)&amp;&amp;(E.splice(R%E.length,1),O++);return O},removeDuplicatePoints:function(E,J){for(var O=E.length-1;1&lt;=O;--O)for(var R=E[O],T=O-1;0&lt;=T;--T)P(R,E[T],J)&amp;&amp;E.splice(O,1)},makeCCW:function(E){for(var J=0,O=1;O&lt;E.length;++O)if(E[O][1]&lt;E[J][1]||E[O][1]===E[J][1]&amp;&amp;E[O][0]&gt;E[J][0])J=O;if(f(m(E,J-1),m(E,J),m(E,J+1)))return!1;q(E);return!0}}}"use strict";
{let c=!1,b=!1,a="dev";const f=self.C3=class{constructor(){throw TypeError("static class can't be instantiated");}static SetReady(){c=!0}static IsReady(){return c}static SetAppStarted(){b=!0}static HasAppStarted(){return b}static SetBuildMode(d){a=d}static GetBuildMode(){return a}static IsReleaseBuild(){return"final"===a}};f.isDebug=!1;f.isDebugDefend=!1;f.hardwareConcurrency=navigator.hardwareConcurrency||2}"use strict";
{const c=self.C3;c.QueryParser=class{constructor(b){this._queryString=b;this._parameters=new Map;this._Parse()}_Parse(){var b=this._queryString;if(b.startsWith("?")||b.startsWith("#"))b=b.substr(1);b=b.split("&amp;");for(const a of b)this._ParseParameter(a)}_ParseParameter(b){if(b)if(b.includes("=")){var a=b.indexOf("="),f=decodeURIComponent(b.substring(0,a));b=decodeURIComponent(b.substring(a+1));this._parameters.set(f,b)}else this._parameters.set(b,null)}LogAll(){for(const b of this._parameters)console.log("[QueryParser] Parameter '"+
b[0]+"' = "+(null===b[1]?"null":"'"+b[1]+"'"))}Has(b){return this._parameters.has(b)}Get(b){b=this._parameters.get(b);return"undefined"===typeof b?null:b}ClearHash(){history.replaceState("",document.title,location.pathname+location.search)}Reparse(b){this._queryString=b;this._parameters.clear();this._Parse()}};c.QueryString=new c.QueryParser(location.search);c.LocationHashString=new c.QueryParser(location.hash);"dev"!==c.QueryString.Get("mode")&amp;&amp;c.SetBuildMode("final")}"use strict";
{const c=self.C3,b=navigator.userAgent;let a={linux:/linux|openbsd|freebsd|netbsd/i.test(b),chromeOS:/CrOS/.test(b),windowsTizen:/trident|iemobile|msie|tizen/i.test(b),genericMS:/trident|iemobile|msie|edge\//i.test(b),opera:/OPR\//.test(b),blackberry:/bb10/i.test(b),edge:/edge\//i.test(b),trident:/trident/i.test(b),webkit:/webkit/i.test(b),safari:/safari\//i.test(b),chrome:/chrome\//i.test(b),chromium:/chromium\//i.test(b),crosswalk:/crosswalk|xwalk/i.test(b),nwjs:/nwjs/i.test(b),amazonwebapp:/amazonwebappplatform/i.test(b),
webview:/wv\)/.test(b),android:/android/i.test(b),nokia:/nokiabrowser\/[0-9.]+/i.test(b)};var JSCompiler_object_inline_windows_0=/windows\s+nt\s+\d+\.\d+/i.exec(b),JSCompiler_object_inline_OSX_1=/mac\s+os\s+x\s+[0-9_]+/i.exec(b),JSCompiler_object_inline_android_2=/android\s+[0-9.]+/i.exec(b),JSCompiler_object_inline_opera_3=/OPR\/[0-9.]+/.exec(b),JSCompiler_object_inline_tizen_4=/tizen\s+[0-9.]+/i.exec(b),JSCompiler_object_inline_iphone_5=/iphone\s+os\s+[0-9_]+/i.exec(b),JSCompiler_object_inline_ipad_6=
/ipad[^)]*os\s+[0-9_]+/i.exec(b),JSCompiler_object_inline_winPhone_7=/windows\s+phone\s+[0-9.]+/i.exec(b),JSCompiler_object_inline_winPhoneOS_8=/windows\s+phone\s+os\s+[0-9.]+/i.exec(b),JSCompiler_object_inline_chrome_9=/chrome\/[0-9.]+/i.exec(b),JSCompiler_object_inline_chromium_10=/chromium\/[0-9.]+/i.exec(b),JSCompiler_object_inline_nwjs_11=/nwjs\/[0-9.]+/i.exec(b),JSCompiler_object_inline_firefox_12=/firefox\/[0-9.]+/i.exec(b),JSCompiler_object_inline_ie_13=/msie\s+[0-9.]+/i.exec(b),JSCompiler_object_inline_edge_14=
/edge\/[0-9.]+/i.exec(b),JSCompiler_object_inline_edgeChromium_15=/edg\/[0-9.]+/i.exec(b),JSCompiler_object_inline_silk_16=/silk\/[0-9.]+/i.exec(b);let f="(unknown)",d="(unknown)",e="(unknown)",g="(unknown)",h="(unknown)",l="(unknown)",m="(unknown)",n="browser",r=!1,q=!1,t=new Map;function u(y,C,G){!0===C?(G(),t.set(y,!0)):C&amp;&amp;C.length&amp;&amp;(G(C[0]),t.set(y,!0))}u("isWindows",JSCompiler_object_inline_windows_0,y=&gt;{f="Windows";if(y=y.split(" ")[2])switch(y){case "5.0":d="2000";break;case "5.1":d="XP";break;
case "5.2":d="XP";break;case "6.0":d="Vista";break;case "6.1":d="7";break;case "6.2":d="8";break;case "6.3":d="8.1";break;case "10.0":d="10"}});u("isOSX",JSCompiler_object_inline_OSX_1,y=&gt;{f="Mac OS X";(y=y.split(" ")[3])&amp;&amp;(d=y.replace("_","."))});u("isLinux",a.linux,()=&gt;{f="Linux"});u("isChromeOS",a.chromeOS,()=&gt;{f="Chrome OS"});u("isAndroid",!a.windowsTizen&amp;&amp;JSCompiler_object_inline_android_2,y=&gt;{f="Android";(y=y.split(" ")[1])&amp;&amp;(d=y)});u("isTizen",JSCompiler_object_inline_tizen_4,y=&gt;{f="Tizen";
(y=y.split(" ")[1])&amp;&amp;(d=y)});u("isIPhone",!a.windowsTizen&amp;&amp;JSCompiler_object_inline_iphone_5,y=&gt;{f="iOS";(y=y.split(" ")[2])&amp;&amp;(d=y.replace("_","."))});u("isIPad",!a.windowsTizen&amp;&amp;JSCompiler_object_inline_ipad_6,y=&gt;{f="iOS";(y=y.split(" ")[3])&amp;&amp;(d=y.replace("_","."))});u("isWindowsPhone",JSCompiler_object_inline_winPhone_7,y=&gt;{f="Windows Phone";(y=y.split(" ")[2])&amp;&amp;(d=y)});u("isWindowsPhoneOS",JSCompiler_object_inline_winPhoneOS_8,y=&gt;{f="Windows Phone";(y=y.split(" ")[3])&amp;&amp;(d=y)});u("isBlackberry",
a.blackberry,()=&gt;{f="Blackberry";d="10";g="stock";m="webkit"});u("isChrome",!a.edge&amp;&amp;!a.opera&amp;&amp;JSCompiler_object_inline_chrome_9,y=&gt;{g="Chrome";m="Chromium";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isOpera",JSCompiler_object_inline_opera_3,y=&gt;{g="Opera";m="Chromium";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isChromium",JSCompiler_object_inline_chromium_10,y=&gt;{m=g="Chromium";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isFirefox",JSCompiler_object_inline_firefox_12,y=&gt;{g="Firefox";m="Gecko";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isInternetExplorer",
JSCompiler_object_inline_ie_13,y=&gt;{g="Internet Explorer";m="Trident";(y=y.split(" ")[1])&amp;&amp;(h=y)});u("isTrident","Internet Explorer"!==g&amp;&amp;a.trident,()=&gt;{m="Trident";var y=/rv:[0-9.]+/i.exec(b);y&amp;&amp;y.length&amp;&amp;(g="Internet Explorer",(y=y[0].split(":")[1])&amp;&amp;(h=y))});u("isEdge",JSCompiler_object_inline_edge_14,y=&gt;{m=g="Edge";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isEdgeChromium",JSCompiler_object_inline_edgeChromium_15,y=&gt;{g="Edge";m="Chromium";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isSafari",a.safari&amp;&amp;!a.nokia&amp;&amp;!a.chrome&amp;&amp;
!a.chromium&amp;&amp;!a.genericIE&amp;&amp;!a.blackberry,()=&gt;{g="Safari";m="WebKit";var y=/version\/[0-9.]+/i.exec(b),C=/crios\/[0-9.]+/i.exec(b),G=/fxios\/[0-9.]+/i.exec(b);y&amp;&amp;y.length&amp;&amp;(y=y[0].split("/")[1])&amp;&amp;(h=y);C&amp;&amp;C.length&amp;&amp;(g="Chrome for iOS",(C=C[0].split("/")[1])&amp;&amp;(h=C));G&amp;&amp;G.length&amp;&amp;(g="Firefox for iOS",(G=G[0].split("/")[1])&amp;&amp;(h=G))});u("isSilk",JSCompiler_object_inline_silk_16,y=&gt;{g="Silk";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isCrosswalk",a.crosswalk,()=&gt;n="crosswalk");u("isCordova",self.device&amp;&amp;(self.device.cordova||
self.device.phonegap),()=&gt;n="cordova");u("isNWJS",JSCompiler_object_inline_nwjs_11,y=&gt;{n="nwjs";g="NW.js";m="Chromium";(y=y.split("/")[1])&amp;&amp;(h=y)});u("isAmazonWebApp",a.amazonwebapp,()=&gt;n="webapp");u("isHomeScreenWebApp","nwjs"!==n&amp;&amp;"undefined"!==typeof window&amp;&amp;(window.matchMedia&amp;&amp;window.matchMedia("(display-mode: standalone)").matches||navigator.standalone),()=&gt;n="webapp");u("isFalseSafari","Safari"===g&amp;&amp;("Android"===f||"Tizen"===f||"Blackberry"===f),()=&gt;g="stock");u("isAndroidWebview","Chrome"===
g&amp;&amp;"browser"===n&amp;&amp;a.webview,()=&gt;n="webview");u("isFirefoxOS","Firefox"===g&amp;&amp;"(unknown)"===f,()=&gt;f="Firefox OS");u("isAndroidFallback","(unknown)"===f&amp;&amp;!a.windowsTizen&amp;&amp;a.android,()=&gt;f="Android");u("isTridentFallback","(unknown)"===f&amp;&amp;a.trident,()=&gt;m="Trident");u("isWebkitFallback","(unknown)"===f&amp;&amp;a.webkit,()=&gt;m="WebKit");u("is64Bit",(y=&gt;y.test(b)||y.test(navigator.platform)||"x64"===navigator.cpuClass)(/x86_64|x86-64|win64|x64;|x64\)|x64_|amd64|wow64|ia64|arm64|arch64|sparc64|ppc64|irix64/i),()=&gt;
e="64-bit");u("is32Bit",(y=&gt;y.test(b)||y.test(navigator.platform)||"x86"===navigator.cpuClass)(/x86;|x86\)|i86|i386|i486|i586|i686|armv1|armv2|armv3|armv4|armv5|armv6|armv7/i),()=&gt;e="32-bit");u("is64BitFallback","(unknown)"===e&amp;&amp;"Mac OS X"===f&amp;&amp;10.7&lt;=parseFloat(d),()=&gt;e="64-bit");u("is32BitFallback","(unknown)"===e&amp;&amp;"Windows"===f||"Android"===f&amp;&amp;5&gt;parseFloat(d),()=&gt;e="32-bit");u("is32BitBrowser","32-bit"===e||/wow64/i.test(b),()=&gt;l="32-bit");u("is64BitBrowser",/win64/i.test(b),()=&gt;l="64-bit");u("isDesktop",
(()=&gt;"Windows"===f||"Mac OS X"===f||"Linux"===f||"Chrome OS"===f||"nwjs"===n)(),()=&gt;r=!0);"Edge"===m&amp;&amp;"undefined"!==typeof Windows&amp;&amp;"undefined"!==typeof Windows.System&amp;&amp;(n="windows-store");q="nwjs"===n;const w="Mac OS X"===f&amp;&amp;navigator.maxTouchPoints&amp;&amp;2&lt;navigator.maxTouchPoints;w&amp;&amp;(f="iOS",d=h,q=r=!1);c.Platform={OS:f,OSVersion:d,OSArchitecture:e,Browser:g,BrowserVersion:h,BrowserVersionNumber:parseFloat(h),BrowserArchitecture:l,BrowserEngine:m,Context:n,IsDesktop:r,IsMobile:!r,IsDesktopApp:q,IsChromeWebStore:!!(self.chrome&amp;&amp;
self.chrome.runtime&amp;&amp;self.chrome.runtime.id),IsAppleOS:"Mac OS X"===f||"iOS"===f,IsIpadOS:w}}"use strict";
{const c=new Map,b="undefined"!==typeof IDBObjectStore&amp;&amp;"function"===typeof IDBObjectStore.prototype.getAll,a="undefined"!==typeof IDBObjectStore&amp;&amp;"function"===typeof IDBObjectStore.prototype.getAllKeys;function f(t){return new Promise((u,w)=&gt;{t.onsuccess=()=&gt;u(t.result);t.onerror=()=&gt;w(t.error)})}function d(t){return new Promise((u,w)=&gt;{t.oncomplete=()=&gt;u();t.onerror=()=&gt;w(t.error);t.onabort=()=&gt;w(t.error)})}function e(t,u){return h(t,u)}function g(t,u){return h(t,u,!0)}async function h(t,u,w=!1,
y=!0){const C=await l(t);try{const G=C.transaction(["keyvaluepairs"],w?"readwrite":"readonly");return u(G)}catch(G){if(y&amp;&amp;"InvalidStateError"===G.name)return c.delete(t),h(t,u,w,!1);throw G;}}function l(t){n(t);let u=c.get(t);u instanceof Promise||(u=m(t),c.set(t,u),u.catch(w=&gt;c.delete(t)));return u}async function m(t){n(t);const u=indexedDB.open(t,2);u.addEventListener("upgradeneeded",w=&gt;{try{w.target.result.createObjectStore("keyvaluepairs")}catch(y){console.error(`Failed to create objectstore for database ${t}`,
y)}});return f(u)}function n(t){if("string"!==typeof t)throw new TypeError("expected string");}function r(t,u){const w=t.objectStore("keyvaluepairs").openCursor();return new Promise(y=&gt;{const C=[];w.onsuccess=G=&gt;{if(G=G.target.result){switch(u){case "entries":C.push([G.key,G.value]);break;case "keys":C.push(G.key);break;case "values":C.push(G.value)}G.continue()}else y(C)}})}class q{constructor(t){n(t);this.name=t}async ready(){await l(this.name)}set(t,u){n(t);return g(this.name,async w=&gt;{var y=w.objectStore("keyvaluepairs").put(u,
t);y=f(y);w=d(w);await Promise.all([w,y])})}get(t){n(t);return e(this.name,async u=&gt;{var w=u.objectStore("keyvaluepairs").get(t);w=f(w);u=d(u);[,u]=await Promise.all([u,w]);return u})}delete(t){n(t);return g(this.name,async u=&gt;{var w=u.objectStore("keyvaluepairs").delete(t);w=f(w);u=d(u);await Promise.all([u,w])})}clear(){return g(this.name,async t=&gt;{var u=t.objectStore("keyvaluepairs").clear();u=f(u);t=d(t);await Promise.all([t,u])})}keys(){return e(this.name,async t=&gt;{if(a){var u=t.objectStore("keyvaluepairs").getAllKeys();
u=f(u)}else u=r(t,"keys");t=d(t);[,t]=await Promise.all([t,u]);return t})}values(){return e(this.name,async t=&gt;{if(b){var u=t.objectStore("keyvaluepairs").getAll();u=f(u)}else u=r(t,"values");t=d(t);[,t]=await Promise.all([t,u]);return t})}entries(){return e(this.name,async t=&gt;{var u=r(t,"entries");t=d(t);[,u]=await Promise.all([t,u]);return u})}}self.KVStorageContainer=q}"use strict";
{const c=self.KVStorageContainer,b=[/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],a=new WeakMap;let f=!1;"undefined"===typeof indexedDB&amp;&amp;(f=!0,console.warn("Unable to use local storage because indexedDB is not defined"));function d(l){throw Error(`"${l}" is not implemented`);
}function e(l){if("function"===typeof l)throw Error("localforage callback API is not implemented; please use the promise API instead");}function g(l){return"object"===typeof l?new Promise(m=&gt;{const {port1:n,port2:r}=new MessageChannel;r.onmessage=q=&gt;m(q.data);n.postMessage(l)}):Promise.resolve(l)}class h{constructor(l){this._inst=l;a.set(this,new Map)}_MaybeSwitchToMemoryFallback(l){if(!f)for(const m of b)if(l&amp;&amp;m.test(l.message)){console.error("Unable to use local storage, reverting to in-memory store: ",
l,l.message);f=!0;break}}async _getItemFallback(l){l=a.get(this).get(l);l=await g(l);return"undefined"===typeof l?null:l}async _setItemFallback(l,m){m=await g(m);a.get(this).set(l,m)}_removeItemFallback(l){a.get(this).delete(l)}_clearFallback(){a.get(this).clear()}_keysFallback(){return Array.from(a.get(this).keys())}IsUsingFallback(){return f}async getItem(l,m){e(m);if(f)return await this._getItemFallback(l);let n;try{n=await this._inst.get(l)}catch(r){this._MaybeSwitchToMemoryFallback(r);if(f)return await this._getItemFallback(l);
console.error(`Error reading '${l}' from storage, returning null: `,r);return null}return"undefined"===typeof n?null:n}async setItem(l,m,n){e(n);"undefined"===typeof m&amp;&amp;(m=null);if(f)await this._setItemFallback(l,m);else try{await this._inst.set(l,m)}catch(r){if(this._MaybeSwitchToMemoryFallback(r),f)await this._setItemFallback(l,m);else throw r;}}async removeItem(l,m){e(m);if(f)this._removeItemFallback(l);else try{await this._inst.delete(l)}catch(n){this._MaybeSwitchToMemoryFallback(n),f?this._removeItemFallback(l):
console.error(`Error removing '${l}' from storage: `,n)}}async clear(l){e(l);if(f)this._clearFallback();else try{await this._inst.clear()}catch(m){this._MaybeSwitchToMemoryFallback(m),f?this._clearFallback():console.error("Error clearing storage: ",m)}}async keys(l){e(l);if(f)return this._keysFallback();l=[];try{l=await this._inst.keys()}catch(m){this._MaybeSwitchToMemoryFallback(m);if(f)return this._keysFallback();console.error("Error getting storage keys: ",m)}return l}ready(l){e(l);return f?Promise.resolve(!0):
this._inst.ready()}createInstance(l){if("object"!==typeof l)throw new TypeError("invalid options object");l=l.name;if("string"!==typeof l)throw new TypeError("invalid store name");l=new c(l);return new h(l)}length(l){d("localforage.length()")}key(l,m){d("localforage.key()")}iterate(l,m){d("localforage.iterate()")}setDriver(l){d("localforage.setDriver()")}config(l){d("localforage.config()")}defineDriver(l){d("localforage.defineDriver()")}driver(){d("localforage.driver()")}supports(l){d("localforage.supports()")}dropInstance(){d("localforage.dropInstance()")}disableMemoryMode(){f=
!1}}self.localforage=new h(new c("localforage"))}"use strict";
{const c=self.C3;c.Supports={};c.Supports.WebAnimations=(()=&gt;{try{if("Safari"===c.Platform.Browser||"undefined"===typeof document)return!1;const b=document.createElement("div");return"undefined"===typeof b.animate?!1:"undefined"!==typeof b.animate([{opacity:"0"},{opacity:"1"}],1E3).reverse}catch(b){return!1}})();c.Supports.DialogElement="undefined"!==typeof HTMLDialogElement;c.Supports.RequestIdleCallback=!!self.requestIdleCallback;c.Supports.ImageBitmap=!!self.createImageBitmap;c.Supports.ImageBitmapOptions=
!1;if(c.Supports.ImageBitmap)try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:"none"}).then(b=&gt;{c.Supports.ImageBitmapOptions=!0}).catch(b=&gt;{c.Supports.ImageBitmapOptions=!1})}catch(b){c.Supports.ImageBitmapOptions=!1}c.Supports.ClipboardReadText=!(!navigator.clipboard||!navigator.clipboard.readText||"Firefox"===c.Platform.Browser);c.Supports.PermissionsQuery=!(!navigator.permissions||!navigator.permissions.query);c.Supports.Proxies="undefined"!==typeof Proxy;c.Supports.DownloadAttribute=
(()=&gt;"undefined"===typeof document?!1:"undefined"!==typeof document.createElement("a").download)();c.Supports.CanvasToBlob=(()=&gt;"undefined"!==typeof HTMLCanvasElement&amp;&amp;HTMLCanvasElement.prototype.toBlob)();c.Supports.Fetch="function"===typeof fetch;c.Supports.PersistentStorage=!!(self.isSecureContext&amp;&amp;"Opera"!==c.Platform.Browser&amp;&amp;navigator.storage&amp;&amp;navigator.storage.persist);c.Supports.StorageQuotaEstimate=!!(self.isSecureContext&amp;&amp;navigator.storage&amp;&amp;navigator.storage.estimate);c.Supports.Fullscreen=
(()=&gt;{if("undefined"===typeof document||"iOS"===c.Platform.OS)return!1;const b=document.documentElement;return!!(b.requestFullscreen||b.msRequestFullscreen||b.mozRequestFullScreen||b.webkitRequestFullscreen)})();c.Supports.ImageDecoder="undefined"!==typeof self.ImageDecoder;c.Supports.NativeFileSystemAPI=!!self.showOpenFilePicker;c.Supports.NavigatorFontsQuery=!(!navigator.fonts||!navigator.fonts.query)}"use strict";
{const c=self.C3;if(!String.prototype.trimStart){const b=/^[\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(b,"")}}if(!String.prototype.trimEnd){const b=/[\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(b,
"")}}String.prototype.replaceAll||(String.prototype.replaceAll=function(b,a){return this.replace(new RegExp(c.EscapeRegex(b),"g"),a)});Array.prototype.values||(Array.prototype.values=function*(){for(const b of this)yield b});if(!Array.prototype.flat){function b(a,f){return a.reduce((d,e)=&gt;{0&lt;f&amp;&amp;Array.isArray(e)?Array.prototype.push.apply(d,b(e,f-1)):d.push(e);return d},[])}Array.prototype.flat=function(a=1){return b(this,a)}}RegExp.escape||(RegExp.escape=function(b){return String(b).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((b,a)=&gt;navigator.webkitTemporaryStorage.queryUsageAndQuota((f,d)=&gt;b({usage:f,quota:d}),a))});"undefined"===typeof HTMLCollection||HTMLCollection.prototype[Symbol.iterator]||(HTMLCollection.prototype[Symbol.iterator]=function(){let b=0;return{next:()=&gt;b&gt;=this.length?{done:!0}:{value:this.item(b++),
done:!1}}});"undefined"===typeof NodeList||NodeList.prototype[Symbol.iterator]||(NodeList.prototype[Symbol.iterator]=function(){let b=0;return{next:()=&gt;b&gt;=this.length?{done:!0}:{value:this.item(b++),done:!1}}});"undefined"===typeof DOMTokenList||DOMTokenList.prototype[Symbol.iterator]||(DOMTokenList.prototype[Symbol.iterator]=function(){let b=0;return{next:()=&gt;b&gt;=this.length?{done:!0}:{value:this.item(b++),done:!1}}});"undefined"===typeof FileList||FileList.prototype[Symbol.iterator]||(FileList.prototype[Symbol.iterator]=
function(){let b=0;return{next:()=&gt;b&gt;=this.length?{done:!0}:{value:this.item(b++),done:!1}}});"undefined"===typeof TextEncoder&amp;&amp;(self.TextEncoder=class{constructor(){Object.defineProperty(this,"encoding",{value:"utf-8",writable:!1})}encode(b){for(var a=b.length,f=-1,d=new Uint8Array(3*a),e,g,h=0;h!==a;){e=b.charCodeAt(h);h+=1;if(55296&lt;=e&amp;&amp;56319&gt;=e){if(h===a){d[f+=1]=239;d[f+=1]=191;d[f+=1]=189;break}g=b.charCodeAt(h);if(56320&lt;=g&amp;&amp;57343&gt;=g){if(e=1024*(e-55296)+g-56320+65536,h+=1,65535&lt;e){d[f+=1]=240|
e&gt;&gt;&gt;18;d[f+=1]=128|e&gt;&gt;&gt;12&amp;63;d[f+=1]=128|e&gt;&gt;&gt;6&amp;63;d[f+=1]=128|e&amp;63;continue}}else{d[f+=1]=239;d[f+=1]=191;d[f+=1]=189;continue}}127&gt;=e?d[f+=1]=0|e:(2047&gt;=e?d[f+=1]=192|e&gt;&gt;&gt;6:(d[f+=1]=224|e&gt;&gt;&gt;12,d[f+=1]=128|e&gt;&gt;&gt;6&amp;63),d[f+=1]=128|e&amp;63)}return new Uint8Array(d.buffer.slice(0,f+1))}toString(){return"[object TextEncoder]"}},TextEncoder[Symbol.toStringTag]="TextEncoder");if("undefined"===typeof TextDecoder){function b(d){const e=d[Symbol.iterator]();return{next:g=&gt;e.next(),[Symbol.iterator](){return this}}}
function a(d){d=d.next();if(d.done)throw Error("unexpected end of input");if(0!=(d.value&amp;192^128))throw Error("invalid byte");return d.value&amp;63}const f=new Map;f.set("utf-8",(d,e)=&gt;{if(d.buffer)var g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);else if(g instanceof ArrayBuffer)g=new Uint8Array(d);else throw Error("Invalid parameter");d=b(g);g=[];try{for(const h of d){let l;if(127&gt;h)l=h&amp;127;else if(223&gt;h)l=(h&amp;31)&lt;&lt;6|a(d);else if(239&gt;h)l=(h&amp;15)&lt;&lt;12|a(d)&lt;&lt;6|a(d);else if(247&gt;h)l=(h&amp;7)&lt;&lt;18|a(d)&lt;&lt;
12|a(d)&lt;&lt;6|a(d);else throw Error("Invalid character");g.push(String.fromCodePoint(l))}}catch(h){if(e)throw h;g.push("\ufffd")}return g.join("")});f.set("utf8",f.get("utf-8"));f.set("utf-16le",(d,e)=&gt;{throw Error("utf-16le decoder not implemented");});self.TextDecoder=class{constructor(d="utf-8",e={}){const g=f.get(d);if(!g)throw Error(`TextDecoder polyfill does not support "${d}"`);Object.defineProperty(this,"fatal",{value:!0===e.fatal,writable:!1});Object.defineProperty(this,"_decoder",{value:g,
writable:!1});Object.defineProperty(this,"encoding",{value:d,writable:!1})}decode(d){return this._decoder(d,this.fatal)}toString(){return"[object TextDecoder]"}};TextDecoder[Symbol.toStringTag]="TextDecoder"}"undefined"===typeof self.isSecureContext&amp;&amp;(self.isSecureContext="https:"===location.protocol);"undefined"===typeof self.globalThis&amp;&amp;(self.globalThis=self)}"use strict";
{const c=self.C3;function b(a){let f=c.GetCallStack();console.error("Assertion failure: "+a+"\n\nStack trace:\n"+f)}self.assert=function(a,f){a||b(f)}}"use strict";
{const c=self.C3;c.IsNumber=function(a){return"number"===typeof a};c.IsFiniteNumber=function(a){return c.IsNumber(a)&amp;&amp;isFinite(a)};c.RequireNumber=function(a){if(!c.IsNumber(a))throw new TypeError("expected number");};c.RequireOptionalNumber=function(a){c.IsNullOrUndefined(a)};c.RequireNumberInRange=function(a,f,d){if(!c.IsNumber(a)||isNaN(a)||f&gt;a||d&lt;a)throw new RangeError("number outside of range");};c.RequireAllNumber=function(...a){for(let f of a);};c.RequireFiniteNumber=function(a){if(!c.IsFiniteNumber(a))throw new TypeError("expected finite number");
};c.RequireOptionalFiniteNumber=function(a){c.IsNullOrUndefined(a)};c.RequireAllFiniteNumber=function(...a){for(let f of a);};c.IsString=function(a){return"string"===typeof a};c.RequireString=function(a){if(!c.IsString(a))throw new TypeError("expected string");};c.RequireOptionalString=function(a){c.IsNullOrUndefined(a)};c.RequireAllString=function(...a){for(let f of a);};c.IsSimpleObject=function(a){return"object"!==typeof a||null===a?!1:(a=Object.getPrototypeOf(a))?a.constructor===Object:null===
a};c.RequireSimpleObject=function(a){if(!c.IsSimpleObject(a))throw new TypeError("expected simple object");};c.RequireOptionalSimpleObject=function(a){if(!c.IsNullOrUndefined(a)&amp;&amp;!c.IsSimpleObject(a))throw new TypeError("expected simple object");};c.IsObject=function(a){return"object"===typeof a&amp;&amp;null!==a&amp;&amp;!Array.isArray(a)};c.RequireObject=function(a){if(!c.IsObject(a))throw new TypeError("expected object");};c.RequireOptionalObject=function(a){c.IsNullOrUndefined(a)};c.RequireAllObject=function(...a){for(let f of a);
};c.IsFileLike=function(a){return c.IsInstanceOf(a,Blob)&amp;&amp;"string"===typeof a.name};c.RequireFileLike=function(a){if(!c.IsFileLike(a))throw new TypeError("expected file");};c.RequireOptionalFileLike=function(a){c.IsNullOrUndefined(a)};c.IsArray=function(a){return Array.isArray(a)};c.RequireArray=function(a){if(!c.IsArray(a))throw new TypeError("expected array");};c.RequireOptionalArray=function(a){c.IsNullOrUndefined(a)};c.RequireAllArray=function(...a){for(let f of a);};c.Is2DArray=function(a){return c.IsArray(a)?
a.length?c.IsArray(a[0])?!0:!1:!0:!1};c.Require2DArray=function(a){if(!c.Is2DArray(a))throw new TypeError("expected 2d array");for(let f of a)if(!c.IsArray(f))throw new TypeError("expected 2d array");};c.RequireOptional2DArray=function(a){c.IsNullOrUndefined(a)};c.IsFunction=function(a){return"function"===typeof a};c.RequireFunction=function(a,f){if(!c.IsFunction(a))throw new TypeError("expected function");if(!c.IsNullOrUndefined(f)&amp;&amp;a!==f)throw new TypeError("expected same function reference");};
c.RequireOptionalFunction=function(a){c.IsNullOrUndefined(a)};c.RequireAllFunction=function(...a){for(let f of a);};c.RequireAnyFunction=function(a,...f){if(!c.IsFunction(a))throw new TypeError("expected function");if(!f.length)throw Error("missing comparison functions");for(let d of f)if(!c.IsNullOrUndefined(d)&amp;&amp;a===d)return;throw new TypeError("expected same function reference");};c.RequireOptionalAllFunction=function(...a){if(!c.IsNullOrUndefined(a))for(let f of a);};c.IsInstanceOf=function(a,
f){return a instanceof f};c.IsInstanceOfAny=function(a,...f){for(let d of f)if(c.IsInstanceOf(a,d))return!0;return!1};c.RequireInstanceOf=function(a,f){if(!c.IsInstanceOf(a,f))throw new TypeError("unexpected type");};c.RequireOptionalInstanceOf=function(a,f){c.IsNullOrUndefined(a)};c.RequireAllInstanceOf=function(a,...f){for(let d of f);};c.RequireAnyInstanceOf=function(a,...f){if(!c.IsInstanceOfAny(a,...f))throw new TypeError("unexpected type");};c.RequireAnyOptionalInstanceOf=function(a,...f){if(!c.IsNullOrUndefined(a)&amp;&amp;
!c.IsInstanceOfAny(a,...f))throw new TypeError("unexpected type");};c.IsArrayOf=function(a,f){for(let d of a)if(!c.IsInstanceOf(d,f))return!1;return!0};c.IsArrayOfFiniteNumbers=function(a){for(let f of a)if(!c.IsFiniteNumber(f))return!1;return!0};c.RequireArrayOf=function(a,f){for(let d of a);};c.RequireOptionalArrayOf=function(a,f){if(!c.IsNullOrUndefined(a))for(let d of a);};c.RequireArrayOfAny=function(a,...f){for(let d of a);};c.RequireOptionalArrayOfAny=function(a,...f){if(!c.IsNullOrUndefined(a))for(let d of a);
};c.IsDOMNode=function(a,f){return c.IsNullOrUndefined(a)||!c.IsString(a.nodeName)?!1:!f||c.equalsNoCase(a.nodeName,f)};c.RequireDOMNode=function(a,f){if(c.IsNullOrUndefined(a)||!c.IsString(a.nodeName))throw new TypeError("expected DOM node");if(f&amp;&amp;!c.equalsNoCase(a.nodeName,f))throw new TypeError(`expected DOM '${f}' node`);};c.RequireOptionalDOMNode=function(a,f){c.IsNullOrUndefined(a)};c.IsHTMLElement=function(a,f){return c.IsNullOrUndefined(a)||!c.IsString(a.tagName)?!1:!f||c.equalsNoCase(a.tagName,
f)};c.RequireHTMLElement=function(a,f){if(c.IsNullOrUndefined(a)||!c.IsString(a.tagName))throw new TypeError("expected HTML element");if(f&amp;&amp;!c.equalsNoCase(a.tagName,f))throw new TypeError(`expected HTML '${f}' element`);};c.RequireOptionalHTMLElement=function(a,f){c.IsNullOrUndefined(a)};c.IsDrawable=function(a){return c.IsHTMLElement(a,"img")||c.IsHTMLElement(a,"canvas")||c.IsHTMLElement(a,"video")||"undefined"!==typeof OffscreenCanvas&amp;&amp;a instanceof OffscreenCanvas||"undefined"!==typeof ImageBitmap&amp;&amp;
a instanceof ImageBitmap};c.RequireDrawable=function(a){if(!c.IsDrawable(a))throw new TypeError("expected drawable");};c.RequireOptionalDrawable=function(a){c.IsNullOrUndefined(a)};c.IsDrawableOrImageData=function(a){return a instanceof ImageData?!0:c.IsDrawable(a)};c.RequireDrawableOrImageData=function(a){if(!c.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");};c.RequireOptionalDrawableOrImageData=function(a){if(!c.IsNullOrUndefined(a)&amp;&amp;!c.IsDrawableOrImageData(a))throw new TypeError("expected drawable or image data");
};c.IsStringLike=function(a){return"string"===typeof a||a instanceof c.HtmlString||a instanceof c.BBString};c.RequireStringLike=function(a){if(!c.IsStringLike(a))throw new TypeError("expected string-like");};c.RequireOptionalStringLike=function(a){c.IsNullOrUndefined(a)};c.RequireAllStringLike=function(...a){for(let f of a);};c.RequireOverride=function(){throw Error("must be overridden");};c.NotYetImplemented=function(){throw Error("not yet implemented");};c.IsDefined=function(a,...f){if("undefined"===
typeof a)return!1;for(let d of f){if("undefined"===typeof a[d])return!1;a=a[d]}return!0};c.IsNullOrUndefined=function(a){return"undefined"===typeof a||null===a};c.AreArrayElementsOfSameType=function(a){let f=a[0].constructor;for(let d of a)if(d.constructor!==f)return!1;return f};c.AreArrayElementsOfType=function(a,f){for(let d of a)if(!(d instanceof f))return!1;return!0};const b=Object.getPrototypeOf(Uint8Array);c.IsTypedArray=function(a){return c.IsInstanceOf(a,b)};c.RequireTypedArray=function(a){};
c.WeakRequireTypedArray=function(a){c.WeakRequireInstanceOf(a,b)};c.WeakRequireAnyInstanceOf=function(a,...f){if(!c.WeakIsAnyInstanceOf(a,...f))throw new TypeError("unexpected type");};c.WeakIsAnyInstanceOf=function(a,...f){for(const d of f)if(c.WeakIsInstanceOf(a,d))return!0;return!1};c.WeakRequireInstanceOf=function(a,f){if(!c.WeakIsInstanceOf(a,f))throw new TypeError("unexpected type");};c.WeakIsInstanceOf=function(a,f){for(;a=Object.getPrototypeOf(a);)if(a.constructor.name===f.name)return!0;return!1}}"use strict";
{const c=self.C3;c.GetCallStack=function(){return Error().stack};c.Debugger=function(){debugger};c.cast=function(t,u){return t&amp;&amp;t instanceof u?t:null};c.getName=function(t){return"undefined"===typeof t?"undefined":null===t?"null":"boolean"===typeof t?"&lt;boolean&gt;":c.IsNumber(t)?"&lt;number&gt;":c.IsString(t)?"&lt;string&gt;":c.IsArray(t)?"&lt;array&gt;":"symbol"===typeof t?"&lt;"+t.toString()+"&gt;":c.IsFunction(t)?t.name&amp;&amp;"Function"!==t.name?t.name:"&lt;anonymous function&gt;":"object"===typeof t?t.constructor&amp;&amp;t.constructor.name&amp;&amp;
"Object"!==t.constructor.name?t.constructor.name:"&lt;anonymous object&gt;":"&lt;unknown&gt;"};c.getType=function(t){return null===t?"null":Array.isArray(t)?"array":typeof t};c.range=function*(t,u){if(!isFinite(Math.abs(t-u)))throw Error("Invalid parameters");if(t&gt;u)for(--t;t&gt;=u;t--)yield t;else for(;t&lt;u;t++)yield t};function b(t,u){t=c.getType(t);u=c.getType(u);return"null"===t||"null"===u?!0:"undefined"===t||"undefined"===u?!1:t===u}let a=new Map,f=new Map,d=new WeakMap,e=new WeakMap;c.DefendHandler={};const g=
new Set(["then","splice"]);function h(t){console.warn("[Defence] "+t+" @",c.GetCallStack())}c.DefendHandler.get=function(t,u){u in t||"symbol"===typeof u||g.has(u)||h(`Accessed missing property '${u}' from defended object '${c.getName(t)}', returning undefined`);e.has(t)&amp;&amp;"symbol"!==typeof u&amp;&amp;!g.has(u)&amp;&amp;h(`Accessed property '${u}' on a released object '${c.getName(t)}'\nObject was originally released at: ${e.get(t)})\nCall stack at access: `);return t[u]};c.DefendHandler.set=function(t,u,w){u in t||
a.has(t)||h(`Set non-existent property '${u}' to '${w}' on defended object '${c.getName(t)}'`);b(t[u],w)||a.has(t)||h(`Set '${c.getType(t[u])}' property '${u}' to type '${c.getType(w)}' on defended object '${c.getName(t)}'`);e.has(t)&amp;&amp;h(`Set property '${u}' on a released object '${c.getName(t)}'\nObject was originally released at: ${e.get(t)})\nCall stack at access: `);t[u]=w;return!0};c.DefendHandler.deleteProperty=function(t,u){throw new ReferenceError(`Cannot delete property '${u}' from defended object '${c.getName(t)}'`);
};c.DefendHandler.defineProperty=function(t,u,w){throw new ReferenceError(`Cannot define property '${u}' on defended object '${c.getName(t)}'`);};c.DefendHandler.enumerate=function(t){throw new ReferenceError(`Cannot enumerate defended object '${c.getName(t)}'`);};let l=-1;function m(){l=-1;if(0&lt;a.size||0&lt;f.size){let t=[...new Set([...a.keys()].map(u=&gt;c.getName(u)))].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: ${t}`);
a.clear();f.clear()}}c.DefendedBase=class{constructor(){if(c.isDebugDefend&amp;&amp;c.Supports.Proxies){var t=new.target;t=Object.create(t.prototype);var u=new Proxy(t,c.DefendHandler);a.set(t,u);f.set(u,t);d.set(u,t);-1===l&amp;&amp;(l=requestAnimationFrame(m));return u}}};c.debugDefend=function(t){if(c.isDebugDefend&amp;&amp;c.Supports.Proxies&amp;&amp;t instanceof c.DefendedBase){if(!f.has(t))return t;let u=f.get(t);f.delete(t);a.delete(u);return t}return c.isDebug?Object.seal(t):t};c.New=function(t,...u){let w;try{w=new t(...u)}catch(y){throw f.clear(),
a.clear(),y;}c.isDebugDefend&amp;&amp;q(t,w);return c.debugDefend(w)};c.Release=function(t){(t=d.get(t))&amp;&amp;e.set(t,c.GetCallStack())};c.WasReleased=function(t){return(t=d.get(t))?!!e.get(t):!1};let n=new Map;function r(t){let u=new Set;for(let w in t)u.add(w);return u}function q(t,u){u=r(u);let w=n.get(t);if(w){let y=[];for(let C of w.values())u.has(C)?u.delete(C):y.push(C);c.appendArray(y,[...u]);y.length&amp;&amp;console.warn(`[Defence] '${c.getName(t)}' constructor creates inconsistent properties: ${y.join(", ")}`)}else n.set(t,
u)}c.PerfMark=class{constructor(t){this._name="";t&amp;&amp;this.start(t)}start(t){this._name=t;performance.mark(this._name+"-Start")}end(){performance.mark(this._name+"-End");performance.measure(this._name,this._name+"-Start",this._name+"-End")}next(t){this.end();this._name=t;performance.mark(this._name+"-Start")}}}"use strict";
{const c=self.C3,b=2*Math.PI,a=Math.PI/180,f=180/Math.PI;c.wrap=function(g,h,l){g=Math.floor(g);h=Math.floor(h);l=Math.floor(l);return g&lt;h?(g=l-(h-g)%(l-h),g===l?0:g):h+(g-h)%(l-h)};c.mapToRange=function(g,h,l,m,n){return(g-h)*(n-m)/(l-h)+m};c.normalize=function(g,h,l){return(g-h)/(l-h)};c.clamp=function(g,h,l){return g&lt;h?h:g&gt;l?l:g};c.clampAngle=function(g){g%=b;0&gt;g&amp;&amp;(g+=b);return g};c.toRadians=function(g){return g*a};c.toDegrees=function(g){return g*f};c.distanceTo=function(g,h,l,m){return Math.hypot(l-
g,m-h)};c.distanceSquared=function(g,h,l,m){g=l-g;h=m-h;return g*g+h*h};c.angleTo=function(g,h,l,m){return Math.atan2(m-h,l-g)};c.angleDiff=function(g,h){if(g===h)return 0;g=Math.sin(g)*Math.sin(h)+Math.cos(g)*Math.cos(h);return 1&lt;=g?0:-1&gt;=g?Math.PI:Math.acos(g)};c.angleRotate=function(g,h,l){let m=Math.sin(g),n=Math.cos(g),r=Math.sin(h),q=Math.cos(h);return Math.acos(m*r+n*q)&gt;l?0&lt;n*r-m*q?c.clampAngle(g+l):c.clampAngle(g-l):c.clampAngle(h)};c.angleClockwise=function(g,h){return 0&gt;=Math.cos(g)*Math.sin(h)-
Math.sin(g)*Math.cos(h)};c.angleLerp=function(g,h,l,m=0){let n=c.angleDiff(g,h);m*=b;return c.angleClockwise(h,g)?c.clampAngle(g+(n+m)*l):c.clampAngle(g-(n+m)*l)};c.angleLerpClockwise=function(g,h,l,m=0){const n=c.angleDiff(g,h);m*=b;return c.angleClockwise(h,g)?c.clampAngle(g+(n+m)*l):c.clampAngle((b-n+m)*l)};c.angleLerpAntiClockwise=function(g,h,l,m=0){const n=c.angleDiff(g,h);m*=b;return c.angleClockwise(h,g)?c.clampAngle((-b+n-m)*l):c.clampAngle(g-(n+m)*l)};c.lerp=function(g,h,l){return g+l*(h-
g)};c.unlerp=function(g,h,l){return g===h?0:(l-g)/(h-g)};c.relerp=function(g,h,l,m,n){return c.lerp(m,n,c.unlerp(g,h,l))};c.qarp=function(g,h,l,m){return c.lerp(c.lerp(g,h,m),c.lerp(h,l,m),m)};c.cubic=function(g,h,l,m,n){return c.lerp(c.qarp(g,h,l,n),c.qarp(h,l,m,n),n)};c.cosp=function(g,h,l){return(g+h+(g-h)*Math.cos(l*Math.PI))/2};c.isPOT=function(g){return 0&lt;g&amp;&amp;0===(g-1&amp;g)};c.nextHighestPowerOfTwo=function(g){--g;for(let h=1;32&gt;h;h&lt;&lt;=1)g|=g&gt;&gt;h;return g+1};c.roundToNearestFraction=function(g,h){return Math.round(g*
h)/h};c.floorToNearestFraction=function(g,h){return Math.floor(g*h)/h};c.round6dp=function(g){return Math.round(1E6*g)/1E6};c.toFixed=function(g,h){g=g.toFixed(h);for(h=g.length-1;0&lt;=h&amp;&amp;"0"===g.charAt(h);--h);0&lt;=h&amp;&amp;"."===g.charAt(h)&amp;&amp;--h;return 0&gt;h?g:g.substr(0,h+1)};c.PackRGB=function(g,h,l){return c.clamp(g,0,255)|c.clamp(h,0,255)&lt;&lt;8|c.clamp(l,0,255)&lt;&lt;16};c.PackRGBAEx=function(g,h,l,m){g=c.clamp(Math.floor(1024*g),-8192,8191);h=c.clamp(Math.floor(1024*h),-8192,8191);l=c.clamp(Math.floor(1024*l),
-8192,8191);m=c.clamp(Math.floor(1023*m),0,1023);0&gt;g&amp;&amp;(g+=16384);0&gt;h&amp;&amp;(h+=16384);0&gt;l&amp;&amp;(l+=16384);return-(274877906944*g+16777216*h+1024*l+m)};c.PackRGBEx=function(g,h,l){return c.PackRGBAEx(g,h,l,1)};function d(g){return 0===g&amp;&amp;0&gt;1/g}c.GetRValue=function(g){if(0&lt;=g)return(g&amp;255)/255;g=Math.floor(-g/274877906944);8191&lt;g&amp;&amp;(g-=16384);return g/1024};c.GetGValue=function(g){if(0&lt;=g)return((g&amp;65280)&gt;&gt;8)/255;g=Math.floor(-g%274877906944/16777216);8191&lt;g&amp;&amp;(g-=16384);return g/1024};c.GetBValue=function(g){if(0&lt;=
g)return((g&amp;16711680)&gt;&gt;16)/255;g=Math.floor(-g%16777216/1024);8191&lt;g&amp;&amp;(g-=16384);return g/1024};c.GetAValue=function(g){return d(g)?0:0&lt;=g?1:Math.floor(-g%1024)/1023};c.greatestCommonDivisor=function(g,h){g=Math.floor(g);for(h=Math.floor(h);0!==h;){let l=h;h=g%h;g=l}return g};const e=[[3,2],[4,3],[5,4],[5,3],[6,5],[14,9],[16,9],[16,10],[21,9]];c.getAspectRatio=function(g,h){g=Math.floor(g);h=Math.floor(h);if(g===h)return[1,1];for(var l of e){let m=g/l[0]*l[1];if(1&gt;Math.abs(h-m))return l.slice(0);
m=g/l[1]*l[0];if(1&gt;Math.abs(h-m))return[l[1],l[0]]}l=c.greatestCommonDivisor(g,h);return[g/l,h/l]};c.segmentsIntersect=function(g,h,l,m,n,r,q,t){var u=Math.min(g,l),w=Math.max(n,q);if(Math.max(g,l)&lt;Math.min(n,q)||u&gt;w)return!1;u=Math.min(h,m);w=Math.max(r,t);if(Math.max(h,m)&lt;Math.min(r,t)||u&gt;w)return!1;u=n-g+q-l;w=r-h+t-m;g=l-g;h=m-h;n=q-n;r=t-r;t=Math.abs(h*n-r*g);return Math.abs(n*w-r*u)&gt;t?!1:Math.abs(g*w-h*u)&lt;=t};c.segmentsIntersectPreCalc=function(g,h,l,m,n,r,q,t,u,w,y,C){const G=Math.max(u,y);
if(r&lt;Math.min(u,y)||n&gt;G)return!1;n=Math.max(w,C);if(t&lt;Math.min(w,C)||q&gt;n)return!1;q=u-g+y-l;t=w-h+C-m;g=l-g;h=m-h;u=y-u;w=C-w;C=Math.abs(h*u-w*g);return Math.abs(u*t-w*q)&gt;C?!1:Math.abs(g*t-h*q)&lt;=C};c.segmentIntersectsQuad=function(g,h,l,m,n){const r=Math.min(g,l),q=Math.max(g,l),t=Math.min(h,m),u=Math.max(h,m),w=n.getTlx(),y=n.getTly(),C=n.getTrx(),G=n.getTry(),x=n.getBrx(),B=n.getBry(),H=n.getBlx();n=n.getBly();return c.segmentsIntersectPreCalc(g,h,l,m,r,q,t,u,w,y,C,G)||c.segmentsIntersectPreCalc(g,
h,l,m,r,q,t,u,C,G,x,B)||c.segmentsIntersectPreCalc(g,h,l,m,r,q,t,u,x,B,H,n)||c.segmentsIntersectPreCalc(g,h,l,m,r,q,t,u,H,n,w,y)};c.segmentIntersectsAnyN=function(g,h,l,m,n){const r=Math.min(g,l),q=Math.max(g,l),t=Math.min(h,m),u=Math.max(h,m);let w=0;for(let y=n.length-4;w&lt;=y;w+=2)if(c.segmentsIntersectPreCalc(g,h,l,m,r,q,t,u,n[w],n[w+1],n[w+2],n[w+3]))return!0;return c.segmentsIntersectPreCalc(g,h,l,m,r,q,t,u,n[w],n[w+1],n[0],n[1])};c.rayIntersect=function(g,h,l,m,n,r,q,t){l-=g;r=t-r;const u=l*
r-(m-h)*(q-n);if(0===u)return 2;m=((h-m)*(q-g)+l*(t-h))/u;return 0&lt;m&amp;&amp;1.000001&gt;m?(r*(q-g)+(n-q)*(t-h))/u:2};c.rayIntersectExtended=function(g,h,l,m,n,r,q,t,u){const w=(q-n)*u;u*=t-r;return c.rayIntersect(g,h,l,m,n-w,r-u,q+w,t+u)};c.isPointInTriangleInclusive=function(g,h,l,m,n,r,q,t){n-=l;r-=m;q-=l;t-=m;g-=l;l=h-m;h=n*n+r*r;m=n*q+r*t;n=n*g+r*l;r=q*q+t*t;q=q*g+t*l;t=1/(h*r-m*m);r=(r*n-m*q)*t;n=(h*q-m*n)*t;return 0&lt;=r&amp;&amp;0&lt;=n&amp;&amp;1&gt;=r+n};c.triangleCartesianToBarycentric=function(g,h,l,m,n,r,q,t){n-=l;r-=
m;q-=l;t-=m;g-=l;const u=h-m;h=n*n+r*r;m=n*q+r*t;l=q*q+t*t;n=g*n+u*r;r=g*q+u*t;q=h*l-m*m;t=(l*n-m*r)/q;n=(h*r-m*n)/q;return[1-t-n,t,n]};c.triangleBarycentricToCartesian=function(g,h,l,m,n,r,q,t,u){return[g*m+h*r+l*t,g*n+h*q+l*u]}}"use strict";
{const c=self.C3;let b=null,a="";if("undefined"!==typeof document){b=document;const l=document.querySelector("base");if(a=l&amp;&amp;l.hasAttribute("href")?l.getAttribute("href"):"")a.startsWith("/")&amp;&amp;(a=a.substr(1)),a.endsWith("/")||(a+="/")}c.GetBaseHref=function(){return a};c.GetBaseURL=function(){if(!b)return"";const l=b.location;return c.GetPathFromURL(l.origin+l.pathname)+a};c.GetPathFromURL=function(l){if(!l.length||l.endsWith("/")||l.endsWith("\\"))return l;const m=Math.max(l.lastIndexOf("/"),l.lastIndexOf("\\"));
return-1===m?"":l.substr(0,m+1)};c.GetFilenameFromURL=function(l){if(!l.length)return l;if(l.endsWith("/")||l.endsWith("\\"))return"";const m=Math.max(l.lastIndexOf("/"),l.lastIndexOf("\\"));return-1===m?l:l.substr(m+1)};c.DataTransferHasFiles=function(l){if(l.types)for(let m=0;m&lt;l.types.length;m++)if("Files"===l.types[m]||"application/x-c3-file"===l.types[m])return!0;return!1};c.DataTransferFilterFiles=async function(l,m){l=Array.from(l.files).filter(n=&gt;0!==n.size).filter(n=&gt;m(n)).map(async n=&gt;{try{return await c.CloneFile(n)}catch(r){return null}});
return(await Promise.all(l)).filter(n=&gt;n)};c.IsFileAnImage=function(l){return l.type?-1!==l.type.search(/image\/.*/):-1!==c.MimeType.GetForFileExtension(c.GetFileExtension(l.name)).GetString().search(/image\/.*/)};c.IsFileAnSVG=function(l){return"image/svg+xml"===l.type};c.IsFileAMultiImageContainer=function(l){return l.type?c.MimeType.Get(l.type).IsAnimatedImage():c.MimeType.GetForFileExtension(c.GetFileExtension(l.name)).IsAnimatedImage()};c.GetFileExtension=function(l){let m=l.lastIndexOf(".");
return 1&gt;m?"":l.substr(m)};c.GetFileNamePart=function(l){let m=l.lastIndexOf(".");return 1&gt;m?l:l.substr(0,m)};c.NormalizeFileSeparator=function(l){return l.replace(/\\/g,"/")};c.ParseFilePath=function(l){l=c.NormalizeFileSeparator(l);let m=/^\w:\//.exec(l);m?(m=m[0],l=l.slice(3),"/"!==l[0]&amp;&amp;(l="/"+l)):m="";l=l.replace(/\/{2,}/g,"/");1&lt;l.length&amp;&amp;"/"===l.slice(-1)&amp;&amp;(l=l.slice(0,-1));var n=l.lastIndexOf("/")+1;let r="",q=l,t="";0&lt;n&amp;&amp;(r=l.slice(0,n),q=l.slice(n));l=q;n=q.lastIndexOf(".");0&lt;n&amp;&amp;(t=q.slice(n),
l=q.slice(0,-t.length));return{dir:r,base:q,name:l,root:m,ext:t,full:m+r+q}};c.Wait=function(l,m){return new Promise((n,r)=&gt;{self.setTimeout(n,l,m)})};c.swallowException=function(l){try{l()}catch(m){c.isDebug&amp;&amp;console.warn("Swallowed exception: ",m)}};c.noop=function(){};c.equalsNoCase=function(l,m){if("string"!==typeof l||"string"!==typeof m)return!1;if(l===m)return!0;l=l.normalize();m=m.normalize();return l.length!==m.length?!1:l.toLowerCase()===m.toLowerCase()};c.equalsCase=function(l,m){return"string"!==
typeof l||"string"!==typeof m?!1:l===m?!0:l.normalize()===m.normalize()};c.typedArraySet16=function(l,m,n){l[n++]=m[0];l[n++]=m[1];l[n++]=m[2];l[n++]=m[3];l[n++]=m[4];l[n++]=m[5];l[n++]=m[6];l[n++]=m[7];l[n++]=m[8];l[n++]=m[9];l[n++]=m[10];l[n++]=m[11];l[n++]=m[12];l[n++]=m[13];l[n++]=m[14];l[n]=m[15]};c.truncateArray=function(l,m){l.length=m};c.clearArray=function(l){l&amp;&amp;0!==l.length&amp;&amp;c.truncateArray(l,0)};c.clear2DArray=function(l){if(l){for(let m=0;m&lt;l.length;m++)c.truncateArray(l[m],0);c.truncateArray(l,
0)}};c.extendArray=function(l,m,n){m|=0;var r=l.length;if(!(m&lt;=r))for(;r&lt;m;++r)l.push(n)};c.resizeArray=function(l,m,n){m|=0;const r=l.length;m&lt;r?c.truncateArray(l,m):m&gt;r&amp;&amp;c.extendArray(l,m,n)};c.shallowAssignArray=function(l,m){c.clearArray(l);c.appendArray(l,m)};c.appendArray=function(l,m){if(1E4&gt;m.length)l.push(...m);else for(let n=0,r=m.length;n&lt;r;++n)l.push(m[n])};c.arrayRemove=function(l,m){m=Math.floor(m);if(!(0&gt;m||m&gt;=l.length)){for(var n=l.length-1;m&lt;n;++m)l[m]=l[m+1];c.truncateArray(l,n)}};
c.arrayFindRemove=function(l,m){m=l.indexOf(m);0&lt;=m&amp;&amp;l.splice(m,1)};c.arraysEqual=function(l,m){let n=l.length;if(m.length!==n)return!1;for(let r=0;r&lt;n;++r)if(l[r]!==m[r])return!1;return!0};c.arrayFilterOut=function(l,m){let n=[],r=0;for(let q=0,t=l.length;q&lt;t;++q){let u=l[q];m(u)?n.push(u):(l[r]=u,++r)}c.truncateArray(l,r);return n};c.arrayRemoveAllInSet=function(l,m){const n=l.length;let r=0;for(let q=0,t=l.length;q&lt;t;++q){let u=l[q];m.has(u)||(l[r++]=u)}c.truncateArray(l,r);return n-r};c.isArrayIndexInBounds=
function(l,m){return l!==Math.floor(l)?!1:0&lt;=l&amp;&amp;l&lt;m.length};c.validateArrayIndex=function(l,m){if(!c.isArrayIndexInBounds(l,m))throw new RangeError("array index out of bounds");};c.cloneArray=function(l){return l.slice()};c.deepCloneArray=function(l,m){let n=[];for(let r of l)if(c.IsObject(r)){l=m(r);if(!l)throw Error("missing clone");if(l.constructor!==r.constructor)throw Error("object is not a clone");n.push(l)}else c.IsArray(r)?n.push(c.deepCloneArray(r,m)):n.push(r);return n};c.clone2DArray=function(l){let m=
[];for(let n of l)m.push(n.slice());return m};c.mergeSets=function(l,m){return new Set([...l,...m])};c.mergeSetsInPlace=function(l,m){for(const n of m)l.add(n);return l};c.first=function(l){for(let m of l)return m;return null};c.xor=function(l,m){return!l!==!m};c.compare=function(l,m,n){switch(m){case 0:return l===n;case 1:return l!==n;case 2:return l&lt;n;case 3:return l&lt;=n;case 4:return l&gt;n;case 5:return l&gt;=n;default:return!1}};c.hasAnyOwnProperty=function(l){for(let m in l)if(l.hasOwnProperty(m))return!0;
return!1};c.PromiseAllWithProgress=function(l,m){return l.length?new Promise((n,r)=&gt;{const q=[];let t=0,u=!1;for(let w=0,y=l.length;w&lt;y;++w)q.push(void 0),l[w].then(C=&gt;{u||(q[w]=C,++t,t===l.length?n(q):m(t,l.length))}).catch(C=&gt;{u=!0;r(C)})}):Promise.resolve([])};let f=[];c.AddLibraryMemoryCallback=function(l){f.push(l)};c.GetEstimatedLibraryMemoryUsage=function(){let l=0;for(let m of f){let n=m();l+=n}return Math.floor(l)};let d=1;const e=new Map,g=new MessageChannel;g.port2.onmessage=function(l){const m=
l.data,n=e.get(m);e.delete(m);n&amp;&amp;n(l.timeStamp)};c.RequestUnlimitedAnimationFrame=function(l){const m=d++;e.set(m,l);g.port1.postMessage(m);return m};c.CancelUnlimitedAnimationFrame=function(l){e.delete(l)};c.PostTask=c.RequestUnlimitedAnimationFrame;c.WaitForNextTask=function(){return new Promise(l=&gt;c.PostTask(l))};const h=new Set;c.RequestPostAnimationFrame=function(l){const m=self.requestAnimationFrame(async n=&gt;{await c.WaitForNextTask();h.has(m)&amp;&amp;(h.delete(m),l(n))});h.add(m);return m};c.CancelPostAnimationFrame=
function(l){h.has(l)&amp;&amp;(self.cancelAnimationFrame(l),h.delete(l))}}"use strict";
{const c=self.C3;c.IsAbsoluteURL=function(b){return/^(?:[a-z]+:)?\/\//.test(b)||"data:"===b.substr(0,5)||"blob:"===b.substr(0,5)};c.IsRelativeURL=function(b){return!c.IsAbsoluteURL(b)};c.ThrowIfNotOk=function(b){if(!b.ok)throw Error(`fetch '${b.url}' response returned ${b.status} ${b.statusText}`);};c.FetchOk=function(b,a){return fetch(b,a).then(f=&gt;{c.ThrowIfNotOk(f);return f})};c.FetchText=function(b){return c.FetchOk(b).then(a=&gt;a.text())};c.FetchJson=function(b){return c.FetchOk(b).then(a=&gt;a.json())};
c.FetchBlob=function(b){return c.FetchOk(b).then(a=&gt;a.blob())};c.FetchArrayBuffer=function(b){return c.FetchOk(b).then(a=&gt;a.arrayBuffer())};c.FetchImage=function(b){return new Promise((a,f)=&gt;{const d=new Image;d.onload=()=&gt;a(d);d.onerror=e=&gt;f(e);d.src=b})};c.BlobToArrayBuffer=function(b){return"function"===typeof b.arrayBuffer?b.arrayBuffer():new Promise((a,f)=&gt;{const d=new FileReader;d.onload=()=&gt;a(d.result);d.onerror=()=&gt;f(d.error);d.readAsArrayBuffer(b)})};c.BlobToString=function(b){return"function"===
typeof b.text?b.text():new Promise((a,f)=&gt;{const d=new FileReader;d.onload=()=&gt;a(d.result);d.onerror=()=&gt;f(d.error);d.readAsText(b)})};c.BlobToJson=function(b){return c.BlobToString(b).then(a=&gt;JSON.parse(a))};c.BlobToImage=async function(b,a){b=URL.createObjectURL(b);try{const f=await c.FetchImage(b);URL.revokeObjectURL(b);b="";a&amp;&amp;"function"===typeof f.decode&amp;&amp;await f.decode();return f}finally{b&amp;&amp;URL.revokeObjectURL(b)}};c.CreateCanvas=function(b,a){if("undefined"!==typeof document&amp;&amp;"function"===
typeof document.createElement){const f=document.createElement("canvas");f.width=b;f.height=a;return f}return new OffscreenCanvas(b,a)};c.CanvasToBlob=function(b,a,f){"number"!==typeof f&amp;&amp;(f=1);a=a||"image/png";f=c.clamp(f,0,1);return b.toBlob?new Promise(d=&gt;b.toBlob(d,a,f)):b.convertToBlob?b.convertToBlob({type:a,quality:f}):c.Asyncify(()=&gt;c.CanvasToBlobSync(b,a,f))};c.CanvasToBlobSync=function(b,a,f){"number"!==typeof f&amp;&amp;(f=1);a=a||"image/png";f=c.clamp(f,0,1);return c.DataURIToBinaryBlobSync(b.toDataURL(a,
f))};c.DataURIToBinaryBlobSync=function(b){b=c.ParseDataURI(b);return c.BinaryStringToBlob(b.data,b.mime_type)};c.ParseDataURI=function(b){if("data:"!==b.substr(0,5))throw new URIError("expected data: uri");var a=b.indexOf(",");if(0&gt;a)throw new URIError("expected comma in data: uri");var f=b.substring(5,a);b=b.substring(a+1);a=f.split(";");f=a[0]||"";let d=a[2];b="base64"===a[1]||"base64"===d?atob(b):decodeURIComponent(b);return{mime_type:f,data:b}};c.BinaryStringToBlob=function(b,a){var f=b.length;
let d=f&gt;&gt;2,e=new Uint8Array(f),g=new Uint32Array(e.buffer,0,d),h,l;for(l=h=0;h&lt;d;++h)g[h]=b.charCodeAt(l++)|b.charCodeAt(l++)&lt;&lt;8|b.charCodeAt(l++)&lt;&lt;16|b.charCodeAt(l++)&lt;&lt;24;for(f&amp;=3;f--;)e[l]=b.charCodeAt(l),++l;return a?new Blob([e],{type:a}):new Blob([e])};c.DrawableToBlob=function(b,a,f){const d=c.CreateCanvas(b.width,b.height);d.getContext("2d").drawImage(b,0,0);return c.CanvasToBlob(d,a,f)};c.ImageDataToBlobSync=function(b,a,f){const d=c.CreateCanvas(b.width,b.height);d.getContext("2d").putImageData(b,
0,0);return c.CanvasToBlobSync(d,a,f)};c.ImageDataToBlob=function(b,a,f){if(c.Supports.ImageBitmapOptions)return createImageBitmap(b,{premultiplyAlpha:"none"}).then(d=&gt;c.DrawableToBlob(d,a,f));if(c.Supports.ImageBitmap)return createImageBitmap(b).then(d=&gt;c.DrawableToBlob(d,a,f));{const d=c.CreateCanvas(b.width,b.height);d.getContext("2d").putImageData(b,0,0);return c.CanvasToBlob(d,a,f)}};c.CopySet=function(b,a){b.clear();for(const f of a)b.add(f)};c.MapToObject=function(b){const a=Object.create(null);
for(const [f,d]of b.entries())a[f]=d;return a};c.ObjectToMap=function(b,a){a.clear();for(const [f,d]of Object.entries(b))a.set(f,d)};c.ToSuperJSON=function f(a){if("object"===typeof a&amp;&amp;null!==a){if(a instanceof Set)return{_c3type_:"set",data:[...a].map(d=&gt;f(d))};if(a instanceof Map)return{_c3type_:"map",data:[...a].map(d=&gt;[d[0],f(d[1])])};{const d=Object.create(null);for(const [e,g]of Object.entries(a))d[e]=f(g);return d}}return a};c.FromSuperJSON=function d(f){if("object"===typeof f&amp;null!==f){if("set"===
f._c3type_)return new Set(f.data.map(e=&gt;d(e)));if("map"===f._c3type_)return new Map(f.data.map(e=&gt;[e[0],d(e[1])]));{const e=Object.create(null);for(const [g,h]of Object.entries(f))e[g]=d(h);return e}}return f};c.CSSToCamelCase=function(f){let d="",e=!1;for(const g of f)"-"===g?e=!0:e?(d+=g.toUpperCase(),e=!1):d+=g;return d};c.IsIterator=function(f){return"object"===typeof f&amp;&amp;"function"===typeof f.next};c.MakeFilledArray=function(f,d){const e=[];if("function"===typeof d)for(var g=0;g&lt;f;++g)e.push(d());
else for(g=0;g&lt;f;++g)e.push(d);return e}}"use strict";
{const c=self.C3,b=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?/i,a=/([0-9.]+),([0-9.]+)%?,([0-9.]+)%?,([0-9.])/i;function f(e){return 0===e.length?"00":1===e.length?"0"+e:e}function d(e,g,h){0&gt;h&amp;&amp;(h+=1);1&lt;h&amp;&amp;--h;return h&lt;1/6?e+6*(g-e)*h:.5&gt;h?g:h&lt;2/3?e+(g-e)*(2/3-h)*6:e}c.Color=class{constructor(e,g,h,l){this._a=this._b=this._g=this._r=0;e instanceof c.Color?this.set(e):this.setRgba(e||0,g||0,h||0,l||0)}setRgb(e,g,h){this._r=+e;this._g=+g;this._b=+h;this.clamp();return this}setRgba(e,g,h,l){this._r=+e;this._g=
+g;this._b=+h;this._a=+l;this.clamp();return this}set(e){this._r=e._r;this._g=e._g;this._b=e._b;this._a=e._a;return this}copy(e){return this.set(e)}add(e){this._r+=e._r;this._g+=e._g;this._b+=e._b;this._a+=e._a;this.clamp()}addRgb(e,g,h,l=0){this._r+=+e;this._g+=+g;this._b+=+h;this._a+=+l;this.clamp()}diff(e){this.setR(Math.max(this._r,e._r)-Math.min(this._r,e._r));this.setG(Math.max(this._g,e._g)-Math.min(this._g,e._g));this.setB(Math.max(this._b,e._b)-Math.min(this._b,e._b));this.setA(Math.max(this._a,
e._a)-Math.min(this._a,e._a));this.clamp()}copyRgb(e){this._r=e._r;this._g=e._g;this._b=e._b}setR(e){this._r=c.clamp(+e,0,1)}getR(){return this._r}setG(e){this._g=c.clamp(+e,0,1)}getG(){return this._g}setB(e){this._b=c.clamp(+e,0,1)}getB(){return this._b}setA(e){this._a=c.clamp(+e,0,1)}getA(){return this._a}clone(){return c.New(c.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(e,g){e[g++]=
this._r;e[g++]=this._g;e[g++]=this._b;e[g]=this._a}equals(e){return this._r===e._r&amp;&amp;this._g===e._g&amp;&amp;this._b===e._b&amp;&amp;this._a===e._a}equalsIgnoringAlpha(e){return this._r===e._r&amp;&amp;this._g===e._g&amp;&amp;this._b===e._b}equalsRgb(e,g,h){return this._r===e&amp;&amp;this._g===g&amp;&amp;this._b===h}equalsRgba(e,g,h,l){return this._r===e&amp;&amp;this._g===g&amp;&amp;this._b===h&amp;&amp;this._a===l}multiply(e){this._r*=e._r;this._g*=e._g;this._b*=e._b;this._a*=e._a}multiplyAlpha(e){this._r*=e;this._g*=e;this._b*=e;this._a*=e}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=c.clamp(this._r,0,1);this._g=c.clamp(this._g,0,1);this._b=c.clamp(this._b,0,1);this._a=c.clamp(this._a,0,1);return this}setFromRgbValue(e){this._r=c.GetRValue(e);this._g=c.GetGValue(e);this._b=c.GetBValue(e);this._a=c.GetAValue(e)}getCssRgb(e,g,h){e=c.IsFiniteNumber(e)?e:this.getR();g=c.IsFiniteNumber(g)?g:this.getG();h=c.IsFiniteNumber(h)?h:this.getB();return`rgb(${100*
e}%, ${100*g}%, ${100*h}%)`}getCssRgba(e,g,h,l){e=c.IsFiniteNumber(e)?e:this.getR();g=c.IsFiniteNumber(g)?g:this.getG();h=c.IsFiniteNumber(h)?h:this.getB();l=c.IsFiniteNumber(l)?l:this.getA();return`rgba(${100*e}%, ${100*g}%, ${100*h}%, ${l})`}toHexString(){const e=Math.round(255*this.getR()),g=Math.round(255*this.getG()),h=Math.round(255*this.getB());return"#"+f(e.toString(16))+f(g.toString(16))+f(h.toString(16))}parseHexString(e){if("string"!==typeof e)return!1;e=e.trim();"#"===e.charAt(0)&amp;&amp;(e=
e.substr(1));let g,h;if(3===e.length)g=parseInt(e[0],16)/15,h=parseInt(e[1],16)/15,e=parseInt(e[2],16)/15;else if(6===e.length)g=parseInt(e.substr(0,2),16)/255,h=parseInt(e.substr(2,2),16)/255,e=parseInt(e.substr(4,2),16)/255;else return!1;isFinite(g)&amp;&amp;this.setR(g);isFinite(h)&amp;&amp;this.setG(h);isFinite(e)&amp;&amp;this.setB(e);this.setA(1);return!0}toCommaSeparatedRgb(){const e=Math.round(255*this.getR()),g=Math.round(255*this.getG()),h=Math.round(255*this.getB());return`${e}, ${g}, ${h}`}toRgbArray(){const e=
Math.round(255*this.getR()),g=Math.round(255*this.getG()),h=Math.round(255*this.getB());return[e,g,h]}parseCommaSeparatedRgb(e){if("string"!==typeof e)return!1;e=e.replace(/^rgb\(|\)|%/,"");var g=e.split(",");if(3&gt;g.length)return!1;e=parseInt(g[0].trim(),10)/255;const h=parseInt(g[1].trim(),10)/255;g=parseInt(g[2].trim(),10)/255;isFinite(e)&amp;&amp;this.setR(e);isFinite(h)&amp;&amp;this.setG(h);isFinite(g)&amp;&amp;this.setB(g);this.setA(1);return!0}parseCommaSeparatedPercentageRgb(e){if("string"!==typeof e)return!1;e=
e.replace(/^rgb\(|\)|%/,"");var g=e.split(",");if(3&gt;g.length)return!1;e=parseInt(g[0].trim(),10)/100;const h=parseInt(g[1].trim(),10)/100;g=parseInt(g[2].trim(),10)/100;isFinite(e)&amp;&amp;this.setR(e);isFinite(h)&amp;&amp;this.setG(h);isFinite(g)&amp;&amp;this.setB(g);this.setA(1);return!0}parseCommaSeparatedRgba(e){if("string"!==typeof e)return!1;e=e.replace(/^rgba\(|\)|%/,"");var g=e.split(",");if(4&gt;g.length)return!1;e=parseInt(g[0].trim(),10)/255;const h=parseInt(g[1].trim(),10)/255,l=parseInt(g[2].trim(),10)/255;g=
parseFloat(g[3].trim());isFinite(e)&amp;&amp;this.setR(e);isFinite(h)&amp;&amp;this.setG(h);isFinite(l)&amp;&amp;this.setB(l);isFinite(g)&amp;&amp;this.setA(g);return!0}parseCommaSeparatedPercentageRgba(e){if("string"!==typeof e)return!1;e=e.replace(/^rgba\(|\)|%/,"");var g=e.split(",");if(4&gt;g.length)return!1;e=parseInt(g[0].trim(),10)/100;const h=parseInt(g[1].trim(),10)/100,l=parseInt(g[2].trim(),10)/100;g=parseFloat(g[3].trim());isFinite(e)&amp;&amp;this.setR(e);isFinite(h)&amp;&amp;this.setG(h);isFinite(l)&amp;&amp;this.setB(l);isFinite(g)&amp;&amp;this.setA(g);
return!0}parseString(e){if("string"!==typeof e)return!1;e=e.replace(/\s+/,"");if(e.includes(",")){if(e.startsWith("rgb("))return e.includes("%")?this.parseCommaSeparatedPercentageRgb(e):this.parseCommaSeparatedRgb(e);if(e.startsWith("rgba("))return e.includes("%")?this.parseCommaSeparatedPercentageRgba(e):this.parseCommaSeparatedRgba(e);if(e.startsWith("hsl(")||e.startsWith("hsla("))return this.parseHSLString(e);{const g=e.split(",");if(e.includes("%")){if(3===g.length)return this.parseCommaSeparatedPercentageRgb(e);
if(4===g.length)return this.parseCommaSeparatedPercentageRgba(e)}else{if(3===g.length)return this.parseCommaSeparatedRgb(e);if(4===g.length)return this.parseCommaSeparatedRgba(e)}return!1}}return this.parseHexString(e)}toJSON(){return[this._r,this._g,this._b,this._a]}setFromHSLA(e,g,h,l){e%=360;g=c.clamp(g,0,100);h=c.clamp(h,0,100);l=c.clamp(l,0,1);e/=360;g/=100;h/=100;if(0===g)h=g=e=h;else{const m=.5&gt;h?h*(1+g):h+g-h*g,n=2*h-m;h=d(n,m,e+1/3);g=d(n,m,e);e=d(n,m,e-1/3)}this.setR(h);this.setG(g);this.setB(e);
this.setA(l);return this}parseHSLString(e){var g=e.replace(/ |hsl|hsla|\(|\)|;/gi,"");e=b.exec(g);g=a.exec(g);return e&amp;&amp;4===e.length?(this.setFromHSLA(+e[1],+e[2],+e[3],1),!0):g&amp;&amp;5===g.length?(this.setFromHSLA(+e[1],+e[2],+e[3],+e[4]),!0):!1}toHSLAString(){var e=this._r;const g=this._g,h=this._b,l=this._a,m=c.Color.GetHue(e,g,h),n=c.Color.GetSaturation(e,g,h);e=c.Color.GetLuminosity(e,g,h);return`hsla(${m}, ${n}%, ${e}%, ${l})`}toHSLAArray(){const e=this._r,g=this._g,h=this._b;return[c.Color.GetHue(e,
g,h),c.Color.GetSaturation(e,g,h),c.Color.GetLuminosity(e,g,h),this._a]}setFromJSON(e){!Array.isArray(e)||3&gt;e.length||(this._r=e[0],this._g=e[1],this._b=e[2],this._a=4&lt;=e.length?e[3]:1)}set r(e){this.setR(e)}get r(){return this.getR()}set g(e){this.setG(e)}get g(){return this.getG()}set b(e){this.setB(e)}get b(){return this.getB()}set a(e){this.setA(e)}get a(){return this.getA()}setAtIndex(e,g){switch(e){case 0:this.setR(g);break;case 1:this.setG(g);break;case 2:this.setB(g);break;case 3:this.setA(g);
break;default:throw new RangeError("invalid color index");}}getAtIndex(e){switch(e){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 DiffChannel(e,g){return c.clamp(Math.max(e,g)-Math.min(e,g),0,1)}static Diff(e,g){const h=new c.Color;h.setR(Math.max(e._r,g._r)-Math.min(e._r,g._r));h.setG(Math.max(e._g,g._g)-Math.min(e._g,g._g));h.setB(Math.max(e._b,g._b)-Math.min(e._b,g._b));h.setA(Math.max(e._a,
g._a)-Math.min(e._a,g._a));return h}static DiffNoAlpha(e,g){const h=new c.Color(0,0,0,1);h.setR(Math.max(e._r,g._r)-Math.min(e._r,g._r));h.setG(Math.max(e._g,g._g)-Math.min(e._g,g._g));h.setB(Math.max(e._b,g._b)-Math.min(e._b,g._b));return h}static GetHue(e,g,h){const l=Math.max(e,g,h),m=Math.min(e,g,h);if(l===m)return 0;let n=0;switch(l){case e:n=(g-h)/(l-m)+(g&lt;h?6:0);break;case g:n=(h-e)/(l-m)+2;break;case h:n=(e-g)/(l-m)+4}return Math.round(n/6*360)}static GetSaturation(e,g,h){const l=Math.max(e,
g,h);e=Math.min(e,g,h);if(l===e)return 0;g=l-e;return Math.round(100*(.5&lt;(l+e)/2?g/(2-l-e):g/(l+e)))}static GetLuminosity(e,g,h){const l=Math.max(e,g,h);return l?Math.round((l+Math.min(e,g,h))/2*100):0}};c.Color.White=Object.freeze(c.New(c.Color,1,1,1,1));c.Color.Black=Object.freeze(c.New(c.Color,0,0,0,1));c.Color.TransparentBlack=Object.freeze(c.New(c.Color,0,0,0,0))}"use strict";
{const c=self.C3;c.Vector2=class{constructor(b,a){this._y=this._x=0;b instanceof c.Vector2?this.copy(b):this.set(b||0,a||0)}set(b,a){this._x=+b;this._y=+a}copy(b){this._x=b._x;this._y=b._y}equals(b){return this._x===b._x&amp;&amp;this._y===b._y}setX(b){this._x=+b}getX(){return this._x}setY(b){this._y=+b}getY(){return this._y}toArray(){return[this._x,this._y]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(b,a){b[a++]=this._x;b[a]=this._y}offset(b,a){this._x+=+b;this._y+=+a}scale(b,
a){this._x*=b;this._y*=a}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 c.angleTo(0,0,this._x,this._y)}lengthSquared(){return this._x*this._x+this._y*this._y}length(){return Math.sqrt(this.lengthSquared())}rotatePrecalc(b,a){const f=this._x*a-this._y*b;this._y=this._y*a+this._x*b;this._x=f}rotate(b){0!==b&amp;&amp;this.rotatePrecalc(Math.sin(b),Math.cos(b))}rotateAbout(b,
a,f){0===b||a===this._x&amp;&amp;f===this._y||(this._x-=a,this._y-=f,this.rotatePrecalc(Math.sin(b),Math.cos(b)),this._x+=+a,this._y+=+f)}move(b,a){0!==a&amp;&amp;(this._x+=Math.cos(b)*a,this._y+=Math.sin(b)*a)}normalize(){const b=this.length();0!==b&amp;&amp;1!==b&amp;&amp;(this._x/=b,this._y/=b)}clamp(b,a){this._x=c.clamp(this._x,b,a);this._y=c.clamp(this._y,b,a)}}}"use strict";
{const c=self.C3;c.Rect=class{constructor(b,a,f,d){this._bottom=this._right=this._top=this._left=0;b instanceof c.Rect?this.copy(b):this.set(b||0,a||0,f||0,d||0)}set(b,a,f,d){this._left=+b;this._top=+a;this._right=+f;this._bottom=+d}setWH(b,a,f,d){b=+b;a=+a;this._left=b;this._top=a;this._right=b+ +f;this._bottom=a+ +d}copy(b){this._left=+b._left;this._top=+b._top;this._right=+b._right;this._bottom=+b._bottom}clone(){return new c.Rect(this._left,this._top,this._right,this._bottom)}static Merge(b,a){const f=
new c.Rect;f.setLeft(Math.min(b._left,a._left));f.setTop(Math.min(b._top,a._top));f.setRight(Math.max(b._right,a._right));f.setBottom(Math.max(b._bottom,a._bottom));return f}static FromObject(b){return new c.Rect(b.left,b.top,b.right,b.bottom)}equals(b){return this._left===b._left&amp;&amp;this._top===b._top&amp;&amp;this._right===b._right&amp;&amp;this._bottom===b._bottom}setLeft(b){this._left=+b}getLeft(){return this._left}setTop(b){this._top=+b}getTop(){return this._top}setRight(b){this._right=+b}getRight(){return this._right}setBottom(b){this._bottom=
+b}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(b,a){b[a++]=this._left;b[a++]=this._top;b[a++]=this._right;b[a]=this._bottom}writeAsQuadToTypedArray(b,a){b[a++]=this._left;b[a++]=this._top;b[a++]=this._right;b[a++]=this._top;b[a++]=this._right;b[a++]=this._bottom;b[a++]=this._left;b[a]=this._bottom}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(b,a){b=+b;a=+a;this._left+=b;this._top+=a;this._right+=b;this._bottom+=a}offsetLeft(b){this._left+=+b}offsetTop(b){this._top+=+b}offsetRight(b){this._right+=+b}offsetBottom(b){this._bottom+=+b}toSquare(b){if("x"!==b)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(b,a){b=+b;a=+a;this._left-=b;this._top-=a;this._right+=b;this._bottom+=a}deflate(b,a){b=+b;a=+a;this._left+=b;this._top+=a;this._right-=b;this._bottom-=a}multiply(b,a){this._left*=b;this._top*=a;this._right*=b;this._bottom*=a}divide(b,a){this._left/=b;this._top/=a;this._right/=b;this._bottom/=a}mirrorAround(b){this._left=+b-this._left;this._right=+b-this._right}flipAround(b){this._top=+b-this._top;this._bottom=+b-this._bottom}swapLeftRight(){const b=
this._left;this._left=this._right;this._right=b}swapTopBottom(){const b=this._top;this._top=this._bottom;this._bottom=b}shuntY(b){const a=this._top;this._top=+b-this._bottom;this._bottom=+b-a}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(b,a,f,d){this._left&lt;b&amp;&amp;(this._left=+b);this._top&lt;a&amp;&amp;(this._top=+a);this._right&gt;
f&amp;&amp;(this._right=+f);this._bottom&gt;d&amp;&amp;(this._bottom=+d)}clampFlipped(b,a,f,d){this._left&lt;b&amp;&amp;(this._left=+b);this._top&gt;a&amp;&amp;(this._top=+a);this._right&gt;f&amp;&amp;(this._right=+f);this._bottom&lt;d&amp;&amp;(this._bottom=+d)}normalize(){this._left&gt;this._right&amp;&amp;this.swapLeftRight();this._top&gt;this._bottom&amp;&amp;this.swapTopBottom()}intersectsRect(b){return!(b._right&lt;this._left||b._bottom&lt;this._top||b._left&gt;this._right||b._top&gt;this._bottom)}intersectsRectOffset(b,a,f){return!(b._right+a&lt;this._left||b._bottom+f&lt;this._top||b._left+
a&gt;this._right||b._top+f&gt;this._bottom)}containsPoint(b,a){return b&gt;=this._left&amp;&amp;b&lt;=this._right&amp;&amp;a&gt;=this._top&amp;&amp;a&lt;=this._bottom}containsRect(b){return b._left&gt;=this._left&amp;&amp;b._top&gt;=this._top&amp;&amp;b._right&lt;=this._right&amp;&amp;b._bottom&lt;=this._bottom}expandToContain(b){b._left&lt;this._left&amp;&amp;(this._left=+b._left);b._top&lt;this._top&amp;&amp;(this._top=+b._top);b._right&gt;this._right&amp;&amp;(this._right=+b._right);b._bottom&gt;this._bottom&amp;&amp;(this._bottom=+b._bottom)}lerpInto(b){this._left=c.lerp(b._left,b._right,this._left);this._top=c.lerp(b._top,
b._bottom,this._top);this._right=c.lerp(b._left,b._right,this._right);this._bottom=c.lerp(b._top,b._bottom,this._bottom)}}}"use strict";
{const c=self.C3;c.Quad=class{constructor(b,a,f,d,e,g,h,l){this._bly=this._blx=this._bry=this._brx=this._try=this._trx=this._tly=this._tlx=0;b instanceof c.Quad?this.copy(b):this.set(b||0,a||0,f||0,d||0,e||0,g||0,h||0,l||0)}set(b,a,f,d,e,g,h,l){this._tlx=+b;this._tly=+a;this._trx=+f;this._try=+d;this._brx=+e;this._bry=+g;this._blx=+h;this._bly=+l}setRect(b,a,f,d){this.set(b,a,f,a,f,d,b,d)}copy(b){this._tlx=b._tlx;this._tly=b._tly;this._trx=b._trx;this._try=b._try;this._brx=b._brx;this._bry=b._bry;
this._blx=b._blx;this._bly=b._bly}equals(b){return this._tlx===b._tlx&amp;&amp;this._tly===b._tly&amp;&amp;this._trx===b._trx&amp;&amp;this._try===b._try&amp;&amp;this._brx===b._brx&amp;&amp;this._bry===b._bry&amp;&amp;this._blx===b._blx&amp;&amp;this._bly===b._bly}setTlx(b){this._tlx=+b}getTlx(){return this._tlx}setTly(b){this._tly=+b}getTly(){return this._tly}setTrx(b){this._trx=+b}getTrx(){return this._trx}setTry(b){this._try=+b}getTry(){return this._try}setBrx(b){this._brx=+b}getBrx(){return this._brx}setBry(b){this._bry=+b}getBry(){return this._bry}setBlx(b){this._blx=
+b}getBlx(){return this._blx}setBly(b){this._bly=+b}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(b,a){b[a++]=this._tlx;b[a++]=this._tly;b[a++]=this._trx;b[a++]=this._try;b[a++]=this._brx;
b[a++]=this._bry;b[a++]=this._blx;b[a]=this._bly}writeToTypedArray3D(b,a,f){b[a++]=this._tlx;b[a++]=this._tly;b[a++]=f;b[a++]=this._trx;b[a++]=this._try;b[a++]=f;b[a++]=this._brx;b[a++]=this._bry;b[a++]=f;b[a++]=this._blx;b[a++]=this._bly;b[a]=f}offset(b,a){b=+b;a=+a;this._tlx+=b;this._tly+=a;this._trx+=b;this._try+=a;this._brx+=b;this._bry+=a;this._blx+=b;this._bly+=a}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(b){this._tlx=b._left;this._tly=b._top;this._trx=b._right;this._try=b._top;this._brx=b._right;this._bry=b._bottom;this._blx=b._left;this._bly=b._bottom}setFromRotatedRect(b,a){0===a?this.setFromRect(b):this.setFromRotatedRectPrecalc(b,Math.sin(a),Math.cos(a))}setFromRotatedRectPrecalc(b,a,f){const d=b._left*a,e=b._top*a,g=b._right*a;a*=b._bottom;
const h=b._left*f,l=b._top*f,m=b._right*f;b=b._bottom*f;this._tlx=h-e;this._tly=l+d;this._trx=m-e;this._try=l+g;this._brx=m-a;this._bry=b+g;this._blx=h-a;this._bly=b+d}getBoundingBox(b){b.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(b,a){var f=this._trx-this._tlx,d=this._try-this._tly;const e=this._brx-this._tlx,g=this._bry-this._tly;
b-=this._tlx;a-=this._tly;var h=f*f+d*d;let l=f*e+d*g;d=f*b+d*a;const m=e*e+g*g,n=e*b+g*a;let r=1/(h*m-l*l);f=(m*d-l*n)*r;h=(h*n-l*d)*r;if(0&lt;=f&amp;&amp;0&lt;h&amp;&amp;1&gt;f+h)return!0;f=this._blx-this._tlx;d=this._bly-this._tly;h=f*f+d*d;l=f*e+d*g;d=f*b+d*a;r=1/(h*m-l*l);f=(m*d-l*n)*r;h=(h*n-l*d)*r;return 0&lt;=f&amp;&amp;0&lt;h&amp;&amp;1&gt;f+h}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(b,a,f,d){return this.containsPoint(b,a)||this.containsPoint(f,d)?
!0:c.segmentIntersectsQuad(b,a,f,d,this)}intersectsQuad(b){var a=b.midX(),f=b.midY();if(this.containsPoint(a,f))return!0;a=this.midX();f=this.midY();if(b.containsPoint(a,f))return!0;a=this._tlx;f=this._tly;const d=this._trx,e=this._try,g=this._brx,h=this._bry,l=this._blx,m=this._bly;return c.segmentIntersectsQuad(a,f,d,e,b)||c.segmentIntersectsQuad(d,e,g,h,b)||c.segmentIntersectsQuad(g,h,l,m,b)||c.segmentIntersectsQuad(l,m,a,f,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(b,a){const f=this._getAtIndex(b);this._setAtIndex(b,this._getAtIndex(a));this._setAtIndex(a,f)}_getAtIndex(b){switch(b){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(b,
a){a=+a;switch(b){case 0:this._tlx=a;break;case 1:this._tly=a;break;case 2:this._trx=a;break;case 3:this._try=a;break;case 4:this._brx=a;break;case 5:this._bry=a;break;case 6:this._blx=a;break;case 7:this._bly=a;break;default:throw new RangeError("invalid quad point index");}}}}"use strict";
{const c=self.C3,b=[0,0,1,0,1,1,0,1],a=c.New(c.Quad);c.CollisionPoly=class extends c.DefendedBase{constructor(f,d=!0){super();f||(f=b);this._ptsArr=Float64Array.from(f);this._bbox=new c.Rect;this._isBboxChanged=!0;this._enabled=d}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(f){this._ptsArr.length===f.length?this._ptsArr.set(f):this._ptsArr=Float64Array.from(f);this._isBboxChanged=!0}setDefaultPoints(){this.setPoints(b)}copy(f){this.setPoints(f._ptsArr)}setBboxChanged(){this._isBboxChanged=
!0}_updateBbox(){if(this._isBboxChanged){var f=this._ptsArr,d=f[0],e=f[1],g=d,h=e;for(let l=0,m=f.length;l&lt;m;l+=2){const n=f[l],r=f[l+1];n&lt;d&amp;&amp;(d=n);n&gt;g&amp;&amp;(g=n);r&lt;e&amp;&amp;(e=r);r&gt;h&amp;&amp;(h=r)}this._bbox.set(d,e,g,h);this._isBboxChanged=!1}}setFromRect(f,d,e){let g=this._ptsArr;8!==g.length&amp;&amp;(this._ptsArr=g=new Float64Array(8));g[0]=f.getLeft()-d;g[1]=f.getTop()-e;g[2]=f.getRight()-d;g[3]=f.getTop()-e;g[4]=f.getRight()-d;g[5]=f.getBottom()-e;g[6]=f.getLeft()-d;g[7]=f.getBottom()-e;this._bbox.copy(f);0===d&amp;&amp;0===
e||this._bbox.offset(-d,-e);this._isBboxChanged=!1}setFromQuad(f,d,e){a.copy(f);a.offset(d,e);this.setPoints(a.toArray());this._isBboxChanged=!0}transform(f,d,e){let g=0,h=1;0!==e&amp;&amp;(g=Math.sin(e),h=Math.cos(e));this.transformPrecalc(f,d,g,h)}transformPrecalc(f,d,e,g){const h=this._ptsArr;for(let l=0,m=h.length;l&lt;m;l+=2){const n=l+1,r=h[l]*f,q=h[n]*d;h[l]=r*g-q*e;h[n]=q*g+r*e}this._isBboxChanged=!0}offset(f,d){const e=this._ptsArr;for(let g=0,h=e.length;g&lt;h;g+=2)e[g]+=f,e[g+1]+=d}containsPoint(f,d){const e=
this._ptsArr;if(f===e[0]&amp;&amp;d===e[1])return!0;this._updateBbox();var g=this._bbox;const h=g.getLeft()-110,l=g.getTop()-101,m=g.getRight()+131;g=g.getBottom()+120;let n,r,q,t,u,w,y,C;h&lt;f?(n=h,q=f):(n=f,q=h);l&lt;d?(r=l,t=d):(r=d,t=l);m&lt;f?(u=m,y=f):(u=f,y=m);g&lt;d?(w=g,C=d):(w=d,C=g);let G=0,x=0;for(let H=0,P=e.length;H&lt;P;H+=2){var B=(H+2)%P;const E=e[H],J=e[H+1],O=e[B];B=e[B+1];c.segmentsIntersectPreCalc(h,l,f,d,n,q,r,t,E,J,O,B)&amp;&amp;++G;c.segmentsIntersectPreCalc(m,g,f,d,u,y,w,C,E,J,O,B)&amp;&amp;++x}return 1===G%2||
1===x%2}intersectsPoly(f,d,e){const g=f._ptsArr,h=this._ptsArr;if(this.containsPoint(g[0]+d,g[1]+e)||f.containsPoint(h[0]-d,h[1]-e))return!0;for(let m=0,n=h.length;m&lt;n;m+=2){var l=(m+2)%n;f=h[m];const r=h[m+1],q=h[l];l=h[l+1];let t,u,w,y;f&lt;q?(t=f,w=q):(t=q,w=f);r&lt;l?(u=r,y=l):(u=l,y=r);for(let C=0,G=g.length;C&lt;G;C+=2){const x=(C+2)%G;if(c.segmentsIntersectPreCalc(f,r,q,l,t,w,u,y,g[C]+d,g[C+1]+e,g[x]+d,g[x+1]+e))return!0}}return!1}intersectsSegment(f,d,e,g,h,l){if(this.containsPoint(e-f,g-d)||this.containsPoint(h-
f,l-d))return!0;let m,n,r,q;e&lt;h?(m=e,r=h):(m=h,r=e);g&lt;l?(n=g,q=l):(n=l,q=g);const t=this._ptsArr;for(let u=0,w=t.length;u&lt;w;u+=2){const y=(u+2)%w;if(c.segmentsIntersectPreCalc(e,g,h,l,m,r,n,q,t[u]+f,t[u+1]+d,t[y]+f,t[y+1]+d))return!0}return!1}mirror(f){const d=this._ptsArr;for(let e=0,g=d.length;e&lt;g;e+=2)d[e]=2*f-d[e];this._isBboxChanged=!0}flip(f){const d=this._ptsArr;for(let e=0,g=d.length;e&lt;g;e+=2){const h=e+1;d[h]=2*f-d[h]}this._isBboxChanged=!0}diag(){const f=this._ptsArr;for(let d=0,e=f.length;d&lt;
e;d+=2){const g=d+1,h=f[d];f[d]=f[g];f[g]=h}this._isBboxChanged=!0}GetMidX(){const f=this._ptsArr;let d=0;for(let e=0,g=f.length;e&lt;g;e+=2)d+=f[e];return d/this.pointCount()}GetMidY(){const f=this._ptsArr;let d=0;for(let e=0,g=f.length;e&lt;g;e+=2)d+=f[e+1];return d/this.pointCount()}GetPointsArray(){return this._ptsArr}GetPointCount(){return this.pointCount()}IsEnabled(){return this._enabled}}}"use strict";
{const c=self.C3;c.PairMap=class extends c.DefendedBase{constructor(b){super();this._firstMap=new Map;if(b)for(const [a,f,d]of b)this.Set(a,f,d)}Release(){this.Clear();this._firstMap=null}Clear(){const b=this._firstMap;for(const a of b.values())a.clear();b.clear()}Set(b,a,f){const d=this._firstMap;let e=d.get(b);e||(e=new Map,d.set(b,e));e.set(a,f)}Get(b,a){return(b=this._firstMap.get(b))?b.get(a):b}Has(b,a){return(b=this._firstMap.get(b))?b.has(a):!1}Delete(b,a){const f=this._firstMap,d=f.get(b);
if(!d)return!1;(a=d.delete(a))&amp;&amp;0===d.size&amp;&amp;f.delete(b);return a}DeleteEither(b){const a=this._firstMap,f=a.get(b);f&amp;&amp;(f.clear(),a.delete(b));for(const [d,e]of a.entries())e.delete(b)&amp;&amp;0===e.size&amp;&amp;a.delete(d)}GetSize(){let b=0;for(const a of this._firstMap.values())b+=a.size;return b}*values(){for(const b of this._firstMap.values())yield*b.values()}*keyPairs(){for(const [b,a]of this._firstMap.entries())for(const f of a.keys())yield[b,f]}*entries(){for(const [b,a]of this._firstMap.entries())for(const [f,
d]of a.entries())yield[b,f,d]}}}"use strict";
{const c=self.C3;c.ArraySet=class extends c.DefendedBase{constructor(){super();this._set=new Set;this._arr=[];this._needToRebuildArray=!1}Release(){this.Clear()}Clear(){this._set.clear();c.clearArray(this._arr);this._needToRebuildArray=!1}Add(b){this._set.has(b)||(this._set.add(b),this._needToRebuildArray||this._arr.push(b))}Has(b){return this._set.has(b)}Delete(b){this._set.delete(b)&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 b=this._arr;c.clearArray(b);for(const a of this._set)b.push(a)}}}"use strict";
{const c=new Map,b=new Map,a=new Map,f=new Map,d=new Map,e=new Map;e.set("linear","noease");e.set("default","noease");self.Ease=class q{constructor(){}static InheritEase(){return"default"}static DefaultEase(){return"noease"}static GetEditorEaseNames(t,...u){this._CreateEaseMap();a.has(t)||a.set(t,new Map);t=a.get(t);return[...b.keys()].concat([...t.keys()]).filter(w=&gt;!u.includes(w))}static GetRuntimeEaseNames(){this._CreateEaseMap();return[...b.keys()].concat([...f.keys()])}static IsNamePredefined(t){this._CreateEaseMap();
return[...b.keys()].includes(t)}static _GetEase(t){const u=e.get(t);if(u)return c.get(u);if(q.IsNamePredefined(t))return c.get(t);if(d.has(t))return d.get(t)}static GetEditorEase(t,u){this._CreateEaseMap();const w=q._GetEase(t);return w?w:a.get(u).get(t)}static GetRuntimeEase(t){this._CreateEaseMap();const u=q._GetEase(t);return u?u:f.get(t)}static GetEaseFromIndex(t){this._CreateEaseMap();return this.GetRuntimeEaseNames()[t]}static GetIndexForEase(t,u){this._CreateEaseMap();return this.GetEditorEaseNames(u).indexOf(t)}static _CreateEaseMap(){0===
c.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(t,u){q._AddEase(t,u,"predefined")}static _AddPrivateCustomEase(t,
u){q._AddEase(t,u,"private")}static AddCustomEase(t,u,w){this._CreateEaseMap();q._AddEase(t,u,"custom",w)}static RemoveCustomEase(t,u){this.IsNamePredefined(t)||[...d.keys()].includes(t)||(u=a.get(u))&amp;&amp;u.delete(t)}static _AddEase(t,u,w,y){switch(w){case "predefined":c.set(t,u);b.set(t,u);break;case "custom":y?(a.has(y)||a.set(y,new Map),a.get(y).set(t,u)):f.set(t,u);break;case "private":c.set(t,u);d.set(t,u);break;default:throw Error("unexpected ease mode");}}static NoEase(t,u,w,y){return w*t/y+u}static EaseInQuad(t,
u,w,y){return w*(t/=y)*t+u}static EaseOutQuad(t,u,w,y){return-w*(t/=y)*(t-2)+u}static EaseInOutQuad(t,u,w,y){return 1&gt;(t/=y/2)?w/2*t*t+u:-w/2*(--t*(t-2)-1)+u}static EaseInCubic(t,u,w,y){return w*(t/=y)*t*t+u}static EaseOutCubic(t,u,w,y){return w*((t=t/y-1)*t*t+1)+u}static EaseInOutCubic(t,u,w,y){return 1&gt;(t/=y/2)?w/2*t*t*t+u:w/2*((t-=2)*t*t+2)+u}static EaseInQuart(t,u,w,y){return w*(t/=y)*t*t*t+u}static EaseOutQuart(t,u,w,y){return-w*((t=t/y-1)*t*t*t-1)+u}static EaseInOutQuart(t,u,w,y){return 1&gt;(t/=
y/2)?w/2*t*t*t*t+u:-w/2*((t-=2)*t*t*t-2)+u}static EaseInQuint(t,u,w,y){return w*(t/=y)*t*t*t*t+u}static EaseOutQuint(t,u,w,y){return w*((t=t/y-1)*t*t*t*t+1)+u}static EaseInOutQuint(t,u,w,y){return 1&gt;(t/=y/2)?w/2*t*t*t*t*t+u:w/2*((t-=2)*t*t*t*t+2)+u}static EaseInSine(t,u,w,y){return-w*Math.cos(t/y*(Math.PI/2))+w+u}static EaseOutSine(t,u,w,y){return w*Math.sin(t/y*(Math.PI/2))+u}static EaseInOutSine(t,u,w,y){return-w/2*(Math.cos(Math.PI*t/y)-1)+u}static EaseInExpo(t,u,w,y){return 0===t?u:w*Math.pow(2,
10*(t/y-1))+u}static EaseOutExpo(t,u,w,y){return t===y?u+w:w*(-Math.pow(2,-10*t/y)+1)+u}static EaseInOutExpo(t,u,w,y){return 0===t?u:t===y?u+w:1&gt;(t/=y/2)?w/2*Math.pow(2,10*(t-1))+u:w/2*(-Math.pow(2,-10*--t)+2)+u}static EaseInCirc(t,u,w,y){return-w*(Math.sqrt(1-(t/=y)*t)-1)+u}static EaseOutCirc(t,u,w,y){return w*Math.sqrt(1-(t=t/y-1)*t)+u}static EaseInOutCirc(t,u,w,y){return 1&gt;(t/=y/2)?-w/2*(Math.sqrt(1-t*t)-1)+u:w/2*(Math.sqrt(1-(t-=2)*t)+1)+u}static EaseInElastic(t,u,w,y){let C=0,G=w;if(0===t)return u;
if(1===(t/=y))return u+w;C||(C=.3*y);G&lt;Math.abs(w)?(G=w,w=C/4):w=C/(2*Math.PI)*Math.asin(w/G);return-(G*Math.pow(2,10*--t)*Math.sin(2*(t*y-w)*Math.PI/C))+u}static EaseOutElastic(t,u,w,y){let C,G=0,x=w;if(0===t)return u;if(1===(t/=y))return u+w;G||(G=.3*y);x&lt;Math.abs(w)?(x=w,C=G/4):C=G/(2*Math.PI)*Math.asin(w/x);return x*Math.pow(2,-10*t)*Math.sin(2*(t*y-C)*Math.PI/G)+w+u}static EaseInOutElastic(t,u,w,y){let C,G=0,x=w;if(0===t)return u;if(2===(t/=y/2))return u+w;G||(G=.3*y*1.5);x&lt;Math.abs(w)?(x=w,
C=G/4):C=G/(2*Math.PI)*Math.asin(w/x);return 1&gt;t?-.5*x*Math.pow(2,10*--t)*Math.sin(2*(t*y-C)*Math.PI/G)+u:x*Math.pow(2,-10*--t)*Math.sin(2*(t*y-C)*Math.PI/G)*.5+w+u}static EaseInBack(t,u,w,y,C){void 0===C&amp;&amp;(C=1.70158);return w*(t/=y)*t*((C+1)*t-C)+u}static EaseOutBack(t,u,w,y,C){void 0===C&amp;&amp;(C=1.70158);return w*((t=t/y-1)*t*((C+1)*t+C)+1)+u}static EaseInOutBack(t,u,w,y,C){void 0===C&amp;&amp;(C=1.70158);return 1&gt;(t/=y/2)?w/2*t*t*(((C*=1.525)+1)*t-C)+u:w/2*((t-=2)*t*(((C*=1.525)+1)*t+C)+2)+u}static EaseInBounce(t,
u,w,y){return w-q.EaseOutBounce(y-t,0,w,y)+u}static EaseOutBounce(t,u,w,y){return(t/=y)&lt;1/2.75?7.5625*w*t*t+u:t&lt;2/2.75?w*(7.5625*(t-=1.5/2.75)*t+.75)+u:t&lt;2.5/2.75?w*(7.5625*(t-=2.25/2.75)*t+.9375)+u:w*(7.5625*(t-=2.625/2.75)*t+.984375)+u}static EaseInOutBounce(t,u,w,y){return t&lt;y/2?.5*q.EaseInBounce(2*t,0,w,y)+u:.5*q.EaseOutBounce(2*t-y,0,w,y)+.5*w+u}static EaseCubicBezier(t,u,w,y,C){return u+3*t*(w-u)+3*t**2*(u+y-2*w)+t**3*(C-u+3*w-3*y)}static EaseSpline(t,u,w,y,C,G,x,B,H,P){if(y===C&amp;&amp;G===x)return t;
t=r(t,u,y,G,B,P);u=g(w,C,x,H);y=h(w,C,x,H);w=l(w,C,x,H);return m(t,u,y,w)}static GetBezierSamples(t,u,w,y){const C=[],G=g(t,u,w,y),x=h(t,u,w,y);t=l(t,u,w,y);for(u=0;11&gt;u;++u)w=m(.1*u,G,x,t),C.push(w);return C}};const g=(q,t,u,w)=&gt;w-3*u+3*t-q,h=(q,t,u,w)=&gt;3*u-6*t+3*q,l=(q,t,u,w)=&gt;3*(t-q),m=(q,t,u,w)=&gt;((t*q+u)*q+w)*q,n=(q,t,u,w)=&gt;3*t*q*q+2*u*q+w,r=(q,t,u,w,y,C)=&gt;{if(1==q)return 1;for(var G=0,x=1,B=C[x];10!=x&amp;&amp;B&lt;=q;)x++,B=C[x],G+=.1;x--;B=C[x];C=G+(q-B)/(C[x+1]-B)*.1;x=g(t,u,w,y);B=h(t,u,w,y);t=l(t,
u,w,y);u=n(C,x,B,t);if(0!==u)if(.02&lt;=u)for(G=0;4&gt;G;++G)u=m(C,x,B,t)-q,w=n(C,x,B,t),C-=u/w;else{u=G;G+=.1;w=0;let H;do C=u+(G-u)/2,y=m(C,x,B,t)-q,0&lt;y?G=C:u=C,y=1e-7&lt;Math.abs(y),H=10&gt;++w;while(y&amp;&amp;H)}return C}}"use strict";
{const c=self.C3;function b(a){c.IsString(a)}c.ProbabilityTable=class{constructor(){this._items=[];this._totalWeight=0}Release(){this.Clear();this._items=null}Clear(){c.clear2DArray(this._items);this._totalWeight=0}GetTotalWeight(){return this._totalWeight}Sample(a=Math.random()*this.GetTotalWeight()){let f=0;for(const [d,e]of this._items)if(f+=d,a&lt;f)return e;return 0}AddItem(a,f){b(f);this._totalWeight+=a;this._items.push([a,f])}RemoveItem(a,f){b(f);const d=0===a;for(let e=0;e&lt;this._items.length;e++){const g=
this._items[e],h=g[1]===f;if((d||g[0]===a)&amp;&amp;h){this._items.splice(e,1);this._totalWeight-=g[0];break}}}asJSON(){return JSON.stringify(this._items)}static fromJSON(a){const f=new c.ProbabilityTable;a=JSON.parse(a);for(const d of a)f.AddItem(d[0],d[1]);return f}}}"use strict";
self.C3.Event=class{constructor(c,b){this.type=c;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 c=self.C3;c.Event.Handler=class extends c.DefendedBase{constructor(b){super();this._type=b;this._captureListeners=[];this._captureListenersSet=new Set;this._listeners=[];this._listenersSet=new Set;this._fireDepth=0;this._queueAddListeners=[];this._queueRemoveCaptureListeners=[];this._queueRemoveListeners=[]}Release(){0&lt;this._fireDepth||(c.clearArray(this._captureListeners),this._captureListenersSet.clear(),c.clearArray(this._listeners),this._listenersSet.clear(),c.clearArray(this._queueAddListeners),
c.clearArray(this._queueRemoveCaptureListeners),c.clearArray(this._queueRemoveListeners),c.Release(this))}_AddListener(b,a){this._IsFiring()?this._queueAddListeners.push([b,a]):a?this._captureListenersSet.has(b)||(this._captureListeners.push(b),this._captureListenersSet.add(b)):this._listenersSet.has(b)||(this._listeners.push(b),this._listenersSet.add(b))}_RemoveListener(b,a){this._IsFiring()?a?this._queueRemoveCaptureListeners.push(b):this._queueRemoveListeners.push(b):a?this._captureListenersSet.has(b)&amp;&amp;
(this._captureListenersSet.delete(b),c.arrayFindRemove(this._captureListeners,b)):this._listenersSet.has(b)&amp;&amp;(this._listenersSet.delete(b),c.arrayFindRemove(this._listeners,b))}_IsEmpty(){return!this._captureListeners.length&amp;&amp;!this._listeners.length}_IsFiring(){return 0&lt;this._fireDepth}_ProcessQueuedListeners(){for(var b of this._queueAddListeners)this._AddListener(...b);c.clearArray(this._queueAddListeners);for(var a of this._queueRemoveListeners)this._listenersSet.delete(a);for(const f of this._queueRemoveCaptureListeners)this._captureListenersSet.delete(f);
b=new Set(this._queueRemoveListeners);a=new Set(this._queueRemoveCaptureListeners);c.arrayRemoveAllInSet(this._listeners,b);c.arrayRemoveAllInSet(this._captureListeners,a);c.clearArray(this._queueRemoveCaptureListeners);c.clearArray(this._queueRemoveListeners)}_FireCancellable(b){this._IncreaseFireDepth();let a=!1;for(let f=0,d=this._captureListeners.length;f&lt;d;++f)if(this._captureListeners[f](b),b.propagationStopped){a=!0;break}if(!a)for(let f=0,d=this._listeners.length;f&lt;d&amp;&amp;(this._listeners[f](b),
!b.propagationStopped);++f);this._DecreaseFireDepth();return!b.defaultPrevented}_FireNonCancellable(b){this._IncreaseFireDepth();for(let a=0,f=this._captureListeners.length;a&lt;f;++a)this._captureListeners[a](b);for(let a=0,f=this._listeners.length;a&lt;f;++a)this._listeners[a](b);this._DecreaseFireDepth();return!0}_IncreaseFireDepth(){this._fireDepth++}_DecreaseFireDepth(){this._fireDepth--;0===this._fireDepth&amp;&amp;(this._queueAddListeners.length||this._queueRemoveCaptureListeners.length||this._queueRemoveListeners.length)&amp;&amp;
this._ProcessQueuedListeners()}SetDelayRemoveEventsEnabled(b){b?this._IncreaseFireDepth():this._DecreaseFireDepth()}_FireAsync(b){let a=[];for(let f=0,d=this._captureListeners.length;f&lt;d;++f){let e=this._captureListeners[f];a.push(c.Asyncify(()=&gt;e(b)))}for(let f=0,d=this._listeners.length;f&lt;d;++f){let e=this._listeners[f];a.push(c.Asyncify(()=&gt;e(b)))}return Promise.all(a).then(()=&gt;!b.defaultPrevented)}_FireAndWait_AsyncOptional(b){const a=[];this._IncreaseFireDepth();for(let d=0,e=this._captureListeners.length;d&lt;
e;++d){var f=this._captureListeners[d](b);f instanceof Promise&amp;&amp;a.push(f)}for(let d=0,e=this._listeners.length;d&lt;e;++d)f=this._listeners[d](b),f instanceof Promise&amp;&amp;a.push(f);this._DecreaseFireDepth();return a.length?Promise.all(a).then(()=&gt;!b.defaultPrevented):!b.defaultPrevented}async _FireAndWaitAsync(b){return await this._FireAndWait_AsyncOptional(b)}async _FireAndWaitAsyncSequential(b){this._IncreaseFireDepth();for(let f=0,d=this._captureListeners.length;f&lt;d;++f){var a=this._captureListeners[f](b);
a instanceof Promise&amp;&amp;await a}for(let f=0,d=this._listeners.length;f&lt;d;++f)a=this._listeners[f](b),a instanceof Promise&amp;&amp;await a;this._DecreaseFireDepth();return!b.defaultPrevented}*_FireAsGenerator(b){this._IncreaseFireDepth();for(let f=0,d=this._captureListeners.length;f&lt;d;++f){var a=this._captureListeners[f](b);c.IsIterator(a)&amp;&amp;(yield*a)}for(let f=0,d=this._listeners.length;f&lt;d;++f)a=this._listeners[f](b),c.IsIterator(a)&amp;&amp;(yield*a);this._DecreaseFireDepth()}}}"use strict";
{const c=self.C3;c.Event.Dispatcher=class extends c.DefendedBase{constructor(){super();this._eventHandlers=new Map;this._dispatcherWasReleased=!1}Release(){if(this._dispatcherWasReleased)throw Error("already released");this.ClearEvents();this._dispatcherWasReleased=!0;c.Release(this)}WasReleased(){return this._dispatcherWasReleased}ClearEvents(){for(let b of this._eventHandlers.values())b.Release();this._eventHandlers.clear()}_GetHandlerByType(b,a){let f=this._eventHandlers.get(b);return f?f:a?(f=
c.New(c.Event.Handler,b),this._eventHandlers.set(b,f),f):null}HasAnyHandlerFor(b){return this._eventHandlers.has(b)}addEventListener(b,a,f){this._GetHandlerByType(b,!0)._AddListener(a,!!f)}removeEventListener(b,a,f){let d=this._GetHandlerByType(b,!1);d&amp;&amp;(d._RemoveListener(a,!!f),d._IsEmpty()&amp;&amp;this._eventHandlers.delete(b))}dispatchEvent(b){const a=this._GetHandlerByType(b.type,!1);return a?b.cancelable?a._FireCancellable(b):a._FireNonCancellable(b):!0}dispatchEventAsync(b){const a=this._GetHandlerByType(b.type,
!1);if(!a)return Promise.resolve(!0);b.isAsync=!0;return a._FireAsync(b)}async dispatchEventAndClearAsync(b){const a=this._GetHandlerByType(b.type,!1);if(!a)return!0;this._eventHandlers.delete(b.type);b.isAsync=!0;b=await a._FireAsync(b);a.Release();return b}async dispatchEventAndWaitAsync(b){const a=this._GetHandlerByType(b.type,!1);return a?await a._FireAndWaitAsync(b):!0}dispatchEventAndWait_AsyncOptional(b){const a=this._GetHandlerByType(b.type,!1);return a?a._FireAndWait_AsyncOptional(b):!0}async dispatchEventAndWaitAsyncSequential(b){const a=
this._GetHandlerByType(b.type,!1);return a?await a._FireAndWaitAsyncSequential(b):!0}dispatchGeneratorEvent(b){const a=this._GetHandlerByType(b.type,!1);if(!a)return null;if(b.cancelable)throw Error("not supported");return a._FireAsGenerator(b)}SetDelayRemoveEventsEnabled(b){for(const a of this._eventHandlers.values())a.SetDelayRemoveEventsEnabled(b)}}}"use strict";
{const c=self.C3,b="undefined"!==typeof requestIdleCallback;let a=[],f=-1,d=0;function e(m){f=b&amp;&amp;0===d?requestIdleCallback(g,{timeout:35}):setTimeout(g,0&lt;d?1:m)}function g(m){f=-1;if(a.length){var n=performance.now(),r=0;do{h(a.shift());var q=performance.now();++r;var t=(q-n)/r*1.1}while(a.length&amp;&amp;(b&amp;&amp;0===d&amp;&amp;"undefined"!==typeof m?t&lt;m.timeRemaining():12&gt;q-n+t));-1===f&amp;&amp;a.length&amp;&amp;e(Math.max(16-(q-n),4))}}function h(m){let n;try{n=m.func()}catch(r){m.reject(r);return}m.resolve(n)}let l=c.QueryString.Has("disable-asyncify");
l&amp;&amp;console.warn("[Asyncify] Asyncify has been disabled due to disable-asyncify in the query string. Some work will now be done synchronously.");c.Asyncify=function(m){let n=null;c.isDebug&amp;&amp;(n=c.GetCallStack());return new Promise((r,q)=&gt;{a.push({func:m,resolve:r,reject:q,stack:n});l?h(a.pop()):-1===f&amp;&amp;e(16)})};c.Asyncify.SetHighThroughputMode=function(m){if(m)++d;else if(--d,0&gt;d)throw Error("already turned off high throughput mode");}}"use strict";
{const c=self.C3;let b=-1;function a(){b=-1}c.FastGetDateNow=function(){-1===b&amp;&amp;(b=Date.now(),self.setTimeout(a,16));return b};let f=-1,d=-1,e=new Set;function g(){d=f=-1;let h=Date.now();for(let l of e)if(l._CheckTimeout(h)){let m=l._GetDeadline();if(-1===d||m&lt;d)d=m}else e.delete(l);-1!==d&amp;&amp;(f=self.setTimeout(g,Math.max(d-h+100,1E3)))}c.IdleTimeout=class{constructor(h,l){this._callback=h;this._timeout=1E3*l;this._deadline=0;this._isActive=!1}Reset(){let h=c.FastGetDateNow();this._deadline=h+this._timeout;
this._isActive||(e.add(this),this._isActive=!0);-1===f?(d=this._deadline,f=self.setTimeout(g,this._timeout+100)):this._deadline&lt;d&amp;&amp;d&gt;h+1E3&amp;&amp;(self.clearTimeout(f),d=this._deadline,f=self.setTimeout(g,this._timeout+100))}_CheckTimeout(h){return h&gt;=this._deadline?this._callback()?(this._deadline=h+this._timeout,!0):this._isActive=!1:!0}_GetDeadline(){return this._deadline}Cancel(){this._isActive&amp;&amp;(e.delete(this),this._isActive=!1,0===e.size&amp;&amp;-1!==f&amp;&amp;(self.clearTimeout(f),d=f=-1))}Release(){this.Cancel();
this._callback=null}}}"use strict";
{const c=self.C3;c.Disposable=class b{constructor(a){this._disposed=!1;this._disposeAction=a}Dispose(){this._disposed||(this._disposed=!0,this._disposeAction&amp;&amp;(this._disposeAction(),this._disposeAction=null))}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(a){return new b(()=&gt;a.Release())}static From(a,f,d,e,g){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");g&amp;&amp;(d=d.bind(g));
if(f.includes(" ")){f=f.split(" ");g=new c.CompositeDisposable;for(let h of f)a.addEventListener(h,d,e),g.Add(c.New(c.Disposable,()=&gt;a.removeEventListener(h,d,e)));return g}a.addEventListener(f,d,e);return c.New(c.Disposable,()=&gt;a.removeEventListener(f,d,e))}};c.StubDisposable=class extends c.Disposable{SetAction(b){this._disposeAction=b}};c.CompositeDisposable=class extends c.Disposable{constructor(...b){super();this._disposables=new Set;for(let a of b)this.Add(a)}Add(...b){if(this._disposed)throw Error("already disposed");
for(let a of b)this._disposables.add(a)}Remove(b){if(this._disposed)throw Error("already disposed");this._disposables.delete(b)}RemoveAll(){if(this._disposed)throw Error("already disposed");if(this._disposables){for(let b of this._disposables)b.Dispose();this._disposables.clear()}}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw Error("already disposed");this._disposed=!0;for(let b of this._disposables)b.Dispose();this._disposables.clear();this._disposables=null}Release(){this.Dispose()}}}"use strict";
{const c=self.C3;c.KahanSum=class extends c.DefendedBase{constructor(){super();this._sum=this._t=this._y=this._c=0}Add(b){this._y=+b-this._c;this._t=this._sum+this._y;this._c=this._t-this._sum-this._y;this._sum=this._t}Subtract(b){this._sum-=+b}Get(){return this._sum}Reset(){this._sum=this._t=this._y=this._c=0}Set(b){this._t=this._y=this._c=0;this._sum=+b}Release(){}}}"use strict";
{const c=self.C3,b={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 b.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel;this.compare=a||this.default_compare}};b.RedBlackSet.prototype.default_compare=function(a,f){return a&lt;f?-1:f&lt;a?1:0};b.RedBlackSet.prototype.clone=function(){var a=new b.RedBlackSet(this.compare);a.insertAll(this);return a};
b.RedBlackSet.prototype.clear=function(){this.size=0;this.sentinel=new b.RBnode(this);this.sentinel.color=!1;this.root=this.sentinel;this.root.parent=this.sentinel};b.RedBlackSet.prototype.leftRotate=function(a){var f=a.right;a.right=f.left;f.left!=this.sentinel&amp;&amp;(f.left.parent=a);f.parent=a.parent;a.parent==this.sentinel?this.root=f:a==a.parent.left?a.parent.left=f:a.parent.right=f;f.left=a;a.parent=f};b.RedBlackSet.prototype.rightRotate=function(a){var f=a.left;a.left=f.right;f.right!=this.sentinel&amp;&amp;
(f.right.parent=a);f.parent=a.parent;a.parent==this.sentinel?this.root=f:a==a.parent.right?a.parent.right=f:a.parent.left=f;f.right=a;a.parent=f};b.RedBlackSet.prototype.insert=function(a){if(this.contains(a))this.get_(a).key=a;else{var f=new b.RBnode(this);f.key=a;a=this.sentinel;for(var d=this.root;d!=this.sentinel;)a=d,d=0&gt;this.compare(f.key,d.key)?d.left:d.right;f.parent=a;a==this.sentinel?this.root=f:0&gt;this.compare(f.key,a.key)?a.left=f:a.right=f;f.left=this.sentinel;f.right=this.sentinel;f.color=
!0;this.insertFixup(f);this.size++}};b.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 f=a.parent.parent.right;1==f.color?(a.parent.color=!1,f.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 f=a.parent.parent.left,1==f.color?(a.parent.color=
!1,f.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};b.RedBlackSet.prototype.delete_=function(a){var f=a.left==this.sentinel||a.right==this.sentinel?a:this.successor_(a);var d=f.left!=this.sentinel?f.left:f.right;d.parent=f.parent;f.parent==this.sentinel?this.root=d:f==f.parent.left?f.parent.left=d:f.parent.right=
d;f!=a&amp;&amp;(a.key=f.key);0==f.color&amp;&amp;this.deleteFixup(d);this.size--};b.RedBlackSet.prototype.deleteFixup=function(a){for(;a!=this.root&amp;&amp;0==a.color;)if(a==a.parent.left){var f=a.parent.right;1==f.color&amp;&amp;(f.color=!1,a.parent.color=!0,this.leftRotate(a.parent),f=a.parent.right);0==f.left.color&amp;&amp;0==f.right.color?(f.color=!0,a=a.parent):(0==f.right.color&amp;&amp;(f.left.color=!1,f.color=!0,this.rightRotate(f),f=a.parent.right),f.color=a.parent.color,a.parent.color=!1,f.right.color=!1,this.leftRotate(a.parent),
a=this.root)}else f=a.parent.left,1==f.color&amp;&amp;(f.color=!1,a.parent.color=!0,this.rightRotate(a.parent),f=a.parent.left),0==f.right.color&amp;&amp;0==f.left.color?(f.color=!0,a=a.parent):(0==f.left.color&amp;&amp;(f.right.color=!1,f.color=!0,this.leftRotate(f),f=a.parent.left),f.color=a.parent.color,a.parent.color=!1,f.left.color=!1,this.rightRotate(a.parent),a=this.root);a.color=!1};b.RedBlackSet.prototype.remove=function(a){a=this.get_(a);if(a!=this.sentinel){var f=a.key;this.delete_(a);return f}return null};b.RedBlackSet.prototype.removeSwapped=
function(a,f){this.remove(f)};b.RedBlackSet.prototype.min=function(a){for(;a.left!=this.sentinel;)a=a.left;return a};b.RedBlackSet.prototype.max=function(a){for(;a.right!=this.sentinel;)a=a.right;return a};b.RedBlackSet.prototype.successor_=function(a){if(a.right!=this.sentinel)return this.min(a.right);for(var f=a.parent;f!=this.sentinel&amp;&amp;a==f.right;)a=f,f=f.parent;return f};b.RedBlackSet.prototype.predeccessor_=function(a){if(a.left!=this.sentinel)return this.max(a.left);for(var f=a.parent;f!=this.sentinel&amp;&amp;
a==f.left;)a=f,f=f.parent;return f};b.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 f=a.parent;f!=this.sentinel&amp;&amp;a==f.right;)a=f,f=f.parent;return f!=this.sentinel?f.key:null}return null};b.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 f=a.parent;f!=this.sentinel&amp;&amp;
a==f.left;)a=f,f=f.parent;return f!=this.sentinel?f.key:null}return null};b.RedBlackSet.prototype.getMin=function(){return this.min(this.root).key};b.RedBlackSet.prototype.getMax=function(){return this.max(this.root).key};b.RedBlackSet.prototype.get_=function(a){for(var f=this.root;f!=this.sentinel&amp;&amp;0!=this.compare(f.key,a);)f=0&gt;this.compare(a,f.key)?f.left:f.right;return f};b.RedBlackSet.prototype.contains=function(a){return null!=this.get_(a).key};b.RedBlackSet.prototype.getValues=function(){var a=
[];this.forEach(function(f){a.push(f)});return a};b.RedBlackSet.prototype.insertAll=function(a){if("array"==b.typeOf(a))for(var f=0;f&lt;a.length;f++)this.insert(a[f]);else if("function"==b.typeOf(a.forEach))a.forEach(this.insert,this);else if("function"==b.typeOf(a.getValues))for(a=a.getValues(),f=0;f&lt;a.length;f++)this.insert(a[f]);else if("object"==b.typeOf(a))for(f in a)this.insert(a[f])};b.RedBlackSet.prototype.removeAll=function(a){if("array"==b.typeOf(a))for(var f=0;f&lt;a.length;f++)this.remove(a[f]);
else if("function"==b.typeOf(a.forEach))a.forEach(this.removeSwapped,this);else if("function"==b.typeOf(a.getValues))for(a=a.getValues(),f=0;f&lt;a.length;f++)this.remove(a[f]);else if("object"==b.typeOf(a))for(f in a)this.remove(a[f])};b.RedBlackSet.prototype.containsAll=function(a){if("array"==b.typeOf(a)){for(var f=0;f&lt;a.length;f++)if(!this.contains(a[f]))return!1;return!0}if("function"==b.typeOf(a.forEach))return a.every(this.contains,this);if("function"==b.typeOf(a.getValues)){a=a.getValues();for(f=
0;f&lt;a.length;f++)if(!this.contains(a[f]))return!1;return!0}if("object"==b.typeOf(a)){for(f in a)if(!this.contains(a[f]))return!1;return!0}};b.RedBlackSet.prototype.range=function(a,f){var d=[];this.traverseFromTo(function(e){d.push(e)},a,f);return d};b.RedBlackSet.prototype.traverse=function(a,f){if(!this.isEmpty())for(var d=this.min(this.root);d!=this.sentinel&amp;&amp;!a.call(f,d.key,this);)d=this.successor_(d)};b.RedBlackSet.prototype.traverseFrom=function(a,f,d){if(!this.isEmpty())for(f=this.get_(f);f!=
this.sentinel&amp;&amp;!a.call(d,f.key,this);)f=this.successor_(f)};b.RedBlackSet.prototype.traverseTo=function(a,f,d){if(!this.isEmpty()){var e=this.min(this.root);for(f=this.get_(f);e!=f&amp;&amp;!a.call(d,e.key,this);)e=this.successor_(e)}};b.RedBlackSet.prototype.traverseFromTo=function(a,f,d,e){if(!this.isEmpty())for(f=this.get_(f),d=this.get_(d);f!=d&amp;&amp;!a.call(e,f.key,this);)f=this.successor_(f)};b.RedBlackSet.prototype.traverseBackwards=function(a,f){if(!this.isEmpty())for(var d=this.max(this.root);d!=this.sentinel&amp;&amp;
!a.call(f,d.key,this);)d=this.predeccessor_(d)};b.RedBlackSet.prototype.forEach=function(a,f){if(!this.isEmpty())for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))a.call(f,d.key,d.key,this)};b.RedBlackSet.prototype.some=function(a,f){if(this.isEmpty())return!1;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))if(a.call(f,d.key,d.key,this))return!0;return!1};b.RedBlackSet.prototype.every=function(a,f){if(this.isEmpty())return!1;for(var d=this.min(this.root);d!=this.sentinel;d=
this.successor_(d))if(!a.call(f,d.key,d.key,this))return!1;return!0};b.RedBlackSet.prototype.map=function(a,f){var d=[];if(this.isEmpty())return d;for(var e=this.min(this.root);e!=this.sentinel;e=this.successor_(e))d.push(a.call(f,e.key,e.key,this));return d};b.RedBlackSet.prototype.filter=function(a,f){var d=[];if(this.isEmpty())return d;for(var e=this.min(this.root);e!=this.sentinel;e=this.successor_(e))a.call(f,e.key,e.key,this)&amp;&amp;d.push(e.key);return d};b.RedBlackSet.prototype.getCount=function(){return this.size};
b.RedBlackSet.prototype.isEmpty=function(){return 0==this.size};b.RedBlackSet.prototype.isSubsetOf=function(a){var f=b.getCount(a);if(this.getCount()&gt;f)return!1;f=0;if(this.isEmpty())return!0;for(var d=this.min(this.root);d!=this.sentinel;d=this.successor_(d))b.contains.call(a,a,d.key)&amp;&amp;f++;return f==this.getCount()};b.RedBlackSet.prototype.intersection=function(a){var f=new b.RedBlackSet(this.compare);if(this.isEmpty())return f;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;f.insert(d.key);return f};c.RedBlackSet=class extends c.DefendedBase{constructor(a){super();this._rbSet=new b.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 f of this._queueRemove)this._rbSet.remove(f);this._queueRemove.clear();for(const f of this._queueInsert)this._rbSet.insert(f);this._queueInsert.clear()}}ForEach(a){this._rbSet.forEach(a)}*values(){if(!this.IsEmpty()){var a=
this._rbSet;for(let f=a.min(a.root);f!=a.sentinel;f=a.successor_(f))yield f.key}}[Symbol.iterator](){return this.values()}}}"use strict";
{const c=self.C3;c.PromiseThrottle=class{constructor(b=c.hardwareConcurrency){this._maxParallel=b;this._queue=[];this._activeCount=0}Add(b){return new Promise((a,f)=&gt;{this._queue.push({func:b,resolve:a,reject:f});this._MaybeStartNext()})}_FindInQueue(b){for(let a=0,f=this._queue.length;a&lt;f;++a)if(this._queue[a].func===b)return a;return-1}RemoveAndResolve(b,a){b=this._FindInQueue(b);if(-1===b)throw Error("cannot find promise to resolve");this._queue[b].resolve(a);this._queue.splice(b,1)}RemoveAndReject(b,
a){b=this._FindInQueue(b);if(-1===b)throw Error("cannot find promise to reject");this._queue[b].reject(a);this._queue.splice(b,1)}async _MaybeStartNext(){if(this._queue.length&amp;&amp;!(this._activeCount&gt;=this._maxParallel)){this._activeCount++;var b=this._queue.shift();try{const a=await b.func();b.resolve(a)}catch(a){b.reject(a)}this._activeCount--;this._MaybeStartNext()}}static async Batch(b,a){const f=[];let d=!1;const e=async h=&gt;{for(;(h=a.pop())&amp;&amp;!d;)try{f.push(await h())}catch(l){throw d=!0,l;}},g=
[];for(;b--;)g.push(e());await Promise.all(g);return f}}}"use strict";
{const c=self.C3;c.RateLimiter=class{constructor(b,a,f){this._callback=b;this._interval=a;this._intervalOnBattery=f||2*a;this._timerId=-1;this._lastCallTime=-Infinity;this._timerCallFunc=()=&gt;this._OnTimer();this._canRunImmediate=this._ignoreReset=!1;this._callbackArguments=null}SetCanRunImmediate(b){this._canRunImmediate=!!b}_GetInterval(){return"undefined"!==typeof c.Battery&amp;&amp;c.Battery.IsOnBatteryPower()?this._intervalOnBattery:this._interval}Call(...b){if(-1===this._timerId){this._callbackArguments=
b;b=c.FastGetDateNow();var a=b-this._lastCallTime,f=this._GetInterval();a&gt;=f&amp;&amp;this._canRunImmediate?(this._lastCallTime=b,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(f-a,4))}}_RunCallback(){this._ignoreReset=!0;const b=this._callbackArguments;this._callbackArguments=null;b?this._callback(...b):this._callback();this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._callbackArguments=null,this._lastCallTime=c.FastGetDateNow())}_OnTimer(){this._timerId=
-1;this._lastCallTime=c.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 c=self.C3;c.SVGRasterManager=class{constructor(){this._images=new Map;this._allowNpotSurfaces=!1;this._redrawCallback=this._releaseResultCallback=this._rasterAtSizeCallback=this._getBaseSizeCallback=null}SetNpotSurfaceAllowed(b){this._allowNpotSurfaces=!!b}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(b){this._getBaseSizeCallback=b}GetBaseSize(b){if(!this._getBaseSizeCallback)throw Error("no get base size callback set");return this._getBaseSizeCallback(b)}SetRasterAtSizeCallback(b){this._rasterAtSizeCallback=
b}RasterAtSize(b,a,f,d,e,g){if(!this._rasterAtSizeCallback)throw Error("no raster at size callback set");return this._rasterAtSizeCallback(b,a,f,d,e,g)}SetReleaseResultCallback(b){this._releaseResultCallback=b}ReleaseResult(b){if(!this._releaseResultCallback)throw Error("no release result callback set");this._releaseResultCallback(b)}SetRedrawCallback(b){this._redrawCallback=b}Redraw(){if(!this._redrawCallback)throw Error("no redraw callback set");this._redrawCallback()}AddImage(b){let a=this._images.get(b);
a||(a=c.New(c.SVGRasterImage,this,b),this._images.set(b,a));a.IncReference();return a}_RemoveImage(b){this._images.delete(b.GetDataSource())}}}"use strict";
{const c=self.C3;c.SVGRasterImage=class{constructor(b,a){this._manager=b;this._dataSource=a;this._baseHeight=this._baseWidth=this._refCount=0;this._getBaseSizePromise=this._manager.GetBaseSize(a).then(f=&gt;{this._baseWidth=f[0];this._baseHeight=f[1];this._manager.Redraw()}).catch(f=&gt;{console.error("[SVG] Error loading SVG: ",f);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()}_Release(){this._rasterizedResult&amp;&amp;(this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=null);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(b,a,f){if(0!==a&amp;&amp;0!==f&amp;&amp;!this._hadError&amp;&amp;!this._isRasterizing){var d=c.nextHighestPowerOfTwo(Math.ceil(a)),e=c.nextHighestPowerOfTwo(Math.ceil(f)),g=Math.max(d,e);2048&lt;g&amp;&amp;(g=2048/g,a*=g,f*=g,d=Math.min(Math.ceil(d*g),2048),e=Math.min(Math.ceil(e*g),2048));a&lt;d&amp;&amp;f&lt;e&amp;&amp;(f=a/f,d/e&gt;f?(a=e*f,f=e):(a=d,f=d/f));this._manager.IsNpotSurfaceAllowed()&amp;&amp;(d=Math.ceil(a),e=Math.ceil(f));d&lt;=this._rasterSurfaceWidth&amp;&amp;e&lt;=this._rasterSurfaceHeight&amp;&amp;!this._forceRaster||(this._isRasterizing=
!0,this._rasterSurfaceWidth=d,this._rasterSurfaceHeight=e,b=await this._manager.RasterAtSize(this._dataSource,b,this._rasterSurfaceWidth,this._rasterSurfaceHeight,a,f),this._rasterizedResult&amp;&amp;this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=b,this._rasterImageWidth=a,this._rasterImageHeight=f,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 c=self.C3;c.UTF8_BOM="\ufeff";const b=new Set([..."0123456789"]);c.IsNumericChar=function(m){return b.has(m)};const a=new Set([..." \t\n\r\u00a0\u0085\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000"]);c.IsWhitespaceChar=function(m){return a.has(m)};c.FilterWhitespace=function(m){return[...m].filter(n=&gt;!c.IsWhitespaceChar(n)).join("")};c.IsStringAllWhitespace=function(m){for(const n of m)if(!c.IsWhitespaceChar(n))return!1;return!0};c.IsUnprintableChar=
function(m){return 1===m.length&amp;&amp;32&gt;m.charCodeAt(0)};c.FilterUnprintableChars=function(m){return[...m].filter(n=&gt;!c.IsUnprintableChar(n)).join("")};const f=new Set([..."0123456789.+-e"]);c.IsStringNumber=function(m){m=m.trim();if(!m.length)return!1;let n=m.charAt(0);if("-"!==n&amp;&amp;!b.has(n))return!1;for(let r of m)if(!f.has(r))return!1;return!0};c.RemoveTrailingDigits=function(m){let n=m.length;for(;0&lt;n;){let r=m.charAt(n-1);if(!c.IsNumericChar(r))break;--n}return m.substr(0,n)};c.IncrementNumberAtEndOf=
function(m){let n=c.RemoveTrailingDigits(m);m=(m=m.substr(n.length))?(parseInt(m,10)+1).toString():"2";return n+m};const d=new Map([["&amp;","&amp;amp;"],["&lt;","&amp;lt;"],["&gt;","&amp;gt;"],['"',"&amp;quot;"],["'","&amp;#39;"]]);function e(m){return d.get(m)}const g=/[&amp;&lt;&gt;"']/g;c.EscapeHTML=function(m){return m.replace(g,e)};c.EscapeJS=function(m){m=c.ReplaceAll(m,"\\","\\\\");m=c.ReplaceAll(m,'"','\\"');m=c.ReplaceAll(m,"\t","\\t");m=c.ReplaceAll(m,"\r","");return c.ReplaceAll(m,"\n","\\n")};c.EscapeXML=function(m){m=c.ReplaceAll(m,
"&amp;","&amp;amp;");m=c.ReplaceAll(m,"&lt;","&amp;lt;");m=c.ReplaceAll(m,"&gt;","&amp;gt;");return c.ReplaceAll(m,'"',"&amp;quot;")};const h=/[-[\]{}()*+?.,\\^$|#\s]/g;c.EscapeRegex=function(m){return m.replace(h,"\\$&amp;")};c.FindAll=function(m,n,r=!1){if(!n)return[];r||(m=m.toLowerCase(),n=n.toLowerCase());r=n.length;var q=0;let t=[];for(;-1&lt;(q=m.indexOf(n,q));)t.push(q),q+=r;return t};c.ReplaceAll=function(m,n,r){return m.replaceAll(n,()=&gt;r)};c.ReplaceAllCaseInsensitive=function(m,n,r){return m.replace(new RegExp(c.EscapeRegex(n),
"gi"),()=&gt;r)};c.SetElementContent=function(m,n){"string"===typeof n?m.textContent=n:n.isPlainText()?m.textContent=n.toString():(m.innerHTML=n.toHTML(),n instanceof c.BBString&amp;&amp;n.attachLinkHandlers(m))};c.StringLikeEquals=function(m,n){return m instanceof c.HtmlString||m instanceof c.BBString?m.equals(n):n instanceof c.HtmlString||n instanceof c.BBString?n.equals(m):m===n};c.StringSubstitute=function(m,...n){let r=m;for(let q=0,t=n.length;q&lt;t;++q){const u=`{${q}}`;if(!m.includes(u))throw Error(`missing placeholder '${u}' in string substitution`);
r=r.replace(u,n[q].toString())}return r};c.StringSubstituteAllowMissing=function(m,...n){let r=m,q=-1,t=-1;for(let u=0,w=n.length;u&lt;w;++u){const y=`{${u}}`;m.includes(y)?(t=u,r=r.replace(y,n[u].toString())):-1===q&amp;&amp;(q=u)}if(0&lt;=q&amp;&amp;0&lt;=t&amp;&amp;q&lt;t)throw Error(`missing placeholder '${q}' in string substitution`);return r};c.StringSubstituteMap=function(m,n){for(let [r,q]of Object.entries(n))m=m.replaceAll(r,q.toString());return m};c.SortAZCaseInsensitive=function(m,n){m=m.toLowerCase();n=n.toLowerCase();return m&gt;
n?1:m&lt;n?-1:0};c.FormatDataSize=function(m,n){n="common."+(n?"dataRates":"dataSizes")+".";const r=self.langSub;if(1024&gt;m)return r(n+"bytes",m);if(1048576&gt;m)return m/=1024,m=10&gt;m?Math.round(10*m)/10:Math.round(m),r(n+"kilobytes",m);if(1073741824&gt;m)return m/=1048576,m=10&gt;m?Math.round(10*m)/10:Math.round(m),r(n+"megabytes",m);if(1099511627776&gt;m)return m/=1073741824,m=10&gt;m?Math.round(10*m)/10:Math.round(m),r(n+"gigabytes",m);m/=1099511627776;m=10&gt;m?Math.round(10*m)/10:Math.round(m);return r(n+"terabytes",
m)};const l={approximate:!1,days:!0,hours:!0,minutes:!0,seconds:!0};c.FormatTime=function(m,n){n=Object.assign({},l,n);c.Lang.PushContext("common.time");const r=[],q=self.lang,t=self.langPluralSub;if(n.days){var u=Math.floor(m/86400);0&lt;u&amp;&amp;(m-=86400*u,r.push(t(".days",null,u)))}n.hours&amp;&amp;(u=Math.floor(m/3600),0&lt;u||r.length)&amp;&amp;(m-=3600*u,r.push(t(".hours",null,u)));n.minutes&amp;&amp;(u=Math.floor(m/60),0&lt;u||r.length||!n.seconds)&amp;&amp;(m-=60*u,r.push(t(".minutes",null,u)));n.seconds&amp;&amp;r.push(t(".seconds",null,Math.floor(m%
60)));m=(n.approximate?q(".approx-prefix"):"")+r.join(q(".separator"));c.Lang.PopContext();return m};c.ZeroPad=function(m,n){let r=0&gt;m?"-":"";m=Math.abs(m);m=m.toString();n-=m.length;for(let q=0;q&lt;n;++q)r+="0";return r+m};c.StringToTitleCase=function(m){return m.toLowerCase().replace(/\b\w/g,n=&gt;n.toUpperCase())};c.CompareVersionStrings=function(m,n){m=m.split(".").map(r=&gt;r.trim());n=n.split(".").map(r=&gt;r.trim());c.resizeArray(m,4,"0");c.resizeArray(n,4,"0");m=m.map(r=&gt;parseInt(r,10));n=n.map(r=&gt;parseInt(r,
10));for(let r=0;4&gt;r;++r){const q=m[r]-n[r];if(0!==q)return 0&gt;q?-1:1}return 0};c.CreateGUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,m=&gt;{const n=Math.floor(16*Math.random());return("x"===m?n:n&amp;3|8).toString(16)})};c.StringHammingDistance=function(m,n){if(m.length!==n.length)throw Error("strings must be same length");let r=0;for(let q=0,t=m.length;q&lt;t;++q)m.charAt(q)!==n.charAt(q)&amp;&amp;++r;return r};c.StringLevenshteinDistance=function(m,n){if(0===m.length)return n.length;
if(0===n.length)return m.length;let r,q,t,u;if(m.length&gt;n.length){var w=m;m=n;n=w}u=Array(m.length+1);for(w=0;w&lt;=m.length;w++)u[w]=w;for(w=1;w&lt;=n.length;w++){q=w;for(r=1;r&lt;=m.length;r++)t=n[w-1]===m[r-1]?u[r-1]:Math.min(u[r-1]+1,Math.min(q+1,u[r]+1)),u[r-1]=q,q=t;u[m.length]=q}return u[m.length]}}"use strict";
{const c=self.C3,b=new Map([["b","strong"],["i","em"],["s","s"],["u","u"],["sub","sub"],["sup","sup"],["small","small"],["mark","mark"],["a1","a"],["a2","a"],["a3","a"],["a4","a"],["a5","a"],["a6","a"],["a7","a"],["a8","a"],["a9","a"],["bad",["span","bbCodeBad"]],["good",["span","bbCodeGood"]],["info",["span","bbCodeInfo"]],["h1",["span","bbCodeH1"]],["h2",["span","bbCodeH2"]],["h3",["span","bbCodeH3"]],["h4",["span","bbCodeH4"]],["item",["span","bbCodeItem"]]]),a=/\[(\/?)([a-zA-Z0-9]+)\]/g,f=/\[(\/?)([^\[]*?)\]/g;
let d=null,e=0;function g(l,m,n){var r=b.get(n);if(r){if("string"===typeof r){if("a"!==r||m)return"&lt;"+m+r+"&gt;";m=parseInt(n.substring(1),10)-1;if(0&gt;m||m&gt;=d.length)throw Error("invalid bbcode link substitution");r=d[m];if("string"===typeof r)return`&lt;a href="${d[m]}"&gt;`;if("function"===typeof r)return`&lt;a class="bblink${m}"&gt;`;throw new TypeError("invalid bbcode link action");}if(Array.isArray(r))return l=r[0],r=r[1],m?"&lt;/"+l+"&gt;":`&lt;${l} class="${r}"&gt;`}else return"class"===n?m?"&lt;/span&gt;":`&lt;span class="bbclass${e++}"&gt;`:
l}const h=/\n/g;c.BBString=class{constructor(l,m){this._bbstr=m&amp;&amp;m.noEscape?l:c.EscapeHTML(l);this._htmlstr="";this._convertLineBreaks=!1;this._linkActions=[];if(m&amp;&amp;(this._convertLineBreaks=!!m.convertLineBreaks,m.links)){if(9&lt;m.links.length)throw Error("too many links");this._linkActions=m.links}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(a,""):this._bbstr}toHTML(){if(this._isPlain)return this._bbstr;if(!this._htmlstr&amp;&amp;this._bbstr){let l=this._bbstr;this._hasAnyBBtags&amp;&amp;(e=0,d=this._linkActions,l=l.replace(a,g),d=null);this._needsLineBreakConversion&amp;&amp;(l=l.replace(h,"&lt;br&gt;"));this._htmlstr=l}return this._htmlstr}attachLinkHandlers(l){if(this._linkActions.length)for(let m=
0,n=this._linkActions.length;m&lt;n;++m){const r=this._linkActions[m];if("function"!==typeof r)continue;const q=l.querySelector(".bblink"+m);if(!q)throw Error("unable to attach BBString link handler");q.onclick=r}}equals(l){return l instanceof c.HtmlString?this.toHTML()===l.toHTML():l instanceof c.BBString?this._bbstr===l._bbstr:this._bbstr===l}toFragmentList(){if(this._hasParsedFragments)return this._fragments;const l=this._bbstr,m=[];let n=f.lastIndex=0;for(var r;null!==(r=f.exec(l));){var q=r.index;
if(0&lt;q&amp;&amp;"\\"===l.charAt(q-1))continue;var t=r[0],u=r[1];r=r[2];const w=l.substring(n,q);n=q+t.length;w&amp;&amp;this._fragments.push({text:w,styles:m.slice(0)});if(r)if(u)for(r=r.toLowerCase(),q=m.length-1;0&lt;=q;--q){if(m[q].tag===r){m.splice(q,1);break}}else q=r,t=null,u=r.indexOf("="),-1!==u?(q=r.substring(0,u).toLowerCase(),t=r.substring(u+1)):q=q.toLowerCase(),m.push({tag:q,param:t})}n&lt;l.length&amp;&amp;this._fragments.push({text:l.substring(n),styles:m.slice(0)});for(const w of this._fragments)w.text=this._ProcessBBCodeEscapeSequences(w.text);
this._hasParsedFragments=!0;return this._fragments}_ProcessBBCodeEscapeSequences(l){l=c.ReplaceAll(l,"\\[","[");return c.ReplaceAll(l,"\\\\","\\")}static StripTags(l){return c.New(c.BBString,l,{noEscape:!0}).toPlainText()}static StripAnyTags(l){return l.replace(f,"")}}}"use strict";
{const c=self.C3;c.WordWrap=class{constructor(){this._lines=[]}GetLines(){return this._lines}GetLineCount(){return this._lines.length}_MeasureLine(b,a){let f=0,d=0;for(const e of b)-1===e.width&amp;&amp;(b=a(e.text,e.styles),e.width=b.width,e.height=b.height),f+=e.width,d=Math.max(d,e.height);return{width:f,height:d}}_AddLine(b,a,f){this._lines.push({fragments:b,width:a,height:f})}WordWrap(b,a,f,d,e){"string"===typeof b&amp;&amp;(b=[{text:b,styles:[]}]);c.clearArray(this._lines);if(!(!b.length||1===b.length&amp;&amp;!b[0].text.length||
2&gt;f)){if(1===b.length){var g=b[0];const h=g.text;g=g.styles;if(100&gt;=h.length&amp;&amp;!h.includes("\n")){let {width:l,height:m}=a(h,g);l+=e;if(l&lt;=f){this._AddLine([{text:h,styles:g,width:l,height:m}],l,m);return}}}if("word"===d)d=this._TokeniseWords(b);else{d=[];for(const h of b)c.appendArray(d,[...h.text].map(l=&gt;[{text:l,styles:h.styles}]))}this._WrapText(d,a,f,e)}}_TokeniseWords(b){const a=[];let f=[],d=!1;for(const g of b){var e=g.text;b=g.styles;for(const h of e)"\n"===h?(0&lt;f.length&amp;&amp;a.push(f),a.push([{text:"\n",
styles:b}]),f=[]):0===f.length?(f.push({text:h,styles:b}),d=c.IsWhitespaceChar(h)):(e=c.IsWhitespaceChar(h),e===d?(e=f[f.length-1],e.styles===b?e.text+=h:f.push({text:h,styles:b})):(a.push(f),f=[],f.push({text:h,styles:b}),d=e))}0&lt;f.length&amp;&amp;a.push(f);return a}_CopyLine(b){return b.map(a=&gt;({text:a.text,styles:a.styles,width:a.width,height:a.height}))}_AddWordToLine(b,a){var f=b.length?b[b.length-1]:null;let d=0;f&amp;&amp;a[0].styles===f.styles&amp;&amp;(f.text+=a[0].text,f.width=-1,f.height=-1,d=1);for(f=a.length;d&lt;
f;++d){const e=a[d];b.push({text:e.text,styles:e.styles,width:-1,height:-1})}}_WrapText(b,a,f,d){let e=[],g=0;var h=0;for(const m of b){if(1===m.length&amp;&amp;"\n"===m[0].text){0===h&amp;&amp;(h=a(" ",m[0].styles).height);this._AddLine(e,g,h);e=[];h=g=0;continue}b=this._CopyLine(e);this._AddWordToLine(b,m);var l=this._MeasureLine(b,a);const n=l.width;l=l.height;n&gt;=f?(0&lt;e.length&amp;&amp;this._AddLine(e,g,h),e=[],c.IsStringAllWhitespace(m[0].text)?h=g=0:(this._AddWordToLine(e,m),h=this._MeasureLine(e,a),g=h.width,h=h.height)):
(e=b,g=n,h=l)}0&lt;e.length&amp;&amp;this._AddLine(e,g,h);this._TrimLinesTrailingWhitespace(a,d)}_TrimLinesTrailingWhitespace(b,a){for(const d of this._lines){const e=d.fragments;if(!e.length)continue;let g=e[e.length-1];var f=g.text;const h=f.trimEnd();if(!h)d.width-=g.width,e.pop();else if(h.length&lt;f.length){f=b(h,g.styles).width;const l=g.width-f;g.width=f;g.text=h;d.width-=l}0!==a&amp;&amp;0&lt;e.length&amp;&amp;(g=e[e.length-1],g.width+=a,d.width+=a)}}Clear(){c.clearArray(this._lines)}GetMaxLineWidth(){return this._lines.reduce((b,
a)=&gt;Math.max(b,a.width),0)}GetTotalLineHeight(){return this._lines.reduce((b,a)=&gt;b+a.height,0)}}}"use strict";self.C3.Gfx={};"use strict";
{const c=self.C3,b=[0,0,0,0,0,0,0,0],a=self.glMatrix,f=a.vec3,d=a.mat4,e=f.fromValues(0,0,0);c.Gfx.RendererBase=class{constructor(){this._height=this._width=0;this._cam=f.fromValues(0,0,100);this._look=f.fromValues(0,0,0);this._up=f.fromValues(0,1,0);this._worldScale=f.fromValues(1,1,1);this._matP=d.create();this._matMV=d.create();this._lastMV=d.create();this._allShaderPrograms=[];this._shaderProgramsByName=new Map;this._spTextureFill=null;this._stateGroups=new Map;this._currentStateGroup=null;this._blendModeTable=
[];this._namedBlendModeMap=new Map;this._frameNumber=0;this._enableMipmaps=!0}FillIndexBufferData(g){let h=0,l=g.length,m=0;for(;h&lt;l;)g[h++]=m,g[h++]=m+1,g[h++]=m+2,g[h++]=m,g[h++]=m+2,g[h++]=m+3,m+=4}Project(g,h,l,m,n){const r=this._matMV,q=this._matP;for(let t=0,u=b.length;t&lt;u;++t)b[t]=0;b[0]=r[0]*g+r[4]*h+r[12];b[1]=r[1]*g+r[5]*h+r[13];b[2]=r[2]*g+r[6]*h+r[14];b[3]=r[3]*g+r[7]*h+r[15];b[4]=q[0]*b[0]+q[4]*b[1]+q[8]*b[2]+q[12]*b[3];b[5]=q[1]*b[0]+q[5]*b[1]+q[9]*b[2]+q[13]*b[3];b[6]=q[2]*b[0]+q[6]*
b[1]+q[10]*b[2]+q[14]*b[3];b[7]=-b[2];0!==b[7]&amp;&amp;(b[7]=1/b[7],b[4]*=b[7],b[5]*=b[7],b[6]*=b[7],n[0]=(.5*b[4]+.5)*l,n[1]=(.5*b[5]+.5)*m)}GetWidth(){return this._width}GetHeight(){return this._height}GetNearZ(){return 1}GetFarZ(){return 1E4}SetCameraXYZ(g,h,l){this._cam[0]=g*this._worldScale[0];this._cam[1]=h*this._worldScale[1];this._cam[2]=l}SetLookXYZ(g,h,l){this._look[0]=g*this._worldScale[0];this._look[1]=h*this._worldScale[1];this._look[2]=l}ResetModelView(g){d.lookAt(this._matMV,this._cam,this._look,
g||this._up);d.scale(this._matMV,this._matMV,this._worldScale)}Translate(g,h){if(0!==g||0!==h)e[0]=g,e[1]=h,e[2]=0,d.translate(this._matMV,this._matMV,e)}Scale(g,h){if(1!==g||1!==h)e[0]=g,e[1]=h,e[2]=1,d.scale(this._matMV,this._matMV,e)}RotateZ(g){0!==g&amp;&amp;d.rotateZ(this._matMV,this._matMV,g)}_AddShaderProgram(g){this._allShaderPrograms.push(g);this._shaderProgramsByName.set(g.GetName(),g)}_RemoveShaderProgram(g){const h=this._allShaderPrograms.indexOf(g);-1!==h&amp;&amp;this._allShaderPrograms.splice(h,1);
this._shaderProgramsByName.delete(g.GetName())}_ClearAllShaderPrograms(){c.clearArray(this._allShaderPrograms);this._shaderProgramsByName.clear()}GetShaderProgramByName(g){return this._shaderProgramsByName.get(g)||null}GetTextureFillShaderProgram(){return this._spTextureFill}_SetCurrentStateGroup(g){this._currentStateGroup=g}GetCurrentStateGroup(){return this._currentStateGroup}AcquireStateGroup(g,h,l,m){const n=c.Gfx.StateGroup.MakeKey(g,h,l,m);let r=this._stateGroups.get(n);r||(r=c.New(c.Gfx.StateGroup,
this,g,h,l,m),this._stateGroups.set(n,r));r.AddRef();return r}ReleaseStateGroup(g){g.DecRef();0===g._GetRefCount()&amp;&amp;(this._currentStateGroup===g&amp;&amp;(this._currentStateGroup=null),this._stateGroups.delete(g.GetKey()),g.Release())}_InitBlendModeData(g){c.clearArray(this._blendModeTable);this._namedBlendModeMap.clear();for(const h of g){g=h[0];const l=h[1],m=h[2];this._blendModeTable.push([l,m]);this._namedBlendModeMap.set(g,{srcBlend:l,destBlend:m})}}_GetBlendByIndex(g){return this._blendModeTable[g]}GetSrcBlendByIndex(g){return this._GetBlendByIndex(g)[0]}GetDestBlendByIndex(g){return this._GetBlendByIndex(g)[1]}GetNamedBlend(g){g=
this._namedBlendModeMap.get(g);if("undefined"===typeof g)throw Error("invalid blend name");return g}Finish(){this.EndBatch();this._frameNumber++}GetFrameNumber(){return this._frameNumber}IncrementFrameNumber(){this._frameNumber++}SetMipmapsEnabled(g){this._enableMipmaps=!!g}AreMipmapsEnabled(){return this._enableMipmaps}}}"use strict";
{const c=self.C3;c.Gfx.StateGroup=class{constructor(b,a,f,d,e){this._renderer=b;this._refCount=0;this._shaderProgram=null;this._shaderProgramName="";this._blendMode=f;this._color=c.New(c.Color);this._color.set(d);this._zElevation=e;"string"===typeof a?this._shaderProgramName=a:(this._shaderProgram=a,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 b=
this._renderer;b.SetProgram(this._shaderProgram);b.SetBlendMode(this._blendMode);b.SetColor(this._color);b.SetCurrentZ(this._zElevation);b._SetCurrentStateGroup(this)}GetKey(){return c.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(b){this._shaderProgram=b.GetShaderProgramByName(this._shaderProgramName);if(!this._shaderProgram)throw Error("failed to restore shader program");
}static MakeKey(b,a,f,d){return("string"===typeof b?b:b.GetName())+","+a+","+f.getR()+","+f.getG()+","+f.getB()+","+f.getA()+","+d}}}"use strict";
{const c=self.C3,b=c.New(c.Quad),a=c.New(c.Quad);function f(e,g,h){const l=h.getTlx(),m=h.getTly(),n=h.getTrx()-l,r=h.getTry()-m,q=h.getBlx()-l;h=h.getBly()-m;return[l+n*e+q*g,m+r*e+h*g]}class d{constructor(e){this._mesh=e;this._v=this._u=this._y=this._x=0}_Init(e,g,h,l){this._x=e;this._y=g;this._u=h;this._v=l}GetX(){return this._x}SetX(e){this._x!==e&amp;&amp;(this._x=e,this._mesh._SetPointsChanged())}GetY(){return this._y}SetY(e){this._y!==e&amp;&amp;(this._y=e,this._mesh._SetPointsChanged())}GetU(){return this._u}SetU(e){this._u=
e}GetV(){return this._v}SetV(e){this._v=e}_Interpolate_TexRect(e,g,h){[this._x,this._y]=f(e._x,e._y,g);this._u=c.lerp(h.getLeft(),h.getRight(),e._u);this._v=c.lerp(h.getTop(),h.getBottom(),e._v)}_Interpolate_TexQuad(e,g,h){[this._x,this._y]=f(e._x,e._y,g);[this._u,this._v]=f(e._u,e._v,h)}}c.Gfx.Mesh=class{constructor(e,g){if(2&gt;e||2&gt;g)throw Error("invalid mesh size");this._hsize=e;this._vsize=g;this._pts=[];this._minY=this._minX=0;this._maxY=this._maxX=1;this._pointsChanged=!1;const h=e-1,l=g-1;for(let m=
0;m&lt;g;++m){const n=[];for(let r=0;r&lt;e;++r){const q=c.New(d,this),t=r/h,u=m/l;q._Init(t,u,t,u);n.push(q)}this._pts.push(n)}}Release(){c.clearArray(this._pts)}GetHSize(){return this._hsize}GetVSize(){return this._vsize}_SetPointsChanged(){this._pointsChanged=!0}_MaybeComputeBounds(){if(this._pointsChanged){var e=Infinity,g=Infinity,h=-Infinity,l=-Infinity;for(const m of this._pts)for(const n of m){const r=n.GetX(),q=n.GetY();e=Math.min(e,r);g=Math.min(g,q);h=Math.max(h,r);l=Math.max(l,q)}this._minX=
e;this._minY=g;this._maxX=h;this._maxY=l;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}GetMeshPointAt(e,g){e=Math.floor(e);g=Math.floor(g);return 0&gt;e||e&gt;=this._hsize||0&gt;g||g&gt;=this._vsize?null:this._pts[g][e]}CalculateTransformedMesh(e,g,h){const l=h instanceof c.Rect;if(e.GetHSize()!==this.GetHSize()||
e.GetVSize()!==this.GetVSize())throw Error("source mesh wrong size");e=e._pts;const m=this._pts;for(let n=0,r=m.length;n&lt;r;++n){const q=e[n],t=m[n];for(let u=0,w=t.length;u&lt;w;++u){const y=q[u],C=t[u];l?C._Interpolate_TexRect(y,g,h):C._Interpolate_TexQuad(y,g,h)}}}Draw(e){const g=this._pts;let h=g[0];for(let l=1,m=g.length;l&lt;m;++l){const n=g[l];let r=h[0],q=n[0];for(let t=1,u=n.length;t&lt;u;++t){const w=h[t],y=n[t];b.set(r.GetX(),r.GetY(),w.GetX(),w.GetY(),y.GetX(),y.GetY(),q.GetX(),q.GetY());a.set(r.GetU(),
r.GetV(),w.GetU(),w.GetV(),y.GetU(),y.GetV(),q.GetU(),q.GetV());e.Quad4(b,a);r=w;q=y}h=n}}Outline(e){const g=this._pts;let h=g[0];for(let n=1,r=g.length;n&lt;r;++n){const q=g[n];var l=h[0],m=q[0];for(let t=1,u=q.length;t&lt;u;++t){const w=h[t],y=q[t],C=l.GetX();l=l.GetY();const G=w.GetX(),x=w.GetY(),B=y.GetX(),H=y.GetY(),P=m.GetX();m=m.GetY();e.Line(C,l,G,x);e.Line(C,l,B,H);e.Line(C,l,P,m);t===u-1&amp;&amp;e.Line(G,x,B,H);n===r-1&amp;&amp;e.Line(P,m,B,H);l=w;m=y}h=q}}InsertPolyMeshVertices(e){e=e.pointsArr();const g=[],
h=this.GetHSize()-1,l=this.GetVSize()-1,m=1/h,n=1/l,r=h-1,q=l-1;let t=e[0],u=e[1],w=c.clamp(Math.floor(t*h),0,r),y=c.clamp(Math.floor(u*l),0,q),C=0,G=0,x=0;var B=-1;const H=()=&gt;{t=c.clamp(c.lerp(t,C,x),0,1);u=c.clamp(c.lerp(u,G,x),0,1);g.push(t,u)};for(let P=0,E=e.length;P&lt;E;P+=2)for(t=e[P],u=e[P+1],g.push(t,u),w=c.clamp(Math.floor(t*h),0,r),y=c.clamp(Math.floor(u*l),0,q),B=(P+2)%E,C=e[B],G=e[B+1],B=-1;;){if(1E6&lt;g.length)throw Error("Too many mesh poly points");const J=w*m,O=y*n,R=(w+1)*m,T=(y+1)*
n;c.isPointInTriangleInclusive(t,u,J,O,R,O,R,T);if(0!==B&amp;&amp;(x=c.rayIntersectExtended(t,u,C,G,J,O,R,T,-.001),0&lt;=x&amp;&amp;.99999999&gt;=x)){H();B=0;continue}if(0&lt;y&amp;&amp;2!==B&amp;&amp;(x=c.rayIntersectExtended(t,u,C,G,J,O,R,O,.001),0&lt;=x&amp;&amp;.99999999&gt;=x)){H();y--;B=4;continue}if(w&lt;r&amp;&amp;3!==B&amp;&amp;(x=c.rayIntersectExtended(t,u,C,G,R,O,R,T,.001),0&lt;=x&amp;&amp;.99999999&gt;=x)){H();w++;B=1;continue}if(0&lt;w&amp;&amp;1!==B&amp;&amp;(x=c.rayIntersectExtended(t,u,C,G,J,O,J,T,.001),0&lt;=x&amp;&amp;.99999999&gt;=x)){H();w--;B=3;continue}if(y&lt;q&amp;&amp;4!==B&amp;&amp;(x=c.rayIntersectExtended(t,
u,C,G,J,T,R,T,.001),0&lt;=x&amp;&amp;.99999999&gt;=x)){H();y++;B=2;continue}break}return c.New(c.CollisionPoly,g)}TransformCollisionPoly(e,g){e=this._TransformPolyPoints(e);this._SimplifyPoly(e);g.setPoints(e)}_TransformPolyPoints(e){const g=[];e=e.pointsArr();for(let h=0,l=e.length;h&lt;l;h+=2){const [m,n]=this.TransformPoint(e[h],e[h+1]);g.push(m,n)}return g}TransformPoint(e,g){var h=this.GetHSize()-1,l=this.GetVSize()-1,m=1/h,n=1/l;h=c.clamp(Math.floor(e*h),0,h-1);const r=c.clamp(Math.floor(g*l),0,l-1);l=h*m;const q=
r*n,t=(h+1)*m,u=(r+1)*n,w=this.GetMeshPointAt(h,r),y=this.GetMeshPointAt(h+1,r+1),C=c.isPointInTriangleInclusive(e,g,l,q,t,q,t,u);m=C?l+m:l;n=C?q:q+n;h=this.GetMeshPointAt(h+(C?1:0),r+(C?0:1));const [G,x,B]=c.triangleCartesianToBarycentric(e,g,l,q,m,n,t,u);return c.triangleBarycentricToCartesian(G,x,B,w.GetX(),w.GetY(),h.GetX(),h.GetY(),y.GetX(),y.GetY())}_SimplifyPoly(e){const g=[];let h=e[0],l=e[1],m=h-e[e.length-2],n=l-e[e.length-1];for(let q=0,t=e.length;q&lt;t;q+=2){var r=(q+2)%t;const u=e[r];r=
e[r+1];const w=u-h,y=r-l,C=1e-7&gt;Math.abs(y)&amp;&amp;1e-7&gt;Math.abs(n)&amp;&amp;Math.sign(w)===Math.sign(m);(!(1e-7&gt;Math.abs(w)&amp;&amp;1e-7&gt;Math.abs(m)&amp;&amp;Math.sign(y)===Math.sign(n)||C)&amp;&amp;1e-7&lt;Math.abs(w/m-y/n)||0==w&amp;&amp;0===y)&amp;&amp;g.push(h,l);h=u;l=r;m=w;n=y}g.length&lt;e.length&amp;&amp;c.shallowAssignArray(e,g)}}}"use strict";
{const c=self.C3,b=new Set(["rgba8","rgb8","rgba4","rgb5_a1","rgb565"]),a=new Set(["nearest","bilinear","trilinear"]),f=new Set(["default","low","high"]),d=new Set(["clamp-to-edge","repeat","mirror-repeat"]);function e(m,n){let r,q;switch(m){case "rgba8":m=n.RGBA8;q=r=n.RGBA;n=n.UNSIGNED_BYTE;break;case "rgb8":m=n.RGB8;q=r=n.RGB;n=n.UNSIGNED_BYTE;break;case "rgba4":m=n.RGBA4;q=r=n.RGBA;n=n.UNSIGNED_SHORT_4_4_4_4;break;case "rgb5_a1":m=n.RGB5_A1;q=r=n.RGBA;n=n.UNSIGNED_SHORT_5_5_5_1;break;case "rgb565":m=
n.RGB565;q=r=n.RGB;n=n.UNSIGNED_SHORT_5_6_5;break;default:throw Error("invalid pixel format");}return{sizedinternalformat:m,internalformat:r,format:q,type:n}}const g={wrapX:"clamp-to-edge",wrapY:"clamp-to-edge",sampling:"trilinear",pixelFormat:"rgba8",mipMap:!0,mipMapQuality:"default",premultiplyAlpha:!0,isSvg:!1,width:-1,height:-1},h={premultiplyAlpha:!0,flipY:!1},l=new Set;c.Gfx.WebGLRendererTexture=class{constructor(m){this._renderer=m;this._texture=null;this._height=this._width=0;this._isStatic=
!0;this._wrapY=this._wrapX="clamp-to-edge";this._sampling="trilinear";this._pixelFormat="rgba8";this._isMipMapped=!1;this._mipMapQuality="default";this._refCount=0}_CreateStatic(m,n){if(!("undefined"!==typeof HTMLImageElement&amp;&amp;m instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&amp;&amp;m instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&amp;&amp;m instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&amp;&amp;m instanceof OffscreenCanvas||m instanceof ImageData||m instanceof ArrayBuffer)&amp;&amp;
null!==m)throw Error("invalid texture source");n=Object.assign({},g,n);if(this._texture)throw Error("already created texture");this._wrapX=n.wrapX;this._wrapY=n.wrapY;this._sampling=n.sampling;this._pixelFormat=n.pixelFormat;this._isMipMapped=!!n.mipMap&amp;&amp;this._renderer.AreMipmapsEnabled();this._mipMapQuality=n.mipMapQuality;if(!d.has(this._wrapX)||!d.has(this._wrapY))throw Error("invalid wrap mode");if(!a.has(this._sampling))throw Error("invalid sampling");if(!b.has(this._pixelFormat))throw Error("invalid pixel format");
if(!f.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!0;if(m instanceof ArrayBuffer||null===m||n.isSvg){if(this._width=n.width,this._height=n.height,m instanceof ArrayBuffer&amp;&amp;m.byteLength!==this._width*this._height*4)throw Error("ArrayBuffer wrong size");}else this._width=m.width,this._height=m.height;if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid texture data size");if(n.isSvg){var r=c.CreateCanvas(this._width,this._height);r.getContext("2d").drawImage(m,0,
0,this._width,this._height);m=r}var q=c.isPOT(this._width)&amp;&amp;c.isPOT(this._height);r=this._renderer.GetMaxTextureSize();if(this._width&gt;r||this._height&gt;r)throw Error("texture data exceeds maximum texture size");r=this._renderer.GetContext();var t=this._renderer.GetWebGLVersionNumber();this._texture=r.createTexture();r.bindTexture(r.TEXTURE_2D,this._texture);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha);n=e(this._pixelFormat,r);if(this._renderer.SupportsNPOTTextures()||q||!this._IsTiled())2&lt;=
t?(r.texStorage2D(r.TEXTURE_2D,this._isMipMapped?Math.floor(Math.log2(Math.max(this._width,this._height))+1):1,n.sizedinternalformat,this._width,this._height),m instanceof ArrayBuffer?r.texSubImage2D(r.TEXTURE_2D,0,0,0,this._width,this._height,n.format,n.type,new Uint8Array(m)):null!==m&amp;&amp;r.texSubImage2D(r.TEXTURE_2D,0,0,0,n.format,n.type,m)):m instanceof ArrayBuffer?r.texImage2D(r.TEXTURE_2D,0,n.internalformat,this._width,this._height,0,n.format,n.type,new Uint8Array(m)):null===m?r.texImage2D(r.TEXTURE_2D,
0,n.internalformat,this._width,this._height,0,n.format,n.type,null):r.texImage2D(r.TEXTURE_2D,0,n.internalformat,n.format,n.type,m);else{if(null===m)throw Error("cannot pass null data when creating a NPOT tiled texture without NPOT support");m instanceof ArrayBuffer&amp;&amp;(m=new ImageData(new Uint8ClampedArray(m),this._width,this._height));m instanceof ImageData&amp;&amp;(q=c.CreateCanvas(this._width,this._height),q.getContext("2d").putImageData(m,0,0),m=q);q=c.CreateCanvas(c.nextHighestPowerOfTwo(this._width),
c.nextHighestPowerOfTwo(this._height));t=q.getContext("2d");t.imageSmoothingEnabled="nearest"!==this._sampling;t.drawImage(m,0,0,this._width,this._height,0,0,q.width,q.height);r.texImage2D(r.TEXTURE_2D,0,n.internalformat,n.format,n.type,q)}null!==m&amp;&amp;this._SetTextureParameters(r);r.bindTexture(r.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;l.add(this)}_CreateDynamic(m,n,r){r=Object.assign({},g,r);if(this._texture)throw Error("already created texture");this._wrapX=r.wrapX;this._wrapY=
r.wrapY;this._sampling=r.sampling;this._pixelFormat=r.pixelFormat;this._isMipMapped=!!r.mipMap&amp;&amp;this._renderer.AreMipmapsEnabled();this._mipMapQuality=r.mipMapQuality;if(!d.has(this._wrapX)||!d.has(this._wrapY))throw Error("invalid wrap mode");if(!a.has(this._sampling))throw Error("invalid sampling");if(!b.has(this._pixelFormat))throw Error("invalid pixel format");if(!f.has(this._mipMapQuality))throw Error("invalid mipmap quality");this._isStatic=!1;this._width=Math.floor(m);this._height=Math.floor(n);
m=c.isPOT(this._width)&amp;&amp;c.isPOT(this._height);n=this._renderer.GetMaxTextureSize();if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid texture size");if(this._width&gt;n||this._height&gt;n)throw Error("texture exceeds maximum texture size");if(!this._renderer.SupportsNPOTTextures()&amp;&amp;this._IsTiled()&amp;&amp;!m)throw Error("non-power-of-two tiled textures not supported");m=this._renderer.GetContext();n=this._renderer.GetWebGLVersionNumber();this._texture=m.createTexture();m.bindTexture(m.TEXTURE_2D,this._texture);
m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha);r=e(this._pixelFormat,m);m.texImage2D(m.TEXTURE_2D,0,2&lt;=n?r.sizedinternalformat:r.internalformat,this._width,this._height,0,r.format,r.type,null);this._SetTextureParameters(m);m.bindTexture(m.TEXTURE_2D,null);this._renderer._ResetLastTexture();this._refCount=1;l.add(this)}_GetMipMapHint(m){if("default"===this._mipMapQuality)return this._isStatic?m.NICEST:m.FASTEST;if("low"===this._mipMapQuality)return m.FASTEST;if("high"===this._mipMapQuality)return m.NICEST;
throw Error("invalid mipmap quality");}_IsTiled(){return"clamp-to-edge"!==this._wrapX||"clamp-to-edge"!==this._wrapY}_GetTextureWrapMode(m,n){if("clamp-to-edge"===n)return m.CLAMP_TO_EDGE;if("repeat"===n)return m.REPEAT;if("mirror-repeat"===n)return m.MIRRORED_REPEAT;throw Error("invalid wrap mode");}_SetTextureParameters(m){var n=c.isPOT(this._width)&amp;&amp;c.isPOT(this._height);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,this._GetTextureWrapMode(m,this._wrapX));m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,
this._GetTextureWrapMode(m,this._wrapY));"nearest"===this._sampling?(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST),this._isMipMapped=!1):(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.LINEAR),(n||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped?(m.hint(m.GENERATE_MIPMAP_HINT,this._GetMipMapHint(m)),m.generateMipmap(m.TEXTURE_2D),n="trilinear"===this._sampling&amp;&amp;!this._renderer.HasMajorPerformanceCaveat(),m.texParameteri(m.TEXTURE_2D,
m.TEXTURE_MIN_FILTER,n?m.LINEAR_MIPMAP_LINEAR:m.LINEAR_MIPMAP_NEAREST)):(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),this._isMipMapped=!1))}_Update(m,n){if(!("undefined"!==typeof HTMLImageElement&amp;&amp;m instanceof HTMLImageElement||"undefined"!==typeof HTMLVideoElement&amp;&amp;m instanceof HTMLVideoElement||"undefined"!==typeof HTMLCanvasElement&amp;&amp;m instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&amp;&amp;m instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&amp;&amp;m instanceof OffscreenCanvas||
m 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");n=Object.assign({},h,n);const r=m.width||m.videoWidth,q=m.height||m.videoHeight;var t=this._renderer.GetWebGLVersionNumber();const u=this._renderer.GetContext();u.bindTexture(u.TEXTURE_2D,this._texture);u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha);u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,
!!n.flipY);n=e(this._pixelFormat,u);t=2&lt;=t?n.sizedinternalformat:n.internalformat;try{if(this._width===r&amp;&amp;this._height===q){const w=c.isPOT(this._width)&amp;&amp;c.isPOT(this._height);u.texSubImage2D(u.TEXTURE_2D,0,0,0,n.format,n.type,m);(w||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped&amp;&amp;(u.hint(u.GENERATE_MIPMAP_HINT,this._GetMipMapHint(u)),u.generateMipmap(u.TEXTURE_2D))}else{this._width=r;this._height=q;const w=c.isPOT(this._width)&amp;&amp;c.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&amp;&amp;
this._IsTiled()&amp;&amp;!w)throw Error("non-power-of-two tiled textures not supported");u.texImage2D(u.TEXTURE_2D,0,t,n.format,n.type,m);(w||this._renderer.SupportsNPOTTextures())&amp;&amp;this._isMipMapped&amp;&amp;(u.hint(u.GENERATE_MIPMAP_HINT,this._GetMipMapHint(u)),u.generateMipmap(u.TEXTURE_2D))}}catch(w){console.error("Error updating WebGL texture: ",w)}u.bindTexture(u.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");
l.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 m=this._width*this._height;
switch(this._pixelFormat){case "rgba8":m*=4;break;case "rgb8":m*=3;break;case "rgba4":case "rgb5_a1":case "rgb565":m*=2}this._isMipMapped&amp;&amp;(m+=Math.floor(m/3));return m}static OnContextLost(){l.clear()}static allTextures(){return l.values()}}}"use strict";
{const c=self.C3,b=new Set(["nearest","bilinear","trilinear"]),a={sampling:"trilinear",alpha:!0,readback:!0,isDefaultSize:!0,multisampling:0},f=new Set;c.Gfx.WebGLRenderTarget=class{constructor(d){this._renderer=d;this._renderBuffer=this._texture=this._frameBuffer=null;this._height=this._width=0;this._isDefaultSize=!0;this._sampling="trilinear";this._readback=this._alpha=!0;this._multisampling=0}_Create(d,e,g){g=Object.assign({},a,g);const h=this._renderer.GetWebGLVersionNumber();if(this._texture||
this._renderBuffer)throw Error("already created render target");this._sampling=g.sampling;this._alpha=!!g.alpha;this._readback=!!g.readback;this._isDefaultSize=!!g.isDefaultSize;this._multisampling=g.multisampling;if(!b.has(this._sampling))throw Error("invalid sampling");if(0&lt;this._multisampling&amp;&amp;(2&gt;h||this._readback))throw Error("invalid use of multisampling");2&gt;h&amp;&amp;(this._readback=!0);this._width=d;this._height=e;if(0&gt;=this._width||0&gt;=this._height)throw Error("invalid render target size");d=this._renderer.GetContext();
this._frameBuffer=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,this._frameBuffer);this._readback?(this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling,pixelFormat:this._alpha?"rgba8":"rgb8",mipMap:!1}),e=this._texture._GetTexture(),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,e,0)):(this._renderBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,this._renderBuffer),e=this._alpha?d.RGBA8:d.RGB8,0&lt;this._multisampling&amp;&amp;
((g=d.getInternalformatParameter(d.RENDERBUFFER,e,d.SAMPLES))&amp;&amp;g[0]?(g=g[0],this._multisampling&gt;g&amp;&amp;(this._multisampling=g)):this._multisampling=0),0===this._multisampling?d.renderbufferStorage(d.RENDERBUFFER,e,this._width,this._height):d.renderbufferStorageMultisample(d.RENDERBUFFER,this._multisampling,e,this._width,this._height),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.RENDERBUFFER,this._renderBuffer),d.bindRenderbuffer(d.RENDERBUFFER,null));d.bindFramebuffer(d.FRAMEBUFFER,null);
f.add(this)}_Resize(d,e){if(this._width!==d||this._height!==e)this._width=d,this._height=e,d=this._renderer.GetContext(),d.bindFramebuffer(d.FRAMEBUFFER,this._frameBuffer),this._texture?this._texture._Update(new ImageData(this._width,this._height)):(d.bindRenderbuffer(d.RENDERBUFFER,this._renderBuffer),d.renderbufferStorage(d.RENDERBUFFER,this._alpha?d.RGBA8:d.RGB8,this._width,this._height),d.bindRenderbuffer(d.RENDERBUFFER,null)),d.bindFramebuffer(d.FRAMEBUFFER,null)}_Delete(){if(!this._texture&amp;&amp;
!this._renderBuffer)throw Error("already deleted render target");f.delete(this);const d=this._renderer.GetContext();d.bindFramebuffer(d.FRAMEBUFFER,this._frameBuffer);this._texture?(d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,null,0),this._renderer.DeleteTexture(this._texture),this._texture=null):this._renderBuffer&amp;&amp;(d.framebufferRenderbuffer(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.RENDERBUFFER,null),d.deleteRenderbuffer(this._renderBuffer),this._renderBuffer=null);d.bindFramebuffer(d.FRAMEBUFFER,
null);2&lt;=this._renderer.GetWebGLVersionNumber()&amp;&amp;(d.bindFramebuffer(d.READ_FRAMEBUFFER,null),d.bindFramebuffer(d.DRAW_FRAMEBUFFER,null));d.deleteFramebuffer(this._frameBuffer);this._frameBuffer=this._renderer.GetBatchState().currentFramebuffer=null}_GetFramebuffer(){return this._frameBuffer}GetWebGLRenderer(){return this._renderer}GetTexture(){return this._texture}IsLinearSampling(){return"nearest"!==this._sampling}HasAlpha(){return this._alpha}IsReadback(){return this._readback}GetWidth(){return this._width}GetHeight(){return this._height}IsDefaultSize(){return this._isDefaultSize}GetMultisampling(){return this._multisampling}GetOptions(){const d=
{sampling:this._sampling,alpha:this._alpha,readback:this._readback};this._isDefaultSize||(d.width=this._width,d.height=this._height);return d}IsCompatibleWithOptions(d){d=Object.assign({},a,d);return"nearest"!==d.sampling!==this.IsLinearSampling()||!!d.alpha!==this.HasAlpha()||2&lt;=this._renderer.GetWebGLVersionNumber()&amp;&amp;!!d.readback!==this.IsReadback()?!1:"number"===typeof d.width||"number"===typeof d.height?!this.IsDefaultSize()&amp;&amp;this.GetWidth()===d.width&amp;&amp;this.GetHeight()===d.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(d,e){d=await d.ReadBackRenderTargetToImageData(e,!0);return await c.ImageDataToBlob(d)}static OnContextLost(){f.clear()}static allRenderTargets(){return f.values()}static ResizeAll(d,e){for(const g of f)g.IsDefaultSize()&amp;&amp;g._Resize(d,e)}}}"use strict";
{const c=self.C3,b=self.glMatrix,a=b.vec3,f=b.mat4,d=new Set("aPos aTex aPoints matP matMV samplerFront samplerBack destStart destEnd srcStart srcEnd srcOriginStart srcOriginEnd pixelSize seconds layerScale layerAngle layoutStart layoutEnd color color2_ pointTexStart pointTexEnd zElevation tileSize tileSpacing outlineThickness".split(" "));c.Gfx.WebGLShaderProgram=class{static async Compile(e,g,h,l){const m=e.GetContext(),n=m.createShader(m.FRAGMENT_SHADER);m.shaderSource(n,g);m.compileShader(n);
g=m.createShader(m.VERTEX_SHADER);m.shaderSource(g,h);m.compileShader(g);const r=m.createProgram();m.attachShader(r,n);m.attachShader(r,g);m.bindAttribLocation(r,0,"aPos");m.bindAttribLocation(r,1,"aTex");m.bindAttribLocation(r,2,"aPoints");m.linkProgram(r);const q=e._GetParallelShaderCompileExtension();q?await e._WaitForObjectReady(()=&gt;m.getProgramParameter(r,q.COMPLETION_STATUS_KHR)):await c.Wait(5);if(!m.getShaderParameter(n,m.COMPILE_STATUS))throw l=m.getShaderInfoLog(n),m.deleteShader(n),m.deleteShader(g),
m.deleteProgram(r),Error("Error compiling fragment shader: "+l);if(!m.getShaderParameter(g,m.COMPILE_STATUS))throw l=m.getShaderInfoLog(g),m.deleteShader(n),m.deleteShader(g),m.deleteProgram(r),Error("Error compiling vertex shader: "+l);if(!m.getProgramParameter(r,m.LINK_STATUS))throw l=m.getProgramInfoLog(r),m.deleteShader(n),m.deleteShader(g),m.deleteProgram(r),Error("Error linking shader program: "+l);(e=c.FilterUnprintableChars(m.getProgramInfoLog(r)||"").trim())&amp;&amp;!c.IsStringAllWhitespace(e)&amp;&amp;
console.info(`[WebGL] Shader program '${l}' compilation log: `,e);m.deleteShader(n);m.deleteShader(g);return r}static async Create(e,g,h,l){h=await c.Gfx.WebGLShaderProgram.Compile(e,g.src,h,l);return new c.Gfx.WebGLShaderProgram(e,h,g,l)}constructor(e,g,h,l){const m=e.GetContext();var n=e.GetBatchState();e.EndBatch();m.useProgram(g);this._gl=m;this._renderer=e;this._name=l;this._shaderProgram=g;this._isDeviceTransform="&lt;default-device-transform&gt;"===l;l=m.getAttribLocation(g,"aPos");const r=m.getAttribLocation(g,
"aTex");g=m.getAttribLocation(g,"aPoints");-1!==l&amp;&amp;(m.bindBuffer(m.ARRAY_BUFFER,e._vertexBuffer),m.vertexAttribPointer(l,e.GetNumVertexComponents(),m.FLOAT,!1,0,0),m.enableVertexAttribArray(l));-1!==r&amp;&amp;(m.bindBuffer(m.ARRAY_BUFFER,e._texcoordBuffer),m.vertexAttribPointer(r,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(r));-1!==g&amp;&amp;(m.bindBuffer(m.ARRAY_BUFFER,e._pointBuffer),m.vertexAttribPointer(g,4,m.FLOAT,!1,0,0),m.enableVertexAttribArray(g));m.bindBuffer(m.ARRAY_BUFFER,null);this._uMatP=new c.Gfx.WebGLShaderUniform(this,
"matP","mat4");this._uMatMV=new c.Gfx.WebGLShaderUniform(this,"matMV","mat4");this._uColor=new c.Gfx.WebGLShaderUniform(this,"color","vec4");this._uSamplerFront=new c.Gfx.WebGLShaderUniform(this,"samplerFront","sampler");this._uPointTexStart=new c.Gfx.WebGLShaderUniform(this,"pointTexStart","vec2");this._uPointTexEnd=new c.Gfx.WebGLShaderUniform(this,"pointTexEnd","vec2");this._uZElevation=new c.Gfx.WebGLShaderUniform(this,"zElevation","float");this._uTileSize=new c.Gfx.WebGLShaderUniform(this,"tileSize",
"vec2");this._uTileSpacing=new c.Gfx.WebGLShaderUniform(this,"tileSpacing","vec2");this._uColor2=new c.Gfx.WebGLShaderUniform(this,"color2_","vec4");this._uOutlineThickness=new c.Gfx.WebGLShaderUniform(this,"outlineThickness","float");this._uSamplerBack=new c.Gfx.WebGLShaderUniform(this,"samplerBack","sampler");this._uDestStart=new c.Gfx.WebGLShaderUniform(this,"destStart","vec2");this._uDestEnd=new c.Gfx.WebGLShaderUniform(this,"destEnd","vec2");this._uSrcStart=new c.Gfx.WebGLShaderUniform(this,
"srcStart","vec2");this._uSrcEnd=new c.Gfx.WebGLShaderUniform(this,"srcEnd","vec2");this._uSrcOriginStart=new c.Gfx.WebGLShaderUniform(this,"srcOriginStart","vec2");this._uSrcOriginEnd=new c.Gfx.WebGLShaderUniform(this,"srcOriginEnd","vec2");this._uPixelSize=new c.Gfx.WebGLShaderUniform(this,"pixelSize","vec2");this._uSeconds=new c.Gfx.WebGLShaderUniform(this,"seconds","float");this._uLayerScale=new c.Gfx.WebGLShaderUniform(this,"layerScale","float");this._uLayerAngle=new c.Gfx.WebGLShaderUniform(this,
"layerAngle","float");this._uLayoutStart=new c.Gfx.WebGLShaderUniform(this,"layoutStart","vec2");this._uLayoutEnd=new c.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._uLayerScale.IsUsed()||this._uLayerAngle.IsUsed()||
this._uLayoutStart.IsUsed()||this._uLayoutEnd.IsUsed());this._extendBoxHorizontal=h.extendBoxHorizontal||0;this._extendBoxVertical=h.extendBoxVertical||0;this._crossSampling=!!h.crossSampling;this._mustPreDraw=!!h.mustPreDraw;this._preservesOpaqueness=!!h.preservesOpaqueness;this._animated=!!h.animated;e=h.parameters||[];this._uCustomParameters=[];this._usesDest=this._uDestStart.IsUsed()||this._uDestEnd.IsUsed();this._usesAnySrcRectOrPixelSize=this._uPixelSize.IsUsed()||this._uSrcStart.IsUsed()||
this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed();this._needsPostDrawOrExtendBox=this._crossSampling||this._usesDest||0!==this._extendBoxHorizontal||0!==this._extendBoxVertical;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._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._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 q of e)e=q[2],h=new c.Gfx.WebGLShaderUniform(this,q[0],e),"color"===e?h.Init3f(0,0,0):h.Init1f(0),this._uCustomParameters.push(h);
this._isDeviceTransform?this._UpdateDeviceTransformUniforms(n.currentMatP):(this.UpdateMatP(n.currentMatP,!0),this.UpdateMatMV(n.currentMV,!0));n=n.currentShader;m.useProgram(n?n._shaderProgram:null)}Release(){this._gl.deleteProgram(this._shaderProgram);this._shaderProgram=null;this._renderer._RemoveShaderProgram(this);this._renderer=this._gl=null}GetName(){return this._name}GetWebGLContext(){return this._gl}GetShaderProgram(){return this._shaderProgram}UsesDest(){return this._usesDest}UsesCrossSampling(){return this._crossSampling}MustPreDraw(){return this._mustPreDraw}PreservesOpaqueness(){return this._preservesOpaqueness}ExtendsBox(){return 0!==
this._extendBoxHorizontal||0!==this._extendBoxVertical}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(e){return this._uCustomParameters[e].GetType()}AreCustomParametersAlreadySetInBatch(e){for(let g=0,h=e.length;g&lt;h;++g)if(!this._uCustomParameters[g].IsSetToCustomInBatch(e[g]))return!1;
return!0}SetCustomParametersInBatch(e){for(let g=0,h=e.length;g&lt;h;++g)this._uCustomParameters[g].SetBatchValueCustom(e[g])}AreOptionalUniformsAlreadySetInBatch(e,g,h,l,m,n,r,q,t){return this._uSamplerBack.IsUsed()||this._uPixelSize.IsUsed()&amp;&amp;!this._uPixelSize.IsSetTo2InBatch(m,n)||this._uDestStart.IsUsed()&amp;&amp;!this._uDestStart.IsSetTo2InBatch(e.getLeft(),e.getTop())||this._uDestEnd.IsUsed()&amp;&amp;!this._uDestEnd.IsSetTo2InBatch(e.getRight(),e.getBottom())||this._uLayerScale.IsUsed()&amp;&amp;!this._uLayerScale.IsSetTo1InBatch(r)||
this._uLayerAngle.IsUsed()&amp;&amp;!this._uLayerAngle.IsSetTo1InBatch(q)||this._uSrcStart.IsUsed()&amp;&amp;!this._uSrcStart.IsSetTo2InBatch(g.getLeft(),g.getTop())||this._uSrcEnd.IsUsed()&amp;&amp;!this._uSrcEnd.IsSetTo2InBatch(g.getRight(),g.getBottom())||this._uSrcOriginStart.IsUsed()&amp;&amp;!this._uSrcOriginStart.IsSetTo2InBatch(h.getLeft(),h.getTop())||this._uSrcOriginEnd.IsUsed()&amp;&amp;!this._uSrcOriginEnd.IsSetTo2InBatch(h.getRight(),h.getBottom())||this._uLayoutStart.IsUsed()&amp;&amp;!this._uLayoutStart.IsSetTo2InBatch(l.getLeft(),
l.getTop())||this._uLayoutEnd.IsUsed()&amp;&amp;!this._uLayoutEnd.IsSetTo2InBatch(l.getTop(),l.getBottom())||this._uSeconds.IsUsed()&amp;&amp;!this._uSeconds.IsSetTo1InBatch(t)?!1:!0}SetOptionalUniformsInBatch(e,g,h,l,m,n,r,q,t){this._uSamplerBack.IsUsed()||(this._uPixelSize.IsUsed()&amp;&amp;this._uPixelSize.SetBatch2(m,n),this._uDestStart.IsUsed()&amp;&amp;this._uDestStart.SetBatch2(e.getLeft(),e.getTop()),this._uDestEnd.IsUsed()&amp;&amp;this._uDestEnd.SetBatch2(e.getRight(),e.getBottom()),this._uLayerScale.IsUsed()&amp;&amp;this._uLayerScale.SetBatch1(r),
this._uLayerAngle.IsUsed()&amp;&amp;this._uLayerAngle.SetBatch1(q),this._uSrcStart.IsUsed()&amp;&amp;this._uSrcStart.SetBatch2(g.getLeft(),g.getTop()),this._uSrcEnd.IsUsed()&amp;&amp;this._uSrcEnd.SetBatch2(g.getRight(),g.getBottom()),this._uSrcOriginStart.IsUsed()&amp;&amp;this._uSrcOriginStart.SetBatch2(h.getLeft(),h.getTop()),this._uSrcOriginEnd.IsUsed()&amp;&amp;this._uSrcOriginEnd.SetBatch2(h.getRight(),h.getBottom()),this._uLayoutStart.IsUsed()&amp;&amp;this._uLayoutStart.SetBatch2(l.getLeft(),l.getTop()),this._uLayoutEnd.IsUsed()&amp;&amp;this._uLayoutEnd.SetBatch2(l.getTop(),
l.getBottom()),this._uSeconds.IsUsed()&amp;&amp;this._uSeconds.SetBatch1(t))}IsAnimated(){return this._animated}UpdateMatP(e,g){this._hasCurrentMatP&amp;&amp;!g||this._isDeviceTransform||(this._uMatP.IsUsed()&amp;&amp;this._uMatP.UpdateMatrix4fv(e),this._hasCurrentMatP=!0)}SetMatPStale(){this._hasCurrentMatP=!1}UpdateMatMV(e,g){this._hasCurrentMatMV&amp;&amp;!g||this._isDeviceTransform||(this._uMatMV.IsUsed()&amp;&amp;this._uMatMV.UpdateMatrix4fv(e),this._hasCurrentMatMV=!0)}SetMatMVStale(){this._hasCurrentMatMV=!1}_UpdateDeviceTransformUniforms(e){if(!this._isDeviceTransform)throw Error("not device transform shader");
this._uMatP.UpdateMatrix4fv(e);e=this._renderer;var g=e.GetWidth()/2,h=e.GetHeight()/2;const l=e._worldScale,m=a.fromValues(g*l[0],h*l[1],100*self.devicePixelRatio);g=a.fromValues(g*l[0],h*l[1],0);h=f.create();f.lookAt(h,m,g,e._up);f.scale(h,h,l);this._uMatMV.UpdateMatrix4fv(h)}UpdateColor(e){this._uColor.IsUsed()&amp;&amp;this._uColor.Update4f(e[0],e[1],e[2],e[3])}static GetReservedUniformNames(){return d}static GetDefaultVertexShaderSource(e,g){g=g?"highmedp":"mediump";return["#ifdef GL_FRAGMENT_PRECISION_HIGH\n#define highmedp highp\n#else\n#define highmedp mediump\n#endif",
`attribute highp ${e?"vec3":"vec2"} aPos;`,`attribute ${g} vec2 aTex;`,`varying ${g} vec2 vTex;`,"uniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {",`	gl_Position = matP * matMV * vec4(aPos, ${e?"":"0.0,"} 1.0);`,"\tvTex = aTex;\n}"].join("\n")}static GetTextureFillFragmentShaderSource(){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 GetTilemapFragmentShaderSource(){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 GetPointVertexShaderSource(){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 GetPointFragmentShaderSource(){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 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 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 c=self.C3,b=new Map([["float",1],["percent",1],["sampler",1],["vec2",2],["vec3",3],["color",3],["vec4",4],["mat4",16]]);function a(f,d){return f[0]===d[0]&amp;&amp;f[1]===d[1]&amp;&amp;f[2]===d[2]&amp;&amp;f[3]===d[3]&amp;&amp;f[4]===d[4]&amp;&amp;f[5]===d[5]&amp;&amp;f[6]===d[6]&amp;&amp;f[7]===d[7]&amp;&amp;f[8]===d[8]&amp;&amp;f[9]===d[9]&amp;&amp;f[10]===d[10]&amp;&amp;f[11]===d[11]&amp;&amp;f[12]===d[12]&amp;&amp;f[13]===d[13]&amp;&amp;f[14]===d[14]&amp;&amp;f[15]===d[15]}c.Gfx.WebGLShaderUniform=class{constructor(f,d,e){if(!b.has(e))throw Error("invalid uniform type");this._owner=f;this._gl=this._owner.GetWebGLContext();
this._name=d;this._type=e;this._isColorType="color"===this._type;this._location=this._gl.getUniformLocation(this._owner.GetShaderProgram(),d);this._isUsed=!!this._location;f=b.get(e);this._lastValue=new Float32Array(f);this._lastBatchValue=new Float32Array(f)}Release(){this._location=this._gl=this._owner=null}IsUsed(){return this._isUsed}GetType(){return this._type}IsColorType(){return this._isColorType}Init1f(f){this.IsUsed()&amp;&amp;(this._lastValue[0]=f,this._lastBatchValue.set(this._lastValue),this._gl.uniform1f(this._location,
f))}Init1i(f){this.IsUsed()&amp;&amp;(this._lastValue[0]=f,this._lastBatchValue.set(this._lastValue),this._gl.uniform1i(this._location,f))}Init2f(f,d){this.IsUsed()&amp;&amp;(this._lastValue[0]=f,this._lastValue[1]=d,this._lastBatchValue.set(this._lastValue),this._gl.uniform2f(this._location,f,d))}Init3f(f,d,e){this.IsUsed()&amp;&amp;(this._lastValue[0]=f,this._lastValue[1]=d,this._lastValue[2]=e,this._lastBatchValue.set(this._lastValue),this._gl.uniform3f(this._location,f,d,e))}Init4f(f,d,e,g){this.IsUsed()&amp;&amp;(this._lastValue[0]=
f,this._lastValue[1]=d,this._lastValue[2]=e,this._lastValue[3]=g,this._lastBatchValue.set(this._lastValue),this._gl.uniform4f(this._location,f,d,e,g))}Update1f(f){f=Math.fround(f);const d=this._lastValue;d[0]!==f&amp;&amp;(d[0]=f,this._gl.uniform1f(this._location,f))}Update1i(f){const d=this._lastValue;d[0]!==f&amp;&amp;(d[0]=f,this._gl.uniform1i(this._location,f))}Update2f(f,d){f=Math.fround(f);d=Math.fround(d);const e=this._lastValue;if(e[0]!==f||e[1]!==d)e[0]=f,e[1]=d,this._gl.uniform2f(this._location,f,d)}Update3f(f,
d,e){f=Math.fround(f);d=Math.fround(d);e=Math.fround(e);const g=this._lastValue;if(g[0]!==f||g[1]!==d||g[2]!==e)g[0]=f,g[1]=d,g[2]=e,this._gl.uniform3f(this._location,f,d,e)}Update4f(f,d,e,g){f=Math.fround(f);d=Math.fround(d);e=Math.fround(e);g=Math.fround(g);const h=this._lastValue;if(h[0]!==f||h[1]!==d||h[2]!==e||h[3]!==g)h[0]=f,h[1]=d,h[2]=e,h[3]=g,this._gl.uniform4f(this._location,f,d,e,g)}UpdateMatrix4fv(f){const d=this._lastValue;a(d,f)||(c.typedArraySet16(d,f,0),this._gl.uniformMatrix4fv(this._location,
!1,f))}IsSetToCustomInBatch(f){const d=this._lastBatchValue;return this.IsColorType()?d[0]===Math.fround(f.getR())&amp;&amp;d[1]===Math.fround(f.getG())&amp;&amp;d[2]===Math.fround(f.getB()):d[0]===Math.fround(f)}SetBatchValueCustom(f){const d=this._lastBatchValue;this.IsColorType()?(d[0]=f.getR(),d[1]=f.getG(),d[2]=f.getB()):d[0]=f}IsSetTo1InBatch(f){return this._lastBatchValue[0]===Math.fround(f)}IsSetTo2InBatch(f,d){const e=this._lastBatchValue;return e[0]===Math.fround(f)&amp;&amp;e[1]===Math.fround(d)}SetBatch1(f){this._lastBatchValue[0]=
f}SetBatch2(f,d){const e=this._lastBatchValue;e[0]=f;e[1]=d}}}"use strict";
{const c=self.C3,b=self.glMatrix,a=b.vec4,f=b.mat4;c.Gfx.BatchState=class{constructor(d){this.renderer=d;this.currentMV=f.create();this.currentMatP=f.create();this.currentFramebuffer=null;this.currentColor=a.fromValues(1,1,1,1);this.currentShader=null;this.pointTexCoords=new c.Rect;this.clearColor=c.New(c.Color,0,0,0,0)}};c.Gfx.WebGLBatchJob=class{constructor(d){const e=new ArrayBuffer(96);this._type=0;this._batchState=d;this._gl=d.renderer.GetContext();this._indexCount=this._startIndex=0;this._texParam=
null;this._mat4param=new Float32Array(e,0,16);this._colorParam=new Float32Array(e,64,4);this._srcOriginRect=new Float32Array(e,80,4);this._shaderParams=[]}InitQuad(d,e){this._type=1;this._startIndex=d;this._indexCount=e}DoQuad(){const d=this._gl;d.drawElements(d.TRIANGLES,this._indexCount,d.UNSIGNED_SHORT,this._startIndex)}InitSetTexture(d){this._type=2;this._texParam=d}DoSetTexture(){const d=this._gl,e=this._texParam;d.bindTexture(d.TEXTURE_2D,e?e._GetTexture():null)}InitSetColor(d){this._type=3;
d.writeToTypedArray(this._colorParam,0)}DoSetColor(){const d=this._colorParam,e=this._batchState;a.copy(e.currentColor,d);e.currentShader.UpdateColor(d)}InitSetGradientColor(d){this._type=19;d.writeToTypedArray(this._colorParam,0)}DoSetGradientColor(){const d=this._colorParam,e=this._batchState.currentShader;e._uColor2.IsUsed()&amp;&amp;e._uColor2.Update4f(d[0],d[1],d[2],d[3])}InitSetBlend(d,e){this._type=4;this._startIndex=d;this._indexCount=e}DoSetBlend(){this._gl.blendFunc(this._startIndex,this._indexCount)}InitUpdateModelView(d){this._type=
5;f.copy(this._mat4param,d)}DoUpdateModelView(){const d=this._batchState,e=d.renderer._allShaderPrograms,g=d.currentShader,h=this._mat4param;for(let l=0,m=e.length;l&lt;m;++l){const n=e[l];n===g?n.UpdateMatMV(h,!0):n.SetMatMVStale()}f.copy(d.currentMV,h)}InitSetRenderTarget(d,e,g){this._type=6;this._texParam=d;this._startIndex=e?1:0;e&amp;&amp;f.copy(this._mat4param,g)}DoSetRenderTarget(){var d=this._gl,e=this._texParam;const g=0!==this._startIndex,h=this._mat4param,l=this._batchState,m=l.renderer;if(e){const n=
e._GetFramebuffer();l.currentFramebuffer=n;d.bindFramebuffer(d.FRAMEBUFFER,n);d=e.GetWidth();e=e.GetHeight()}else l.currentFramebuffer=null,d.bindFramebuffer(d.FRAMEBUFFER,null),d=m.GetScissoredViewportWidth(),e=m.GetScissoredViewportHeight();g&amp;&amp;m._UpdateViewportBatch(d,e,h)}InitClearSurface(d){this._type=7;d.writeToTypedArray(this._mat4param,0)}InitClearSurface2(d,e,g,h){this._type=7;const l=this._mat4param;l[0]=d;l[1]=e;l[2]=g;l[3]=h}DoClearSurface(){const d=this._gl;var e=this._mat4param,g=this._batchState;
const h=g.clearColor;(g=g.renderer._isScissorViewport&amp;&amp;c.isDebug)&amp;&amp;d.disable(d.SCISSOR_TEST);const l=e[0],m=e[1],n=e[2];e=e[3];h.equalsRgba(l,m,n,e)||(d.clearColor(l,m,n,e),h.setRgba(l,m,n,e));d.clear(d.COLOR_BUFFER_BIT);g&amp;&amp;d.enable(d.SCISSOR_TEST)}InitClearRect(d,e,g,h,l,m,n,r){this._type=8;const q=this._mat4param;q[0]=d;q[1]=e;q[2]=g;q[3]=h;q[4]=l;q[5]=m;q[6]=n;q[7]=r}DoClearRectangle(){const d=this._gl;var e=this._mat4param,g=this._batchState;const h=g.renderer;g=g.clearColor;h._isScissorViewport||
d.enable(d.SCISSOR_TEST);d.scissor(e[0],e[1],e[2],e[3]);const l=e[4],m=e[5],n=e[6];e=e[7];g.equalsRgba(l,m,n,e)||(d.clearColor(l,m,n,e),g.setRgba(l,m,n,e));d.clear(d.COLOR_BUFFER_BIT);h._isScissorViewport?d.scissor(0,0,h._viewportScissorWidth,h._viewportScissorHeight):d.disable(d.SCISSOR_TEST)}InitSetPointTexCoords(d){this._type=13;d.writeToTypedArray(this._mat4param,0)}DoSetPointTextureCoords(){const d=this._mat4param;this._batchState.pointTexCoords.set(d[0],d[1],d[2],d[3])}InitPoints(d,e){this._type=
9;this._startIndex=d;this._indexCount=1;this._mat4param[0]=e}DoPoints(){const d=this._gl,e=this._batchState,g=e.renderer._spPoints;d.useProgram(g._shaderProgram);g.UpdateMatP(e.currentMatP,!1);g.UpdateMatMV(e.currentMV,!1);var h=e.pointTexCoords;g._uPointTexStart.IsUsed()&amp;&amp;g._uPointTexStart.Update2f(h.getLeft(),h.getTop());g._uPointTexEnd.IsUsed()&amp;&amp;g._uPointTexEnd.Update2f(h.getRight(),h.getBottom());h=this._mat4param[0];g._uZElevation.IsUsed()&amp;&amp;g._uZElevation.Update1f(h);g._uColor.IsUsed()&amp;&amp;(h=e.currentColor,
g._uColor.Update4f(h[0],h[1],h[2],h[3]));d.drawArrays(d.POINTS,this._startIndex/4,this._indexCount);d.useProgram(e.currentShader._shaderProgram)}InitSetProgram(d){this._type=10;this._texParam=d}DoSetProgram(){var d=this._gl;const e=this._batchState,g=this._texParam;e.currentShader=g;d.useProgram(g._shaderProgram);g.UpdateMatP(e.currentMatP,!1);g.UpdateMatMV(e.currentMV,!1);g._uColor.IsUsed()&amp;&amp;(d=e.currentColor,g._uColor.Update4f(d[0],d[1],d[2],d[3]))}InitSetProgramParameters(){this._type=11}DoSetProgramParameters(){const d=
this._batchState.currentShader;d._hasAnyOptionalUniforms&amp;&amp;this._DoSetOptionalUniformProgramParameters(d);d._uCustomParameters.length&amp;&amp;this._DoUpdateCustomProgramParameters(d)}_DoSetOptionalUniformProgramParameters(d){const e=this._gl,g=this._mat4param,h=this._colorParam,l=this._srcOriginRect;if(d._uSamplerBack.IsUsed()){const m=this._batchState.renderer,n=this._texParam;m._lastTexture1!==n&amp;&amp;(e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,n?n._GetTexture():null),m._lastTexture1=n,e.activeTexture(e.TEXTURE0))}d._uPixelSize.IsUsed()&amp;&amp;
d._uPixelSize.Update2f(g[0],g[1]);d._uDestStart.IsUsed()&amp;&amp;d._uDestStart.Update2f(g[2],g[3]);d._uDestEnd.IsUsed()&amp;&amp;d._uDestEnd.Update2f(g[4],g[5]);d._uLayerScale.IsUsed()&amp;&amp;d._uLayerScale.Update1f(g[6]);d._uLayerAngle.IsUsed()&amp;&amp;d._uLayerAngle.Update1f(g[7]);d._uSrcStart.IsUsed()&amp;&amp;d._uSrcStart.Update2f(g[12],g[13]);d._uSrcEnd.IsUsed()&amp;&amp;d._uSrcEnd.Update2f(g[14],g[15]);d._uSrcOriginStart.IsUsed()&amp;&amp;d._uSrcOriginStart.Update2f(l[0],l[1]);d._uSrcOriginEnd.IsUsed()&amp;&amp;d._uSrcOriginEnd.Update2f(l[2],l[3]);d._uLayoutStart.IsUsed()&amp;&amp;
d._uLayoutStart.Update2f(h[0],h[1]);d._uLayoutEnd.IsUsed()&amp;&amp;d._uLayoutEnd.Update2f(h[2],h[3]);d._uSeconds.IsUsed()&amp;&amp;d._uSeconds.Update1f(this._startIndex)}_DoUpdateCustomProgramParameters(d){d=d._uCustomParameters;const e=this._shaderParams;for(let g=0,h=d.length;g&lt;h;++g){const l=d[g],m=e[g];l.IsColorType()?l.Update3f(m.getR(),m.getG(),m.getB()):l.Update1f(m)}}InitInvalidateFramebuffer(d){this._type=12;this._texParam=d}DoInvalidateFramebuffer(){const d=this._gl,e=this._texParam,g=this._batchState.currentFramebuffer;
e!==g&amp;&amp;d.bindFramebuffer(d.FRAMEBUFFER,e);d.invalidateFramebuffer(d.FRAMEBUFFER,[d.COLOR_ATTACHMENT0]);e!==g&amp;&amp;d.bindFramebuffer(d.FRAMEBUFFER,g)}InitBlitFramebuffer(d,e,g){this._type=15;const h=this._mat4param,l=this._batchState.renderer;h[0]=d.GetWidth();h[1]=d.GetHeight();h[2]=e?e.GetWidth():l.GetWidth();h[3]=e?e.GetHeight():l.GetHeight();h[4]=d.IsLinearSampling()?1:0;h[5]="stretch"===g;g=this._shaderParams;c.clearArray(g);g.push(d._GetFramebuffer());g.push(e?e._GetFramebuffer():null)}DoBlitFramebuffer(){var d=
this._mat4param,e=this._shaderParams;const g=this._gl;var h=d[0],l=d[1],m=d[2];const n=d[3],r=0!==d[4];d=0!==d[5];const q=e[1];g.bindFramebuffer(g.READ_FRAMEBUFFER,e[0]);g.bindFramebuffer(g.DRAW_FRAMEBUFFER,q);d?g.blitFramebuffer(0,0,h,l,0,0,m,n,g.COLOR_BUFFER_BIT,r?g.LINEAR:g.NEAREST):(e=Math.min(h,m),h=Math.min(l,n),m=Math.max(l-n,0),l=Math.max(n-l,0),g.blitFramebuffer(0,m,e,h+m,0,l,e,h+l,g.COLOR_BUFFER_BIT,g.NEAREST))}InitStartQuery(d){this._type=16;this._texParam=d}DoStartQuery(){this._texParam.BeginTimeElapsed();
this._texParam=null}InitEndQuery(d){this._type=17;this._texParam=d}DoEndQuery(){this._texParam.EndTimeElapsed();this._texParam=null}InitSetEllipseParams(d,e,g){this._type=18;const h=this._mat4param;h[0]=d;h[1]=e;h[2]=g}DoSetEllipseParams(){const d=this._batchState.currentShader,e=this._mat4param;d._uPixelSize.IsUsed()&amp;&amp;d._uPixelSize.Update2f(e[0],e[1]);d._uOutlineThickness.IsUsed()&amp;&amp;d._uOutlineThickness.Update1f(e[2])}InitSetTilemapInfo(d,e,g,h,l,m,n){this._type=14;const r=this._mat4param;d.writeToTypedArray(r,
0);r[4]=1/e;r[5]=1/g;r[6]=h/e;r[7]=l/g;r[8]=m/e;r[9]=n/g}DoSetTilemapInfo(){const d=this._batchState.currentShader,e=this._mat4param;d._uSrcStart.IsUsed()&amp;&amp;d._uSrcStart.Update2f(e[0],e[1]);d._uPixelSize.IsUsed()&amp;&amp;d._uPixelSize.Update2f(e[4],e[5]);d._uTileSize.IsUsed()&amp;&amp;d._uTileSize.Update2f(e[6],e[7]);d._uTileSpacing.IsUsed()&amp;&amp;d._uTileSpacing.Update2f(e[8],e[9])}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.DoUpdateModelView();break;case 6:this.DoSetRenderTarget();break;case 7:this.DoClearSurface();break;case 8:this.DoClearRectangle();break;case 9:this.DoPoints();break;case 10:this.DoSetProgram();break;case 11:this.DoSetProgramParameters();break;case 12:this.DoInvalidateFramebuffer();break;case 13:this.DoSetPointTextureCoords();break;case 14:this.DoSetTilemapInfo();break;case 15:this.DoBlitFramebuffer();break;case 16:this.DoStartQuery();break;case 17:this.DoEndQuery();break;case 18:this.DoSetEllipseParams();
break;case 19:this.DoSetGradientColor()}}}}"use strict";
{const c=self.C3,b={timeout:60},a=new c.Color(0,0,0,1),f=new Set(["left","center","right"]),d=new Set(["top","center","bottom"]),e=new Set(["word","character"]),g=new Set;c.FontManager&amp;&amp;c.FontManager.addEventListener("fontload",n=&gt;{n=n.font.GetName();for(const r of g)(r.IsBBCodeEnabled()||c.equalsNoCase(r.GetFontName(),n))&amp;&amp;r._SetTextChanged()});function h(n,r,q,t,u,w){r?"Gecko"===c.Platform.BrowserEngine?n.strokeText(q,t,u,w):n.strokeText(q,t,u):"Gecko"===c.Platform.BrowserEngine?n.fillText(q,t,
u,w):n.fillText(q,t,u)}function l(n,r,q,t,u,w){r?n.strokeRect(q,t,u,w):n.fillRect(q,t,u,w)}function m(n){return 4/3*n}c.Gfx.RendererText=class{constructor(n,r){r=Object.assign({},b,r);this._renderer=n;this._fontName="Arial";this._fontSize=16;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=
c.New(c.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._measureContext=this._textContext=this._textCanvas=null;this._lastCanvasHeight=this._lastCanvasWidth=-1;this._lastTextCanvasFillStyle=this._lastMeasureCanvasFont=this._lastTextCanvasFont="";this._lastTextCanvasLineWidth=this._lastTextCanvasOpacity=1;this._measureTextCallback=
(q,t)=&gt;this._MeasureText(q,t);this._texture=null;this._textureHeight=this._textureWidth=0;this._rcTex=new c.Rect;this._scaleFactor=1;this._needToRecreateTexture=!1;this._textureTimeout=new c.IdleTimeout(()=&gt;{this.ReleaseTexture();this._SetTextCanvasSize(8,8)},r.timeout);this.ontextureupdate=null;this._wasReleased=!1;g.add(this)}Release(){this.onloadfont=null;this._alreadyLoadedFonts.clear();this._measureTextCallback=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;g.delete(this)}_SetChanged(){this._changed=!0}_SetTextChanged(){this._SetChanged();this._wrappedText.Clear();this._textChanged=!0}SetIsAsync(n){this._isAsync=!!n}IsAsync(){return this._isAsync}SetBBCodeEnabled(n){n=!!n;this._isBBcodeEnabled!==n&amp;&amp;(this._isBBcodeEnabled=n,this._textContext&amp;&amp;(this._textContext.textBaseline=this._isBBcodeEnabled?"alphabetic":"top"),this._SetTextChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetFontName(n){n||
(n="serif");this._fontName!==n&amp;&amp;(this._fontName=n,this._SetTextChanged())}GetFontName(){return this._fontName}SetFontSize(n){.1&gt;n&amp;&amp;(n=.1);this._fontSize!==n&amp;&amp;(this._fontSize=n,this._SetTextChanged())}SetLineHeight(n){this._lineHeight!==n&amp;&amp;(this._lineHeight=n,this._SetChanged())}SetBold(n){n=!!n;this._isBold!==n&amp;&amp;(this._isBold=n,this._SetTextChanged())}SetItalic(n){n=!!n;this._isItalic!==n&amp;&amp;(this._isItalic=n,this._SetTextChanged())}SetDrawMaxCharacterCount(n){n=Math.floor(n);this._drawMaxCharCount!==
n&amp;&amp;(this._drawMaxCharCount=n,this._SetChanged())}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(n,r){for(let q=n.length-1;0&lt;=q;--q){const t=n[q];if(t.tag===r)return t}return null}_HasStyleTag(n,r){return!!this._GetStyleTag(n,r)}_GetFontString(n,r){let q="";if(this._isBold||this._HasStyleTag(r,"b"))q+="bold";if(this._isItalic||this._HasStyleTag(r,"i"))q+=" italic";var t=this._GetStyleTag(r,"size");t=t?parseFloat(t.param):this._fontSize;q=n?q+(" "+t+"pt"):q+(" "+t*this._scaleFactor*
this._zoom*self.devicePixelRatio+"pt");n=this._fontName;(r=this._GetStyleTag(r,"font"))&amp;&amp;r.param&amp;&amp;(n=r.param,this.onloadfont&amp;&amp;!this._alreadyLoadedFonts.has(n)&amp;&amp;(this.onloadfont(n),this._alreadyLoadedFonts.add(n)));n&amp;&amp;(q+=' "'+n+'"');return q}SetColor(n){n instanceof c.Color&amp;&amp;(n=n.getCssRgb());this._colorStr!==n&amp;&amp;(this._colorStr=n,this._SetChanged())}SetColorRgb(n,r,q){a.setRgb(n,r,q);this.SetColor(a)}SetHorizontalAlignment(n){if(!f.has(n))throw Error("invalid horizontal alignment");this._horizontalAlign!==
n&amp;&amp;(this._horizontalAlign=n,this._SetChanged())}SetVerticalAlignment(n){if(!d.has(n))throw Error("invalid vertical alignment");this._verticalAlign!==n&amp;&amp;(this._verticalAlign=n,this._SetChanged())}SetWordWrapMode(n){if(!e.has(n))throw Error("invalid word wrap mode");this._wrapMode!==n&amp;&amp;(this._wrapMode=n,this._SetTextChanged())}SetText(n){this._text!==n&amp;&amp;(this._text=n,this._SetTextChanged())}SetSize(n,r,q){"undefined"===typeof q&amp;&amp;(q=1);if(!(0&gt;=n||0&gt;=n||this._cssWidth===n&amp;&amp;this._cssHeight===r&amp;&amp;this._zoom===
q)){1===this._zoom!==(1===q)&amp;&amp;(this._needToRecreateTexture=!0);var t=this._cssWidth,u=this._zoom;this._cssWidth=n;this._cssHeight=r;this._zoom=q;n=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*n;this._height=this._cssHeight*this._zoom*n;n=Math.max(this._width,this._height);r=Math.min(this._renderer.GetMaxTextureSize(),2048);q=1;n&gt;r&amp;&amp;(q=r/n,this._width=Math.min(this._width*q,r),this._height=Math.min(this._height*q,r));this._scaleFactor=q;0&lt;this._textureWidth&amp;&amp;0&lt;this._textureHeight&amp;&amp;this._zoom===
u&amp;&amp;this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight);this._cssWidth!==t?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?c.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(n,r){this._textCanvas||
(this._textCanvas=c.CreateCanvas(16,16));let q=!1;if(this._lastCanvasWidth!==n||this._lastCanvasHeight!==r)this._lastCanvasWidth=n,this._lastCanvasHeight=r,this._textCanvas.width=n,this._textCanvas.height=r,q=!0;this._textContext||(this._textContext=this._textCanvas.getContext("2d"),q=!0);q?(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,n,r)}_MaybeCreateMeasureContext(){this._measureContext||(this._measureContext=c.CreateCanvas(16,16).getContext("2d"))}_SetMeasureFontString(n){this._lastMeasureCanvasFont!==n&amp;&amp;(this._lastMeasureCanvasFont=n,this._measureContext.font=n)}_MaybeWrapText(){this._textChanged&amp;&amp;(this._MaybeCreateMeasureContext(),!this._isBBcodeEnabled||
this._bbString&amp;&amp;this._bbString.toString()===this._text||(this._bbString=new c.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(n,r){this._SetMeasureFontString(this._GetFontString(!0,r));r=(r=this._GetStyleTag(r,"size"))?parseFloat(r.param):this._fontSize;return{width:this._measureContext.measureText(n).width,height:m(r)}}_SetDrawFontString(n){this._lastTextCanvasFont!==
n&amp;&amp;(this._lastTextCanvasFont=n,this._textContext.font=n)}_SetDrawCanvasColor(n){this._lastTextCanvasFillStyle!==n&amp;&amp;(this._lastTextCanvasFillStyle=n,this._textContext.fillStyle=n,this._textContext.strokeStyle=n)}_SetDrawCanvasOpacity(n){this._lastTextCanvasOpacity!==n&amp;&amp;(this._lastTextCanvasOpacity=n,this._textContext.globalAlpha=n)}_SetDrawCanvasLineWith(n){this._lastTextCanvasLineWidth!==n&amp;&amp;(this._lastTextCanvasLineWidth=n,this._textContext.lineWidth=n)}_DrawTextToCanvas(){this._drawCharCount=0;const n=
this._scaleFactor*this._zoom*self.devicePixelRatio,r=(4+this._lineHeight)*n;let q=0;const t=this._wrappedText.GetLines();var u=t.reduce((w,y)=&gt;w+y.height*n+r,0)-this._lineHeight*n;"center"===this._verticalAlign?q=Math.max(this._height/2-u/2,0):"bottom"===this._verticalAlign&amp;&amp;(q=this._height-u-2);for(let w=0,y=t.length;w&lt;y;++w){u=t[w];const C=u.height*n,G=q;if(this._isBBcodeEnabled){if(q+=C,0&lt;w&amp;&amp;q&gt;this._height-4*n)break}else if(0&lt;w&amp;&amp;q&gt;=this._height-C)break;0&lt;=G&amp;&amp;this._DrawTextLine(u,q,n);this._isBBcodeEnabled||
(q+=C);q+=r}}_DrawTextLine(n,r,q){let t=0;"center"===this._horizontalAlign?t=(this._width-n.width*q)/2:"right"===this._horizontalAlign&amp;&amp;(t=this._width-n.width*q);for(const u of n.fragments)this._DrawTextFragment(u,t,r,q,n.height),t+=u.width*q}_DrawTextFragment(n,r,q,t,u){const w=this._textContext,y=u/16;u=n.width*t;const C=n.height*t,G=n.height/16;var x=(4+this._lineHeight)*t;const B=n.styles;n=n.text;if(-1!==this._drawMaxCharCount){if(this._drawCharCount&gt;=this._drawMaxCharCount)return;this._drawCharCount+
n.length&gt;this._drawMaxCharCount&amp;&amp;(n=n.substr(0,this._drawMaxCharCount-this._drawCharCount),u=this._MeasureText(n,B).width*t);this._drawCharCount+=n.length}const H=this._GetStyleTag(B,"background"),P=this._HasStyleTag(B,"u"),E=this._HasStyleTag(B,"s");if((!c.IsStringAllWhitespace(n)||H||P||E)&amp;&amp;!this._HasStyleTag(B,"hide")){var J=this._GetStyleTag(B,"offsetx");r+=J?parseFloat(J.param)*t:0;J=this._GetStyleTag(B,"offsety");q+=J?parseFloat(J.param)*t:0;H&amp;&amp;(this._SetDrawCanvasColor(H.param),w.fillRect(r,
q-C,u,C+x));x=this._GetStyleTag(B,"color");this._SetDrawCanvasColor(x?x.param:this._colorStr);x=this._GetStyleTag(B,"opacity");this._SetDrawCanvasOpacity(x?parseFloat(x.param)/100:1);(x=this._HasStyleTag(B,"stroke"))&amp;&amp;this._SetDrawCanvasLineWith(G*this._scaleFactor*this._zoom);P&amp;&amp;l(w,x,r,q+t*y,u,t*y);E&amp;&amp;l(w,x,r,q-C/4,u,t*G);this._SetDrawFontString(this._GetFontString(!1,B));h(w,x,n,r,q,u);!x&amp;&amp;(this._SetDrawCanvasLineWith(G*this._scaleFactor*this._zoom),t=this._GetStyleTag(B,"outline"))&amp;&amp;(this._SetDrawCanvasColor(t.param),
h(w,!0,n,r,q,u))}}_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 n of g)n.ReleaseTexture()}static GetAll(){return g.values()}}}"use strict";
{const c=self.C3;class b{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 f=this._gl.getParameter(this._timerExt.GPU_DISJOINT_EXT);a&amp;&amp;!f&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||
f)&amp;&amp;this._DeleteQueryObject()}}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw Error("no result available");return this._result}}c.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 b&amp;&amp;a.Release();c.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[a.length-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=c.New(b,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,f)=&gt;a+f.GetResult(),0)}GetFrameNumber(){return this._frameNumber}}}"use strict";
{const c=self.C3;c.Gfx.WebGLQueryResultBuffer=class{constructor(b,a=1E3){this._renderer=b;this._maxQueries=a;this._buffer=[];this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear();this._renderer._RemoveQueryResultBuffer(this);this._renderer=null}Clear(){for(const b of this._buffer)b.Release();c.clearArray(this._buffer)}AddTimeElapsedQuery(){const b=new c.Gfx.WebGLTimeElapsedQuery(this._renderer);this._buffer.push(b);this._buffer.length&gt;this._maxQueries&amp;&amp;this._buffer.shift().Release();return b}CheckForResults(b){for(const a of this._buffer){if(a.GetFrameNumber()&gt;=
b)break;if(a.IsNested())break;a.CheckForResult()}}GetFrameRangeResultSum(b,a){if(a&lt;=b)return NaN;let f=0;for(const d of this._buffer){if(d.GetFrameNumber()&gt;=a)break;if(!(d.GetFrameNumber()&lt;b))if(d.HasResult())f+=d.GetResult();else return NaN}return f}DeleteAllBeforeFrameNumber(b){for(let a=0,f=this._buffer.length;a&lt;f;++a){const d=this._buffer[a];if(d.GetFrameNumber()&lt;b)d.Release();else{0&lt;a&amp;&amp;this._buffer.splice(0,a);break}}}}}"use strict";
{const c=self.C3,b=self.glMatrix,a=b.vec3,f=b.vec4,d=b.mat4,e={powerPreference:"default",enableGpuProfiling:!0,alpha:!1,lowLatency:!1,maxWebGLVersion:2},g=new Set(["default","low-power","high-performance"]);function h(x,B){return x[0]===B[0]&amp;&amp;x[1]===B[1]&amp;&amp;x[2]===B[2]&amp;&amp;x[3]===B[3]&amp;&amp;x[4]===B[4]&amp;&amp;x[5]===B[5]&amp;&amp;x[6]===B[6]&amp;&amp;x[7]===B[7]&amp;&amp;x[8]===B[8]&amp;&amp;x[9]===B[9]&amp;&amp;x[10]===B[10]&amp;&amp;x[11]===B[11]&amp;&amp;x[12]===B[12]&amp;&amp;x[13]===B[13]&amp;&amp;x[14]===B[14]&amp;&amp;x[15]===B[15]}const l=new c.Quad(0,0,1,0,1,1,0,1),m=a.fromValues(0,
0,0),n=a.fromValues(0,0,0),r=d.create(),q=new c.Quad,t=new c.Rect;let u=null;c.isDebug&amp;&amp;(self.debug_lose_context=function(){u?u.loseContext():console.warn("WEBGL_lose_context not supported")},self.debug_restore_context=function(){u?u.restoreContext():console.warn("WEBGL_lose_context not supported")});const w=new Set;let y=-1;function C(){y=-1;for(const x of w)x.checkFunc()&amp;&amp;(x.resolve(),w.delete(x));0&lt;w.size&amp;&amp;(y=self.requestAnimationFrame(C))}function G(x,B,H){if(2&lt;=H&amp;&amp;(H=x.getContext("webgl2",B)))return{gl:H,
version:2};H=x.getContext("webgl",B);if(!H)try{H=x.getContext("experimental-webgl",B)}catch(P){console.warn("Error requesting 'experimental-webgl' context: ",P)}return{gl:H,version:1}}c.Gfx.WebGLRenderer=class extends c.Gfx.RendererBase{constructor(x,B){super();B=Object.assign({},e,B);if(!g.has(B.powerPreference))throw Error("invalid power preference");let H=!1;const P={alpha:!!B.alpha,depth:!1,antialias:!1,powerPreference:B.powerPreference,failIfMajorPerformanceCaveat:!0};B.lowLatency&amp;&amp;(P.desynchronized=
!0,P.preserveDrawingBuffer=!0);let E=G(x,P,B.maxWebGLVersion);E.gl||(H=!0,P.failIfMajorPerformanceCaveat=!1,E=G(x,P,B.maxWebGLVersion));if(!E.gl)throw Error("failed to initialise WebGL context");this._gl=x=E.gl;this._attribs=x.getContextAttributes();B.lowLatency&amp;&amp;!this._attribs.desynchronized&amp;&amp;console.info("[WebGLRenderer] Low-latency mode specified but is not supported here");this._versionString=x.getParameter(x.VERSION);this._version=E.version;this._is3d=!0;this._lastBackbufferHeight=this._lastBackbufferWidth=
0;this._pointBuffer=this._indexBuffer=this._texcoordBuffer=this._vertexBuffer=null;this._vertexData=new Float32Array(8E3*this.GetNumVertexComponents());this._indexData=new Uint16Array(12E3);this._texcoordData=new Float32Array(16E3);this._pointData=new Float32Array(32E3);this._lastVertexPtr=this._pointPtr=this._texPtr=this._vertexPtr=0;this._spTilemapFill=this._spPoints=this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=this._spHardEllipseFill=
this._spLinearGradientFill=this._spColorFill=this._spDeviceTransformTextureFill=this._lastProgram=null;this._batch=[];this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=null;this._lastPointZ=this._currentZ=this._baseZ=0;this._batchState=c.New(c.Gfx.BatchState,this);this._lastColor=c.New(c.Color,1,1,1,1);this._lastTexture1=this._lastTexture0=null;this._lastDestBlend=this._lastSrcBlend=0;this._lineWidth=1;this._lineWidthStack=[this._lineWidth];this._lineCap=1;this._lineCapStack=[this._lineCap];
this._lineOffset=.5;this._lineOffsetStack=[this._lineOffset];this._isScissorViewport=!1;this._viewportScissorHeight=this._viewportScissorWidth=-1;this._lastPointTexCoords=new c.Rect;this._maxTextureSize=-1;this._highpPrecision=this._maxPointSize=this._minPointSize=0;this._unmaskedRenderer=this._unmaskedVendor="(unavailable)";this._extensions=[];this._hasMajorPerformanceCaveat=H;this._isInitialisingAfterContextRestored=!1;this._parallelShaderCompileExt=null;this._isGpuProfilingEnabled=!!B.enableGpuProfiling;
this._timerExt=null;this._allQueryResultBuffers=new Set;this._timeQueryStack=[];this.FillIndexBufferData(this._indexData)}async InitState(){var x=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;c.clearArray(this._batch);this._topOfBatch=this._batchPtr=0;this._currentRenderTarget=this._lastProgram=null;this._lastPointTexCoords.set(0,0,1,1);this._lastPointZ=this._currentZ=
this._baseZ=0;B=this._batchState;B.currentShader=null;B.currentFramebuffer=null;f.set(B.currentColor,1,1,1,1);B.clearColor.setRgba(0,0,0,0);B.pointTexCoords.set(0,0,1,1);x.clearColor(0,0,0,0);x.clear(x.COLOR_BUFFER_BIT);x.enable(x.BLEND);x.blendFunc(x.ONE,x.ONE_MINUS_SRC_ALPHA);this._lastSrcBlend=x.ONE;this._lastDestBlend=x.ONE_MINUS_SRC_ALPHA;this._InitBlendModes(x);x.disable(x.CULL_FACE);x.disable(x.STENCIL_TEST);x.disable(x.DITHER);x.disable(x.DEPTH_TEST);this._pointBuffer=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,
this._pointBuffer);x.bufferData(x.ARRAY_BUFFER,this._pointData.byteLength,x.DYNAMIC_DRAW);this._vertexBuffer=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,this._vertexBuffer);x.bufferData(x.ARRAY_BUFFER,this._vertexData.byteLength,x.DYNAMIC_DRAW);this._texcoordBuffer=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,this._texcoordBuffer);x.bufferData(x.ARRAY_BUFFER,this._texcoordData.byteLength,x.DYNAMIC_DRAW);this._indexBuffer=x.createBuffer();x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,this._indexBuffer);x.bufferData(x.ELEMENT_ARRAY_BUFFER,
this._indexData,x.STATIC_DRAW);x.activeTexture(x.TEXTURE0);x.bindTexture(x.TEXTURE_2D,null);this._maxTextureSize=x.getParameter(x.MAX_TEXTURE_SIZE);B=x.getParameter(x.ALIASED_POINT_SIZE_RANGE);this._minPointSize=B[0];this._maxPointSize=B[1];B=x.getShaderPrecisionFormat(x.VERTEX_SHADER,x.HIGH_FLOAT);const H=x.getShaderPrecisionFormat(x.FRAGMENT_SHADER,x.HIGH_FLOAT);this._highpPrecision=B&amp;&amp;H?Math.min(B.precision,H.precision):0;2048&lt;this._maxPointSize&amp;&amp;(this._maxPointSize=2048);this._extensions=x.getSupportedExtensions();
if(B=x.getExtension("WEBGL_debug_renderer_info"))this._unmaskedVendor=x.getParameter(B.UNMASKED_VENDOR_WEBGL),this._unmaskedRenderer=x.getParameter(B.UNMASKED_RENDERER_WEBGL);this._parallelShaderCompileExt=x.getExtension("KHR_parallel_shader_compile");c.isDebug&amp;&amp;(u=x.getExtension("WEBGL_lose_context"));if(this._isGpuProfilingEnabled)if(1===this.GetWebGLVersionNumber()){if("Chromium"!==c.Platform.BrowserEngine||81&lt;=c.Platform.BrowserVersionNumber||"undefined"!==typeof document)this._timerExt=x.getExtension("EXT_disjoint_timer_query")}else this._timerExt=
x.getExtension("EXT_disjoint_timer_query_webgl2")||x.getExtension("EXT_disjoint_timer_query");this._ClearAllShaderPrograms();x=c.Gfx.WebGLShaderProgram;B=x.GetDefaultVertexShaderSource(this._is3d,!1);x=[[x.GetTextureFillFragmentShaderSource(),B,"&lt;default&gt;"],[x.GetTextureFillFragmentShaderSource(),B,"&lt;default-device-transform&gt;"],[x.GetPointFragmentShaderSource(),x.GetPointVertexShaderSource(),"&lt;point&gt;"],[x.GetColorFillFragmentShaderSource(),B,"&lt;fill&gt;"],[x.GetLinearGradientFillFragmentShaderSource(),
B,"&lt;lineargradient&gt;"],[x.GetHardEllipseFillFragmentShaderSource(),B,"&lt;hardellipse&gt;"],[x.GetHardEllipseOutlineFragmentShaderSource(),B,"&lt;hardellipseoutline&gt;"],[x.GetSmoothEllipseFillFragmentShaderSource(),B,"&lt;smoothellipse&gt;"],[x.GetSmoothEllipseOutlineFragmentShaderSource(),B,"&lt;smoothellipseoutline&gt;"],[x.GetSmoothLineFillFragmentShaderSource(),B,"&lt;smoothline&gt;"],[x.GetTilemapFragmentShaderSource(),x.GetDefaultVertexShaderSource(this._is3d,!0),"&lt;tilemap&gt;"]];x=await Promise.all(x.map(P=&gt;this.CreateShaderProgram({src:P[0]},
P[1],P[2])));this._spTextureFill=x[0];this._spDeviceTransformTextureFill=x[1];this._spPoints=x[2];this._spColorFill=x[3];this._spLinearGradientFill=x[4];this._spHardEllipseFill=x[5];this._spHardEllipseOutline=x[6];this._spSmoothEllipseFill=x[7];this._spSmoothEllipseOutline=x[8];this._spSmoothLineFill=x[9];this._spTilemapFill=x[10];this._currentStateGroup=null;this.SetTextureFillMode()}Is3D(){return this._is3d}GetNumVertexComponents(){return this._is3d?3:2}SetBaseZ(x){this._baseZ=x}GetBaseZ(){return this._baseZ}SetCurrentZ(x){this._currentZ=
x;this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}async CreateShaderProgram(x,B,H){x=await c.Gfx.WebGLShaderProgram.Create(this,x,B,H);this._AddShaderProgram(x);return x}ResetLastProgram(){this._lastProgram=null}SetSize(x,B,H){if(this._width!==x||this._height!==B||H){this.EndBatch();H=this._gl;var P=this._batchState;this._width=x;this._height=B;x=this.GetScissoredViewportWidth();B=this.GetScissoredViewportHeight();this._UpdateViewportRenderer(x,B,this._width,this._height);this._UpdateViewportBatch(x,
B,this._matP);this._spDeviceTransformTextureFill&amp;&amp;(H.useProgram(this._spDeviceTransformTextureFill.GetShaderProgram()),this._spDeviceTransformTextureFill._UpdateDeviceTransformUniforms(this._matP),this._lastProgram=this._spDeviceTransformTextureFill,this._batchState.currentShader=this._spDeviceTransformTextureFill);H.bindTexture(H.TEXTURE_2D,null);H.activeTexture(H.TEXTURE1);H.bindTexture(H.TEXTURE_2D,null);H.activeTexture(H.TEXTURE0);this._lastTexture1=this._lastTexture0=null;this._currentRenderTarget&amp;&amp;
this._currentRenderTarget._Resize(this._width,this._height);H.bindFramebuffer(H.FRAMEBUFFER,null);this._currentRenderTarget=null;P.currentFramebuffer=null}}_UpdateViewportRenderer(x,B,H,P){this._cam[2]=100;d.lookAt(this._matMV,this._cam,this._look,this._up);d.perspective(this._matP,45,x/B,this.GetNearZ(),this.GetFarZ());const E=[0,0],J=[0,0],O=self.devicePixelRatio;this.Project(0,0,x,B,E);this.Project(1,1,x,B,J);this._worldScale[0]=O/(J[0]-E[0]);this._worldScale[1]=-O/(J[1]-E[1]);this._lastBackbufferWidth=
H;this._lastBackbufferHeight=P}_UpdateViewportBatch(x,B,H){const P=this._batchState;this._gl.viewport(0,0,x,B);x=this._allShaderPrograms;B=P.currentShader;for(let E=0,J=x.length;E&lt;J;++E){const O=x[E];O===B?O.UpdateMatP(H,!0):O.SetMatPStale()}d.copy(P.currentMatP,H)}SetViewportScissor(x,B){const H=this._gl;if(this._width===x&amp;&amp;this._height===B)this._isScissorViewport&amp;&amp;(this.EndBatch(),H.disable(H.SCISSOR_TEST),this._isScissorViewport=!1,this._viewportScissorHeight=this._viewportScissorWidth=-1,this.SetSize(this._width,
this._height,!0));else if(this._isScissorViewport||(this.EndBatch(),H.enable(H.SCISSOR_TEST),this._isScissorViewport=!0),this._viewportScissorWidth!==x||this._viewportScissorHeight!==B)this.EndBatch(),H.scissor(0,0,x,B),this._viewportScissorWidth=x,this._viewportScissorHeight=B,this.SetSize(this._width,this._height,!0)}RemoveViewportScissor(){const x=this._gl;this._isScissorViewport&amp;&amp;(this.EndBatch(),x.disable(x.SCISSOR_TEST),this._isScissorViewport=!1);this._viewportScissorHeight=this._viewportScissorWidth=
-1}GetScissoredViewportWidth(){return this._isScissorViewport?this._viewportScissorWidth:this.GetWidth()}GetScissoredViewportHeight(){return this._isScissorViewport?this._viewportScissorHeight:this.GetHeight()}UpdateModelView(){h(this._lastMV,this._matMV)||(this.PushBatch().InitUpdateModelView(this._matMV),d.copy(this._lastMV,this._matMV),this._topOfBatch=0)}GetBatchState(){return this._batchState}PushBatch(){const x=this._batch;this._batchPtr===x.length&amp;&amp;x.push(new c.Gfx.WebGLBatchJob(this._batchState));
return x[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 x=this._gl;0&lt;this._pointPtr&amp;&amp;(x.bindBuffer(x.ARRAY_BUFFER,this._pointBuffer),x.bufferSubData(x.ARRAY_BUFFER,0,this._pointData.subarray(0,this._pointPtr)));0&lt;this._vertexPtr&amp;&amp;(x.bindBuffer(x.ARRAY_BUFFER,this._vertexBuffer),x.bufferSubData(x.ARRAY_BUFFER,0,this._vertexData.subarray(0,
this._vertexPtr)),x.bindBuffer(x.ARRAY_BUFFER,this._texcoordBuffer),x.bufferSubData(x.ARRAY_BUFFER,0,this._texcoordData.subarray(0,this._texPtr)))}_ExecuteBatch(){const x=this._batch;for(let B=0,H=this._batchPtr;B&lt;H;++B)x[B].Run()}GetOpacity(){return this._lastColor.getA()}SetColorRgba(x,B,H,P){const E=this._lastColor;E.equalsRgba(x,B,H,P)||(E.setRgba(x,B,H,P),this.PushBatch().InitSetColor(E),this._topOfBatch=0,this._currentStateGroup=null)}SetOpacity(x){const B=this._lastColor;B.getA()!==x&amp;&amp;(B.setA(x),
this.PushBatch().InitSetColor(B),this._topOfBatch=0,this._currentStateGroup=null)}SetColor(x){const B=this._lastColor;B.equals(x)||(B.set(x),this.PushBatch().InitSetColor(B),this._topOfBatch=0,this._currentStateGroup=null)}ResetColor(){this.SetColorRgba(1,1,1,1)}GetColor(){return this._lastColor}SetTexture(x){x!==this._lastTexture0&amp;&amp;(this.PushBatch().InitSetTexture(x),this._lastTexture0=x,this._topOfBatch=0)}_ResetLastTexture(){this._lastTexture0=null}SetBlendMode(x){x=this._GetBlendByIndex(x);this._SetBlend(x[0],
x[1])}SetNamedBlendMode(x){x=this.GetNamedBlend(x);this._SetBlend(x.srcBlend,x.destBlend)}_SetBlend(x,B){if(x!==this._lastSrcBlend||B!==this._lastDestBlend)this.PushBatch().InitSetBlend(x,B),this._lastSrcBlend=x,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(x){this.Rect2(x.getLeft(),x.getTop(),x.getRight(),x.getBottom())}Rect2(x,B,H,P){this.Quad2(x,B,H,B,H,P,x,P)}_ExtendQuadBatch(){let x=this._vertexPtr;x&gt;=this._lastVertexPtr&amp;&amp;(this.EndBatch(),x=0);1===this._topOfBatch?this._batch[this._batchPtr-1]._indexCount+=6:(this.PushBatch().InitQuad(this._is3d?x:x/2*3,6),this._topOfBatch=1)}_WriteQuadToVertexBuffer(x){x.writeToTypedArray3D(this._vertexData,this._vertexPtr,
this._baseZ+this._currentZ);this._vertexPtr+=12}Quad(x){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(x);l.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad2(x,B,H,P,E,J,O,R){this._ExtendQuadBatch();const T=this._vertexData;let Y=this._vertexPtr;const W=this._baseZ+this._currentZ;this._is3d?(T[Y++]=x,T[Y++]=B,T[Y++]=W,T[Y++]=H,T[Y++]=P,T[Y++]=W,T[Y++]=E,T[Y++]=J,T[Y++]=W,T[Y++]=O,T[Y++]=R,T[Y++]=W):(T[Y++]=x,T[Y++]=B,T[Y++]=H,T[Y++]=P,T[Y++]=E,T[Y++]=J,T[Y++]=O,T[Y++]=
R);this._vertexPtr=Y;l.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad3(x,B){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(x);B.writeAsQuadToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}Quad4(x,B){this._ExtendQuadBatch();this._WriteQuadToVertexBuffer(x);B.writeToTypedArray(this._texcoordData,this._texPtr);this._texPtr+=8}FullscreenQuad(x,B){d.copy(r,this._lastMV);a.copy(m,this._cam);a.copy(n,this._look);this._cam[0]=0;this._cam[1]=0;this._cam[2]=100*
self.devicePixelRatio;this._look[0]=0;this._look[1]=0;this._look[2]=0;this.ResetModelView();this.UpdateModelView();if(this._isScissorViewport){x=this._viewportScissorWidth/2;var H=this._viewportScissorHeight/2;t.set(-x,H,-x+this._viewportScissorWidth,H-this._viewportScissorHeight);q.setFromRect(t);t.set(0,0,this._viewportScissorWidth/this._width,this._viewportScissorHeight/this._height);this.Quad3(q,t)}else if("crop"===x&amp;&amp;this._currentRenderTarget&amp;&amp;B){x=this._width/2;H=this._height/2;const J=B.GetWidth();
B=B.GetHeight();var P=this._currentRenderTarget.GetWidth(),E=this._currentRenderTarget.GetHeight();P=Math.min(P,J);const O=Math.min(E,B),R=Math.max(B-E,0);E=Math.max(E-B,0);t.set(-x,H-E,-x+P,H-O-E);q.setFromRect(t);t.set(0,R,P,O+R);t.divide(J,B);this.Quad3(q,t)}else{let [J,O]=this.GetRenderTargetSize(this._currentRenderTarget);x=J/2;H=O/2;this.Rect2(-x,H,x,-H)}d.copy(this._matMV,r);a.copy(this._cam,m);a.copy(this._look,n);this.UpdateModelView()}ConvexPoly(x){var B=x.length/2;if(3&gt;B)throw Error("need at least 3 points");
B-=2;const H=B-1,P=x[0],E=x[1];for(let J=0;J&lt;B;J+=2){const O=2*J,R=x[O+2],T=x[O+3],Y=x[O+4],W=x[O+5];J===H?this.Quad2(P,E,R,T,Y,W,Y,W):this.Quad2(P,E,R,T,Y,W,x[O+6],x[O+7])}}Line(x,B,H,P){var E=c.angleTo(x,B,H,P),J=.5*this._lineWidth;const O=Math.sin(E)*J;E=Math.cos(E)*J;J=this._lineCap;2===J?this.LinePreCalc_LineCap2(x,B,H,P,O,E):1===J?this.LinePreCalc_LineCap1(x,B,H,P,O,E):this.LinePreCalc_LineCap0(x,B,H,P,O,E)}LinePreCalc_LineCap2(x,B,H,P,E,J){var O=this._lineOffset;x=x+O-J;B=B+O-E;H=H+O+J;P=P+
O+E;O=2*J;const R=2*E;this.Quad2(x+E,B-J,H+E,P-J,H-E-O,P+J-R,x-E+O,B+J+R)}LinePreCalc_LineCap1(x,B,H,P,E,J){const O=this._lineOffset;x=x+O-J;B=B+O-E;H=H+O+J;P=P+O+E;this.Quad2(x+E,B-J,H+E,P-J,H-E,P+J,x-E,B+J)}LinePreCalc_LineCap0(x,B,H,P,E,J){const O=this._lineOffset;x+=O;B+=O;H+=O;P+=O;this.Quad2(x+E,B-J,H+E,P-J,H-E,P+J,x-E,B+J)}TexturedLine(x,B,H,P,E,J){var O=c.angleTo(x,B,H,P),R=.5*this._lineWidth;const T=Math.sin(O)*R;O=Math.cos(O)*R;R=this._lineCap;2===R?this.TexturedLinePreCalc_LineCap2(x,B,
H,P,T,O,E,J):1===R?this.TexturedLinePreCalc_LineCap1(x,B,H,P,T,O,E,J):this.TexturedLinePreCalc_LineCap0(x,B,H,P,T,O,E,J)}TexturedLinePreCalc_LineCap2(x,B,H,P,E,J,O,R){var T=this._lineOffset;x=x+T-J;B=B+T-E;H=H+T+J;P=P+T+E;T=2*J;const Y=2*E;q.set(x+E,B-J,H+E,P-J,H-E-T,P+J-Y,x-E+T,B+J+Y);t.set(O,0,R,0);this.Quad3(q,t)}TexturedLinePreCalc_LineCap1(x,B,H,P,E,J,O,R){const T=this._lineOffset;x=x+T-J;B=B+T-E;H=H+T+J;P=P+T+E;q.set(x+E,B-J,H+E,P-J,H-E,P+J,x-E,B+J);t.set(O,0,R,0);this.Quad3(q,t)}TexturedLinePreCalc_LineCap0(x,
B,H,P,E,J,O,R){const T=this._lineOffset;x+=T;B+=T;H+=T;P+=T;q.set(x+E,B-J,H+E,P-J,H-E,P+J,x-E,B+J);t.set(O,0,R,0);this.Quad3(q,t)}LineRect(x,B,H,P){const E=.5*this._lineWidth,J=this._lineCap;2===J?this._LineRectPreCalc_LineCap2(x,B,H,P,E):1===J?this._LineRectPreCalc_LineCap1(x,B,H,P,E):this._LineRectPreCalc_LineCap0(x,B,H,P,E)}_LineRectPreCalc_LineCap2(x,B,H,P,E){this.LinePreCalc_LineCap2(x,B,H,B,0,E);this.LinePreCalc_LineCap2(H,B,H,P,E,0);this.LinePreCalc_LineCap2(H,P,x,P,0,-E);this.LinePreCalc_LineCap2(x,
P,x,B,-E,0)}_LineRectPreCalc_LineCap1(x,B,H,P,E){this.LinePreCalc_LineCap1(x,B,H,B,0,E);this.LinePreCalc_LineCap1(H,B,H,P,E,0);this.LinePreCalc_LineCap1(H,P,x,P,0,-E);this.LinePreCalc_LineCap1(x,P,x,B,-E,0)}_LineRectPreCalc_LineCap0(x,B,H,P,E){this.LinePreCalc_LineCap0(x,B,H,B,0,E);this.LinePreCalc_LineCap0(H,B,H,P,E,0);this.LinePreCalc_LineCap0(H,P,x,P,0,-E);this.LinePreCalc_LineCap0(x,P,x,B,-E,0)}LineRect2(x){this.LineRect(x.getLeft(),x.getTop(),x.getRight(),x.getBottom())}LineQuad(x){var B=c.angleTo(x.getTlx(),
x.getTly(),x.getTrx(),x.getTry()),H=.5*this._lineWidth;const P=Math.sin(B)*H;B=Math.cos(B)*H;H=this._lineCap;2===H?this._LineQuadPreCalc_LineCap2(x,P,B):1===H?this._LineQuadPreCalc_LineCap1(x,P,B):this._LineQuadPreCalc_LineCap0(x,P,B)}_LineQuadPreCalc_LineCap2(x,B,H){this.LinePreCalc_LineCap2(x.getTlx(),x.getTly(),x.getTrx(),x.getTry(),B,H);this.LinePreCalc_LineCap2(x.getTrx(),x.getTry(),x.getBrx(),x.getBry(),H,-B);this.LinePreCalc_LineCap2(x.getBrx(),x.getBry(),x.getBlx(),x.getBly(),-B,-H);this.LinePreCalc_LineCap2(x.getBlx(),
x.getBly(),x.getTlx(),x.getTly(),-H,B)}_LineQuadPreCalc_LineCap1(x,B,H){this.LinePreCalc_LineCap1(x.getTlx(),x.getTly(),x.getTrx(),x.getTry(),B,H);this.LinePreCalc_LineCap1(x.getTrx(),x.getTry(),x.getBrx(),x.getBry(),H,-B);this.LinePreCalc_LineCap1(x.getBrx(),x.getBry(),x.getBlx(),x.getBly(),-B,-H);this.LinePreCalc_LineCap1(x.getBlx(),x.getBly(),x.getTlx(),x.getTly(),-H,B)}_LineQuadPreCalc_LineCap0(x,B,H){this.LinePreCalc_LineCap0(x.getTlx(),x.getTly(),x.getTrx(),x.getTry(),B,H);this.LinePreCalc_LineCap0(x.getTrx(),
x.getTry(),x.getBrx(),x.getBry(),H,-B);this.LinePreCalc_LineCap0(x.getBrx(),x.getBry(),x.getBlx(),x.getBly(),-B,-H);this.LinePreCalc_LineCap0(x.getBlx(),x.getBly(),x.getTlx(),x.getTly(),-H,B)}SetLineWidth(x){this._lineWidth=x;this._lineWidthStack[this._lineWidthStack.length-1]=x}GetLineWidth(){return this._lineWidth}PushLineWidth(x){if(100&lt;=this._lineWidthStack.length)throw Error("pushed too many line widths - check push/pop pairs");this._lineWidthStack.push(x);this._lineWidth=x}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[this._lineWidthStack.length-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(x){if("butt"===x)this.PushLineCapButt();else if("square"===
x)this.PushLineCapSquare();else if("zag"===x)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[this._lineCapStack.length-1]}SetLineOffset(x){this._lineOffset=x;this._lineOffsetStack[this._lineOffsetStack.length-1]=x}GetLineOffset(){return this._lineOffset}PushLineOffset(x){if(100&lt;=this._lineOffsetStack.length)throw Error("pushed too many line offsets - check push/pop pairs");this._lineOffsetStack.push(x);
this._lineOffset=x}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[this._lineOffsetStack.length-1]}SetPointTextureCoords(x){this._lastPointTexCoords.equals(x)||(this._lastPointTexCoords.copy(x),this.PushBatch().InitSetPointTexCoords(x),this._topOfBatch=0)}Point(x,B,H,P){7996&lt;=this._pointPtr&amp;&amp;this.EndBatch();let E=this._pointPtr;var J=this._baseZ+this._currentZ;2===
this._topOfBatch&amp;&amp;this._lastPointZ===J?this._batch[this._batchPtr-1]._indexCount++:(this.PushBatch().InitPoints(E,J),this._topOfBatch=2,this._lastPointZ=J);J=this._pointData;J[E++]=x;J[E++]=B;J[E++]=H;J[E++]=P;this._pointPtr=E}SetProgram(x){this._lastProgram!==x&amp;&amp;(this.PushBatch().InitSetProgram(x),this._lastProgram=x,this._topOfBatch=0,this._currentStateGroup=null)}SetTextureFillMode(){this.SetProgram(this._spTextureFill)}SetDeviceTransformTextureFillMode(){this.SetProgram(this._spDeviceTransformTextureFill)}SetColorFillMode(){this.SetProgram(this._spColorFill)}SetLinearGradientFillMode(){this.SetProgram(this._spLinearGradientFill)}SetGradientColor(x){this.PushBatch().InitSetGradientColor(x);
this._topOfBatch=0}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetEllipseParams(x,B,H=1){this.PushBatch().InitSetEllipseParams(x,B,H);this._topOfBatch=0}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetTilemapInfo(x,
B,H,P,E,J,O){if(this._lastProgram!==this._spTilemapFill)throw Error("must set tilemap fill mode first");this.PushBatch().InitSetTilemapInfo(x,B,H,P,E,J,O);this._topOfBatch=0}SetProgramParameters(x,B,H,P,E,J,O,R,T,Y,W){const ea=this._lastProgram;var qa=ea._hasAnyOptionalUniforms;const ja=!!W.length;if(qa&amp;&amp;!ea.AreOptionalUniformsAlreadySetInBatch(B,H,P,E,J,O,R,T,Y)||ja&amp;&amp;!ea.AreCustomParametersAlreadySetInBatch(W)){var xa=this.PushBatch();xa.InitSetProgramParameters();qa&amp;&amp;(ea.SetOptionalUniformsInBatch(B,
H,P,E,J,O,R,T,Y),qa=xa._mat4param,qa[0]=J,qa[1]=O,B.writeToTypedArray(qa,2),qa[6]=R,qa[7]=T,H.writeToTypedArray(qa,12),B=xa._colorParam,E.writeToTypedArray(B,0),E=B[1],B[1]=B[3],B[3]=E,P.writeToTypedArray(xa._srcOriginRect,0),xa._startIndex=Y,ea._uSamplerBack.IsUsed()?xa._texParam=x?x.GetTexture():null:xa._texParam=null);ja&amp;&amp;(ea.SetCustomParametersInBatch(W),c.shallowAssignArray(xa._shaderParams,W));this._topOfBatch=0}}ClearRgba(x,B,H,P){this.PushBatch().InitClearSurface2(x,B,H,P);this._topOfBatch=
0}Clear(x){this.PushBatch().InitClearSurface(x);this._topOfBatch=0}ClearRect(x,B,H,P){this.ClearRect4(x,B,H,P,0,0,0,0)}ClearRect2(x){this.ClearRect4(x.getLeft(),x.getTop(),x.width(),x.height(),0,0,0,0)}ClearRect3(x,B){this.ClearRect4(x.getLeft(),x.getTop(),x.width(),x.height(),B.getR(),B.getG(),B.getB(),B.getA())}ClearRect4(x,B,H,P,E,J,O,R){0&gt;H||0&gt;P||(this.PushBatch().InitClearRect(x,B,H,P,E,J,O,R),this._topOfBatch=0)}Start(){}Finish(){super.Finish();this._gl.flush()}CheckForQueryResults(){for(const x of this._allQueryResultBuffers)x.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl||
this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){c.Gfx.WebGLRendererTexture.OnContextLost();c.Gfx.WebGLRenderTarget.OnContextLost();c.Gfx.RendererText.OnContextLost();for(const x of this._allQueryResultBuffers)x.Clear();this._extensions=[];this._parallelShaderCompileExt=this._timerExt=null;this._unmaskedRenderer=this._unmaskedVendor="(unavailable)";this._spTilemapFill=this._spPoints=this._spSmoothLineFill=this._spSmoothEllipseOutline=this._spSmoothEllipseFill=this._spHardEllipseOutline=
this._spHardEllipseFill=this._spLinearGradientFill=this._spColorFill=this._spDeviceTransformTextureFill=this._spTextureFill=this._lastProgram=null;for(const x of this._stateGroups.values())x.OnContextLost();for(const x of this._allShaderPrograms)x.Release();this._ClearAllShaderPrograms()}async OnContextRestored(){this._isInitialisingAfterContextRestored=!0;await this.InitState();this._isInitialisingAfterContextRestored=!1;for(const x of this._stateGroups.values())x.OnContextRestored(this);this.SetSize(this._width,
this._height,!0)}CreateStaticTexture(x,B){if(this.IsContextLost())throw Error("context lost");this.EndBatch();const H=c.New(c.Gfx.WebGLRendererTexture,this);H._CreateStatic(x,B);return H}CreateStaticTextureAsync(x,B){if(this.IsContextLost())return Promise.reject("context lost");B=Object.assign({},B);const H=B.wrapX&amp;&amp;"clamp-to-edge"!==B.wrapX||B.wrapY&amp;&amp;"clamp-to-edge"!==B.wrapY;if(!c.Supports.ImageBitmapOptions||!this.SupportsNPOTTextures()&amp;&amp;H)return c.Supports.ImageBitmap?createImageBitmap(x).then(P=&gt;
c.Asyncify(()=&gt;this.CreateStaticTexture(P,B))):x instanceof Blob?c.BlobToImage(x,!0).then(P=&gt;this.CreateStaticTextureAsync(P,B)):"undefined"!==typeof HTMLImageElement&amp;&amp;x instanceof HTMLImageElement&amp;&amp;"function"===typeof x.decode?x.decode().then(()=&gt;c.Asyncify(()=&gt;this.CreateStaticTexture(x,B))):c.Asyncify(()=&gt;this.CreateStaticTexture(x,B));B.premultiplyAlpha=!1;return createImageBitmap(x,{premultiplyAlpha:"premultiply"}).then(P=&gt;c.Asyncify(()=&gt;this.CreateStaticTexture(P,B)))}CreateDynamicTexture(x,
B,H){this.EndBatch();const P=c.New(c.Gfx.WebGLRendererTexture,this);P._CreateDynamic(x,B,H);return P}UpdateTexture(x,B,H){this.EndBatch();B._Update(x,H)}DeleteTexture(x){x&amp;&amp;(x.SubtractReference(),0&lt;x.GetReferenceCount()||(this.EndBatch(),x===this._lastTexture0&amp;&amp;(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=null),x===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),x._Delete()))}CreateRenderTarget(x){let B=this._width,H=this._height,P=!0;x&amp;&amp;("number"===typeof x.width&amp;&amp;(B=x.width,P=!1),"number"===typeof x.height&amp;&amp;(H=x.height,P=!1));if(0&gt;=B||0&gt;=H)throw Error("invalid size");this.EndBatch();const E=c.New(c.Gfx.WebGLRenderTarget,this);E._Create(B,H,Object.assign({isDefaultSize:P},x));this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;return E}SetRenderTarget(x){if(x!==this._currentRenderTarget){if(x){x.IsDefaultSize()&amp;&amp;x._Resize(this._width,
this._height);var B=x.GetWidth();var H=x.GetHeight();var P=B;var E=H}else B=this._width,H=this._height,P=this.GetScissoredViewportWidth(),E=this.GetScissoredViewportHeight();var J=this._lastBackbufferWidth!==B||this._lastBackbufferHeight!==H;J&amp;&amp;this._UpdateViewportRenderer(P,E,B,H);this.PushBatch().InitSetRenderTarget(x,J,this._matP);this._currentRenderTarget=x;this._topOfBatch=0}}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(x){return x?[x.GetWidth(),x.GetHeight()]:[this._width,
this._height]}CopyRenderTarget(x,B="stretch"){2&gt;this._version||this._currentRenderTarget&amp;&amp;0&lt;this._currentRenderTarget.GetMultisampling()?(this.SetCopyBlend(),this.ResetColor(),this.DrawRenderTarget(x,B)):(this.PushBatch().InitBlitFramebuffer(x,this._currentRenderTarget,B),this._topOfBatch=0)}DrawRenderTarget(x,B="stretch"){x=x.GetTexture();if(!x)throw Error("not a texture-backed render target");this.SetTexture(x);this.FullscreenQuad(B,x)}InvalidateRenderTarget(x){2&gt;this._version||(this.PushBatch().InitInvalidateFramebuffer(x._GetFramebuffer()),
this._topOfBatch=0)}DeleteRenderTarget(x){this.SetRenderTarget(null);this.EndBatch();const B=x.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);x._Delete()}async ReadBackRenderTargetToImageData(x,B,H){this.EndBatch();const P=this._currentRenderTarget;if(x){var E=
x.GetWidth();var J=x.GetHeight();var O=x._GetFramebuffer()}else E=this.GetWidth(),J=this.GetHeight(),O=null;let R=x=0;var T=E,Y=J;H&amp;&amp;(x=c.clamp(Math.floor(H.getLeft()),0,E-1),R=c.clamp(Math.floor(H.getTop()),0,J-1),T=H.width(),T=0===T?E-x:c.clamp(Math.floor(T),0,E-x),Y=H.height(),Y=0===Y?J-R:c.clamp(Math.floor(Y),0,J-R),R=J-(R+Y));const W=this._gl;W.bindFramebuffer(W.FRAMEBUFFER,O);J=()=&gt;{W.bindFramebuffer(W.FRAMEBUFFER,null);this._currentRenderTarget=null;this._batchState.currentFramebuffer=null;
this.SetRenderTarget(P)};if(!B&amp;&amp;2&lt;=this.GetWebGLVersionNumber()){W.bindFramebuffer(W.READ_FRAMEBUFFER,O);O=W.createBuffer();H=T*Y*4;E=W.PIXEL_PACK_BUFFER;W.bindBuffer(E,O);W.bufferData(E,H,W.STREAM_READ);W.readPixels(x,R,T,Y,W.RGBA,W.UNSIGNED_BYTE,0);W.bindFramebuffer(W.READ_FRAMEBUFFER,null);W.bindBuffer(E,null);J();const ea=W.fenceSync(W.SYNC_GPU_COMMANDS_COMPLETE,0);await this._WaitForObjectReady(()=&gt;W.getSyncParameter(ea,W.SYNC_STATUS)===W.SIGNALED);W.deleteSync(ea);B=new ImageData(T,Y);W.bindBuffer(E,
O);W.getBufferSubData(E,0,new Uint8Array(B.data.buffer),0,H);W.bindBuffer(E,null);W.deleteBuffer(O)}else B=new ImageData(T,Y),W.readPixels(x,R,T,Y,W.RGBA,W.UNSIGNED_BYTE,new Uint8Array(B.data.buffer)),J();return B}StartQuery(x){this.SupportsGPUProfiling()&amp;&amp;(this.PushBatch().InitStartQuery(x),this._topOfBatch=0)}EndQuery(x){this.SupportsGPUProfiling()&amp;&amp;(this.PushBatch().InitEndQuery(x),this._topOfBatch=0)}_WaitForObjectReady(x){const B=new Promise(H=&gt;w.add({resolve:H,checkFunc:x}));-1===y&amp;&amp;(y=self.requestAnimationFrame(C));
return B}IsDesynchronized(){return!!this._attribs.desynchronized}GetEstimatedBackBufferMemoryUsage(){return this._width*this._height*(this._attribs.alpha?4:3)}GetEstimatedRenderBufferMemoryUsage(){let x=0;for(const B of c.Gfx.WebGLRenderTarget.allRenderTargets())B.GetTexture()||(x+=B.GetEstimatedMemoryUsage());return x}GetEstimatedTextureMemoryUsage(){let x=0;for(const B of c.Gfx.WebGLRendererTexture.allTextures())x+=B.GetEstimatedMemoryUsage();return x}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+
this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}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}HasMajorPerformanceCaveat(){return this._hasMajorPerformanceCaveat}SupportsGPUProfiling(){return!!this._timerExt}_GetDisjointTimerQueryExtension(){return this._timerExt}_GetParallelShaderCompileExtension(){return this._parallelShaderCompileExt}_AddQueryResultBuffer(x){this._allQueryResultBuffers.add(x)}_RemoveQueryResultBuffer(x){this._allQueryResultBuffers.delete(x)}_GetTimeQueryStack(){return this._timeQueryStack}GetContext(){return this._gl}_InitBlendModes(x){this._InitBlendModeData([["normal",
x.ONE,x.ONE_MINUS_SRC_ALPHA],["additive",x.ONE,x.ONE],["xor",x.ONE,x.ONE_MINUS_SRC_ALPHA],["copy",x.ONE,x.ZERO],["destination-over",x.ONE_MINUS_DST_ALPHA,x.ONE],["source-in",x.DST_ALPHA,x.ZERO],["destination-in",x.ZERO,x.SRC_ALPHA],["source-out",x.ONE_MINUS_DST_ALPHA,x.ZERO],["destination-out",x.ZERO,x.ONE_MINUS_SRC_ALPHA],["source-atop",x.DST_ALPHA,x.ONE_MINUS_SRC_ALPHA],["destination-atop",x.ONE_MINUS_DST_ALPHA,x.SRC_ALPHA]])}CreateRendererText(){return c.New(c.Gfx.RendererText,this)}CreateWebGLText(){return this.CreateRendererText()}}}"use strict";
{const c=self.C3;let b=null;const a=new Set;function f(h,l){const m=h[0]-l[0];return 0!==m?m:h[1]-l[1]}const d=[],e=[];let g=!1;self.IRuntime=class{constructor(h,l){b=h;Object.defineProperties(this,{assets:{value:b.GetAssetManager().GetIAssetManager(),writable:!1},objects:{value:l,writable:!1},globalVars:{value:{},writable:!1},projectName:{value:b.GetProjectName(),writable:!1},projectVersion:{value:b.GetProjectVersion(),writable:!1},storage:{value:new self.IStorage(b),writable:!1},isInWorker:{value:b.IsInWorker(),
writable:!1}});b.UserScriptDispatcher().addEventListener("keydown",m=&gt;{a.has(m.key)?m.stopPropagation():a.add(m.key)});b.UserScriptDispatcher().addEventListener("keyup",m=&gt;a.delete(m.key));b.Dispatcher().addEventListener("window-blur",()=&gt;a.clear());b.IsInWorker()&amp;&amp;(self.alert=m=&gt;{g||(g=!0,console.warn("[Construct 3] 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(m)})}_InitGlobalVars(h){Object.defineProperties(this.globalVars,h)}addEventListener(h,l){b.UserScriptDispatcher().addEventListener(h,l)}removeEventListener(h,l){b.UserScriptDispatcher().removeEventListener(h,l)}callFunction(h,...l){const m=b.GetEventSheetManager(),n=m.GetFunctionBlockByName(h);if(!n)throw Error(`cannot find function name '${h}'`);if(!n.IsEnabled())return n.GetDefaultReturnValue();if(l.length&lt;n.GetFunctionParameterCount())throw Error(`not enough function parameters passed for '${h}' (${l.length} passed, ${n.GetFunctionParameterCount()} expected)`);
const r=n.GetEventBlock();h=null;var q=m.GetCurrentEvent();q&amp;&amp;(q=q.GetSolModifiersIncludingParents(),0&lt;q.length&amp;&amp;(h=q,m.PushCleanSol(q)));l=r.RunAsExpressionFunctionCall(r.GetSolModifiersIncludingParents(),n.GetReturnType(),n.GetDefaultReturnValue(),...l);h&amp;&amp;m.PopSol(h);return l}setReturnValue(h){const l=b.GetEventStack().GetCurrentExpFuncStackFrame();if(!l)throw Error("not in a function which returns a value");switch(l.GetFunctionReturnType()){case 1:"number"===typeof h&amp;&amp;l.SetFunctionReturnValue(h);
break;case 2:"string"===typeof h&amp;&amp;l.SetFunctionReturnValue(h);break;case 3:"number"!==typeof h&amp;&amp;"string"!==typeof h||l.SetFunctionReturnValue(h)}}get dt(){return b.GetDt()}get gameTime(){return b.GetGameTime()}get wallTime(){return b.GetWallTime()}random(){return b.Random()}get layout(){return b.GetMainRunningLayout().GetILayout()}getLayout(h){const l=b.GetLayoutManager();if("number"===typeof h||"string"===typeof h)h=l.GetLayout(h);else throw new TypeError("expected string or number");if(!h)throw Error("invalid layout");
return h.GetILayout()}getAllLayouts(){return b.GetLayoutManager().GetAllLayouts().map(h=&gt;h.GetILayout())}goToLayout(h){const l=b.GetLayoutManager();if("number"===typeof h||"string"===typeof h)h=l.GetLayout(h);else throw new TypeError("expected string or number");if(!h)throw Error("invalid layout");l.IsPendingChangeMainLayout()||l.ChangeMainLayout(h)}get keyboard(){const h=b._GetCommonScriptInterfaces().keyboard;if(!h)throw Error("runtime.keyboard used but Keyboard object missing - add it to your project first");
return h}get mouse(){const h=b._GetCommonScriptInterfaces().mouse;if(!h)throw Error("runtime.mouse used but Mouse object missing - add it to your project first");return h}get touch(){const h=b._GetCommonScriptInterfaces().touch;if(!h)throw Error("runtime.touch used but Touch object missing - add it to your project first");return h}invokeDownload(h,l){b.InvokeDownload(h,l)}getInstanceByUid(h){return(h=b.GetInstanceByUID(h))?h.GetInterfaceClass():null}sortZOrder(h,l){const m=b.GetCurrentLayout();for(var n of h){h=
b._UnwrapScriptInterface(n);if(!h||!h.GetWorldInfo())throw Error("invalid instance");var r=h.GetWorldInfo();d.push([r.GetLayer().GetIndex(),r.GetZIndex()]);e.push(h)}if(0!==d.length){d.sort(f);e.sort((q,t)=&gt;l(q.GetInterfaceClass(),t.GetInterfaceClass()));n=!1;for(let q=0,t=d.length;q&lt;t;++q){h=e[q];r=m.GetLayerByIndex(d[q][0]);const u=d[q][1],w=r._GetInstances();w[u]!==h&amp;&amp;(w[u]=h,h.GetWorldInfo()._SetLayer(r),r.SetZIndicesChanged(),n=!0)}n&amp;&amp;b.UpdateRender();c.clearArray(d);c.clearArray(e)}}alert(h){return b.PostComponentMessageToDOMAsync("runtime",
"alert",{message:h+(b.IsInWorker()?" [via Web Worker]":"")})}}}"use strict";
{const c=self.C3;let b=null;self.IAssetManager=class{constructor(a){b=a;Object.defineProperties(this,{isWebMOpusSupported:{value:b.IsAudioFormatSupported("audio/webm; codecs=opus"),writable:!1}})}fetchText(a){return b.FetchText(a)}fetchJson(a){return b.FetchJson(a)}fetchBlob(a){return b.FetchBlob(a)}fetchArrayBuffer(a){return b.FetchArrayBuffer(a)}getProjectFileUrl(a){return b.GetProjectFileUrl(a)}getMediaFileUrl(a){c.IsRelativeURL(a)&amp;&amp;(a=a.toLowerCase());return b.GetMediaFileUrl(a,b.GetMediaSubfolder())}get mediaFolder(){return b.GetMediaSubfolder()}async decodeWebMOpus(a,
f){if(this.isWebMOpusSupported)throw Error("decodeWebMOpus(): not supported because WebM Opus is supported by the platform");f=await b.GetRuntime()._WasmDecodeWebMOpus(f);f=new Float32Array(f);a=a.createBuffer(1,f.length,48E3);a.getChannelData(0).set(f);return a}loadScripts(...a){return b.LoadScripts(...a)}compileWebAssembly(a){return b.CompileWebAssembly(a)}loadStyleSheet(a){return b.LoadStyleSheet(a)}}}"use strict";
self.IStorage=class{constructor(c){this._storage=c._GetProjectStorage()}getItem(c){return this._storage.getItem(c)}setItem(c,b){return this._storage.setItem(c,b)}removeItem(c){return this._storage.removeItem(c)}clear(){return this._storage.clear()}keys(){return this._storage.keys()}};"use strict";
{const c=new WeakMap;self.IObjectClass=class{constructor(b){c.set(this,b);Object.defineProperties(this,{name:{value:b.GetName(),writable:!1}});b.GetRuntime()._MapScriptInterface(this,b)}addEventListener(b,a){c.get(this).UserScriptDispatcher().addEventListener(b,a)}removeEventListener(b,a){c.get(this).UserScriptDispatcher().removeEventListener(b,a)}getAllInstances(){return c.get(this).GetInstances().map(b=&gt;b.GetInterfaceClass())}getFirstInstance(){const b=c.get(this).GetInstances();return 0&lt;b.length?
b[0].GetInterfaceClass():null}getPickedInstances(){return c.get(this).GetCurrentSol().GetInstances().map(b=&gt;b.GetInterfaceClass())}getFirstPickedInstance(){const b=c.get(this).GetCurrentSol().GetInstances();return 0&lt;b.length?b[0].GetInterfaceClass():null}*instances(){for(const b of c.get(this).GetInstances())yield b.GetInterfaceClass()}*pickedInstances(){for(const b of c.get(this).GetCurrentSol().GetInstances())yield b.GetInterfaceClass()}setInstanceClass(b){if(0&lt;c.get(this).GetInstanceCount())throw Error("setInstanceClass() called too late, because instances have already been created - call in runOnStartup");
c.get(this)._SetUserScriptInstanceClass(b)}createInstance(b,a,f){if("number"!==typeof b&amp;&amp;"string"!==typeof b)throw new TypeError("invalid layer parameter");const d=c.get(this);var e=d.GetRuntime();b=e.GetMainRunningLayout().GetLayer(b);if(!b)throw Error("invalid layer");a=e.CreateInstance(d,b,a,f);e=e.GetEventSheetManager();e.BlockFlushingInstances(!0);a._TriggerOnCreated();if(a.IsInContainer())for(const g of a.siblings())g._TriggerOnCreated();e.BlockFlushingInstances(!1);return a.GetInterfaceClass()}}}"use strict";
{const c=new WeakMap;self.ILayout=class{constructor(b){c.set(this,b);const a=[],f=b.GetEffectList(),d=f.GetAllEffectTypes().length;for(let e=0;e&lt;d;++e)a.push(new self.IEffectInstance(f,e));Object.defineProperties(this,{name:{value:b.GetName(),writable:!1},index:{value:b.GetIndex(),writable:!1},effects:{value:a,writable:!1}})}addEventListener(b,a){c.get(this).UserScriptDispatcher().addEventListener(b,a)}removeEventListener(b,a){c.get(this).UserScriptDispatcher().removeEventListener(b,a)}get width(){return c.get(this).GetWidth()}set width(b){c.get(this).SetWidth(b)}get height(){return c.get(this).GetHeight()}set height(b){c.get(this).SetHeight(b)}scrollTo(b,
a){const f=c.get(this);f.SetScrollX(b);f.SetScrollY(a)}getLayer(b){const a=c.get(this);if("number"===typeof b||"string"===typeof b)b=a.GetLayer(b);else throw new TypeError("expected string or number");if(!b)throw Error("invalid layer");return b.GetILayer()}getAllLayers(){return c.get(this).GetLayers().map(b=&gt;b.GetILayer())}}}"use strict";
{const c=self.C3,b=new WeakMap;self.ILayer=class{constructor(a){b.set(this,a);const f=[],d=a.GetEffectList(),e=d.GetAllEffectTypes().length;for(let g=0;g&lt;e;++g)f.push(new self.IEffectInstance(d,g));Object.defineProperties(this,{name:{value:a.GetName(),writable:!1},index:{value:a.GetIndex(),writable:!1},layout:{value:a.GetLayout().GetILayout(),writable:!1},effects:{value:f,writable:!1}})}static _Unwrap(a){return b.get(a)}get isVisible(){return b.get(this).IsVisible()}set isVisible(a){b.get(this).SetVisible(a)}get opacity(){return b.get(this).GetOpacity()}set opacity(a){a=
c.clamp(+a,0,1);isNaN(a)||b.get(this).SetOpacity(a)}getViewport(){return b.get(this).GetViewport().toDOMRect()}cssPxToLayer(a,f,d=0){const e=b.get(this),g=e.GetRuntime();return e.CanvasCssToLayer(a-g.GetCanvasClientX(),f-g.GetCanvasClientY(),d)}layerToCssPx(a,f,d=0){const e=b.get(this),g=e.GetRuntime(),[h,l]=e.LayerToCanvasCss(a,f,d);return[h+g.GetCanvasClientX(),l+g.GetCanvasClientY()]}}}"use strict";
{const c=self.C3,b=new WeakMap,a=new WeakMap;function f(e){let g=a.get(e);if(g)return g;g=c.New(c.Event.Dispatcher);a.set(e,g);return g}let d=null;self.IInstance=class{constructor(){b.set(this,d);const e={runtime:{value:d.GetRuntime().GetIRuntime(),writable:!1},objectType:{value:d.GetObjectClass().GetIObjectClass(),writable:!1},uid:{value:d.GetUID(),writable:!1}};d._GetInstVarsScriptDescriptor(e);d._GetBehaviorsScriptDescriptor(e);Object.defineProperties(this,e);d.GetRuntime()._MapScriptInterface(this,
d)}static _Init(e){d=e}static _GetInitInst(){return d}_Release(){const e=a.get(this);e&amp;&amp;(e.Release(),a.delete(this));b.delete(this)}addEventListener(e,g,h){f(this).addEventListener(e,g,h)}removeEventListener(e,g,h){f(this).removeEventListener(e,g,h)}dispatchEvent(e){f(this).dispatchEvent(e)}destroy(){const e=b.get(this);e.GetRuntime().DestroyInstance(e)}}}"use strict";
{const c=self.C3,b=self.IInstance,a=self.ILayer,f=new WeakMap,d=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]]),e=new Map([...d.entries()].map(h=&gt;[h[1],h[0]])),g=c.New(c.Color);self.IWorldInstance=class extends b{constructor(){super();var h=b._GetInitInst();f.set(this,h);const l=[];var m=h.GetWorldInfo();if(h=m.GetInstanceEffectList()){m=m.GetObjectClass().GetEffectList().GetAllEffectTypes().length;
for(let n=0;n&lt;m;++n)l.push(new self.IEffectInstance(h,n))}Object.defineProperties(this,{effects:{value:l,writable:!1}})}get layout(){return f.get(this).GetWorldInfo().GetLayout().GetILayout()}get layer(){return f.get(this).GetWorldInfo().GetLayer().GetILayer()}get x(){return f.get(this).GetWorldInfo().GetX()}set x(h){h=+h;const l=f.get(this).GetWorldInfo();isNaN(h)||l.GetX()===h||(l.SetX(h),l.SetBboxChanged())}get y(){return f.get(this).GetWorldInfo().GetY()}set y(h){h=+h;const l=f.get(this).GetWorldInfo();
isNaN(h)||l.GetY()===h||(l.SetY(h),l.SetBboxChanged())}get zElevation(){return f.get(this).GetWorldInfo().GetZElevation()}set zElevation(h){h=+h;const l=f.get(this),m=l.GetWorldInfo();m.GetZElevation()!==h&amp;&amp;(m.SetZElevation(h),l.GetRuntime().UpdateRender())}get totalZElevation(){return f.get(this).GetWorldInfo().GetTotalZElevation()}get width(){return f.get(this).GetWorldInfo().GetWidth()}set width(h){h=+h;const l=f.get(this).GetWorldInfo();isNaN(h)||l.GetWidth()===h||(l.SetWidth(h),l.SetBboxChanged())}get height(){return f.get(this).GetWorldInfo().GetHeight()}set height(h){h=
+h;const l=f.get(this).GetWorldInfo();isNaN(h)||l.GetHeight()===h||(l.SetHeight(h),l.SetBboxChanged())}get angle(){return f.get(this).GetWorldInfo().GetAngle()}set angle(h){h=c.clampAngle(+h);const l=f.get(this).GetWorldInfo();isNaN(h)||l.GetAngle()===h||(l.SetAngle(h),l.SetBboxChanged())}get angleDegrees(){return c.toDegrees(this.angle)}set angleDegrees(h){this.angle=c.toRadians(h)}getBoundingBox(){return f.get(this).GetWorldInfo().GetBoundingBox().toDOMRect()}getBoundingQuad(){return f.get(this).GetWorldInfo().GetBoundingQuad().toDOMQuad()}get isVisible(){return f.get(this).GetWorldInfo().IsVisible()}set isVisible(h){h=
!!h;const l=f.get(this),m=l.GetWorldInfo();m.IsVisible()!==h&amp;&amp;(m.SetVisible(h),l.GetRuntime().UpdateRender())}get opacity(){return f.get(this).GetWorldInfo().GetOpacity()}set opacity(h){h=c.clamp(+h,0,1);const l=f.get(this),m=l.GetWorldInfo();isNaN(h)||m.GetOpacity()===h||(m.SetOpacity(h),l.GetRuntime().UpdateRender())}set colorRgb(h){if(3&gt;h.length)throw Error("expected 3 elements");g.setRgb(h[0],h[1],h[2]);h=f.get(this);const l=h.GetWorldInfo();l.GetUnpremultipliedColor().equalsIgnoringAlpha(g)||
(l.SetUnpremultipliedColor(g),h.GetRuntime().UpdateRender())}get colorRgb(){const h=f.get(this).GetWorldInfo().GetUnpremultipliedColor();return[h.getR(),h.getG(),h.getB()]}set blendMode(h){h=d.get(h);if("number"!==typeof h)throw Error("invalid blend mode");const l=f.get(this);l.GetWorldInfo().SetBlendMode(h);l.GetRuntime().UpdateRender()}get blendMode(){return e.get(f.get(this).GetWorldInfo().GetBlendMode())}moveToTop(){f.get(this).GetWorldInfo().ZOrderMoveToTop()}moveToBottom(){f.get(this).GetWorldInfo().ZOrderMoveToBottom()}moveToLayer(h){h=
a._Unwrap(h);if(!h)throw Error("invalid layer");f.get(this).GetWorldInfo().ZOrderMoveToLayer(h)}moveAdjacentToInstance(h,l){f.get(this).GetWorldInfo().ZOrderMoveAdjacentToInstance(f.get(h),l)}containsPoint(h,l){return f.get(this).GetWorldInfo().ContainsPoint(+h,+l)}testOverlap(h){const l=f.get(this);h=f.get(h);return l.GetRuntime().GetCollisionEngine().TestOverlap(l,h)}testOverlapSolid(){var h=f.get(this);return(h=h.GetRuntime().GetCollisionEngine().TestOverlapSolid(h))?h.GetInterfaceClass():null}getParent(){const h=
f.get(this).GetParent();return h?h.GetInterfaceClass():null}getTopParent(){const h=f.get(this).GetTopParent();return h?h.GetInterfaceClass():null}*parents(){for(const h of f.get(this).parents())yield h.GetInterfaceClass()}getChildCount(){return f.get(this).GetChildCount()}getChildAt(h){return(h=f.get(this).GetChildAt(h))?h.GetInterfaceClass():null}*children(){for(const h of f.get(this).children())yield h.GetInterfaceClass()}*allChildren(){for(const h of f.get(this).allChildren())yield h.GetInterfaceClass()}addChild(h,
l){l||(l={});const m=f.get(this);h=f.get(h);m.AddChild(h,l)}removeChild(h){const l=f.get(this);h=f.get(h);l.RemoveChild(h)}removeFromParent(){const h=f.get(this);h.HasParent()&amp;&amp;h.GetParent().RemoveChild(h)}createMesh(h,l){f.get(this).GetWorldInfo().CreateMesh(h,l)}releaseMesh(){const h=f.get(this).GetWorldInfo();h.ReleaseMesh();h.SetBboxChanged()}setMeshPoint(h,l,m){const n=f.get(this).GetWorldInfo();n.SetMeshPoint(h,l,m)&amp;&amp;n.SetBboxChanged()}}}"use strict";
{const c=new WeakMap;self.IDOMInstance=class extends self.IWorldInstance{constructor(){super();c.set(this,self.IInstance._GetInitInst())}getElement(){return c.get(this).GetSdkInstance()._GetElementInDOMMode()}focus(){c.get(this).GetSdkInstance().FocusElement()}blur(){c.get(this).GetSdkInstance().BlurElement()}setCssStyle(b,a){c.get(this).GetSdkInstance().SetElementCSSStyle(b,a)}}}"use strict";
{const c=self.C3,b=new WeakMap,a=new WeakMap;function f(e){let g=a.get(e);if(g)return g;g=c.New(c.Event.Dispatcher);a.set(e,g);return g}let d=null;self.IBehaviorInstance=class{constructor(){b.set(this,d);const e={runtime:{value:d.GetRuntime().GetIRuntime(),writable:!1},behavior:{value:d.GetBehavior().GetIBehavior(),writable:!1}};Object.defineProperties(this,e)}static _Init(e){d=e}static _GetInitInst(){return d}get instance(){return b.get(this).GetObjectInstance().GetInterfaceClass()}_Release(){const e=
a.get(this);e&amp;&amp;(e.Release(),a.delete(this));b.delete(this)}addEventListener(e,g,h){f(this).addEventListener(e,g,h)}removeEventListener(e,g,h){f(this).removeEventListener(e,g,h)}dispatchEvent(e){f(this).dispatchEvent(e)}}}"use strict";{const c=new WeakMap;self.IBehavior=class{constructor(b){c.set(this,b);b={runtime:{value:b.GetRuntime().GetIRuntime(),writable:!1}};Object.defineProperties(this,b)}getAllInstances(){return c.get(this).GetInstances().map(b=&gt;b.GetInterfaceClass())}}}"use strict";
{const c=self.C3,b=new WeakMap;self.IEffectInstance=class{constructor(a,f){b.set(this,a);Object.defineProperties(this,{index:{value:f,writable:!1}})}get name(){return b.get(this).GetAllEffectTypes()[this.index].GetName()}get isActive(){return b.get(this).IsEffectIndexActive(this.index)}set isActive(a){a=!!a;const f=b.get(this);f.IsEffectIndexActive(this.index)!==a&amp;&amp;(f.SetEffectIndexActive(this.index,a),f.UpdateActiveEffects(),f.GetRuntime().UpdateRender())}setParameter(a,f){a=Math.floor(+a);const d=
b.get(this);var e=d.GetEffectParametersForIndex(this.index);if(0&gt;a||a&gt;=e.length)throw new RangeError("invalid effect parameter index");const g=e[a];if(g instanceof c.Color){if(!Array.isArray(f)||3&gt;f.length)throw new TypeError("expected array with 3 elements");a=f[0];e=f[1];f=f[2];if(g.equalsRgb(a,e,f))return;g.setRgb(a,e,f)}else{if("number"!==typeof f)throw new TypeError("expected number");if(g===f)return;e[a]=f}d.IsEffectIndexActive(this.index)&amp;&amp;d.GetRuntime().UpdateRender()}getParameter(a){a=Math.floor(+a);
const f=b.get(this).GetEffectParametersForIndex(this.index);if(0&gt;a||a&gt;=f.length)throw new RangeError("invalid effect parameter index");a=f[a];return a instanceof c.Color?[a.getR(),a.getG(),a.getB()]:a}}}"use strict";
{const c=self.C3,b=new Set(["local","remote"]),a=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 f(e){if(!e)return"";e=e.split(".");if(2&gt;e.length)return"";e=e[e.length-1].toLowerCase();return a.get(e)||""}function d(e){return new Promise((g,h)=&gt;{const l=document.createElement("script");l.onload=g;l.onerror=h;l.async=!1;l.src=e;document.head.appendChild(l)})}
c.AssetManager=class extends c.DefendedBase{constructor(e,g){super();if(!b.has(g.defaultLoadPolicy))throw Error("invalid load policy");this._runtime=e;this._localUrlBlobs=new Map;this._localBlobUrlCache=new Map;this._isCordova=!!g.isCordova;this._isiOSCordova=!!g.isiOSCordova;this._isFileProtocol="file:"===location.protocol;this._supportedAudioFormats=g.supportedAudioFormats||{};this._audioFiles=new Map;this._preloadSounds=!1;this._iconsSubfolder=this._fontsSubfolder=this._mediaSubfolder="";this._defaultLoadPolicy=
g.defaultLoadPolicy;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=c.New(c.RateLimiter,()=&gt;this._FireLoadingProgressEvent(),50);this._promiseThrottle=new c.PromiseThrottle(Math.max(c.hardwareConcurrency,8));if(g.localUrlBlobs)for(const [h,l]of Object.entries(g.localUrlBlobs))this._localUrlBlobs.set(h.toLowerCase(),
l);this._iAssetManager=new self.IAssetManager(this)}Release(){this._localUrlBlobs.clear();for(const e of this._localBlobUrlCache.values())URL.revokeObjectURL(e);this._localBlobUrlCache.clear();for(const e of this._allAssets)e.Release();c.clearArray(this._allAssets);this._assetsByUrl.clear();c.clearArray(this._loadPromises);this._runtime=null}GetRuntime(){return this._runtime}_SetMediaSubfolder(e){this._mediaSubfolder=e}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(e){this._fontsSubfolder=
e}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(e){this._iconsSubfolder=e}GetIconsSubfolder(){return this._iconsSubfolder}_HasLocalUrlBlob(e){return this._localUrlBlobs.has(e.toLowerCase())}_GetLocalUrlBlob(e){return this._localUrlBlobs.get(e.toLowerCase())||null}GetLocalUrlAsBlobUrl(e){const g=this._GetLocalUrlBlob(e);if(!g)return e;e=this._localBlobUrlCache.get(g);e||(e=URL.createObjectURL(g),this._localBlobUrlCache.set(g,e));return e}FetchBlob(e,g){g=g||this._defaultLoadPolicy;
const h=this._GetLocalUrlBlob(e);if(h)return Promise.resolve(h);if(c.IsRelativeURL(e)){const l=e.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsBlob(l):"local"===g?this._promiseThrottle.Add(()=&gt;c.FetchBlob(l)):c.FetchBlob(l)}return c.FetchBlob(e)}FetchArrayBuffer(e){const g=this._GetLocalUrlBlob(e);if(g)return c.BlobToArrayBuffer(g);if(c.IsRelativeURL(e)){const h=e.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsArrayBuffer(h):
"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=&gt;c.FetchArrayBuffer(h)):c.FetchArrayBuffer(h)}return c.FetchArrayBuffer(e)}FetchText(e){const g=this._GetLocalUrlBlob(e);if(g)return c.BlobToString(g);if(c.IsRelativeURL(e)){const h=e.toLowerCase();return this._isCordova&amp;&amp;this._isFileProtocol?this.CordovaFetchLocalFileAsText(h):"local"===this._defaultLoadPolicy?this._promiseThrottle.Add(()=&gt;c.FetchText(h)):c.FetchText(h)}return c.FetchText(e)}async FetchJson(e){e=await this.FetchText(e);
return JSON.parse(e)}_CordovaFetchLocalFileAs(e,g){return this._runtime.PostComponentMessageToDOMAsync("runtime","cordova-fetch-local-file",{filename:e,as:g})}CordovaFetchLocalFileAsText(e){return this._CordovaFetchLocalFileAs(e,"text")}async CordovaFetchLocalFileAsBlob(e){const g=await this._CordovaFetchLocalFileAs(e,"buffer");e=f(e);return new Blob([g],{type:e})}async CordovaFetchLocalFileAsBlobURL(e){e=e.toLowerCase();var g=this._localBlobUrlCache.get(e);if(g)return g;g=await this.CordovaFetchLocalFileAsBlob(e);
g=URL.createObjectURL(g);this._localBlobUrlCache.set(e,g);return g}CordovaFetchLocalFileAsArrayBuffer(e){return this._CordovaFetchLocalFileAs(e,"buffer")}GetMediaFileUrl(e){return this._HasLocalUrlBlob(e)?this.GetLocalUrlAsBlobUrl(e):this._mediaSubfolder+e.toLowerCase()}GetProjectFileUrl(e,g=""){if(c.IsAbsoluteURL(e)){if(g)throw Error("cannot specify subfolder with remote URL");return Promise.resolve(e)}return this._HasLocalUrlBlob(e)?Promise.resolve(this.GetLocalUrlAsBlobUrl(e)):this._isCordova&amp;&amp;
this._isFileProtocol?this.CordovaFetchLocalFileAsBlobURL(g+e):Promise.resolve(g+e.toLowerCase())}LoadProjectFileUrl(e){return this.GetProjectFileUrl(e)}LoadImage(e){if(e.loadPolicy&amp;&amp;!b.has(e.loadPolicy))throw Error("invalid load policy");let g=this._assetsByUrl.get(e.url);if(g)return g;g=c.New(c.ImageAsset,this,{url:e.url,size:e.size||0,loadPolicy:e.loadPolicy||this._defaultLoadPolicy});this._allAssets.push(g);this._assetsByUrl.set(g.GetURL(),g);this._hasFinishedInitialLoad||(this._totalAssetSizeToLoad+=
g.GetSize(),this._loadPromises.push(g.Load().then(()=&gt;this._AddLoadedSize(g.GetSize()))));return g}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises),this._lastLoadProgress=1}catch(e){console.error("Error loading: ",e),this._hasHadErrorLoading=!0,this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=!0}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(e){this._assetSizeLoaded+=e;this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const e=
c.New(c.Event,"loadingprogress");this._lastLoadProgress=c.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1);e.progress=this._lastLoadProgress;this._runtime.Dispatcher().dispatchEvent(e)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(e){c.shallowAssignArray(this._webFonts,e);this._webFonts.length&amp;&amp;this._loadPromises.push(this._LoadWebFonts())}_LoadWebFonts(){if("undefined"===typeof FontFace)return Promise.resolve();const e=[];for(const [g,h,l]of this._webFonts)this._totalAssetSizeToLoad+=
l,e.push(this._LoadWebFont(g,h).then(()=&gt;this._AddLoadedSize(l)));return Promise.all(e)}async _LoadWebFont(e,g){try{const h=await this.GetProjectFileUrl(g,this._fontsSubfolder),l=new FontFace(e,`url('${h}')`);this._runtime.IsInWorker()?self.fonts.add(l):document.fonts.add(l);await l.load()}catch(h){console.warn(`[C3 runtime] Failed to load web font '${e}': `,h)}}IsAudioFormatSupported(e){return!!this._supportedAudioFormats[e]}_SetAudioFiles(e,g){this._preloadSounds=!!g;for(const [h,l,m]of e)this._audioFiles.set(h,
{fileName:h,formats:l.map(n=&gt;({type:n[0],fileExtension:n[1],fullName:h+n[1],fileSize:n[2]})),isMusic:m})}GetPreferredAudioFile(e){e=this._audioFiles.get(e.toLowerCase());if(!e)return null;let g=null;for(const h of e.formats)if(g||"audio/webm; codecs=opus"!==h.type||(g=h),this.IsAudioFormatSupported(h.type))return h;return g}GetProjectAudioFileUrl(e){return(e=this.GetPreferredAudioFile(e))?{url:this.GetMediaFileUrl(e.fullName),type:e.type}:null}GetAudioToPreload(){if(this._preloadSounds){const e=[];
for(const g of this._audioFiles.values()){if(g.isMusic)continue;const h=this.GetPreferredAudioFile(g.fileName);h&amp;&amp;e.push({originalUrl:g.fileName,url:this.GetMediaFileUrl(h.fullName),type:h.type,fileSize:h.fileSize})}return e}return[]}GetIAssetManager(){return this._iAssetManager}async LoadScripts(...e){e=await Promise.all(e.map(g=&gt;this.GetProjectFileUrl(g)));this._runtime.IsInWorker()?importScripts(...e):await Promise.all(e.map(g=&gt;d(g)))}async CompileWebAssembly(e){if(WebAssembly.compileStreaming)return e=
await this.GetProjectFileUrl(e),await WebAssembly.compileStreaming(fetch(e));e=await c.FetchArrayBuffer(e);return await WebAssembly.compile(e)}async LoadStyleSheet(e){e=await this.GetProjectFileUrl(e);return await this._runtime.PostComponentMessageToDOMAsync("runtime","add-stylesheet",{url:e})}}}"use strict";
{const c=self.C3;c.Asset=class extends c.DefendedBase{constructor(b,a){super();this._assetManager=b;this._runtime=b.GetRuntime();this._url=a.url;this._size=a.size;this._loadPolicy=a.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(b=&gt;{this._isLoaded=!0;this._loadPromise=null;this._blob=b}).catch(b=&gt;console.error("Error loading resource: ",b))}IsLoaded(){return this._isLoaded}GetBlob(){return this._blob?Promise.resolve(this._blob):this._assetManager.FetchBlob(this._url,this._loadPolicy)}}}"use strict";
{const c=self.C3,b=new c.PromiseThrottle,a=new Set;c.ImageAsset=class extends c.Asset{constructor(f,d){super(f,d);this._webglTexture=this._texturePromise=null;this._refCount=0;this._imageHeight=this._imageWidth=-1;a.add(this)}Release(){this.ReleaseTexture();if(0!==this._refCount)throw Error("released image asset which still has texture references");this._texturePromise=null;a.delete(this);super.Release()}static OnWebGLContextLost(){for(const f of a)f._texturePromise=null,f._webglTexture=null,f._refCount=
0}LoadStaticTexture(f,d){this._refCount++;return this._webglTexture?Promise.resolve(this._webglTexture):this._texturePromise?this._texturePromise:this._texturePromise=this.GetBlob().then(e=&gt;b.Add(()=&gt;f.CreateStaticTextureAsync(e,d).then(g=&gt;{this._texturePromise=null;if(0===this._refCount)return f.DeleteTexture(g),null;this._webglTexture=g;this._imageWidth=g.GetWidth();this._imageHeight=g.GetHeight();return this._webglTexture}))).catch(e=&gt;{console.error("Failed to load texture: ",e);throw e;})}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 f=await this.GetBlob();return c.Supports.ImageBitmapOptions?await createImageBitmap(f,{premultiplyAlpha:"none"}):c.Supports.ImageBitmap?await createImageBitmap(f):
await c.BlobToImage(f)}}}"use strict";
{const c=self.C3;function b(a,f){return a.GetWorldInfo()._GetLastCachedZIndex()-f.GetWorldInfo()._GetLastCachedZIndex()}c.RenderCell=class extends c.DefendedBase{constructor(a,f,d){super();this._grid=a;this._x=f;this._y=d;this._instances=[];this._isSorted=!0;this._pendingRemoval=new Set;this._isAnyPendingRemoval=!1}Release(){c.clearArray(this._instances);this._pendingRemoval.clear();this._grid=null}Reset(){c.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():(c.arrayRemoveAllInSet(this._instances,this._pendingRemoval),this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1))}_EnsureSorted(){this._isSorted||(this._instances.sort(b),this._isSorted=!0)}Dump(a){this._FlushPending();this._EnsureSorted();this._instances.length&amp;&amp;a.push(this._instances)}}}"use strict";
{const c=self.C3;c.RenderGrid=class extends c.DefendedBase{constructor(b,a){super();this._cellWidth=b;this._cellHeight=a;this._cells=c.New(c.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(b,a,f){let d=this._cells.Get(b,a);return d?d:f?(d=c.New(c.RenderCell,this,b,a),this._cells.Set(b,a,d),d):null}XToCell(b){return Math.floor(b/this._cellWidth)}YToCell(b){return Math.floor(b/this._cellHeight)}Update(b,a,f){if(a)for(let d=a.getLeft(),e=a.getRight();d&lt;=e;++d)for(let g=a.getTop(),h=
a.getBottom();g&lt;=h;++g){if(f&amp;&amp;f.containsPoint(d,g))continue;const l=this.GetCell(d,g,!1);l&amp;&amp;(l.Remove(b),l.IsEmpty()&amp;&amp;this._cells.Delete(d,g))}if(f)for(let d=f.getLeft(),e=f.getRight();d&lt;=e;++d)for(let g=f.getTop(),h=f.getBottom();g&lt;=h;++g)a&amp;&amp;a.containsPoint(d,g)||this.GetCell(d,g,!0).Insert(b)}QueryRange(b,a){let f=this.XToCell(b.getLeft());const d=this.YToCell(b.getTop()),e=this.XToCell(b.getRight());for(b=this.YToCell(b.getBottom());f&lt;=e;++f)for(let g=d;g&lt;=b;++g){const h=this.GetCell(f,g,!1);h&amp;&amp;
h.Dump(a)}}MarkRangeChanged(b){let a=b.getLeft();const f=b.getTop(),d=b.getRight();for(b=b.getBottom();a&lt;=d;++a)for(let e=f;e&lt;=b;++e){const g=this.GetCell(a,e,!1);g&amp;&amp;g.SetChanged()}}}}"use strict";
{const c=self.C3,b=new c.Rect,a=new c.Quad,f=[],d=new c.Rect,e=new c.Rect,g=self.glMatrix.vec3,h=g.fromValues(0,1,0);function l(n,r){return n.GetWorldInfo()._GetLastCachedZIndex()-r.GetWorldInfo()._GetLastCachedZIndex()}function m(n,r){return n.GetWorldInfo().GetZElevation()-r.GetWorldInfo().GetZElevation()}c.Layer=class extends c.DefendedBase{constructor(n,r,q){super();this._layout=n;this._runtime=n.GetRuntime();this._name=q[0];this._index=r;this._sid=q[2];this._isVisible=!!q[3];this._backgroundColor=
c.New(c.Color);this._backgroundColor.setFromJSON(q[4].map(t=&gt;t/255));this._isTransparent=!!q[5];this._parallaxX=q[6];this._parallaxY=q[7];this._color=c.New(c.Color,1,1,1,q[8]);this._premultipliedColor=c.New(c.Color);this._isForceOwnTexture=q[9];this._useRenderCells=q[10];this._scaleRate=q[11];this._blendMode=q[12];this._curRenderTarget=null;this._scale=1;this._zElevation=q[16];this._angle=0;this._isAngleEnabled=!0;this._viewport=c.New(c.Rect);this._viewportZ0=c.New(c.Rect);this._startupInitialInstances=
[];this._initialInstances=[];this._createdGlobalUids=[];this._instances=[];this._anyInstanceZElevated=this._zIndicesUpToDate=!1;this._effectList=c.New(c.EffectList,this,q[15]);this._renderGrid=null;this._lastRenderList=[];this._isRenderListUpToDate=!1;this._lastRenderCells=c.New(c.Rect,0,0,-1,-1);this._curRenderCells=c.New(c.Rect,0,0,-1,-1);this._iLayer=new self.ILayer(this);this._UpdatePremultipliedColor();this._useRenderCells&amp;&amp;(this._renderGrid=c.New(c.RenderGrid,this._runtime.GetOriginalViewportWidth(),
this._runtime.GetOriginalViewportHeight()));for(const t of q[14])n=this._runtime.GetObjectClassByIndex(t[1]),this._layout._AddInitialObjectClass(n),n.GetDefaultInstanceData()||(n.SetDefaultInstanceData(t),n._SetDefaultLayerIndex(this._index)),this._initialInstances.push(t);c.shallowAssignArray(this._startupInitialInstances,this._initialInstances)}static Create(n,r,q){return c.New(c.Layer,n,r,q)}Release(){this._runtime=this._layout=null}CreateInitialInstances(n){const r=this._layout.IsFirstVisit();
let q=0;const t=this._initialInstances;for(let w=0,y=t.length;w&lt;y;++w){var u=t[w];const C=this._runtime.GetObjectClassByIndex(u[1]);let G=!0;if(!C.HasPersistBehavior()||r)u=this._runtime.CreateInstanceFromData(u,this,!0),n.push(u),C.IsGlobal()&amp;&amp;(G=!1,this._createdGlobalUids.push(u.GetUID()));G&amp;&amp;(t[q]=t[w],++q)}c.truncateArray(t,q);this._runtime.FlushPendingInstances();this.SetZIndicesChanged()}_AddInstance(n,r){const q=n.GetWorldInfo();if(q.GetLayer()!==this)throw Error("instance added to wrong layer");
this._instances.push(n);0!==q.GetZElevation()&amp;&amp;(this._anyInstanceZElevated=!0);r&amp;&amp;this._useRenderCells&amp;&amp;n.GetWorldInfo().SetBboxChanged();this.SetZIndicesChanged()}_MaybeAddInstance(n){this._instances.includes(n)||(this._instances.push(n),0!==n.GetWorldInfo().GetZElevation()&amp;&amp;(this._anyInstanceZElevated=!0),this.SetZIndicesChanged())}_PrependInstance(n,r){const q=n.GetWorldInfo();if(q.GetLayer()!==this)throw Error("instance added to wrong layer");this._instances.unshift(n);0!==q.GetZElevation()&amp;&amp;
(this._anyInstanceZElevated=!0);this.SetZIndicesChanged();r&amp;&amp;this._useRenderCells&amp;&amp;n.GetWorldInfo().SetBboxChanged()}_RemoveInstance(n,r){const q=this._instances.indexOf(n);0&gt;q||(r&amp;&amp;this._useRenderCells&amp;&amp;n.GetWorldInfo()._RemoveFromRenderCells(),this._instances.splice(q,1),this.SetZIndicesChanged(),this._MaybeResetAnyInstanceZElevatedFlag())}_SetAnyInstanceZElevated(){this._anyInstanceZElevated=!0}_MaybeResetAnyInstanceZElevatedFlag(){0===this._instances.length&amp;&amp;(this._anyInstanceZElevated=!1)}_SortInstancesByLastCachedZIndex(n){if(n){n=
new Set;for(var r of this._instances){var q=r.GetWorldInfo()._GetLastCachedZIndex();0&lt;=q&amp;&amp;n.add(q)}r=-1;for(const t of this._instances)if(q=t.GetWorldInfo(),!(0&lt;=q._GetLastCachedZIndex())){for(++r;n.has(r);)++r;q._SetZIndex(r)}}this._instances.sort(l)}_Start(){}_End(){for(const n of this._instances)n.GetObjectClass().IsGlobal()||this._runtime.DestroyInstance(n);this._runtime.FlushPendingInstances();c.clearArray(this._instances);this._anyInstanceZElevated=!1;this.SetZIndicesChanged()}RecreateInitialObjects(n,
r,q,t){const u=this._runtime.GetEventSheetManager(),w=this._runtime.GetAllObjectClasses(),y=n.IsFamily(),C=[];for(const B of this._initialInstances){var G=B[0];if(r.containsPoint(G[0],G[1])){G=w[B[1]];if(G!==n)if(y){if(!n.FamilyHasMember(G))continue}else continue;G=this;var x=this._runtime.GetCurrentLayout();this.GetLayout()!==x&amp;&amp;((G=x.GetLayerByName(this.GetName()))||(G=x.GetLayerByIndex(this.GetIndex())));G=this._runtime.CreateInstanceFromData(B,G,!1);x=G.GetWorldInfo();x.OffsetXY(q,t);x.SetBboxChanged();
u.BlockFlushingInstances(!0);G._TriggerOnCreated();if(G.IsInContainer())for(const H of G.siblings())H._TriggerOnCreated();u.BlockFlushingInstances(!1);C.push(G)}}return C}GetInstanceCount(){return this._instances.length}GetLayout(){return this._layout}GetName(){return this._name}GetIndex(){return this._index}GetSID(){return this._sid}GetRuntime(){return this._runtime}GetDevicePixelRatio(){return this._runtime.GetDevicePixelRatio()}GetEffectList(){return this._effectList}UsesRenderCells(){return this._useRenderCells}GetRenderGrid(){return this._renderGrid}SetRenderListStale(){this._isRenderListUpToDate=
!1}IsVisible(){return this._isVisible}SetVisible(n){n=!!n;this._isVisible!==n&amp;&amp;(this._isVisible=n,this._runtime.UpdateRender())}GetViewport(){return this._viewport}GetViewportForZ(n,r){var q=this._viewportZ0;if(0===n)r.copy(q);else{const t=this.Get2DScaleFactorToZ(n);n=q.midX();const u=q.midY(),w=.5*q.width()/t;q=.5*q.height()/t;r.set(n-w,u-q,n+w,u+q)}}GetOpacity(){return this._color.getA()}SetOpacity(n){n=c.clamp(n,0,1);this._color.getA()!==n&amp;&amp;(this._color.setA(n),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(n){this._scaleRate!==n&amp;&amp;(this._scaleRate=n,this._runtime.UpdateRender())}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(n,r){if(this._parallaxX!==n||this._parallaxY!==
r)if(this._parallaxX=n,this._parallaxY=r,this._runtime.UpdateRender(),1!==this._parallaxX||1!==this._parallaxY)for(const q of this._instances)q.GetObjectClass()._SetAnyInstanceParallaxed(!0)}SetParallaxX(n){this.SetParallax(n,this.GetParallaxY())}SetParallaxY(n){this.SetParallax(this.GetParallaxX(),n)}SetZElevation(n){n=+n;this._zElevation!==n&amp;&amp;(this._zElevation=n,this._runtime.UpdateRender())}GetZElevation(){return this._zElevation}SetAngle(n){this._angle=c.clampAngle(n)}GetAngle(){return this._isAngleEnabled?
c.clampAngle(this._layout.GetAngle()+this._angle):0}GetOwnAngle(){return this._angle}HasInstances(){return 0&lt;this._instances.length}_GetInstances(){return this._instances}GetBackgroundColor(){return this._backgroundColor}IsTransparent(){return this._isTransparent}SetTransparent(n){this._isTransparent=!!n}IsForceOwnTexture(){return this._isForceOwnTexture}SetForceOwnTexture(n){this._isForceOwnTexture=!!n}SetBlendMode(n){this._blendMode!==n&amp;&amp;(this._blendMode=n,this._runtime.UpdateRender())}GetBlendMode(){return this._blendMode}IsTransformCompatibleWith(n){return this===
n||this._parallaxX===n._parallaxX&amp;&amp;this._parallaxY===n._parallaxY&amp;&amp;this._scale===n._scale&amp;&amp;this._scaleRate===n._scaleRate&amp;&amp;this._angle===n._angle}_RemoveAllInstancesInSet(n){0!==n.size&amp;&amp;0&lt;c.arrayRemoveAllInSet(this._instances,n)&amp;&amp;(this._MaybeResetAnyInstanceZElevatedFlag(),this.SetZIndicesChanged())}SetZIndicesChanged(){this._isRenderListUpToDate=this._zIndicesUpToDate=!1}_UpdateZIndices(){if(!this._zIndicesUpToDate){this._instances.sort(m);if(this._useRenderCells)for(let n=0,r=this._instances.length;n&lt;
r;++n){const q=this._instances[n].GetWorldInfo();q._SetZIndex(n);this._renderGrid.MarkRangeChanged(q.GetRenderCellRange())}else for(let n=0,r=this._instances.length;n&lt;r;++n)this._instances[n].GetWorldInfo()._SetZIndex(n);this._zIndicesUpToDate=!0}}MoveInstanceAdjacent(n,r,q){var t=n.GetWorldInfo();r=r.GetWorldInfo();if(t.GetLayer()!==this||r.GetLayer()!==this)throw Error("can't arrange Z order unless both objects on this layer");t=t.GetZIndex();r=r.GetZIndex();if(t===r+(q?1:-1))return!1;c.arrayRemove(this._instances,
t);t&lt;r&amp;&amp;r--;q&amp;&amp;r++;r===this._instances.length?this._instances.push(n):this._instances.splice(r,0,n);this.SetZIndicesChanged();return!0}_MergeSortedZArrays(n,r){const q=[];let t=0,u=0,w=n.length,y=r.length;for(;t&lt;w&amp;&amp;u&lt;y;){const C=n[t],G=r[u];C.GetWorldInfo()._GetLastCachedZIndex()&lt;G.GetWorldInfo()._GetLastCachedZIndex()?(q.push(C),++t):(q.push(G),++u)}for(;t&lt;w;++t)q.push(n[t]);for(;u&lt;y;++u)q.push(r[u]);return q}_MergeAllSortedZArrays_pass(n){const r=[],q=n.length;for(let t=0;t&lt;q-1;t+=2)r.push(this._MergeSortedZArrays(n[t],
n[t+1]));1===q%2&amp;&amp;r.push(n[q-1]);return r}_MergeAllSortedZArrays(n){for(;1&lt;n.length;)n=this._MergeAllSortedZArrays_pass(n);return n[0]}_GetRenderCellInstancesToDraw(){this._UpdateZIndices();c.clearArray(f);this._renderGrid.QueryRange(this._viewport,f);return f.length?1===f.length?f[0]:this._MergeAllSortedZArrays(f):[]}_IsOpaque(){return!this.UsesOwnTexture()&amp;&amp;!this.IsTransparent()}ShouldDraw(){return this.IsVisible()&amp;&amp;0&lt;this.GetOpacity()&amp;&amp;(this.HasInstances()||!this.IsTransparent())}UsesOwnTexture(){return this.IsForceOwnTexture()||
!this.HasDefaultColor()||0!==this.GetBlendMode()||this._effectList.HasAnyActiveEffect()}GetRenderTarget(){return this._curRenderTarget}_CanFastPathDrawLayer(n){if(0===n.length)return!0;if(2&lt;=n.length)return!1;n=n[0].GetShaderProgram();return!n.MustPreDraw()&amp;&amp;!n.UsesDest()&amp;&amp;!n.UsesCrossSampling()&amp;&amp;this.HasDefaultColor()}Get2DScaleFactorToZ(n){const r=this.GetCameraZ();return r/(r-n)}GetCameraZ(){return 100/this.GetNormalScale()}_SetTransform(n,r=0,q=0){const t=this._runtime.GetRenderScale();r=(this._viewport.midX()+
r)*t;q=(this._viewport.midY()+q)*t;const u=this.GetCameraZ();n.SetCameraXYZ(r,q,u);n.SetLookXYZ(r,q,u-100);r=this.GetAngle();0===r?g.set(h,0,1,0):g.set(h,Math.sin(r),Math.cos(r),0);n.ResetModelView(h);n.Scale(t,t);n.UpdateModelView()}Draw(n,r,q){const t=this._runtime.GetCanvasManager(),u=this.UsesOwnTexture();var w=null;let y=null;if(this._runtime.IsGPUProfiling()&amp;&amp;n.SupportsGPUProfiling()){const C=t.GetLayerTimingsBuffer(this);C&amp;&amp;(y=C.AddTimeElapsedQuery(),n.StartQuery(y))}u?(w={sampling:this._runtime.GetSampling()},
"low"===t.GetCurrentFullscreenScalingQuality()&amp;&amp;(w.width=t.GetDrawWidth(),w.height=t.GetDrawHeight()),w=this._runtime.GetAdditionalRenderTarget(w),n.SetRenderTarget(w),this.IsTransparent()&amp;&amp;n.ClearRgba(0,0,0,0)):n.SetRenderTarget(r);this.IsTransparent()||n.Clear(this._backgroundColor);this._curRenderTarget=w||r;this._SetTransform(n);n.SetBaseZ(this.GetZElevation());this.GetNormalScale()&gt;Number.EPSILON&amp;&amp;(this._UpdateZIndices(),this._useRenderCells&amp;&amp;0===this.GetZElevation()&amp;&amp;!this._anyInstanceZElevated?
this._DrawInstances_RenderCells(n):this._DrawInstances(n,this._instances));n.SetBaseZ(0);n.SetCurrentZ(0);n.SetCameraXYZ(0,0,100);n.SetLookXYZ(0,0,0);u&amp;&amp;this._DrawLayerOwnTextureToRenderTarget(n,w,r,q);y&amp;&amp;n.EndQuery(y);this._curRenderTarget=null}_DrawInstances(n,r){const q=this._viewport,t=this._curRenderTarget;let u=null;for(let w=0,y=r.length;w&lt;y;++w){const C=r[w];if(C===u)continue;u=C;const G=C.GetWorldInfo();G.IsVisible()&amp;&amp;G.IsInViewport(q)&amp;&amp;(G.HasAnyActiveEffect()?this._DrawInstanceWithEffectsAndRestore(C,
G,n,t):this._DrawInstance(C,G,n))}}_DrawInstances_RenderCells(n){var r=this._renderGrid;const q=this._curRenderCells,t=this._lastRenderCells,u=this._viewport;q.set(r.XToCell(u.getLeft()),r.YToCell(u.getTop()),r.XToCell(u.getRight()),r.YToCell(u.getBottom()));this._isRenderListUpToDate&amp;&amp;q.equals(t)?r=this._lastRenderList:(r=this._GetRenderCellInstancesToDraw(),this._isRenderListUpToDate=!0,t.copy(q));this._DrawInstances(n,r);r!==this._lastRenderList&amp;&amp;c.shallowAssignArray(this._lastRenderList,r)}_DrawInstance(n,
r,q){r=r.GetRendererStateGroup();q.GetCurrentStateGroup()!==r&amp;&amp;r.Apply();n.Draw(q)}_DrawInstanceWithEffectsAndRestore(n,r,q,t){this._DrawInstanceWithEffects(n,r,q,t,null)&amp;&amp;this._SetTransform(q)}_DrawInstanceWithEffects(n,r,q,t,u){const w=r.GetInstanceEffectList().GetActiveEffectTypes();if(1===w.length){const y=w[0],C=y.GetShaderProgram();if(!C.NeedsPostDrawOrExtendsBox()&amp;&amp;r.HasDefaultColor()&amp;&amp;!n.MustPreDraw())return this._DrawInstanceWithEffects_FastPath(n,r,y,C,q),!1}n=c.RenderEffectChain(q,this._runtime,
n,t,w,u);q.SetBaseZ(this.GetZElevation());return n}_DrawInstanceWithEffects_FastPath(n,r,q,t,u){u.SetProgram(t);u.SetBlendMode(r.GetBlendMode());t.IsAnimated()&amp;&amp;this._runtime.UpdateRender();let w=0,y=0;if(t.UsesAnySrcRectOrPixelSize()){const [C,G]=n.GetCurrentSurfaceSize();w=1/C;y=1/G;(t=n.GetCurrentTexRect())?e.copy(t):e.set(0,0,0,0)}q=r.GetInstanceEffectList().GetEffectParametersForIndex(q.GetIndex());u.SetCurrentZ(r.GetZElevation());u.SetProgramParameters(null,d,e,e,r.GetBoundingBox(),w,y,this.GetOwnScale(),
this.GetAngle(),this._runtime.GetGameTime(),q);n.Draw(u)}_DrawLayerOwnTextureToRenderTarget(n,r,q,t){const u=this._effectList.GetActiveEffectTypes(),w=this._runtime;if(this._CanFastPathDrawLayer(u)){n.SetRenderTarget(q);if(1===u.length){var y=u[0];q=y.GetShaderProgram();n.SetProgram(q);e.set(0,0,1,1);y=this._effectList.GetEffectParametersForIndex(y.GetIndex());n.SetProgramParameters(null,d,e,e,this._viewport,1/w.GetDrawWidth(),1/w.GetDrawHeight(),this.GetNormalScale(),this.GetAngle(),w.GetGameTime(),
y);q.IsAnimated()&amp;&amp;w.UpdateRender()}else n.SetTextureFillMode();t&amp;&amp;0===this._blendMode&amp;&amp;this.HasDefaultColor()&amp;&amp;0===u.length?n.CopyRenderTarget(r):(n.SetBlendMode(this._blendMode),n.SetColor(this._premultipliedColor),n.DrawRenderTarget(r));n.InvalidateRenderTarget(r);w.ReleaseAdditionalRenderTarget(r)}else c.RenderEffectChain(n,w,this,q,u)}GetOwnScale(){return this._scale}SetOwnScale(n){this._scale!==n&amp;&amp;(this._scale=n,this._layout.BoundScrolling(),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}UpdateViewport(){this._isAngleEnabled=!1;let [n,r]=this.CanvasCssToLayer(0,0);this._isAngleEnabled=!0;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(n=Math.round(n),r=Math.round(r));var q=1/this.GetNormalScale();const t=this._viewportZ0;t.set(n,r,n+this._runtime.GetViewportWidth()*q,r+this._runtime.GetViewportHeight()*
q);q=this.GetAngle();0!==q&amp;&amp;(b.copy(t),b.offset(-t.midX(),-t.midY()),a.setFromRotatedRect(b,q),a.getBoundingBox(b),b.offset(t.midX(),t.midY()),t.copy(b));this.GetViewportForZ(this._zElevation,this._viewport)}CanvasCssToLayer(n,r,q=0){return this._CanvasToLayer(n,r,q,this.GetDisplayScale())}DrawSurfaceToLayer(n,r,q=0){return this._CanvasToLayer(n,r,q,this.GetRenderScale()*this.GetDevicePixelRatio())}_CanvasToLayer(n,r,q,t){var u=this._runtime.GetParallaxXOrigin(),w=this._runtime.GetParallaxYOrigin();
u=(this._layout.GetScrollX()-u)*this._parallaxX+u;w=(this._layout.GetScrollY()-w)*this._parallaxY+w;var y=this.GetNormalScale(),C=this._runtime.GetViewportWidth()/y;y=this._runtime.GetViewportHeight()/y;n=u-C/2+n/t;r=w-y/2+r/t;C=this.GetAngle();0!==C&amp;&amp;(n-=u,r-=w,t=Math.cos(C),C=Math.sin(C),y=n*t-r*C,r=r*t+n*C,n=y,n+=u,r+=w);0!==q&amp;&amp;(u=this._viewportZ0.midX(),w=this._viewportZ0.midY(),q=this.Get2DScaleFactorToZ(q),n=(n-u)/q+u,r=(r-w)/q+w);return[n,r]}CanvasCssToLayer_DefaultTransform(n,r){const q=this._scale,
t=this._scaleRate,u=this._parallaxX,w=this._parallaxY,y=this._angle;this._parallaxY=this._parallaxX=this._scaleRate=this._scale=1;this._angle=0;n=this.CanvasCssToLayer(n,r);this._scale=q;this._scaleRate=t;this._parallaxX=u;this._parallaxY=w;this._angle=y;return n}LayerToCanvasCss(n,r,q=0){return this._LayerToCanvas(n,r,q,this.GetDisplayScale())}LayerToDrawSurface(n,r,q=0){return this._LayerToCanvas(n,r,q,this.GetRenderScale()*this.GetDevicePixelRatio())}_LayerToCanvas(n,r,q,t){var u=this._runtime,
w=this._layout;if(0!==q){var y=this._viewportZ0.midX(),C=this._viewportZ0.midY();q=this.Get2DScaleFactorToZ(q);n=(n-y)*q+y;r=(r-C)*q+C}y=u.GetParallaxXOrigin();C=u.GetParallaxYOrigin();y=(w.GetScrollX()-y)*this._parallaxX+y;w=(w.GetScrollY()-C)*this._parallaxY+C;q=this.GetAngle();if(0!==q){n-=y;r-=w;C=Math.cos(-q);q=Math.sin(-q);const G=n*C-r*q;r=r*C+n*q;n=G;n+=y;r+=w}q=this.GetNormalScale();C=u.GetViewportWidth()/q;u=u.GetViewportHeight()/q;return[(n-(y-C/2))*t,(r-(w-u/2))*t]}_GetLayerToDrawSurfaceScale(n,
r){n*=this.GetRenderScale()*this.GetDevicePixelRatio();0!==r&amp;&amp;(n*=this.Get2DScaleFactorToZ(r));return n}_SaveToJson(){return{s:this.GetOwnScale(),a:this.GetOwnAngle(),vl:this._viewport.getLeft(),vt:this._viewport.getTop(),vr:this._viewport.getRight(),vb:this._viewport.getBottom(),v:this.IsVisible(),bc:this._backgroundColor.toJSON(),t:this.IsTransparent(),px:this.GetParallaxX(),py:this.GetParallaxY(),c:this._color.toJSON(),sr:this.GetScaleRate(),fx:this._effectList.SaveToJson(),cg:this._createdGlobalUids}}_LoadFromJson(n){this._scale=
n.s;this._angle=n.a;this._viewport.set(n.vl,n.vt,n.vr,n.vb);this._isVisible=!!n.v;this._backgroundColor.setFromJSON(n.bc);this._isTransparent=!!n.t;this._parallaxX=n.px;this._parallaxY=n.py;this._color.setFromJSON(n.c);this._scaleRate=n.sr;c.shallowAssignArray(this._createdGlobalUids,n.cg);c.shallowAssignArray(this._initialInstances,this._startupInitialInstances);const r=new Set(this._createdGlobalUids);let q=0;for(let t=0,u=this._initialInstances.length;t&lt;u;++t)r.has(this._initialInstances[t][2])||
(this._initialInstances[q]=this._initialInstances[t],++q);c.truncateArray(this._initialInstances,q);this._effectList.LoadFromJson(n.fx);this._SortInstancesByLastCachedZIndex(!1);this.SetZIndicesChanged()}GetILayer(){return this._iLayer}}}"use strict";
{const c=self.C3,b=self.C3Debugger,a=c.New(c.Rect),f=c.New(c.Rect),d=c.New(c.Rect);c.Layout=class extends c.DefendedBase{constructor(e,g,h){super();this._layoutManager=e;this._runtime=e.GetRuntime();this._name=h[0];this._originalWidth=h[1];this._originalHeight=h[2];this._width=h[1];this._height=h[2];this._isUnboundedScrolling=!!h[3];this._eventSheetName=h[4];this._eventSheet=null;this._sid=h[5];this._index=g;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._layers=[];this._layersByName=new Map;this._layersBySid=new Map;this._effectList=c.New(c.EffectList,this,h[8]);this._curRenderTarget=null;this._persistData={};this._isFirstVisit=!0;this._iLayout=new self.ILayout(this);this._userScriptDispatcher=c.New(c.Event.Dispatcher);for(const l of h[6])e=c.Layer.Create(this,this._layers.length,l),this._layers.push(e),this._layersByName.set(e.GetName().toLowerCase(),
e),this._layersBySid.set(e.GetSID(),e);for(const l of h[7]){h=this._runtime.GetObjectClassByIndex(l[1]);if(!h)throw Error("missing nonworld object class");h.GetDefaultInstanceData()||h.SetDefaultInstanceData(l);this._initialNonWorld.push(l);this._AddInitialObjectClass(h)}}Release(){for(const e of this._layers)e.Release();c.clearArray(this._layers);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}GetMinLayerScale(){let e=
this._layers[0].GetNormalScale();for(let g=1,h=this._layers.length;g&lt;h;++g){const l=this._layers[g];if(0!==l.GetParallaxX()||0!==l.GetParallaxY())e=Math.min(e,l.GetNormalScale())}return e}SetScrollX(e){if(!this._isUnboundedScrolling){const g=this._runtime.GetViewportWidth()*(1/this.GetMinLayerScale())/2;e&gt;this._width-g&amp;&amp;(e=this._width-g);e&lt;g&amp;&amp;(e=g)}this._scrollX!==e&amp;&amp;(this._scrollX=e,this._runtime.UpdateRender())}GetScrollX(){return this._scrollX}SetScrollY(e){if(!this._isUnboundedScrolling){const g=
this._runtime.GetViewportHeight()*(1/this.GetMinLayerScale())/2;e&gt;this._height-g&amp;&amp;(e=this._height-g);e&lt;g&amp;&amp;(e=g)}this._scrollY!==e&amp;&amp;(this._scrollY=e,this._runtime.UpdateRender())}GetScrollY(){return this._scrollY}BoundScrolling(){this.SetScrollX(this.GetScrollX());this.SetScrollY(this.GetScrollY())}GetScale(){return this._scale}SetScale(e){e=+e;this._scale!==e&amp;&amp;(this._scale=e,this.BoundScrolling())}SetAngle(e){this._angle=c.clampAngle(e)}GetAngle(){return this._angle}GetWidth(){return this._width}SetWidth(e){!isFinite(e)||
1&gt;e||(this._width=e)}GetHeight(){return this._height}SetHeight(e){!isFinite(e)||1&gt;e||(this._height=e)}GetEventSheet(){return this._eventSheet}GetLayers(){return this._layers}GetLayerCount(){return this._layers.length}GetLayer(e){return"number"===typeof e?this.GetLayerByIndex(e):this.GetLayerByName(e.toString())}GetLayerByIndex(e){e=c.clamp(Math.floor(e),0,this._layers.length-1);return this._layers[e]}GetLayerByName(e){return this._layersByName.get(e.toLowerCase())||null}GetLayerBySID(e){return this._layersBySid.get(e)||
null}HasOpaqueBottomLayer(){for(const e of this._layers)if(e.ShouldDraw())return e._IsOpaque();return!1}IsFirstVisit(){return this._isFirstVisit}_GetInitialObjectClasses(){return[...this._initialObjectClasses]}_AddInitialObjectClass(e){if(e.IsInContainer())for(const g of e.GetContainer().GetObjectTypes())this._initialObjectClasses.add(g);else this._initialObjectClasses.add(e)}_GetTextureLoadedObjectTypes(){return[...this._textureLoadedTypes]}_Load(e,g){if(e===this||!g)return Promise.resolve();e&amp;&amp;
(c.CopySet(this._textureLoadedTypes,e._textureLoadedTypes),e._textureLoadedTypes.clear());e=[];for(const h of this._initialObjectClasses)this._textureLoadedTypes.has(h)||(e.push(h.LoadTextures(g)),this._textureLoadedTypes.add(h));return Promise.all(e)}async MaybeLoadTexturesFor(e){if(e.IsFamily())throw Error("cannot load textures for family");var g=this._runtime.GetWebGLRenderer();!g||g.IsContextLost()||this._textureLoadedTypes.has(e)||(this._textureLoadedTypes.add(e),g=e.LoadTextures(g),this._AddPendingTextureLoadPromise(g),
await g,e.OnDynamicTextureLoadComplete(),this._runtime.UpdateRender())}_AddPendingTextureLoadPromise(e){this._textureLoadPendingPromises.add(e);e.then(()=&gt;this._textureLoadPendingPromises.delete(e)).catch(()=&gt;this._textureLoadPendingPromises.delete(e))}WaitForPendingTextureLoadsToComplete(){return Promise.all([...this._textureLoadPendingPromises])}MaybeUnloadTexturesFor(e){if(e.IsFamily()||0&lt;e.GetInstanceCount())throw Error("cannot unload textures");const g=this._runtime.GetWebGLRenderer();g&amp;&amp;this._textureLoadedTypes.has(e)&amp;&amp;
(this._textureLoadedTypes.delete(e),e.ReleaseTextures(g))}_Unload(e,g){if(e!==this&amp;&amp;g)for(const h of this._textureLoadedTypes)h.IsGlobal()||e._initialObjectClasses.has(h)||(h.ReleaseTextures(),this._textureLoadedTypes.delete(h))}_OnWebGLContextLost(){this._textureLoadedTypes.clear()}async _StartRunning(e){const g=this._runtime,h=this._layoutManager,l=g.GetEventSheetManager();this._eventSheetName&amp;&amp;(this._eventSheet=l.GetEventSheetByName(this._eventSheetName),this._eventSheet._UpdateDeepIncludes());
h._SetMainRunningLayout(this);this._width=this._originalWidth;this._height=this._originalHeight;this._scrollX=g.GetOriginalViewportWidth()/2;this._scrollY=g.GetOriginalViewportHeight()/2;this.BoundScrolling();this._MoveGlobalObjectsToThisLayout(e);this._runtime.SetUsingCreatePromises(!0);this._CreateInitialInstances();this._isFirstVisit||this._CreatePersistedInstances();this._CreateAndLinkContainerInstances(this._createdInstances);this._CreateInitialNonWorldInstances();h.ClearPendingChangeLayout();
g.FlushPendingInstances();this._runtime.SetUsingCreatePromises(!1);const m=this._runtime.GetCreatePromises();await Promise.all(m);c.clearArray(m);if(g.IsLoadingState())g._TriggerOnCreateAfterLoad(this._createdInstances);else for(const n of this._createdInstances)n._TriggerOnCreated(),n.SetupInitialSceneGraphConnections();c.clearArray(this._createdInstances);await Promise.all([...this._initialObjectClasses].map(n=&gt;n.PreloadTexturesWithInstances(this._runtime.GetWebGLRenderer())));e&amp;&amp;(g.Dispatcher().dispatchEvent(new c.Event("beforefirstlayoutstart")),
await g.DispatchUserScriptEventAsyncWait(new c.Event("beforeprojectstart")));await this.DispatchUserScriptEventAsyncWait(new c.Event("beforelayoutstart"));g.IsLoadingState()||await g.TriggerAsync(c.Plugins.System.Cnds.OnLayoutStart,null,null);await this.DispatchUserScriptEventAsyncWait(new c.Event("afterlayoutstart"));e&amp;&amp;(g.Dispatcher().dispatchEvent(new c.Event("afterfirstlayoutstart")),await g.DispatchUserScriptEventAsyncWait(new c.Event("afterprojectstart")));l._RunQueuedTriggers(h);await this.WaitForPendingTextureLoadsToComplete();
this._isFirstVisit=!1}_MoveGlobalObjectsToThisLayout(e){for(const h of this._runtime.GetAllObjectClasses())if(!h.IsFamily()&amp;&amp;h.IsWorldType())for(const l of h.GetInstances()){const m=l.GetWorldInfo();var g=m.GetLayer();g=c.clamp(g.GetIndex(),0,this._layers.length-1);g=this._layers[g];m._SetLayer(g);g._MaybeAddInstance(l)}if(!e)for(const h of this._layers)h._SortInstancesByLastCachedZIndex(!1)}_CreateInitialInstances(){for(const e of this._layers)e.CreateInitialInstances(this._createdInstances),e.UpdateViewport(),
e._Start()}_CreatePersistedInstances(){let e=!1;for(const [h,l]of Object.entries(this._persistData)){const m=this._runtime.GetObjectClassBySID(parseInt(h,10));if(m&amp;&amp;!m.IsFamily()&amp;&amp;m.HasPersistBehavior()){for(const n of l){var g=null;if(m.IsWorldType()&amp;&amp;(g=this.GetLayerBySID(n.w.l),!g))continue;g=this._runtime.CreateInstanceFromData(m,g,!1,0,0,!0);g.LoadFromJson(n);e=!0;this._createdInstances.push(g)}c.clearArray(l)}}for(const h of this._layers)h._SortInstancesByLastCachedZIndex(!0),h.SetZIndicesChanged();
e&amp;&amp;(this._runtime.FlushPendingInstances(),this._runtime._RefreshUidMap())}_CreateAndLinkContainerInstances(e){for(const h of e){if(!h.IsInContainer())continue;const l=h.GetWorldInfo(),m=h.GetIID();for(const n of h.GetObjectClass().GetContainer().objectTypes())if(n!==h.GetObjectClass()){var g=n.GetInstances();g.length&gt;m?h._AddSibling(g[m]):(g=l?this._runtime.CreateInstanceFromData(n,l.GetLayer(),!0,l.GetX(),l.GetY(),!0):this._runtime.CreateInstanceFromData(n,null,!0,0,0,!0),this._runtime.FlushPendingInstances(),
n._UpdateIIDs(),h._AddSibling(g),e.push(g))}}}_CreateInitialNonWorldInstances(){for(const e of this._initialNonWorld)this._runtime.GetObjectClassByIndex(e[1]).IsInContainer()||this._runtime.CreateInstanceFromData(e,null,!0)}_CreateGlobalNonWorlds(){const e=[],g=this._initialNonWorld;let h=0;for(let l=0,m=g.length;l&lt;m;++l){const n=g[l],r=this._runtime.GetObjectClassByIndex(n[1]);r.IsGlobal()?r.IsInContainer()&amp;&amp;r.GetContainer().HasAnyWorldType()||e.push(this._runtime.CreateInstanceFromData(n,null,!0)):
(g[h]=n,++h)}c.truncateArray(g,h);this._runtime.FlushPendingInstances();this._CreateAndLinkContainerInstances(e)}RecreateInitialObjects(e,g,h,l,m){if(h)return h.RecreateInitialObjects(e,g,l,m);h=[];for(const n of this._layers)h.push(n.RecreateInitialObjects(e,g,l,m));return h.flat()}async _StopRunning(){const e=this._layoutManager;this._runtime.IsLoadingState()||await this._runtime.TriggerAsync(c.Plugins.System.Cnds.OnLayoutEnd,null,null);e.SetIsEndingLayout(!0);this._runtime.GetEventSheetManager().ClearAllScheduledWaits();
this._isFirstVisit||this._SavePersistData();for(const g of this._layers)g._End();for(const g of this._runtime.GetAllObjectClasses())if(!(g.IsGlobal()||g.IsWorldType()||g.GetPlugin().IsSingleGlobal()||g.IsFamily())){for(const h of g.GetInstances())this._runtime.DestroyInstance(h);this._runtime.FlushPendingInstances()}e.SetIsEndingLayout(!1);e.GetMainRunningLayout()===this&amp;&amp;e._SetMainRunningLayout(null)}_SaveInstanceToPersist(e){const g=e.GetObjectClass().GetSID().toString();this._persistData.hasOwnProperty(g)||
(this._persistData[g]=[]);this._persistData[g].push(e.SaveToJson())}_SavePersistData(){for(const e of this._layers){e._UpdateZIndices();for(const g of e._GetInstances()){const h=g.GetObjectClass();!h.IsGlobal()&amp;&amp;h.HasPersistBehavior()&amp;&amp;this._SaveInstanceToPersist(g)}}}ResetPersistData(){this._persistData={};this._isFirstVisit=!0}GetRenderTarget(){return this._curRenderTarget}UsesOwnTexture(){return"low"===this._runtime.GetCanvasManager().GetCurrentFullscreenScalingQuality()||this._runtime.UsesAnyBackgroundBlending()||
"low-latency"===this._runtime.GetCompositingMode()||this._effectList.HasAnyActiveEffect()}_CanFastPathDrawLayout(e){return 0===e.length?!0:2&lt;=e.length?!1:!e[0].GetShaderProgram().MustPreDraw()}Draw(e){var g=this._runtime.GetCanvasManager();const h=this.UsesOwnTexture();var l=null;h?("low-latency"!==this._runtime.GetCompositingMode()&amp;&amp;(e.SetRenderTarget(null),e.ClearRgba(0,0,0,0)),l={sampling:this._runtime.GetSampling(),readback:this._runtime.UsesAnyBackgroundBlending()||this._effectList.HasAnyActiveEffect()},
"low"===g.GetCurrentFullscreenScalingQuality()&amp;&amp;(l.width=g.GetDrawWidth(),l.height=g.GetDrawHeight()),l=this._runtime.GetAdditionalRenderTarget(l),e.SetRenderTarget(l)):e.SetRenderTarget(null);this.HasOpaqueBottomLayer()||e.ClearRgba(0,0,0,0);this._curRenderTarget=l;g=!0;for(const m of this._layers)m.UpdateViewport(),m.ShouldDraw()&amp;&amp;(m.Draw(e,l,g),g=!1);h&amp;&amp;this._DrawLayoutOwnTextureToRenderTarget(e,l);this._curRenderTarget=null}_DrawLayoutOwnTextureToRenderTarget(e,g){const h=this._effectList.GetActiveEffectTypes(),
l=this._runtime;if(this._CanFastPathDrawLayout(h)){e.SetRenderTarget(null);if(1===h.length){var m=h[0];const n=m.GetShaderProgram();e.SetProgram(n);f.set(0,0,1,1);d.set(0,0,l.GetViewportWidth(),l.GetViewportHeight());m=this._effectList.GetEffectParametersForIndex(m.GetIndex());e.SetProgramParameters(null,a,f,f,d,1/l.GetDrawWidth(),1/l.GetDrawHeight(),this.GetScale(),this.GetAngle(),l.GetGameTime(),m);n.IsAnimated()&amp;&amp;l.UpdateRender()}else e.SetTextureFillMode();0===h.length?e.CopyRenderTarget(g):(e.SetAlphaBlend(),
e.ResetColor(),e.DrawRenderTarget(g));e.InvalidateRenderTarget(g);l.ReleaseAdditionalRenderTarget(g)}else c.RenderEffectChain(e,l,this,null,h)}_SaveToJson(){const e={sx:this.GetScrollX(),sy:this.GetScrollY(),s:this.GetScale(),a:this.GetAngle(),w:this.GetWidth(),h:this.GetHeight(),fv:this._isFirstVisit,persist:this._persistData,fx:this._effectList.SaveToJson(),layers:{}};for(const g of this._layers)e.layers[g.GetSID().toString()]=g._SaveToJson();return e}_LoadFromJson(e){this._scrollX=e.sx;this._scrollY=
e.sy;this._scale=e.s;this._angle=e.a;this._width=e.w;this._height=e.h;this._isFirstVisit=!!e.fv;this._persistData=e.persist;this._effectList.LoadFromJson(e.fx);for(const [g,h]of Object.entries(e.layers))e=parseInt(g,10),(e=this.GetLayerBySID(e))&amp;&amp;e._LoadFromJson(h)}GetILayout(){return this._iLayout}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(e){e.layout=this.GetILayout();var g=this._runtime;(g=g.IsDebug()&amp;&amp;!g.GetEventSheetManager().IsInEventEngine())&amp;&amp;b.StartMeasuringScriptTime();
this._userScriptDispatcher.dispatchEvent(e);g&amp;&amp;b.AddScriptTime()}DispatchUserScriptEventAsyncWait(e){e.layout=this.GetILayout();return this._userScriptDispatcher.dispatchEventAndWaitAsync(e)}}}"use strict";
{const c=self.C3;c.LayoutManager=class extends c.DefendedBase{constructor(b){super();this._runtime=b;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;c.clearArray(this._allLayouts);this._layoutsByName.clear();this._layoutsBySid.clear();c.clearArray(this._runningSubLayouts)}Create(b){b=
c.New(c.Layout,this,this._allLayouts.length,b);this._allLayouts.push(b);this._layoutsByName.set(b.GetName().toLowerCase(),b);this._layoutsBySid.set(b.GetSID(),b)}GetRuntime(){return this._runtime}SetFirstLayout(b){this._firstLayout=b}GetFirstLayout(){if(this._firstLayout)return this._firstLayout;if(this._allLayouts.length)return this._allLayouts[0];throw Error("no first layout");}GetLayoutByName(b){return this._layoutsByName.get(b.toLowerCase())||null}GetLayoutBySID(b){return this._layoutsBySid.get(b)||
null}GetLayoutByIndex(b){b=c.clamp(Math.floor(b),0,this._allLayouts.length-1);return this._allLayouts[b]}GetLayout(b){return"number"===typeof b?this.GetLayoutByIndex(b):this.GetLayoutByName(b.toString())}GetAllLayouts(){return this._allLayouts}_SetMainRunningLayout(b){this._mainRunningLayout=b}GetMainRunningLayout(){return this._mainRunningLayout}_AddRunningSubLayout(b){if(this._runningSubLayouts.includes(b))throw Error("layout already running");this._runningSubLayouts.push(b)}_RemoveRunningSubLayout(b){b=
this._runningSubLayouts.indexOf(b);if(-1===b)throw Error("layout not running");this._runningSubLayouts.splice(b,1)}*runningLayouts(){this._mainRunningLayout&amp;&amp;(yield this._mainRunningLayout);this._runningSubLayouts.length&amp;&amp;(yield*this._runningSubLayouts)}IsLayoutRunning(b){return this._mainRunningLayout===b||this._runningSubLayouts.includes(b)}SetIsEndingLayout(b){if(b)this._isEndingLayout++;else{if(0&gt;=this._isEndingLayout)throw Error("already unset");this._isEndingLayout--}}IsEndingLayout(){return 0&lt;
this._isEndingLayout}ChangeMainLayout(b){this._pendingChangeLayout=b}ClearPendingChangeLayout(){this._pendingChangeLayout=null}IsPendingChangeMainLayout(){return!!this._pendingChangeLayout}GetPendingChangeMainLayout(){return this._pendingChangeLayout}}}"use strict";
{const c=self.C3;class b{constructor(){this.runtime=this.renderer=null;this.surfaceHeight=this.surfaceWidth=this.drawHeight=this.drawWidth=0;this.layoutRect=new c.Rect;this.rcTexBounce=new c.Rect;this.rcTexDest=new c.Rect;this.rcTexOrigin=new c.Rect;this.screenRect=new c.Rect;this.clearRect=new c.Rect;this.srcRect=new c.Rect;this.fxTex=[null,null];this.fxIndex=0;this.otherFxIndex=1;this.layerAngle=this.layerScale=this.boxExtendVertical=this.boxExtendHorizontal=0;this.renderTarget=this.wi=this.inst=
this.layer=this.layout=null;this.didChangeTransform=this.postDraw=this.preDraw=!1;this.opts=null}Clear(){this.opts=this.renderTarget=this.wi=this.inst=this.layer=this.layout=this.runtime=this.renderer=null}ShouldPreDraw(u){u=u.GetShaderProgram();if(u.MustPreDraw())return!0;if(this.inst)return u.UsesDest()&amp;&amp;(0!==this.wi.GetAngle()||0&gt;this.wi.GetWidth()||0&gt;this.wi.GetHeight())||0!==this.boxExtendHorizontal||0!==this.boxExtendVertical||!this.wi.HasDefaultColor()||this.inst.MustPreDraw();if(this.layer)return!this.layer.HasDefaultColor()}ShouldPostDraw(u){u=
u.GetShaderProgram();return u.UsesDest()||u.UsesCrossSampling()||this.layout&amp;&amp;"low"===this.runtime.GetCanvasManager().GetCurrentFullscreenScalingQuality()}GetEffectRenderTarget(u){if(0!==u&amp;&amp;1!==u)throw Error("invalid effect target");const w=this.fxTex;if(!w[u]){var y=this.runtime;const C=y.GetCanvasManager();y={sampling:y.GetSampling()};"low"===C.GetCurrentFullscreenScalingQuality()&amp;&amp;(y.width=C.GetDrawWidth(),y.height=C.GetDrawHeight());w[u]=C.GetAdditionalRenderTarget(y)}return w[u]}ReleaseEffectRenderTargets(){const u=
this.fxTex,w=this.runtime.GetCanvasManager();u[0]&amp;&amp;(w.ReleaseAdditionalRenderTarget(u[0]),u[0]=null);u[1]&amp;&amp;(w.ReleaseAdditionalRenderTarget(u[1]),u[1]=null)}}const a=[];let f=0;function d(){f===a.length&amp;&amp;a.push(new b);return a[f++]}function e(u){u.ReleaseEffectRenderTargets();u.Clear();f--}const g=new c.Quad;let h=!1;async function l(u,w,y){w=await c.Gfx.WebGLRenderTarget.DebugReadPixelsToBlob(w,y);w=URL.createObjectURL(w);console.log("[FX] "+u+" "+(y?"":" [to display]")+": ",w)}c.RenderEffectChain=
function(u,w,y,C,G,x){const B=d();B.renderer=u;B.runtime=w;if(y instanceof c.Instance)B.inst=y,B.wi=B.inst.GetWorldInfo();else if(y instanceof c.Layer)B.layer=y;else if(y instanceof c.Layout)B.layout=y;else throw Error("invalid effects object");y=w.GetCanvasManager();B.renderTarget=C;B.drawWidth=y.GetDrawWidth();B.drawHeight=y.GetDrawHeight();B.surfaceWidth=B.drawWidth;B.surfaceHeight=B.drawHeight;B.fxIndex=0;B.otherFxIndex=1;B.boxExtendHorizontal=0;B.boxExtendVertical=0;B.screenRect.set(0,0,B.drawWidth,
B.drawHeight);B.clearRect.set(0,0,B.drawWidth,B.drawHeight);B.didChangeTransform=!1;B.opts=x;B.inst?(C=B.wi,B.layerScale=C.GetLayer().GetRenderScale(),B.layerAngle=C.GetLayer().GetAngle(),B.layoutRect.copy(C.GetBoundingBox())):B.layer?(C=B.layer,B.layerScale=C.GetRenderScale(),B.layerAngle=C.GetAngle(),B.layoutRect.copy(C.GetViewport())):(C=B.layout,B.layerScale=C.GetScale(),B.layerAngle=C.GetAngle(),B.layoutRect.set(0,0,B.drawWidth,B.drawHeight));B.inst?m(B,G):(B.rcTexBounce.set(0,0,B.drawWidth/
B.surfaceWidth,B.drawHeight/B.surfaceHeight),B.rcTexDest.copy(B.rcTexBounce),B.rcTexOrigin.copy(B.rcTexBounce),B.rcTexBounce.swapTopBottom(),B.rcTexDest.swapTopBottom(),B.rcTexOrigin.swapTopBottom());u.SetAlphaBlend();u.ResetColor();u.SetBaseZ(0);u.SetCurrentZ(0);B.preDraw=B.ShouldPreDraw(G[0]);B.preDraw&amp;&amp;n(B);u.ResetColor();C=G.length-1;B.postDraw=B.ShouldPostDraw(G[C]);for(let H=0,P=G.length;H&lt;P;++H)x=G[H],y=x.GetShaderProgram(),u.SetProgram(y),y.IsAnimated()&amp;&amp;w.UpdateRender(),0!==H||B.preDraw?
(u.SetCopyBlend(),q(B,x,H===C&amp;&amp;!B.postDraw,H)):r(B,x),0===B.fxIndex?(B.fxIndex=1,B.otherFxIndex=0):(B.fxIndex=0,B.otherFxIndex=1);B.postDraw&amp;&amp;t(B,G);u=B.didChangeTransform;e(B);h=!1;return u};function m(u,w){for(let J=0,O=w.length;J&lt;O;++J){var y=w[J].GetShaderProgram();u.boxExtendHorizontal+=y.GetBoxExtendHorizontal();u.boxExtendVertical+=y.GetBoxExtendVertical()}var C=u.wi;w=C.GetLayer();y=w.GetAngle();var G=C.GetBoundingBox();C=C.GetTotalZElevation();let [x,B]=w.LayerToDrawSurface(G.getLeft(),G.getTop(),
C),[H,P]=w.LayerToDrawSurface(G.getRight(),G.getBottom(),C);if(0!==y){const [J,O]=w.LayerToDrawSurface(G.getRight(),G.getTop(),C),[R,T]=w.LayerToDrawSurface(G.getLeft(),G.getBottom(),C);w=Math.min(x,H,J,R);H=Math.max(x,H,J,R);x=w;w=Math.min(B,P,O,T);P=Math.max(B,P,O,T);B=w}w=u.screenRect;y=u.rcTexOrigin;G=u.rcTexDest;C=u.clearRect;const E=u.rcTexBounce;w.set(x,B,H,P);w.shuntY(u.drawHeight);y.copy(w);y.divide(u.surfaceWidth,u.surfaceHeight);y.swapTopBottom();w.inflate(u.boxExtendHorizontal,u.boxExtendVertical);
G.copy(w);G.divide(u.surfaceWidth,u.surfaceHeight);G.swapTopBottom();C.copy(w);C.roundOuter();C.inflate(u.boxExtendHorizontal+1,u.boxExtendVertical+1);w.clamp(0,0,u.drawWidth,u.drawHeight);C.clamp(0,0,u.drawWidth,u.drawHeight);E.copy(w);E.divide(u.surfaceWidth,u.surfaceHeight);E.swapTopBottom()}function n(u){const w=u.renderer;w.SetTextureFillMode();const y=u.GetEffectRenderTarget(u.fxIndex);w.SetRenderTarget(y);var C=u.opts;C&amp;&amp;C.preTransform&amp;&amp;C.preTransform();w.ClearRect2(u.clearRect);u.inst?(w.SetColor(u.wi.GetPremultipliedColor()),
w.SetCurrentZ(u.wi.GetTotalZElevation()),u.inst.Draw(w),w.SetCurrentZ(0)):(C=(u.layer||u.layout).GetRenderTarget(),u.layer?w.SetColor(u.layer.GetPremultipliedColor()):w.ResetColor(),w.DrawRenderTarget(C),w.InvalidateRenderTarget(C),u.runtime.GetCanvasManager().ReleaseAdditionalRenderTarget(C));u.rcTexDest.clampFlipped(0,1,1,0);u.fxIndex=1;u.otherFxIndex=0;h&amp;&amp;l("Pre-draw",w,y)}function r(u,w){const y=u.renderer,C=u.runtime,G=u.GetEffectRenderTarget(u.fxIndex);y.SetRenderTarget(G);var x=u.opts;x&amp;&amp;x.preTransform&amp;&amp;
x.preTransform();y.ClearRect2(u.clearRect);if(u.inst){const [B,H]=u.inst.GetCurrentSurfaceSize();(x=u.inst.GetCurrentTexRect())?u.srcRect.copy(x):u.srcRect.set(0,0,0,0);w=u.wi.GetInstanceEffectList().GetEffectParametersForIndex(w.GetIndex());y.SetProgramParameters(u.renderTarget,u.rcTexDest,u.srcRect,u.srcRect,u.layoutRect,1/B,1/H,u.layerScale,u.layerAngle,C.GetGameTime(),w);y.SetCurrentZ(u.wi.GetTotalZElevation());u.inst.Draw(y);y.SetCurrentZ(0);u.rcTexDest.clampFlipped(0,1,1,0);u.screenRect.shuntY(u.drawHeight)}else w=
(u.layer||u.layout).GetEffectList().GetEffectParametersForIndex(w.GetIndex()),y.SetProgramParameters(u.renderTarget,u.rcTexDest,u.rcTexBounce,u.rcTexOrigin,u.layoutRect,1/u.drawWidth,1/u.drawHeight,u.layerScale,u.layerAngle,C.GetGameTime(),w),u=(u.layer||u.layout).GetRenderTarget(),h&amp;&amp;l("Layer target",y,u),y.DrawRenderTarget(u),y.InvalidateRenderTarget(u),C.GetCanvasManager().ReleaseAdditionalRenderTarget(u);h&amp;&amp;l("First bounce",y,G)}function q(u,w,y,C){const G=u.renderer,x=u.runtime;0===C&amp;&amp;u.preDraw&amp;&amp;
u.inst&amp;&amp;u.screenRect.shuntY(u.drawHeight);y?(u.inst?G.SetBlendMode(u.wi.GetBlendMode()):u.layer&amp;&amp;G.SetBlendMode(u.layer.GetBlendMode()),y=u.renderTarget,G.SetRenderTarget(y)):(y=u.GetEffectRenderTarget(u.fxIndex),G.SetRenderTarget(y),G.ClearRect2(u.clearRect));w=u.inst?u.wi.GetInstanceEffectList().GetEffectParametersForIndex(w.GetIndex()):(u.layer||u.layout).GetEffectList().GetEffectParametersForIndex(w.GetIndex());G.SetProgramParameters(u.renderTarget,u.rcTexDest,u.rcTexBounce,u.rcTexOrigin,u.layoutRect,
1/u.surfaceWidth,1/u.surfaceHeight,u.layerScale,u.layerAngle,x.GetGameTime(),w);w=u.GetEffectRenderTarget(u.otherFxIndex);G.SetTexture(w.GetTexture());x.GetCanvasManager().SetDeviceTransform(G);u.didChangeTransform=!0;g.setFromRect(u.screenRect);G.Quad3(g,u.rcTexBounce);u.inst||G.InvalidateRenderTarget(w);h&amp;&amp;l("Bounce "+C,G,y)}function t(u,w){w=u.renderer;if(u.layout)w.SetTextureFillMode(),w.SetRenderTarget(u.renderTarget),u=u.GetEffectRenderTarget(u.otherFxIndex),w.CopyRenderTarget(u),w.InvalidateRenderTarget(u);
else{var y=u.runtime.GetCanvasManager();"low"===y.GetCurrentFullscreenScalingQuality()?(w.SetTextureFillMode(),y.SetDeviceTransform(w,y.GetDrawWidth(),y.GetDrawHeight()),u.didChangeTransform=!0):w.SetDeviceTransformTextureFillMode();u.inst?w.SetBlendMode(u.wi.GetBlendMode()):u.layer&amp;&amp;w.SetBlendMode(u.layer.GetBlendMode());w.SetRenderTarget(u.renderTarget);y=u.GetEffectRenderTarget(u.otherFxIndex);w.SetTexture(y.GetTexture());g.setFromRect(u.screenRect);w.Quad3(g,u.rcTexBounce);u.inst||w.InvalidateRenderTarget(y);
h&amp;&amp;l("Post-draw",w,u.renderTarget)}}}"use strict";
{const c=self.C3,b=/&lt;(.+?)&gt;/g;c.TimelineManager=class extends c.DefendedBase{constructor(a){super();this._runtime=a;this._timelineDataManager=c.New(c.TimelineDataManager);this._pluginInstance=null;this._timelines=[];this._timelinesByName=new Map;this._objectClassToTimelineMap=new Map;this._timelinesCreatedByTemplate=new Map;this._scheduledTimelines=[];this._playingTimelines=[];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=f=&gt;this._OnInstanceDestroy(f.instance);this._afterLoad=f=&gt;this._OnAfterLoad();this._destroyedWhileLoadingState=[]}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();c.clearArray(this._timelines);
this._timelines=null;this._timelineDataManager.Release();this._timelineDataManager=null;c.clearArray(this._scheduledTimelines);this._scheduledTimelines=null;c.clearArray(this._playingTimelines);this._playingTimelines=null;this._timelinesByName.clear();this._timelinesByName=null;this._objectClassToTimelineMap.clear();this._objectClassToTimelineMap=null;this._timelinesCreatedByTemplate.clear();this._timelinesCreatedByTemplate=null;c.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("afterload",this._afterLoad)}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("afterload",this._afterLoad)}Create(a){this._timelineDataManager.Add(a);a=c.TimelineState.CreateInitial(a,this);this.Add(a);this.SetTimelineObjectClassesToMap(a);this._timelinesCreatedByTemplate.set(a.GetName(),0)}CreateFromTemplate(a){var f=this.GetTimelineDataManager();a=
a.GetTemplateName();f=f.Get(a);f=c.TimelineState.CreateFromTemplate(`${a}:${this._timelinesCreatedByTemplate.get(a)}`,f,this);this._IncreaseTemplateTimelinesCount(a);this.Add(f);return f}_IncreaseTemplateTimelinesCount(a){this._timelinesCreatedByTemplate.set(a,this._timelinesCreatedByTemplate.get(a)+1)}_SetCreatedTemplateTimelinesCount(){for(const a of this._timelines){if(a.IsTemplate())continue;const f=a.GetTemplateName();this._IncreaseTemplateTimelinesCount(f)}}_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.IsTemplate()||(c.arrayFindRemove(this._timelines,a),c.arrayFindRemove(this._scheduledTimelines,a),c.arrayFindRemove(this._playingTimelines,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,f){this._objectClassToTimelineMap.has(a)||this._objectClassToTimelineMap.set(a,new Set);this._objectClassToTimelineMap.get(a).add(f)}SetTimelineObjectClassesToMap(a){for(const f of a.GetObjectClasses())this.SetTimelineObjectClassToMap(f,a)}RemoveTimelineFromObjectClassMap(a){for(const [f,d]of this._objectClassToTimelineMap.entries())d.has(a)&amp;&amp;(d.delete(a),0===d.size&amp;&amp;
this._objectClassToTimelineMap.delete(f))}GetTimelinesForObjectClass(a){if(this._objectClassToTimelineMap.has(a))return this._objectClassToTimelineMap.get(a)}GetTimelineOfTemplateForInstances(a,f){if(f)for(const d of this._timelines)if(f.every(e=&gt;d.HasTrackInstance(e.instance,e.trackId))&amp;&amp;d.GetName().includes(a.GetName()))return d}GetTimelineByName(a){return this._timelinesByName.get(a.toLowerCase())||null}GetScheduledOrPlayingTimelineByName(a){for(const f of this._scheduledTimelines)if(f.GetName()===
a)return f;for(const f of this._playingTimelines)if(f.GetName()===a)return f;return null}*GetTimelinesByName(a){if(b.test(a)){b.lastIndex=0;let d;var f=new Set;do if(d=b.exec(a)){const e=d[1].split(",");for(const g of e)f.add(g)}while(d);for(const e of f.values())(a=this.GetTimelineByName(e))&amp;&amp;(yield a);f.clear()}else(f=this.GetTimelineByName(a))&amp;&amp;(yield f)}*GetTimelinesByTags(a){for(const f of this._timelines)f.HasTags(a)&amp;&amp;(yield f)}AddScheduledTimeline(a){this._scheduledTimelines.includes(a)||this._scheduledTimelines.push(a);
this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(a){c.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();
c.arrayFindRemove(this._scheduledTimelines,a);this._MaybeDisableRuntimeListeners()}CompleteTimeline(a){a.SetPlaying(!1);a.SetScheduled(!1);a.SetMarkedForRemoval(!0)}CompleteTimelineAndResolve(a){this.CompleteTimeline(a);a.ResolvePlayPromise()}_OnTick(){if(!this.GetRuntime().IsLoadingState()&amp;&amp;this._hasRuntimeListeners&amp;&amp;!this._changingLayout){var a=!1;for(this._isTickingTimelines=!0;this._scheduledTimelines.length;){var f=this._scheduledTimelines.pop();f.SetInitialState();this._playingTimelines.push(f)}f=
this._runtime.GetDt();var d=this._runtime.GetTimeScale();for(const e of this._playingTimelines){if(e.IsMarkedForRemoval())continue;const g=e.Tick(f,d);!a&amp;&amp;g&amp;&amp;(a=!0)}this._isTickingTimelines=!1;a&amp;&amp;this.GetRuntime().UpdateRender()}}_OnTick2(){if(!this.GetRuntime().IsLoadingState()&amp;&amp;this._hasRuntimeListeners&amp;&amp;!this._changingLayout){var a;for(const f of this._playingTimelines)f.IsMarkedForRemoval()&amp;&amp;(a||(a=new Set),this._MaybeExecuteTimelineFinishTriggers(f),a.add(f));a&amp;&amp;c.arrayRemoveAllInSet(this._playingTimelines,
a);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._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 f of this._playingTimelines)f._OnBeforeChangeLayout()&amp;&amp;a.add(f);c.arrayRemoveAllInSet(this._playingTimelines,a);this._MaybeDisableRuntimeListeners();for(const f of this._timelines)f.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=!1}_OnInstanceDestroy(a){var f=a.GetObjectClass();if(f=this.GetTimelinesForObjectClass(f))if(this._runtime.IsLoadingState())this._destroyedWhileLoadingState.push(a);else for(const d of f)d.IsTemplate()||(d.IsReleased()?this.Remove(d):d.HasValidTracks()||
(this._MaybeExecuteTimelineFinishTriggers(d),this.Remove(d)))}_OnAfterLoad(){for(const a of this._destroyedWhileLoadingState)this._OnInstanceDestroy(a);c.clearArray(this._destroyedWhileLoadingState)}_SaveToJson(){return{timelinesJson:this._SaveTimelinesToJson(),scheduledTimelinesJson:this._SaveScheduledTimelinesToJson(),playingTimelinesJson:this._SavePlayingTimelinesToJson(),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._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 f of a){a=this.GetTimelineByName(f.name);if(!a){a=this._GetTemplateNameFromJson(f);if(!a)continue;a=this.GetTimelineByName(a);a=this.CreateFromTemplate(a)}a._LoadFromJson(f);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)}_IsTimelineInJson(a,f){for(const d of f)if(d===a.GetName())return!0;return!1}_SaveTimelines(a){return a.map(f=&gt;f.GetName())}_LoadTimelines(a,f){var d=new Set;for(const e of f)this._IsTimelineInJson(e,a)||d.add(e);c.arrayRemoveAllInSet(f,d);d=e=&gt;g=&gt;g.GetName()===e;for(const e of a)(a=this.GetTimelineByName(e))&amp;&amp;(f.find(d(e))||f.push(a))}}}"use strict";
{const c=self.C3;c.TimelineState=class extends c.DefendedBase{constructor(b,a,f){super();this._runtime=f.GetRuntime();this._timelineManager=f;this._timelineDataItem=a;this._name=b;this._tracks=[];for(const d of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(c.TrackState.Create(this,d));this._playResolve=this._playPromise=null;this._playheadTime=c.New(c.KahanSum);this._playheadTime.Set(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}static CreateInitial(b,a){var f=a.GetTimelineDataManager();const d=f.GetNameId();f=f.Get(b[d]);b=c.New(c.TimelineState,b[d],f,a);b.SetIsTemplate(!0);return b}static CreateFromTemplate(b,a,f){return c.New(c.TimelineState,b,a,f)}static get WORLD_INSTANCE_BOX_CHANGE(){return 1}static get LAYOUT_RENDER_CHANGE(){return c.nextHighestPowerOfTwo(1)}Release(){if(!this.IsReleased()){this._timelineManager.DeScheduleTimeline(this);
this._timelineManager.CompleteTimelineAndResolve(this);for(const b of this._tracks)b.Release();c.clearArray(this._tracks);this._tracks=null;this._playheadTime.Release();this._timelineDataItem=this._timelineManager=this._runtime=this._playheadTime=null;this._released=!0;this._playResolve=this._playPromise=null}}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}GetSimilarPropertyTracks(b,a,f){const d=[];for(const e of this._tracks){if(b!==
e.GetInstance())continue;const g=e.GetPropertyTrack(f);g&amp;&amp;a.constructor===g.GetSourceAdapter().constructor&amp;&amp;d.push(g)}return d}HasTracks(){return!!this._tracks.length}GetTrackById(b){for(const a of this._tracks)if(c.equalsNoCase(a.GetId(),b))return a;return null}SetName(b){this._name=b}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(b){this._timelineDataItem.SetTotalTime(b)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(b){this._timelineDataItem.SetStep(b)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(b){this._timelineDataItem.SetInterpolationMode(b)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(b){this._timelineDataItem.GetResultMode(b)}SetEase(b){for(const a of this.GetTracks())a.SetEase(b)}GetLoop(){return this._timelineDataItem.GetLoop()}SetLoop(b){return this._timelineDataItem.SetLoop(b)}GetPingPong(){return this._timelineDataItem.GetPingPong()}SetPingPong(b){return this._timelineDataItem.SetPingPong(b)}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetPlaybackRate(b){return this._playbackRate=
b}GetPlaybackRate(){return this._playbackRate}IsForwardPlayBack(){return this.IsPlaying()?0&lt;this._playbackRate:!0}GetPlayPromise(){return this._playPromise?this._playPromise:this._playPromise=new Promise(b=&gt;{this._playResolve=b})}ResolvePlayPromise(){this._playPromise&amp;&amp;(this._playResolve(),this._playResolve=this._playPromise=null)}SetTags(b){this._tags=c.TimelineState._GetTagArray(b);this._tagsChanged=!0}GetTags(){return this._tags}GetStringTags(){this._tagsChanged&amp;&amp;(this._stringTags=this._tags.join(" "));
this._tagsChanged=!1;return this._stringTags}HasTags(b){return this._tags&amp;&amp;this._tags.length?(b=c.TimelineState._GetTagArray(b))&amp;&amp;b.length?b.every(c.TimelineState._HasTag,this):!1:!1}OnStarted(){c.Plugins.Timeline.Cnds.SetTriggerTimeline(this);this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineStarted);this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineStartedByName);this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineStartedByTags);this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnAnyTimelineStarted);
c.Plugins.Timeline.Cnds.SetTriggerTimeline(null)}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){this._finishedTriggers||(this._finishedTriggers=!0,c.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineFinished),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineFinishedByName),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimelineFinishedByTags),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnAnyTimelineFinished),
c.Plugins.Timeline.Cnds.SetTriggerTimeline(null))}SetPlaying(b){this._isPlaying=b}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(b=!1){return this.IsCompletedTick()||this.IsScheduled()&amp;&amp;!b?!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(b){this._isScheduled=b}IsScheduled(){return this._isScheduled}SetComplete(b){this._complete=
b;b=this.GetTime();if(0&gt;=b||b&gt;=this.GetTotalTime())this._complete=!0}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(b){this._markedForRemoval=b}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(b){this._implicitPause=b}IsImplicitPause(){return this._implicitPause}SetIsTemplate(b){this._isTemplate=!!b}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime.Get()}SetTime(b){const a=
this.GetTime();this._SetTime(b);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._Interpolate(b,!1,!0,!0,a)&amp;&amp;this.GetRuntime().UpdateRender();this._OnSetTime()}_SetTime(b){0&gt;b?this._playheadTime.Set(0):
b&gt;=this.GetTotalTime()?this._playheadTime.Set(this.GetTotalTime()):this._playheadTime.Set(b)}_OnSetTime(){c.Plugins.Timeline&amp;&amp;this.constructor===c.TimelineState&amp;&amp;(c.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimeSet),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimeSetByName),this._timelineManager.Trigger(c.Plugins.Timeline.Cnds.OnTimeSetByTags),c.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(b=!1){return this.IsReleased()||this.IsScheduled()?!1:this._IsPlaying()&amp;&amp;this.IsCompletedTick()?this._SchedulePlayingTimeline():this._IsPlaying()||
!this.IsComplete()&amp;&amp;!b&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(b=!1){this.IsReleased()||(this.SetComplete(b),this._timelineManager.CompleteTimeline(this),this.IsComplete()&amp;&amp;
this.ResolvePlayPromise())}Reset(b=!0,a=!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 f=this.GetTime();a=a?this._InterpolateBeforeChangeLayout(f):this._Interpolate(f,!1,!1,!0);b&amp;&amp;this._OnSetTime();a&amp;&amp;b&amp;&amp;this.GetRuntime().UpdateRender()}}}ResetBeforeChangeLayout(){this.Reset(!1,!0)}_InterpolateBeforeChangeLayout(b){this._Interpolate(b,
!1,!1,!0,NaN,!1,!0)}_OnBeforeChangeLayout(){if(this.IsReleased())return!0;if(this.HasValidGlobalTracks())return!1;this._timelineManager.CompleteTimeline(this);this.ResetBeforeChangeLayout();return!0}SetInitialStateFromSetTime(){this.SetInitialState(!0)}SetInitialState(b){if(!this.IsMarkedForRemoval())if(b){this._firstTick=this._initialStateSet=!0;for(const a of this._tracks)a.SetInitialState()}else if(this.SetPlaying(!0),this.SetScheduled(!1),this.OnStarted(),this.IsComplete()){this._completedTick=
-1;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());for(const a of this._tracks)a.SetInitialState()}else{this._firstTick=!0;for(const a of this._tracks)a.SetResumeState()}}Tick(b,a){if(0!==b||0!==this._lastDelta){this._lastDelta=b;var f=this.GetTime();this._SetTime(f+b*a*this._playbackRate);var d;this.GetLoop()||this.GetPingPong()?this.GetLoop()&amp;&amp;
!this.GetPingPong()?d=this._LoopCompleteCheck():!this.GetLoop()&amp;&amp;this.GetPingPong()?d=this._PingPongCompleteCheck():this.GetLoop()&amp;&amp;this.GetPingPong()&amp;&amp;(d=this._LoopPingPongCompleteCheck()):d=this._SimpleCompleteCheck();if(d){for(const e of this._tracks)e.SetEndState();this.Stop(!0);this.OnCompleted();return!0}return this._Interpolate(this.GetTime(),!0,!1,!1,f,!0)}}_Interpolate(b,a=!1,f=!1,d=!1,e=NaN,g=!1,h=!1){let l=!1;for(var m of this._tracks)m.BeforeInterpolate();for(const n of this._tracks){m=
b;if("number"===typeof e){const r=this.GetTime()-n.GetStartOffset(),q=e-n.GetStartOffset();0&gt;r&amp;&amp;0&lt;q&amp;&amp;(m=n.GetStartOffset(),this._SetTime(m))}m=n.Interpolate(m,a,f,d,this._firstTick,h);!l&amp;&amp;m&amp;&amp;(l=!0)}for(const n of this._tracks)n.AfterInterpolate();this._firstTick&amp;&amp;g&amp;&amp;(this._firstTick=!1);return l}_SimpleCompleteCheck(){if(this.IsForwardPlayBack()){if(this.GetTime()&gt;=this.GetTotalTime())if(this._currentRepeatCount&lt;this.GetRepeatCount())this._currentRepeatCount++,this._SetTime(0);else return this._SetTime(this.GetTotalTime()),
!0}else if(0&gt;=this.GetTime())if(this._currentRepeatCount&lt;this.GetRepeatCount())this._currentRepeatCount++,this._SetTime(this.GetTotalTime());else return this._SetTime(0),!0;return!1}_LoopCompleteCheck(){this.IsForwardPlayBack()?this.GetTime()&gt;=this.GetTotalTime()&amp;&amp;this._SetTime(0):0&gt;=this.GetTime()&amp;&amp;this._SetTime(this.GetTotalTime());return!1}_PingPongCompleteCheck(){if(this.IsForwardPlayBack()){if(this.GetTime()&gt;=this.GetTotalTime())if(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate()),
1===this._pingPongState)if(this._currentRepeatCount&lt;this.GetRepeatCount())this._currentRepeatCount++,this._pingPongState=0;else return!0;else 0===this._pingPongState&amp;&amp;(this._pingPongState=1)}else if(0&gt;=this.GetTime())if(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),1===this._pingPongState)if(this._currentRepeatCount&lt;this.GetRepeatCount())this._currentRepeatCount++,this._pingPongState=0;else return!0;else 0===this._pingPongState&amp;&amp;(this._pingPongState=1);return!1}_LoopPingPongCompleteCheck(){this.IsForwardPlayBack()?
this.GetTime()&gt;=this.GetTotalTime()&amp;&amp;(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate())):0&gt;=this.GetTime()&amp;&amp;(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()));return!1}AddTrack(){var b=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem();b=c.TrackState.Create(this,b);this._tracks.push(b);return b}CleanCaches(){for(const b of this._tracks)b.CleanCaches()}ClearTrackInstances(){for(const b of this._tracks)b.ClearInstance()}SetTrackInstance(b,
a){if(a)for(const f of this._tracks){if(b){if(f.GetId()!==b)continue}else if(f.HasInstance())continue;f.SetInstance(a);this._timelineManager.SetTimelineObjectClassToMap(a.GetObjectClass(),this);break}}HasTrackInstance(b,a){for(const f of this._tracks)if(a){if(a===f.GetId()&amp;&amp;b===f.GetInstance())return!0}else if(b===f.GetInstance())return!0;return!1}HasValidTracks(){return this._tracks.some(b=&gt;b.CanInstanceBeValid())}HasValidGlobalTracks(){return this._tracks.some(b=&gt;b.CanInstanceBeValid()?(b=b.GetObjectClass())?
b.IsGlobal():!1:!1)}GetPropertyTrack(b){for(const a of this.GetTracks())for(const f of a.GetPropertyTracks())if(f.GetPropertyName()===b)return f}GetKeyframeWithTags(b){b=b?b.split(" "):[];b=[...(new Set(b.map(a=&gt;a.toLowerCase().trim()))).values()];for(const a of this.GetTracks())for(const f of a.GetKeyframeDataItems())if(b.every(d=&gt;f.HasTag(d)))return f}GetObjectClasses(){const b=[];for(const a of this.GetTracks())b.push(a.GetObjectClass());return b.filter(a=&gt;a)}_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(b){b&amp;&amp;(this._LoadTracksFromJson(b.tracksJson),this._name=b.name,this._playheadTime.Set(b.playheadTime),this._playbackRate=b.playbackRate,this._pingPongState=b.pingPongState,this._currentRepeatCount=b.currentRepeatCount,this._isPlaying=!!b.isPlaying,this._isScheduled=!!b.isScheduled,this._initialStateSet=!!b.initialStateSet,this._finishedTriggers=b.hasOwnProperty("finishedTriggers")?!!b.finishedTriggers:!1,this._complete=!!b.complete,
this._released=!!b.released,this._markedForRemoval=!!b.markedForRemoval,this._completedTick=b.completedTick,this._implicitPause=!!b.implicitPause,this._isTemplate=!!b.isTemplate,this._tags=b.tags.split(" "),this._stringTags=b.stringTags,this._tagsChanged=!!b.tagsChanged,this._firstTick=!!b.firstTick)}_SaveTracksToJson(){return this._tracks.map(b=&gt;b._SaveToJson())}_LoadTracksFromJson(b){b.forEach((a,f)=&gt;{this._tracks[f]._LoadFromJson(a)});this._tracks.filter(a=&gt;a.CanInstanceBeValid())}static _HasTag(b){const a=
this.GetTags();return""===b?1===a.length&amp;&amp;""===a[0]:a.includes(b)}static _GetTagArray(b){if(c.IsArray(b))return b.slice(0);if(c.IsString(b))return b.split(" ")}}}"use strict";
{const c=self.C3;c.TrackState=class extends c.DefendedBase{constructor(b,a){super();this._timeline=b;this._trackDataItem=a;this._trackData=a.GetTrackData();this._objectClassIndex=this._instanceUid=NaN;this._worldInfo=this._instance=null;this._isNested=0&lt;a.GetStartOffset();this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this._lastKeyframeDataItem=null;this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray();this._propertyTracks=[];for(const f of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(c.PropertyTrackState.Create(this,
f))}static Create(b,a){return c.New(c.TrackState,b,a)}Release(){this._keyframeDataItems=null;for(const b of this._propertyTracks)b.Release();c.clearArray(this._propertyTracks);this._lastKeyframeDataItem=this._trackDataItem=this._worldInfo=this._instance=this._timeline=this._propertyTracks=null}CleanCaches(){for(const b of this._propertyTracks)b.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(b){for(const a of this._propertyTracks)if(a.GetPropertyName()===b)return a}MaybeGetInstance(){this._instance||this.GetInstance()}IsInstanceValid(){return this._instance?!this._instance.IsDestroyed():!1}CanInstanceBeValid(){var b=this.GetInstanceUID();return(b=this.GetRuntime().GetInstanceByUID(b))?!b.IsDestroyed():!1}GetObjectClass(){const b=
this.GetObjectClassIndex();if(-1!==b)return this.GetRuntime().GetObjectClassByIndex(b)}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 b=this.GetInstanceUID();return this._instance=this.GetRuntime().GetInstanceByUID(b)}SetInstance(b){if(this._instance!==b){this.CleanCaches();this._instance=b;this._objectClassIndex=b.GetObjectClass().GetIndex();
this._instanceUid=b.GetUID();this._worldInfo=b.GetWorldInfo();for(const g of this.propertyTrackItems()){const h=g.sourceAdapter;switch(g.propertyTrack.GetSourceAdapterId()){case "instance-variable":h.GetEditorIndex();var a=b.GetObjectClass(),f=a.GetInstanceVariableIndexByName(g.name),d=a.GetInstanceVariableName(f);a=a.GetInstanceVariableType(f);d===g.name&amp;&amp;a===g.type&amp;&amp;h.UpdateInstanceVariableIndex(f);break;case "behavior":var e=g.behaviorType;f=this.GetObjectClass();d=b.GetObjectClass();a=h.GetBehaviorType(d);
e&amp;&amp;a&amp;&amp;(e=e.GetName(),f.GetBehaviorIndexByName(e),d.GetBehaviorIndexByName(e),h.GetEditorIndex(),h.UpdateBehaviorTypeSid(a.GetSID()))}}}}*propertyTrackItems(){for(const f of this._propertyTracks){var b=f.GetSourceAdapter(),a=this.GetObjectClass();const d={propertyTrack:f,sourceAdapter:b};switch(f.GetSourceAdapterId()){case "world-instance":d.property=f.GetPropertyName();break;case "instance-variable":b=b.GetEditorIndex();d.name=a.GetInstanceVariableName(b);d.type=a.GetInstanceVariableType(b);break;
case "effect":a=a.GetEffectList();b=b.GetEffectType(a);d.effectType=b;break;case "behavior":b=b.GetBehaviorType(a);d.behaviorType=b;break;case "plugin":d.plugin=a.GetPlugin()}yield d}}GetWorldInfo(){if(this._worldInfo&amp;&amp;this.IsInstanceValid())return this._worldInfo;const b=this.GetInstance();b&amp;&amp;(this._worldInfo=b.GetWorldInfo());return this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){return this._instanceUid?this._instanceUid:this._trackDataItem.GetInstanceUID()}SetInstanceUID(b){this._trackDataItem.SetInstanceUID(b)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(b){this._trackDataItem.SetInterpolationMode(b)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}GetStartOffset(){return this._trackDataItem.GetStartOffset()}GetLocalTotalTime(){return this._trackDataItem.GetLocalTotalTime()}SetResultMode(b){this._trackDataItem.SetResultMode(b)}SetEase(b){for(const a of this.GetKeyframeDataItems())a.SetEase(b);
for(const a of this.GetPropertyTracks())a.SetEase(b)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(b){this._trackDataItem.SetEnable(b)}GetObjectClassIndex(){return isNaN(this._objectClassIndex)?this._trackDataItem.GetObjectClassIndex():this._objectClassIndex}SetObjectClassIndex(b){this._trackDataItem.SetObjectClassIndex(b)}SetOriginalWidth(b){this._trackDataItem.SetOriginalWidth(b)}GetOriginalWidth(){return this._trackDataItem.GetOriginalWidth()}SetOriginalHeight(b){this._trackDataItem.SetOriginalHeight(b)}GetOriginalHeight(){return this._trackDataItem.GetOriginalHeight()}SetInitialState(){this.MaybeGetInstance();
if(this.IsInstanceValid()){for(var b of this._propertyTracks)b.SetInitialState();b=this.GetTimeline().IsForwardPlayBack()?0:this.GetLocalTotalTime();this._lastKeyframeDataItem=this.GetLastKeyFrameBeforeTime(b);this._endStateOfNestedSet=this._initialStateOfNestedSet=!1;this.Interpolate(b)}}SetResumeState(){this.MaybeGetInstance();if(this.IsInstanceValid()){this._timeline.IsForwardPlayBack();var b=this._timeline.GetTime()-this.GetStartOffset();this._lastKeyframeDataItem=this.GetLastKeyFrameBeforeTime(b);
for(const a of this._propertyTracks)a.SetResumeState()}}SetEndState(){if(!this.GetTimeline().IsComplete()&amp;&amp;(this.MaybeGetInstance(),this.IsInstanceValid()&amp;&amp;!this._isNested)){const b=this._timeline.GetTime(),a=this.GetStartOffset()+this.GetLocalTotalTime();b&gt;=a?this.Interpolate(this.GetLocalTotalTime(),!0,!1,!0):0&gt;=b&amp;&amp;this.Interpolate(0,!0,!1,!0)}}BeforeInterpolate(){for(const b of this._propertyTracks)b.BeforeInterpolate()}Interpolate(b,a=!1,f=!1,d=!1,e=!1,g=!1){this.MaybeGetInstance();if(!this.IsInstanceValid()||
g&amp;&amp;this.GetObjectClass().IsGlobal())return!1;b-=this.GetStartOffset();if(0&gt;b)return!1;this.MaybeSetInitialStateOfNestedTrack(b,a);this.MaybeTriggerKeyframeReachedConditions(b,a,e);e=g=!1;for(const h of this._propertyTracks){const l=h.Interpolate(b,f,!1,d);g||0===(l&amp;c.TimelineState.WORLD_INSTANCE_BOX_CHANGE)||(g=!0);e||0===(l&amp;c.TimelineState.LAYOUT_RENDER_CHANGE)||(e=!0)}this.MaybeSetEndStateOfNestedTrack(b,a);g&amp;&amp;(b=this.GetWorldInfo())&amp;&amp;b.SetBboxChanged();return e}AfterInterpolate(){for(const b of this._propertyTracks)b.AfterInterpolate()}MaybeSetInitialStateOfNestedTrack(b,
a){if(a&amp;&amp;this._isNested&amp;&amp;!this._initialStateOfNestedSet){if(this.GetTimeline().IsForwardPlayBack()){if(0&gt;b)return;for(const f of this._propertyTracks)f.Interpolate(0,!1,!1,!0)}else{if(b&gt;this.GetLocalTotalTime())return;for(const f of this._propertyTracks)f.Interpolate(this.GetLocalTotalTime(),!1,!1,!0)}for(const f of this._propertyTracks)f.SetInitialState();this._initialStateOfNestedSet=!0}}MaybeSetEndStateOfNestedTrack(b,a){if(a&amp;&amp;this._isNested&amp;&amp;!this._endStateOfNestedSet)if(this.GetTimeline().IsForwardPlayBack()){if(b&gt;=
this.GetLocalTotalTime()){for(const f of this._propertyTracks)f.Interpolate(this.GetLocalTotalTime(),!1,!1,!0);this._endStateOfNestedSet=!0}}else if(0&gt;=b){for(const f of this._propertyTracks)f.Interpolate(0,!1,!1,!0);this._endStateOfNestedSet=!0}}MaybeTriggerKeyframeReachedConditions(b,a,f){if(!f&amp;&amp;a)return b=this.GetLastKeyFrameBeforeTime(b),b!==this._lastKeyframeDataItem&amp;&amp;this.OnKeyframeReached(b),this._lastKeyframeDataItem=b}GetLastKeyFrameBeforeTime(b){const a=this.GetTimeline();let f=this._trackData.GetKeyFrameDataItemAtTime(b,
this._trackDataItem);return f?f:a.IsForwardPlayBack()?this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(b,this._trackDataItem):this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(b,this._trackDataItem)}OnKeyframeReached(b){if(c.Plugins.Timeline&amp;&amp;this.GetTimeline().constructor===c.TimelineState){var a=this.GetTimeline();c.Plugins.Timeline.Cnds.SetTriggerTimeline(a);c.Plugins.Timeline.Cnds.SetTriggerKeyframe(b);b=a.GetTimelineManager();b.Trigger(c.Plugins.Timeline.Cnds.OnAnyKeyframeReached);
b.Trigger(c.Plugins.Timeline.Cnds.OnKeyframeReached);c.Plugins.Timeline.Cnds.SetTriggerTimeline(null);c.Plugins.Timeline.Cnds.SetTriggerKeyframe(null)}}AddKeyframe(){return this._trackDataItem.GetKeyframeData().AddEmptyKeyframeDataItem()}AddPropertyTrack(){var b=this._trackDataItem.GetPropertyTrackData().AddEmptyPropertyTrackDataItem();b=c.PropertyTrackState.Create(this,b);this._propertyTracks.push(b);return b}DeleteKeyframes(b){this._trackDataItem.GetKeyframeData().DeleteKeyframeDataItems(b)}DeletePropertyKeyframes(b){for(const a of this._propertyTracks)a.DeletePropertyKeyframes(b)}SaveState(){for(const b of this._propertyTracks)b.SaveState()}CompareInitialStateWithCurrent(){this.MaybeGetInstance();
if(this.IsInstanceValid())for(const b of this._propertyTracks)b.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){this.MaybeGetInstance();if(this.IsInstanceValid()){var b=!1;for(const a of this._propertyTracks){const f=a.CompareSaveStateWithCurrent();!b&amp;&amp;f&amp;&amp;(b=!0)}b&amp;&amp;(b=this.AddKeyframe(),b.SetTime(this.GetTimeline().GetTime()),b.SetEase("noease"),b.SetEnable(!0),b.SetTags(""))}}_SaveToJson(){var b=this.GetInstance();b=b?b.GetUID():this.GetInstanceUID();return{propertyTracksJson:this._SavePropertyTracksToJson(),
lastKeyframeDataItemJson:this._SaveLastKeyframeDataItemToJson(),initialStateOfNestedSet:this._initialStateOfNestedSet,endStateOfNestedSet:this._endStateOfNestedSet,instanceUid:b}}_LoadFromJson(b){b&amp;&amp;(this._LoadPropertyTracksFromJson(b.propertyTracksJson),this._LoadLastKeyframeDataItemFromJson(b.lastKeyframeDataItemJson),this._LoadInstanceFromJson(b.instanceUid),this._initialStateOfNestedSet=!1,b.hasOwnProperty.initialStateOfNestedSet&amp;&amp;(this._initialStateOfNestedSet=b.initialStateOfNestedSet),this._endStateOfNestedSet=
!1,b.hasOwnProperty.endStateOfNestedSet&amp;&amp;(this._endStateOfNestedSet=b.endStateOfNestedSet))}_SaveLastKeyframeDataItemToJson(){return this._trackDataItem.GetKeyframeData().GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(b=&gt;b._SaveToJson())}_LoadPropertyTracksFromJson(b){b.forEach((a,f)=&gt;{this._propertyTracks[f]._LoadFromJson(a)})}_LoadInstanceFromJson(b){if(c.IsFiniteNumber(b)&amp;&amp;(b=this.GetRuntime().GetInstanceByUID(b))){var a=this.GetTimeline();
a.ClearTrackInstances();a.SetTrackInstance(this._trackDataItem.GetId(),b)}}_LoadLastKeyframeDataItemFromJson(b){this._lastKeyframeDataItem=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemFromIndex(b)}}}"use strict";
{const c=self.C3;c.PropertyTrackState=class extends c.DefendedBase{constructor(b,a){super();this._track=b;this._propertyTrackDataItem=a;this._propertyTrackData=a.GetPropertyTrackData();this._sourceAdapter=this.GetSourceAdapter();this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}static Create(b,a){return c.New(c.PropertyTrackState,b,a)}Release(){this._track=null;this._sourceAdapter&amp;&amp;(this._sourceAdapter.Release(),this._sourceAdapter=
null);this._propertyTrackData=this._propertyTrackDataItem=this._propertyKeyframeDataItems=null}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 b;switch(this._propertyTrackDataItem.GetSourceAdapterId()){case "behavior":b=
new c.PropertyTrackState.BehaviorSourceAdapter(this);break;case "effect":b=new c.PropertyTrackState.EffectSourceAdapter(this);break;case "instance-variable":b=new c.PropertyTrackState.InstanceVariableSourceAdapter(this);break;case "plugin":b=new c.PropertyTrackState.PluginSourceAdapter(this);break;case "world-instance":b=new c.PropertyTrackState.WorldInstanceSourceAdapter(this);break;case "value":b=new c.PropertyTrackState.ValueSourceAdapter(this)}return this._sourceAdapter=b}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(b){this._propertyTrackDataItem.SetSourceAdapterId(b)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(b){this._propertyTrackDataItem.SetSourceAdapterArguments(b)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(b){this._propertyTrackDataItem.SetProperty(b)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(b){this._propertyTrackDataItem.SetType(b)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(b){this._propertyTrackDataItem.SetMin(b)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(b){this._propertyTrackDataItem.SetMax(b)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(b){this._propertyTrackDataItem.SetEnable(b)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(b){this._propertyTrackDataItem.SetInterpolationMode(b)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(b){this._propertyTrackDataItem.SetResultMode(b)}SetEase(b){for(const a of this.GetPropertyKeyframeDataItems())a.SetEase(b)}GetPropertyKeyframeDataItems(){return this._propertyKeyframeDataItems?
this._propertyKeyframeDataItems:this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}*GetPropertyKeyframeValues(){for(const b of this.GetPropertyKeyframeDataItems())yield b.GetValueWithResultMode()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}GetCurrentState(){return this.GetSourceAdapter().GetCurrentState()}SetInitialState(){this.GetSourceAdapter().SetInitialState()}SetResumeState(){this.GetSourceAdapter().SetResumeState()}BeforeInterpolate(){this.GetSourceAdapter().BeforeInterpolate()}Interpolate(b,
a=!1,f=!1,d=!1){var e=this._propertyTrackDataItem;let g=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(b,e);g?e=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(b,e):(g=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(b,e),e=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(b,e));return this.GetSourceAdapter().Interpolate(b,g,e,a,f,d)}AfterInterpolate(){this.GetSourceAdapter().AfterInterpolate()}static GetStartPropertyKeyframeForTime(b,
a){const f=a.GetPropertyTrackDataItem();a=a._propertyTrackData;let d=a.GetPropertyKeyFrameDataItemAtTime(b,f);d||(d=a.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(b,f));return d}static GetEndPropertyKeyframeForTime(b,a){const f=a.GetPropertyTrackDataItem();a=a._propertyTrackData;return a.GetPropertyKeyFrameDataItemAtTime(b,f)?a.GetFirstPropertyKeyFrameDataItemHigherThan(b,f):a.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(b,f)}AddPropertyKeyframe(){return this._propertyTrackDataItem.GetPropertyKeyframeData().AddEmptyPropertyKeyframeDataItem()}DeletePropertyKeyframes(b){this._propertyTrackDataItem.GetPropertyKeyframeData().DeletePropertyKeyframeDataItems(b)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){if(this.GetSourceAdapter().CompareInitialStateWithCurrent()){const b=
this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem),a=this.GetSourceAdapter().GetCurrentState();b.SetAbsoluteValue(a)}}CompareSaveStateWithCurrent(){const b=this.GetSourceAdapter().CompareSaveStateWithCurrent();b&amp;&amp;this.AddPropertyKeyframeAtCurrentTime();this.GetSourceAdapter().ClearSaveState();return b}AddPropertyKeyframeAtCurrentTime(){const b=this.GetTimeline().GetTime(),a=this.GetSourceAdapter(),f=c.PropertyTrackState.GetStartPropertyKeyframeForTime(b,this),d=
this.AddPropertyKeyframe();d.SetType(f.GetType());d.SetTime(b);d.SetEase(f.GetEase());d.SetEnable(!0);d.SetValue(a.GetValueAtTime());d.SetAbsoluteValue(a.GetCurrentState())}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(b){b&amp;&amp;this.GetSourceAdapter()._LoadFromJson(b.sourceAdapterJson)}}}"use strict";
{const c=self.C3.PropertyTrackState;c.PropertySourceAdapter=class{constructor(b){this._propertyTrack=b;this._propertyAdapter=null}Release(){this._propertyAdapter&amp;&amp;(this._propertyAdapter.Release(),this._propertyAdapter=null);this._propertyTrack=null}GetPropertyTrack(){return this._propertyTrack}CleanCaches(){this._propertyAdapter&amp;&amp;this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){return this._propertyAdapter?this._propertyAdapter:this._propertyAdapter=this._CreatePropertyAdapter()}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}BeforeInterpolate(){this.GetPropertyAdapter().BeforeChangeProperty()}Interpolate(b,
a,f,d,e,g){const h=c.PropertySourceAdapter.GetInterpolateFunc(this._propertyTrack)(b,a,f,this._propertyTrack);return e?h:this.GetPropertyAdapter().ChangeProperty(b,h,a,f,d,g)}AfterInterpolate(){this.GetPropertyAdapter().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(){return c.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)}_CreatePropertyAdapter(){const b=
this._propertyTrack.GetPropertyType();switch(this._propertyTrack.GetPropertyKeyframeType()){case "combo":case "boolean":case "text":case "string":return new c.PropertyInterpolationAdapter.NoInterpolationAdapter(this);case "numeric":case "number":case "angle":return"combo"===b?new c.PropertyInterpolationAdapter.NoInterpolationAdapter(this):new c.PropertyInterpolationAdapter.NumericInterpolationAdapter(this);case "color":case "offsetColor":return new c.PropertyInterpolationAdapter.ColorInterpolationAdapter(this)}}_SaveToJson(){return{propertyAdapterJson:this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(b){b&amp;&amp;
this.GetPropertyAdapter()._LoadFromJson(b.propertyAdapterJson)}static GetValueAtTime(b){const a=b.GetTrack().GetTimeline().GetTime(),f=c.GetStartPropertyKeyframeForTime(a,b),d=c.GetEndPropertyKeyframeForTime(a,b);return c.PropertySourceAdapter.GetInterpolateFunc(b)(a,f,d,b)}static GetValue(b,a,f){let d=b.GetResultMode();"combo"===b.GetPropertyType()&amp;&amp;(d="absolute");switch(d){case "relative":return a+f;case "absolute":return f}}static GetInterpolateFunc(b){switch(b.GetPropertyKeyframeType()){case "numeric":return c.NumericTypeAdapter.Interpolate;
case "angle":return c.AngleTypeAdapter.Interpolate;case "boolean":return c.BooleanTypeAdapter.Interpolate;case "color":return c.ColorTypeAdapter.Interpolate;case "text":return c.TextTypeAdapter.Interpolate}}static GetWillChangeFunc(b){switch(b.GetPropertyKeyframeType()){case "numeric":return c.NumericTypeAdapter.WillChange;case "angle":return c.AngleTypeAdapter.WillChange;case "boolean":return c.BooleanTypeAdapter.WillChange;case "color":return c.ColorTypeAdapter.WillChange;case "text":return c.TextTypeAdapter.WillChange}}}}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}}c.PropertyTrackState.WorldInstanceSourceAdapter=b}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetIndex(){return this._updatedIndex?this._updatedIndex:super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]!==a&amp;&amp;(this._updatedIndex=a)}Interpolate(a,
f,d,e,g,h){if(this.GetPropertyAdapter().CanChange(f.GetValue()))return super.Interpolate(a,f,d,e,g,h)}_SaveToJson(){return Object.assign(super._SaveToJson(),{index:this._updatedIndex})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._updatedIndex=a.index)}}c.PropertyTrackState.InstanceVariableSourceAdapter=b}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._sid=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){var a=this._propertyTrack.GetPropertyTrackDataItem(),f=this._propertyTrack.GetTrack();a=this._sid?this._sid:a.GetSourceAdapterArguments()[0];f=f.GetInstance();a=f.GetBehaviorIndexBySID(a);return f.GetBehaviorInstances()[a].GetSdkInstance()}GetBehaviorType(a){const f=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[2];
return a.GetBehaviorTypeByName(f)}UpdateBehaviorTypeSid(a){this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]!==a&amp;&amp;(this._sid=a)}Interpolate(a,f,d,e,g,h){const l=this._propertyTrack.GetTrack().GetInstance();if(this.GetBehaviorType(l.GetObjectClass()))return super.Interpolate(a,f,d,e,g,h)}_SaveToJson(){return Object.assign(super._SaveToJson(),{sid:this._sid})}_LoadFromJson(a){a&amp;&amp;(super._LoadFromJson(a),this._sid=a.sid)}}c.PropertyTrackState.BehaviorSourceAdapter=b}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var f=a.GetEffectList();f=this.GetEffectType(f).GetIndex();return a.IsEffectIndexActive(f)?a.GetEffectParametersForIndex(f):null}GetEffectType(a){const f=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0];
return a.GetEffectTypeByName(f)}Interpolate(a,f,d,e,g,h){if(this._IsEffectActive())return super.Interpolate(a,f,d,e,g,h)}_IsEffectActive(){const a=this._propertyTrack.GetTrack().GetWorldInfo().GetInstanceEffectList();var f=a.GetEffectList();if(f=this.GetEffectType(f))return f=f.GetIndex(),a.IsEffectIndexActive(f)}}c.PropertyTrackState.EffectSourceAdapter=b}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(a,f,d,e,g,h){var l=this._propertyTrack.GetTrack();const m=l.GetObjectClass().GetPlugin();l=l.GetInstance().GetObjectClass().GetPlugin();if(m===l)return super.Interpolate(a,f,d,e,g,h)}}c.PropertyTrackState.PluginSourceAdapter=
b}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertySourceAdapter{constructor(a){super(a);this._value=0;this._init=!1}SetInitialState(){const a=this._propertyTrack.GetPropertyTrackData();let f=this._propertyTrack.GetPropertyTrackDataItem();f=a.GetFirstPropertyKeyframeDataItem(f);this._value=f.GetValueWithResultMode()}SetResumeState(){}GetValue(){this._init||this._propertyTrack.Interpolate(0);return this._value}Interpolate(a,f,d,e,g,h){e=c.PropertyTrackState.NumericTypeAdapter.Interpolate;this._value=
e(a,f,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)}}c.PropertyTrackState.ValueSourceAdapter=b}"use strict";
self.C3.PropertyTrackState.PropertyInterpolationAdapter=class{constructor(c){this._sourceAdapter=c;this._propertyTrack=c.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}CleanCaches(){this._target=this._saveState=this._worldInfo=null}GetPropertyTrack(){return this._propertyTrack}GetWorldInfo(){return this._worldInfo?
this._worldInfo:this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo()}SetFirstAbsoluteUpdate(c){this._firstAbsoluteUpdate=!!c}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState=null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(c){return typeof this._Getter()===typeof c}BeforeChangeProperty(){}ChangeProperty(c,b,
a,f,d){}AfterChangeProperty(){}_FirstKeyframeGetter(){return this._PickTimelinePlaybackMode(()=&gt;{const c=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(c)},()=&gt;{const c=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(c)}).GetAbsoluteValue()}_CurrentKeyframeGetter(){const c=this._propertyTrack.GetTimeline().GetTime()-this._propertyTrack.GetTrack().GetStartOffset();
return this._PickTimelinePlaybackMode(()=&gt;{const b=this._propertyTrack.GetPropertyTrackDataItem();return this._propertyTrack.GetPropertyTrackData().GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(c,b)},()=&gt;{const b=this._propertyTrack.GetPropertyTrackDataItem(),a=this._propertyTrack.GetPropertyTrackData(),f=a.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(c,b);return f?f:a.GetLastPropertyKeyframeDataItem(b)}).GetAbsoluteValue()}_PickTimelinePlaybackMode(c,b){return this._propertyTrack.GetTimeline().IsForwardPlayBack()?
c():b()}_PickResultMode(c,b){return"relative"===this._propertyTrack.GetResultMode()?c():b()}_PickFirstAbsoluteUpdate(c,b){return this.GetFirstAbsoluteUpdate()?(this.SetFirstAbsoluteUpdate(!1),c()):b()}_GetAbsoluteInitialValue(c){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){return this._target?this._target:this._target=this._sourceAdapter.GetTarget()}_PickSource(c,b,a,f,d){switch(this._propertyTrack.GetSourceAdapterId()){case "behavior":return c();case "effect":return b();case "instance-variable":return a();
case "plugin":return f();case "world-instance":return d()}}_SaveToJson(){return{firstAbsoluteUpdate:this._firstAbsoluteUpdate,saveState:this._saveState}}_LoadFromJson(c){c&amp;&amp;(this._firstAbsoluteUpdate=c.firstAbsoluteUpdate,this._saveState=c.saveState)}_GetPropertyKeyframeStubs(c,b=!1){const a=[];for(const f of c){c=f.GetTrack().GetStartOffset();for(const d of f.GetPropertyKeyframeDataItems())b&amp;&amp;0===d.GetTime()?a.push({time:c+d.GetTime(),value:d.GetAbsoluteValue()}):b||a.push({time:c+d.GetTime(),value:d.GetAbsoluteValue()})}return a.sort((f,
d)=&gt;f.time-d.time)}_GetLastPropertyKeyframeStub(c,b,a){return this._GetPropertyKeyframeStubLowerThanPlayhead(b,a)}_GetPropertyKeyframeStubLowerThanPlayhead(c,b){for(let a=b.length-1;0&lt;=a;a--)if(b[a].time&lt;=c)return b[a];return null}};"use strict";
{const c=self.C3,b=new Map,a=[0,0,0];class f extends c.PropertyTrackState.PropertyInterpolationAdapter{constructor(d){super(d)}SetInitialState(){}SetResumeState(){}GetCurrentState(){const d=this._propertyTrack.GetSourceAdapterId(),e=this._GetTarget(),g=this._GetIndex();switch(d){case "behavior":return this._ToColorArray(e.GetPropertyValueByIndex(g));case "effect":return this._ToColorArray(e[g]);case "plugin":return this._ToColorArray(e.GetPropertyValueByIndex(g));case "world-instance":return this._ToColorArray(this._Getter())}}CompareInitialStateWithCurrent(){const d=
this._FirstKeyframeGetter();return!this._CompareColors(d,this._Getter())}CompareSaveStateWithCurrent(){return c.IsNullOrUndefined(this._saveState)?!1:!this._CompareColors(this._saveState,this._Getter())}_CompareColors(d,e){return d.equalsIgnoringAlpha(e)}_FirstKeyframeGetter(){const d=super._FirstKeyframeGetter();return this._GetColorFromArray(d)}_CurrentKeyframeGetter(){const d=super._CurrentKeyframeGetter();return this._GetColorFromArray(d)}_GetAbsoluteInitialValue(d){}_ToColorArray(d){return c.IsInstanceOf(d,
c.Color)?d.toArray().slice(0,3):d.slice(0,3)}_GetColorFromArray(d){return c.IsInstanceOf(d,c.Color)?d:new c.Color(d[0],d[1],d[2],1)}CanChange(d){return!0}BeforeChangeProperty(){var d=this._propertyTrack.GetInstance();b.has(d)||b.set(d,new Map);d=b.get(d);const e=this._propertyTrack.GetSourceAdapterId();d.has(e)||d.set(e,new Map);d=d.get(e);d.has(this._property)||d.set(this._property,{used:!1,color:new c.Color(0,0,0,1)})}_GetTmpColor(d,e,g){d=b.get(d).get(e).get(g);d.used=!0;return d.color}ChangeProperty(d,
e,g,h,l){l=this._propertyTrack.GetTimeline();h=this._propertyTrack.GetTrack();d=this._propertyTrack.GetInstance();var m=this._propertyTrack.GetSourceAdapter();g=this._propertyTrack.GetSourceAdapterId();m=l.GetSimilarPropertyTracks(d,m,this._property);if(1&lt;m.length){if(m=this._GetPropertyKeyframeStubs(m,!0),l=this._GetLastPropertyKeyframeStub(l,l.GetTime(),m))if(h=h.GetStartOffset(),m=l.time-h,0===m)this._GetTmpColor(d,g,this._property).addRgb(e[0],e[1],e[2]);else{if(0&gt;m)return;l=e[0];h=e[1];e=e[2];
m=this._propertyTrack.Interpolate(m,!1,!0);l=c.Color.DiffChannel(l,m[0]);h=c.Color.DiffChannel(h,m[1]);e=c.Color.DiffChannel(e,m[2]);this._GetTmpColor(d,g,this._property).addRgb(l,h,e)}}else this._Setter(e[0],e[1],e[2]);return c.TimelineState.LAYOUT_RENDER_CHANGE}AfterChangeProperty(){const d=this._propertyTrack.GetInstance();if(b.has(d)){var e=b.get(d),g=this._propertyTrack.GetSourceAdapterId();if(e.has(g)){var h=e.get(g);if(h.has(this._property)){var l=h.get(this._property),m=l.color;l.used&amp;&amp;this._Setter(m.getR(),
m.getG(),m.getB());0===h.size&amp;&amp;e.delete(g);0===e.size&amp;&amp;b.delete(d)}}}}_Getter(){const d=this._propertyTrack.GetSourceAdapterId(),e=this._GetTarget(),g=this._GetIndex();switch(d){case "behavior":return this._GetColorFromArray(e.GetPropertyValueByIndex(g));case "effect":return e[g].clone();case "plugin":return this._GetColorFromArray(e.GetPropertyValueByIndex(g));case "world-instance":return this.GetWorldInfo().GetUnpremultipliedColor().clone()}}_Setter(d,e,g){const h=this._propertyTrack.GetSourceAdapterId(),
l=this._GetTarget(),m=this._GetIndex();switch(h){case "behavior":a[0]=d;a[1]=e;a[2]=g;l.SetPropertyValueByIndex(m,a);break;case "effect":l[m].setRgb(d,e,g);break;case "plugin":a[0]=d;a[1]=e;a[2]=g;l.SetPropertyValueByIndex(m,a);break;case "world-instance":this.GetWorldInfo().SetUnpremultipliedColorRGB(d,e,g)}}_SaveToJson(){}_LoadFromJson(d){}}c.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=f}"use strict";
{const c=self.C3;class b extends c.PropertyTrackState.PropertyInterpolationAdapter{constructor(a){super(a)}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return c.IsNullOrUndefined(this._saveState)?!1:this._saveState!==this.GetCurrentState()}ChangeProperty(a,f,d,e,g){d=c.PropertyTrackState.PropertySourceAdapter.GetWillChangeFunc(this._propertyTrack);
var h=this._propertyTrack;const l=h.GetTrack();e=h.GetSourceAdapterId();g=h.GetTimeline();var m=l.GetInstance();h=h.GetSourceAdapter();m=g.GetSimilarPropertyTracks(m,h,this._property);1&lt;m.length&amp;&amp;(m=this._GetPropertyKeyframeStubs(m),a+=l.GetStartOffset(),a=this._GetLastPropertyKeyframeStub(g,a,m))&amp;&amp;(f=a.value);if(d(this._GetIndex(),this._GetTarget(),f,e))switch(this._Setter(f),e){case "plugin":return c.TimelineState.LAYOUT_RENDER_CHANGE}}_Getter(){const a=this._propertyTrack.GetSourceAdapterId(),
f=this._GetTarget(),d=this._GetIndex();switch(a){case "behavior":return f.GetPropertyValueByIndex(d);case "effect":return f[d];case "instance-variable":return f.GetInstanceVariableValue(d);case "plugin":return f.GetPropertyValueByIndex(d)}}_Setter(a){const f=this._propertyTrack.GetSourceAdapterId(),d=this._GetTarget(),e=this._GetIndex();switch(f){case "behavior":d.SetPropertyValueByIndex(e,a);break;case "effect":d[e]=a;break;case "instance-variable":d.SetInstanceVariableValue(e,a);break;case "plugin":d.SetPropertyValueByIndex(e,
a)}}}c.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=b}"use strict";
{const c=self.C3,b=new Map,a=(d,e,g,h,l)=&gt;b.set(d,{setter:e,absolute_setter:g,getter:h,round:l});a("offsetX",(d,e)=&gt;d.OffsetX(e),(d,e)=&gt;d.SetX(e),d=&gt;d.GetX(),!0);a("offsetY",(d,e)=&gt;d.OffsetY(e),(d,e)=&gt;d.SetY(e),d=&gt;d.GetY(),!0);a("offsetWidth",(d,e)=&gt;d.OffsetWidth(e),(d,e)=&gt;d.SetWidth(e),d=&gt;d.GetWidth(),!0);a("offsetHeight",(d,e)=&gt;d.OffsetHeight(e),(d,e)=&gt;d.SetHeight(e),d=&gt;d.GetHeight(),!0);a("offsetAngle",(d,e)=&gt;d.OffsetAngle(e),(d,e)=&gt;d.SetAngle(e),d=&gt;d.GetAngle(),!1);a("offsetOpacity",(d,e)=&gt;d.OffsetOpacity(e),
(d,e)=&gt;d.SetOpacity(e),d=&gt;d.GetOpacity(),!1);a("offsetOriginX",(d,e)=&gt;d.OffsetOriginX(e),(d,e)=&gt;d.SetOriginX(e),d=&gt;d.GetOriginX(),!1);a("offsetOriginY",(d,e)=&gt;d.OffsetOriginY(e),(d,e)=&gt;d.SetOriginY(e),d=&gt;d.GetOriginY(),!1);a("offsetZElevation",(d,e)=&gt;d.OffsetZElevation(e),(d,e)=&gt;d.SetZElevation(e),d=&gt;d.GetZElevation(),!0);a("offsetScaleX",(d,e,g)=&gt;{d.OffsetWidth(g.GetOriginalWidth()*e)},(d,e,g)=&gt;{d.SetWidth(g.GetOriginalWidth()*e)},(d,e)=&gt;d.GetWidth()/e.GetOriginalWidth(),!1);a("offsetScaleY",(d,
e,g)=&gt;{d.OffsetHeight(g.GetOriginalHeight()*e)},(d,e,g)=&gt;{d.SetHeight(g.GetOriginalHeight()*e)},(d,e)=&gt;d.GetHeight()/e.GetOriginalHeight(),!1);class f extends c.PropertyTrackState.PropertyInterpolationAdapter{constructor(d){super(d);this._lastValue=0;this._instance_absolute_setter=this._instance_setter=this._instance_getter=null;this._round=!1;c.IsInstanceOf(this._propertyTrack.GetTimeline(),c.Tween)?this._typeAdapter=new c.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween(this):
this._typeAdapter=new c.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline(this);d=this._propertyTrack.GetPropertyName();"world-instance"===this._propertyTrack.GetSourceAdapterId()&amp;&amp;(d=b.get(d),this._instance_getter=d.getter,this._instance_setter=d.setter,this._instance_absolute_setter=d.absolute_setter,this._round=d.round)}Release(){this._instance_absolute_setter=this._instance_setter=this._instance_getter=this._typeAdapter=null;super.Release()}GetLastValue(){return this._lastValue}SetLastValue(d){this._lastValue=
d}SetInitialState(){const d=this._typeAdapter.SetInitialState();"number"===typeof d&amp;&amp;(this._lastValue=d)}SetResumeState(){const d=this._typeAdapter.SetResumeState();"number"===typeof d&amp;&amp;(this._lastValue=d)}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){return this._FirstKeyframeGetter()!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return c.IsNullOrUndefined(this._saveState)?!1:this._saveState!==this.GetCurrentState()}BeforeChangeProperty(){this._typeAdapter.BeforeChangeProperty()}ChangeProperty(d,
e,g,h,l,m){return this._typeAdapter.ChangeProperty(d,e,g,h,l,m)}AfterChangeProperty(){this._typeAdapter.AfterChangeProperty()}_Getter(){const d=this._GetTarget(),e=this._GetIndex(),g=this._propertyTrack.GetTrack(),h=this.GetWorldInfo();return this._PickSource(()=&gt;d.GetPropertyValueByIndex(e),()=&gt;d[e],()=&gt;d.GetInstanceVariableValue(e),()=&gt;d.GetPropertyValueByIndex(e),()=&gt;this._instance_getter(h,g))}_Setter(d,e,g){const h=this._GetTarget(),l=this._GetIndex(),m=this._propertyTrack.GetTrack(),n=this.GetWorldInfo();
this._PickSource(()=&gt;h.OffsetPropertyValueByIndex(l,d),()=&gt;h[l]+=d,()=&gt;h.SetInstanceVariableOffset(l,d),()=&gt;h.OffsetPropertyValueByIndex(l,d),()=&gt;this._instance_setter(n,d,m))}_SetterAbsolute(d,e,g){const h=this._GetTarget(),l=this._GetIndex(),m=this._propertyTrack.GetTrack(),n=this.GetWorldInfo();this._PickSource(()=&gt;h.SetPropertyValueByIndex(l,d),()=&gt;h[l]=d,()=&gt;h.SetInstanceVariableValue(l,d),()=&gt;h.SetPropertyValueByIndex(l,d),()=&gt;this._instance_absolute_setter(n,d,m))}_MaybeEnsureValue(d,e,g,h,
l,m){this._typeAdapter._MaybeEnsureValue(d,e,g,h,l,m)}_AddDelta(d,e,g){var h=(d.toString().split(".")[1]||"").length;d=this._Getter();h=0===h?this._round?Math.round(d):d:c.toFixed(d,h);this._Setter(h-d,e,g)}_SaveToJson(){return Object.assign(super._SaveToJson(),{v:this._lastValue})}_LoadFromJson(d){d&amp;&amp;(super._LoadFromJson(d),this._lastValue=d.v)}}c.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=f}"use strict";
{const c=self.C3,b=new Map;class a{constructor(f){this._numericInterpolationAdapter=f}Release(){this._numericInterpolationAdapter=null}SetInitialState(){const f=this._numericInterpolationAdapter,d=this._numericInterpolationAdapter.GetPropertyTrack();return f._PickResultMode(()=&gt;f._PickTimelinePlaybackMode(()=&gt;0,()=&gt;c.PropertyTrackState.PropertySourceAdapter.GetValueAtTime(d)),()=&gt;{})}SetResumeState(){}BeforeChangeProperty(){const f=this._numericInterpolationAdapter,d=this._numericInterpolationAdapter.GetPropertyTrack(),
e=d.GetPropertyName();f._PickResultMode(()=&gt;{},()=&gt;{var g=d.GetInstance();b.has(g)||b.set(g,new Map);g=b.get(g);const h=d.GetSourceAdapterId();g.has(h)||g.set(h,new Map);g=g.get(h);g.has(e)||g.set(e,{used:!1,value:0})})}_GetTmpAbsoluteValueObject(f,d,e){f=b.get(f).get(d).get(e);f.used=!0;return f}ChangeProperty(f,d,e,g,h,l){const m=this._numericInterpolationAdapter,n=this._numericInterpolationAdapter.GetPropertyTrack(),r=n.GetPropertyName();m._PickResultMode(()=&gt;{const q=m.GetLastValue();m._Setter(d-
q,e,g);l&amp;&amp;this._MaybeEnsureValue(f,e,g,h,q,d);m.SetLastValue(d)},()=&gt;{var q=n.GetTimeline(),t=n.GetTrack();const u=n.GetInstance();var w=n.GetSourceAdapter();const y=n.GetSourceAdapterId();w=q.GetSimilarPropertyTracks(u,w,r);if(1&lt;w.length){if(w=m._GetPropertyKeyframeStubs(w,!0),q=m._GetLastPropertyKeyframeStub(q,q.GetTime(),w))t=t.GetStartOffset(),t=q.time-t,0===t?this._GetTmpAbsoluteValueObject(u,y,r).value+=d:0&gt;t||(t=n.Interpolate(t,!1,!0),this._GetTmpAbsoluteValueObject(u,y,r).value+=d-t)}else m._SetterAbsolute(d)});
return m._PickSource(()=&gt;{},()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE,()=&gt;{},()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE,()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE)}AfterChangeProperty(){const f=this._numericInterpolationAdapter,d=this._numericInterpolationAdapter.GetPropertyTrack(),e=d.GetPropertyName();f._PickResultMode(()=&gt;{},()=&gt;{const g=d.GetInstance();if(b.has(g)){var h=b.get(g),l=d.GetSourceAdapterId();if(h.has(l)){var m=h.get(l);if(m.has(e)){var n=m.get(e),r=n.value;n.used&amp;&amp;f._SetterAbsolute(r);
m.delete(e);0===m.size&amp;&amp;h.delete(l);0===h.size&amp;&amp;b.delete(g)}}}})}_MaybeEnsureValue(f,d,e,g,h,l){const m=this._numericInterpolationAdapter;g||(d&amp;&amp;f===d.GetTime()?m._AddDelta(d.GetValueWithResultMode(),d,e):e&amp;&amp;f===e.GetTime()?m._AddDelta(e.GetValueWithResultMode(),d,e):0===l-h&amp;&amp;m._AddDelta(d.GetValueWithResultMode(),d,e))}}c.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTimeline=a}"use strict";
{const c=self.C3;new Map;class b{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())}BeforeChangeProperty(){}ChangeProperty(a,
f,d,e,g,h){const l=this._numericInterpolationAdapter,m=l.GetLastValue();l._PickResultMode(()=&gt;{l._Setter(f-m,d,e);h&amp;&amp;this._MaybeEnsureValue(a,d,e,g,m,f)},()=&gt;{l._PickFirstAbsoluteUpdate(()=&gt;{l._Setter(m,d,e)},()=&gt;{l._Setter(f-m,d,e);h&amp;&amp;this._MaybeEnsureValue(a,d,e,g,m,f)})});l.SetLastValue(f);return l._PickSource(()=&gt;{},()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE,()=&gt;{},()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE,()=&gt;c.TimelineState.LAYOUT_RENDER_CHANGE)}AfterChangeProperty(){}_GetAbsoluteInitialValue(a){return a-
this._numericInterpolationAdapter.GetCurrentState()}_MaybeEnsureValue(a,f,d,e,g,h){const l=this._numericInterpolationAdapter;e?f&amp;&amp;a===f.GetTime()?l._AddDelta(f.GetValueWithResultMode(),f,d):d&amp;&amp;a===d.GetTime()?l._AddDelta(d.GetValueWithResultMode(),f,d):d||l._AddDelta(f.GetValueWithResultMode(),f,d):f&amp;&amp;a===f.GetTime()?l._AddDelta(f.GetValueWithResultMode(),f,d):d&amp;&amp;a===d.GetTime()?l._AddDelta(d.GetValueWithResultMode(),f,d):0===h-g&amp;&amp;l._AddDelta(f.GetValueWithResultMode(),f,d)}}c.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapterForTween=
b}"use strict";
{const c=self.C3,b=self.Ease;c.PropertyTrackState.NumericTypeAdapter=class{constructor(){}static WillChange(a,f,d,e){let g;switch(e){case "behavior":g=f.GetPropertyValueByIndex(a);break;case "effect":g=f[a];break;case "instance-variable":g=f.GetInstanceVariableValue(a);break;case "plugin":g=f.GetPropertyValueByIndex(a)}return g===d?!1:!0}static Interpolate(a,f,d,e){if(!d)return d=e.GetPropertyTrackDataItem(),d=e.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(d),d.GetValueWithResultMode();var g=
e.GetInterpolationMode();"default"===g&amp;&amp;(g="continuous");"combo"===e.GetPropertyType()&amp;&amp;(g="discrete");if("discrete"===g)return f.GetValueWithResultMode();if("continuous"===g||"step"===g){"step"===g&amp;&amp;(g=e.GetTimeline().GetStep(),0!==g&amp;&amp;(g=1/g,a=Math.floor(a*g)/g));var h=f.GetTime();const l=d.GetTime();g=f.GetValueWithResultMode();const m=d.GetValueWithResultMode();if(g===m)return g;a=c.normalize(a,h,l);const n=f.GetEase();f=f.GetAddOn("cubic-bezier");d=d.GetAddOn("cubic-bezier");f&amp;&amp;f.GetStartEnable()&amp;&amp;
d&amp;&amp;d.GetEndEnable()?(h=l-h,h=b.GetRuntimeEase(n)(h*a,0,1,h),h=b.GetRuntimeEase("cubicbezier")(h,g,g+f.GetStartAnchor(),m+d.GetEndAnchor(),m)):h=b.GetRuntimeEase(n)((l-h)*a,g,m-g,l-h);return"integer"===e.GetPropertyType()?Math.floor(h):h}}}}"use strict";
{const c=self.C3;c.PropertyTrackState.AngleTypeAdapter=class{constructor(){}static WillChange(b,a,f,d){let e;switch(d){case "behavior":e=a.GetPropertyValueByIndex(b);break;case "effect":e=a[b];break;case "instance-variable":e=a.GetInstanceVariableValue(b);break;case "plugin":e=a.GetPropertyValueByIndex(b)}return e===f?!1:!0}static Interpolate(b,a,f,d){if(!f)return a=d.GetPropertyTrackDataItem(),a=d.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(a),a.GetValueWithResultMode();var e=d.GetInterpolationMode();
"default"===e&amp;&amp;(e="continuous");"combo"===d.GetPropertyType()&amp;&amp;(e="discrete");if("discrete"===e)return a.GetValueWithResultMode();if("continuous"===e||"step"===e){"step"===e&amp;&amp;(d=d.GetTimeline().GetStep(),0!==d&amp;&amp;(d=1/d,b=Math.floor(b*d)/d));const g=a.GetTime(),h=f.GetTime();d=a.GetValueWithResultMode();f=f.GetValueWithResultMode();if(e=a.GetAddOn("angle")){const l=e.GetRevolutions();if(d===f&amp;&amp;0===l)return d;b=c.normalize(b,g,h);a=self.Ease.GetRuntimeEase(a.GetEase())(b,0,1,1);switch(e.GetDirection()){case "closest":return c.angleLerp(d,
f,a,l);case "clockwise":return c.angleLerpClockwise(d,f,a,l);case "anti-clockwise":return c.angleLerpAntiClockwise(d,f,a,l)}}else{if(d===f)return d;b=c.normalize(b,g,h);a=self.Ease.GetRuntimeEase(a.GetEase());return c.angleLerp(d,f,a(b,0,1,1))}}}}}"use strict";
self.C3.PropertyTrackState.BooleanTypeAdapter=class{constructor(){}static WillChange(c,b,a,f){let d;switch(f){case "behavior":d=b.GetPropertyValueByIndex(c);break;case "effect":d=b[c];break;case "instance-variable":d=b.GetInstanceVariableValue(c);break;case "plugin":d=b.GetPropertyValueByIndex(c)}return!!d===!!a?!1:!0}static Interpolate(c,b,a,f){return a?b.GetValueWithResultMode()?1:0:(c=f.GetPropertyTrackDataItem(),c=f.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(c),c.GetValueWithResultMode()?
1:0)}};"use strict";
{const c=self.C3,b=[0,0,0],a=[0,0,0],f=[0,0,0];c.PropertyTrackState.ColorTypeAdapter=class{constructor(){}static WillChange(d,e,g,h){let l;switch(h){case "behavior":l=e.GetPropertyValueByIndex(d);break;case "effect":l=e[d];break;case "instance-variable":l=e.GetInstanceVariableValue(d);break;case "plugin":l=e.GetPropertyValueByIndex(d)}Array.isArray(g)?(b[0]=g[0],b[1]=g[1],b[2]=g[2]):(f.parseCommaSeparatedRgb(g),b[0]=Math.floor(255*f.getR()),b[1]=Math.floor(255*f.getG()),b[2]=Math.floor(255*f.getB()));
Array.isArray(l)?(a[0]=l[0],a[1]=l[1],a[2]=l[2]):(f.parseCommaSeparatedRgb(l),a[0]=Math.floor(255*f.getR()),a[1]=Math.floor(255*f.getG()),a[2]=Math.floor(255*f.getB()));return b[0]!==a[0]||b[1]!==a[1]||b[2]!==a[2]?!0:!1}static Interpolate(d,e,g,h){if(!g){var l=h.GetPropertyTrackDataItem();l=h.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(l);h=l.GetValueWithResultMode();b[0]=h[0];b[1]=h[1];b[2]=h[2];return b}l=h.GetInterpolationMode();"default"===l&amp;&amp;(l="continuous");if("discrete"===l)return h=
e.GetValueWithResultMode(),b[0]=h[0],b[1]=h[1],b[2]=h[2],b;if("continuous"===l||"step"===l){"step"===l&amp;&amp;(h=h.GetTimeline().GetStep(),0!==h&amp;&amp;(h=1/h,d=Math.floor(d*h)/h));h=e.GetTime();l=g.GetTime();var m=e.GetValueWithResultMode(),n=g.GetValueWithResultMode();d=c.normalize(d,h,l);var r=e.GetEase();e=m[0];g=m[1];m=m[2];const q=n[0],t=n[1];n=n[2];r=self.Ease.GetRuntimeEase(r);h=l-h;l=h*d;b[0]=e===q?e:r(l,e,q-e,h);b[1]=g===t?g:r(l,g,t-g,h);b[2]=m===n?m:r(l,m,n-m,h);return b}}}}"use strict";
self.C3.PropertyTrackState.TextTypeAdapter=class{constructor(){}static WillChange(c,b,a,f){let d;switch(f){case "behavior":d=b.GetPropertyValueByIndex(c);break;case "effect":d=b[c];break;case "instance-variable":d=b.GetInstanceVariableValue(c);break;case "plugin":d=b.GetPropertyValueByIndex(c)}return d===a?!1:!0}static Interpolate(c,b,a,f){return a?b.GetValueWithResultMode():(c=f.GetPropertyTrackDataItem(),c=f.GetPropertyTrackData().GetLastPropertyKeyframeDataItem(c),c.GetValueWithResultMode())}};
"use strict";
{const c=self.C3;c.TimelineDataManager=class{constructor(){this._timelineDataItems=new Map}Release(){for(const b of this._timelineDataItems.values())b.Release();this._timelineDataItems.clear();this._timelineDataItems=null}Add(b){b=new c.TimelineDataItem(b);const a=b.GetName();this._timelineDataItems.set(a,b)}Get(b){return this._timelineDataItems.get(b)}GetNameId(){return 0}static _CreateDataItems(b,a,f,d){if(a)for(const e of a)c.TimelineDataManager._CreateDataItem("create",e,b,f,d)}static _LoadDataItemsFromJson(b,a,
f,d){b.length?a.forEach((e,g)=&gt;{b[g]._LoadFromJson(e)}):a.forEach(e=&gt;{c.TimelineDataManager._CreateDataItem("load",e,b,f,d)})}static _CreateDataItem(b,a,f,d,e){let g;if("function"===typeof d)switch(b){case "load":g=new d(null,e);break;case "create":g=new d(a,e)}else if("object"===typeof d)switch(d=d.map.get(a[d.prop]),b){case "load":g=new d(null,e);break;case "create":g=new d(a,e)}switch(b){case "load":g._LoadFromJson(a);f.push(g);break;case "create":if("function"===typeof g.GetEnable&amp;&amp;!g.GetEnable())return g.Release();
f.push(g)}}}}"use strict";
{const c=self.C3;c.TimelineDataItem=class{constructor(b){this._name="";this._totalTime=NaN;this._step=0;this._resultMode=this._interpolationMode="default";this._pingPong=this._loop=!1;this._repeatCount=1;this._trackData=null;b&amp;&amp;(this._name=b[0],this._totalTime=b[1],this._step=b[2],this._interpolationMode=b[3],this._resultMode=b[4],this._loop=!!b[6],this._pingPong=!!b[7],this._repeatCount=b[8],this._trackData=new c.TrackData(b[5],this))}Release(){this._trackData.Release();this._trackData=null}GetTrackData(){this._trackData||
(this._trackData=new c.TrackData(null,this));return this._trackData}GetName(){return this._name}SetName(b){this._name=b}GetTotalTime(){return this._totalTime}SetTotalTime(b){this._totalTime=b}GetStep(){return this._step}SetStep(b){this._step=b}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(b){this._interpolationMode=b}GetResultMode(){return this._resultMode}SetResultMode(b){this._resultMode=b}GetLoop(){return this._loop}SetLoop(b){this._loop=b}GetPingPong(){return this._pingPong}SetPingPong(b){this._pingPong=
b}GetRepeatCount(){return this._repeatCount}_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}}_LoadFromJson(b){b&amp;&amp;(this.GetTrackData()._LoadFromJson(b.trackDataJson),this._name=b.name,this._totalTime=b.totalTime,this._step=b.step,this._interpolationMode=b.interpolationMode,this._resultMode=
b.resultMode,this._loop=b.loop,this._pingPong=b.pingPong,this._repeatCount=b.repeatCount)}}}"use strict";
{const c=self.C3;class b{constructor(a,f){this._trackData=f;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();a&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]),this._keyframeData=new c.KeyframeData(a[4],this),this._propertyTrackData=new c.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 c.KeyframeData(null,this));return this._keyframeData}GetPropertyTrackData(){this._propertyTrackData||(this._propertyTrackData=new c.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}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}_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}}_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._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))}}c.TrackData=class{constructor(a,f){this._timelineDataItem=f;this._trackDataItems=[];this._keyframeTimeMap=new Map;c.TimelineDataManager._CreateDataItems(this._trackDataItems,a,b,this)}Release(){this._timelineDataItem=
null;for(const a of this._trackDataItems)a.Release();c.clearArray(this._trackDataItems);this._trackDataItems=null;this._keyframeTimeMap.clear();this._keyframeTimeMap=null}GetTimelineDataItem(){return this._timelineDataItem}AddEmptyTrackDataItem(){const a=new b(null,this);this._trackDataItems.push(a);return a}GetFirstKeyframeDataItem(a){return a.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(a){a=a.GetKeyframeData().GetKeyframeDataItemArray();return a[a.length-1]}GetKeyFrameDataItemAtTime(a,
f){const d=this._keyframeTimeMap.get(f);if(d&amp;&amp;d.has(a))return d.get(a);for(const e of f.GetKeyframeData().keyframeDataItems())if(e.GetTime()===a)return d||this._keyframeTimeMap.set(f,new Map),this._keyframeTimeMap.get(f).set(a,e),e}GetFirstKeyFrameDataItemHigherThan(a,f){for(const d of f.GetKeyframeData().keyframeDataItems())if(d.GetTime()&gt;a)return d}GetFirstKeyFrameDataItemHigherOrEqualThan(a,f){for(const d of f.GetKeyframeData().keyframeDataItems())if(d.GetTime()&gt;=a)return d}GetFirstKeyFrameDataItemLowerOrEqualThan(a,
f){for(const d of f.GetKeyframeData().keyframeDataItemsReverse())if(d.GetTime()&lt;=a)return d}*trackDataItems(){for(const a of this._trackDataItems)yield a}_SaveToJson(){return{trackDataItemsJson:this._trackDataItems.map(a=&gt;a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;c.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,a.trackDataItemsJson,b,this)}}}"use strict";
{const c=self.C3;class b{constructor(a,f){this._propertyTrackData=f;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;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 c.PropertyKeyframeData(a[8],this))}Release(){this._propertyKeyframeData.Release();this._sourceAdapterArguments=this._propertyTrackData=this._propertyKeyframeData=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){this._propertyKeyframeData||(this._propertyKeyframeData=new c.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}_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}}_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.GetPropertyKeyframeData()._LoadFromJson(a.propertyKeyframeDataJson))}}c.PropertyTrackData=class{constructor(a,f){this._trackDataItem=f;this._propertyTrackDataItems=[];this._propertyKeyframeTimeMap=new Map;c.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems,a,b,this)}Release(){this._trackDataItem=null;for(const a of this._propertyTrackDataItems)a.Release();c.clearArray(this._propertyTrackDataItems);this._propertyTrackDataItems=null;this._propertyKeyframeTimeMap.clear();
this._propertyKeyframeTimeMap=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const a=new b(null,this);this._propertyTrackDataItems.push(a);return a}GetFirstPropertyKeyframeDataItem(a){return a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(a){a=a.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray();return a[a.length-1]}GetPropertyKeyFrameDataItemAtTime(a,f){const d=this._propertyKeyframeTimeMap.get(f);if(d&amp;&amp;
d.has(a))return d.get(a);const e=f.GetPropertyKeyframeData();for(const g of e.propertyKeyframeDataItems())if(g.GetTime()===a)return d||this._propertyKeyframeTimeMap.set(f,new Map),this._propertyKeyframeTimeMap.get(f).set(a,g),g}GetFirstPropertyKeyFrameDataItemHigherThan(a,f){f=f.GetPropertyKeyframeData();for(const d of f.propertyKeyframeDataItems())if(d.GetTime()&gt;a)return d}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(a,f){f=f.GetPropertyKeyframeData();for(const d of f.propertyKeyframeDataItems())if(d.GetTime()&gt;=
a)return d}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(a,f){f=f.GetPropertyKeyframeData();for(const d of f.propertyKeyframeDataItemsReverse())if(d.GetTime()&lt;=a)return d}*propertyTrackDataItems(){for(const a of this._propertyTrackDataItems)yield a}_SaveToJson(){return{propertyTrackDataItemsJson:this._propertyTrackDataItems.map(a=&gt;a._SaveToJson())}}_LoadFromJson(a){a&amp;&amp;c.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,a.propertyTrackDataItemsJson,b,this)}}}"use strict";
{const c=self.C3;class b{constructor(a,f){this._keyframeData=f;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())))}Release(){this._keyframeData=null;c.clearArray(this._tags);this._tags=null;this._lowerTags.clear();this._lowerTags=null}GetKeyframeData(){return this._keyframeData}GetTime(){return this._time}SetTime(a){this._time=
a}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(f=&gt;f.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(f=&gt;f.toLowerCase())))}}c.KeyframeData=class{constructor(a,f){this._trackDataItem=f;this._keyframeDataItems=[];c.TimelineDataManager._CreateDataItems(this._keyframeDataItems,a,b,this)}Release(){this._trackDataItem=null;for(const a of this._keyframeDataItems)a.Release();c.clearArray(this._keyframeDataItems);this._keyframeDataItems=null}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const a=
new b(null,this);this._keyframeDataItems.push(a);return a}DeleteKeyframeDataItems(a){for(const f of this._keyframeDataItems){if(!a(f))continue;const d=this._keyframeDataItems.indexOf(f);-1!==d&amp;&amp;(f.Release(),this._keyframeDataItems.splice(d,1))}this.SortKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((a,f)=&gt;a.GetTime()-f.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;c.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,a.keyframeDataItemsJson,b,this)}}}"use strict";
{const c=self.C3;class b{constructor(a,f){this._propertyKeyframeData=f;this._aValue=this._value=null;this._type="";this._time=NaN;this._ease="noease";this._enable=!1;this._addonData=null;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 c.AddonData(a[4],this)))}Release(){this._propertyKeyframeData=null;this._addonData&amp;&amp;(this._addonData.Release(),this._addonData=null)}GetAddonData(){return this._addonData}GetValue(){return this._value}SetValue(a){"color"===
this._type&amp;&amp;c.IsFiniteNumber(a)?(this._value[0]=c.GetRValue(a),this._value[1]=c.GetGValue(a),this._value[2]=c.GetBValue(a)):this._value=a}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(a){"color"===this._type&amp;&amp;c.IsFiniteNumber(a)?(this._aValue[0]=c.GetRValue(a),this._aValue[1]=c.GetGValue(a),this._aValue[2]=c.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}GetEase(){return this._ease}SetEase(a){this._ease=a}GetEnable(){return this._enable}SetEnable(a){this._enable=!!a}GetAddOn(a){if(this.GetAddonData())for(const f of this.GetAddonData().addonDataItems())if(f.GetId()===a)return f}_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)}}c.PropertyKeyframeData=class{constructor(a,f){this._propertyTrackDataItem=f;this._propertyKeyframeDataItems=[];c.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,a,b,this)}Release(){this._propertyTrackDataItem=null;for(const a of this._propertyKeyframeDataItems)a.Release();
c.clearArray(this._propertyKeyframeDataItems);this._propertyKeyframeDataItems=null}AddEmptyPropertyKeyframeDataItem(){const a=new b(null,this);this._propertyKeyframeDataItems.push(a);return a}DeletePropertyKeyframeDataItems(a){for(const f of this._propertyKeyframeDataItems){if(!a(f))continue;const d=this._propertyKeyframeDataItems.indexOf(f);-1!==d&amp;&amp;(f.Release(),this._propertyKeyframeDataItems.splice(d,1))}this.SortPropertyKeyFrameDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((a,
f)=&gt;a.GetTime()-f.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){return this._propertyKeyframeDataItems.length}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;c.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,a.propertyKeyframeDataItemsJson,b,this)}}}"use strict";
{const c=self.C3;class b{constructor(d,e){this._addonData=e;this._id=d[0];this._data=d[1]}Release(){this._data=this._addonData=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{id:this._id,data:this._data}}_LoadFromJson(d){d&amp;&amp;(this._id=d.id,this._data=d.data)}}class a extends b{constructor(d,e){super(d,e);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(d){d&amp;&amp;(super._LoadFromJson(d),this._startAnchor=d.startAnchor,this._startEnable=!!d.startEnable,this._endAnchor=d.endAnchor,this._endEnable=!!d.endEnable)}}class f extends b{constructor(d,e){super(d,e);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(d){d&amp;&amp;(super._LoadFromJson(d),this._direction=d.direction,this._revolutions=d.revolutions)}}c.AddonData=class{constructor(d,e){this._propertyKeyframeDataItem=e;this._addonDataItems=[];c.TimelineDataManager._CreateDataItems(this._addonDataItems,d,{prop:0,map:new Map([["cubic-bezier",a],["angle",f]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const d of this._addonDataItems)d.Release();c.clearArray(this._addonDataItems);
this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}*addonDataItems(){for(const d of this._addonDataItems)yield d}_SaveToJson(){return{addonDataItemsJson:this._addonDataItems.map(d=&gt;d._SaveToJson())}}_LoadFromJson(d){d&amp;&amp;c.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,d.addonDataItemsJson,{prop:"id",map:new Map([["cubic-bezier",a],["angle",f]])},this)}}}"use strict";
{const c=self.C3;let b=0;c.Tween=class extends c.TimelineState{constructor(a,f){super(`tween-${b++}`,a,f);this._id="";this._destroyInstanceOnComplete=!1;this._initialValueMode="start-value";this._on_started_callbacks=this._on_completed_callbacks=null}GetInstance(){var a=this.GetTracks();if(a&amp;&amp;a.length&amp;&amp;(a=a[0])){var f=a.GetInstance();return a.IsInstanceValid()?f:null}}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,f){for(const e of this._tracks)for(const g of e._propertyTracks){if(g.GetPropertyName()!==f)continue;var d=g.GetPropertyTrackData();
const h=g.GetPropertyTrackDataItem();d=d.GetFirstPropertyKeyframeDataItem(h);d.SetValue(a);d.SetAbsoluteValue(a)}}_GetPropertyTrackState(a){for(const f of this._tracks)for(const d of f._propertyTracks)if(d.GetPropertyName()===a)return d}BeforeSetEndValues(a){for(const f of a)a=this._GetPropertyTrackState(f),this.SetStartValue(a.GetCurrentState(),f);this.IsForwardPlayBack()?(this.SetTotalTime(this.GetTotalTime()-this.GetTime()),this._SetTime(0)):(this.SetTotalTime(this.GetTime()),this._SetTime(this.GetTotalTime()));
this.SetInitialStateFromSetTime()}SetEndValue(a,f){var d=this._GetPropertyTrackState(f);f=d.GetPropertyTrackData();d=d.GetPropertyTrackDataItem();f=f.GetLastPropertyKeyframeDataItem(d);f.SetTime(this.GetTotalTime());f.SetValue(a);f.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)}SetInitialState(a){if(!this.InitialStateSet()&amp;&amp;"current-state"===this.GetInitialValueMode())for(const f of this._tracks)f.CompareInitialStateWithCurrent();
super.SetInitialState(a)}Stop(a=!1){super.Stop(a);if(!this.IsComplete())for(const f of this._tracks)f.SaveState()}Reset(a=!0,f=!1){this._DeleteIntermediateKeyframes();super.Reset(a,f)}_DeleteIntermediateKeyframes(){for(const a of this._tracks){const f=d=&gt;{d=d.GetTime();const e=this.GetTotalTime();return 0!==d&amp;&amp;d!==e};a.DeleteKeyframes(f);a.DeletePropertyKeyframes(f)}}_OnBeforeChangeLayout(){if(this.IsReleased())return!0;const a=this.GetInstance();if(a&amp;&amp;a.GetObjectClass().IsGlobal())return!1;this._timelineManager.CompleteTimeline(this);
this.ResetBeforeChangeLayout();return!0}MaybeTriggerKeyframeReachedConditions(){}Tick(a,f){a=this.GetInstance();a=this.GetRuntime().GetDt(a);super.Tick(a,1)}_SaveToJson(){const a=super._SaveToJson(),f=this.GetTimelineDataItem();return Object.assign(a,{tweenDataItemJson:f._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 f=a.runtime.GetTimelineManager(),d=new c.TimelineDataItem;if(a.json){d._LoadFromJson(a.json.tweenDataItemJson);var e=new c.Tween(d,f);e._LoadFromJson(a.json);return e}f=new c.Tween(d,f);c.IsArray(a.propertyTracksConfig)||(a.propertyTracksConfig=[a.propertyTracksConfig]);f.SetId(a.id);
f.SetTags(a.tags);f.SetInitialValueMode(a.initialValueMode);f.SetDestroyInstanceOnComplete(a.releaseOnComplete);f.SetLoop(a.loop);f.SetPingPong(a.pingPong);f.SetTotalTime(a.time);f.SetStep(0);f.SetInterpolationMode("default");f.SetResultMode(a.propertyTracksConfig[0].resultMode);d=f.AddTrack();d.SetInstanceUID(a.instance.GetUID());d.SetInterpolationMode("default");d.SetResultMode(a.propertyTracksConfig[0].resultMode);d.SetEnable(!0);d.SetObjectClassIndex(a.instance.GetObjectClass().GetIndex());d.SetOriginalWidth(a.instance.GetWorldInfo().GetWidth());
d.SetOriginalHeight(a.instance.GetWorldInfo().GetHeight());var g=d.AddKeyframe();g.SetTime(0);g.SetEase("noease");g.SetEnable(!0);g.SetTags("");g=d.AddKeyframe();g.SetTime(a.time);g.SetEase("noease");g.SetEnable(!0);g.SetTags("");for(e of a.propertyTracksConfig){g=d.AddPropertyTrack();g.SetSourceAdapterId(e.sourceId);g.SetSourceAdapterArgs(e.sourceArgs);g.SetPropertyName(e.property);g.SetPropertyType(e.type);g.SetMin(NaN);g.SetMax(NaN);g.SetInterpolationMode("default");g.SetResultMode(e.resultMode);
g.SetEnable(!0);const h=g.AddPropertyKeyframe();h.SetType(e.valueType);h.SetTime(0);h.SetEase(e.ease);h.SetEnable(!0);h.SetValue(e.startValue);h.SetAbsoluteValue(e.startValue);g=g.AddPropertyKeyframe();g.SetType(e.valueType);g.SetTime(a.time);g.SetEase(e.ease);g.SetEnable(!0);g.SetValue(e.endValue);g.SetAbsoluteValue(e.endValue)}return f}}}"use strict";
{const c=self.C3,b=self.Ease;c.Transition=class extends c.DefendedBase{constructor(a){super();this._name=a[0];this._transitionKeyframes=[];for(const f of a[1])a=c.TransitionKeyframe.Create(this,f),this._transitionKeyframes.push(a);this._precalculatedSamples=new Map;this._transitionKeyframeCache=new Map;this._PreCalcSamples();b.AddCustomEase(this._name,(f,d,e,g)=&gt;this.Interpolate(f,d,e,g))}static Create(a){return c.New(c.Transition,a)}Release(){for(const a of this._transitionKeyframes)a.Release();
c.clearArray(this._transitionKeyframes);this._transitionKeyframes=null;this._precalculatedSamples.clear();this._precalculatedSamples=null;this._transitionKeyframeCache.clear();this._transitionKeyframeCache=null}GetTransitionKeyFrameAt(a){const f=this._transitionKeyframeCache.get(a);if(f)return f;for(const d of this._transitionKeyframes)if(d.GetValueX()===a)return this._transitionKeyframeCache.set(a,d),d}GetFirstTransitionKeyFrameHigherThan(a){for(const f of this._transitionKeyframes)if(f.GetValueX()&gt;
a)return f}GetFirstTransitionKeyFrameHigherOrEqualThan(a){for(const f of this._transitionKeyframes)if(f.GetValueX()&gt;=a)return f}GetFirstTransitionKeyFrameLowerOrEqualThan(a){for(let f=this._transitionKeyframes.length-1;0&lt;=f;f--){const d=this._transitionKeyframes[f];if(d.GetValueX()&lt;=a)return d}}Interpolate(a,f,d,e){var g=a/e;(a=this.GetTransitionKeyFrameAt(g))?e=this.GetFirstTransitionKeyFrameHigherThan(g):(a=this.GetFirstTransitionKeyFrameLowerOrEqualThan(g),e=this.GetFirstTransitionKeyFrameHigherOrEqualThan(g));
var h=e.GetValueX()-a.GetValueX();g=c.mapToRange(g,a.GetValueX(),e.GetValueX(),0,h);h=a.GetValueX();const l=a.GetValueY(),m=a.GetValueX()+a.GetStartAnchorX(),n=a.GetValueY()+a.GetStartAnchorY(),r=e.GetValueX()+e.GetEndAnchorX(),q=e.GetValueY()+e.GetEndAnchorY(),t=e.GetValueX();e=e.GetValueY();e=b.GetRuntimeEase("spline")(g,h,l,m,n,r,q,t,e,this._precalculatedSamples.get(a));e+=a.GetValueY();return(1-e)*f+e*(f+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 f=this._transitionKeyframes[d+1];const e=a.GetValueX(),g=a.GetValueX()+a.GetStartAnchorX(),h=f.GetValueX()+f.GetEndAnchorX();f=f.GetValueX();this._precalculatedSamples.set(a,b.GetBezierSamples(e,g,h,f))}}}}"use strict";
{const c=self.C3;c.TransitionKeyframe=class extends c.DefendedBase{constructor(b,a){super();this._transition=b;this._valueX=a[0];this._valueY=a[1];this._startAnchorX=a[2];this._startAnchorY=a[3];this._endAnchorX=a[4];this._endAnchorY=a[5];this._startEnable=a[6];this._endEnable=a[7]}Release(){this._transition=null}static Create(b,a){return c.New(c.TransitionKeyframe,b,a)}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 c=self.C3;c.TransitionManager=class extends c.DefendedBase{constructor(b){super();this._runtime=b;this._transitions=[]}Release(){for(const b of this._transitions)b.Release();c.clearArray(this._transitions);this._transitions=null}Create(b){this._transitions.push(c.Transition.Create(b))}}}"use strict";
{const c=self.C3;c.SolStack=class extends c.DefendedBase{constructor(b){super();this._objectClass=b;this._stack=[];this._stack.push(c.New(c.Sol,this));this._index=0;this._current=this._stack[0]}Release(){for(const b of this._stack)b.Release();c.clearArray(this._stack);this._objectClass=this._current=null}GetObjectClass(){return this._objectClass}GetCurrentSol(){return this._current}Clear(){this.GetCurrentSol().Clear()}PushClean(){var b=this._stack,a=++this._index;a===b.length?(a=c.New(c.Sol,this),
b.push(a),this._current=a):(b=b[a],b.Reset(),this._current=b)}PushCopy(){const b=this._stack,a=++this._index;a===b.length&amp;&amp;b.push(c.New(c.Sol,this));const f=b[a];f.Copy(b[a-1]);this._current=f}Pop(){this._current=this._stack[--this._index]}RemoveInstances(b){const a=this._stack;for(let f=0,d=a.length;f&lt;d;++f)a[f].RemoveInstances(b)}}}"use strict";
{const c=self.C3;c.Sol=class extends c.DefendedBase{constructor(b){super();this._stack=b;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(){c.clearArray(this._instances);c.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 b=this.GetInstances();return b.length?b:this._elseInstances}Reset(){this._selectAll=!0;c.clearArray(this._elseInstances)}Clear(){this._selectAll=!0}Copy(b){b.IsSelectAll()?this.Reset():(this._selectAll=!1,c.shallowAssignArray(this._instances,
b._instances),c.clearArray(this._elseInstances))}_PushInstance(b){this._instances.push(b)}_PushElseInstance(b){this._elseInstances.push(b)}_SetSelectAll(b){this._selectAll=!!b}_GetOwnInstances(){return this._instances}_GetOwnElseInstances(){return this._elseInstances}SetSinglePicked(b){this._selectAll=!1;c.clearArray(this._instances);this._instances.push(b)}SetArrayPicked(b){this._selectAll=!1;c.shallowAssignArray(this._instances,b)}SetSetPicked(b){this._selectAll=!1;c.clearArray(this._instances);
for(const a of b)this._instances.push(a)}AddElseInstances(b,a){for(const f of a)b.has(f)||this._elseInstances.push(f)}TransferElseInstancesToOwn(b){for(const a of b)this._instances.push(a);c.arrayRemoveAllInSet(this._elseInstances,b)}PickOne(b){b&amp;&amp;(this._eventStack.GetCurrentStackFrame().GetCurrentEvent().IsOrBlock()?(this.IsSelectAll()&amp;&amp;(c.clearArray(this._instances),c.shallowAssignArray(this._elseInstances,b.GetObjectClass().GetInstances()),this._selectAll=!1),b=this._elseInstances.indexOf(b),-1!==
b&amp;&amp;(this._instances.push(this._elseInstances[b]),this._elseInstances.splice(b,1))):this.SetSinglePicked(b))}RemoveInstances(b){c.arrayRemoveAllInSet(this._instances,b);c.arrayRemoveAllInSet(this._elseInstances,b)}}}"use strict";
{const c=self.C3;c.EventStack=class extends c.DefendedBase{constructor(b){super();this._eventSheetManager=b;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._stack.push(c.New(c.EventStackFrame,this,null));this._index=0;this._expFuncStack=[]}Release(){for(const b of this._stack)b.Release();c.clearArray(this._stack);c.clearArray(this._expFuncStack);this._runtime=this._eventSheetManager=null}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrentStackFrame(){return this._stack[this._index]}Push(b){var a=
this._stack;const f=++this._index;if(f===a.length)return b=c.New(c.EventStackFrame,this,b),a.push(b),b;a=a[f];a.Reset(b);return a}Pop(){--this._index}PushExpFunc(b){this._expFuncStack.push(b)}PopExpFunc(){this._expFuncStack.pop()}GetCurrentExpFuncStackFrame(){const b=this._expFuncStack;return 0===b.length?null:b[b.length-1]}}}"use strict";
{const c=self.C3;c.EventStackFrame=class extends c.DefendedBase{constructor(b,a){super();this._stack=b;this._runtime=this._stack.GetRuntime();this._currentEvent=a;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(b){this._currentEvent=b;this._actIndex=this._cndIndex=0;this._elseBranchRan=this._lastEventTrue=!1}_Restore(b,a){this._currentEvent=
b;this._cndIndex=0;this._actIndex=a}ResetQuick(){this._actIndex=this._cndIndex=0}GetCurrentEvent(){return this._currentEvent}SetCurrentEvent(b){this._currentEvent=b}GetConditionIndex(){return this._cndIndex}SetConditionIndex(b){this._cndIndex=b}GetActionIndex(){return this._actIndex}SetActionIndex(b){this._actIndex=b}SetLastEventTrue(b){this._lastEventTrue=!!b}GetLastEventTrue(){return this._lastEventTrue}SetElseBranchRan(b){this._elseBranchRan=!!b}GetElseBranchRan(){return this._elseBranchRan}SetExpressionObjectClass(b){this._expressionObjectClass=
b}GetExpressionObjectClass(){return this._expressionObjectClass}InitCallFunctionExpression(b,a){this._functionReturnType=b;this._functionReturnValue=a}GetFunctionReturnType(){return this._functionReturnType}SetFunctionReturnValue(b){this._functionReturnValue=b}GetFunctionReturnValue(){return this._functionReturnValue}IsSolModifierAfterCnds(){const b=this._currentEvent;return b.IsSolWriterAfterCnds()?!0:this._cndIndex&lt;b.GetConditionCount()-1?!!b.GetSolModifiers().length:!1}}}"use strict";
{const c=self.C3;c.LocalVarStack=class extends c.DefendedBase{constructor(b){super();this._eventSheetManager=b;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1;this._current=null;this._initialValues=[]}Release(){c.clearArray(this._stack);this._runtime=this._eventSheetManager=null}_SetInitialValues(b){this._initialValues=b;b=this._initialValues.slice(0);this._stack.push(b);this._index=0;this._current=b}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetCurrent(){return this._current}Push(){const b=
++this._index,a=this._stack;b===a.length?a.push(this._initialValues.slice(0)):c.shallowAssignArray(a[b],this._initialValues);this._current=a[b]}Pop(){this._current=this._stack[--this._index]}}}"use strict";
{const c=self.C3;c.LoopStack=class extends c.DefendedBase{constructor(b){super();this._eventSheetManager=b;this._runtime=this._eventSheetManager.GetRuntime();this._stack=[];this._index=-1}Release(){c.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 b=c.New(c.Loop,
this);this._stack.push(b);return b}b=this._stack[this._index];b.Reset();return b}Pop(){--this._index}FindByName(b){const a=this._stack;for(let f=this._index;0&lt;=f;--f){const d=a[f];if(d.GetName()===b)return d}return null}_GetStack(){return this._stack.slice(0,this._index+1)}}}"use strict";
{const c=self.C3;c.Loop=class extends c.DefendedBase{constructor(b){super();this._loopStack=b;this._name="";this._index=0;this._isStopped=!1;this._end=NaN}Reset(){this._name="";this._index=0;this._isStopped=!1;this._end=NaN}SetName(b){this._name=b}GetName(){return this._name}SetIndex(b){this._index=b}GetIndex(){return this._index}Stop(){this._isStopped=!0}IsStopped(){return this._isStopped}SetEnd(b){this._end=b}GetEnd(){return this._end}}}"use strict";
{const c=self.C3;c.ArrayStack=class extends c.DefendedBase{constructor(){super();this._stack=[];this._index=-1}Release(){c.clearArray(this._stack)}GetCurrent(){return this._stack[this._index]}Push(){++this._index;if(this._index===this._stack.length){const b=[];this._stack.push(b);return b}return this._stack[this._index]}Pop(){--this._index}}}"use strict";
{const c=self.C3;function b(f,d){return f.GetIndex()-d.GetIndex()}function a(f,d){for(let e=0,g=f.length;e&lt;g;++e)if(f[e]!==d[e])return!1;return!0}c.EventSheetManager=class extends c.DefendedBase{constructor(f){super();this._runtime=f;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=c.New(c.EventStack,this);this._localVarStack=c.New(c.LocalVarStack,this);this._loopStack=c.New(c.LoopStack,this);this._triggersToPostInit=[];this._queuedTriggers=[];this._queuedDebugTriggers=[];this._blockFlushingDepth=this._executingTriggerDepth=this._runningEventsDepth=0;this._scheduledWaits=[];this._asyncActionPromises=[];self.c3_callFunction=(d,e)=&gt;this._InvokeFunctionFromJS(d,e)}Release(){this.ClearAllScheduledWaits();
this._eventStack.Release();this._eventStack=null;this._localVarStack.Release();this._localVarStack=null;c.clearArray(this._queuedTriggers);c.clearArray(this._queuedDebugTriggers);this._runtime=null;c.clearArray(this._allSheets);this._sheetsByName.clear()}Create(f){f=c.New(c.EventSheet,this,f);this._allSheets.push(f);this._sheetsByName.set(f.GetName().toLowerCase(),f)}_AddTriggerToPostInit(f){this._triggersToPostInit.push(f)}_PostInit(){for(const f of this._functionBlocksByName.values())f._PostInit(!1);
for(const f of this._allSheets)f._PostInit();for(const f of this._allSheets)f._UpdateDeepIncludes();for(const f of this._triggersToPostInit)f._PostInit(!1);c.clearArray(this._triggersToPostInit);this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(f){return this._sheetsByName.get(f.toLowerCase())||null}_RegisterGroup(f){this._allGroups.push(f);this._groupsByName.set(f.GetGroupName(),f)}_RegisterEventBlock(f){this._blocksBySid.set(f.GetSID(),
f)}_RegisterCondition(f){this._cndsBySid.set(f.GetSID(),f)}_RegisterAction(f){this._actsBySid.set(f.GetSID(),f)}_RegisterFunctionBlock(f){this._functionBlocksByName.set(f.GetFunctionName().toLowerCase(),f)}_RegisterEventVariable(f){this._eventVarsBySid.set(f.GetSID(),f);f.IsGlobal()?this._allGlobalVars.push(f):this._allLocalVars.push(f)}_DeduplicateSolModifierList(f){2&lt;=f.length&amp;&amp;f.sort(b);let d=this._allUniqueSolModifiers.get(f.length);d||(d=[],this._allUniqueSolModifiers.set(f.length,d));for(let e=
0,g=d.length;e&lt;g;++e){const h=d[e];if(a(f,h))return h}d.push(f);return f}_GetNextLocalVarIndex(f){this._localVarInitialValues.push(f.GetInitialValue());return this._nextLocalVarIndex++}GetEventStack(){return this._eventStack}GetCurrentEventStackFrame(){return this.GetEventStack().GetCurrentStackFrame()}GetCurrentEvent(){return this.GetCurrentEventStackFrame().GetCurrentEvent()}GetCurrentCondition(){const f=this.GetCurrentEventStackFrame();return f.GetCurrentEvent().GetConditionAt(f.GetConditionIndex())}GetCurrentAction(){const f=
this.GetCurrentEventStackFrame();return f.GetCurrentEvent().GetActionAt(f.GetActionIndex())}GetLocalVarStack(){return this._localVarStack}GetLoopStack(){return this._loopStack}GetAllLocalVariablesInScope(f){const d=[];for(f=f.GetScopeParent();f;)c.appendArray(d,f._GetAllLocalVariablesInScope()),f=f.GetScopeParent();return d}_GetLocalVariablesScriptInterface(f){const d={};for(const e of this.GetAllLocalVariablesInScope(f))d[e.GetJsPropName()]=e._GetScriptInterfaceDescriptor();return Object.create(Object.prototype,
d)}GetEventVariableBySID(f){return this._eventVarsBySid.get(f)||null}GetEventBlockBySID(f){return this._blocksBySid.get(f)||null}GetConditionBySID(f){return this._cndsBySid.get(f)||null}GetActionBySID(f){return this._actsBySid.get(f)||null}GetFunctionBlockByName(f){return this._functionBlocksByName.get(f.toLowerCase())||null}GetAllGlobalVariables(){return this._allGlobalVars}GetAllLocalVariables(){return this._allLocalVars}ResetAllGlobalsToInitialValue(){for(const f of this._allGlobalVars)f.ResetToInitialValue()}GetEventGroupByName(f){return this._groupsByName.get(f.toLowerCase())||
null}GetEventGroupBySID(f){return(f=this._blocksBySid.get(f))&amp;&amp;f.IsGroup()?f:null}GetAllGroups(){return this._allGroups}ResetAllGroupsInitialActivation(){for(const f of this._allGroups)f.ResetInitialActivation()}_ResetAllHasRunFlags(){for(const f of this._allSheets)f._ResetHasRunFlag()}RunEvents(f){this._ResetAllHasRunFlags();this._runningEventsDepth++;for(const d of f.runningLayouts())if(f=d.GetEventSheet())this._runtime.PushCurrentLayout(d),f.Run(),this._runtime.PopCurrentLayout();this._runningEventsDepth--}async DebugRunEvents(f){this._ResetAllHasRunFlags();
this._runningEventsDepth++;for(const d of this._DebugRunEventsGen(f))await this._runtime.DebugBreak(d);this._runningEventsDepth--}*_DebugRunEventsGen(f){for(const d of f.runningLayouts())if(f=d.GetEventSheet())this._runtime.PushCurrentLayout(d),yield*f.DebugRun(),this._runtime.PopCurrentLayout()}_Trigger(f,d,e,g){let h=!1;if(!f.GetMainRunningLayout())return this.QueueTrigger(d,e,g);this._executingTriggerDepth++;for(const l of f.runningLayouts())if(f=l.GetEventSheet()){this._runtime.PushCurrentLayout(l);
for(const m of f.deepIncludes()){const n=m._Trigger(d,e,g);h=h||n}f=f._Trigger(d,e,g);h=h||f;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--;return h}*_DebugTrigger(f,d,e,g){let h=!1;if(!f.GetMainRunningLayout())return this.QueueTrigger(d,e,g);this._executingTriggerDepth++;for(const l of f.runningLayouts())if(f=l.GetEventSheet()){this._runtime.PushCurrentLayout(l);for(const m of f.deepIncludes()){const n=yield*m._DebugTrigger(d,e,g);h=h||n}f=yield*f._DebugTrigger(d,e,g);h=h||f;this._runtime.PopCurrentLayout()}this._executingTriggerDepth--;
return h}QueueTrigger(f,d,e){this._queuedTriggers.push([f,d,e]);return!1}QueueDebugTrigger(f,d,e){let g=null;const h=new Promise(l=&gt;g=l);this._queuedDebugTriggers.push([f,d,e,g]);return h}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw Error("should not be in breakpoint");const f=this._runtime.GetLayoutManager();for(;this._queuedDebugTriggers.length;){const [d,e,g,h]=this._queuedDebugTriggers.shift(),l=yield*this._DebugTrigger(f,d,e,g);h(l)}}async RunQueuedDebugTriggersAsync(){for(const f of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(f)}_FastTrigger(f,
d,e,g){let h=!1;var l=f.GetMainRunningLayout();if(f=l.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(l);l=f.deepIncludes();for(let m=0,n=l.length;m&lt;n;++m){const r=l[m]._FastTrigger(d,e,g);h=h||r}d=f._FastTrigger(d,e,g);h=h||d;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return h}}*_DebugFastTrigger(f,d,e,g){let h=!1;var l=f.GetMainRunningLayout();if(f=l.GetEventSheet()){this._executingTriggerDepth++;this._runtime.PushCurrentLayout(l);l=f.deepIncludes();
for(let m=0,n=l.length;m&lt;n;++m){const r=yield*l[m]._DebugFastTrigger(d,e,g);h=h||r}d=yield*f._DebugFastTrigger(d,e,g);h=h||d;this._runtime.PopCurrentLayout();this._executingTriggerDepth--;return h}}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(f){for(const [d,e,g]of this._queuedTriggers)this._Trigger(f,d,e,g);c.clearArray(this._queuedTriggers)}BlockFlushingInstances(f){f?this._blockFlushingDepth++:this._blockFlushingDepth--}IsFlushingBlocked(){return 0&lt;this._blockFlushingDepth}ClearSol(f){for(let d=0,e=f.length;d&lt;e;++d)f[d].GetSolStack().Clear()}PushCleanSol(f){for(let d=0,e=f.length;d&lt;e;++d)f[d].GetSolStack().PushClean()}PushCopySol(f){for(let d=0,e=f.length;d&lt;e;++d)f[d].GetSolStack().PushCopy()}PopSol(f){for(let d=
0,e=f.length;d&lt;e;++d)f[d].GetSolStack().Pop()}AddScheduledWait(){const f=c.New(c.ScheduledWait,this);this._scheduledWaits.push(f);return f}scheduledWaits(){return this._scheduledWaits}RunScheduledWaits(){if(this._scheduledWaits.length){var f=this.GetCurrentEventStackFrame(),d=!1;this._runningEventsDepth++;for(let e=0,g=this._scheduledWaits.length;e&lt;g;++e){const h=this._scheduledWaits[e];h._ShouldRun()&amp;&amp;h._Run(f);h.ShouldRelease()&amp;&amp;(d=!0)}d&amp;&amp;this._FilterScheduledWaitsToRelease();this._runningEventsDepth--}}async DebugRunScheduledWaits(){if(this._scheduledWaits.length){var f=
this.GetCurrentEventStackFrame(),d=!1;this._runningEventsDepth++;for(let e=0,g=this._scheduledWaits.length;e&lt;g;++e){const h=this._scheduledWaits[e];h._ShouldRun()&amp;&amp;await h._DebugRun(f);h.ShouldRelease()&amp;&amp;(d=!0)}d&amp;&amp;this._FilterScheduledWaitsToRelease();this._runningEventsDepth--}}_FilterScheduledWaitsToRelease(){const f=c.arrayFilterOut(this._scheduledWaits,d=&gt;d.ShouldRelease());for(const d of f)d.Release()}ClearAllScheduledWaits(){for(const f of this._scheduledWaits)f.Release();c.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(f){for(const d of this._scheduledWaits)d.RemoveInstances(f)}AddAsyncActionPromise(f){this._asyncActionPromises.push(f)}ClearAsyncActionPromises(){c.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const f=
Promise.all(this._asyncActionPromises);this._asyncActionPromises=[];return f}_SaveToJson(){return{groups:this._SaveGroupsToJson(),cnds:this._SaveCndsToJson(),acts:this._SaveActsToJson(),vars:this._SaveVarsToJson(),waits:this._SaveScheduledWaitsToJson()}}_LoadFromJson(f){this._LoadGroupsFromJson(f.groups);this._LoadCndsFromJson(f.cnds);this._LoadActsFromJson(f.acts);this._LoadVarsFromJson(f.vars);this._LoadScheduledWaitsFromJson(f.waits)}_SaveGroupsToJson(){const f={};for(const d of this.GetAllGroups())f[d.GetSID().toString()]=
d.IsGroupActive();return f}_LoadGroupsFromJson(f){for(const [d,e]of Object.entries(f))f=parseInt(d,10),(f=this.GetEventGroupBySID(f))&amp;&amp;f.SetGroupActive(e)}_SaveCndsToJson(){const f={};for(const [d,e]of this._cndsBySid){const g=e._SaveToJson();g&amp;&amp;(f[d.toString()]=g)}return f}_LoadCndsFromJson(f){const d=new Map;for(const [e,g]of Object.entries(f))d.set(parseInt(e,10),g);for(const [e,g]of this._cndsBySid)g._LoadFromJson(d.get(e)||null)}_SaveActsToJson(){const f={};for(const [d,e]of this._actsBySid){const g=
e._SaveToJson();g&amp;&amp;(f[d.toString()]=g)}return f}_LoadActsFromJson(f){const d=new Map;for(const [e,g]of Object.entries(f))d.set(parseInt(e,10),g);for(const [e,g]of this._actsBySid)g._LoadFromJson(d.get(e)||null)}_SaveVarsToJson(){const f={};for(const [d,e]of this._eventVarsBySid)e.IsConstant()||!e.IsGlobal()&amp;&amp;!e.IsStatic()||(f[d.toString()]=e.GetValue());return f}_LoadVarsFromJson(f){for(const [d,e]of Object.entries(f))f=parseInt(d,10),(f=this.GetEventVariableBySID(f))&amp;&amp;f.SetValue(e)}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(f=&gt;
!f.IsPromise()).map(f=&gt;f._SaveToJson())}_LoadScheduledWaitsFromJson(f){this.ClearAllScheduledWaits();for(const d of f)(f=c.ScheduledWait._CreateFromJson(this,d))&amp;&amp;this._scheduledWaits.push(f)}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(f=&gt;f.GetEventSheet()).filter(f=&gt;f).map(f=&gt;f._GetPerfRecord())}FindFirstFunctionBlockParent(f){for(;f;){const d=f.GetScopeParent();if(d instanceof c.FunctionBlock)return d;f=f.GetParent()}return null}_InvokeFunctionFromJS(f,d){Array.isArray(d)||
(d=[]);f=this.GetFunctionBlockByName(f.toLowerCase());if(!f)return null;if(!f.IsEnabled())return f.GetDefaultReturnValue();var e=f.GetFunctionParameters();if(d.length&lt;e.length){d=d.slice(0);do d.push(e[d.length].GetInitialValue());while(d.length&lt;e.length)}e=f.GetEventBlock();return e.RunAsExpressionFunctionCall(e.GetSolModifiersIncludingParents(),f.GetReturnType(),f.GetDefaultReturnValue(),...d)}}}"use strict";
{const c=self.C3;c.EventSheet=class extends c.DefendedBase{constructor(b,a){super();this._eventSheetManager=b;this._runtime=b.GetRuntime();this._name=a[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 f of a[1])this._CreateEvent(f,null,this._events);this._perfRecord=this._runtime.IsDebug()?{type:"sheet",name:this._name,totalTimeCounter:0,
children:[]}:null}Release(){this._runtime=this._eventSheetManager=null}_CreateEvent(b,a,f){switch(b[0]){case 0:case 3:this._CreateEventBlock(b,a,f);break;case 1:this._CreateEventVariable(b,a,f);break;case 2:this._CreateInclude(b,a,f);break;case 4:this._CreateFunctionBlock(b,a);break;case 5:this._CreateScriptBlock(b,a,f);break;default:throw Error("invalid event type");}}_CreateEventBlock(b,a,f){b=c.EventBlock.Create(this,a,b);if(b.IsOrBlock()){f.push(b);f=b.GetConditions();for(let d=0,e=f.length;d&lt;
e;++d)f[d].IsTrigger()&amp;&amp;this._InitTrigger(b,d)}else b.IsTrigger()?this._InitTrigger(b,0):f.push(b)}_CreateFunctionBlock(b,a){b=c.FunctionBlock.Create(this,a,b);this._eventSheetManager._RegisterFunctionBlock(b)}_CreateEventVariable(b,a,f){b=c.EventVariable.Create(this,a,b);f.push(b)}_CreateInclude(b,a,f){b=c.EventInclude.Create(this,a,b);f.push(b)}_CreateScriptBlock(b,a,f){b=c.EventScript.Create(this,a,b);f.push(b)}_InitTrigger(b,a){b.IsOrBlock()||this._eventSheetManager._AddTriggerToPostInit(b);var f=
b.GetConditionAt(a),d=f._GetFunc(),e=f.GetObjectClass();if(f.IsFastTrigger()){var g=this._fastTriggers.get(e);g||(g=new Map,this._fastTriggers.set(e,g));f=f.GetFastTriggerValue().toLowerCase();e=g.get(d);e||(e=new Map,g.set(d,e));d=e.get(f);d||(d=[],e.set(f,d));d.push([b,a])}else g=this._triggers.get(e),g||(g={methodMap:new Map,behaviors:new Map},this._triggers.set(e,g)),(e=f.GetBehaviorType())?(f=g.behaviors.get(e),f||(f=new Map,g.behaviors.set(e,f))):f=g.methodMap,g=f.get(d),g||(g=[],f.set(d,g)),
g.push([b,a])}_PostInit(){const b=this._events;for(let a=0,f=b.length;a&lt;f;++a){const d=a&lt;f-1&amp;&amp;b[a+1]instanceof c.EventBlock&amp;&amp;b[a+1].IsElseBlock();b[a]._PostInit(d)}}_AddShallowInclude(b){this._shallowIncludes.push(b)}_UpdateDeepIncludes(){c.clearArray(this._deepIncludes);this._AddDeepIncludes(this);this._alreadyIncludedSheets.clear()}_AddDeepIncludes(b){const a=b._deepIncludes,f=b._alreadyIncludedSheets;for(const d of this._shallowIncludes){const e=d.GetIncludeSheet();d.IsActive()&amp;&amp;b!==e&amp;&amp;!f.has(e)&amp;&amp;
(f.add(e),e._AddDeepIncludes(b),a.push(e))}}deepIncludes(){return this._deepIncludes}GetEventSheetManager(){return this._eventSheetManager}GetRuntime(){return this._runtime}GetName(){return this._name}_RegisterEventByDisplayNumber(b,a){this._eventsByDisplayNumber.set(a,b)}_GetEventByDisplayNumber(b){return this._eventsByDisplayNumber.get(b)||null}_ResetHasRunFlag(){this._hasRun=!1}Run(){if(!this._hasRun){var b=this._runtime,a=b.IsCPUProfiling(),f=a?performance.now():0;this._hasRun=!0;var d=this.GetEventSheetManager(),
e=d.GetCurrentEventStackFrame();for(const g of this._events)g.Run(e),d.ClearSol(g.GetSolModifiers()),d.ClearAsyncActionPromises(),b.FlushPendingInstances();e.Reset(null);a&amp;&amp;(this._perfRecord.totalTimeCounter+=performance.now()-f)}}*DebugRun(){if(!this._hasRun){this._hasRun=!0;var b=this._runtime,a=this.GetEventSheetManager(),f=a.GetCurrentEventStackFrame();for(const d of this._events)yield*d.DebugRun(f),a.ClearSol(d.GetSolModifiers()),a.ClearAsyncActionPromises(),b.FlushPendingInstances();f.Reset(null)}}_Trigger(b,
a,f){if(a){const d=a.GetObjectClass();this._TriggerForClass(b,a,d,f);for(const e of d.GetFamilies())this._TriggerForClass(b,a,e,f)}else return this._TriggerForClass(b,a,null,null)}_TriggerForClass(b,a,f,d){f=this._triggers.get(f);if(!f)return!1;d=d?f.behaviors.get(d):f.methodMap;if(!d)return!1;d=d.get(b);if(!d)return!1;b=!1;for(const [e,g]of d)d=this._ExecuteTrigger(a,e,g),b=b||d;return b}*_DebugTrigger(b,a,f){if(a){const d=a.GetObjectClass();yield*this._DebugTriggerForClass(b,a,d,f);for(const e of d.GetFamilies())yield*this._DebugTriggerForClass(b,
a,e,f)}else return yield*this._DebugTriggerForClass(b,a,null,null)}*_DebugTriggerForClass(b,a,f,d){f=this._triggers.get(f);if(!f)return!1;d=d?f.behaviors.get(d):f.methodMap;if(!d)return!1;d=d.get(b);if(!d)return!1;b=!1;for(const [e,g]of d)d=e.DebugCanRunFast()?this._ExecuteTrigger(a,e,g):yield*this._DebugExecuteTrigger(a,e,g),b=b||d;return b}_FastTrigger(b,a,f){a=a.GetObjectClass();a=this._fastTriggers.get(a);if(!a)return!1;b=a.get(b);if(!b)return!1;f=b.get(f);if(!f)return!1;b=!1;for(let d=0,e=f.length;d&lt;
e;++d)a=f[d],a=this._ExecuteTrigger(null,a[0],a[1]),b=b||a;return b}*_DebugFastTrigger(b,a,f){a=a.GetObjectClass();a=this._fastTriggers.get(a);if(!a)return!1;b=a.get(b);if(!b)return!1;f=b.get(f);if(!f)return!1;b=!1;for(let e=0,g=f.length;e&lt;g;++e){var d=f[e];a=d[0];d=d[1];a=a.DebugCanRunFast()?this._ExecuteTrigger(null,a,d):yield*this._DebugExecuteTrigger(null,a,d);b=b||a}return b}_ExecuteTrigger(b,a,f){const d=this._runtime,e=this._eventSheetManager,g=e.GetCurrentEvent(),h=e.GetEventStack(),l=e.GetTriggerDepth();
let m=!1;g&amp;&amp;e.PushCleanSol(g.GetSolModifiersIncludingParents());e.PushCleanSol(a.GetSolModifiersIncludingParents());const n=1&lt;l;n&amp;&amp;e.GetLocalVarStack().Push();const r=h.Push(a);b&amp;&amp;(a.GetConditions()[f].GetObjectClass().GetCurrentSol().SetSinglePicked(b),b.IsInContainer()&amp;&amp;b.SetSiblingsSinglePicked());b=!0;if(a.GetParent()){const q=a.GetTriggerParents();for(let t=0,u=q.length;t&lt;u;++t)if(!q[t].RunPreTrigger(r)){b=!1;break}}b&amp;&amp;(d.IncrementExecCount(),a.IsOrBlock()?a.RunOrBlockTrigger(r,f):a.Run(r),m=
r.GetLastEventTrue());h.Pop();n&amp;&amp;e.GetLocalVarStack().Pop();e.PopSol(a.GetSolModifiersIncludingParents());g&amp;&amp;e.PopSol(g.GetSolModifiersIncludingParents());g||1!==l||e.IsFlushingBlocked()||d.FlushPendingInstances();return m}*_DebugExecuteTrigger(b,a,f){const d=this._runtime,e=this._eventSheetManager,g=e.GetCurrentEvent(),h=e.GetEventStack(),l=e.GetTriggerDepth();let m=!1;g&amp;&amp;e.PushCleanSol(g.GetSolModifiersIncludingParents());e.PushCleanSol(a.GetSolModifiersIncludingParents());const n=1&lt;l;n&amp;&amp;e.GetLocalVarStack().Push();
const r=h.Push(a);b&amp;&amp;(a.GetConditions()[f].GetObjectClass().GetCurrentSol().SetSinglePicked(b),b.IsInContainer()&amp;&amp;b.SetSiblingsSinglePicked());b=!0;if(a.GetParent()){const q=a.GetTriggerParents();for(let t=0,u=q.length;t&lt;u;++t)if(!(yield*q[t].DebugRunPreTrigger(r))){b=!1;break}}b&amp;&amp;(d.IncrementExecCount(),a.IsOrBlock()?yield*a.DebugRunOrBlockTrigger(r,f):yield*a.DebugRun(r),m=r.GetLastEventTrue());h.Pop();n&amp;&amp;e.GetLocalVarStack().Pop();e.PopSol(a.GetSolModifiersIncludingParents());g&amp;&amp;e.PopSol(g.GetSolModifiersIncludingParents());
g||1!==l||e.IsFlushingBlocked()||d.FlushPendingInstances();return m}_GetPerfRecord(){return this._perfRecord}}}"use strict";
{const c=self.C3,b=[];function a(d,e){return!0}function*f(d,e){return!0}c.EventBlock=class extends c.DefendedBase{constructor(d,e,g){super();this._eventSheet=d;this._runtime=d.GetRuntime();this._parent=e;this._scopeParent=null;this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._solModifiers=[];this._solModifiersIncludingParents=[];this._hasElseBlock=this._isTopLevelGroup=this._isSolWriterAfterCnds=this._hasGotSolModifiersIncludingParents=!1;this._isOrBlock=!!g[2];this._isElseBlock=
!1;this._triggerParents=null;this._conditions=[];this._actions=[];this._subEvents=[];this._RunActions=a;this._DebugRunActions=f;this._isInitiallyActive=this._isGroup=!1;this._groupName="";this._isGroupActive=!1;this._perfRecord=this._containedIncludes=null;this._sid=g[4];this._displayNumber=g[5];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=this._runtime.IsDebug()?{isBreakpoint:g[3][0],isBreakable:g[3][1],canRunAllConditionsFast:!1,canRunAllActionsFast:!1,
canRunAllSubEventsFast:!1,canRunSelfFast:!1}:null;this.GetEventSheetManager()._RegisterEventBlock(this);3===g[0]&amp;&amp;this._InitGroup(g[1]);d=0;for(var h of g[6])e=c.Condition.Create(this,h,d++),this._conditions.push(e),this._AddSolModifier(e.GetObjectClass());d=0;for(const l of g[7])h=c.Action.Create(this,l,d++),this._actions.push(h);if(9===g.length){g=g[8];for(const l of g)this._eventSheet._CreateEvent(l,this,this._subEvents)}this._conditions.length&amp;&amp;(this._isElseBlock=null===this._conditions[0].GetObjectClass()&amp;&amp;
this._conditions[0]._GetFunc()===c.Plugins.System.Cnds.Else);0===this._conditions.length&amp;&amp;(this._conditions=b);0===this._actions.length&amp;&amp;(this._actions=b);0===this._subEvents.length&amp;&amp;(this._subEvents=b)}static Create(d,e,g){return c.New(c.EventBlock,d,e,g)}_InitGroup(d){this._isGroup=!0;this._isGroupActive=this._isInitiallyActive=!!d[0];this._groupName=d[1].toLowerCase();this._containedIncludes=[];this.GetEventSheetManager()._RegisterGroup(this);this._runtime.IsDebug()&amp;&amp;(this._perfRecord={type:"group",
name:d[1],totalTimeCounter:0,children:[]})}_AddContainedInclude(d){this._containedIncludes.push(d)}_AddContainerSolModifierToList(d,e){for(const g of d.GetContainer().objectTypes())e.includes(g)||e.push(g)}_AddSolModifierToList(d,e){if(d)if(e.includes(d)||e.push(d),d.IsFamily())for(const g of d.GetFamilyMembers())g.IsInContainer()&amp;&amp;this._AddContainerSolModifierToList(g,e);else d.IsInContainer()&amp;&amp;this._AddContainerSolModifierToList(d,e)}_AddSolModifier(d){this._AddSolModifierToList(d,this._solModifiers)}_AddParentSolModifier(d){this._AddSolModifierToList(d,
this._solModifiersIncludingParents)}SetAllSolModifiers(){this._solModifiers=this._runtime.GetAllObjectClasses()}_PostInit(d){this._hasElseBlock=!!d;this._IdentifyTopLevelGroup();this._IdentifyTriggerParents();for(const g of this._conditions)g._PostInit();if(0&lt;this._actions.length){d=!1;for(var e of this._actions)e._PostInit(),e.HasReturnType()&amp;&amp;(d=!0);d?(this._RunActions=this._RunActions_ReturnValue,this._DebugRunActions=this._DebugRunActions_ReturnValue):(this._RunActions=this._RunActions_Fast,this._DebugRunActions=
this._DebugRunActions_Fast)}e=this._subEvents;for(let g=0,h=e.length;g&lt;h;++g)d=g&lt;h-1&amp;&amp;e[g+1]instanceof c.EventBlock&amp;&amp;e[g+1].IsElseBlock(),e[g]._PostInit(d);this._debugData&amp;&amp;this._UpdateCanRunFast();this._perfRecord&amp;&amp;this._GetPerfRecordParent()._GetPerfRecord().children.push(this._perfRecord)}_GetPerfRecord(){return this._perfRecord}_GetPerfRecordParent(){let d=this.GetParent();for(;d;){if(d.IsGroup())return d;d=d.GetParent()}return this._eventSheet}_UpdateCanRunFast(){const d=this._debugData;d.canRunAllConditionsFast=
this._conditions.every(e=&gt;e.DebugCanRunFast());d.canRunAllActionsFast=this._actions.every(e=&gt;e.DebugCanRunFast());d.canRunAllSubEventsFast=this._subEvents.every(e=&gt;e.DebugCanRunFast());d.canRunSelfFast=d.canRunAllConditionsFast&amp;&amp;d.canRunAllActionsFast&amp;&amp;d.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let d=this;do d._UpdateCanRunFast(),d=d.GetParent();while(d)}_IdentifyTopLevelGroup(){if(this.IsGroup()){var d=this.GetParent();for(this._isTopLevelGroup=!0;d;){if(!d.IsGroup()){this._isTopLevelGroup=
!1;break}d=d.GetParent()}}}_IdentifySolModifiersIncludingParents(){var d=this._runtime.GetAllObjectClasses();if(this._solModifiers===d)this._solModifiersIncludingParents=d;else{this._solModifiersIncludingParents=c.cloneArray(this._solModifiers);for(d=this.GetParent();d;){for(var e of d._solModifiers)this._AddParentSolModifier(e);d=d.GetParent()}e=this.GetEventSheetManager();this._solModifiers=e._DeduplicateSolModifierList(this._solModifiers);this._solModifiersIncludingParents=e._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(this.HasAnyTriggeredCondition()){this._triggerParents=
[];for(var d=this.GetParent();d;)this._triggerParents.push(d),d=d.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(d){return this._solModifiers.includes(d)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(d){this._scopeParent=
d}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(d){this._debugData.isBreakpoint=!!d;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(d){d=
!!d;if(!this._isGroup)throw Error("not a group");if(this._isGroupActive!==d){this._isGroupActive=d;for(const e of this._containedIncludes)e.UpdateActive();this._containedIncludes.length&amp;&amp;(d=this._runtime.GetCurrentLayout().GetEventSheet())&amp;&amp;d._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 c.FunctionBlock}HasAnyTriggeredCondition(){return this.IsForFunctionBlock()||
this._conditions.some(d=&gt;d.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(d){d=Math.floor(d);if(0&gt;d||d&gt;=this._conditions.length)throw new RangeError("invalid condition index");return this._conditions[d]}GetConditionByDebugIndex(d){return this.GetConditionAt(d)}IsFirstConditionOfType(d){let e=d.GetIndex();if(0===e)return!0;for(--e;0&lt;=e;--e)if(this._conditions[e].GetObjectClass()===d.GetObjectClass())return!1;return!0}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(d){d=
Math.floor(d);if(0&gt;d||d&gt;=this._actions.length)throw new RangeError("invalid action index");return this._actions[d]}GetActionByDebugIndex(d){d=Math.floor(d);const e=this._actions.find(g=&gt;g.GetDebugIndex()===d);if(!e)throw new RangeError("invalid action debug index");return e}_HasActionIndex(d){d=Math.floor(d);return 0&lt;=d&amp;&amp;d&lt;this._actions.length}GetSubEvents(){return this._subEvents}_GetAllLocalVariablesInScope(){return this._subEvents.filter(d=&gt;d instanceof c.EventVariable)}RunPreTrigger(d){d.SetCurrentEvent(this);
let e=!1;const g=this._conditions;for(let h=0,l=g.length;h&lt;l;++h){const m=g[h];d.SetConditionIndex(h);if(m.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(m.Run())e=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?e:!0}RunOrBlockTrigger(d,e){d.SetCurrentEvent(this);this._conditions[e].Run()&amp;&amp;(this._RunActions(d,0)&amp;&amp;this._RunSubEvents(d),d.SetLastEventTrue(!0))}*DebugRunPreTrigger(d){d.SetCurrentEvent(this);let e=!1;const g=this._conditions;for(let h=0,l=g.length;h&lt;
l;++h){const m=g[h];d.SetConditionIndex(h);if(m.IsLooping())throw Error("trigger cannot be used as sub-event to a loop");if(m.DebugCanRunFast()?m.Run():yield*m.DebugRun())e=!0;else if(!this._isOrBlock)return!1}return this._isOrBlock?e:!0}*DebugRunOrBlockTrigger(d,e){d.SetCurrentEvent(this);e=this._conditions[e];if(e.DebugCanRunFast()?e.Run():yield*e.DebugRun())(this.DebugCanRunActionsFast()?this._RunActions(d,0):yield*this._DebugRunActions(d,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?this._RunSubEvents():
yield*this._DebugRunSubEvents()),d.SetLastEventTrue(!0)}Run(d){d.SetCurrentEvent(this);this._isElseBlock||d.SetElseBranchRan(!1);this._isOrBlock?this._RunOrBlock(d):this._RunAndBlock(d)}*DebugRun(d){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;d.SetCurrentEvent(this);this._isElseBlock||d.SetElseBranchRan(!1);this._isOrBlock?yield*this._DebugRunOrBlock(d):yield*this._DebugRunAndBlock(d)}_RunOrBlock(d){const e=this._conditions;let g=0===e.length;for(let l=0,m=e.length;l&lt;m;++l){var h=
e[l];h.IsTrigger()||(d.SetConditionIndex(l),h=h.Run(),g=g||h)}d.SetLastEventTrue(g);g&amp;&amp;(this._RunActions(d,0)&amp;&amp;this._RunSubEvents(d),this._hasElseBlock&amp;&amp;d.SetElseBranchRan(!0))}*_DebugRunOrBlock(d){const e=this._conditions;let g=0===e.length;for(let l=0,m=e.length;l&lt;m;++l){var h=e[l];h.IsTrigger()||(d.SetConditionIndex(l),h=h.DebugCanRunFast()?h.Run():yield*h.DebugRun(),g=g||h)}d.SetLastEventTrue(g);g&amp;&amp;((this.DebugCanRunActionsFast()?this._RunActions(d,0):yield*this._DebugRunActions(d,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?
this._RunSubEvents():yield*this._DebugRunSubEvents()),this._hasElseBlock&amp;&amp;d.SetElseBranchRan(!0))}_RunAndBlock(d){const e=this._conditions;for(let g=0,h=e.length;g&lt;h;++g){const l=e[g];d.SetConditionIndex(g);if(!l.Run()){d.SetLastEventTrue(!1);return}}d.SetLastEventTrue(!0);this._RunActions(d,0)&amp;&amp;this._RunSubEvents(d);d.GetLastEventTrue()&amp;&amp;this._hasElseBlock&amp;&amp;d.SetElseBranchRan(!0)}*_DebugRunAndBlock(d){const e=this._conditions;for(let g=0,h=e.length;g&lt;h;++g){const l=e[g];d.SetConditionIndex(g);if(l.DebugCanRunFast()?
!l.Run():!(yield*l.DebugRun())){d.SetLastEventTrue(!1);return}}d.SetLastEventTrue(!0);(this.DebugCanRunActionsFast()?this._RunActions(d,0):yield*this._DebugRunActions(d,0))&amp;&amp;(this.DebugCanRunSubEventsFast()?this._RunSubEvents():yield*this._DebugRunSubEvents());d.GetLastEventTrue()&amp;&amp;this._hasElseBlock&amp;&amp;d.SetElseBranchRan(!0)}_RunActions_Fast(d,e){const g=this._actions;for(let h=e,l=g.length;h&lt;l;++h)e=g[h],d.SetActionIndex(h),e.Run();return!0}*_DebugRunActions_Fast(d,e){const g=this._actions;for(let h=
e,l=g.length;h&lt;l;++h)e=g[h],d.SetActionIndex(h),e.DebugCanRunFast()?e.Run():yield*e.DebugRun();return!0}_RunActions_ReturnValue(d,e){const g=this.GetEventSheetManager(),h=this._actions;for(let l=e,m=h.length;l&lt;m;++l){e=h[l];d.SetActionIndex(l);const n=e.Run();if(e.CanBailOut()&amp;&amp;!0===n)return!1;e.IsAsync()&amp;&amp;n instanceof Promise&amp;&amp;g.AddAsyncActionPromise(n)}return!0}*_DebugRunActions_ReturnValue(d,e){const g=this.GetEventSheetManager(),h=this._actions;for(let l=e,m=h.length;l&lt;m;++l){e=h[l];d.SetActionIndex(l);
let n;n=e.DebugCanRunFast()?e.Run():yield*e.DebugRun();if(e.CanBailOut()&amp;&amp;!0===n)return!1;e.IsAsync()&amp;&amp;n instanceof Promise&amp;&amp;g.AddAsyncActionPromise(n)}return!0}_ResumeActionsAndSubEvents(d){this._RunActions(d,d.GetActionIndex())&amp;&amp;this._RunSubEvents()}*_DebugResumeActionsAndSubEvents(d){if(yield*this._DebugRunActions(d,d.GetActionIndex()))yield*this._DebugRunSubEvents()}_RunSubEvents(){if(this._subEvents.length){var d=this.IsGroup()&amp;&amp;this._runtime.IsCPUProfiling(),e=d?performance.now():0,g=this._eventStack,
h=g.Push(this);this._isSolWriterAfterCnds?this._RunSubEvents_SolWriterAfterCnds(h):this._RunSubEvents_Fast(h);g.Pop();d&amp;&amp;(this._perfRecord.totalTimeCounter+=performance.now()-e)}}_RunSubEvents_SolWriterAfterCnds(d){const e=this._isGroup,g=this._isTopLevelGroup,h=this.GetEventSheetManager(),l=this._subEvents;for(let m=0,n=l.length,r=n-1;m&lt;n;++m){const q=l[m],t=q.GetSolModifiers(),u=!g||!e&amp;&amp;m&lt;r;u&amp;&amp;h.PushCopySol(t);q.Run(d);u?h.PopSol(t):h.ClearSol(t)}}_RunSubEvents_Fast(d){const e=this._subEvents;for(let g=
0,h=e.length;g&lt;h;++g)e[g].Run(d)}*_DebugRunSubEvents(){if(this._subEvents.length){var d=this._eventStack,e=d.Push(this);this._isSolWriterAfterCnds?yield*this._DebugRunSubEvents_SolWriterAfterCnds(e):yield*this._DebugRunSubEvents_Fast(e);d.Pop()}}*_DebugRunSubEvents_SolWriterAfterCnds(d){const e=this._isGroup,g=this._isTopLevelGroup,h=this.GetEventSheetManager(),l=this._subEvents;for(let m=0,n=l.length,r=n-1;m&lt;n;++m){const q=l[m],t=q.GetSolModifiers(),u=!g||!e&amp;&amp;m&lt;r;u&amp;&amp;h.PushCopySol(t);yield*q.DebugRun(d);
u?h.PopSol(t):h.ClearSol(t)}}*_DebugRunSubEvents_Fast(d){const e=this._subEvents;for(let g=0,h=e.length;g&lt;h;++g)yield*e[g].DebugRun(d)}Retrigger(d,e){this._runtime.IncrementExecCount();e.ResetQuick();const g=this._conditions;if(!this.IsOrBlock())for(let h=d.GetConditionIndex()+1,l=g.length;h&lt;l;++h)if(d=g[h],e.SetConditionIndex(h),!d.Run())return!1;this._RunActions(e,0)&amp;&amp;this._RunSubEvents(e);return!0}*DebugRetrigger(d,e){this._runtime.IncrementExecCount();e.ResetQuick();const g=this._conditions;if(!this.IsOrBlock())for(let h=
d.GetConditionIndex()+1,l=g.length;h&lt;l;++h)if(d=g[h],e.SetConditionIndex(h),d.DebugCanRunFast()?!d.Run():!(yield*d.DebugRun()))return!1;(this.DebugCanRunActionsFast()?this._RunActions(e,0):yield*this._DebugRunActions(e,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(d){if(this.GetParent()){const e=this.GetTriggerParents();for(let g=0,h=e.length;g&lt;h;++g)if(!e[g].RunPreTrigger(d))return!1}return!0}*_DebugCheckParentsOKToRun(d){if(this.GetParent()){const e=this.GetTriggerParents();for(let g=0,h=e.length;g&lt;h;++g)if(!(yield*e[g].DebugRunPreTrigger(d)))return!1}return!0}_EvaluateFunctionCallParameters(d,e,g){0&lt;e.length?g?(e=e.map(h=&gt;h.Get(0)),d.GetLocalVarStack().Push(),this._scopeParent.SetFunctionParameters(e)):
this._scopeParent.EvaluateFunctionParameters(e):g&amp;&amp;d.GetLocalVarStack().Push()}RunAsFunctionCall(d,e){let g,h;const l=0&lt;d.length;var m=this._runtime;const n=this._eventStack,r=m.GetEventSheetManager(),q=1&lt;r._IncTriggerDepth();this._EvaluateFunctionCallParameters(r,e,q);l&amp;&amp;r.PushCleanSol(d);e=n.Push(this);this._CheckParentsOKToRun(e)&amp;&amp;(m.IncrementExecCount(),e.SetCurrentEvent(this),(m=this._scopeParent.IsAsync())&amp;&amp;([h,g]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(e),m&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(h));
n.Pop();q&amp;&amp;r.GetLocalVarStack().Pop();l&amp;&amp;r.PopSol(d);r._DecTriggerDepth();return g}*DebugRunAsFunctionCall(d,e){let g,h;if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const l=0&lt;d.length;var m=this._runtime;const n=this._eventStack,r=m.GetEventSheetManager(),q=1&lt;r._IncTriggerDepth();this._EvaluateFunctionCallParameters(r,e,q);l&amp;&amp;r.PushCleanSol(d);e=n.Push(this);if(yield*this._DebugCheckParentsOKToRun(e))m.IncrementExecCount(),e.SetCurrentEvent(this),(m=this._scopeParent.IsAsync())&amp;&amp;
([h,g]=this._scopeParent.StartAsyncFunctionCall()),yield*this._DebugRunAndBlock(e),m&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(h);n.Pop();q&amp;&amp;r.GetLocalVarStack().Pop();l&amp;&amp;r.PopSol(d);r._DecTriggerDepth();return g}RunAsMappedFunctionCall(d){const e=this.GetSolModifiersIncludingParents(),g=0&lt;e.length,h=this._runtime,l=this._eventStack,m=h.GetEventSheetManager(),n=1&lt;m._IncTriggerDepth();n&amp;&amp;m.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(d);g&amp;&amp;m.PushCleanSol(e);d=l.Push(this);
this._CheckParentsOKToRun(d)&amp;&amp;(h.IncrementExecCount(),d.SetCurrentEvent(this),this._RunAndBlock(d));l.Pop();n&amp;&amp;m.GetLocalVarStack().Pop();g&amp;&amp;m.PopSol(e);m._DecTriggerDepth()}*DebugRunAsMappedFunctionCall(d){if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;const e=this.GetSolModifiersIncludingParents(),g=0&lt;e.length,h=this._runtime,l=this._eventStack,m=h.GetEventSheetManager(),n=1&lt;m._IncTriggerDepth();n&amp;&amp;m.GetLocalVarStack().Push();this._scopeParent.SetFunctionParameters(d);g&amp;&amp;
m.PushCleanSol(e);d=l.Push(this);if(yield*this._DebugCheckParentsOKToRun(d))h.IncrementExecCount(),d.SetCurrentEvent(this),yield*this._DebugRunAndBlock(d);l.Pop();n&amp;&amp;m.GetLocalVarStack().Pop();g&amp;&amp;m.PopSol(e);m._DecTriggerDepth()}RunAsExpressionFunctionCall(d,e,g,...h){let l,m;const n=0&lt;d.length,r=this._runtime,q=this._eventStack,t=r.GetEventSheetManager(),u=1&lt;t._IncTriggerDepth();u&amp;&amp;t.GetLocalVarStack().Push();0&lt;h.length&amp;&amp;this._scopeParent.SetFunctionParameters(h);n&amp;&amp;t.PushCleanSol(d);h=q.Push(this);
h.InitCallFunctionExpression(e,g);q.PushExpFunc(h);r.SetDebuggingEnabled(!1);this._CheckParentsOKToRun(h)&amp;&amp;(r.IncrementExecCount(),h.SetCurrentEvent(this),(e=this._scopeParent.IsAsync())&amp;&amp;([m,l]=this._scopeParent.StartAsyncFunctionCall()),this._RunAndBlock(h),e&amp;&amp;this._scopeParent.MaybeFinishAsyncFunctionCall(m));r.SetDebuggingEnabled(!0);q.Pop();q.PopExpFunc();u&amp;&amp;t.GetLocalVarStack().Pop();n&amp;&amp;t.PopSol(d);t._DecTriggerDepth();return l||h.GetFunctionReturnValue()}}}"use strict";
{const c=self.C3,b=[];let a=!1;c.EventScript=class extends c.DefendedBase{constructor(f,d,e){super();const g=f.GetRuntime(),h=f.GetEventSheetManager();this._eventSheet=f;this._eventSheetManager=h;this._runtime=f.GetRuntime();this._parent=d;this._func=g.GetObjectReference(e[1]);this._displayNumber=e[2];this._eventSheet._RegisterEventByDisplayNumber(this,this._displayNumber);this._debugData=g.IsDebug()?{isBreakpoint:e[3][0],isBreakable:e[3][1]}:null}static Create(f,d,e){return c.New(c.EventScript,f,
d,e)}_PostInit(){const f=this._func,d=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this);this._func=f.bind(null,this._runtime.GetIRuntime(),d)}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(f){this._debugData.isBreakpoint=
!!f}IsElseBlock(){return!1}GetSolModifiers(){return b}GetSolModifiersIncludingParents(){return this._parent?this._parent.GetSolModifiersIncludingParents():b}Run(f){f.SetCurrentEvent(this);this._eventSheetManager.AddAsyncActionPromise(this._RunUserScript())}async _RunUserScript(){try{await this._func()}catch(f){console.error(`Unhandled exception running script %c${this.GetEventSheet().GetName()}, event ${this.GetDisplayNumber()}:`,"font-size: 1.2em; font-weight: bold;",f),self.C3Debugger&amp;&amp;self.C3Debugger._SetLastErrorScript(this),
a||(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"),a=!0)}}*DebugRun(f){f.SetCurrentEvent(this);if(this.IsDebugBreakpoint()||this._runtime.DebugBreakNext())yield this;this.Run(f)}DebugCanRunFast(){return!this.IsDebugBreakpoint()&amp;&amp;!this._runtime.DebugBreakNext()}static HadUserScriptException(){return a}static SetHadUserScriptException(){a=!0}}}"use strict";
{const c=self.C3;c.FunctionBlock=class extends c.DefendedBase{constructor(b,a,f){super();this._eventSheet=b;this._runtime=b.GetRuntime();this._parent=a;const d=f[1];this._functionName=d[0];this._returnType=d[1];this._functionParameters=d[2].map(e=&gt;c.EventVariable.Create(b,this,e));this._isEnabled=d[3];this._isAsync=d[4];this._nextAsyncId=0;this._currentAsyncId=-1;this._asyncMap=new Map;this._eventBlock=c.EventBlock.Create(b,a,f);this._eventBlock._SetScopeParent(this)}static Create(b,a,f){return c.New(c.FunctionBlock,
b,a,f)}_PostInit(){for(const b of this._functionParameters)b._PostInit();this._eventBlock._PostInit(!1)}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}EvaluateFunctionParameters(b){const a=this._functionParameters;for(let f=0,d=a.length;f&lt;d;++f)a[f].SetValue(b[f].Get(0))}SetFunctionParameters(b){const a=this._functionParameters;for(let f=0,d=a.length;f&lt;d;++f)a[f].SetValue(b[f])}CaptureFunctionParameters(){return this._functionParameters.map(b=&gt;
b.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}IsAsync(){return this._isAsync}StartAsyncFunctionCall(){const b=this._nextAsyncId++;this._currentAsyncId=b;let a;const f=new Promise(d=&gt;a=d);this._asyncMap.set(b,
{resolve:a,pauseCount:0});return[b,f]}MaybeFinishAsyncFunctionCall(b){const a=this._asyncMap.get(b);0===a.pauseCount&amp;&amp;(a.resolve(),this._asyncMap.delete(b));this._currentAsyncId=-1}PauseCurrentAsyncFunction(){this._asyncMap.get(this._currentAsyncId).pauseCount++;return this._currentAsyncId}ResumeAsyncFunction(b){this._currentAsyncId=b;this._asyncMap.get(b).pauseCount--}}}"use strict";
{const c=self.C3,b=[];c.EventVariable=class extends c.DefendedBase{constructor(a,f,d){super();const e=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=e;this._runtime=a.GetRuntime();this._parent=f;this._localVarStack=e.GetLocalVarStack();this._name=d[1];this._type=d[2];this._initialValue=d[3];this._isStatic=!!d[4];this._isConstant=!!d[5];this._isFunctionParameter=f instanceof c.FunctionBlock;this._sid=d[6];this._jsPropName=this._runtime.GetJsPropName(d[8]);this._scriptSetter=g=&gt;
this.SetValue(g);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=e._GetNextLocalVarIndex(this));e._RegisterEventVariable(this)}static Create(a,f,d){return c.New(c.EventVariable,a,f,d)}_PostInit(){}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}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 b}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 c=self.C3,b=[];c.EventInclude=class extends c.DefendedBase{constructor(a,f,d){super();const e=a.GetEventSheetManager();this._eventSheet=a;this._eventSheetManager=e;this._runtime=a.GetRuntime();this._parent=f;this._includeSheet=null;this._includeSheetName=d[1];this._isActive=!0}static Create(a,f,d){return c.New(c.EventInclude,a,f,d)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName);this._eventSheet._AddShallowInclude(this);let a=this.GetParent();
for(;a;)a instanceof c.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 b}GetIncludeSheet(){return this._includeSheet}Run(a){a=!!this.GetParent();const f=this._runtime.GetAllObjectClasses();a&amp;&amp;this._eventSheetManager.PushCleanSol(f);this._includeSheet.Run();a&amp;&amp;this._eventSheetManager.PopSol(f)}*DebugRun(a){a=
!!this.GetParent();const f=this._runtime.GetAllObjectClasses();a&amp;&amp;this._eventSheetManager.PushCleanSol(f);yield*this._includeSheet.DebugRun();a&amp;&amp;this._eventSheetManager.PopSol(f)}DebugCanRunFast(){return!1}IsActive(){return this._isActive}UpdateActive(){let a=this.GetParent();for(;a;){if(a instanceof c.EventBlock&amp;&amp;a.IsGroup()&amp;&amp;!a.IsGroupActive()){this._isActive=!1;return}a=a.GetParent()}this._isActive=!0}}}"use strict";
{const c=self.C3;c.ExpNode=class extends c.DefendedBase{constructor(l){super();this._owner=l;this._runtime=l.GetRuntime()}_PostInit(){}static CreateNode(l,m){return c.New([g,d,e,h,b,a][m[0]],l,m)}};class b extends c.ExpNode{constructor(l,m){super(l);this._systemPlugin=this._runtime.GetSystemPlugin();this._func=this._runtime.GetObjectReference(m[1]);this._func!==c.Plugins.System.Exps.random&amp;&amp;this._func!==c.Plugins.System.Exps.choose||this._owner.SetVariesPerInstance()}GetBoundMethod(){return this._systemPlugin._GetBoundACEMethod(this._func,
this._systemPlugin)}}class a extends c.ExpNode{constructor(l,m){super(l);this._functionBlock=null;this._functionName=m[1];this._owner.SetVariesPerInstance()}_PostInit(){const l=this._runtime.GetEventSheetManager();this._functionBlock=l.GetFunctionBlockByName(this._functionName);this._functionName=null;const m=this._owner.GetEventBlock(),n=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...new Set([...m.GetSolModifiersIncludingParents(),...n.GetSolModifiersIncludingParents()])];this._combinedSolModifiers=
l._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const l=this._functionBlock;if(l.IsEnabled()){const m=l.GetEventBlock();return c.EventBlock.prototype.RunAsExpressionFunctionCall.bind(m,this._combinedSolModifiers,l.GetReturnType(),l.GetDefaultReturnValue())}{const m=l.GetDefaultReturnValue();return()=&gt;m}}}function f(l,m){if(l&gt;=m)return l%m;0&gt;l&amp;&amp;(l&lt;=-m&amp;&amp;(l%=m),0&gt;l&amp;&amp;(l+=m));return l}class d extends c.ExpNode{constructor(l,m){super(l);this._objectClass=this._runtime.GetObjectClassByIndex(m[1]);
this._func=this._runtime.GetObjectReference(m[2]);this._returnsString=!!m[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(...l){const m=this._objectClass,n=m.GetCurrentSol().GetExpressionInstances();var r=n.length;if(0===r)return this._returnsString?"":0;r=f(this._owner.GetSolIndex(),
r);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(m);return this._func.apply(n[r].GetSdkInstance(),l)}ExpObject_InstExpr(l,...m){const n=this._objectClass,r=n.GetInstances(),q=r.length;if(0===q)return this._returnsString?"":0;l=f(l,q);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n);return this._func.apply(r[l].GetSdkInstance(),m)}}class e extends c.ExpNode{constructor(l,m){super(l);this._objectClass=this._runtime.GetObjectClassByIndex(m[1]);this._varIndex=m[3];
this._returnsString=!!m[2];this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const l=this._objectClass.GetCurrentSol().GetExpressionInstances();var m=l.length;if(0===m)return this._returnsString?"":0;m=f(this._owner.GetSolIndex(),m);return l[m]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){var l=this._objectClass,m=l.GetCurrentSol().GetExpressionInstances(),n=m.length;if(0===n)return this._returnsString?"":0;n=f(this._owner.GetSolIndex(),n);m=m[n];l=m.GetObjectClass().GetFamilyInstanceVariableOffset(l.GetFamilyIndex());
return m._GetInstanceVariableValueUnchecked(this._varIndex+l)}ExpInstVar_InstExpr(l){const m=this._objectClass;var n=m.GetInstances();const r=n.length;if(0===r)return this._returnsString?"":0;l=f(l,r);n=n[l];l=0;m.IsFamily()&amp;&amp;(l=n.GetObjectClass().GetFamilyInstanceVariableOffset(m.GetFamilyIndex()));return n._GetInstanceVariableValueUnchecked(this._varIndex+l)}}class g extends c.ExpNode{constructor(l,m){super(l);this._objectClass=this._runtime.GetObjectClassByIndex(m[1]);this._behaviorType=this._objectClass.GetBehaviorTypeByName(m[2]);
this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(m[2]);this._func=this._runtime.GetObjectReference(m[3]);this._returnsString=!!m[4];this._eventStack=this._runtime.GetEventSheetManager().GetEventStack();this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...l){const m=this._objectClass;var n=m.GetCurrentSol().GetExpressionInstances(),r=n.length;if(0===r)return this._returnsString?"":0;r=f(this._owner.GetSolIndex(),r);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(m);
n=n[r];r=0;m.IsFamily()&amp;&amp;(r=n.GetObjectClass().GetFamilyBehaviorOffset(m.GetFamilyIndex()));return this._func.apply(n.GetBehaviorInstances()[this._behaviorIndex+r].GetSdkInstance(),l)}ExpBehavior_InstExpr(l,...m){const n=this._objectClass;var r=n.GetInstances();const q=r.length;if(0===q)return this._returnsString?"":0;l=f(l,q);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n);r=r[l];l=0;n.IsFamily()&amp;&amp;(l=r.GetObjectClass().GetFamilyBehaviorOffset(n.GetFamilyIndex()));return this._func.apply(r.GetBehaviorInstances()[this._behaviorIndex+
l].GetSdkInstance(),m)}}class h extends c.ExpNode{constructor(l,m){super(l);this._eventVar=null;this._eventVarSid=m[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableBySID(this._eventVarSid)}GetVar(){return this._eventVar}}}"use strict";
{const c=self.C3;c.Parameter=class extends c.DefendedBase{constructor(y,C,G){super();this._owner=y;this._index=G;this._type=C;this.Get=null;this._isConstant=this._variesPerInstance=!1}static Create(y,C,G){const x=C[0];return c.New([a,f,n,e,h,d,l,a,e,e,r,q,n,u,f,m,g,t,w][x],y,x,G,C)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=!0}_MaybeVaryFor(y){this._variesPerInstance||!y||y.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 b(y){y=self.C3_ExpressionFuncs[y];if(!y)throw Error("invalid expression number");return y}class a extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._solIndex=0;y=x[1];this._expressionNumber=y[0];this._numberedNodes=[];this._expressionFunc=null;for(let B=1,H=y.length;B&lt;H;++B)this._numberedNodes.push(c.ExpNode.CreateNode(this,y[B]));this._numberedNodes.length?this.Get=this.GetExpression:(this.Get=b(this._expressionNumber),this._isConstant=!0)}_GetNode(y){if(0&gt;y||y&gt;=this._numberedNodes.length)throw new RangeError("invalid numbered node");
return this._numberedNodes[y]}_PostInit(){for(var y of this._numberedNodes)y._PostInit();y=b(this._expressionNumber);this._expressionFunc=this._numberedNodes.length?y(this):y}GetSolIndex(){return this._solIndex}GetExpression(y){this._solIndex=y;return this._expressionFunc()}}class f extends a{constructor(y,C,G,x){super(y,C,G,x);this.Get=this.GetStringExpression;14===C&amp;&amp;(this.GetEventBlock().SetAllSolModifiers(),this._owner instanceof c.Action&amp;&amp;this.GetEventBlock().SetSolWriterAfterCnds())}GetStringExpression(y){this._solIndex=
y;y=this._expressionFunc();return"string"===typeof y?y:""}_GetFastTriggerValue(){return b(this._expressionNumber)()}}class d extends a{constructor(y,C,G,x){super(y,C,G,x);this.Get=this.GetLayer;this._isConstant=!1}GetLayer(y){this._solIndex=y;y=this._expressionFunc();return this.GetRuntime().GetCurrentLayout().GetLayer(y)}}class e extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._combo=x[1];this.Get=this.GetCombo;this._isConstant=!0}GetCombo(){return this._combo}}class g extends c.Parameter{constructor(y,
C,G,x){super(y,C,G);this._bool=x[1];this.Get=this.GetBoolean;this._isConstant=!0}GetBoolean(){return this._bool}}class h extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._objectClass=this.GetRuntime().GetObjectClassByIndex(x[1]);this.Get=this.GetObjectClass;y=this.GetEventBlock();y._AddSolModifier(this._objectClass);this._owner instanceof c.Action?y.SetSolWriterAfterCnds():y.GetParent()&amp;&amp;y.GetParent().SetSolWriterAfterCnds();this._isConstant=!0}GetObjectClass(){return this._objectClass}}
class l extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(x[1]);this.Get=this.GetLayout;this._isConstant=!0}GetLayout(){return this._layout}}class m extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(x[1]);this.Get=this.GetTimeline;this._isConstant=!0}GetTimeline(){return this._timeline}}class n extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._fileInfo=
x[1];this.Get=this.GetFile;this._isConstant=!0}GetFile(){return this._fileInfo}}class r extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._instVarIndex=x[1];(y=this._owner.GetObjectClass())&amp;&amp;y.IsFamily()?(this.Get=this.GetFamilyInstanceVariable,this.SetVariesPerInstance()):(this.Get=this.GetInstanceVariable,this._isConstant=!0)}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(y){y=y||0;const C=this._owner.GetObjectClass();var G=C.GetCurrentSol();const x=G.GetInstances();
if(x.length)y=x[y%x.length].GetObjectClass();else if(G.HasAnyElseInstances())G=G.GetElseInstances(),y=G[y%G.length].GetObjectClass();else if(0&lt;C.GetInstanceCount())G=C.GetInstances(),y=G[y%G.length].GetObjectClass();else return 0;return this._instVarIndex+y.GetFamilyInstanceVariableOffset(C.GetFamilyIndex())}}class q extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._eventVarSid=x[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 t extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._functionBlockName=x[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 u extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._subParams=[];this._variadicRet=[];this._isConstant=!0;for(let B=1,H=x.length;B&lt;
H;++B)y=c.Parameter.Create(this._owner,x[B],0),this._subParams.push(y),this._variadicRet.push(0),y.IsConstant()||(this._isConstant=!1);this.Get=this.GetVariadic}_PostInit(){for(const y of this._subParams)y._PostInit()}GetVariadic(){const y=this._subParams,C=this._variadicRet;for(let G=0,x=y.length;G&lt;x;++G)C[G]=y[G].Get(0);return C}}class w extends c.Parameter{constructor(y,C,G,x){super(y,C,G);this._easeIndex=x[1];this.Get=this.GetEase;this._isConstant=!0}GetEase(){return this._easeIndex}}}"use strict";
{const c=self.C3;function b(d,e){for(let g=0,h=d.length;g&lt;h;++g)e[g]=d[g].Get(0)}const a=[],f=function(){};c.Condition=class extends c.DefendedBase{constructor(d,e,g){super();this._eventBlock=d;this._runtime=d.GetRuntime();this._index=g;this._func=this._runtime.GetObjectReference(e[1]);this._isTrigger=0&lt;e[3];this._isFastTrigger=2===e[3];this._isLooping=!!e[4];this._isInverted=!!e[5];this._isStatic=!!e[6];this._sid=e[7];this._isInOrBlock=this._eventBlock.IsOrBlock();this._behaviorType=this._objectClass=
null;this._behaviorIndex=-1;this._systemPlugin=null;this.DebugRun=this.Run=f;this._parameters=[];this._results=[];this._anyParamVariesPerInstance=!1;this._unsavedData=this._savedData=null;this._debugData=this._runtime.IsDebug()?{isBreakpoint:e[8][0],canDebug:e[8][1]}:null;-1===e[0]?this._systemPlugin=this._runtime.GetSystemPlugin():(this._objectClass=this._runtime.GetObjectClassByIndex(e[0]),e[2]&amp;&amp;(this._behaviorType=this._objectClass.GetBehaviorTypeByName(e[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(e[2])),
this._eventBlock.GetParent()&amp;&amp;this._eventBlock.GetParent().SetSolWriterAfterCnds());if(10===e.length){d=e[9];for(let h of d)this._parameters.push(c.Parameter.Create(this,h,this._parameters.length)),this._results.push(0)}0===this._parameters.length&amp;&amp;(this._results=this._parameters=a);this._eventBlock.GetEventSheetManager()._RegisterCondition(this)}static Create(d,e,g){return c.New(c.Condition,d,e,g)}_PostInit(){for(const d of this._parameters)d._PostInit(),d.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 d=this._objectClass.GetPlugin(),e=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(d,e,this._RunSingleGlobal)}_SetRunMethodForBoundFunc(d,e,g){const h=this._func,l=this._isInverted,m=this._parameters;if(0===m.length){const n=d._GetBoundACEMethod(h,e);this.Run=l?function(){return c.xor(n(),l)}:n}else if(1===m.length){const n=m[0];if(!l&amp;&amp;n.IsConstant())this.Run=d._GetBoundACEMethod_1param(h,
e,n.Get(0));else{const r=d._GetBoundACEMethod(h,e);this.Run=function(){return c.xor(r(n.Get(0)),l)}}}else if(2===m.length){const n=m[0],r=m[1];if(!l&amp;&amp;n.IsConstant()&amp;&amp;r.IsConstant())this.Run=d._GetBoundACEMethod_2params(h,e,n.Get(0),r.Get(0));else{const q=d._GetBoundACEMethod(h,e);this.Run=function(){return c.xor(q(n.Get(0),r.Get(0)),l)}}}else if(3===m.length){const n=m[0],r=m[1],q=m[2];if(!l&amp;&amp;n.IsConstant()&amp;&amp;r.IsConstant()&amp;&amp;q.IsConstant())this.Run=d._GetBoundACEMethod_3params(h,e,n.Get(0),r.Get(0),
q.Get(0));else{const t=d._GetBoundACEMethod(h,e);this.Run=function(){return c.xor(t(n.Get(0),r.Get(0),q.Get(0)),l)}}}else this.Run=g}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(d){this._debugData.isBreakpoint=
!!d;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 d=this._results;b(this._parameters,d);return c.xor(this._func.apply(this._systemPlugin,d),
this._isInverted)}*_DebugRunSystem(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var d=this._results;b(this._parameters,d);d=this._func.apply(this._systemPlugin,d);c.IsIterator(d)&amp;&amp;(d=yield*d);return c.xor(d,this._isInverted)}return this.Run()}_RunSingleGlobal(){const d=this._results;b(this._parameters,d);const e=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();return c.xor(this._func.apply(e,d),this._isInverted)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||
this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var d=this._results;b(this._parameters,d);const e=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();d=this._func.apply(e,d);c.IsIterator(d)&amp;&amp;(d=yield*d);return c.xor(d,this._isInverted)}return this.Run()}_RunFastTrigger(){return!0}*_DebugRunFastTrigger(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return!0}_RunStatic(){var d=this._results;b(this._parameters,d);d=this._func.apply(this._behaviorType||
this._objectClass,d);this._objectClass.ApplySolToContainer();return d}*_DebugRunStatic(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var d=this._results;b(this._parameters,d);d=this._func.apply(this._behaviorType||this._objectClass,d);c.IsIterator(d)&amp;&amp;(d=yield*d);this._objectClass.ApplySolToContainer();return d}return this.Run()}_RunObject(){const d=this._parameters,e=this._results,g=this._objectClass.GetCurrentSol();for(let h=0,l=d.length;h&lt;
l;++h){const m=d[h];m.VariesPerInstance()||(e[h]=m.Get(0))}return g.IsSelectAll()?this._RunObject_FirstFilter(g):this._RunObject_NextFilter(g)}*_DebugRunObject(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this._RunObject()}_EvaluateVaryingParameters(d){const e=this._parameters,g=this._results;for(let h=0,l=e.length;h&lt;l;++h){const m=e[h];m.VariesPerInstance()&amp;&amp;(g[h]=m.Get(d))}}_RunObject_FirstFilter(d){const e=this._objectClass,g=e.IsFamily(),h=e.GetFamilyIndex(),l=this._behaviorIndex,
m=0&lt;=l,n=e.GetInstances(),r=this._anyParamVariesPerInstance,q=this._results,t=this._func,u=this._isInverted,w=this._isInOrBlock&amp;&amp;!this._isTrigger;d.ClearArrays();for(let C=0,G=n.length;C&lt;G;++C){const x=n[C];r&amp;&amp;this._EvaluateVaryingParameters(C);var y=void 0;m?(y=g?x.GetObjectClass().GetFamilyBehaviorOffset(h):0,y=t.apply(x.GetBehaviorInstances()[l+y].GetSdkInstance(),q)):y=t.apply(x.GetSdkInstance(),q);c.xor(y,u)?d._PushInstance(x):w&amp;&amp;d._PushElseInstance(x)}e.FinishCondition(!0);d._SetSelectAll(!1);
e.ApplySolToContainer();return d.HasAnyInstances()}_RunObject_NextFilter(d){const e=this._objectClass;var g=e.IsFamily();const h=e.GetFamilyIndex(),l=e.IsInContainer(),m=this._behaviorIndex,n=0&lt;=m,r=this._anyParamVariesPerInstance,q=this._results,t=this._func,u=this._isInverted,w=this._isInOrBlock&amp;&amp;!this._isTrigger,y=d._GetOwnInstances(),C=d._GetOwnElseInstances(),G=w&amp;&amp;!this._eventBlock.IsFirstConditionOfType(this),x=G?C:y;let B=0,H=!1;for(let E=0,J=x.length;E&lt;J;++E){const O=x[E];r&amp;&amp;this._EvaluateVaryingParameters(E);
var P=void 0;n?(P=g?O.GetObjectClass().GetFamilyBehaviorOffset(h):0,P=t.apply(O.GetBehaviorInstances()[m+P].GetSdkInstance(),q)):P=t.apply(O.GetSdkInstance(),q);c.xor(P,u)?(H=!0,G?(y.push(O),l&amp;&amp;O._PushSiblingsToSolInstances()):(x[B]=O,l&amp;&amp;O._SetSiblingsToSolInstancesIndex(B),++B)):G?(x[B]=O,l&amp;&amp;O._SetSiblingsToSolElseInstancesIndex(B),++B):w&amp;&amp;(C.push(O),l&amp;&amp;O._PushSiblingsToSolElseInstances())}c.truncateArray(x,B);l&amp;&amp;e._TruncateContainerSols(G,B);g=H;G&amp;&amp;!H&amp;&amp;(H=this._OrBlockCheckInstances(y));e.FinishCondition(g||
w);return w?H:d.HasAnyInstances()}_OrBlockCheckInstances(d){var e=this._objectClass;const g=e.IsFamily();e=e.GetFamilyIndex();const h=this._anyParamVariesPerInstance,l=this._behaviorIndex,m=0&lt;=l,n=this._results,r=this._func,q=this._isInverted;for(let u=0,w=d.length;u&lt;w;++u){var t=d[u];h&amp;&amp;this._EvaluateVaryingParameters(u);if(m){const y=g?t.GetObjectClass().GetFamilyBehaviorOffset(e):0;t=r.apply(t.GetBehaviorInstances()[l+y].GetSdkInstance(),n)}else t=r.apply(t.GetSdkInstance(),n);if(c.xor(t,q))return!0}return!1}ReevaluateParameter(d,
e){return this._parameters[d].Get(e)}GetFastTriggerValue(){const d=this._parameters;if(!d.length)throw Error("no parameters");return d[0]._GetFastTriggerValue()}_SaveToJson(){if(!this._savedData||!this._savedData.size)return null;const d={};for(const [e,g]of this._savedData.entries()){let h=g;"collmemory"===e&amp;&amp;(h=[...g.entries()].map(l=&gt;[l[0].GetUID(),l[1].GetUID(),l[2]]));d[e]=h}return{ex:d}}_LoadFromJson(d){this._savedData&amp;&amp;(this._savedData.clear(),this._savedData=null);if(d){var e=this._runtime,
g=d.ex;if(g){d=this.GetSavedDataMap();d.clear();for(const [h,l]of Object.entries(g))g=l,"collmemory"===h&amp;&amp;(g=c.New(c.PairMap,l.map(m=&gt;[e.GetInstanceByUID(m[0]),e.GetInstanceByUID(m[1]),m[2]]).filter(m=&gt;m[0]&amp;&amp;m[1]))),d.set(h,g)}}}}}"use strict";
{const c=self.C3;function b(e,g){for(let h=0,l=e.length;h&lt;l;++h)g[h]=e[h].Get(0)}const a=[],f=function(){},d=function*(){};c.Action=class extends c.DefendedBase{constructor(e,g,h){super();this._eventBlock=e;this._runtime=e=e.GetRuntime();this._index=h;this._sid=4&lt;=g.length?g[3]:-1;this._actionReturnType=5&lt;=g.length?g[4]:0;this._behaviorType=this._objectClass=this._func=null;this._behaviorIndex=-1;this._systemPlugin=null;this._callFunctionName="";this._combinedSolModifiers=this._callEventBlock=null;
this.DebugRun=this.Run=f;this._parameters=[];this._results=[];this._anyParamVariesPerInstance=!1;this._unsavedData=this._savedData=null;const l=(h=-3===g[0])?g[2]:g[5];this._debugData=e.IsDebug()||h?{isBreakpoint:l[0],canDebug:l[1],index:l[2]}:null;-1===g[0]?(this._systemPlugin=e.GetSystemPlugin(),this._func=e.GetObjectReference(g[1])):-2===g[0]?this._callFunctionName=g[1]:h?(this._func=e.GetObjectReference(g[1]),this.Run=this.RunUserScript,this.DebugRun=this.DebugRunUserScript,this._actionReturnType=
1):(this._func=e.GetObjectReference(g[1]),this._objectClass=e.GetObjectClassByIndex(g[0]),g[2]&amp;&amp;(this._behaviorType=this._objectClass.GetBehaviorTypeByName(g[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(g[2])));if(7===g.length){g=g[6];for(const m of g)this._parameters.push(c.Parameter.Create(this,m,this._parameters.length)),this._results.push(0)}0===this._parameters.length&amp;&amp;(this._results=this._parameters=a);this._eventBlock.GetEventSheetManager()._RegisterAction(this)}static Create(e,
g,h){return c.New(c.Action,e,g,h)}_PostInit(){for(var e of this._parameters)e._PostInit(),e.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){e=this._func;const g=this._runtime.GetEventSheetManager()._GetLocalVariablesScriptInterface(this._eventBlock);this._func=e.bind(null,this._runtime.GetIRuntime(),
g)}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._parameters.length?this._parameters.every(g=&gt;g.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(g=&gt;g.IsConstant())?(b(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 e=this._objectClass.GetPlugin(),g=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(e,g,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const e=this._eventBlock.GetEventSheetManager(),g=e.GetFunctionBlockByName(this._callFunctionName);g.IsEnabled()?(this._callEventBlock=g.GetEventBlock(),this._combinedSolModifiers=[...new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()])],
this._combinedSolModifiers=e._DeduplicateSolModifierList(this._combinedSolModifiers),this.Run=c.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,this._combinedSolModifiers,this._parameters),this.DebugRun=this._DebugRunCallFunction):(this.Run=f,this.DebugRun=d)}_SetRunMethodForBoundFunc(e,g,h){const l=this._func,m=this._parameters;if(0===m.length)this.Run=e._GetBoundACEMethod(l,g);else if(1===m.length){const n=m[0];if(n.IsConstant())this.Run=e._GetBoundACEMethod_1param(l,g,n.Get(0));
else{const r=e._GetBoundACEMethod(l,g);this.Run=function(){return r(n.Get(0))}}}else if(2===m.length){const n=m[0],r=m[1];if(n.IsConstant()&amp;&amp;r.IsConstant())this.Run=e._GetBoundACEMethod_2params(l,g,n.Get(0),r.Get(0));else{const q=e._GetBoundACEMethod(l,g);this.Run=function(){return q(n.Get(0),r.Get(0))}}}else if(3===m.length){const n=m[0],r=m[1],q=m[2];if(n.IsConstant()&amp;&amp;r.IsConstant()&amp;&amp;q.IsConstant())this.Run=e._GetBoundACEMethod_3params(l,g,n.Get(0),r.Get(0),q.Get(0));else{const t=e._GetBoundACEMethod(l,
g);this.Run=function(){return t(n.Get(0),r.Get(0),q.Get(0))}}}else this.Run=h}GetSID(){return this._sid}IsAsync(){return 1===this._actionReturnType}CanBailOut(){return 2===this._actionReturnType}HasReturnType(){return 0!==this._actionReturnType}GetObjectClass(){return this._objectClass}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this._debugData.index}GetCombinedSolModifiers(){return this._combinedSolModifiers}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(e){this._debugData.isBreakpoint=
!!e;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 e=this._results;b(this._parameters,e);return this._func.apply(this._systemPlugin,e)}*_DebugRunSystem(){if(this.IsBreakpoint()||
this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._results;b(this._parameters,e);return yield*this._func.apply(this._systemPlugin,e)}return this.Run()}*_DebugRunCallFunction(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return yield*this._callEventBlock.DebugRunAsFunctionCall(this._combinedSolModifiers,this._parameters)}_RunSingleGlobal(){const e=this._results;b(this._parameters,e);return this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),
e)}*_DebugRunSingleGlobal(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._results;b(this._parameters,e);return yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),e)}return this.Run()}_RunObject_ParamsConst(){const e=this._results,g=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,l=g.length;h&lt;l;++h)this._func.apply(g[h].GetSdkInstance(),e)}*_DebugRunObject_ParamsConst(){if(this.IsBreakpoint()||
this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._results,g=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,l=g.length;h&lt;l;++h)yield*this._func.apply(g[h].GetSdkInstance(),e)}else this._RunObject_ParamsConst()}_RunObject_ParamsDontVary(){const e=this._results;b(this._parameters,e);const g=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,l=g.length;h&lt;l;++h)this._func.apply(g[h].GetSdkInstance(),e)}*_DebugRunObject_ParamsDontVary(){if(this.IsBreakpoint()||
this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._results;b(this._parameters,e);const g=this._objectClass.GetCurrentSol().GetInstances();for(let h=0,l=g.length;h&lt;l;++h)yield*this._func.apply(g[h].GetSdkInstance(),e)}else this._RunObject_ParamsDontVary()}_RunObject_AllParamsVary(){const e=this._parameters,g=this._results,h=this._func,l=this._objectClass.GetCurrentSol().GetInstances();for(let m=0,n=l.length;m&lt;n;++m){const r=l[m];for(let q=0,t=e.length;q&lt;t;++q)g[q]=
e[q].Get(m);h.apply(r.GetSdkInstance(),g)}}*_DebugRunObject_AllParamsVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._parameters,g=this._results,h=this._func,l=this._objectClass.GetCurrentSol().GetInstances();for(let m=0,n=l.length;m&lt;n;++m){const r=l[m];for(let q=0,t=e.length;q&lt;t;++q)g[q]=e[q].Get(m);yield*h.apply(r.GetSdkInstance(),g)}}else this._RunObject_AllParamsVary()}_RunObject_SomeParamsVary(){const e=this._parameters,
g=this._results,h=this._func,l=this._objectClass.GetCurrentSol().GetInstances();for(let n=0,r=e.length;n&lt;r;++n){var m=e[n];m.VariesPerInstance()||(g[n]=m.Get(0))}for(let n=0,r=l.length;n&lt;r;++n){m=l[n];for(let q=0,t=e.length;q&lt;t;++q){const u=e[q];u.VariesPerInstance()&amp;&amp;(g[q]=u.Get(n))}h.apply(m.GetSdkInstance(),g)}}*_DebugRunObject_SomeParamsVary(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const g=this._parameters,h=this._results,l=this._func,
m=this._objectClass.GetCurrentSol().GetInstances();for(let n=0,r=g.length;n&lt;r;++n){var e=g[n];e.VariesPerInstance()||(h[n]=e.Get(0))}for(let n=0,r=m.length;n&lt;r;++n){e=m[n];for(let q=0,t=g.length;q&lt;t;++q){const u=g[q];u.VariesPerInstance()&amp;&amp;(h[q]=u.Get(n))}yield*l.apply(e.GetSdkInstance(),h)}}else this._RunObject_SomeParamsVary()}_RunBehavior(){var e=this._objectClass;const g=e.IsFamily(),h=e.GetFamilyIndex(),l=this._parameters,m=this._anyParamVariesPerInstance,n=this._results,r=this._func,q=this._behaviorIndex;
e=e.GetCurrentSol().GetInstances();for(let w=0,y=l.length;w&lt;y;++w){var t=l[w];t.VariesPerInstance()||(n[w]=t.Get(0))}for(let w=0,y=e.length;w&lt;y;++w){t=e[w];if(m)for(let C=0,G=l.length;C&lt;G;++C){var u=l[C];u.VariesPerInstance()&amp;&amp;(n[C]=u.Get(w))}u=g?t.GetObjectClass().GetFamilyBehaviorOffset(h):0;r.apply(t.GetBehaviorInstances()[q+u].GetSdkInstance(),n)}}*_DebugRunBehavior(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var e=this._objectClass;const l=
e.IsFamily(),m=e.GetFamilyIndex(),n=this._parameters,r=this._anyParamVariesPerInstance,q=this._results,t=this._func,u=this._behaviorIndex;e=e.GetCurrentSol().GetInstances();for(let w=0,y=n.length;w&lt;y;++w){var g=n[w];g.VariesPerInstance()||(q[w]=g.Get(0))}for(let w=0,y=e.length;w&lt;y;++w){g=e[w];if(r)for(let C=0,G=n.length;C&lt;G;++C){var h=n[C];h.VariesPerInstance()&amp;&amp;(q[C]=h.Get(w))}h=l?g.GetObjectClass().GetFamilyBehaviorOffset(m):0;yield*t.apply(g.GetBehaviorInstances()[u+h].GetSdkInstance(),q)}}else this._RunBehavior()}_RunObject_Async(){const e=
this._parameters,g=this._results,h=this._func,l=this._objectClass.GetCurrentSol().GetInstances(),m=[];for(let n=0,r=l.length;n&lt;r;++n){const q=l[n];for(let t=0,u=e.length;t&lt;u;++t)g[t]=e[t].Get(n);m.push(h.apply(q.GetSdkInstance(),g))}return Promise.all(m)}*_DebugRunObject_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){const e=this._parameters,g=this._results,h=this._func,l=this._objectClass.GetCurrentSol().GetInstances(),m=[];for(let n=0,
r=l.length;n&lt;r;++n){const q=l[n];for(let t=0,u=e.length;t&lt;u;++t)g[t]=e[t].Get(n);m.push(yield*h.apply(q.GetSdkInstance(),g))}return Promise.all(m)}return this._RunObject_Async()}_RunBehavior_Async(){var e=this._objectClass;const g=e.IsFamily(),h=e.GetFamilyIndex(),l=this._parameters,m=this._results,n=this._func,r=this._behaviorIndex;e=e.GetCurrentSol().GetInstances();const q=[];for(let t=0,u=e.length;t&lt;u;++t){const w=e[t];for(let C=0,G=l.length;C&lt;G;++C)m[C]=l[C].Get(t);const y=g?w.GetObjectClass().GetFamilyBehaviorOffset(h):
0;q.push(n.apply(w.GetBehaviorInstances()[r+y].GetSdkInstance(),m))}return Promise.all(q)}*_DebugRunBehavior_Async(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;if(this._DebugReturnsGenerator()){var e=this._objectClass;const g=e.IsFamily(),h=e.GetFamilyIndex(),l=this._parameters,m=this._results,n=this._func,r=this._behaviorIndex;e=e.GetCurrentSol().GetInstances();const q=[];for(let t=0,u=e.length;t&lt;u;++t){const w=e[t];for(let C=0,G=l.length;C&lt;G;++C)m[C]=l[C].Get(t);const y=g?
w.GetObjectClass().GetFamilyBehaviorOffset(h):0;q.push(yield*n.apply(w.GetBehaviorInstances()[r+y].GetSdkInstance(),m))}return Promise.all(q)}return this._RunBehavior_Async()}async RunUserScript(){try{await this._func()}catch(e){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;",e),self.C3Debugger&amp;&amp;self.C3Debugger._SetLastErrorScript(this),
c.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"),c.EventScript.SetHadUserScriptException())}}*DebugRunUserScript(){if(this.IsBreakpoint()||this._runtime.DebugBreakNext())yield this;return this.RunUserScript()}_SaveToJson(){return this._savedData&amp;&amp;this._savedData.size?{ex:c.ToSuperJSON(this._savedData)}:null}_LoadFromJson(e){this._savedData&amp;&amp;
(this._savedData.clear(),this._savedData=null);e&amp;&amp;(e=e.ex)&amp;&amp;(this._savedData=c.FromSuperJSON(e))}}}"use strict";
{const c=self.C3,b=new c.Color;function a(L,N){return c.compare(this.GetWorldInfo().GetX(),L,N)}function f(L,N){return c.compare(this.GetWorldInfo().GetY(),L,N)}function d(){const L=this.GetWorldInfo();return L.IsInViewport(L.GetLayer().GetViewport())}function e(){var L=this.GetWorldInfo();const N=L.GetLayout();L=L.GetBoundingBox();return 0&gt;L.getRight()||0&gt;L.getBottom()||L.getLeft()&gt;N.GetWidth()||L.getTop()&gt;N.GetHeight()}function g(L,N,V){const aa=this.GetCurrentSol(),fa=aa.GetInstances();if(!fa.length)return!1;
let ha=fa[0];var da=ha.GetWorldInfo();let sa=ha,ta=c.distanceSquared(da.GetX(),da.GetY(),N,V);for(let ya=1,Ha=fa.length;ya&lt;Ha;++ya)if(ha=fa[ya],da=ha.GetWorldInfo(),da=c.distanceSquared(da.GetX(),da.GetY(),N,V),0===L&amp;&amp;da&lt;ta||1===L&amp;&amp;da&gt;ta)ta=da,sa=ha;aa.PickOne(sa);return!0}function h(L){const N=this.GetWorldInfo();N.GetX()!==L&amp;&amp;(N.SetX(L),N.SetBboxChanged())}function l(L){const N=this.GetWorldInfo();N.GetY()!==L&amp;&amp;(N.SetY(L),N.SetBboxChanged())}function m(L,N){const V=this.GetWorldInfo();V.EqualsXY(L,
N)||(V.SetXY(L,N),V.SetBboxChanged())}function n(L,N){if(L&amp;&amp;(L=L.GetPairedInstance(this._inst))){var [V,aa]=L.GetImagePoint(N);N=this.GetWorldInfo();if(N.GetX()!==V||N.GetY()!==aa)N.SetXY(V,aa),N.SetBboxChanged()}}function r(L){if(0!==L){var N=this.GetWorldInfo();N.OffsetXY(N.GetCosAngle()*L,N.GetSinAngle()*L);N.SetBboxChanged()}}function q(L,N){if(0!==N){var V=this.GetWorldInfo();L=c.toRadians(L);V.OffsetXY(Math.cos(L)*N,Math.sin(L)*N);V.SetBboxChanged()}}function t(){return this.GetWorldInfo().GetX()}
function u(){return this.GetWorldInfo().GetY()}function w(){return this._runtime.GetDt(this._inst)}function y(L,N){return c.compare(this.GetWorldInfo().GetWidth(),L,N)}function C(L,N){return c.compare(this.GetWorldInfo().GetHeight(),L,N)}function G(L){const N=this.GetWorldInfo();N.GetWidth()!==L&amp;&amp;(N.SetWidth(L),N.SetBboxChanged())}function x(L){const N=this.GetWorldInfo();N.GetHeight()!==L&amp;&amp;(N.SetHeight(L),N.SetBboxChanged())}function B(L,N){const V=this.GetWorldInfo();if(V.GetWidth()!==L||V.GetHeight()!==
N)V.SetSize(L,N),V.SetBboxChanged()}function H(){return this.GetWorldInfo().GetWidth()}function P(){return this.GetWorldInfo().GetHeight()}function E(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function J(){return this.GetWorldInfo().GetBoundingBox().getTop()}function O(){return this.GetWorldInfo().GetBoundingBox().getRight()}function R(){return this.GetWorldInfo().GetBoundingBox().getBottom()}function T(L,N){return c.angleDiff(this.GetWorldInfo().GetAngle(),c.toRadians(N))&lt;=c.toRadians(L)}
function Y(L){return c.angleClockwise(this.GetWorldInfo().GetAngle(),c.toRadians(L))}function W(L,N){L=c.toRadians(L);N=c.toRadians(N);const V=this.GetWorldInfo().GetAngle();return c.angleClockwise(N,L)?c.angleClockwise(V,L)&amp;&amp;!c.angleClockwise(V,N):!(!c.angleClockwise(V,L)&amp;&amp;c.angleClockwise(V,N))}function ea(L){const N=this.GetWorldInfo();L=c.clampAngle(c.toRadians(L));isNaN(L)||N.GetAngle()===L||(N.SetAngle(L),N.SetBboxChanged())}function qa(L){if(!isNaN(L)&amp;&amp;0!==L){var N=this.GetWorldInfo();N.SetAngle(N.GetAngle()+
c.toRadians(L));N.SetBboxChanged()}}function ja(L){if(!isNaN(L)&amp;&amp;0!==L){var N=this.GetWorldInfo();N.SetAngle(N.GetAngle()-c.toRadians(L));N.SetBboxChanged()}}function xa(L,N){const V=this.GetWorldInfo(),aa=V.GetAngle();L=c.angleRotate(aa,c.toRadians(N),c.toRadians(L));isNaN(L)||aa===L||(V.SetAngle(L),V.SetBboxChanged())}function ua(L,N,V){const aa=this.GetWorldInfo(),fa=aa.GetAngle();N-=aa.GetX();V-=aa.GetY();L=c.angleRotate(fa,Math.atan2(V,N),c.toRadians(L));isNaN(L)||fa===L||(aa.SetAngle(L),aa.SetBboxChanged())}
function Da(L,N){const V=this.GetWorldInfo(),aa=V.GetAngle();L-=V.GetX();N-=V.GetY();N=Math.atan2(N,L);isNaN(N)||aa===N||(V.SetAngle(N),V.SetBboxChanged())}function Ea(){return c.toDegrees(this.GetWorldInfo().GetAngle())}function Ba(L,N){return c.compare(c.round6dp(100*this.GetWorldInfo().GetOpacity()),L,N)}function Aa(){return this.GetWorldInfo().IsVisible()}function ia(L){const N=this.GetWorldInfo();L=2===L?!N.IsVisible():0!==L;N.IsVisible()!==L&amp;&amp;(N.SetVisible(L),this._runtime.UpdateRender())}function Fa(L){L=
c.clamp(L/100,0,1);const N=this.GetWorldInfo();N.GetOpacity()!==L&amp;&amp;(N.SetOpacity(L),this._runtime.UpdateRender())}function wa(L){b.setFromRgbValue(L);L=this.GetWorldInfo();L.GetUnpremultipliedColor().equalsIgnoringAlpha(b)||(L.SetUnpremultipliedColor(b),this._runtime.UpdateRender())}function Ca(){const L=this.GetWorldInfo().GetUnpremultipliedColor();return c.PackRGBAEx(L.getR(),L.getG(),L.getB(),L.getA())}function Pa(){return c.round6dp(100*this.GetWorldInfo().GetOpacity())}function Qa(L){return L?
this.GetWorldInfo().GetLayer()===L:!1}function Ra(L){const N=this.GetCurrentSol(),V=N.GetInstances();if(!V.length)return!1;let aa=V[0];for(let fa=1,ha=V.length;fa&lt;ha;++fa){const da=V[fa],sa=da.GetWorldInfo(),ta=aa.GetWorldInfo(),ya=sa.GetLayer().GetIndex(),Ha=ta.GetLayer().GetIndex();if(0===L){if(ya&gt;Ha||ya===Ha&amp;&amp;sa.GetZIndex()&gt;ta.GetZIndex())aa=da}else if(ya&lt;Ha||ya===Ha&amp;&amp;sa.GetZIndex()&lt;ta.GetZIndex())aa=da}N.PickOne(aa);return!0}function Ja(L,N,V){const aa=this.GetWorldInfo();L=0===L?aa.GetZElevation():
aa.GetTotalZElevation();return c.compare(L,N,V)}function Sa(){this.GetWorldInfo().ZOrderMoveToTop()}function Ta(){this.GetWorldInfo().ZOrderMoveToBottom()}function Ua(L){L&amp;&amp;this.GetWorldInfo().ZOrderMoveToLayer(L)}function Va(L,N){L=0===L;N&amp;&amp;(N=N.GetFirstPicked(this.GetInstance()))&amp;&amp;this.GetWorldInfo().ZOrderMoveAdjacentToInstance(N,L)}function Wa(L){const N=this.GetWorldInfo();N.GetZElevation()!==L&amp;&amp;(N.SetZElevation(L),this._runtime.UpdateRender())}function Xa(){return this.GetWorldInfo().GetLayer().GetIndex()}
function Za(){return this.GetWorldInfo().GetLayer().GetName()}function Ka(){return this.GetWorldInfo().GetZIndex()}function $a(){return this.GetWorldInfo().GetZElevation()}function ab(){return this.GetWorldInfo().GetTotalZElevation()}function bb(L,N){if(N=this.GetObjectClass().GetEffectList().GetEffectTypeByName(N)){N=N.GetIndex();L=1===L;var V=this.GetWorldInfo().GetInstanceEffectList();V.IsEffectIndexActive(N)!==L&amp;&amp;(V.SetEffectIndexActive(N,L),V.UpdateActiveEffects(),this._runtime.UpdateRender())}}
function cb(L,N,V){var aa=this.GetObjectClass().GetEffectList().GetEffectTypeByName(L);if(aa){L=aa.GetIndex();var fa=this.GetWorldInfo().GetInstanceEffectList(),ha=fa.GetEffectParametersForIndex(L);N=Math.floor(N);if(!(0&gt;N||N&gt;=ha.length)){aa=aa.GetShaderProgram().GetParameterType(N);if("color"===aa){b.setFromRgbValue(V);N=ha[N];if(b.equalsIgnoringAlpha(N))return;N.copyRgb(b)}else{"percent"===aa&amp;&amp;(V/=100);if(ha[N]===V)return;ha[N]=V}fa.IsEffectIndexActive(L)&amp;&amp;this._runtime.UpdateRender()}}}function db(){return this.GetWorldInfo().HasParent()}
function eb(){return this.GetWorldInfo().HasChildren()}function fb(L,N){const V=this.GetCurrentSol().GetInstances();if(0===V.length)return!1;const aa=L.GetCurrentSol();var fa=aa.GetInstances();if(0===fa.length)return!1;fa=new Set(fa);const ha=new Set;for(let sa=0,ta=V.length;sa&lt;ta;++sa){var da=V[sa];if(1===N)for(const ya of da.parents())ya.BelongsToObjectClass(L)&amp;&amp;fa.has(ya)&amp;&amp;ha.add(ya);else{if(0===N){if(da=da.GetParent(),null===da)continue}else da=da.GetTopParent();da.BelongsToObjectClass(L)&amp;&amp;fa.has(da)&amp;&amp;
ha.add(da)}}if(0===ha.size)return!1;aa.SetSetPicked(ha);L.ApplySolToContainer();return!0}function gb(L,N){const V=this.GetCurrentSol().GetInstances();if(0===V.length)return!1;const aa=L.GetCurrentSol();var fa=aa.GetInstances();if(0===fa.length)return!1;fa=new Set(fa);const ha=new Set;for(let da=0,sa=V.length;da&lt;sa;++da){const ta=V[da];2===N&amp;&amp;!ta.HasChildren()&amp;&amp;ta.BelongsToObjectClass(L)&amp;&amp;fa.has(ta)&amp;&amp;ha.add(ta);for(const ya of 0===N?ta.children():ta.allChildren())2===N&amp;&amp;ya.HasChildren()||ya.BelongsToObjectClass(L)&amp;&amp;
fa.has(ya)&amp;&amp;ha.add(ya)}if(0===ha.size)return!1;aa.SetSetPicked(ha);L.ApplySolToContainer();return!0}function hb(L,N){const V=this.GetCurrentSol().GetInstances();if(0===V.length)return!1;const aa=L.GetCurrentSol();var fa=aa.GetInstances();if(0===fa.length)return!1;fa=new Set(fa);const ha=[];for(let da=0,sa=V.length;da&lt;sa;++da){const ta=V[da].GetChildAt(N);null!==ta&amp;&amp;ta.BelongsToObjectClass(L)&amp;&amp;fa.has(ta)&amp;&amp;ha.push(ta)}if(0===ha.length)return!1;aa.SetArrayPicked(ha);L.ApplySolToContainer();return!0}
function ib(L,N){return c.compare(this._inst.GetChildCount(),L,N)}function jb(L,N,V,aa,fa,ha,da,sa){const ta=this._inst,ya=this._runtime.GetCurrentAction().GetObjectClass();for(const Ha of L.allCorrespondingInstances(ta,ya)){if(!Ha.GetPlugin().SupportsSceneGraph())break;ta.AddChild(Ha,{transformX:N,transformY:V,transformWidth:aa,transformHeight:fa,transformAngle:ha,transformZElevation:da,destroyWithParent:sa})}}function kb(L){const N=this._inst,V=this._runtime.GetCurrentAction().GetObjectClass();
for(const aa of L.allCorrespondingInstances(N,V))N.RemoveChild(aa)}function ma(){this._inst.HasParent()&amp;&amp;this._inst.GetParent().RemoveChild(this._inst)}function Ga(){return this._inst.GetChildCount()}function lb(L,N){L=Math.floor(L);N=Math.floor(N);const V=this.GetWorldInfo();2&gt;L||2&gt;N||!isFinite(L)||!isFinite(N)?(V.ReleaseMesh(),V.SetBboxChanged()):V.CreateMesh(L,N)}function mb(L,N,V,aa,fa,ha,da){const sa=this.GetWorldInfo();sa.SetMeshPoint(L,N,{mode:0===V?"absolute":"relative",x:aa,y:fa,u:ha,v:da})&amp;&amp;
sa.SetBboxChanged()}function nb(){const L=this.GetWorldInfo();return L.HasMesh()?L.GetSourceMesh().GetHSize():0}function ob(){const L=this.GetWorldInfo();return L.HasMesh()?L.GetSourceMesh().GetVSize():0}function pb(L){const N=this.GetWorldInfo();L=2===L?!N.IsVisible():0!==L;N.IsVisible()!==L&amp;&amp;N.SetVisible(L)}function qb(L,N){this.SetElementCSSStyle(L,N)}function La(L,N){this.SetElementAttribute(L,""+N)}function Ma(L){this.RemoveElementAttribute(L)}function Na(){this.FocusElement()}function Oa(){this.BlurElement()}
function Ia(){return this.IsElementFocused()}function k(L){this._SetEnabled(0!==L)}function p(){return this._IsEnabled()}function v(L,N,V){return c.compare(this.GetInstance().GetInstanceVariableValue(L),N,V)}function z(L){return!!this.GetInstance().GetInstanceVariableValue(L)}function A(L,N){const V=this.GetCurrentSol(),aa=V.GetInstances();if(!aa.length)return!1;let fa=aa[0],ha=fa,da=fa.GetInstanceVariableValue(N);for(let sa=1,ta=aa.length;sa&lt;ta;++sa){fa=aa[sa];const ya=fa.GetInstanceVariableValue(N);
if(0===L&amp;&amp;ya&lt;da||1===L&amp;&amp;ya&gt;da)da=ya,ha=fa}V.PickOne(ha);return!0}function D(L){return this._runtime.GetCurrentCondition().IsInverted()?I(this,L):F(this,L)}function F(L,N){N=L.GetRuntime().GetInstanceByUID(N);if(!N)return!1;const V=L.GetCurrentSol();if(!V.IsSelectAll()&amp;&amp;!V._GetOwnInstances().includes(N))return!1;if(L.IsFamily()){if(N.GetObjectClass().BelongsToFamily(L))return V.PickOne(N),L.ApplySolToContainer(),!0}else if(N.GetObjectClass()===L)return V.PickOne(N),L.ApplySolToContainer(),!0;return!1}
function I(L,N){const V=L.GetCurrentSol();if(V.IsSelectAll()){V._SetSelectAll(!1);V.ClearArrays();var aa=L.GetInstances();for(let ha=0,da=aa.length;ha&lt;da;++ha){var fa=aa[ha];fa.GetUID()===N?V._PushElseInstance(fa):V._PushInstance(fa)}L.ApplySolToContainer();return!!V._GetOwnInstances().length}aa=V._GetOwnInstances();fa=0;for(let ha=0,da=aa.length;ha&lt;da;++ha){const sa=aa[ha];aa[fa]=sa;sa.GetUID()===N?V._PushElseInstance(sa):++fa}c.truncateArray(aa,fa);L.ApplySolToContainer();return!!aa.length}function K(){this._runtime.DestroyInstance(this._inst)}
function M(){return!0}function Q(){return!0}function S(L,N){this.GetInstance().SetInstanceVariableValue(L,N)}function X(L,N){const V=this.GetInstance(),aa=V.GetInstanceVariableValue(L);"number"===typeof aa&amp;&amp;"number"!==typeof N?N=parseFloat(N):"string"===typeof aa&amp;&amp;"string"!==typeof N&amp;&amp;(N=N.toString());V.SetInstanceVariableValue(L,aa+N)}function U(L,N){const V=this.GetInstance(),aa=V.GetInstanceVariableValue(L);"number"===typeof aa&amp;&amp;("number"!==typeof N&amp;&amp;(N=parseFloat(N)),V.SetInstanceVariableValue(L,
aa-N))}function ca(L,N){this.GetInstance().SetInstanceVariableValue(L,N?1:0)}function ba(L){const N=this.GetInstance();N.SetInstanceVariableValue(L,0===N.GetInstanceVariableValue(L)?1:0)}function Z(L){let N;try{N=JSON.parse(L)}catch(V){console.error("Failed to load from JSON string: ",V);return}this.GetInstance().LoadFromJson(N,"state")}function ra(){return JSON.stringify(this.GetInstance().SaveToJson("state"))}function la(){return this.GetInstance().GetObjectClass().GetName()}function oa(){const L=
this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass();let N=L.GetInstanceCount();const V=this._runtime._GetInstancesPendingCreate();for(const aa of V)L.IsFamily()?aa.GetObjectClass().BelongsToFamily(L)&amp;&amp;++N:aa.GetObjectClass()===L&amp;&amp;++N;return N}function pa(){return this._runtime.GetCurrentEventStackFrame().GetExpressionObjectClass().GetCurrentSol().GetInstances().length}function na(){return this._inst.GetIID()}function za(){return this._inst.GetUID()}c.AddCommonACEs=function(L,N){const V=
L[1],aa=L[4],fa=L[5],ha=L[6],da=L[7],sa=L[8],ta=L[10],ya=L[11],Ha=L[12],rb=L[13],sb=L[14],va=N.Cnds,ka=N.Acts;N=N.Exps;L[3]&amp;&amp;(va.CompareX=a,va.CompareY=f,va.IsOnScreen=d,va.IsOutsideLayout=e,va.PickDistance=g,ka.SetX=h,ka.SetY=l,ka.SetPos=m,ka.SetPosToObject=n,ka.MoveForward=r,ka.MoveAtAngle=q,N.X=t,N.Y=u,N.dt=w);aa&amp;&amp;(va.CompareWidth=y,va.CompareHeight=C,ka.SetWidth=G,ka.SetHeight=x,ka.SetSize=B,N.Width=H,N.Height=P,N.BBoxLeft=E,N.BBoxTop=J,N.BBoxRight=O,N.BBoxBottom=R);fa&amp;&amp;(va.AngleWithin=T,va.IsClockwiseFrom=
Y,va.IsBetweenAngles=W,ka.SetAngle=ea,ka.RotateClockwise=qa,ka.RotateCounterclockwise=ja,ka.RotateTowardAngle=xa,ka.RotateTowardPosition=ua,ka.SetTowardPosition=Da,N.Angle=Ea);ha&amp;&amp;(va.IsVisible=Aa,va.CompareOpacity=Ba,ka.SetVisible=ia,ka.SetOpacity=Fa,ka.SetDefaultColor=wa,N.Opacity=Pa,N.ColorValue=Ca);da&amp;&amp;(va.IsOnLayer=Qa,va.PickTopBottom=Ra,va.CompareZElevation=Ja,ka.MoveToTop=Sa,ka.MoveToBottom=Ta,ka.MoveToLayer=Ua,ka.ZMoveToObject=Va,ka.SetZElevation=Wa,N.LayerNumber=Xa,N.LayerName=Za,N.ZIndex=
Ka,N.ZElevation=$a,N.TotalZElevation=ab);sa&amp;&amp;(ka.SetEffectEnabled=bb,ka.SetEffectParam=cb);rb&amp;&amp;(va.HasParent=db,va.HasChildren=eb,va.PickParent=fb,va.PickChildren=gb,va.PickNthChild=hb,va.CompareChildCount=ib,ka.AddChild=jb,ka.RemoveChild=kb,ka.RemoveFromParent=ma,N.ChildCount=Ga);sb&amp;&amp;(ka.SetMeshSize=lb,ka.SetMeshPoint=mb,N.MeshColumns=nb,N.MeshRows=ob);ta&amp;&amp;(va.IsVisible=Aa,ka.SetVisible=pb,ka.SetCSSStyle=qb,ka.SetElemAttribute=La,ka.RemoveElemAttribute=Ma);ya&amp;&amp;(va.IsFocused=Ia,ka.SetFocus=Na,ka.SetBlur=
Oa);Ha&amp;&amp;(va.IsEnabled=p,ka.SetEnabled=k);V||(va.CompareInstanceVar=v,va.IsBoolInstanceVarSet=z,va.PickInstVarHiLow=A,va.PickByUID=D,ka.SetInstanceVar=S,ka.AddInstanceVar=X,ka.SubInstanceVar=U,ka.SetBoolInstanceVar=ca,ka.ToggleBoolInstanceVar=ba,va.OnCreated=M,va.OnDestroyed=Q,ka.Destroy=K,ka.LoadFromJsonString||(ka.LoadFromJsonString=Z),N.AsJSON||(N.AsJSON=ra),N.Count=oa,N.PickedCount=pa,N.IID=na,N.UID=za,N.ObjectTypeName=la)}}"use strict";
{const c=self.C3;c.ScheduledWait=class extends c.DefendedBase{constructor(b){super();this._eventSheetManager=b;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._functionParameters=null;this._shouldRelease=!1}Release(){this._type="";this._time=-1;this._signalTag="";this._functionParameters=this._callingFunctionBlock=this._event=null;this._asyncId=-1;c.clearArray(this._solModifiers);
for(const b of this._sols.values())b.Release();this._sols.clear()}_Init(){var b=this._eventSheetManager,a=b.GetRuntime().GetAllObjectClasses();const f=b.GetCurrentEventStackFrame();this._event=f.GetCurrentEvent();this._actIndex=f.GetActionIndex()+1;if(b=b.FindFirstFunctionBlockParent(this._event))this._callingFunctionBlock=b,this._functionParameters=b.CaptureFunctionParameters(),b.IsAsync()&amp;&amp;(this._asyncId=b.PauseCurrentAsyncFunction());for(const d of a)if(a=d.GetCurrentSol(),!a.IsSelectAll()||this._event.HasSolModifier(d))this._solModifiers.push(d),
this._sols.set(d,c.New(c.SolState,a))}InitTimer(b){this._type="timer";this._Init();this._time=this._eventSheetManager.GetRuntime().GetGameTime()+b}InitSignal(b){this._type="signal";this._Init();this._signalTag=b.toLowerCase()}InitPromise(b){this._type="promise";this._Init();b.then(()=&gt;this.SetSignalled()).catch(a=&gt;{console.warn("[C3 runtime] Promise rejected in 'Wait for previous actions to complete': ",a);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(b){b._Restore(this._event,this._actIndex);for(const [a,f]of this._sols.entries())b=a.GetCurrentSol(),f._Restore(b);if(b=this._callingFunctionBlock)b.SetFunctionParameters(this._functionParameters),b.IsAsync()&amp;&amp;b.ResumeAsyncFunction(this._asyncId)}_Run(b){this._RestoreState(b);
this._event._ResumeActionsAndSubEvents(b);this._callingFunctionBlock&amp;&amp;this._callingFunctionBlock.IsAsync()&amp;&amp;this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId);this._eventSheetManager.ClearSol(this._solModifiers);this._shouldRelease=!0}async _DebugRun(b){this._RestoreState(b);for(const a of this._event._DebugResumeActionsAndSubEvents(b))await this._eventSheetManager.GetRuntime().DebugBreak(a);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(b){for(const a of this._sols.values())a.RemoveInstances(b)}_SaveToJson(){const b={},a={t:this._time,st:this._signalTag,s:this._isSignalled,ev:this._event.GetSID(),sm:this._solModifiers.map(f=&gt;f.GetSID()),sols:b};this._event._HasActionIndex(this._actIndex)&amp;&amp;(a.act=this._event.GetActionAt(this._actIndex).GetSID());for(const [f,d]of this._sols)b[f.GetSID().toString()]=
d._SaveToJson();return a}static _CreateFromJson(b,a){const f=b.GetRuntime();var d=b.GetEventBlockBySID(a.ev);if(!d)return null;let e=0;if(a.hasOwnProperty("act")){var g=b.GetActionBySID(a.act);if(!g)return null;e=g.GetIndex()}g=c.New(c.ScheduledWait,b);g._time=a.t;g._type=-1===g._time?"signal":"timer";g._signalTag=a.st;g._isSignalled=a.s;g._event=d;g._actIndex=e;for(var h of a.sm)(d=f.GetObjectClassBySID(h))&amp;&amp;g._solModifiers.push(d);for(const [l,m]of Object.entries(a.sols))if(a=parseInt(l,10),a=f.GetObjectClassBySID(a))h=
c.New(c.SolState,null),h._LoadFromJson(b,m),g._sols.set(a,h);return g}}}"use strict";
{const c=self.C3;c.SolState=class extends c.DefendedBase{constructor(b){super();this._objectClass=null;this._isSelectAll=!0;this._instances=[];b&amp;&amp;(this._objectClass=b.GetObjectClass(),this._isSelectAll=b.IsSelectAll(),c.shallowAssignArray(this._instances,b._GetOwnInstances()))}Release(){this._objectClass=null;c.clearArray(this._instances)}_Restore(b){b._SetSelectAll(this._isSelectAll);c.shallowAssignArray(b._GetOwnInstances(),this._instances)}RemoveInstances(b){c.arrayRemoveAllInSet(this._instances,
b)}_SaveToJson(){return{sa:this._isSelectAll,insts:this._instances.map(b=&gt;b.GetUID())}}_LoadFromJson(b,a){b=b.GetRuntime();this._isSelectAll=!!a.sa;c.clearArray(this._instances);for(const f of a.insts)(a=b.GetInstanceByUID(f))&amp;&amp;this._instances.push(a)}}}"use strict";
{const c=self.C3;function b(a,f){let d=a.get(f);d||(d=new Map,a.set(f,d));return d}c.SDKPluginBase=class extends c.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,f){if(!f)throw Error("missing 'this' binding");
let d=this._boundACEMethodCache.get(a);if(d)return d;d=a.bind(f);this._boundACEMethodCache.set(a,d);return d}_GetBoundACEMethod_1param(a,f,d){if(!f)throw Error("missing 'this' binding");const e=b(this._boundACEMethodCache_1param,a);let g=e.get(d);if(g)return g;g=a.bind(f,d);e.set(d,g);return g}_GetBoundACEMethod_2params(a,f,d,e){if(!f)throw Error("missing 'this' binding");var g=b(this._boundACEMethodCache_2params,a);g=b(g,d);let h=g.get(e);if(h)return h;h=a.bind(f,d,e);g.set(e,h);return h}_GetBoundACEMethod_3params(a,
f,d,e,g){if(!f)throw Error("missing 'this' binding");var h=b(this._boundACEMethodCache_3params,a);h=b(h,d);h=b(h,e);let l=h.get(g);if(l)return l;l=a.bind(f,d,e,g);h.set(g,l);return l}_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 c=self.C3;c.SDKDOMPluginBase=class extends c.SDKPluginBase{constructor(b,a){super(b);this._domComponentId=a;this._nextElementId=0;this._instMap=new Map;this.AddElementMessageHandler("elem-focused",f=&gt;f._OnElemFocused());this.AddElementMessageHandler("elem-blurred",f=&gt;{f&amp;&amp;f._OnElemBlurred()})}Release(){super.Release()}_AddElement(b){const a=this._nextElementId++;this._instMap.set(a,b);return a}_RemoveElement(b){this._instMap.delete(b)}AddElementMessageHandler(b,a){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,
b,f=&gt;{const d=this._instMap.get(f.elementId);a(d,f)})}}}"use strict";{const c=self.C3;c.SDKTypeBase=class extends c.DefendedBase{constructor(b){super();this._objectClass=b;this._runtime=b.GetRuntime();this._plugin=b.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(b){}LoadTextures(b){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(b){}LoadTilemapData(){}GetScriptInterfaceClass(){return null}}}"use strict";
{const c=self.C3;c.SDKInstanceBase=class extends c.DefendedBase{constructor(b,a){super();this._inst=b;this._domComponentId=a;this._runtime=b.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(b){return this._runtime.Trigger(b,this._inst,null)}DebugTrigger(b){return this._runtime.DebugTrigger(b,this._inst,null)}TriggerAsync(b){return this._runtime.TriggerAsync(b,
this._inst,null)}FastTrigger(b,a){return this._runtime.FastTrigger(b,this._inst,a)}DebugFastTrigger(b,a){return this._runtime.DebugFastTrigger(b,this._inst,a)}ScheduleTriggers(b){return this._runtime.ScheduleTriggers(b)}AddDOMMessageHandler(b,a){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,b,a)}AddDOMMessageHandlers(b){for(const [a,f]of b)this.AddDOMMessageHandler(a,f)}PostToDOM(b,a){this._runtime.PostComponentMessageToDOM(this._domComponentId,b,a)}PostToDOMAsync(b,a){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId,
b,a)}_PostToDOMMaybeSync(b,a){if(this._runtime.IsInWorker())this.PostToDOM(b,a);else return window.c3_runtimeInterface._OnMessageFromRuntime({type:"event",component:this._domComponentId,handler:b,data:a,responseId:null})}GetCurrentImageInfo(){return null}GetCurrentSurfaceSize(){var b=this.GetCurrentImageInfo();return b&amp;&amp;(b=b.GetTexture())?[b.GetWidth(),b.GetHeight()]:[100,100]}GetCurrentTexRect(){const b=this.GetCurrentImageInfo();return b?b.GetTexRect():null}GetImagePoint(b){b=this._inst.GetWorldInfo();
return[b.GetX(),b.GetY()]}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(b){}LoadTilemapData(b,a,f){}TestPointOverlapTile(b,a){}GetPropertyValueByIndex(b){}SetPropertyValueByIndex(b,a){}OffsetPropertyValueByIndex(b,a){if(0!==a){var f=this.GetPropertyValueByIndex(b);if("number"!==typeof f)throw Error("expected number");
this.SetPropertyValueByIndex(b,f+a)}}SetPropertyColorOffsetValueByIndex(b,a,f,d){}CallAction(b,...a){b.call(this,...a)}CallExpression(b,...a){return b.call(this,...a)}GetScriptInterfaceClass(){return null}}}"use strict";
{const c=self.C3;c.SDKWorldInstanceBase=class extends c.SDKInstanceBase{constructor(b,a){super(b,a);this._worldInfo=b.GetWorldInfo();this._webglcontextrestored_handler=this._webglcontextlost_handler=null}Release(){if(this._webglcontextlost_handler){const b=this._runtime.Dispatcher();b.removeEventListener("webglcontextlost",this._webglcontextlost_handler);b.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 b=this._runtime.Dispatcher();b.addEventListener("webglcontextlost",this._webglcontextlost_handler);b.addEventListener("webglcontextrestored",this._webglcontextrestored_handler)}}OnWebGLContextLost(){}OnWebGLContextRestored(){}GetWorldInfo(){return this._worldInfo}}}"use strict";
{const c=self.C3,b=c.New(c.Rect);c.SDKDOMInstanceBase=class extends c.SDKWorldInstanceBase{constructor(a,f){super(a,f);this._elementId=this.GetPlugin()._AddElement(this);this._isElementShowing=!0;this._autoFontSize=this._elemHasFocus=!1;this._lastRect=c.New(c.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,f){f||(f={});f.elementId=this._elementId;this.PostToDOM(a,f)}_PostToDOMElementMaybeSync(a,f){f||(f={});f.elementId=this._elementId;return this._PostToDOMMaybeSync(a,f)}PostToDOMElementAsync(a,f){f||(f={});f.elementId=this._elementId;return this.PostToDOMAsync(a,f)}CreateElement(a){a||
(a={});const f=this.GetWorldInfo().IsVisible();a.elementId=this._elementId;a.isVisible=f;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"===c.Platform.OS&amp;&amp;
("scale-inner"===a||"scale-outer"===a||"crop"===a)}_UpdatePosition(a){var f=this.GetWorldInfo();const d=f.GetLayer();var e=f.GetX(),g=f.GetY();let [h,l]=d.LayerToCanvasCss(e,g),[m,n]=d.LayerToCanvasCss(e+f.GetWidth(),g+f.GetHeight());e=this._runtime.GetCanvasManager();g=e.GetCssWidth();const r=e.GetCssHeight();if(f.IsVisible()&amp;&amp;d.IsVisible()){if(!this._ShouldPreserveElement()){if(0&gt;=m||0&gt;=n||h&gt;=g||l&gt;=r){this.SetElementVisible(!1);return}1&gt;h&amp;&amp;(h=1);1&gt;l&amp;&amp;(l=1);m&gt;=g&amp;&amp;(m=g-1);n&gt;=r&amp;&amp;(n=r-1)}b.set(h,l,
m,n);f=e.GetLastWidth();g=e.GetLastHeight();!a&amp;&amp;b.equals(this._lastRect)&amp;&amp;this._lastWindowWidth===f&amp;&amp;this._lastWindowHeight===g?this.SetElementVisible(!0):(this._lastRect.copy(b),this._lastWindowWidth=f,this._lastWindowHeight=g,this.SetElementVisible(!0),a=null,this._autoFontSize&amp;&amp;(a=d.GetDisplayScale()-.2),this.PostToDOMElement("update-position",{left:Math.round(this._lastRect.getLeft())+e.GetCanvasClientX(),top:Math.round(this._lastRect.getTop())+e.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,f){this.PostToDOMElement("set-css-style",{prop:c.CSSToCamelCase(a),val:f})}SetElementAttribute(a,f){this.PostToDOMElement("set-attribute",
{name:a,val:f})}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 c=self.C3,b=self.IBehavior;c.SDKBehaviorBase=class extends c.DefendedBase{constructor(a){super();this._runtime=a.runtime;this._myObjectClasses=c.New(c.ArraySet);this._myInstances=c.New(c.ArraySet);this._iBehavior=null;if(a=a.scriptInterfaceClass){if(this._iBehavior=new a(this),!(this._iBehavior instanceof b))throw new TypeError("script interface class must derive from IBehavior");}else this._iBehavior=new b(this)}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(){return this._iBehavior}}}"use strict";
{const c=self.C3;c.SDKBehaviorTypeBase=class extends c.DefendedBase{constructor(b){super();this._runtime=b.GetRuntime();this._behaviorType=b;this._objectClass=b.GetObjectClass();this._behavior=b.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 c=self.C3;c.SDKBehaviorInstanceBase=class extends c.DefendedBase{constructor(b,a){super();this._behInst=b;this._domComponentId=a;this._inst=b.GetObjectInstance();this._runtime=b.GetRuntime();this._behaviorType=b.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(b){return this._runtime.Trigger(b,
this._inst,this._behaviorType)}DebugTrigger(b){return this._runtime.DebugTrigger(b,this._inst,this._behaviorType)}TriggerAsync(b){return this._runtime.TriggerAsync(b,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(b,a){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,
b,a)}OnSpriteFrameChanged(b,a){}SaveToJson(){return null}LoadFromJson(b){}GetPropertyValueByIndex(b){}SetPropertyValueByIndex(b,a){}OffsetPropertyValueByIndex(b,a){if(0!==a){var f=this.GetPropertyValueByIndex(b);if("number"!==typeof f)throw Error("expected number");this.SetPropertyValueByIndex(b,f+a)}}SetPropertyColorOffsetValueByIndex(b,a,f,d){}CallAction(b,...a){b.call(this,...a)}CallExpression(b,...a){return b.call(this,...a)}GetScriptInterfaceClass(){return null}}}"use strict";
{const c=self.C3;c.Plugins={};c.Behaviors={};c.PluginManager=class extends c.DefendedBase{constructor(b){super();this._runtime=b;this._allPlugins=[];this._pluginsByCtor=new Map;this._systemPlugin=null;this._allBehaviors=[];this._behaviorsByCtor=new Map;this._jumpthruBehavior=this._solidBehavior=null}CreatePlugin(b){const a=this._runtime.GetObjectReference(b[0]);if(!a)throw Error("missing plugin");c.AddCommonACEs(b,a);b=c.New(a,{runtime:this._runtime,isSingleGlobal:b[1],isWorld:b[2],isRotatable:b[5],
hasEffects:b[8],mustPredraw:b[9],supportsSceneGraph:b[13],supportsMesh:b[14]});b.OnCreate();this._allPlugins.push(b);this._pluginsByCtor.set(a,b)}CreateSystemPlugin(){this._systemPlugin=c.New(c.Plugins.System,{runtime:this._runtime,isSingleGlobal:!0});this._systemPlugin.OnCreate()}CreateBehavior(b){b=this._runtime.GetObjectReference(b[1]);if(!b)throw Error("missing behavior");const a=c.New(b,{runtime:this._runtime});a.OnCreate();this._allBehaviors.push(a);this._behaviorsByCtor.set(b,a);!this._solidBehavior&amp;&amp;
c.Behaviors.solid&amp;&amp;a instanceof c.Behaviors.solid?this._solidBehavior=a:!this._jumpthruBehavior&amp;&amp;c.Behaviors.jumpthru&amp;&amp;a instanceof c.Behaviors.jumpthru&amp;&amp;(this._jumpthruBehavior=a)}GetPluginByConstructorFunction(b){return this._pluginsByCtor.get(b)||null}HasBehaviorByConstructorFunction(b){return this._behaviorsByCtor.has(b)}GetBehaviorByConstructorFunction(b){return this._behaviorsByCtor.get(b)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}}}"use strict";
{const c=self.C3,b=new Set;c.ImageInfo=class extends c.DefendedBase{constructor(){super();this._url="";this._height=this._width=this._offsetY=this._offsetX=this._pixelFormat=this._size=0;this._hasMetaData=!1;this._imageAsset=null;this._textureState="";this._rcTex=c.New(c.Rect);b.add(this)}Release(){this.ReleaseTexture();this._imageAsset=null;b.delete(this)}static OnWebGLContextLost(){for(const a of b)a._textureState="",a._rcTex.set(0,0,0,0)}LoadData(a){this._url=a[0];this._size=a[1];this._pixelFormat=
a[2];this._offsetX=a[3];this._offsetY=a[4];this._width=a[5];this._height=a[6];this._hasMetaData=!0}LoadAnimationFrameData(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._pixelFormat=a[11];this._hasMetaData=!0}LoadDynamicAsset(a,f){if(this._imageAsset)throw Error("already loaded asset");this._url=f;const d={};c.IsAbsoluteURL(f)&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._pixelFormat=a._pixelFormat;this._offsetX=a._offsetX;this._offsetY=a._offsetY;this._width=a._width;this._height=a._height;this._hasMetaData=a._hasMetaData;this._imageAsset=a._imageAsset;this._textureState=a._textureState;this._rcTex=a._rcTex}GetURL(){return this._url}GetSize(){return this._size}GetPixelFormat(){return this._pixelFormat}GetOffsetX(){return this._offsetX}GetOffsetY(){return this._offsetY}GetWidth(){return this._width}GetHeight(){return this._height}GetSheetWidth(){return this._imageAsset.GetWidth()}GetSheetHeight(){return this._imageAsset.GetHeight()}LoadAsset(a,
f){if(this._imageAsset)throw Error("already got asset");f=Object.assign({},f,{url:this.GetURL(),size:this.GetSize()});this._imageAsset=a.LoadImage(f)}IsLoaded(){return this._imageAsset&amp;&amp;this._imageAsset.IsLoaded()}async LoadStaticTexture(a,f){if(!this._imageAsset)throw Error("no asset");if(this._textureState)throw Error("already loaded texture");this._textureState="loading";a=await this._imageAsset.LoadStaticTexture(a,f);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._width,this._offsetY+this._height);this._rcTex.divide(a.GetWidth(),a.GetHeight());return a}ReleaseTexture(){this._textureState&amp;&amp;(this._imageAsset&amp;&amp;this._imageAsset.ReleaseTexture(),this._textureState="",this._rcTex.set(0,0,0,0))}GetTexture(){return this._imageAsset?this._imageAsset.GetTexture():null}GetTexRect(){return this._rcTex}async ExtractImageToCanvas(){const a=
await this._imageAsset.LoadToDrawable(),f=c.CreateCanvas(this._width,this._height);f.getContext("2d").drawImage(a,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height);return f}}}"use strict";
{const c=self.C3;c.AnimationInfo=class extends c.DefendedBase{constructor(b){super();this._name=b[0];this._speed=b[1];this._isLooping=!!b[2];this._repeatCount=b[3];this._repeatTo=b[4];this._isPingPong=!!b[5];this._sid=b[6];this._frames=b[7].map(a=&gt;c.New(c.AnimationFrameInfo,a))}Release(){for(const b of this._frames)b.Release();c.clearArray(this._frames)}LoadAllAssets(b){for(const a of this._frames)a.GetImageInfo().LoadAsset(b)}LoadAllTextures(b,a){return Promise.all(this._frames.map(f=&gt;f.GetImageInfo().LoadStaticTexture(b,
a)))}ReleaseAllTextures(){for(const b of this._frames)b.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(b){b=Math.floor(b);if(0&gt;b||b&gt;=this._frames.length)throw new RangeError("invalid frame");return this._frames[b]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}}}"use strict";
{const c=self.C3;c.AnimationFrameInfo=class extends c.DefendedBase{constructor(b){super();this._imageInfo=c.New(c.ImageInfo);this._imageInfo.LoadAnimationFrameData(b);this._duration=b[6];this._origin=c.New(c.Vector2,b[7],b[8]);this._imagePoints=b[9].map(a=&gt;c.New(c.ImagePoint,this,a));this._imagePointsByName=new Map;for(const a of this._imagePoints)this._imagePointsByName.set(a.GetName().toLowerCase(),a);this._collisionPoly=null;b=b[10];6&lt;=b.length&amp;&amp;(this._collisionPoly=c.New(c.CollisionPoly,b))}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(b){return this._imagePointsByName.get(b.toLowerCase())||null}GetImagePointByIndex(b){b=Math.floor(b);return 0&gt;b||b&gt;=this._imagePoints.length?null:this._imagePoints[b]}GetImagePointCount(){return this._imagePoints.length}}}"use strict";
{const c=self.C3;c.ImagePoint=class extends c.DefendedBase{constructor(b,a){super();this._afi=b;this._name=a[0];this._pos=c.New(c.Vector2,a[1],a[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}}}"use strict";
{const c=self.C3,b=self.C3Debugger,a=self.IObjectClass;c.ObjectClass=class extends c.DefendedBase{constructor(f,d,e){super();const g=f.GetObjectReference(e[1]);this._runtime=f;this._plugin=f.GetPluginManager().GetPluginByConstructorFunction(g);this._sdkType=null;this._instSdkCtor=g.Instance;this._index=d;this._sid=e[11];this._name=e[0];this._jsPropName=this._runtime.GetJsPropName(e[14]);this._isGlobal=!!e[9];this._isFamily=!!e[2];this._isOnLoaderLayout=!!e[10];this._instVars=e[3].map(h=&gt;({sid:h[0],
type:h[1],name:h[2],jsPropName:f.GetJsPropName(h[3])}));this._behaviorsCount=e[4];this._effectsCount=e[5];this._isWorldType=this._plugin.IsWorldType();this._effectList=null;this._collisionGrid=c.New(c.SparseGrid,f.GetOriginalViewportWidth(),f.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=e[8].map(h=&gt;c.BehaviorType.Create(this,h));this._behaviorTypesIncludingInherited=[];this._behaviorsByName=new Map;this._behaviorNameToIndex=new Map;this._usedBehaviorCtors=new Set;this._solStack=c.New(c.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=c.New(c.EffectList,this,e[12]));e[6]&amp;&amp;(this._imageInfo=c.New(c.ImageInfo),this._imageInfo.LoadData(e[6]));if(e[7]){this._animations=e[7].map(h=&gt;c.New(c.AnimationInfo,h));this._animationsByName=new Map;this._animationsBySid=new Map;for(const h of this._animations)this._animationsByName.set(h.GetName().toLowerCase(),h),this._animationsBySid.set(h.GetSID(),h)}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=c.New(g.Type,this,e[15]);this._instanceUserScriptClass=this._iObjectClass=null;this._userScriptDispatcher=c.New(c.Event.Dispatcher);if(d=this._sdkType.GetScriptInterfaceClass()){if(this._iObjectClass=new d(this),!(this._iObjectClass instanceof a))throw new TypeError("script interface class must derive from IObjectClass");
}else this._iObjectClass=new a(this);e[13]&amp;&amp;(d=e[13])&amp;&amp;this._sdkType.LoadTilemapData(d[0],d[1]);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(e))}static Create(f,d,e){return c.New(c.ObjectClass,f,d,e)}Release(){this._imageInfo&amp;&amp;(this._imageInfo.Release(),this._imageInfo=null);if(this._animations){for(const f of this._animations)f.Release();
c.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(f){for(let d=1,e=f.length;d&lt;e;++d){const g=this._runtime.GetObjectClassByIndex(f[d]);this._familyMembers.push(g);this._familyMembersSet.add(g);g._families.push(this);g._familiesSet.add(this)}}_SetContainer(f){this._isInContainer=!0;this._container=f}IsInContainer(){return this._isInContainer}GetContainer(){return this._container}_OnAfterCreate(){var f=
0;if(!this._isFamily)for(var d of this._families)for(var e of d.GetBehaviorTypes()){const l=e.GetName().toLowerCase();this._behaviorsByName.set(l,e);this._behaviorNameToIndex.set(l,f);this._behaviorTypesIncludingInherited.push(e);++f}for(var g of this.GetBehaviorTypes())d=g.GetName().toLowerCase(),this._behaviorsByName.set(d,g),this._behaviorNameToIndex.set(d,f),this._behaviorTypesIncludingInherited.push(g),++f;for(var h of this._behaviorTypesIncludingInherited)this._usedBehaviorCtors.add(h.GetBehavior().constructor);
if(!this._isFamily&amp;&amp;this._families.length){f=this._runtime.GetFamilyCount();c.extendArray(this._familyInstVarMap,f,0);c.extendArray(this._familyBehaviorMap,f,0);c.extendArray(this._familyEffectMap,f,0);f=[];d=h=g=0;for(const l of this._families)if(e=l.GetFamilyIndex(),this._familyInstVarMap[e]=g,g+=l.GetInstanceVariablesCount(),this._familyBehaviorMap[e]=h,h+=l.GetBehaviorTypesCount(),this._familyEffectMap[e]=d,d+=l.GetEffectTypesCount(),(e=l.GetEffectList())&amp;&amp;this._effectList)for(const m of e.GetAllEffectTypes())f.push(m.Clone(this._effectList));
this._effectList&amp;&amp;this._effectList.PrependEffectTypes(f)}}_CreateSingleGlobalInstance(f){const d=this._runtime._GetNewUID(),e=c.New(c.Instance,{runtime:this._runtime,objectType:this,uid:d});e._CreateSdkInstance(f[16],[]);this._runtime._MapInstanceByUID(d,e);this._instances.push(e)}GetSdkType(){return this._sdkType}IsOnLoaderLayout(){return this._isOnLoaderLayout}OnCreate(){this._isFamily||this._sdkType.OnCreate()}HasLoadedTextures(){return 0&lt;this._textureRefCount}LoadTextures(f){if(this._isFamily)return Promise.resolve();
this._textureRefCount++;return 1===this._textureRefCount?this._sdkType.LoadTextures(f)||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(f){return this._isFamily?
Promise.resolve():this._sdkType.PreloadTexturesWithInstances(f)}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(f){return f&amp;&amp;
this._usedBehaviorCtors.has(f)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(f=&gt;f.sid)}GetInstanceVariableIndexBySID(f){return this._instVars.findIndex(d=&gt;d.sid===f)}GetInstanceVariableIndexByName(f){return this._instVars.findIndex(d=&gt;d.name===f)}_GetAllInstanceVariableNames(){return this._instVars.map(f=&gt;f.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(f=&gt;f.jsPropName)}GetInstanceVariableType(f){f=Math.floor(f);
if(0&gt;f||f&gt;=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[f].type}GetInstanceVariableName(f){f=Math.floor(f);if(0&gt;f||f&gt;=this._instVars.length)throw new RangeError("invalid instance variable index");return this._instVars[f].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(f){return this._behaviorsByName.get(f.toLowerCase())||null}GetBehaviorIndexByName(f){f=
this._behaviorNameToIndex.get(f.toLowerCase());return"undefined"===typeof f?-1:f}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(f){this._defaultInstanceData=f}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(f){this._defaultLayerIndex=
f}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(f){return this._familiesSet.has(f)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(f){return this._familyMembersSet.has(f)}GetFamilyBehaviorOffset(f){return this._familyBehaviorMap[f]}GetFamilyInstanceVariableOffset(f){return this._familyInstVarMap[f]}GetAnimationByName(f){if(!this._animations)throw Error("no animations");
return this._animationsByName.get(f.toLowerCase())||null}GetAnimationBySID(f){if(!this._animations)throw Error("no animations");return this._animationsBySid.get(f)||null}GetFirstAnimationFrame(){if(!this._animations)throw Error("no animations");return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const f=this.GetFirstAnimationFrame().GetImageInfo();return[f.GetWidth(),f.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;for(const f of this._runtime._GetInstancesPendingCreate())f.GetObjectClass()===this&amp;&amp;(yield f)}GetInstanceCount(){return this._instances.length}_AddInstance(f){this._instances.push(f)}_SetIIDsStale(){this._iidsStale=!0}_UpdateIIDs(){if(this._iidsStale&amp;&amp;
!this._isFamily){var f=this._instances,d=0;for(let e=f.length;d&lt;e;++d)f[d]._SetIID(d);f=this._runtime._GetInstancesPendingCreate();for(const e of f)e.GetObjectClass()===this&amp;&amp;e._SetIID(d++);this._iidsStale=!1}}GetInstanceByIID(f){var d=this._instances;if(f&lt;d.length)return d[f];f-=d.length;d=this._runtime._GetInstancesPendingCreate();for(const e of d)if(e.GetObjectClass()===this){if(0===f)return e;--f}return null}GetFirstPicked(f){if(f&amp;&amp;f.IsInContainer()&amp;&amp;f.GetObjectClass()!==this)for(const d of f.siblings())if(d.GetObjectClass()===
this)return d;f=this.GetCurrentSol().GetInstances();return f.length?f[0]:null}GetPairedInstance(f){const d=this.GetCurrentSol().GetInstances();return d.length?d[f.GetIID()%d.length]:null}*allCorrespondingInstances(f,d){const e=this.GetCurrentSol().GetInstances();var g=e.length;const h=d.GetCurrentSol(),l=d.GetCurrentSol().GetInstances(),m=l.length;var n=f.GetIID();if(d.IsFamily()||!h.IsSelectAll())n=l.indexOf(f);f=Math.ceil(g/m);g%=m;0===g||n&lt;g?(n*=f,g=f):(n=g*f+(n-g)*(f-1),g=f-1);for(let r=n,q=n+
g;r&lt;q;++r)yield e[r]}FinishCondition(f){this._sdkType.FinishCondition(f)}ApplySolToContainer(){if(this._isInContainer&amp;&amp;!this._isFamily){this._UpdateIIDs();var f=this.GetCurrentSol(),d=f._GetOwnInstances(),e=f.IsSelectAll(),g=this._runtime.GetCurrentEventStackFrame();g=g&amp;&amp;g.GetCurrentEvent()&amp;&amp;g.GetCurrentEvent().IsOrBlock();for(const m of this._container.objectTypes())if(m!==this){m._UpdateIIDs();var h=m.GetCurrentSol();h._SetSelectAll(e);if(!e){var l=h._GetOwnInstances();c.clearArray(l);for(const n of d)l.push(m.GetInstanceByIID(n.GetIID()));
if(g){l=f._GetOwnElseInstances();h=h._GetOwnElseInstances();c.clearArray(h);for(const n of l)h.push(m.GetInstanceByIID(n.GetIID()))}}}}}_TruncateContainerSols(f,d){for(const e of this.GetContainer().objectTypes()){const g=e.GetCurrentSol();f?c.truncateArray(g._GetOwnElseInstances(),d):c.truncateArray(g._GetOwnInstances(),d)}}_GetCollisionCellGrid(){return this._collisionGrid}_SetAnyCollisionCellChanged(f){this._anyCollisionCellChanged=!!f}_SetAnyInstanceParallaxed(f){this._anyInstanceParallaxed=!!f}IsAnyInstanceParallaxed(){return this._anyInstanceParallaxed}_UpdateAllCollisionCells(){if(this._anyCollisionCellChanged&amp;&amp;
this._isWorldType){for(const f of this._instances)f.GetWorldInfo()._UpdateCollisionCell();for(const f of this._runtime._GetInstancesPendingCreate())f.GetObjectClass()===this&amp;&amp;f.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(c.Behaviors.solid)}HasNoSaveBehavior(){return this.UsesBehaviorByCtor(c.Behaviors.NoSave)}HasPersistBehavior(){return this.UsesBehaviorByCtor(c.Behaviors.Persist)}_SaveToJson(){const f=
{instances:this._instances.map(d=&gt;d.SaveToJson())};this._savedData&amp;&amp;this._savedData.size&amp;&amp;(f.ex=c.ToSuperJSON(this._savedData));return f}_LoadFromJson(f){this._savedData&amp;&amp;(this._savedData.clear(),this._savedData=null);var d=f.ex;d&amp;&amp;(this._savedData=c.FromSuperJSON(d));d=this._instances;f=f.instances;for(let e=0,g=Math.min(d.length,f.length);e&lt;g;++e)d[e].LoadFromJson(f[e]);for(let e=f.length,g=d.length;e&lt;g;++e)this._runtime.DestroyInstance(d[e]);for(let e=d.length,g=f.length;e&lt;g;++e){d=f[e];let h=
null;if(this.IsWorldType()&amp;&amp;(h=this._runtime.GetMainRunningLayout().GetLayerBySID(d.w.l),!h))continue;this._runtime.CreateInstanceFromData(this._defaultInstanceData||this,h,!1,0,0,!0).LoadFromJson(d)}this._SetIIDsStale()}GetIObjectClass(){return this._iObjectClass}UserScriptDispatcher(){return this._userScriptDispatcher}_GetUserScriptInstanceClass(){return this._instanceUserScriptClass}_SetUserScriptInstanceClass(f){this._instanceUserScriptClass=f}DispatchUserScriptEvent(f){var d=this._runtime;(d=
d.IsDebug()&amp;&amp;!d.GetEventSheetManager().IsInEventEngine())&amp;&amp;b.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(f);d&amp;&amp;b.AddScriptTime()}}}"use strict";
{const c=self.C3;c.Container=class extends c.DefendedBase{constructor(b,a){super();this._runtime=b;this._objectTypes=a;for(const f of this._objectTypes)f._SetContainer(this)}Release(){this._runtime=null}GetRuntime(){return this._runtime}GetObjectTypes(){return this._objectTypes}objectTypes(){return this._objectTypes}HasAnyWorldType(){return this._objectTypes.some(b=&gt;b.IsWorldType())}}}"use strict";
{const c=self.C3,b=self.C3Debugger,a=self.IInstance,f=[];let d=0;const e=new WeakMap,g=new WeakMap;c.Instance=class extends c.DefendedBase{constructor(h){super();this._runtime=h.runtime;this._objectType=h.objectType;this._iScriptInterface=this._sdkInst=this._worldInfo=null;this._iid=0;this._uid=h.uid;this._puid=d++;this._flags=0;this._behaviorInstances=this._instVarValues=f;var l=this._objectType.GetBehaviorTypesIncludingInherited();0&lt;l.length&amp;&amp;(this._behaviorInstances=l.map((m,n)=&gt;c.New(c.BehaviorInstance,
{runtime:this._runtime,behaviorType:m,instance:this,index:n})));this._siblings=this._objectType.IsInContainer()?[]:null;this._timeScale=-1;this._dispatcher=null;l=this.GetPlugin();l.MustPreDraw()&amp;&amp;(this._flags|=4);if(l.IsWorldType())if(this._worldInfo=c.New(c.WorldInfo,this,h.layer),h.worldData)this._worldInfo.Init(h.worldData);else{this._worldInfo.InitNoData();const [m,n]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(m,n);this.GetObjectClass().UsesEffects()&amp;&amp;this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}h.instVarData?
this._LoadInstanceVariableData(h.instVarData):this._LoadDefaultInstanceVariables()}Release(){this._iScriptInterface&amp;&amp;(this._iScriptInterface._Release(),this._iScriptInterface=null);if(0&lt;this._behaviorInstances.length){for(var h of this._behaviorInstances)h.Release();c.clearArray(this._behaviorInstances)}this._sdkInst.Release();this._sdkInst=null;if(h=e.get(this))h.clear(),e.delete(this);if(h=g.get(this))h.clear(),g.delete(this);this._siblings&amp;&amp;c.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;c.clearArray(this._instVarValues);this._worldInfo&amp;&amp;(this._worldInfo.Release(),this._worldInfo=null)}_LoadInstanceVariableData(h){0&lt;h.length&amp;&amp;(this._instVarValues=[],c.shallowAssignArray(this._instVarValues,h))}_LoadDefaultInstanceVariables(){const h=this._objectType.GetInstanceVariablesCount();if(0!==h){this._instVarValues=[];var l=[0,0,""];for(let m=0;m&lt;h;++m)this._instVarValues.push(l[this._objectType.GetInstanceVariableType(m)])}}_CreateSdkInstance(h,
l){if(this._sdkInst)throw Error("already got sdk instance");for(let m=0,n=this._behaviorInstances.length;m&lt;n;++m)this._behaviorInstances[m]._CreateSdkInstance(l?l[m]:null);this._sdkInst=c.New(this._objectType.GetInstanceSdkCtor(),this,h);if(!(this._sdkInst instanceof c.SDKInstanceBase))throw Error("sdk type must derive from SDKInstanceBase");for(let m=0,n=this._behaviorInstances.length;m&lt;n;++m)this._behaviorInstances[m].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 h=
this._timeScale;return-1===h?this.GetRuntime().GetTimeScale():h}SetTimeScale(h){h=+h;if(0&gt;h||!isFinite(h))h=0;this._timeScale=h}RestoreTimeScale(){this._timeScale=-1}Dispatcher(){this._dispatcher||(this._dispatcher=c.New(c.Event.Dispatcher));return this._dispatcher}Draw(h){this._sdkInst.Draw(h)}OnCreate(h){this._sdkInst.OnCreate(h)}_SetHasTilemap(){this._flags|=2}HasTilemap(){return 0!==(this._flags&amp;2)}_MarkDestroyed(){this._flags|=1}IsDestroyed(){return 0!==(this._flags&amp;1)}MustPreDraw(){return 0!==
(this._flags&amp;4)}_IsSolidEnabled(){return 0!==(this._flags&amp;8)}_SetSolidEnabled(h){this._flags=h?this._flags|8:this._flags&amp;-9}_IsJumpthruEnabled(){return 0!==(this._flags&amp;16)}_SetJumpthruEnabled(h){this._flags=h?this._flags|16:this._flags&amp;-17}SetFlag(h,l){h&lt;&lt;=16;this._flags=l?this._flags|h:this._flags&amp;~h}GetFlag(h){return 0!==(this._flags&amp;h&lt;&lt;16)}GetCurrentImageInfo(){return this._sdkInst.GetCurrentImageInfo()}GetCurrentSurfaceSize(){return this._sdkInst.GetCurrentSurfaceSize()}GetCurrentTexRect(){return this._sdkInst.GetCurrentTexRect()}GetImagePoint(h){return this._sdkInst.GetImagePoint(h)}GetObjectClass(){return this._objectType}BelongsToObjectClass(h){return h.IsFamily()?
h.FamilyHasMember(this.GetObjectClass()):this.GetObjectClass()===h}VerifySupportsSceneGraph(){if(!this.GetPlugin().SupportsSceneGraph())throw Error("object does not support scene graph");}HasParent(){return null!==this.GetParent()}GetParent(){var h=this.GetWorldInfo();return h?(h=h.GetParent())?h.GetInstance():null:null}GetTopParent(){var h=this.GetWorldInfo();return h?(h=h.GetTopParent())?h.GetInstance():null:null}*parents(){const h=this.GetWorldInfo();if(h)for(const l of h.parents())yield l.GetInstance()}HasChildren(){const h=
this.GetWorldInfo();return h?h.HasChildren():!1}GetChildren(){const h=this.GetWorldInfo();return h?h.GetChildren().map(l=&gt;l.GetInstance()):[]}*children(){const h=this.GetWorldInfo();if(h)for(const l of h.children())yield l.GetInstance()}*allChildren(){const h=this.GetWorldInfo();if(h)for(const l of h.allChildren())yield l.GetInstance()}GetChildCount(){const h=this.GetWorldInfo();return h?h.GetChildCount():0}GetChildAt(h){const l=this.GetWorldInfo();return l?(h=l.GetChildAt(h))?h.GetInstance():null:
null}AddChild(h,l){this.VerifySupportsSceneGraph();h.VerifySupportsSceneGraph();this.GetWorldInfo().AddChild(h.GetWorldInfo(),l||{})}RemoveChild(h){const l=this.GetWorldInfo();l&amp;&amp;l.RemoveChild(h.GetWorldInfo())}GetDestroyWithParent(){const h=this.GetWorldInfo();return h?h.GetDestroyWithParent():!1}SetupInitialSceneGraphConnections(){var h=this.GetWorldInfo();if(h&amp;&amp;(h=h.GetSceneGraphChildrenExportData()))for(const l of h)if(h=this._runtime.GetInstanceByUID(l[0])){const m=l[1];this.AddChild(h,{transformX:!!(m&gt;&gt;
0&amp;1),transformY:!!(m&gt;&gt;1&amp;1),transformWidth:!!(m&gt;&gt;2&amp;1),transformHeight:!!(m&gt;&gt;3&amp;1),transformAngle:!!(m&gt;&gt;4&amp;1),destroyWithParent:!!(m&gt;&gt;5&amp;1),transformZElevation:!!(m&gt;&gt;6&amp;1)})}}IsInContainer(){return null!==this._siblings}_AddSibling(h){this._siblings.push(h)}GetSiblings(){return this._siblings}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const h of this.siblings())h.GetObjectClass().GetCurrentSol().SetSinglePicked(h)}_PushSiblingsToSolInstances(){for(const h of this.siblings())h.GetObjectClass().GetCurrentSol()._PushInstance(h)}_SetSiblingsToSolInstancesIndex(h){for(const l of this.siblings())l.GetObjectClass().GetCurrentSol()._GetOwnInstances()[h]=
l}_PushSiblingsToSolElseInstances(){for(const h of this.siblings())h.GetObjectClass().GetCurrentSol()._PushElseInstance(h)}_SetSiblingsToSolElseInstancesIndex(h){for(const l of this.siblings())l.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[h]=l}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(h){this._iid=h}GetIID(){this._objectType._UpdateIIDs();return this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(h){if(!h)return null;
for(const l of this._behaviorInstances)if(l.GetBehavior()instanceof h)return l;return null}GetBehaviorSdkInstanceFromCtor(h){return h?(h=this.GetBehaviorInstanceFromCtor(h))?h.GetSdkInstance():null:null}GetBehaviorIndexBySID(h){const l=this._behaviorInstances;for(let m=0,n=l.length;m&lt;n;++m)if(l[m].GetBehaviorType().GetSID()===h)return m;return-1}GetAllInstanceVariableValues(){return this._instVarValues}_GetAllInstanceVariableNames(){return this._objectType._GetAllInstanceVariableNames()}GetInstanceVariableCount(){return this._instVarValues.length}GetInstanceVariableValue(h){h|=
0;const l=this._instVarValues;if(0&gt;h||h&gt;=l.length)throw new RangeError("invalid instance variable");return l[h]}_GetInstanceVariableValueUnchecked(h){return this._instVarValues[h]}SetInstanceVariableValue(h,l){h|=0;const m=this._instVarValues;if(0&gt;h||h&gt;=m.length)throw new RangeError("invalid instance variable");const n=m[h];if("number"===typeof n)m[h]="number"===typeof l?l:parseFloat(l);else if("boolean"===typeof n)m[h]="boolean"===typeof l?l:!!l;else if("string"===typeof n)m[h]="string"===typeof l?
l:l.toString();else throw Error("unknown instance variable type");}SetInstanceVariableOffset(h,l){if(0!==l){h|=0;var m=this._instVarValues;if(0&gt;h||h&gt;=m.length)throw new RangeError("invalid instance variable");var n=m[h];if("number"===typeof n)m[h]="number"===typeof l?m[h]+l:m[h]+parseFloat(l);else{if("boolean"===typeof n)throw Error("can not set offset of boolean variable");if("string"===typeof n)throw Error("can not set offset of string variable");throw Error("unknown instance variable type");}}}GetSavedDataMap(){let h=
e.get(this);if(h)return h;h=new Map;e.set(this,h);return h}GetUnsavedDataMap(){let h=g.get(this);if(h)return h;h=new Map;g.set(this,h);return h}_HasAnyCreateDestroyHandler(h){const l=this.GetObjectClass();if(l.UserScriptDispatcher().HasAnyHandlerFor(h))return!0;for(const m of l.GetFamilies())if(m.UserScriptDispatcher().HasAnyHandlerFor(h))return!0;return this._runtime.UserScriptDispatcher().HasAnyHandlerFor(h)?!0:!1}_TriggerOnCreated(){if(this._HasAnyCreateDestroyHandler("instancecreate")){const h=
this.GetObjectClass(),l=new c.Event("instancecreate");l.instance=this.GetInterfaceClass();h.DispatchUserScriptEvent(l);for(const m of h.GetFamilies())m.DispatchUserScriptEvent(l);this._runtime.DispatchUserScriptEvent(l)}this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_FireDestroyedScriptEvents(h){if(this._iScriptInterface){var l=new c.Event("destroy");l.isEndingLayout=
h;this.DispatchUserScriptEvent(l)}if(this._HasAnyCreateDestroyHandler("instancedestroy")){l=this.GetObjectClass();var m=new c.Event("instancedestroy");m.instance=this.GetInterfaceClass();m.isEndingLayout=h;l.DispatchUserScriptEvent(m);for(const n of l.GetFamilies())n.DispatchUserScriptEvent(m);this._runtime.DispatchUserScriptEvent(m)}}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(h="full"){const l={};"full"===h?l.uid=this.GetUID():l.c3=!0;if("visual-state"!==h){(h=
e.get(this))&amp;&amp;h.size&amp;&amp;(l.ex=c.ToSuperJSON(h));-1!==this.GetTimeScale()&amp;&amp;(l.mts=this.GetTimeScale());if(0&lt;this._objectType.GetInstanceVariablesCount()){h={};var m=this._objectType.GetInstanceVariableSIDs();for(let r=0,q=this._instVarValues.length;r&lt;q;++r)h[m[r].toString()]=this._instVarValues[r];l.ivs=h}if(this._behaviorInstances.length){h={};for(var n of this._behaviorInstances)(m=n.SaveToJson())&amp;&amp;(h[n.GetBehaviorType().GetSID().toString()]=m);l.behs=h}}this._worldInfo&amp;&amp;(l.w=this._worldInfo._SaveToJson());
(n=this._sdkInst.SaveToJson())&amp;&amp;(l.data=n);return l}LoadFromJson(h,l="full"){if("full"===l)this._uid=h.uid;else if(!h.c3)return;if("visual-state"!==l){var m=e.get(this);m&amp;&amp;(m.clear(),e.delete(this));if(m=h.ex)m=c.FromSuperJSON(m),e.set(this,m);this._timeScale=h.hasOwnProperty("mts")?h.mts:-1;if(m=h.ivs)for(const [q,t]of Object.entries(m))if(m=parseInt(q,10),m=this._objectType.GetInstanceVariableIndexBySID(m),!(0&gt;m||m&gt;=this._instVarValues.length)){var n=t;null===n&amp;&amp;(n=NaN);this._instVarValues[m]=n}}if(this.GetPlugin().IsWorldType()){m=
h.w;var r=m.l;this._worldInfo.GetLayer().GetSID()!==r&amp;&amp;(n=this._worldInfo.GetLayer(),(r=n.GetLayout().GetLayerBySID(r))?(this._worldInfo._SetLayer(r),n._RemoveInstance(this,!0),r._AddInstance(this,!0),r.SetZIndicesChanged(),this._worldInfo.SetBboxChanged()):"full"===l&amp;&amp;this._runtime.DestroyInstance(this));this._worldInfo._LoadFromJson(m)}if("visual-state"!==l&amp;&amp;(l=h.behs))for(const [q,t]of Object.entries(l))l=parseInt(q,10),l=this.GetBehaviorIndexBySID(l),0&gt;l||l&gt;=this._behaviorInstances.length||this._behaviorInstances[l].LoadFromJson(t);
(h=h.data)&amp;&amp;this._sdkInst.LoadFromJson(h)}GetInterfaceClass(){return this._iScriptInterface||this._InitUserScriptInterface()}_InitUserScriptInterface(){var h=this._worldInfo?self.IWorldInstance:a;const l=this._sdkInst.GetScriptInterfaceClass(),m=this._objectType._GetUserScriptInstanceClass(),n=m||l||h;a._Init(this);this._iScriptInterface=new n;a._Init(null);if(l&amp;&amp;!(this._iScriptInterface instanceof h))throw new TypeError(`script interface class '${l.name}' does not extend the right base class '${h.name}'`);
if(m&amp;&amp;(h=l||h,!(this._iScriptInterface instanceof h)))throw new TypeError(`setInstanceClass(): class '${m.name}' does not extend the right base class '${h.name}'`);return this._iScriptInterface}_GetInstVarsScriptDescriptor(h){if(0!==this._instVarValues.length){var l={},m=this._objectType._GetAllInstanceVariableJsPropNames();for(let n=0,r=m.length;n&lt;r;++n)l[m[n]]={configurable:!1,enumerable:!0,get:c.Instance.prototype._GetInstanceVariableValueUnchecked.bind(this,n),set:c.Instance.prototype.SetInstanceVariableValue.bind(this,
n)};l=Object.create(Object.prototype,l);h.instVars={value:l,writable:!1}}}_GetBehaviorsScriptDescriptor(h){var l=this._behaviorInstances;if(0!==l.length){var m={};for(const n of l)m[n.GetBehaviorType().GetJsPropName()]={value:n.GetScriptInterface(),writable:!1};l=Object.create(Object.prototype,m);h.behaviors={value:l,writable:!1}}}DispatchUserScriptEvent(h){h.instance=this.GetInterfaceClass();var l=this._runtime;(l=l.IsDebug()&amp;&amp;!l.GetEventSheetManager().IsInEventEngine())&amp;&amp;b.StartMeasuringScriptTime();
this.GetInterfaceClass().dispatchEvent(h);l&amp;&amp;b.AddScriptTime()}}}"use strict";
{const c=self.C3;c.SceneGraphInfo=class extends c.DefendedBase{constructor(b){super();this._owner=b;this._parent=null;this._children=[];this._myStartWidth=b.GetWidth();this._myStartHeight=b.GetHeight();this._parentStartAngle=0}Release(){this._parent=null;c.clearArray(this._children)}SetParent(b){this._parentStartAngle=(this._parent=b)?b.GetAngle():0}GetParent(){return this._parent}HasChildren(){return 0&lt;this._children.length}GetChildren(){return this._children}_GetStartWidth(){return this._myStartWidth}_GetStartHeight(){return this._myStartHeight}GetParentScaleX(){return this._owner.GetTransformWithParentWidth()?this._parent.GetWidth()/
this._parent._GetSceneGraphInfo()._GetStartWidth():1}GetParentScaleY(){return this._owner.GetTransformWithParentHeight()?this._parent.GetHeight()/this._parent._GetSceneGraphInfo()._GetStartHeight():1}GetParentStartAngle(){return this._parentStartAngle}_SaveToJson(){return{sw:this._myStartWidth,sh:this._myStartHeight,psa:this._parentStartAngle,c:this._children.map(b=&gt;{let a="";b.GetTransformWithParentX()&amp;&amp;(a+="x");b.GetTransformWithParentY()&amp;&amp;(a+="y");b.GetTransformWithParentWidth()&amp;&amp;(a+="w");b.GetTransformWithParentHeight()&amp;&amp;
(a+="h");b.GetTransformWithParentAngle()&amp;&amp;(a+="a");b.GetTransformWithParentZElevation()&amp;&amp;(a+="z");b.GetDestroyWithParent()&amp;&amp;(a+="d");return{uid:b.GetInstance().GetUID(),f:a}})}}_LoadFromJson(b){this._myStartWidth=b.sw;this._myStartHeight=b.sh;this._parentStartAngle=b.psa}_OnAfterLoad(b){const a=this._owner,f=a.GetRuntime();for(const d of b.c){b=f.GetInstanceByUID(d.uid).GetWorldInfo();const e=d.f,g={};g.transformX=e.includes("x");g.transformY=e.includes("y");g.transformWidth=e.includes("w");g.transformHeight=
e.includes("h");g.transformAngle=e.includes("a");g.transformZElevation=e.includes("z");g.destroyWithParent=e.includes("d");a.AddChild(b,g)}}}}"use strict";
{const c=self.C3,b=c.New(c.Rect),a=c.New(c.Quad),f=c.New(c.Event,"bboxchange",!1),d=c.New(c.Color,0,0,0,0),e=c.New(c.CollisionPoly),g=c.New(c.Color,1,1,1,1),h=c.New(c.Rect,0,0,-1,-1),l=c.New(c.Rect,0,0,-1,-1),m=new Set(["absolute","relative"]),n=[];let r=!0;c.WorldInfo=class extends c.DefendedBase{constructor(q,t){super();this._inst=q;this._objectClass=q.GetObjectClass();this._runtime=q.GetRuntime();this._layer=t;this._zIndex=-1;this._flags=98331;this._objectClass.GetPlugin().IsRotatable()&amp;&amp;(this._flags|=
128);this._oy=this._ox=this._cosA=this._sinA=this._a=this._h=this._w=this._zElevation=this._y=this._x=NaN;this._boundingBox=c.New(c.Rect);this._boundingQuad=c.New(c.Quad);this._collisionCells=l;this._renderCells=h;this._solidFilterTags=this._transformedPolyInfo=this._sourceCollisionPoly=null;this._colorPremultiplied=this._color=g;this._instanceEffectList=this._stateGroup=null;this._inst.GetObjectClass().UsesEffects()&amp;&amp;(this._instanceEffectList=c.New(c.InstanceEffectList,this._inst,this));this._sceneGraphInfo=
null;this._sceneGraphFlagsExportData=NaN;this._meshInfo=this._sceneGraphChildrenExportData=null}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 q=
[...this.GetChildren()];for(const t of q)this.RemoveChild(t)}this._ReleaseSceneGraphInfo();this._layer=this._runtime=this._objectClass=this._inst=null}Init(q){r=!1;this.SetXY(q[0],q[1]);this.SetZElevation(q[2]);this.SetSize(q[3],q[4]);this.IsRotatable()?this.SetAngle(q[6]):this._a=0;d.setFromJSON(q[7]);this._SetColor(d);this.SetOriginX(q[8]);this.SetOriginY(q[9]);this.SetBlendMode(q[10]);this._instanceEffectList&amp;&amp;this._instanceEffectList._LoadEffectParameters(q[12]);q[14]&amp;&amp;(this._sceneGraphFlagsExportData=
q[14][0],this._sceneGraphChildrenExportData=q[14][1]);r=!0;this._UpdateRendererStateGroup()}InitNoData(){this._sinA=this._a=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(q){q=+q;
if(this.GetTransformWithParentX()){const t=this._sceneGraphInfo;q-=this.GetX();const u=-this._GetParentOffsetAngle();0===u?this._x+=q/t.GetParentScaleX():(this._x+=Math.cos(u)*q/t.GetParentScaleX(),this.GetTransformWithParentY()&amp;&amp;(this._y+=Math.sin(u)*q/t.GetParentScaleY()))}else this._x=q}OffsetX(q){q=+q;this.GetTransformWithParentX()?this.SetX(this.GetX()+q):this._x+=q}GetX(){if(this.GetTransformWithParentX()){let q=this._x;const t=this._sceneGraphInfo,u=this.GetParent(),w=this._GetParentOffsetAngle();
0===w?q*=t.GetParentScaleX():(q=q*t.GetParentScaleX()*Math.cos(w),this.GetTransformWithParentY()&amp;&amp;(q-=this._y*t.GetParentScaleY()*Math.sin(w)));return u.GetX()+q}return this._x}SetY(q){q=+q;if(this.GetTransformWithParentY()){const t=this._sceneGraphInfo;q-=this.GetY();const u=-this._GetParentOffsetAngle();0===u?this._y+=q/t.GetParentScaleY():(this.GetTransformWithParentX()&amp;&amp;(this._x-=Math.sin(u)*q/t.GetParentScaleX()),this._y+=Math.cos(u)*q/t.GetParentScaleY())}else this._y=q}OffsetY(q){q=+q;this.GetTransformWithParentY()?
this.SetY(this.GetY()+q):this._y+=q}GetY(){if(this.GetTransformWithParentY()){let q=this._y;const t=this._sceneGraphInfo,u=this.GetParent(),w=this._GetParentOffsetAngle();0===w?q*=t.GetParentScaleY():(q=q*t.GetParentScaleY()*Math.cos(w),this.GetTransformWithParentX()&amp;&amp;(q+=this._x*t.GetParentScaleX()*Math.sin(w)));return u.GetY()+q}return this._y}SetXY(q,t){q=+q;t=+t;if(this.GetTransformWithParentXOrY()){const w=this.GetTransformWithParentX(),y=this.GetTransformWithParentY(),C=this._sceneGraphInfo,
G=q-this.GetX(),x=t-this.GetY();var u=-this._GetParentOffsetAngle();if(0===u)this._x=w?this._x+G/C.GetParentScaleX():q,this._y=y?this._y+x/C.GetParentScaleY():t;else{const B=Math.sin(u);u=Math.cos(u);this._x=w?y?this._x+(u*G-B*x)/C.GetParentScaleX():this._x+u*G/C.GetParentScaleX():q;this._y=y?w?this._y+(B*G+u*x)/C.GetParentScaleY():this._y+u*x/C.GetParentScaleY():t}}else this._x=q,this._y=t}OffsetXY(q,t){q=+q;t=+t;this.GetTransformWithParentXOrY()?this.SetXY(this.GetX()+q,this.GetY()+t):(this._x+=
q,this._y+=t)}EqualsXY(q,t){return this.GetX()===q&amp;&amp;this.GetY()===t}SetZElevation(q){q=+q;this.GetTransformWithParentZElevation()&amp;&amp;(q-=this.GetParent().GetZElevation());this._zElevation!==q&amp;&amp;(this._zElevation=q,this._UpdateZElevation(),q=this.GetLayer(),0!==this._zElevation&amp;&amp;q._SetAnyInstanceZElevated(),q.SetZIndicesChanged())}_UpdateZElevation(){this._UpdateRendererStateGroup();if(this.HasChildren()){const q=this.GetChildren();for(let t=0,u=q.length;t&lt;u;t++){const w=q[t];w.GetTransformWithParentZElevation()&amp;&amp;
w._UpdateZElevation()}}}OffsetZElevation(q){this.SetZElevation(this.GetZElevation()+q)}GetZElevation(){return this.GetTransformWithParentZElevation()?this.GetParent().GetZElevation()+this._zElevation:this._zElevation}GetTotalZElevation(){return this.GetLayer().GetZElevation()+this.GetZElevation()}SetWidth(q){q=+q;this.GetTransformWithParentWidth()?this._w*=q/this.GetWidth():this._w=q}OffsetWidth(q){q=+q;this.GetTransformWithParentWidth()?this.SetWidth(this.GetWidth()+q):this._w+=q}GetWidth(){return this.GetTransformWithParentWidth()?
this.GetParent().GetWidth()*this._w:this._w}SetHeight(q){q=+q;this.GetTransformWithParentHeight()?this._h*=q/this.GetHeight():this._h=q}OffsetHeight(q){q=+q;this.GetTransformWithParentHeight()?this.SetHeight(this.GetHeight()+q):this._h+=q}GetHeight(){return this.GetTransformWithParentHeight()?this.GetParent().GetHeight()*this._h:this._h}SetSize(q,t){q=+q;t=+t;this.GetTransformWithParentWidth()?this._w*=q/this.GetWidth():this._w=q;this.GetTransformWithParentHeight()?this._h*=t/this.GetHeight():this._h=
t}GetSceneGraphScale(){if(this.HasParent()){const q=this._sceneGraphInfo;return Math.min(q.GetParentScaleX(),q.GetParentScaleY())}return 1}IsRotatable(){return 0!==(this._flags&amp;128)}SetAngle(q){q=+q;this.IsRotatable()&amp;&amp;(this.GetTransformWithParentAngle()&amp;&amp;(q-=this.GetParent().GetAngle()),q=c.clampAngle(q),this._a!==q&amp;&amp;(this._a=q,this._MarkSinCosAngleChanged()))}OffsetAngle(q){q=+q;0!==q&amp;&amp;this.IsRotatable()&amp;&amp;(this._a=c.clampAngle(this._a+q),this._MarkSinCosAngleChanged())}_MarkSinCosAngleChanged(){this._flags|=
131072;if(this.HasChildren()){const q=this.GetChildren();for(let t=0,u=q.length;t&lt;u;t++)q[t]._MarkSinCosAngleChanged()}}GetAngle(){return this.GetTransformWithParentAngle()?c.clampAngle(this.GetParent().GetAngle()+this._a):this._a}_MaybeUpdateSinCosAngle(){const q=this._flags;if(0!==(q&amp;131072)){var t=this.GetAngle();this._sinA=Math.sin(t);this._cosA=Math.cos(t);this._flags=q&amp;-131073}}GetSinAngle(){this._MaybeUpdateSinCosAngle();return this._sinA}GetCosAngle(){this._MaybeUpdateSinCosAngle();return this._cosA}SetOriginX(q){this._ox=
+q}OffsetOriginX(q){this._ox+=+q}GetOriginX(){return this._ox}SetOriginY(q){this._oy=+q}OffsetOriginY(q){this._oy+=+q}GetOriginY(){return this._oy}_SetColor(q){this._color.equals(q)||(this._color===g?(this._color=c.New(c.Color,q),this._colorPremultiplied=c.New(c.Color,q),this._colorPremultiplied.premultiply()):q.equalsRgba(1,1,1,1)?this._colorPremultiplied=this._color=g:(this._color.set(q),this._colorPremultiplied.set(q),this._colorPremultiplied.premultiply()),this._UpdateRendererStateGroup())}SetOpacity(q){q=
c.clamp(+q,0,1);this._color.a!==q&amp;&amp;(d.copyRgb(this._color),d.a=q,this._SetColor(d))}OffsetOpacity(q){this.SetOpacity(this.GetOpacity()+q)}GetOpacity(){return this._color.a}SetUnpremultipliedColor(q){this._color.equalsIgnoringAlpha(q)||(d.copyRgb(q),d.a=this._color.a,this._SetColor(d))}SetUnpremultipliedColorRGB(q,t,u){d.setRgb(q,t,u);this.SetUnpremultipliedColor(d)}OffsetUnpremultipliedColorRGB(q,t,u){if(0!==q||0!==t||0!==u)d.copyRgb(this._color),d.r+=q,d.g+=t,d.b+=u,this.SetUnpremultipliedColor(d)}GetUnpremultipliedColor(){return this._color}GetPremultipliedColor(){return this._colorPremultiplied}GetDestroyWithParent(){return 0!==
(this._flags&amp;256)}SetDestroyWithParent(q){this._SetFlag(256,q)}GetTransformWithParentX(){return 0!==(this._flags&amp;512)}SetTransformWithParentX(q){this._SetFlag(512,q)}GetTransformWithParentY(){return 0!==(this._flags&amp;1024)}GetTransformWithParentXOrY(){return 0!==(this._flags&amp;1536)}SetTransformWithParentY(q){this._SetFlag(1024,q)}GetTransformWithParentWidth(){return 0!==(this._flags&amp;2048)}SetTransformWithParentWidth(q){this._SetFlag(2048,q)}GetTransformWithParentHeight(){return 0!==(this._flags&amp;4096)}SetTransformWithParentHeight(q){this._SetFlag(4096,
q)}GetTransformWithParentAngle(){return 0!==(this._flags&amp;8192)}SetTransformWithParentAngle(q){this._SetFlag(8192,q)}GetTransformWithParentZElevation(){return 0!==(this._flags&amp;16384)}SetTransformWithParentZElevation(q){this._SetFlag(16384,q)}_ClearAllSceneGraphFlags(){this._flags&amp;=-32513}AddChild(q,t){if(q!==this&amp;&amp;!q.HasParent()&amp;&amp;!this._HasChildRecursive(q)&amp;&amp;!this._HasAnyParent(q)){var u=q.GetX(),w=q.GetY(),y=q.GetWidth(),C=q.GetHeight(),G=q.GetAngle(),x=q.GetZElevation();q._SetParent(this);q.SetTransformWithParentX(t.transformX);
q.SetTransformWithParentY(t.transformY);q.SetTransformWithParentWidth(t.transformWidth);q.SetTransformWithParentHeight(t.transformHeight);q.SetTransformWithParentAngle(t.transformAngle);q.SetTransformWithParentZElevation(t.transformZElevation);q.SetDestroyWithParent(t.destroyWithParent);t.transformX&amp;&amp;(q._x=u-this.GetX());t.transformY&amp;&amp;(q._y=w-this.GetY());t.transformWidth&amp;&amp;(q._w=y/this.GetWidth());t.transformHeight&amp;&amp;(q._h=C/this.GetHeight());t.transformAngle&amp;&amp;(q._a=G-this.GetAngle());t.transformZElevation&amp;&amp;
(q._zElevation=x-this.GetZElevation());this._AddChildToSceneGraphInfo(q);this.SetBboxChanged()}}RemoveChild(q){if(q.GetParent()===this){var t=q.GetX(),u=q.GetY(),w=q.GetWidth(),y=q.GetHeight(),C=q.GetAngle(),G=q.GetZElevation();q._SetParent(null);q._ClearAllSceneGraphFlags();q.SetXY(t,u);q.SetSize(w,y);q.SetAngle(C);q.SetZElevation(G);this._RemoveChildFromSceneGraphInfo(q);this.SetBboxChanged()}}_ResetAllSceneGraphState(){for(var q of this.children())this.RemoveChild(q);(q=this.GetParent())&amp;&amp;q.RemoveChild(this);
this._ClearAllSceneGraphFlags()}HasParent(){return null!==this.GetParent()}GetParent(){const q=this._sceneGraphInfo;return null!==q?q.GetParent():null}GetTopParent(){let q=this;for(;q.HasParent();)q=q.GetParent();return q}*parents(){let q=this.GetParent();for(;q;)yield q,q=q.GetParent()}HasChild(q){return this.GetChildren().includes(q)}HasChildren(){const q=this._sceneGraphInfo;return null!==q?q.HasChildren():!1}GetChildren(){const q=this._sceneGraphInfo;return null!==q?q.GetChildren():n}children(){return this.GetChildren()}*allChildren(){for(const q of this.children())yield q,
yield*q.allChildren()}GetChildCount(){return this.GetChildren().length}GetChildAt(q){const t=this.GetChildren();q=Math.floor(+q);return 0&gt;q||q&gt;=t.length?null:t[q]}_CreateSceneGraphInfo(q){this._sceneGraphInfo||(this._sceneGraphInfo=c.New(c.SceneGraphInfo,this));q&amp;&amp;this._sceneGraphInfo.SetParent(q)}_GetSceneGraphInfo(){return this._sceneGraphInfo}_ReleaseSceneGraphInfo(){this._sceneGraphInfo&amp;&amp;(this._sceneGraphInfo.Release(),this._sceneGraphInfo=null)}_SetParent(q){q?(q._CreateSceneGraphInfo(null),
this._CreateSceneGraphInfo(q)):(this._sceneGraphInfo&amp;&amp;this._sceneGraphInfo.SetParent(null),this.HasChildren()||this._ReleaseSceneGraphInfo())}_HasAnyParent(q){if(!this.HasParent())return!1;const t=this.GetParent();return t===q?!0:t._HasAnyParent(q)}_HasChildRecursive(q){if(this.HasChild(q))return!0;for(const t of this.GetChildren())if(t._HasChildRecursive(q))return!0;return!1}_AddChildToSceneGraphInfo(q){this._sceneGraphInfo.GetChildren().push(q)}_RemoveChildFromSceneGraphInfo(q){const t=this._sceneGraphInfo.GetChildren(),
u=t.indexOf(q);-1!==u&amp;&amp;t.splice(u,1);0!==t.length||this.HasParent()||this._ReleaseSceneGraphInfo();q.HasChildren()||q._ReleaseSceneGraphInfo()}GetSceneGraphChildrenExportData(){return this._sceneGraphChildrenExportData}_UpdateRendererStateGroup(){if(r){var q=this._runtime.GetRenderer();this._stateGroup&amp;&amp;q.ReleaseStateGroup(this._stateGroup);this._stateGroup=q.AcquireStateGroup(q.GetTextureFillShaderProgram()||"&lt;default&gt;",this.GetBlendMode(),this._colorPremultiplied,this.GetZElevation())}}GetRendererStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===
g}SetBlendMode(q){q|=0;if(0&gt;q||31&lt;q)throw new RangeError("invalid blend mode");this.GetBlendMode()!==q&amp;&amp;(this._flags=this._flags&amp;-2080374785|q&lt;&lt;26,this._UpdateRendererStateGroup())}GetBlendMode(){return(this._flags&amp;2080374784)&gt;&gt;26}_SetLayer(q){this._layer=q;0!==this.GetZElevation()&amp;&amp;this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(q){this._zIndex=q|0}GetZIndex(){this._layer._UpdateZIndices();return this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(q,
t){this._flags=t?this._flags|q:this._flags&amp;~q}IsVisible(){return 0!==(this._flags&amp;1)}SetVisible(q){this._SetFlag(1,q)}IsCollisionEnabled(){return 0!==(this._flags&amp;8)}SetCollisionEnabled(q){q=!!q;this.IsCollisionEnabled()!==q&amp;&amp;(this._SetFlag(8,q),q?this.SetBboxChanged():this._RemoveFromCollisionCells())}SetSolidCollisionFilter(q,t){this._SetFlag(32,q);this._solidFilterTags&amp;&amp;this._solidFilterTags.clear();if(t.trim()){this._solidFilterTags||(this._solidFilterTags=new Set);for(const u of t.split(" "))u&amp;&amp;
this._solidFilterTags.add(u.toLowerCase())}else this._solidFilterTags=null}IsSolidCollisionAllowed(q){const t=0!==(this._flags&amp;32),u=this._solidFilterTags;if(!q||!u)return!t;for(const w of u)if(q.has(w))return t;return!t}SetBboxChanged(){this._flags|=32786;this._objectClass._SetAnyCollisionCellChanged(!0);this._runtime.UpdateRender();this._layer.UsesRenderCells()&amp;&amp;(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags&amp;=-3,this._UpdateRenderCell());0!==(this._flags&amp;4)&amp;&amp;this._inst.Dispatcher().dispatchEvent(f);
if(null!==this._sceneGraphInfo){const q=this._sceneGraphInfo.GetChildren();for(let t=0,u=q.length;t&lt;u;++t)q[t].SetBboxChanged()}}CalculateBbox(q,t,u){const w=this.GetX(),y=this.GetY(),C=this.GetWidth(),G=this.GetHeight(),x=this.GetAngle();q.setWH(w-this._ox*C,y-this._oy*G,C,G);u&amp;&amp;this.HasMesh()&amp;&amp;this._ExpandBboxForMesh(q);0===x?t.setFromRect(q):(q.offset(-w,-y),t.setFromRotatedRectPrecalc(q,this.GetSinAngle(),this.GetCosAngle()),t.offset(w,y),t.getBoundingBox(q));q.normalize()}_UpdateBbox(){const q=
this._flags;0!==(q&amp;2)&amp;&amp;(this.CalculateBbox(this._boundingBox,this._boundingQuad,!0),this._flags=q&amp;-3)}GetBoundingBox(){this._UpdateBbox();return this._boundingBox}GetBoundingQuad(){this._UpdateBbox();return this._boundingQuad}PixelRoundQuad(q){var t=this.GetX(),u=this.GetY();t=Math.round(t)-t;u=Math.round(u)-u;if(0===t&amp;&amp;0===u)return q;a.copy(q);a.offset(t,u);return a}OverwriteBoundingBox(q){this._boundingBox.copy(q);this._boundingQuad.setFromRect(this._boundingBox);this._flags&amp;=-3;this._UpdateCollisionCell();
this._UpdateRenderCell()}SetBboxChangeEventEnabled(q){this._SetFlag(4,q)}IsBboxChangeEventEnabled(){return 0!==(this._flags&amp;4)}IsInViewport(q){return 0===this.GetZElevation()?q.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const q=this.GetLayer(),t=this.GetTotalZElevation();if(t&gt;=q.GetCameraZ())return!1;q.GetViewportForZ(t,b);return b.intersectsRect(this.GetBoundingBox())}SetSourceCollisionPoly(q){this._sourceCollisionPoly=q;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(q,t,u){let w=0,y=1;0!==u&amp;&amp;(w=Math.sin(u),y=Math.cos(u));return this._GetCustomTransformedCollisionPolyPrecalc(q,
t,u,w,y)}_GetCustomTransformedCollisionPolyPrecalc(q,t,u,w,y){let C=this._transformedPolyInfo;null===C&amp;&amp;(this._transformedPolyInfo=C={poly:c.New(c.CollisionPoly),width:NaN,height:NaN,angle:NaN});const G=C.poly;if(C.width===q&amp;&amp;C.height===t&amp;&amp;C.angle===u)return G;const x=this._sourceCollisionPoly;if(this.HasMesh()){const B=this.GetOriginX(),H=this.GetOriginY(),P=this.GetSourceMesh();let E=this._meshInfo.meshPoly;E||(x?(e.copy(x),e.offset(B,H)):e.setDefaultPoints(),E=P.InsertPolyMeshVertices(e),this._meshInfo.meshPoly=
E);P.TransformCollisionPoly(E,G);G.offset(-B,-H);G.transformPrecalc(q,t,w,y)}else x?(G.copy(x),G.transformPrecalc(q,t,w,y)):G.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY());C.width=q;C.height=t;C.angle=u;return G}_DiscardTransformedCollisionPoly(){this.SetPhysicsBodyChanged(!0);const q=this._transformedPolyInfo;null!==q&amp;&amp;(q.width=NaN)}CreateMesh(q,t){q=Math.floor(q);t=Math.floor(t);if(!this.GetInstance().GetPlugin().SupportsMesh())throw Error("object does not support mesh");this.ReleaseMesh();
this._meshInfo={sourceMesh:c.New(c.Gfx.Mesh,q,t),transformedMesh:c.New(c.Gfx.Mesh,q,t),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(q){this._SetFlag(32768,q)}IsMeshChanged(){return 0!==(this._flags&amp;32768)}SetPhysicsBodyChanged(q){this._SetFlag(65536,q)}IsPhysicsBodyChanged(){return 0!==
(this._flags&amp;65536)}_ExpandBboxForMesh(q){var t=this._meshInfo.sourceMesh;const u=Math.min(t.GetMinX(),0),w=Math.min(t.GetMinY(),0),y=Math.max(t.GetMaxX(),1);t=Math.max(t.GetMaxY(),1);const C=q.width(),G=q.height();q.offsetLeft(u*C);q.offsetTop(w*G);q.offsetRight((y-1)*C);q.offsetBottom((t-1)*G)}ReleaseMesh(){this._meshInfo&amp;&amp;(this._meshInfo.sourceMesh.Release(),this._meshInfo.transformedMesh.Release(),this._meshInfo=null,this._DiscardTransformedCollisionPoly())}SetMeshPoint(q,t,u){q=Math.floor(q);
t=Math.floor(t);var w=u.mode||"absolute";if(!m.has(w))throw Error("invalid mode");w="relative"===w;let y=u.x,C=u.y,G="number"===typeof u.u?u.u:w?0:-1;u="number"===typeof u.v?u.v:w?0:-1;if(!this.HasMesh())return!1;const x=this.GetSourceMesh(),B=x.GetMeshPointAt(q,t);if(null===B)return!1;w&amp;&amp;(y+=q/(x.GetHSize()-1),C+=t/(x.GetVSize()-1));-1!==G||w?(w&amp;&amp;(G+=q/(x.GetHSize()-1)),G=c.clamp(G,0,1)):G=B.GetU();-1!==u||w?(w&amp;&amp;(u+=t/(x.GetVSize()-1)),u=c.clamp(u,0,1)):u=B.GetV();if(B.GetX()===y&amp;&amp;B.GetY()===C&amp;&amp;
B.GetU()===G&amp;&amp;B.GetV()===u)return!1;B.SetX(y);B.SetY(C);B.SetU(G);B.SetV(u);this._DiscardTransformedCollisionPoly();return!0}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(q,t){return this.GetBoundingBox().containsPoint(q,t)&amp;&amp;this.GetBoundingQuad().containsPoint(q,t)?this.HasTilemap()?this._inst.GetSdkInstance().TestPointOverlapTile(q,t):this.HasOwnCollisionPoly()?this.GetTransformedCollisionPoly().containsPoint(q-this.GetX(),t-this.GetY()):!0:!1}_IsCollisionCellChanged(){return 0!==(this._flags&amp;
16)}_UpdateCollisionCell(){if(this._IsCollisionCellChanged()&amp;&amp;this.IsCollisionEnabled()){var q=this.GetBoundingBox(),t=this._objectClass._GetCollisionCellGrid(),u=this._collisionCells;b.set(t.XToCell(q.getLeft()),t.YToCell(q.getTop()),t.XToCell(q.getRight()),t.YToCell(q.getBottom()));u.equals(b)||(q=this._inst,u===l?(t.Update(q,null,b),this._collisionCells=c.New(c.Rect,b)):(t.Update(q,u,b),u.copy(b)),this._flags&amp;=-17)}}_RemoveFromCollisionCells(){const q=this._collisionCells;q!==l&amp;&amp;(this._objectClass._GetCollisionCellGrid().Update(this._inst,
q,null),this._collisionCells=l)}_UpdateRenderCell(){const q=this.GetLayer();if(q.UsesRenderCells()){var t=q.GetRenderGrid(),u=this.GetBoundingBox(),w=this._renderCells;b.set(t.XToCell(u.getLeft()),t.YToCell(u.getTop()),t.XToCell(u.getRight()),t.YToCell(u.getBottom()));w.equals(b)||(u=this._inst,w===h?(t.Update(u,null,b),this._renderCells=c.New(c.Rect,b)):(t.Update(u,w,b),w.copy(b)),q.SetRenderListStale())}}_RemoveFromRenderCells(){const q=this._renderCells;q!==h&amp;&amp;(this.GetLayer().GetRenderGrid().Update(this._inst,
q,null),this._renderCells=h)}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const q=this._inst,t=this._layer,u=t._GetInstances();u.length&amp;&amp;u[u.length-1]===q||(t._RemoveInstance(q,!1),t._AddInstance(q,!1),this._runtime.UpdateRender())}ZOrderMoveToBottom(){const q=this._inst,t=this._layer,u=t._GetInstances();u.length&amp;&amp;u[0]===q||(t._RemoveInstance(q,!1),t._PrependInstance(q,!1),this._runtime.UpdateRender())}ZOrderMoveToLayer(q){const t=this._inst,u=this._layer;if(u.GetLayout()!==q.GetLayout())throw Error("layer from different layout");
q!==u&amp;&amp;(u._RemoveInstance(t,!0),this._SetLayer(q),q._AddInstance(t,!0),this._runtime.UpdateRender())}ZOrderMoveAdjacentToInstance(q,t){const u=this._inst,w=this._layer;if(q.GetUID()!==u.GetUID()){var y=q.GetWorldInfo();if(!y)throw Error("expected world instance");var C=y.GetLayer();y=!1;w.GetIndex()!==C.GetIndex()&amp;&amp;(w._RemoveInstance(u,!0),this._SetLayer(C),C._AddInstance(u,!0),y=!0);q=C.MoveInstanceAdjacent(u,q,!!t);(y||q)&amp;&amp;this._runtime.UpdateRender()}}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(q){this._SetFlag(64,
q)}HasAnyActiveEffect(){return 0!==(this._flags&amp;64)}_SaveToJson(){const q={x:this.GetX(),y:this.GetY(),w:this.GetWidth(),h:this.GetHeight(),l:this.GetLayer().GetSID(),zi:this.GetZIndex()};0!==this.GetZElevation()&amp;&amp;(q.ze=this.GetZElevation());0!==this.GetAngle()&amp;&amp;(q.a=this.GetAngle());this.HasDefaultColor()||(q.c=this._color.toJSON());.5!==this.GetOriginX()&amp;&amp;(q.oX=this.GetOriginX());.5!==this.GetOriginY()&amp;&amp;(q.oY=this.GetOriginY());0!==this.GetBlendMode()&amp;&amp;(q.bm=this.GetBlendMode());this.IsVisible()||
(q.v=this.IsVisible());this.IsCollisionEnabled()||(q.ce=this.IsCollisionEnabled());this.IsBboxChangeEventEnabled()&amp;&amp;(q.be=this.IsBboxChangeEventEnabled());this._instanceEffectList&amp;&amp;(q.fx=this._instanceEffectList._SaveToJson());const t=0!==(this._flags&amp;32);t&amp;&amp;(q.sfi=t);this._solidFilterTags&amp;&amp;(q.sft=[...this._solidFilterTags].join(" "));this._sceneGraphInfo&amp;&amp;(q.sgi=this._sceneGraphInfo._SaveToJson());return q}_LoadFromJson(q){r=!1;this._ResetAllSceneGraphState();this.SetX(q.x);this.SetY(q.y);this.SetWidth(q.w);
this.SetHeight(q.h);this._SetZIndex(q.zi);this.SetZElevation(q.hasOwnProperty("ze")?q.ze:0);this.SetAngle(q.hasOwnProperty("a")?q.a:0);q.hasOwnProperty("c")?d.setFromJSON(q.c):q.hasOwnProperty("o")?(d.copyRgb(this._color),d.a=q.o):d.setRgba(1,1,1,1);this._SetColor(d);this.SetOriginX(q.hasOwnProperty("oX")?q.oX:.5);this.SetOriginY(q.hasOwnProperty("oY")?q.oY:.5);this.SetBlendMode(q.hasOwnProperty("bm")?q.bm:0);this.SetVisible(q.hasOwnProperty("v")?q.v:!0);this.SetCollisionEnabled(q.hasOwnProperty("ce")?
q.ce:!0);this.SetBboxChangeEventEnabled(q.hasOwnProperty("be")?q.be:!1);this.SetSolidCollisionFilter(q.hasOwnProperty("sfi")?q.sfi:!1,q.hasOwnProperty("sft")?q.sft:"");this._instanceEffectList&amp;&amp;q.hasOwnProperty("fx")&amp;&amp;this._instanceEffectList._LoadFromJson(q.fx);if(q.hasOwnProperty("sgi")){this._CreateSceneGraphInfo(null);const t=this._sceneGraphInfo,u=q.sgi;t._LoadFromJson(u);const w=this.GetRuntime().Dispatcher(),y=()=&gt;{w.removeEventListener("afterload",y);t._OnAfterLoad(u)};w.addEventListener("afterload",
y)}this.SetBboxChanged();r=!0;this._UpdateRendererStateGroup()}}}"use strict";
{const c=self.C3;c.BehaviorType=class extends c.DefendedBase{constructor(b,a){super();const f=b.GetRuntime(),d=f.GetPluginManager(),e=f.GetObjectReference(a[1]);d.HasBehaviorByConstructorFunction(e)||d.CreateBehavior(a);this._runtime=f;this._objectClass=b;this._behavior=d.GetBehaviorByConstructorFunction(e);this._sdkType=null;this._instSdkCtor=e.Instance;this._sid=a[2];this._name=a[0];this._jsPropName=this._runtime.GetJsPropName(a[3]);this._sdkType=c.New(e.Type,this);this.OnCreate()}static Create(b,
a){return c.New(c.BehaviorType,b,a)}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 c=self.C3,b=self.IBehaviorInstance;c.BehaviorInstance=class extends c.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=c.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,
f){this._sdkInst.OnSpriteFrameChanged(a,f)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(a){return this._sdkInst.LoadFromJson(a)}static SortByTickSequence(a,f){var d=a.GetObjectInstance(),e=f.GetObjectInstance();const g=d.GetObjectClass().GetIndex(),h=e.GetObjectClass().GetIndex();if(g!==h)return g-h;d=d.GetPUID();e=e.GetPUID();return d!==e?d-e:a.GetBehaviorInstance()._GetIndex()-f.GetBehaviorInstance()._GetIndex()}_InitScriptInterface(){const a=
this._sdkInst.GetScriptInterfaceClass(),f=a||b;b._Init(this);this._iScriptInterface=new f;b._Init(null);if(a&amp;&amp;!(this._iScriptInterface instanceof b))throw new TypeError(`script interface class '${a.name}' does not extend the right base class '${b.name}'`);}GetScriptInterface(){return this._iScriptInterface}}}"use strict";
{const c=self.C3;c.EffectList=class extends c.DefendedBase{constructor(b,a){super();this._owner=b;this._allEffectTypes=[];this._activeEffectTypes=[];this._effectTypesByName=new Map;this._effectParams=[];this._preservesOpaqueness=!0;for(const f of a)b=c.New(c.EffectType,this,f,this._allEffectTypes.length),this._allEffectTypes.push(b),this._effectTypesByName.set(b.GetName().toLowerCase(),b),3&lt;=f.length&amp;&amp;this._effectParams.push(this._LoadSingleEffectParameters(f[2]));this.GetRuntime()._AddEffectList(this)}Release(){c.clearArray(this._allEffectTypes);
c.clearArray(this._activeEffectTypes);this._effectTypesByName.clear();c.clearArray(this._effectParams);this._owner=null}PrependEffectTypes(b){if(b.length){this._allEffectTypes=b.concat(this._allEffectTypes);for(const a of b)this._effectTypesByName.set(a.GetName().toLowerCase(),a);for(let a=0,f=this._allEffectTypes.length;a&lt;f;++a)this._allEffectTypes[a]._SetIndex(a)}}_LoadSingleEffectParameters(b){b=b.slice(0);for(let a=0,f=b.length;a&lt;f;++a){const d=b[a];if(Array.isArray(d)){const e=c.New(c.Color);
e.setFromJSON(d);b[a]=e}}return b}GetOwner(){return this._owner}GetRuntime(){return this._owner.GetRuntime()}UpdateActiveEffects(){c.clearArray(this._activeEffectTypes);let b=!0;for(const a of this._allEffectTypes)a.IsActive()&amp;&amp;(this._activeEffectTypes.push(a),a.GetShaderProgram().PreservesOpaqueness()||(b=!1));this._preservesOpaqueness=b}GetAllEffectTypes(){return this._allEffectTypes}HasAnyEffectType(){return 0&lt;this._allEffectTypes.length}GetEffectTypeByName(b){return this._effectTypesByName.get(b.toLowerCase())||
null}GetEffectTypeByIndex(b){b=Math.floor(+b);if(0&gt;b||b&gt;=this._allEffectTypes.length)throw new RangeError("invalid effect type index");return this._allEffectTypes[b]}IsEffectIndexActive(b){return this.GetEffectTypeByIndex(b).IsActive()}SetEffectIndexActive(b,a){this.GetEffectTypeByIndex(b).SetActive(a)}GetActiveEffectTypes(){return this._activeEffectTypes}HasAnyActiveEffect(){return 0&lt;this._activeEffectTypes.length}PreservesOpaqueness(){return this._preservesOpaqueness}GetEffectParametersForIndex(b){return this._effectParams[b]}static SaveFxParamToJson(b){return b&amp;&amp;
b instanceof c.Color?{t:"color",v:b.toJSON()}:b}static LoadFxParamFromJson(b){if("object"===typeof b){if("color"===b.t){const a=c.New(c.Color);a.setFromJSON(b.v);return a}throw Error("invalid effect parameter type");}return b}static SaveFxParamsToJson(b){return b.map(c.EffectList.SaveFxParamToJson)}static LoadFxParamsFromJson(b){return b.map(c.EffectList.LoadFxParamFromJson)}SaveToJson(){return this._allEffectTypes.map(b=&gt;({name:b.GetName(),active:b.IsActive(),params:c.EffectList.SaveFxParamsToJson(this._effectParams[b.GetIndex()])}))}LoadFromJson(b){for(const a of b)if(b=
this.GetEffectTypeByName(a.name))b.SetActive(a.active),this._effectParams[b.GetIndex()]=c.EffectList.LoadFxParamsFromJson(a.params);this.UpdateActiveEffects()}}}"use strict";
{const c=self.C3;c.EffectType=class extends c.DefendedBase{constructor(b,a,f){super();this._effectList=b;this._id=a[0];this._name=a[1];this._index=f;this._shaderProgram=null;this._isActive=!0}Release(){this._shaderProgram=this._effectList=null}Clone(b){b=c.New(c.EffectType,b,[this._id,this._name],-1);b._shaderProgram=this._shaderProgram;b._isActive=this._isActive;return b}_InitRenderer(b){b=b.GetShaderProgramByName(this._id);if(!b)throw Error("failed to find shader program '"+this._id+"'");this._shaderProgram=
b}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(b){this._index=b}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(b){this._isActive=!!b}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const b=[];for(let a=0,f=this._shaderProgram.GetParameterCount();a&lt;f;++a){const d=this._shaderProgram.GetParameterType(a);if("float"===d||"percent"===
d)b.push(0);else if("color"===d)b.push(c.New(c.Color,1,1,1,1));else throw new TypeError("unknown effect parameter type");}return b}}}"use strict";
{const c=self.C3;c.InstanceEffectList=class extends c.DefendedBase{constructor(b,a,f){super();this._inst=b;this._wi=a;this._effectList=b.GetObjectClass().GetEffectList();this._activeEffectFlags=[];this._activeEffectTypes=[];this._preservesOpaqueness=!0;this._effectParams=[];for(const d of this._effectList.GetAllEffectTypes())this._activeEffectFlags.push(!0);this.UpdateActiveEffects()}Release(){c.clearArray(this._activeEffectFlags);c.clearArray(this._activeEffectTypes);c.clearArray(this._effectParams);
this._effectList=this._inst=null}_LoadEffectParameters(b){for(const a of b)this._effectParams.push(this._LoadSingleEffectParameters(a))}_LoadSingleEffectParameters(b){b=b.slice(0);for(let a=0,f=b.length;a&lt;f;++a){const d=b[a];if(Array.isArray(d)){const e=c.New(c.Color);e.setFromJSON(d);b[a]=e}}return b}LoadDefaultEffectParameters(){for(const b of this._effectList.GetAllEffectTypes())this._effectParams.push(b.GetDefaultParameterValues())}GetOwner(){return this._owner}GetEffectList(){return this._effectList}GetRuntime(){return this._inst.GetRuntime()}UpdateActiveEffects(){c.clearArray(this._activeEffectTypes);
const b=this._effectList.GetAllEffectTypes(),a=this._activeEffectTypes,f=this._activeEffectFlags;let d=!0;for(let e=0,g=b.length;e&lt;g;++e)if(f[e]){const h=b[e];a.push(h);h.GetShaderProgram().PreservesOpaqueness()||(d=!1)}this._preservesOpaqueness=d;this._wi._SetHasAnyActiveEffect(!!a.length)}GetActiveEffectTypes(){return this._activeEffectTypes}GetEffectParametersForIndex(b){return this._effectParams[b]}PreservesOpaqueness(){return this._preservesOpaqueness}HasAnyActiveBackgroundBlendingEffect(){return this._activeEffectTypes.some(b=&gt;
b.GetShaderProgram().UsesDest())}IsEffectIndexActive(b){return this._activeEffectFlags[b]}SetEffectIndexActive(b,a){this._activeEffectFlags[b]=!!a}GetAllEffectTypes(){return this._effectList.GetAllEffectTypes()}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(b=&gt;({name:b.GetName(),active:this._activeEffectFlags[b.GetIndex()],params:c.EffectList.SaveFxParamsToJson(this._effectParams[b.GetIndex()])}))}_LoadFromJson(b){for(const a of b)if(b=this._effectList.GetEffectTypeByName(a.name))this._activeEffectFlags[b.GetIndex()]=
a.active,this._effectParams[b.GetIndex()]=c.EffectList.LoadFxParamsFromJson(a.params);this.UpdateActiveEffects()}}}"use strict";
{const c=self.C3,b=[],a=[],f=[],d=c.New(c.CollisionPoly),e=c.New(c.CollisionPoly),g=c.New(c.Quad),h=c.New(c.Rect),l=c.New(c.Rect);c.CollisionEngine=class extends c.DefendedBase{constructor(m){super();this._runtime=m;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(m,n){const r=m.GetWorldInfo(),q=n.GetWorldInfo();r&amp;&amp;q&amp;&amp;r.IsCollisionEnabled()&amp;&amp;q.IsCollisionEnabled()&amp;&amp;this._registeredCollisions.push([m,n])}AddRegisteredCollisionCandidates(m,n,r){for(const [q,t]of this._registeredCollisions){let u;if(m===q)u=t;else if(m===t)u=q;else continue;u.BelongsToObjectClass(n)&amp;&amp;(r.includes(u)||r.push(u))}}CheckRegisteredCollision(m,
n){if(!this._registeredCollisions.length)return!1;for(const [r,q]of this._registeredCollisions)if(m===r&amp;&amp;n===q||m===q&amp;&amp;n===r)return!0;return!1}ClearRegisteredCollisions(){c.clearArray(this._registeredCollisions)}TestOverlap(m,n){if(!m||!n||m===n)return!1;m=m.GetWorldInfo();n=n.GetWorldInfo();if(!m.IsCollisionEnabled()||!n.IsCollisionEnabled())return!1;this._collisionCheckCount++;const r=m.GetLayer(),q=n.GetLayer();return r.IsTransformCompatibleWith(q)?this._TestOverlap_SameLayers(m,n):this._TestOverlap_DifferentLayers(m,
n)}_TestOverlap_SameLayers(m,n){if(!m.GetBoundingBox().intersectsRect(n.GetBoundingBox()))return!1;this._polyCheckCount++;if(!m.GetBoundingQuad().intersectsQuad(n.GetBoundingQuad())||m.HasTilemap()&amp;&amp;n.HasTilemap())return!1;if(m.HasTilemap())return this.TestTilemapOverlap(m,n);if(n.HasTilemap())return this.TestTilemapOverlap(n,m);if(!m.HasOwnCollisionPoly()&amp;&amp;!n.HasOwnCollisionPoly())return!0;const r=m.GetTransformedCollisionPoly(),q=n.GetTransformedCollisionPoly();return r.intersectsPoly(q,n.GetX()-
m.GetX(),n.GetY()-m.GetY())}_TestOverlap_DifferentLayers(m,n){var r=m.GetLayer();const q=n.GetLayer();d.copy(m.GetTransformedCollisionPoly());e.copy(n.GetTransformedCollisionPoly());var t=d.pointsArr();for(let u=0,w=t.length;u&lt;w;u+=2){const y=u+1,C=t[y],[G,x]=r.LayerToCanvasCss(t[u]+m.GetX(),C+m.GetY());t[u]=G;t[y]=x}m=e.pointsArr();for(let u=0,w=m.length;u&lt;w;u+=2){r=u+1;t=m[r];const [y,C]=q.LayerToCanvasCss(m[u]+n.GetX(),t+n.GetY());m[u]=y;m[r]=C}d.setBboxChanged();e.setBboxChanged();this._polyCheckCount++;
return d.intersectsPoly(e,0,0)}TestTilemapOverlap(m,n){const r=n.GetBoundingBox(),q=m.GetX(),t=m.GetY();var u=m.GetInstance().GetSdkInstance();m=n.GetX();const w=n.GetY(),y=n.HasOwnCollisionPoly(),C=n.GetBoundingQuad();u.GetCollisionRectCandidates(r,a);for(let B=0,H=a.length;B&lt;H;++B){var G=a[B];u=G.GetRect();this._collisionCheckCount++;if(r.intersectsRectOffset(u,q,t)&amp;&amp;(g.setFromRect(u),g.offset(q,t),g.intersectsQuad(C)))if(y){var x=n.GetTransformedCollisionPoly();if(G=G.GetPoly()){if(this._polyCheckCount++,
G.intersectsPoly(x,m-(q+u.getLeft()),w-(t+u.getTop())))return c.clearArray(a),!0}else if(d.setFromQuad(g,0,0),d.intersectsPoly(x,m,w))return c.clearArray(a),!0}else if(x=G.GetPoly()){if(d.setFromQuad(C,0,0),x.intersectsPoly(d,-(q+u.getLeft()),-(t+u.getTop())))return c.clearArray(a),!0}else return c.clearArray(a),!0}c.clearArray(a);return!1}TestAndSelectCanvasPointOverlap(m,n,r,q){const t=m.GetCurrentSol();var u=this._runtime.GetCurrentEvent();if(!u)throw Error("cannot call outside event");u=u.IsOrBlock();
if(t.IsSelectAll()){q||(t._SetSelectAll(!1),c.clearArray(t._GetOwnInstances()));for(var w of m.GetInstances()){var y=w.GetWorldInfo(),C=y.GetLayer();const [G,x]=C.CanvasCssToLayer(n,r,y.GetTotalZElevation());if(y.ContainsPoint(G,x)){if(q)return!1;t._PushInstance(w)}else u&amp;&amp;t._PushElseInstance(w)}}else{w=u?t._GetOwnElseInstances():t._GetOwnInstances();y=0;for(let G=0,x=w.length;G&lt;x;++G){C=w[G];const B=C.GetWorldInfo(),H=B.GetLayer(),[P,E]=H.CanvasCssToLayer(n,r,B.GetTotalZElevation());if(B.ContainsPoint(P,
E)){if(q)return!1;u?t._PushInstance(C):w[y++]=C}else u&amp;&amp;(w[y++]=C)}q||(w.length=y)}m.ApplySolToContainer();return q?!0:t.HasAnyInstances()}GetCollisionCandidates(m,n,r,q){m=m?1!==m.GetParallaxX()||1!==m.GetParallaxY():!1;if(n.IsFamily())for(const t of n.GetFamilyMembers())m||t.IsAnyInstanceParallaxed()?c.appendArray(q,t.GetInstances()):(t._UpdateAllCollisionCells(),t._GetCollisionCellGrid().QueryRange(r,q));else m||n.IsAnyInstanceParallaxed()?c.appendArray(q,n.GetInstances()):(n._UpdateAllCollisionCells(),
n._GetCollisionCellGrid().QueryRange(r,q))}GetObjectClassesCollisionCandidates(m,n,r,q){for(const t of n)this.GetCollisionCandidates(m,t,r,q)}GetSolidCollisionCandidates(m,n,r){const q=this._runtime.GetSolidBehavior();q&amp;&amp;this.GetObjectClassesCollisionCandidates(m,q.GetObjectClasses(),n,r)}GetJumpthruCollisionCandidates(m,n,r){const q=this._runtime.GetJumpthruBehavior();q&amp;&amp;this.GetObjectClassesCollisionCandidates(m,q.GetObjectClasses(),n,r)}IsSolidCollisionAllowed(m,n){return m._IsSolidEnabled()&amp;&amp;
(!n||n.GetWorldInfo().IsSolidCollisionAllowed(m.GetSavedDataMap().get("solidTags")))}TestOverlapSolid(m){const n=m.GetWorldInfo();this.GetSolidCollisionCandidates(n.GetLayer(),n.GetBoundingBox(),b);for(const r of b)if(this.IsSolidCollisionAllowed(r,m)&amp;&amp;this.TestOverlap(m,r))return c.clearArray(b),r;c.clearArray(b);return null}TestRectOverlapSolid(m,n){this.GetSolidCollisionCandidates(null,m,b);for(const r of b)if(this.IsSolidCollisionAllowed(r,n)&amp;&amp;this.TestRectOverlap(m,r))return c.clearArray(b),
r;c.clearArray(b);return null}TestOverlapJumpthru(m,n){let r=null;n&amp;&amp;(r=f,c.clearArray(r));const q=m.GetWorldInfo();this.GetJumpthruCollisionCandidates(q.GetLayer(),q.GetBoundingBox(),b);for(const t of b)if(t._IsJumpthruEnabled()&amp;&amp;this.TestOverlap(m,t))if(n)r.push(t);else return c.clearArray(b),t;c.clearArray(b);return r}PushOut(m,n,r,q,t){q=q||50;const u=m.GetWorldInfo(),w=u.GetX(),y=u.GetY();for(let C=0;C&lt;q;++C)if(u.SetXY(w+n*C,y+r*C),u.SetBboxChanged(),!this.TestOverlap(m,t))return!0;u.SetXY(w,
y);u.SetBboxChanged();return!1}PushOutSolid(m,n,r,q,t,u){q=q||50;const w=m.GetWorldInfo(),y=w.GetX(),C=w.GetY();let G=null,x=null;for(let B=0;B&lt;q;++B)if(w.SetXY(y+n*B,C+r*B),w.SetBboxChanged(),!this.TestOverlap(m,G))if(G=this.TestOverlapSolid(m))x=G;else if(t&amp;&amp;(G=u?this.TestOverlap(m,u)?u:null:this.TestOverlapJumpthru(m))&amp;&amp;(x=G),!G)return x&amp;&amp;this.PushInFractional(m,n,r,x,16,!0),!0;w.SetXY(y,C);w.SetBboxChanged();return!1}PushOutSolidAxis(m,n,r,q){q=q||50;const t=m.GetWorldInfo(),u=t.GetX(),w=t.GetY();
let y=null,C=null;for(let G=0;G&lt;q;++G)for(let x=0;2&gt;x;++x){const B=2*x-1;t.SetXY(u+n*G*B,w+r*G*B);t.SetBboxChanged();if(!this.TestOverlap(m,y))if(y=this.TestOverlapSolid(m))C=y;else return C&amp;&amp;this.PushInFractional(m,n*B,r*B,C,16,!0),!0}t.SetXY(u,w);t.SetBboxChanged();return!1}PushInFractional(m,n,r,q,t,u){let w=2,y=!1;var C=!1;const G=m.GetWorldInfo();let x=G.GetX(),B=G.GetY();for(;w&lt;=t;)C=1/w,w*=2,G.OffsetXY(n*C*(y?1:-1),r*C*(y?1:-1)),G.SetBboxChanged(),this.TestOverlap(m,q)||u&amp;&amp;this.TestOverlapSolid(m)?
C=y=!0:(C=y=!1,x=G.GetX(),B=G.GetY());C&amp;&amp;(G.SetXY(x,B),G.SetBboxChanged())}PushOutSolidNearest(m,n=100){let r=0;const q=m.GetWorldInfo(),t=q.GetX(),u=q.GetY();let w=0,y=this.TestOverlapSolid(m);if(!y)return!0;for(;r&lt;=n;){let C=0,G=0;switch(w){case 0:C=0;G=-1;r++;break;case 1:C=1;G=-1;break;case 2:C=1;G=0;break;case 3:G=C=1;break;case 4:C=0;G=1;break;case 5:C=-1;G=1;break;case 6:C=-1;G=0;break;case 7:G=C=-1}w=(w+1)%8;q.SetXY(Math.floor(t+C*r),Math.floor(u+G*r));q.SetBboxChanged();if(!this.TestOverlap(m,
y)&amp;&amp;(y=this.TestOverlapSolid(m),!y))return!0}q.SetXY(t,u);q.SetBboxChanged();return!1}CalculateBounceAngle(m,n,r,q){const t=m.GetWorldInfo(),u=t.GetX(),w=t.GetY(),y=Math.max(10,c.distanceTo(n,r,u,w));var C=c.angleTo(n,r,u,w),G=q||this.TestOverlapSolid(m);if(!G)return c.clampAngle(C+Math.PI);let x=G;var B=0,H=0;const P=c.toRadians(5);let E;for(E=1;36&gt;E;++E){const J=C-E*P;t.SetXY(n+Math.cos(J)*y,r+Math.sin(J)*y);t.SetBboxChanged();if(!this.TestOverlap(m,x)&amp;&amp;(x=q?null:this.TestOverlapSolid(m),!x)){B=
J;break}}36===E&amp;&amp;(B=c.clampAngle(C+Math.PI));x=G;for(E=1;36&gt;E;++E)if(G=C+E*P,t.SetXY(n+Math.cos(G)*y,r+Math.sin(G)*y),t.SetBboxChanged(),!this.TestOverlap(m,x)&amp;&amp;(x=q?null:this.TestOverlapSolid(m),!x)){H=G;break}36===E&amp;&amp;(H=c.clampAngle(C+Math.PI));t.SetXY(u,w);t.SetBboxChanged();if(H===B)return H;m=c.angleDiff(H,B)/2;m=c.angleClockwise(H,B)?c.clampAngle(B+m+Math.PI):c.clampAngle(H+m);B=Math.cos(C);C=Math.sin(C);H=Math.cos(m);m=Math.sin(m);n=B*H+C*m;return c.angleTo(0,0,B-2*n*H,C-2*n*m)}TestSegmentOverlap(m,
n,r,q,t){if(!t)return!1;const u=t.GetWorldInfo();if(!u.IsCollisionEnabled())return!1;this._collisionCheckCount++;h.set(Math.min(m,r),Math.min(n,q),Math.max(m,r),Math.max(n,q));if(!u.GetBoundingBox().intersectsRect(h))return!1;if(t.HasTilemap())return this._TestSegmentOverlapTilemap(m,n,r,q,t,u);this._polyCheckCount++;return u.GetBoundingQuad().intersectsSegment(m,n,r,q)?u.HasOwnCollisionPoly()?u.GetTransformedCollisionPoly().intersectsSegment(u.GetX(),u.GetY(),m,n,r,q):!0:!1}_TestSegmentOverlapTilemap(m,
n,r,q,t,u){const w=u.GetX();u=u.GetY();t=t.GetSdkInstance();l.set(m,n,r,q);l.normalize();t.GetCollisionRectCandidates(l,a);for(let C=0,G=a.length;C&lt;G;++C){var y=a[C];t=y.GetRect();this._collisionCheckCount++;if(h.intersectsRectOffset(t,w,u)&amp;&amp;(g.setFromRect(t),g.offset(w,u),g.intersectsSegment(m,n,r,q)))if(y=y.GetPoly()){if(this._polyCheckCount++,y.intersectsSegment(w+t.getLeft(),u+t.getTop(),m,n,r,q))return c.clearArray(a),!0}else return c.clearArray(a),!0}c.clearArray(a);return!1}TestRectOverlap(m,
n){if(!n)return!1;const r=n.GetWorldInfo();if(!r.IsCollisionEnabled())return!1;this._collisionCheckCount++;if(!r.GetBoundingBox().intersectsRect(m))return!1;if(n.HasTilemap())return this._TestRectOverlapTilemap(m,n,r);this._polyCheckCount++;g.setFromRect(m);if(!r.GetBoundingQuad().intersectsQuad(g))return!1;if(!r.HasOwnCollisionPoly())return!0;d.setFromRect(m,r.GetX(),r.GetY());m=r.GetTransformedCollisionPoly();return d.intersectsPoly(m,0,0)}_TestRectOverlapTilemap(m,n,r){const q=r.GetX();r=r.GetY();
n.GetSdkInstance().GetCollisionRectCandidates(m,a);for(let u=0,w=a.length;u&lt;w;++u){var t=a[u];n=t.GetRect();this._collisionCheckCount++;if(m.intersectsRectOffset(n,q,r))if(t=t.GetPoly()){if(this._polyCheckCount++,d.setFromRect(m,0,0),t.intersectsPoly(d,-(q+n.getLeft()),-(r+n.getTop())))return c.clearArray(a),!0}else return c.clearArray(a),!0}c.clearArray(a);return!1}TestRayIntersectsInstance(m,n){if(m){var r=m.GetWorldInfo();r.IsCollisionEnabled()&amp;&amp;(this._collisionCheckCount++,r.GetBoundingBox().intersectsRect(n.rect)&amp;&amp;
(m.HasTilemap()?this._TestRayIntersectsTilemap(m,r,n):(this._polyCheckCount++,r.HasOwnCollisionPoly()?n.TestInstancePoly(m,r.GetX(),r.GetY(),r.GetTransformedCollisionPoly()):n.TestInstanceQuad(m,r.GetBoundingQuad()))))}}_TestRayIntersectsTilemap(m,n,r){const q=n.GetX(),t=n.GetY();m.GetSdkInstance().GetCollisionRectCandidates(r.rect,a);for(let w=0,y=a.length;w&lt;y;w++){var u=a[w];const C=u.GetRect();this._collisionCheckCount++;r.rect.intersectsRectOffset(C,q,t)&amp;&amp;(u=u.GetPoly(),this._polyCheckCount++,
u?r.TestInstancePoly(m,q+C.getLeft(),t+C.getTop(),u):r.TestInstanceRect(m,n.GetX(),n.GetY(),C))}c.clearArray(a)}}}"use strict";
{const c=self.C3;c.SparseGrid=class extends c.DefendedBase{constructor(b,a){super();this._cellWidth=b;this._cellHeight=a;this._cells=c.New(c.PairMap)}Release(){this._cells.Release();this._cells=null}GetCell(b,a,f){let d=this._cells.Get(b,a);return d?d:f?(d=c.New(c.GridCell,this,b,a),this._cells.Set(b,a,d),d):null}XToCell(b){b=Math.floor(b/this._cellWidth);return isFinite(b)?b:0}YToCell(b){b=Math.floor(b/this._cellHeight);return isFinite(b)?b:0}Update(b,a,f){if(a)for(let d=a.getLeft(),e=a.getRight();d&lt;=
e;++d)for(let g=a.getTop(),h=a.getBottom();g&lt;=h;++g){if(f&amp;&amp;f.containsPoint(d,g))continue;const l=this.GetCell(d,g,!1);l&amp;&amp;(l.Remove(b),l.IsEmpty()&amp;&amp;this._cells.Delete(d,g))}if(f)for(let d=f.getLeft(),e=f.getRight();d&lt;=e;++d)for(let g=f.getTop(),h=f.getBottom();g&lt;=h;++g)a&amp;&amp;a.containsPoint(d,g)||this.GetCell(d,g,!0).Insert(b)}QueryRange(b,a){let f=this.XToCell(b.getLeft());const d=this.YToCell(b.getTop()),e=this.XToCell(b.getRight());b=this.YToCell(b.getBottom());if(isFinite(e)&amp;&amp;isFinite(b))for(;f&lt;=
e;++f)for(let g=d;g&lt;=b;++g){const h=this.GetCell(f,g,!1);h&amp;&amp;h.Dump(a)}}}}"use strict";{const c=self.C3;c.GridCell=class extends c.DefendedBase{constructor(b,a,f){super();this._grid=b;this._x=a;this._y=f;this._instances=c.New(c.ArraySet)}Release(){this._instances.Release();this._grid=this._instances=null}IsEmpty(){return this._instances.IsEmpty()}Insert(b){this._instances.Add(b)}Remove(b){this._instances.Delete(b)}Dump(b){c.appendArray(b,this._instances.GetArray())}}}"use strict";
{const c=self.C3;c.Ray=class{constructor(){this.dy=this.dx=this.y2=this.x2=this.y1=this.x1=0;this.rect=new c.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(b,a,f,d){this.x1=b;this.y1=a;this.x2=f;this.y2=d;this.dx=f-b;this.dy=d-a;this.rect.set(b,a,f,d);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 b=this.dx*this.hitFraction,a=this.dy*this.hitFraction,f=Math.sqrt(b*b+a*a);b/=f;a/=f;this.distance=f-.000001;this.hitX=this.x1+b*this.distance;this.hitY=this.y1+a*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);f=b*this.normalX+a*this.normalY;this.reflectionX=b-2*this.normalX*f;this.reflectionY=a-2*this.normalY*f;0&lt;f&amp;&amp;(this.hitNormal=c.clampAngle(this.hitNormal+Math.PI),this.normalX=-this.normalX,this.normalY=-this.normalY)}}TestInstanceSegment(b,a,f,d,e){const g=c.rayIntersect(this.x1,this.y1,this.x2,this.y2,a,f,d,e);0&lt;=g&amp;&amp;g&lt;this.hitFraction&amp;&amp;(this.hitFraction=g,this.hitUid=b.GetUID(),this.hitNormalDx=a-d,this.hitNormalDy=f-e)}TestInstanceRect(b,a,f,d){const e=a+d.getLeft();a+=
d.getRight();const g=f+d.getTop();f+=d.getBottom();this.TestInstanceSegment(b,e,g,a,g);this.TestInstanceSegment(b,a,g,a,f);this.TestInstanceSegment(b,a,f,e,f);this.TestInstanceSegment(b,e,f,e,g)}TestInstanceQuad(b,a){const f=a.getTlx(),d=a.getTly(),e=a.getTrx(),g=a.getTry(),h=a.getBrx(),l=a.getBry(),m=a.getBlx();a=a.getBly();this.TestInstanceSegment(b,f,d,e,g);this.TestInstanceSegment(b,e,g,h,l);this.TestInstanceSegment(b,h,l,m,a);this.TestInstanceSegment(b,m,a,f,d)}TestInstancePoly(b,a,f,d){d=d.pointsArr();
for(let e=0,g=d.length;e&lt;g;e+=2){const h=(e+2)%g;this.TestInstanceSegment(b,d[e]+a,d[e+1]+f,d[h]+a,d[h+1]+f)}}}}"use strict";
{const c=self.C3,b=new Set("off crop scale-inner scale-outer letterbox-scale letterbox-integer-scale".split(" ")),a=new Set(["high","low"]),f=c.New(c.Quad),d=c.New(c.Rect);c.CanvasManager=class extends c.DefendedBase{constructor(e){super();this._runtime=e;this._webglRenderer=this._canvas=null;this._gpuPreference="high-performance";this._canvasCssOffsetY=this._canvasCssOffsetX=this._canvasDeviceHeight=this._canvasDeviceWidth=this._canvasCssHeight=this._canvasCssWidth=this._windowInnerHeight=this._windowInnerWidth=
0;this._enableMipmaps=!0;this._drawHeight=this._drawWidth=0;this._documentFullscreenMode=this._fullscreenMode="letterbox-scale";this._deviceTransformOffY=this._deviceTransformOffX=0;this._fullscreenScalingQuality=this._wantFullscreenScalingQuality="high";this._isDocumentFullscreen=!1;this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets=new Set;this._gpuFrameTimingsBuffer=this._shaderData=null;this._gpuTimeEndFrame=this._gpuTimeStartFrame=0;this._gpuCurUtilisation=NaN;this._gpuLastUtilisation=
0;this._layersGpuProfile=new Map;this._snapshotFormat="";this._snapshotQuality=1;this._snapshotArea=c.New(c.Rect);this._snapshotUrl="";this._snapshotResolve=this._snapshotPromise=null;this._loaderStartTime=0;this._rafId=-1;this._loadingProgress=0;this._loadingprogress_handler=g=&gt;this._loadingProgress=g.progress;this._loadingLogoAsset=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(g=&gt;this._splashDoneResolve=g)}_SetGPUPowerPreference(e){this._gpuPreference=e}async CreateCanvas(e){this._canvas=e.canvas;this._canvas.addEventListener("webglcontextlost",h=&gt;this._OnWebGLContextLost(h));this._canvas.addEventListener("webglcontextrestored",h=&gt;this._OnWebGLContextRestored(h));const g={powerPreference:this._gpuPreference,enableGpuProfiling:!0};"Android"===c.Platform.OS&amp;&amp;"Chromium"===c.Platform.BrowserEngine&amp;&amp;
75&gt;c.Platform.BrowserVersionNumber&amp;&amp;(console.warn("[Construct 3] Disabling WebGL 2 because this device appears to be affected by crbug.com/934823. Install software updates to avoid this."),g.maxWebGLVersion=1);"standard"===this._runtime.GetCompositingMode()?g.alpha=!0:(g.alpha=!1,g.lowLatency=!0);this._webglRenderer=c.New(c.Gfx.WebGLRenderer,this._canvas,g);await this._webglRenderer.InitState();this._webglRenderer.SupportsGPUProfiling()||(this._gpuLastUtilisation=NaN);this._runtime.AddDOMComponentMessageHandler("runtime",
"window-resize",h=&gt;this._OnWindowResize(h));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenchange",h=&gt;this._OnFullscreenChange(h));this._runtime.AddDOMComponentMessageHandler("runtime","fullscreenerror",h=&gt;this._OnFullscreenError(h));this._isDocumentFullscreen=!!e.isFullscreen;this.SetSize(e.windowInnerWidth,e.windowInnerHeight,!0);this._shaderData=self.C3_Shaders;await this._LoadShaderPrograms();e=!1;for(const h of this._runtime._GetAllEffectLists()){for(const l of h.GetAllEffectTypes())l._InitRenderer(this._webglRenderer),
l.GetShaderProgram().UsesDest()&amp;&amp;(e=!0);h.UpdateActiveEffects()}this._runtime._SetUsesAnyBackgroundBlending(e);this._webglRenderer.SupportsGPUProfiling()&amp;&amp;(this._gpuFrameTimingsBuffer=c.New(c.Gfx.WebGLQueryResultBuffer,this._webglRenderer));this._webglRenderer.SetMipmapsEnabled(this._enableMipmaps)}async _LoadShaderPrograms(){if(this._shaderData){var e=[];for(const [g,h]of Object.entries(this._shaderData)){const l=c.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource(this._webglRenderer.Is3D());e.push(this._webglRenderer.CreateShaderProgram(h,
l,g))}await Promise.all(e);this._webglRenderer.ResetLastProgram();this._webglRenderer.SetTextureFillMode()}}Release(){this._canvas=this._webglRenderer=this._runtime=null}_OnWindowResize(e){const g=e.devicePixelRatio;this._runtime.IsInWorker()&amp;&amp;(self.devicePixelRatio=g);this._runtime._SetDevicePixelRatio(g);this.SetSize(e.innerWidth,e.innerHeight);this._runtime.UpdateRender()}_OnFullscreenChange(e){this._isDocumentFullscreen=!!e.isFullscreen;this.SetSize(e.innerWidth,e.innerHeight,!0);this._runtime.UpdateRender()}_OnFullscreenError(e){this._isDocumentFullscreen=
!!e.isFullscreen;this.SetSize(e.innerWidth,e.innerHeight,!0);this._runtime.UpdateRender()}SetSize(e,g,h=!1){e=Math.floor(e);g=Math.floor(g);if(0&gt;=e||0&gt;=g)throw Error("invalid size");if(this._windowInnerWidth!==e||this._windowInnerHeight!==g||h)this._windowInnerWidth=e,this._windowInnerHeight=g,h=this.GetCurrentFullscreenMode(),"letterbox-scale"===h?this._CalculateLetterboxScale(e,g):"letterbox-integer-scale"===h?this._CalculateLetterboxIntegerScale(e,g):"off"===h?this._CalculateFixedSizeCanvas(e,
g):this._CalculateFullsizeCanvas(e,g),this._UpdateFullscreenScalingQuality(h),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}),this._webglRenderer.SetSize(this._canvasDeviceWidth,this._canvasDeviceHeight,!0)}_CalculateLetterboxScale(e,g){const h=this._runtime.GetDevicePixelRatio(),
l=this._runtime.GetOriginalViewportWidth(),m=this._runtime.GetOriginalViewportHeight(),n=l/m;e/g&gt;n?(this._canvasCssWidth=Math.round(g*n),this._canvasCssHeight=g,this._canvasCssOffsetX=Math.floor((e-this._canvasCssWidth)/2),this._canvasCssOffsetY=0):(this._canvasCssWidth=e,this._canvasCssHeight=Math.round(e/n),this._canvasCssOffsetX=0,this._canvasCssOffsetY=Math.floor((g-this._canvasCssHeight)/2));this._canvasDeviceWidth=Math.round(this._canvasCssWidth*h);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*
h);this._runtime.SetViewportSize(l,m)}_CalculateLetterboxIntegerScale(e,g){const h=this._runtime.GetDevicePixelRatio();1!==h&amp;&amp;(e+=1,g+=1);const l=this._runtime.GetOriginalViewportWidth(),m=this._runtime.GetOriginalViewportHeight();var n=l/m;n=e/g&gt;n?g*n*h/l:e/n*h/m;1&lt;n?n=Math.floor(n):1&gt;n&amp;&amp;(n=1/Math.ceil(1/n));this._canvasDeviceWidth=Math.round(l*n);this._canvasDeviceHeight=Math.round(m*n);this._canvasCssWidth=this._canvasDeviceWidth/h;this._canvasCssHeight=this._canvasDeviceHeight/h;this._canvasCssOffsetX=
Math.max(Math.floor((e-this._canvasCssWidth)/2),0);this._canvasCssOffsetY=Math.max(Math.floor((g-this._canvasCssHeight)/2),0);this._runtime.SetViewportSize(l,m)}_CalculateFullsizeCanvas(e,g){const h=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=e;this._canvasCssHeight=g;this._canvasDeviceWidth=Math.round(this._canvasCssWidth*h);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*h);this._canvasCssOffsetY=this._canvasCssOffsetX=0;e=this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/
e,this._canvasCssHeight/e)}_CalculateFixedSizeCanvas(e,g){const h=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth();this._canvasCssHeight=this._runtime.GetViewportHeight();this._canvasDeviceWidth=Math.round(this._canvasCssWidth*h);this._canvasDeviceHeight=Math.round(this._canvasCssHeight*h);this.IsDocumentFullscreen()?(this._canvasCssOffsetX=Math.floor((e-this._canvasCssWidth)/2),this._canvasCssOffsetY=Math.floor((g-this._canvasCssHeight)/2)):this._canvasCssOffsetY=
this._canvasCssOffsetX=0;this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(e){if("high"===this._wantFullscreenScalingQuality)this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality="high";else{let h;if("off"===this.GetCurrentFullscreenMode()){var g=this._runtime.GetViewportWidth();h=this._runtime.GetViewportHeight()}else g=this._runtime.GetOriginalViewportWidth(),
h=this._runtime.GetOriginalViewportHeight();this._canvasDeviceWidth&lt;g&amp;&amp;this._canvasDeviceHeight&lt;h?(this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality="high"):(this._drawWidth=g,this._drawHeight=h,this._fullscreenScalingQuality="low","scale-inner"===e?(e=g/h,g=this._windowInnerWidth/this._windowInnerHeight,g&lt;e?this._drawWidth=this._drawHeight*g:g&gt;e&amp;&amp;(this._drawHeight=this._drawWidth/g)):"scale-outer"===e&amp;&amp;(e=g/h,g=this._windowInnerWidth/
this._windowInnerHeight,g&gt;e?this._drawWidth=this._drawHeight*g:g&lt;e&amp;&amp;(this._drawHeight=this._drawWidth/g)))}}IsDocumentFullscreen(){return this._isDocumentFullscreen}SetFullscreenMode(e){if(!b.has(e))throw Error("invalid fullscreen mode");this._fullscreenMode=e}GetFullscreenMode(){return this._fullscreenMode}SetDocumentFullscreenMode(e){if(!b.has(e))throw Error("invalid fullscreen mode");this._documentFullscreenMode=e}GetDocumentFullscreenMode(){return this._documentFullscreenMode}GetCurrentFullscreenMode(){return this.IsDocumentFullscreen()?
this.GetDocumentFullscreenMode():this.GetFullscreenMode()}SetFullscreenScalingQuality(e){if(!a.has(e))throw Error("invalid fullscreen scaling quality");this._wantFullscreenScalingQuality=e}GetSetFullscreenScalingQuality(){return this._wantFullscreenScalingQuality}GetCurrentFullscreenScalingQuality(){return this._fullscreenScalingQuality}static _FullscreenModeNumberToString(e){switch(e){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(e){this._enableMipmaps=!!e}IsWebGLContextLost(){return this._webglRenderer.IsContextLost()}_OnWebGLContextLost(e){console.log("[Construct 3] WebGL context lost");e.preventDefault();this._availableAdditionalRenderTargets=[];this._usedAdditionalRenderTargets.clear();
this._webglRenderer.OnContextLost();this._runtime._OnWebGLContextLost()}async _OnWebGLContextRestored(e){await this._webglRenderer.OnContextRestored();await this._LoadShaderPrograms();for(const g of this._runtime._GetAllEffectLists())for(const h of g.GetAllEffectTypes())h._InitRenderer(this._webglRenderer);await this._runtime._OnWebGLContextRestored();console.log("[Construct 3] WebGL context restored")}GetWebGLRenderer(){return this._webglRenderer}GetRenderScale(){return"low"===this._fullscreenScalingQuality?
1/this._runtime.GetDevicePixelRatio():this.GetDisplayScale()}GetDisplayScale(){const e=this.GetCurrentFullscreenMode();if("off"===e||"crop"===e)return 1;const g=this._runtime.GetOriginalViewportWidth(),h=this._runtime.GetOriginalViewportHeight(),l=g/h,m=this._canvasDeviceWidth/this._canvasDeviceHeight;return"scale-inner"!==e&amp;&amp;m&gt;l||"scale-inner"===e&amp;&amp;m&lt;l?this._canvasCssHeight/h:this._canvasCssWidth/g}SetDeviceTransformOffset(e,g){this._deviceTransformOffX=e;this._deviceTransformOffY=g}SetDeviceTransform(e,
g,h){g=(g||this._drawWidth)/2+this._deviceTransformOffX;h=(h||this._drawHeight)/2+this._deviceTransformOffY;e.SetCameraXYZ(g,h,100*this._runtime.GetDevicePixelRatio());e.SetLookXYZ(g,h,0);e.ResetModelView();e.UpdateModelView()}SetCssTransform(e){const g=this._canvasCssWidth/2,h=this._canvasCssHeight/2;e.SetCameraXYZ(g,h,100);e.SetLookXYZ(g,h,0);e.ResetModelView();e.UpdateModelView()}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(e){const g=
this._availableAdditionalRenderTargets,h=g.findIndex(m=&gt;m.IsCompatibleWithOptions(e));let l;-1!==h?(l=g[h],g.splice(h,1)):l=this._webglRenderer.CreateRenderTarget(e);this._usedAdditionalRenderTargets.add(l);return l}ReleaseAdditionalRenderTarget(e){if(!this._usedAdditionalRenderTargets.has(e))throw Error("render target not in use");this._usedAdditionalRenderTargets.delete(e);this._availableAdditionalRenderTargets.push(e)}*activeLayersGpuProfiles(){for(const e of this._runtime.GetLayoutManager().runningLayouts())for(const g of e.GetLayers()){const h=
this._layersGpuProfile.get(g);h&amp;&amp;(yield h)}}GetLayerTimingsBuffer(e){if(!this._webglRenderer.SupportsGPUProfiling())return null;let g=this._layersGpuProfile.get(e);g||(g={name:e.GetName(),timingsBuffer:c.New(c.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0},this._layersGpuProfile.set(e,g));return g.timingsBuffer}_Update1sFrameRange(){if(this._webglRenderer.SupportsGPUProfiling()&amp;&amp;0===this._gpuTimeEndFrame){this._gpuTimeEndFrame=this._webglRenderer.GetFrameNumber();
this._gpuCurUtilisation=NaN;for(const e of this.activeLayersGpuProfiles())e.curUtilisation=NaN}}_UpdateTick(){if(this._webglRenderer.SupportsGPUProfiling()&amp;&amp;isNaN(this._gpuCurUtilisation)&amp;&amp;(this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),!isNaN(this._gpuCurUtilisation))){if(this._runtime.IsDebug())for(const e of this.activeLayersGpuProfiles())if(e.curUtilisation=e.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,
this._gpuTimeEndFrame),isNaN(e.curUtilisation))return;this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame);this._gpuLastUtilisation=Math.min(this._gpuCurUtilisation,1);if(this._runtime.IsDebug()){for(const e of this.activeLayersGpuProfiles())e.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),e.lastUtilisation=Math.min(e.curUtilisation,1);self.C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame=this._gpuTimeEndFrame;
this._gpuTimeEndFrame=0}}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(e,g,h,l,m,n){this._snapshotFormat=e;this._snapshotQuality=g;this._snapshotArea.setWH(h,l,m,n);return this._snapshotPromise?this._snapshotPromise:this._snapshotPromise=new Promise(r=&gt;{this._snapshotResolve=r})}_MaybeTakeSnapshot(){if(this._snapshotFormat){var e=this._canvas,g=this._snapshotArea,h=c.clamp(Math.floor(g.getLeft()),0,e.width),l=c.clamp(Math.floor(g.getTop()),
0,e.height),m=g.width();m=0===m?e.width-h:c.clamp(Math.floor(m),0,e.width-h);g=g.height();g=0===g?e.height-l:c.clamp(Math.floor(g),0,e.height-l);(0!==h||0!==l||m!==e.width||g!==e.height)&amp;&amp;0&lt;m&amp;&amp;0&lt;g&amp;&amp;(e=c.CreateCanvas(m,g),e.getContext("2d").drawImage(this._canvas,h,l,m,g,0,0,m,g));c.CanvasToBlob(e,this._snapshotFormat,this._snapshotQuality).then(n=&gt;{this._snapshotUrl=URL.createObjectURL(n);this._snapshotPromise=null;this._snapshotResolve(this._snapshotUrl)});this._snapshotFormat="";this._snapshotQuality=
1}}GetCanvasSnapshotUrl(){return this._snapshotUrl}InitLoadingScreen(e){if(2===e)this._percentText=c.New(c.Gfx.RendererText,this._webglRenderer),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);else if(0===e){const g=this._runtime.GetLoadingLogoFilename();e=this._runtime.GetAssetManager();let h;if(this._runtime.IsPreview()){if(!e._HasLocalUrlBlob(g))return;
h=e.GetLocalUrlAsBlobUrl(g)}else h=e.GetIconsSubfolder()+g;this._loadingLogoAsset=e.LoadImage({url:h});this._loadingLogoAsset.LoadStaticTexture(this._webglRenderer).catch(l=&gt;console.warn(`[C3 runtime] Failed to load '${g}' for loading screen. Check the project has an icon with that name.`,l))}else 4===e&amp;&amp;(this._LoadSvgSplashImage("splash-images/splash-logo.svg").then(g=&gt;{"done"===this._splashState?this._webglRenderer.DeleteTexture(g):this._splashTextures.logo=g}).catch(g=&gt;console.warn("Failed to load splash image: ",
g)),this._LoadBitmapSplashImage("splash-images/splash-poweredby-512.png").then(g=&gt;{"done"===this._splashState?this._webglRenderer.DeleteTexture(g):this._splashTextures.powered=g}).catch(g=&gt;console.warn("Failed to load splash image: ",g)),this._LoadBitmapSplashImage("splash-images/splash-website-512.png").then(g=&gt;{"done"===this._splashState?this._webglRenderer.DeleteTexture(g):this._splashTextures.website=g}).catch(g=&gt;console.warn("Failed to load splash image: ",g)))}async _LoadSvgSplashImage(e){e=
(new URL(e,this._runtime.GetBaseURL())).toString();e=await c.FetchBlob(e);e=await this._runtime.RasterSvgImage(e,2048,2048);return await this._webglRenderer.CreateStaticTextureAsync(e,{mipMapQuality:"high"})}async _LoadBitmapSplashImage(e){e=(new URL(e,this._runtime.GetBaseURL())).toString();e=await c.FetchBlob(e);return await this._webglRenderer.CreateStaticTextureAsync(e,{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(){this._loadingProgress=1;const e=this._runtime.GetLoaderStyle();4===e&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._loadingLogoAsset&amp;&amp;(this._loadingLogoAsset.Release(),this._loadingLogoAsset=null);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===e&amp;&amp;this.HideCordovaSplashScreen()}_DrawLoadingScreen(){if(-1!==this._rafId){var e=this._webglRenderer;e.Start();this._rafId=-1;var g=this._runtime.GetAssetManager().HasHadErrorLoading(),h=this._runtime.GetLoaderStyle();
3!==h&amp;&amp;(this.SetCssTransform(e),e.ClearRgba(0,0,0,0),e.ResetColor(),e.SetTextureFillMode(),e.SetTexture(null));if(0===h)this._DrawProgressBarAndLogoLoadingScreen(g);else if(1===h)this._DrawProgressBarLoadingScreen(g,120,0);else if(2===h)this._DrawPercentTextLoadingScreen(g);else if(3===h)c.noop();else if(4===h)this._DrawSplashLoadingScreen(g);else throw Error("invalid loader style");e.Finish();this._rafId=requestAnimationFrame(()=&gt;this._DrawLoadingScreen())}}_DrawPercentTextLoadingScreen(e){e?this._percentText.SetColorRgb(1,
0,0):this._percentText.SetColorRgb(.6,.6,.6);this._percentText.SetText(Math.round(100*this._loadingProgress)+"%");e=this._canvasCssWidth/2;const g=this._canvasCssHeight/2;f.setRect(e-150,g-100,e+150,g+100);this._webglRenderer.SetTexture(this._percentText.GetTexture());this._webglRenderer.Quad3(f,this._percentText.GetTexRect())}_DrawProgressBarLoadingScreen(e,g,h){const l=this._webglRenderer;l.SetColorFillMode();e?l.SetColorRgba(1,0,0,1):l.SetColorRgba(.118,.565,1,1);e=this._canvasCssWidth/2;const m=
this._canvasCssHeight/2,n=g/2;d.setWH(e-n,m-4+h,Math.floor(g*this._loadingProgress),8);l.Rect(d);d.setWH(e-n,m-4+h,g,8);d.offset(-.5,-.5);d.inflate(.5,.5);l.SetColorRgba(0,0,0,1);l.LineRect2(d);d.inflate(1,1);l.SetColorRgba(1,1,1,1);l.LineRect2(d)}_DrawProgressBarAndLogoLoadingScreen(e){if(this._loadingLogoAsset){var g=this._loadingLogoAsset.GetTexture();if(g){var h=g.GetWidth(),l=g.GetHeight(),m=this._canvasCssWidth/2,n=this._canvasCssHeight/2,r=h/2;l/=2;f.setRect(m-r,n-l,m+r,n+l);this._webglRenderer.SetTexture(g);
this._webglRenderer.Quad(f);this._DrawProgressBarLoadingScreen(e,h,l+16)}else this._DrawProgressBarLoadingScreen(e,120,0)}else this._DrawProgressBarLoadingScreen(e,120,0)}_DrawSplashLoadingScreen(e){const g=this._webglRenderer,h=this._splashTextures.logo,l=this._splashTextures.powered,m=this._splashTextures.website,n=Date.now();0===this._splashFrameNumber&amp;&amp;(this._loaderStartTime=n);const r=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&amp;&amp;!this._runtime.IsCordova(),q=r?0:200,t=r?0:
3E3;let u=1;"fade-in"===this._splashState?u=Math.min((n-this._loaderStartTime)/300,1):"fade-out"===this._splashState&amp;&amp;(u=Math.max(1-(n-this._splashFadeOutStartTime)/300,0));g.SetColorFillMode();g.SetColorRgba(.231*u,.251*u,.271*u,u);d.set(0,0,this._canvasCssWidth,this._canvasCssHeight);g.Rect(d);const w=Math.ceil(this._canvasCssWidth),y=Math.ceil(this._canvasCssHeight);let C;256&lt;this._canvasCssHeight?(g.SetColorRgba(.302*u,.334*u,.365*u,u),C=Math.max(.005*y,2),d.setWH(0,.8*y-C/2,w,C),g.Rect(d),e?
g.SetColorRgba(u,0,0,u):g.SetColorRgba(.161*u,.953*u,.816*u,u),e=w*this._loadingProgress,d.setWH(.5*w-e/2,.8*y-C/2,e,C),g.Rect(d),g.SetColorRgba(u,u,u,u),g.SetTextureFillMode(),l&amp;&amp;(e=1.5*c.clamp(.22*y,105,.6*w),C=e/8,d.setWH(.5*w-e/2,.2*y-C/2,e,C),g.SetTexture(l),g.Rect(d)),h&amp;&amp;(C=e=Math.min(.395*y,.95*w),d.setWH(.5*w-e/2,.485*y-C/2,e,C),g.SetTexture(h),g.Rect(d)),m&amp;&amp;(e=1.5*c.clamp(.22*y,105,.6*w),C=e/8,d.setWH(.5*w-e/2,.868*y-C/2,e,C),g.SetTexture(m),g.Rect(d))):(g.SetColorRgba(.302*u,.334*u,.365*
u,u),C=Math.max(.005*y,2),d.setWH(0,.85*y-C/2,w,C),g.Rect(d),e?g.SetColorRgba(u,0,0,u):g.SetColorRgba(.161*u,.953*u,.816*u,u),e=w*this._loadingProgress,d.setWH(.5*w-e/2,.85*y-C/2,e,C),g.Rect(d),g.SetColorRgba(u,u,u,u),g.SetTextureFillMode(),h&amp;&amp;(C=e=.55*y,d.setWH(.5*w-e/2,.45*y-C/2,e,C),g.SetTexture(h),g.Rect(d)));this._splashFrameNumber++;"fade-in"===this._splashState&amp;&amp;300&lt;=n-this._loaderStartTime&amp;&amp;2&lt;=this._splashFrameNumber&amp;&amp;(this._splashState="wait",this._splashFadeInFinishTime=n);"wait"===this._splashState&amp;&amp;
n-this._splashFadeInFinishTime&gt;=t&amp;&amp;1&lt;=this._loadingProgress&amp;&amp;(this._splashState="fade-out",this._splashFadeOutStartTime=n);("fade-out"===this._splashState&amp;&amp;n-this._splashFadeOutStartTime&gt;=300+q||r&amp;&amp;1&lt;=this._loadingProgress&amp;&amp;500&gt;n-this._loaderStartTime)&amp;&amp;this._splashDoneResolve()}}}"use strict";
{const c=self.C3,b=self.C3Debugger,a={messagePort:null,baseUrl:"",headless:!1,hasDom:!0,isInWorker:!1,useAudio:!0,projectData:"",exportType:""};let f=!0;c.Runtime=class extends c.DefendedBase{constructor(d){d=Object.assign({},a,d);super();this._messagePort=d.messagePort;this._baseUrl=d.baseUrl;this._isHeadless=!!d.headless;this._hasDom=!!d.hasDom;this._isInWorker=!!d.isInWorker;f=d.ife;this._useAudio=!!d.useAudio;this._exportType=d.exportType;this._isiOSCordova=!!d.isiOSCordova;this._isiOSWebView=
!!d.isiOSWebView;this._isFBInstantAvailable=!!d.isFBInstantAvailable;this._opusWasmScriptUrl=d.opusWasmScriptUrl;this._opusWasmBinaryUrl=d.opusWasmBinaryUrl;this._dataJsonFilename="data.json";this._isDebugging=this._breakpointsEnabled=this._isDebug=!("preview"!==this._exportType||!d.isDebug);this._debuggingDisabled=0;const e=d.previewImageBlobs;var g=d.previewProjectFileBlobs;g&amp;&amp;Object.assign(e,g);(g=d.projectData)&amp;&amp;(e[this._dataJsonFilename]=g);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._usesAnyBackgroundBlending=!1;this._loadingLogoFilename="loading-logo.png";this._assetManager=c.New(c.AssetManager,this,{defaultLoadPolicy:"html5"===
this._exportType||"scirra-arcade"===this._exportType||"instant-games"===this._exportType?"remote":"local",localUrlBlobs:e,isCordova:"cordova"===this._exportType,isiOSCordova:this._isiOSCordova,supportedAudioFormats:d.supportedAudioFormats});this._layoutManager=c.New(c.LayoutManager,this);this._eventSheetManager=c.New(c.EventSheetManager,this);this._pluginManager=c.New(c.PluginManager,this);this._collisionEngine=c.New(c.CollisionEngine,this);this._timelineManager=c.New(c.TimelineManager,this);this._transitionManager=
c.New(c.TransitionManager,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._framerateMode="vsync";this._compositingMode="standard";this._sampling="trilinear";this._isPixelRoundingEnabled=!1;this._needRender=!0;this._isPausedOnBlur=this._pauseOnBlur=!1;this._tickCallbacks={normal:h=&gt;{this._ruafId=this._rafId=-1;this.Tick(h)},tickOnly:h=&gt;{this._ruafId=-1;this.Tick(h,!1,"skip-render")},renderOnly:()=&gt;{this._rafId=-1;this.Render()}};this._ruafId=this._rafId=-1;this._execCount=this._tickCountNoSave=
this._tickCount=0;this._hasStartedTicking=this._isInTick=this._hasStarted=!1;this._isLayoutFirstTick=!0;this._suspendCount=0;this._scheduleTriggersThrottle=new c.PromiseThrottle(1);this._randomNumberCallback=()=&gt;Math.random();this._dt=this._dt1=this._lastTickTime=this._startTime=0;this._timeScale=1;this._minimumFramerate=30;this._gameTime=c.New(c.KahanSum);this._wallTime=c.New(c.KahanSum);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._triggerOnCreateAfterLoad=[];this._savegamesStorage=this._projectStorage=null;this._dispatcher=c.New(c.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:c.New(c.Event,"pretick",
!1),tick:c.New(c.Event,"tick",!1),tick2:c.New(c.Event,"tick2",!1),instancedestroy:c.New(c.Event,"instancedestroy",!1),beforelayoutchange:c.New(c.Event,"beforelayoutchange",!1),layoutchange:c.New(c.Event,"layoutchange",!1)};this._eventObjects.instancedestroy.instance=null;this._userScriptDispatcher=c.New(c.Event.Dispatcher);this._userScriptEventObjects=null;this._behInstsToTick=c.New(c.RedBlackSet,c.BehaviorInstance.SortByTickSequence);this._behInstsToPostTick=c.New(c.RedBlackSet,c.BehaviorInstance.SortByTickSequence);
this._behInstsToTick2=c.New(c.RedBlackSet,c.BehaviorInstance.SortByTickSequence);this._jobScheduler=c.New(c.JobSchedulerRuntime,this,d.jobScheduler);d.canvas&amp;&amp;(this._canvasManager=c.New(c.CanvasManager,this));this._messagePort.onmessage=h=&gt;this._OnMessageFromDOM(h.data);this.AddDOMComponentMessageHandler("runtime","visibilitychange",h=&gt;this._OnVisibilityChange(h));this.AddDOMComponentMessageHandler("runtime","opus-decode",h=&gt;this._WasmDecodeWebMOpus(h.arrayBuffer));this.AddDOMComponentMessageHandler("runtime",
"get-remote-preview-status-info",()=&gt;this._GetRemotePreviewStatusInfo());this.AddDOMComponentMessageHandler("runtime","js-invoke-function",h=&gt;this._InvokeFunctionFromJS(h));this.AddDOMComponentMessageHandler("runtime","go-to-last-error-script",self.goToLastErrorScript);this._dispatcher.addEventListener("window-blur",h=&gt;this._OnWindowBlur(h));this._dispatcher.addEventListener("window-focus",()=&gt;this._OnWindowFocus());this._timelineManager.AddRuntimeListeners();this._iRuntime=null;this._interfaceMap=
new WeakMap;this._commonScriptInterfaces={keyboard:null,mouse:null,touch:null}}static Create(d){return c.New(c.Runtime,d)}Release(){c.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._canvasManager&amp;&amp;(this._canvasManager.Release(),this._canvasManager=null);this._dispatcher.Release();this._tickEvent=this._dispatcher=null}["_OnMessageFromDOM"](d){const e=d.type;if("event"===e)this._OnEventFromDOM(d);else if("result"===e)this._OnResultFromDOM(d);else throw Error(`unknown message '${e}'`);}_OnEventFromDOM(d){if(this._isReadyToHandleEvents){var e=d.component,
g=d.handler,h=d.data,l=d.dispatchOpts,m=!(!l||!l.dispatchRuntimeEvent);l=!(!l||!l.dispatchUserScriptEvent);var n=d.responseId;if("runtime"===e&amp;&amp;(m&amp;&amp;(d=new c.Event(g),d.data=h,this._dispatcher.dispatchEventAndWaitAsyncSequential(d)),l)){d=new c.Event(g,!0);for(const [r,q]of Object.entries(h))d[r]=q;this.DispatchUserScriptEvent(d)}if(d=this._domEventHandlers.get(e))if(d=d.get(g)){m=null;try{m=d(h)}catch(r){console.error(`Exception in '${e}' handler '${g}':`,r);null!==n&amp;&amp;this._PostResultToDOM(n,!1,""+
r);return}null!==n&amp;&amp;(m&amp;&amp;m.then?m.then(r=&gt;this._PostResultToDOM(n,!0,r)).catch(r=&gt;{console.error(`Rejection from '${e}' handler '${g}':`,r);this._PostResultToDOM(n,!1,""+r)}):this._PostResultToDOM(n,!0,m))}else m||l||console.warn(`[Runtime] No DOM handler '${g}' for component '${e}'`);else m||l||console.warn(`[Runtime] No DOM event handlers for component '${e}'`)}else this._waitingToHandleEvents.push(d)}_PostResultToDOM(d,e,g){this._messagePort.postMessage({type:"result",responseId:d,isOk:e,result:g})}_OnResultFromDOM(d){const e=
d.responseId,g=d.isOk;d=d.result;const h=this._pendingResponsePromises.get(e);g?h.resolve(d):h.reject(d);this._pendingResponsePromises.delete(e)}AddDOMComponentMessageHandler(d,e,g){let h=this._domEventHandlers.get(d);h||(h=new Map,this._domEventHandlers.set(d,h));if(h.has(e))throw Error(`[Runtime] Component '${d}' already has handler '${e}'`);h.set(e,g)}PostComponentMessageToDOM(d,e,g){this._messagePort.postMessage({type:"event",component:d,handler:e,data:g,responseId:null})}PostComponentMessageToDOMAsync(d,
e,g){const h=this._nextDomResponseId++,l=new Promise((m,n)=&gt;{this._pendingResponsePromises.set(h,{resolve:m,reject:n})});this._messagePort.postMessage({type:"event",component:d,handler:e,data:g,responseId:h});return l}PostToDebugger(d){if(!this.IsDebug())throw Error("not in debug mode");this.PostComponentMessageToDOM("runtime","post-to-debugger",d)}async Init(d){this.IsDebug()?await b.Init(this):self.C3Debugger&amp;&amp;self.C3Debugger.InitPreview(this);var [e]=await Promise.all([this._assetManager.FetchJson(this._dataJsonFilename),
this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);this._LoadDataJson(e);await this._InitialiseCanvas(d);this.IsPreview()||console.info("Made with Construct 3, the game and app creator :: https://www.construct.net");(e=this.GetWebGLRenderer())?(console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, rendering with WebGL ${e.GetWebGLVersionNumber()} [${e.GetUnmaskedRenderer()}] (${e.IsDesynchronized()?"desynchronized":"standard"} compositing)`),e.HasMajorPerformanceCaveat()&amp;&amp;
console.warn("[C3 runtime] WebGL indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance.")):console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?"worker":"DOM"}, headless`);this._isReadyToHandleEvents=!0;for(const g of this._waitingToHandleEvents)this._OnEventFromDOM(g);c.clearArray(this._waitingToHandleEvents);this._canvasManager&amp;&amp;this._canvasManager.StartLoadingScreen();for(const g of d.runOnStartupFunctions)this._additionalLoadPromises.push(this._RunOnStartupFunction(g));
await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]);c.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 c.Event("beforeruntimestart")),await this.Start(),this._messagePort.postMessage({type:"runtime-ready"}),this}async _RunOnStartupFunction(d){try{await d(this._iRuntime)}catch(e){console.error("[C3 runtime] Error in runOnStartup function: ",
e)}}_LoadDataJson(d){d=d.project;this._projectName=d[0];this._projectVersion=d[16];this._projectUniqueId=d[31];this._appId=d[38];this._loadingLogoFilename=d[39];this._isPixelRoundingEnabled=!!d[9];this._originalViewportWidth=this._viewportWidth=d[10];this._originalViewportHeight=this._viewportHeight=d[11];this._parallaxXorigin=this._originalViewportWidth/2;this._parallaxYorigin=this._originalViewportHeight/2;this._compositingMode=d[36];this._framerateMode=d[37];"low-latency"===this._compositingMode&amp;&amp;
this.IsAndroidWebView()&amp;&amp;77&gt;=c.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._sampling=d[14];this._usesLoaderLayout=!!d[18];this._loaderStyle=d[19];this._nextUid=d[21];this._pauseOnBlur=d[22];this._assetManager._SetAudioFiles(d[7],d[25]);this._assetManager._SetMediaSubfolder(d[8]);
this._assetManager._SetFontsSubfolder(d[32]);this._assetManager._SetIconsSubfolder(d[28]);this._assetManager._SetWebFonts(d[29]);this._canvasManager&amp;&amp;(this._canvasManager.SetFullscreenMode(c.CanvasManager._FullscreenModeNumberToString(d[12])),this._canvasManager.SetFullscreenScalingQuality(d[23]?"high":"low"),this._canvasManager.SetMipmapsEnabled(0!==d[24]),this._canvasManager._SetGPUPowerPreference(d[34]));this._pluginManager.CreateSystemPlugin();this._objectReferenceTable=self.C3_GetObjectRefTable();
for(var e of d[2])this._pluginManager.CreatePlugin(e);this._objectReferenceTable=self.C3_GetObjectRefTable();this._LoadJsPropNameTable();for(var g of d[3])e=c.ObjectClass.Create(this,this._allObjectClasses.length,g),this._allObjectClasses.push(e),this._objectClassesByName.set(e.GetName().toLowerCase(),e),this._objectClassesBySid.set(e.GetSID(),e);for(const m of d[4])this._allObjectClasses[m[0]]._LoadFamily(m);for(var h of d[27])g=h.map(m=&gt;this._allObjectClasses[m]),this._allContainers.push(c.New(c.Container,
this,g));for(const m of this._allObjectClasses)m._OnAfterCreate();for(const m of d[5])this._layoutManager.Create(m);(h=d[1])&amp;&amp;(h=this._layoutManager.GetLayoutByName(h))&amp;&amp;this._layoutManager.SetFirstLayout(h);for(var l of d[33])this._timelineManager.Create(l);for(const m of d[35])this._transitionManager.Create(m);this._InitScriptInterfaces();for(const m of d[6])this._eventSheetManager.Create(m);this._eventSheetManager._PostInit();this._InitGlobalVariableScriptInterface();c.clearArray(this._objectReferenceTable);
this.FlushPendingInstances();l="any";d=d[20];1===d?l="portrait":2===d&amp;&amp;(l="landscape");this.PostComponentMessageToDOM("runtime","set-target-orientation",{targetOrientation:l})}GetLoaderStyle(){return this._loaderStyle}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(d){this._additionalLoadPromises.push(d)}SetUsingCreatePromises(d){this._isUsingCreatePromises=!!d}AddCreatePromise(d){this._isUsingCreatePromises&amp;&amp;this._additionalCreatePromises.push(d)}GetCreatePromises(){return this._additionalCreatePromises}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(d){this._allEffectLists.push(d)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(d){this._canvasManager&amp;&amp;
(await this._canvasManager.CreateCanvas(d),this._canvasManager.InitLoadingScreen(this._loaderStyle))}async _MaybeLoadOpusDecoder(){if(!this._assetManager.IsAudioFormatSupported("audio/webm; codecs=opus")){var d=null,e=null;try{this.IsiOSCordova()&amp;&amp;"file:"===location.protocol?e=await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl):d=await this._assetManager.FetchBlob(this._opusWasmBinaryUrl)}catch(g){console.info("Failed to fetch Opus decoder WASM; assuming project has no Opus audio.",
g);return}e?this.AddJobWorkerBuffer(e,"opus-decoder-wasm"):this.AddJobWorkerBlob(d,"opus-decoder-wasm");await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}}async _WasmDecodeWebMOpus(d){return await this.AddJob("OpusDecode",{arrayBuffer:d},[d])}async Start(){this._hasStarted=!0;this._startTime=Date.now();if(this._usesLoaderLayout){for(var d of this._allObjectClasses)d.IsFamily()||d.IsOnLoaderLayout()||!d.IsWorldType()||d.OnCreate();this._assetManager.WaitForAllToLoad().then(()=&gt;{this._isLoading=
!1;this._OnLoadFinished()})}else this._isLoading=!1;this._assetManager.SetInitialLoadFinished();this.IsDebug()&amp;&amp;b.RuntimeInit(f);for(const e of this._layoutManager.GetAllLayouts())e._CreateGlobalNonWorlds();d=this._layoutManager.GetFirstLayout();await d._Load(null,this.GetWebGLRenderer());await d._StartRunning(!0);this._fpsLastTime=performance.now();this._usesLoaderLayout||this._OnLoadFinished();(await this.PostComponentMessageToDOMAsync("runtime","before-start-ticking")).isSuspended?this._suspendCount++:
this.Tick()}_OnLoadFinished(){this.Trigger(c.Plugins.System.Cnds.OnLoadFinished,null,null);this.PostComponentMessageToDOM("runtime","register-sw")}GetObjectReference(d){d=Math.floor(d);const e=this._objectReferenceTable;if(0&gt;d||d&gt;=e.length)throw Error("invalid object reference");return e[d]}_LoadJsPropNameTable(){for(const d of self.C3_JsPropNameTable){const e=c.first(Object.keys(d));this._jsPropNameTable.push(e)}}GetJsPropName(d){d=Math.floor(d);const e=this._jsPropNameTable;if(0&gt;d||d&gt;=e.length)throw Error("invalid prop reference");
return e[d]}HasDOM(){return this._hasDom}IsHeadless(){return this._isHeadless}IsInWorker(){return this._isInWorker}GetBaseURL(){return this._baseUrl}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(d){d=Math.floor(d);if(0&gt;d||d&gt;=this._allObjectClasses.length)throw new RangeError("invalid index");return this._allObjectClasses[d]}GetObjectClassByName(d){return this._objectClassesByName.get(d.toLowerCase())||null}GetObjectClassBySID(d){return this._objectClassesBySid.get(d)||
null}GetSingleGlobalObjectClassByCtor(d){return(d=this._pluginManager.GetPluginByConstructorFunction(d))?d.GetSingleGlobalObjectClass():null}GetAllObjectClasses(){return this._allObjectClasses}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(d){d.runtime=this.GetIRuntime();const e=this.IsDebug()&amp;&amp;!this._eventSheetManager.IsInEventEngine();e&amp;&amp;b.StartMeasuringScriptTime();this._userScriptDispatcher.dispatchEvent(d);e&amp;&amp;b.AddScriptTime()}DispatchUserScriptEventAsyncWait(d){d.runtime=
this.GetIRuntime();return this._userScriptDispatcher.dispatchEventAndWaitAsync(d)}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(d,e){this._originalViewportWidth=d;this._originalViewportHeight=e}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(d,e){this._viewportWidth=d;this._viewportHeight=e}_SetDevicePixelRatio(d){this._devicePixelRatio=
d}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}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(d){return this._canvasManager?
this._canvasManager.GetAdditionalRenderTarget(d):null}ReleaseAdditionalRenderTarget(d){this._canvasManager&amp;&amp;this._canvasManager.ReleaseAdditionalRenderTarget(d)}_SetUsesAnyBackgroundBlending(d){this._usesAnyBackgroundBlending=!!d}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}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}GetLoadingLogoFilename(){return this._loadingLogoFilename}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetAssetManager(){return this._assetManager}LoadImage(d){return this._assetManager.LoadImage(d)}CreateInstance(d,
e,g,h){return this.CreateInstanceFromData(d,e,!1,g,h)}CreateInstanceFromData(d,e,g,h,l,m){let n=null,r=null;if(d instanceof c.ObjectClass){r=d;if(r.IsFamily()){d=r.GetFamilyMembers();var q=Math.floor(this.Random()*d.length);r=d[q]}n=r.GetDefaultInstanceData()}else n=d,r=this.GetObjectClassByIndex(n[1]);const t=r.GetPlugin().IsWorldType();if(this._isLoading&amp;&amp;t&amp;&amp;!r.IsOnLoaderLayout())return null;const u=e;t||(e=null);var w=g&amp;&amp;!m&amp;&amp;n&amp;&amp;!this._instancesByUid.has(n[2])?n[2]:this._nextUid++;q=n?n[0]:null;
d=c.New(c.Instance,{runtime:this,objectType:r,layer:e,worldData:q,instVarData:n?n[3]:null,uid:w});this._instancesByUid.set(w,d);w=null;t&amp;&amp;(w=d.GetWorldInfo(),"undefined"!==typeof h&amp;&amp;"undefined"!==typeof l&amp;&amp;(w.SetX(h),w.SetY(l)),r._SetAnyCollisionCellChanged(!0));e&amp;&amp;(e._AddInstance(d,!0),1===e.GetParallaxX()&amp;&amp;1===e.GetParallaxY()||r._SetAnyInstanceParallaxed(!0),e.GetLayout().MaybeLoadTexturesFor(r));this._objectCount++;if(r.IsInContainer()&amp;&amp;!g&amp;&amp;!m){for(var y of r.GetContainer().objectTypes())y!==
r&amp;&amp;(e=this.CreateInstanceFromData(y,u,!1,w?w.GetX():h,w?w.GetY():l,!0),d._AddSibling(e));for(const C of d.siblings()){C._AddSibling(d);for(const G of d.siblings())C!==G&amp;&amp;C._AddSibling(G)}}r._SetIIDsStale();h=n?c.cloneArray(n[5]):null;l=n?n[4].map(C=&gt;c.cloneArray(C)):null;(y=t&amp;&amp;q&amp;&amp;14===q.length)&amp;&amp;d._SetHasTilemap();d._CreateSdkInstance(h,l);y&amp;&amp;(h=q[13],d.GetSdkInstance().LoadTilemapData(h[2],h[0],h[1]));this._instancesPendingCreate.push(d);this._hasPendingInstances=!0;this.IsDebug()&amp;&amp;b.InstanceCreated(d);
return d}DestroyInstance(d){if(!this._instancesToReleaseAtEndOfTick.has(d)){var e=d.GetObjectClass(),g=this._instancesPendingDestroy.get(e);if(g){if(g.has(d))return;g.add(d)}else g=new Set,g.add(d),this._instancesPendingDestroy.set(e,g);this.IsDebug()&amp;&amp;b.InstanceDestroyed(d);d._MarkDestroyed();this._hasPendingInstances=!0;if(d.IsInContainer())for(const h of d.siblings())this.DestroyInstance(h);for(const h of d.children())h.GetDestroyWithParent()&amp;&amp;this.DestroyInstance(h);this._layoutManager.IsEndingLayout()||
this._isLoadingState||(e=this.GetEventSheetManager(),e.BlockFlushingInstances(!0),d._TriggerOnDestroyed(),e.BlockFlushingInstances(!1));d._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 d of this._instancesPendingCreate){const e=
d.GetObjectClass();e._AddInstance(d);for(const g of e.GetFamilies())g._AddInstance(d),g._SetIIDsStale()}c.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(!0);for(const [d,e]of this._instancesPendingDestroy.entries())this._FlushInstancesPendingDestroyForObjectClass(d,e),e.clear();this._instancesPendingDestroy.clear();this._dispatcher.SetDelayRemoveEventsEnabled(!1)}_FlushInstancesPendingDestroyForObjectClass(d,e){for(const h of e){var g=
this._eventObjects.instancedestroy;g.instance=h;this._dispatcher.dispatchEvent(g);this._instancesByUid.delete(h.GetUID());if(g=h.GetWorldInfo())g._RemoveFromCollisionCells(),g._RemoveFromRenderCells();this._instancesToReleaseAtEndOfTick.add(h);this._objectCount--}c.arrayRemoveAllInSet(d.GetInstances(),e);d._SetIIDsStale();this._instancesToReleaseAffectedObjectClasses.add(d);0===d.GetInstances().length&amp;&amp;d._SetAnyInstanceParallaxed(!1);for(const h of d.GetFamilies())c.arrayRemoveAllInSet(h.GetInstances(),
e),h._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(h);if(d.GetPlugin().IsWorldType()){d=new Set([...e].map(h=&gt;h.GetWorldInfo().GetLayer()));for(const h of d)h._RemoveAllInstancesInSet(e)}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(d,e){this._instancesByUid.set(d,e)}_OnWebGLContextLost(){this._dispatcher.dispatchEvent(c.New(c.Event,"webglcontextlost"));this.SetSuspended(!0);for(var d of this._allObjectClasses)!d.IsFamily()&amp;&amp;
d.HasLoadedTextures()&amp;&amp;d.ReleaseTextures();(d=this.GetMainRunningLayout())&amp;&amp;d._OnWebGLContextLost();c.ImageInfo.OnWebGLContextLost();c.ImageAsset.OnWebGLContextLost()}async _OnWebGLContextRestored(){await this.GetMainRunningLayout()._Load(null,this.GetWebGLRenderer());this._dispatcher.dispatchEvent(c.New(c.Event,"webglcontextrestored"));this.SetSuspended(!1);this.UpdateRender()}_OnVisibilityChange(d){this.SetSuspended(d.hidden)}_OnWindowBlur(d){this.IsPreview()&amp;&amp;this._pauseOnBlur&amp;&amp;!c.Platform.IsMobile&amp;&amp;
!d.data.parentHasFocus&amp;&amp;(this.SetSuspended(!0),this._isPausedOnBlur=!0)}_OnWindowFocus(){this._isPausedOnBlur&amp;&amp;(this.SetSuspended(!1),this._isPausedOnBlur=!1)}_RequestAnimationFrame(){const d=this._tickCallbacks;"vsync"===this._framerateMode?-1===this._rafId&amp;&amp;(this._rafId=self.requestAnimationFrame(d.normal)):"unlimited-tick"===this._framerateMode?(-1===this._ruafId&amp;&amp;(this._ruafId=c.RequestUnlimitedAnimationFrame(d.tickOnly)),-1===this._rafId&amp;&amp;(this._rafId=self.requestAnimationFrame(d.renderOnly))):
-1===this._ruafId&amp;&amp;(this._ruafId=c.RequestUnlimitedAnimationFrame(d.normal))}_CancelAnimationFrame(){-1!==this._rafId&amp;&amp;(self.cancelAnimationFrame(this._rafId),this._rafId=-1);-1!==this._ruafId&amp;&amp;(c.CancelUnlimitedAnimationFrame(this._ruafId),this._ruafId=-1)}IsSuspended(){return 0&lt;this._suspendCount}SetSuspended(d){var e=this.IsSuspended();this._suspendCount+=d?1:-1;0&gt;this._suspendCount&amp;&amp;(this._suspendCount=0);d=this.IsSuspended();!e&amp;&amp;d?(console.log("[Construct 3] Suspending"),this._CancelAnimationFrame(),
this._dispatcher.dispatchEvent(c.New(c.Event,"suspend")),this.Trigger(c.Plugins.System.Cnds.OnSuspend,null,null)):e&amp;&amp;!d&amp;&amp;(console.log("[Construct 3] Resuming"),this._fpsLastTime=this._lastTickTime=e=performance.now(),this._mainThreadTimeCounter=this._mainThreadTime=this._fps=this._fpsFrameCount=0,this._dispatcher.dispatchEvent(c.New(c.Event,"resume")),this.Trigger(c.Plugins.System.Cnds.OnResume,null,null),this.HitBreakpoint()||this.Tick(e))}_AddBehInstToTick(d){this._behInstsToTick.Add(d)}_AddBehInstToPostTick(d){this._behInstsToPostTick.Add(d)}_AddBehInstToTick2(d){this._behInstsToTick2.Add(d)}_RemoveBehInstToTick(d){this._behInstsToTick.Remove(d)}_RemoveBehInstToPostTick(d){this._behInstsToPostTick.Remove(d)}_RemoveBehInstToTick2(d){this._behInstsToTick2.Remove(d)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);
for(const d of this._behInstsToTick)d.Tick();this._behInstsToTick.SetQueueingEnabled(!1)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const d of this._behInstsToPostTick)d.PostTick();this._behInstsToPostTick.SetQueueingEnabled(!1)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const d of this._behInstsToTick2)d.Tick2();this._behInstsToTick2.SetQueueingEnabled(!1)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const d of this._behInstsToTick){const e=
d.Tick();c.IsIterator(e)&amp;&amp;(yield*e)}this._behInstsToTick.SetQueueingEnabled(!1)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const d of this._behInstsToPostTick){const e=d.PostTick();c.IsIterator(e)&amp;&amp;(yield*e)}this._behInstsToPostTick.SetQueueingEnabled(!1)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const d of this._behInstsToTick2){const e=d.Tick2();c.IsIterator(e)&amp;&amp;(yield*e)}this._behInstsToTick2.SetQueueingEnabled(!1)}async Tick(d,e,
g){this._hasStartedTicking=!0;const h="background-wake"===g;g="background-wake"!==g&amp;&amp;"skip-render"!==g;this._hasStarted&amp;&amp;(!this.IsSuspended()||e||h)&amp;&amp;(e=performance.now(),this._isInTick=!0,d||(d=e),this._MeasureDt(d),d=this.Step_BeforePreTick(),this.IsDebugging()&amp;&amp;await d,d=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects.pretick),d instanceof Promise&amp;&amp;await d,d=this.Step_AfterPreTick(),this.IsDebugging()&amp;&amp;await d,this._NeedsHandleSaveOrLoad()&amp;&amp;await this._HandleSaveOrLoad(),
this.GetLayoutManager().IsPendingChangeMainLayout()&amp;&amp;await this._MaybeChangeLayout(),d=this.Step_RunEventsEtc(),this.IsDebugging()&amp;&amp;await d,g&amp;&amp;this.Render(),this.IsSuspended()||h||this._RequestAnimationFrame(),this._tickCount++,this._tickCountNoSave++,this._execCount++,this._isInTick=!1,this._mainThreadTimeCounter+=performance.now()-e)}async Step_BeforePreTick(){const d=this._eventSheetManager,e=this.IsDebug();this.FlushPendingInstances();d.BlockFlushingInstances(!0);this.PushCurrentLayout(this.GetMainRunningLayout());
e&amp;&amp;b.StartMeasuringTime();this.IsDebugging()?await d.DebugRunScheduledWaits():d.RunScheduledWaits();e&amp;&amp;b.AddEventsTime();this.PopCurrentLayout();d.BlockFlushingInstances(!1);this.FlushPendingInstances();d.BlockFlushingInstances(!0)}async Step_AfterPreTick(){const d=this.IsDebug(),e=this.IsDebugging(),g=this._dispatcher,h=this._eventObjects,l=this._userScriptEventObjects;d&amp;&amp;b.StartMeasuringTime();e?await this.DebugIterateAndBreak(this._DebugBehaviorTick()):this._BehaviorTick();e?await this.DebugIterateAndBreak(this._DebugBehaviorPostTick()):
this._BehaviorPostTick();d&amp;&amp;b.AddBehaviorTickTime();d&amp;&amp;b.StartMeasuringTime();e?await this.DebugFireGeneratorEventAndBreak(h.tick):g.dispatchEvent(h.tick);d&amp;&amp;b.AddPluginTickTime();this._eventSheetManager.BlockFlushingInstances(!1);this.DispatchUserScriptEvent(l.tick)}async Step_RunEventsEtc(){const d=this._eventSheetManager,e=this._dispatcher,g=this._eventObjects,h=this.IsDebug(),l=this.IsDebugging();h&amp;&amp;b.StartMeasuringTime();l?await d.DebugRunEvents(this._layoutManager):d.RunEvents(this._layoutManager);
h&amp;&amp;b.AddEventsTime();this._collisionEngine.ClearRegisteredCollisions();if(0&lt;this._instancesToReleaseAtEndOfTick.size){e.SetDelayRemoveEventsEnabled(!0);for(const m of this._instancesToReleaseAffectedObjectClasses)m.GetSolStack().RemoveInstances(this._instancesToReleaseAtEndOfTick);this._instancesToReleaseAffectedObjectClasses.clear();this._eventSheetManager.RemoveInstancesFromScheduledWaits(this._instancesToReleaseAtEndOfTick);for(const m of this._instancesToReleaseAtEndOfTick)m.Release();this._instancesToReleaseAtEndOfTick.clear();
e.SetDelayRemoveEventsEnabled(!1)}this._isLayoutFirstTick=!1;d.BlockFlushingInstances(!0);h&amp;&amp;b.StartMeasuringTime();l?await this.DebugIterateAndBreak(this._DebugBehaviorTick2()):this._BehaviorTick2();h&amp;&amp;b.AddBehaviorTickTime();h&amp;&amp;b.StartMeasuringTime();l?await this.DebugFireGeneratorEventAndBreak(g.tick2):e.dispatchEvent(g.tick2);h&amp;&amp;b.AddPluginTickTime();d.BlockFlushingInstances(!1);l&amp;&amp;await d.RunQueuedDebugTriggersAsync()}async _MaybeChangeLayout(){const d=this.GetLayoutManager();let e=0;for(;d.IsPendingChangeMainLayout()&amp;&amp;
10&gt;e++;)await this._DoChangeLayout(d.GetPendingChangeMainLayout())}_MeasureDt(d){if(0!==this._lastTickTime){this._dt1=Math.max(d-this._lastTickTime,0)/1E3;const e=1/this._minimumFramerate;.5&lt;this._dt1?this._dt1=0:this._dt1&gt;e&amp;&amp;(this._dt1=e)}this._lastTickTime=d;this._dt=this._dt1*this._timeScale;this._gameTime.Add(this._dt);this._wallTime.Add(this._dt1);this._canvasManager&amp;&amp;this._canvasManager._UpdateTick();1E3&lt;=d-this._fpsLastTime&amp;&amp;(this._fpsLastTime+=1E3,1E3&lt;=d-this._fpsLastTime&amp;&amp;(this._fpsLastTime=
d),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;b.Update1sPerfStats());this._fpsFrameCount++}async _DoChangeLayout(d){const e=this._dispatcher,g=this.GetLayoutManager().GetMainRunningLayout();await g._StopRunning();g._Unload(d,this.GetWebGLRenderer());g===d&amp;&amp;this._eventSheetManager.ClearAllScheduledWaits();
this._collisionEngine.ClearRegisteredCollisions();e.dispatchEvent(this._eventObjects.beforelayoutchange);c.Asyncify.SetHighThroughputMode(!0);await d._Load(g,this.GetWebGLRenderer());c.Asyncify.SetHighThroughputMode(!1);await d._StartRunning(!1);e.dispatchEvent(this._eventObjects.layoutchange);this.UpdateRender();this._isLayoutFirstTick=!0;this.FlushPendingInstances()}UpdateRender(){this._needRender=!0}GetWebGLRenderer(){return this._canvasManager?this._canvasManager.GetWebGLRenderer():null}GetRenderer(){return this.GetWebGLRenderer()}Render(){if(this._canvasManager&amp;&amp;
!this._canvasManager.IsWebGLContextLost()){var d=this.GetWebGLRenderer();d.Start();d.CheckForQueryResults();if(this._needRender){var e=this.IsDebug();e&amp;&amp;b.StartMeasuringTime();this._needRender=!1;var g=null;d.SupportsGPUProfiling()&amp;&amp;(g=this._canvasManager.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery(),d.StartQuery(g));d.SetTextureFillMode();d.SetAlphaBlend();d.SetColorRgba(1,1,1,1);d.SetRenderTarget(null);d.SetTexture(null);this._layoutManager.GetMainRunningLayout().Draw(d);g&amp;&amp;d.EndQuery(g);d.Finish();
e&amp;&amp;(b.AddDrawCallsTime(),b.UpdateInspectHighlight());this._canvasManager&amp;&amp;this._canvasManager._MaybeTakeSnapshot()}else d.IncrementFrameNumber()}}Trigger(d,e,g){if(!this._hasStarted)return!1;var h=!this._isInTick&amp;&amp;!this._eventSheetManager.IsInTrigger();let l=0;h&amp;&amp;(l=performance.now());const m=this.IsDebug();m&amp;&amp;this.SetDebuggingEnabled(!1);d=this._eventSheetManager._Trigger(this._layoutManager,d,e,g);h&amp;&amp;(h=performance.now()-l,this._mainThreadTimeCounter+=h,m&amp;&amp;b.AddTriggersTime(h));m&amp;&amp;this.SetDebuggingEnabled(!0);
return d}DebugTrigger(d,e,g){if(!this.IsDebug())return this.Trigger(d,e,g);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,d,e,g)}async TriggerAsync(d,e,g){if(!this.IsDebugging())return this.Trigger(d,e,g);if(!this._hasStarted)return!1;if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(d,
e,g);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(d,e,g);const h=performance.now();d=this._eventSheetManager._DebugTrigger(this._layoutManager,d,e,g);for(e=d.next();!e.done;)await this.DebugBreak(e.value),e=d.next();this.IsSuspended()||this._eventSheetManager.IsInTrigger()||(await this._eventSheetManager.RunQueuedDebugTriggersAsync(),this._hasStartedTicking&amp;&amp;!this._isInTick&amp;&amp;this._RequestAnimationFrame());this._mainThreadTimeCounter+=performance.now()-h;return e.value}FastTrigger(d,
e,g){const h=this.IsDebug();h&amp;&amp;this.SetDebuggingEnabled(!1);d=this._eventSheetManager._FastTrigger(this._layoutManager,d,e,g);h&amp;&amp;this.SetDebuggingEnabled(!0);return d}DebugFastTrigger(d,e,g){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,d,e,g)}ScheduleTriggers(d){return this._scheduleTriggersThrottle.Add(d)}PushCurrentLayout(d){this._currentLayoutStack.push(d)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw Error("layout stack empty");this._currentLayoutStack.pop()}GetCurrentLayout(){return this._currentLayoutStack.length?
this._currentLayoutStack[this._currentLayoutStack.length-1]:this.GetMainRunningLayout()}GetDt(d){return d&amp;&amp;-1!==d.GetTimeScale()?this._dt1*d.GetTimeScale():this._dt}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetTimeScale(){return this._timeScale}SetTimeScale(d){if(isNaN(d)||0&gt;d)d=0;this._timeScale=d}SetMinimumFramerate(d){this._minimumFramerate=c.clamp(d,1,120)}GetMinimumFramerate(){return this._minimumFramerate}GetFPS(){return this._fps}GetMainThreadTime(){return this._mainThreadTime}GetStartTime(){return this._startTime}GetGameTime(){return this._gameTime.Get()}GetWallTime(){return this._wallTime.Get()}GetTickCount(){return this._tickCount}GetTickCountNoSave(){return this._tickCountNoSave}IncrementExecCount(){++this._execCount}GetExecCount(){return this._execCount}GetObjectCount(){return this._objectCount}GetProjectName(){return this._projectName}GetProjectVersion(){return this._projectVersion}GetProjectUniqueId(){return this._projectUniqueId}GetAppId(){return this._appId}GetInstanceByUID(d){if(this._isLoadingState)throw Error("cannot call while loading state - wait until afterload event");
return this._instancesByUid.get(d)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const d of this._allObjectClasses)if(!d.IsFamily())for(const e of d.GetInstances())this._instancesByUid.set(e.GetUID(),e)}IsPreview(){return"preview"===this._exportType}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return"cordova"===this._exportType}IsAndroidWebView(){return"Android"===c.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()}IsLayoutFirstTick(){return this._isLayoutFirstTick}SetPixelRoundingEnabled(d){d=!!d;this._isPixelRoundingEnabled!==d&amp;&amp;(this._isPixelRoundingEnabled=d,this.UpdateRender())}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}SaveToSlot(d){this._saveToSlotName=
d}LoadFromSlot(d){this._loadFromSlotName=d}LoadFromJsonString(d){this._loadFromJson=d}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;
b.StepIfPausedInDebugger());if(null!==this._loadFromJson){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson),this._lastSaveJson=this._loadFromJson,await this.TriggerAsync(c.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=""}catch(d){console.error("[Construct 3] Failed to load state from JSON string: ",d),await this.TriggerAsync(c.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(d){const e=await this._SaveToJsonString();
try{await this._GetSavegamesStorage().setItem(d,e),console.log("[Construct 3] Saved state to storage ("+e.length+" chars)"),this._lastSaveJson=e,await this.TriggerAsync(c.Plugins.System.Cnds.OnSaveComplete,null),this._lastSaveJson=""}catch(g){console.error("[Construct 3] Failed to save state to storage: ",g),await this.TriggerAsync(c.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(d){try{const e=await this._GetSavegamesStorage().getItem(d);if(!e)throw Error("empty slot");console.log("[Construct 3] Loaded state from storage ("+
e.length+" chars)");await this._DoLoadFromJsonString(e);this._lastSaveJson=e;await this.TriggerAsync(c.Plugins.System.Cnds.OnLoadComplete,null);this._lastSaveJson=""}catch(e){console.error("[Construct 3] Failed to load state from storage: ",e),await this.TriggerAsync(c.Plugins.System.Cnds.OnLoadFailed,null)}}async _SaveToJsonString(){const d={c3save:!0,version:1,rt:{time:this.GetGameTime(),walltime:this.GetWallTime(),timescale:this.GetTimeScale(),tickcount:this.GetTickCount(),execcount:this.GetExecCount(),
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 e of this._allObjectClasses)e.IsFamily()||e.HasNoSaveBehavior()||(d.types[e.GetSID().toString()]=e._SaveToJson());for(const g of this._layoutManager.GetAllLayouts())d.layouts[g.GetSID().toString()]=g._SaveToJson();e=this._CreateUserScriptEvent("save");
e.saveData=null;await this.DispatchUserScriptEventAsyncWait(e);d.user_script_data=e.saveData;return JSON.stringify(d)}IsLoadingState(){return this._isLoadingState}_TriggerOnCreateAfterLoad(d){c.shallowAssignArray(this._triggerOnCreateAfterLoad,d)}async _DoLoadFromJsonString(d){d=JSON.parse(d);if(d.c2save)throw Error("C2 saves are incompatible with C3 runtime");if(!d.c3save)throw Error("not valid C3 save data");if(1&lt;d.version)throw Error("C3 save data from future version");this._isLoadingState=!0;
var e=d.rt;this._gameTime.Set(e.time);this._wallTime.Set(e.walltime);this._timeScale=e.timescale;this._tickCount=e.tickcount;this._execCount=e.execcount;this._startTime=Date.now()-e.start_time_offset;var g=e.running_layout;if(g!==this.GetMainRunningLayout().GetSID())if(g=this._layoutManager.GetLayoutBySID(g))await this._DoChangeLayout(g);else return;for(const [m,n]of Object.entries(d.types))g=parseInt(m,10),g=this.GetObjectClassBySID(g),!g||g.IsFamily()||g.HasNoSaveBehavior()||g._LoadFromJson(n);
this.FlushPendingInstances();this._RefreshUidMap();this._isLoadingState=!1;this._nextUid=e.next_uid;for(const [m,n]of Object.entries(d.layouts))e=parseInt(m,10),(e=this._layoutManager.GetLayoutBySID(e))&amp;&amp;e._LoadFromJson(n);this._eventSheetManager._LoadFromJson(d.events);for(var h of this._triggerOnCreateAfterLoad)h._TriggerOnCreated(),h.SetupInitialSceneGraphConnections();c.clearArray(this._triggerOnCreateAfterLoad);for(var l of this._allObjectClasses)if(!l.IsFamily()&amp;&amp;l.IsInContainer())for(const m of l.GetInstances()){h=
m.GetIID();for(const n of l.GetContainer().objectTypes())if(n!==l){e=n.GetInstances();if(0&gt;h||h&gt;=e.length)throw Error("missing sibling instance");m._AddSibling(e[h])}}this._timelineManager._LoadFromJson(d.timelines);this._dispatcher.dispatchEvent(c.New(c.Event,"afterload"));l=this._CreateUserScriptEvent("load");l.saveData=d.user_script_data;await this.DispatchUserScriptEventAsyncWait(l);this.UpdateRender()}async AddJobWorkerScripts(d){d=(await Promise.all(d.map(e=&gt;this._assetManager.FetchBlob(e)))).map(e=&gt;
URL.createObjectURL(e));this._jobScheduler.ImportScriptsToJobWorkers(d)}AddJobWorkerBlob(d,e){this._jobScheduler.SendBlobToJobWorkers(d,e)}AddJobWorkerBuffer(d,e){this._jobScheduler.SendBufferToJobWorkers(d,e)}AddJob(d,e,g){return this._jobScheduler.AddJob(d,e,g)}BroadcastJob(d,e,g){return this._jobScheduler.BroadcastJob(d,e,g)}InvokeDownload(d,e){this.PostComponentMessageToDOM("runtime","invoke-download",{url:d,filename:e})}async RasterSvgImage(d,e,g,h,l,m){h=h||e;l=l||g;if(this.IsInWorker())return(await this.PostComponentMessageToDOMAsync("runtime",
"raster-svg-image",{blob:d,imageWidth:e,imageHeight:g,surfaceWidth:h,surfaceHeight:l,imageBitmapOpts:m})).imageBitmap;d=await self.C3_RasterSvgImageBlob(d,e,g,h,l);return m?await self.createImageBitmap(d,m):d}async GetSvgImageSize(d){return this.IsInWorker()?await this.PostComponentMessageToDOMAsync("runtime","get-svg-image-size",{blob:d}):await self.C3_GetSvgImageSize(d)}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(d){this._randomNumberCallback=d}_GetRemotePreviewStatusInfo(){return{fps:this.GetFPS(),cpu:this.GetMainThreadTime(),gpu:this.GetGPUUtilisation(),layout:this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():"",renderer:this.GetWebGLRenderer().GetUnmaskedRenderer()}}HitBreakpoint(){return this.IsDebug()?
b.HitBreakpoint():!1}DebugBreak(d){return this.IsDebugging()?b.DebugBreak(d):Promise.resolve()}DebugBreakNext(){return this.IsDebugging()?b.BreakNext():!1}SetDebugBreakpointsEnabled(d){this._breakpointsEnabled=!!d;this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(d){d?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;b.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&amp;&amp;this.GetWebGLRenderer().SupportsGPUProfiling()&amp;&amp;b.IsGPUProfiling()}async DebugIterateAndBreak(d){if(d)for(const e of d)await this.DebugBreak(e)}DebugFireGeneratorEventAndBreak(d){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(d))}_InvokeFunctionFromJS(d){return this._eventSheetManager._InvokeFunctionFromJS(d.name,d.params)}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(d){d=
c.New(c.Event,d,!1);d.runtime=this._iRuntime;return d}_InitScriptInterfaces(){var d={};for(const e of this._allObjectClasses)d[e.GetJsPropName()]={value:e.GetIObjectClass(),enumerable:!0,writable:!1};d=Object.create(Object.prototype,d);this._iRuntime=new self.IRuntime(this,d);this._userScriptEventObjects={tick:this._CreateUserScriptEvent("tick")}}_InitGlobalVariableScriptInterface(){const d={};for(const e of this.GetEventSheetManager().GetAllGlobalVariables())d[e.GetJsPropName()]=e._GetScriptInterfaceDescriptor();
this._iRuntime._InitGlobalVars(d)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}_MapScriptInterface(d,e){this._interfaceMap.set(d,e)}_UnwrapScriptInterface(d){return this._interfaceMap.get(d)}};self.C3_CreateRuntime=c.Runtime.Create;self.C3_InitRuntime=(d,e)=&gt;d.Init(e)}"use strict";
{const c=self.C3;c.JobSchedulerRuntime=class extends c.DefendedBase{constructor(b,a){super();this._runtime=b;this._jobPromises=new Map;this._nextJobId=0;this._inputPort=a.inputPort;a.outputPort.onmessage=f=&gt;this._OnJobWorkerMessage(f);this._maxNumWorkers=a.maxNumWorkers;this._jobWorkerCount=1;this._hadErrorCreatingWorker=this._isCreatingWorker=!1}async Init(){}ImportScriptsToJobWorkers(b){this._inputPort.postMessage({type:"_import_scripts",scripts:b})}SendBlobToJobWorkers(b,a){this._inputPort.postMessage({type:"_send_blob",
blob:b,id:a})}SendBufferToJobWorkers(b,a){this._inputPort.postMessage({type:"_send_buffer",buffer:b,id:a},[b])}AddJob(b,a,f,d,e){f||(f=[]);const g=this._nextJobId++;b={type:b,isBroadcast:!1,jobId:g,params:a,transferables:f};a=new Promise((h,l)=&gt;{this._jobPromises.set(g,{resolve:h,progress:d,reject:l,cancelled:!1})});e&amp;&amp;e.SetAction(()=&gt;this._CancelJob(g));this._inputPort.postMessage(b,f);this._MaybeCreateExtraWorker();return a}BroadcastJob(b,a,f){f||(f=[]);const d=this._nextJobId++;this._inputPort.postMessage({type:b,
isBroadcast:!0,jobId:d,params:a,transferables:f},f)}_CancelJob(b){const a=this._jobPromises.get(b);a&amp;&amp;(a.cancelled=!0,a.resolve=null,a.progress=null,a.reject=null,this._inputPort.postMessage({type:"_cancel",jobId:b}))}_OnJobWorkerMessage(b){b=b.data;const a=b.type,f=b.jobId;switch(a){case "result":this._OnJobResult(f,b.result);break;case "progress":this._OnJobProgress(f,b.progress);break;case "error":this._OnJobError(f,b.error);break;case "ready":this._OnJobWorkerReady();break;default:throw Error(`unknown message from worker '${a}'`);
}}_OnJobResult(b,a){const f=this._jobPromises.get(b);if(!f)throw Error("invalid job ID");f.cancelled||f.resolve(a);this._jobPromises.delete(b)}_OnJobProgress(b,a){b=this._jobPromises.get(b);if(!b)throw Error("invalid job ID");!b.cancelled&amp;&amp;b.progress&amp;&amp;b.progress(a)}_OnJobError(b,a){const f=this._jobPromises.get(b);if(!f)throw Error("invalid job ID");f.cancelled||f.reject(a);this._jobPromises.delete(b)}_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=b=&gt;this._OnJobWorkerMessage(b)}catch(b){this._hadErrorCreatingWorker=!0,this._isCreatingWorker=
!1,console.error(`[Construct 3] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,b)}}}}self.C3_Shaders={};"use strict";
{const c=self.C3;let b=null,a="",f="",d=[],e="",g="",h="";const l=c.New(c.ArrayStack);function m(n,r){n=n[1];r=r[1];if("number"===typeof n&amp;&amp;"number"===typeof r)return n-r;n=""+n;r=""+r;return n&lt;r?-1:n&gt;r?1:0}c.Plugins.System=class extends c.SDKPluginBase{constructor(n){super(n);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(n){this._runtime.Trigger(n,
null,null)}GetRegex(n,r){b&amp;&amp;n===a&amp;&amp;r===f||(b=new RegExp(n,r),a=n,f=r);b.lastIndex=0;return b}GetRegexMatches(n,r,q){if(n===e&amp;&amp;r===g&amp;&amp;q===h)return d;const t=this.GetRegex(r,q);d=n.match(t);e=n;g=r;h=q;return d}async _LoadTexturesForObjectClasses(n,r){if(r.length){this._imagesLoadingTotal+=r.length;var q=[];for(const t of r)q.push(n.MaybeLoadTexturesFor(t));await c.PromiseAllWithProgress(q,()=&gt;{this._imagesLoadingComplete++});this._imagesLoadingComplete++;this._imagesLoadingComplete===this._imagesLoadingTotal&amp;&amp;
(this._runtime.Trigger(c.Plugins.System.Cnds.OnImageLoadingComplete,null,null),this._imagesLoadingTotal=this._imagesLoadingComplete=0)}}_UnloadTexturesForObjectClasses(n,r){for(const q of r)0===q.GetInstanceCount()&amp;&amp;n.MaybeUnloadTexturesFor(q)}_GetForEachStack(){return l}_Repeat(n){var r=this._runtime.GetEventSheetManager();const q=r.GetEventStack(),t=q.GetCurrentStackFrame(),u=t.GetCurrentEvent(),w=u.GetSolModifiers();var y=t.IsSolModifierAfterCnds();const C=q.Push(u),G=r.GetLoopStack(),x=G.Push();
x.SetEnd(n);if(y)for(y=0;y&lt;n&amp;&amp;!x.IsStopped();++y)r.PushCopySol(w),x.SetIndex(y),u.Retrigger(t,C),r.PopSol(w);else for(r=0;r&lt;n&amp;&amp;!x.IsStopped();++r)x.SetIndex(r),u.Retrigger(t,C);q.Pop();G.Pop();return!1}*_DebugRepeat(n){var r=this._runtime.GetEventSheetManager();const q=r.GetEventStack(),t=q.GetCurrentStackFrame(),u=t.GetCurrentEvent(),w=u.GetSolModifiers();var y=t.IsSolModifierAfterCnds();const C=q.Push(u),G=r.GetLoopStack(),x=G.Push();x.SetEnd(n);if(y)for(y=0;y&lt;n&amp;&amp;!x.IsStopped();++y)r.PushCopySol(w),
x.SetIndex(y),yield*u.DebugRetrigger(t,C),r.PopSol(w);else for(r=0;r&lt;n&amp;&amp;!x.IsStopped();++r)x.SetIndex(r),yield*u.DebugRetrigger(t,C);q.Pop();G.Pop();return!1}_While(){var n=this._runtime.GetEventSheetManager();const r=n.GetEventStack(),q=r.GetCurrentStackFrame(),t=q.GetCurrentEvent(),u=t.GetSolModifiers();var w=q.IsSolModifierAfterCnds();const y=r.Push(t),C=n.GetLoopStack(),G=C.Push();if(w)for(w=0;!G.IsStopped();++w)n.PushCopySol(u),G.SetIndex(w),t.Retrigger(q,y)||G.Stop(),n.PopSol(u);else for(n=
0;!G.IsStopped();++n)G.SetIndex(n),t.Retrigger(q,y)||G.Stop();r.Pop();C.Pop();return!1}*_DebugWhile(){var n=this._runtime.GetEventSheetManager();const r=n.GetEventStack(),q=r.GetCurrentStackFrame(),t=q.GetCurrentEvent(),u=t.GetSolModifiers();var w=q.IsSolModifierAfterCnds();const y=r.Push(t),C=n.GetLoopStack(),G=C.Push();if(w)for(w=0;!G.IsStopped();++w)n.PushCopySol(u),G.SetIndex(w),(yield*t.DebugRetrigger(q,y))||G.Stop(),n.PopSol(u);else for(n=0;!G.IsStopped();++n)G.SetIndex(n),(yield*t.DebugRetrigger(q,
y))||G.Stop();r.Pop();C.Pop();return!1}_For(n,r,q){var t=this._runtime.GetEventSheetManager();const u=t.GetEventStack(),w=u.GetCurrentStackFrame(),y=w.GetCurrentEvent(),C=y.GetSolModifiers(),G=w.IsSolModifierAfterCnds(),x=u.Push(y),B=t.GetLoopStack(),H=B.Push();H.SetName(n);H.SetEnd(q);if(q&lt;r)if(G)for(n=r;n&gt;=q&amp;&amp;!H.IsStopped();--n)t.PushCopySol(C),H.SetIndex(n),y.Retrigger(w,x),t.PopSol(C);else for(t=r;t&gt;=q&amp;&amp;!H.IsStopped();--t)H.SetIndex(t),y.Retrigger(w,x);else if(G)for(n=r;n&lt;=q&amp;&amp;!H.IsStopped();++n)t.PushCopySol(C),
H.SetIndex(n),y.Retrigger(w,x),t.PopSol(C);else for(t=r;t&lt;=q&amp;&amp;!H.IsStopped();++t)H.SetIndex(t),y.Retrigger(w,x);u.Pop();B.Pop();return!1}*_DebugFor(n,r,q){var t=this._runtime.GetEventSheetManager();const u=t.GetEventStack(),w=u.GetCurrentStackFrame(),y=w.GetCurrentEvent(),C=y.GetSolModifiers(),G=w.IsSolModifierAfterCnds(),x=u.Push(y),B=t.GetLoopStack(),H=B.Push();H.SetName(n);H.SetEnd(q);if(q&lt;r)if(G)for(n=r;n&gt;=q&amp;&amp;!H.IsStopped();--n)t.PushCopySol(C),H.SetIndex(n),yield*y.DebugRetrigger(w,x),t.PopSol(C);
else for(t=r;t&gt;=q&amp;&amp;!H.IsStopped();--t)H.SetIndex(t),yield*y.DebugRetrigger(w,x);else if(G)for(n=r;n&lt;=q&amp;&amp;!H.IsStopped();++n)t.PushCopySol(C),H.SetIndex(n),yield*y.DebugRetrigger(w,x),t.PopSol(C);else for(t=r;t&lt;=q&amp;&amp;!H.IsStopped();++t)H.SetIndex(t),yield*y.DebugRetrigger(w,x);u.Pop();B.Pop();return!1}_ForEach(n){var r=this._runtime.GetEventSheetManager();const q=r.GetEventStack(),t=q.GetCurrentStackFrame(),u=t.GetCurrentEvent(),w=u.GetSolModifiers();var y=t.IsSolModifierAfterCnds();const C=q.Push(u),
G=r.GetLoopStack(),x=G.Push(),B=n.IsInContainer(),H=n.GetCurrentSol(),P=l.Push();c.shallowAssignArray(P,H.GetInstances());x.SetEnd(P.length);if(y)for(let E=0,J=P.length;E&lt;J&amp;&amp;!x.IsStopped();++E)r.PushCopySol(w),y=P[E],n.GetCurrentSol().SetSinglePicked(y),B&amp;&amp;y.SetSiblingsSinglePicked(),x.SetIndex(E),u.Retrigger(t,C),r.PopSol(w);else{H._SetSelectAll(!1);n=H._GetOwnInstances();c.clearArray(n);n.push(null);for(let E=0,J=P.length;E&lt;J&amp;&amp;!x.IsStopped();++E)r=P[E],n[0]=r,B&amp;&amp;r.SetSiblingsSinglePicked(),x.SetIndex(E),
u.Retrigger(t,C)}q.Pop();G.Pop();c.clearArray(P);l.Pop();return!1}*_DebugForEach(n){var r=this._runtime.GetEventSheetManager();const q=r.GetEventStack(),t=q.GetCurrentStackFrame(),u=t.GetCurrentEvent(),w=u.GetSolModifiers();var y=t.IsSolModifierAfterCnds();const C=q.Push(u),G=r.GetLoopStack(),x=G.Push(),B=n.IsInContainer(),H=n.GetCurrentSol(),P=l.Push();c.shallowAssignArray(P,H.GetInstances());x.SetEnd(P.length);if(y)for(let E=0,J=P.length;E&lt;J&amp;&amp;!x.IsStopped();++E)r.PushCopySol(w),y=P[E],n.GetCurrentSol().SetSinglePicked(y),
B&amp;&amp;y.SetSiblingsSinglePicked(),x.SetIndex(E),yield*u.DebugRetrigger(t,C),r.PopSol(w);else{H._SetSelectAll(!1);n=H._GetOwnInstances();c.clearArray(n);n.push(null);for(let E=0,J=P.length;E&lt;J&amp;&amp;!x.IsStopped();++E)r=P[E],n[0]=r,B&amp;&amp;r.SetSiblingsSinglePicked(),x.SetIndex(E),yield*u.DebugRetrigger(t,C)}q.Pop();G.Pop();c.clearArray(P);l.Pop();return!1}_ForEachOrdered(n,r){var q=this._runtime.GetEventSheetManager();const t=q.GetEventStack(),u=q.GetCurrentCondition(),w=t.GetCurrentStackFrame(),y=w.GetCurrentEvent(),
C=y.GetSolModifiers(),G=w.IsSolModifierAfterCnds(),x=t.Push(y),B=q.GetLoopStack(),H=B.Push(),P=n.IsInContainer(),E=n.GetCurrentSol(),J=l.Push();c.clearArray(J);const O=E.GetInstances();H.SetEnd(O.length);for(let R=0,T=O.length;R&lt;T;++R)J.push([O[R],u.ReevaluateParameter(1,R)]);J.sort(m);1===r&amp;&amp;J.reverse();if(G)for(let R=0,T=J.length;R&lt;T&amp;&amp;!H.IsStopped();++R)q.PushCopySol(C),r=J[R][0],n.GetCurrentSol().SetSinglePicked(r),P&amp;&amp;r.SetSiblingsSinglePicked(),H.SetIndex(R),y.Retrigger(w,x),q.PopSol(C);else{E._SetSelectAll(!1);
n=E._GetOwnInstances();c.clearArray(n);n.push(null);for(let R=0,T=J.length;R&lt;T&amp;&amp;!H.IsStopped();++R)q=J[R][0],n[0]=q,P&amp;&amp;q.SetSiblingsSinglePicked(),H.SetIndex(R),y.Retrigger(w,x)}t.Pop();B.Pop();c.clearArray(J);l.Pop();return!1}*_DebugForEachOrdered(n,r){var q=this._runtime.GetEventSheetManager();const t=q.GetEventStack(),u=q.GetCurrentCondition(),w=t.GetCurrentStackFrame(),y=w.GetCurrentEvent(),C=y.GetSolModifiers(),G=w.IsSolModifierAfterCnds(),x=t.Push(y),B=q.GetLoopStack(),H=B.Push(),P=n.IsInContainer(),
E=n.GetCurrentSol(),J=l.Push();c.clearArray(J);const O=E.GetInstances();H.SetEnd(O.length);for(let R=0,T=O.length;R&lt;T;++R)J.push([O[R],u.ReevaluateParameter(1,R)]);J.sort(m);1===r&amp;&amp;J.reverse();if(G)for(let R=0,T=J.length;R&lt;T&amp;&amp;!H.IsStopped();++R)q.PushCopySol(C),r=J[R][0],n.GetCurrentSol().SetSinglePicked(r),P&amp;&amp;r.SetSiblingsSinglePicked(),H.SetIndex(R),yield*y.DebugRetrigger(w,x),q.PopSol(C);else{E._SetSelectAll(!1);n=E._GetOwnInstances();c.clearArray(n);n.push(null);for(let R=0,T=J.length;R&lt;T&amp;&amp;!H.IsStopped();++R)q=
J[R][0],n[0]=q,P&amp;&amp;q.SetSiblingsSinglePicked(),H.SetIndex(R),yield*y.DebugRetrigger(w,x)}t.Pop();B.Pop();c.clearArray(J);l.Pop();return!1}_GetFunctionMap(n,r){let q=this._functionMaps.get(n);if(q)return q;if(!r)return null;q={defaultFunc:null,strMap:new Map};this._functionMaps.set(n,q);return q}_DoCallMappedFunction(n,r,q,t,u){r.GetEventBlock().RunAsMappedFunctionCall(q);t&amp;&amp;n.PopSol(u)}*_DebugDoCallMappedFunction(n,r,q,t,u){yield*r.GetEventBlock().DebugRunAsMappedFunctionCall(q);t&amp;&amp;n.PopSol(u)}}}"use strict";
{const c=self.C3;c.Plugins.System.Type=class extends c.DefendedBase{constructor(b){super();this._objectClass=b;this._runtime=b.GetRuntime();this._plugin=b.GetPlugin()}OnCreate(){}Release(){this._plugin=this._runtime=this._objectClass=null}}}"use strict";
{const c=self.C3;c.Plugins.System.Instance=class extends c.DefendedBase{constructor(b,a){super();this._inst=b;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}}}"use strict";
{const c=self.C3,b=[];c.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 f=a.get("TriggerOnce_lastTick");"undefined"===typeof f&amp;&amp;(f=-1,a.set("TriggerOnce_lastTick",-1));const d=
this._runtime.GetTickCount();a.set("TriggerOnce_lastTick",d);return this._runtime.IsLayoutFirstTick()||f!==d-1},Every(a){const f=this._runtime.GetCurrentCondition().GetSavedDataMap(),d=f.get("Every_lastTime")||0,e=this._runtime.GetGameTime();f.has("Every_seconds")||f.set("Every_seconds",a);const g=f.get("Every_seconds");if(e&gt;=d+g)return f.set("Every_lastTime",d+g),e&gt;=f.get("Every_lastTime")+.04&amp;&amp;f.set("Every_lastTime",e),f.set("Every_seconds",a),!0;e&lt;d-.1&amp;&amp;f.set("Every_lastTime",e);return!1},IsGroupActive(a){return(a=
this._runtime.GetEventSheetManager().GetEventGroupByName(a))&amp;&amp;a.IsGroupActive()},IsPreview(){return this._runtime.IsPreview()},IsMobile(){return c.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"===c.Platform.Context;case 1:return"iOS"===
c.Platform.OS;case 2:return"Android"===c.Platform.OS;case 8:return"cordova"===c.Platform.Context;case 9:return"scirra-arcade"===this._runtime.GetExportType();case 10:return"nwjs"===c.Platform.Context;case 13:return"windows-uwp"===this._runtime.GetExportType();default:return!1}},RegexTest(a,f,d){return this.GetRegex(f,d).test(a)},Compare(a,f,d){return c.compare(a,f,d)},CompareBetween(a,f,d){return a&gt;=f&amp;&amp;a&lt;=d},CompareVar(a,f,d){return c.compare(a.GetValue(),f,d)},CompareBoolVar(a){return!!a.GetValue()},
CompareTime(a,f){const d=this._runtime.GetGameTime();return 0===a?(a=this._runtime.GetCurrentCondition().GetSavedDataMap(),!a.get("CompareTime_executed")&amp;&amp;d&gt;=f?(a.set("CompareTime_executed",!0),!0):!1):c.compare(d,a,f)},IsNaN(a){return isNaN(a)},AngleWithin(a,f,d){return c.angleDiff(c.toRadians(a),c.toRadians(d))&lt;=c.toRadians(f)},IsClockwiseFrom(a,f){return c.angleClockwise(c.toRadians(a),c.toRadians(f))},IsBetweenAngles(a,f,d){a=c.toRadians(a);f=c.toRadians(f);d=c.toRadians(d);return c.angleClockwise(d,
f)?c.angleClockwise(a,f)&amp;&amp;!c.angleClockwise(a,d):!(!c.angleClockwise(a,f)&amp;&amp;c.angleClockwise(a,d))},IsValueType(a,f){return"number"===typeof a?0===f:1===f},EvaluateExpression(a){return!!a},PickByComparison(a,f,d,e){if(!a)return!1;const g=this._GetForEachStack(),h=g.Push(),l=a.GetCurrentSol();c.shallowAssignArray(h,l.GetInstances());l.IsSelectAll()&amp;&amp;c.clearArray(l._GetOwnElseInstances());const m=this._runtime.GetCurrentCondition();let n=0;for(let r=0,q=h.length;r&lt;q;++r){const t=h[r];h[n]=t;f=m.ReevaluateParameter(1,
r);e=m.ReevaluateParameter(3,r);c.compare(f,d,e)?++n:l._PushElseInstance(t)}c.truncateArray(h,n);l.SetArrayPicked(h);f=!!h.length;c.clearArray(h);g.Pop();a.ApplySolToContainer();return f},PickByEvaluate(a,f){if(!a)return!1;const d=this._GetForEachStack(),e=d.Push(),g=a.GetCurrentSol();c.shallowAssignArray(e,g.GetInstances());g.IsSelectAll()&amp;&amp;c.clearArray(g._GetOwnElseInstances());const h=this._runtime.GetCurrentCondition();let l=0;for(let m=0,n=e.length;m&lt;n;++m){const r=e[m];e[l]=r;(f=h.ReevaluateParameter(1,
m))?++l:g._PushElseInstance(r)}c.truncateArray(e,l);g.SetArrayPicked(e);f=!!e.length;c.clearArray(e);d.Pop();a.ApplySolToContainer();return f},PickNth(a,f){if(!a)return!1;const d=a.GetCurrentSol(),e=d.GetInstances();f=Math.floor(f);if(f&gt;=e.length)return!1;d.PickOne(e[f]);a.ApplySolToContainer();return!0},PickRandom(a){if(!a)return!1;const f=a.GetCurrentSol(),d=f.GetInstances(),e=Math.floor(this._runtime.Random()*d.length);if(e&gt;=d.length)return!1;f.PickOne(d[e]);a.ApplySolToContainer();return!0},PickAll(a){if(!a||
!a.GetInstanceCount())return!1;a.GetCurrentSol()._SetSelectAll(!0);a.ApplySolToContainer();return!0},PickOverlappingPoint(a,f,d){if(!a)return!1;const e=a.GetCurrentSol();var g=e.GetInstances();const h=this._runtime.GetCurrentEvent().IsOrBlock(),l=this._runtime.GetCurrentCondition().IsInverted();e.IsSelectAll()?(c.shallowAssignArray(b,g),e.ClearArrays(),e._SetSelectAll(!1)):h?(c.shallowAssignArray(b,e._GetOwnElseInstances()),c.clearArray(e._GetOwnElseInstances())):(c.shallowAssignArray(b,e._GetOwnInstances()),
c.clearArray(e._GetOwnInstances()));for(let m=0,n=b.length;m&lt;n;++m)g=b[m],c.xor(g.GetWorldInfo().ContainsPoint(f,d),l)?e._PushInstance(g):e._PushElseInstance(g);a.ApplySolToContainer();return c.xor(!!e._GetOwnInstances().length,l)},PickLastCreated(a){if(!a)return!1;var f=a.IsFamily();let d=null;const e=this._runtime._GetInstancesPendingCreate();for(let g=e.length-1;0&lt;=g;--g){const h=e[g];if(f){if(h.GetObjectClass().BelongsToFamily(a)){d=h;break}}else if(h.GetObjectClass()===a){d=h;break}}d||(f=a.GetInstances(),
f.length&amp;&amp;(d=f[f.length-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,f,d){return this._runtime.IsDebugging()?this._DebugFor(a,f,d):this._For(a,f,d)},ForEach(a){return this._runtime.IsDebugging()?this._DebugForEach(a):this._ForEach(a)},ForEachOrdered(a,f,d){return this._runtime.IsDebugging()?this._DebugForEachOrdered(a,
d):this._ForEachOrdered(a,d)},LayerVisible(a){return a?a.IsVisible():!1},LayerEmpty(a){return a?!a.GetInstanceCount():!1},LayerCmpOpacity(a,f,d){return a?c.compare(100*a.GetOpacity(),f,d):!1},OnImageLoadingComplete(){return!0},IsLoadingImages(){return 0&lt;this._imagesLoadingTotal}}}"use strict";
{const c=self.C3;function b(h,l){const m=h[0]-l[0];return 0!==m?m:h[1]-l[1]}function a(h,l){return h[1]-l[1]}const f=[],d=[],e=c.New(c.Rect),g=c.New(c.Color);c.Plugins.System.Acts={SetVar(h,l){h.SetValue(l)},AddVar(h,l){h.IsNumber()&amp;&amp;"number"!==typeof l&amp;&amp;(l=parseFloat(l));h.SetValue(h.GetValue()+l)},SubVar(h,l){h.IsNumber()&amp;&amp;h.SetValue(h.GetValue()-l)},SetBoolVar(h,l){h.SetValue(!!l)},ToggleBoolVar(h){h.SetValue(!h.GetValue())},ResetGlobals(){this._runtime.GetEventSheetManager().ResetAllGlobalsToInitialValue()},
CreateObject(h,l,m,n){if(h&amp;&amp;l&amp;&amp;(l=this._runtime.CreateInstance(h,l,m,n))){m=this._runtime.GetEventSheetManager();m.BlockFlushingInstances(!0);l._TriggerOnCreated();if(l.IsInContainer())for(const r of l.siblings())r._TriggerOnCreated();m.BlockFlushingInstances(!1);h.GetCurrentSol().SetSinglePicked(l);l.IsInContainer()&amp;&amp;l.SetSiblingsSinglePicked()}},CreateObjectByName(h,l,m,n){h&amp;&amp;l&amp;&amp;(h=this._runtime.GetObjectClassByName(h))&amp;&amp;c.Plugins.System.Acts.CreateObject.call(this,h,l,m,n)},RecreateInitialObjects(h,
l,m,n,r,q,t,u,w){if(h){var y=this._runtime.GetCurrentLayout();if(q&amp;&amp;(y=this._runtime.GetLayoutManager().GetLayoutByName(q),!y))return;q=null;if("number"!==typeof t||0&lt;=t)if(q=y.GetLayer(t),!q)return;e.set(l,m,n,r);l=y.RecreateInitialObjects(h,e,q,u,w);h.GetCurrentSol().SetArrayPicked(l);h.ApplySolToContainer()}},StopLoop(){const h=this._loopStack;h.IsInLoop()&amp;&amp;h.GetCurrent().Stop()},SetGroupActive(h,l){(h=this._runtime.GetEventSheetManager().GetEventGroupByName(h))&amp;&amp;(0===l?h.SetGroupActive(!1):1===
l?h.SetGroupActive(!0):h.SetGroupActive(!h.IsGroupActive()))},SetTimescale(h){this._runtime.SetTimeScale(h)},SetObjectTimescale(h,l){0&gt;l&amp;&amp;(l=0);if(h){h=h.GetCurrentSol().GetInstances();for(const m of h)m.SetTimeScale(l)}},RestoreObjectTimescale(h){if(h){h=h.GetCurrentSol().GetInstances();for(const l of h)l.RestoreTimeScale()}},Wait(h){if(!(0&gt;h))return this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(h),!0},WaitForSignal(h){this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(h);
return!0},WaitForPreviousActions(){const h=this._runtime.GetEventSheetManager();h.AddScheduledWait().InitPromise(h.GetPromiseForAllAsyncActions());return!0},Signal(h){h=h.toLowerCase();for(const l of this._runtime.GetEventSheetManager().scheduledWaits())l.IsSignal()&amp;&amp;l.GetSignalTag()===h&amp;&amp;l.SetSignalled()},async SnapshotCanvas(h,l,m,n,r,q){const t=this._runtime.GetCanvasManager();t&amp;&amp;(this.UpdateRender(),await t.SnapshotCanvas(0===h?"image/png":"image/jpeg",l/100,m,n,r,q),await this._runtime.TriggerAsync(c.Plugins.System.Cnds.OnCanvasSnapshot,
null))},SetCanvasSize(h,l){if(!(0&gt;=h||0&gt;=l)){this._runtime.SetViewportSize(h,l);var m=this._runtime.GetCurrentLayout();m.BoundScrolling();for(const n of m.GetLayers())n.UpdateViewport();if(m=this._runtime.GetCanvasManager())"off"!==m.GetCurrentFullscreenMode()&amp;&amp;this._runtime.SetOriginalViewportSize(h,l),m.SetSize(m.GetLastWidth(),m.GetLastHeight(),!0),this._runtime.UpdateRender()}},SetFullscreenQuality(h){const l=this._runtime.GetCanvasManager();l&amp;&amp;"off"!==l.GetCurrentFullscreenMode()&amp;&amp;(l.SetFullscreenScalingQuality(0!==
h?"high":"low"),l.SetSize(l.GetLastWidth(),l.GetLastHeight(),!0))},SaveState(h){this._runtime.SaveToSlot(h)},LoadState(h){this._runtime.LoadFromSlot(h)},LoadStateJSON(h){this._runtime.LoadFromJsonString(h)},SetHalfFramerateMode(h){},ResetPersisted(){for(const h of this._runtime.GetLayoutManager().GetAllLayouts())h.ResetPersistData()},SetPixelRounding(h){this._runtime.SetPixelRoundingEnabled(0!==h)},SetMinimumFramerate(h){this._runtime.SetMinimumFramerate(h)},SortZOrderByInstVar(h,l){if(h){var m=h.GetCurrentSol().GetInstances(),
n=this._runtime.GetCurrentLayout(),r=h.IsFamily();h=h.GetFamilyIndex();for(let t=0,u=m.length;t&lt;u;++t){var q=m[t];const w=q.GetWorldInfo();if(!w)continue;let y;y=r?q.GetInstanceVariableValue(l+q.GetObjectClass().GetFamilyInstanceVariableOffset(h)):q.GetInstanceVariableValue(l);f.push([w.GetLayer().GetIndex(),w.GetZIndex()]);d.push([q,y])}if(f.length){f.sort(b);d.sort(a);l=!1;for(let t=0,u=f.length;t&lt;u;++t)m=d[t][0],r=n.GetLayerByIndex(f[t][0]),h=f[t][1],q=r._GetInstances(),q[h]!==m&amp;&amp;(q[h]=m,m.GetWorldInfo()._SetLayer(r),
r.SetZIndicesChanged(),l=!0);l&amp;&amp;this._runtime.UpdateRender();c.clearArray(f);c.clearArray(d)}}},GoToLayout(h){if(!this._runtime.IsLoading()){var l=this._runtime.GetLayoutManager();l.IsPendingChangeMainLayout()||l.ChangeMainLayout(h)}},GoToLayoutByName(h){if(!this._runtime.IsLoading()){var l=this._runtime.GetLayoutManager();l.IsPendingChangeMainLayout()||(h=l.GetLayoutByName(h))&amp;&amp;l.ChangeMainLayout(h)}},NextPrevLayout(h){if(!this._runtime.IsLoading()){var l=this._runtime.GetLayoutManager();if(!l.IsPendingChangeMainLayout()){var m=
l.GetAllLayouts(),n=m.indexOf(l.GetMainRunningLayout());h&amp;&amp;0===n||(h||n!==m.length-1)&amp;&amp;l.ChangeMainLayout(m[n+(h?-1:1)])}}},RestartLayout(){if(!this._runtime.IsLoading()){var h=this._runtime.GetLayoutManager();h.IsPendingChangeMainLayout()||(h.ChangeMainLayout(h.GetMainRunningLayout()),this._runtime.GetEventSheetManager().ResetAllGroupsInitialActivation())}},SetLayerVisible(h,l){h&amp;&amp;h.SetVisible(l)},SetLayerOpacity(h,l){h&amp;&amp;h.SetOpacity(l/100)},SetLayerScale(h,l){h&amp;&amp;h.SetOwnScale(l)},SetLayerScaleRate(h,
l){h&amp;&amp;h.SetScaleRate(l)},SetLayerAngle(h,l){h&amp;&amp;(l=c.clampAngle(c.toRadians(+l)),h.GetOwnAngle()!==l&amp;&amp;(h.SetAngle(l),this.UpdateRender()))},SetLayerParallax(h,l,m){h&amp;&amp;h.SetParallax(l/100,m/100)},SetLayerZElevation(h,l){h&amp;&amp;h.SetZElevation(l)},SetLayerBackground(h,l){h&amp;&amp;(g.setFromRgbValue(l),g.clamp(),h=h.GetBackgroundColor(),h.equalsIgnoringAlpha(g)||(h.copyRgb(g),this.UpdateRender()))},SetLayerTransparent(h,l){h&amp;&amp;(l=!!l,h.IsTransparent()!==l&amp;&amp;(h.SetTransparent(l),this.UpdateRender()))},SetLayerBlendMode(h,
l){h&amp;&amp;h.GetBlendMode()!==l&amp;&amp;(h.SetBlendMode(l),this.UpdateRender())},SetLayerEffectEnabled(h,l,m){h&amp;&amp;(h=h.GetEffectList(),m=h.GetEffectTypeByName(m))&amp;&amp;(l=1===l,m.IsActive()!==l&amp;&amp;(m.SetActive(l),h.UpdateActiveEffects(),this._runtime.UpdateRender()))},SetLayerEffectParam(h,l,m,n){if(h&amp;&amp;(h=h.GetEffectList(),l=h.GetEffectTypeByName(l))){var r=l.GetIndex();h=h.GetEffectParametersForIndex(r);m=Math.floor(m);if(!(0&gt;m||m&gt;=h.length)){r=l.GetShaderProgram().GetParameterType(m);if("color"===r){g.setFromRgbValue(n);
m=h[m];if(g.equalsIgnoringAlpha(m))return;m.copyRgb(g)}else{"percent"===r&amp;&amp;(n/=100);if(h[m]===n)return;h[m]=n}l.IsActive()&amp;&amp;this._runtime.UpdateRender()}}},SetLayerForceOwnTexture(h,l){h&amp;&amp;(l=!!l,h.IsForceOwnTexture()!==l&amp;&amp;(h.SetForceOwnTexture(l),this.UpdateRender()))},SetLayoutScale(h){const l=this._runtime.GetCurrentLayout();l.GetScale()!==h&amp;&amp;(l.SetScale(h),this.UpdateRender())},SetLayoutAngle(h){h=c.clampAngle(c.toRadians(+h));const l=this._runtime.GetCurrentLayout();l.GetAngle()!==h&amp;&amp;(l.SetAngle(h),
this.UpdateRender())},SetLayoutEffectEnabled(h,l){const m=this._runtime.GetCurrentLayout().GetEffectList();if(l=m.GetEffectTypeByName(l))h=1===h,l.IsActive()!==h&amp;&amp;(l.SetActive(h),m.UpdateActiveEffects(),this._runtime.UpdateRender())},SetLayoutEffectParam(h,l,m){var n=this._runtime.GetCurrentLayout().GetEffectList();if(h=n.GetEffectTypeByName(h)){var r=h.GetIndex();n=n.GetEffectParametersForIndex(r);l=Math.floor(l);if(!(0&gt;l||l&gt;=n.length)){r=h.GetShaderProgram().GetParameterType(l);if("color"===r){g.setFromRgbValue(m);
l=n[l];if(g.equalsIgnoringAlpha(l))return;l.copyRgb(g)}else{"percent"===r&amp;&amp;(m/=100);if(n[l]===m)return;n[l]=m}h.IsActive()&amp;&amp;this._runtime.UpdateRender()}}},ScrollX(h){this._runtime.GetCurrentLayout().SetScrollX(h)},ScrollY(h){this._runtime.GetCurrentLayout().SetScrollY(h)},Scroll(h,l){const m=this._runtime.GetCurrentLayout();m.SetScrollX(h);m.SetScrollY(l)},ScrollToObject(h){if(h&amp;&amp;(h=h.GetFirstPicked())&amp;&amp;(h=h.GetWorldInfo())){var l=this._runtime.GetCurrentLayout();l.SetScrollX(h.GetX());l.SetScrollY(h.GetY())}},
async LoadObjectTextures(h){const l=this._runtime.GetMainRunningLayout();l&amp;&amp;h&amp;&amp;!this._runtime.IsLoading()&amp;&amp;(h=h.IsFamily()?h.GetFamilyMembers():[h],await this._LoadTexturesForObjectClasses(l,h))},async LoadObjectTexturesByName(h){await c.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(h))},UnloadObjectTextures(h){const l=this._runtime.GetMainRunningLayout();l&amp;&amp;h&amp;&amp;(h=h.IsFamily()?h.GetFamilyMembers():[h],this._UnloadTexturesForObjectClasses(l,h))},UnloadObjectTexturesByName(h){c.Plugins.System.Acts.UnloadObjectTexturesByName.call(this,
this._runtime.GetObjectClassByName(h))},UnloadUnusedTextures(){const h=this._runtime.GetMainRunningLayout();if(h){var l=h._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(h,l)}},async LoadLayoutTextures(h){const l=this._runtime.GetMainRunningLayout();h&amp;&amp;l&amp;&amp;!this._runtime.IsLoading()&amp;&amp;await this._LoadTexturesForObjectClasses(l,h._GetInitialObjectClasses())},async LoadLayoutTexturesByName(h){const l=this._runtime.GetMainRunningLayout();(h=this._runtime.GetLayoutManager().GetLayoutByName(h))&amp;&amp;
l&amp;&amp;!this._runtime.IsLoading()&amp;&amp;await this._LoadTexturesForObjectClasses(l,h._GetInitialObjectClasses())},SetFunctionReturnValue(h){const l=this._eventStack.GetCurrentExpFuncStackFrame();if(l)switch(l.GetFunctionReturnType()){case 1:"number"===typeof h&amp;&amp;l.SetFunctionReturnValue(h);break;case 2:"string"===typeof h&amp;&amp;l.SetFunctionReturnValue(h);break;case 3:l.SetFunctionReturnValue(h)}},MapFunction(h,l,m){var n=this._GetFunctionMap(h.toLowerCase(),!0);const r=n.strMap,q=l.toLowerCase();r.has(q)&amp;&amp;console.warn(`[Construct 3] Function map '${h}' string '${l}' already in map; overwriting entry`);
if(n=c.first(r.values())||n.defaultFunc){n=0!==n.GetReturnType();const t=0!==m.GetReturnType();if(n!==t){console.error(`[Construct 3] Function map '${h}' string '${l}' function return type not compatible with other functions in the map; entry ignored`);return}}r.set(q,m)},MapFunctionDefault(h,l){const m=this._GetFunctionMap(h.toLowerCase(),!0);m.defaultFunc&amp;&amp;console.warn(`[Construct 3] Function map '${h}' already has a default; overwriting entry`);var n=c.first(m.strMap.values())||m.defaultFunc;if(n){n=
0!==n.GetReturnType();const r=0!==l.GetReturnType();if(n!==r){console.error(`[Construct 3] Function map '${h}' default: function return type not compatible with other functions in the map; entry ignored`);return}}m.defaultFunc=l},CallMappedFunction(h,l,m){m=Math.floor(m);var n=this._GetFunctionMap(h.toLowerCase(),!1);if(n){var r=n.strMap.get(l.toLowerCase());if(!r)if(n.defaultFunc)r=n.defaultFunc,m=0;else{console.warn(`[Construct 3] Call mapped function: no function associated with map '${h}' string '${l}'; call ignored (consider setting a default)`);
return}if(r.IsEnabled())if(0!==r.GetReturnType())console.warn(`[Construct 3] Call mapped function: map '${h}' string '${l}' has a return type so cannot be called`);else{h=this._runtime;l=h.GetEventSheetManager();var q=l.GetCurrentEvent();n=q.GetSolModifiersIncludingParents();var t=0&lt;n.length;t&amp;&amp;l.PushCleanSol(n);var u=[];if(q=l.FindFirstFunctionBlockParent(q)){q=q.GetFunctionParameters();for(let w=m,y=q.length;w&lt;y;++w)u.push(q[w].GetValue())}m=r.GetFunctionParameters();for(let w=u.length,y=m.length;w&lt;
y;++w)u.push(m[w].GetInitialValue());return h.IsDebugging()?this._DebugDoCallMappedFunction(l,r,u,t,n):this._DoCallMappedFunction(l,r,u,t,n)}}else console.warn(`[Construct 3] Call mapped function: map name '${h}' not found; call ignored`)}}}"use strict";
{const c=self.C3;c.Plugins.System.Exps={int:function(b){"string"===typeof b&amp;&amp;(b=parseInt(b,10),isNaN(b)&amp;&amp;(b=0));return Math.floor(b)},float:function(b){"string"===typeof b&amp;&amp;(b=parseFloat(b),isNaN(b)&amp;&amp;(b=0));return b},str(b){return b.toString()},len(b){return"string"===typeof b?b.length:0},random(b,a){return"undefined"===typeof a?this._runtime.Random()*b:this._runtime.Random()*(a-b)+b},choose(...b){const a=Math.floor(this._runtime.Random()*b.length);return b[a]},pi(){return Math.PI},infinity(){return Infinity},
sqrt(b){return Math.sqrt(b)},abs(b){return Math.abs(b)},round(b){return Math.round(b)},floor(b){return Math.floor(b)},ceil(b){return Math.ceil(b)},sign(b){return Math.sign(b)},sin(b){return Math.sin(c.toRadians(b))},cos(b){return Math.cos(c.toRadians(b))},tan(b){return Math.tan(c.toRadians(b))},asin(b){return c.toDegrees(Math.asin(b))},acos(b){return c.toDegrees(Math.acos(b))},atan(b){return c.toDegrees(Math.atan(b))},exp(b){return Math.exp(b)},ln(b){return Math.log(b)},log10(b){return Math.log(b)/
Math.LN10},max(...b){let a=b[0];"number"!==typeof a&amp;&amp;(a=0);for(let f=1,d=b.length;f&lt;d;++f){let e=b[f];"number"===typeof e&amp;&amp;a&lt;e&amp;&amp;(a=e)}return a},min(...b){let a=b[0];"number"!==typeof a&amp;&amp;(a=0);for(let f=1,d=b.length;f&lt;d;++f){let e=b[f];"number"===typeof e&amp;&amp;a&gt;e&amp;&amp;(a=e)}return a},clamp(b,a,f){return c.clamp(b,a,f)},distance(b,a,f,d){return c.distanceTo(b,a,f,d)},angle(b,a,f,d){return c.toDegrees(c.angleTo(b,a,f,d))},lerp(b,a,f){return c.lerp(b,a,f)},unlerp(b,a,f){return c.unlerp(b,a,f)},qarp(b,a,f,d){return c.qarp(b,
a,f,d)},cubic(b,a,f,d,e){return c.cubic(b,a,f,d,e)},cosp(b,a,f){return c.cosp(b,a,f)},anglediff(b,a){return c.toDegrees(c.angleDiff(c.toRadians(b),c.toRadians(a)))},anglelerp(b,a,f){return c.toDegrees(c.angleLerp(c.toRadians(b),c.toRadians(a),f))},anglerotate(b,a,f){return c.toDegrees(c.angleRotate(c.toRadians(b),c.toRadians(a),c.toRadians(f)))},setbit(b,a,f){a|=0;return(b|0)&amp;~(1&lt;&lt;a)|(0!==f?1:0)&lt;&lt;a},togglebit(b,a){return(b|0)^1&lt;&lt;(a|0)},getbit(b,a){return(b|0)&amp;1&lt;&lt;(a|0)?1:0},newline(){return"\n"},uppercase(b){return"string"===
typeof b?b.toUpperCase():""},lowercase(b){return"string"===typeof b?b.toLowerCase():""},left(b,a){return"string"===typeof b?b.substr(0,a):""},mid(b,a,f){return"string"!==typeof b?"":0&gt;f?b.substr(a):b.substr(a,f)},right(b,a){return"string"===typeof b?b.substr(b.length-a):""},trim(b){return"string"===typeof b?b.trim():""},tokenat(b,a,f){if("string"!==typeof b||"string"!==typeof f)return"";b=b.split(f);a=Math.floor(a);return 0&gt;a||a&gt;=b.length?"":b[a]},tokencount(b,a){return"string"===typeof b&amp;&amp;"string"===
typeof a&amp;&amp;b.length?b.split(a).length:0},find(b,a){return"string"===typeof b&amp;&amp;"string"===typeof a?b.search(new RegExp(c.EscapeRegex(a),"i")):-1},findcase(b,a){return"string"===typeof b&amp;&amp;"string"===typeof a?b.search(new RegExp(c.EscapeRegex(a),"")):-1},replace(b,a,f){return"string"===typeof b&amp;&amp;"string"===typeof a&amp;&amp;"string"===typeof f?b.replace(new RegExp(c.EscapeRegex(a),"gi"),f):"string"===typeof b?b:""},regexsearch(b,a,f){a=this.GetRegex(a,f);return b?b.search(a):-1},regexreplace(b,a,f,d){a=this.GetRegex(a,
f);return b?b.replace(a,d):""},regexmatchcount(b,a,f){return(b=this.GetRegexMatches(b.toString(),a,f))?b.length:0},regexmatchat(b,a,f,d){d=Math.floor(d);b=this.GetRegexMatches(b.toString(),a,f);return!b||0&gt;d||d&gt;=b.length?"":b[d]},zeropad(b,a){let f=0&gt;b?"-":"";0&gt;b&amp;&amp;(b=-b);f+="0".repeat(Math.max(a-b.toString().length,0));return f+b.toString()},urlencode(b){return encodeURIComponent(b)},urldecode(b){return decodeURIComponent(b)},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 c.toDegrees(this._runtime.GetCurrentLayout().GetAngle())},layoutwidth(){return this._runtime.GetCurrentLayout().GetWidth()},layoutheight(){return this._runtime.GetCurrentLayout().GetHeight()},viewportleft(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().getLeft():0},viewporttop(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().getTop():0},viewportright(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().getRight():
0},viewportbottom(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().getBottom():0},viewportwidth(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().width():0},viewportheight(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetViewport().height():0},canvastolayerx(b,a,f){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.CanvasCssToLayer(a,f)[0]:0},canvastolayery(b,a,f){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.CanvasCssToLayer(a,
f)[1]:0},layertocanvasx(b,a,f){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.LayerToCanvasCss(a,f)[0]:0},layertocanvasy(b,a,f){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.LayerToCanvasCss(a,f)[1]:0},layerscale(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetOwnScale():0},layerangle(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?c.toDegrees(b.GetOwnAngle()):0},layeropacity(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?100*b.GetOpacity():
0},layerscalerate(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetScaleRate():0},layerparallaxx(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?100*b.GetParallaxX():0},layerparallaxy(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?100*b.GetParallaxY():0},layerzelevation(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetZElevation():0},layerindex(b){return(b=this._runtime.GetCurrentLayout().GetLayer(b))?b.GetIndex():-1},canvassnapshot(){const b=this._runtime.GetCanvasManager();
return b?b.GetCanvasSnapshotUrl():""},loopindex(b){const a=this._loopStack;return a.IsInLoop()?b?(b=a.FindByName(b))?b.GetIndex():0:a.GetCurrent().GetIndex():0},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(b,a,...f){var d=this._GetFunctionMap(b.toLowerCase(),!1);if(!d)return console.warn(`[Construct 3] Call mapped function: map name '${b}' not found; returning 0`),0;var e=d.strMap.get(a.toLowerCase());if(!e)if(d.defaultFunc)e=d.defaultFunc;else return console.warn(`[Construct 3] Call mapped function: no function associated with map '${b}' string '${a}'; returning 0 (consider setting a default)`),
0;d=e.GetReturnType();const g=e.GetDefaultReturnValue();if(0===d)return console.warn(`[Construct 3] Call mapped function: map '${b}' string '${a}' has no return type so cannot be called from an expression; returning 0`),0;if(!e.IsEnabled())return g;b=this._runtime.GetEventSheetManager();a=b.GetCurrentEvent().GetSolModifiersIncludingParents();const h=0&lt;a.length;h&amp;&amp;b.PushCleanSol(a);const l=e.GetFunctionParameters();for(let m=f.length,n=l.length;m&lt;n;++m)f.push(l[m].GetInitialValue());e=e.GetEventBlock();
f=e.RunAsExpressionFunctionCall(e.GetSolModifiersIncludingParents(),d,g,...f);h&amp;&amp;b.PopSol(a);return f},loadingprogress(){return this._runtime.GetAssetManager().GetLoadProgress()},imageloadingprogress(){return 0===this._imagesLoadingTotal?1:this._imagesLoadingComplete/this._imagesLoadingTotal},renderer(){return"webgl"},rendererdetail(){return this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},imagememoryusage(){let b=this._runtime.GetWebGLRenderer().GetEstimatedTextureMemoryUsage();return Math.round(100*
b/1048576)/100},rgb(b,a,f){return c.PackRGB(b,a,f)},rgbex(b,a,f){return c.PackRGBEx(b/100,a/100,f/100)},rgba(b,a,f,d){return c.PackRGBAEx(b/100,a/100,f/100,d/100)},rgbex255(b,a,f){return c.PackRGBEx(b/255,a/255,f/255)},rgba255(b,a,f,d){return c.PackRGBAEx(b/255,a/255,f/255,d/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 c=self.C3;c.Plugins.PlatformInfo=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Plugins.PlatformInfo.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Plugins.PlatformInfo.Instance=class extends c.SDKInstanceBase{constructor(b,a){super(b,"platform-info");this._windowOuterHeight=this._windowOuterWidth=this._screenHeight=this._screenWidth=0;this._safeAreaInset=[0,0,0,0];this._isWakeLockActive=this._supportsWakeLock=!1;this.AddDOMMessageHandlers([["window-resize",f=&gt;this._OnWindowResize(f)],["wake-lock-acquired",f=&gt;this._OnWakeLockAcquired(f)],["wake-lock-error",f=&gt;this._OnWakeLockError(f)],["wake-lock-released",f=&gt;this._OnWakeLockReleased(f)]]);
navigator.connection&amp;&amp;navigator.connection.addEventListener("change",()=&gt;this._OnNetworkChange());this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state").then(f=&gt;{this._screenWidth=f.screenWidth;this._screenHeight=f.screenHeight;this._windowOuterWidth=f.windowOuterWidth;this._windowOuterHeight=f.windowOuterHeight;this._safeAreaInset=f.safeAreaInset;this._supportsWakeLock=f.supportsWakeLock}))}Release(){super.Release()}_OnWindowResize(b){this._windowOuterWidth=b.windowOuterWidth;this._windowOuterHeight=
b.windowOuterHeight;this._safeAreaInset=b.safeAreaInset}async _OnNetworkChange(){await this.TriggerAsync(c.Plugins.PlatformInfo.Cnds.OnNetworkChange)}async _OnWakeLockAcquired(){this._isWakeLockActive=!0;await this.TriggerAsync(c.Plugins.PlatformInfo.Cnds.OnWakeLockAcquired)}async _OnWakeLockError(){this._isWakeLockActive=!1;await this.TriggerAsync(c.Plugins.PlatformInfo.Cnds.OnWakeLockError)}async _OnWakeLockReleased(){this._isWakeLockActive=!1;await this.TriggerAsync(c.Plugins.PlatformInfo.Cnds.OnWakeLockReleased)}}}"use strict";
{const c=self.C3;c.Plugins.PlatformInfo.Cnds={IsOnMobile(){return c.Platform.IsMobile},IsOnWindows(){return"Windows"===c.Platform.OS},IsOnMacOS(){return"Mac OS X"===c.Platform.OS},IsOnLinux(){return"Linux"===c.Platform.OS},IsOnChromeOS(){return"Chrome OS"===c.Platform.OS},IsOnAndroid(){return"Android"===c.Platform.OS},IsOniOS(){return"iOS"===c.Platform.OS},IsWebExport(){const b=this._runtime.GetExportType();return"html5"===b||"scirra-arcade"===b||"preview"===b||"instant-games"===b},IsCordovaExport(){return this._runtime.IsCordova()},
IsNWjsExport(){return"nwjs"===this._runtime.GetExportType()},IsWindowsUWPExport(){return"windows-uwp"===this._runtime.GetExportType()},OnNetworkChange(){return!0},OnWakeLockAcquired(){return!0},OnWakeLockError(){return!0},OnWakeLockReleased(){return!0},IsWakeLockActive(){return this._isWakeLockActive},IsWakeLockSupported(){return this._supportsWakeLock}}}"use strict";
self.C3.Plugins.PlatformInfo.Acts={RequestWakeLock(){this._supportsWakeLock&amp;&amp;this._PostToDOMMaybeSync("request-wake-lock")},ReleaseWakeLock(){this._supportsWakeLock&amp;&amp;(this._isWakeLockActive=!1,this.PostToDOM("release-wake-lock"))}};"use strict";
self.C3.Plugins.PlatformInfo.Exps={Renderer(){const c=this._runtime.GetWebGLRenderer();let b="webgl"+c.GetWebGLVersionNumber();c.HasMajorPerformanceCaveat()&amp;&amp;(b+="-software");return b},RendererDetail(){return this._runtime.GetWebGLRenderer().GetUnmaskedRenderer()},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._windowOuterHeight},CanvasCssWidth(){return this._runtime.GetCanvasManager().GetCssWidth()},CanvasCssHeight(){return this._runtime.GetCanvasManager().GetCssHeight()},CanvasDeviceWidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},CanvasDeviceHeight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},Downlink(){return navigator.connection?navigator.connection.downlink||0:0},DownlinkMax(){return navigator.connection?
navigator.connection.downlinkMax||0:0},ConnectionType(){return navigator.connection?navigator.connection.type||"unknown":"unknown"},ConnectionEffectiveType(){return navigator.connection?navigator.connection.effectiveType||"unknown":"unknown"},ConnectionRTT(){return navigator.connection?navigator.connection.rtt||0:0},HardwareConcurrency(){return navigator.hardwareConcurrency||0},DeviceMemory(){return navigator.deviceMemory||0},SafeAreaInsetTop(){return this._safeAreaInset[0]},SafeAreaInsetRight(){return this._safeAreaInset[1]},
SafeAreaInsetBottom(){return this._safeAreaInset[2]},SafeAreaInsetLeft(){return this._safeAreaInset[3]}};"use strict";{const c=self.C3;c.Plugins.Share=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Plugins.Share.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Plugins.Share.Instance=class extends c.SDKInstanceBase{constructor(b,a){super(b,"share");this._isFilesSupported=this._isSupported=!1;this._files=[];this.AddDOMMessageHandlers([["share-completed",()=&gt;this._OnShareCompleted()],["share-failed",()=&gt;this._OnShareFailed()]]);this._runtime.AddLoadPromise(this.PostToDOMAsync("init").then(f=&gt;{this._isFilesSupported=f.isFilesSupported;this._isSupported=f.isSupported}))}_OnShareCompleted(){this.Trigger(c.Plugins.Share.Cnds.OnShareCompleted)}_OnShareFailed(){this.Trigger(c.Plugins.Share.Cnds.OnShareFailed)}}}"use strict";
self.C3.Plugins.Share.Cnds={IsSupported(){return this._isSupported},IsSharingFilesSupported(){return this._isFilesSupported},OnShareCompleted(){return!0},OnShareFailed(){return!0}};"use strict";
{const c=self.C3;c.Plugins.Share.Acts={Share(b,a,f){this._isSupported&amp;&amp;(this._PostToDOMMaybeSync("share",{text:b,title:a,url:f,files:this._files}),c.clearArray(this._files))},AddFile(b,a,f){this._isFilesSupported&amp;&amp;f&amp;&amp;(f=f.GetFirstPicked(this._inst))&amp;&amp;(f=f.GetSdkInstance().GetArrayBufferReadOnly(),0!==f.byteLength&amp;&amp;(b=new (self.RealFile||self.File)([f],b,{type:a}),this._files.push(b)))},RequestRate(b,a,f,d){this._PostToDOMMaybeSync("request-rate",{body:b,confirm:a,cancel:f,appID:d||this._runtime.GetAppId()})},
RequestStore(b){this._PostToDOMMaybeSync("request-store",{appID:b||this._runtime.GetAppId()})}}}"use strict";self.C3.Plugins.Share.Exps={};"use strict";C3.Plugins.Eponesh_YandexSDK=class extends C3.SDKPluginBase{constructor(c){super(c)}Release(){super.Release()}};"use strict";C3.Plugins.Eponesh_YandexSDK.Type=class extends C3.SDKTypeBase{constructor(c){super(c)}Release(){super.Release()}OnCreate(){}};"use strict";
var SDKInstanceBase=globalThis.C3?globalThis.C3.SDKInstanceBase:class{},Instance=class extends SDKInstanceBase{constructor(c,b=[]){super(c);globalThis.C3&amp;&amp;(this.conditions=C3.Plugins.Eponesh_YandexSDK.Cnds,this.init(b))}init(c){this.ready=new Promise(b=&gt;this.init=b);this.rtbReady=new Promise(b=&gt;this.initRTB=b);this.enableFullscreenOnStart=c[0];this.setOrientation(c[1]);this.isOrientationLocked=c[2];this.metricaId=c[3];this.enableRTB=c[4];this.banners={};this.isRewardedVideoPlaying=!1;this.purchases=
[];this.products=[];this.playerData={};this.playerStats={};this.currentProductDescription=this.currentProductImage=this.currentProductTitle=this.currentProductID="";this.currentProductPrice=0;this.lastDataKey=this.lastStateKey=this.lastPurchaseToken=this.lastPurchaseID=this.currentPurchaseSign=this.currentPurchaseToken=this.currentPurchaseID="";this.metricaId&amp;&amp;(this.loadMetrica(),this.metricaReady=new Promise(b=&gt;{window[`yaCounter${this.metricaId}`]?b():document.addEventListener(`yacounter${this.metricaId}inited`,
b)}));this.enableRTB&amp;&amp;this.loadRTB();this.loadSDK()}Release(){super.Release()}SaveToJson(){return{}}LoadFromJson(c){}GetDebuggerProperties(){return[{title:"YandexSDK",properties:[]}]}setOrientation(c){switch(c){case 1:this.fullscreenOrientation="portrait";break;case 2:this.fullscreenOrientation="landscape";break;default:this.fullscreenOrientation=null}}onAdvClosed(c){console.log("Adv was closed, shown:",c);this.Trigger(this.conditions.OnAdvClosed);this.isFirstAdvClosed||(this.isFirstAdvClosed=!0,
this.Trigger(this.conditions.OnFirstAdvClosed))}async getPlayer(){try{const c=await this.ysdk.getPlayer();this.setPlayer(c)}catch(c){try{await this.ysdk.auth.openAuthDialog();const b=await this.ysdk.getPlayer();this.setPlayer(b)}catch(b){this.Trigger(this.conditions.OnSignInFailed)}}}async setPlayer(c){this.player=c;this.playerStats={};this.playerData={};this.Trigger(this.conditions.OnSignInSuccess)}getPurchase(c){return this.purchases.find(b=&gt;b.productID===c)||{}}getProduct(c){return this.products.find(b=&gt;
b.productID===c)||{}}loadSDK(){const c=async()=&gt;{const b={fullscreen:this.enableFullscreenOnStart};null!==this.fullscreenOrientation&amp;&amp;(b.orientation={value:this.fullscreenOrientation,lock:this.isOrientationLocked});this.ysdk=await YaGames.init({screen:b,adv:{onAdvClose:a=&gt;this.onAdvClosed(a)}});this.ysdk.getPayments({signed:!0}).then(a=&gt;this.payments=a).catch(console.error);this.init()};(function(b){var a=b.getElementsByTagName("script")[0];b=b.createElement("script");b.src="https://yandex.ru/games/sdk/v2";
b.async=!0;a.parentNode.insertBefore(b,a);b.onload=c})(document)}loadMetrica(){(function(c,b,a,f,d,e,g){c[d]=c[d]||function(){(c[d].a=c[d].a||[]).push(arguments)};c[d].l=1*new Date;e=b.createElement(a);g=b.getElementsByTagName(a)[0];e.async=1;e.src=f;g.parentNode.insertBefore(e,g)})(window,document,"script","https://mc.yandex.ru/metrika/tag.js","ym");ym(this.metricaId,"init",{clickmap:!0,trackLinks:!0,accurateTrackBounce:!0,triggerEvent:!0})}loadRTB(){((c,b,a,f,d)=&gt;{c[a]=c[a]||[];d=b.getElementsByTagName("script")[0];
f=b.createElement("script");f.onload=()=&gt;this.initRTB();f.type="text/javascript";f.src="//an.yandex.ru/system/context.js";f.async=!0;d.parentNode.insertBefore(f,d)})(window,document,"yandexContextAsyncCallbacks")}};globalThis.C3&amp;&amp;(C3.Plugins.Eponesh_YandexSDK.Instance=Instance);try{module.exports=Instance}catch(c){}Instance;"use strict";
{function c(a,f,d){if("getCurrentEventStack"in a)b(a,f,d);else{var e=a.GetEventSheetManager(),g=a.GetCurrentEvent(),h=g.GetSolModifiers();a=a.GetEventStack();var l=a.GetCurrentStackFrame(),m=a.Push(g);f.forEach(n=&gt;{d(n);e.PushCopySol(h);g.Retrigger(l,m);e.PopSol(h)});a.Pop()}}function b(a,f,d){const e=a.getCurrentEventStack(),g=e.current_event;e.isModifierAfterCnds()?f.forEach(h=&gt;{a.pushCopySol(g.solModifiers);d(h);g.retrigger();a.popSol(g.solModifiers)}):f.forEach(h=&gt;{d(h);g.retrigger()})}var Cnds=
{OnAdvClosed(){return!0},OnFirstAdvClosed(){return!0},OnSignInFailed(){return!0},OnSignInSuccess(){return!0},IsSignedIn(){return!!this.player},IsPurchasesAvailable(){return!!this.payments},HasAnyPurchase(){return 0&lt;this.purchases.length},OnBuySuccess(a){return a===this.lastPurchaseID},OnBuyFailed(a){return a===this.lastPurchaseID},OnAnyBuySuccess(){return!0},OnAnyBuyFailed(){return!0},OnPurchasesLoadSuccess(){return!0},OnPurchasesLoadFailed(){return!0},OnCatalogLoadSuccess(){return!0},OnCatalogLoadFailed(){return!0},
HasPurchase(a){return this.purchases.some(f=&gt;f.productID===a)},EachProduct(){c(this._runtime,this.products,a=&gt;{this.currentProductID=a.id||a.productID;this.currentProductTitle=a.title;this.currentProductDescription=a.description;this.currentProductImage=a.imageURI;this.currentProductPrice=parseFloat(a.price)});return!1},EachPurchase(){c(this._runtime,this.purchases,a=&gt;{this.currentPurchaseID=a.productID;this.currentPurchaseToken=a.purchaseToken;this.currentPurchaseSign=a.signature});return!1},OnRewardedVideoOpen(){return!0},
OnRewardedVideoClose(){return!0},OnRewardedVideoError(){return!0},OnRewardedVideoReward(){return!0},IsRewardedVideoPlaying(){return this.isRewardedVideoPlaying},OnIncrementPlayerStateFailed(a){return a===this.lastStateKey},OnSetPlayerStateFailed(a){return a===this.lastStateKey},OnSetPlayerDataFailed(a){return a===this.lastDataKey},OnLoadPlayerStatsSuccess(){return!0},OnLoadPlayerStatsFailed(){return!0},OnLoadPlayerDataSuccess(){return!0},OnLoadPlayerDataFailed(){return!0},OnConsumeSuccess(a){return a===
this.lastPurchaseID},OnConsumeFailed(a){return a===this.lastPurchaseID},OnAnyConsumeSuccess(){return!0},OnAnyConsumeFailed(){return!0},OnBannerDisplayed(a){return a===this.lastBannerID},OnBannerDestroyed(a){return a===this.lastBannerID},IsBannerDisplaying(a){a=this.banners[a];return!(!a||!a.displayed)}};globalThis.C3&amp;&amp;(C3.Plugins.Eponesh_YandexSDK.Cnds=Cnds);try{module.exports=Cnds}catch(a){}Cnds}"use strict";
var Acts={async ShowFullscreen(){await this.ready;this.ysdk.adv.showFullscreenAdv({callbacks:{}})},async CreateBanner(c,b=0,a=0,f=0,d=0,e){if(!this.banners[c]){await this.rtbReady;var g=document.createElement("div");this.banners[c]={$el:g,displayed:!1};g.id=`yandex_rtb_${c}`;g.style.cssText=`
                ${"\n        display: flex;\n        justify-content: center;\n        align-tems: center;\n        position: absolute;\n        z-index: 10;\n    "}
                top: ${b}px;
                left: ${a}px;
                width: ${0===f?"auto":`${f}px`};
                height: ${0===d?"auto":`${d}px`};
                ${e}
            `;document.body.appendChild(g);Ya.Context.AdvManager.render({blockId:c,renderTo:g.id,async:!0,onRender:()=&gt;{this.banners[c].displayed=!0;this.lastBannerID=c;this.Trigger(this.conditions.OnBannerDisplayed)}})}},async CreateStickyBanner(c,b=0,a=0,f=0,d){if(!this.banners[c]){await this.rtbReady;var e=document.createElement("div");this.banners[c]={$el:e,displayed:!1};e.id=`yandex_rtb_${c}`;var g=(()=&gt;{switch(b){case 0:return"top: 0; left: 0;";case 1:return"top: 0; left: 50%; transform: translateX(-50%);";
case 2:return"top: 0; right: 0;";case 3:return"top: 0; left: 0; bottom: 0;";case 4:return"top: 50%; left: 50%; transform: translate(-50%, -50%);";case 5:return"top: 0; right: 0; bottom: 0;";case 6:return"bottom: 0; left: 0;";case 7:return"bottom: 0; left: 50%; transform: translateX(-50%);";case 8:return"bottom: 0; right: 0;";default:return""}})();e.style.cssText=`
                ${"\n        display: flex;\n        justify-content: center;\n        align-tems: center;\n        position: absolute;\n        z-index: 10;\n    "}
                ${g}
                width: ${0===a?"100%":`${a}px`};
                height: ${0===f?"100%":`${f}px`};
                ${d}
            `;document.body.appendChild(e);Ya.Context.AdvManager.render({blockId:c,renderTo:e.id,async:!0,onRender:()=&gt;{this.banners[c].displayed=!0;this.lastBannerID=c;this.Trigger(this.conditions.OnBannerDisplayed)}})}},async DisplayBanner(c){const b=this.banners[c];b&amp;&amp;(await this.rtbReady,Ya.Context.AdvManager.render({blockId:c,renderTo:b.$el.id,async:!0,onRender:()=&gt;{this.lastBannerID=c;b.displayed=!0;this.Trigger(this.conditions.OnBannerDisplayed)}}))},async RefreshBanner(c){const b=this.banners[c];
b&amp;&amp;(await this.rtbReady,Ya.Context.AdvManager.destroy(c),Ya.Context.AdvManager.render({blockId:c,renderTo:b.$el.id,async:!0,onRender:()=&gt;{this.lastBannerID=c;b.displayed=!0;this.Trigger(this.conditions.OnBannerDisplayed)}}))},async DestroyBanner(c){const b=this.banners[c];b&amp;&amp;(await this.rtbReady,Ya.Context.AdvManager.destroy(c),this.lastBannerID=c,b.displayed=!1,this.Trigger(this.conditions.OnBannerDestroyed))},async ReachGoal(c){await this.metricaReady;console.log("Reach Goal: ",c);ym(this.metricaId,
"reachGoal",c)},async SignIn(){await this.getPlayer()},async LoadCatalog(){try{this.products=await this.payments.getCatalog(),this.Trigger(this.conditions.OnCatalogLoadSuccess)}catch(c){this.Trigger(this.conditions.OnCatalogLoadFailed)}},async LoadPurchases(c){if(c)try{await this.getPlayer()}catch(b){this.Trigger(this.conditions.OnPurchasesLoadFailed)}try{this.purchases=await this.payments.getPurchases(),this.Trigger(this.conditions.OnPurchasesLoadSuccess)}catch(b){this.Trigger(this.conditions.OnPurchasesLoadFailed)}},
async Buy(c){try{const b=await this.payments.purchase(c);this.purchases.push(b);this.lastPurchaseID=c;this.lastPurchaseToken=b.purchaseToken;this.Trigger(this.conditions.OnAnyBuySuccess);this.Trigger(this.conditions.OnBuySuccess)}catch(b){this.lastPurchaseID=c,this.Trigger(this.conditions.OnAnyBuyFailed),this.Trigger(this.conditions.OnBuyFailed)}},async ShowRewardedVideo(){await this.ready;try{this.ysdk.adv.showRewardedVideo({callbacks:{onOpen:()=&gt;{this.isRewardedVideoPlaying=!0;this.Trigger(this.conditions.OnRewardedVideoOpen)},
onRewarded:()=&gt;this.Trigger(this.conditions.OnRewardedVideoReward),onClose:()=&gt;{this.isRewardedVideoPlaying=!1;this.Trigger(this.conditions.OnRewardedVideoClose)},onError:()=&gt;this.Trigger(this.conditions.OnRewardedVideoError)}})}catch(c){this.Trigger(this.conditions.OnRewardedVideoError)}},async ConsumePurchase(c){const b=this.purchases.find(a=&gt;a.productID===c);try{await this.payments.consumePurchase(b.purchaseToken),this.purchases=this.purchases.filter(a=&gt;a.productID!==c),this.lastPurchaseID=c,this.lastPurchaseToken=
b?b.token:"",this.Trigger(this.conditions.OnAnyConsumeSuccess),this.Trigger(this.conditions.OnConsumeSuccess)}catch(a){this.lastPurchaseID=c,this.lastPurchaseToken=b?b.token:"",this.Trigger(this.conditions.OnAnyConsumeFailed),this.Trigger(this.conditions.OnConsumeFailed)}},async IncrementState(c,b){this.playerStats[c]=this.playerStats[c]?this.playerStats[c]+b:b;try{await this.player.incrementStats({[c]:b});const a=await this.player.getStats([c]);this.playerStats[c]=a[c]||0}catch(a){this.lastStateKey=
c,this.Trigger(this.conditions.OnIncrementPlayerStateFailed)}},async SetState(c,b){this.playerStats[c]=b;try{await this.player.setStats({[c]:b});const a=await this.player.getStats([c]);this.playerStats[c]=a[c]||0}catch(a){this.lastStateKey=c,this.Trigger(this.conditions.OnSetPlayerStateFailed)}},async SetData(c,b){this.playerData[c]=b;try{await this.player.setData({[c]:b})}catch(a){this.lastDataKey=c,this.Trigger(this.conditions.OnSetPlayerDataFailed)}},async LoadStats(){try{this.playerStats=await this.player.getStats()||
{},this.Trigger(this.conditions.OnLoadPlayerStatsSuccess)}catch(c){this.Trigger(this.conditions.OnLoadPlayerStatsFailed)}},async LoadData(){try{this.playerData=await this.player.getData()||{},this.Trigger(this.conditions.OnLoadPlayerDataSuccess)}catch(c){this.Trigger(this.conditions.OnLoadPlayerDataFailed)}}};globalThis.C3&amp;&amp;(C3.Plugins.Eponesh_YandexSDK.Acts=Acts);try{module.exports=Acts}catch(c){}Acts;"use strict";
var Exps={PlayerName(){return this.player?this.player.getName():""},PlayerId(){return this.player?this.player.getID():""},PlayerPhotoSmall(){return this.player?this.player.getPhoto("small"):""},PlayerPhotoMedium(){return this.player?this.player.getPhoto("medium"):""},PlayerPhotoLarge(){return this.player?this.player.getPhoto("large"):""},CurrentProductID(){return this.currentProductID||""},CurrentProductTitle(){return this.currentProductTitle||""},CurrentProductImage(){return this.currentProductImage||
""},CurrentProductDescription(){return this.currentProductDescription||""},CurrentProductPrice(){return this.currentProductPrice||0},CurrentPurchaseID(){return this.currentPurchaseID||""},CurrentPurchaseToken(){return this.currentPurchaseToken||""},CurrentPurchaseSign(){return this.currentPurchaseSign||""},GetPurchaseToken(c){return this.getPurchase(c).purchaseToken||""},LastPurchaseId(){return this.lastPurchaseID||""},LastPurchaseToken(){return this.lastPurchaseToken||""},GetProductTitle(c){return this.getProduct(c).title||
""},GetProductDescription(c){return this.getProduct(c).description||""},GetProductImage(c){return this.getProduct(c).imageURI||""},GetProductPrice(c){return parseFloat(this.getProduct(c).price||0)},LastPlayerStateKey(){return this.lastStateKey||""},LastPlayerDataKey(){return this.lastDataKey||""},GetPlayerState(c){return this.playerStats[c]||0},GetPlayerData(c){return this.playerData[c]||""},LastBanner(){return this.lastBannerID}};globalThis.C3&amp;&amp;(C3.Plugins.Eponesh_YandexSDK.Exps=Exps);
try{module.exports=Exps}catch(c){}Exps;"use strict";{const c=self.C3;c.Plugins.AJAX=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Plugins.AJAX.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Plugins.AJAX.Instance=class extends c.SDKInstanceBase{constructor(b,a){super(b);this._curTag=this._lastData="";this._progress=0;this._timeout=-1;this._nextRequestHeaders=new Map;this._nextReponseBinaryData=null;this._nextRequestOverrideMimeType="";this._nwjsAppFolder=this._nwjsPath=this._nwjsFs=null;if(this._isNWjs="nwjs"===this._runtime.GetExportType())this._nwjsFs=require("fs"),this._nwjsPath=require("path"),this._nwjsAppFolder=this._nwjsPath.dirname((self.process||nw.process).execPath)+
"\\"}Release(){super.Release()}async _TriggerError(b,a,f){console.error(`[Construct 3] AJAX request to '${a}' (tag '${b}') failed: `,f);this._curTag=b;await this.TriggerAsync(c.Plugins.AJAX.Cnds.OnAnyError);await this.TriggerAsync(c.Plugins.AJAX.Cnds.OnError)}async _TriggerComplete(b){this._curTag=b;await this.TriggerAsync(c.Plugins.AJAX.Cnds.OnAnyComplete);await this.TriggerAsync(c.Plugins.AJAX.Cnds.OnComplete)}async _OnProgress(b,a){a.lengthComputable&amp;&amp;(this._progress=a.loaded/a.total,this._curTag=
b,await this.TriggerAsync(c.Plugins.AJAX.Cnds.OnProgress))}_OnError(b,a,f){if(this._isNWjs){var d=this._nwjsFs,e=this._nwjsAppFolder+a;d.existsSync(e)?d.readFile(e,{encoding:"utf8"},(g,h)=&gt;{g?this._TriggerError(b,a,g):(this._lastData=h.replace(/\r\n/g,"\n"),this._TriggerComplete(b))}):this._TriggerError(b,a,f)}else this._TriggerError(b,a,f)}async _DoCordovaRequest(b,a){const f=this._runtime.GetAssetManager(),d=this._nextReponseBinaryData;this._nextReponseBinaryData=null;try{if(d){const e=await f.CordovaFetchLocalFileAsArrayBuffer(a);
d.SetArrayBufferTransfer(e);this._lastData=""}else this._lastData=(await f.CordovaFetchLocalFileAsText(a)).replace(/\r\n/g,"\n");this._TriggerComplete(b)}catch(e){this._TriggerError(b,a,e)}}_DoRequest(b,a,f,d){return new Promise(e=&gt;{const g=l=&gt;{this._OnError(b,a,l);e()},h=this._nextReponseBinaryData;this._nextReponseBinaryData=null;try{const l=new XMLHttpRequest;l.onreadystatechange=()=&gt;{if(4===l.readyState){this._lastData=h?"":(l.responseText||"").replace(/\r\n/g,"\n");if(400&lt;=l.status)this._TriggerError(b,
a,l.status+l.statusText);else{const m=this._lastData.length||h&amp;&amp;l.response instanceof ArrayBuffer;this._isNWjs&amp;&amp;!m||!this._isNWjs&amp;&amp;0===l.status&amp;&amp;!m||(h&amp;&amp;h.SetArrayBufferTransfer(l.response),this._TriggerComplete(b))}e()}};l.onerror=g;l.ontimeout=g;l.onabort=g;l.onprogress=m=&gt;this._OnProgress(b,m);l.open(f,a);0&lt;=this._timeout&amp;&amp;"undefined"!==typeof l.timeout&amp;&amp;(l.timeout=this._timeout);l.responseType=h?"arraybuffer":"text";d&amp;&amp;!this._nextRequestHeaders.has("Content-Type")&amp;&amp;("string"!==typeof d?l.setRequestHeader("Content-Type",
"application/octet-stream"):l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"));for(const [m,n]of this._nextRequestHeaders)try{l.setRequestHeader(m,n)}catch(r){console.error(`[Construct 3] AJAX: Failed to set header '${m}: ${n}': `,r)}this._nextRequestHeaders.clear();if(this._nextRequestOverrideMimeType){try{l.overrideMimeType(this._nextRequestOverrideMimeType)}catch(m){console.error("[Construct 3] AJAX: failed to override MIME type: ",m)}this._nextRequestOverrideMimeType=""}d?
l.send(d):l.send()}catch(l){g(l)}})}GetDebuggerProperties(){return[{title:"plugins.ajax.debugger.title",properties:[{name:"plugins.ajax.debugger.last-data",value:this._lastData}]}]}SaveToJson(){return{lastData:this._lastData}}LoadFromJson(b){this._lastData=b.lastData;this._curTag="";this._progress=0}}}"use strict";
{const c=self.C3;c.Plugins.AJAX.Cnds={OnComplete(b){return c.equalsNoCase(this._curTag,b)},OnAnyComplete(){return!0},OnError(b){return c.equalsNoCase(this._curTag,b)},OnAnyError(){return!0},OnProgress(b){return c.equalsNoCase(this._curTag,b)}}}"use strict";
{const c=self.C3;c.Plugins.AJAX.Acts={async Request(b,a){this._runtime.IsCordova()&amp;&amp;c.IsRelativeURL(a)&amp;&amp;"file:"===location.protocol?await this._DoCordovaRequest(b,a):this._runtime.IsPreview()&amp;&amp;c.IsRelativeURL(a)?(a=this._runtime.GetAssetManager().GetLocalUrlAsBlobUrl(a.toLowerCase()),await this._DoRequest(b,a,"GET",null)):await this._DoRequest(b,a,"GET",null)},async RequestFile(b,a){this._runtime.IsCordova()&amp;&amp;"file:"===location.protocol?await this._DoCordovaRequest(b,a):await this._DoRequest(b,this._runtime.GetAssetManager().GetLocalUrlAsBlobUrl(a),
"GET",null)},async Post(b,a,f,d){await this._DoRequest(b,a,d,f)},async PostBinary(b,a,f,d){f&amp;&amp;(f=f.GetFirstPicked(this._inst))&amp;&amp;(f=f.GetSdkInstance().GetArrayBufferReadOnly(),await this._DoRequest(b,a,d,f))},SetTimeout(b){this._timeout=1E3*b},SetHeader(b,a){this._nextRequestHeaders.set(b,a)},SetResponseBinary(b){b&amp;&amp;(b=b.GetFirstPicked(this._inst))&amp;&amp;(this._nextReponseBinaryData=b.GetSdkInstance())},OverrideMIMEType(b){this._nextRequestOverrideMimeType=b}}}"use strict";
self.C3.Plugins.AJAX.Exps={LastData(){return this._lastData},Progress(){return this._progress},Tag(){return this._curTag}};"use strict";{const c=self.C3;c.Plugins.Arr=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Plugins.Arr.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=self.IInstance;function a(d,e,g){if(e&lt;d.length)c.truncateArray(d,e);else if(e&gt;d.length)if("function"===typeof g)for(var h=d.length;h&lt;e;++h)d.push(g());else for(h=d.length;h&lt;e;++h)d.push(g)}c.Plugins.Arr.Instance=class extends c.SDKInstanceBase{constructor(d,e){super(d);this._cx=10;this._cz=this._cy=1;this._arr=null;this._forX=[];this._forY=[];this._forZ=[];this._forDepth=-1;e&amp;&amp;(this._cx=e[0],this._cy=e[1],this._cz=e[2]);this._arr=c.MakeFilledArray(this._cx,()=&gt;c.MakeFilledArray(this._cy,
()=&gt;c.MakeFilledArray(this._cz,0)))}Release(){this._arr=null;super.Release()}At(d,e,g){d=Math.floor(d);e=Math.floor(e);g=Math.floor(g);return 0&lt;=d&amp;&amp;d&lt;this._cx&amp;&amp;0&lt;=e&amp;&amp;e&lt;this._cy&amp;&amp;0&lt;=g&amp;&amp;g&lt;this._cz?this._arr[d][e][g]:0}Set(d,e,g,h){d=Math.floor(d);e=Math.floor(e);g=Math.floor(g);0&lt;=d&amp;&amp;d&lt;this._cx&amp;&amp;0&lt;=e&amp;&amp;e&lt;this._cy&amp;&amp;0&lt;=g&amp;&amp;g&lt;this._cz&amp;&amp;(this._arr[d][e][g]=h)}SetSize(d,e,g){d=Math.floor(d);e=Math.floor(e);g=Math.floor(g);0&gt;d&amp;&amp;(d=0);0&gt;e&amp;&amp;(e=0);0&gt;g&amp;&amp;(g=0);if(this._cx!==d||this._cy!==e||this._cz!==g){this._cx=
d;this._cy=e;this._cz=g;var h=this._arr;a(h,d,()=&gt;c.MakeFilledArray(e,()=&gt;c.MakeFilledArray(g,0)));for(let l=0;l&lt;d;++l){a(h[l],e,()=&gt;c.MakeFilledArray(g,0));for(let m=0;m&lt;e;++m)a(h[l][m],g,0)}}}GetWidth(){return this._cx}GetHeight(){return this._cy}GetDepth(){return this._cz}GetDebuggerProperties(){const d=[{title:"plugins.arr.debugger.array-properties.title",properties:[{name:"plugins.arr.properties.width.name",value:this._cx,onedit:g=&gt;this.SetSize(g,this._cy,this._cz)},{name:"plugins.arr.properties.height.name",
value:this._cy,onedit:g=&gt;this.SetSize(this._cx,g,this._cz)},{name:"plugins.arr.properties.depth.name",value:this._cz,onedit:g=&gt;this.SetSize(this._cx,this._cy,g)},{name:"plugins.arr.properties.elements.name",value:this._cx*this._cy*this._cz}]}],e=[];if(1===this._cy&amp;&amp;1===this._cz)for(let g=0;g&lt;this._cx;++g)e.push({name:"$"+g,value:this._arr[g][0][0],onedit:h=&gt;this._arr[g][0][0]=h});else for(let g=0;g&lt;this._cx;++g)e.push({name:"$"+g,value:this._arr[g].toString()});e.length&amp;&amp;d.push({title:"plugins.arr.debugger.array-data.title",
properties:e});return d}GetAsJsonString(){return JSON.stringify({c2array:!0,size:[this._cx,this._cy,this._cz],data:this._arr})}SaveToJson(){return{size:[this._cx,this._cy,this._cz],data:this._arr}}LoadFromJson(d){const e=d.size;this._cx=e[0];this._cy=e[1];this._cz=e[2];this._arr=d.data}_GetForX(){return 0&lt;=this._forDepth&amp;&amp;this._forDepth&lt;this._forX.length?this._forX[this._forDepth]:0}_GetForY(){return 0&lt;=this._forDepth&amp;&amp;this._forDepth&lt;this._forY.length?this._forY[this._forDepth]:0}_GetForZ(){return 0&lt;=
this._forDepth&amp;&amp;this._forDepth&lt;this._forZ.length?this._forZ[this._forDepth]:0}GetScriptInterfaceClass(){return self.IArrayInstance}};const f=new WeakMap;self.IArrayInstance=class extends b{constructor(){super();f.set(this,b._GetInitInst().GetSdkInstance())}get width(){return f.get(this).GetWidth()}get height(){return f.get(this).GetHeight()}get depth(){return f.get(this).GetDepth()}setSize(d,e=1,g=1){f.get(this).SetSize(d,e,g)}getAt(d,e=0,g=0){return f.get(this).At(d,e,g)}setAt(d,e,g=0,h=0){if("number"!==
typeof d&amp;&amp;"string"!==typeof d)throw new TypeError("invalid type");f.get(this).Set(e,g,h,d)}}}"use strict";
{const c=self.C3;function b(a,f,d,e,g){a.PushCopySol(d);f.Retrigger(e,g);a.PopSol(d)}c.Plugins.Arr.Cnds={CompareX(a,f,d){return c.compare(this.At(a,0,0),f,d)},CompareXY(a,f,d,e){return c.compare(this.At(a,f,0),d,e)},CompareXYZ(a,f,d,e,g){return c.compare(this.At(a,f,d),e,g)},ArrForEach(a){const f=this._runtime,d=f.GetEventSheetManager(),e=f.GetCurrentEvent(),g=e.GetSolModifiers(),h=f.GetEventStack(),l=h.GetCurrentStackFrame(),m=h.Push(e),n=++this._forDepth,r=this._forX;var q=this._forY,t=this._forZ;
const u=this._cx,w=this._cy;var y=this._cz;n===this._forX.length?(r.push(0),q.push(0),t.push(0)):(r[n]=0,q[n]=0,t[n]=0);f.SetDebuggingEnabled(!1);if(0===a)for(a=0;a&lt;u;++a)for(let C=0;C&lt;w;++C)for(let G=0;G&lt;y;++G)r[n]=a,q[n]=C,t[n]=G,b(d,e,g,l,m);else if(1===a)for(t=0;t&lt;u;++t)for(y=0;y&lt;w;++y)r[n]=t,q[n]=y,b(d,e,g,l,m);else for(q=0;q&lt;u;++q)r[n]=q,b(d,e,g,l,m);f.SetDebuggingEnabled(!0);this._forDepth--;h.Pop();return!1},CompareCurrent(a,f){return c.compare(this.At(this._GetForX(),this._GetForY(),this._GetForZ()),
a,f)},Contains(a){const f=this._cx,d=this._cy,e=this._cz,g=this._arr;for(let h=0;h&lt;f;++h)for(let l=0;l&lt;d;++l)for(let m=0;m&lt;e;++m)if(g[h][l][m]===a)return!0;return!1},IsEmpty(){return 0===this._cx||0===this._cy||0===this._cz},CompareSize(a,f,d){let e=0;switch(a){case 0:e=this._cx;break;case 1:e=this._cy;break;case 2:e=this._cz}return c.compare(e,f,d)}}}"use strict";
{const c=self.C3;function b(a,f){if("number"===typeof a&amp;&amp;"number"===typeof f)return a-f;a=a.toString();f=f.toString();return a&lt;f?-1:a&gt;f?1:0}c.Plugins.Arr.Acts={Clear(a){const f=this._cx,d=this._cy,e=this._cz,g=this._arr;for(let h=0;h&lt;f;++h)for(let l=0;l&lt;d;++l)for(let m=0;m&lt;e;++m)g[h][l][m]=a},SetSize(a,f,d){this.SetSize(a,f,d)},SetX(a,f){this.Set(a,0,0,f)},SetXY(a,f,d){this.Set(a,f,0,d)},SetXYZ(a,f,d,e){this.Set(a,f,d,e)},Push(a,f,d){var e=this._cx,g=this._cy;const h=this._cz,l=this._arr;if(0===d)e=
c.MakeFilledArray(g,()=&gt;c.MakeFilledArray(h,f)),0===a?l.push(e):l.unshift(e),this._cx++;else if(1===d){for(g=0;g&lt;e;++g)d=c.MakeFilledArray(h,f),0===a?l[g].push(d):l[g].unshift(d);this._cy++}else{for(d=0;d&lt;e;++d)for(let m=0;m&lt;g;++m)0===a?l[d][m].push(f):l[d][m].unshift(f);this._cz++}},Pop(a,f){const d=this._cx;var e=this._cy,g=this._cz;const h=this._arr;if(0===f)0!==d&amp;&amp;(0===a?h.pop():h.shift(),this._cx--);else if(1===f){if(0!==e){for(e=0;e&lt;d;++e)0===a?h[e].pop():h[e].shift();this._cy--}}else if(0!==
g){for(f=0;f&lt;d;++f)for(g=0;g&lt;e;++g)0===a?h[f][g].pop():h[f][g].shift();this._cz--}},Reverse(a){const f=this._cx;var d=this._cy,e=this._cz;const g=this._arr;if(0!==f&amp;&amp;0!==d&amp;&amp;0!==e)if(0===a)g.reverse();else if(1===a)for(d=0;d&lt;f;++d)g[d].reverse();else for(a=0;a&lt;f;++a)for(e=0;e&lt;d;++e)g[a][e].reverse()},Sort(a){const f=this._cx;var d=this._cy,e=this._cz;const g=this._arr;if(0!==f&amp;&amp;0!==d&amp;&amp;0!==e)if(0===a)g.sort((h,l)=&gt;b(h[0][0],l[0][0]));else if(1===a)for(d=0;d&lt;f;++d)g[d].sort((h,l)=&gt;b(h[0],l[0]));else for(a=
0;a&lt;f;++a)for(e=0;e&lt;d;++e)g[a][e].sort(b)},Delete(a,f){a=Math.floor(a);if(!(0&gt;a)){var d=this._cx,e=this._cy,g=this._cz,h=this._arr;if(0===f)a&gt;=d||(h.splice(a,1),this._cx--);else if(1===f){if(!(a&gt;=e)){for(e=0;e&lt;d;++e)h[e].splice(a,1);this._cy--}}else if(!(a&gt;=g)){for(f=0;f&lt;d;++f)for(g=0;g&lt;e;++g)h[f][g].splice(a,1);this._cz--}}},Insert(a,f,d){f=Math.floor(f);if(!(0&gt;f)){var e=this._cx,g=this._cy,h=this._cz,l=this._arr;if(0===d)f&gt;e||(l.splice(f,0,c.MakeFilledArray(g,()=&gt;c.MakeFilledArray(h,a))),this._cx++);
else if(1===d){if(!(f&gt;g)){for(g=0;g&lt;e;++g)l[g].splice(f,0,c.MakeFilledArray(h,a));this._cy++}}else if(!(f&gt;h)){for(d=0;d&lt;e;++d)for(let m=0;m&lt;g;++m)l[d][m].splice(f,0,a);this._cz++}}},JSONLoad(a){let f=null;try{f=JSON.parse(a)}catch(d){console.error("[Construct 3] Failed to parse JSON: ",d);return}f.c2array&amp;&amp;(a=f.size,this._cx=a[0],this._cy=a[1],this._cz=a[2],this._arr=f.data)},JSONDownload(a){const f=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(f,
a)}}}"use strict";
self.C3.Plugins.Arr.Exps={At(c,b,a){return this.At(c,b||0,a||0)},Width(){return this._cx},Height(){return this._cy},Depth(){return this._cz},CurX(){return this._GetForX()},CurY(){return this._GetForY()},CurZ(){return this._GetForZ()},CurValue(){return this.At(this._GetForX(),this._GetForY(),this._GetForZ())},Front(){return this.At(0,0,0)},Back(){return this.At(this._cx-1,0,0)},IndexOf(c){const b=this._arr;for(let a=0,f=this._cx;a&lt;f;++a)if(b[a][0][0]===c)return a;return-1},LastIndexOf(c){const b=this._arr;
for(let a=this._cx-1;0&lt;=a;--a)if(b[a][0][0]===c)return a;return-1},AsJSON(){return this.GetAsJsonString()}};"use strict";{const c=self.C3;c.Plugins.Sprite=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.Sprite.Type=class extends c.SDKTypeBase{constructor(b){super(b);this._animations=b.GetAnimations()}Release(){c.clearArray(this._animations);super.Release()}OnCreate(){for(const b of this._animations)b.LoadAllAssets(this._runtime)}LoadTextures(b){const a={sampling:this._runtime.GetSampling()};return Promise.all(this._animations.map(f=&gt;f.LoadAllTextures(b,a)))}ReleaseTextures(){for(const b of this._animations)b.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const b of this._objectClass.instancesIncludingPendingCreate())b.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(b){c.Plugins.Sprite._FinishCondition(this,
b)}}}"use strict";
{const c=self.C3,b=c.New(c.Rect),a=c.New(c.Quad),f=c.New(c.Vector2);c.Plugins.Sprite.Instance=class extends c.SDKWorldInstanceBase{constructor(g,h){super(g);let l=!0,m="",n=0,r=!0;h&amp;&amp;(l=!!h[0],m=h[1],n=h[2],r=h[3]);this._currentAnimation=this._objectClass.GetAnimationByName(m)||this._objectClass.GetAnimations()[0];this._currentFrameIndex=c.clamp(n,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);h=this._currentAnimationFrame.GetImageInfo();
this._currentTexture=h.GetTexture();this._currentRcTex=h.GetTexRect();this.HandleWebGLContextLoss();g.SetFlag(2,!0);g.SetFlag(1,0&lt;=this._currentAnimation.GetSpeed());this._currentAnimationSpeed=Math.abs(this._currentAnimation.GetSpeed());this._currentAnimationRepeatTo=this._currentAnimation.GetRepeatTo();this._animationTimer=c.New(c.KahanSum);this._animationRepeats=this._frameStartTime=0;this._animTriggerName="";this._changeAnimFrameIndex=-1;this._changeAnimationName="";this._changeAnimationFrom=
0;g=this.GetWorldInfo();this._bquadRef=g.GetBoundingQuad();g.SetVisible(l);g.SetCollisionEnabled(r);g.SetOriginX(this._currentAnimationFrame.GetOriginX());g.SetOriginY(this._currentAnimationFrame.GetOriginY());g.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly());g.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()}OnWebGLContextLost(){this._currentTexture=null}OnWebGLContextRestored(){this._UpdateCurrentTexture()}Draw(g){var h=this._currentTexture;null!==h&amp;&amp;(g.SetTexture(h),h=this.GetWorldInfo(),h.HasMesh()?this._DrawMesh(h,g):this._DrawStandard(h,g))}_DrawStandard(g,h){let l=this._bquadRef;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(l=g.PixelRoundQuad(l));h.Quad3(l,this._currentRcTex)}_DrawMesh(g,
h){const l=g.GetTransformedMesh();if(g.IsMeshChanged()){g.CalculateBbox(b,a,!1);let m=a;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(m=g.PixelRoundQuad(m));l.CalculateTransformedMesh(g.GetSourceMesh(),m,this._currentRcTex);g.SetMeshChanged(!1)}l.Draw(h)}GetAnimationTime(){return this._animationTimer.Get()}IsAnimationPlaying(){return this._inst.GetFlag(2)}SetAnimationPlaying(g){this._inst.SetFlag(2,g)}IsPlayingForwards(){return this._inst.GetFlag(1)}SetPlayingForwards(g){this._inst.SetFlag(1,g)}IsInAnimationTrigger(){return this._inst.GetFlag(4)}SetInAnimationTrigger(g){this._inst.SetFlag(4,
g)}Tick(){this._changeAnimationName&amp;&amp;this._DoChangeAnimation();0&lt;=this._changeAnimFrameIndex&amp;&amp;this._DoChangeAnimFrame();const g=this._currentAnimationSpeed;if(this.IsAnimationPlaying()&amp;&amp;0!==g){var h=this._runtime.GetDt(this._inst);this._animationTimer.Add(h);h=this.GetAnimationTime();var l=this._currentAnimationFrame,m=l.GetDuration()/g;if(!(h&lt;this._frameStartTime+m)){var n=this._currentAnimation,r=this._currentAnimationRepeatTo,q=n.GetFrameCount(),t=n.GetRepeatCount(),u=n.IsLooping(),w=n.IsPingPong();
this.IsPlayingForwards()?this._currentFrameIndex++:this._currentFrameIndex--;this._frameStartTime+=m;this._currentFrameIndex&gt;=q&amp;&amp;(w?(this.SetPlayingForwards(!1),this._currentFrameIndex=q-2):u?this._currentFrameIndex=r:(this._animationRepeats++,this._animationRepeats&gt;=t?this._FinishAnimation(!1):this._currentFrameIndex=r));0&gt;this._currentFrameIndex&amp;&amp;(w?(this._currentFrameIndex=1,this.SetPlayingForwards(!0),u||(this._animationRepeats++,this._animationRepeats&gt;=t&amp;&amp;this._FinishAnimation(!0))):u?this._currentFrameIndex=
r:(this._animationRepeats++,this._animationRepeats&gt;=t?this._FinishAnimation(!0):this._currentFrameIndex=r));this._currentFrameIndex=c.clamp(this._currentFrameIndex,0,q-1);m=n.GetFrameAt(this._currentFrameIndex);h&gt;this._frameStartTime+m.GetDuration()/g&amp;&amp;(this._frameStartTime=h);this._OnFrameChanged(l,m)}}else this._StopTicking()}_FinishAnimation(g){this._currentFrameIndex=g?0:this._currentAnimation.GetFrameCount()-1;this.SetAnimationPlaying(!1);this._animTriggerName=this._currentAnimation.GetName();
this.SetInAnimationTrigger(!0);this.Trigger(c.Plugins.Sprite.Cnds.OnAnyAnimFinished);this.Trigger(c.Plugins.Sprite.Cnds.OnAnimFinished);this.SetInAnimationTrigger(!1);this._animationRepeats=0}_OnFrameChanged(g,h){if(g!==h){var l=this.GetWorldInfo(),m=g.GetImageInfo(),n=h.GetImageInfo(),r=m.GetWidth();m=m.GetHeight();var q=n.GetWidth(),t=n.GetHeight();r!==q&amp;&amp;l.SetWidth(l.GetWidth()*(q/r));m!==t&amp;&amp;l.SetHeight(l.GetHeight()*(t/m));l.SetOriginX(h.GetOriginX());l.SetOriginY(h.GetOriginY());l.SetSourceCollisionPoly(h.GetCollisionPoly());
l.SetBboxChanged();this._currentAnimationFrame=h;this._currentTexture=n.GetTexture();this._currentRcTex=n.GetTexRect();l=this.GetInstance().GetBehaviorInstances();for(let u=0,w=l.length;u&lt;w;++u)l[u].OnSpriteFrameChanged(g,h);this.Trigger(c.Plugins.Sprite.Cnds.OnFrameChanged);this._runtime.UpdateRender()}}_StartAnim(g){this.SetAnimationPlaying(!0);this._frameStartTime=this.GetAnimationTime();1===g&amp;&amp;0!==this._currentFrameIndex&amp;&amp;(this._changeAnimFrameIndex=0,this.IsInAnimationTrigger()||this._DoChangeAnimFrame());
this._StartTicking()}_SetAnim(g,h){this._changeAnimationName=g;this._changeAnimationFrom=h;this._StartTicking();this.IsInAnimationTrigger()||this._DoChangeAnimation()}_GetCurrentAnimationName(){return this._changeAnimationName?this._changeAnimationName:this._currentAnimation.GetName()}_SetAnimFrame(g){isFinite(g)&amp;&amp;(this._changeAnimFrameIndex=g,this.IsInAnimationTrigger()||this._DoChangeAnimFrame())}_GetAnimFrame(){return this._currentFrameIndex}_SetAnimSpeed(g){this._currentAnimationSpeed=Math.abs(g);
this.SetPlayingForwards(0&lt;=g);0&lt;this._currentAnimationSpeed&amp;&amp;this._StartTicking()}_GetAnimSpeed(){return this.IsPlayingForwards()?this._currentAnimationSpeed:-this._currentAnimationSpeed}_SetAnimRepeatToFrame(g){this._currentAnimationRepeatTo=g=c.clamp(Math.floor(g),0,this._currentAnimation.GetFrameCount()-1)}_GetAnimRepeatToFrame(){return this._currentAnimationRepeatTo}_DoChangeAnimation(){const g=this._currentAnimationFrame;var h=this._objectClass.GetAnimationByName(this._changeAnimationName);this._changeAnimationName=
"";!h||h===this._currentAnimation&amp;&amp;this.IsAnimationPlaying()||(this._currentAnimation=h,this.SetPlayingForwards(0&lt;=h.GetSpeed()),this._currentAnimationSpeed=Math.abs(h.GetSpeed()),this._currentAnimationRepeatTo=h.GetRepeatTo(),this._currentFrameIndex=c.clamp(this._currentFrameIndex,0,this._currentAnimation.GetFrameCount()-1),1===this._changeAnimationFrom&amp;&amp;(this._currentFrameIndex=0),this.SetAnimationPlaying(!0),this._frameStartTime=this.GetAnimationTime(),h=this._currentAnimation.GetFrameAt(this._currentFrameIndex),
this._OnFrameChanged(g,h))}_DoChangeAnimFrame(){const g=this._currentAnimationFrame;var h=this._currentFrameIndex;this._currentFrameIndex=c.clamp(Math.floor(this._changeAnimFrameIndex),0,this._currentAnimation.GetFrameCount()-1);this._changeAnimFrameIndex=-1;h!==this._currentFrameIndex&amp;&amp;(h=this._currentAnimation.GetFrameAt(this._currentFrameIndex),this._OnFrameChanged(g,h),this._frameStartTime=this.GetAnimationTime())}_UpdateCurrentTexture(){const g=this._currentAnimationFrame.GetImageInfo();this._currentTexture=
g.GetTexture();this._currentRcTex=g.GetTexRect();this.GetWorldInfo().SetMeshChanged(!0)}GetImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()}GetImagePoint(g){const h=this._currentAnimationFrame,l=this.GetWorldInfo();if("string"===typeof g)g=h.GetImagePointByName(g);else if("number"===typeof g)g=h.GetImagePointByIndex(g-1);else throw new TypeError("expected string or number");if(!g)return[l.GetX(),l.GetY()];f.copy(g.GetVec2());if(l.HasMesh()){const [m,n]=l.GetSourceMesh().TransformPoint(f.getX(),
f.getY());f.set(m,n)}f.offset(-h.GetOriginX(),-h.GetOriginY());f.scale(l.GetWidth(),l.GetHeight());f.rotate(l.GetAngle());f.offset(l.GetX(),l.GetY());return[f.getX(),f.getY()]}GetCollisionPolyPointCount(){return this.GetWorldInfo().GetTransformedCollisionPoly().pointCount()}GetCollisionPolyPoint(g){g=Math.floor(g);const h=this.GetWorldInfo();var l=h.GetTransformedCollisionPoly();const m=l.pointCount();g===m&amp;&amp;(g=0);if(0&gt;g||g&gt;=m)return[0,0];l=l.pointsArr();return[l[2*g]+h.GetX(),l[2*g+1]+h.GetY()]}GetDebuggerProperties(){const g=
c.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:h=&gt;this.CallAction(g.SetAnim,h,0)},{name:"plugins.sprite.debugger.animation-properties.current-frame",value:this._currentFrameIndex,onedit:h=&gt;this.CallAction(g.SetAnimFrame,h)},{name:"plugins.sprite.debugger.animation-properties.is-playing",value:this.IsAnimationPlaying(),onedit:h=&gt;
h?this.CallAction(g.StartAnim,0):this.CallAction(g.StopAnim)},{name:"plugins.sprite.debugger.animation-properties.speed",value:this._currentAnimationSpeed,onedit:h=&gt;this.CallAction(g.SetAnimSpeed,h)},{name:"plugins.sprite.debugger.animation-properties.repeats",value:this._animationRepeats,onedit:h=&gt;this._animationRepeats=h}]}]}SaveToJson(){const g={a:this._currentAnimation.GetSID()};0!==this._frameStartTime&amp;&amp;(g.fs=this._frameStartTime);var h=this.GetAnimationTime();0!==h&amp;&amp;(g.at=h);0!==this._currentFrameIndex&amp;&amp;
(g.f=this._currentFrameIndex);0!==this._currentAnimationSpeed&amp;&amp;(g.cas=this._currentAnimationSpeed);1!==this._animationRepeats&amp;&amp;(g.ar=this._animationRepeats);0!==this._currentAnimationRepeatTo&amp;&amp;(g.rt=this._currentAnimationRepeatTo);this.IsAnimationPlaying()||(g.ap=this.IsAnimationPlaying());this.IsPlayingForwards()||(g.af=this.IsPlayingForwards());h=this.GetWorldInfo();h.IsCollisionEnabled()&amp;&amp;(g.ce=h.IsCollisionEnabled());return g}LoadFromJson(g){var h=this.GetObjectClass().GetAnimationBySID(g.a);
h&amp;&amp;(this._currentAnimation=h);this._frameStartTime=g.hasOwnProperty("fs")?g.fs:0;this._animationTimer.Set(g.hasOwnProperty("at")?g.at:0);h=g.hasOwnProperty("f")?g.f:0;this._currentFrameIndex=c.clamp(h,0,this._currentAnimation.GetFrameCount()-1);this._currentAnimationSpeed=g.hasOwnProperty("cas")?g.cas:0;this._animationRepeats=g.hasOwnProperty("ar")?g.ar:1;h=g.hasOwnProperty("rt")?g.rt:0;this._currentAnimationRepeatTo=c.clamp(h,0,this._currentAnimation.GetFrameCount()-1);this.SetAnimationPlaying(g.hasOwnProperty("ap")?
!!g.ap:!0);this.SetPlayingForwards(g.hasOwnProperty("af")?!!g.af:!0);this._currentAnimationFrame=h=this._currentAnimation.GetFrameAt(this._currentFrameIndex);this._UpdateCurrentTexture();const l=this.GetWorldInfo();l.SetOriginX(h.GetOriginX());l.SetOriginY(h.GetOriginY());l.SetSourceCollisionPoly(h.GetCollisionPoly());l.SetCollisionEnabled(!!g.ce)}GetPropertyValueByIndex(g){const h=this.GetWorldInfo();switch(g){case 3:return h.IsCollisionEnabled();case 2:return c.clamp(this._currentFrameIndex,0,this._currentAnimation.GetFrameCount()-
1)}}SetPropertyValueByIndex(g,h){var l=this.GetWorldInfo();switch(g){case 3:l.SetCollisionEnabled(!!h);break;case 2:this.SetAnimationPlaying(!1);g=this._currentAnimation.GetFrameCount()-1;l=h=c.clamp(h,0,g);h=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const m=this._currentAnimation.GetFrameAt(l);this._OnFrameChanged(h,m);this._currentFrameIndex=c.clamp(l,0,g)}}GetScriptInterfaceClass(){return self.ISpriteInstance}};const d=new WeakMap,e=new Map([["current-frame",0],["beginning",1]]);
self.ISpriteInstance=class extends self.IWorldInstance{constructor(){super();d.set(this,self.IInstance._GetInitInst().GetSdkInstance())}getImagePointCount(){return d.get(this).GetImagePointCount()}getImagePointX(g){if("string"!==typeof g&amp;&amp;"number"!==typeof g)throw new TypeError("expected string or number");return d.get(this).GetImagePoint(g)[0]}getImagePointY(g){if("string"!==typeof g&amp;&amp;"number"!==typeof g)throw new TypeError("expected string or number");return d.get(this).GetImagePoint(g)[1]}getImagePoint(g){if("string"!==
typeof g&amp;&amp;"number"!==typeof g)throw new TypeError("expected string or number");return d.get(this).GetImagePoint(g)}getPolyPointCount(){return d.get(this).GetCollisionPolyPointCount()}getPolyPointX(g){return d.get(this).GetCollisionPolyPoint(g)[0]}getPolyPointY(g){return d.get(this).GetCollisionPolyPoint(g)[1]}getPolyPoint(g){return d.get(this).GetCollisionPolyPoint(g)}stopAnimation(){d.get(this).SetAnimationPlaying(!1)}startAnimation(g="current-frame"){g=e.get(g);if("undefined"===typeof g)throw Error("invalid mode");
d.get(this)._StartAnim(g)}setAnimation(g,h="beginning"){h=e.get(h);if("undefined"===typeof h)throw Error("invalid mode");d.get(this)._SetAnim(g,h)}get animationName(){return d.get(this)._GetCurrentAnimationName()}set animationFrame(g){d.get(this)._SetAnimFrame(g)}get animationFrame(){return d.get(this)._GetAnimFrame()}set animationSpeed(g){d.get(this)._SetAnimSpeed(g)}get animationSpeed(){return d.get(this)._GetAnimSpeed()}set animationRepeatToFrame(g){d.get(this)._SetAnimRepeatToFrame(g)}get animationRepeatToFrame(){return d.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return d.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return d.get(this).GetCurrentImageInfo().GetHeight()}}}"use strict";
{const c=self.C3,b=c.New(c.Rect),a=[],f=[];let d=!1,e=null,g=!1;const h=new Set;function l(u,w,y,C){const G=w.GetUID(),x=y.GetUID();G&lt;x?u.Set(w,y,C):u.Set(y,w,C)}function m(u,w,y){const C=w.GetUID(),G=y.GetUID();C&lt;G?u.Delete(w,y):u.Delete(y,w)}function n(u,w){u.DeleteEither(w)}function r(u,w,y){const C=w.GetUID(),G=y.GetUID();return C&lt;G?u.Get(w,y):u.Get(y,w)}function q(u,w,y,C){if(!w)return!1;u=u.GetInstance();const G=0!==y||0!==C,x=u.GetWorldInfo(),B=u.GetRuntime(),H=B.GetCollisionEngine();var P=
B.GetCurrentCondition();const E=P.GetEventBlock().IsOrBlock();var J=P.GetObjectClass();P=P.IsInverted();const O=w.GetCurrentSol();J=J!==w;e=w;d=J&amp;&amp;!P;g=!1;let R=0,T=0,Y=!1;O.IsSelectAll()?(b.copy(x.GetBoundingBox()),b.offset(y,C),H.GetCollisionCandidates(x.GetLayer(),w,b,f),w=f):E?B.IsCurrentConditionFirst()&amp;&amp;!O._GetOwnElseInstances().length&amp;&amp;O._GetOwnInstances().length?w=O._GetOwnInstances():(w=O._GetOwnElseInstances(),g=!0):w=O._GetOwnInstances();G&amp;&amp;(R=x.GetX(),T=x.GetY(),x.OffsetXY(y,C),x.SetBboxChanged());
for(const W of w)if(H.TestOverlap(u,W)){Y=!0;if(P)break;J&amp;&amp;h.add(W)}G&amp;&amp;(x.SetXY(R,T),x.SetBboxChanged());c.clearArray(f);return Y}function t(u){u=u.GetRuntime().GetCurrentEvent().IsOrBlock();const w=e.GetCurrentSol(),y=w._GetOwnInstances(),C=w._GetOwnElseInstances();w.IsSelectAll()?(w.SetSetPicked(h),u&amp;&amp;(c.clearArray(C),w.AddElseInstances(h,e.GetInstances()))):u?g?w.TransferElseInstancesToOwn(h):(w.AddElseInstances(h,y),w.SetSetPicked(h)):w.SetSetPicked(h);e.ApplySolToContainer()}c.Plugins.Sprite._FinishCondition=
function(u,w){d&amp;&amp;(w&amp;&amp;t(u),h.clear(),e=null,d=!1)};c.Plugins.Sprite.Cnds={OnCollision(u){if(this._runtime.IsDebugging())return c.Plugins.Sprite.Cnds.DebugOnCollision.call(this,u);if(!u)return!1;var w=this._runtime;const y=w.GetCollisionEngine(),C=w.GetEventSheetManager(),G=C.GetEventStack();var x=C.GetCurrentCondition();const B=x.GetObjectClass();var H=x.GetSavedDataMap(),P=x.GetUnsavedDataMap();x=G.GetCurrentStackFrame();const E=w.GetTickCount(),J=E-1,O=x.GetCurrentEvent(),R=G.Push(O);let T=H.get("collmemory");
T||(T=c.New(c.PairMap),H.set("collmemory",T));P.get("spriteCreatedDestroyCallback")||(P.set("spriteCreatedDestroyCallback",!0),w.Dispatcher().addEventListener("instancedestroy",qa=&gt;n(T,qa.instance)));H=B.GetCurrentSol();w=u.GetCurrentSol();H=H.GetInstances();P=null;for(let qa=0;qa&lt;H.length;++qa){const ja=H[qa];w.IsSelectAll()?(y.GetCollisionCandidates(ja.GetWorldInfo().GetLayer(),u,ja.GetWorldInfo().GetBoundingBox(),a),P=a,y.AddRegisteredCollisionCandidates(ja,u,P)):P=w.GetInstances();for(let xa=
0;xa&lt;P.length;++xa){const ua=P[xa];if(y.TestOverlap(ja,ua)||y.CheckRegisteredCollision(ja,ua)){var Y=r(T,ja,ua),W=!1,ea=-2;"number"===typeof Y&amp;&amp;(W=!0,ea=Y);Y=!W||ea&lt;J;l(T,ja,ua,E);Y&amp;&amp;(Y=O.GetSolModifiers(),C.PushCopySol(Y),ea=B.GetCurrentSol(),W=u.GetCurrentSol(),ea._SetSelectAll(!1),W._SetSelectAll(!1),B===u?(W=ea._GetOwnInstances(),c.clearArray(W),W.push(ja),W.push(ua),B.ApplySolToContainer()):(ea=ea._GetOwnInstances(),W=W._GetOwnInstances(),c.clearArray(ea),c.clearArray(W),ea.push(ja),W.push(ua),
B.ApplySolToContainer(),u.ApplySolToContainer()),O.Retrigger(x,R),C.PopSol(Y))}else m(T,ja,ua)}c.clearArray(a)}G.Pop();return!1},*DebugOnCollision(u){if(!u)return!1;var w=this._runtime;const y=w.GetCollisionEngine(),C=w.GetEventSheetManager(),G=C.GetEventStack(),x=G.GetCurrentStackFrame(),B=w.GetTickCount(),H=B-1,P=x.GetCurrentEvent(),E=G.Push(P);var J=C.GetCurrentCondition();const O=J.GetObjectClass();var R=J.GetSavedDataMap();J=J.GetUnsavedDataMap();let T=R.get("collmemory");T||(T=c.New(c.PairMap),
R.set("collmemory",T));J.get("spriteCreatedDestroyCallback")||(J.set("spriteCreatedDestroyCallback",!0),w.Dispatcher().addEventListener("instancedestroy",qa=&gt;n(T,qa.instance)));R=O.GetCurrentSol();w=u.GetCurrentSol();R=R.GetInstances();J=null;for(let qa=0;qa&lt;R.length;++qa){const ja=R[qa];w.IsSelectAll()?(y.GetCollisionCandidates(ja.GetWorldInfo().GetLayer(),u,ja.GetWorldInfo().GetBoundingBox(),a),J=a,y.AddRegisteredCollisionCandidates(ja,u,J)):J=w.GetInstances();for(let xa=0;xa&lt;J.length;++xa){const ua=
J[xa];if(y.TestOverlap(ja,ua)||y.CheckRegisteredCollision(ja,ua)){var Y=r(T,ja,ua),W=!1,ea=-2;"number"===typeof Y&amp;&amp;(W=!0,ea=Y);Y=!W||ea&lt;H;l(T,ja,ua,B);Y&amp;&amp;(Y=P.GetSolModifiers(),C.PushCopySol(Y),ea=O.GetCurrentSol(),W=u.GetCurrentSol(),ea._SetSelectAll(!1),W._SetSelectAll(!1),O===u?(W=ea._GetOwnInstances(),c.clearArray(W),W.push(ja),W.push(ua),O.ApplySolToContainer()):(ea=ea._GetOwnInstances(),W=W._GetOwnInstances(),c.clearArray(ea),c.clearArray(W),ea.push(ja),W.push(ua),O.ApplySolToContainer(),u.ApplySolToContainer()),
yield*P.DebugRetrigger(x,E),C.PopSol(Y))}else m(T,ja,ua)}c.clearArray(a)}G.Pop();return!1},IsOverlapping(u){return q(this,u,0,0)},IsOverlappingOffset(u,w,y){return q(this,u,w,y)},IsAnimPlaying(u){return c.equalsNoCase(this._GetCurrentAnimationName(),u)},CompareFrame(u,w){return c.compare(this._currentFrameIndex,u,w)},CompareAnimSpeed(u,w){return c.compare(this._GetAnimSpeed(),u,w)},OnAnimFinished(u){return c.equalsNoCase(this._animTriggerName,u)},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()}}}"use strict";
{const c=self.C3;c.Plugins.Sprite.Acts={Spawn(b,a,f){if(b&amp;&amp;a){var [d,e]=this.GetImagePoint(f);if(a=this._runtime.CreateInstance(b,a,d,e)){b.GetPlugin().IsRotatable()&amp;&amp;(f=a.GetWorldInfo(),f.SetAngle(this.GetWorldInfo().GetAngle()),f.SetBboxChanged());f=this._runtime.GetEventSheetManager();f.BlockFlushingInstances(!0);a._TriggerOnCreated();if(a.IsInContainer())for(var g of a.siblings())g._TriggerOnCreated();f.BlockFlushingInstances(!1);f=this._runtime.GetCurrentAction().GetSavedDataMap();g=!1;if(!f.has("Spawn_LastExec")||
f.get("Spawn_LastExec")&lt;this._runtime.GetExecCount())g=!0,f.set("Spawn_LastExec",this._runtime.GetExecCount());if(b!==this.GetObjectClass()&amp;&amp;(b=b.GetCurrentSol(),b._SetSelectAll(!1),b=b._GetOwnInstances(),g&amp;&amp;c.clearArray(b),b.push(a),a.IsInContainer()))for(const h of a.siblings())b=h.GetObjectClass().GetCurrentSol(),g?b.SetSinglePicked(h):(b._SetSelectAll(!1),b._PushInstance(h))}}},StopAnim(){this.SetAnimationPlaying(!1)},StartAnim(b){this._StartAnim(b)},SetAnim(b,a){this._SetAnim(b,a)},SetAnimFrame(b){this._SetAnimFrame(b)},
SetAnimSpeed(b){this._SetAnimSpeed(b)},SetAnimRepeatToFrame(b){this._SetAnimRepeatToFrame(b)},SetMirrored(b){const a=this.GetWorldInfo(),f=a.GetWidth();b=Math.abs(f)*(0===b?-1:1);f!==b&amp;&amp;(a.SetWidth(b),a.SetBboxChanged())},SetFlipped(b){const a=this.GetWorldInfo(),f=a.GetHeight();b=Math.abs(f)*(0===b?-1:1);f!==b&amp;&amp;(a.SetHeight(b),a.SetBboxChanged())},SetScale(b){const a=this._currentAnimationFrame.GetImageInfo(),f=this.GetWorldInfo();var d=0&gt;f.GetWidth()?-1:1;const e=0&gt;f.GetHeight()?-1:1;d*=a.GetWidth()*
b;b=a.GetHeight()*b*e;if(f.GetWidth()!==d||f.GetHeight()!==b)f.SetSize(d,b),f.SetBboxChanged()},async LoadURL(b,a,f){f=this._currentAnimationFrame.GetImageInfo();const d=this.GetWorldInfo(),e=this._runtime;if(f.GetURL()===b)0===a&amp;&amp;(d.SetSize(f.GetWidth(),f.GetHeight()),d.SetBboxChanged()),this.Trigger(c.Plugins.Sprite.Cnds.OnURLLoaded);else{var g=c.New(c.ImageInfo);await g.LoadDynamicAsset(e,b);g.IsLoaded()?(await g.LoadStaticTexture(e.GetWebGLRenderer(),{sampling:this._runtime.GetSampling()}),f.ReplaceWith(g),
this._sdkType._UpdateAllCurrentTexture(),this.WasReleased()||0!==a||(d.SetSize(f.GetWidth(),f.GetHeight()),d.SetBboxChanged()),e.UpdateRender(),this.WasReleased()||await this.TriggerAsync(c.Plugins.Sprite.Cnds.OnURLLoaded)):this.Trigger(c.Plugins.Sprite.Cnds.OnURLFailed)}},SetCollisions(b){this.GetWorldInfo().SetCollisionEnabled(b)},SetSolidCollisionFilter(b,a){this.GetWorldInfo().SetSolidCollisionFilter(0===b,a)},SetEffect(b){this.GetWorldInfo().SetBlendMode(b);this._runtime.UpdateRender()}}}"use strict";
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(c){return this.GetImagePoint(c)[0]},ImagePointY(c){return this.GetImagePoint(c)[1]},ImagePointCount(){return this.GetImagePointCount()},ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},
ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},PolyPointXAt(c){return this.GetCollisionPolyPoint(c)[0]},PolyPointYAt(c){return this.GetCollisionPolyPoint(c)[1]},PolyPointCount(){return this.GetCollisionPolyPointCount()}};"use strict";{const c=self.C3;c.Plugins.Touch=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.Touch.Type=class extends c.SDKTypeBase{constructor(f){super(f)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.ITouchObjectType}};let b=null;function a(){return b.GetSingleGlobalInstance().GetSdkInstance()}self.ITouchObjectType=class extends self.IObjectClass{constructor(f){super(f);b=f;f.GetRuntime()._GetCommonScriptInterfaces().touch=this}requestPermission(f){const d=a();if("orientation"===f)return d._RequestPermission(0);if("motion"===f)return d._RequestPermission(1);
throw Error("invalid type");}}}"use strict";
{const c=self.C3;c.Plugins.Touch.Instance=class extends c.SDKInstanceBase{constructor(b,a){super(b,"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=[];a&amp;&amp;(this._useMouseInput=a[0]);
this.AddDOMMessageHandler("permission-result",f=&gt;this._OnPermissionResult(f));b=this.GetRuntime().Dispatcher();this._disposables=new c.CompositeDisposable(c.Disposable.From(b,"pointerdown",f=&gt;this._OnPointerDown(f.data)),c.Disposable.From(b,"pointermove",f=&gt;this._OnPointerMove(f.data)),c.Disposable.From(b,"pointerup",f=&gt;this._OnPointerUp(f.data,!1)),c.Disposable.From(b,"pointercancel",f=&gt;this._OnPointerUp(f.data,!0)),c.Disposable.From(b,"deviceorientation",f=&gt;this._OnDeviceOrientation(f.data)),c.Disposable.From(b,
"deviceorientationabsolute",f=&gt;this._OnDeviceOrientationAbsolute(f.data)),c.Disposable.From(b,"devicemotion",f=&gt;this._OnDeviceMotion(f.data)),c.Disposable.From(b,"tick2",f=&gt;this._OnTick2()))}Release(){this._touches.clear();super.Release()}_OnPointerDown(b){if("mouse"===b.pointerType)if(this._useMouseInput)this._isMouseDown=!0;else return;const a=b.pointerId;if(!this._touches.has(a)){var f=b.pageX-this._runtime.GetCanvasClientX(),d=b.pageY-this._runtime.GetCanvasClientY();b=b.timeStamp;var e=this._touches.size;
this._triggerIndex=e;this._triggerId=a;var g=c.New(c.Plugins.Touch.TouchInfo);g.Init(b,f,d,a,e);this._touches.set(a,g);this.Trigger(c.Plugins.Touch.Cnds.OnNthTouchStart);this.Trigger(c.Plugins.Touch.Cnds.OnTouchStart);this._curTouchX=f;this._curTouchY=d;this.Trigger(c.Plugins.Touch.Cnds.OnTouchObject)}}_OnPointerMove(b){if("mouse"!==b.pointerType||this._isMouseDown){var a=this._touches.get(b.pointerId);if(a){var f=b.timeStamp;if(!(2&gt;f-a.GetTime())){var d=b.pageX-this._runtime.GetCanvasClientX(),e=
b.pageY-this._runtime.GetCanvasClientY();a.Update(f,d,e,b.width,b.height,b.pressure)}}}}_OnPointerUp(b,a){if("mouse"===b.pointerType)if(this._isMouseDown)this._isMouseDown=!1;else return;const f=b.timeStamp;b=b.pointerId;const d=this._touches.get(b);d&amp;&amp;(this._triggerIndex=d.GetStartIndex(),this._triggerId=d.GetId(),this.Trigger(c.Plugins.Touch.Cnds.OnNthTouchEnd),this.Trigger(c.Plugins.Touch.Cnds.OnTouchEnd),a||(a=d.ShouldTriggerTap(f),"single-tap"===a?(this.Trigger(c.Plugins.Touch.Cnds.OnTapGesture),
this._curTouchX=d.GetX(),this._curTouchY=d.GetY(),this.Trigger(c.Plugins.Touch.Cnds.OnTapGestureObject)):"double-tap"===a&amp;&amp;(this.Trigger(c.Plugins.Touch.Cnds.OnDoubleTapGesture),this._curTouchX=d.GetX(),this._curTouchY=d.GetY(),this.Trigger(c.Plugins.Touch.Cnds.OnDoubleTapGestureObject))),d.Release(),this._touches.delete(b))}_RequestPermission(b){this._PostToDOMMaybeSync("request-permission",{type:b});return new Promise((a,f)=&gt;{this._permissionPromises.push({type:b,resolve:a,reject:f})})}_OnPermissionResult(b){const a=
b.result,f=b.type;this._triggerPermission=f;b=this._permissionPromises.filter(d=&gt;d.type===f);for(const d of b)d.resolve(a?"granted":"denied");this._permissionPromises=this._permissionPromises.filter(d=&gt;d.type!==f);a?(this.Trigger(c.Plugins.Touch.Cnds.OnPermissionGranted),0===f?this._runtime.RequestDeviceOrientationEvent():this._runtime.RequestDeviceMotionEvent()):this.Trigger(c.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(b){"number"===typeof b.webkitCompassHeading?this._orientCompassHeading=
b.webkitCompassHeading:b.absolute&amp;&amp;(this._orientCompassHeading=b.alpha);this._orientAlpha=b.alpha;this._orientBeta=b.beta;this._orientGamma=b.gamma}_OnDeviceOrientationAbsolute(b){this._orientCompassHeading=b.alpha}_OnDeviceMotion(b){const a=b.acceleration;a&amp;&amp;(this._accX=a.x,this._accY=a.y,this._accZ=a.z);if(b=b.accelerationIncludingGravity)this._accWithGX=b.x,this._accWithGY=b.y,this._accWithGZ=b.z}_OnTick2(){const b=performance.now();let a=0;for(const f of this._touches.values())f.GetTime()&lt;=b-
50&amp;&amp;f._SetLastTime(b),f.ShouldTriggerHold(b)&amp;&amp;(this._triggerIndex=f.GetStartIndex(),this._triggerId=f.GetId(),this._getTouchIndex=a,this.Trigger(c.Plugins.Touch.Cnds.OnHoldGesture),this._curTouchX=f.GetX(),this._curTouchY=f.GetY(),this.Trigger(c.Plugins.Touch.Cnds.OnHoldGestureObject),this._getTouchIndex=0),++a}_GetTouchByIndex(b){b=Math.floor(b);for(const a of this._touches.values()){if(0===b)return a;--b}return null}_IsClientPosOnCanvas(b,a){return 0&lt;=b&amp;&amp;0&lt;=a&amp;&amp;b&lt;this._runtime.GetCanvasCssWidth()&amp;&amp;
a&lt;this._runtime.GetCanvasCssHeight()}GetDebuggerProperties(){return[{title:"plugins.touch.debugger.touches",properties:[...this._touches.values()].map(b=&gt;({name:"$"+b.GetId(),value:b.GetX()+", "+b.GetY()}))}]}}}"use strict";
{const c=self.C3,b=[];c.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 f=a.GetCurrentSol();var d=f.GetInstances();for(const e of d){d=e.GetWorldInfo();const g=d.GetLayer();for(const h of this._touches.values()){if(!this._IsClientPosOnCanvas(h.GetX(),
h.GetY()))continue;const [l,m]=g.CanvasCssToLayer(h.GetX(),h.GetY(),d.GetTotalZElevation());if(d.ContainsPoint(l,m)){b.push(e);break}}}return b.length?(f.SetArrayPicked(b),a.ApplySolToContainer(),c.clearArray(b),!0):!1},CompareTouchSpeed(a,f,d){return(a=this._GetTouchByIndex(a))?c.compare(a.GetSpeed(),f,d):!1},OrientationSupported(){return!0},MotionSupported(){return!0},CompareOrientation(a,f,d){this._runtime.RequestDeviceOrientationEvent();return c.compare(0===a?this._orientAlpha:1===a?this._orientBeta:
this._orientGamma,f,d)},CompareAcceleration(a,f,d){this._runtime.RequestDeviceMotionEvent();return c.compare(0===a?this._accWithGX:1===a?this._accWithGY:2===a?this._accWithGZ:3===a?this._accX:4===a?this._accY:this._accZ,f,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}}}"use strict";self.C3.Plugins.Touch.Acts={RequestPermission(c){this._RequestPermission(c)}};"use strict";
{const c=self.C3;c.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(b){const a=this._GetTouchByIndex(this._getTouchIndex);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!0):0},Y(b){const a=this._GetTouchByIndex(this._getTouchIndex);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),b,!1):0},XAt(b,a){return(b=this._GetTouchByIndex(b))?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!0):0},YAt(b,a){return(b=this._GetTouchByIndex(b))?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),
a,!1):0},XForID(b,a){return(b=this._touches.get(b))?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!0):0},YForID(b,a){return(b=this._touches.get(b))?b.GetPositionForLayer(this._runtime.GetCurrentLayout(),a,!1):0},AbsoluteX(){const b=this._GetTouchByIndex(0);return b?b.GetX():0},AbsoluteY(){const b=this._GetTouchByIndex(0);return b?b.GetY():0},AbsoluteXAt(b){return(b=this._GetTouchByIndex(b))?b.GetX():0},AbsoluteYAt(b){return(b=this._GetTouchByIndex(b))?b.GetY():0},AbsoluteXForID(b){return(b=
this._touches.get(b))?b.GetX():0},AbsoluteYForID(b){return(b=this._touches.get(b))?b.GetY():0},SpeedAt(b){return(b=this._GetTouchByIndex(b))?b.GetSpeed():0},SpeedForID(b){return(b=this._touches.get(b))?b.GetSpeed():0},AngleAt(b){return(b=this._GetTouchByIndex(b))?c.toDegrees(b.GetAngle()):0},AngleForID(b){return(b=this._touches.get(b))?c.toDegrees(b.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(b){return(b=this._touches.get(b))?b.GetWidth():0},HeightForID(b){return(b=this._touches.get(b))?b.GetHeight():0},PressureForID(b){return(b=this._touches.get(b))?b.GetPressure():0}}}"use strict";
{const c=self.C3;let b=-1E3,a=-1E3,f=-1E4;c.Plugins.Touch.TouchInfo=class extends c.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(d,e,g,h,l){this._pointerId=h;this._startIndex=l;this._startTime=this._lastTime=this._time=d;this._startX=e;this._startY=g;this._x=e;this._y=
g;this._lastX=e;this._lastY=g}Update(d,e,g,h,l,m){this._lastTime=this._time;this._time=d;this._lastX=this._x;this._lastY=this._y;this._x=e;this._y=g;this._width=h;this._height=l;this._pressure=m;!this._isTooFarForHold&amp;&amp;15&lt;=c.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(d){this._lastTime=d}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const d=
c.distanceTo(this._x,this._y,this._lastX,this._lastY),e=(this._time-this._lastTime)/1E3;return 0&lt;e?d/e:0}GetAngle(){return c.angleTo(this._lastX,this._lastY,this._x,this._y)}GetWidth(){return this._width}GetHeight(){return this._height}GetPressure(){return this._pressure}ShouldTriggerHold(d){return this._hasTriggeredHold?!1:500&lt;=d-this._startTime&amp;&amp;!this._isTooFarForHold&amp;&amp;15&gt;c.distanceTo(this._startX,this._startY,this._x,this._y)?this._hasTriggeredHold=!0:!1}ShouldTriggerTap(d){if(this._hasTriggeredHold)return"";
if(333&gt;=d-this._startTime&amp;&amp;!this._isTooFarForHold&amp;&amp;15&gt;c.distanceTo(this._startX,this._startY,this._x,this._y)){if(666&gt;=d-f&amp;&amp;25&gt;c.distanceTo(b,a,this._x,this._y))return a=b=-1E3,f=-1E4,"double-tap";b=this._x;a=this._y;f=d;return"single-tap"}return""}GetPositionForLayer(d,e,g){return"undefined"===typeof e?d.GetLayerByIndex(0).CanvasCssToLayer_DefaultTransform(this._x,this._y)[g?0:1]:(d=d.GetLayer(e))?d.CanvasCssToLayer(this._x,this._y)[g?0:1]:0}}}"use strict";{const c=self.C3;c.Plugins.Text=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.Text.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}LoadTextures(b){}ReleaseTextures(){}}}"use strict";
{const c=self.C3,b=[0,0,0],a=["left","center","right"],f=["top","center","bottom"],d=new c.Rect,e=new c.Quad;c.Plugins.Text.Instance=class extends c.SDKWorldInstanceBase{constructor(n,r){super(n);this._text="";this._enableBBcode=!0;this._faceName="Arial";this._ptSize=12;this._lineHeightOffset=0;this._isItalic=this._isBold=!1;this._color=c.New(c.Color);this._verticalAlign=this._horizontalAlign=0;this._wrapByWord=!0;this._typewriterEndTime=this._typewriterStartTime=-1;this._typewriterLength=0;this._rendererText=
c.New(c.Gfx.RendererText,this._runtime.GetWebGLRenderer(),{timeout:5});this._rendererText.ontextureupdate=()=&gt;this._runtime.UpdateRender();this._rendererText.SetIsAsync(!1);r&amp;&amp;(this._text=r[0],this._enableBBcode=!!r[1],this._faceName=r[2],this._ptSize=r[3],this._lineHeightOffset=r[4],this._isBold=!!r[5],this._isItalic=!!r[6],this._horizontalAlign=r[8],this._verticalAlign=r[9],this._wrapByWord=0===r[10],n=r[7],this._color.setRgb(n[0],n[1],n[2]),this.GetWorldInfo().SetVisible(r[11]));this._UpdateTextSettings()}Release(){this._CancelTypewriter();
this._rendererText.Release();this._rendererText=null;super.Release()}_UpdateTextSettings(){const n=this._rendererText;n.SetText(this._text);n.SetBBCodeEnabled(this._enableBBcode);n.SetFontName(this._faceName);n.SetLineHeight(this._lineHeightOffset);n.SetBold(this._isBold);n.SetItalic(this._isItalic);n.SetColor(this._color);n.SetHorizontalAlignment(a[this._horizontalAlign]);n.SetVerticalAlignment(f[this._verticalAlign]);n.SetWordWrapMode(this._wrapByWord?"word":"character")}_UpdateTextSize(){const n=
this.GetWorldInfo();this._rendererText.SetFontSize(this._ptSize*n.GetSceneGraphScale());var r=n.GetLayer();r=r.GetRenderScale()*r.Get2DScaleFactorToZ(n.GetTotalZElevation());this._rendererText.SetSize(n.GetWidth(),n.GetHeight(),r)}Draw(n){var r=this.GetWorldInfo();this._UpdateTextSize();const q=this._rendererText.GetTexture();if(q){var t=r.GetLayer(),u=r.GetBoundingQuad();if(0===r.GetAngle()&amp;&amp;0===r.GetLayer().GetAngle()&amp;&amp;0===r.GetTotalZElevation()){const [w,y]=t.LayerToDrawSurface(u.getTlx(),u.getTly()),
[C,G]=t.LayerToDrawSurface(u.getBrx(),u.getBry());u=w-Math.round(w);r=y-Math.round(y);d.set(w,y,C,G);d.offset(-u,-r);e.setFromRect(d);const [x,B]=n.GetRenderTargetSize(n.GetRenderTarget());this._runtime.GetCanvasManager().SetDeviceTransform(n,x,B);n.SetTexture(q);n.Quad3(e,this._rendererText.GetTexRect());t._SetTransform(n)}else{r=t=0;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(t=u.getTlx()-Math.round(u.getTlx()),r=u.getTly()-Math.round(u.getTly()));if(0!==t||0!==r)e.copy(u),e.offset(-t,-r),u=e;n.SetTexture(q);
n.Quad3(u,this._rendererText.GetTexRect())}}}SaveToJson(){const n={t:this._text,c:this._color.toJSON(),fn:this._faceName,ps:this._ptSize};this._enableBBcode&amp;&amp;(n.bbc=this._enableBBcode);0!==this._horizontalAlign&amp;&amp;(n.ha=this._horizontalAlign);0!==this._verticalAlign&amp;&amp;(n.va=this._verticalAlign);this._wrapByWord||(n.wr=this._wrapByWord);0!==this._lineHeightOffset&amp;&amp;(n.lho=this._lineHeightOffset);this._isBold&amp;&amp;(n.b=this._isBold);this._isItalic&amp;&amp;(n.i=this._isItalic);-1!==this._typewriterEndTime&amp;&amp;(n.tw={st:this._typewriterStartTime,
en:this._typewriterEndTime,l:this._typewriterLength});return n}LoadFromJson(n){this._CancelTypewriter();this._text=n.t;this._color.setFromJSON(n.c);this._faceName=n.fn;this._ptSize=n.ps;this._enableBBcode=n.hasOwnProperty("bbc")?n.bbc:!1;this._horizontalAlign=n.hasOwnProperty("ha")?n.ha:0;this._verticalAlign=n.hasOwnProperty("va")?n.va:0;this._wrapByWord=n.hasOwnProperty("wr")?n.wr:!0;this._lineHeightOffset=n.hasOwnProperty("lho")?n.lho:0;this._isBold=n.hasOwnProperty("b")?n.b:!1;this._isItalic=n.hasOwnProperty("i")?
n.i:!1;n.hasOwnProperty("tw")&amp;&amp;(n=n.tw,this._typewriterStartTime=n.st,this._typewriterEndTime=n.en,this._typewriterLength=n.l);this._UpdateTextSettings();-1!==this._typewriterEndTime&amp;&amp;this._StartTicking()}GetPropertyValueByIndex(n){switch(n){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 b[0]=this._color.getR(),b[1]=this._color.getG(),
b[2]=this._color.getB(),b;case 8:return this._horizontalAlign;case 9:return this._verticalAlign;case 10:return this._wrapByWord?1:0}}SetPropertyValueByIndex(n,r){switch(n){case 0:if(this._text===r)break;this._text=r;this._UpdateTextSettings();break;case 1:if(this._enableBBcode===!!r)break;this._enableBBcode=!!r;this._UpdateTextSettings();break;case 2:if(this._faceName===r)break;this._faceName=r;this._UpdateTextSettings();break;case 3:if(this._ptSize===r)break;this._ptSize=r;this._UpdateTextSettings();
break;case 4:if(this._lineHeightOffset===r)break;this._lineHeightOffset=r;this._UpdateTextSettings();break;case 5:if(this._isBold===!!r)break;this._isBold=!!r;this._UpdateTextSettings();break;case 6:if(this._isItalic===!!r)break;this._isItalic=!!r;this._UpdateTextSettings();break;case 7:n=this._color;if(n.getR()===r[0]&amp;&amp;n.getG()===r[1]&amp;&amp;n.getB()===r[2])break;this._color.setRgb(r[0],r[1],r[2]);this._UpdateTextSettings();break;case 8:if(this._horizontalAlign===r)break;this._horizontalAlign=r;this._UpdateTextSettings();
break;case 9:if(this._verticalAlign===r)break;this._verticalAlign=r;this._UpdateTextSettings();break;case 10:this._wrapByWord!==(0===r)&amp;&amp;(this._wrapByWord=0===r,this._UpdateTextSettings())}}SetPropertyColorOffsetValueByIndex(n,r,q,t){if(0!==r||0!==q||0!==t)switch(n){case 7:this._color.addRgb(r,q,t),this._UpdateTextSettings()}}_SetText(n){this._text!==n&amp;&amp;(this._text=n,this._rendererText.SetText(n),this._runtime.UpdateRender())}GetText(){return this._text}_StartTypewriter(n,r){this._SetText(n);this._typewriterStartTime=
this._runtime.GetWallTime();this._typewriterEndTime=this._typewriterStartTime+r/this.GetInstance().GetActiveTimeScale();this._typewriterLength=c.BBString.StripAnyTags(n).length;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(c.Plugins.Text.Cnds.OnTypewriterTextFinished),
this._runtime.UpdateRender())}_SetFontFace(n){this._faceName!==n&amp;&amp;(this._faceName=n,this._rendererText.SetFontName(n),this._runtime.UpdateRender())}_GetFontFace(){return this._faceName}_SetBold(n){n=!!n;this._isBold!==n&amp;&amp;(this._isBold=n,this._rendererText.SetBold(n),this._runtime.UpdateRender())}_IsBold(){return this._isBold}_SetItalic(n){n=!!n;this._isItalic!==n&amp;&amp;(this._isItalic=n,this._rendererText.SetItalic(n),this._runtime.UpdateRender())}_IsItalic(){return this._isItalic}_SetFontSize(n){this._ptSize!==
n&amp;&amp;(this._ptSize=n,this._runtime.UpdateRender())}_GetFontSize(){return this._ptSize}_SetLineHeight(n){this._lineHeightOffset!==n&amp;&amp;(this._lineHeightOffset=n,this._UpdateTextSettings(),this._runtime.UpdateRender())}_GetLineHeight(){return this._lineHeightOffset}_SetHAlign(n){this._horizontalAlign!==n&amp;&amp;(this._horizontalAlign=n,this._UpdateTextSettings(),this._runtime.UpdateRender())}_GetHAlign(){return this._horizontalAlign}_SetVAlign(n){this._verticalAlign!==n&amp;&amp;(this._verticalAlign=n,this._UpdateTextSettings(),
this._runtime.UpdateRender())}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(n){n=!!n;this._wrapByWord!==n&amp;&amp;(this._wrapByWord=n,this._UpdateTextSettings(),this._runtime.UpdateRender())}_IsWrapByWord(){return this._wrapByWord}Tick(){var n=this._runtime.GetWallTime();n&gt;=this._typewriterEndTime?(this._CancelTypewriter(),this.Trigger(c.Plugins.Text.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender()):(n=c.relerp(this._typewriterStartTime,this._typewriterEndTime,n,0,this._typewriterLength),
n=Math.floor(n),n!==this._rendererText.GetDrawMaxCharacterCount()&amp;&amp;(this._rendererText.SetDrawMaxCharacterCount(n),this._runtime.UpdateRender()))}GetDebuggerProperties(){return[{title:"plugins.text.name",properties:[{name:"plugins.text.properties.text.name",value:this._text,onedit:n=&gt;this._SetText(n)}]}]}GetScriptInterfaceClass(){return self.ITextInstance}};const g=new WeakMap,h=new Map([["left",0],["center",1],["right",2]]),l=new Map([["top",0],["center",1],["bottom",2]]),m=new Map([["word",!0],
["character",!1]]);self.ITextInstance=class extends self.IWorldInstance{constructor(){super();g.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get text(){return g.get(this).GetText()}set text(n){const r=g.get(this);r._CancelTypewriter();r._SetText(n)}typewriterText(n,r){const q=g.get(this);q._CancelTypewriter();q._StartTypewriter(n,r)}typewriterFinish(){g.get(this)._FinishTypewriter()}set fontFace(n){g.get(this)._SetFontFace(n)}get fontFace(){return g.get(this)._GetFontFace()}set isBold(n){g.get(this)._SetBold(n)}get isBold(){return g.get(this)._IsBold()}set isItalic(n){g.get(this)._SetItalic(n)}get isItalic(){return g.get(this)._IsItalic()}set sizePt(n){g.get(this)._SetFontSize(n)}get sizePt(){return g.get(this)._GetFontSize()}set lineHeight(n){g.get(this)._SetLineHeight(n)}get lineHeight(){return g.get(this)._GetLineHeight()}set horizontalAlign(n){n=
h.get(n);if("undefined"===typeof n)throw Error("invalid mode");g.get(this)._SetHAlign(n)}get horizontalAlign(){return a[g.get(this)._GetHAlign()]}set verticalAlign(n){n=l.get(n);if("undefined"===typeof n)throw Error("invalid mode");g.get(this)._SetVAlign(n)}get verticalAlign(){return f[g.get(this)._GetVAlign()]}set wordWrapMode(n){n=m.get(n);if("undefined"===typeof n)throw Error("invalid mode");g.get(this)._SetWrapByWord(n)}get wordWrapMode(){return g.get(this)._IsWrapByWord()?"word":"character"}}}"use strict";
{const c=self.C3;c.Plugins.Text.Cnds={CompareText(b,a){return a?this._text===b:c.equalsNoCase(this._text,b)},IsRunningTypewriterText(){return-1!==this._typewriterEndTime},OnTypewriterTextFinished(){return!0}}}"use strict";
{const c=self.C3,b=c.New(c.Color);c.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,f){this._CancelTypewriter();"number"===typeof a&amp;&amp;1E9&gt;a&amp;&amp;(a=Math.round(1E10*a)/1E10);this._StartTypewriter(a.toString(),f)},SetFontFace(a,f){let d=!1,e=!1;switch(f){case 1:d=
!0;break;case 2:e=!0;break;case 3:e=d=!0}if(a!==this._faceName||d!==this._isBold||e!==this._isItalic)this._SetFontFace(a),this._SetBold(d),this._SetItalic(e)},SetFontSize(a){this._SetFontSize(a)},SetFontColor(a){b.setFromRgbValue(a);b.clamp();this._color.equalsIgnoringAlpha(b)||(this._color.copyRgb(b),this._rendererText.SetColor(this._color),this._runtime.UpdateRender())},SetWebFont(a,f){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)}}}"use strict";
{const c=self.C3;c.Plugins.Text.Exps={Text(){return this._text},PlainText(){return this._enableBBcode?c.BBString.StripAnyTags(this._text):this._text},FaceName(){return this._faceName},FaceSize(){return this._ptSize},TextWidth(){this._UpdateTextSize();return this._rendererText.GetTextWidth()},TextHeight(){this._UpdateTextSize();return this._rendererText.GetTextHeight()},LineHeight(){return this._lineHeightOffset}}}"use strict";
{const c=self.C3;c.Plugins.Tilemap=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}};c.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL=-2147483648;c.Plugins.Tilemap.TILE_FLIPPED_VERTICAL=1073741824;c.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL=536870912;c.Plugins.Tilemap.TILE_FLAGS_MASK=3758096384;c.Plugins.Tilemap.TILE_ID_MASK=536870911}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,a=c.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,f=c.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,d=c.Plugins.Tilemap.TILE_ID_MASK;c.Plugins.Tilemap.Type=class extends c.SDKTypeBase{constructor(e){super(e);this._tilePolys=[];this._areTilePolysCached=!1;this._maxTileIndex=0}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(e){return this.GetImageInfo().LoadStaticTexture(e,{sampling:this._runtime.GetSampling()})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}OnDynamicTextureLoadComplete(){for(const e of this.GetObjectClass().instancesIncludingPendingCreate())e.GetSdkInstance()._OnDynamicTextureLoadComplete()}LoadTilemapData(e,
g){this._maxTileIndex=g;for(const h of e)h?this._tilePolys.push({poly:h[0],use:!!h[1],flipmap:[[[null,null],[null,null]],[[null,null],[null,null]]]}):this._tilePolys.push(null)}_ForceCacheOfTileCollisionPolys(e,g){this._areTilePolysCached=!1;this._MaybeCacheTileCollisionPolys(e,g)}_MaybeCacheTileCollisionPolys(e,g){if(!this._areTilePolysCached){this._areTilePolysCached=!0;for(let h=0,l=this._tilePolys.length;h&lt;l;++h)this._tilePolys[h]&amp;&amp;(this._CacheTilePoly(h,e,g,!1,!1,!1),this._CacheTilePoly(h,e,
g,!1,!1,!0),this._CacheTilePoly(h,e,g,!1,!0,!1),this._CacheTilePoly(h,e,g,!1,!0,!0),this._CacheTilePoly(h,e,g,!0,!1,!1),this._CacheTilePoly(h,e,g,!0,!1,!0),this._CacheTilePoly(h,e,g,!0,!0,!1),this._CacheTilePoly(h,e,g,!0,!0,!0))}}_CacheTilePoly(e,g,h,l,m,n){if(!(0&gt;e||e&gt;=this._tilePolys.length)&amp;&amp;(e=this._tilePolys[e])){var r=c.New(c.CollisionPoly,e.poly,e.use);r.transform(g,h,0);n&amp;&amp;r.diag();l&amp;&amp;r.mirror(g/2);m&amp;&amp;r.flip(h/2);e.flipmap[l?1:0][m?1:0][n?1:0]=null;e.flipmap[l?1:0][m?1:0][n?1:0]=r}}GetTilePoly(e){if(-1===
e)return null;var g=e&amp;d;return 0&gt;g||g&gt;=this._tilePolys.length?null:(g=this._tilePolys[g])?g.flipmap[e&amp;b?1:0][e&amp;a?1:0][e&amp;f?1:0]:null}IsTilePolyEnabled(e){return e?e.IsEnabled():!0}GetMaxTileIndex(){return this._maxTileIndex}}}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,a=c.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,f=c.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,d=c.Plugins.Tilemap.TILE_FLAGS_MASK,e=c.Plugins.Tilemap.TILE_ID_MASK,g=c.New(c.Rect),h=c.New(c.Rect);function l(r){const q=[];r=r.split(",");for(let y=0,C=r.length;y&lt;C;++y){var t=r[y],u=t.indexOf("x");if(-1&lt;u){var w=parseInt(t.substring(0,u),10);t=t.substring(u+1);u=parseInt(t,10);t.includes("h")&amp;&amp;(u|=b);t.includes("v")&amp;&amp;(u|=a);for(t.includes("d")&amp;&amp;(u|=f);0&lt;
w;--w)q.push(u)}else w=parseInt(t,10),t.includes("h")&amp;&amp;(w|=b),t.includes("v")&amp;&amp;(w|=a),t.includes("d")&amp;&amp;(w|=f),q.push(w)}return q}c.Plugins.Tilemap.Instance=class extends c.SDKWorldInstanceBase{constructor(r,q){super(r);r=this.GetWorldInfo();this._tileHeight=this._tileWidth=32;this._mapHeight=this._mapWidth=this._tileYspacing=this._tileXspacing=this._tileYoffset=this._tileXoffset=0;this._lastWidth=r.GetWidth();this._lastHeight=r.GetHeight();this._cellHeight=this._cellWidth=0;this._tileCells=[];this._tileTexQuads=
new Map;this._isAnyQuadMapChanged=!0;this._ownImageInfo=null;q&amp;&amp;(r.SetVisible(q[0]),this._tileWidth=Math.max(q[1],1),this._tileHeight=Math.max(q[2],1),this._tileXoffset=q[3],this._tileYoffset=q[4],this._tileXspacing=q[5],this._tileYspacing=q[6]);this._cellWidth=Math.ceil(this._runtime.GetOriginalViewportWidth()/this._tileWidth);this._cellHeight=Math.ceil(this._runtime.GetOriginalViewportHeight()/this._tileHeight);this._sdkType._MaybeCacheTileCollisionPolys(this._tileWidth,this._tileHeight)}Release(){this._ReleaseOwnImage();
c.clearArray(this._tileCells);this._tileCells=null;this._tileTexQuads.clear();this._tileTexQuads=null;super.Release()}_ReleaseOwnImage(){this._ownImageInfo&amp;&amp;(this._ownImageInfo.Release(),this._ownImageInfo=null)}LoadTilemapData(r,q,t){this._mapWidth=q;this._mapHeight=t;this._MaybeResizeTilemap(!0);this.SetTilesFromRLECSV(r);this._MaybeBuildAllQuadMap()}_MaybeResizeTilemap(r){var q=this.GetWorldInfo(),t=Math.floor(q.GetWidth()/this._tileWidth),u=Math.floor(q.GetHeight()/this._tileHeight);if(!(t&lt;=this._mapWidth&amp;&amp;
u&lt;=this._mapHeight)||r){r?(r=Math.ceil(this._mapHeight/this._cellHeight),q=Math.ceil(this._mapWidth/this._cellWidth)):(r=this._tileCells.length,q=Math.ceil(this._mapWidth/this._cellWidth),u&gt;this._mapHeight&amp;&amp;(this._mapHeight=u,r=Math.ceil(this._mapHeight/this._cellHeight)),t&gt;this._mapWidth&amp;&amp;(this._mapWidth=t,q=Math.ceil(this._mapWidth/this._cellWidth)),this._SetAllQuadMapChanged(),this._SetPhysicsChanged(),this._runtime.UpdateRender());t=this._tileCells;if(t.length&lt;r)for(u=t.length;u&lt;r;++u)t.push([]);
for(u=0;u&lt;r;++u){const w=t[u];for(let y=w.length;y&lt;q;++y)w.push(c.New(c.Plugins.Tilemap.TileCell,this,y,u))}}}SetTilesFromRLECSV(r){r=l(r);let q=0;const t=this._mapWidth,u=this._cellWidth,w=this._cellHeight;for(let y=0,C=this._mapHeight;y&lt;C;++y)for(let G=0;G&lt;t;++G){const x=r[q++],B=this.GetCellAt(G,y);B&amp;&amp;B.SetTileAt(G%u,y%w,x)}}GetTilesAsRLECSV(){let r="";if(0&gt;=this._mapWidth||0&gt;=this._mapHeight)return r;let q=1;var t=this.GetTileAt(0,0),u=this.GetWorldInfo();const w=Math.floor(u.GetWidth()/this._tileWidth);
u=Math.floor(u.GetHeight()/this._tileHeight);let y,C,G;for(let x=0;x&lt;u;++x)for(let B=0===x?1:0;B&lt;w;++B){const H=this.GetTileAt(B,x);H===t?++q:(-1===t?(y=-1,t=G=C=!1):(y=t&amp;e,C=0!==(t&amp;b),G=0!==(t&amp;a),t=0!==(t&amp;f)),r=1===q?r+(""+y):r+(""+q+"x"+y),C&amp;&amp;(r+="h"),G&amp;&amp;(r+="v"),t&amp;&amp;(r+="d"),r+=",",q=1,t=H)}-1===t?(y=-1,t=G=C=!1):(y=t&amp;e,C=0!==(t&amp;b),G=0!==(t&amp;a),t=0!==(t&amp;f));r=1===q?r+(""+y):r+(""+q+"x"+y);C&amp;&amp;(r+="h");G&amp;&amp;(r+="v");t&amp;&amp;(r+="d");return r}_SetAllQuadMapChanged(){const r=this._tileCells;for(let q=0,t=r.length;q&lt;
t;++q){const u=r[q];for(let w=0,y=u.length;w&lt;y;++w)u[w]._SetQuadMapChanged()}this._isAnyQuadMapChanged=!0}_MaybeBuildAllQuadMap(){if(this._isAnyQuadMapChanged){this._isAnyQuadMapChanged=!1;var r=this._tileCells;for(let q=0,t=r.length;q&lt;t;++q){const u=r[q];for(let w=0,y=u.length;w&lt;y;++w)u[w].MaybeBuildQuadMap()}}}SetTileChanged(){this._isAnyQuadMapChanged=!0;this._SetPhysicsChanged();this._runtime.UpdateRender()}_SetPhysicsChanged(){this.GetWorldInfo().SetPhysicsBodyChanged(!0)}GetCellAt(r,q){if(0&gt;
r||0&gt;q)return null;q=Math.floor(q/this._cellHeight);if(q&gt;=this._tileCells.length)return null;q=this._tileCells[q];r=Math.floor(r/this._cellWidth);return r&gt;=q.length?null:q[r]}GetCellAtIndex(r,q){if(0&gt;r||0&gt;q||q&gt;=this._tileCells.length)return null;q=this._tileCells[q];return r&gt;=q.length?null:q[r]}GetTileAt(r,q){r=Math.floor(r);q=Math.floor(q);if(0&gt;r||0&gt;q||r&gt;=this._mapWidth||q&gt;=this._mapHeight)return-1;const t=this.GetCellAt(r,q);return t?t.GetTilesArr()[q%this._cellHeight][r%this._cellWidth]:-1}SetTileAt(r,
q,t){r=Math.floor(r);q=Math.floor(q);if(!(0&gt;r||0&gt;q||r&gt;=this._mapWidth||q&gt;=this._mapHeight||-1!==t&amp;&amp;(t&amp;e)&gt;this.GetMaxTileIndex())){var u=this.GetCellAt(r,q);u&amp;&amp;u.SetTileAt(r%this._cellWidth,q%this._cellHeight,t)}}GetMaxTileIndex(){return this._sdkType.GetMaxTileIndex()}WorldToCellX(r){return Math.floor((r-this.GetWorldInfo().GetX())/(this._cellWidth*this._tileWidth))}WorldToCellY(r){return Math.floor((r-this.GetWorldInfo().GetY())/(this._cellHeight*this._tileHeight))}WorldToTileX(r){return Math.floor((r-
this.GetWorldInfo().GetX())/this._tileWidth)}WorldToTileY(r){return Math.floor((r-this.GetWorldInfo().GetY())/this._tileHeight)}GetMapWidth(){return this._mapWidth}GetMapHeight(){return this._mapHeight}GetTileWidth(){return this._tileWidth}GetTileHeight(){return this._tileHeight}GetCellWidth(){return this._cellWidth}GetCellHeight(){return this._cellHeight}GetCollisionRectCandidates(r,q){var t=this.WorldToCellX(r.getLeft());const u=this.WorldToCellY(r.getTop()),w=this.WorldToCellX(r.getRight());for(r=
this.WorldToCellY(r.getBottom());t&lt;=w;++t)for(let y=u;y&lt;=r;++y){const C=this.GetCellAtIndex(t,y);C&amp;&amp;(C.MaybeBuildQuadMap(),c.appendArray(q,C.GetCollisionRects()))}}TestPointOverlapTile(r,q){var t=this.WorldToTileX(r),u=this.WorldToTileY(q);t=this.GetTileAt(t,u);if(-1===t)return!1;t=this._sdkType.GetTilePoly(t);if(!t)return!0;if(!this._sdkType.IsTilePolyEnabled(t))return!1;var w=this.GetWorldInfo();u=Math.floor((r-w.GetX())/this._tileWidth)*this._tileWidth+w.GetX();w=Math.floor((q-w.GetY())/this._tileHeight)*
this._tileHeight+w.GetY();return t.containsPoint(r-u,q-w)}GetAllCollisionRects(r){const q=this._tileCells;for(let t=0,u=q.length;t&lt;u;++t){const w=q[t];for(let y=0,C=w.length;y&lt;C;++y){const G=w[y];G.MaybeBuildQuadMap();c.appendArray(r,G.GetCollisionRects())}}}GetCurrentImageInfo(){return this._ownImageInfo||this._objectClass.GetImageInfo()}GetTileUvQuad(r){const q=this._tileTexQuads;var t=q.get(r);if(t)return t;var u=r&amp;e;t=0!==(r&amp;b);const w=0!==(r&amp;a),y=0!==(r&amp;f);var C=this.GetCurrentImageInfo(),G=
C.GetWidth(),x=this._tileWidth,B=this._tileXspacing;x=Math.floor((Math.floor((G-this._tileXoffset)/(x+B)*x)+B)/x);G=u%x;u=Math.floor(u/x);x=C.GetOffsetX()+this._tileXoffset+(this._tileWidth+this._tileXspacing)*G;B=C.GetOffsetY()+this._tileYoffset+(this._tileHeight+this._tileYspacing)*u;g.setWH(x,B,this._tileWidth,this._tileHeight);g.divide(C.GetSheetWidth(),C.GetSheetHeight());C=c.New(c.Quad);C.setFromRect(g);y&amp;&amp;C.diag();t&amp;&amp;C.mirror();w&amp;&amp;C.flip();C.offset(G,u);q.set(r,C);return C}_OnDynamicTextureLoadComplete(){this._tileTexQuads.clear();
this._SetAllQuadMapChanged()}Draw(r){var q=this.GetCurrentImageInfo(),t=q.GetTexture();if(t){g.copy(q.GetTexRect());g.offsetLeft(this._tileXoffset/t.GetWidth());g.offsetTop(this._tileYoffset/t.GetHeight());r.SetTilemapFillMode();r.SetTilemapInfo(g,t.GetWidth(),t.GetHeight(),this._tileWidth,this._tileHeight,this._tileXspacing,this._tileYspacing);r.SetTexture(t);t=this.GetWorldInfo();if(t.GetWidth()!==this._lastWidth||t.GetHeight()!==this._lastHeight)this._SetPhysicsChanged(),this._SetAllQuadMapChanged(),
this._lastWidth=t.GetWidth(),this._lastHeight=t.GetHeight();t.GetLayer().GetViewportForZ(t.GetTotalZElevation(),h);q=t.GetX();t=t.GetY();this._runtime.IsPixelRoundingEnabled()&amp;&amp;(q=Math.round(q),t=Math.round(t));var u=this._cellWidth*this._tileWidth,w=this._cellHeight*this._tileHeight,y=Math.floor((h.getLeft()-q)/u);u=Math.floor((h.getRight()-q)/u);var C=Math.floor((h.getTop()-t)/w);for(w=Math.floor((h.getBottom()-t)/w);y&lt;=u;++y)for(let G=C;G&lt;=w;++G){const x=this.GetCellAtIndex(y,G);x&amp;&amp;(x.MaybeBuildQuadMap(),
x.Draw(r,h,q,t))}}}SaveToJson(){this._MaybeResizeTilemap();var r=this.GetWorldInfo();const q=Math.floor(r.GetWidth()/this._tileWidth);r=Math.floor(r.GetHeight()/this._tileHeight);return{tw:this._tileWidth,th:this._tileHeight,tox:this._tileXoffset,toy:this._tileYoffset,tsx:this._tileXspacing,tsy:this._tileYspacing,w:q,h:r,d:this.GetTilesAsRLECSV()}}LoadFromJson(r){this._tileWidth=r.tw;this._tileHeight=r.th;this._tileXoffset=r.tox;this._tileYoffset=r.toy;this._tileXspacing=r.tsx;this._tileYspacing=
r.tsy;this._mapWidth=r.w;this._mapHeight=r.h;this._MaybeResizeTilemap(!0);this.SetTilesFromRLECSV(r.d);this._SetPhysicsChanged();this._SetAllQuadMapChanged()}GetAsJsonString(){this._MaybeResizeTilemap();var r=this.GetWorldInfo();const q=Math.floor(r.GetWidth()/this._tileWidth);r=Math.floor(r.GetHeight()/this._tileHeight);return JSON.stringify({c2tilemap:!0,width:q,height:r,data:this.GetTilesAsRLECSV()})}StateComboToFlags(r){switch(r){case 0:return 0;case 1:return b;case 2:return a;case 3:return b|
f;case 4:return b|a;case 5:return a|f;case 6:return b|a|f;case 7:return f;default:return 0}}GetPropertyValueByIndex(r){switch(r){case 1:return this._tileWidth;case 2:return this._tileHeight;case 3:return this._tileXoffset;case 4:return this._tileYoffset;case 5:return this._tileXspacing;case 6:return this._tileYspacing}}SetPropertyValueByIndex(r,q){switch(r){case 1:if(this._tileWidth===q)break;this._tileWidth=Math.max(q,1);this._cellWidth=Math.ceil(this._runtime.GetOriginalViewportWidth()/this._tileWidth);
this._sdkType._ForceCacheOfTileCollisionPolys();this._UpdateQuadMaps();break;case 2:if(this._tileHeight===q)break;this._tileHeight=Math.max(q,1);this._cellHeight=Math.ceil(this._runtime.GetOriginalViewportHeight()/this._tileHeight);this._sdkType._ForceCacheOfTileCollisionPolys();this._UpdateQuadMaps();break;case 3:if(this._tileXoffset===q)break;this._tileXoffset=q;this._UpdateQuadMaps();break;case 4:if(this._tileYoffset===q)break;this._tileYoffset=q;this._UpdateQuadMaps();break;case 5:if(this._tileXspacing===
q)break;this._tileXspacing=q;this._UpdateQuadMaps();break;case 6:this._tileYspacing!==q&amp;&amp;(this._tileYspacing=q,this._UpdateQuadMaps())}}_UpdateQuadMaps(){this._tileTexQuads.clear();this._SetAllQuadMapChanged();this._MaybeBuildAllQuadMap()}GetScriptInterfaceClass(){return n}};const m=new WeakMap,n=self.ITilemapInstance=class extends self.IWorldInstance{constructor(){super();m.set(this,self.IInstance._GetInitInst().GetSdkInstance())}get mapWidth(){return m.get(this).GetMapWidth()}get mapHeight(){return m.get(this).GetMapHeight()}get tileWidth(){return m.get(this).GetTileWidth()}get tileHeight(){return m.get(this).GetTileHeight()}getTileAt(r,
q){return m.get(this).GetTileAt(r,q)}setTileAt(r,q,t){return m.get(this).SetTileAt(r,q,t)}};n.TILE_FLIPPED_HORIZONTAL=b;n.TILE_FLIPPED_VERTICAL=a;n.TILE_FLIPPED_DIAGONAL=f;n.TILE_FLAGS_MASK=d;n.TILE_ID_MASK=e}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_FLAGS_MASK,a=c.Plugins.Tilemap.TILE_ID_MASK;c.Plugins.Tilemap.Cnds={CompareTileAt(f,d,e,g){f=this.GetTileAt(f,d);-1!==f&amp;&amp;(f&amp;=a);return c.compare(f,e,g)},CompareTileStateAt(f,d,e){f=this.GetTileAt(f,d);d=0;-1!==f&amp;&amp;(d=f&amp;b);return d===this.StateComboToFlags(e)},OnURLLoaded(){return!0},OnURLFailed(){return!0}}}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_ID_MASK;c.Plugins.Tilemap.Acts={EraseTile(a,f){this._MaybeResizeTilemap();this.SetTileAt(a,f,-1)},SetTile(a,f,d,e){this._MaybeResizeTilemap();this.SetTileAt(a,f,d&amp;b|this.StateComboToFlags(e))},SetTileState(a,f,d){const e=this.GetTileAt(a,f);-1!==e&amp;&amp;(this._MaybeResizeTilemap(),this.SetTileAt(a,f,e&amp;b|this.StateComboToFlags(d)))},EraseTileRange(a,f,d,e){const g=Math.floor(Math.max(a,0));var h=Math.floor(Math.max(f,0));a=Math.floor(Math.min(a+d,this._mapWidth));
for(f=Math.floor(Math.min(f+e,this._mapHeight));h&lt;f;++h)for(e=g;e&lt;a;++e)this.SetTileAt(e,h,-1)},SetTileRange(a,f,d,e,g,h){this._MaybeResizeTilemap();const l=Math.floor(Math.max(a,0));var m=Math.floor(Math.max(f,0));a=Math.floor(Math.min(a+d,this._mapWidth));f=Math.floor(Math.min(f+e,this._mapHeight));for(g=g&amp;b|this.StateComboToFlags(h);m&lt;f;++m)for(h=l;h&lt;a;++h)this.SetTileAt(h,m,g)},SetTileStateRange(a,f,d,e,g){this._MaybeResizeTilemap();const h=Math.floor(Math.max(a,0));var l=Math.floor(Math.max(f,
0));a=Math.floor(Math.min(a+d,this._mapWidth));f=Math.floor(Math.min(f+e,this._mapHeight));for(g=this.StateComboToFlags(g);l&lt;f;++l)for(e=h;e&lt;a;++e)d=this.GetTileAt(e,l),-1!==d&amp;&amp;this.SetTileAt(e,l,d&amp;b|g)},LoadFromJSON(a){let f=null;try{f=JSON.parse(a)}catch(d){console.error("[Construct 3] Failed to parse tilemap JSON: ",d);return}f.c2tilemap?(this._mapWidth=f.width,this._mapHeight=f.height,this._MaybeResizeTilemap(!0),this.SetTilesFromRLECSV(f.data),this._SetAllQuadMapChanged(),this._SetPhysicsChanged()):
console.error("[Construct 3] Unrecognized JSON data format")},JSONDownload(a){const f=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(f,a)},async LoadURL(a,f){if(!this._ownImageInfo||this._ownImageInfo.GetURL()!==a){f=this._runtime;var d=c.New(c.ImageInfo);await d.LoadDynamicAsset(f,a);if(d.IsLoaded()){if(this.WasReleased())return d.Release(),null;await d.LoadStaticTexture(f.GetWebGLRenderer(),{sampling:this._runtime.GetSampling()})&amp;&amp;
(this.WasReleased()?d.Release():(this._ReleaseOwnImage(),this._ownImageInfo=d,f.UpdateRender(),this._tileTexQuads.clear(),this._SetAllQuadMapChanged(),await this.TriggerAsync(c.Plugins.Tilemap.Cnds.OnURLLoaded)))}else this.Trigger(c.Plugins.Tilemap.Cnds.OnURLFailed)}}}}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_ID_MASK;c.Plugins.Tilemap.Exps={TileAt(a,f){a=this.GetTileAt(a,f);return-1===a?-1:a&amp;b},PositionToTileX(a){return this.WorldToTileX(a)},PositionToTileY(a){return this.WorldToTileY(a)},TileToPositionX(a){return a*this._tileWidth+this.GetWorldInfo().GetX()+this._tileWidth/2},TileToPositionY(a){return a*this._tileHeight+this.GetWorldInfo().GetY()+this._tileHeight/2},SnapX(a){const f=this.GetWorldInfo().GetX();return Math.floor((a-f)/this._tileWidth)*this._tileWidth+
f+this._tileWidth/2},SnapY(a){const f=this.GetWorldInfo().GetY();return Math.floor((a-f)/this._tileHeight)*this._tileHeight+f+this._tileHeight/2},TilesJSON(){return this.GetAsJsonString()}}}"use strict";
{const c=self.C3,b=c.Plugins.Tilemap.TILE_FLIPPED_HORIZONTAL,a=c.Plugins.Tilemap.TILE_FLIPPED_VERTICAL,f=c.Plugins.Tilemap.TILE_FLIPPED_DIAGONAL,d=c.Plugins.Tilemap.TILE_ID_MASK,e=c.New(c.Rect),g=c.New(c.Quad);c.Plugins.Tilemap.TileQuad=class extends c.DefendedBase{constructor(){super();this._tileId=this._id=-1;this._isDiagFlip=this._isVertFlip=this._isHorizFlip=!1;this._rc=c.New(c.Rect);this._uv=null}Update(h,l,m,n,r,q,t,u){this._id=h;this._tileId=h&amp;d;this._isHorizFlip=0!==(h&amp;b);this._isVertFlip=
0!==(h&amp;a);this._isDiagFlip=0!==(h&amp;f);this._rc.setWH(n*l+q,r*m+t,l,m);this._uv=u.GetTileUvQuad(this._id)}Draw(h,l,m,n,r){e.copy(this._rc);e.offset(m,n);e.intersectsRect(l)&amp;&amp;(g.setFromRect(e),h.Quad4(g,this._uv))}}}"use strict";
{const c=self.C3;c.Plugins.Tilemap.TileCollisionRect=class extends c.DefendedBase{constructor(){super();this._id=-1;this._poly=null;this._rc=c.New(c.Rect)}Update(b,a,f,d,e,g,h,l){this._id=b;this._poly=a;this._rc.setWH(e*f+h,g*d+l,f,d)}ExtendRight(b){this._rc.setRight(this._rc.getRight()+b)}GetTileId(){return this._id}HasPoly(){return!!this._poly}GetPoly(){return this._poly}GetRect(){return this._rc}}}"use strict";
{const c=self.C3;c.Plugins.Tilemap.TileCell=class extends c.DefendedBase{constructor(b,a,f){super();const d=b.GetCellWidth(),e=b.GetCellHeight();this._sdkInst=b;this._x=a;this._y=f;this._left=this._x*d*b.GetTileWidth();this._top=this._y*e*b.GetTileHeight();this._tiles=[];this._quads=[];this._collisionRects=[];this._isQuadMapValid=!1;for(b=0;b&lt;e;++b)a=new Int32Array(d),a.fill(-1),this._tiles.push(a)}Clear(){const b=this._sdkInst.GetCellWidth();var a=this._sdkInst.GetCellHeight();const f=this._tiles;
if(f.length&lt;a)for(let d=f.length;d&lt;a;++d)f.push(new Int32Array(b));else f.length&gt;a&amp;&amp;c.truncateArray(f,a);for(let d=0,e=f.length;d&lt;e;++d)a=f[d],a.length!==b&amp;&amp;(a=new Int32Array(b),f[d]=a),a.fill(-1)}_SetQuadMapChanged(){this._isQuadMapValid=!1}MaybeBuildQuadMap(){if(!this._isQuadMapValid){var b=this._sdkInst,a=b.GetSdkType(),f=b.GetWorldInfo(),d=b.GetTileWidth(),e=b.GetTileHeight(),g=b.GetCellWidth(),h=b.GetCellHeight(),l=this._left,m=this._top;if(!(0&gt;=d||0&gt;=e)){var n=Math.min(b.GetMapWidth(),Math.floor(f.GetWidth()/
d));f=Math.min(b.GetMapHeight(),Math.floor(f.GetHeight()/e));n-=l/d;f-=m/e;n&gt;g&amp;&amp;(n=g);f&gt;h&amp;&amp;(f=h);g=this._tiles;h=this._quads;var r=0;for(var q=0;q&lt;f;++q){var t=g[q];for(var u=0;u&lt;n;++u){var w=t[u];if(-1!==w){var y=void 0;r&lt;h.length?y=h[r]:(y=c.New(c.Plugins.Tilemap.TileQuad),h.push(y));y.Update(w,d,e,u,q,l,m,b);++r}}}r&lt;h.length&amp;&amp;c.truncateArray(h,r);h=null;r=!1;b=this._collisionRects;c.clearArray(b);for(q=0;q&lt;f;++q){t=g[q];for(u=0;u&lt;n;++u){w=t[u];y=a.GetTilePoly(w);const C=a.IsTilePolyEnabled(y);
-1!==w&amp;&amp;C?!h||y||r?(h&amp;&amp;b.push(h),h=c.New(c.Plugins.Tilemap.TileCollisionRect),h.Update(w,y,d,e,u,q,l,m),r=!!y):h.ExtendRight(d):h&amp;&amp;(b.push(h),h=null,r=!1)}h&amp;&amp;(b.push(h),h=null,r=!1)}a=b.length;for(d=0;d&lt;a;++d)if(l=b[d],!l.HasPoly())for(l=l.GetRect(),m=d+1;m&lt;a;++m)n=b[m],f=n.GetRect(),f.getTop()&lt;l.getBottom()||f.getTop()&gt;l.getBottom()||f.getRight()&gt;l.getRight()||f.getLeft()&gt;l.getLeft()||n.HasPoly()||f.getLeft()!==l.getLeft()||f.getRight()!==l.getRight()||(b.splice(m,1),--a,l.setBottom(l.getBottom()+
e),--m);this._isQuadMapValid=!0}}}SetTileAt(b,a,f){this._tiles[a][b]!==f&amp;&amp;(this._tiles[a][b]=f,this._isQuadMapValid=!1,this._sdkInst.SetTileChanged())}GetTilesArr(){return this._tiles}GetCollisionRects(){return this._collisionRects}Draw(b,a,f,d){const e=this._sdkInst,g=this._quads;for(let h=0,l=g.length;h&lt;l;++h)g[h].Draw(b,a,f,d,e)}}}"use strict";{const c=self.C3;c.Plugins.Audio=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.Audio.Type=class extends c.SDKTypeBase{constructor(a){super(a)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return self.IAudioObjectType}};function b(){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 b().GetAudioContext()}get destinationNode(){return b().GetDestinationNode()}}}"use strict";
{const c=self.C3,b=["interactive","balanced","playback"];c.Plugins.Audio.Instance=class extends c.SDKInstanceBase{constructor(a,f){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._effectCount=new Map;this._preloadCount=this._preloadTotal=0;this._remoteUrls=new Map;a="interactive";f&amp;&amp;(this._timeScaleMode=f[0],this._saveLoadMode=f[1],this._playInBackground=f[2],a=b[f[3]],this._panningModel=f[4],this._distanceModel=f[5],this._listenerZ=-f[6],this._referenceDistance=f[7],this._maxDistance=f[8],this._rolloffFactor=f[9]);this._lastAIState=[];this._lastFxState=[];this._lastAnalysersData=
[];this.AddDOMMessageHandlers([["state",d=&gt;this._OnUpdateState(d)],["fxstate",d=&gt;this._OnUpdateFxState(d)],["trigger",d=&gt;this._OnTrigger(d)]]);f=this.GetRuntime().Dispatcher();this._disposables=new c.CompositeDisposable(c.Disposable.From(f,"instancedestroy",d=&gt;this._OnInstanceDestroyed(d.instance)),c.Disposable.From(f,"afterload",()=&gt;this._OnAfterLoad()),c.Disposable.From(f,"suspend",()=&gt;this._OnSuspend()),c.Disposable.From(f,"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._StartTicking()}Release(){this._listenerInst=null;super.Release()}_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 f=a.tickCount,d=this._lastAIState.filter(e=&gt;e.hasOwnProperty("placeholder")&amp;&amp;(e.placeholder&gt;f||-1===e.placeholder));this._lastAIState=a.audioInstances;this._lastAnalysersData=a.analysers;0&lt;d.length&amp;&amp;c.appendArray(this._lastAIState,d)}_OnUpdateFxState(a){this._lastFxState=a.fxstate}_GetFirstAudioStateByTag(a){for(const f of this._lastAIState)if(c.equalsNoCase(f.tag,a))return f;return null}_IsTagPlaying(a){return this._lastAIState.some(f=&gt;
c.equalsNoCase(a,f.tag)&amp;&amp;f.isPlaying)}_MaybeMarkAsPlaying(a,f,d,e){if(this._IsTagPlaying(a))return null;a={tag:a,duration:0,volume:e,isPlaying:!0,playbackTime:0,playbackRate:1,uid:-1,bufferOriginalUrl:"",bufferUrl:"",bufferType:"",isMusic:f,isLooping:d,isMuted:!1,resumePosition:0,pan:null,placeholder:-1};this._lastAIState.push(a);return a}async _OnTrigger(a){const f=a.type;this._triggerTag=a.tag;a=a.aiid;if("ended"===f){for(const d of this._lastAIState)if(d.aiid===a){d.isPlaying=!1;break}await this.TriggerAsync(c.Plugins.Audio.Cnds.OnEnded)}else"fade-ended"===
f&amp;&amp;await this.TriggerAsync(c.Plugins.Audio.Cnds.OnFadeEnded)}Tick(){const a={timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTime(),instPans:this.GetInstancePans(),tickCount:this._runtime.GetTickCountNoSave()};if(this._listenerInst){const f=this._listenerInst.GetWorldInfo();this._listenerX=f.GetX();this._listenerY=f.GetY();a.listenerPos=[this._listenerX,this._listenerY,this._listenerZ]}this.PostToDOM("tick",a)}rotatePtAround(a,f,d,e,g){if(0===d)return[a,f];const h=Math.sin(d);
d=Math.cos(d);a-=e;f-=g;const l=a*h;a=a*d-f*h;return[a+e,f*d+l+g]}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 f=a.GetWorldInfo(),d=f.GetLayer().GetAngle(),[e,g]=this.rotatePtAround(f.GetX(),f.GetY(),-d,this._listenerX,this._listenerY);return{uid:a.GetUID(),x:e,y:g,angle:f.GetAngle()-d}})}GetAnalyserData(a,f){for(const d of this._lastAnalysersData)if(d.index===f&amp;&amp;c.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 [f,d]of a.remoteUrls)this._remoteUrls.set(f,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 f of this._lastAIState)(a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f.bufferOriginalUrl))?(f.bufferUrl=a.url,f.bufferType=a.type):f.bufferUrl=null;for(const d of Object.values(this._lastFxState))for(const e of d)e.hasOwnProperty("bufferOriginalUrl")&amp;&amp;(f=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e.bufferOriginalUrl))&amp;&amp;(e.bufferUrl=f.url,e.bufferType=f.type);this.PostToDOM("load-state",{saveLoadMode:this._saveLoadMode,
timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTime(),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 [f,d]of Object.entries(this._lastFxState))a.push({name:"$"+f,value:d.map(e=&gt;e.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((f,d)=&gt;({name:"$#"+d,value:`${f.bufferOriginalUrl} ("${f.tag}") ${Math.round(10*f.playbackTime)/10} / ${Math.round(10*f.duration)/10}`}))]}]}}}"use strict";
{const c=self.C3;c.Plugins.Audio.Cnds={OnEnded(b){return c.equalsNoCase(this._triggerTag,b)},OnFadeEnded(b){return c.equalsNoCase(this._triggerTag,b)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return!0},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const b of this._lastAIState)if(b.isPlaying)return!0;return!1},IsTagPlaying(b){return this._IsTagPlaying(b)}}}"use strict";
{const c=self.C3,b="lowpass highpass bandpass lowshelf highshelf peaking notch allpass".split(" ");c.Plugins.Audio.Acts={async Play(a,f,d,e){if(!this._isSilent){var g=a[1],h=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(h){var l=this._nextPlayTime;this._nextPlayTime=0;var m=this._MaybeMarkAsPlaying(e.toLowerCase(),g,0!==f,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:h.url,type:h.type,isMusic:g,tag:e.toLowerCase(),isLooping:0!==f,vol:this.DbToLinear(d),
pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{m&amp;&amp;(m.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPosition(a,f,d,e,g,h,l,m,n,r){if(!this._isSilent){var q=a[1],t=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(t){var u=this._nextPlayTime;this._nextPlayTime=0;var w=this._MaybeMarkAsPlaying(r.toLowerCase(),q,0!==f,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:t.url,type:t.type,isMusic:q,tag:r.toLowerCase(),isLooping:0!==
f,vol:this.DbToLinear(d),pos:0,off:u,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:e,y:g,angle:c.toRadians(h),innerAngle:c.toRadians(l),outerAngle:c.toRadians(m),outerGain:this.DbToLinear(n)}})}finally{w&amp;&amp;(w.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObject(a,f,d,e,g,h,l,m){if(!this._isSilent&amp;&amp;e&amp;&amp;(e=e.GetFirstPicked())&amp;&amp;e.GetWorldInfo()){var n=e.GetWorldInfo(),r=n.GetLayer().GetAngle(),[q,t]=this.rotatePtAround(n.GetX(),n.GetY(),-r,this._listenerX,this._listenerY),
u=a[1],w=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]);if(w){var y=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(m.toLowerCase(),u,0!==f,this.DbToLinear(d));try{await this.PostToDOMAsync("play",{originalUrl:a[0],url:w.url,type:w.type,isMusic:u,tag:m.toLowerCase(),isLooping:0!==f,vol:this.DbToLinear(d),pos:0,off:y,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:q,y:t,angle:n.GetAngle()-r,innerAngle:c.toRadians(g),outerAngle:c.toRadians(h),outerGain:this.DbToLinear(l),
uid:e.GetUID()}})}finally{C&amp;&amp;(C.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayByName(a,f,d,e,g){if(!this._isSilent){a=1===a;var h=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f)||this._remoteUrls.get(f.toLowerCase());if(h){var l=this._nextPlayTime;this._nextPlayTime=0;var m=this._MaybeMarkAsPlaying(g.toLowerCase(),a,0!==d,this.DbToLinear(e));try{await this.PostToDOMAsync("play",{originalUrl:f,url:h.url,type:h.type,isMusic:a,tag:g.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(e),
pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{m&amp;&amp;(m.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPositionByName(a,f,d,e,g,h,l,m,n,r,q){if(!this._isSilent){a=1===a;var t=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f)||this._remoteUrls.get(f.toLowerCase());if(t){var u=this._nextPlayTime;this._nextPlayTime=0;var w=this._MaybeMarkAsPlaying(q.toLowerCase(),a,0!==d,this.DbToLinear(e));try{await this.PostToDOMAsync("play",{originalUrl:f,url:t.url,type:t.type,
isMusic:a,tag:q.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(e),pos:0,off:u,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:g,y:h,angle:c.toRadians(l),innerAngle:c.toRadians(m),outerAngle:c.toRadians(n),outerGain:this.DbToLinear(r)}})}finally{w&amp;&amp;(w.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObjectByName(a,f,d,e,g,h,l,m,n){if(!this._isSilent&amp;&amp;!this._isSilent&amp;&amp;g&amp;&amp;(g=g.GetFirstPicked())&amp;&amp;g.GetWorldInfo()){var r=g.GetWorldInfo(),q=r.GetLayer().GetAngle(),[t,u]=this.rotatePtAround(r.GetX(),
r.GetY(),-q,this._listenerX,this._listenerY);a=1===a;var w=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f)||this._remoteUrls.get(f.toLowerCase());if(w){var y=this._nextPlayTime;this._nextPlayTime=0;var C=this._MaybeMarkAsPlaying(n.toLowerCase(),a,0!==d,this.DbToLinear(e));try{await this.PostToDOMAsync("play",{originalUrl:f,url:w.url,type:w.type,isMusic:a,tag:n.toLowerCase(),isLooping:0!==d,vol:this.DbToLinear(e),pos:0,off:y,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:t,y:u,
angle:r.GetAngle()-q,innerAngle:c.toRadians(h),outerAngle:c.toRadians(l),outerGain:this.DbToLinear(m),uid:g.GetUID()}})}finally{C&amp;&amp;(C.placeholder=this._runtime.GetTickCountNoSave())}}}},SetLooping(a,f){this.PostToDOM("set-looping",{tag:a.toLowerCase(),isLooping:0===f})},SetMuted(a,f){this.PostToDOM("set-muted",{tag:a.toLowerCase(),isMuted:0===f})},SetVolume(a,f){this.PostToDOM("set-volume",{tag:a.toLowerCase(),vol:this.DbToLinear(f)})},FadeVolume(a,f,d,e){this.PostToDOM("fade-volume",{tag:a.toLowerCase(),
vol:this.DbToLinear(f),duration:d,stopOnEnd:0===e})},async Preload(a){const f=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:f}),this._preloadCount++)},async PreloadByName(a,f){a=1===a;const d=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f)||this._remoteUrls.get(f.toLowerCase());d&amp;&amp;(this._preloadTotal++,await this.PostToDOMAsync("preload",{originalUrl:f,url:d.url,
type:d.type,isMusic:a}),this._preloadCount++)},SetPlaybackRate(a,f){this.PostToDOM("set-playback-rate",{tag:a.toLowerCase(),rate:Math.max(f,0)})},Stop(a){this.PostToDOM("stop",{tag:a.toLowerCase()})},StopAll(){this.PostToDOM("stop-all")},SetPaused(a,f){this.PostToDOM("set-paused",{tag:a.toLowerCase(),paused:0===f})},Seek(a,f){this.PostToDOM("seek",{tag:a.toLowerCase(),pos:f})},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,f,d,e,g,h,l){a=a.toLowerCase();f=b[f];this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"filter",tag:a,params:[f,d,e,g,h,c.clamp(l/100,0,1)]})},AddDelayEffect(a,f,d,e){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"delay",tag:a,params:[f,this.DbToLinear(d),c.clamp(e/100,0,1)]})},AddFlangerEffect(a,f,
d,e,g,h){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"flanger",tag:a,params:[f/1E3,d/1E3,e,g/100,c.clamp(h/100,0,1)]})},AddPhaserEffect(a,f,d,e,g,h,l){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"phaser",tag:a,params:[f,d,e,g,h,c.clamp(l/100,0,1)]})},AddConvolutionEffect(a,f,d,e){a=a.toLowerCase();const g=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f[0]);g&amp;&amp;(this._IncrementEffectCount(a),this.PostToDOM("add-effect",
{type:"convolution",tag:a,bufferOriginalUrl:f[0],bufferUrl:g.url,bufferType:g.type,params:[0===d,c.clamp(e/100,0,1)]}))},AddGainEffect(a,f){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tag:a,params:[this.DbToLinear(f)]})},AddMuteEffect(a){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"gain",tag:a,params:[0]})},AddTremoloEffect(a,f,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"tremolo",
tag:a,params:[f,c.clamp(d/100,0,1)]})},AddRingModEffect(a,f,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"ringmod",tag:a,params:[f,c.clamp(d/100,0,1)]})},AddDistortionEffect(a,f,d,e,g,h){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"distortion",tag:a,params:[this.DbToLinearNoCap(f),this.DbToLinearNoCap(d),e,this.DbToLinearNoCap(g),c.clamp(h/100,0,1)]})},AddCompressorEffect(a,f,d,e,g,h){a=a.toLowerCase();this._IncrementEffectCount(a);
this.PostToDOM("add-effect",{type:"compressor",tag:a,params:[f,d,e,g/1E3,h/1E3]})},AddAnalyserEffect(a,f,d){a=a.toLowerCase();this._IncrementEffectCount(a);this.PostToDOM("add-effect",{type:"analyser",tag:a,params:[f,d]})},RemoveEffects(a){a=a.toLowerCase();this._effectCount.set(a,0);this.PostToDOM("remove-effects",{tag:a});this._lastFxState={}},SetEffectParameter(a,f,d,e,g,h){this.PostToDOM("set-effect-param",{tag:a.toLowerCase(),index:Math.floor(f),param:d,value:e,ramp:g,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 f=a[1];(a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(a[0]))&amp;&amp;this.PostToDOM("unload",{url:a.url,type:a.type,isMusic:f})},UnloadAudioByName(a,f){a=1===a;(f=this._runtime.GetAssetManager().GetProjectAudioFileUrl(f)||this._remoteUrls.get(f.toLowerCase()))&amp;&amp;this.PostToDOM("unload",{url:f.url,type:f.type,isMusic:a})},
UnloadAll(){this.PostToDOM("unload-all")},AddRemoteURL(a,f,d){this._remoteUrls.set(d.toLowerCase(),{url:a,type:f})}}}"use strict";
self.C3.Plugins.Audio.Exps={Duration(c){return(c=this._GetFirstAudioStateByTag(c))?c.duration:0},PlaybackTime(c){return(c=this._GetFirstAudioStateByTag(c))?c.playbackTime:0},PlaybackRate(c){return(c=this._GetFirstAudioStateByTag(c))?c.playbackRate:0},Volume(c){return(c=this._GetFirstAudioStateByTag(c))?this.LinearToDb(c.volume):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(c){return this._effectCount.get(c.toLowerCase())||0},AnalyserFreqBinCount(c,b){return(c=this.GetAnalyserData(c,
Math.floor(b)))?c.binCount:0},AnalyserFreqBinAt(c,b,a){c=this.GetAnalyserData(c,Math.floor(b));if(!c)return 0;a=Math.floor(a);return 0&gt;a||a&gt;=c.binCount?0:c.freqBins[a]},AnalyserPeakLevel(c,b){return(c=this.GetAnalyserData(c,Math.floor(b)))?c.peak:0},AnalyserRMSLevel(c,b){return(c=this.GetAnalyserData(c,Math.floor(b)))?c.rms:0},SampleRate(){return this._sampleRate},CurrentTime(){return self.C3_GetAudioContextCurrentTime?self.C3_GetAudioContextCurrentTime():performance.now()/1E3}};"use strict";
{const c=self.C3;c.Plugins.Browser=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Plugins.Browser.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Plugins.Browser.Instance=class extends c.SDKInstanceBase{constructor(b,a){super(b,"browser");this._initLocationStr="";this._isOnline=!1;this._docTitle=this._referrer="";this._isCookieEnabled=!1;this._windowOuterHeight=this._windowOuterWidth=this._screenHeight=this._screenWidth=0;this._isScirraArcade=!1;this.AddDOMMessageHandlers([["online-state",f=&gt;this._OnOnlineStateChanged(f)],["backbutton",()=&gt;this._OnBackButton()],["sw-message",f=&gt;this._OnSWMessage(f)],["hashchange",f=&gt;this._OnHashChange(f)]]);
b=this.GetRuntime().Dispatcher();this._disposables=new c.CompositeDisposable(c.Disposable.From(b,"afterfirstlayoutstart",()=&gt;this._OnAfterFirstLayoutStart()),c.Disposable.From(b,"window-resize",()=&gt;this._OnWindowResize()),c.Disposable.From(b,"suspend",()=&gt;this._OnSuspend()),c.Disposable.From(b,"resume",()=&gt;this._OnResume()));this._runtime.AddLoadPromise(this.PostToDOMAsync("get-initial-state",{exportType:this._runtime.GetExportType()}).then(f=&gt;{this._initLocationStr=f.location;this._isOnline=f.isOnline;
this._referrer=f.referrer;this._docTitle=f.title;this._isCookieEnabled=f.isCookieEnabled;this._screenWidth=f.screenWidth;this._screenHeight=f.screenHeight;this._windowOuterWidth=f.windowOuterWidth;this._windowOuterHeight=f.windowOuterHeight;this._isScirraArcade=f.isScirraArcade}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM("ready-for-sw-messages")}async _OnOnlineStateChanged(b){b=!!b.isOnline;this._isOnline!==b&amp;&amp;((this._isOnline=b)?await this.TriggerAsync(c.Plugins.Browser.Cnds.OnOnline):
await this.TriggerAsync(c.Plugins.Browser.Cnds.OnOffline))}async _OnWindowResize(){await this.TriggerAsync(c.Plugins.Browser.Cnds.OnResize)}_OnSuspend(){this.Trigger(c.Plugins.Browser.Cnds.OnPageHidden)}_OnResume(){this.Trigger(c.Plugins.Browser.Cnds.OnPageVisible)}async _OnBackButton(){await this.TriggerAsync(c.Plugins.Browser.Cnds.OnBackButton)}_OnSWMessage(b){b=b.type;"downloading-update"===b?this.Trigger(c.Plugins.Browser.Cnds.OnUpdateFound):"update-ready"===b||"update-pending"===b?this.Trigger(c.Plugins.Browser.Cnds.OnUpdateReady):
"offline-ready"===b&amp;&amp;this.Trigger(c.Plugins.Browser.Cnds.OnOfflineReady)}_OnHashChange(b){this._initLocationStr=b.location;this.Trigger(c.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()}]}]}}}"use strict";
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(c){const b=this._runtime.GetCanvasManager().GetLastWidth(),a=this._runtime.GetCanvasManager().GetLastHeight();return(b&lt;=a?0:1)===c},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}};"use strict";
{const c=self.C3,b="portrait landscape portrait-primary portrait-secondary landscape-primary landscape-secondary".split(" ");c.Plugins.Browser.Acts={Alert(a){this.PostToDOM("alert",{message:a.toString()})},Close(){this._isScirraArcade||(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._isScirraArcade||this.PostToDOM("navigate",{type:"back"})},GoForward(){this._isScirraArcade||
this.PostToDOM("navigate",{type:"forward"})},GoHome(){this._isScirraArcade||this.PostToDOM("navigate",{type:"home"})},Reload(){this._isScirraArcade||(this._runtime.IsDebug()?this._runtime.PostToDebugger({type:"reload"}):this.PostToDOM("navigate",{type:"reload"}))},GoToURL(a,f){this._PostToDOMMaybeSync("navigate",{type:"url",url:a,target:f,exportType:this._runtime.GetExportType()})},GoToURLWindow(a,f){this._PostToDOMMaybeSync("navigate",{type:"new-window",url:a,tag:f,exportType:this._runtime.GetExportType()})},
RequestFullScreen(a,f){2&lt;=a&amp;&amp;(a+=1);6===a&amp;&amp;(a=2);1===a&amp;&amp;(a=0);a=c.CanvasManager._FullscreenModeNumberToString(a);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(a);this._PostToDOMMaybeSync("request-fullscreen",{navUI:f})},CancelFullScreen(){this._PostToDOMMaybeSync("exit-fullscreen")},Vibrate(a){a=a.split(",");for(let f=0,d=a.length;f&lt;d;++f)a[f]=parseInt(a[f],10);this._PostToDOMMaybeSync("vibrate",{pattern:a})},async InvokeDownload(a,f){f&amp;&amp;(a=await this._runtime.GetAssetManager().GetProjectFileUrl(a),
this._runtime.InvokeDownload(a,f))},InvokeDownloadString(a,f,d){d&amp;&amp;(a=`data:${f},${encodeURIComponent(a)}`,this._runtime.InvokeDownload(a,d))},ConsoleLog(a,f){f=f.toString();0===a?console.log(f):1===a?console.warn(f):2===a&amp;&amp;console.error(f)},ConsoleGroup(a){console.group(a)},ConsoleGroupEnd(){console.groupEnd()},ExecJs(a){try{eval(a)}catch(f){console.error("Error executing JavaScript: ",f)}},LockOrientation(a){a=Math.floor(a);0&gt;a||a&gt;=b.length||this._PostToDOMMaybeSync("lock-orientation",{orientation:b[a]})},
UnlockOrientation(){this._PostToDOMMaybeSync("unlock-orientation")},LoadStyleSheet(a){this._runtime.GetAssetManager().LoadStyleSheet(a)},SetHash(a){this.PostToDOM("set-hash",{hash:a})}}}"use strict";
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(c){const b=this._runtime.IsInWorker()?(new URL(this._initLocationStr)).search:location.search;return(c=RegExp("[?&amp;]"+c+"=([^&amp;]*)").exec(b))?decodeURIComponent(c[1].replace(/\+/g," ")):""},Referrer(){return this._referrer},Title(){return this._docTitle},Language(){return navigator.language},
Platform(){return navigator.platform},UserAgent(){return navigator.userAgent},ExecJS(c){let b=0;try{b=eval(c)}catch(a){console.error("Error executing JavaScript: ",a)}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 c=navigator.connection;return c?c.downlink||
c.downlinkMax||c.bandwidth||Infinity:Infinity},ConnectionType(){const c=navigator.connection;return c?c.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 c=self.C3;c.Plugins.TiledBg=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;function b(a){switch(a){case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"}c.Plugins.TiledBg.Type=class extends c.SDKTypeBase{constructor(a,f){super(a);this._wrapY=this._wrapX="repeat";f&amp;&amp;(this._wrapX=b(f[0]),this._wrapY=b(f[1]))}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(a){return this.GetImageInfo().LoadStaticTexture(a,{sampling:this._runtime.GetSampling(),wrapX:this._wrapX,wrapY:this._wrapY})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}}}"use strict";
{const c=self.C3,b=c.New(c.Rect),a=c.New(c.Quad),f=c.New(c.Rect),d=c.New(c.Quad);c.Plugins.TiledBg.Instance=class extends c.SDKWorldInstanceBase{constructor(g,h){super(g);this._imageOffsetY=this._imageOffsetX=0;this._imageScaleY=this._imageScaleX=1;this._imageAngle=0;this._ownImageInfo=null;h&amp;&amp;(this.GetWorldInfo().SetVisible(!!h[0]),this._imageOffsetX=h[4],this._imageOffsetY=h[5],this._imageScaleX=h[6],this._imageScaleY=h[7],this._imageAngle=c.toRadians(h[8]))}Release(){this._ReleaseOwnImage();super.Release()}_ReleaseOwnImage(){this._ownImageInfo&amp;&amp;
(this._ownImageInfo.Release(),this._ownImageInfo=null)}Draw(g){var h=this.GetCurrentImageInfo(),l=h.GetTexture();if(null!==l){g.SetTexture(l);l=h.GetWidth();h=h.GetHeight();var m=this._imageOffsetX/l,n=this._imageOffsetY/h,r=this.GetWorldInfo();f.set(0,0,r.GetWidth()/(l*this._imageScaleX),r.GetHeight()/(h*this._imageScaleY));f.offset(-m,-n);r.HasMesh()?this._DrawMesh(r,g):this._DrawStandard(r,g)}}_DrawStandard(g,h){let l=g.GetBoundingQuad();this._runtime.IsPixelRoundingEnabled()&amp;&amp;(l=g.PixelRoundQuad(l));
0===this._imageAngle?h.Quad3(l,f):(d.setFromRotatedRect(f,-this._imageAngle),h.Quad4(l,d))}_DrawMesh(g,h){const l=g.GetTransformedMesh();if(g.IsMeshChanged()){g.CalculateBbox(b,a,!1);let m=a;this._runtime.IsPixelRoundingEnabled()&amp;&amp;(m=g.PixelRoundQuad(m));let n=f;0!==this._imageAngle&amp;&amp;(d.setFromRotatedRect(f,-this._imageAngle),n=d);l.CalculateTransformedMesh(g.GetSourceMesh(),m,n);g.SetMeshChanged(!1)}l.Draw(h)}GetCurrentImageInfo(){return this._ownImageInfo||this._objectClass.GetImageInfo()}_SetMeshChanged(){this.GetWorldInfo().SetMeshChanged(!0)}_SetImageOffsetX(g){this._imageOffsetX!==
g&amp;&amp;(this._imageOffsetX=g,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageOffsetX(){return this._imageOffsetX}_SetImageOffsetY(g){this._imageOffsetY!==g&amp;&amp;(this._imageOffsetY=g,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageOffsetY(){return this._imageOffsetY}_SetImageScaleX(g){this._imageScaleX!==g&amp;&amp;(this._imageScaleX=g,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageScaleX(){return this._imageScaleX}_SetImageScaleY(g){this._imageScaleY!==g&amp;&amp;(this._imageScaleY=
g,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageScaleY(){return this._imageScaleY}_SetImageAngle(g){this._imageAngle!==g&amp;&amp;(this._imageAngle=g,this._runtime.UpdateRender(),this._SetMeshChanged())}_GetImageAngle(){return this._imageAngle}GetPropertyValueByIndex(g){switch(g){case 4:return this._GetImageOffsetX();case 5:return this._GetImageOffsetY();case 6:return this._GetImageScaleX();case 7:return this._GetImageScaleY();case 8:return this._GetImageAngle()}}SetPropertyValueByIndex(g,
h){switch(g){case 4:this._SetImageOffsetX(h);break;case 5:this._SetImageOffsetY(h);break;case 6:this._SetImageScaleX(h);break;case 7:this._SetImageScaleY(h);break;case 8:this._SetImageAngle(h)}}GetScriptInterfaceClass(){return self.ITiledBackgroundInstance}};const e=new WeakMap;self.ITiledBackgroundInstance=class extends self.IWorldInstance{constructor(){super();e.set(this,self.IInstance._GetInitInst().GetSdkInstance())}set imageOffsetX(g){e.get(this)._SetImageOffsetX(g)}get imageOffsetX(){return e.get(this)._GetImageOffsetX()}set imageOffsetY(g){e.get(this)._SetImageOffsetY(g)}get imageOffsetY(){return e.get(this)._GetImageOffsetY()}set imageScaleX(g){e.get(this)._SetImageScaleX(g)}get imageScaleX(){return e.get(this)._GetImageScaleX()}set imageScaleY(g){e.get(this)._SetImageScaleY(g)}get imageScaleY(){return e.get(this)._GetImageScaleY()}set imageAngle(g){e.get(this)._SetImageAngle(g)}get imageAngle(){return e.get(this)._GetImageAngle()}set imageAngleDegrees(g){e.get(this)._SetImageAngle(c.toRadians(g))}get imageAngleDegrees(){return c.toDegrees(e.get(this)._GetImageAngle())}}}"use strict";
self.C3.Plugins.TiledBg.Cnds={OnURLLoaded(){return!0},OnURLFailed(){return!0}};"use strict";
{const c=self.C3;c.Plugins.TiledBg.Acts={SetImageOffsetX(b){this._SetImageOffsetX(b)},SetImageOffsetY(b){this._SetImageOffsetY(b)},SetImageScaleX(b){this._SetImageScaleX(b/100)},SetImageScaleY(b){this._SetImageScaleY(b/100)},SetImageAngle(b){this._SetImageAngle(c.toRadians(b))},SetEffect(b){this.GetWorldInfo().SetBlendMode(b);this._runtime.UpdateRender()},async LoadURL(b,a){if(!this._ownImageInfo||this._ownImageInfo.GetURL()!==b){a=this._runtime;var f=c.New(c.ImageInfo);await f.LoadDynamicAsset(a,
b);if(f.IsLoaded()){if(this.WasReleased())return f.Release(),null;await f.LoadStaticTexture(a.GetWebGLRenderer(),{sampling:this._runtime.GetSampling(),wrapX:"repeat",wrapY:"repeat"})&amp;&amp;(this.WasReleased()?f.Release():(this._ReleaseOwnImage(),this._ownImageInfo=f,a.UpdateRender(),await this.TriggerAsync(c.Plugins.TiledBg.Cnds.OnURLLoaded)))}else this.Trigger(c.Plugins.TiledBg.Cnds.OnURLFailed)}}}}"use strict";
{const c=self.C3;c.Plugins.TiledBg.Exps={ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},ImageOffsetX(){return this._imageOffsetX},ImageOffsetY(){return this._imageOffsetY},ImageScaleX(){return 100*this._imageScaleX},ImageScaleY(){return 100*this._imageScaleY},ImageAngle(){return c.toDegrees(this._imageAngle)}}}"use strict";{const c=self.C3;c.Plugins.Dictionary=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.Dictionary.Type=class extends c.SDKTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=self.IInstance;c.Plugins.Dictionary.Instance=class extends c.SDKInstanceBase{constructor(f,d){super(f);this._data=new Map;this._curKey=""}Release(){this._data.clear();super.Release()}GetAsJsonString(){return JSON.stringify({c2dictionary:!0,data:c.MapToObject(this._data)})}GetDataMap(){return this._data}SaveToJson(){return c.MapToObject(this._data)}LoadFromJson(f){c.ObjectToMap(f,this._data)}GetDebuggerProperties(){return[{title:"plugins.dictionary.name",properties:[{name:"plugins.dictionary.debugger.key-count",
value:this._data.size},...[...this._data].map(f=&gt;({name:"$"+f[0],value:f[1],onedit:d=&gt;this._data.set(f[0],d)}))]}]}GetScriptInterfaceClass(){return self.IDictionaryInstance}};const a=new WeakMap;self.IDictionaryInstance=class extends b{constructor(){super();a.set(this,b._GetInitInst().GetSdkInstance())}getDataMap(){return a.get(this).GetDataMap()}}}"use strict";
{const c=self.C3;c.Plugins.Dictionary.Cnds={CompareValue(b,a,f){b=this._data.get(b);return"undefined"===typeof b?!1:c.compare(b,a,f)},ForEachKey(){const b=this._runtime,a=b.GetEventSheetManager(),f=b.GetCurrentEvent(),d=f.GetSolModifiers(),e=b.GetEventStack(),g=e.GetCurrentStackFrame(),h=e.Push(f);b.SetDebuggingEnabled(!1);for(const l of this._data.keys())this._curKey=l,a.PushCopySol(d),f.Retrigger(g,h),a.PopSol(d);b.SetDebuggingEnabled(!0);this._curKey="";e.Pop();return!1},CompareCurrentValue(b,
a){const f=this._data.get(this._curKey);return"undefined"===typeof f?!1:c.compare(f,b,a)},HasKey(b){return this._data.has(b)},IsEmpty(){return 0===this._data.size}}}"use strict";
{const c=self.C3;c.Plugins.Dictionary.Acts={AddKey(b,a){this._data.set(b,a)},SetKey(b,a){this._data.has(b)&amp;&amp;this._data.set(b,a)},DeleteKey(b){this._data.delete(b)},Clear(){this._data.clear()},JSONLoad(b){let a=null;try{a=JSON.parse(b)}catch(f){console.error("[Construct 3] Error parsing JSON: ",f);return}a.c2dictionary&amp;&amp;c.ObjectToMap(a.data,this._data)},JSONDownload(b){const a=URL.createObjectURL(new Blob([this.GetAsJsonString()],{type:"application/json"}));this._runtime.InvokeDownload(a,b)}}}"use strict";
self.C3.Plugins.Dictionary.Exps={Get(c){c=this._data.get(c);return"undefined"===typeof c?0:c},GetDefault(c,b){c=this._data.get(c);return"undefined"===typeof c?b:c},KeyCount(){return this._data.size},CurrentKey(){return this._curKey},CurrentValue(){return this._data.get(this._curKey)||0},AsJSON(){return this.GetAsJsonString()}};"use strict";C3.Plugins.GameAnalytics=class extends C3.SDKPluginBase{constructor(c){super(c)}Release(){super.Release()}};"use strict";C3.Plugins.GameAnalytics.Type=class extends C3.SDKTypeBase{constructor(c){super(c)}Release(){super.Release()}OnCreate(){}};
"use strict";
C3.Plugins.GameAnalytics.Instance=class extends C3.SDKInstanceBase{constructor(c,b){super(c);this._customUserId=this._build="";this._autoDetectAppVersion=this._enableVerboseLog=this._enableInfoLog=this._enableManualSessionHandling=!1;this._secretKeyIOS=this._gameKeyIOS=this._secretKeyAndroid=this._gameKeyAndroid=this._secretKeyBrowser=this._gameKeyBrowser="";this._customDimensions01=[];this._customDimensions02=[];this._customDimensions03=[];this._resourceCurrencies=[];this._resourceItemTypes=[];b&amp;&amp;
(this._build=b[0],this._customUserId=b[1],this._enableManualSessionHandling=b[2],this._enableInfoLog=b[3],this._enableVerboseLog=b[4],this._autoDetectAppVersion=b[5],this._gameKeyBrowser=b[6],this._secretKeyBrowser=b[7],this._gameKeyAndroid=b[8],this._secretKeyAndroid=b[9],this._gameKeyIOS=b[10],this._secretKeyIOS=b[11])}Release(){super.Release()}SaveToJson(){return{}}LoadFromJson(c){}};"use strict";
C3.Plugins.GameAnalytics.Cnds={isRemoteConfigsReady(c){if("function"==typeof window.GameAnalytics.isRemoteConfigsReady)return window.GameAnalytics.isRemoteConfigsReady(b=&gt;{c&amp;&amp;window.c2_callFunction&amp;&amp;window.c2_callFunction(c,[b?1:0])}),!1;if("undefined"!=typeof window.gameanalytics.GameAnalytics)return window.gameanalytics.GameAnalytics.isRemoteConfigsReady();console.log("isRemoteConfigsReady: GameAnalytics object not found");return!1}};"use strict";
C3.Plugins.GameAnalytics.Acts={addAvailableCustomDimension01(c){this._customDimensions01.push(c)},addAvailableCustomDimension02(c){this._customDimensions02.push(c)},addAvailableCustomDimension03(c){this._customDimensions03.push(c)},addAvailableResourceCurrency(c){this._resourceCurrencies.push(c)},addAvailableResourceItemType(c){this._resourceItemTypes.push(c)},initialize(){if("function"==typeof window.GameAnalytics.initialize){var c=window.GameAnalytics;this._enableInfoLog&amp;&amp;c.setEnabledInfoLog(!0);
this._enableVerboseLog&amp;&amp;c.setEnabledVerboseLog(!0);this._enableManualSessionHandling&amp;&amp;c.setEnabledManualSessionHandling(!0);0&lt;this._customDimensions01.length&amp;&amp;c.configureAvailableCustomDimensions01(this._customDimensions01);0&lt;this._customDimensions02.length&amp;&amp;c.configureAvailableCustomDimensions02(this._customDimensions02);0&lt;this._customDimensions03.length&amp;&amp;c.configureAvailableCustomDimensions03(this._customDimensions03);0&lt;this._resourceCurrencies.length&amp;&amp;c.configureAvailableResourceCurrencies(this._resourceCurrencies);
0&lt;this._resourceItemTypes.length&amp;&amp;c.configureAvailableResourceItemTypes(this._resourceItemTypes);c.configureBuild(this._build);this._autoDetectAppVersion&amp;&amp;c.configureAutoDetectAppVersion(!0);c.initialize({gameKey:"Android"===window.device.platform?this._gameKeyAndroid:this._gameKeyIOS,secretKey:"Android"===window.device.platform?this._secretKeyAndroid:this._secretKeyIOS,sdkVersion:"construct 3.0.8"})}else"undefined"!=typeof window.gameanalytics.GameAnalytics?(c=window.gameanalytics.GameAnalytics,
this._enableInfoLog&amp;&amp;c.setEnabledInfoLog(!0),this._enableVerboseLog&amp;&amp;c.setEnabledVerboseLog(!0),this._enableManualSessionHandling&amp;&amp;c.setEnabledManualSessionHandling(!0),0&lt;this._customDimensions01.length&amp;&amp;c.configureAvailableCustomDimensions01(this._customDimensions01),0&lt;this._customDimensions02.length&amp;&amp;c.configureAvailableCustomDimensions02(this._customDimensions02),0&lt;this._customDimensions03.length&amp;&amp;c.configureAvailableCustomDimensions03(this._customDimensions03),0&lt;this._resourceCurrencies.length&amp;&amp;
c.configureAvailableResourceCurrencies(this._resourceCurrencies),0&lt;this._resourceItemTypes.length&amp;&amp;c.configureAvailableResourceItemTypes(this._resourceItemTypes),c.configureBuild(this._build),c.configureSdkGameEngineVersion("construct 3.0.8"),c.initialize(this._gameKeyBrowser,this._secretKeyBrowser)):console.log("initialize: GameAnalytics object not found")},addBusinessEvent(c,b,a,f,d){"function"==typeof window.GameAnalytics.addBusinessEvent?window.GameAnalytics.addBusinessEvent({currency:c,amount:b,
itemType:a,itemId:f,cartType:d}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addBusinessEvent(c,b,a,f,d):console.log("addBusinessEvent: GameAnalytics object not found")},addResourceEvent(c,b,a,f,d){"function"==typeof window.GameAnalytics.addResourceEvent?window.GameAnalytics.addResourceEvent({flowType:c,currency:b,amount:a,itemType:f,itemId:d}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addResourceEvent(c,
b,a,f,d):console.log("addResourceEvent: GameAnalytics object not found")},addProgressionEvent(c,b,a,f){"function"==typeof window.GameAnalytics.addProgressionEvent?window.GameAnalytics.addProgressionEvent({progressionStatus:c,progression01:b,progression02:a,progression03:f}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addProgressionEvent(c,b,a,f):console.log("addProgressionEvent: GameAnalytics object not found")},addProgressionEventWithScore(c,b,a,f,d){"function"==
typeof window.GameAnalytics.addProgressionEvent?window.GameAnalytics.addProgressionEvent({progressionStatus:c,progression01:b,progression02:a,progression03:f,score:d}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addProgressionEvent(c,b,a,f,d):console.log("addProgressionEventWithScore: GameAnalytics object not found")},addDesignEvent(c){"function"==typeof window.GameAnalytics.addDesignEvent?window.GameAnalytics.addDesignEvent({eventId:c}):"undefined"!=
typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addDesignEvent(c):console.log("addDesignEvent: GameAnalytics object not found")},addDesignEventWithValue(c,b){"function"==typeof window.GameAnalytics.addDesignEvent?window.GameAnalytics.addDesignEvent({eventId:c,value:b}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addDesignEvent(c,b):console.log("addDesignEventWithValue: GameAnalytics object not found")},addErrorEvent(c,b){"function"==
typeof window.GameAnalytics.addErrorEvent?window.GameAnalytics.addErrorEvent({severity:c,message:b}):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.addErrorEvent(c,b):console.log("addErrorEvent: GameAnalytics object not found")},setEnabledEventSubmission(c){"function"==typeof window.GameAnalytics.setEnabledEventSubmission?window.GameAnalytics.setEnabledEventSubmission(c?!0:!1):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.setEnabledEventSubmission(c?
!0:!1):console.log("setEnabledEventSubmission: GameAnalytics object not found")},setEnabledManualSessionHandling(c){"function"==typeof window.GameAnalytics.setEnabledManualSessionHandling?window.GameAnalytics.setEnabledManualSessionHandling(c?!0:!1):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.setEnabledManualSessionHandling(c?!0:!1):console.log("setEnabledManualSessionHandling: GameAnalytics object not found")},setCustomDimension01(c){"function"==typeof window.GameAnalytics.setCustomDimension01?
window.GameAnalytics.setCustomDimension01(c):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.setCustomDimension01(c):console.log("setCustomDimension01: GameAnalytics object not found")},setCustomDimension02(c){"function"==typeof window.GameAnalytics.setCustomDimension02?window.GameAnalytics.setCustomDimension02(c):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.setCustomDimension02(c):console.log("setCustomDimension02: GameAnalytics object not found")},
setCustomDimension03(c){"function"==typeof window.GameAnalytics.setCustomDimension03?window.GameAnalytics.setCustomDimension03(c):"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.setCustomDimension03(c):console.log("setCustomDimension03: GameAnalytics object not found")},startSession(){"function"==typeof window.GameAnalytics.startSession?window.GameAnalytics.startSession():"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.startSession():
console.log("startSession: GameAnalytics object not found")},endSession(){"function"==typeof window.GameAnalytics.endSession?window.GameAnalytics.endSession():"undefined"!=typeof window.gameanalytics.GameAnalytics?window.gameanalytics.GameAnalytics.endSession():console.log("endSession: GameAnalytics object not found")},configureBuild(c){this._build=c}};"use strict";
C3.Plugins.GameAnalytics.Exps={getRemoteConfigsValueAsString(c,b,a){if("function"==typeof window.GameAnalytics.getRemoteConfigsValueAsString)return window.GameAnalytics.getRemoteConfigsValueAsString({key:c,defaultValue:b},f=&gt;{a&amp;&amp;window.c2_callFunction&amp;&amp;window.c2_callFunction(a,[f])}),"";if("undefined"!=typeof window.gameanalytics.GameAnalytics)return window.gameanalytics.GameAnalytics.getRemoteConfigsValueAsString(c,b);console.log("getRemoteConfigsValueAsString: GameAnalytics object not found");return""},
getRemoteConfigsContentAsString(c){if("function"==typeof window.GameAnalytics.getRemoteConfigsContentAsString)return window.GameAnalytics.getRemoteConfigsContentAsString(b=&gt;{c&amp;&amp;window.c2_callFunction&amp;&amp;window.c2_callFunction(c,[b])}),"";if("undefined"!=typeof window.gameanalytics.GameAnalytics)return window.gameanalytics.GameAnalytics.getRemoteConfigsContentAsString();console.log("endSession: GameAnalytics object not found");return""}};"use strict";{const c=self.C3;c.Plugins.NinePatch=class extends c.SDKPluginBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Plugins.NinePatch.Type=class extends c.SDKTypeBase{constructor(b){super(b);this._drawable=this._textureSet=null}Release(){this.ReleaseTextures();super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}async LoadTextures(b){this._drawable=await this.GetImageInfo().ExtractImageToCanvas()}CreatePatch(b,a,f,d){!this._textureSet&amp;&amp;this._drawable&amp;&amp;(this._textureSet=new self.NinePatchTextureSet(this),this._textureSet.CreateTextures(this._drawable,b,a,f,d))}ReleaseTextures(){this._textureSet&amp;&amp;
(this._textureSet.Release(),this._textureSet=null)}GetTextureSet(){return this._textureSet}}}"use strict";
{const c=self.C3,b=c.New(c.Rect),a=c.New(c.Quad);c.Plugins.NinePatch.Instance=class extends c.SDKWorldInstanceBase{constructor(f,d){super(f);this._bottomMargin=this._topMargin=this._rightMargin=this._leftMargin=16;this._fill=this._edges=1;this._isSeamless=!0;d&amp;&amp;(this._leftMargin=d[0],this._rightMargin=d[1],this._topMargin=d[2],this._bottomMargin=d[3],this._edges=d[4],this._fill=d[5],this._isSeamless=!!d[8],this.GetWorldInfo().SetVisible(!!d[6]));this._sdkType.CreatePatch(this._leftMargin,this._rightMargin,
this._topMargin,this._bottomMargin)}Release(){super.Release()}Draw(f){let d=this._sdkType.GetTextureSet();if(!d&amp;&amp;(this._sdkType.CreatePatch(this._leftMargin,this._rightMargin,this._topMargin,this._bottomMargin),d=this._sdkType.GetTextureSet(),!d))return;var e=this.GetWorldInfo();const g=this._leftMargin,h=this._rightMargin,l=this._topMargin,m=this._bottomMargin;var n=d.GetImageWidth(),r=d.GetImageHeight();n-=h;r-=m;var q=e.GetBoundingQuad();const t=q.getTlx();q=q.getTly();const u=e.GetWidth();e=e.GetHeight();
var w=this._isSeamless?1:0;const y=this._edges,C=this._fill;0&lt;g&amp;&amp;0&lt;l&amp;&amp;this._DrawPatch(f,d.GetTexture(),0,0,g+w,l+w,t,q,g+w,l+w);0&lt;h&amp;&amp;0&lt;l&amp;&amp;this._DrawPatch(f,d.GetTexture(),n-w,0,h+w,l+w,t+u-h-w,q,h+w,l+w);0&lt;h&amp;&amp;0&lt;m&amp;&amp;this._DrawPatch(f,d.GetTexture(),n-w,r-w,h+w,m+w,t+u-h-w,q+e-m-w,h+w,m+w);0&lt;g&amp;&amp;0&lt;m&amp;&amp;this._DrawPatch(f,d.GetTexture(),0,r-w,g+w,m+w,t,q+e-m-w,g+w,m+w);0===y?(w=2===C?0:w,0&lt;g&amp;&amp;r&gt;l&amp;&amp;this._TilePatch(f,d.GetLeftTexture(),t,q+l,g+w,e-l-m,0,0),0&lt;h&amp;&amp;r&gt;l&amp;&amp;this._TilePatch(f,d.GetRightTexture(),t+
u-h-w,q+l,h+w,e-l-m,w,0),0&lt;l&amp;&amp;n&gt;g&amp;&amp;this._TilePatch(f,d.GetTopTexture(),t+g,q,u-g-h,l+w,0,0),0&lt;m&amp;&amp;n&gt;g&amp;&amp;this._TilePatch(f,d.GetBottomTexture(),t+g,q+e-m-w,u-g-h,m+w,0,w)):1===y&amp;&amp;(0&lt;g&amp;&amp;r&gt;l&amp;&amp;this._DrawPatch(f,d.GetTexture(),0,l,g,r-l,t,q+l,g,e-l-m),0&lt;h&amp;&amp;r&gt;l&amp;&amp;this._DrawPatch(f,d.GetTexture(),n,l,h,r-l,t+u-h,q+l,h,e-l-m),0&lt;l&amp;&amp;n&gt;g&amp;&amp;this._DrawPatch(f,d.GetTexture(),g,0,n-g,l,t+g,q,u-g-h,l),0&lt;m&amp;&amp;n&gt;g&amp;&amp;this._DrawPatch(f,d.GetTexture(),g,r,n-g,m,t+g,q+e-m,u-g-h,m));r&gt;l&amp;&amp;n&gt;g&amp;&amp;(0===C?this._TilePatch(f,d.GetFillTexture(),
t+g,q+l,u-g-h,e-l-m,0,0):1===C&amp;&amp;this._DrawPatch(f,d.GetTexture(),g,l,n-g,r-l,t+g,q+l,u-g-h,e-l-m))}_DrawPatch(f,d,e,g,h,l,m,n,r,q){const t=d.GetWidth(),u=d.GetHeight();f.SetTexture(d);d=this.GetWorldInfo();var w=d.GetBoundingQuad();const y=w.getTlx();w=w.getTly();b.set(m,n,m+r,n+q);b.offset(-y,-w);a.setFromRotatedRect(b,d.GetAngle());a.offset(y,w);b.set(e/t,g/u,(e+h)/t,(g+l)/u);f.Quad3(a,b)}_TilePatch(f,d,e,g,h,l,m,n){const r=d.GetWidth(),q=d.GetHeight();f.SetTexture(d);d=this.GetWorldInfo();var t=
d.GetBoundingQuad();const u=t.getTlx();t=t.getTly();b.set(e,g,e+h,g+l);b.offset(-u,-t);a.setFromRotatedRect(b,d.GetAngle());a.offset(u,t);b.set(-m/r,-n/q,(h-m)/r,(l-n)/q);f.Quad3(a,b)}GetCurrentImageInfo(){this._objectClass.GetImageInfo()}GetPropertyValueByIndex(f){}SetPropertyValueByIndex(f,d){}}}"use strict";self.C3.Plugins.NinePatch.Cnds={};"use strict";self.C3.Plugins.NinePatch.Acts={SetEffect(c){this.GetWorldInfo().SetBlendMode(c);this._runtime.UpdateRender()}};"use strict";
self.C3.Plugins.NinePatch.Exps={};"use strict";
{const c=self.C3;function b(a){const f=c.CreateCanvas(a.width,a.height);f.getContext("2d").drawImage(a,0,0);return f}self.NinePatchTextureSet=class{constructor(a){this._sdkType=a;this._runtime=this._sdkType.GetRuntime();this._bottomTexture=this._topTexture=this._rightTexture=this._leftTexture=this._fillTexture=this._texture=null;this._imageHeight=this._imageWidth=0;this._renderer=this._runtime.GetWebGLRenderer();this._wasReleased=this._isLoading=!1}Release(){this._renderer.IsContextLost()||(this._renderer.DeleteTexture(this._texture),
this._renderer.DeleteTexture(this._fillTexture),this._renderer.DeleteTexture(this._leftTexture),this._renderer.DeleteTexture(this._rightTexture),this._renderer.DeleteTexture(this._topTexture),this._renderer.DeleteTexture(this._bottomTexture));this._renderer=this._sdkType=this._bottomTexture=this._topTexture=this._rightTexture=this._leftTexture=this._fillTexture=this._texture=null;this._wasReleased=!0}WasReleased(){return this._wasReleased}CreateTextures(a,f,d,e,g){this._SliceImage(a,f,d,e,g)}HasCreatedTextures(){return!!this._texture}_SliceImage(a,
f,d,e,g){if(!this._wasReleased){var h=a.width,l=a.height;this._imageWidth=h;this._imageHeight=l;var m=h-d,n=l-g,r=this._runtime.GetSampling();this._texture=this._renderer.CreateStaticTexture(b(a),{sampling:r});m&gt;f&amp;&amp;n&gt;e&amp;&amp;(this._fillTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(b(a),f,e,m,n),{wrapX:"repeat",wrapY:"repeat",sampling:r}));0&lt;f&amp;&amp;n&gt;e&amp;&amp;(this._leftTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(b(a),0,e,f,n),{wrapY:"repeat",sampling:r}));0&lt;d&amp;&amp;n&gt;e&amp;&amp;(this._rightTexture=
this._renderer.CreateStaticTexture(this._SliceSubImage(b(a),m,e,h,n),{wrapY:"repeat",sampling:r}));0&lt;e&amp;&amp;m&gt;f&amp;&amp;(this._topTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(b(a),f,0,m,e),{wrapX:"repeat",sampling:r}));0&lt;g&amp;&amp;m&gt;f&amp;&amp;(this._bottomTexture=this._renderer.CreateStaticTexture(this._SliceSubImage(b(a),f,n,m,l),{wrapX:"repeat",sampling:r}))}}_SliceSubImage(a,f,d,e,g){e-=f;g-=d;const h=c.CreateCanvas(e,g);h.getContext("2d").drawImage(a,f,d,e,g,0,0,e,g);return h}GetImageWidth(){return this._imageWidth}GetImageHeight(){return this._imageHeight}GetTexture(){return this._texture}GetFillTexture(){return this._fillTexture}GetLeftTexture(){return this._leftTexture}GetRightTexture(){return this._rightTexture}GetTopTexture(){return this._topTexture}GetBottomTexture(){return this._bottomTexture}}}"use strict";
{const c=self.C3;c.Behaviors.Platform=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.Platform.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=self.IBehaviorInstance;function a(e,g,h,l,m){return c.clamp(e*m+.5*l*m*m,g*m,h*m)}c.Behaviors.Platform.Instance=class extends c.SDKBehaviorInstanceBase{constructor(e,g){super(e);this._keyboardDisposables=null;this._simJump=this._simRight=this._simLeft=this._ignoreInput=this._canDoubleJump=this._doubleJumped=this._jumped=this._jumpKey=this._rightKey=this._leftKey=!1;this._lastFloorObject=null;this._loadFloorUid=-1;this._lastFloorY=this._lastFloorX=0;this._wasOnFloor=this._floorIsJumpthru=
!1;this._wasOverJumpthru=!!this._runtime.GetCollisionEngine().TestOverlapJumpthru(this._inst);this._loadJumpthruUid=-1;this._animMode="stopped";this._fallThrough=0;this._isFirstTick=!0;this._rightY=this._rightX=this._downY=this._downX=this._dy=this._dx=0;this._g1=this._g=1500;this._ga=c.toRadians(90);this._maxSpeed=330;this._dec=this._acc=1500;this._jumpStrength=650;this._maxFall=1E3;this._enableDoubleJump=!1;this._sustainTime=this._jumpSustain=0;this._defaultControls=!0;this._ceilingCollisionMode=
0;this._isEnabled=!0;g&amp;&amp;(this._maxSpeed=g[0],this._acc=g[1],this._dec=g[2],this._jumpStrength=g[3],this._g=g[4],this._maxFall=g[5],this._enableDoubleJump=!!g[6],this._jumpSustain=g[7]/1E3,this._defaultControls=!!g[8],this._isEnabled=!!g[9]);e=this._runtime.Dispatcher();this._disposables=new c.CompositeDisposable(c.Disposable.From(e,"instancedestroy",h=&gt;this._OnInstanceDestroyed(h.instance)),c.Disposable.From(e,"afterload",h=&gt;this._OnAfterLoad()));this._defaultControls&amp;&amp;this._BindEvents();this._isEnabled&amp;&amp;
this._StartPostTicking();this._UpdateGravity();this._inst.GetUnsavedDataMap().set("isPlatformBehavior",!0)}Release(){this._keyboardDisposables&amp;&amp;(this._keyboardDisposables.Release(),this._keyboardDisposables=null);this._wasOverJumpthru=this._lastFloorObject=null;super.Release()}_BindEvents(){if(!this._keyboardDisposables){var e=this._runtime.Dispatcher();this._keyboardDisposables=new c.CompositeDisposable(c.Disposable.From(e,"keydown",g=&gt;this._OnKeyDown(g.data)),c.Disposable.From(e,"keyup",g=&gt;this._OnKeyUp(g.data)),
c.Disposable.From(e,"window-blur",()=&gt;this._OnWindowBlur()))}}_UnBindEvents(){this._keyboardDisposables&amp;&amp;(this._keyboardDisposables.Release(),this._keyboardDisposables=null)}_OnInstanceDestroyed(e){this._lastFloorObject===e&amp;&amp;(this._lastFloorObject=null);this._wasOverJumpthru===e&amp;&amp;(this._wasOverJumpthru=null)}_OnKeyDown(e){switch(e.key){case "ArrowLeft":this._leftKey=!0;break;case "ArrowRight":this._rightKey=!0;break;case "ArrowUp":this._jumpKey=!0}}_OnKeyUp(e){switch(e.key){case "ArrowLeft":this._leftKey=
!1;break;case "ArrowRight":this._rightKey=!1;break;case "ArrowUp":this._jumped=this._jumpKey=!1}}_OnWindowBlur(){this._jumped=this._jumpKey=this._rightKey=this._leftKey=!1}SaveToJson(){return{ii:this._ignoreInput,lfx:this._lastFloorX,lfy:this._lastFloorY,lfo:this._lastFloorObject?this._lastFloorObject.GetUID():-1,am:this._animMode,en:this._isEnabled,fall:this._fallThrough,ft:this._isFirstTick,dx:this._dx,dy:this._dy,ms:this._maxSpeed,acc:this._acc,dec:this._dec,js:this._jumpStrength,g:this._g,g1:this._g1,
mf:this._maxFall,wof:this._wasOnFloor,woj:this._wasOverJumpthru?this._wasOverJumpthru.GetUID():-1,ga:this._ga,edj:this._enableDoubleJump,cdj:this._canDoubleJump,dj:this._doubleJumped,sus:this._jumpSustain,dc:this._defaultControls,cc:this._ceilingCollisionMode}}LoadFromJson(e){this._ignoreInput=e.ii;this._lastFloorX=e.lfx;this._lastFloorY=e.lfy;this._loadFloorUid=e.lfo;this._animMode=e.am;const g=e.en;this._fallThrough=e.fall;this._isFirstTick=e.ft;this._dx=e.dx;this._dy=e.dy;this._maxSpeed=e.ms;this._acc=
e.acc;this._dec=e.dec;this._jumpStrength=e.js;this._g=e.g;this._g1=e.g1;this._maxFall=e.mf;this._wasOnFloor=e.wof;this._loadJumpthruUid=e.woj;this._ga=e.ga;this._enableDoubleJump=e.edj;this._canDoubleJump=e.cdj;this._doubleJumped=e.dj;this._jumpSustain=e.sus;this._defaultControls=e.dc;this._ceilingCollisionMode=e.cc||0;this._simJump=this._simRight=this._simLeft=this._jumped=this._jumpKey=this._rightKey=this._leftKey=!1;this._sustainTime=0;this._defaultControls?this._BindEvents():this._UnBindEvents();
this._SetEnabled(g);this._UpdateGravity()}_OnAfterLoad(){this._lastFloorObject=-1===this._loadFloorUid?null:this._runtime.GetInstanceByUID(this._loadFloorUid);this._wasOverJumpthru=-1===this._loadJumpthruUid?null:this._runtime.GetInstanceByUID(this._loadJumpthruUid)}_UpdateGravity(){this._downX=Math.cos(this._ga);this._downY=Math.sin(this._ga);this._rightX=Math.cos(this._ga-Math.PI/2);this._rightY=Math.sin(this._ga-Math.PI/2);this._downX=c.round6dp(this._downX);this._downY=c.round6dp(this._downY);
this._rightX=c.round6dp(this._rightX);this._rightY=c.round6dp(this._rightY);this._g1=this._g;0&gt;this._g&amp;&amp;(this._downX*=-1,this._downY*=-1,this._g=Math.abs(this._g))}_GetGDir(){return 0&gt;this._g?-1:1}_IsOnFloor(){var e=this._inst.GetWorldInfo();const g=this._runtime.GetCollisionEngine(),h=this._inst;var l=this._lastFloorObject;const m=e.GetX(),n=e.GetY();e.OffsetXY(this._downX,this._downY);e.SetBboxChanged();if(l&amp;&amp;g.TestOverlap(h,l)&amp;&amp;(!l.GetObjectClass().HasSolidBehavior()||g.IsSolidCollisionAllowed(l,
h)))return e.SetXY(m,n),e.SetBboxChanged(),l;{let r=g.TestOverlapSolid(h);l=null;r||0!==this._fallThrough||(l=g.TestOverlapJumpthru(h,!0));e.SetXY(m,n);e.SetBboxChanged();if(r){if(g.TestOverlap(h,r))return null;this._floorIsJumpthru=!1;return r}if(l&amp;&amp;l.length){e=0;for(let q=0,t=l.length;q&lt;t;++q)l[e]=l[q],g.TestOverlap(h,l[q])||++e;if(1&lt;=e)return this._floorIsJumpthru=!0,l[0]}return null}}PostTick(){if(this._isEnabled){var e=this._runtime.GetDt(this._inst);this._jumpKey||this._simJump||(this._jumped=
!1);var g=this._leftKey||this._simLeft,h=this._rightKey||this._simRight,l=this._jumpKey||this._simJump,m=l&amp;&amp;!this._jumped;this._simJump=this._simRight=this._simLeft=!1;this._ignoreInput&amp;&amp;(m=l=h=g=!1);l||(this._sustainTime=0);this._HandleFirstTick();var [n,,r]=this._TrackMovingPlatform(),q=this._IsOnFloor(),t=q&amp;&amp;!this._wasOnFloor;if(!this._MaybePushOutSolid()){this._TrackFloor(q,r,n,l);m=this._HandleJump(q,m,l);q||this._ApplyJumpGravity(m,l,e);this._wasOnFloor=!!q;g=this._ApplyHorizontalAcceleration(g,
h,e);h=!1;l=0;0!==this._dx&amp;&amp;(h=this._HandleHorizontalMovement(e,g,q,m));if(0!==this._dy){const [u,w]=this._HandleVerticalMovement(e,q);h=h||u;l=w}!h&amp;&amp;t&amp;&amp;0&gt;this._dy&amp;&amp;0&lt;l&amp;&amp;(this._dy=0,h=!0);this._HandleAnimationTriggers(q,h,m);0&lt;this._fallThrough&amp;&amp;this._fallThrough--;this._wasOverJumpthru=this._runtime.GetCollisionEngine().TestOverlapJumpthru(this._inst)}}}_HandleFirstTick(){if(this._isFirstTick){var e=this._inst,g=this._runtime.GetCollisionEngine();(g.TestOverlapSolid(e)||g.TestOverlapJumpthru(e))&amp;&amp;
g.PushOutSolid(e,-this._downX,-this._downY,4,!0);this._isFirstTick=!1}}_TrackMovingPlatform(){var e=this._lastFloorObject,g=e?e.GetWorldInfo():null;let h=0,l=0;var m=!1;if(e&amp;&amp;0===this._dy&amp;&amp;(g.GetY()!==this._lastFloorY||g.GetX()!==this._lastFloorX)){e=this._inst;m=e.GetWorldInfo();const n=this._runtime.GetCollisionEngine(),r=g.GetX();g=g.GetY();h=r-this._lastFloorX;l=g-this._lastFloorY;m.OffsetXY(h,l);m.SetBboxChanged();this._lastFloorX=r;this._lastFloorY=g;m=!0;n.TestOverlapSolid(e)&amp;&amp;n.PushOutSolid(e,
-h,-l,2.5*Math.hypot(h,l))}return[h,l,m]}_MaybePushOutSolid(){const e=this._inst;var g=e.GetWorldInfo();const h=this._runtime.GetCollisionEngine(),l=h.TestOverlapSolid(e);if(!l)return!1;const m=Math.abs(g.GetWidth());g=Math.abs(g.GetHeight());return e.GetSavedDataMap().get("inputPredicted")?(h.PushOutSolid(e,-this._downX,-this._downY,10,!1),!1):h.PushOutSolidAxis(e,-this._downX,-this._downY,g/8)||h.PushOutSolidAxis(e,this._rightX,this._rightY,m/2)||h.PushOutSolidAxis(e,this._downX,this._downY,g/2)||
h.PushOutSolidNearest(e,Math.max(m,g)/2)?(h.RegisterCollision(e,l),!1):!0}_TrackFloor(e,g,h,l){const m=this._inst,n=this._runtime.GetCollisionEngine();if(e){l=this._downX;const r=this._downY,q=this._rightX,t=this._rightY;this._canDoubleJump=this._doubleJumped=!1;0&lt;this._dy&amp;&amp;(this._wasOnFloor||(n.PushInFractional(m,-l,-r,e,16),this._wasOnFloor=!0),this._dy=0);this._lastFloorObject!==e?(this._lastFloorObject=e,h=e.GetWorldInfo(),this._lastFloorX=h.GetX(),this._lastFloorY=h.GetY(),n.RegisterCollision(m,
e)):g&amp;&amp;(e=n.TestOverlapSolid(m))&amp;&amp;(n.RegisterCollision(m,e),0!==h&amp;&amp;(0&lt;h?n.PushOutSolid(m,-q,-t):n.PushOutSolid(m,q,t)),n.PushOutSolid(m,-l,-r))}else l||(this._canDoubleJump=!0)}_HandleJump(e,g,h){if(e&amp;&amp;g||!e&amp;&amp;this._enableDoubleJump&amp;&amp;h&amp;&amp;this._canDoubleJump&amp;&amp;!this._doubleJumped){g=this._inst;h=g.GetWorldInfo();const l=this._runtime.GetCollisionEngine(),m=h.GetX(),n=h.GetY();h.OffsetXY(-this._downX,-this._downY);h.SetBboxChanged();l.TestOverlapSolid(g)?g=!1:(this._sustainTime=this._jumpSustain,this.Trigger(c.Behaviors.Platform.Cnds.OnJump),
this._animMode="jumping",this._dy=-this._jumpStrength,g=!0,e?this._jumped=!0:this._doubleJumped=!0);h.SetXY(m,n);h.SetBboxChanged()}return g}_ApplyJumpGravity(e,g,h){g&amp;&amp;0&lt;this._sustainTime?(this._dy=-this._jumpStrength,this._sustainTime-=h):(this._lastFloorObject=null,this._dy+=this._g*h,this._dy&gt;this._maxFall&amp;&amp;(this._dy=this._maxFall));e&amp;&amp;(this._jumped=!0)}_ApplyHorizontalAcceleration(e,g,h){const l=this._acc,m=this._dec;e===g&amp;&amp;(0&gt;this._dx?(this._dx+=m*h,0&lt;this._dx&amp;&amp;(this._dx=0)):0&lt;this._dx&amp;&amp;(this._dx-=
m*h,0&gt;this._dx&amp;&amp;(this._dx=0)));let n=0;e&amp;&amp;!g&amp;&amp;(n=0&lt;this._dx?-(l+m):-l);g&amp;&amp;!e&amp;&amp;(n=0&gt;this._dx?l+m:l);this._dx+=n*h;this._dx=c.clamp(this._dx,-this._maxSpeed,this._maxSpeed);return n}_HandleHorizontalMovement(e,g,h,l){const m=this._inst;var n=m.GetWorldInfo();const r=this._runtime.GetCollisionEngine(),q=this._downX,t=this._downY,u=this._rightX,w=this._rightY;var y=this._maxSpeed;let C=!1;var G=n.GetX();let x=n.GetY();var B=a(this._dx,-y,y,g,e)*u;const H=a(this._dx,-y,y,g,e)*w;n.OffsetXY(u*(1&lt;this._dx?
1:-1)-q,w*(1&lt;this._dx?1:-1)-t);n.SetBboxChanged();g=!1;y=r.TestOverlapSolid(m);n.SetXY(G+B,x+H);n.SetBboxChanged();let P=r.TestOverlapSolid(m);!P&amp;&amp;h&amp;&amp;(P=r.TestOverlapJumpthru(m))&amp;&amp;(n.SetXY(G,x),n.SetBboxChanged(),r.TestOverlap(m,P)?(P=null,g=!1):g=!0,n.SetXY(G+B,x+H),n.SetBboxChanged());P?(B=Math.abs(this._dx*e)+2,y||!r.PushOutSolid(m,-q,-t,B,g,P))?(r.RegisterCollision(m,P),B=Math.max(Math.abs(this._dx*e*2.5),30),r.PushOutSolid(m,u*(0&gt;this._dx?1:-1),w*(0&gt;this._dx?1:-1),B,!1)?!h||g||this._floorIsJumpthru||
(G=n.GetX(),x=n.GetY(),n.OffsetXY(q,t),r.TestOverlapSolid(m)?r.PushOutSolid(m,-q,-t,3,!1)||(n.SetXY(G,x),n.SetBboxChanged()):(n.SetXY(G,x),n.SetBboxChanged())):(n.SetXY(G,x),n.SetBboxChanged()),g||(this._dx=0)):!y&amp;&amp;!l&amp;&amp;Math.abs(this._dy)&lt;Math.abs(this._jumpStrength/4)&amp;&amp;(this._dy=0,h||(C=!0)):(G=this._IsOnFloor(),h&amp;&amp;!G?(e=Math.ceil(Math.abs(this._dx*e))+2,G=n.GetX(),x=n.GetY(),n.OffsetXY(q*e,t*e),n.SetBboxChanged(),r.TestOverlapSolid(m)||r.TestOverlapJumpthru(m)?r.PushOutSolid(m,-q,-t,e+2,!0):(n.SetXY(G,
x),n.SetBboxChanged())):G&amp;&amp;(!h&amp;&amp;this._floorIsJumpthru&amp;&amp;(this._lastFloorObject=G,n=G.GetWorldInfo(),this._lastFloorX=n.GetX(),this._lastFloorY=n.GetY(),this._dy=0,C=!0),0===this._dy&amp;&amp;r.PushInFractional(m,-q,-t,G,16)));return C}_HandleVerticalMovement(e,g){const h=this._inst,l=h.GetWorldInfo(),m=this._runtime.GetCollisionEngine(),n=this._downX,r=this._downY;let q=!1,t=l.GetX(),u=l.GetY();const w=a(this._dy,-Infinity,this._maxFall,this._g,e);l.OffsetXY(w*n,w*r);const y=l.GetX(),C=l.GetY();l.SetBboxChanged();
let G=m.TestOverlapSolid(h);var x=!1;if(!G&amp;&amp;0&lt;this._dy&amp;&amp;!g){if((x=0&lt;this._fallThrough?null:m.TestOverlapJumpthru(h,!0))&amp;&amp;x.length){if(this._wasOverJumpthru){l.SetXY(t,u);l.SetBboxChanged();g=0;for(let B=0,H=x.length;B&lt;H;++B)x[g]=x[B],m.TestOverlap(h,x[B])||++g;c.truncateArray(x,g);l.SetXY(y,C);l.SetBboxChanged()}1&lt;=x.length&amp;&amp;(G=x[0])}x=!!G}if(G)if(m.RegisterCollision(h,G),this._sustainTime=0,m.PushOutSolid(h,n*(0&gt;this._dy?1:-1),r*(0&gt;this._dy?1:-1),Math.max(Math.abs(this._dy*e*1.1),2),x,G)){this._lastFloorObject=
G;e=G.GetWorldInfo();this._lastFloorX=e.GetX();this._lastFloorY=e.GetY();(this._floorIsJumpthru=x)&amp;&amp;(q=!0);if(0&lt;this._dy||0===this._ceilingCollisionMode)this._dy=0;0&gt;this._dy&amp;&amp;1===this._ceilingCollisionMode&amp;&amp;m.PushInFractional(h,n,r,G,32)}else l.SetXY(t,u),l.SetBboxChanged(),this._wasOnFloor=!0,x||(this._dy=0);return[q,w]}_HandleAnimationTriggers(e,g,h){"falling"!==this._animMode&amp;&amp;0&lt;this._dy&amp;&amp;!e&amp;&amp;(this.Trigger(c.Behaviors.Platform.Cnds.OnFall),this._animMode="falling");(e||g)&amp;&amp;0&lt;=this._dy&amp;&amp;("falling"===
this._animMode||g||h&amp;&amp;0===this._dy?(this.Trigger(c.Behaviors.Platform.Cnds.OnLand),this._animMode=0===this._dx&amp;&amp;0===this._dy?"stopped":"moving"):("stopped"!==this._animMode&amp;&amp;0===this._dx&amp;&amp;0===this._dy&amp;&amp;(this.Trigger(c.Behaviors.Platform.Cnds.OnStop),this._animMode="stopped"),"moving"===this._animMode||0===this._dx&amp;&amp;0===this._dy||h||(this.Trigger(c.Behaviors.Platform.Cnds.OnMove),this._animMode="moving")))}_CheckIfStandingOnFloor(){if(0!==this._dy)return!1;const e=this._inst;var g=this.GetWorldInfo();
const h=this._runtime.GetCollisionEngine(),l=g.GetX(),m=g.GetY();g.OffsetXY(this._downX,this._downY);g.SetBboxChanged();const n=h.TestOverlapSolid(e);let r=null;n||0!==this._fallThrough||(r=h.TestOverlapJumpthru(e,!0));g.SetXY(l,m);g.SetBboxChanged();if(n)return!h.TestOverlap(e,n);if(r&amp;&amp;r.length){g=0;for(let q=0,t=r.length;q&lt;t;++q)r[g]=r[q],h.TestOverlap(e,r[q])||g++;if(1&lt;=g)return!0}return!1}_IsByWall(e){const g=this._inst,h=this.GetWorldInfo(),l=this._runtime.GetCollisionEngine(),m=h.GetX(),n=h.GetY();
0===e?h.OffsetXY(2*-this._rightX,2*-this._rightY):h.OffsetXY(2*this._rightX,2*this._rightY);h.SetBboxChanged();if(!l.TestOverlapSolid(g))return h.SetXY(m,n),h.SetBboxChanged(),!1;h.OffsetXY(3*-this._downX,3*-this._downY);h.SetBboxChanged();e=!!l.TestOverlapSolid(g);h.SetXY(m,n);h.SetBboxChanged();return e}_FallThroughJumpThru(){const e=this.GetWorldInfo(),g=e.GetX(),h=e.GetY();e.OffsetXY(this._downX,this._downY);e.SetBboxChanged();const l=this._runtime.GetCollisionEngine().TestOverlapJumpthru(this._inst,
!1);e.SetXY(g,h);e.SetBboxChanged();l&amp;&amp;(this._fallThrough=3,this._lastFloorObject=null)}_ResetDoubleJump(e){this._doubleJumped=!e}_GetSpeed(){return Math.hypot(this._dx,this._dy)}_GetMovingAngle(){return Math.atan2(this._dy,this._dx)}_IsJumping(){return 0&gt;this._dy}_IsFalling(){return 0&lt;this._dy}_SetMaxSpeed(e){this._maxSpeed=Math.max(e,0)}_GetMaxSpeed(){return this._maxSpeed}_SetAcceleration(e){this._acc=Math.max(e,0)}_GetAcceleration(){return this._acc}_SetDeceleration(e){this._dec=Math.max(e,0)}_GetDeceleration(){return this._dec}_SetJumpStrength(e){this._jumpStrength=
Math.max(e,0)}_GetJumpStrength(){return this._jumpStrength}_SetMaxFallSpeed(e){this._maxFall=Math.max(e,0)}_GetMaxFallSpeed(){return this._maxFall}_SetGravity(e){if(this._g1!==e){this._g=e;this._UpdateGravity();e=this._runtime.GetCollisionEngine();var g=this.GetWorldInfo();e.TestOverlapSolid(this._inst)&amp;&amp;(e.PushOutSolid(this._inst,this._downX,this._downY,10),g.OffsetXY(2*this._downX,2*this._downY),g.SetBboxChanged());this._lastFloorObject=null}}_GetGravity(){return this._g}_SetGravityAngle(e){e=c.clampAngle(e);
this._ga!==e&amp;&amp;(this._ga=e,this._UpdateGravity(),this._lastFloorObject=null)}_GetGravityAngle(){return this._ga}_SetDoubleJumpEnabled(e){this._enableDoubleJump=!!e}_IsDoubleJumpEnabled(){return this._enableDoubleJump}_SetJumpSustain(e){this._jumpSustain=e}_GetJumpSustain(){return this._jumpSustain}_SetCeilingCollisionMode(e){this._ceilingCollisionMode=e}_GetCeilingCollisionMode(){return this._ceilingCollisionMode}_SetVectorX(e){this._dx=e}_GetVectorX(){return this._dx}_SetVectorY(e){this._dy=e}_GetVectorY(){return this._dy}_SimulateControl(e){if(this._isEnabled)switch(e){case 0:this._simLeft=
!0;break;case 1:this._simRight=!0;break;case 2:this._simJump=!0}}_SetDefaultControls(e){e=!!e;this._defaultControls!==e&amp;&amp;((this._defaultControls=e)?this._BindEvents():(this._UnBindEvents(),this._OnWindowBlur()))}_IsDefaultControls(){return this._defaultControls}_SetIgnoreInput(e){this._ignoreInput=!!e}_IsIgnoreInput(){return this._ignoreInput}_SetEnabled(e){e=!!e;this._isEnabled!==e&amp;&amp;((this._isEnabled=e)?this._StartPostTicking():(this._StopPostTicking(),this._lastFloorObject=null,this._simJump=this._simRight=
this._simLeft=!1))}_IsEnabled(){return this._isEnabled}GetPropertyValueByIndex(e){switch(e){case 0:return this._GetMaxSpeed();case 1:return this._GetAcceleration();case 2:return this._GetDeceleration();case 3:return this._GetJumpStrength();case 4:return this._GetGravity();case 5:return this._GetMaxFallSpeed();case 6:return this._IsDoubleJumpEnabled();case 7:return 1E3*this._GetJumpSustain();case 8:return this._IsDefaultControls();case 9:return this._IsEnabled()}}SetPropertyValueByIndex(e,g){switch(e){case 0:this._SetMaxSpeed(g);
break;case 1:this._SetAcceleration(g);break;case 2:this._SetDeceleration(g);break;case 3:this._SetJumpStrength(g);break;case 4:this._SetGravity(g);break;case 5:this._SetMaxFallSpeed(g);break;case 6:this._SetDoubleJumpEnabled(!!g);break;case 7:this._SetJumpSustain(g/1E3);break;case 8:this._SetDefaultControls(!!g);break;case 9:this._SetEnabled(!!g)}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.platform.debugger.vector-x",value:this._GetVectorX(),
onedit:e=&gt;this._SetVectorX(e)},{name:"behaviors.platform.debugger.vector-y",value:this._GetVectorY(),onedit:e=&gt;this._SetVectorY(e)},{name:"behaviors.platform.properties.max-speed.name",value:this._GetMaxSpeed(),onedit:e=&gt;this._SetMaxSpeed(e)},{name:"behaviors.platform.properties.acceleration.name",value:this._GetAcceleration(),onedit:e=&gt;this._SetAcceleration(e)},{name:"behaviors.platform.properties.deceleration.name",value:this._GetDeceleration(),onedit:e=&gt;this._SetDeceleration(e)},{name:"behaviors.platform.properties.jump-strength.name",
value:this._GetJumpStrength(),onedit:e=&gt;this._SetJumpStrength(e)},{name:"behaviors.platform.properties.gravity.name",value:this._GetGravity(),onedit:e=&gt;this._SetGravity(e)},{name:"behaviors.platform.debugger.gravity-angle",value:c.toDegrees(this._GetGravityAngle()),onedit:e=&gt;this._SetGravityAngle(c.toRadians(e))},{name:"behaviors.platform.properties.max-fall-speed.name",value:this._GetMaxFallSpeed(),onedit:e=&gt;this._SetMaxFallSpeed(e)},{name:"behaviors.platform.debugger.animation-mode",value:["behaviors.platform.debugger.anim-"+
this._animMode]},{name:"behaviors.platform.properties.enabled.name",value:this._IsEnabled(),onedit:e=&gt;this._SetEnabled(e)}]}]}GetScriptInterfaceClass(){return self.IPlatformBehaviorInstance}};const f=new WeakMap,d=new Map([["left",0],["right",1],["jump",2]]);self.IPlatformBehaviorInstance=class extends b{constructor(){super();f.set(this,b._GetInitInst().GetSdkInstance())}fallThrough(){f.get(this)._FallThroughJumpThru()}resetDoubleJump(e){f.get(this)._ResetDoubleJump(!!e)}simulateControl(e){e=d.get(e);
if("number"!==typeof e)throw Error("invalid control");f.get(this)._SimulateControl(e)}get speed(){return f.get(this)._GetSpeed()}get maxSpeed(){return f.get(this)._GetMaxSpeed()}set maxSpeed(e){f.get(this)._SetMaxSpeed(e)}get acceleration(){return f.get(this)._GetAcceleration()}set acceleration(e){f.get(this)._SetAcceleration(e)}get deceleration(){return f.get(this)._GetDeceleration()}set deceleration(e){f.get(this)._SetDeceleration(e)}get jumpStrength(){return f.get(this)._GetJumpStrength()}set jumpStrength(e){f.get(this)._SetJumpStrength(e)}get maxFallSpeed(){return f.get(this)._GetMaxFallSpeed()}set maxFallSpeed(e){f.get(this)._SetMaxFallSpeed(e)}get gravity(){return f.get(this)._GetGravity()}set gravity(e){f.get(this)._SetGravity(e)}get gravityAngle(){return f.get(this)._GetGravityAngle()}set gravityAngle(e){f.get(this)._SetGravityAngle(e)}get isDoubleJumpEnabled(){return f.get(this)._IsDoubleJumpEnabled()}set isDoubleJumpEnabled(e){f.get(this)._SetDoubleJumpEnabled(!!e)}get jumpSustain(){return f.get(this)._GetJumpSustain()}set jumpSustain(e){f.get(this)._SetJumpSustain(e)}get ceilingCollisionMode(){return 0===
f.get(this)._GetCeilingCollisionMode()?"stop":"preserve-momentum"}set ceilingCollisionMode(e){const g=f.get(this);if("stop"===e)g._SetCeilingCollisionMode(0);else if("preserve-momentum"===e)g._SetCeilingCollisionMode(1);else throw Error("invalid mode");}get isOnFloor(){return f.get(this)._CheckIfStandingOnFloor()}isByWall(e){const g=f.get(this);if("left"===e)return g._IsByWall(0);if("right"===e)return g._IsByWall(1);throw Error("invalid side");}get isJumping(){return f.get(this)._IsJumping()}get isFalling(){return f.get(this)._IsFalling()}get vectorX(){return f.get(this)._GetVectorX()}set vectorX(e){f.get(this)._SetVectorX(e)}get vectorY(){return f.get(this)._GetVectorY()}set vectorY(e){f.get(this)._SetVectorY(e)}get isDefaultControls(){return f.get(this)._IsDefaultControls()}set isDefaultControls(e){f.get(this)._SetDefaultControls(!!e)}get isIgnoringInput(){return f.get(this)._IsIgnoreInput()}set isIgnoringInput(e){f.get(this)._SetIgnoreInput(!!e)}get isEnabled(){return f.get(this)._IsEnabled()}set isEnabled(e){f.get(this)._SetEnabled(!!e)}}}"use strict";
{const c=self.C3;c.Behaviors.Platform.Cnds={IsMoving(){return 0!==this._GetVectorX()||0!==this._GetVectorY()},CompareSpeed(b,a){return c.compare(this._GetSpeed(),b,a)},IsOnFloor(){return this._CheckIfStandingOnFloor()},IsByWall(b){return this._IsByWall(b)},IsJumping(){return this._IsJumping()},IsFalling(){return this._IsFalling()},IsDoubleJumpEnabled(){return this._IsDoubleJumpEnabled()},OnJump(){return!0},OnFall(){return!0},OnStop(){return!0},OnMove(){return!0},OnLand(){return!0},IsEnabled(){return this._IsEnabled()}}}"use strict";
{const c=self.C3;c.Behaviors.Platform.Acts={SetMaxSpeed(b){this._SetMaxSpeed(b)},SetAcceleration(b){this._SetAcceleration(b)},SetDeceleration(b){this._SetDeceleration(b)},SetJumpStrength(b){this._SetJumpStrength(b)},SetMaxFallSpeed(b){this._SetMaxFallSpeed(b)},SetGravity(b){this._SetGravity(b)},SimulateControl(b){this._SimulateControl(b)},SetIgnoreInput(b){this._SetIgnoreInput(!!b)},SetVectorX(b){this._SetVectorX(b)},SetVectorY(b){this._SetVectorY(b)},SetGravityAngle(b){this._SetGravityAngle(c.toRadians(b))},
SetEnabled(b){this._SetEnabled(0!==b)},FallThrough(){this._FallThroughJumpThru()},SetDoubleJumpEnabled(b){this._SetDoubleJumpEnabled(0!==b)},SetJumpSustain(b){this._SetJumpSustain(b/1E3)},SetCeilingCollision(b){this._SetCeilingCollisionMode(b)},SetDefaultControls(b){this._SetDefaultControls(b)},ResetDoubleJump(b){this._ResetDoubleJump(b)}}}"use strict";
{const c=self.C3;c.Behaviors.Platform.Exps={Speed(){return this._GetSpeed()},MaxSpeed(){return this._GetMaxSpeed()},Acceleration(){return this._GetAcceleration()},Deceleration(){return this._GetDeceleration()},JumpStrength(){return this._GetJumpStrength()},Gravity(){return this._GetGravity()},GravityAngle(){return c.toDegrees(this._GetGravityAngle())},MaxFallSpeed(){return this._GetMaxFallSpeed()},MovingAngle(){return c.toDegrees(this._GetMovingAngle())},VectorX(){return this._GetVectorX()},VectorY(){return this._GetVectorY()},
JumpSustain(){return 1E3*this._GetJumpSustain()}}}"use strict";{const c=self.C3;c.Behaviors.solid=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.solid.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=new Set;c.Behaviors.solid.Instance=class extends c.SDKBehaviorInstanceBase{constructor(a,f){super(a);this.SetEnabled(!0);f&amp;&amp;(this.SetEnabled(f[0]),this.SetTags(f[1]))}Release(){super.Release()}SetEnabled(a){this._inst._SetSolidEnabled(!!a)}IsEnabled(){return this._inst._IsSolidEnabled()}SetTags(a){const f=this._inst.GetSavedDataMap();if(a.trim()){var d=f.get("solidTags");d||(d=new Set,f.set("solidTags",d));d.clear();for(const e of a.split(" "))e&amp;&amp;d.add(e.toLowerCase())}else f.delete("solidTags")}GetTags(){return this._inst.GetSavedDataMap().get("solidTags")||
b}SaveToJson(){return{e:this.IsEnabled()}}LoadFromJson(a){this.SetEnabled(a.e)}GetPropertyValueByIndex(a){switch(a){case 0:return this.IsEnabled()}}SetPropertyValueByIndex(a,f){switch(a){case 0:this.SetEnabled(f)}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.solid.properties.enabled.name",value:this.IsEnabled(),onedit:a=&gt;this.SetEnabled(a)}]}]}}}"use strict";self.C3.Behaviors.solid.Cnds={IsEnabled(){return this.IsEnabled()}};"use strict";
self.C3.Behaviors.solid.Acts={SetEnabled(c){this.SetEnabled(c)},SetTags(c){this.SetTags(c)}};"use strict";self.C3.Behaviors.solid.Exps={};"use strict";{const c=self.C3;c.Behaviors.Anchor=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.Anchor.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Behaviors.Anchor.Instance=class extends c.SDKBehaviorInstanceBase{constructor(b,a){super(b);this._anchorTop=this._anchorLeft=2;this._anchorBottom=this._anchorRight=0;this._isEnabled=!0;b=this._inst.GetWorldInfo().GetBoundingBox();this._xLeft=b.getLeft();this._yTop=b.getTop();this._xRight=this._runtime.GetOriginalViewportWidth()-b.getLeft();this._yBottom=this._runtime.GetOriginalViewportHeight()-b.getTop();this._rDiff=this._runtime.GetOriginalViewportWidth()-b.getRight();this._bDiff=
this._runtime.GetOriginalViewportHeight()-b.getBottom();a&amp;&amp;(this._anchorLeft=a[0],this._anchorTop=a[1],this._anchorRight=a[2],this._anchorBottom=a[3],this._isEnabled=!!a[4]);this._isEnabled&amp;&amp;this._StartTicking()}Release(){super.Release()}SaveToJson(){return{xl:this._xLeft,yt:this._yTop,xr:this._xRight,yb:this._yBottom,rd:this._rDiff,bd:this._bDiff,al:this._anchorLeft,at:this._anchorTop,ar:this._anchorRight,ab:this._anchorBottom,e:this._isEnabled}}LoadFromJson(b){this._xLeft=b.xl;this._yTop=b.yt;this._xRight=
b.xr;this._yBottom=b.yb;this._rDiff=b.rd;this._bDiff=b.bd;this._anchorLeft=b.al;this._anchorTop=b.at;this._anchorRight=b.ar;this._anchorBottom=b.ab;(this._isEnabled=b.e)?this._StartTicking():this._StopTicking()}Tick(){if(this._isEnabled){var b=this._inst.GetWorldInfo(),a=b.GetLayer().GetViewport();if(0===this._anchorLeft){var f=a.getLeft()+this._xLeft-b.GetBoundingBox().getLeft();0!==f&amp;&amp;(b.OffsetX(f),b.SetBboxChanged())}else 1===this._anchorLeft&amp;&amp;(f=a.getRight()-this._xRight-b.GetBoundingBox().getLeft(),
0!==f&amp;&amp;(b.OffsetX(f),b.SetBboxChanged()));0===this._anchorTop?(f=a.getTop()+this._yTop-b.GetBoundingBox().getTop(),0!==f&amp;&amp;(b.OffsetY(f),b.SetBboxChanged())):1===this._anchorTop&amp;&amp;(f=a.getBottom()-this._yBottom-b.GetBoundingBox().getTop(),0!==f&amp;&amp;(b.OffsetY(f),b.SetBboxChanged()));1===this._anchorRight&amp;&amp;(f=a.getRight()-this._rDiff-b.GetBoundingBox().getRight(),0!==f&amp;&amp;(b.OffsetX(b.GetOriginX()*f),b.SetWidth(Math.max(b.GetWidth()+f),0),b.SetBboxChanged(),this._rDiff=a.getRight()-b.GetBoundingBox().getRight()));
1===this._anchorBottom&amp;&amp;(f=a.getBottom()-this._bDiff-b.GetBoundingBox().getBottom(),0!==f&amp;&amp;(b.OffsetY(b.GetOriginY()*f),b.SetHeight(Math.max(b.GetHeight()+f,0)),b.SetBboxChanged(),this._bDiff=a.getBottom()-b.GetBoundingBox().getBottom()))}}GetPropertyValueByIndex(b){switch(b){case 0:return this._anchorLeft;case 1:return this._anchorTop;case 2:return this._anchorRight;case 3:return this._anchorBottom;case 4:return this._isEnabled}}SetPropertyValueByIndex(b,a){switch(b){case 0:this._anchorLeft=a;break;
case 1:this._anchorTop=a;break;case 2:this._anchorRight=a;break;case 3:this._anchorBottom=a;break;case 4:(this._isEnabled=!!a)?this._StartTicking():this._StopTicking()}}}}"use strict";self.C3.Behaviors.Anchor.Cnds={IsEnabled(){return this._isEnabled}};"use strict";
self.C3.Behaviors.Anchor.Acts={SetEnabled(c){this._isEnabled&amp;&amp;0===c?(this._isEnabled=!1,this._StopTicking()):this._isEnabled||0===c||(c=this._inst.GetWorldInfo().GetBoundingBox(),this._xLeft=c.getLeft(),this._yTop=c.getTop(),this._xRight=this._runtime.GetOriginalViewportWidth()-c.getLeft(),this._yBottom=this._runtime.GetOriginalViewportHeight()-c.getTop(),this._rDiff=this._runtime.GetOriginalViewportWidth()-c.getRight(),this._bDiff=this._runtime.GetOriginalViewportHeight()-c.getBottom(),this._isEnabled=
!0,this._StartTicking())}};"use strict";self.C3.Behaviors.Anchor.Exps={};"use strict";{const c=self.C3;c.Behaviors.Sin=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.Sin.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=2*Math.PI,a=Math.PI/2,f=3*Math.PI/2,d=[0,1,8,3,4,2,5,6,9,7];c.Behaviors.Sin.Instance=class extends c.SDKBehaviorInstanceBase{constructor(e,g){super(e);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;g&amp;&amp;(this._movement=d[g[0]],this._wave=
g[1],this._periodRandom=this._runtime.Random()*g[3],this._basePeriod=g[2],this._period=g[2],this._period+=this._periodRandom,this._basePeriodOffset=g[4],0!==this._period&amp;&amp;(this._periodOffsetRandom=this._runtime.Random()*g[5],this._i=g[4]/this._period*b,this._i+=this._periodOffsetRandom/this._period*b),this._magnitudeRandom=this._runtime.Random()*g[7],this._baseMag=g[6],this._mag=g[6],this._mag+=this._magnitudeRandom,this._isEnabled=!!g[8]);5===this._movement&amp;&amp;(this._mag=c.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(e){this._i=e.i;this._SetEnabled(e.e);this._movement=e.mv;this._wave=e.w;this._period=e.p;this._mag=e.mag;this._initialValue=e.iv;this._initialValue2=e.iv2;this._ratio=e.r;this._lastKnownValue=e.lkv;this._lastKnownValue2=
e.lkv2}Init(){const e=this._inst.GetWorldInfo();switch(this._movement){case 0:this._initialValue=e.GetX();break;case 1:this._initialValue=e.GetY();break;case 2:this._initialValue=e.GetWidth();this._ratio=e.GetHeight()/e.GetWidth();break;case 3:this._initialValue=e.GetWidth();break;case 4:this._initialValue=e.GetHeight();break;case 5:this._initialValue=e.GetAngle();break;case 6:this._initialValue=e.GetOpacity();break;case 7:this._initialValue=0;break;case 8:this._initialValue=e.GetX();this._initialValue2=
e.GetY();break;case 9:this._initialValue=e.GetZElevation()}this._lastKnownValue=this._initialValue;this._lastKnownValue2=this._initialValue2}WaveFunc(e){e%=b;switch(this._wave){case 0:return Math.sin(e);case 1:return e&lt;=a?e/a:e&lt;=f?1-2*(e-a)/Math.PI:(e-f)/a-1;case 2:return 2*e/b-1;case 3:return-2*e/b+1;case 4:return e&lt;Math.PI?-1:1}return 0}Tick(){const e=this._runtime.GetDt(this._inst);this._isEnabled&amp;&amp;0!==e&amp;&amp;(this._i=0===this._period?0:(this._i+e/this._period*b)%b,this._UpdateFromPhase())}_UpdateFromPhase(){const e=
this._inst.GetWorldInfo();switch(this._movement){case 0:e.GetX()!==this._lastKnownValue&amp;&amp;(this._initialValue+=e.GetX()-this._lastKnownValue);e.SetX(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=e.GetX();break;case 1:e.GetY()!==this._lastKnownValue&amp;&amp;(this._initialValue+=e.GetY()-this._lastKnownValue);e.SetY(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=e.GetY();break;case 2:e.SetWidth(this._initialValue+this.WaveFunc(this._i)*this._mag);e.SetHeight(e.GetWidth()*
this._ratio);break;case 3:e.SetWidth(this._initialValue+this.WaveFunc(this._i)*this._mag);break;case 4:e.SetHeight(this._initialValue+this.WaveFunc(this._i)*this._mag);break;case 5:e.GetAngle()!==this._lastKnownValue&amp;&amp;(this._initialValue=c.clampAngle(this._initialValue+(e.GetAngle()-this._lastKnownValue)));e.SetAngle(this._initialValue+this.WaveFunc(this._i)*this._mag);this._lastKnownValue=e.GetAngle();break;case 6:e.SetOpacity(this._initialValue+this.WaveFunc(this._i)*this._mag/100);break;case 8:e.GetX()!==
this._lastKnownValue&amp;&amp;(this._initialValue+=e.GetX()-this._lastKnownValue);e.GetY()!==this._lastKnownValue2&amp;&amp;(this._initialValue2+=e.GetY()-this._lastKnownValue2);e.SetX(this._initialValue+Math.cos(e.GetAngle())*this.WaveFunc(this._i)*this._mag);e.SetY(this._initialValue2+Math.sin(e.GetAngle())*this.WaveFunc(this._i)*this._mag);this._lastKnownValue=e.GetX();this._lastKnownValue2=e.GetY();break;case 9:e.SetZElevation(this._initialValue+this.WaveFunc(this._i)*this._mag)}e.SetBboxChanged()}_OnSpriteFrameChanged(e,
g){}_SetEnabled(e){(this._isEnabled=!!e)?this._StartTicking():this._StopTicking()}GetPropertyValueByIndex(e){switch(e){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(e,g){switch(e){case 0:this._movement=d[g];this.Init();break;case 1:this._wave=g;break;case 2:this._basePeriod=g;this._period=this._basePeriod+this._periodRandom;this._isEnabled||(0!==this._period?(this._i=this._basePeriodOffset/
this._period*b,this._i+=this._periodOffsetRandom/this._period*b):this._i=0);break;case 6:this._baseMag=g;this._mag=this._baseMag+this._magnitudeRandom;5===this._movement&amp;&amp;(this._mag=c.toRadians(this._mag));break;case 8:this._isEnabled=!!g}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.sin.properties.enabled.name",value:this._isEnabled,onedit:e=&gt;this._SetEnabled(e)},{name:"behaviors.sin.properties.period.name",value:this._period,onedit:e=&gt;this._period=
e},{name:"behaviors.sin.properties.magnitude.name",value:this._mag,onedit:e=&gt;this._mag=e},{name:"behaviors.sin.debugger.value",value:this.WaveFunc(this._i)*this._mag}]}]}}}"use strict";
{const c=self.C3;c.Behaviors.Sin.Cnds={IsEnabled(){return this._isEnabled},CompareMovement(b){return this._movement===b},ComparePeriod(b,a){return c.compare(this._period,b,a)},CompareMagnitude(b,a){return 5===this._movement?c.compare(this._mag,b,c.toRadians(a)):c.compare(this._mag,b,a)},CompareWave(b){return this._wave===b}}}"use strict";
{const c=self.C3;c.Behaviors.Sin.Acts={SetEnabled(b){this._SetEnabled(0!==b)},SetPeriod(b){this._period=b},SetMagnitude(b){this._mag=b;5===this._movement&amp;&amp;(this._mag=c.toRadians(this._mag))},SetMovement(b){5===this._movement&amp;&amp;5!==b&amp;&amp;(this._mag=c.toDegrees(this._mag));this._movement=b;this.Init()},SetWave(b){this._wave=b},SetPhase(b){const a=2*Math.PI;this._i=b*a%a;this._UpdateFromPhase()},UpdateInitialState(){this.Init()}}}"use strict";
{const c=self.C3;c.Behaviors.Sin.Exps={CyclePosition(){return this._i/(2*Math.PI)},Period(){return this._period},Magnitude(){return 5===this._movement?c.toDegrees(this._mag):this._mag},Value(){return this.WaveFunc(this._i)*this._mag}}}"use strict";{const c=self.C3;c.Behaviors.Fade=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.Fade.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Behaviors.Fade.Instance=class extends c.SDKBehaviorInstanceBase{constructor(b,a){super(b);this._fadeOutTime=this._waitTime=this._fadeInTime=0;this._activeAtStart=this._destroy=!0;this._setMaxOpacity=!1;this._stage=0;this._stageTime=c.New(c.KahanSum);this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1;a&amp;&amp;(this._fadeInTime=a[0],this._waitTime=a[1],this._fadeOutTime=a[2],this._destroy=!!a[3],this._stage=(this._activeAtStart=!!a[4])?0:3);this._activeAtStart&amp;&amp;(0===this._fadeInTime?
(this._stage=1,0===this._waitTime&amp;&amp;(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender()));this._StartTicking()}Release(){super.Release()}SaveToJson(){return{fit:this._fadeInTime,wt:this._waitTime,fot:this._fadeOutTime,d:this._destroy,s:this._stage,st:this._stageTime.Get(),mo:this._maxOpacity}}LoadFromJson(b){this._fadeInTime=b.fit;this._waitTime=b.wt;this._fadeOutTime=b.fot;this._destroy=b.d;this._stage=b.s;this._stageTime.Set(b.st);this._maxOpacity=b.mo}Tick(){var b=
this._runtime.GetDt(this._inst);this._stageTime.Add(b);b=this._inst.GetWorldInfo();0===this._stage&amp;&amp;(b.SetOpacity(this._stageTime.Get()/this._fadeInTime*this._maxOpacity),this._runtime.UpdateRender(),b.GetOpacity()&gt;=this._maxOpacity&amp;&amp;(b.SetOpacity(this._maxOpacity),this._stage=1,this._stageTime.Reset(),this.Trigger(c.Behaviors.Fade.Cnds.OnFadeInEnd)));1===this._stage&amp;&amp;this._stageTime.Get()&gt;=this._waitTime&amp;&amp;(this._stage=2,this._stageTime.Reset(),this.Trigger(c.Behaviors.Fade.Cnds.OnWaitEnd));2===this._stage&amp;&amp;
0!==this._fadeOutTime&amp;&amp;(b.SetOpacity(this._maxOpacity-this._stageTime.Get()/this._fadeOutTime*this._maxOpacity),this._runtime.UpdateRender(),0&gt;=b.GetOpacity()&amp;&amp;(this._stage=3,this._stageTime.Reset(),this.Trigger(c.Behaviors.Fade.Cnds.OnFadeOutEnd),this._destroy&amp;&amp;this._runtime.DestroyInstance(this._inst)))}Start(){this._stage=0;this._stageTime.Reset();0===this._fadeInTime?(this._stage=1,0===this._waitTime&amp;&amp;(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender())}GetPropertyValueByIndex(b){switch(b){case 0:return this._fadeInTime;
case 1:return this._waitTime;case 2:return this._fadeOutTime;case 3:return this._destroy}}SetPropertyValueByIndex(b,a){switch(b){case 0:this._fadeInTime=a;break;case 1:this._waitTime=a;break;case 2:this._fadeOutTime=a;break;case 3:this._destroy=!!a}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.fade.properties.fade-in-time.name",value:this._fadeInTime,onedit:b=&gt;this._fadeInTime=b},{name:"behaviors.fade.properties.wait-time.name",value:this._waitTime,
onedit:b=&gt;this._waitTime=b},{name:"behaviors.fade.properties.fade-out-time.name",value:this._fadeOutTime,onedit:b=&gt;this._fadeOutTime=b},{name:"behaviors.fade.debugger.stage",value:["behaviors.fade.debugger."+["fade-in","wait","fade-out","done"][this._stage]]}]}]}}}"use strict";self.C3.Behaviors.Fade.Cnds={OnFadeOutEnd(){return!0},OnFadeInEnd(){return!0},OnWaitEnd(){return!0}};"use strict";
self.C3.Behaviors.Fade.Acts={StartFade(){this._activeAtStart||this._setMaxOpacity||(this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1,this._setMaxOpacity=!0);3===this._stage&amp;&amp;this.Start()},RestartFade(){this.Start()},SetFadeInTime(c){0&gt;c&amp;&amp;(c=0);this._fadeInTime=c},SetWaitTime(c){0&gt;c&amp;&amp;(c=0);this._waitTime=c},SetFadeOutTime(c){0&gt;c&amp;&amp;(c=0);this._fadeOutTime=c}};"use strict";self.C3.Behaviors.Fade.Exps={FadeInTime(){return this._fadeInTime},WaitTime(){return this._waitTime},FadeOutTime(){return this._fadeOutTime}};
"use strict";{const c=self.C3;c.Behaviors.scrollto=class extends c.SDKBehaviorBase{constructor(b){super(b);this._shakeMode=this._shakeEnd=this._shakeStart=this._shakeMag=0}Release(){super.Release()}SetShakeMagnitude(b){this._shakeMag=b}GetShakeMagnitude(){return this._shakeMag}SetShakeStart(b){this._shakeStart=b}GetShakeStart(){return this._shakeStart}SetShakeEnd(b){this._shakeEnd=b}GetShakeEnd(){return this._shakeEnd}SetShakeMode(b){this._shakeMode=b}GetShakeMode(){return this._shakeMode}}}"use strict";
{const c=self.C3;c.Behaviors.scrollto.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Behaviors.scrollto.Instance=class extends c.SDKBehaviorInstanceBase{constructor(b,a){super(b);this._isEnabled=!0;a&amp;&amp;(this._isEnabled=a[0]);this._isEnabled&amp;&amp;this._StartTicking2()}Release(){super.Release()}SaveToJson(){const b=this.GetBehavior();return{e:this._isEnabled,smg:b.GetShakeMagnitude(),ss:b.GetShakeStart(),se:b.GetShakeEnd(),smd:b.GetShakeMode()}}LoadFromJson(b){const a=this.GetBehavior();a.SetShakeMagnitude(b.smg);a.SetShakeStart(b.ss);a.SetShakeEnd(b.se);a.SetShakeMode(b.smd);
(this._isEnabled=b.e)?this._StartTicking2():this._StopTicking2()}IsEnabled(){return this._isEnabled}Tick2(){if(this.IsEnabled()){this._runtime.GetDt(this._inst);var b=this.GetBehavior(),a=b.GetInstances(),f=0,d=0,e=0;for(var g of a)(a=g.GetBehaviorInstanceFromCtor(c.Behaviors.scrollto))&amp;&amp;a.GetSdkInstance().IsEnabled()&amp;&amp;(a=g.GetWorldInfo(),f+=a.GetX(),d+=a.GetY(),++e);g=this._inst.GetWorldInfo().GetLayout();var h=this._runtime.GetGameTime(),l=a=0;h&gt;=b.GetShakeStart()&amp;&amp;h&lt;b.GetShakeEnd()&amp;&amp;(a=b.GetShakeMagnitude()*
Math.min(this._runtime.GetTimeScale(),1),0===b.GetShakeMode()&amp;&amp;(a*=1-(h-b.GetShakeStart())/(b.GetShakeEnd()-b.GetShakeStart())),b=this._runtime.Random()*Math.PI*2,h=this._runtime.Random()*a,a=Math.cos(b)*h,l=Math.sin(b)*h);g.SetScrollX(f/e+a);g.SetScrollY(d/e+l)}}GetPropertyValueByIndex(b){switch(b){case 0:return this._isEnabled}}SetPropertyValueByIndex(b,a){switch(b){case 0:(this._isEnabled=!!a)?this._StartTicking2():this._StopTicking2()}}}}"use strict";self.C3.Behaviors.scrollto.Cnds={IsEnabled(){return this._isEnabled}};
"use strict";self.C3.Behaviors.scrollto.Acts={Shake(c,b,a){const f=this.GetBehavior();f.SetShakeMagnitude(c);f.SetShakeStart(this._runtime.GetGameTime());f.SetShakeEnd(this._runtime.GetGameTime()+b);f.SetShakeMode(a)},SetEnabled(c){(this._isEnabled=0!==c)?this._StartTicking2():this._StopTicking2()}};"use strict";self.C3.Behaviors.scrollto.Exps={};"use strict";{const c=self.C3;c.Behaviors.Bullet=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";
{const c=self.C3;c.Behaviors.Bullet.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3,b=self.IBehaviorInstance;c.Behaviors.Bullet.Instance=class extends c.SDKBehaviorInstanceBase{constructor(f,d){super(f);f=this.GetWorldInfo();this._g=this._acc=this._speed=0;this._isStepping=this._setAngle=this._bounceOffSolid=!1;this._isEnabled=!0;this._dy=this._dx=0;this._lastX=f.GetX();this._lastY=f.GetY();this._lastKnownAngle=f.GetAngle();this._travelled=0;this._stepSize=Math.min(Math.abs(f.GetWidth()),Math.abs(f.GetHeight())/2);this._stopStepping=!1;d&amp;&amp;(this._speed=d[0],this._acc=
d[1],this._g=d[2],this._bounceOffSolid=!!d[3],this._setAngle=!!d[4],this._isStepping=!!d[5],this._isEnabled=!!d[6]);d=f.GetAngle();this._dx=Math.cos(d)*this._speed;this._dy=Math.sin(d)*this._speed;this._isEnabled&amp;&amp;(this._StartTicking(),this._bounceOffSolid&amp;&amp;this._StartPostTicking())}Release(){super.Release()}SaveToJson(){const f={dx:this._dx,dy:this._dy,lx:this._lastX,ly:this._lastY,lka:this._lastKnownAngle,t:this._travelled};0!==this._acc&amp;&amp;(f.acc=this._acc);0!==this._g&amp;&amp;(f.g=this._g);this._isStepping&amp;&amp;
(f.st=this._isStepping);this._isEnabled||(f.e=this._isEnabled);this._bounceOffSolid&amp;&amp;(f.bos=this._bounceOffSolid);this._setAngle&amp;&amp;(f.sa=this._setAngle);return f}LoadFromJson(f){this._dx=f.dx;this._dy=f.dy;this._lastX=f.lx;this._lastY=f.ly;this._lastKnownAngle=f.lka;this._travelled=f.t;this._acc=f.hasOwnProperty("acc")?f.acc:0;this._g=f.hasOwnProperty("g")?f.g:0;this._isStepping=f.hasOwnProperty("st")?f.st:!1;this._bounceOffSolid=f.hasOwnProperty("bos")?f.bos:!1;this._setAngle=f.hasOwnProperty("sa")?
f.sa:!1;this._SetEnabled(f.hasOwnProperty("e")?f.e:!0)}Tick(){if(this._isEnabled){var f=this._runtime.GetDt(this._inst),d=this._inst.GetWorldInfo();if(d.GetAngle()!==this._lastKnownAngle){var e=d.GetAngle();if(this._setAngle){var g=c.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(e)*g;this._dy=Math.sin(e)*g}this._lastKnownAngle=e}e=g=0;if(0!==this._acc){let h=c.distanceTo(0,0,this._dx,this._dy),l;l=0===this._dx&amp;&amp;0===this._dy?d.GetAngle():c.angleTo(0,0,this._dx,this._dy);h+=this._acc*f;g=Math.cos(l)*
this._acc;e=Math.sin(l)*this._acc;0&gt;h&amp;&amp;(e=g=h=0);this._dx=Math.cos(l)*h;this._dy=Math.sin(l)*h}0!==this._g&amp;&amp;(this._dy+=this._g*f,e+=this._g);this._lastX=d.GetX();this._lastY=d.GetY();if(0!==this._dx||0!==this._dy)g=this._dx*f+.5*g*f*f,f=this._dy*f+.5*e*f*f,e=c.distanceTo(0,0,g,f),this._MoveBy(g,f,e),this._travelled+=e,!this._setAngle||0===g&amp;&amp;0===f||(f=c.angleTo(0,0,g,f),d.SetAngle(f),this._lastKnownAngle=d.GetAngle()),d.SetBboxChanged()}}_MoveBy(f,d,e){const g=this.GetWorldInfo();if(!this._isStepping||
e&lt;=this._stepSize)g.OffsetXY(f,d),g.SetBboxChanged(),this._isStepping&amp;&amp;this.Trigger(c.Behaviors.Bullet.Cnds.OnStep);else{this._stopStepping=!1;var h=g.GetX(),l=g.GetY(),m=h+f,n=l+d;d=c.angleTo(0,0,f,d);f=Math.cos(d)*this._stepSize;d=Math.sin(d)*this._stepSize;e=Math.floor(e/this._stepSize);for(let r=1;r&lt;=e;++r)if(g.SetXY(h+f*r,l+d*r),g.SetBboxChanged(),this.Trigger(c.Behaviors.Bullet.Cnds.OnStep),this._inst.IsDestroyed()||this._stopStepping)return;g.SetXY(m,n);g.SetBboxChanged();this.Trigger(c.Behaviors.Bullet.Cnds.OnStep)}}PostTick(){if(this._isEnabled&amp;&amp;
this._bounceOffSolid&amp;&amp;(0!==this._dx||0!==this._dy)){var f=this._runtime.GetDt(this._inst),d=this._inst.GetWorldInfo(),e=this._runtime.GetCollisionEngine(),g=e.TestOverlapSolid(this._inst);if(g){e.RegisterCollision(this._inst,g);g=c.distanceTo(0,0,this._dx,this._dy);const h=e.CalculateBounceAngle(this._inst,this._lastX,this._lastY);this._dx=Math.cos(h)*g;this._dy=Math.sin(h)*g;d.OffsetXY(this._dx*f,this._dy*f);d.SetBboxChanged();this._setAngle&amp;&amp;(d.SetAngle(h),this._lastKnownAngle=d.GetAngle(),d.SetBboxChanged());
e.PushOutSolid(this._inst,this._dx/g,this._dy/g,Math.max(2.5*g*f,30))||e.PushOutSolidNearest(this._inst,100)}}}GetPropertyValueByIndex(f){switch(f){case 0:return this._GetSpeed();case 1:return this._GetAcceleration();case 2:return this._GetGravity();case 4:return this._setAngle;case 5:return this._isStepping;case 6:return this._IsEnabled()}}SetPropertyValueByIndex(f,d){switch(f){case 0:this._SetSpeed(d);break;case 1:this._acc=d;break;case 2:this._g=d;break;case 4:this._setAngle=!!d;break;case 5:this._isStepping=
!!d;break;case 6:this._SetEnabled(!!d)}}_SetSpeed(f){const d=c.angleTo(0,0,this._dx,this._dy);this._dx=Math.cos(d)*f;this._dy=Math.sin(d)*f}_GetSpeed(){return c.round6dp(c.distanceTo(0,0,this._dx,this._dy))}_SetAcceleration(f){this._acc=f}_GetAcceleration(){return this._acc}_SetGravity(f){this._g=f}_GetGravity(){return this._g}_SetAngleOfMotion(f){const d=c.distanceTo(0,0,this._dx,this._dy);this._dx=Math.cos(f)*d;this._dy=Math.sin(f)*d}_GetAngleOfMotion(){return c.angleTo(0,0,this._dx,this._dy)}_SetBounceOffSolids(f){f=
!!f;this._bounceOffSolid!==f&amp;&amp;(this._bounceOffSolid=f,this._isEnabled&amp;&amp;(this._bounceOffSolid?this._StartPostTicking():this._StopPostTicking()))}_IsBounceOffSolids(){return this._bounceOffSolid}_SetDistanceTravelled(f){this._travelled=f}_GetDistanceTravelled(){return this._travelled}_SetEnabled(f){(this._isEnabled=!!f)?(this._StartTicking(),this._bounceOffSolid&amp;&amp;this._StartPostTicking()):(this._StopTicking(),this._StopPostTicking())}_IsEnabled(){return this._isEnabled}GetDebuggerProperties(){return[{title:"$"+
this.GetBehaviorType().GetName(),properties:[{name:"behaviors.bullet.debugger.vector-x",value:this._dx,onedit:f=&gt;this._dx=f},{name:"behaviors.bullet.debugger.vector-y",value:this._dy,onedit:f=&gt;this._dy=f},{name:"behaviors.bullet.properties.speed.name",value:this._GetSpeed(),onedit:f=&gt;this._SetSpeed(f)},{name:"behaviors.bullet.debugger.angle-of-motion",value:c.toDegrees(this._GetAngleOfMotion())},{name:"behaviors.bullet.properties.gravity.name",value:this._GetGravity(),onedit:f=&gt;this._SetGravity(f)},
{name:"behaviors.bullet.properties.acceleration.name",value:this._GetAcceleration(),onedit:f=&gt;this._SetAcceleration(f)},{name:"behaviors.bullet.debugger.distance-travelled",value:this._GetDistanceTravelled()},{name:"behaviors.bullet.properties.enabled.name",value:this._IsEnabled(),onedit:f=&gt;this._SetEnabled(f)}]}]}GetScriptInterfaceClass(){return self.IBulletBehaviorInstance}};const a=new WeakMap;self.IBulletBehaviorInstance=class extends b{constructor(){super();a.set(this,b._GetInitInst().GetSdkInstance())}get speed(){return a.get(this)._GetSpeed()}set speed(f){a.get(this)._SetSpeed(f)}get acceleration(){return a.get(this)._GetAcceleration()}set acceleration(f){a.get(this)._SetAcceleration(f)}get gravity(){return a.get(this)._GetGravity()}set gravity(f){a.get(this)._SetGravity(f)}get angleOfMotion(){return a.get(this)._GetAngleOfMotion()}set angleOfMotion(f){a.get(this)._SetAngleOfMotion(f)}get bounceOffSolids(){return a.get(this)._IsBounceOffSolids()}set bounceOffSolids(f){a.get(this)._SetBounceOffSolids(!!f)}get distanceTravelled(){return a.get(this)._GetDistanceTravelled()}set distanceTravelled(f){a.get(this)._SetDistanceTravelled(f)}get isEnabled(){return a.get(this)._IsEnabled()}set isEnabled(f){a.get(this)._SetEnabled(f)}}}"use strict";
{const c=self.C3;c.Behaviors.Bullet.Cnds={CompareSpeed(b,a){return c.compare(Math.sqrt(this._dx*this._dx+this._dy*this._dy),b,a)},CompareTravelled(b,a){return c.compare(this._GetDistanceTravelled(),b,a)},OnStep(){return!0},IsEnabled(){return this._IsEnabled()}}}"use strict";
{const c=self.C3;c.Behaviors.Bullet.Acts={SetSpeed(b){this._SetSpeed(b)},SetAcceleration(b){this._SetAcceleration(b)},SetGravity(b){this._SetGravity(b)},SetAngleOfMotion(b){this._SetAngleOfMotion(c.toRadians(b))},Bounce(b){if(b&amp;&amp;(b=b.GetFirstPicked(this._inst))){var a=this._inst.GetWorldInfo(),f=this._runtime.GetCollisionEngine(),d=this._runtime.GetDt(this._inst),e=c.distanceTo(0,0,this._dx,this._dy),g=f.CalculateBounceAngle(this._inst,this._lastX,this._lastY,b);this._dx=Math.cos(g)*e;this._dy=Math.sin(g)*
e;a.OffsetXY(this._dx*d,this._dy*d);a.SetBboxChanged();this._setAngle&amp;&amp;(a.SetAngle(g),this._lastKnownAngle=a.GetAngle(),a.SetBboxChanged());0!==e&amp;&amp;(this._bounceOffSolid?f.PushOutSolid(this._inst,this._dx/e,this._dy/e,Math.max(2.5*e*d,30))||f.PushOutSolidNearest(this._inst,100):f.PushOut(this._inst,this._dx/e,this._dy/e,Math.max(2.5*e*d,30),b))}},SetBounceOffSolids(b){this._SetBounceOffSolids(b)},SetDistanceTravelled(b){this._SetDistanceTravelled(b)},SetEnabled(b){this._SetEnabled(b)},StopStepping(){this._stopStepping=
!0}}}"use strict";{const c=self.C3;c.Behaviors.Bullet.Exps={Speed(){return this._GetSpeed()},Acceleration(){return this._GetAcceleration()},AngleOfMotion(){return c.toDegrees(this._GetAngleOfMotion())},DistanceTravelled(){return this._GetDistanceTravelled()},Gravity(){return this._GetGravity()}}}"use strict";
var easeOutBounceArray=[],easeInElasticArray=[],easeOutElasticArray=[],easeInOutElasticArray=[],easeInCircle=[],easeOutCircle=[],easeInOutCircle=[],easeInBack=[],easeOutBack=[],easeInOutBack=[],litetween_precision=1E4,updateLimit=0;function easeOutBouncefunc(c){return result=(c/=1)&lt;1/2.75?7.5625*c*c:c&lt;2/2.75?7.5625*(c-=1.5/2.75)*c+.75:c&lt;2.5/2.75?7.5625*(c-=2.25/2.75)*c+.9375:7.5625*(c-=2.625/2.75)*c+.984375}
function do_cmp(c,b,a){if("undefined"===typeof c||"undefined"===typeof a)return!1;switch(b){case 0:return c===a;case 1:return c!==a;case 2:return c&lt;a;case 3:return c&lt;=a;case 4:return c&gt;a;case 5:return c&gt;=a;default:return!1}}function integerize(c,b){return Math.round(c/b*litetween_precision)}
function easeFunc(c,b,a,f,d,e,g){var h=0;switch(c){case 0:h=f*b/d+a;break;case 1:h=f*(b/=d)*b+a;break;case 2:h=-f*(b/=d)*(b-2)+a;break;case 3:h=1&gt;(b/=d/2)?f/2*b*b+a:-f/2*(--b*(b-2)-1)+a;break;case 4:h=f*(b/=d)*b*b+a;break;case 5:h=f*((b=b/d-1)*b*b+1)+a;break;case 6:h=1&gt;(b/=d/2)?f/2*b*b*b+a:f/2*((b-=2)*b*b+2)+a;break;case 7:h=f*(b/=d)*b*b*b+a;break;case 8:h=-f*((b=b/d-1)*b*b*b-1)+a;break;case 9:h=1&gt;(b/=d/2)?f/2*b*b*b*b+a:-f/2*((b-=2)*b*b*b-2)+a;break;case 10:h=f*(b/=d)*b*b*b*b+a;break;case 11:h=f*
((b=b/d-1)*b*b*b*b+1)+a;break;case 12:h=1&gt;(b/=d/2)?f/2*b*b*b*b*b+a:f/2*((b-=2)*b*b*b*b+2)+a;break;case 13:h=g.optimized?easeInCircle[integerize(b,d)]:-(Math.sqrt(1-b*b)-1);break;case 14:h=g.optimized?easeOutCircle[integerize(b,d)]:Math.sqrt(1-(b-1)*(b-1));break;case 15:h=g.optimized?easeInOutCircle[integerize(b,d)]:1&gt;(b/=d/2)?-f/2*(Math.sqrt(1-b*b)-1)+a:f/2*(Math.sqrt(1-(b-=2)*b)+1)+a;break;case 16:g.optimized?h=easeInBack[integerize(b,d)]:(g=g.s,h=f*(b/=d)*b*((g+1)*b-g)+a);break;case 17:g.optimized?
h=easeOutBack[integerize(b,d)]:(g=g.s,h=f*((b=b/d-1)*b*((g+1)*b+g)+1)+a);break;case 18:g.optimized?h=easeInOutBack[integerize(b,d)]:(g=g.s,h=1&gt;(b/=d/2)?f/2*b*b*(((g*=1.525)+1)*b-g)+a:f/2*((b-=2)*b*(((g*=1.525)+1)*b+g)+2)+a);break;case 19:g.optimized?h=easeInElasticArray[integerize(b,d)]:(h=g.a,c=g.p,b/=d,0==c&amp;&amp;(c=.3*d),0==h||h&lt;Math.abs(f)?(h=f,g=c/4):g=c/(2*Math.PI)*Math.asin(f/h),h=-(h*Math.pow(2,10*--b)*Math.sin(2*(b*d-g)*Math.PI/c))+a);break;case 20:g.optimized?h=easeOutElasticArray[integerize(b,
d)]:(h=g.a,c=g.p,b/=d,0==c&amp;&amp;(c=.3*d),0==h||h&lt;Math.abs(f)?(h=f,g=c/4):g=c/(2*Math.PI)*Math.asin(f/h),h=h*Math.pow(2,-10*b)*Math.sin(2*(b*d-g)*Math.PI/c)+f+a);break;case 21:g.optimized?h=easeInOutElasticArray[integerize(b,d)]:(h=g.a,c=g.p,b/=d/2,0==c&amp;&amp;(c=.3*d*1.5),0==h||h&lt;Math.abs(f)?(h=f,g=c/4):g=c/(2*Math.PI)*Math.asin(f/h),h=1&gt;b?-.5*h*Math.pow(2,10*--b)*Math.sin(2*(b*d-g)*Math.PI/c)+a:h*Math.pow(2,-10*--b)*Math.sin(2*(b*d-g)*Math.PI/c)*.5+f+a);break;case 22:h=g.optimized?f-easeOutBounceArray[integerize(d-
b,d)]+a:f-easeOutBouncefunc(d-b/d)+a;break;case 23:h=g.optimized?easeOutBounceArray[integerize(b,d)]:easeOutBouncefunc(b/d);break;case 24:h=g.optimized?b&lt;d/2?.5*(f-easeOutBounceArray[integerize(d-2*b,d)]+a)+a:.5*easeOutBounceArray[integerize(2*b-d,d)]+.5*f+a:b&lt;d/2?.5*(f-easeOutBouncefunc(d-2*b)+a)+a:.5*easeOutBouncefunc((2*b-d)/d)+.5*f+a;break;case 25:b=b/d/2;h=2*b*b*(3-2*b);break;case 26:b=(b/d+1)/2;h=2*b*b*(3-2*b)-1;break;case 27:b/=d,h=b*b*(3-2*b)}return e?f-a-h:h}
(function(){for(var c,b,a,f,d=0;d&lt;=litetween_precision;d++)a=d/litetween_precision,c=(a/=1)&lt;1/2.75?7.5625*a*a:a&lt;2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a&lt;2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375,easeOutBounceArray[d]=c,a=d/litetween_precision,b=c=0,a/=1,0==b&amp;&amp;(b=.3),0==c||1&gt;c?(c=1,f=b/4):f=b/(2*Math.PI)*Math.asin(1/c),c=-(c*Math.pow(2,10*--a)*Math.sin(2*(1*a-f)*Math.PI/b)),easeInElasticArray[d]=c,a=d/litetween_precision,b=c=0,a/=1,0==b&amp;&amp;(b=.3),0==c||1&gt;c?(c=1,f=b/4):f=b/(2*
Math.PI)*Math.asin(1/c),c=c*Math.pow(2,-10*a)*Math.sin(2*(1*a-f)*Math.PI/b)+1,easeOutElasticArray[d]=c,a=d/litetween_precision,b=c=0,a/=.5,0==b&amp;&amp;(b=.3*1.5),0==c||1&gt;c?(c=1,f=b/4):f=b/(2*Math.PI)*Math.asin(1/c),c=1&gt;a?-.5*c*Math.pow(2,10*--a)*Math.sin(2*(1*a-f)*Math.PI/b):c*Math.pow(2,-10*--a)*Math.sin(2*(1*a-f)*Math.PI/b)*.5+1,easeInOutElasticArray[d]=c,a=d/litetween_precision,easeInCircle[d]=-(Math.sqrt(1-a*a)-1),a=d/litetween_precision,easeOutCircle[d]=Math.sqrt(1-(a-1)*(a-1)),a=d/litetween_precision,
c=1&gt;(a/=.5)?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1),easeInOutCircle[d]=c,a=d/litetween_precision,f=0,0==f&amp;&amp;(f=1.70158),c=(a/=1)*a*((f+1)*a-f),easeInBack[d]=c,a=d/litetween_precision,f=0,0==f&amp;&amp;(f=1.70158),c=(a=a/1-1)*a*((f+1)*a+f)+1,easeOutBack[d]=c,a=d/litetween_precision,f=0,0==f&amp;&amp;(f=1.70158),c=1&gt;(a/=.5)?.5*a*a*(((f*=1.525)+1)*a-f):.5*((a-=2)*a*(((f*=1.525)+1)*a+f)+2),easeInOutBack[d]=c})();
var TweenObject=function(){return function(c,b,a,f,d,e,g){this.name=c;this.value=0;this.setInitial(f);this.setTarget(d);this.easefunc=a;this.tweened=b;this.duration=e;this.state=this.progress=0;this.onReverseEnd=this.onReverseStart=this.onEnd=this.onStart=!1;this.lastKnownValue2=this.lastKnownValue=0;this.enforce=g;this.pingpong=1;this.flipEase=!1;this.easingparam=[];this.lastState=1;for(c=0;28&gt;c;c++)this.easingparam[c]={},this.easingparam[c].a=0,this.easingparam[c].p=0,this.easingparam[c].t=0,this.easingparam[c].s=
0,this.easingparam[c].optimized=!0}}();
(function(){TweenObject.prototype={};TweenObject.prototype.flipTarget=function(){var c=this.initialparam1,b=this.initialparam2;this.initialparam1=this.targetparam1;this.initialparam2=this.targetparam2;this.targetparam1=c;this.targetparam2=b;this.lastKnownValue2=this.lastKnownValue=0};TweenObject.prototype.setInitial=function(c){this.initialparam1=parseFloat(c.split(",")[0]);this.initialparam2=parseFloat(c.split(",")[1]);this.lastKnownValue2=this.lastKnownValue=0};TweenObject.prototype.setTarget=function(c){this.targetparam1=
parseFloat(c.split(",")[0]);this.targetparam2=parseFloat(c.split(",")[1]);isNaN(this.targetparam2)&amp;&amp;(this.targetparam2=this.targetparam1)};TweenObject.prototype.OnTick=function(c){if(0===this.state)return-1;1===this.state&amp;&amp;(this.progress+=c);2===this.state&amp;&amp;(this.progress-=c);3===this.state&amp;&amp;(this.state=0);if(4===this.state||6===this.state)this.progress+=c*this.pingpong;5===this.state&amp;&amp;(this.progress+=c*this.pingpong);return 0&gt;this.progress?(this.progress=0,4===this.state?this.pingpong=1:6===this.state?
(this.pingpong=1,this.flipEase=!1):this.state=0,this.onReverseEnd=!0,0):this.progress&gt;this.duration?(this.progress=this.duration,4===this.state?this.pingpong=-1:6===this.state?(this.pingpong=-1,this.flipEase=!0):5===this.state?this.progress=0:this.state=0,this.onEnd=!0,1):this.flipEase?easeFunc(this.easefunc,this.duration-this.progress,0,1,this.duration,this.flipEase,this.easingparam[this.easefunc]):easeFunc(this.easefunc,this.progress,0,1,this.duration,this.flipEase,this.easingparam[this.easefunc])}})();
function trim(c){return c.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}TweenObject.Load=function(c,b,a,f,d,e,g,h){b=new TweenObject(b,a,f,d,e,g,h);for(var l in c)b[l]=c[l];return b};C3.Behaviors.lunarray_LiteTween=class extends C3.SDKBehaviorBase{constructor(c){super(c)}Release(){super.Release()}};"use strict";C3.Behaviors.lunarray_LiteTween.Type=class extends C3.SDKBehaviorTypeBase{constructor(c){super(c)}Release(){super.Release()}OnCreate(){}};"use strict";
C3.Behaviors.lunarray_LiteTween.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(c,b){super(c);this.i=0;this.inst=this._inst.GetWorldInfo();b&amp;&amp;(this.playmode=b[0],this.active=1==this.playmode||2==this.playmode||3==this.playmode||4==this.playmode,this.tweened=b[1],this.easing=b[2],this.target=b[3],this.targetmode=b[4],this.useCurrent=!1,1===this.targetmode&amp;&amp;(this.target="relative("+this.target+")"),this.duration=b[5],this.enforce=1===b[6],this.value=0,this.tween_list={},this.addToTweenList("default",
this.tweened,this.easing,"current",this.target,this.duration,this.enforce),1===b[0]&amp;&amp;this.startTween(0),2===b[0]&amp;&amp;this.startTween(2),3===b[0]&amp;&amp;this.startTween(3),4===b[0]&amp;&amp;this.startTween(4));this._StartTicking()}Release(){super.Release()}SaveToJson(){JSON.stringify(this.tween_list["default"]);return{playmode:this.playmode,active:this.active,tweened:this.tweened,easing:this.easing,target:this.target,targetmode:this.targetmode,useCurrent:this.useCurrent,duration:this.duration,enforce:this.enforce,
value:this.value,tweenlist:JSON.stringify(this.tween_list["default"])}}LoadFromJson(c){var b=JSON.parse(c.tweenlist);b=TweenObject.Load(b,b.name,b.tweened,b.easefunc,b.initialparam1+","+b.initialparam2,b.targetparam1+","+b.targetparam2,b.duration,b.enforce);this.tween_list["default"]=b;this.playmode=c.playmode;this.active=c.active;this.movement=c.tweened;this.easing=c.easing;this.target=c.target;this.targetmode=c.targetmode;this.useCurrent=c.useCurrent;this.duration=c.duration;this.enforce=c.enforce;
this.value=c.value}parseCurrent(c,b){void 0===b&amp;&amp;(b="current");var a=trim(b);b=trim(b);var f=this.value;if("current"===b)switch(c){case 0:a=this.inst.GetX()+","+this.inst.GetY();break;case 1:a=this.inst.GetWidth()+","+this.inst.GetHeight();break;case 2:a=this.inst.GetWidth()+","+this.inst.GetHeight();break;case 3:a=this.inst.GetWidth()+","+this.inst.GetHeight();break;case 4:a=C3.toDegrees(this.inst.GetAngle())+","+C3.toDegrees(this.inst.GetAngle());break;case 5:a=100*this.inst.GetOpacity()+","+100*
this.inst.GetOpacity();break;case 6:a=f+","+f;break;case 7:a=this.inst.GetX()+","+this.inst.GetY();break;case 8:a=this.inst.GetX()+","+this.inst.GetY();break;case 9:a="1,1"}if("relative"===b.substring(0,8)){if(b=b.match(/\((.*?)\)/))var d=parseFloat(b[1].split(",")[0]),e=parseFloat(b[1].split(",")[1]);isNaN(d)&amp;&amp;(d=0);isNaN(e)&amp;&amp;(e=0);switch(c){case 0:a=this.inst.GetX()+d+","+(this.inst.GetY()+e);break;case 1:a=this.inst.GetWidth()+d+","+(this.inst.GetHeight()+e);break;case 2:a=this.inst.GetWidth()+
d+","+(this.inst.GetHeight()+e);break;case 3:a=this.inst.GetWidth()+d+","+(this.inst.GetHeight()+e);break;case 4:a=C3.toDegrees(this.inst.GetAngle())+d+","+(C3.toDegrees(this.inst.GetAngle())+e);break;case 5:a=100*this.inst.GetOpacity()+d+","+(100*this.inst.GetOpacity()+e);break;case 6:a=f+d+","+f+d;break;case 7:a=this.inst.GetX()+d+","+this.inst.GetY();break;case 8:a=this.inst.GetX()+","+(this.inst.GetY()+d);break;case 9:a=d+","+e}}return a}addToTweenList(c,b,a,f,d,e,g){f=this.parseCurrent(b,f);
d=this.parseCurrent(b,d);void 0!==this.tween_list[c]&amp;&amp;delete this.tween_list[c];this.tween_list[c]=new TweenObject(c,b,a,f,d,e,g);this.tween_list[c].dt=0}setProgressTo(c){1&lt;c&amp;&amp;(c=1);0&gt;c&amp;&amp;(c=0);for(var b in this.tween_list){var a=this.tween_list[b];a.lastKnownValue=0;a.lastKnownValue2=0;a.state=3;a.progress=c*a.duration;var f=a.OnTick(0);this.updateTween(a,f)}}startTween(c){for(var b in this.tween_list){var a=this.tween_list[b];if(this.useCurrent){var f=this.parseCurrent(a.tweened,"current"),d=this.parseCurrent(a.tweened,
this.target);a.setInitial(f);a.setTarget(d)}0===c&amp;&amp;(a.progress=.000001,a.lastKnownValue=0,a.lastKnownValue2=0,a.onStart=!0,a.state=1);1===c&amp;&amp;(a.state=a.lastState);if(2===c||4===c)a.progress=.000001,a.lastKnownValue=0,a.lastKnownValue2=0,a.onStart=!0,2==c&amp;&amp;(a.state=4),4==c&amp;&amp;(a.state=6);3===c&amp;&amp;(a.progress=.000001,a.lastKnownValue=0,a.lastKnownValue2=0,a.onStart=!0,a.state=5)}}stopTween(c){for(var b in this.tween_list){var a=this.tween_list[b];3!=a.state&amp;&amp;0!=a.state&amp;&amp;(a.lastState=a.state);1===c&amp;&amp;(a.progress=
0);2===c&amp;&amp;(a.progress=a.duration);a.state=3;var f=a.OnTick(0);this.updateTween(a,f)}}reverseTween(c){for(var b in this.tween_list){var a=this.tween_list[b];1===c&amp;&amp;(a.progress=a.duration,a.lastKnownValue=0,a.lastKnownValue2=0,a.onReverseStart=!0);a.state=2}}updateTween(c,b){if(0===c.tweened)c.enforce?(this.inst.SetX(c.initialparam1+(c.targetparam1-c.initialparam1)*b),this.inst.SetY(c.initialparam2+(c.targetparam2-c.initialparam2)*b)):(this.inst.SetX(this.inst.GetX()+(c.targetparam1-c.initialparam1)*
b-c.lastKnownValue),this.inst.SetY(this.inst.GetY()+(c.targetparam2-c.initialparam2)*b-c.lastKnownValue2),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b,c.lastKnownValue2=(c.targetparam2-c.initialparam2)*b);else if(1===c.tweened)c.enforce?(this.inst.SetWidth(c.initialparam1+(c.targetparam1-c.initialparam1)*b),this.inst.SetHeight(c.initialparam2+(c.targetparam2-c.initialparam2)*b)):(this.inst.SetWidth(this.inst.GetWidth()+(c.targetparam1-c.initialparam1)*b-c.lastKnownValue),this.inst.SetHeight(this.inst.GetHeight()+
(c.targetparam2-c.initialparam2)*b-c.lastKnownValue2),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b,c.lastKnownValue2=(c.targetparam2-c.initialparam2)*b);else if(2===c.tweened)c.enforce?this.inst.SetWidth(c.initialparam1+(c.targetparam1-c.initialparam1)*b):(this.inst.SetWidth(this.inst.GetWidth()+(c.targetparam1-c.initialparam1)*b-c.lastKnownValue),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b);else if(3===c.tweened)c.enforce?this.inst.SetHeight(c.initialparam2+(c.targetparam2-c.initialparam2)*
b):(this.inst.SetHeight(this.inst.GetHeight()+(c.targetparam2-c.initialparam2)*b-c.lastKnownValue2),c.lastKnownValue2=(c.targetparam2-c.initialparam2)*b);else if(4===c.tweened)if(c.enforce){var a=c.initialparam1+(c.targetparam1-c.initialparam1)*b;this.inst.SetAngle(C3.clampAngle(C3.toRadians(a)))}else a=(c.targetparam1-c.initialparam1)*b-c.lastKnownValue,this.inst.SetAngle(C3.clampAngle(this.inst.angle+C3.toRadians(a))),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b;else if(5===c.tweened)c.enforce?
this.inst.SetOpacity((c.initialparam1+(c.targetparam1-c.initialparam1)*b)/100):(this.inst.SetOpacity(this.inst.GetOpacity()+((c.targetparam1-c.initialparam1)*b-c.lastKnownValue)/100),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b);else if(6===c.tweened)c.enforce?this.value=c.initialparam1+(c.targetparam1-c.initialparam1)*b:(this.value+=(c.targetparam1-c.initialparam1)*b-c.lastKnownValue,c.lastKnownValue=(c.targetparam1-c.initialparam1)*b);else if(7===c.tweened)c.enforce?this.inst.SetX(c.initialparam1+
(c.targetparam1-c.initialparam1)*b):(this.inst.SetX(this.inst.GetX()+(c.targetparam1-c.initialparam1)*b-c.lastKnownValue),c.lastKnownValue=(c.targetparam1-c.initialparam1)*b);else if(8===c.tweened)c.enforce?this.inst.SetY(c.initialparam2+(c.targetparam2-c.initialparam2)*b):(this.inst.SetY(this.inst.GetY()+(c.targetparam2-c.initialparam2)*b-c.lastKnownValue2),c.lastKnownValue2=(c.targetparam2-c.initialparam2)*b);else if(9===c.tweened){a=c.initialparam1+(c.targetparam1-c.initialparam1)*b;var f=c.initialparam2+
(c.targetparam2-c.initialparam2)*b;0&gt;this.inst.GetWidth()&amp;&amp;(a=c.initialparam1+(c.targetparam1+c.initialparam1)*-b);0&gt;this.inst.GetHeight()&amp;&amp;(f=c.initialparam2+(c.targetparam2+c.initialparam2)*-b);c.enforce?(this.inst.SetWidth(this._inst.GetWorldInfo().GetInstance().GetCurrentImageInfo().GetWidth()*a),this.inst.SetHeight(this._inst.GetWorldInfo().GetInstance().GetCurrentImageInfo().GetHeight()*f)):(0&gt;this.inst.GetWidth()?(this.inst.SetWidth(a*(this.inst.GetWidth()/(-1+c.lastKnownValue))),c.lastKnownValue=
a+1):(this.inst.SetWidth(a*(this.inst.GetWidth()/(1+c.lastKnownValue))),c.lastKnownValue=a-1),0&gt;this.inst.GetHeight()?(this.inst.SetHeight(f*(this.inst.GetHeight()/(-1+c.lastKnownValue2))),c.lastKnownValue2=f+1):(this.inst.SetHeight(f*(this.inst.GetHeight()/(1+c.lastKnownValue2))),c.lastKnownValue2=f-1))}this.inst.SetBboxChanged()}Tick(){var c=this._runtime.GetDt(this._inst);this._inst.GetWorldInfo();var b=this.tween_list["default"];0!==b.state&amp;&amp;(b.onStart&amp;&amp;(this.Trigger(C3.Behaviors.lunarray_LiteTween.Cnds.OnStart,
this.inst),b.onStart=!1),b.onReverseStart&amp;&amp;(this.Trigger(C3.Behaviors.lunarray_LiteTween.Cnds.OnReverseStart,this.inst),b.onReverseStart=!1),this.active=1==b.state||2==b.state||4==b.state||5==b.state||6==b.state,c=b.OnTick(c),this.updateTween(b,c),b.onEnd&amp;&amp;(this.Trigger(C3.Behaviors.lunarray_LiteTween.Cnds.OnEnd,this.inst),b.onEnd=!1),b.onReverseEnd&amp;&amp;(this.Trigger(C3.Behaviors.lunarray_LiteTween.Cnds.OnReverseEnd,this.inst),b.onReverseEnd=!1))}};"use strict";
C3.Behaviors.lunarray_LiteTween.Cnds={IsActive(){return 0!==this.tween_list["default"].state},IsReversing(){return 2==this.tween_list["default"].state},CompareProgress(c,b){var a=this.tween_list["default"];return do_cmp(a.progress/a.duration,c,b)},OnThreshold(c,b){var a=this.tween_list["default"];this.threshold=do_cmp(a.progress/a.duration,c,b);if(c=this.oldthreshold!=this.threshold&amp;&amp;this.threshold)this.oldthreshold=this.threshold;return c},OnStart(){return void 0===this.tween_list["default"]?!1:
this.tween_list["default"].onStart},OnReverseStart(){return void 0===this.tween_list["default"]?!1:this.tween_list["default"].onReverseStart},OnEnd(){return void 0===this.tween_list["default"]?!1:this.tween_list["default"].onEnd},OnReverseEnd(){return void 0===this.tween_list["default"]?!1:this.tween_list["default"].onReverseEnd}};"use strict";
C3.Behaviors.lunarray_LiteTween.Acts={Start(c,b){this.oldthreshold=this.threshold=!1;this.useCurrent=1==b;this.startTween(c)},Stop(c){this.stopTween(c)},Reverse(c){this.oldthreshold=this.threshold=!1;this.reverseTween(c)},ProgressTo(c){this.setProgressTo(c)},SetDuration(c){isNaN(c)||0&gt;c||void 0===this.tween_list["default"]||(this.tween_list["default"].duration=c)},SetEnforce(c){void 0!==this.tween_list["default"]&amp;&amp;(this.tween_list["default"].enforce=1===c)},SetInitial(c){void 0!==this.tween_list["default"]&amp;&amp;
(c=this.parseCurrent(this.tween_list["default"].tweened,c),this.tween_list["default"].setInitial(c))},SetTarget(c,b,a){if(void 0!==this.tween_list["default"]&amp;&amp;!isNaN(a)){var f=this.tween_list["default"],d=a+"";this.targetmode=b;var e="",g="";if(1===b){this.target="relative("+d+")";switch(c){case 0:e=this.inst.GetX()+a;g=f.targetparam2;break;case 1:e=f.targetparam1;g=this.inst.GetY()+a;break;case 2:g=e=""+C3.toDegrees(this.inst.GetAngle()+C3.toRadians(a));break;case 3:g=e=""+100*this.inst.GetOpacity()+
a;break;case 4:e=this.inst.GetWidth()+a;g=f.targetparam2;break;case 5:e=f.targetparam1;g=this.inst.GetHeight()+a;break;case 6:g=e=a}d=e+","+g}else{switch(c){case 0:e=a;g=f.targetparam2;break;case 1:e=f.targetparam1;g=a;break;case 2:g=e=a;break;case 3:g=e=a;break;case 4:e=a;g=f.targetparam2;break;case 5:e=f.targetparam1;g=a;break;case 6:g=e=a}this.target=d=e+","+g}c=this.parseCurrent(this.tween_list["default"].tweened,"current");d=this.parseCurrent(this.tween_list["default"].tweened,d);f.setInitial(c);
f.setTarget(d)}},SetTweenedProperty(c){void 0!==this.tween_list["default"]&amp;&amp;(this.tween_list["default"].tweened=c)},SetEasing(c){void 0!==this.tween_list["default"]&amp;&amp;(this.tween_list["default"].easefunc=c)},SetEasingParam(c,b,a,f,d){void 0!==this.tween_list["default"]&amp;&amp;(this.tween_list["default"].easingparam[c].optimized=!1,this.tween_list["default"].easingparam[c].a=b,this.tween_list["default"].easingparam[c].p=a,this.tween_list["default"].easingparam[c].t=f,this.tween_list["default"].easingparam[c].s=
d)},ResetEasingParam(){void 0!==this.tween_list["default"]&amp;&amp;(this.tween_list["default"].optimized=!0)},SetValue(c){var b=this.tween_list["default"];this.value=c;6===b.tweened&amp;&amp;b.setInitial(this.parseCurrent(b.tweened,"current"))},SetParameter(c,b,a,f,d){if(void 0===this.tween_list["default"])this.addToTweenList("default",c,b,initial,a,f,d,0);else{var e=this.tween_list["default"];e.tweened=c;e.easefunc=b;e.setInitial(this.parseCurrent(c,"current"));e.setTarget(this.parseCurrent(c,a));e.duration=f;
e.enforce=1===d}}};"use strict";
C3.Behaviors.lunarray_LiteTween.Exps={State(){var c="N/A";switch(this.tween_list["default"].state){case 0:c="paused";break;case 1:c="playing";break;case 2:c="reversing";break;case 3:c="seeking"}return c},Progress(){return this.tween_list["default"].progress/this.tween_list["default"].duration},Duration(){return this.tween_list["default"].duration},Target(){var c=this.tween_list["default"],b="N/A";switch(c.tweened){case 0:b=c.targetparam1;break;case 1:b=c.targetparam2;break;case 2:b=c.targetparam1;
break;case 3:b=c.targetparam1;break;case 4:b=c.targetparam1;break;case 5:b=c.targetparam2;break;case 6:b=c.targetparam1}return b},Value(){return this.value},Tween(c,b,a,f){a=1&lt;a?1:a;f=easeFunc(f,0&gt;a?0:a,0,1,1,!1,!1);return c+f*(b-c)}};"use strict";{const c=self.C3;c.Behaviors.Pin=class extends c.SDKBehaviorBase{constructor(b){super(b)}Release(){super.Release()}}}"use strict";{const c=self.C3;c.Behaviors.Pin.Type=class extends c.SDKBehaviorTypeBase{constructor(b){super(b)}Release(){super.Release()}OnCreate(){}}}"use strict";
{const c=self.C3;c.Behaviors.Pin.Instance=class extends c.SDKBehaviorInstanceBase{constructor(b,a){super(b);this._pinInst=null;this._pinUid=-1;this._mode="";this._propSet=new Set;this._lastKnownAngle=this._dz=this._dAngle=this._dHeight=this._dWidth=this._dy=this._dx=this._pinImagePoint=this._pinAngle=this._pinDist=0;this._destroy=!1;a&amp;&amp;(this._destroy=a[0]);b=this._runtime.Dispatcher();this._disposables=new c.CompositeDisposable(c.Disposable.From(b,"instancedestroy",f=&gt;this._OnInstanceDestroyed(f.instance)),
c.Disposable.From(b,"afterload",f=&gt;this._OnAfterLoad()))}Release(){this._pinInst=null;super.Release()}_SetPinInst(b){b?(this._pinInst=b,this._StartTicking2()):(this._pinInst=null,this._StopTicking2())}_Pin(b,a,f){if(b&amp;&amp;(b=b.GetFirstPicked(this._inst)))if(this._mode=a,this._SetPinInst(b),a=this._inst.GetWorldInfo(),b=b.GetWorldInfo(),"properties"===this._mode){const d=this._propSet;d.clear();for(const e of f)d.add(e);this._dx=a.GetX()-b.GetX();this._dy=a.GetY()-b.GetY();this._dAngle=a.GetAngle()-b.GetAngle();
this._lastKnownAngle=a.GetAngle();this._dz=a.GetZElevation()-b.GetZElevation();d.has("x")&amp;&amp;d.has("y")&amp;&amp;(this._pinAngle=c.angleTo(b.GetX(),b.GetY(),a.GetX(),a.GetY())-b.GetAngle(),this._pinDist=c.distanceTo(b.GetX(),b.GetY(),a.GetX(),a.GetY()));d.has("width-abs")?this._dWidth=a.GetWidth()-b.GetWidth():d.has("width-scale")&amp;&amp;(this._dWidth=a.GetWidth()/b.GetWidth());d.has("height-abs")?this._dHeight=a.GetHeight()-b.GetHeight():d.has("height-scale")&amp;&amp;(this._dHeight=a.GetHeight()/b.GetHeight())}else this._pinDist=
c.distanceTo(b.GetX(),b.GetY(),a.GetX(),a.GetY())}SaveToJson(){const b=this._propSet,a=this._mode,f={uid:this._pinInst?this._pinInst.GetUID():-1,m:a};if("rope"===a||"bar"===a)f.pd=this._pinDist;else if("properties"===a){f.ps=[...this._propSet];b.has("imagepoint")?f.ip=this._pinImagePoint:b.has("x")&amp;&amp;b.has("y")?(f.pa=this._pinAngle,f.pd=this._pinDist):(b.has("x")&amp;&amp;(f.dx=this._dx),b.has("y")&amp;&amp;(f.dy=this._dy));b.has("angle")&amp;&amp;(f.da=this._dAngle,f.lka=this._lastKnownAngle);if(b.has("width-abs")||b.has("width-scale"))f.dw=
this._dWidth;if(b.has("height-abs")||b.has("height-scale"))f.dh=this._dHeight;b.has("z")&amp;&amp;(f.dz=this._dz)}return f}LoadFromJson(b){const a=b.m,f=this._propSet;f.clear();this._pinUid=b.uid;if("number"===typeof a)this._LoadFromJson_Legacy(b);else if(this._mode=a,"rope"===a||"bar"===a)this._pinDist=b.pd;else if("properties"===a){for(const d of b.ps)f.add(d);f.has("imagepoint")?this._pinImagePoint=b.ip:f.has("x")&amp;&amp;f.has("y")?(this._pinAngle=b.pa,this._pinDist=b.pd):(f.has("x")&amp;&amp;(this._dx=b.dx),f.has("y")&amp;&amp;
(this._dy=b.dy));f.has("angle")&amp;&amp;(this._dAngle=b.da,this._lastKnownAngle=b.lka||0);if(f.has("width-abs")||f.has("width-scale"))this._dWidth=b.dw;if(f.has("height-abs")||f.has("height-scale"))this._dHeight=b.dh;f.has("z")&amp;&amp;(this._dz=b.dz)}}_LoadFromJson_Legacy(b){const a=this._propSet,f=b.msa,d=b.tsa,e=b.pa,g=b.pd;switch(b.m){case 0:this._mode="properties";a.add("x").add("y").add("angle");this._pinAngle=e;this._pinDist=g;this._dAngle=f-d;this._lastKnownAngle=b.lka;break;case 1:this._mode="properties";
a.add("x").add("y");this._pinAngle=e;this._pinDist=g;break;case 2:this._mode="properties";a.add("angle");this._dAngle=f-d;this._lastKnownAngle=b.lka;break;case 3:this._mode="rope";this._pinDist=b.pd;break;case 4:this._mode="bar",this._pinDist=b.pd}}_OnAfterLoad(){-1===this._pinUid?this._SetPinInst(null):(this._SetPinInst(this._runtime.GetInstanceByUID(this._pinUid)),this._pinUid=-1)}_OnInstanceDestroyed(b){this._pinInst===b&amp;&amp;(this._SetPinInst(null),this._destroy&amp;&amp;this._runtime.DestroyInstance(this._inst))}Tick2(){var b=
this._pinInst;if(b){var a=b.GetWorldInfo(),f=this._inst.GetWorldInfo(),d=this._mode,e=!1;if("rope"===d||"bar"===d){if(b=c.distanceTo(f.GetX(),f.GetY(),a.GetX(),a.GetY()),b&gt;this._pinDist||"bar"===d&amp;&amp;b&lt;this._pinDist)e=c.angleTo(a.GetX(),a.GetY(),f.GetX(),f.GetY()),f.SetXY(a.GetX()+Math.cos(e)*this._pinDist,a.GetY()+Math.sin(e)*this._pinDist),e=!0}else{d=this._propSet;if(d.has("imagepoint")){const [g,h]=b.GetImagePoint(this._pinImagePoint);f.EqualsXY(g,h)||(f.SetXY(g,h),e=!0)}else if(d.has("x")&amp;&amp;d.has("y")){b=
a.GetX()+Math.cos(a.GetAngle()+this._pinAngle)*this._pinDist;const g=a.GetY()+Math.sin(a.GetAngle()+this._pinAngle)*this._pinDist;f.EqualsXY(b,g)||(f.SetXY(b,g),e=!0)}else b=a.GetX()+this._dx,d.has("x")&amp;&amp;b!==f.GetX()&amp;&amp;(f.SetX(b),e=!0),b=a.GetY()+this._dy,d.has("y")&amp;&amp;b!==f.GetY()&amp;&amp;(f.SetY(b),e=!0);d.has("angle")&amp;&amp;(this._lastKnownAngle!==f.GetAngle()&amp;&amp;(this._dAngle=c.clampAngle(this._dAngle+(f.GetAngle()-this._lastKnownAngle))),b=c.clampAngle(a.GetAngle()+this._dAngle),b!==f.GetAngle()&amp;&amp;(f.SetAngle(b),
e=!0),this._lastKnownAngle=f.GetAngle());d.has("width-abs")&amp;&amp;(b=a.GetWidth()+this._dWidth,b!==f.GetWidth()&amp;&amp;(f.SetWidth(b),e=!0));d.has("width-scale")&amp;&amp;(b=a.GetWidth()*this._dWidth,b!==f.GetWidth()&amp;&amp;(f.SetWidth(b),e=!0));d.has("height-abs")&amp;&amp;(b=a.GetHeight()+this._dHeight,b!==f.GetHeight()&amp;&amp;(f.SetHeight(b),e=!0));d.has("height-scale")&amp;&amp;(b=a.GetHeight()*this._dHeight,b!==f.GetHeight()&amp;&amp;(f.SetHeight(b),e=!0));d.has("z")&amp;&amp;(b=a.GetZElevation()+this._dz,b!==f.GetZElevation()&amp;&amp;(f.SetZElevation(b),this._runtime.UpdateRender()))}e&amp;&amp;
f.SetBboxChanged()}}GetDebuggerProperties(){return[{title:"$"+this.GetBehaviorType().GetName(),properties:[{name:"behaviors.pin.debugger.is-pinned",value:!!this._pinInst},{name:"behaviors.pin.debugger.pinned-uid",value:this._pinInst?this._pinInst.GetUID():0}]}]}}}"use strict";self.C3.Behaviors.Pin.Cnds={IsPinned(){return!!this._pinInst},WillDestroy(){return this._destroy}};"use strict";
self.C3.Behaviors.Pin.Acts={PinByDistance(c,b){this._Pin(c,0===b?"rope":"bar")},PinByProperties(c,b,a,f,d,e,g){const h=[];b&amp;&amp;h.push("x");a&amp;&amp;h.push("y");f&amp;&amp;h.push("angle");g&amp;&amp;h.push("z");1===d?h.push("width-abs"):2===d&amp;&amp;h.push("width-scale");1===e?h.push("height-abs"):2===e&amp;&amp;h.push("height-scale");0!==h.length&amp;&amp;this._Pin(c,"properties",h)},PinByImagePoint(c,b,a,f,d,e){const g=["imagepoint"];a&amp;&amp;g.push("angle");e&amp;&amp;g.push("z");1===f?g.push("width-abs"):2===f&amp;&amp;g.push("width-scale");1===d?g.push("height-abs"):
2===d&amp;&amp;g.push("height-scale");this._pinImagePoint=b;this._Pin(c,"properties",g)},SetPinDistance(c){if("rope"===this._mode||"bar"===this._mode)this._pinDist=Math.max(c,0)},SetDestroy(c){this._destroy=c},Unpin(){this._SetPinInst(null);this._mode="";this._propSet.clear();this._pinImagePoint=""},Pin(c,b){switch(b){case 0:this._Pin(c,"properties",["x","y","angle"]);break;case 1:this._Pin(c,"properties",["x","y"]);break;case 2:this._Pin(c,"properties",["angle"]);break;case 3:this._Pin(c,"rope");break;case 4:this._Pin(c,
"bar")}}};"use strict";self.C3.Behaviors.Pin.Exps={PinnedUID(){return this._pinInst?this._pinInst.GetUID():-1}};"use strict";
{const c=self.C3;self.C3_GetObjectRefTable=function(){return[c.Plugins.PlatformInfo,c.Plugins.Share,c.Plugins.Eponesh_YandexSDK,c.Plugins.AJAX,c.Plugins.Arr,c.Plugins.Sprite,c.Behaviors.Platform,c.Behaviors.solid,c.Plugins.Touch,c.Plugins.Text,c.Behaviors.Anchor,c.Plugins.Tilemap,c.Behaviors.Sin,c.Behaviors.Fade,c.Behaviors.scrollto,c.Behaviors.Bullet,c.Plugins.Audio,c.Plugins.Browser,c.Plugins.TiledBg,c.Behaviors.lunarray_LiteTween,c.Plugins.Dictionary,c.Plugins.GameAnalytics,c.Behaviors.Pin,c.Plugins.NinePatch,
c.Plugins.System.Cnds.IsGroupActive,c.Plugins.Sprite.Cnds.IsOverlapping,c.Plugins.System.Acts.SetVar,c.Behaviors.Bullet.Acts.SetEnabled,c.Plugins.System.Cnds.CompareVar,c.Behaviors.Bullet.Acts.SetSpeed,c.Behaviors.Platform.Acts.SetMaxSpeed,c.Plugins.System.Cnds.OnLayoutStart,c.Plugins.Text.Acts.SetWebFont,c.Plugins.System.Cnds.Every,c.Plugins.System.Acts.CreateObject,c.Plugins.Sprite.Exps.X,c.Plugins.System.Exps.choose,c.Plugins.Sprite.Exps.Y,c.Plugins.Sprite.Acts.SetAnimFrame,c.Plugins.System.Acts.AddVar,
c.Plugins.System.Cnds.EveryTick,c.Plugins.Text.Acts.SetText,c.Plugins.Sprite.Acts.SetPos,c.Behaviors.Platform.Acts.SimulateControl,c.Plugins.Sprite.Cnds.IsOutsideLayout,c.Plugins.Sprite.Cnds.CompareX,c.Plugins.System.Exps.viewportleft,c.Plugins.Sprite.Exps.LayerName,c.Plugins.System.Cnds.TriggerOnce,c.Plugins.GameAnalytics.Acts.addDesignEventWithValue,c.Plugins.Audio.Acts.Play,c.Plugins.Sprite.Acts.SetCollisions,c.Behaviors.Platform.Acts.SetEnabled,c.Behaviors.scrollto.Acts.Shake,c.Plugins.Sprite.Acts.SetAnim,
c.Plugins.System.Acts.Wait,c.Plugins.Sprite.Acts.SetVisible,c.Plugins.Text.Acts.SetVisible,c.Plugins.Sprite.Acts.Destroy,c.Plugins.GameAnalytics.Acts.addDesignEvent,c.Plugins.System.Acts.RestartLayout,c.Plugins.Touch.Cnds.OnTouchObject,c.Plugins.System.Acts.SetTimescale,c.Plugins.System.Cnds.Else,c.Plugins.Touch.Cnds.OnTapGestureObject,c.Plugins.Sprite.Cnds.IsVisible,c.Plugins.System.Acts.ResetGlobals,c.Plugins.System.Acts.GoToLayout,c.Plugins.Touch.Cnds.OnTouchStart,c.Plugins.Touch.Cnds.IsTouchingObject,
c.Behaviors.Platform.Acts.SetGravity,c.Plugins.Sprite.Acts.SetFlipped,c.Behaviors.Platform.Cnds.IsOnFloor,c.Behaviors.Platform.Cnds.IsMoving,c.Plugins.Audio.Cnds.IsTagPlaying,c.Plugins.Dictionary.Cnds.CompareValue,c.Plugins.Browser.Acts.GoToURLWindow,c.Plugins.Dictionary.Exps.Get,c.Plugins.Browser.Acts.Close,c.Plugins.GameAnalytics.Acts.initialize,c.Plugins.System.Cnds.Compare,c.Plugins.System.Exps.viewportbottom,c.Plugins.System.Exps.canvastolayery,c.Plugins.Eponesh_YandexSDK.Acts.CreateStickyBanner,
c.Plugins.Share.Cnds.IsSupported,c.Plugins.Share.Acts.Share,c.Plugins.System.Exps.projectname,c.Plugins.Browser.Exps.URL,c.Plugins.Share.Cnds.OnShareCompleted,c.Plugins.Eponesh_YandexSDK.Cnds.IsBannerDisplaying,c.Plugins.Eponesh_YandexSDK.Acts.DestroyBanner,c.Plugins.NinePatch.Exps.Count,c.Plugins.Sprite.Acts.SetY,c.Plugins.Sprite.Exps.LayerNumber,c.Plugins.NinePatch.Exps.Height,c.Plugins.NinePatch.Acts.SetHeight,c.Plugins.Text.Acts.Destroy,c.Plugins.Sprite.Exps.AnimationFrame,c.Plugins.Sprite.Acts.LoadURL,
c.Plugins.Sprite.Cnds.OnURLLoaded,c.Plugins.Text.Cnds.CompareInstanceVar,c.Plugins.Text.Exps.Text,c.Plugins.PlatformInfo.Cnds.IsOniOS,c.Plugins.Browser.Acts.GoToURL,c.Behaviors.Pin.Acts.PinByProperties,c.Plugins.NinePatch.Acts.Destroy,c.Plugins.Arr.Cnds.IsEmpty,c.Plugins.AJAX.Acts.RequestFile,c.Plugins.AJAX.Cnds.OnComplete,c.Plugins.Arr.Acts.JSONLoad,c.Plugins.AJAX.Exps.LastData,c.Plugins.System.Acts.SetGroupActive,c.Plugins.System.Acts.SetLayerVisible,c.Plugins.NinePatch.Acts.SetVisible,c.Plugins.Eponesh_YandexSDK.Acts.ShowFullscreen,
c.Plugins.Arr.Cnds.CompareSize,c.Plugins.System.Cnds.ForEach,c.Plugins.System.Exps.random,c.Plugins.Arr.Exps.Height,c.Plugins.Sprite.Acts.SetInstanceVar,c.Plugins.Arr.Exps.At,c.Plugins.Arr.Acts.Delete,c.Plugins.Eponesh_YandexSDK.Acts.DisplayBanner,c.Plugins.System.Acts.SetLayerScale,c.Plugins.System.Exps.viewportwidth,c.Plugins.NinePatch.Exps.Width]};self.C3_JsPropNameTable=[{PlatformInfo:0},{Share:0},{YandexSDK:0},{AJAX:0},{mgArray:0},{Platform:0},{reallittletree:0},{Solid:0},{solid:0},{Touch:0},
{Anchor:0},{Text:0},{TilemM1:0},{LittleTree:0},{clouds:0},{mountains:0},{frame:0},{Sine:0},{Sine2:0},{Sine3:0},{Star:0},{Fade:0},{Star2:0},{BGtree:0},{BGtree1:0},{BGtree2:0},{BGtree4:0},{BGtree3:0},{BGtree5:0},{ScrollTo:0},{Bullet:0},{camera:0},{MoveOn:0},{slowdown:0},{death:0},{Audio:0},{BGMoon:0},{bgTrees:0},{BGCloud:0},{BGCloud2:0},{BGCloud3:0},{BGCloud4:0},{pause:0},{score:0},{Ball:0},{tryagain:0},{Text2:0},{question:0},{restart:0},{twitter:0},{backbutton:0},{facebook:0},{Browser:0},{teleport:0},
{TilemM2:0},{christmas:0},{gravity:0},{runner:0},{playbutton:0},{TiledBackground:0},{TiledBackground2:0},{LiteTween:0},{onduckLogo:0},{Dictionary:0},{sponsorBranding:0},{TiledBackground3:0},{GameAnalytics:0},{id:0},{Pin:0},{txt_crossgame:0},{shareTxt:0},{bgMoregames:0},{quadro:0},{img_url:0},{crossgame:0},{shareBtn:0},{texts:0},{speed:0},{condition:0},{moveon:0},{movestarts:0},{level:0},{RTBbanner:0},{best:0},{Counter:0},{index:0},{scale:0}]}"use strict";
{const c=self.C3;function b(a,f){return"string"===typeof a||"string"===typeof f?("number"===typeof a?(Math.round(1E10*a)/1E10).toString():a)+("number"===typeof f?(Math.round(1E10*f)/1E10).toString():f):a&amp;&amp;f?1:0}self.C3_ExpressionFuncs=[()=&gt;"Camera",()=&gt;1,()=&gt;0,()=&gt;60,()=&gt;100,a=&gt;{const f=a._GetNode(0).GetVar();return()=&gt;f.GetValue()},()=&gt;"Every Tick Events and start of layout",()=&gt;"press_start_2pregular",()=&gt;"stylesheet.css",()=&gt;.1,()=&gt;5,a=&gt;{const f=a._GetNode(0);return()=&gt;f.ExpObject()},a=&gt;{const f=
a._GetNode(0).GetBoundMethod(),d=a._GetNode(1),e=a._GetNode(2),g=a._GetNode(3),h=a._GetNode(4),l=a._GetNode(5),m=a._GetNode(6);return()=&gt;f(d.ExpObject()+6,e.ExpObject()+4,g.ExpObject()+2,h.ExpObject(),l.ExpObject()-2,m.ExpObject()-4)},a=&gt;{const f=a._GetNode(0).GetBoundMethod();return()=&gt;f(0,1,2,3,4)},()=&gt;2,a=&gt;{const f=a._GetNode(0);return()=&gt;f.ExpObject()-6},()=&gt;"Collision with objects",a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1);return()=&gt;f(d.ExpObject())},()=&gt;"gameover",()=&gt;10,()=&gt;
"effect",()=&gt;20,()=&gt;.4,()=&gt;"death",()=&gt;"",()=&gt;"final",()=&gt;"Tap gestures",()=&gt;85,()=&gt;"Playing with gravity",()=&gt;2E3,()=&gt;-2E3,a=&gt;{const f=a._GetNode(0);return()=&gt;f.ExpObject()+6},()=&gt;"Little Tree Animations",()=&gt;"run",()=&gt;"idle",()=&gt;"fall",()=&gt;"The result",()=&gt;30,()=&gt;"Music",()=&gt;"music",()=&gt;"brandLink",()=&gt;"s",a=&gt;{const f=a._GetNode(0);return()=&gt;f.ExpObject("url")},()=&gt;"NewWindow",a=&gt;{const f=a._GetNode(0).GetBoundMethod();return()=&gt;f(0)},a=&gt;{const f=a._GetNode(0).GetBoundMethod();return()=&gt;f(0,0,600)},
()=&gt;"R-A-477368-2",()=&gt;160,()=&gt;600,a=&gt;{const f=a._GetNode(0).GetVar(),d=a._GetNode(1).GetBoundMethod();return()=&gt;b("\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0448\u0435\u043b \u0443\u0440\u043e\u0432\u0435\u043d\u044c ",f.GetValue())+" i\u0432 "+d()+"! \u0418\u0434\u0438 \u043f\u043e\u0438\u0433\u0440\u0430\u0439 \u0441\u043e \u043c\u043d\u043e\u0439! \u041a\u0430\u043a \u0434\u0430\u043b\u0435\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0439\u0442\u0438?"},
a=&gt;{const f=a._GetNode(0).GetBoundMethod();return()=&gt;f()},a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1).GetVar(),e=a._GetNode(2).GetBoundMethod();return()=&gt;b("https://twitter.com/intent/tweet?url="+f()+"&amp;text=\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0448\u0435\u043b \u0443\u0440\u043e\u0432\u0435\u043d\u044c ",d.GetValue())+" i\u0432 "+e()+"! \u0418\u0434\u0438 \u043f\u043e\u0438\u0433\u0440\u0430\u0439 \u0441\u043e \u043c\u043d\u043e\u0439! \u041a\u0430\u043a \u0434\u0430\u043b\u0435\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0439\u0442\u0438?"},
()=&gt;"twitter",a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1).GetVar();return()=&gt;b("\u041c\u043e\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 "+f()+" - ",d.GetValue())+"!  \u041c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u043c\u0435\u043d\u044f?"},a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1).GetBoundMethod(),e=a._GetNode(2).GetVar();return()=&gt;b("https://twitter.com/intent/tweet?url="+
f()+"&amp;text=\u041c\u043e\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 "+d()+" - ",e.GetValue())+"! \u041c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u043c\u0435\u043d\u044f?"},()=&gt;"share",()=&gt;"More Games",()=&gt;"Cross Promotion",a=&gt;{const f=a._GetNode(0),d=a._GetNode(1).GetBoundMethod(),e=a._GetNode(2),g=a._GetNode(3);return()=&gt;c.lerp(f.ExpObject(),d(e.ExpObject())-g.ExpObject()/
4-10,.06)},a=&gt;{const f=a._GetNode(0),d=a._GetNode(1).GetBoundMethod(),e=a._GetNode(2),g=a._GetNode(3);return()=&gt;c.lerp(f.ExpObject(),d(e.ExpObject())-g.ExpObject()/2-10,.1)},()=&gt;326,a=&gt;{const f=a._GetNode(0);return()=&gt;f.ExpInstVar()},()=&gt;"crossgame",()=&gt;"games",()=&gt;"MoreGames",a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1);return()=&gt;f(d.ExpObject())+1E3},a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1);return()=&gt;Math.floor(f(d.ExpObject()))},a=&gt;{const f=a._GetNode(0),d=a._GetNode(1).GetVar();
return()=&gt;f.ExpObject(2,d.GetValue())},a=&gt;{const f=a._GetNode(0),d=a._GetNode(1).GetVar();return()=&gt;f.ExpObject(1,d.GetValue())},a=&gt;{const f=a._GetNode(0),d=a._GetNode(1).GetVar();return()=&gt;f.ExpObject(3,d.GetValue())},a=&gt;{const f=a._GetNode(0).GetBoundMethod(),d=a._GetNode(1);return()=&gt;f(0)/d.ExpObject()},()=&gt;"MoreGamesBG"]}"use strict";self.C3.ScriptsInEvents={};</pre></body></html>