phaser/plugins/spine4.1/dist/SpinePlugin.min.js

1272 lines
No EOL
539 KiB
JavaScript

window.SpinePlugin=function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=69)}([function(t,e){function i(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function s(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function n(t,e,n,r){for(var o in e)if(e.hasOwnProperty(o)){var h=i(e,o,n);if(!1!==h){if(s((r||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)n(t,e[i].prototype||e[i])}}function a(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var s=t.Extends;e=function(){s.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var a=null;return t.Mixins&&(a=t.Mixins,delete t.Mixins),r(e,a),n(e,t,!0,i),e}a.extend=n,a.mixin=r,a.ignoreFinals=!1,t.exports=a},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e){t.exports=function(){}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(35),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e){t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},function(t,e){t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4);t.exports=function(t){return t*s.RAD_TO_DEG}},function(t,e){t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,a=s,o=i,h=i,l=!0,c=!0,u=0;u<n.length;u++)r&&r.hasOwnProperty(n[u])?(o=r[n[u]],r=r[n[u]]):l=!1,a&&a.hasOwnProperty(n[u])?(h=a[n[u]],a=a[n[u]]):c=!1;return l?o:c?h:i}return i}},function(t,e){t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n<i;n++)t[n]=t[n+1];return t.length=i,s}}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(30),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,a=e.y,o=e.z;return this.x=s*o-n*a,this.y=n*r-i*o,this.z=i*a-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z;return this.x=i*a-s*r,this.y=s*n-e*a,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],a=e*n[1]+i*n[5]+s*n[9]+n[13],o=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],a=n[1],o=n[2],h=n[3],l=n[4],c=n[5],u=n[6],d=n[7],f=n[8],p=n[9],m=n[10],g=n[11],x=n[12],w=n[13],y=n[14],v=1/(e*h+i*d+s*g+n[15]);return this.x=(e*r+i*l+s*f+x)*v,this.y=(e*a+i*c+s*p+w)*v,this.z=(e*o+i*u+s*m+y)*v,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=this.x-i,o=r-this.y-1-s,h=this.z;return this.x=2*a/n-1,this.y=2*o/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(27),n=i(61);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s,n=i(28),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit/.test(s)&&n.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(7),n=function(){var t,e,i,r,a,o,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l<c;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(r=t[e])&&(u&&r&&(s(r)||(a=Array.isArray(r)))?(a?(a=!1,o=i&&Array.isArray(i)?i:[]):o=i&&s(i)?i:{},h[e]=n(u,o,r)):void 0!==r&&(h[e]=r));return h};t.exports=n},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4);t.exports=function(t){return t*s.DEG_TO_RAD}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(16),r=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new r(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,a,o,h,l,c,u,d,f,p,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=s,g[4]=n,g[5]=r,g[6]=a,g[7]=o,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=f,g[14]=p,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],x=e*a-i*r,w=e*o-s*r,y=e*h-n*r,v=i*o-s*a,b=i*h-n*a,A=s*h-n*o,M=l*p-c*f,S=l*m-u*f,I=l*g-d*f,k=c*m-u*p,T=c*g-d*p,E=u*g-d*m,C=x*E-w*T+y*k+v*I-b*S+A*M;return C?(C=1/C,this.setValues((a*E-o*T+h*k)*C,(s*T-i*E-n*k)*C,(p*A-m*b+g*v)*C,(u*b-c*A-d*v)*C,(o*I-r*E-h*S)*C,(e*E-s*I+n*S)*C,(m*y-f*A-g*w)*C,(l*A-u*y+d*w)*C,(r*T-a*I+h*M)*C,(i*I-e*T-n*M)*C,(f*b-p*y+g*x)*C,(c*y-l*b-d*x)*C,(a*S-r*k-o*M)*C,(e*k-i*S+s*M)*C,(p*w-f*v-m*x)*C,(l*v-c*w+u*x)*C)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return this.setValues(a*(u*g-d*m)-c*(o*g-h*m)+p*(o*d-h*u),-(i*(u*g-d*m)-c*(s*g-n*m)+p*(s*d-n*u)),i*(o*g-h*m)-a*(s*g-n*m)+p*(s*h-n*o),-(i*(o*d-h*u)-a*(s*d-n*u)+c*(s*h-n*o)),-(r*(u*g-d*m)-l*(o*g-h*m)+f*(o*d-h*u)),e*(u*g-d*m)-l*(s*g-n*m)+f*(s*d-n*u),-(e*(o*g-h*m)-r*(s*g-n*m)+f*(s*h-n*o)),e*(o*d-h*u)-r*(s*d-n*u)+l*(s*h-n*o),r*(c*g-d*p)-l*(a*g-h*p)+f*(a*d-h*c),-(e*(c*g-d*p)-l*(i*g-n*p)+f*(i*d-n*c)),e*(a*g-h*p)-r*(i*g-n*p)+f*(i*h-n*a),-(e*(a*d-h*c)-r*(i*d-n*c)+l*(i*h-n*a)),-(r*(c*m-u*p)-l*(a*m-o*p)+f*(a*u-o*c)),e*(c*m-u*p)-l*(i*m-s*p)+f*(i*u-s*c),-(e*(a*m-o*p)-r*(i*m-s*p)+f*(i*o-s*a)),e*(a*u-o*c)-r*(i*u-s*c)+l*(i*o-s*a))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-i*r)*(u*g-d*m)-(e*o-s*r)*(c*g-d*p)+(e*h-n*r)*(c*m-u*p)+(i*o-s*a)*(l*g-d*f)-(i*h-n*a)*(l*m-u*f)+(s*h-n*o)*(l*p-c*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],x=e[15],w=t.val,y=w[0],v=w[1],b=w[2],A=w[3];return e[0]=y*i+v*a+b*c+A*p,e[1]=y*s+v*o+b*u+A*m,e[2]=y*n+v*h+b*d+A*g,e[3]=y*r+v*l+b*f+A*x,y=w[4],v=w[5],b=w[6],A=w[7],e[4]=y*i+v*a+b*c+A*p,e[5]=y*s+v*o+b*u+A*m,e[6]=y*n+v*h+b*d+A*g,e[7]=y*r+v*l+b*f+A*x,y=w[8],v=w[9],b=w[10],A=w[11],e[8]=y*i+v*a+b*c+A*p,e[9]=y*s+v*o+b*u+A*m,e[10]=y*n+v*h+b*d+A*g,e[11]=y*r+v*l+b*f+A*x,y=w[12],v=w[13],b=w[14],A=w[15],e[12]=y*i+v*a+b*c+A*p,e[13]=y*s+v*o+b*u+A*m,e[14]=y*n+v*h+b*d+A*g,e[15]=y*r+v*l+b*f+A*x,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],a=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],f=i[6],p=i[10],m=i[14],g=i[3],x=i[7],w=i[11],y=i[15],v=s[0],b=s[4],A=s[8],M=s[12],S=s[1],I=s[5],k=s[9],T=s[13],E=s[2],C=s[6],R=s[10],F=s[14],Y=s[3],X=s[7],P=s[11],L=s[15];return this.setValues(n*v+r*S+a*E+o*Y,h*v+l*S+c*E+u*Y,d*v+f*S+p*E+m*Y,g*v+x*S+w*E+y*Y,n*b+r*I+a*C+o*X,h*b+l*I+c*C+u*X,d*b+f*I+p*C+m*X,g*b+x*I+w*C+y*X,n*A+r*k+a*R+o*P,h*A+l*k+c*R+u*P,d*A+f*k+p*R+m*P,g*A+x*k+w*R+y*P,n*M+r*T+a*F+o*L,h*M+l*T+c*F+u*L,d*M+f*T+p*F+m*L,g*M+x*T+w*F+y*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,a=t.y,o=t.z,h=n*r,l=n*a;return this.setValues(h*r+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*r,0,h*o-s*a,l*o+s*r,n*o*o+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,r=e.z,a=Math.sqrt(s*s+n*n+r*r);if(Math.abs(a)<1e-6)return this;s*=a=1/a,n*=a,r*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,c=i[0],u=i[1],d=i[2],f=i[3],p=i[4],m=i[5],g=i[6],x=i[7],w=i[8],y=i[9],v=i[10],b=i[11],A=i[12],M=i[13],S=i[14],I=i[15],k=s*s*l+h,T=n*s*l+r*o,E=r*s*l-n*o,C=s*n*l-r*o,R=n*n*l+h,F=r*n*l+s*o,Y=s*r*l+n*o,X=n*r*l-s*o,P=r*r*l+h;return this.setValues(c*k+p*T+w*E,u*k+m*T+y*E,d*k+g*T+v*E,f*k+x*T+b*E,c*C+p*R+w*F,u*C+m*R+y*F,d*C+g*R+v*F,f*C+x*R+b*F,c*Y+p*X+w*P,u*Y+m*X+y*P,d*Y+g*X+v*P,f*Y+x*X+b*P,A,M,S,I)},rotateX:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[4],r=e[5],a=e[6],o=e[7],h=e[8],l=e[9],c=e[10],u=e[11];return e[4]=n*s+h*i,e[5]=r*s+l*i,e[6]=a*s+c*i,e[7]=o*s+u*i,e[8]=h*s-n*i,e[9]=l*s-r*i,e[10]=c*s-a*i,e[11]=u*s-o*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[8],l=e[9],c=e[10],u=e[11];return e[0]=n*s-h*i,e[1]=r*s-l*i,e[2]=a*s-c*i,e[3]=o*s-u*i,e[8]=n*i+h*s,e[9]=r*i+l*s,e[10]=a*i+c*s,e[11]=o*i+u*s,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),s=Math.cos(t),n=e[0],r=e[1],a=e[2],o=e[3],h=e[4],l=e[5],c=e[6],u=e[7];return e[0]=n*s+h*i,e[1]=r*s+l*i,e[2]=a*s+c*i,e[3]=o*s+u*i,e[4]=h*s-n*i,e[5]=l*s-r*i,e[6]=c*s-a*i,e[7]=u*s-o*i,this},fromRotationTranslation:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,a=i+i,o=s+s,h=n+n,l=i*a,c=i*o,u=i*h,d=s*o,f=s*h,p=n*h,m=r*a,g=r*o,x=r*h;return this.setValues(1-(d+p),c+x,u-g,0,c-x,1-(l+p),f+m,0,u+g,f-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o;return this.setValues(1-(u+f),l+g,c-m,0,l-g,1-(h+f),d+p,0,c+m,d-p,1-(h+u),0,0,0,0,1)},frustum:function(t,e,i,s,n,r){var a=1/(e-t),o=1/(s-i),h=1/(n-r);return this.setValues(2*n*a,0,0,0,0,2*n*o,0,0,(e+t)*a,(s+i)*o,(r+n)*h,-1,0,0,r*n*2*h,0)},perspective:function(t,e,i,s){var n=1/Math.tan(t/2),r=1/(i-s);return this.setValues(n/e,0,0,0,0,n,0,0,0,0,(s+i)*r,-1,0,0,2*s*i*r,0)},perspectiveLH:function(t,e,i,s){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-s/(i-s),1,0,0,i*s/(i-s),0)},ortho:function(t,e,i,s,n,r){var a=t-e,o=i-s,h=n-r;return a=0===a?a:1/a,o=0===o?o:1/o,h=0===h?h:1/h,this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(s+i)*o,(r+n)*h,1)},lookAtRH:function(t,e,i){var s=this.val;return c.subVectors(t,e),0===c.getLengthSquared()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.getLengthSquared()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),l.crossVectors(c,h),s[0]=h.x,s[1]=h.y,s[2]=h.z,s[4]=l.x,s[5]=l.y,s[6]=l.z,s[8]=c.x,s[9]=c.y,s[10]=c.z,this},lookAt:function(t,e,i){var s=t.x,n=t.y,r=t.z,a=i.x,o=i.y,h=i.z,l=e.x,c=e.y,u=e.z;if(Math.abs(s-l)<1e-6&&Math.abs(n-c)<1e-6&&Math.abs(r-u)<1e-6)return this.identity();var d=s-l,f=n-c,p=r-u,m=1/Math.sqrt(d*d+f*f+p*p),g=o*(p*=m)-h*(f*=m),x=h*(d*=m)-a*p,w=a*f-o*d;(m=Math.sqrt(g*g+x*x+w*w))?(g*=m=1/m,x*=m,w*=m):(g=0,x=0,w=0);var y=f*w-p*x,v=p*g-d*w,b=d*x-f*g;return(m=Math.sqrt(y*y+v*v+b*b))?(y*=m=1/m,v*=m,b*=m):(y=0,v=0,b=0),this.setValues(g,y,d,0,x,v,f,0,w,b,p,0,-(g*s+x*n+w*r),-(y*s+v*n+b*r),-(d*s+f*n+p*r),1)},yawPitchRoll:function(t,e,i){this.zero(),a.zero(),o.zero();var s=this.val,n=a.val,r=o.val,h=Math.sin(i),l=Math.cos(i);return s[10]=1,s[15]=1,s[0]=l,s[1]=h,s[4]=-h,s[5]=l,h=Math.sin(e),l=Math.cos(e),n[0]=1,n[15]=1,n[5]=l,n[10]=l,n[9]=-h,n[6]=h,h=Math.sin(t),l=Math.cos(t),r[5]=1,r[15]=1,r[0]=l,r[2]=-h,r[8]=h,r[10]=l,this.multiplyLocal(a),this.multiplyLocal(o),this},setWorldMatrix:function(t,e,i,s,n){return this.yawPitchRoll(t.y,t.x,t.z),a.scaling(i.x,i.y,i.z),o.xyz(e.x,e.y,e.z),this.multiplyLocal(a),this.multiplyLocal(o),s&&this.multiplyLocal(s),n&&this.multiplyLocal(n),this},multiplyToMat4:function(t,e){var i=this.val,s=t.val,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=i[6],u=i[7],d=i[8],f=i[9],p=i[10],m=i[11],g=i[12],x=i[13],w=i[14],y=i[15],v=s[0],b=s[1],A=s[2],M=s[3],S=s[4],I=s[5],k=s[6],T=s[7],E=s[8],C=s[9],R=s[10],F=s[11],Y=s[12],X=s[13],P=s[14],L=s[15];return e.setValues(v*n+b*h+A*d+M*g,b*r+b*l+A*f+M*x,A*a+b*c+A*p+M*w,M*o+b*u+A*m+M*y,S*n+I*h+k*d+T*g,S*r+I*l+k*f+T*x,S*a+I*c+k*p+T*w,S*o+I*u+k*m+T*y,E*n+C*h+R*d+F*g,E*r+C*l+R*f+F*x,E*a+C*c+R*p+F*w,E*o+C*u+R*m+F*y,Y*n+X*h+P*d+L*g,Y*r+X*l+P*f+L*x,Y*a+X*c+P*p+L*w,Y*o+X*u+P*m+L*y)},fromRotationXYTranslation:function(t,e,i){var s=e.x,n=e.y,r=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),c=s,u=n,d=r,f=-a,p=0-f*h,m=0-o*h,g=f*l,x=o*l;return i||(c=l*s+h*r,u=p*s+o*n+g*r,d=m*s+a*n+x*r),this.setValues(l,p,m,0,0,o,a,0,h,g,x,0,c,u,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],s=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,s))}}),a=new r,o=new r,h=new n,l=new n,c=new n;t.exports=r},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={ADDED_TO_SCENE:i(187),BOOT:i(188),CREATE:i(189),DESTROY:i(190),PAUSE:i(191),POST_UPDATE:i(192),PRE_RENDER:i(193),PRE_UPDATE:i(194),READY:i(195),REMOVED_FROM_SCENE:i(196),RENDER:i(197),RESUME:i(198),SHUTDOWN:i(199),SLEEP:i(200),START:i(201),TRANSITION_COMPLETE:i(202),TRANSITION_INIT:i(203),TRANSITION_OUT:i(204),TRANSITION_START:i(205),TRANSITION_WAKE:i(206),UPDATE:i(207),WAKE:i(208)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(12),r=i(47),a=i(11),o=i(48),h=i(49),l=i(223),c=i(50),u=new s({initialize:function(t,e){if(this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=a(e,"url");void 0===s?s=t.path+i+"."+a(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=c(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={},s={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=s},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(4),r=i(3),a=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3];return s[0]=n*i+a*e,s[1]=r*i+o*e,s[2]=n*-e+a*i,s[3]=r*-e+o*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],a=i[2],o=i[3],h=i[4],l=i[5],c=s[0],u=s[1],d=s[2],f=s[3],p=s[4],m=s[5],g=void 0===e?i:e.matrix;return g[0]=c*n+u*a,g[1]=c*r+u*o,g[2]=d*n+f*a,g[3]=d*r+f*o,g[4]=p*n+m*a+h,g[5]=p*r+m*o+l,g},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],a=s[1],o=s[2],h=s[3],l=e*r+i*o+s[4],c=e*a+i*h+s[5],u=n[0],d=n[1],f=n[2],p=n[3],m=n[4],g=n[5];return s[0]=u*r+d*o,s[1]=u*a+d*h,s[2]=f*r+p*o,s[3]=f*a+p*h,s[4]=m*r+g*o+l,s[5]=m*a+g*h+c,this},transform:function(t,e,i,s,n,r){var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*c,a[2]=i*o+s*l,a[3]=i*h+s*c,a[4]=n*o+r*l+u,a[5]=n*h+r*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],a=s[2],o=s[3],h=s[4],l=s[5];return i.x=t*n+e*a+h,i.y=t*r+e*o+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=e*n-i*s;return t[0]=n/o,t[1]=-i/o,t[2]=-s/o,t[3]=e/o,t[4]=(s*a-n*r)/o,t[5]=-(e*a-i*r)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=i,a[3]=s,a[4]=n,a[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],a=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var o=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/o):-Math.acos(i/o),t.scaleX=o,t.scaleY=a/o}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,a=Math.sin(i),o=Math.cos(i);return r[4]=t,r[5]=e,r[0]=o*s,r[1]=a*s,r[2]=-a*n,r[3]=o*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],a=s[1],o=s[2],h=s[3],l=s[4],c=s[5],u=1/(n*h+o*-a);return i.x=h*u*t+-o*u*e+(c*o-l*h)*u,i.y=n*u*e+-a*u*t+(-c*n+l*a)*u,i},setQuad:function(t,e,i,s,n,r){void 0===r&&(r=this.quad);var a=this.matrix,o=a[0],h=a[1],l=a[2],c=a[3],u=a[4],d=a[5];return r[0]=t*o+e*l+u,r[1]=t*h+e*c+d,r[2]=t*o+s*l+u,r[3]=t*h+s*c+d,r[4]=i*o+s*l+u,r[5]=i*h+s*c+d,r[6]=i*o+e*l+u,r[7]=i*h+e*c+d,n&&r.forEach((function(t,e){r[e]=Math.round(t)})),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e,i){(function(e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var s=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!s||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(i.cordova=!0),void 0!==window.ejecta&&(i.ejecta=!0)),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(302))},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(320),r=i(66),a=i(321),o=i(30),h=i(322),l=i(327),c=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=o.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return a(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(6);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(6);t.exports=function(t){return s(t,-180,180)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(37);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,s,n){var r=.5*(s-e),a=.5*(n-i),o=t*t;return(2*i-2*s+r+a)*(t*o)+(-3*i+3*s-2*r-a)*o+r*t+i}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),a=t.x-e,o=t.y-i;return t.x=a*n-o*r+e,t.y=a*r+o*n+i,t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(3);t.exports=function(t,e,i,n,r,a,o,h){void 0===h&&(h=new s);var l=Math.sin(r),c=Math.cos(r),u=c*a,d=l*a,f=-l*o,p=c*o,m=1/(u*p+f*-d);return h.x=p*m*t+-f*m*e+(n*f-i*p)*m,h.y=u*m*e+-d*m*t+(-n*u+i*d)*m,h}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8],c=l*r-a*h,u=-l*n+a*o,d=h*n-r*o,f=e*c+i*u+s*d;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+s*h)*f,t[2]=(a*i-s*r)*f,t[3]=u*f,t[4]=(l*e-s*o)*f,t[5]=(-a*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*o)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=r*l-a*h,t[1]=s*h-i*l,t[2]=i*a-s*r,t[3]=a*o-n*l,t[4]=e*l-s*o,t[5]=s*n-e*a,t[6]=n*h-r*o,t[7]=i*o-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*r-a*h)+i*(-l*n+a*o)+s*(h*n-r*o)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],x=u[5],w=u[6],y=u[7],v=u[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*a+p*l,e[2]=d*n+f*o+p*c,e[3]=m*i+g*r+x*h,e[4]=m*s+g*a+x*l,e[5]=m*n+g*o+x*c,e[6]=w*i+y*r+v*h,e[7]=w*s+y*a+v*l,e[8]=w*n+y*o+v*c,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*a,e[2]=l*n+h*o,e[3]=l*r-h*i,e[4]=l*a-h*s,e[5]=l*o-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,a=i+i,o=s+s,h=e*r,l=e*a,c=e*o,u=i*a,d=i*o,f=s*o,p=n*r,m=n*a,g=n*o,x=this.val;return x[0]=1-(u+f),x[3]=l+g,x[6]=c-m,x[1]=l-g,x[4]=1-(h+f),x[7]=d+p,x[2]=c+m,x[5]=d-p,x[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],x=e[14],w=e[15],y=s*h-n*o,v=s*l-r*o,b=s*c-a*o,A=n*l-r*h,M=n*c-a*h,S=r*c-a*l,I=u*g-d*m,k=u*x-f*m,T=u*w-p*m,E=d*x-f*g,C=d*w-p*g,R=f*w-p*x,F=y*R-v*C+b*E+A*T-M*k+S*I;return F?(F=1/F,i[0]=(h*R-l*C+c*E)*F,i[1]=(l*T-o*R-c*k)*F,i[2]=(o*C-h*T+c*I)*F,i[3]=(r*C-n*R-a*E)*F,i[4]=(s*R-r*T+a*k)*F,i[5]=(n*T-s*C-a*I)*F,i[6]=(g*S-x*M+w*A)*F,i[7]=(x*b-m*S-w*v)*F,i[8]=(m*M-g*b+w*y)*F,this):null}});t.exports=s},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(45),r=i(2),a=i(16),o=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new a(1,0,0),c=new a(0,1,0),u=new a,d=new n,f=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(l).cross(t).length()<1e-6&&u.copy(c).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?this.set(0,0,0,1):(u.copy(t).cross(e),this._x=u.x,this._y=u.y,this._z=u.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=d.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,a=t.y,o=t.z,h=t.w;return this.set(e*h+n*r+i*o-s*a,i*h+n*a+s*r-e*o,s*h+n*o+e*a-i*r,n*h-e*r-i*a-s*o)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,a=t.x,o=t.y,h=t.z,l=t.w,c=i*a+s*o+n*h+r*l;c<0&&(c=-c,a=-a,o=-o,h=-h,l=-l);var u=1-e,d=e;if(1-c>1e-6){var f=Math.acos(c),p=Math.sin(f);u=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.set(u*i+d*a,u*s+d*o,u*n+d*h,u*r+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+n*r,i*a+s*r,s*a-i*r,n*a-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a-s*r,i*a+n*r,s*a+e*r,n*a-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),a=Math.cos(t);return this.set(e*a+i*r,i*a-e*r,s*a+n*r,n*a-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),a=Math.cos(s),o=Math.cos(n),h=Math.sin(i),l=Math.sin(s),c=Math.sin(n);switch(t.order){case"XYZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"YXZ":this.set(h*a*o+r*l*c,r*l*o-h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"ZXY":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c+h*l*o,r*a*o-h*l*c,e);break;case"ZYX":this.set(h*a*o-r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o+h*l*c,e);break;case"YZX":this.set(h*a*o+r*l*c,r*l*o+h*a*c,r*a*c-h*l*o,r*a*o-h*l*c,e);break;case"XZY":this.set(h*a*o-r*l*c,r*l*o-h*a*c,r*a*c+h*l*o,r*a*o+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],a=i[1],o=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=s+o+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(r-l)*e,(a-n)*e,.25/e)):s>o&&s>u?(e=2*Math.sqrt(1+s-o-u),this.set(.25*e,(n+a)/e,(r+l)/e,(c-h)/e)):o>u?(e=2*Math.sqrt(1+o-s-u),this.set((n+a)/e,.25*e,(h+c)/e,(r-l)/e)):(e=2*Math.sqrt(1+u-s-o),this.set((r+l)/e,(h+c)/e,.25*e,(a-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=o[n],a=o[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*a+a]+1),h[n]=.5*e,e=.5/e,h[r]=(i[3*r+n]+i[3*n+r])*e,h[a]=(i[3*a+n]+i[3*n+a])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*a+r]-i[3*r+a])*e}return this.onChangeCallback(this),this}});t.exports=f},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={ADD:i(213),COMPLETE:i(214),FILE_COMPLETE:i(215),FILE_KEY_COMPLETE:i(216),FILE_LOAD_ERROR:i(217),FILE_LOAD:i(218),FILE_PROGRESS:i(219),POST_PROCESS:i(220),PROGRESS:i(221),START:i(222)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(19),n=i(50);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e){t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4),n=i(26),r=i(44),a=i(33),o=i(34),h=i(3),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=a(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n),void 0===e&&(e=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,a=s.scrollY,o=t+n*this.scrollFactorX-n,l=e+a*this.scrollFactorY-a;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,l,i):r(o,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(58),r=i(228),a=i(235),o=i(59),h=i(23),l=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(o.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(o.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={ADDED_TO_SCENE:i(236),DESTROY:i(237),REMOVED_FROM_SCENE:i(238),VIDEO_COMPLETE:i(239),VIDEO_CREATED:i(240),VIDEO_ERROR:i(241),VIDEO_LOOP:i(242),VIDEO_PLAY:i(243),VIDEO_SEEKED:i(244),VIDEO_SEEKING:i(245),VIDEO_STOP:i(246),VIDEO_TIMEOUT:i(247),VIDEO_UNLOCKED:i(248)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(26),n=new s,r=new s,a=new s,o={camera:n,sprite:r,calc:a};t.exports=function(t,e,i){var s=n,h=r,l=a;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),o}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n<i;n++){s[n]=new Array(e);for(var r=e-1;r>-1;r--)s[n][r]=t[r][n]}return s}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s<e;s++)i=t.shift(),t.push(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s<e;s++)i=t.pop(),t.unshift(i);return i}},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s,n,r,a=i(304),o=i(306),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,a.CANVAS)},create:s=function(t,e,i,s,r){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=a.CANVAS),void 0===r&&(r=!1);var u=n(s);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:s},s===a.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),r&&(u.parent=c),c.width=e,c.height=i,l&&s===a.CANVAS&&o.disable(c.getContext("2d")),c},createWebGL:function(t,e,i){return s(t,e,i,a.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=a.CANVAS),t===a.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-r()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:r})},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(67),n=i(14);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(1),r=i(19),a=new s({initialize:function(t,e,i,s,n,r,a){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,a,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var a=n.drawImage;return a.x=i,a.y=s,a.width=t,a.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var a=this.data,o=a.spriteSourceSize;return a.trim=!0,a.sourceSize.w=t,a.sourceSize.h=e,o.x=i,o.y=s,o.w=n,o.h=r,o.r=i+n,o.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,s,r,a,o){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),m=l+(i=n(i,0,f)),g=s=n(s,0,d-e),x=r=n(r,0,f-i),w=this.data;if(w.trim){var y=w.spriteSourceSize,v=e+(s=n(s,0,c-e)),b=i+(r=n(r,0,u-i));if(!(y.r<e||y.b<i||y.x>v||y.y>b)){var A=Math.max(y.x,e),M=Math.max(y.y,i),S=Math.min(y.r,v)-A,I=Math.min(y.b,b)-M;g=S,x=I,p=a?h+(c-(A-y.x)-S):h+(A-y.x),m=o?l+(u-(M-y.y)-I):l+(M-y.y),e=A,i=M,s=S,r=I}else p=0,m=0,g=0,x=0}else a&&(p=h+(c-e-s)),o&&(m=l+(u-i-r));var k=this.source.width,T=this.source.height;return t.u0=Math.max(0,p/k),t.v0=Math.max(0,m/T),t.u1=Math.min(1,(p+g)/k),t.v1=Math.min(1,(m+x)/T),t.x=e,t.y=i,t.cx=p,t.cy=m,t.cw=g,t.ch=x,t.width=s,t.height=r,t.flipX=a,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var a=this.data.drawImage;return a.width=t,a.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,a=this.source.height;return this.u0=t/r,this.v0=e/a,this.u1=(t+i)/r,this.v1=(e+s)/a,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new a(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=a},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(70),n=i(0),r=i(10),a=i(184),o=i(185),h={canvas:i(209),webgl:i(210)},l=i(211),c=i(227),u=i(260),d=i(2),f=new n({Extends:o,initialize:function(t,e,i){o.call(this,t,e,i);var n=e.game;this.isWebGL=2===n.config.renderType,this.cache=n.cache.addCustom("spine"),this.spineTextures=n.cache.addCustom("spineTextures"),this.json=n.cache.json,this.textures=n.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=n.renderer,this.gl=n.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=n.renderer,this.getAtlas=this.getAtlasCanvas),this.renderer||(this.renderer={width:n.scale.width,height:n.scale.height,preRender:d,postRender:d,render:d,destroy:d});e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",(function(t,e,s,n,r){var a=this.scene.sys[i],o=new c(this.scene,a,t,e,s,n,r);return this.displayList.add(o),this.updateList.add(o),o}),(function(t,e){void 0===t&&(t={});var n=r(t,"key",null),a=r(t,"animationName",null),o=r(t,"loop",!1),h=this.scene.sys[i],l=new c(this.scene,h,0,0,n,a,o);void 0!==e&&(t.add=e),s(this.scene,l,t);var u=r(t,"skinName",!1);u&&l.setSkinByName(u);var d=r(t,"slotName",!1),f=r(t,"attachmentName",null);return d&&l.setAttachment(d,f),l.refresh()})),e.registerGameObject("spineContainer",(function(t,e,s){var n=this.scene.sys[i],r=new u(this.scene,n,t,e,s);return this.displayList.add(r),r}),(function(t,e){void 0===t&&(t={});var n=r(t,"x",0),a=r(t,"y",0),o=r(t,"children",null),h=this.scene.sys[i],l=new u(this.scene,h,n,a,o);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this),this.game.events.once("destroy",this.gameDestroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){var t=this.renderer.spineSceneRenderer;t||(t=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0),this.renderer.spineSceneRenderer=t),this.sceneRenderer=t,this.skeletonRenderer=t.skeletonRenderer,this.skeletonDebugRenderer=t.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures;i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.canvas.CanvasTexture(n.get(e.prefix+t).getSourceImage())}))}return i}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var i,s=this.spineTextures;if(s.has(t))i=s.get(t);else{var n=this.textures,r=this.sceneRenderer.context.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i=new this.runtime.TextureAtlas(e.data,(function(t){return new h.webgl.GLTexture(r,n.get(e.prefix+t).getSourceImage(),!1)}))}return i}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,i,s,n,r,a){var o;if(a=a||{},Array.isArray(t))for(var h=0;h<t.length;h++)(o=new l(this,t[h])).prefix=o.prefix||a.prefix||"",this.addFile(o.files);else(o=new l(this,t,e,i,s,n,r)).prefix=o.prefix||a.prefix||"",this.addFile(o.files);return this},worldToLocal:function(t,e,i,s){var n=this.temp1,r=this.temp2,a=this.sceneRenderer.camera;n.set(t+i.x,e-i.y,0);var o=a.viewportWidth,h=a.viewportHeight;return a.screenToWorld(n,o,h),s&&null!==s.parent?(s.parent.worldToLocal(r.set(n.x-i.x,n.y-i.y,0)),new this.runtime.Vector2(r.x,r.y)):s?new this.runtime.Vector2(n.x-i.x,n.y-i.y):new this.runtime.Vector2(n.x,n.y)},getVector2:function(t,e){return new this.runtime.Vector2(t,e)},getVector3:function(t,e,i){return new h.webgl.Vector3(t,e,i)},setDebugBones:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawBones=t,this},setDebugRegionAttachments:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawRegionAttachments=t,this},setDebugBoundingBoxes:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawBoundingBoxes=t,this},setDebugMeshHull:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawMeshHull=t,this},setDebugMeshTriangles:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawMeshTriangles=t,this},setDebugPaths:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawPaths=t,this},setDebugSkeletonXY:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawSkeletonXY=t,this},setDebugClipping:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawClipping=t,this},setEffect:function(t){return this.sceneRenderer.skeletonRenderer.vertexEffect=t,this},createSkeleton:function(t,e){var i=t,s=t,n=-1!==t.indexOf(".");if(n){var a=t.split(".");i=a.shift(),s=a.join(".")}var o=this.cache.get(i),h=this.getAtlas(i);if(!h)return null;if(!this.spineTextures.has(i)){var l,c,u,d=this.gl;for(this.isWebGL&&d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),l=0;l<h.pages.length;l++)c=h.pages[l],u=o.prefix?o.prefix+c.name:c.name,this.isWebGL?c.setTexture(new this.runtime.GLTexture(d,this.textures.get(u).getSourceImage(),!1)):c.setTexture(new this.runtime.CanvasTexture(this.textures.get(u).getSourceImage()));this.spineTextures.add(i,h)}var f,p=o.preMultipliedAlpha,m=new this.runtime.AtlasAttachmentLoader(h),g=new this.runtime.SkeletonJson(m);if(e)f=e;else{var x=this.json.get(i);f=n?r(x,s):x}if(f){var w=g.readSkeletonData(f);return{skeletonData:w,skeleton:new this.runtime.Skeleton(w),preMultipliedAlpha:p}}return null},createAnimationState:function(t){var e=new this.runtime.AnimationStateData(t.data);return{stateData:e,state:new this.runtime.AnimationState(e)}},getBounds:function(t){var e=new this.runtime.Vector2,i=new this.runtime.Vector2;return t.getBounds(e,i,[]),{offset:e,size:i}},onResize:function(){var t=this.renderer,e=this.sceneRenderer,i=t.width,s=t.height;e.camera.position.x=i/2,e.camera.position.y=s/2,e.camera.setViewport(i,s)},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this),this.isWebGL&&this.game.scale.off(a,this.onResize,this)},destroy:function(){this.shutdown(),this.game=null,this.scene=null,this.systems=null,this.cache=null,this.spineTextures=null,this.json=null,this.textures=null,this.skeletonRenderer=null,this.gl=null},gameDestroy:function(){this.pluginManager.removeGameObject("spine",!0,!0),this.pluginManager.removeGameObject("spineContainer",!0,!0),this.pluginManager=null;var t=this.renderer.spineSceneRenderer;t&&t.dispose(),this.renderer.spineSceneRenderer=null,this.sceneRenderer=null}});f.SpineGameObject=c,f.SpineContainer=u,t.exports=f},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(15),n=i(71);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var a=n(i,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=n(a,"x",1),e.scrollFactorY=n(a,"y",1)),e.rotation=n(i,"rotation",0);var o=n(i,"angle",null);null!==o&&(e.angle=o),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),c=n(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(72),n=i(10);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4),n=i(19),r={Angle:i(73),Distance:i(82),Easing:i(90),Fuzzy:i(135),Interpolation:i(140),Pow2:i(148),Snap:i(152),RandomDataGenerator:i(156),Average:i(157),Bernstein:i(36),Between:i(158),CatmullRom:i(38),CeilTo:i(159),Clamp:i(1),DegToRad:i(21),Difference:i(160),Euler:i(161),Factorial:i(37),FloatBetween:i(20),FloorTo:i(162),FromPercent:i(163),GetSpeed:i(164),IsEven:i(165),IsEvenStrict:i(166),Linear:i(39),LinearXY:i(167),MaxAdd:i(168),Median:i(169),MinSub:i(170),Percent:i(171),RadToDeg:i(9),RandomXY:i(172),RandomXYZ:i(173),RandomXYZW:i(174),Rotate:i(175),RotateAround:i(42),RotateAroundDistance:i(176),RotateTo:i(177),RoundAwayFromZero:i(43),RoundTo:i(178),SinCosTableGenerator:i(179),SmootherStep:i(41),SmoothStep:i(40),ToXY:i(180),TransformXY:i(44),Within:i(181),Wrap:i(6),Vector2:i(3),Vector3:i(16),Vector4:i(182),Matrix3:i(45),Matrix4:i(22),Quaternion:i(46),RotateVec3:i(183)};r=n(!1,r,s),t.exports=r},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Between:i(31),BetweenPoints:i(74),BetweenPointsY:i(75),BetweenY:i(76),CounterClockwise:i(8),Normalize:i(32),Random:i(77),RandomDegrees:i(78),Reverse:i(79),RotateTo:i(80),ShortestBetween:i(81),Wrap:i(33),WrapDegrees:i(34)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @author @samme
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(20);t.exports=function(){return s(-Math.PI,Math.PI)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @author @samme
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(20);t.exports=function(){return s(-180,180)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(32);t.exports=function(t){return s(t+Math.PI)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(4);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=s.PI2:e-=s.PI2),e>t?t+=i:e<t&&(t-=i))),t}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Between:i(83),BetweenPoints:i(84),BetweenPointsSquared:i(85),Chebyshev:i(86),Power:i(87),Snake:i(88),Squared:i(89)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},function(t,e){t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},function(t,e){t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},function(t,e){t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},function(t,e){t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Back:i(91),Bounce:i(95),Circular:i(99),Cubic:i(103),Elastic:i(107),Expo:i(111),Linear:i(115),Quadratic:i(117),Quartic:i(121),Quintic:i(125),Sine:i(129),Stepped:i(133)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(92),Out:i(93),InOut:i(94)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(96),Out:i(97),InOut:i(98)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(100),Out:i(101),InOut:i(102)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(104),Out:i(105),InOut:i(106)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(108),Out:i(109),InOut:i(110)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(112),Out:i(113),InOut:i(114)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports=i(116)},function(t,e){t.exports=function(t){return t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(118),Out:i(119),InOut:i(120)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(122),Out:i(123),InOut:i(124)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(126),Out:i(127),InOut:i(128)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={In:i(130),Out:i(131),InOut:i(132)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports=i(134)},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Ceil:i(136),Equal:i(35),Floor:i(137),GreaterThan:i(138),LessThan:i(139)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Bezier:i(141),CatmullRom:i(142),CubicBezier:i(143),Linear:i(144),QuadraticBezier:i(145),SmoothStep:i(146),SmootherStep:i(147)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(36);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(38);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2])}},function(t,e){t.exports=function(t,e,i,s,n){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(39);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},function(t,e){t.exports=function(t,e,i,s){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(40);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(41);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={GetNext:i(149),IsSize:i(150),IsValue:i(151)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Ceil:i(153),Floor:i(154),To:i(155)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},function(t,e){t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s<t.length;s++)e=.02519603282416938*(i+=t.charCodeAt(s)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(1),n=i(0),r=i(22),a=i(2),o=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),o.fromQuat(t),this.setFromRotationMatrix(o,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],a=n[4],o=n[8],h=n[1],l=n[5],c=n[9],u=n[2],d=n[6],f=n[10],p=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(s(o,-1,1)),Math.abs(o)<.99999?(p=Math.atan2(-c,f),g=Math.atan2(-a,r)):p=Math.atan2(d,l);break;case"YXZ":p=Math.asin(-s(c,-1,1)),Math.abs(c)<.99999?(m=Math.atan2(o,f),g=Math.atan2(h,l)):m=Math.atan2(-u,r);break;case"ZXY":p=Math.asin(s(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-u,f),g=Math.atan2(-a,l)):g=Math.atan2(h,r);break;case"ZYX":m=Math.asin(-s(u,-1,1)),Math.abs(u)<.99999?(p=Math.atan2(d,f),g=Math.atan2(h,r)):g=Math.atan2(-a,l);break;case"YZX":g=Math.asin(s(h,-1,1)),Math.abs(h)<.99999?(p=Math.atan2(-c,l),m=Math.atan2(-u,r)):m=Math.atan2(o,f);break;case"XZY":g=Math.asin(-s(a,-1,1)),Math.abs(a)<.99999?(p=Math.atan2(d,l),m=Math.atan2(o,r)):p=Math.atan2(-c,f)}return this._x=p,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(1);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},function(t,e){t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},function(t,e){t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],a=0;a<t;a++)e+=(i-=e*s)*s,n[a]=i,r[a]=e;return{sin:r,cos:n,length:t}}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(3);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,a=0;return t>0&&t<=e*i&&(r=t>e-1?t-(a=Math.floor(t/e))*e:t),n.set(r,a)}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=new(i(0))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,a=t.z,o=t.w,h=o*e+r*s-a*i,l=o*i+a*e-n*s,c=o*s+n*i-r*e,u=-n*e-r*i-a*s;return this.x=h*o+u*-n+l*-a-c*-r,this.y=l*o+u*-r+c*-n-h*-a,this.z=c*o+u*-a+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(16),n=i(22),r=i(46),a=new n,o=new r,h=new s;t.exports=function(t,e,i){return o.setAxisAngle(e,i),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="resize"},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}
*/
var s=i(186),n=i(0),r=i(23),a=new n({Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}
*/
var s=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="addedtoscene"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="boot"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="create"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="destroy"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="pause"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="postupdate"},function(t,e){
/**
* @author samme
* @copyright 2021 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="prerender"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="preupdate"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="ready"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="removedfromscene"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="render"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="resume"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="shutdown"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="sleep"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="start"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="transitioncomplete"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="transitioninit"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="transitionout"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="transitionstart"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="transitionwake"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="update"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="wake"},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(n,{AlphaTimeline:()=>ft,Animation:()=>E,AnimationState:()=>Rt,AnimationStateAdapter:()=>Pt,AnimationStateData:()=>_t,AssetManager:()=>bi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Xe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CanvasTexture:()=>vi,ClippingAttachment:()=>Wt,Color:()=>h,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>yt,EventType:()=>Xt,FIRST:()=>Dt,FakeTexture:()=>Zt,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Ot,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,IntSet:()=>r,Interpolation:()=>u,MathUtils:()=>c,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>kt,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,Pool:()=>x,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>ne,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SequenceTimeline:()=>Et,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>ke,SkeletonJson:()=>fi,SkeletonRenderer:()=>Si,Skin:()=>Ee,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,StringSet:()=>a,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,TrackEntry:()=>Ft,TransformConstraint:()=>Me,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>nt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,VertexAttachment:()=>M,WindowedMean:()=>v});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i<s;i++)this.add(t[i]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},o=class{constructor(t=0,e=0,i=0,s=0){this.r=t,this.g=e,this.b=i,this.a=s}set(t,e,i,s){return this.r=t,this.g=e,this.b=i,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,i,s){return this.r+=t,this.g+=e,this.b+=i,this.a+=s,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return t<e?e:t>i?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r<e+n;r++,a++)i[a]=t[r]}static arrayFill(t,e,i,s){for(let n=e;n<i;n++)t[n]=s}static setArraySize(t,e,i=0){let s=t.length;if(s==e)return t;if(t.length=e,s<e)for(let n=s;n<e;n++)t[n]=i;return t}static ensureArrayCapacity(t,e,i=0){return t.length>=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s<t;s++)i[s]=e;return i}static newFloatArray(t){if(p.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(p.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return p.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return p.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,i=!0){for(var s=0;s<t.length;s++)if(t[s]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}},m=p;m.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;var g=class{static logBones(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}}},x=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}},w=class{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}},y=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},v=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}},b=class{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}},A=class extends b{constructor(t){super(t),this.id=A.nextID++,this.bones=null,this.vertices=[],this.worldVerticesLength=0,this.timelineAttachment=this}computeWorldVertices(t,e,i,s,n,r){i=n+(i>>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a<i;t+=2,a+=r){let e=h[t],i=h[t+1];s[a]=e*u+i*d+l,s[a+1]=e*f+i*p+c}return}let c=0,u=0;for(let t=0;t<e;t+=2){let t=l[c];c+=t+1,u+=t}let d=a.bones;if(0==o.length)for(let t=n,e=3*u;t<i;t+=r){let i=0,n=0,r=l[c++];for(r+=c;c<r;c++,e+=3){let t=d[l[c]],s=h[e],r=h[e+1],a=h[e+2];i+=(s*t.a+r*t.b+t.worldX)*a,n+=(s*t.c+r*t.d+t.worldY)*a}s[t]=i,s[t+1]=n}else{let t=o;for(let e=n,a=3*u,o=u<<1;e<i;e+=r){let i=0,n=0,r=l[c++];for(r+=c;c<r;c++,a+=3,o+=2){let e=d[l[c]],s=h[a]+t[o],r=h[a+1]+t[o+1],u=h[a+2];i+=(s*e.a+r*e.b+e.worldX)*u,n+=(s*e.c+r*e.d+e.worldY)*u}s[e]=i,s[e+1]=n}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),m.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=m.newFloatArray(this.vertices.length),m.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}},M=A;M.nextID=0;var S=class{constructor(t){this.id=S.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(t)}copy(){let t=new S(this.regions.length);return m.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let i=t.sequenceIndex;-1==i&&(i=this.setupIndex),i>=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return S._nextID++}},I=S;I._nextID=0;var k=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(k||{}),T=[0,1,2,3,4,5,6],E=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,i,s,n,r,a,o){if(!t)throw new Error("skeleton cannot be null.");s&&0!=this.duration&&(i%=this.duration,e>0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s<l;s++)h[s].apply(t,e,i,n,r,a,o)}},C=(t=>(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,X=2,P=3,L=4,D=5,O=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;s<i;s++)if(t[s]>e)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;n<s;n+=i)if(t[n]>e)return n-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),m=.006*(3*(r-o)-s+l),g=.006*(3*(a-h)-n+c),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*(a-n)+p+.16666667*g,b=s+y,A=n+v;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=A,y+=x,v+=w,x+=m,w+=g,b+=y,A+=v}getBezierValue(t,e,i,s){let n=this.curves;if(n[s]>t){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s<r;s+=2)if(n[s]>=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.rotation=o.data.rotation);case 1:o.rotation+=(o.data.rotation-o.rotation)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.rotation=o.data.rotation+h*n;break;case 1:case 2:h+=o.data.rotation-o.rotation;case 3:o.rotation+=h*n}}},it=class extends tt{constructor(t,e,i){super(t,e,Y+"|"+i,X+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.x=o.data.x,void(o.y=o.data.y);case 1:o.x+=(o.data.x-o.x)*n,o.y+=(o.data.y-o.y)*n}return}let l=0,c=0,u=J.search(h,i,3),d=this.curves[u/3];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+3]-t);l+=(h[u+3+1]-l)*e,c+=(h[u+3+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}switch(r){case 0:o.x=o.data.x+l*n,o.y=o.data.y+c*n;break;case 1:case 2:o.x+=(o.data.x+l-o.x)*n,o.y+=(o.data.y+c-o.y)*n;break;case 3:o.x+=l*n,o.y+=c*n}}},st=class extends ${constructor(t,e,i){super(t,e,Y+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.x=o.data.x);case 1:o.x+=(o.data.x-o.x)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.x=o.data.x+h*n;break;case 1:case 2:o.x+=(o.data.x+h-o.x)*n;break;case 3:o.x+=h*n}}},nt=class extends ${constructor(t,e,i){super(t,e,X+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.y=o.data.y);case 1:o.y+=(o.data.y-o.y)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.y=o.data.y+h*n;break;case 1:case 2:o.y+=(o.data.y+h-o.y)*n;break;case 3:o.y+=h*n}}},rt=class extends tt{constructor(t,e,i){super(t,e,P+"|"+i,L+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h,l,u=this.frames;if(i<u[0]){switch(r){case 0:return o.scaleX=o.data.scaleX,void(o.scaleY=o.data.scaleY);case 1:o.scaleX+=(o.data.scaleX-o.scaleX)*n,o.scaleY+=(o.data.scaleY-o.scaleY)*n}return}let d=J.search(u,i,3),f=this.curves[d/3];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2];let e=(i-t)/(u[d+3]-t);h+=(u[d+3+1]-h)*e,l+=(u[d+3+2]-l)*e;break;case 1:h=u[d+1],l=u[d+2];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2)}if(h*=o.data.scaleX,l*=o.data.scaleY,1==n)3==r?(o.scaleX+=h-o.data.scaleX,o.scaleY+=l-o.data.scaleY):(o.scaleX=h,o.scaleY=l);else{let t=0,e=0;if(1==a)switch(r){case 0:t=o.data.scaleX,e=o.data.scaleY,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n,o.scaleY=e+(Math.abs(l)*c.signum(e)-e)*n;break;case 1:case 2:t=o.scaleX,e=o.scaleY,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n,o.scaleY=e+(Math.abs(l)*c.signum(e)-e)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n,o.scaleY+=(l-o.data.scaleY)*n}else switch(r){case 0:t=Math.abs(o.data.scaleX)*c.signum(h),e=Math.abs(o.data.scaleY)*c.signum(l),o.scaleX=t+(h-t)*n,o.scaleY=e+(l-e)*n;break;case 1:case 2:t=Math.abs(o.scaleX)*c.signum(h),e=Math.abs(o.scaleY)*c.signum(l),o.scaleX=t+(h-t)*n,o.scaleY=e+(l-e)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n,o.scaleY+=(l-o.data.scaleY)*n}}}},at=class extends ${constructor(t,e,i){super(t,e,P+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.scaleX=o.data.scaleX);case 1:o.scaleX+=(o.data.scaleX-o.scaleX)*n}return}let h=this.getCurveValue(i)*o.data.scaleX;if(1==n)3==r?o.scaleX+=h-o.data.scaleX:o.scaleX=h;else{let t=0;if(1==a)switch(r){case 0:t=o.data.scaleX,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 1:case 2:t=o.scaleX,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n}else switch(r){case 0:t=Math.abs(o.data.scaleX)*c.signum(h),o.scaleX=t+(h-t)*n;break;case 1:case 2:t=Math.abs(o.scaleX)*c.signum(h),o.scaleX=t+(h-t)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n}}}},ot=class extends ${constructor(t,e,i){super(t,e,L+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.scaleY=o.data.scaleY);case 1:o.scaleY+=(o.data.scaleY-o.scaleY)*n}return}let h=this.getCurveValue(i)*o.data.scaleY;if(1==n)3==r?o.scaleY+=h-o.data.scaleY:o.scaleY=h;else{let t=0;if(1==a)switch(r){case 0:t=o.data.scaleY,o.scaleY=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 1:case 2:t=o.scaleY,o.scaleY=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 3:o.scaleY+=(h-o.data.scaleY)*n}else switch(r){case 0:t=Math.abs(o.data.scaleY)*c.signum(h),o.scaleY=t+(h-t)*n;break;case 1:case 2:t=Math.abs(o.scaleY)*c.signum(h),o.scaleY=t+(h-t)*n;break;case 3:o.scaleY+=(h-o.data.scaleY)*n}}}},ht=class extends tt{constructor(t,e,i){super(t,e,D+"|"+i,O+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY);case 1:o.shearX+=(o.data.shearX-o.shearX)*n,o.shearY+=(o.data.shearY-o.shearY)*n}return}let l=0,c=0,u=J.search(h,i,3),d=this.curves[u/3];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+3]-t);l+=(h[u+3+1]-l)*e,c+=(h[u+3+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}switch(r){case 0:o.shearX=o.data.shearX+l*n,o.shearY=o.data.shearY+c*n;break;case 1:case 2:o.shearX+=(o.data.shearX+l-o.shearX)*n,o.shearY+=(o.data.shearY+c-o.shearY)*n;break;case 3:o.shearX+=l*n,o.shearY+=c*n}}},lt=class extends ${constructor(t,e,i){super(t,e,D+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.shearX=o.data.shearX);case 1:o.shearX+=(o.data.shearX-o.shearX)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.shearX=o.data.shearX+h*n;break;case 1:case 2:o.shearX+=(o.data.shearX+h-o.shearX)*n;break;case 3:o.shearX+=h*n}}},ct=class extends ${constructor(t,e,i){super(t,e,O+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.shearY=o.data.shearY);case 1:o.shearY+=(o.data.shearY-o.shearY)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.shearY=o.data.shearY+h*n;break;case 1:case 2:o.shearY+=(o.data.shearY+h-o.shearY)*n;break;case 3:o.shearY+=h*n}}},ut=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,V+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 5}setFrame(t,e,i,s,n,r){t*=5,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case 0:return void l.setFromColor(t);case 1:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n)}return}let c=0,u=0,d=0,f=0,p=J.search(h,i,5),m=this.curves[p/5];switch(m){case 0:let t=h[p];c=h[p+1],u=h[p+2],d=h[p+3],f=h[p+4];let e=(i-t)/(h[p+5]-t);c+=(h[p+5+1]-c)*e,u+=(h[p+5+2]-u)*e,d+=(h[p+5+3]-d)*e,f+=(h[p+5+4]-f)*e;break;case 1:c=h[p+1],u=h[p+2],d=h[p+3],f=h[p+4];break;default:c=this.getBezierValue(i,p,1,m-2),u=this.getBezierValue(i,p,2,m+18-2),d=this.getBezierValue(i,p,3,m+36-2),f=this.getBezierValue(i,p,4,m+54-2)}1==n?l.set(c,u,d,f):(0==r&&l.setFromColor(o.data.color),l.add((c-l.r)*n,(u-l.g)*n,(d-l.b)*n,(f-l.a)*n))}},dt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){t<<=2,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case 0:return l.r=t.r,l.g=t.g,void(l.b=t.b);case 1:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n}return}let c=0,u=0,d=0,f=J.search(h,i,4),p=this.curves[f>>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=c,l.g=u,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*n,l.g+=(u-l.g)*n,l.b+=(d-l.b)*n}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i<this.frames[0]){let t=o.data.color;switch(r){case 0:return void(h.a=t.a);case 1:h.a+=(t.a-h.a)*n}return}let l=this.getCurveValue(i);1==n?h.a=l:(0==r&&(h.a=o.data.color.a),h.a+=(l-h.a)*n)}},pt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,V+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 8}setFrame(t,e,i,s,n,r,a,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=h}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case 0:return l.setFromColor(t),c.r=e.r,c.g=e.g,void(c.b=e.b);case 1:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n),c.r+=(e.r-c.r)*n,c.g+=(e.g-c.g)*n,c.b+=(e.b-c.b)*n}return}let u=0,d=0,f=0,p=0,m=0,g=0,x=0,w=J.search(h,i,8),y=this.curves[w>>3];switch(y){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,y-2),d=this.getBezierValue(i,w,2,y+18-2),f=this.getBezierValue(i,w,3,y+36-2),p=this.getBezierValue(i,w,4,y+54-2),m=this.getBezierValue(i,w,5,y+72-2),g=this.getBezierValue(i,w,6,y+90-2),x=this.getBezierValue(i,w,7,y+108-2)}if(1==n)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),c.r+=(m-c.r)*n,c.g+=(g-c.g)*n,c.b+=(x-c.b)*n}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case 0:return l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,void(c.b=e.b);case 1:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n,c.r+=(e.r-c.r)*n,c.g+=(e.g-c.g)*n,c.b+=(e.b-c.b)*n}return}let u=0,d=0,f=0,p=0,m=0,g=0,x=J.search(h,i,7),w=this.curves[x/7];switch(w){case 0:let t=h[x];u=h[x+1],d=h[x+2],f=h[x+3],p=h[x+4],m=h[x+5],g=h[x+6];let e=(i-t)/(h[x+7]-t);u+=(h[x+7+1]-u)*e,d+=(h[x+7+2]-d)*e,f+=(h[x+7+3]-f)*e,p+=(h[x+7+4]-p)*e,m+=(h[x+7+5]-m)*e,g+=(h[x+7+6]-g)*e;break;case 1:u=h[x+1],d=h[x+2],f=h[x+3],p=h[x+4],m=h[x+5],g=h[x+6];break;default:u=this.getBezierValue(i,x,1,w-2),d=this.getBezierValue(i,x,2,w+18-2),f=this.getBezierValue(i,x,3,w+36-2),p=this.getBezierValue(i,x,4,w+54-2),m=this.getBezierValue(i,x,5,w+72-2),g=this.getBezierValue(i,x,6,w+90-2)}if(1==n)l.r=u,l.g=d,l.b=f,c.r=p,c.g=m,c.b=g;else{if(0==r){let t=o.data.color,e=o.data.darkColor;l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,c.b=e.b}l.r+=(u-l.r)*n,l.g+=(d-l.g)*n,l.b+=(f-l.b)*n,c.r+=(p-c.r)*n,c.g+=(m-c.g)*n,c.b+=(g-c.b)*n}}},gt=class extends J{constructor(t,e){super(t,[N+"|"+e]),this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];o.bone.active&&(1!=a?i<this.frames[0]?0!=r&&1!=r||this.setAttachment(t,o,o.data.attachmentName):this.setAttachment(t,o,this.attachmentNames[J.search1(this.frames,i)]):0==r&&this.setAttachment(t,o,o.data.attachmentName))}setAttachment(t,e,i){e.setAttachment(i?t.getAttachment(this.slotIndex,i):null)}},xt=class extends Q{constructor(t,e,i,s){super(t,e,[_+"|"+i+"|"+s.id]),this.slotIndex=0,this.slotIndex=i,this.attachment=s,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.vertices[t]=i}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*h-.06*a,m=.006*(3*(r-o)-s+l),g=.018*(a-h+.33333333),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*a+p+.16666667*g,b=s+y,A=v;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=A,y+=x,v+=w,x+=m,w+=g,b+=y,A+=v}getCurvePercent(t,e){let i=this.curves,s=i[e];switch(s){case 0:let i=this.frames[e];return(t-i)/(this.frames[e+this.getFrameEntries()]-i);case 1:return 0}if(s-=2,i[s]>t){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s<n;s+=2)if(i[s]>=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i<d[0]){switch(r){case 0:return void(l.length=0);case 1:if(1==n)return void(l.length=0);l.length=u;let t=h;if(t.bones){n=1-n;for(f=0;f<u;f++)l[f]*=n}else{let e=t.vertices;for(var f=0;f<u;f++)l[f]+=(e[f]-l[f])*n}}return}if(l.length=u,i>=d[d.length-1]){let t=c[d.length-1];if(1==n)if(3==r){let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]+=t[e];else{let i=e.vertices;for(let e=0;e<u;e++)l[e]+=t[e]-i[e]}}else m.arrayCopy(t,0,l,0,u);else switch(r){case 0:{let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]=t[e]*n;else{let i=e.vertices;for(let e=0;e<u;e++){let s=i[e];l[e]=s+(t[e]-s)*n}}break}case 1:case 2:for(let e=0;e<u;e++)l[e]+=(t[e]-l[e])*n;break;case 3:let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]+=t[e]*n;else{let i=e.vertices;for(let e=0;e<u;e++)l[e]+=(t[e]-i[e])*n}}return}let p=J.search1(d,i),g=this.getCurvePercent(i,p),x=c[p],w=c[p+1];if(1==n)if(3==r){let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]+=e+(w[t]-e)*g}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t];l[t]+=i+(w[t]-i)*g-e[t]}}}else for(let t=0;t<u;t++){let e=x[t];l[t]=e+(w[t]-e)*g}else switch(r){case 0:{let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]=(e+(w[t]-e)*g)*n}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t],s=e[t];l[t]=s+(i+(w[t]-i)*g-s)*n}}break}case 1:case 2:for(let t=0;t<u;t++){let e=x[t];l[t]+=(e+(w[t]-e)*g-l[t])*n}break;case 3:let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]+=(e+(w[t]-e)*g)*n}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t];l[t]+=(i+(w[t]-i)*g-e[t])*n}}}}},wt=class extends J{constructor(t){super(t,wt.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,n,r,a){if(!s)return;let o=this.frames,h=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i<o[0])return;let l=0;if(e<o[0])l=0;else{l=J.search1(o,e)+1;let t=o[l];for(;l>0&&o[l-1]==t;)l--}for(;l<h&&i>=o[l];l++)s.push(this.events[l])}},yt=wt;yt.propertyIds=[""+U];var vt=class extends J{constructor(t){super(t,vt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i<this.frames[0])return void(0!=r&&1!=r||m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let o=J.search1(this.frames,i),h=this.drawOrders[o];if(h){let e=t.drawOrder,i=t.slots;for(let t=0,s=h.length;t<s;t++)e[t]=i[h[t]]}else m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}},bt=vt;bt.propertyIds=[""+W];var At=class extends Q{constructor(t,e,i){super(t,e,[q+"|"+i]),this.ikConstraintIndex=0,this.ikConstraintIndex=i}getFrameEntries(){return 6}setFrame(t,e,i,s,n,r,a){t*=6,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r?1:0,this.frames[t+5]=a?1:0}apply(t,e,i,s,n,r,a){let o=t.ikConstraints[this.ikConstraintIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,void(o.stretch=o.data.stretch);case 1:o.mix+=(o.data.mix-o.mix)*n,o.softness+=(o.data.softness-o.softness)*n,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}return}let l=0,c=0,u=J.search(h,i,6),d=this.curves[u/6];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+6]-t);l+=(h[u+6+1]-l)*e,c+=(h[u+6+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}0==r?(o.mix=o.data.mix+(l-o.data.mix)*n,o.softness=o.data.softness+(c-o.data.softness)*n,1==a?(o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch):(o.bendDirection=h[u+3],o.compress=0!=h[u+4],o.stretch=0!=h[u+5])):(o.mix+=(l-o.mix)*n,o.softness+=(c-o.softness)*n,0==a&&(o.bendDirection=h[u+3],o.compress=0!=h[u+4],o.stretch=0!=h[u+5]))}},Mt=class extends Q{constructor(t,e,i){super(t,e,[G+"|"+i]),this.transformConstraintIndex=0,this.transformConstraintIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){let h=this.frames;h[t*=7]=e,h[t+1]=i,h[t+2]=s,h[t+3]=n,h[t+4]=r,h[t+5]=a,h[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.transformConstraints[this.transformConstraintIndex];if(!o.active)return;let h,l,c,u,d,f,p=this.frames;if(i<p[0]){let t=o.data;switch(r){case 0:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY);case 1:o.mixRotate+=(t.mixRotate-o.mixRotate)*n,o.mixX+=(t.mixX-o.mixX)*n,o.mixY+=(t.mixY-o.mixY)*n,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*n,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*n,o.mixShearY+=(t.mixShearY-o.mixShearY)*n}return}let m=J.search(p,i,7),g=this.curves[m/7];switch(g){case 0:let t=p[m];h=p[m+1],l=p[m+2],c=p[m+3],u=p[m+4],d=p[m+5],f=p[m+6];let e=(i-t)/(p[m+7]-t);h+=(p[m+7+1]-h)*e,l+=(p[m+7+2]-l)*e,c+=(p[m+7+3]-c)*e,u+=(p[m+7+4]-u)*e,d+=(p[m+7+5]-d)*e,f+=(p[m+7+6]-f)*e;break;case 1:h=p[m+1],l=p[m+2],c=p[m+3],u=p[m+4],d=p[m+5],f=p[m+6];break;default:h=this.getBezierValue(i,m,1,g-2),l=this.getBezierValue(i,m,2,g+18-2),c=this.getBezierValue(i,m,3,g+36-2),u=this.getBezierValue(i,m,4,g+54-2),d=this.getBezierValue(i,m,5,g+72-2),f=this.getBezierValue(i,m,6,g+90-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n,o.mixScaleX=t.mixScaleX+(u-t.mixScaleX)*n,o.mixScaleY=t.mixScaleY+(d-t.mixScaleY)*n,o.mixShearY=t.mixShearY+(f-t.mixShearY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n,o.mixScaleX+=(u-o.mixScaleX)*n,o.mixScaleY+=(d-o.mixScaleY)*n,o.mixShearY+=(f-o.mixShearY)*n}},St=class extends ${constructor(t,e,i){super(t,e,j+"|"+i),this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.position=o.data.position);case 1:o.position+=(o.data.position-o.position)*n}return}let h=this.getCurveValue(i);0==r?o.position=o.data.position+(h-o.data.position)*n:o.position+=(h-o.position)*n}},It=class extends ${constructor(t,e,i){super(t,e,H+"|"+i),this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.spacing=o.data.spacing);case 1:o.spacing+=(o.data.spacing-o.spacing)*n}return}let h=this.getCurveValue(i);0==r?o.spacing=o.data.spacing+(h-o.data.spacing)*n:o.spacing+=(h-o.spacing)*n}},kt=class extends Q{constructor(t,e,i){super(t,e,[Z+"|"+i]),this.pathConstraintIndex=0,this.pathConstraintIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){let r=this.frames;r[t<<=2]=e,r[t+1]=i,r[t+2]=s,r[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;let h,l,c,u=this.frames;if(i<u[0]){switch(r){case 0:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY);case 1:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*n,o.mixX+=(o.data.mixX-o.mixX)*n,o.mixY+=(o.data.mixY-o.mixY)*n}return}let d=J.search(u,i,4),f=this.curves[d>>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=Tt.ENTRIES]=e,r[t+Tt.MODE]=i|s<<4,r[t+Tt.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let c=this.frames;if(i<c[0])return void(0!=r&&1!=r||(o.sequenceIndex=-1));let u=J.search(c,i,Tt.ENTRIES),d=c[u],f=c[u+Tt.MODE],p=c[u+Tt.DELAY];if(!this.attachment.sequence)return;let m=f>>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Et=Tt;Et.ENTRIES=3,Et.MODE=1,Et.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(!s)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let n=t*s.timeScale;if(s.delay>0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r<a;r++){let a=i[r];if(!a||a.delay>0)continue;s=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e<p;e++){m.webkit602BugfixHelper(h,o);var n=f[e];n instanceof gt?this.applyAttachmentTimeline(n,t,u,o,!0):n.apply(t,l,u,d,h,o,0)}else{let e=a.timelineMode,i=a.shortestRotation,s=!i&&a.timelinesRotation.length!=p<<1;s&&(a.timelinesRotation.length=p<<1);for(let n=0;n<p;n++){let r=f[n],c=e[n]==Lt?o:0;!i&&r instanceof et?this.applyRotateTimeline(r,t,u,h,c,a.timelinesRotation,n<<1,s):r instanceof gt?this.applyAttachmentTimeline(r,t,u,o,!0):(m.webkit602BugfixHelper(h,o),r.apply(t,l,u,d,h,c,0))}}this.queueEvents(a,c),e.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime}for(var r=this.unkeyedState+zt,a=t.slots,o=0,h=t.slots.length;o<h;o++){var l=a[o];if(l.attachmentState==r){var c=l.data.attachmentName;l.setAttachment(c?t.getAttachment(l.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(t,e,i){let s=t.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,e,i);let n=0;0==t.mixDuration?(n=1,1==i&&(i=0)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),1!=i&&(i=s.mixBlend));let r=n<s.attachmentThreshold,a=n<s.drawOrderThreshold,o=s.animation.timelines,h=o.length,l=s.alpha*t.interruptAlpha,c=l*(1-n),u=s.animationLast,d=s.getAnimationTime(),f=d,p=null;if(s.reverse?f=s.animation.duration-f:n<s.eventThreshold&&(p=this.events),3==i)for(let t=0;t<h;t++)o[t].apply(e,u,f,p,c,i,1);else{let t=s.timelineMode,n=s.timelineHoldMix,d=s.shortestRotation,g=!d&&s.timelinesRotation.length!=h<<1;g&&(s.timelinesRotation.length=h<<1),s.totalAlpha=0;for(let x=0;x<h;x++){let h,w=o[x],y=1,v=0;switch(t[x]){case Lt:if(!a&&w instanceof bt)continue;h=i,v=c;break;case Dt:h=0,v=c;break;case Ot:h=i,v=l;break;case Bt:h=0,v=l;break;default:h=0;let t=n[x];v=l*Math.max(0,1-t.mixTime/t.mixDuration)}s.totalAlpha+=v,!d&&w instanceof et?this.applyRotateTimeline(w,e,f,v,h,s.timelinesRotation,x<<1,g):w instanceof gt?this.applyAttachmentTimeline(w,e,f,h,r):(m.webkit602BugfixHelper(v,i),a&&w instanceof bt&&0==h&&(y=0),w.apply(e,u,f,p,v,h,y))}}return t.mixDuration>0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i<t.frames[0]?0!=s&&1!=s||this.setAttachment(e,r,r.data.attachmentName,n):this.setAttachment(e,r,t.attachmentNames[J.search1(t.frames,i)],n),r.attachmentState<=this.unkeyedState&&(r.attachmentState=this.unkeyedState+zt))}setAttachment(t,e,i,s){e.setAttachment(i?t.getAttachment(e.data.index,i):null),s&&(e.attachmentState=this.unkeyedState+Nt)}applyRotateTimeline(t,e,i,s,n,r,a,o){if(o&&(r[a]=0),1==s)return void t.apply(e,0,i,null,1,n,0);let h=e.bones[t.boneIndex];if(!h.active)return;let l=0,u=0;if(i<t.frames[0])switch(n){case 0:h.rotation=h.data.rotation;default:return;case 1:l=h.rotation,u=h.data.rotation}else l=0==n?h.data.rotation:h.rotation,u=h.data.rotation+t.getCurveValue(i);let d=0,f=u-l;if(f-=360*(16384-(16384.499999999996-f/360|0)),0==f)d=r[a];else{let t=0,e=0;o?(t=0,e=f):(t=r[a],e=r[a+1]);let i=f>0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;o<h;o++){let e=a[o];if(e.time<r)break;e.time>s||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast<s,l&&this.queue.complete(t);o<h;o++){let e=a[o];e.time<i||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){let i=this.tracks[e];i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(m.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,i,s){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=i,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.attachmentThreshold=0,n.drawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=s?this.data.getMix(s.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=2,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&3==i.mixBlend||this.computeHold(i),i=i.mixingTo}while(i)}}}computeHold(t){let e=t.mixingTo,i=t.animation.timelines,s=t.animation.timelines.length,n=t.timelineMode;n.length=s;let r=t.timelineHoldMix;r.length=0;let a=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<s;t++)n[t]=a.addAll(i[t].getPropertyIds())?Bt:Ot;else t:for(let o=0;o<s;o++){let s=i[o],h=s.getPropertyIds();if(a.addAll(h))if(!e||s instanceof gt||s instanceof bt||s instanceof yt||!e.animation.hasTimeline(h))n[o]=Dt;else{for(let i=e.mixingTo;i;i=i.mixingTo)if(!i.animation.hasTimeline(h)){if(t.mixDuration>0){n[o]=Vt,r[o]=i;continue t}break}n[o]=Bt}else n[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new E("<empty>",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}},Yt=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(Xt.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(Xt.interrupt),this.objects.push(t)}end(t){this.objects.push(Xt.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(Xt.dispose),this.objects.push(t)}complete(t){this.objects.push(Xt.complete),this.objects.push(t)}event(t,e){this.objects.push(Xt.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let i=0;i<t.length;i+=2){let s=t[i],n=t[i+1];switch(s){case Xt.start:n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++){let i=e[t];i.start&&i.start(n)}break;case Xt.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++){let i=e[t];i.interrupt&&i.interrupt(n)}break;case Xt.end:n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++){let i=e[t];i.end&&i.end(n)}case Xt.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++){let i=e[t];i.dispose&&i.dispose(n)}this.animState.trackEntryPool.free(n);break;case Xt.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++){let i=e[t];i.complete&&i.complete(n)}break;case Xt.event:let s=t[2+i++];n.listener&&n.listener.event&&n.listener.event(n,s);for(let t=0;t<e.length;t++){let i=e[t];i.event&&i.event(n,s)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Xt=(t=>(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Xt||{}),Pt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Ot=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new $t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e<s;e++)t.push(parseInt(i[e+1]));h.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),o&&o.length>0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let i of this.pages)i.setTexture(t.get(e+i.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)null==(t=this.pages[e].texture)||t.dispose()}},Jt=class{constructor(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o<i;o+=2)e[o]=s+t[o+1]*r,e[o+1]=n+(1-t[o])*a;return;case 180:s-=(o.originalWidth-o.offsetX-o.width)/l,n-=o.offsetY/c,r=o.originalWidth/l,a=o.originalHeight/c;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o])*r,e[o+1]=n+(1-t[o+1])*a;return;case 270:s-=o.offsetY/l,n-=o.offsetX/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o+1])*r,e[o+1]=n+t[o]*a;return}s-=o.offsetX/l,n-=(o.originalHeight-o.offsetY-o.height)/c,r=o.originalWidth/l,a=o.originalHeight/c}else this.region?(r=this.region.u2-s,a=this.region.v2-n):(s=n=0,r=a=1);for(let o=0;o<i;o+=2)e[o]=s+t[o]*r,e[o+1]=n+t[o+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new te(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),m.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),m.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),m.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),m.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,i,s,n,r){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,i,s,n,r)}newLinkedMesh(){let t=new te(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}},ee=class extends M{constructor(t){super(t),this.lengths=[],this.closed=!1,this.constantSpeed=!1,this.color=new h(1,1,1,1)}copy(){let t=new ee(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),m.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},ie=class extends M{constructor(t){super(t),this.x=0,this.y=0,this.rotation=0,this.color=new h(.38,.94,0,1)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){let e=c.cosDeg(this.rotation),i=c.sinDeg(this.rotation),s=e*t.a+i*t.b,n=e*t.c+i*t.d;return Math.atan2(n,s)*c.radDeg}copy(){let t=new ie(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},se=class extends b{constructor(t,e){super(t),this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new h(1,1,1,1),this.rendererObject=null,this.region=null,this.sequence=null,this.offset=m.newFloatArray(8),this.uvs=m.newFloatArray(8),this.tempColor=new h(1,1,1,1),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);let i=this.width/this.region.originalWidth*this.scaleX,s=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*s,a=n+this.region.width*i,o=r+this.region.height*s,h=this.rotation*Math.PI/180,l=Math.cos(h),c=Math.sin(h),u=this.x,d=this.y,f=n*l+u,p=n*c,m=r*l+d,g=r*c,x=a*l+u,w=a*c,y=o*l+d,v=o*c,b=this.offset;b[0]=f-g,b[1]=m+p,b[2]=f-v,b[3]=y+p,b[4]=x-v,b[5]=y+w,b[6]=x-g,b[7]=m+w,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,i,s){null!=this.sequence&&this.sequence.apply(t,this);let n=t.bone,r=this.offset,a=n.worldX,o=n.worldY,h=n.a,l=n.b,c=n.c,u=n.d,d=0,f=0;d=r[0],f=r[1],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[2],f=r[3],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[4],f=r[5],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[6],f=r[7],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o}copy(){let t=new se(this.name,this.path);return t.region=this.region,t.rendererObject=this.rendererObject,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,m.arrayCopy(this.uvs,0,t.uvs,0,8),m.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}},ne=se;ne.X1=0,ne.Y1=1,ne.C1R=2,ne.C1G=3,ne.C1B=4,ne.C1A=5,ne.U1=6,ne.V1=7,ne.X2=8,ne.Y2=9,ne.C2R=10,ne.C2G=11,ne.C2B=12,ne.C2A=13,ne.U2=14,ne.V2=15,ne.X3=16,ne.Y3=17,ne.C3R=18,ne.C3G=19,ne.C3B=20,ne.C3A=21,ne.U3=22,ne.V3=23,ne.X4=24,ne.Y4=25,ne.C4R=26,ne.C4G=27,ne.C4B=28,ne.C4A=29,ne.U4=30,ne.V4=31;var re=class{constructor(t){this.atlas=t}loadSequence(t,e,i){let s=i.regions;for(let n=0,r=s.length;n<r;n++){let r=i.getPath(e,n),a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (sequence: "+t+")");s[n]=a,s[n].renderObject=s[n]}}newRegionAttachment(t,e,i,s){let n=new ne(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (region attachment: "+e+")");t.renderObject=t,n.region=t}return n}newMeshAttachment(t,e,i,s){let n=new te(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+e+")");t.renderObject=t,n.region=t}return n}newBoundingBoxAttachment(t,e){return new Ut(e)}newPathAttachment(t,e){return new ee(e)}newPointAttachment(t,e){return new ie(e)}newClippingAttachment(t,e){return new Wt(e)}},ae=class{constructor(t,e,i){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=oe.Normal,this.skinRequired=!1,this.color=new h,t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+r)*s*l,this.b=c.cosDeg(h)*n*l,this.c=c.sinDeg(i+r)*s*u,this.d=c.sinDeg(h)*n*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+r)*s,o=c.cosDeg(t)*n,f=c.sinDeg(i+r)*s,p=c.sinDeg(t)*n;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+r)*s,this.b=c.cosDeg(t)*n,this.c=c.sinDeg(i+r)*s,this.d=c.sinDeg(t)*n;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+r-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*n,g=c.sinDeg(o)*s,x=c.sinDeg(f)*n;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(r)*s,y=c.cosDeg(90+a)*n,v=c.sinDeg(r)*s,b=c.sinDeg(90+a)*n;this.a=o*w+g*v,this.b=o*y+g*b,this.c=f*w+x*v,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*n*r-o*i*r,this.ay=o*e*r-a*s*r;let h=r*n,l=r*e,u=r*i,d=r*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=c.cosDeg(t),a=c.sinDeg(t);this.a=r*e-a*s,this.b=r*i-a*n,this.c=a*e+r*s,this.d=a*i+r*n}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let a=new Kt(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,(i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))},(e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n<i;n++)s[n]=e.charCodeAt(n);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+="base64,".length,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.overrideMimeType("text/html"),s.open("GET",t,!0);let n=()=>{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t<e;t+=2)s[t].apply(null,n)}},de=class{constructor(t,e){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!e)throw new Error("data cannot be null.");this.time=t,this.data=e}},fe=class{constructor(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t}},pe=class{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error("Couldn't find bone "+t.bones[i].name);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find bone "+t.target.name);this.target=i}isActive(){return this.active}update(){if(0==this.mix)return;let t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,i,s,n,r,a){let o=t.parent;if(!o)throw new Error("IK bone must have parent.");let h=o.a,l=o.b,u=o.c,d=o.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case 1:p=e-t.worldX,m=i-t.worldY;break;case 2:let s=Math.abs(h*d-l*u)/(h*h+u*u),n=h/t.skeleton.scaleX,r=u/t.skeleton.scaleY;l=-r*s*t.skeleton.scaleX,d=n*s*t.skeleton.scaleY,f+=Math.atan2(r,n)*c.radDeg;default:let a=e-o.worldX,g=i-o.worldY,x=h*d-l*u;p=(a*d-g*l)/x-t.ax,m=(g*h-a*u)/x-t.ay}f+=Math.atan2(m,p)*c.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||n){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&h<o||n&&h>o&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,w=180):w=0;let v=e.ax,b=0,A=0,M=0,S=t.a,I=t.b,k=t.c,T=t.d,E=Math.abs(d-f)<=1e-4;!E||r?(b=0,A=S*v+t.worldX,M=k*v+t.worldY):(b=e.ay,A=S*v+I*b+t.worldX,M=k*v+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");S=C.a,I=C.b,k=C.c,T=C.d;let R,F,Y=1/(S*T-I*k),X=A-C.worldX,P=M-C.worldY,L=(X*T-P*I)*Y-l,D=(P*S-X*k)*Y-u,O=Math.sqrt(L*L+D*D),B=e.data.length*g;if(O<1e-4)return this.apply1(t,i,s,!1,r,!1,h),void e.updateWorldTransformWith(v,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);X=i-C.worldX,P=s-C.worldY;let V=(X*T-P*I)*Y-l,z=(P*S-X*k)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-O-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(E){B*=d;let t=(N-O*O-B*B)/(2*O*B);t<-1?(t=-1,F=Math.PI*n):t>1?(t=1,F=0,r&&(S=(Math.sqrt(N)/(O+B)-1)*h+1,p*=S,a&&(m*=S))):F=Math.acos(t)*n,S=O+B*t,I=B*Math.sin(F),R=Math.atan2(z*S-V*I,V*S+z*I)}else{S=d*B,I=f*B;let t=S*S,e=I*I,i=Math.atan2(z,V);k=e*O*O+t*N-t*e;let s=-2*e*O,r=e-t;if(T=s*s-4*r*k,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=k/t,o=Math.abs(e)<Math.abs(a)?e:a;if(o*o<=N){P=Math.sqrt(N-o*o)*n,R=i-Math.atan2(P,o),F=Math.atan2(P/f,(o-O)/d);break t}}let a=c.PI,o=O-S,h=o*o,l=0,u=0,p=O+S,m=p*p,g=0;k=-S*O/(t-e),k>=-1&&k<=1&&(k=Math.acos(k),X=S*Math.cos(k)+O,P=I*Math.sin(k),T=X*X+P*P,T<h&&(a=k,h=T,o=X,l=P),T>m&&(u=k,m=T,p=X,g=P)),N<=.5*(h+m)?(R=i-Math.atan2(l*n,o),F=a*n):(R=i-Math.atan2(g*n,p),F=u*n)}let _=Math.atan2(b,v)*y,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*y+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(v,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),ve=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i<s;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findSlot(t.target.name);if(!i)throw new Error("Couldn't find target bone "+t.target.name);this.target=i,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof ee))return;let e=this.mixRotate,i=this.mixX,s=this.mixY;if(0==e&&0==i&&0==s)return;let n=this.data,r=0==n.rotateMode,a=2==n.rotateMode,o=this.bones,h=o.length,l=r?h:h+1,u=m.setArraySize(this.spaces,l),d=a?this.lengths=m.setArraySize(this.lengths,h):[],f=this.spacing;switch(n.spacingMode){case 2:if(a)for(let t=0,e=l-1;t<e;t++){let e=o[t],i=e.data.length;if(i<ve.epsilon)d[t]=0;else{let s=i*e.a,n=i*e.c;d[t]=Math.sqrt(s*s+n*n)}}m.arrayFill(u,1,l,f);break;case 3:let t=0;for(let e=0,i=l-1;e<i;){let i=o[e],s=i.data.length;if(s<ve.epsilon)a&&(d[e]=0),u[++e]=f;else{let n=s*i.a,r=s*i.c,o=Math.sqrt(n*n+r*r);a&&(d[e]=o),u[++e]=o,t+=o}}if(t>0){t=l/t*f;for(let e=1;e<l;e++)u[e]*=t}break;default:let e=0==n.spacingMode;for(let t=0,i=l-1;t<i;){let i=o[t],s=i.data.length;if(s<ve.epsilon)a&&(d[t]=0),u[++t]=f;else{let n=s*i.a,r=s*i.c,o=Math.sqrt(n*n+r*r);a&&(d[t]=o),u[++t]=(e?s+f:f)*o/s}}}let p=this.computeWorldPositions(t,l,r),g=p[0],x=p[1],w=n.offsetRotation,y=!1;if(0==w)y=1==n.rotateMode;else{y=!1;let t=this.target.bone;w*=t.a*t.d-t.b*t.c>0?c.degRad:-c.degRad}for(let t=0,n=3;t<h;t++,n+=3){let h=o[t];h.worldX+=(g-h.worldX)*i,h.worldY+=(x-h.worldY)*s;let l=p[n],f=p[n+1],m=l-g,v=f-x;if(a){let i=d[t];if(0!=i){let t=(Math.sqrt(m*m+v*v)/i-1)*e+1;h.a*=t,h.c*=t}}if(g=l,x=f,e>0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[n-1]:0==u[t+1]?p[n+2]:Math.atan2(v,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-v)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ve.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;m<e;m++,g+=3){let e=r[m]*f;n+=e;let w=n;if(h)w%=p,w<0&&(w+=p),x=0;else{if(w<0){u!=ve.BEFORE&&(u=ve.BEFORE,t.computeWorldVertices(s,2,4,o,0,2)),this.addBeforePosition(w,o,0,a,g);continue}if(w>p){u!=ve.AFTER&&(u=ve.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,y=0,v=0,b=0,A=0,M=0,S=0,I=0,k=0,T=0,E=0,C=0,R=0,F=0;for(let t=0,e=2;t<c;t++,e+=6)w=o[e],y=o[e+1],v=o[e+2],b=o[e+3],A=o[e+4],M=o[e+5],S=.1875*(g-2*w+v),I=.1875*(x-2*y+b),k=.09375*(3*(w-v)-g+A),T=.09375*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.75*(w-g)+S+.16666667*k,F=.75*(y-x)+I+.16666667*T,p+=Math.sqrt(R*R+F*F),R+=E,F+=C,E+=k,C+=T,p+=Math.sqrt(R*R+F*F),R+=E,F+=C,p+=Math.sqrt(R*R+F*F),R+=E+k,F+=C+T,p+=Math.sqrt(R*R+F*F),f[t]=p,g=A,x=M;switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:d=p;break;case 3:d=p/e;break;default:d=1}let Y=this.segments,X=0;for(let t=0,s=0,c=0,m=0;t<e;t++,s+=3){let e=r[t]*d;n+=e;let P=n;if(h)P%=p,P<0&&(P+=p),c=0;else{if(P<0){this.addBeforePosition(P,o,0,a,s);continue}if(P>p){this.addAfterPosition(P-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(P>t)){if(0==c)P/=t;else{let e=f[c-1];P=(P-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],y=o[t+3],v=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],S=.03*(g-2*w+v),I=.03*(x-2*y+b),k=.006*(3*(w-v)-g+A),T=.006*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.3*(w-g)+S+.16666667*k,F=.3*(y-x)+I+.16666667*T,X=Math.sqrt(R*R+F*F),Y[0]=X,t=1;t<8;t++)R+=E,F+=C,E+=k,C+=T,X+=Math.sqrt(R*R+F*F),Y[t]=X;R+=E,F+=C,X+=Math.sqrt(R*R+F*F),Y[8]=X,R+=E+k,F+=C+T,X+=Math.sqrt(R*R+F*F),Y[9]=X,m=0}for(P*=X;;m++){let t=Y[m];if(!(P>t)){if(0==m)P/=t;else{let e=Y[m-1];P=m+(P-e)/(t-e)}break}}this.addCurvePosition(.1*P,g,x,w,y,v,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,y=p*w,v=w*t,b=e*g+s*y+r*v+o*f,A=i*g+n*y+a*v+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(A-(i*m+n*x*2+a*d),b-(e*m+s*x*2+r*d)))}},be=ve;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=i}isActive(){return this.active}update(){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;f<x;f++){let x=g[f];if(0!=t){let e=x.a,i=x.b,s=x.c,n=x.d,r=Math.atan2(u,h)-Math.atan2(s,e)+p;r>c.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*r;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*n,x.d=Math.sin(s)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;f<x;f++){let x=g[f];if(0!=t){let e=x.a,i=x.b,s=x.c,n=x.d,r=Math.atan2(u,h)+p;r>c.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*r;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],c=l.arotation;if(0!=t){let e=a.arotation-c+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),c+=e*t}let u=l.ax,d=l.ay;u+=(a.ax-u+this.data.offsetX)*e,d+=(a.ay-d+this.data.offsetY)*i;let f=l.ascaleX,p=l.ascaleY;0!=s&&0!=f&&(f=(f+(a.ascaleX-f+this.data.offsetScaleX)*s)/f),0!=n&&0!=p&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p);let m=l.ashearY;if(0!=r){let t=a.ashearY-m+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),m+=t*r}l.updateWorldTransformWith(u,d,c,f,p,l.ashearX,m)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],c=l.arotation+(a.arotation+this.data.offsetRotation)*t,u=l.ax+(a.ax+this.data.offsetX)*e,d=l.ay+(a.ay+this.data.offsetY)*i,f=l.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*s+1),p=l.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*n+1),m=l.ashearY+(a.ashearY+this.data.offsetShearY)*r;l.updateWorldTransformWith(u,d,c,f,p,l.ashearX,m)}}},Se=class{constructor(t){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let i,s=t.bones[e];if(s.parent){let t=this.bones[s.parent.index];i=new he(s,this,t),t.children.push(i)}else i=new he(s,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let i=t.slots[e],s=this.bones[i.boneData.index],n=new Ae(i,s);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let i=t.ikConstraints[e];this.ikConstraints.push(new pe(i,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let i=t.transformConstraints[e];this.transformConstraints.push(new Me(i,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let i=t.pathConstraints[e];this.pathConstraints.push(new be(i,this))}this.color=new h(1,1,1,1),this.updateCache()}get scaleY(){return Se.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,i=this.skin.bones.length;e<i;e++){let i=this.bones[t[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(i)}}let e=this.ikConstraints,i=this.transformConstraints,s=this.pathConstraints,n=e.length,r=i.length,a=s.length,o=n+r+a;t:for(let t=0;t<o;t++){for(let i=0;i<n;i++){let s=e[i];if(s.data.order==t){this.sortIkConstraint(s);continue t}}for(let e=0;e<r;e++){let s=i[e];if(s.data.order==t){this.sortTransformConstraint(s);continue t}}for(let e=0;e<a;e++){let i=s[e];if(i.data.order==t){this.sortPathConstraint(i);continue t}}}for(let e=0,i=t.length;e<i;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let i=t.bones,s=i[0];if(this.sortBone(s),1==i.length)this._updateCache.push(t),this.sortReset(s.children);else{let e=i[i.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(s.children),e.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,i=e.data.index,s=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,s);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],i,s);let n=e.getAttachment();n instanceof ee&&this.sortPathConstraintAttachmentWith(n,s);let r=t.bones,a=r.length;for(let t=0;t<a;t++)this.sortBone(r[t]);this._updateCache.push(t);for(let t=0;t<a;t++)this.sortReset(r[t].children);for(let t=0;t<a;t++)r[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,i=e.length;if(t.data.local)for(let t=0;t<i;t++){let i=e[t];this.sortBone(i.parent),this.sortBone(i)}else for(let t=0;t<i;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<i;t++)this.sortReset(e[t].children);for(let t=0;t<i;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,i){let s=t.attachments[e];if(s)for(let t in s)this.sortPathConstraintAttachmentWith(s[t],i)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof ee))return;let i=t.bones;if(i){let t=this.bones;for(let e=0,s=i.length;e<s;){let s=i[e++];for(s+=e;e<s;)this.sortBone(t[i[e++]])}}else this.sortBone(e)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,i=t.length;e<i;e++){let i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}let e=this._updateCache;for(let t=0,i=e.length;t<i;t++)e[t].update()}updateWorldTransformWith(t){let e=this.getRootBone();if(!e)throw new Error("Root bone must not be null.");let i=t.a,s=t.b,n=t.c,r=t.d;e.worldX=i*this.x+s*this.y+t.worldX,e.worldY=n*this.x+r*this.y+t.worldY;let a=e.rotation+90+e.shearY,o=c.cosDeg(e.rotation+e.shearX)*e.scaleX,h=c.cosDeg(a)*e.scaleY,l=c.sinDeg(e.rotation+e.shearX)*e.scaleX,u=c.sinDeg(a)*e.scaleY;e.a=(i*o+s*l)*this.scaleX,e.b=(i*h+s*u)*this.scaleX,e.c=(n*o+r*l)*this.scaleY,e.d=(n*h+r*u)*this.scaleY;let d=this._updateCache;for(let t=0,i=d.length;t<i;t++){let i=d[t];i!=e&&i.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose();let e=this.ikConstraints;for(let t=0,i=e.length;t<i;t++){let i=e[t];i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}let i=this.transformConstraints;for(let t=0,e=i.length;t<e;t++){let e=i[t],s=e.data;e.mixRotate=s.mixRotate,e.mixX=s.mixX,e.mixY=s.mixY,e.mixScaleX=s.mixScaleX,e.mixScaleY=s.mixScaleY,e.mixShearY=s.mixShearY}let s=this.pathConstraints;for(let t=0,e=s.length;t<e;t++){let e=s[t],i=e.data;e.position=i.position,e.spacing=i.spacing,e.mixRotate=i.mixRotate,e.mixX=i.mixX,e.mixY=i.mixY}}setSlotsToSetupPose(){let t=this.slots;m.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i],n=s.data.attachmentName;if(n){let e=t.getAttachment(i,n);e&&s.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let i=this.data.findSlot(t);if(!i)throw new Error("Can't find slot with name "+t);return this.getAttachment(i.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let s=0,n=i.length;s<n;s++){let n=i[s];if(n.data.name==t){let i=null;if(e&&(i=this.getAttachment(s,e),!i))throw new Error("Attachment not found: "+e+", for slot: "+t);return void n.setAttachment(i)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}getBoundsRect(){let t=new w,e=new w;return this.getBounds(t,e),{x:t.x,y:t.y,width:e.x,height:e.y}}getBounds(t,e,i=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let s=this.drawOrder,n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let t=0,e=s.length;t<e;t++){let e=s[t];if(!e.bone.active)continue;let h=0,l=null,c=e.getAttachment();if(c instanceof ne)h=8,l=m.setArraySize(i,h,0),c.computeWorldVertices(e,l,0,2);else if(c instanceof te){let t=c;h=t.worldVerticesLength,l=m.setArraySize(i,h,0),t.computeWorldVertices(e,0,h,l,0,2)}if(l)for(let t=0,e=l.length;t<e;t+=2){let e=l[t],i=l[t+1];n=Math.min(n,e),r=Math.min(r,i),a=Math.max(a,e),o=Math.max(o,i)}}t.set(n,r),e.set(a-n,o-r)}},Ie=Se;Ie.yDown=!1;var ke=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}},Te=class{constructor(t=0,e,i){this.slotIndex=t,this.name=e,this.attachment=i}},Ee=class{constructor(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,i){if(!i)throw new Error("attachment cannot be null.");let s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];this.setAttachment(i.slotIndex,i.name,i.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];i.attachment&&(i.attachment instanceof te?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(t,e){let i=this.attachments[t];return i?i[e]:null}removeAttachment(t,e){let i=this.attachments[t];i&&delete i[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let i=this.attachments[e];if(i)for(let s in i){let n=i[s];n&&t.push(new Te(e,s,n))}}return t}getAttachmentsForSlot(t,e){let i=this.attachments[t];if(i)for(let s in i){let n=i[s];n&&e.push(new Te(t,s,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let i=0;for(let s=0;s<t.slots.length;s++){let n=t.slots[s],r=n.getAttachment();if(r&&i<e.attachments.length){let t=e.attachments[i];for(let e in t){if(r==t[e]){let t=this.getAttachment(i,e);t&&n.setAttachment(t);break}}}i++}}},Ce=class{constructor(t,e,i){if(this.index=0,this.color=new h(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=Re.Normal,t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke;i.name="";let s=new Xe(t),n=s.readInt32(),r=s.readInt32();i.hash=0==r&&0==n?null:r.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readString();if(!t)throw new Error("String in string table must not be null.");s.strings.push(t)}o=s.readInt(!0);for(let t=0;t<o;t++){let n=s.readString();if(!n)throw new Error("Bone name must not be null.");let r=0==t?null:i.bones[s.readInt(!0)],o=new ae(t,n,r);o.rotation=s.readFloat(),o.x=s.readFloat()*e,o.y=s.readFloat()*e,o.scaleX=s.readFloat(),o.scaleY=s.readFloat(),o.shearX=s.readFloat(),o.shearY=s.readFloat(),o.length=s.readFloat()*e,o.transformMode=s.readInt(!0),o.skinRequired=s.readBoolean(),a&&h.rgba8888ToColor(o.color,s.readInt32()),i.bones.push(o)}o=s.readInt(!0);for(let t=0;t<o;t++){let e=s.readString();if(!e)throw new Error("Slot name must not be null.");let n=i.bones[s.readInt(!0)],r=new Ce(t,e,n);h.rgba8888ToColor(r.color,s.readInt32());let a=s.readInt32();-1!=a&&h.rgb888ToColor(r.darkColor=new h,a),r.attachmentName=s.readStringRef(),r.blendMode=s.readInt(!0),i.slots.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("IK constraint data name must not be null.");let r=new me(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.mix=s.readFloat(),r.softness=s.readFloat()*e,r.bendDirection=s.readByte(),r.compress=s.readBoolean(),r.stretch=s.readBoolean(),r.uniform=s.readBoolean(),i.ikConstraints.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("Transform constraint data name must not be null.");let r=new Fe(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.local=s.readBoolean(),r.relative=s.readBoolean(),r.offsetRotation=s.readFloat(),r.offsetX=s.readFloat()*e,r.offsetY=s.readFloat()*e,r.offsetScaleX=s.readFloat(),r.offsetScaleY=s.readFloat(),r.offsetShearY=s.readFloat(),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),r.mixScaleX=s.readFloat(),r.mixScaleY=s.readFloat(),r.mixShearY=s.readFloat(),i.transformConstraints.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("Path constraint data name must not be null.");let r=new ge(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.slots[s.readInt(!0)],r.positionMode=s.readInt(!0),r.spacingMode=s.readInt(!0),r.rotateMode=s.readInt(!0),r.offsetRotation=s.readFloat(),r.position=s.readFloat(),0==r.positionMode&&(r.position*=e),r.spacing=s.readFloat(),0!=r.spacingMode&&1!=r.spacingMode||(r.spacing*=e),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),i.pathConstraints.push(r)}let l=this.readSkin(s,i,!0,a);l&&(i.defaultSkin=l,i.skins.push(l));{let t=i.skins.length;for(m.setArraySize(i.skins,o=t+s.readInt(!0));t<o;t++){let e=this.readSkin(s,i,!1,a);if(!e)throw new Error("readSkin() should not have returned null.");i.skins[t]=e}}o=this.linkedMeshes.length;for(let t=0;t<o;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error("Not skin found for linked mesh.");if(!e.parent)throw new Error("Linked mesh parent must not be null");let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error("Parent mesh not found: "+e.parent);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readStringRef();if(!t)throw new Error;let e=new fe(t);e.intValue=s.readInt(!1),e.floatValue=s.readFloat(),e.stringValue=s.readString(),e.audioPath=s.readString(),e.audioPath&&(e.volume=s.readFloat(),e.balance=s.readFloat()),i.events.push(e)}o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readString();if(!t)throw new Error("Animatio name must not be null.");i.animations.push(this.readAnimation(s,t,i))}return i}readSkin(t,e,i,s){let n=null,r=0;if(i){if(r=t.readInt(!0),0==r)return null;n=new Ee("default")}else{let i=t.readStringRef();if(!i)throw new Error("Skin name must not be null.");n=new Ee(i),n.bones.length=t.readInt(!0);for(let i=0,s=n.bones.length;i<s;i++)n.bones[i]=e.bones[t.readInt(!0)];for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);r=t.readInt(!0)}for(let i=0;i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("Attachment name must not be null");let a=this.readAttachment(t,e,n,i,r,s);a&&n.setAttachment(i,r,a)}}return n}readAttachment(t,e,i,s,n,r){let a=this.scale,o=t.readStringRef();switch(o||(o=n),t.readByte()){case De.Region:{let e=t.readStringRef(),s=t.readFloat(),n=t.readFloat(),r=t.readFloat(),l=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),f=t.readInt32(),p=this.readSequence(t);e||(e=o);let m=this.attachmentLoader.newRegionAttachment(i,o,e,p);return m?(m.path=e,m.x=n*a,m.y=r*a,m.scaleX=l,m.scaleY=c,m.rotation=s,m.width=u*a,m.height=d*a,h.rgba8888ToColor(m.color,f),m.sequence=p,null==p&&m.updateRegion(),m):null}case De.BoundingBox:{let e=t.readInt(!0),s=this.readVertices(t,e),n=r?t.readInt32():0,a=this.attachmentLoader.newBoundingBoxAttachment(i,o);return a?(a.worldVerticesLength=e<<1,a.vertices=s.vertices,a.bones=s.bones,r&&h.rgba8888ToColor(a.color,n),a):null}case De.Mesh:{let e=t.readStringRef(),s=t.readInt32(),n=t.readInt(!0),l=this.readFloatArray(t,n<<1,1),c=this.readShortArray(t),u=this.readVertices(t,n),d=t.readInt(!0),f=this.readSequence(t),p=[],m=0,g=0;r&&(p=this.readShortArray(t),m=t.readFloat(),g=t.readFloat()),e||(e=o);let x=this.attachmentLoader.newMeshAttachment(i,o,e,f);return x?(x.path=e,h.rgba8888ToColor(x.color,s),x.bones=u.bones,x.vertices=u.vertices,x.worldVerticesLength=n<<1,x.triangles=c,x.regionUVs=l,null==f&&x.updateRegion(),x.hullLength=d<<1,x.sequence=f,r&&(x.edges=p,x.width=m*a,x.height=g*a),x):null}case De.LinkedMesh:{let e=t.readStringRef(),n=t.readInt32(),l=t.readStringRef(),c=t.readStringRef(),u=t.readBoolean(),d=this.readSequence(t),f=0,p=0;r&&(f=t.readFloat(),p=t.readFloat()),e||(e=o);let m=this.attachmentLoader.newMeshAttachment(i,o,e,d);return m?(m.path=e,h.rgba8888ToColor(m.color,n),m.sequence=d,r&&(m.width=f*a,m.height=p*a),this.linkedMeshes.push(new Pe(m,l,s,c,u)),m):null}case De.Path:{let e=t.readBoolean(),s=t.readBoolean(),n=t.readInt(!0),l=this.readVertices(t,n),c=m.newArray(n/3,0);for(let e=0,i=c.length;e<i;e++)c[e]=t.readFloat()*a;let u=r?t.readInt32():0,d=this.attachmentLoader.newPathAttachment(i,o);return d?(d.closed=e,d.constantSpeed=s,d.worldVerticesLength=n<<1,d.vertices=l.vertices,d.bones=l.bones,d.lengths=c,r&&h.rgba8888ToColor(d.color,u),d):null}case De.Point:{let e=t.readFloat(),s=t.readFloat(),n=t.readFloat(),l=r?t.readInt32():0,c=this.attachmentLoader.newPointAttachment(i,o);return c?(c.x=s*a,c.y=n*a,c.rotation=e,r&&h.rgba8888ToColor(c.color,l),c):null}case De.Clipping:{let s=t.readInt(!0),n=t.readInt(!0),a=this.readVertices(t,n),l=r?t.readInt32():0,c=this.attachmentLoader.newClippingAttachment(i,o);return c?(c.endSlot=e.slots[s],c.worldVerticesLength=n<<1,c.vertices=a.vertices,c.bones=a.bones,r&&h.rgba8888ToColor(c.color,l),c):null}}return null}readSequence(t){if(!t.readBoolean())return null;let e=new I(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){let i=this.scale,s=e<<1,n=new Le;if(!t.readBoolean())return n.vertices=this.readFloatArray(t,s,i),n;let r=new Array,a=new Array;for(let s=0;s<e;s++){let e=t.readInt(!0);a.push(e);for(let s=0;s<e;s++)a.push(t.readInt(!0)),r.push(t.readFloat()*i),r.push(t.readFloat()*i),r.push(t.readFloat())}return n.vertices=m.toFloatArray(r),n.bones=a,n}readFloatArray(t,e,i){let s=new Array(e);if(1==i)for(let i=0;i<e;i++)s[i]=t.readFloat();else for(let n=0;n<e;n++)s[n]=t.readFloat()*i;return s}readShortArray(t){let e=t.readInt(!0),i=new Array(e);for(let s=0;s<e;s++)i[s]=t.readShort();return i}readAnimation(t,e,i){t.readInt(!0);let s=new Array,n=this.scale;new h,new h;for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,n=t.readInt(!0);i<n;i++){let i=t.readByte(),n=t.readInt(!0),r=n-1;switch(i){case Je:{let i=new gt(n,e);for(let e=0;e<n;e++)i.setFrame(e,t.readFloat(),t.readStringRef());s.push(i);break}case Qe:{let i=t.readInt(!0),a=new ut(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,d,1),Ve(t,a,i++,e,3,o,s,u,f,1)}o=s,h=n,l=r,c=d,u=f}s.push(a);break}case $e:{let i=t.readInt(!0),a=new dt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,u,1)}o=s,h=n,l=r,c=u}s.push(a);break}case ti:{let i=t.readInt(!0),a=new pt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u,d,f,p),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,y=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,m,1),Ve(t,a,i++,e,3,o,s,u,g,1),Ve(t,a,i++,e,4,o,s,d,x,1),Ve(t,a,i++,e,5,o,s,f,w,1),Ve(t,a,i++,e,6,o,s,p,y,1)}o=s,h=n,l=r,c=m,u=g,d=x,f=w,p=y}s.push(a);break}case ei:{let i=t.readInt(!0),a=new mt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u,d,f),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,p,1),Ve(t,a,i++,e,3,o,s,u,m,1),Ve(t,a,i++,e,4,o,s,d,g,1),Ve(t,a,i++,e,5,o,s,f,x,1)}o=s,h=n,l=r,c=p,u=m,d=g,f=x}s.push(a);break}case ii:{let i=new ft(n,t.readInt(!0),e),a=t.readFloat(),o=t.readUnsignedByte()/255;for(let e=0,s=0;i.setFrame(e,a,o),e!=r;e++){let n=t.readFloat(),r=t.readUnsignedByte()/255;switch(t.readByte()){case hi:i.setStepped(e);break;case li:Ve(t,i,s++,e,0,a,n,o,r,1)}a=n,o=r}s.push(i)}}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readByte(),r=t.readInt(!0),a=t.readInt(!0);switch(i){case Ne:s.push(Oe(t,new et(r,a,e),1));break;case _e:s.push(Be(t,new it(r,a,e),n));break;case Ue:s.push(Oe(t,new st(r,a,e),n));break;case We:s.push(Oe(t,new nt(r,a,e),n));break;case qe:s.push(Be(t,new rt(r,a,e),1));break;case Ge:s.push(Oe(t,new at(r,a,e),1));break;case je:s.push(Oe(t,new ot(r,a,e),1));break;case He:s.push(Be(t,new ht(r,a,e),1));break;case Ze:s.push(Oe(t,new lt(r,a,e),1));break;case Ke:s.push(Oe(t,new ct(r,a,e),1))}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),r=i-1,a=new At(i,t.readInt(!0),e),o=t.readFloat(),h=t.readFloat(),l=t.readFloat()*n;for(let e=0,i=0;a.setFrame(e,o,h,l,t.readByte(),t.readBoolean(),t.readBoolean()),e!=r;e++){let s=t.readFloat(),r=t.readFloat(),c=t.readFloat()*n;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,r,1),Ve(t,a,i++,e,1,o,s,l,c,n)}o=s,h=r,l=c}s.push(a)}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),n=i-1,r=new Mt(i,t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat();for(let e=0,i=0;r.setFrame(e,a,o,h,l,c,u,d),e!=n;e++){let s=t.readFloat(),n=t.readFloat(),f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),g=t.readFloat(),x=t.readFloat();switch(t.readByte()){case hi:r.setStepped(e);break;case li:Ve(t,r,i++,e,0,a,s,o,n,1),Ve(t,r,i++,e,1,a,s,h,f,1),Ve(t,r,i++,e,2,a,s,l,p,1),Ve(t,r,i++,e,3,a,s,c,m,1),Ve(t,r,i++,e,4,a,s,u,g,1),Ve(t,r,i++,e,5,a,s,d,x,1)}a=s,o=n,h=f,l=p,c=m,u=g,d=x}s.push(r)}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0),r=i.pathConstraints[e];for(let i=0,a=t.readInt(!0);i<a;i++)switch(t.readByte()){case ri:s.push(Oe(t,new St(t.readInt(!0),t.readInt(!0),e),0==r.positionMode?n:1));break;case ai:s.push(Oe(t,new It(t.readInt(!0),t.readInt(!0),e),0==r.spacingMode||1==r.spacingMode?n:1));break;case oi:let i=new kt(t.readInt(!0),t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat();for(let e=0,s=0,n=i.getFrameCount()-1;i.setFrame(e,a,o,h,l),e!=n;e++){let n=t.readFloat(),r=t.readFloat(),c=t.readFloat(),u=t.readFloat();switch(t.readByte()){case hi:i.setStepped(e);break;case li:Ve(t,i,s++,e,0,a,n,o,r,1),Ve(t,i,s++,e,1,a,n,h,c,1),Ve(t,i,s++,e,2,a,n,l,u,1)}a=n,o=r,h=c,l=u}s.push(i)}}for(let e=0,r=t.readInt(!0);e<r;e++){let e=i.skins[t.readInt(!0)];for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("attachmentName must not be null.");let a=e.getAttachment(i,r),o=t.readByte(),h=t.readInt(!0),l=h-1;switch(o){case si:{let e=a,r=e.bones,o=e.vertices,c=r?o.length/3*2:o.length,u=t.readInt(!0),d=new xt(h,u,i,e),f=t.readFloat();for(let e=0,i=0;;e++){let s,a=t.readInt(!0);if(0==a)s=r?m.newFloatArray(c):o;else{s=m.newFloatArray(c);let e=t.readInt(!0);if(a+=e,1==n)for(let i=e;i<a;i++)s[i]=t.readFloat();else for(let i=e;i<a;i++)s[i]=t.readFloat()*n;if(!r)for(let t=0,e=s.length;t<e;t++)s[t]+=o[t]}if(d.setFrame(e,f,s),e==l)break;let h=t.readFloat();switch(t.readByte()){case hi:d.setStepped(e);break;case li:Ve(t,d,i++,e,0,f,h,0,1,1)}f=h}s.push(d);break}case ni:{let e=new Et(h,i,a);for(let i=0;i<h;i++){let s=t.readFloat(),n=t.readInt32();e.setFrame(i,s,T[15&n],n>>4,t.readFloat())}s.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),n=i.slots.length;for(let i=0;i<r;i++){let s=t.readFloat(),r=t.readInt(!0),a=m.newArray(n,0);for(let t=n-1;t>=0;t--)a[t]=-1;let o=m.newArray(n-r,0),h=0,l=0;for(let e=0;e<r;e++){let e=t.readInt(!0);for(;h!=e;)o[l++]=h++;a[h+t.readInt(!0)]=h++}for(;h<n;)o[l++]=h++;for(let t=n-1;t>=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s<a;s++){let n=t.readFloat(),r=i.events[t.readInt(!0)],a=new de(n,r);a.intValue=t.readInt(!1),a.floatValue=t.readFloat(),a.stringValue=t.readBoolean()?t.readString():r.stringValue,a.data.audioPath&&(a.volume=t.readFloat(),a.balance=t.readFloat()),e.setFrame(s,a)}s.push(e)}let o=0;for(let t=0,e=s.length;t<e;t++)o=Math.max(o,s[t].getDuration());return new E(e,s,o)}},Xe=class{constructor(t,e=new Array,i=0,s=new DataView(t.buffer)){this.strings=e,this.index=i,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),i=127&e;return 0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<7,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<14,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<21,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<28)))),t?i:i>>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Pe=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Oe(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:Ve(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function Be(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,n,l,i),Ve(t,e,o++,a,1,s,h,r,c,i)}s=h,n=l,r=c}return e}function Ve(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ni=1,ri=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t<a;t++){let e=r[t];if(!e.bone.active)continue;let a=e.getAttachment();if(a instanceof Ut){let t=a;i.push(t);let r=n.obtain();r.length!=t.worldVerticesLength&&(r=m.newFloatArray(t.worldVerticesLength)),s.push(r),t.computeWorldVertices(e,0,t.worldVerticesLength,r,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,n=this.polygons;for(let r=0,a=n.length;r<a;r++){let a=n[r],o=a;for(let n=0,r=a.length;n<r;n+=2){let r=o[n],a=o[n+1];t=Math.min(t,r),e=Math.min(e,a),i=Math.max(i,r),s=Math.max(s,a)}}this.minX=t,this.minY=e,this.maxX=i,this.maxY=s}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&l<o)return!0;if(l=h*(a-t)+e,l>r&&l<o)return!0;let c=(r-e)/h+t;return c>n&&c<a||(c=(o-e)/h+t,c>n&&c<a)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s<n;s++)if(this.containsPointPolygon(i[s],t,e))return this.boundingBoxes[s];return null}containsPointPolygon(t,e,i){let s=t,n=t.length,r=n-2,a=!1;for(let t=0;t<n;t+=2){let n=s[t+1],o=s[r+1];if(n<i&&o>=i||o<i&&n>=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)<e&&(a=!a)}r=t}return a}intersectsSegment(t,e,i,s){let n=this.polygons;for(let r=0,a=n.length;r<a;r++)if(this.intersectsSegmentPolygon(n[r],t,e,i,s))return this.boundingBoxes[r];return null}intersectsSegmentPolygon(t,e,i,s,n){let r=t,a=t.length,o=e-s,h=i-n,l=e*n-i*s,c=r[a-2],u=r[a-1];for(let t=0;t<a;t+=2){let a=r[t],d=r[t+1],f=c*d-u*a,p=c-a,m=u-d,g=o*m-h*p,x=(l*p-o*f)/g;if((x>=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t<i;t++)s[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,r=i;t<r;++t)n[t]=ui.isConcave(t,i,e,s);let r=this.triangles;for(r.length=0;i>3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[r],u=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=ui.isConcave(h,i,e,s),n[l]=ui.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t<l;t+=3){let l=e[t]<<1,c=e[t+1]<<1,u=e[t+2]<<1,d=i[l],f=i[l+1],p=i[c],m=i[c+1],g=i[u],x=i[u+1],w=!1;if(o==l){let t=a.length-4,e=ui.winding(a[t],a[t+1],a[t+2],a[t+3],g,x),i=ui.winding(g,x,a[0],a[1],a[2],a[3]);e==h&&i==h&&(a.push(g),a.push(x),r.push(u),w=!0)}w||(a.length>0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(c),r.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t<e;t++){if(r=n[t],0==r.length)continue;let i=r[0],o=r[r.length-1];a=s[t];let h=a.length-4,l=a[h],c=a[h+1],u=a[h+2],d=a[h+3],f=a[0],p=a[1],m=a[2],g=a[3],x=ui.winding(l,c,u,d,f,p);for(let h=0;h<e;h++){if(h==t)continue;let e=n[h];if(3!=e.length)continue;let w=e[0],y=e[1],v=e[2],b=s[h],A=b[b.length-2],M=b[b.length-1];if(w!=i||y!=o)continue;let S=ui.winding(l,c,u,d,A,M),I=ui.winding(A,M,f,p,m,g);S==x&&I==x&&(b.length=0,e.length=0,a.push(A),a.push(M),r.push(v),l=u,c=d,u=A,d=M,h=0)}}for(let t=s.length-1;t>=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;di.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t<e;t++){let e=r[t];di.makeClockwise(e),e.push(e[0]),e.push(e[1])}return r.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,i,s,n,r,a,o){let h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,f=o?12:8,p=0;l.length=0,c.length=0;t:for(let e=0;e<s;e+=3){let s=i[e]<<1,g=t[s],x=t[s+1],w=n[s],y=n[s+1];s=i[e+1]<<1;let v=t[s],b=t[s+1],A=n[s],M=n[s+1];s=i[e+2]<<1;let S=t[s],I=t[s+1],k=n[s],T=n[s+1];for(let t=0;t<d;t++){let e=l.length;if(!this.clip(g,x,v,b,S,I,u[t],h)){let t=m.setArraySize(l,e+3*f);t[e]=g,t[e+1]=x,t[e+2]=r.r,t[e+3]=r.g,t[e+4]=r.b,t[e+5]=r.a,o?(t[e+6]=w,t[e+7]=y,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=v,t[e+13]=b,t[e+14]=r.r,t[e+15]=r.g,t[e+16]=r.b,t[e+17]=r.a,t[e+18]=A,t[e+19]=M,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=S,t[e+25]=I,t[e+26]=r.r,t[e+27]=r.g,t[e+28]=r.b,t[e+29]=r.a,t[e+30]=k,t[e+31]=T,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=w,t[e+7]=y,t[e+8]=v,t[e+9]=b,t[e+10]=r.r,t[e+11]=r.g,t[e+12]=r.b,t[e+13]=r.a,t[e+14]=A,t[e+15]=M,t[e+16]=S,t[e+17]=I,t[e+18]=r.r,t[e+19]=r.g,t[e+20]=r.b,t[e+21]=r.a,t[e+22]=k,t[e+23]=T),e=c.length;let i=m.setArraySize(c,e+3);i[e]=p,i[e+1]=p+1,i[e+2]=p+2,p+=3;continue t}{let t=h.length;if(0==t)continue;let i=b-I,s=S-v,n=g-S,u=I-x,d=1/(i*n+s*(x-I)),E=t>>1,C=this.clipOutput,R=m.setArraySize(l,e+E*f);for(let h=0;h<t;h+=2){let t=C[h],l=C[h+1];R[e]=t,R[e+1]=l,R[e+2]=r.r,R[e+3]=r.g,R[e+4]=r.b,R[e+5]=r.a;let c=t-S,p=l-I,m=(i*c+s*p)*d,g=(u*c+n*p)*d,x=1-m-g;R[e+6]=w*m+A*g+k*x,R[e+7]=y*m+M*g+T*x,o&&(R[e+8]=a.r,R[e+9]=a.g,R[e+10]=a.b,R[e+11]=a.a),e+=f}e=c.length;let F=m.setArraySize(c,e+3*(E-2));E--;for(let t=1;t<E;t++)F[e]=p,F[e+1]=p+t,F[e+2]=p+t+1,e+=3;p+=E+1}}}}clip(t,e,i,s,n,r,a,o){let h,l=o,c=!1;a.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],n=u[t+3],r=e-s,a=i-n,f=h,p=h.length-2,m=o.length;for(let t=0;t<p;t+=2){let h=f[t],l=f[t+1],u=f[t+2],d=f[t+3],p=r*(d-n)-a*(u-s)>0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t<e;t++)l[t]=o[t]}else l.length=l.length-2;return c}static makeClockwise(t){let e=t,i=t.length,s=e[i-2]*e[1]-e[0]*e[i-1],n=0,r=0,a=0,o=0;for(let t=0,h=i-3;t<h;t+=2)n=e[t],r=e[t+1],a=e[t+2],o=e[t+3],s+=n*o-a*r;if(!(s<0))for(let t=0,s=i-2,n=i>>1;t<n;t+=2){let i=e[t],n=e[t+1],r=s-t;e[t]=e[r],e[t+1]=e[r+1],e[r]=i,e[r+1]=n}}},fi=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke,s="string"==typeof t?JSON.parse(t):t,n=s.skeleton;if(n&&(i.hash=n.hash,i.version=n.spine,i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height,i.fps=n.fps,i.imagesPath=n.images),s.bones)for(let t=0;t<s.bones.length;t++){let n=s.bones[t],r=null,a=wi(n,"parent",null);a&&(r=i.findBone(a));let o=new ae(i.bones.length,n.name,r);o.length=wi(n,"length",0)*e,o.x=wi(n,"x",0)*e,o.y=wi(n,"y",0)*e,o.rotation=wi(n,"rotation",0),o.scaleX=wi(n,"scaleX",1),o.scaleY=wi(n,"scaleY",1),o.shearX=wi(n,"shearX",0),o.shearY=wi(n,"shearY",0),o.transformMode=m.enumValue(oe,wi(n,"transform","Normal")),o.skinRequired=wi(n,"skin",!1);let h=wi(n,"color",null);h&&o.color.setFromString(h),i.bones.push(o)}if(s.slots)for(let t=0;t<s.slots.length;t++){let e=s.slots[t],n=i.findBone(e.bone);if(!n)throw new Error(`Couldn't find bone ${e.bone} for slot ${e.name}`);let r=new Ce(i.slots.length,e.name,n),a=wi(e,"color",null);a&&r.color.setFromString(a);let o=wi(e,"dark",null);o&&(r.darkColor=h.fromString(o)),r.attachmentName=wi(e,"attachment",null),r.blendMode=m.enumValue(Re,wi(e,"blend","normal")),i.slots.push(r)}if(s.ik)for(let t=0;t<s.ik.length;t++){let n=s.ik[t],r=new me(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=i.findBone(n.bones[t]);if(!e)throw new Error(`Couldn't find bone ${n.bones[t]} for IK constraint ${n.name}.`);r.bones.push(e)}let a=i.findBone(n.target);if(!a)throw new Error(`Couldn't find target bone ${n.target} for IK constraint ${n.name}.`);r.target=a,r.mix=wi(n,"mix",1),r.softness=wi(n,"softness",0)*e,r.bendDirection=wi(n,"bendPositive",!0)?1:-1,r.compress=wi(n,"compress",!1),r.stretch=wi(n,"stretch",!1),r.uniform=wi(n,"uniform",!1),i.ikConstraints.push(r)}if(s.transform)for(let t=0;t<s.transform.length;t++){let n=s.transform[t],r=new Fe(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for transform constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findBone(a);if(!o)throw new Error(`Couldn't find target bone ${a} for transform constraint ${n.name}.`);r.target=o,r.local=wi(n,"local",!1),r.relative=wi(n,"relative",!1),r.offsetRotation=wi(n,"rotation",0),r.offsetX=wi(n,"x",0)*e,r.offsetY=wi(n,"y",0)*e,r.offsetScaleX=wi(n,"scaleX",0),r.offsetScaleY=wi(n,"scaleY",0),r.offsetShearY=wi(n,"shearY",0),r.mixRotate=wi(n,"mixRotate",1),r.mixX=wi(n,"mixX",1),r.mixY=wi(n,"mixY",r.mixX),r.mixScaleX=wi(n,"mixScaleX",1),r.mixScaleY=wi(n,"mixScaleY",r.mixScaleX),r.mixShearY=wi(n,"mixShearY",1),i.transformConstraints.push(r)}if(s.path)for(let t=0;t<s.path.length;t++){let n=s.path[t],r=new ge(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for path constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findSlot(a);if(!o)throw new Error(`Couldn't find target slot ${a} for path constraint ${n.name}.`);r.target=o,r.positionMode=m.enumValue(xe,wi(n,"positionMode","Percent")),r.spacingMode=m.enumValue(we,wi(n,"spacingMode","Length")),r.rotateMode=m.enumValue(ye,wi(n,"rotateMode","Tangent")),r.offsetRotation=wi(n,"rotation",0),r.position=wi(n,"position",0),0==r.positionMode&&(r.position*=e),r.spacing=wi(n,"spacing",0),0!=r.spacingMode&&1!=r.spacingMode||(r.spacing*=e),r.mixRotate=wi(n,"mixRotate",1),r.mixX=wi(n,"mixX",1),r.mixY=wi(n,"mixY",r.mixX),i.pathConstraints.push(r)}if(s.skins)for(let t=0;t<s.skins.length;t++){let e=s.skins[t],n=new Ee(e.name);if(e.bones)for(let t=0;t<e.bones.length;t++){let s=e.bones[t],r=i.findBone(s);if(!r)throw new Error(`Couldn't find bone ${s} for skin ${e.name}.`);n.bones.push(r)}if(e.ik)for(let t=0;t<e.ik.length;t++){let s=e.ik[t],r=i.findIkConstraint(s);if(!r)throw new Error(`Couldn't find IK constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.transform)for(let t=0;t<e.transform.length;t++){let s=e.transform[t],r=i.findTransformConstraint(s);if(!r)throw new Error(`Couldn't find transform constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.path)for(let t=0;t<e.path.length;t++){let s=e.path[t],r=i.findPathConstraint(s);if(!r)throw new Error(`Couldn't find path constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}for(let t in e.attachments){let s=i.findSlot(t);if(!s)throw new Error(`Couldn't find slot ${t} for skin ${e.name}.`);let r=e.attachments[t];for(let t in r){let e=this.readAttachment(r[t],n,s.index,t,i);e&&n.setAttachment(s.index,t,e)}}i.skins.push(n),"default"==n.name&&(i.defaultSkin=n)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error("Skin not found: "+e.skin);let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error("Parent mesh not found: "+e.parent);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(let t in s.events){let e=s.events[t],n=new fe(t);n.intValue=wi(e,"int",0),n.floatValue=wi(e,"float",0),n.stringValue=wi(e,"string",""),n.audioPath=wi(e,"audio",null),n.audioPath&&(n.volume=wi(e,"volume",1),n.balance=wi(e,"balance",0)),i.events.push(n)}if(s.animations)for(let t in s.animations){let e=s.animations[t];this.readAnimation(e,t,i)}return i}readAttachment(t,e,i,s,n){let r=this.scale;switch(s=wi(t,"name",s),wi(t,"type","region")){case"region":{let i=wi(t,"path",s),n=this.readSequence(wi(t,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(e,s,i,n);if(!a)return null;a.path=i,a.x=wi(t,"x",0)*r,a.y=wi(t,"y",0)*r,a.scaleX=wi(t,"scaleX",1),a.scaleY=wi(t,"scaleY",1),a.rotation=wi(t,"rotation",0),a.width=t.width*r,a.height=t.height*r,a.sequence=n;let o=wi(t,"color",null);return o&&a.color.setFromString(o),null!=a.region&&a.updateRegion(),a}case"boundingbox":{let i=this.attachmentLoader.newBoundingBoxAttachment(e,s);if(!i)return null;this.readVertices(t,i,t.vertexCount<<1);let n=wi(t,"color",null);return n&&i.color.setFromString(n),i}case"mesh":case"linkedmesh":{let n=wi(t,"path",s),a=this.readSequence(wi(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(e,s,n,a);if(!o)return null;o.path=n;let h=wi(t,"color",null);h&&o.color.setFromString(h),o.width=wi(t,"width",0)*r,o.height=wi(t,"height",0)*r,o.sequence=a;let l=wi(t,"parent",null);if(l)return this.linkedMeshes.push(new pi(o,wi(t,"skin",null),i,l,wi(t,"timelines",!0))),o;let c=t.uvs;return this.readVertices(t,o,c.length),o.triangles=t.triangles,o.regionUVs=c,null!=o.region&&o.updateRegion(),o.edges=wi(t,"edges",null),o.hullLength=2*wi(t,"hull",0),o}case"path":{let i=this.attachmentLoader.newPathAttachment(e,s);if(!i)return null;i.closed=wi(t,"closed",!1),i.constantSpeed=wi(t,"constantSpeed",!0);let n=t.vertexCount;this.readVertices(t,i,n<<1);let a=m.newArray(n/3,0);for(let e=0;e<t.lengths.length;e++)a[e]=t.lengths[e]*r;i.lengths=a;let o=wi(t,"color",null);return o&&i.color.setFromString(o),i}case"point":{let i=this.attachmentLoader.newPointAttachment(e,s);if(!i)return null;i.x=wi(t,"x",0)*r,i.y=wi(t,"y",0)*r,i.rotation=wi(t,"rotation",0);let n=wi(t,"color",null);return n&&i.color.setFromString(n),i}case"clipping":{let i=this.attachmentLoader.newClippingAttachment(e,s);if(!i)return null;let r=wi(t,"end",null);r&&(i.endSlot=n.findSlot(r));let a=t.vertexCount;this.readVertices(t,i,a<<1);let o=wi(t,"color",null);return o&&i.color.setFromString(o),i}}return null}readSequence(t){if(null==t)return null;let e=new I(wi(t,"count",0));return e.start=wi(t,"start",1),e.digits=wi(t,"digits",0),e.setupIndex=wi(t,"setup",0),e}readVertices(t,e,i){let s=this.scale;e.worldVerticesLength=i;let n=t.vertices;if(i==n.length){let t=m.toFloatArray(n);if(1!=s)for(let e=0,i=n.length;e<i;e++)t[e]*=s;return void(e.vertices=t)}let r=new Array,a=new Array;for(let t=0,e=n.length;t<e;){let e=n[t++];a.push(e);for(let i=t+4*e;t<i;t+=4)a.push(n[t]),r.push(n[t+1]*s),r.push(n[t+2]*s),r.push(n[t+3])}e.bones=a,e.vertices=m.toFloatArray(r)}readAnimation(t,e,i){let s=this.scale,n=new Array;if(t.slots)for(let e in t.slots){let s=t.slots[e],r=i.findSlot(e);if(!r)throw new Error("Slot not found: "+e);let a=r.index;for(let t in s){let e=s[t];if(!e)continue;let i=e.length;if("attachment"==t){let t=new gt(i,a);for(let s=0;s<i;s++){let i=e[s];t.setFrame(s,wi(i,"time",0),wi(i,"name",null))}n.push(t)}else if("rgba"==t){let t=new ut(i,i<<2,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,o.a);let a=e[i+1];if(!a){t.shrink(n);break}let l=wi(a,"time",0),c=h.fromString(a.color),u=s.curve;u&&(n=xi(u,t,n,i,0,r,l,o.r,c.r,1),n=xi(u,t,n,i,1,r,l,o.g,c.g,1),n=xi(u,t,n,i,2,r,l,o.b,c.b,1),n=xi(u,t,n,i,3,r,l,o.a,c.a,1)),r=l,o=c,s=a}n.push(t)}else if("rgb"==t){let t=new dt(i,3*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b);let a=e[i+1];if(!a){t.shrink(n);break}let l=wi(a,"time",0),c=h.fromString(a.color),u=s.curve;u&&(n=xi(u,t,n,i,0,r,l,o.r,c.r,1),n=xi(u,t,n,i,1,r,l,o.g,c.g,1),n=xi(u,t,n,i,2,r,l,o.b,c.b,1)),r=l,o=c,s=a}n.push(t)}else if("alpha"==t)n.push(mi(e,new ft(i,i,a),0,1));else if("rgba2"==t){let t=new pt(i,7*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.light),l=h.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,o.a,l.r,l.g,l.b);let a=e[i+1];if(!a){t.shrink(n);break}let c=wi(a,"time",0),u=h.fromString(a.light),d=h.fromString(a.dark),f=s.curve;f&&(n=xi(f,t,n,i,0,r,c,o.r,u.r,1),n=xi(f,t,n,i,1,r,c,o.g,u.g,1),n=xi(f,t,n,i,2,r,c,o.b,u.b,1),n=xi(f,t,n,i,3,r,c,o.a,u.a,1),n=xi(f,t,n,i,4,r,c,l.r,d.r,1),n=xi(f,t,n,i,5,r,c,l.g,d.g,1),n=xi(f,t,n,i,6,r,c,l.b,d.b,1)),r=c,o=u,l=d,s=a}n.push(t)}else if("rgb2"==t){let t=new mt(i,6*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.light),l=h.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,l.r,l.g,l.b);let a=e[i+1];if(!a){t.shrink(n);break}let c=wi(a,"time",0),u=h.fromString(a.light),d=h.fromString(a.dark),f=s.curve;f&&(n=xi(f,t,n,i,0,r,c,o.r,u.r,1),n=xi(f,t,n,i,1,r,c,o.g,u.g,1),n=xi(f,t,n,i,2,r,c,o.b,u.b,1),n=xi(f,t,n,i,3,r,c,l.r,d.r,1),n=xi(f,t,n,i,4,r,c,l.g,d.g,1),n=xi(f,t,n,i,5,r,c,l.b,d.b,1)),r=c,o=u,l=d,s=a}n.push(t)}}}if(t.bones)for(let e in t.bones){let r=t.bones[e],a=i.findBone(e);if(!a)throw new Error("Bone not found: "+e);let o=a.index;for(let t in r){let e=r[t],i=e.length;if(0!=i)if("rotate"===t)n.push(mi(e,new et(i,i,o),0,1));else if("translate"===t){let t=new it(i,i<<1,o);n.push(gi(e,t,"x","y",0,s))}else if("translatex"===t){let t=new st(i,i,o);n.push(mi(e,t,0,s))}else if("translatey"===t){let t=new nt(i,i,o);n.push(mi(e,t,0,s))}else if("scale"===t){let t=new rt(i,i<<1,o);n.push(gi(e,t,"x","y",1,1))}else if("scalex"===t){let t=new at(i,i,o);n.push(mi(e,t,1,1))}else if("scaley"===t){let t=new ot(i,i,o);n.push(mi(e,t,1,1))}else if("shear"===t){let t=new ht(i,i<<1,o);n.push(gi(e,t,"x","y",0,1))}else if("shearx"===t){let t=new lt(i,i,o);n.push(mi(e,t,0,1))}else if("sheary"===t){let t=new ct(i,i,o);n.push(mi(e,t,0,1))}}}if(t.ik)for(let e in t.ik){let r=t.ik[e],a=r[0];if(!a)continue;let o=i.findIkConstraint(e);if(!o)throw new Error("IK Constraint not found: "+e);let h=i.ikConstraints.indexOf(o),l=new At(r.length,r.length<<1,h),c=wi(a,"time",0),u=wi(a,"mix",1),d=wi(a,"softness",0)*s;for(let t=0,e=0;;t++){l.setFrame(t,c,u,d,wi(a,"bendPositive",!0)?1:-1,wi(a,"compress",!1),wi(a,"stretch",!1));let i=r[t+1];if(!i){l.shrink(e);break}let n=wi(i,"time",0),o=wi(i,"mix",1),h=wi(i,"softness",0)*s,f=a.curve;f&&(e=xi(f,l,e,t,0,c,n,u,o,1),e=xi(f,l,e,t,1,c,n,d,h,s)),c=n,u=o,d=h,a=i}n.push(l)}if(t.transform)for(let e in t.transform){let s=t.transform[e],r=s[0];if(!r)continue;let a=i.findTransformConstraint(e);if(!a)throw new Error("Transform constraint not found: "+e);let o=i.transformConstraints.indexOf(a),h=new Mt(s.length,6*s.length,o),l=wi(r,"time",0),c=wi(r,"mixRotate",1),u=wi(r,"mixX",1),d=wi(r,"mixY",u),f=wi(r,"mixScaleX",1),p=wi(r,"mixScaleY",f),m=wi(r,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,l,c,u,d,f,p,m);let i=s[t+1];if(!i){h.shrink(e);break}let n=wi(i,"time",0),a=wi(i,"mixRotate",1),o=wi(i,"mixX",1),g=wi(i,"mixY",o),x=wi(i,"mixScaleX",1),w=wi(i,"mixScaleY",x),y=wi(i,"mixShearY",1),v=r.curve;v&&(e=xi(v,h,e,t,0,l,n,c,a,1),e=xi(v,h,e,t,1,l,n,u,o,1),e=xi(v,h,e,t,2,l,n,d,g,1),e=xi(v,h,e,t,3,l,n,f,x,1),e=xi(v,h,e,t,4,l,n,p,w,1),e=xi(v,h,e,t,5,l,n,m,y,1)),l=n,c=a,u=o,d=g,f=x,p=w,f=x,r=i}n.push(h)}if(t.path)for(let e in t.path){let r=t.path[e],a=i.findPathConstraint(e);if(!a)throw new Error("Path constraint not found: "+e);let o=i.pathConstraints.indexOf(a);for(let t in r){let e=r[t],i=e[0];if(!i)continue;let h=e.length;if("position"===t){let t=new St(h,h,o);n.push(mi(e,t,0,0==a.positionMode?s:1))}else if("spacing"===t){let t=new It(h,h,o);n.push(mi(e,t,0,0==a.spacingMode||1==a.spacingMode?s:1))}else if("mix"===t){let t=new kt(h,3*h,o),s=wi(i,"time",0),r=wi(i,"mixRotate",1),a=wi(i,"mixX",1),l=wi(i,"mixY",a);for(let n=0,o=0;;n++){t.setFrame(n,s,r,a,l);let h=e[n+1];if(!h){t.shrink(o);break}let c=wi(h,"time",0),u=wi(h,"mixRotate",1),d=wi(h,"mixX",1),f=wi(h,"mixY",d),p=i.curve;p&&(o=xi(p,t,o,n,0,s,c,r,u,1),o=xi(p,t,o,n,1,s,c,a,d,1),o=xi(p,t,o,n,2,s,c,l,f,1)),s=c,r=u,a=d,l=f,i=h}n.push(t)}}}if(t.attachments)for(let e in t.attachments){let r=t.attachments[e],a=i.findSkin(e);if(!a)throw new Error("Skin not found: "+e);for(let t in r){let e=r[t],o=i.findSlot(t);if(!o)throw new Error("Slot not found: "+t);let h=o.index;for(let t in e){let i=e[t],r=a.getAttachment(h,t);for(let t in i){let e=i[t],a=e[0];if(a)if("deform"==t){let t=r.bones,i=r.vertices,o=t?i.length/3*2:i.length,l=new xt(e.length,e.length,h,r),c=wi(a,"time",0);for(let n=0,r=0;;n++){let h,u=wi(a,"vertices",null);if(u){h=m.newFloatArray(o);let e=wi(a,"offset",0);if(m.arrayCopy(u,0,h,e,u.length),1!=s)for(let t=e,i=t+u.length;t<i;t++)h[t]*=s;if(!t)for(let t=0;t<o;t++)h[t]+=i[t]}else h=t?m.newFloatArray(o):i;l.setFrame(n,c,h);let d=e[n+1];if(!d){l.shrink(r);break}let f=wi(d,"time",0),p=a.curve;p&&(r=xi(p,l,r,n,0,c,f,0,1,1)),c=f,a=d}n.push(l)}else if("sequence"==t){let t=new Et(e.length,h,r),i=0;for(let s=0;s<e.length;s++){let n=wi(a,"delay",i),r=wi(a,"time",0),o=k[wi(a,"mode","hold")],h=wi(a,"index",0);t.setFrame(s,r,o,h,n),i=n,a=e[s+1]}n.push(t)}}}}}if(t.drawOrder){let e=new bt(t.drawOrder.length),s=i.slots.length,r=0;for(let n=0;n<t.drawOrder.length;n++,r++){let a=t.drawOrder[n],o=null,h=wi(a,"offsets",null);if(h){o=m.newArray(s,-1);let t=m.newArray(s-h.length,0),e=0,n=0;for(let s=0;s<h.length;s++){let r=h[s],a=i.findSlot(r.slot);if(!a)throw new Error("Slot not found: "+a);let l=a.index;for(;e!=l;)t[n++]=e++;o[e+r.offset]=e++}for(;e<s;)t[n++]=e++;for(let e=s-1;e>=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,wi(a,"time",0),o)}n.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let n=0;n<t.events.length;n++,s++){let r=t.events[n],a=i.findEvent(r.name);if(!a)throw new Error("Event not found: "+r.name);let o=new de(m.toSinglePrecision(wi(r,"time",0)),a);o.intValue=wi(r,"int",a.intValue),o.floatValue=wi(r,"float",a.floatValue),o.stringValue=wi(r,"string",a.stringValue),o.data.audioPath&&(o.volume=wi(r,"volume",1),o.balance=wi(r,"balance",0)),e.setFrame(s,o)}n.push(e)}let r=0;for(let t=0,e=n.length;t<e;t++)r=Math.max(r,n[t].getDuration());i.animations.push(new E(e,n,r))}},pi=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}};function mi(t,e,i,s){let n=t[0],r=wi(n,"time",0),a=wi(n,"value",i)*s,o=0;for(let h=0;;h++){e.setFrame(h,r,a);let l=t[h+1];if(!l)return e.shrink(o),e;let c=wi(l,"time",0),u=wi(l,"value",i)*s;n.curve&&(o=xi(n.curve,e,o,h,0,r,c,a,u,s)),r=c,a=u,n=l}}function gi(t,e,i,s,n,r){let a=t[0],o=wi(a,"time",0),h=wi(a,i,n)*r,l=wi(a,s,n)*r,c=0;for(let u=0;;u++){e.setFrame(u,o,h,l);let d=t[u+1];if(!d)return e.shrink(c),e;let f=wi(d,"time",0),p=wi(d,i,n)*r,m=wi(d,s,n)*r,g=a.curve;g&&(c=xi(g,e,c,u,0,o,f,h,p,r),c=xi(g,e,c,u,1,o,f,l,m,r)),o=f,h=p,l=m,a=d}}function xi(t,e,i,s,n,r,a,o,h,l){if("stepped"==t)return e.setStepped(s),i;let c=n<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(i,s,n,r,o,u,d,f,p,a,h),i+1}function wi(t,e,i){return void 0!==t[e]?t[e]:i}void 0===Math.fround&&(Math.fround=(ze=new Float32Array(1),function(t){return ze[0]=t,ze[0]}));var yi,vi=class extends qt{constructor(t){super(t)}setFilters(t,e){}setWraps(t,e){}dispose(){}},bi=class extends ce{constructor(t="",e=new ue){super(t=>new vi(t),t,e)}},Ai=m.newFloatArray(8),Mi=class{constructor(t){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=m.newFloatArray(8192),this.tempColor=new h,this.ctx=t}draw(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)}drawImages(t){let e=this.ctx,i=this.tempColor,s=t.color,n=t.drawOrder;this.debugRendering&&(e.strokeStyle="green");for(let t=0,r=n.length;t<r;t++){let r=n[t],a=r.bone;if(!a.active)continue;let o=r.getAttachment();if(!(o instanceof ne))continue;o.computeWorldVertices(r,Ai,0,2);let h=o.region,l=h.page.texture.getImage(),c=r.color,u=o.color;i.set(s.r*c.r*u.r,s.g*c.g*u.g,s.b*c.b*u.b,s.a*c.a*u.a),e.save(),e.transform(a.a,a.c,a.b,a.d,a.worldX,a.worldY),e.translate(o.offset[0],o.offset[1]),e.rotate(o.rotation*Math.PI/180);let d=o.width/h.originalWidth;e.scale(d*o.scaleX,d*o.scaleY);let f=h.width,p=h.height;if(e.translate(f/2,p/2),90==o.region.degrees){let t=f;f=p,p=t,e.rotate(-Math.PI/2)}e.scale(1,-1),e.translate(-f/2,-p/2),e.globalAlpha=i.a,e.drawImage(l,h.x,h.y,f,p,0,0,f,p),this.debugRendering&&e.strokeRect(0,0,f,p),e.restore()}}drawTriangles(t){let e=this.ctx,i=this.tempColor,s=t.color,n=t.drawOrder,r=null,a=this.vertices,o=null;for(let t=0,l=n.length;t<l;t++){let l,c,u=n[t],d=u.getAttachment();if(d instanceof ne){let t=d;a=this.computeRegionVertices(u,t,!1),o=Mi.QUAD_TRIANGLES,c=t.region,l=c.page.texture.getImage()}else{if(!(d instanceof te))continue;{let t=d;a=this.computeMeshVertices(u,t,!1),o=t.triangles,l=t.region.renderObject.page.texture.getImage()}}if(l){u.data.blendMode!=r&&(r=u.data.blendMode);let t=u.color,n=d.color;i.set(s.r*t.r*n.r,s.g*t.g*n.g,s.b*t.b*n.b,s.a*t.a*n.a),e.globalAlpha=i.a;for(var h=0;h<o.length;h+=3){let t=8*o[h],i=8*o[h+1],s=8*o[h+2],n=a[t],r=a[t+1],c=a[t+6],u=a[t+7],d=a[i],f=a[i+1],p=a[i+6],m=a[i+7],g=a[s],x=a[s+1],w=a[s+6],y=a[s+7];this.drawTriangle(l,n,r,c,u,d,f,p,m,g,x,w,y),this.debugRendering&&(e.strokeStyle="green",e.beginPath(),e.moveTo(n,r),e.lineTo(d,f),e.lineTo(g,x),e.lineTo(n,r),e.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(t,e,i,s,n,r,a,o,h,l,c,u,d){let f=this.ctx;s*=t.width,n*=t.height,o*=t.width,h*=t.height,u*=t.width,d*=t.height,f.beginPath(),f.moveTo(e,i),f.lineTo(r,a),f.lineTo(l,c),f.closePath();var p=1/((o-=s)*(d-=n)-(u-=s)*(h-=n)),m=(d*(r-=e)-h*(l-=e))*p,g=(d*(a-=i)-h*(c-=i))*p,x=(o*l-u*r)*p,w=(o*c-u*a)*p,y=e-m*s-x*n,v=i-g*s-w*n;f.save(),f.transform(m,g,x,w,y,v),f.clip(),f.drawImage(t,0,0),f.restore()}computeRegionVertices(t,e,i){let s=t.bone.skeleton.color,n=t.color,r=e.color,a=s.a*n.a*r.a,o=i?a:1,h=this.tempColor;h.set(s.r*n.r*r.r*o,s.g*n.g*r.g*o,s.b*n.b*r.b*o,a),e.computeWorldVertices(t,this.vertices,0,Mi.VERTEX_SIZE);let l=this.vertices,c=e.uvs;return l[ne.C1R]=h.r,l[ne.C1G]=h.g,l[ne.C1B]=h.b,l[ne.C1A]=h.a,l[ne.U1]=c[0],l[ne.V1]=c[1],l[ne.C2R]=h.r,l[ne.C2G]=h.g,l[ne.C2B]=h.b,l[ne.C2A]=h.a,l[ne.U2]=c[2],l[ne.V2]=c[3],l[ne.C3R]=h.r,l[ne.C3G]=h.g,l[ne.C3B]=h.b,l[ne.C3A]=h.a,l[ne.U3]=c[4],l[ne.V3]=c[5],l[ne.C4R]=h.r,l[ne.C4G]=h.g,l[ne.C4B]=h.b,l[ne.C4A]=h.a,l[ne.U4]=c[6],l[ne.V4]=c[7],l}computeMeshVertices(t,e,i){let s=t.bone.skeleton.color,n=t.color,r=e.color,a=s.a*n.a*r.a,o=i?a:1,h=this.tempColor;h.set(s.r*n.r*r.r*o,s.g*n.g*r.g*o,s.b*n.b*r.b*o,a);let l=e.worldVerticesLength/2,c=this.vertices;c.length<e.worldVerticesLength&&(this.vertices=c=m.newFloatArray(e.worldVerticesLength)),e.computeWorldVertices(t,0,e.worldVerticesLength,c,0,Mi.VERTEX_SIZE);let u=e.uvs;for(let t=0,e=0,i=2;t<l;t++)c[i++]=h.r,c[i++]=h.g,c[i++]=h.b,c[i++]=h.a,c[i++]=u[e++],c[i++]=u[e++],i+=2;return c}},Si=Mi;return Si.QUAD_TRIANGLES=[0,1,2,2,3,0],Si.VERTEX_SIZE=8,yi=n,((n,r,a,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))s.call(n,h)||h===a||t(n,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return n})(t({},"__esModule",{value:!0}),yi)})();t.exports=e}).call(window)},function(t,e){(function(){"use strict";var e=(()=>{var t=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n={};((e,i)=>{for(var s in i)t(e,s,{get:i[s],enumerable:!0})})(n,{AlphaTimeline:()=>ft,Animation:()=>E,AnimationState:()=>Rt,AnimationStateAdapter:()=>Pt,AnimationStateData:()=>_t,AssetManager:()=>Mi,AssetManagerBase:()=>ce,AtlasAttachmentLoader:()=>re,Attachment:()=>b,AttachmentTimeline:()=>gt,BinaryInput:()=>Xe,BlendMode:()=>Re,Bone:()=>he,BoneData:()=>ae,BoundingBoxAttachment:()=>Ut,CURRENT:()=>Nt,CameraController:()=>Gi,ClippingAttachment:()=>Wt,Color:()=>h,Color2Attribute:()=>es,ColorAttribute:()=>ts,ConstraintData:()=>le,CurveTimeline:()=>Q,CurveTimeline1:()=>$,CurveTimeline2:()=>tt,DebugUtils:()=>g,DeformTimeline:()=>xt,Downloader:()=>ue,DrawOrderTimeline:()=>bt,Event:()=>de,EventData:()=>fe,EventQueue:()=>Yt,EventTimeline:()=>yt,EventType:()=>Xt,FIRST:()=>Dt,FakeTexture:()=>Zt,GLTexture:()=>Ai,HOLD_FIRST:()=>Bt,HOLD_MIX:()=>Vt,HOLD_SUBSEQUENT:()=>Ot,IkConstraint:()=>pe,IkConstraintData:()=>me,IkConstraintTimeline:()=>At,Input:()=>Wi,IntSet:()=>r,Interpolation:()=>u,LoadingScreen:()=>vs,M00:()=>Ii,M01:()=>ki,M02:()=>Ti,M03:()=>Ei,M10:()=>Ci,M11:()=>Ri,M12:()=>Fi,M13:()=>Yi,M20:()=>Xi,M21:()=>Pi,M22:()=>Li,M23:()=>Di,M30:()=>Oi,M31:()=>Bi,M32:()=>Vi,M33:()=>zi,ManagedWebGLRenderingContext:()=>yi,MathUtils:()=>c,Matrix4:()=>_i,Mesh:()=>Zi,MeshAttachment:()=>te,MixBlend:()=>C,MixDirection:()=>R,OrthoCamera:()=>Ui,PathAttachment:()=>ee,PathConstraint:()=>be,PathConstraintData:()=>ge,PathConstraintMixTimeline:()=>kt,PathConstraintPositionTimeline:()=>St,PathConstraintSpacingTimeline:()=>It,PointAttachment:()=>ie,PolygonBatcher:()=>ns,Pool:()=>x,Position2Attribute:()=>Ji,Position3Attribute:()=>Qi,PositionMode:()=>xe,Pow:()=>d,PowOut:()=>f,RGB2Timeline:()=>mt,RGBA2Timeline:()=>pt,RGBATimeline:()=>ut,RGBTimeline:()=>dt,RegionAttachment:()=>ne,ResizeMode:()=>ws,RotateMode:()=>ye,RotateTimeline:()=>et,SETUP:()=>zt,SUBSEQUENT:()=>Lt,ScaleTimeline:()=>rt,ScaleXTimeline:()=>at,ScaleYTimeline:()=>ot,SceneRenderer:()=>xs,SequenceTimeline:()=>Et,Shader:()=>Hi,ShapeRenderer:()=>rs,ShapeType:()=>as,ShearTimeline:()=>ht,ShearXTimeline:()=>lt,ShearYTimeline:()=>ct,Skeleton:()=>Ie,SkeletonBinary:()=>Ye,SkeletonBounds:()=>ci,SkeletonClipping:()=>di,SkeletonData:()=>ke,SkeletonDebugRenderer:()=>hs,SkeletonJson:()=>fi,SkeletonRenderer:()=>cs,Skin:()=>Ee,SkinEntry:()=>Te,Slot:()=>Ae,SlotData:()=>Ce,SpacingMode:()=>we,SpineCanvas:()=>Ms,StringSet:()=>a,TexCoordAttribute:()=>$i,Texture:()=>qt,TextureAtlas:()=>Kt,TextureAtlasPage:()=>Qt,TextureAtlasRegion:()=>$t,TextureFilter:()=>Gt,TextureRegion:()=>Ht,TextureWrap:()=>jt,TimeKeeper:()=>y,Timeline:()=>J,Touch:()=>qi,TrackEntry:()=>Ft,TransformConstraint:()=>Me,TransformConstraintData:()=>Fe,TransformConstraintTimeline:()=>Mt,TransformMode:()=>oe,TranslateTimeline:()=>it,TranslateXTimeline:()=>st,TranslateYTimeline:()=>nt,Triangulator:()=>ui,Utils:()=>m,Vector2:()=>w,Vector3:()=>Si,VertexAttachment:()=>M,VertexAttribute:()=>Ki,VertexAttributeType:()=>is,WebGLBlendModeConverter:()=>vi,WindowedMean:()=>v});var r=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}},a=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i<s;i++)this.add(t[i]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},o=class{constructor(t=0,e=0,i=0,s=0){this.r=t,this.g=e,this.b=i,this.a=s}set(t,e,i,s){return this.r=t,this.g=e,this.b=i,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,i,s){return this.r+=t,this.g+=e,this.b+=i,this.a+=s,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}static fromString(t){return(new o).setFromString(t)}},h=o;h.WHITE=new o(1,1,1,1),h.RED=new o(1,0,0,1),h.GREEN=new o(0,1,0,1),h.BLUE=new o(0,0,1,1),h.MAGENTA=new o(1,0,1,1);var l=class{static clamp(t,e,i){return t<e?e:t>i?i:t}static cosDeg(t){return Math.cos(t*l.degRad)}static sinDeg(t){return Math.sin(t*l.degRad)}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return l.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,i){let s=Math.random(),n=e-t;return s<=(i-t)/n?t+Math.sqrt(s*n*(i-t)):e-Math.sqrt((1-s)*n*(e-i))}static isPowerOfTwo(t){return t&&0==(t&t-1)}},c=l;c.PI=3.1415927,c.PI2=2*l.PI,c.radiansToDegrees=180/l.PI,c.radDeg=l.radiansToDegrees,c.degreesToRadians=l.PI/180,c.degRad=l.degreesToRadians;var u=class{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}},d=class extends u{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}},f=class extends d{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}},p=class{static arrayCopy(t,e,i,s,n){for(let r=e,a=s;r<e+n;r++,a++)i[a]=t[r]}static arrayFill(t,e,i,s){for(let n=e;n<i;n++)t[n]=s}static setArraySize(t,e,i=0){let s=t.length;if(s==e)return t;if(t.length=e,s<e)for(let n=s;n<e;n++)t[n]=i;return t}static ensureArrayCapacity(t,e,i=0){return t.length>=e?t:p.setArraySize(t,e,i)}static newArray(t,e){let i=new Array(t);for(let s=0;s<t;s++)i[s]=e;return i}static newFloatArray(t){if(p.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(p.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return p.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return p.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,i=!0){for(var s=0;s<t.length;s++)if(t[s]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}},m=p;m.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;var g=class{static logBones(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e];console.log(i.data.name+", "+i.a+", "+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}}},x=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}},w=class{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}},y=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}update(){let t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},v=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}},b=class{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}},A=class extends b{constructor(t){super(t),this.id=A.nextID++,this.bones=null,this.vertices=[],this.worldVerticesLength=0,this.timelineAttachment=this}computeWorldVertices(t,e,i,s,n,r){i=n+(i>>1)*r;let a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(!l){o.length>0&&(h=o);let a=t.bone,l=a.worldX,c=a.worldY,u=a.a,d=a.b,f=a.c,p=a.d;for(let t=e,a=n;a<i;t+=2,a+=r){let e=h[t],i=h[t+1];s[a]=e*u+i*d+l,s[a+1]=e*f+i*p+c}return}let c=0,u=0;for(let t=0;t<e;t+=2){let t=l[c];c+=t+1,u+=t}let d=a.bones;if(0==o.length)for(let t=n,e=3*u;t<i;t+=r){let i=0,n=0,r=l[c++];for(r+=c;c<r;c++,e+=3){let t=d[l[c]],s=h[e],r=h[e+1],a=h[e+2];i+=(s*t.a+r*t.b+t.worldX)*a,n+=(s*t.c+r*t.d+t.worldY)*a}s[t]=i,s[t+1]=n}else{let t=o;for(let e=n,a=3*u,o=u<<1;e<i;e+=r){let i=0,n=0,r=l[c++];for(r+=c;c<r;c++,a+=3,o+=2){let e=d[l[c]],s=h[a]+t[o],r=h[a+1]+t[o+1],u=h[a+2];i+=(s*e.a+r*e.b+e.worldX)*u,n+=(s*e.c+r*e.d+e.worldY)*u}s[e]=i,s[e+1]=n}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),m.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=m.newFloatArray(this.vertices.length),m.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}},M=A;M.nextID=0;var S=class{constructor(t){this.id=S.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(t)}copy(){let t=new S(this.regions.length);return m.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let i=t.sequenceIndex;-1==i&&(i=this.setupIndex),i>=this.regions.length&&(i=this.regions.length-1);let s=this.regions[i];e.region!=s&&(e.region=s,e.updateRegion())}getPath(t,e){let i=t,s=(this.start+e).toString();for(let t=this.digits-s.length;t>0;t--)i+="0";return i+=s,i}static nextID(){return S._nextID++}},I=S;I._nextID=0;var k=(t=>(t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse",t))(k||{}),T=[0,1,2,3,4,5,6],E=class{constructor(t,e,i){if(this.timelines=[],this.timelineIds=new a,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,i,s,n,r,a,o){if(!t)throw new Error("skeleton cannot be null.");s&&0!=this.duration&&(i%=this.duration,e>0&&(e%=this.duration));let h=this.timelines;for(let s=0,l=h.length;s<l;s++)h[s].apply(t,e,i,n,r,a,o)}},C=(t=>(t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add",t))(C||{}),R=(t=>(t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut",t))(R||{}),F=0,Y=1,X=2,P=3,L=4,D=5,O=6,B=7,V=8,z=9,N=10,_=11,U=12,W=13,q=14,G=15,j=16,H=17,Z=18,K=19,J=class{constructor(t,e){this.propertyIds=e,this.frames=m.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let i=t.length;for(let s=1;s<i;s++)if(t[s]>e)return s-1;return i-1}static search(t,e,i){let s=t.length;for(let n=i;n<s;n+=i)if(t[n]>e)return n-i;return s-i}},Q=class extends J{constructor(t,e,i){super(t,i),this.curves=m.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=m.newFloatArray(e);m.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*(n-2*a+h),m=.006*(3*(r-o)-s+l),g=.006*(3*(a-h)-n+c),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*(a-n)+p+.16666667*g,b=s+y,A=n+v;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=A,y+=x,v+=w,x+=m,w+=g,b+=y,A+=v}getBezierValue(t,e,i,s){let n=this.curves;if(n[s]>t){let r=this.frames[e],a=this.frames[e+i];return a+(t-r)/(n[s]-r)*(n[s+1]-a)}let r=s+18;for(s+=2;s<r;s+=2)if(n[s]>=t){let e=n[s-2],i=n[s-1];return i+(t-e)/(n[s]-e)*(n[s+1]-i)}e+=this.getFrameEntries();let a=n[r-2],o=n[r-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+i]-o)}},$=class extends Q{constructor(t,e,i){super(t,e,[i])}getFrameEntries(){return 2}setFrame(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+1]=i}getCurveValue(t){let e=this.frames,i=e.length-2;for(let s=2;s<=i;s+=2)if(e[s]>t){i=s-2;break}let s=this.curves[i>>1];switch(s){case 0:let s=e[i],n=e[i+1];return n+(t-s)/(e[i+2]-s)*(e[i+2+1]-n);case 1:return e[i+1]}return this.getBezierValue(t,i,1,s-2)}},tt=class extends Q{constructor(t,e,i,s){super(t,e,[i,s])}getFrameEntries(){return 3}setFrame(t,e,i,s){t*=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s}},et=class extends ${constructor(t,e,i){super(t,e,F+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.rotation=o.data.rotation);case 1:o.rotation+=(o.data.rotation-o.rotation)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.rotation=o.data.rotation+h*n;break;case 1:case 2:h+=o.data.rotation-o.rotation;case 3:o.rotation+=h*n}}},it=class extends tt{constructor(t,e,i){super(t,e,Y+"|"+i,X+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.x=o.data.x,void(o.y=o.data.y);case 1:o.x+=(o.data.x-o.x)*n,o.y+=(o.data.y-o.y)*n}return}let l=0,c=0,u=J.search(h,i,3),d=this.curves[u/3];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+3]-t);l+=(h[u+3+1]-l)*e,c+=(h[u+3+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}switch(r){case 0:o.x=o.data.x+l*n,o.y=o.data.y+c*n;break;case 1:case 2:o.x+=(o.data.x+l-o.x)*n,o.y+=(o.data.y+c-o.y)*n;break;case 3:o.x+=l*n,o.y+=c*n}}},st=class extends ${constructor(t,e,i){super(t,e,Y+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.x=o.data.x);case 1:o.x+=(o.data.x-o.x)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.x=o.data.x+h*n;break;case 1:case 2:o.x+=(o.data.x+h-o.x)*n;break;case 3:o.x+=h*n}}},nt=class extends ${constructor(t,e,i){super(t,e,X+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.y=o.data.y);case 1:o.y+=(o.data.y-o.y)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.y=o.data.y+h*n;break;case 1:case 2:o.y+=(o.data.y+h-o.y)*n;break;case 3:o.y+=h*n}}},rt=class extends tt{constructor(t,e,i){super(t,e,P+"|"+i,L+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h,l,u=this.frames;if(i<u[0]){switch(r){case 0:return o.scaleX=o.data.scaleX,void(o.scaleY=o.data.scaleY);case 1:o.scaleX+=(o.data.scaleX-o.scaleX)*n,o.scaleY+=(o.data.scaleY-o.scaleY)*n}return}let d=J.search(u,i,3),f=this.curves[d/3];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2];let e=(i-t)/(u[d+3]-t);h+=(u[d+3+1]-h)*e,l+=(u[d+3+2]-l)*e;break;case 1:h=u[d+1],l=u[d+2];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2)}if(h*=o.data.scaleX,l*=o.data.scaleY,1==n)3==r?(o.scaleX+=h-o.data.scaleX,o.scaleY+=l-o.data.scaleY):(o.scaleX=h,o.scaleY=l);else{let t=0,e=0;if(1==a)switch(r){case 0:t=o.data.scaleX,e=o.data.scaleY,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n,o.scaleY=e+(Math.abs(l)*c.signum(e)-e)*n;break;case 1:case 2:t=o.scaleX,e=o.scaleY,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n,o.scaleY=e+(Math.abs(l)*c.signum(e)-e)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n,o.scaleY+=(l-o.data.scaleY)*n}else switch(r){case 0:t=Math.abs(o.data.scaleX)*c.signum(h),e=Math.abs(o.data.scaleY)*c.signum(l),o.scaleX=t+(h-t)*n,o.scaleY=e+(l-e)*n;break;case 1:case 2:t=Math.abs(o.scaleX)*c.signum(h),e=Math.abs(o.scaleY)*c.signum(l),o.scaleX=t+(h-t)*n,o.scaleY=e+(l-e)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n,o.scaleY+=(l-o.data.scaleY)*n}}}},at=class extends ${constructor(t,e,i){super(t,e,P+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.scaleX=o.data.scaleX);case 1:o.scaleX+=(o.data.scaleX-o.scaleX)*n}return}let h=this.getCurveValue(i)*o.data.scaleX;if(1==n)3==r?o.scaleX+=h-o.data.scaleX:o.scaleX=h;else{let t=0;if(1==a)switch(r){case 0:t=o.data.scaleX,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 1:case 2:t=o.scaleX,o.scaleX=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n}else switch(r){case 0:t=Math.abs(o.data.scaleX)*c.signum(h),o.scaleX=t+(h-t)*n;break;case 1:case 2:t=Math.abs(o.scaleX)*c.signum(h),o.scaleX=t+(h-t)*n;break;case 3:o.scaleX+=(h-o.data.scaleX)*n}}}},ot=class extends ${constructor(t,e,i){super(t,e,L+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.scaleY=o.data.scaleY);case 1:o.scaleY+=(o.data.scaleY-o.scaleY)*n}return}let h=this.getCurveValue(i)*o.data.scaleY;if(1==n)3==r?o.scaleY+=h-o.data.scaleY:o.scaleY=h;else{let t=0;if(1==a)switch(r){case 0:t=o.data.scaleY,o.scaleY=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 1:case 2:t=o.scaleY,o.scaleY=t+(Math.abs(h)*c.signum(t)-t)*n;break;case 3:o.scaleY+=(h-o.data.scaleY)*n}else switch(r){case 0:t=Math.abs(o.data.scaleY)*c.signum(h),o.scaleY=t+(h-t)*n;break;case 1:case 2:t=Math.abs(o.scaleY)*c.signum(h),o.scaleY=t+(h-t)*n;break;case 3:o.scaleY+=(h-o.data.scaleY)*n}}}},ht=class extends tt{constructor(t,e,i){super(t,e,D+"|"+i,O+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY);case 1:o.shearX+=(o.data.shearX-o.shearX)*n,o.shearY+=(o.data.shearY-o.shearY)*n}return}let l=0,c=0,u=J.search(h,i,3),d=this.curves[u/3];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+3]-t);l+=(h[u+3+1]-l)*e,c+=(h[u+3+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}switch(r){case 0:o.shearX=o.data.shearX+l*n,o.shearY=o.data.shearY+c*n;break;case 1:case 2:o.shearX+=(o.data.shearX+l-o.shearX)*n,o.shearY+=(o.data.shearY+c-o.shearY)*n;break;case 3:o.shearX+=l*n,o.shearY+=c*n}}},lt=class extends ${constructor(t,e,i){super(t,e,D+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.shearX=o.data.shearX);case 1:o.shearX+=(o.data.shearX-o.shearX)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.shearX=o.data.shearX+h*n;break;case 1:case 2:o.shearX+=(o.data.shearX+h-o.shearX)*n;break;case 3:o.shearX+=h*n}}},ct=class extends ${constructor(t,e,i){super(t,e,O+"|"+i),this.boneIndex=0,this.boneIndex=i}apply(t,e,i,s,n,r,a){let o=t.bones[this.boneIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.shearY=o.data.shearY);case 1:o.shearY+=(o.data.shearY-o.shearY)*n}return}let h=this.getCurveValue(i);switch(r){case 0:o.shearY=o.data.shearY+h*n;break;case 1:case 2:o.shearY+=(o.data.shearY+h-o.shearY)*n;break;case 3:o.shearY+=h*n}}},ut=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,V+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 5}setFrame(t,e,i,s,n,r){t*=5,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case 0:return void l.setFromColor(t);case 1:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n)}return}let c=0,u=0,d=0,f=0,p=J.search(h,i,5),m=this.curves[p/5];switch(m){case 0:let t=h[p];c=h[p+1],u=h[p+2],d=h[p+3],f=h[p+4];let e=(i-t)/(h[p+5]-t);c+=(h[p+5+1]-c)*e,u+=(h[p+5+2]-u)*e,d+=(h[p+5+3]-d)*e,f+=(h[p+5+4]-f)*e;break;case 1:c=h[p+1],u=h[p+2],d=h[p+3],f=h[p+4];break;default:c=this.getBezierValue(i,p,1,m-2),u=this.getBezierValue(i,p,2,m+18-2),d=this.getBezierValue(i,p,3,m+36-2),f=this.getBezierValue(i,p,4,m+54-2)}1==n?l.set(c,u,d,f):(0==r&&l.setFromColor(o.data.color),l.add((c-l.r)*n,(u-l.g)*n,(d-l.b)*n,(f-l.a)*n))}},dt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){t<<=2,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color;if(i<h[0]){let t=o.data.color;switch(r){case 0:return l.r=t.r,l.g=t.g,void(l.b=t.b);case 1:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n}return}let c=0,u=0,d=0,f=J.search(h,i,4),p=this.curves[f>>2];switch(p){case 0:let t=h[f];c=h[f+1],u=h[f+2],d=h[f+3];let e=(i-t)/(h[f+4]-t);c+=(h[f+4+1]-c)*e,u+=(h[f+4+2]-u)*e,d+=(h[f+4+3]-d)*e;break;case 1:c=h[f+1],u=h[f+2],d=h[f+3];break;default:c=this.getBezierValue(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,f,3,p+36-2)}if(1==n)l.r=c,l.g=u,l.b=d;else{if(0==r){let t=o.data.color;l.r=t.r,l.g=t.g,l.b=t.b}l.r+=(c-l.r)*n,l.g+=(u-l.g)*n,l.b+=(d-l.b)*n}}},ft=class extends ${constructor(t,e,i){super(t,e,V+"|"+i),this.slotIndex=0,this.slotIndex=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.color;if(i<this.frames[0]){let t=o.data.color;switch(r){case 0:return void(h.a=t.a);case 1:h.a+=(t.a-h.a)*n}return}let l=this.getCurveValue(i);1==n?h.a=l:(0==r&&(h.a=o.data.color.a),h.a+=(l-h.a)*n)}},pt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,V+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 8}setFrame(t,e,i,s,n,r,a,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=h}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case 0:return l.setFromColor(t),c.r=e.r,c.g=e.g,void(c.b=e.b);case 1:l.add((t.r-l.r)*n,(t.g-l.g)*n,(t.b-l.b)*n,(t.a-l.a)*n),c.r+=(e.r-c.r)*n,c.g+=(e.g-c.g)*n,c.b+=(e.b-c.b)*n}return}let u=0,d=0,f=0,p=0,m=0,g=0,x=0,w=J.search(h,i,8),y=this.curves[w>>3];switch(y){case 0:let t=h[w];u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];let e=(i-t)/(h[w+8]-t);u+=(h[w+8+1]-u)*e,d+=(h[w+8+2]-d)*e,f+=(h[w+8+3]-f)*e,p+=(h[w+8+4]-p)*e,m+=(h[w+8+5]-m)*e,g+=(h[w+8+6]-g)*e,x+=(h[w+8+7]-x)*e;break;case 1:u=h[w+1],d=h[w+2],f=h[w+3],p=h[w+4],m=h[w+5],g=h[w+6],x=h[w+7];break;default:u=this.getBezierValue(i,w,1,y-2),d=this.getBezierValue(i,w,2,y+18-2),f=this.getBezierValue(i,w,3,y+36-2),p=this.getBezierValue(i,w,4,y+54-2),m=this.getBezierValue(i,w,5,y+72-2),g=this.getBezierValue(i,w,6,y+90-2),x=this.getBezierValue(i,w,7,y+108-2)}if(1==n)l.set(u,d,f,p),c.r=m,c.g=g,c.b=x;else{if(0==r){l.setFromColor(o.data.color);let t=o.data.darkColor;c.r=t.r,c.g=t.g,c.b=t.b}l.add((u-l.r)*n,(d-l.g)*n,(f-l.b)*n,(p-l.a)*n),c.r+=(m-c.r)*n,c.g+=(g-c.g)*n,c.b+=(x-c.b)*n}}},mt=class extends Q{constructor(t,e,i){super(t,e,[B+"|"+i,z+"|"+i]),this.slotIndex=0,this.slotIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=this.frames,l=o.color,c=o.darkColor;if(i<h[0]){let t=o.data.color,e=o.data.darkColor;switch(r){case 0:return l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,void(c.b=e.b);case 1:l.r+=(t.r-l.r)*n,l.g+=(t.g-l.g)*n,l.b+=(t.b-l.b)*n,c.r+=(e.r-c.r)*n,c.g+=(e.g-c.g)*n,c.b+=(e.b-c.b)*n}return}let u=0,d=0,f=0,p=0,m=0,g=0,x=J.search(h,i,7),w=this.curves[x/7];switch(w){case 0:let t=h[x];u=h[x+1],d=h[x+2],f=h[x+3],p=h[x+4],m=h[x+5],g=h[x+6];let e=(i-t)/(h[x+7]-t);u+=(h[x+7+1]-u)*e,d+=(h[x+7+2]-d)*e,f+=(h[x+7+3]-f)*e,p+=(h[x+7+4]-p)*e,m+=(h[x+7+5]-m)*e,g+=(h[x+7+6]-g)*e;break;case 1:u=h[x+1],d=h[x+2],f=h[x+3],p=h[x+4],m=h[x+5],g=h[x+6];break;default:u=this.getBezierValue(i,x,1,w-2),d=this.getBezierValue(i,x,2,w+18-2),f=this.getBezierValue(i,x,3,w+36-2),p=this.getBezierValue(i,x,4,w+54-2),m=this.getBezierValue(i,x,5,w+72-2),g=this.getBezierValue(i,x,6,w+90-2)}if(1==n)l.r=u,l.g=d,l.b=f,c.r=p,c.g=m,c.b=g;else{if(0==r){let t=o.data.color,e=o.data.darkColor;l.r=t.r,l.g=t.g,l.b=t.b,c.r=e.r,c.g=e.g,c.b=e.b}l.r+=(u-l.r)*n,l.g+=(d-l.g)*n,l.b+=(f-l.b)*n,c.r+=(p-c.r)*n,c.g+=(m-c.g)*n,c.b+=(g-c.b)*n}}},gt=class extends J{constructor(t,e){super(t,[N+"|"+e]),this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];o.bone.active&&(1!=a?i<this.frames[0]?0!=r&&1!=r||this.setAttachment(t,o,o.data.attachmentName):this.setAttachment(t,o,this.attachmentNames[J.search1(this.frames,i)]):0==r&&this.setAttachment(t,o,o.data.attachmentName))}setAttachment(t,e,i){e.setAttachment(i?t.getAttachment(this.slotIndex,i):null)}},xt=class extends Q{constructor(t,e,i,s){super(t,e,[_+"|"+i+"|"+s.id]),this.slotIndex=0,this.slotIndex=i,this.attachment=s,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.vertices[t]=i}setBezier(t,e,i,s,n,r,a,o,h,l,c){let u=this.curves,d=this.getFrameCount()+18*t;0==i&&(u[e]=2+d);let f=.03*(s-2*r+o),p=.03*h-.06*a,m=.006*(3*(r-o)-s+l),g=.018*(a-h+.33333333),x=2*f+m,w=2*p+g,y=.3*(r-s)+f+.16666667*m,v=.3*a+p+.16666667*g,b=s+y,A=v;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=A,y+=x,v+=w,x+=m,w+=g,b+=y,A+=v}getCurvePercent(t,e){let i=this.curves,s=i[e];switch(s){case 0:let i=this.frames[e];return(t-i)/(this.frames[e+this.getFrameEntries()]-i);case 1:return 0}if(s-=2,i[s]>t){let n=this.frames[e];return i[s+1]*(t-n)/(i[s]-n)}let n=s+18;for(s+=2;s<n;s+=2)if(i[s]>=t){let e=i[s-2],n=i[s-1];return n+(t-e)/(i[s]-e)*(i[s+1]-n)}let r=i[n-2],a=i[n-1];return a+(1-a)*(t-r)/(this.frames[e+this.getFrameEntries()]-r)}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.getAttachment();if(!h)return;if(!(h instanceof M)||h.timelineAttachment!=this.attachment)return;let l=o.deform;0==l.length&&(r=0);let c=this.vertices,u=c[0].length,d=this.frames;if(i<d[0]){switch(r){case 0:return void(l.length=0);case 1:if(1==n)return void(l.length=0);l.length=u;let t=h;if(t.bones){n=1-n;for(f=0;f<u;f++)l[f]*=n}else{let e=t.vertices;for(var f=0;f<u;f++)l[f]+=(e[f]-l[f])*n}}return}if(l.length=u,i>=d[d.length-1]){let t=c[d.length-1];if(1==n)if(3==r){let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]+=t[e];else{let i=e.vertices;for(let e=0;e<u;e++)l[e]+=t[e]-i[e]}}else m.arrayCopy(t,0,l,0,u);else switch(r){case 0:{let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]=t[e]*n;else{let i=e.vertices;for(let e=0;e<u;e++){let s=i[e];l[e]=s+(t[e]-s)*n}}break}case 1:case 2:for(let e=0;e<u;e++)l[e]+=(t[e]-l[e])*n;break;case 3:let e=h;if(e.bones)for(let e=0;e<u;e++)l[e]+=t[e]*n;else{let i=e.vertices;for(let e=0;e<u;e++)l[e]+=(t[e]-i[e])*n}}return}let p=J.search1(d,i),g=this.getCurvePercent(i,p),x=c[p],w=c[p+1];if(1==n)if(3==r){let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]+=e+(w[t]-e)*g}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t];l[t]+=i+(w[t]-i)*g-e[t]}}}else for(let t=0;t<u;t++){let e=x[t];l[t]=e+(w[t]-e)*g}else switch(r){case 0:{let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]=(e+(w[t]-e)*g)*n}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t],s=e[t];l[t]=s+(i+(w[t]-i)*g-s)*n}}break}case 1:case 2:for(let t=0;t<u;t++){let e=x[t];l[t]+=(e+(w[t]-e)*g-l[t])*n}break;case 3:let t=h;if(t.bones)for(let t=0;t<u;t++){let e=x[t];l[t]+=(e+(w[t]-e)*g)*n}else{let e=t.vertices;for(let t=0;t<u;t++){let i=x[t];l[t]+=(i+(w[t]-i)*g-e[t])*n}}}}},wt=class extends J{constructor(t){super(t,wt.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,s,n,r,a){if(!s)return;let o=this.frames,h=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,s,n,r,a),e=-1;else if(e>=o[h-1])return;if(i<o[0])return;let l=0;if(e<o[0])l=0;else{l=J.search1(o,e)+1;let t=o[l];for(;l>0&&o[l-1]==t;)l--}for(;l<h&&i>=o[l];l++)s.push(this.events[l])}},yt=wt;yt.propertyIds=[""+U];var vt=class extends J{constructor(t){super(t,vt.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,s,n,r,a){if(1==a)return void(0==r&&m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(i<this.frames[0])return void(0!=r&&1!=r||m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let o=J.search1(this.frames,i),h=this.drawOrders[o];if(h){let e=t.drawOrder,i=t.slots;for(let t=0,s=h.length;t<s;t++)e[t]=i[h[t]]}else m.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}},bt=vt;bt.propertyIds=[""+W];var At=class extends Q{constructor(t,e,i){super(t,e,[q+"|"+i]),this.ikConstraintIndex=0,this.ikConstraintIndex=i}getFrameEntries(){return 6}setFrame(t,e,i,s,n,r,a){t*=6,this.frames[t]=e,this.frames[t+1]=i,this.frames[t+2]=s,this.frames[t+3]=n,this.frames[t+4]=r?1:0,this.frames[t+5]=a?1:0}apply(t,e,i,s,n,r,a){let o=t.ikConstraints[this.ikConstraintIndex];if(!o.active)return;let h=this.frames;if(i<h[0]){switch(r){case 0:return o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,void(o.stretch=o.data.stretch);case 1:o.mix+=(o.data.mix-o.mix)*n,o.softness+=(o.data.softness-o.softness)*n,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}return}let l=0,c=0,u=J.search(h,i,6),d=this.curves[u/6];switch(d){case 0:let t=h[u];l=h[u+1],c=h[u+2];let e=(i-t)/(h[u+6]-t);l+=(h[u+6+1]-l)*e,c+=(h[u+6+2]-c)*e;break;case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(i,u,1,d-2),c=this.getBezierValue(i,u,2,d+18-2)}0==r?(o.mix=o.data.mix+(l-o.data.mix)*n,o.softness=o.data.softness+(c-o.data.softness)*n,1==a?(o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch):(o.bendDirection=h[u+3],o.compress=0!=h[u+4],o.stretch=0!=h[u+5])):(o.mix+=(l-o.mix)*n,o.softness+=(c-o.softness)*n,0==a&&(o.bendDirection=h[u+3],o.compress=0!=h[u+4],o.stretch=0!=h[u+5]))}},Mt=class extends Q{constructor(t,e,i){super(t,e,[G+"|"+i]),this.transformConstraintIndex=0,this.transformConstraintIndex=i}getFrameEntries(){return 7}setFrame(t,e,i,s,n,r,a,o){let h=this.frames;h[t*=7]=e,h[t+1]=i,h[t+2]=s,h[t+3]=n,h[t+4]=r,h[t+5]=a,h[t+6]=o}apply(t,e,i,s,n,r,a){let o=t.transformConstraints[this.transformConstraintIndex];if(!o.active)return;let h,l,c,u,d,f,p=this.frames;if(i<p[0]){let t=o.data;switch(r){case 0:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY);case 1:o.mixRotate+=(t.mixRotate-o.mixRotate)*n,o.mixX+=(t.mixX-o.mixX)*n,o.mixY+=(t.mixY-o.mixY)*n,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*n,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*n,o.mixShearY+=(t.mixShearY-o.mixShearY)*n}return}let m=J.search(p,i,7),g=this.curves[m/7];switch(g){case 0:let t=p[m];h=p[m+1],l=p[m+2],c=p[m+3],u=p[m+4],d=p[m+5],f=p[m+6];let e=(i-t)/(p[m+7]-t);h+=(p[m+7+1]-h)*e,l+=(p[m+7+2]-l)*e,c+=(p[m+7+3]-c)*e,u+=(p[m+7+4]-u)*e,d+=(p[m+7+5]-d)*e,f+=(p[m+7+6]-f)*e;break;case 1:h=p[m+1],l=p[m+2],c=p[m+3],u=p[m+4],d=p[m+5],f=p[m+6];break;default:h=this.getBezierValue(i,m,1,g-2),l=this.getBezierValue(i,m,2,g+18-2),c=this.getBezierValue(i,m,3,g+36-2),u=this.getBezierValue(i,m,4,g+54-2),d=this.getBezierValue(i,m,5,g+72-2),f=this.getBezierValue(i,m,6,g+90-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n,o.mixScaleX=t.mixScaleX+(u-t.mixScaleX)*n,o.mixScaleY=t.mixScaleY+(d-t.mixScaleY)*n,o.mixShearY=t.mixShearY+(f-t.mixShearY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n,o.mixScaleX+=(u-o.mixScaleX)*n,o.mixScaleY+=(d-o.mixScaleY)*n,o.mixShearY+=(f-o.mixShearY)*n}},St=class extends ${constructor(t,e,i){super(t,e,j+"|"+i),this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.position=o.data.position);case 1:o.position+=(o.data.position-o.position)*n}return}let h=this.getCurveValue(i);0==r?o.position=o.data.position+(h-o.data.position)*n:o.position+=(h-o.position)*n}},It=class extends ${constructor(t,e,i){super(t,e,H+"|"+i),this.pathConstraintIndex=0,this.pathConstraintIndex=i}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;if(i<this.frames[0]){switch(r){case 0:return void(o.spacing=o.data.spacing);case 1:o.spacing+=(o.data.spacing-o.spacing)*n}return}let h=this.getCurveValue(i);0==r?o.spacing=o.data.spacing+(h-o.data.spacing)*n:o.spacing+=(h-o.spacing)*n}},kt=class extends Q{constructor(t,e,i){super(t,e,[Z+"|"+i]),this.pathConstraintIndex=0,this.pathConstraintIndex=i}getFrameEntries(){return 4}setFrame(t,e,i,s,n){let r=this.frames;r[t<<=2]=e,r[t+1]=i,r[t+2]=s,r[t+3]=n}apply(t,e,i,s,n,r,a){let o=t.pathConstraints[this.pathConstraintIndex];if(!o.active)return;let h,l,c,u=this.frames;if(i<u[0]){switch(r){case 0:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY);case 1:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*n,o.mixX+=(o.data.mixX-o.mixX)*n,o.mixY+=(o.data.mixY-o.mixY)*n}return}let d=J.search(u,i,4),f=this.curves[d>>2];switch(f){case 0:let t=u[d];h=u[d+1],l=u[d+2],c=u[d+3];let e=(i-t)/(u[d+4]-t);h+=(u[d+4+1]-h)*e,l+=(u[d+4+2]-l)*e,c+=(u[d+4+3]-c)*e;break;case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),c=this.getBezierValue(i,d,3,f+36-2)}if(0==r){let t=o.data;o.mixRotate=t.mixRotate+(h-t.mixRotate)*n,o.mixX=t.mixX+(l-t.mixX)*n,o.mixY=t.mixY+(c-t.mixY)*n}else o.mixRotate+=(h-o.mixRotate)*n,o.mixX+=(l-o.mixX)*n,o.mixY+=(c-o.mixY)*n}},Tt=class extends J{constructor(t,e,i){super(t,[K+"|"+e+"|"+i.sequence.id]),this.slotIndex=e,this.attachment=i}getFrameEntries(){return Tt.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,i,s,n){let r=this.frames;r[t*=Tt.ENTRIES]=e,r[t+Tt.MODE]=i|s<<4,r[t+Tt.DELAY]=n}apply(t,e,i,s,n,r,a){let o=t.slots[this.slotIndex];if(!o.bone.active)return;let h=o.attachment,l=this.attachment;if(!(h==l||h instanceof M&&h.timelineAttachment==l))return;let c=this.frames;if(i<c[0])return void(0!=r&&1!=r||(o.sequenceIndex=-1));let u=J.search(c,i,Tt.ENTRIES),d=c[u],f=c[u+Tt.MODE],p=c[u+Tt.DELAY];if(!this.attachment.sequence)return;let m=f>>4,g=this.attachment.sequence.regions.length,x=T[15&f];if(0!=x)switch(m+=(i-d)/p+1e-5|0,x){case 1:m=Math.min(g-1,m);break;case 2:m%=g;break;case 3:{let t=(g<<1)-2;m=0==t?0:m%t,m>=g&&(m=t-m);break}case 4:m=Math.max(g-1-m,0);break;case 5:m=g-1-m%g;break;case 6:{let t=(g<<1)-2;m=0==t?0:(m+g-1)%t,m>=g&&(m=t-m)}}o.sequenceIndex=m}},Et=Tt;Et.ENTRIES=3,Et.MODE=1,Et.DELAY=2;var Ct=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Yt(this),this.propertyIDs=new a,this.animationsChanged=!1,this.trackEntryPool=new x(()=>new Ft),this.data=t}static emptyAnimation(){return Ct._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(!s)continue;s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast;let n=t*s.timeScale;if(s.delay>0){if(s.delay-=n,s.delay>0)continue;n=-s.delay,s.delay=0}let r=s.next;if(r){let e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=n,this.setCurrent(i,r,!0);r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&!s.mixingFrom){e[i]=null,this.queue.end(s),this.clearNext(s);continue}if(s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let i=t.mixingFrom;if(!i)return!0;let s=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),s):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,i=this.tracks,s=!1;for(let r=0,a=i.length;r<a;r++){let a=i[r];if(!a||a.delay>0)continue;s=!0;let o=0==r?1:a.mixBlend,h=a.alpha;a.mixingFrom?h*=this.applyMixingFrom(a,t,o):a.trackTime>=a.trackEnd&&!a.next&&(h=0);let l=a.animationLast,c=a.getAnimationTime(),u=c,d=e;a.reverse&&(u=a.animation.duration-u,d=null);let f=a.animation.timelines,p=f.length;if(0==r&&1==h||3==o)for(let e=0;e<p;e++){m.webkit602BugfixHelper(h,o);var n=f[e];n instanceof gt?this.applyAttachmentTimeline(n,t,u,o,!0):n.apply(t,l,u,d,h,o,0)}else{let e=a.timelineMode,i=a.shortestRotation,s=!i&&a.timelinesRotation.length!=p<<1;s&&(a.timelinesRotation.length=p<<1);for(let n=0;n<p;n++){let r=f[n],c=e[n]==Lt?o:0;!i&&r instanceof et?this.applyRotateTimeline(r,t,u,h,c,a.timelinesRotation,n<<1,s):r instanceof gt?this.applyAttachmentTimeline(r,t,u,o,!0):(m.webkit602BugfixHelper(h,o),r.apply(t,l,u,d,h,c,0))}}this.queueEvents(a,c),e.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime}for(var r=this.unkeyedState+zt,a=t.slots,o=0,h=t.slots.length;o<h;o++){var l=a[o];if(l.attachmentState==r){var c=l.data.attachmentName;l.setAttachment(c?t.getAttachment(l.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),s}applyMixingFrom(t,e,i){let s=t.mixingFrom;s.mixingFrom&&this.applyMixingFrom(s,e,i);let n=0;0==t.mixDuration?(n=1,1==i&&(i=0)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),1!=i&&(i=s.mixBlend));let r=n<s.attachmentThreshold,a=n<s.drawOrderThreshold,o=s.animation.timelines,h=o.length,l=s.alpha*t.interruptAlpha,c=l*(1-n),u=s.animationLast,d=s.getAnimationTime(),f=d,p=null;if(s.reverse?f=s.animation.duration-f:n<s.eventThreshold&&(p=this.events),3==i)for(let t=0;t<h;t++)o[t].apply(e,u,f,p,c,i,1);else{let t=s.timelineMode,n=s.timelineHoldMix,d=s.shortestRotation,g=!d&&s.timelinesRotation.length!=h<<1;g&&(s.timelinesRotation.length=h<<1),s.totalAlpha=0;for(let x=0;x<h;x++){let h,w=o[x],y=1,v=0;switch(t[x]){case Lt:if(!a&&w instanceof bt)continue;h=i,v=c;break;case Dt:h=0,v=c;break;case Ot:h=i,v=l;break;case Bt:h=0,v=l;break;default:h=0;let t=n[x];v=l*Math.max(0,1-t.mixTime/t.mixDuration)}s.totalAlpha+=v,!d&&w instanceof et?this.applyRotateTimeline(w,e,f,v,h,s.timelinesRotation,x<<1,g):w instanceof gt?this.applyAttachmentTimeline(w,e,f,h,r):(m.webkit602BugfixHelper(v,i),a&&w instanceof bt&&0==h&&(y=0),w.apply(e,u,f,p,v,h,y))}}return t.mixDuration>0&&this.queueEvents(s,d),this.events.length=0,s.nextAnimationLast=d,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,i,s,n){var r=e.slots[t.slotIndex];r.bone.active&&(i<t.frames[0]?0!=s&&1!=s||this.setAttachment(e,r,r.data.attachmentName,n):this.setAttachment(e,r,t.attachmentNames[J.search1(t.frames,i)],n),r.attachmentState<=this.unkeyedState&&(r.attachmentState=this.unkeyedState+zt))}setAttachment(t,e,i,s){e.setAttachment(i?t.getAttachment(e.data.index,i):null),s&&(e.attachmentState=this.unkeyedState+Nt)}applyRotateTimeline(t,e,i,s,n,r,a,o){if(o&&(r[a]=0),1==s)return void t.apply(e,0,i,null,1,n,0);let h=e.bones[t.boneIndex];if(!h.active)return;let l=0,u=0;if(i<t.frames[0])switch(n){case 0:h.rotation=h.data.rotation;default:return;case 1:l=h.rotation,u=h.data.rotation}else l=0==n?h.data.rotation:h.rotation,u=h.data.rotation+t.getCurveValue(i);let d=0,f=u-l;if(f-=360*(16384-(16384.499999999996-f/360|0)),0==f)d=r[a];else{let t=0,e=0;o?(t=0,e=f):(t=r[a],e=r[a+1]);let i=f>0,s=t>=0;c.signum(e)!=c.signum(f)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*c.signum(t)),s=i),d=f+t-t%360,s!=i&&(d+=360*c.signum(t)),r[a]=d}r[a+1]=f,h.rotation=l+d*s}queueEvents(t,e){let i=t.animationStart,s=t.animationEnd,n=s-i,r=t.trackLast%n,a=this.events,o=0,h=a.length;for(;o<h;o++){let e=a[o];if(e.time<r)break;e.time>s||this.queue.event(t,e)}let l=!1;for(l=t.loop?0==n||r>t.trackTime%n:e>=s&&t.animationLast<s,l&&this.queue.complete(t);o<h;o++){let e=a[o];e.time<i||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let i=e;for(;;){let t=i.mixingFrom;if(!t)break;this.queue.end(t),i.mixingFrom=null,i.mixingTo=null,i=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,i){let s=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,s&&(i&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,i=!1){let s=this.data.skeletonData.findAnimation(e);if(!s)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,s,i)}setAnimationWith(t,e,i=!1){if(!e)throw new Error("animation cannot be null.");let s=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,s=!1):this.clearNext(n));let r=this.trackEntry(t,e,i,n);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,i=!1,s=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,i,s)}addAnimationWith(t,e,i=!1,s=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let r=this.trackEntry(t,e,i,n);return n?(n.next=r,r.previous=n,s<=0&&(s+=n.getTrackComplete()-r.mixDuration)):(this.setCurrent(t,r,!0),this.queue.drain()),r.delay=s,r}setEmptyAnimation(t,e=0){let i=this.setAnimationWith(t,Ct.emptyAnimation(),!1);return i.mixDuration=e,i.trackEnd=e,i}addEmptyAnimation(t,e=0,i=0){let s=this.addAnimationWith(t,Ct.emptyAnimation(),!1,i);return i<=0&&(s.delay+=s.mixDuration-e),s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){let i=this.tracks[e];i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(m.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,i,s){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=i,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.attachmentThreshold=0,n.drawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=s?this.data.getMix(s.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=2,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&3==i.mixBlend||this.computeHold(i),i=i.mixingTo}while(i)}}}computeHold(t){let e=t.mixingTo,i=t.animation.timelines,s=t.animation.timelines.length,n=t.timelineMode;n.length=s;let r=t.timelineHoldMix;r.length=0;let a=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<s;t++)n[t]=a.addAll(i[t].getPropertyIds())?Bt:Ot;else t:for(let o=0;o<s;o++){let s=i[o],h=s.getPropertyIds();if(a.addAll(h))if(!e||s instanceof gt||s instanceof bt||s instanceof yt||!e.animation.hasTimeline(h))n[o]=Dt;else{for(let i=e.mixingTo;i;i=i.mixingTo)if(!i.animation.hasTimeline(h)){if(t.mixDuration>0){n[o]=Vt,r[o]=i;continue t}break}n[o]=Bt}else n[o]=Lt}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},Rt=Ct;Rt._emptyAnimation=new E("<empty>",[],0);var Ft=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}},Yt=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(Xt.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(Xt.interrupt),this.objects.push(t)}end(t){this.objects.push(Xt.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(Xt.dispose),this.objects.push(t)}complete(t){this.objects.push(Xt.complete),this.objects.push(t)}event(t,e){this.objects.push(Xt.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let i=0;i<t.length;i+=2){let s=t[i],n=t[i+1];switch(s){case Xt.start:n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++){let i=e[t];i.start&&i.start(n)}break;case Xt.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++){let i=e[t];i.interrupt&&i.interrupt(n)}break;case Xt.end:n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++){let i=e[t];i.end&&i.end(n)}case Xt.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++){let i=e[t];i.dispose&&i.dispose(n)}this.animState.trackEntryPool.free(n);break;case Xt.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++){let i=e[t];i.complete&&i.complete(n)}break;case Xt.event:let s=t[2+i++];n.listener&&n.listener.event&&n.listener.event(n,s);for(let t=0;t<e.length;t++){let i=e[t];i.event&&i.event(n,s)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Xt=(t=>(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(Xt||{}),Pt=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},Lt=0,Dt=1,Ot=2,Bt=3,Vt=4,zt=1,Nt=2,_t=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,i){let s=this.skeletonData.findAnimation(t);if(!s)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(s,n,i)}setMixWith(t,e,i){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let s=t.name+"."+e.name;this.animationToMixTime[s]=i}getMix(t,e){let i=t.name+"."+e.name,s=this.animationToMixTime[i];return void 0===s?this.defaultMix:s}},Ut=class extends M{constructor(t){super(t),this.color=new h(1,1,1,1)}copy(){let t=new Ut(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}},Wt=class extends M{constructor(t){super(t),this.endSlot=null,this.color=new h(.2275,.2275,.8078,1)}copy(){let t=new Wt(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}},qt=class{constructor(t){this._image=t}getImage(){return this._image}},Gt=(t=>(t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear",t))(Gt||{}),jt=(t=>(t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat",t))(jt||{}),Ht=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Zt=class extends qt{setFilters(t,e){}setWraps(t,e){}dispose(){}},Kt=class{constructor(t){this.pages=new Array,this.regions=new Array;let e=new Jt(t),i=new Array(4),s={size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:()=>{},filter:t=>{t.minFilter=m.enumValue(Gt,i[1]),t.magFilter=m.enumValue(Gt,i[2])},repeat:t=>{-1!=i[1].indexOf("x")&&(t.uWrap=10497),-1!=i[1].indexOf("y")&&(t.vWrap=10497)},pma:t=>{t.pma="true"==i[1]}};var n={xy:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:t=>{t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:t=>{t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:t=>{t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:t=>{t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:t=>{let e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(i[1])}};let r=e.readLine();for(;r&&0==r.trim().length;)r=e.readLine();for(;r&&0!=r.trim().length&&0!=e.readEntry(i,r);)r=e.readLine();let a=null,o=null,h=null;for(;null!==r;)if(0==r.trim().length)a=null,r=e.readLine();else if(a){let t=new $t(a,r);for(;;){let s=e.readEntry(i,r=e.readLine());if(0==s)break;let a=n[i[0]];if(a)a(t);else{o||(o=[]),h||(h=[]),o.push(i[0]);let t=[];for(let e=0;e<s;e++)t.push(parseInt(i[e+1]));h.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),o&&o.length>0&&h&&h.length>0&&(t.names=o,t.values=h,o=null,h=null),t.u=t.x/a.width,t.v=t.y/a.height,90==t.degrees?(t.u2=(t.x+t.height)/a.width,t.v2=(t.y+t.width)/a.height):(t.u2=(t.x+t.width)/a.width,t.v2=(t.y+t.height)/a.height),this.regions.push(t)}else{for(a=new Qt(r.trim());0!=e.readEntry(i,r=e.readLine());){let t=s[i[0]];t&&t(a)}this.pages.push(a)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let i of this.pages)i.setTexture(t.get(e+i.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)null==(t=this.pages[e].texture)||t.dispose()}},Jt=class{constructor(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let i=e.indexOf(":");if(-1==i)return 0;t[0]=e.substr(0,i).trim();for(let s=1,n=i+1;;s++){let i=e.indexOf(",",n);if(-1==i)return t[s]=e.substr(n).trim(),s;if(t[s]=e.substr(n,i-n).trim(),n=i+1,4==s)return 4}}},Qt=class{constructor(t){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}},$t=class extends Ht{constructor(t,e){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=t,this.name=e}},te=class extends M{constructor(t,e){super(t),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new h(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new h(0,0,0,0),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=m.newFloatArray(t.length));let e=this.uvs,i=this.uvs.length,s=this.region.u,n=this.region.v,r=0,a=0;if(this.region instanceof $t){let o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:s-=(o.originalHeight-o.offsetY-o.height)/l,n-=(o.originalWidth-o.offsetX-o.width)/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o<i;o+=2)e[o]=s+t[o+1]*r,e[o+1]=n+(1-t[o])*a;return;case 180:s-=(o.originalWidth-o.offsetX-o.width)/l,n-=o.offsetY/c,r=o.originalWidth/l,a=o.originalHeight/c;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o])*r,e[o+1]=n+(1-t[o+1])*a;return;case 270:s-=o.offsetY/l,n-=o.offsetX/c,r=o.originalHeight/l,a=o.originalWidth/c;for(let o=0;o<i;o+=2)e[o]=s+(1-t[o+1])*r,e[o+1]=n+t[o]*a;return}s-=o.offsetX/l,n-=(o.originalHeight-o.offsetY-o.height)/c,r=o.originalWidth/l,a=o.originalHeight/c}else this.region?(r=this.region.u2-s,a=this.region.v2-n):(s=n=0,r=a=1);for(let o=0;o<i;o+=2)e[o]=s+t[o]*r,e[o+1]=n+t[o+1]*a}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new te(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),m.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),m.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),m.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),m.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,i,s,n,r){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,i,s,n,r)}newLinkedMesh(){let t=new te(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}},ee=class extends M{constructor(t){super(t),this.lengths=[],this.closed=!1,this.constantSpeed=!1,this.color=new h(1,1,1,1)}copy(){let t=new ee(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),m.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}},ie=class extends M{constructor(t){super(t),this.x=0,this.y=0,this.rotation=0,this.color=new h(.38,.94,0,1)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){let e=c.cosDeg(this.rotation),i=c.sinDeg(this.rotation),s=e*t.a+i*t.b,n=e*t.c+i*t.d;return Math.atan2(n,s)*c.radDeg}copy(){let t=new ie(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}},se=class extends b{constructor(t,e){super(t),this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new h(1,1,1,1),this.rendererObject=null,this.region=null,this.sequence=null,this.offset=m.newFloatArray(8),this.uvs=m.newFloatArray(8),this.tempColor=new h(1,1,1,1),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);let i=this.width/this.region.originalWidth*this.scaleX,s=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*s,a=n+this.region.width*i,o=r+this.region.height*s,h=this.rotation*Math.PI/180,l=Math.cos(h),c=Math.sin(h),u=this.x,d=this.y,f=n*l+u,p=n*c,m=r*l+d,g=r*c,x=a*l+u,w=a*c,y=o*l+d,v=o*c,b=this.offset;b[0]=f-g,b[1]=m+p,b[2]=f-v,b[3]=y+p,b[4]=x-v,b[5]=y+w,b[6]=x-g,b[7]=m+w,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,i,s){null!=this.sequence&&this.sequence.apply(t,this);let n=t.bone,r=this.offset,a=n.worldX,o=n.worldY,h=n.a,l=n.b,c=n.c,u=n.d,d=0,f=0;d=r[0],f=r[1],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[2],f=r[3],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[4],f=r[5],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o,i+=s,d=r[6],f=r[7],e[i]=d*h+f*l+a,e[i+1]=d*c+f*u+o}copy(){let t=new se(this.name,this.path);return t.region=this.region,t.rendererObject=this.rendererObject,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,m.arrayCopy(this.uvs,0,t.uvs,0,8),m.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}},ne=se;ne.X1=0,ne.Y1=1,ne.C1R=2,ne.C1G=3,ne.C1B=4,ne.C1A=5,ne.U1=6,ne.V1=7,ne.X2=8,ne.Y2=9,ne.C2R=10,ne.C2G=11,ne.C2B=12,ne.C2A=13,ne.U2=14,ne.V2=15,ne.X3=16,ne.Y3=17,ne.C3R=18,ne.C3G=19,ne.C3B=20,ne.C3A=21,ne.U3=22,ne.V3=23,ne.X4=24,ne.Y4=25,ne.C4R=26,ne.C4G=27,ne.C4B=28,ne.C4A=29,ne.U4=30,ne.V4=31;var re=class{constructor(t){this.atlas=t}loadSequence(t,e,i){let s=i.regions;for(let n=0,r=s.length;n<r;n++){let r=i.getPath(e,n),a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (sequence: "+t+")");s[n]=a,s[n].renderObject=s[n]}}newRegionAttachment(t,e,i,s){let n=new ne(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (region attachment: "+e+")");t.renderObject=t,n.region=t}return n}newMeshAttachment(t,e,i,s){let n=new te(e,i);if(null!=s)this.loadSequence(e,i,s);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+e+")");t.renderObject=t,n.region=t}return n}newBoundingBoxAttachment(t,e){return new Ut(e)}newPathAttachment(t,e){return new ee(e)}newPointAttachment(t,e){return new ie(e)}newClippingAttachment(t,e){return new Wt(e)}},ae=class{constructor(t,e,i){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=oe.Normal,this.skinRequired=!1,this.color=new h,t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}},oe=(t=>(t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection",t))(oe||{}),he=class{constructor(t,e,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,s,n,r,a){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=s,this.ascaleY=n,this.ashearX=r,this.ashearY=a;let o=this.parent;if(!o){let o=this.skeleton,h=i+90+a,l=o.scaleX,u=o.scaleY;return this.a=c.cosDeg(i+r)*s*l,this.b=c.cosDeg(h)*n*l,this.c=c.sinDeg(i+r)*s*u,this.d=c.sinDeg(h)*n*u,this.worldX=t*l+o.x,void(this.worldY=e*u+o.y)}let h=o.a,l=o.b,u=o.c,d=o.d;switch(this.worldX=h*t+l*e+o.worldX,this.worldY=u*t+d*e+o.worldY,this.data.transformMode){case 0:{let t=i+90+a,e=c.cosDeg(i+r)*s,o=c.cosDeg(t)*n,f=c.sinDeg(i+r)*s,p=c.sinDeg(t)*n;return this.a=h*e+l*f,this.b=h*o+l*p,this.c=u*e+d*f,void(this.d=u*o+d*p)}case 1:{let t=i+90+a;this.a=c.cosDeg(i+r)*s,this.b=c.cosDeg(t)*n,this.c=c.sinDeg(i+r)*s,this.d=c.sinDeg(t)*n;break}case 2:{let t=h*h+u*u,e=0;t>1e-4?(t=Math.abs(h*d-l*u)/t,h/=this.skeleton.scaleX,u/=this.skeleton.scaleY,l=u*t,d=h*t,e=Math.atan2(u,h)*c.radDeg):(h=0,u=0,e=90-Math.atan2(d,l)*c.radDeg);let o=i+r-e,f=i+a-e+90,p=c.cosDeg(o)*s,m=c.cosDeg(f)*n,g=c.sinDeg(o)*s,x=c.sinDeg(f)*n;this.a=h*p-l*g,this.b=h*m-l*x,this.c=u*p+d*g,this.d=u*m+d*x;break}case 3:case 4:{let t=c.cosDeg(i),e=c.sinDeg(i),o=(h*t+l*e)/this.skeleton.scaleX,f=(u*t+d*e)/this.skeleton.scaleY,p=Math.sqrt(o*o+f*f);p>1e-5&&(p=1/p),o*=p,f*=p,p=Math.sqrt(o*o+f*f),3==this.data.transformMode&&h*d-l*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let m=Math.PI/2+Math.atan2(f,o),g=Math.cos(m)*p,x=Math.sin(m)*p,w=c.cosDeg(r)*s,y=c.cosDeg(90+a)*n,v=c.sinDeg(r)*s,b=c.sinDeg(90+a)*n;this.a=o*w+g*v,this.b=o*y+g*b,this.c=f*w+x*v,this.d=f*y+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*c.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*c.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*c.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*c.radDeg);let e=t.a,i=t.b,s=t.c,n=t.d,r=1/(e*n-i*s),a=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=a*n*r-o*i*r,this.ay=o*e*r-a*s*r;let h=r*n,l=r*e,u=r*i,d=r*s,f=h*this.a-u*this.c,p=h*this.b-u*this.d,m=l*this.c-d*this.a,g=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let t=f*g-p*m;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(f*p+m*g,t)*c.radDeg,this.arotation=Math.atan2(m,f)*c.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*c.radDeg}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),i=t.x-this.worldX,s=t.y-this.worldY;return t.x=i*this.d*e-s*this.b*e,t.y=s*this.a*e-i*this.c*e,t}localToWorld(t){let e=t.x,i=t.y;return t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t}worldToLocalRotation(t){let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(this.a*e-this.c*i,this.d*i-this.b*e)*c.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=c.sinDeg(t),i=c.cosDeg(t);return Math.atan2(i*this.c+e*this.d,i*this.a+e*this.b)*c.radDeg}rotateWorld(t){let e=this.a,i=this.b,s=this.c,n=this.d,r=c.cosDeg(t),a=c.sinDeg(t);this.a=r*e-a*s,this.b=r*i-a*n,this.c=a*e+r*s,this.d=a*i+r*n}},le=class{constructor(t,e,i){this.name=t,this.order=e,this.skinRequired=i}},ce=class{constructor(t,e="",i=new ue){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,i){this.toLoad--,this.loaded++,this.assets[e]=i,t&&t(e,i)}error(t,e,i){this.toLoad--,this.loaded++,this.errors[e]=i,t&&t(e,i)}loadAll(){return new Promise((t,e)=>{let i=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadBinary(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load binary ${t}: status ${e}, ${s}`)})}loadText(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadText(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load text ${t}: status ${e}, ${s}`)})}loadJson(t,e=(()=>{}),i=(()=>{})){t=this.start(t),this.downloader.downloadJson(t,i=>{this.success(e,t,i)},(e,s)=>{this.error(i,t,`Couldn't load JSON ${t}: status ${e}, ${s}`)})}loadTexture(t,e=(()=>{}),i=(()=>{})){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(i,t,"Couldn't load image: "+t),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(i=>{i&&this.success(e,t,this.textureLoader(i))});else{let s=new Image;s.crossOrigin="anonymous",s.onload=()=>{this.success(e,t,this.textureLoader(s))},s.onerror=()=>{this.error(i,t,"Couldn't load image: "+t)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),s.src=t}}loadTextureAtlas(t,e=(()=>{}),i=(()=>{}),s){let n=t.lastIndexOf("/"),r=n>=0?t.substring(0,n+1):"";t=this.start(t),this.downloader.downloadText(t,n=>{try{let a=new Kt(n),o=a.pages.length,h=!1;for(let n of a.pages)this.loadTexture(s?s[n.name]:r+n.name,(i,s)=>{h||(n.setTexture(s),0==--o&&this.success(e,t,a))},(e,s)=>{h||this.error(i,t,`Couldn't load texture atlas ${t} page image: ${e}`),h=!0})}catch(e){this.error(i,t,`Couldn't parse texture atlas ${t}: ${e.message}`)}},(e,s)=>{this.error(i,t,`Couldn't load texture atlas ${t}: status ${e}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let i=this.errors[t];throw Error("Asset not found: "+t+(i?"\n"+i:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ue=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+="base64,".length,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n<i;n++)s[n]=e.charCodeAt(n);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+="base64,".length,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.overrideMimeType("text/html"),s.open("GET",t,!0);let n=()=>{this.finish(t,s.status,s.responseText)};s.onload=n,s.onerror=n,s.send()}downloadJson(t,e,i){this.downloadText(t,t=>{e(JSON.parse(t))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="arraybuffer";let n=()=>{this.finish(t,s.status,s.response)};s.onload=()=>{200==s.status||0==s.status?this.finish(t,200,new Uint8Array(s.response)):n()},s.onerror=n,s.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[i]:[e,i];for(let t=n.length-1,e=s.length;t<e;t+=2)s[t].apply(null,n)}},de=class{constructor(t,e){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!e)throw new Error("data cannot be null.");this.time=t,this.data=e}},fe=class{constructor(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t}},pe=class{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error("Couldn't find bone "+t.bones[i].name);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find bone "+t.target.name);this.target=i}isActive(){return this.active}update(){if(0==this.mix)return;let t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,i,s,n,r,a){let o=t.parent;if(!o)throw new Error("IK bone must have parent.");let h=o.a,l=o.b,u=o.c,d=o.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case 1:p=e-t.worldX,m=i-t.worldY;break;case 2:let s=Math.abs(h*d-l*u)/(h*h+u*u),n=h/t.skeleton.scaleX,r=u/t.skeleton.scaleY;l=-r*s*t.skeleton.scaleX,d=n*s*t.skeleton.scaleY,f+=Math.atan2(r,n)*c.radDeg;default:let a=e-o.worldX,g=i-o.worldY,x=h*d-l*u;p=(a*d-g*l)/x-t.ax,m=(g*h-a*u)/x-t.ay}f+=Math.atan2(m,p)*c.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,x=t.ascaleY;if(s||n){switch(t.data.transformMode){case 3:case 4:p=e-t.worldX,m=i-t.worldY}let o=t.data.length*g,h=Math.sqrt(p*p+m*m);if(s&&h<o||n&&h>o&&o>1e-4){let t=(h/o-1)*a+1;g*=t,r&&(x*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*a,g,x,t.ashearX,t.ashearY)}apply2(t,e,i,s,n,r,a,o,h){let l=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,p=d,m=f,g=e.ascaleX,x=0,w=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,w=180):w=0;let v=e.ax,b=0,A=0,M=0,S=t.a,I=t.b,k=t.c,T=t.d,E=Math.abs(d-f)<=1e-4;!E||r?(b=0,A=S*v+t.worldX,M=k*v+t.worldY):(b=e.ay,A=S*v+I*b+t.worldX,M=k*v+T*b+t.worldY);let C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");S=C.a,I=C.b,k=C.c,T=C.d;let R,F,Y=1/(S*T-I*k),X=A-C.worldX,P=M-C.worldY,L=(X*T-P*I)*Y-l,D=(P*S-X*k)*Y-u,O=Math.sqrt(L*L+D*D),B=e.data.length*g;if(O<1e-4)return this.apply1(t,i,s,!1,r,!1,h),void e.updateWorldTransformWith(v,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);X=i-C.worldX,P=s-C.worldY;let V=(X*T-P*I)*Y-l,z=(P*S-X*k)*Y-u,N=V*V+z*z;if(0!=o){o*=d*(g+1)*.5;let t=Math.sqrt(N),e=t-O-B*d+o;if(e>0){let i=Math.min(1,e/(2*o))-1;i=(e-o*(1-i*i))/t,V-=i*V,z-=i*z,N=V*V+z*z}}t:if(E){B*=d;let t=(N-O*O-B*B)/(2*O*B);t<-1?(t=-1,F=Math.PI*n):t>1?(t=1,F=0,r&&(S=(Math.sqrt(N)/(O+B)-1)*h+1,p*=S,a&&(m*=S))):F=Math.acos(t)*n,S=O+B*t,I=B*Math.sin(F),R=Math.atan2(z*S-V*I,V*S+z*I)}else{S=d*B,I=f*B;let t=S*S,e=I*I,i=Math.atan2(z,V);k=e*O*O+t*N-t*e;let s=-2*e*O,r=e-t;if(T=s*s-4*r*k,T>=0){let t=Math.sqrt(T);s<0&&(t=-t),t=.5*-(s+t);let e=t/r,a=k/t,o=Math.abs(e)<Math.abs(a)?e:a;if(o*o<=N){P=Math.sqrt(N-o*o)*n,R=i-Math.atan2(P,o),F=Math.atan2(P/f,(o-O)/d);break t}}let a=c.PI,o=O-S,h=o*o,l=0,u=0,p=O+S,m=p*p,g=0;k=-S*O/(t-e),k>=-1&&k<=1&&(k=Math.acos(k),X=S*Math.cos(k)+O,P=I*Math.sin(k),T=X*X+P*P,T<h&&(a=k,h=T,o=X,l=P),T>m&&(u=k,m=T,p=X,g=P)),N<=.5*(h+m)?(R=i-Math.atan2(l*n,o),F=a*n):(R=i-Math.atan2(g*n,p),F=u*n)}let _=Math.atan2(b,v)*y,U=t.arotation;R=(R-_)*c.radDeg+x-U,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(l,u,U+R*h,p,m,0,0),U=e.arotation,F=((F+_)*c.radDeg-e.ashearX)*y+w-U,F>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(v,b,U+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},me=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ge=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=xe.Fixed,this.spacingMode=we.Fixed,this.rotateMode=ye.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},xe=(t=>(t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent",t))(xe||{}),we=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional",t))(we||{}),ye=(t=>(t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale",t))(ye||{}),ve=class{constructor(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let i=0,s=t.bones.length;i<s;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findSlot(t.target.name);if(!i)throw new Error("Couldn't find target bone "+t.target.name);this.target=i,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}update(){let t=this.target.getAttachment();if(!(t instanceof ee))return;let e=this.mixRotate,i=this.mixX,s=this.mixY;if(0==e&&0==i&&0==s)return;let n=this.data,r=0==n.rotateMode,a=2==n.rotateMode,o=this.bones,h=o.length,l=r?h:h+1,u=m.setArraySize(this.spaces,l),d=a?this.lengths=m.setArraySize(this.lengths,h):[],f=this.spacing;switch(n.spacingMode){case 2:if(a)for(let t=0,e=l-1;t<e;t++){let e=o[t],i=e.data.length;if(i<ve.epsilon)d[t]=0;else{let s=i*e.a,n=i*e.c;d[t]=Math.sqrt(s*s+n*n)}}m.arrayFill(u,1,l,f);break;case 3:let t=0;for(let e=0,i=l-1;e<i;){let i=o[e],s=i.data.length;if(s<ve.epsilon)a&&(d[e]=0),u[++e]=f;else{let n=s*i.a,r=s*i.c,o=Math.sqrt(n*n+r*r);a&&(d[e]=o),u[++e]=o,t+=o}}if(t>0){t=l/t*f;for(let e=1;e<l;e++)u[e]*=t}break;default:let e=0==n.spacingMode;for(let t=0,i=l-1;t<i;){let i=o[t],s=i.data.length;if(s<ve.epsilon)a&&(d[t]=0),u[++t]=f;else{let n=s*i.a,r=s*i.c,o=Math.sqrt(n*n+r*r);a&&(d[t]=o),u[++t]=(e?s+f:f)*o/s}}}let p=this.computeWorldPositions(t,l,r),g=p[0],x=p[1],w=n.offsetRotation,y=!1;if(0==w)y=1==n.rotateMode;else{y=!1;let t=this.target.bone;w*=t.a*t.d-t.b*t.c>0?c.degRad:-c.degRad}for(let t=0,n=3;t<h;t++,n+=3){let h=o[t];h.worldX+=(g-h.worldX)*i,h.worldY+=(x-h.worldY)*s;let l=p[n],f=p[n+1],m=l-g,v=f-x;if(a){let i=d[t];if(0!=i){let t=(Math.sqrt(m*m+v*v)/i-1)*e+1;h.a*=t,h.c*=t}}if(g=l,x=f,e>0){let i=h.a,s=h.b,a=h.c,o=h.d,l=0,d=0,f=0;if(l=r?p[n-1]:0==u[t+1]?p[n+2]:Math.atan2(v,m),l-=Math.atan2(a,i),y){d=Math.cos(l),f=Math.sin(l);let t=h.data.length;g+=(t*(d*i-f*a)-m)*e,x+=(t*(f*i+d*a)-v)*e}else l+=w;l>c.PI?l-=c.PI2:l<-c.PI&&(l+=c.PI2),l*=e,d=Math.cos(l),f=Math.sin(l),h.a=d*i-f*a,h.b=d*s-f*o,h.c=f*i+d*a,h.d=f*s+d*o}h.updateAppliedTransform()}}computeWorldPositions(t,e,i){let s=this.target,n=this.position,r=this.spaces,a=m.setArraySize(this.positions,3*e+2),o=this.world,h=t.closed,l=t.worldVerticesLength,c=l/6,u=ve.NONE;if(!t.constantSpeed){let d=t.lengths;c-=h?1:2;let f,p=d[c];switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:f=p;break;case 3:f=p/e;break;default:f=1}o=m.setArraySize(this.world,8);for(let m=0,g=0,x=0;m<e;m++,g+=3){let e=r[m]*f;n+=e;let w=n;if(h)w%=p,w<0&&(w+=p),x=0;else{if(w<0){u!=ve.BEFORE&&(u=ve.BEFORE,t.computeWorldVertices(s,2,4,o,0,2)),this.addBeforePosition(w,o,0,a,g);continue}if(w>p){u!=ve.AFTER&&(u=ve.AFTER,t.computeWorldVertices(s,l-6,4,o,0,2)),this.addAfterPosition(w-p,o,0,a,g);continue}}for(;;x++){let t=d[x];if(!(w>t)){if(0==x)w/=t;else{let e=d[x-1];w=(w-e)/(t-e)}break}}x!=u&&(u=x,h&&x==c?(t.computeWorldVertices(s,l-4,4,o,0,2),t.computeWorldVertices(s,0,4,o,4,2)):t.computeWorldVertices(s,6*x+2,8,o,0,2)),this.addCurvePosition(w,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],a,g,i||m>0&&0==e)}return a}h?(l+=2,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l-4,o,0,2),t.computeWorldVertices(s,0,2,o,l-4,2),o[l-2]=o[0],o[l-1]=o[1]):(c--,l-=4,o=m.setArraySize(this.world,l),t.computeWorldVertices(s,2,l,o,0,2));let d,f=m.setArraySize(this.curves,c),p=0,g=o[0],x=o[1],w=0,y=0,v=0,b=0,A=0,M=0,S=0,I=0,k=0,T=0,E=0,C=0,R=0,F=0;for(let t=0,e=2;t<c;t++,e+=6)w=o[e],y=o[e+1],v=o[e+2],b=o[e+3],A=o[e+4],M=o[e+5],S=.1875*(g-2*w+v),I=.1875*(x-2*y+b),k=.09375*(3*(w-v)-g+A),T=.09375*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.75*(w-g)+S+.16666667*k,F=.75*(y-x)+I+.16666667*T,p+=Math.sqrt(R*R+F*F),R+=E,F+=C,E+=k,C+=T,p+=Math.sqrt(R*R+F*F),R+=E,F+=C,p+=Math.sqrt(R*R+F*F),R+=E+k,F+=C+T,p+=Math.sqrt(R*R+F*F),f[t]=p,g=A,x=M;switch(1==this.data.positionMode&&(n*=p),this.data.spacingMode){case 2:d=p;break;case 3:d=p/e;break;default:d=1}let Y=this.segments,X=0;for(let t=0,s=0,c=0,m=0;t<e;t++,s+=3){let e=r[t]*d;n+=e;let P=n;if(h)P%=p,P<0&&(P+=p),c=0;else{if(P<0){this.addBeforePosition(P,o,0,a,s);continue}if(P>p){this.addAfterPosition(P-p,o,l-4,a,s);continue}}for(;;c++){let t=f[c];if(!(P>t)){if(0==c)P/=t;else{let e=f[c-1];P=(P-e)/(t-e)}break}}if(c!=u){u=c;let t=6*c;for(g=o[t],x=o[t+1],w=o[t+2],y=o[t+3],v=o[t+4],b=o[t+5],A=o[t+6],M=o[t+7],S=.03*(g-2*w+v),I=.03*(x-2*y+b),k=.006*(3*(w-v)-g+A),T=.006*(3*(y-b)-x+M),E=2*S+k,C=2*I+T,R=.3*(w-g)+S+.16666667*k,F=.3*(y-x)+I+.16666667*T,X=Math.sqrt(R*R+F*F),Y[0]=X,t=1;t<8;t++)R+=E,F+=C,E+=k,C+=T,X+=Math.sqrt(R*R+F*F),Y[t]=X;R+=E,F+=C,X+=Math.sqrt(R*R+F*F),Y[8]=X,R+=E+k,F+=C+T,X+=Math.sqrt(R*R+F*F),Y[9]=X,m=0}for(P*=X;;m++){let t=Y[m];if(!(P>t)){if(0==m)P/=t;else{let e=Y[m-1];P=m+(P-e)/(t-e)}break}}this.addCurvePosition(.1*P,g,x,w,y,v,b,A,M,a,s,i||t>0&&0==e)}return a}addBeforePosition(t,e,i,s,n){let r=e[i],a=e[i+1],o=e[i+2]-r,h=e[i+3]-a,l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addAfterPosition(t,e,i,s,n){let r=e[i+2],a=e[i+3],o=r-e[i],h=a-e[i+1],l=Math.atan2(h,o);s[n]=r+t*Math.cos(l),s[n+1]=a+t*Math.sin(l),s[n+2]=l}addCurvePosition(t,e,i,s,n,r,a,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=i,void(l[c+2]=Math.atan2(n-i,s-e));let d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,x=p*t,w=3*x,y=p*w,v=w*t,b=e*g+s*y+r*v+o*f,A=i*g+n*y+a*v+h*f;l[c]=b,l[c+1]=A,u&&(l[c+2]=t<.001?Math.atan2(n-i,s-e):Math.atan2(A-(i*m+n*x*2+a*d),b-(e*m+s*x*2+r*d)))}},be=ve;be.NONE=-1,be.BEFORE=-2,be.AFTER=-3,be.epsilon=1e-5;var Ae=class{constructor(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new h,this.darkColor=t.darkColor?new h:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof M&&this.attachment instanceof M&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},Me=class{constructor(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new w,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(let i=0;i<t.bones.length;i++){let s=e.findBone(t.bones[i].name);if(!s)throw new Error(`Couldn't find bone ${t.bones[i].name}.`);this.bones.push(s)}let i=e.findBone(t.target.name);if(!i)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=i}isActive(){return this.active}update(){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;f<x;f++){let x=g[f];if(0!=t){let e=x.a,i=x.b,s=x.c,n=x.d,r=Math.atan2(u,h)-Math.atan2(s,e)+p;r>c.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*i}if(0!=s){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*s)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(l*l+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(r>0){let t=x.b,e=x.d,i=Math.atan2(e,t),s=Math.atan2(d,l)-Math.atan2(u,h)-(i-Math.atan2(x.c,x.a));s>c.PI?s-=c.PI2:s<-c.PI&&(s+=c.PI2),s=i+(s+m)*r;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(s)*n,x.d=Math.sin(s)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=0!=e||0!=i,o=this.target,h=o.a,l=o.b,u=o.c,d=o.d,f=h*d-l*u>0?c.degRad:-c.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let f=0,x=g.length;f<x;f++){let x=g[f];if(0!=t){let e=x.a,i=x.b,s=x.c,n=x.d,r=Math.atan2(u,h)+p;r>c.PI?r-=c.PI2:r<-c.PI&&(r+=c.PI2),r*=t;let a=Math.cos(r),o=Math.sin(r);x.a=a*e-o*s,x.b=a*i-o*n,x.c=o*e+a*s,x.d=o*i+a*n}if(a){let t=this.temp;o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*i}if(0!=s){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*s+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(l*l+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(r>0){let t=Math.atan2(d,l)-Math.atan2(u,h);t>c.PI?t-=c.PI2:t<-c.PI&&(t+=c.PI2);let e=x.b,i=x.d;t=Math.atan2(i,e)+(t-c.PI/2+m)*r;let s=Math.sqrt(e*e+i*i);x.b=Math.cos(t)*s,x.d=Math.sin(t)*s}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],c=l.arotation;if(0!=t){let e=a.arotation-c+this.data.offsetRotation;e-=360*(16384-(16384.499999999996-e/360|0)),c+=e*t}let u=l.ax,d=l.ay;u+=(a.ax-u+this.data.offsetX)*e,d+=(a.ay-d+this.data.offsetY)*i;let f=l.ascaleX,p=l.ascaleY;0!=s&&0!=f&&(f=(f+(a.ascaleX-f+this.data.offsetScaleX)*s)/f),0!=n&&0!=p&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p);let m=l.ashearY;if(0!=r){let t=a.ashearY-m+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),m+=t*r}l.updateWorldTransformWith(u,d,c,f,p,l.ashearX,m)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,i=this.mixY,s=this.mixScaleX,n=this.mixScaleY,r=this.mixShearY,a=this.target,o=this.bones;for(let h=0,l=o.length;h<l;h++){let l=o[h],c=l.arotation+(a.arotation+this.data.offsetRotation)*t,u=l.ax+(a.ax+this.data.offsetX)*e,d=l.ay+(a.ay+this.data.offsetY)*i,f=l.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*s+1),p=l.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*n+1),m=l.ashearY+(a.ashearY+this.data.offsetShearY)*r;l.updateWorldTransformWith(u,d,c,f,p,l.ashearX,m)}}},Se=class{constructor(t){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let i,s=t.bones[e];if(s.parent){let t=this.bones[s.parent.index];i=new he(s,this,t),t.children.push(i)}else i=new he(s,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let i=t.slots[e],s=this.bones[i.boneData.index],n=new Ae(i,s);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let i=t.ikConstraints[e];this.ikConstraints.push(new pe(i,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let i=t.transformConstraints[e];this.transformConstraints.push(new Me(i,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let i=t.pathConstraints[e];this.pathConstraints.push(new be(i,this))}this.color=new h(1,1,1,1),this.updateCache()}get scaleY(){return Se.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,i=this.skin.bones.length;e<i;e++){let i=this.bones[t[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(i)}}let e=this.ikConstraints,i=this.transformConstraints,s=this.pathConstraints,n=e.length,r=i.length,a=s.length,o=n+r+a;t:for(let t=0;t<o;t++){for(let i=0;i<n;i++){let s=e[i];if(s.data.order==t){this.sortIkConstraint(s);continue t}}for(let e=0;e<r;e++){let s=i[e];if(s.data.order==t){this.sortTransformConstraint(s);continue t}}for(let e=0;e<a;e++){let i=s[e];if(i.data.order==t){this.sortPathConstraint(i);continue t}}}for(let e=0,i=t.length;e<i;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let i=t.bones,s=i[0];if(this.sortBone(s),1==i.length)this._updateCache.push(t),this.sortReset(s.children);else{let e=i[i.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(s.children),e.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,i=e.data.index,s=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,s),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,s);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],i,s);let n=e.getAttachment();n instanceof ee&&this.sortPathConstraintAttachmentWith(n,s);let r=t.bones,a=r.length;for(let t=0;t<a;t++)this.sortBone(r[t]);this._updateCache.push(t);for(let t=0;t<a;t++)this.sortReset(r[t].children);for(let t=0;t<a;t++)r[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&m.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,i=e.length;if(t.data.local)for(let t=0;t<i;t++){let i=e[t];this.sortBone(i.parent),this.sortBone(i)}else for(let t=0;t<i;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<i;t++)this.sortReset(e[t].children);for(let t=0;t<i;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,i){let s=t.attachments[e];if(s)for(let t in s)this.sortPathConstraintAttachmentWith(s[t],i)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof ee))return;let i=t.bones;if(i){let t=this.bones;for(let e=0,s=i.length;e<s;){let s=i[e++];for(s+=e;e<s;)this.sortBone(t[i[e++]])}}else this.sortBone(e)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,i=t.length;e<i;e++){let i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){let t=this.bones;for(let e=0,i=t.length;e<i;e++){let i=t[e];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}let e=this._updateCache;for(let t=0,i=e.length;t<i;t++)e[t].update()}updateWorldTransformWith(t){let e=this.getRootBone();if(!e)throw new Error("Root bone must not be null.");let i=t.a,s=t.b,n=t.c,r=t.d;e.worldX=i*this.x+s*this.y+t.worldX,e.worldY=n*this.x+r*this.y+t.worldY;let a=e.rotation+90+e.shearY,o=c.cosDeg(e.rotation+e.shearX)*e.scaleX,h=c.cosDeg(a)*e.scaleY,l=c.sinDeg(e.rotation+e.shearX)*e.scaleX,u=c.sinDeg(a)*e.scaleY;e.a=(i*o+s*l)*this.scaleX,e.b=(i*h+s*u)*this.scaleX,e.c=(n*o+r*l)*this.scaleY,e.d=(n*h+r*u)*this.scaleY;let d=this._updateCache;for(let t=0,i=d.length;t<i;t++){let i=d[t];i!=e&&i.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let t=this.bones;for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose();let e=this.ikConstraints;for(let t=0,i=e.length;t<i;t++){let i=e[t];i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}let i=this.transformConstraints;for(let t=0,e=i.length;t<e;t++){let e=i[t],s=e.data;e.mixRotate=s.mixRotate,e.mixX=s.mixX,e.mixY=s.mixY,e.mixScaleX=s.mixScaleX,e.mixScaleY=s.mixScaleY,e.mixShearY=s.mixShearY}let s=this.pathConstraints;for(let t=0,e=s.length;t<e;t++){let e=s[t],i=e.data;e.position=i.position,e.spacing=i.spacing,e.mixRotate=i.mixRotate,e.mixX=i.mixX,e.mixY=i.mixY}}setSlotsToSetupPose(){let t=this.slots;m.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,i=t.length;e<i;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i],n=s.data.attachmentName;if(n){let e=t.getAttachment(i,n);e&&s.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let i=this.data.findSlot(t);if(!i)throw new Error("Can't find slot with name "+t);return this.getAttachment(i.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let i=this.skin.getAttachment(t,e);if(i)return i}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let i=this.slots;for(let s=0,n=i.length;s<n;s++){let n=i[s];if(n.data.name==t){let i=null;if(e&&(i=this.getAttachment(s,e),!i))throw new Error("Attachment not found: "+e+", for slot: "+t);return void n.setAttachment(i)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.data.name==t)return s}return null}getBoundsRect(){let t=new w,e=new w;return this.getBounds(t,e),{x:t.x,y:t.y,width:e.x,height:e.y}}getBounds(t,e,i=new Array(2)){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let s=this.drawOrder,n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let t=0,e=s.length;t<e;t++){let e=s[t];if(!e.bone.active)continue;let h=0,l=null,c=e.getAttachment();if(c instanceof ne)h=8,l=m.setArraySize(i,h,0),c.computeWorldVertices(e,l,0,2);else if(c instanceof te){let t=c;h=t.worldVerticesLength,l=m.setArraySize(i,h,0),t.computeWorldVertices(e,0,h,l,0,2)}if(l)for(let t=0,e=l.length;t<e;t+=2){let e=l[t],i=l[t+1];n=Math.min(n,e),r=Math.min(r,i),a=Math.max(a,e),o=Math.max(o,i)}}t.set(n,r),e.set(a-n,o-r)}},Ie=Se;Ie.yDown=!1;var ke=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.ikConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.transformConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");let e=this.pathConstraints;for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.name==t)return s}return null}},Te=class{constructor(t=0,e,i){this.slotIndex=t,this.name=e,this.attachment=i}},Ee=class{constructor(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,i){if(!i)throw new Error("attachment cannot be null.");let s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=i}addSkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];this.setAttachment(i.slotIndex,i.name,i.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let i=t.bones[e],s=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==i){s=!0;break}s||this.bones.push(i)}for(let e=0;e<t.constraints.length;e++){let i=t.constraints[e],s=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==i){s=!0;break}s||this.constraints.push(i)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var i=e[t];i.attachment&&(i.attachment instanceof te?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(t,e){let i=this.attachments[t];return i?i[e]:null}removeAttachment(t,e){let i=this.attachments[t];i&&delete i[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let i=this.attachments[e];if(i)for(let s in i){let n=i[s];n&&t.push(new Te(e,s,n))}}return t}getAttachmentsForSlot(t,e){let i=this.attachments[t];if(i)for(let s in i){let n=i[s];n&&e.push(new Te(t,s,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let i=0;for(let s=0;s<t.slots.length;s++){let n=t.slots[s],r=n.getAttachment();if(r&&i<e.attachments.length){let t=e.attachments[i];for(let e in t){if(r==t[e]){let t=this.getAttachment(i,e);t&&n.setAttachment(t);break}}}i++}}},Ce=class{constructor(t,e,i){if(this.index=0,this.color=new h(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=Re.Normal,t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}},Re=(t=>(t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen",t))(Re||{}),Fe=class extends le{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ye=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke;i.name="";let s=new Xe(t),n=s.readInt32(),r=s.readInt32();i.hash=0==r&&0==n?null:r.toString(16)+n.toString(16),i.version=s.readString(),i.x=s.readFloat(),i.y=s.readFloat(),i.width=s.readFloat(),i.height=s.readFloat();let a=s.readBoolean();a&&(i.fps=s.readFloat(),i.imagesPath=s.readString(),i.audioPath=s.readString());let o=0;o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readString();if(!t)throw new Error("String in string table must not be null.");s.strings.push(t)}o=s.readInt(!0);for(let t=0;t<o;t++){let n=s.readString();if(!n)throw new Error("Bone name must not be null.");let r=0==t?null:i.bones[s.readInt(!0)],o=new ae(t,n,r);o.rotation=s.readFloat(),o.x=s.readFloat()*e,o.y=s.readFloat()*e,o.scaleX=s.readFloat(),o.scaleY=s.readFloat(),o.shearX=s.readFloat(),o.shearY=s.readFloat(),o.length=s.readFloat()*e,o.transformMode=s.readInt(!0),o.skinRequired=s.readBoolean(),a&&h.rgba8888ToColor(o.color,s.readInt32()),i.bones.push(o)}o=s.readInt(!0);for(let t=0;t<o;t++){let e=s.readString();if(!e)throw new Error("Slot name must not be null.");let n=i.bones[s.readInt(!0)],r=new Ce(t,e,n);h.rgba8888ToColor(r.color,s.readInt32());let a=s.readInt32();-1!=a&&h.rgb888ToColor(r.darkColor=new h,a),r.attachmentName=s.readStringRef(),r.blendMode=s.readInt(!0),i.slots.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("IK constraint data name must not be null.");let r=new me(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.mix=s.readFloat(),r.softness=s.readFloat()*e,r.bendDirection=s.readByte(),r.compress=s.readBoolean(),r.stretch=s.readBoolean(),r.uniform=s.readBoolean(),i.ikConstraints.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("Transform constraint data name must not be null.");let r=new Fe(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.bones[s.readInt(!0)],r.local=s.readBoolean(),r.relative=s.readBoolean(),r.offsetRotation=s.readFloat(),r.offsetX=s.readFloat()*e,r.offsetY=s.readFloat()*e,r.offsetScaleX=s.readFloat(),r.offsetScaleY=s.readFloat(),r.offsetShearY=s.readFloat(),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),r.mixScaleX=s.readFloat(),r.mixScaleY=s.readFloat(),r.mixShearY=s.readFloat(),i.transformConstraints.push(r)}o=s.readInt(!0);for(let t,n=0;n<o;n++){let n=s.readString();if(!n)throw new Error("Path constraint data name must not be null.");let r=new ge(n);r.order=s.readInt(!0),r.skinRequired=s.readBoolean(),t=s.readInt(!0);for(let e=0;e<t;e++)r.bones.push(i.bones[s.readInt(!0)]);r.target=i.slots[s.readInt(!0)],r.positionMode=s.readInt(!0),r.spacingMode=s.readInt(!0),r.rotateMode=s.readInt(!0),r.offsetRotation=s.readFloat(),r.position=s.readFloat(),0==r.positionMode&&(r.position*=e),r.spacing=s.readFloat(),0!=r.spacingMode&&1!=r.spacingMode||(r.spacing*=e),r.mixRotate=s.readFloat(),r.mixX=s.readFloat(),r.mixY=s.readFloat(),i.pathConstraints.push(r)}let l=this.readSkin(s,i,!0,a);l&&(i.defaultSkin=l,i.skins.push(l));{let t=i.skins.length;for(m.setArraySize(i.skins,o=t+s.readInt(!0));t<o;t++){let e=this.readSkin(s,i,!1,a);if(!e)throw new Error("readSkin() should not have returned null.");i.skins[t]=e}}o=this.linkedMeshes.length;for(let t=0;t<o;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error("Not skin found for linked mesh.");if(!e.parent)throw new Error("Linked mesh parent must not be null");let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error("Parent mesh not found: "+e.parent);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readStringRef();if(!t)throw new Error;let e=new fe(t);e.intValue=s.readInt(!1),e.floatValue=s.readFloat(),e.stringValue=s.readString(),e.audioPath=s.readString(),e.audioPath&&(e.volume=s.readFloat(),e.balance=s.readFloat()),i.events.push(e)}o=s.readInt(!0);for(let t=0;t<o;t++){let t=s.readString();if(!t)throw new Error("Animatio name must not be null.");i.animations.push(this.readAnimation(s,t,i))}return i}readSkin(t,e,i,s){let n=null,r=0;if(i){if(r=t.readInt(!0),0==r)return null;n=new Ee("default")}else{let i=t.readStringRef();if(!i)throw new Error("Skin name must not be null.");n=new Ee(i),n.bones.length=t.readInt(!0);for(let i=0,s=n.bones.length;i<s;i++)n.bones[i]=e.bones[t.readInt(!0)];for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let i=0,s=t.readInt(!0);i<s;i++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);r=t.readInt(!0)}for(let i=0;i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("Attachment name must not be null");let a=this.readAttachment(t,e,n,i,r,s);a&&n.setAttachment(i,r,a)}}return n}readAttachment(t,e,i,s,n,r){let a=this.scale,o=t.readStringRef();switch(o||(o=n),t.readByte()){case De.Region:{let e=t.readStringRef(),s=t.readFloat(),n=t.readFloat(),r=t.readFloat(),l=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),f=t.readInt32(),p=this.readSequence(t);e||(e=o);let m=this.attachmentLoader.newRegionAttachment(i,o,e,p);return m?(m.path=e,m.x=n*a,m.y=r*a,m.scaleX=l,m.scaleY=c,m.rotation=s,m.width=u*a,m.height=d*a,h.rgba8888ToColor(m.color,f),m.sequence=p,null==p&&m.updateRegion(),m):null}case De.BoundingBox:{let e=t.readInt(!0),s=this.readVertices(t,e),n=r?t.readInt32():0,a=this.attachmentLoader.newBoundingBoxAttachment(i,o);return a?(a.worldVerticesLength=e<<1,a.vertices=s.vertices,a.bones=s.bones,r&&h.rgba8888ToColor(a.color,n),a):null}case De.Mesh:{let e=t.readStringRef(),s=t.readInt32(),n=t.readInt(!0),l=this.readFloatArray(t,n<<1,1),c=this.readShortArray(t),u=this.readVertices(t,n),d=t.readInt(!0),f=this.readSequence(t),p=[],m=0,g=0;r&&(p=this.readShortArray(t),m=t.readFloat(),g=t.readFloat()),e||(e=o);let x=this.attachmentLoader.newMeshAttachment(i,o,e,f);return x?(x.path=e,h.rgba8888ToColor(x.color,s),x.bones=u.bones,x.vertices=u.vertices,x.worldVerticesLength=n<<1,x.triangles=c,x.regionUVs=l,null==f&&x.updateRegion(),x.hullLength=d<<1,x.sequence=f,r&&(x.edges=p,x.width=m*a,x.height=g*a),x):null}case De.LinkedMesh:{let e=t.readStringRef(),n=t.readInt32(),l=t.readStringRef(),c=t.readStringRef(),u=t.readBoolean(),d=this.readSequence(t),f=0,p=0;r&&(f=t.readFloat(),p=t.readFloat()),e||(e=o);let m=this.attachmentLoader.newMeshAttachment(i,o,e,d);return m?(m.path=e,h.rgba8888ToColor(m.color,n),m.sequence=d,r&&(m.width=f*a,m.height=p*a),this.linkedMeshes.push(new Pe(m,l,s,c,u)),m):null}case De.Path:{let e=t.readBoolean(),s=t.readBoolean(),n=t.readInt(!0),l=this.readVertices(t,n),c=m.newArray(n/3,0);for(let e=0,i=c.length;e<i;e++)c[e]=t.readFloat()*a;let u=r?t.readInt32():0,d=this.attachmentLoader.newPathAttachment(i,o);return d?(d.closed=e,d.constantSpeed=s,d.worldVerticesLength=n<<1,d.vertices=l.vertices,d.bones=l.bones,d.lengths=c,r&&h.rgba8888ToColor(d.color,u),d):null}case De.Point:{let e=t.readFloat(),s=t.readFloat(),n=t.readFloat(),l=r?t.readInt32():0,c=this.attachmentLoader.newPointAttachment(i,o);return c?(c.x=s*a,c.y=n*a,c.rotation=e,r&&h.rgba8888ToColor(c.color,l),c):null}case De.Clipping:{let s=t.readInt(!0),n=t.readInt(!0),a=this.readVertices(t,n),l=r?t.readInt32():0,c=this.attachmentLoader.newClippingAttachment(i,o);return c?(c.endSlot=e.slots[s],c.worldVerticesLength=n<<1,c.vertices=a.vertices,c.bones=a.bones,r&&h.rgba8888ToColor(c.color,l),c):null}}return null}readSequence(t){if(!t.readBoolean())return null;let e=new I(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){let i=this.scale,s=e<<1,n=new Le;if(!t.readBoolean())return n.vertices=this.readFloatArray(t,s,i),n;let r=new Array,a=new Array;for(let s=0;s<e;s++){let e=t.readInt(!0);a.push(e);for(let s=0;s<e;s++)a.push(t.readInt(!0)),r.push(t.readFloat()*i),r.push(t.readFloat()*i),r.push(t.readFloat())}return n.vertices=m.toFloatArray(r),n.bones=a,n}readFloatArray(t,e,i){let s=new Array(e);if(1==i)for(let i=0;i<e;i++)s[i]=t.readFloat();else for(let n=0;n<e;n++)s[n]=t.readFloat()*i;return s}readShortArray(t){let e=t.readInt(!0),i=new Array(e);for(let s=0;s<e;s++)i[s]=t.readShort();return i}readAnimation(t,e,i){t.readInt(!0);let s=new Array,n=this.scale;new h,new h;for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,n=t.readInt(!0);i<n;i++){let i=t.readByte(),n=t.readInt(!0),r=n-1;switch(i){case Je:{let i=new gt(n,e);for(let e=0;e<n;e++)i.setFrame(e,t.readFloat(),t.readStringRef());s.push(i);break}case Qe:{let i=t.readInt(!0),a=new ut(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,d,1),Ve(t,a,i++,e,3,o,s,u,f,1)}o=s,h=n,l=r,c=d,u=f}s.push(a);break}case $e:{let i=t.readInt(!0),a=new dt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,u,1)}o=s,h=n,l=r,c=u}s.push(a);break}case ti:{let i=t.readInt(!0),a=new pt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u,d,f,p),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,y=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,m,1),Ve(t,a,i++,e,3,o,s,u,g,1),Ve(t,a,i++,e,4,o,s,d,x,1),Ve(t,a,i++,e,5,o,s,f,w,1),Ve(t,a,i++,e,6,o,s,p,y,1)}o=s,h=n,l=r,c=m,u=g,d=x,f=w,p=y}s.push(a);break}case ei:{let i=t.readInt(!0),a=new mt(n,i,e),o=t.readFloat(),h=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;for(let e=0,i=0;a.setFrame(e,o,h,l,c,u,d,f),e!=r;e++){let s=t.readFloat(),n=t.readUnsignedByte()/255,r=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,n,1),Ve(t,a,i++,e,1,o,s,l,r,1),Ve(t,a,i++,e,2,o,s,c,p,1),Ve(t,a,i++,e,3,o,s,u,m,1),Ve(t,a,i++,e,4,o,s,d,g,1),Ve(t,a,i++,e,5,o,s,f,x,1)}o=s,h=n,l=r,c=p,u=m,d=g,f=x}s.push(a);break}case ii:{let i=new ft(n,t.readInt(!0),e),a=t.readFloat(),o=t.readUnsignedByte()/255;for(let e=0,s=0;i.setFrame(e,a,o),e!=r;e++){let n=t.readFloat(),r=t.readUnsignedByte()/255;switch(t.readByte()){case hi:i.setStepped(e);break;case li:Ve(t,i,s++,e,0,a,n,o,r,1)}a=n,o=r}s.push(i)}}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0);for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readByte(),r=t.readInt(!0),a=t.readInt(!0);switch(i){case Ne:s.push(Oe(t,new et(r,a,e),1));break;case _e:s.push(Be(t,new it(r,a,e),n));break;case Ue:s.push(Oe(t,new st(r,a,e),n));break;case We:s.push(Oe(t,new nt(r,a,e),n));break;case qe:s.push(Be(t,new rt(r,a,e),1));break;case Ge:s.push(Oe(t,new at(r,a,e),1));break;case je:s.push(Oe(t,new ot(r,a,e),1));break;case He:s.push(Be(t,new ht(r,a,e),1));break;case Ze:s.push(Oe(t,new lt(r,a,e),1));break;case Ke:s.push(Oe(t,new ct(r,a,e),1))}}}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),r=i-1,a=new At(i,t.readInt(!0),e),o=t.readFloat(),h=t.readFloat(),l=t.readFloat()*n;for(let e=0,i=0;a.setFrame(e,o,h,l,t.readByte(),t.readBoolean(),t.readBoolean()),e!=r;e++){let s=t.readFloat(),r=t.readFloat(),c=t.readFloat()*n;switch(t.readByte()){case hi:a.setStepped(e);break;case li:Ve(t,a,i++,e,0,o,s,h,r,1),Ve(t,a,i++,e,1,o,s,l,c,n)}o=s,h=r,l=c}s.push(a)}for(let e=0,i=t.readInt(!0);e<i;e++){let e=t.readInt(!0),i=t.readInt(!0),n=i-1,r=new Mt(i,t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat();for(let e=0,i=0;r.setFrame(e,a,o,h,l,c,u,d),e!=n;e++){let s=t.readFloat(),n=t.readFloat(),f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),g=t.readFloat(),x=t.readFloat();switch(t.readByte()){case hi:r.setStepped(e);break;case li:Ve(t,r,i++,e,0,a,s,o,n,1),Ve(t,r,i++,e,1,a,s,h,f,1),Ve(t,r,i++,e,2,a,s,l,p,1),Ve(t,r,i++,e,3,a,s,c,m,1),Ve(t,r,i++,e,4,a,s,u,g,1),Ve(t,r,i++,e,5,a,s,d,x,1)}a=s,o=n,h=f,l=p,c=m,u=g,d=x}s.push(r)}for(let e=0,r=t.readInt(!0);e<r;e++){let e=t.readInt(!0),r=i.pathConstraints[e];for(let i=0,a=t.readInt(!0);i<a;i++)switch(t.readByte()){case ri:s.push(Oe(t,new St(t.readInt(!0),t.readInt(!0),e),0==r.positionMode?n:1));break;case ai:s.push(Oe(t,new It(t.readInt(!0),t.readInt(!0),e),0==r.spacingMode||1==r.spacingMode?n:1));break;case oi:let i=new kt(t.readInt(!0),t.readInt(!0),e),a=t.readFloat(),o=t.readFloat(),h=t.readFloat(),l=t.readFloat();for(let e=0,s=0,n=i.getFrameCount()-1;i.setFrame(e,a,o,h,l),e!=n;e++){let n=t.readFloat(),r=t.readFloat(),c=t.readFloat(),u=t.readFloat();switch(t.readByte()){case hi:i.setStepped(e);break;case li:Ve(t,i,s++,e,0,a,n,o,r,1),Ve(t,i,s++,e,1,a,n,h,c,1),Ve(t,i,s++,e,2,a,n,l,u,1)}a=n,o=r,h=c,l=u}s.push(i)}}for(let e=0,r=t.readInt(!0);e<r;e++){let e=i.skins[t.readInt(!0)];for(let i=0,r=t.readInt(!0);i<r;i++){let i=t.readInt(!0);for(let r=0,a=t.readInt(!0);r<a;r++){let r=t.readStringRef();if(!r)throw new Error("attachmentName must not be null.");let a=e.getAttachment(i,r),o=t.readByte(),h=t.readInt(!0),l=h-1;switch(o){case si:{let e=a,r=e.bones,o=e.vertices,c=r?o.length/3*2:o.length,u=t.readInt(!0),d=new xt(h,u,i,e),f=t.readFloat();for(let e=0,i=0;;e++){let s,a=t.readInt(!0);if(0==a)s=r?m.newFloatArray(c):o;else{s=m.newFloatArray(c);let e=t.readInt(!0);if(a+=e,1==n)for(let i=e;i<a;i++)s[i]=t.readFloat();else for(let i=e;i<a;i++)s[i]=t.readFloat()*n;if(!r)for(let t=0,e=s.length;t<e;t++)s[t]+=o[t]}if(d.setFrame(e,f,s),e==l)break;let h=t.readFloat();switch(t.readByte()){case hi:d.setStepped(e);break;case li:Ve(t,d,i++,e,0,f,h,0,1,1)}f=h}s.push(d);break}case ni:{let e=new Et(h,i,a);for(let i=0;i<h;i++){let s=t.readFloat(),n=t.readInt32();e.setFrame(i,s,T[15&n],n>>4,t.readFloat())}s.push(e);break}}}}}let r=t.readInt(!0);if(r>0){let e=new bt(r),n=i.slots.length;for(let i=0;i<r;i++){let s=t.readFloat(),r=t.readInt(!0),a=m.newArray(n,0);for(let t=n-1;t>=0;t--)a[t]=-1;let o=m.newArray(n-r,0),h=0,l=0;for(let e=0;e<r;e++){let e=t.readInt(!0);for(;h!=e;)o[l++]=h++;a[h+t.readInt(!0)]=h++}for(;h<n;)o[l++]=h++;for(let t=n-1;t>=0;t--)-1==a[t]&&(a[t]=o[--l]);e.setFrame(i,s,a)}s.push(e)}let a=t.readInt(!0);if(a>0){let e=new yt(a);for(let s=0;s<a;s++){let n=t.readFloat(),r=i.events[t.readInt(!0)],a=new de(n,r);a.intValue=t.readInt(!1),a.floatValue=t.readFloat(),a.stringValue=t.readBoolean()?t.readString():r.stringValue,a.data.audioPath&&(a.volume=t.readFloat(),a.balance=t.readFloat()),e.setFrame(s,a)}s.push(e)}let o=0;for(let t=0,e=s.length;t<e;t++)o=Math.max(o,s[t].getDuration());return new E(e,s,o)}},Xe=class{constructor(t,e=new Array,i=0,s=new DataView(t.buffer)){this.strings=e,this.index=i,this.buffer=s}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),i=127&e;return 0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<7,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<14,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<21,0!=(128&e)&&(e=this.readByte(),i|=(127&e)<<28)))),t?i:i>>>1^-(1&i)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let i=0;i<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(t),i++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}},Pe=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}},Le=class{constructor(t=null,e=null){this.bones=t,this.vertices=e}},De=(t=>(t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping",t))(De||{});function Oe(t,e,i){let s=t.readFloat(),n=t.readFloat()*i;for(let r=0,a=0,o=e.getFrameCount()-1;e.setFrame(r,s,n),r!=o;r++){let o=t.readFloat(),h=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(r);break;case li:Ve(t,e,a++,r,0,s,o,n,h,i)}s=o,n=h}return e}function Be(t,e,i){let s=t.readFloat(),n=t.readFloat()*i,r=t.readFloat()*i;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,s,n,r),a!=h;a++){let h=t.readFloat(),l=t.readFloat()*i,c=t.readFloat()*i;switch(t.readByte()){case hi:e.setStepped(a);break;case li:Ve(t,e,o++,a,0,s,h,n,l,i),Ve(t,e,o++,a,1,s,h,r,c,i)}s=h,n=l,r=c}return e}function Ve(t,e,i,s,n,r,a,o,h,l){e.setBezier(i,s,n,r,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,a,h)}var ze,Ne=0,_e=1,Ue=2,We=3,qe=4,Ge=5,je=6,He=7,Ze=8,Ke=9,Je=0,Qe=1,$e=2,ti=3,ei=4,ii=5,si=0,ni=1,ri=0,ai=1,oi=2,hi=1,li=2,ci=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new x(()=>m.newFloatArray(16))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,s=this.polygons,n=this.polygonPool,r=t.slots,a=r.length;i.length=0,n.freeAll(s),s.length=0;for(let t=0;t<a;t++){let e=r[t];if(!e.bone.active)continue;let a=e.getAttachment();if(a instanceof Ut){let t=a;i.push(t);let r=n.obtain();r.length!=t.worldVerticesLength&&(r=m.newFloatArray(t.worldVerticesLength)),s.push(r),t.computeWorldVertices(e,0,t.worldVerticesLength,r,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,n=this.polygons;for(let r=0,a=n.length;r<a;r++){let a=n[r],o=a;for(let n=0,r=a.length;n<r;n+=2){let r=o[n],a=o[n+1];t=Math.min(t,r),e=Math.min(e,a),i=Math.max(i,r),s=Math.max(s,a)}}this.minX=t,this.minY=e,this.maxX=i,this.maxY=s}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,i,s){let n=this.minX,r=this.minY,a=this.maxX,o=this.maxY;if(t<=n&&i<=n||e<=r&&s<=r||t>=a&&i>=a||e>=o&&s>=o)return!1;let h=(s-e)/(i-t),l=h*(n-t)+e;if(l>r&&l<o)return!0;if(l=h*(a-t)+e,l>r&&l<o)return!0;let c=(r-e)/h+t;return c>n&&c<a||(c=(o-e)/h+t,c>n&&c<a)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let i=this.polygons;for(let s=0,n=i.length;s<n;s++)if(this.containsPointPolygon(i[s],t,e))return this.boundingBoxes[s];return null}containsPointPolygon(t,e,i){let s=t,n=t.length,r=n-2,a=!1;for(let t=0;t<n;t+=2){let n=s[t+1],o=s[r+1];if(n<i&&o>=i||o<i&&n>=i){let h=s[t];h+(i-n)/(o-n)*(s[r]-h)<e&&(a=!a)}r=t}return a}intersectsSegment(t,e,i,s){let n=this.polygons;for(let r=0,a=n.length;r<a;r++)if(this.intersectsSegmentPolygon(n[r],t,e,i,s))return this.boundingBoxes[r];return null}intersectsSegmentPolygon(t,e,i,s,n){let r=t,a=t.length,o=e-s,h=i-n,l=e*n-i*s,c=r[a-2],u=r[a-1];for(let t=0;t<a;t+=2){let a=r[t],d=r[t+1],f=c*d-u*a,p=c-a,m=u-d,g=o*m-h*p,x=(l*p-o*f)/g;if((x>=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=s||x>=s&&x<=e)){let t=(l*m-h*f)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=i&&t<=n||t>=n&&t<=i))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ui=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new x(()=>new Array),this.polygonIndicesPool=new x(()=>new Array)}triangulate(t){let e=t,i=t.length>>1,s=this.indicesArray;s.length=0;for(let t=0;t<i;t++)s[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,r=i;t<r;++t)n[t]=ui.isConcave(t,i,e,s);let r=this.triangles;for(r.length=0;i>3;){let t=i-1,a=0,o=1;for(;;){t:if(!n[a]){let r=s[t]<<1,h=s[a]<<1,l=s[o]<<1,c=e[r],u=e[r+1],d=e[h],f=e[h+1],p=e[l],m=e[l+1];for(let r=(o+1)%i;r!=t;r=(r+1)%i){if(!n[r])continue;let t=s[r]<<1,i=e[t],a=e[t+1];if(ui.positiveArea(p,m,c,u,i,a)&&ui.positiveArea(c,u,d,f,i,a)&&ui.positiveArea(d,f,p,m,i,a))break t}break}if(0==o){do{if(!n[a])break;a--}while(a>0);break}t=a,a=o,o=(o+1)%i}r.push(s[(i+a-1)%i]),r.push(s[a]),r.push(s[(a+1)%i]),s.splice(a,1),n.splice(a,1),i--;let h=(i+a-1)%i,l=a==i?0:a;n[h]=ui.isConcave(h,i,e,s),n[l]=ui.isConcave(l,i,e,s)}return 3==i&&(r.push(s[2]),r.push(s[0]),r.push(s[1])),r}decompose(t,e){let i=t,s=this.convexPolygons;this.polygonPool.freeAll(s),s.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let a=this.polygonPool.obtain();a.length=0;let o=-1,h=0;for(let t=0,l=e.length;t<l;t+=3){let l=e[t]<<1,c=e[t+1]<<1,u=e[t+2]<<1,d=i[l],f=i[l+1],p=i[c],m=i[c+1],g=i[u],x=i[u+1],w=!1;if(o==l){let t=a.length-4,e=ui.winding(a[t],a[t+1],a[t+2],a[t+3],g,x),i=ui.winding(g,x,a[0],a[1],a[2],a[3]);e==h&&i==h&&(a.push(g),a.push(x),r.push(u),w=!0)}w||(a.length>0?(s.push(a),n.push(r)):(this.polygonPool.free(a),this.polygonIndicesPool.free(r)),a=this.polygonPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(p),a.push(m),a.push(g),a.push(x),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(l),r.push(c),r.push(u),h=ui.winding(d,f,p,m,g,x),o=l)}a.length>0&&(s.push(a),n.push(r));for(let t=0,e=s.length;t<e;t++){if(r=n[t],0==r.length)continue;let i=r[0],o=r[r.length-1];a=s[t];let h=a.length-4,l=a[h],c=a[h+1],u=a[h+2],d=a[h+3],f=a[0],p=a[1],m=a[2],g=a[3],x=ui.winding(l,c,u,d,f,p);for(let h=0;h<e;h++){if(h==t)continue;let e=n[h];if(3!=e.length)continue;let w=e[0],y=e[1],v=e[2],b=s[h],A=b[b.length-2],M=b[b.length-1];if(w!=i||y!=o)continue;let S=ui.winding(l,c,u,d,A,M),I=ui.winding(A,M,f,p,m,g);S==x&&I==x&&(b.length=0,e.length=0,a.push(A),a.push(M),r.push(v),l=u,c=d,u=A,d=M,h=0)}}for(let t=s.length-1;t>=0;t--)a=s[t],0==a.length&&(s.splice(t,1),this.polygonPool.free(a),r=n[t],n.splice(t,1),this.polygonIndicesPool.free(r));return s}static isConcave(t,e,i,s){let n=s[(e+t-1)%e]<<1,r=s[t]<<1,a=s[(t+1)%e]<<1;return!this.positiveArea(i[n],i[n+1],i[r],i[r+1],i[a],i[a+1])}static positiveArea(t,e,i,s,n,r){return t*(r-s)+i*(e-r)+n*(s-e)>=0}static winding(t,e,i,s,n,r){let a=i-t,o=s-e;return n*o-r*a+a*e-t*o>=0?1:-1}},di=class{constructor(){this.triangulator=new ui,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let i=e.worldVerticesLength,s=m.setArraySize(this.clippingPolygon,i);e.computeWorldVertices(t,0,i,s,0,2);let n=this.clippingPolygon;di.makeClockwise(n);let r=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let t=0,e=r.length;t<e;t++){let e=r[t];di.makeClockwise(e),e.push(e[0]),e.push(e[1])}return r.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,i,s,n,r,a,o){let h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,f=o?12:8,p=0;l.length=0,c.length=0;t:for(let e=0;e<s;e+=3){let s=i[e]<<1,g=t[s],x=t[s+1],w=n[s],y=n[s+1];s=i[e+1]<<1;let v=t[s],b=t[s+1],A=n[s],M=n[s+1];s=i[e+2]<<1;let S=t[s],I=t[s+1],k=n[s],T=n[s+1];for(let t=0;t<d;t++){let e=l.length;if(!this.clip(g,x,v,b,S,I,u[t],h)){let t=m.setArraySize(l,e+3*f);t[e]=g,t[e+1]=x,t[e+2]=r.r,t[e+3]=r.g,t[e+4]=r.b,t[e+5]=r.a,o?(t[e+6]=w,t[e+7]=y,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=v,t[e+13]=b,t[e+14]=r.r,t[e+15]=r.g,t[e+16]=r.b,t[e+17]=r.a,t[e+18]=A,t[e+19]=M,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=S,t[e+25]=I,t[e+26]=r.r,t[e+27]=r.g,t[e+28]=r.b,t[e+29]=r.a,t[e+30]=k,t[e+31]=T,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=w,t[e+7]=y,t[e+8]=v,t[e+9]=b,t[e+10]=r.r,t[e+11]=r.g,t[e+12]=r.b,t[e+13]=r.a,t[e+14]=A,t[e+15]=M,t[e+16]=S,t[e+17]=I,t[e+18]=r.r,t[e+19]=r.g,t[e+20]=r.b,t[e+21]=r.a,t[e+22]=k,t[e+23]=T),e=c.length;let i=m.setArraySize(c,e+3);i[e]=p,i[e+1]=p+1,i[e+2]=p+2,p+=3;continue t}{let t=h.length;if(0==t)continue;let i=b-I,s=S-v,n=g-S,u=I-x,d=1/(i*n+s*(x-I)),E=t>>1,C=this.clipOutput,R=m.setArraySize(l,e+E*f);for(let h=0;h<t;h+=2){let t=C[h],l=C[h+1];R[e]=t,R[e+1]=l,R[e+2]=r.r,R[e+3]=r.g,R[e+4]=r.b,R[e+5]=r.a;let c=t-S,p=l-I,m=(i*c+s*p)*d,g=(u*c+n*p)*d,x=1-m-g;R[e+6]=w*m+A*g+k*x,R[e+7]=y*m+M*g+T*x,o&&(R[e+8]=a.r,R[e+9]=a.g,R[e+10]=a.b,R[e+11]=a.a),e+=f}e=c.length;let F=m.setArraySize(c,e+3*(E-2));E--;for(let t=1;t<E;t++)F[e]=p,F[e+1]=p+t,F[e+2]=p+t+1,e+=3;p+=E+1}}}}clip(t,e,i,s,n,r,a,o){let h,l=o,c=!1;a.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(i),h.push(s),h.push(n),h.push(r),h.push(t),h.push(e),o.length=0;let u=a,d=a.length-4;for(let t=0;;t+=2){let e=u[t],i=u[t+1],s=u[t+2],n=u[t+3],r=e-s,a=i-n,f=h,p=h.length-2,m=o.length;for(let t=0;t<p;t+=2){let h=f[t],l=f[t+1],u=f[t+2],d=f[t+3],p=r*(d-n)-a*(u-s)>0;if(r*(l-n)-a*(h-s)>0){if(p){o.push(u),o.push(d);continue}let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i)}else if(p){let t=d-l,r=u-h,a=t*(s-e)-r*(n-i);if(Math.abs(a)>1e-6){let c=(r*(i-l)-t*(e-h))/a;o.push(e+(s-e)*c),o.push(i+(n-i)*c)}else o.push(e),o.push(i);o.push(u),o.push(d)}c=!0}if(m==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let g=o;(o=h).length=0,h=g}if(l!=o){l.length=0;for(let t=0,e=o.length-2;t<e;t++)l[t]=o[t]}else l.length=l.length-2;return c}static makeClockwise(t){let e=t,i=t.length,s=e[i-2]*e[1]-e[0]*e[i-1],n=0,r=0,a=0,o=0;for(let t=0,h=i-3;t<h;t+=2)n=e[t],r=e[t+1],a=e[t+2],o=e[t+3],s+=n*o-a*r;if(!(s<0))for(let t=0,s=i-2,n=i>>1;t<n;t+=2){let i=e[t],n=e[t+1],r=s-t;e[t]=e[r],e[t+1]=e[r+1],e[r]=i,e[r+1]=n}}},fi=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,i=new ke,s="string"==typeof t?JSON.parse(t):t,n=s.skeleton;if(n&&(i.hash=n.hash,i.version=n.spine,i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height,i.fps=n.fps,i.imagesPath=n.images),s.bones)for(let t=0;t<s.bones.length;t++){let n=s.bones[t],r=null,a=wi(n,"parent",null);a&&(r=i.findBone(a));let o=new ae(i.bones.length,n.name,r);o.length=wi(n,"length",0)*e,o.x=wi(n,"x",0)*e,o.y=wi(n,"y",0)*e,o.rotation=wi(n,"rotation",0),o.scaleX=wi(n,"scaleX",1),o.scaleY=wi(n,"scaleY",1),o.shearX=wi(n,"shearX",0),o.shearY=wi(n,"shearY",0),o.transformMode=m.enumValue(oe,wi(n,"transform","Normal")),o.skinRequired=wi(n,"skin",!1);let h=wi(n,"color",null);h&&o.color.setFromString(h),i.bones.push(o)}if(s.slots)for(let t=0;t<s.slots.length;t++){let e=s.slots[t],n=i.findBone(e.bone);if(!n)throw new Error(`Couldn't find bone ${e.bone} for slot ${e.name}`);let r=new Ce(i.slots.length,e.name,n),a=wi(e,"color",null);a&&r.color.setFromString(a);let o=wi(e,"dark",null);o&&(r.darkColor=h.fromString(o)),r.attachmentName=wi(e,"attachment",null),r.blendMode=m.enumValue(Re,wi(e,"blend","normal")),i.slots.push(r)}if(s.ik)for(let t=0;t<s.ik.length;t++){let n=s.ik[t],r=new me(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=i.findBone(n.bones[t]);if(!e)throw new Error(`Couldn't find bone ${n.bones[t]} for IK constraint ${n.name}.`);r.bones.push(e)}let a=i.findBone(n.target);if(!a)throw new Error(`Couldn't find target bone ${n.target} for IK constraint ${n.name}.`);r.target=a,r.mix=wi(n,"mix",1),r.softness=wi(n,"softness",0)*e,r.bendDirection=wi(n,"bendPositive",!0)?1:-1,r.compress=wi(n,"compress",!1),r.stretch=wi(n,"stretch",!1),r.uniform=wi(n,"uniform",!1),i.ikConstraints.push(r)}if(s.transform)for(let t=0;t<s.transform.length;t++){let n=s.transform[t],r=new Fe(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for transform constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findBone(a);if(!o)throw new Error(`Couldn't find target bone ${a} for transform constraint ${n.name}.`);r.target=o,r.local=wi(n,"local",!1),r.relative=wi(n,"relative",!1),r.offsetRotation=wi(n,"rotation",0),r.offsetX=wi(n,"x",0)*e,r.offsetY=wi(n,"y",0)*e,r.offsetScaleX=wi(n,"scaleX",0),r.offsetScaleY=wi(n,"scaleY",0),r.offsetShearY=wi(n,"shearY",0),r.mixRotate=wi(n,"mixRotate",1),r.mixX=wi(n,"mixX",1),r.mixY=wi(n,"mixY",r.mixX),r.mixScaleX=wi(n,"mixScaleX",1),r.mixScaleY=wi(n,"mixScaleY",r.mixScaleX),r.mixShearY=wi(n,"mixShearY",1),i.transformConstraints.push(r)}if(s.path)for(let t=0;t<s.path.length;t++){let n=s.path[t],r=new ge(n.name);r.order=wi(n,"order",0),r.skinRequired=wi(n,"skin",!1);for(let t=0;t<n.bones.length;t++){let e=n.bones[t],s=i.findBone(e);if(!s)throw new Error(`Couldn't find bone ${e} for path constraint ${n.name}.`);r.bones.push(s)}let a=n.target,o=i.findSlot(a);if(!o)throw new Error(`Couldn't find target slot ${a} for path constraint ${n.name}.`);r.target=o,r.positionMode=m.enumValue(xe,wi(n,"positionMode","Percent")),r.spacingMode=m.enumValue(we,wi(n,"spacingMode","Length")),r.rotateMode=m.enumValue(ye,wi(n,"rotateMode","Tangent")),r.offsetRotation=wi(n,"rotation",0),r.position=wi(n,"position",0),0==r.positionMode&&(r.position*=e),r.spacing=wi(n,"spacing",0),0!=r.spacingMode&&1!=r.spacingMode||(r.spacing*=e),r.mixRotate=wi(n,"mixRotate",1),r.mixX=wi(n,"mixX",1),r.mixY=wi(n,"mixY",r.mixX),i.pathConstraints.push(r)}if(s.skins)for(let t=0;t<s.skins.length;t++){let e=s.skins[t],n=new Ee(e.name);if(e.bones)for(let t=0;t<e.bones.length;t++){let s=e.bones[t],r=i.findBone(s);if(!r)throw new Error(`Couldn't find bone ${s} for skin ${e.name}.`);n.bones.push(r)}if(e.ik)for(let t=0;t<e.ik.length;t++){let s=e.ik[t],r=i.findIkConstraint(s);if(!r)throw new Error(`Couldn't find IK constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.transform)for(let t=0;t<e.transform.length;t++){let s=e.transform[t],r=i.findTransformConstraint(s);if(!r)throw new Error(`Couldn't find transform constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}if(e.path)for(let t=0;t<e.path.length;t++){let s=e.path[t],r=i.findPathConstraint(s);if(!r)throw new Error(`Couldn't find path constraint ${s} for skin ${e.name}.`);n.constraints.push(r)}for(let t in e.attachments){let s=i.findSlot(t);if(!s)throw new Error(`Couldn't find slot ${t} for skin ${e.name}.`);let r=e.attachments[t];for(let t in r){let e=this.readAttachment(r[t],n,s.index,t,i);e&&n.setAttachment(s.index,t,e)}}i.skins.push(n),"default"==n.name&&(i.defaultSkin=n)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=e.skin?i.findSkin(e.skin):i.defaultSkin;if(!s)throw new Error("Skin not found: "+e.skin);let n=s.getAttachment(e.slotIndex,e.parent);if(!n)throw new Error("Parent mesh not found: "+e.parent);e.mesh.timelineAttachment=e.inheritTimeline?n:e.mesh,e.mesh.setParentMesh(n),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(let t in s.events){let e=s.events[t],n=new fe(t);n.intValue=wi(e,"int",0),n.floatValue=wi(e,"float",0),n.stringValue=wi(e,"string",""),n.audioPath=wi(e,"audio",null),n.audioPath&&(n.volume=wi(e,"volume",1),n.balance=wi(e,"balance",0)),i.events.push(n)}if(s.animations)for(let t in s.animations){let e=s.animations[t];this.readAnimation(e,t,i)}return i}readAttachment(t,e,i,s,n){let r=this.scale;switch(s=wi(t,"name",s),wi(t,"type","region")){case"region":{let i=wi(t,"path",s),n=this.readSequence(wi(t,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(e,s,i,n);if(!a)return null;a.path=i,a.x=wi(t,"x",0)*r,a.y=wi(t,"y",0)*r,a.scaleX=wi(t,"scaleX",1),a.scaleY=wi(t,"scaleY",1),a.rotation=wi(t,"rotation",0),a.width=t.width*r,a.height=t.height*r,a.sequence=n;let o=wi(t,"color",null);return o&&a.color.setFromString(o),null!=a.region&&a.updateRegion(),a}case"boundingbox":{let i=this.attachmentLoader.newBoundingBoxAttachment(e,s);if(!i)return null;this.readVertices(t,i,t.vertexCount<<1);let n=wi(t,"color",null);return n&&i.color.setFromString(n),i}case"mesh":case"linkedmesh":{let n=wi(t,"path",s),a=this.readSequence(wi(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(e,s,n,a);if(!o)return null;o.path=n;let h=wi(t,"color",null);h&&o.color.setFromString(h),o.width=wi(t,"width",0)*r,o.height=wi(t,"height",0)*r,o.sequence=a;let l=wi(t,"parent",null);if(l)return this.linkedMeshes.push(new pi(o,wi(t,"skin",null),i,l,wi(t,"timelines",!0))),o;let c=t.uvs;return this.readVertices(t,o,c.length),o.triangles=t.triangles,o.regionUVs=c,null!=o.region&&o.updateRegion(),o.edges=wi(t,"edges",null),o.hullLength=2*wi(t,"hull",0),o}case"path":{let i=this.attachmentLoader.newPathAttachment(e,s);if(!i)return null;i.closed=wi(t,"closed",!1),i.constantSpeed=wi(t,"constantSpeed",!0);let n=t.vertexCount;this.readVertices(t,i,n<<1);let a=m.newArray(n/3,0);for(let e=0;e<t.lengths.length;e++)a[e]=t.lengths[e]*r;i.lengths=a;let o=wi(t,"color",null);return o&&i.color.setFromString(o),i}case"point":{let i=this.attachmentLoader.newPointAttachment(e,s);if(!i)return null;i.x=wi(t,"x",0)*r,i.y=wi(t,"y",0)*r,i.rotation=wi(t,"rotation",0);let n=wi(t,"color",null);return n&&i.color.setFromString(n),i}case"clipping":{let i=this.attachmentLoader.newClippingAttachment(e,s);if(!i)return null;let r=wi(t,"end",null);r&&(i.endSlot=n.findSlot(r));let a=t.vertexCount;this.readVertices(t,i,a<<1);let o=wi(t,"color",null);return o&&i.color.setFromString(o),i}}return null}readSequence(t){if(null==t)return null;let e=new I(wi(t,"count",0));return e.start=wi(t,"start",1),e.digits=wi(t,"digits",0),e.setupIndex=wi(t,"setup",0),e}readVertices(t,e,i){let s=this.scale;e.worldVerticesLength=i;let n=t.vertices;if(i==n.length){let t=m.toFloatArray(n);if(1!=s)for(let e=0,i=n.length;e<i;e++)t[e]*=s;return void(e.vertices=t)}let r=new Array,a=new Array;for(let t=0,e=n.length;t<e;){let e=n[t++];a.push(e);for(let i=t+4*e;t<i;t+=4)a.push(n[t]),r.push(n[t+1]*s),r.push(n[t+2]*s),r.push(n[t+3])}e.bones=a,e.vertices=m.toFloatArray(r)}readAnimation(t,e,i){let s=this.scale,n=new Array;if(t.slots)for(let e in t.slots){let s=t.slots[e],r=i.findSlot(e);if(!r)throw new Error("Slot not found: "+e);let a=r.index;for(let t in s){let e=s[t];if(!e)continue;let i=e.length;if("attachment"==t){let t=new gt(i,a);for(let s=0;s<i;s++){let i=e[s];t.setFrame(s,wi(i,"time",0),wi(i,"name",null))}n.push(t)}else if("rgba"==t){let t=new ut(i,i<<2,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,o.a);let a=e[i+1];if(!a){t.shrink(n);break}let l=wi(a,"time",0),c=h.fromString(a.color),u=s.curve;u&&(n=xi(u,t,n,i,0,r,l,o.r,c.r,1),n=xi(u,t,n,i,1,r,l,o.g,c.g,1),n=xi(u,t,n,i,2,r,l,o.b,c.b,1),n=xi(u,t,n,i,3,r,l,o.a,c.a,1)),r=l,o=c,s=a}n.push(t)}else if("rgb"==t){let t=new dt(i,3*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.color);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b);let a=e[i+1];if(!a){t.shrink(n);break}let l=wi(a,"time",0),c=h.fromString(a.color),u=s.curve;u&&(n=xi(u,t,n,i,0,r,l,o.r,c.r,1),n=xi(u,t,n,i,1,r,l,o.g,c.g,1),n=xi(u,t,n,i,2,r,l,o.b,c.b,1)),r=l,o=c,s=a}n.push(t)}else if("alpha"==t)n.push(mi(e,new ft(i,i,a),0,1));else if("rgba2"==t){let t=new pt(i,7*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.light),l=h.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,o.a,l.r,l.g,l.b);let a=e[i+1];if(!a){t.shrink(n);break}let c=wi(a,"time",0),u=h.fromString(a.light),d=h.fromString(a.dark),f=s.curve;f&&(n=xi(f,t,n,i,0,r,c,o.r,u.r,1),n=xi(f,t,n,i,1,r,c,o.g,u.g,1),n=xi(f,t,n,i,2,r,c,o.b,u.b,1),n=xi(f,t,n,i,3,r,c,o.a,u.a,1),n=xi(f,t,n,i,4,r,c,l.r,d.r,1),n=xi(f,t,n,i,5,r,c,l.g,d.g,1),n=xi(f,t,n,i,6,r,c,l.b,d.b,1)),r=c,o=u,l=d,s=a}n.push(t)}else if("rgb2"==t){let t=new mt(i,6*i,a),s=e[0],r=wi(s,"time",0),o=h.fromString(s.light),l=h.fromString(s.dark);for(let i=0,n=0;;i++){t.setFrame(i,r,o.r,o.g,o.b,l.r,l.g,l.b);let a=e[i+1];if(!a){t.shrink(n);break}let c=wi(a,"time",0),u=h.fromString(a.light),d=h.fromString(a.dark),f=s.curve;f&&(n=xi(f,t,n,i,0,r,c,o.r,u.r,1),n=xi(f,t,n,i,1,r,c,o.g,u.g,1),n=xi(f,t,n,i,2,r,c,o.b,u.b,1),n=xi(f,t,n,i,3,r,c,l.r,d.r,1),n=xi(f,t,n,i,4,r,c,l.g,d.g,1),n=xi(f,t,n,i,5,r,c,l.b,d.b,1)),r=c,o=u,l=d,s=a}n.push(t)}}}if(t.bones)for(let e in t.bones){let r=t.bones[e],a=i.findBone(e);if(!a)throw new Error("Bone not found: "+e);let o=a.index;for(let t in r){let e=r[t],i=e.length;if(0!=i)if("rotate"===t)n.push(mi(e,new et(i,i,o),0,1));else if("translate"===t){let t=new it(i,i<<1,o);n.push(gi(e,t,"x","y",0,s))}else if("translatex"===t){let t=new st(i,i,o);n.push(mi(e,t,0,s))}else if("translatey"===t){let t=new nt(i,i,o);n.push(mi(e,t,0,s))}else if("scale"===t){let t=new rt(i,i<<1,o);n.push(gi(e,t,"x","y",1,1))}else if("scalex"===t){let t=new at(i,i,o);n.push(mi(e,t,1,1))}else if("scaley"===t){let t=new ot(i,i,o);n.push(mi(e,t,1,1))}else if("shear"===t){let t=new ht(i,i<<1,o);n.push(gi(e,t,"x","y",0,1))}else if("shearx"===t){let t=new lt(i,i,o);n.push(mi(e,t,0,1))}else if("sheary"===t){let t=new ct(i,i,o);n.push(mi(e,t,0,1))}}}if(t.ik)for(let e in t.ik){let r=t.ik[e],a=r[0];if(!a)continue;let o=i.findIkConstraint(e);if(!o)throw new Error("IK Constraint not found: "+e);let h=i.ikConstraints.indexOf(o),l=new At(r.length,r.length<<1,h),c=wi(a,"time",0),u=wi(a,"mix",1),d=wi(a,"softness",0)*s;for(let t=0,e=0;;t++){l.setFrame(t,c,u,d,wi(a,"bendPositive",!0)?1:-1,wi(a,"compress",!1),wi(a,"stretch",!1));let i=r[t+1];if(!i){l.shrink(e);break}let n=wi(i,"time",0),o=wi(i,"mix",1),h=wi(i,"softness",0)*s,f=a.curve;f&&(e=xi(f,l,e,t,0,c,n,u,o,1),e=xi(f,l,e,t,1,c,n,d,h,s)),c=n,u=o,d=h,a=i}n.push(l)}if(t.transform)for(let e in t.transform){let s=t.transform[e],r=s[0];if(!r)continue;let a=i.findTransformConstraint(e);if(!a)throw new Error("Transform constraint not found: "+e);let o=i.transformConstraints.indexOf(a),h=new Mt(s.length,6*s.length,o),l=wi(r,"time",0),c=wi(r,"mixRotate",1),u=wi(r,"mixX",1),d=wi(r,"mixY",u),f=wi(r,"mixScaleX",1),p=wi(r,"mixScaleY",f),m=wi(r,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,l,c,u,d,f,p,m);let i=s[t+1];if(!i){h.shrink(e);break}let n=wi(i,"time",0),a=wi(i,"mixRotate",1),o=wi(i,"mixX",1),g=wi(i,"mixY",o),x=wi(i,"mixScaleX",1),w=wi(i,"mixScaleY",x),y=wi(i,"mixShearY",1),v=r.curve;v&&(e=xi(v,h,e,t,0,l,n,c,a,1),e=xi(v,h,e,t,1,l,n,u,o,1),e=xi(v,h,e,t,2,l,n,d,g,1),e=xi(v,h,e,t,3,l,n,f,x,1),e=xi(v,h,e,t,4,l,n,p,w,1),e=xi(v,h,e,t,5,l,n,m,y,1)),l=n,c=a,u=o,d=g,f=x,p=w,f=x,r=i}n.push(h)}if(t.path)for(let e in t.path){let r=t.path[e],a=i.findPathConstraint(e);if(!a)throw new Error("Path constraint not found: "+e);let o=i.pathConstraints.indexOf(a);for(let t in r){let e=r[t],i=e[0];if(!i)continue;let h=e.length;if("position"===t){let t=new St(h,h,o);n.push(mi(e,t,0,0==a.positionMode?s:1))}else if("spacing"===t){let t=new It(h,h,o);n.push(mi(e,t,0,0==a.spacingMode||1==a.spacingMode?s:1))}else if("mix"===t){let t=new kt(h,3*h,o),s=wi(i,"time",0),r=wi(i,"mixRotate",1),a=wi(i,"mixX",1),l=wi(i,"mixY",a);for(let n=0,o=0;;n++){t.setFrame(n,s,r,a,l);let h=e[n+1];if(!h){t.shrink(o);break}let c=wi(h,"time",0),u=wi(h,"mixRotate",1),d=wi(h,"mixX",1),f=wi(h,"mixY",d),p=i.curve;p&&(o=xi(p,t,o,n,0,s,c,r,u,1),o=xi(p,t,o,n,1,s,c,a,d,1),o=xi(p,t,o,n,2,s,c,l,f,1)),s=c,r=u,a=d,l=f,i=h}n.push(t)}}}if(t.attachments)for(let e in t.attachments){let r=t.attachments[e],a=i.findSkin(e);if(!a)throw new Error("Skin not found: "+e);for(let t in r){let e=r[t],o=i.findSlot(t);if(!o)throw new Error("Slot not found: "+t);let h=o.index;for(let t in e){let i=e[t],r=a.getAttachment(h,t);for(let t in i){let e=i[t],a=e[0];if(a)if("deform"==t){let t=r.bones,i=r.vertices,o=t?i.length/3*2:i.length,l=new xt(e.length,e.length,h,r),c=wi(a,"time",0);for(let n=0,r=0;;n++){let h,u=wi(a,"vertices",null);if(u){h=m.newFloatArray(o);let e=wi(a,"offset",0);if(m.arrayCopy(u,0,h,e,u.length),1!=s)for(let t=e,i=t+u.length;t<i;t++)h[t]*=s;if(!t)for(let t=0;t<o;t++)h[t]+=i[t]}else h=t?m.newFloatArray(o):i;l.setFrame(n,c,h);let d=e[n+1];if(!d){l.shrink(r);break}let f=wi(d,"time",0),p=a.curve;p&&(r=xi(p,l,r,n,0,c,f,0,1,1)),c=f,a=d}n.push(l)}else if("sequence"==t){let t=new Et(e.length,h,r),i=0;for(let s=0;s<e.length;s++){let n=wi(a,"delay",i),r=wi(a,"time",0),o=k[wi(a,"mode","hold")],h=wi(a,"index",0);t.setFrame(s,r,o,h,n),i=n,a=e[s+1]}n.push(t)}}}}}if(t.drawOrder){let e=new bt(t.drawOrder.length),s=i.slots.length,r=0;for(let n=0;n<t.drawOrder.length;n++,r++){let a=t.drawOrder[n],o=null,h=wi(a,"offsets",null);if(h){o=m.newArray(s,-1);let t=m.newArray(s-h.length,0),e=0,n=0;for(let s=0;s<h.length;s++){let r=h[s],a=i.findSlot(r.slot);if(!a)throw new Error("Slot not found: "+a);let l=a.index;for(;e!=l;)t[n++]=e++;o[e+r.offset]=e++}for(;e<s;)t[n++]=e++;for(let e=s-1;e>=0;e--)-1==o[e]&&(o[e]=t[--n])}e.setFrame(r,wi(a,"time",0),o)}n.push(e)}if(t.events){let e=new yt(t.events.length),s=0;for(let n=0;n<t.events.length;n++,s++){let r=t.events[n],a=i.findEvent(r.name);if(!a)throw new Error("Event not found: "+r.name);let o=new de(m.toSinglePrecision(wi(r,"time",0)),a);o.intValue=wi(r,"int",a.intValue),o.floatValue=wi(r,"float",a.floatValue),o.stringValue=wi(r,"string",a.stringValue),o.data.audioPath&&(o.volume=wi(r,"volume",1),o.balance=wi(r,"balance",0)),e.setFrame(s,o)}n.push(e)}let r=0;for(let t=0,e=n.length;t<e;t++)r=Math.max(r,n[t].getDuration());i.animations.push(new E(e,n,r))}},pi=class{constructor(t,e,i,s,n){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=s,this.inheritTimeline=n}};function mi(t,e,i,s){let n=t[0],r=wi(n,"time",0),a=wi(n,"value",i)*s,o=0;for(let h=0;;h++){e.setFrame(h,r,a);let l=t[h+1];if(!l)return e.shrink(o),e;let c=wi(l,"time",0),u=wi(l,"value",i)*s;n.curve&&(o=xi(n.curve,e,o,h,0,r,c,a,u,s)),r=c,a=u,n=l}}function gi(t,e,i,s,n,r){let a=t[0],o=wi(a,"time",0),h=wi(a,i,n)*r,l=wi(a,s,n)*r,c=0;for(let u=0;;u++){e.setFrame(u,o,h,l);let d=t[u+1];if(!d)return e.shrink(c),e;let f=wi(d,"time",0),p=wi(d,i,n)*r,m=wi(d,s,n)*r,g=a.curve;g&&(c=xi(g,e,c,u,0,o,f,h,p,r),c=xi(g,e,c,u,1,o,f,l,m,r)),o=f,h=p,l=m,a=d}}function xi(t,e,i,s,n,r,a,o,h,l){if("stepped"==t)return e.setStepped(s),i;let c=n<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(i,s,n,r,o,u,d,f,p,a,h),i+1}function wi(t,e,i){return void 0!==t[e]?t[e]:i}void 0===Math.fround&&(Math.fround=(ze=new Float32Array(1),function(t){return ze[0]=t,ze[0]}));var yi=class{constructor(t,e={alpha:"true"}){if(this.restorables=new Array,t instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)this.gl=t,this.canvas=this.gl.canvas;else{let i=t;this.gl=i.getContext("webgl2",e)||i.getContext("webgl",e),this.canvas=i,i.addEventListener("webglcontextlost",t=>{t&&t.preventDefault()}),i.addEventListener("webglcontextrestored",t=>{for(let t=0,e=this.restorables.length;t<e;t++)this.restorables[t].restore()})}}addRestorable(t){this.restorables.push(t)}removeRestorable(t){let e=this.restorables.indexOf(t);e>-1&&this.restorables.splice(e,1)}},vi=class{static getDestGLBlendMode(t){switch(t){case 0:return 771;case 1:return 1;case 2:case 3:return 771;default:throw new Error("Unknown blend mode: "+t)}}static getSourceColorGLBlendMode(t,e=!1){switch(t){case 0:case 1:return e?1:770;case 2:return 774;case 3:return 1;default:throw new Error("Unknown blend mode: "+t)}}static getSourceAlphaGLBlendMode(t){switch(t){case 0:case 1:return 1;case 2:return 771;case 3:return 769;default:throw new Error("Unknown blend mode: "+t)}}},bi=class extends qt{constructor(t,e,i=!1){super(e),this.texture=null,this.boundUnit=0,this.useMipMaps=!1,this.context=t instanceof yi?t:new yi(t),this.useMipMaps=i,this.restore(),this.context.addRestorable(this)}setFilters(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,bi.validateMagFilter(e)),this.useMipMaps=bi.usesMipMaps(t),this.useMipMaps&&i.generateMipmap(i.TEXTURE_2D)}static validateMagFilter(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return 9729;default:return t}}static usesMipMaps(t){switch(t){case 9987:case 9987:case 9985:case 9986:case 9984:return!0;default:return!1}}setWraps(t,e){let i=this.context.gl;this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e)}update(t){let e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),bi.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this._image),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t&&e.generateMipmap(e.TEXTURE_2D)}restore(){this.texture=null,this.update(this.useMipMaps)}bind(t=0){let e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)}unbind(){let t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)}dispose(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)}},Ai=bi;Ai.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1;var Mi=class extends ce{constructor(t,e="",i=new ue){super(e=>new Ai(t,e),e,i)}},Si=class{constructor(t=0,e=0,i=0){this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=i}setFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}scale(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(){let t=this.length();return 0==t||(t=1/t,this.x*=t,this.y*=t,this.z*=t),this}cross(t){return this.set(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)}multiply(t){let e=t.values;return this.set(this.x*e[Ii]+this.y*e[ki]+this.z*e[Ti]+e[Ei],this.x*e[Ci]+this.y*e[Ri]+this.z*e[Fi]+e[Yi],this.x*e[Xi]+this.y*e[Pi]+this.z*e[Li]+e[Di])}project(t){let e=t.values,i=1/(this.x*e[Oi]+this.y*e[Bi]+this.z*e[Vi]+e[zi]);return this.set((this.x*e[Ii]+this.y*e[ki]+this.z*e[Ti]+e[Ei])*i,(this.x*e[Ci]+this.y*e[Ri]+this.z*e[Fi]+e[Yi])*i,(this.x*e[Xi]+this.y*e[Pi]+this.z*e[Li]+e[Di])*i)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}distance(t){let e=t.x-this.x,i=t.y-this.y,s=t.z-this.z;return Math.sqrt(e*e+i*i+s*s)}},Ii=0,ki=4,Ti=8,Ei=12,Ci=1,Ri=5,Fi=9,Yi=13,Xi=2,Pi=6,Li=10,Di=14,Oi=3,Bi=7,Vi=11,zi=15,Ni=class{constructor(){this.temp=new Float32Array(16),this.values=new Float32Array(16);let t=this.values;t[Ii]=1,t[Ri]=1,t[Li]=1,t[zi]=1}set(t){return this.values.set(t),this}transpose(){let t=this.temp,e=this.values;return t[Ii]=e[Ii],t[ki]=e[Ci],t[Ti]=e[Xi],t[Ei]=e[Oi],t[Ci]=e[ki],t[Ri]=e[Ri],t[Fi]=e[Pi],t[Yi]=e[Bi],t[Xi]=e[Ti],t[Pi]=e[Fi],t[Li]=e[Li],t[Di]=e[Vi],t[Oi]=e[Ei],t[Bi]=e[Yi],t[Vi]=e[Di],t[zi]=e[zi],this.set(t)}identity(){let t=this.values;return t[Ii]=1,t[ki]=0,t[Ti]=0,t[Ei]=0,t[Ci]=0,t[Ri]=1,t[Fi]=0,t[Yi]=0,t[Xi]=0,t[Pi]=0,t[Li]=1,t[Di]=0,t[Oi]=0,t[Bi]=0,t[Vi]=0,t[zi]=1,this}invert(){let t=this.values,e=this.temp,i=t[Oi]*t[Pi]*t[Fi]*t[Ei]-t[Xi]*t[Bi]*t[Fi]*t[Ei]-t[Oi]*t[Ri]*t[Li]*t[Ei]+t[Ci]*t[Bi]*t[Li]*t[Ei]+t[Xi]*t[Ri]*t[Vi]*t[Ei]-t[Ci]*t[Pi]*t[Vi]*t[Ei]-t[Oi]*t[Pi]*t[Ti]*t[Yi]+t[Xi]*t[Bi]*t[Ti]*t[Yi]+t[Oi]*t[ki]*t[Li]*t[Yi]-t[Ii]*t[Bi]*t[Li]*t[Yi]-t[Xi]*t[ki]*t[Vi]*t[Yi]+t[Ii]*t[Pi]*t[Vi]*t[Yi]+t[Oi]*t[Ri]*t[Ti]*t[Di]-t[Ci]*t[Bi]*t[Ti]*t[Di]-t[Oi]*t[ki]*t[Fi]*t[Di]+t[Ii]*t[Bi]*t[Fi]*t[Di]+t[Ci]*t[ki]*t[Vi]*t[Di]-t[Ii]*t[Ri]*t[Vi]*t[Di]-t[Xi]*t[Ri]*t[Ti]*t[zi]+t[Ci]*t[Pi]*t[Ti]*t[zi]+t[Xi]*t[ki]*t[Fi]*t[zi]-t[Ii]*t[Pi]*t[Fi]*t[zi]-t[Ci]*t[ki]*t[Li]*t[zi]+t[Ii]*t[Ri]*t[Li]*t[zi];if(0==i)throw new Error("non-invertible matrix");let s=1/i;return e[Ii]=t[Fi]*t[Di]*t[Bi]-t[Yi]*t[Li]*t[Bi]+t[Yi]*t[Pi]*t[Vi]-t[Ri]*t[Di]*t[Vi]-t[Fi]*t[Pi]*t[zi]+t[Ri]*t[Li]*t[zi],e[ki]=t[Ei]*t[Li]*t[Bi]-t[Ti]*t[Di]*t[Bi]-t[Ei]*t[Pi]*t[Vi]+t[ki]*t[Di]*t[Vi]+t[Ti]*t[Pi]*t[zi]-t[ki]*t[Li]*t[zi],e[Ti]=t[Ti]*t[Yi]*t[Bi]-t[Ei]*t[Fi]*t[Bi]+t[Ei]*t[Ri]*t[Vi]-t[ki]*t[Yi]*t[Vi]-t[Ti]*t[Ri]*t[zi]+t[ki]*t[Fi]*t[zi],e[Ei]=t[Ei]*t[Fi]*t[Pi]-t[Ti]*t[Yi]*t[Pi]-t[Ei]*t[Ri]*t[Li]+t[ki]*t[Yi]*t[Li]+t[Ti]*t[Ri]*t[Di]-t[ki]*t[Fi]*t[Di],e[Ci]=t[Yi]*t[Li]*t[Oi]-t[Fi]*t[Di]*t[Oi]-t[Yi]*t[Xi]*t[Vi]+t[Ci]*t[Di]*t[Vi]+t[Fi]*t[Xi]*t[zi]-t[Ci]*t[Li]*t[zi],e[Ri]=t[Ti]*t[Di]*t[Oi]-t[Ei]*t[Li]*t[Oi]+t[Ei]*t[Xi]*t[Vi]-t[Ii]*t[Di]*t[Vi]-t[Ti]*t[Xi]*t[zi]+t[Ii]*t[Li]*t[zi],e[Fi]=t[Ei]*t[Fi]*t[Oi]-t[Ti]*t[Yi]*t[Oi]-t[Ei]*t[Ci]*t[Vi]+t[Ii]*t[Yi]*t[Vi]+t[Ti]*t[Ci]*t[zi]-t[Ii]*t[Fi]*t[zi],e[Yi]=t[Ti]*t[Yi]*t[Xi]-t[Ei]*t[Fi]*t[Xi]+t[Ei]*t[Ci]*t[Li]-t[Ii]*t[Yi]*t[Li]-t[Ti]*t[Ci]*t[Di]+t[Ii]*t[Fi]*t[Di],e[Xi]=t[Ri]*t[Di]*t[Oi]-t[Yi]*t[Pi]*t[Oi]+t[Yi]*t[Xi]*t[Bi]-t[Ci]*t[Di]*t[Bi]-t[Ri]*t[Xi]*t[zi]+t[Ci]*t[Pi]*t[zi],e[Pi]=t[Ei]*t[Pi]*t[Oi]-t[ki]*t[Di]*t[Oi]-t[Ei]*t[Xi]*t[Bi]+t[Ii]*t[Di]*t[Bi]+t[ki]*t[Xi]*t[zi]-t[Ii]*t[Pi]*t[zi],e[Li]=t[ki]*t[Yi]*t[Oi]-t[Ei]*t[Ri]*t[Oi]+t[Ei]*t[Ci]*t[Bi]-t[Ii]*t[Yi]*t[Bi]-t[ki]*t[Ci]*t[zi]+t[Ii]*t[Ri]*t[zi],e[Di]=t[Ei]*t[Ri]*t[Xi]-t[ki]*t[Yi]*t[Xi]-t[Ei]*t[Ci]*t[Pi]+t[Ii]*t[Yi]*t[Pi]+t[ki]*t[Ci]*t[Di]-t[Ii]*t[Ri]*t[Di],e[Oi]=t[Fi]*t[Pi]*t[Oi]-t[Ri]*t[Li]*t[Oi]-t[Fi]*t[Xi]*t[Bi]+t[Ci]*t[Li]*t[Bi]+t[Ri]*t[Xi]*t[Vi]-t[Ci]*t[Pi]*t[Vi],e[Bi]=t[ki]*t[Li]*t[Oi]-t[Ti]*t[Pi]*t[Oi]+t[Ti]*t[Xi]*t[Bi]-t[Ii]*t[Li]*t[Bi]-t[ki]*t[Xi]*t[Vi]+t[Ii]*t[Pi]*t[Vi],e[Vi]=t[Ti]*t[Ri]*t[Oi]-t[ki]*t[Fi]*t[Oi]-t[Ti]*t[Ci]*t[Bi]+t[Ii]*t[Fi]*t[Bi]+t[ki]*t[Ci]*t[Vi]-t[Ii]*t[Ri]*t[Vi],e[zi]=t[ki]*t[Fi]*t[Xi]-t[Ti]*t[Ri]*t[Xi]+t[Ti]*t[Ci]*t[Pi]-t[Ii]*t[Fi]*t[Pi]-t[ki]*t[Ci]*t[Li]+t[Ii]*t[Ri]*t[Li],t[Ii]=e[Ii]*s,t[ki]=e[ki]*s,t[Ti]=e[Ti]*s,t[Ei]=e[Ei]*s,t[Ci]=e[Ci]*s,t[Ri]=e[Ri]*s,t[Fi]=e[Fi]*s,t[Yi]=e[Yi]*s,t[Xi]=e[Xi]*s,t[Pi]=e[Pi]*s,t[Li]=e[Li]*s,t[Di]=e[Di]*s,t[Oi]=e[Oi]*s,t[Bi]=e[Bi]*s,t[Vi]=e[Vi]*s,t[zi]=e[zi]*s,this}determinant(){let t=this.values;return t[Oi]*t[Pi]*t[Fi]*t[Ei]-t[Xi]*t[Bi]*t[Fi]*t[Ei]-t[Oi]*t[Ri]*t[Li]*t[Ei]+t[Ci]*t[Bi]*t[Li]*t[Ei]+t[Xi]*t[Ri]*t[Vi]*t[Ei]-t[Ci]*t[Pi]*t[Vi]*t[Ei]-t[Oi]*t[Pi]*t[Ti]*t[Yi]+t[Xi]*t[Bi]*t[Ti]*t[Yi]+t[Oi]*t[ki]*t[Li]*t[Yi]-t[Ii]*t[Bi]*t[Li]*t[Yi]-t[Xi]*t[ki]*t[Vi]*t[Yi]+t[Ii]*t[Pi]*t[Vi]*t[Yi]+t[Oi]*t[Ri]*t[Ti]*t[Di]-t[Ci]*t[Bi]*t[Ti]*t[Di]-t[Oi]*t[ki]*t[Fi]*t[Di]+t[Ii]*t[Bi]*t[Fi]*t[Di]+t[Ci]*t[ki]*t[Vi]*t[Di]-t[Ii]*t[Ri]*t[Vi]*t[Di]-t[Xi]*t[Ri]*t[Ti]*t[zi]+t[Ci]*t[Pi]*t[Ti]*t[zi]+t[Xi]*t[ki]*t[Fi]*t[zi]-t[Ii]*t[Pi]*t[Fi]*t[zi]-t[Ci]*t[ki]*t[Li]*t[zi]+t[Ii]*t[Ri]*t[Li]*t[zi]}translate(t,e,i){let s=this.values;return s[Ei]+=t,s[Yi]+=e,s[Di]+=i,this}copy(){return(new Ni).set(this.values)}projection(t,e,i,s){this.identity();let n=1/Math.tan(i*(Math.PI/180)/2),r=(e+t)/(t-e),a=2*e*t/(t-e),o=this.values;return o[Ii]=n/s,o[Ci]=0,o[Xi]=0,o[Oi]=0,o[ki]=0,o[Ri]=n,o[Pi]=0,o[Bi]=0,o[Ti]=0,o[Fi]=0,o[Li]=r,o[Vi]=-1,o[Ei]=0,o[Yi]=0,o[Di]=a,o[zi]=0,this}ortho2d(t,e,i,s){return this.ortho(t,t+i,e,e+s,0,1)}ortho(t,e,i,s,n,r){this.identity();let a=2/(e-t),o=2/(s-i),h=-2/(r-n),l=-(e+t)/(e-t),c=-(s+i)/(s-i),u=-(r+n)/(r-n),d=this.values;return d[Ii]=a,d[Ci]=0,d[Xi]=0,d[Oi]=0,d[ki]=0,d[Ri]=o,d[Pi]=0,d[Bi]=0,d[Ti]=0,d[Fi]=0,d[Li]=h,d[Vi]=0,d[Ei]=l,d[Yi]=c,d[Di]=u,d[zi]=1,this}multiply(t){let e=this.temp,i=this.values,s=t.values;return e[Ii]=i[Ii]*s[Ii]+i[ki]*s[Ci]+i[Ti]*s[Xi]+i[Ei]*s[Oi],e[ki]=i[Ii]*s[ki]+i[ki]*s[Ri]+i[Ti]*s[Pi]+i[Ei]*s[Bi],e[Ti]=i[Ii]*s[Ti]+i[ki]*s[Fi]+i[Ti]*s[Li]+i[Ei]*s[Vi],e[Ei]=i[Ii]*s[Ei]+i[ki]*s[Yi]+i[Ti]*s[Di]+i[Ei]*s[zi],e[Ci]=i[Ci]*s[Ii]+i[Ri]*s[Ci]+i[Fi]*s[Xi]+i[Yi]*s[Oi],e[Ri]=i[Ci]*s[ki]+i[Ri]*s[Ri]+i[Fi]*s[Pi]+i[Yi]*s[Bi],e[Fi]=i[Ci]*s[Ti]+i[Ri]*s[Fi]+i[Fi]*s[Li]+i[Yi]*s[Vi],e[Yi]=i[Ci]*s[Ei]+i[Ri]*s[Yi]+i[Fi]*s[Di]+i[Yi]*s[zi],e[Xi]=i[Xi]*s[Ii]+i[Pi]*s[Ci]+i[Li]*s[Xi]+i[Di]*s[Oi],e[Pi]=i[Xi]*s[ki]+i[Pi]*s[Ri]+i[Li]*s[Pi]+i[Di]*s[Bi],e[Li]=i[Xi]*s[Ti]+i[Pi]*s[Fi]+i[Li]*s[Li]+i[Di]*s[Vi],e[Di]=i[Xi]*s[Ei]+i[Pi]*s[Yi]+i[Li]*s[Di]+i[Di]*s[zi],e[Oi]=i[Oi]*s[Ii]+i[Bi]*s[Ci]+i[Vi]*s[Xi]+i[zi]*s[Oi],e[Bi]=i[Oi]*s[ki]+i[Bi]*s[Ri]+i[Vi]*s[Pi]+i[zi]*s[Bi],e[Vi]=i[Oi]*s[Ti]+i[Bi]*s[Fi]+i[Vi]*s[Li]+i[zi]*s[Vi],e[zi]=i[Oi]*s[Ei]+i[Bi]*s[Yi]+i[Vi]*s[Di]+i[zi]*s[zi],this.set(this.temp)}multiplyLeft(t){let e=this.temp,i=this.values,s=t.values;return e[Ii]=s[Ii]*i[Ii]+s[ki]*i[Ci]+s[Ti]*i[Xi]+s[Ei]*i[Oi],e[ki]=s[Ii]*i[ki]+s[ki]*i[Ri]+s[Ti]*i[Pi]+s[Ei]*i[Bi],e[Ti]=s[Ii]*i[Ti]+s[ki]*i[Fi]+s[Ti]*i[Li]+s[Ei]*i[Vi],e[Ei]=s[Ii]*i[Ei]+s[ki]*i[Yi]+s[Ti]*i[Di]+s[Ei]*i[zi],e[Ci]=s[Ci]*i[Ii]+s[Ri]*i[Ci]+s[Fi]*i[Xi]+s[Yi]*i[Oi],e[Ri]=s[Ci]*i[ki]+s[Ri]*i[Ri]+s[Fi]*i[Pi]+s[Yi]*i[Bi],e[Fi]=s[Ci]*i[Ti]+s[Ri]*i[Fi]+s[Fi]*i[Li]+s[Yi]*i[Vi],e[Yi]=s[Ci]*i[Ei]+s[Ri]*i[Yi]+s[Fi]*i[Di]+s[Yi]*i[zi],e[Xi]=s[Xi]*i[Ii]+s[Pi]*i[Ci]+s[Li]*i[Xi]+s[Di]*i[Oi],e[Pi]=s[Xi]*i[ki]+s[Pi]*i[Ri]+s[Li]*i[Pi]+s[Di]*i[Bi],e[Li]=s[Xi]*i[Ti]+s[Pi]*i[Fi]+s[Li]*i[Li]+s[Di]*i[Vi],e[Di]=s[Xi]*i[Ei]+s[Pi]*i[Yi]+s[Li]*i[Di]+s[Di]*i[zi],e[Oi]=s[Oi]*i[Ii]+s[Bi]*i[Ci]+s[Vi]*i[Xi]+s[zi]*i[Oi],e[Bi]=s[Oi]*i[ki]+s[Bi]*i[Ri]+s[Vi]*i[Pi]+s[zi]*i[Bi],e[Vi]=s[Oi]*i[Ti]+s[Bi]*i[Fi]+s[Vi]*i[Li]+s[zi]*i[Vi],e[zi]=s[Oi]*i[Ei]+s[Bi]*i[Yi]+s[Vi]*i[Di]+s[zi]*i[zi],this.set(this.temp)}lookAt(t,e,i){let s=Ni.xAxis,n=Ni.yAxis,r=Ni.zAxis;r.setFrom(e).normalize(),s.setFrom(e).normalize(),s.cross(i).normalize(),n.setFrom(s).cross(r).normalize(),this.identity();let a=this.values;return a[Ii]=s.x,a[ki]=s.y,a[Ti]=s.z,a[Ci]=n.x,a[Ri]=n.y,a[Fi]=n.z,a[Xi]=-r.x,a[Pi]=-r.y,a[Li]=-r.z,Ni.tmpMatrix.identity(),Ni.tmpMatrix.values[Ei]=-t.x,Ni.tmpMatrix.values[Yi]=-t.y,Ni.tmpMatrix.values[Di]=-t.z,this.multiply(Ni.tmpMatrix),this}},_i=Ni;_i.xAxis=new Si,_i.yAxis=new Si,_i.zAxis=new Si,_i.tmpMatrix=new Ni;var Ui=class{constructor(t,e){this.position=new Si(0,0,0),this.direction=new Si(0,0,-1),this.up=new Si(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new _i,this.inverseProjectionView=new _i,this.projection=new _i,this.view=new _i,this.viewportWidth=t,this.viewportHeight=e,this.update()}update(){let t=this.projection,e=this.view,i=this.projectionView,s=this.inverseProjectionView,n=this.zoom,r=this.viewportWidth,a=this.viewportHeight;t.ortho(n*(-r/2),n*(r/2),n*(-a/2),n*(a/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),i.set(t.values),i.multiply(e),s.set(i.values).invert()}screenToWorld(t,e,i){let s=t.x,n=i-t.y-1;return t.x=2*s/e-1,t.y=2*n/i-1,t.z=2*t.z-1,t.project(this.inverseProjectionView),t}worldToScreen(t,e,i){return t.project(this.projectionView),t.x=e*(t.x+1)/2,t.y=i*(t.y+1)/2,t.z=(t.z+1)/2,t}setViewport(t,e){this.viewportWidth=t,this.viewportHeight=e}},Wi=class{constructor(t){this.mouseX=0,this.mouseY=0,this.buttonDown=!1,this.touch0=null,this.touch1=null,this.initialPinchDistance=0,this.listeners=new Array,this.eventListeners=[],this.element=t,this.setupCallbacks(t)}setupCallbacks(t){let e=e=>{if(e instanceof MouseEvent){let i=t.getBoundingClientRect();this.mouseX=e.clientX-i.left,this.mouseY=e.clientY-i.top,this.listeners.map(t=>{this.buttonDown?t.dragged&&t.dragged(this.mouseX,this.mouseY):t.moved&&t.moved(this.mouseX,this.mouseY)})}},i=s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!1,this.listeners.map(t=>{t.up&&t.up(this.mouseX,this.mouseY)}),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i)}};t.addEventListener("mousedown",s=>{if(s instanceof MouseEvent){let n=t.getBoundingClientRect();this.mouseX=s.clientX-n.left,this.mouseY=s.clientY-n.top,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.mouseX,this.mouseY)}),document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}},!0),t.addEventListener("mousemove",e,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("wheel",t=>{t.preventDefault();let e=t.deltaY;t.deltaMode==WheelEvent.DOM_DELTA_LINE&&(e*=8),t.deltaMode==WheelEvent.DOM_DELTA_PAGE&&(e*=24),this.listeners.map(e=>{e.wheel&&e.wheel(t.deltaY)})},!0),t.addEventListener("touchstart",e=>{if(!this.touch0||!this.touch1){let i=e.changedTouches.item(0);if(!i)return;let s=t.getBoundingClientRect(),n=i.clientX-s.left,r=i.clientY-s.top,a=new qi(i.identifier,n,r);if(this.mouseX=n,this.mouseY=r,this.buttonDown=!0,this.touch0){if(!this.touch1){this.touch1=a;let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x;this.initialPinchDistance=Math.sqrt(t*t+e*e),this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,this.initialPinchDistance)})}}else this.touch0=a,this.listeners.map(t=>{t.down&&t.down(a.x,a.y)})}e.preventDefault()},!1),t.addEventListener("touchmove",e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s<i.length;s++){var n=i[s];let t=n.clientX-r.left,e=n.clientY-r.top;this.touch0.identifier===n.identifier&&(this.touch0.x=this.mouseX=t,this.touch0.y=this.mouseY=e,this.listeners.map(i=>{i.dragged&&i.dragged(t,e)})),this.touch1&&this.touch1.identifier===n.identifier&&(this.touch1.x=this.mouseX=t,this.touch1.y=this.mouseY=e)}if(this.touch0&&this.touch1){let t=this.touch1.x-this.touch0.x,e=this.touch1.x-this.touch0.x,i=Math.sqrt(t*t+e*e);this.listeners.map(t=>{t.zoom&&t.zoom(this.initialPinchDistance,i)})}}e.preventDefault()},!1);let s=e=>{if(this.touch0){var i=e.changedTouches;let r=t.getBoundingClientRect();for(var s=0;s<i.length;s++){var n=i[s];let t=n.clientX-r.left,e=n.clientY-r.top;if(this.touch0.identifier===n.identifier){if(this.touch0=null,this.mouseX=t,this.mouseY=e,this.listeners.map(i=>{i.up&&i.up(t,e)}),!this.touch1){this.buttonDown=!1;break}this.touch0=this.touch1,this.touch1=null,this.mouseX=this.touch0.x,this.mouseX=this.touch0.x,this.buttonDown=!0,this.listeners.map(t=>{t.down&&t.down(this.touch0.x,this.touch0.y)})}this.touch1&&this.touch1.identifier&&(this.touch1=null)}}e.preventDefault()};t.addEventListener("touchend",s,!1),t.addEventListener("touchcancel",s)}addListener(t){this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}},qi=class{constructor(t,e,i){this.identifier=t,this.x=e,this.y=i}},Gi=class{constructor(t,e){this.canvas=t,this.camera=e;let i=0,s=0,n=0,r=0,a=0,o=0,h=0;new Wi(t).addListener({down:(t,l)=>{i=e.position.x,s=e.position.y,n=a=t,r=o=l,h=e.zoom},dragged:(h,l)=>{let c=h-n,u=l-r,d=e.screenToWorld(new Si(0,0),t.clientWidth,t.clientHeight),f=e.screenToWorld(new Si(c,u),t.clientWidth,t.clientHeight).sub(d);e.position.set(i-f.x,s-f.y,0),e.update(),a=h,o=l},wheel:i=>{let s=i/200*e.zoom,n=e.zoom+s;if(n>0){let s=0,r=0;if(i<0)s=a,r=o;else{let e=new Si(t.clientWidth/2+15,t.clientHeight/2),i=a-e.x,n=t.clientHeight-1-o-e.y;s=e.x-i,r=t.clientHeight-1-e.y+n}let h=e.screenToWorld(new Si(s,r),t.clientWidth,t.clientHeight);e.zoom=n,e.update();let l=e.screenToWorld(new Si(s,r),t.clientWidth,t.clientHeight);e.position.add(h.sub(l)),e.update()}},zoom:(t,i)=>{let s=t/i;e.zoom=h*s},up:(t,e)=>{a=t,o=e},moved:(t,e)=>{a=t,o=e}})}},ji=class{constructor(t,e,i){this.vertexShader=e,this.fragmentShader=i,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=e,this.fsSource=i,this.context=t instanceof yi?t:new yi(t),this.context.addRestorable(this),this.compile()}getProgram(){return this.program}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}getVertexShaderSource(){return this.vsSource}getFragmentSource(){return this.fsSource}compile(){let t=this.context.gl;try{if(this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),!this.vs)throw new Error("Couldn't compile vertex shader.");if(this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),!this.fs)throw new Error("Couldn#t compile fragment shader.");this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}}compileShader(t,e){let i=this.context.gl,s=i.createShader(t);if(!s)throw new Error("Couldn't create shader.");if(i.shaderSource(s,e),i.compileShader(s),!i.getShaderParameter(s,i.COMPILE_STATUS)){let t="Couldn't compile shader: "+i.getShaderInfoLog(s);if(i.deleteShader(s),!i.isContextLost())throw new Error(t)}return s}compileProgram(t,e){let i=this.context.gl,s=i.createProgram();if(!s)throw new Error("Couldn't compile program.");if(i.attachShader(s,t),i.attachShader(s,e),i.linkProgram(s),!i.getProgramParameter(s,i.LINK_STATUS)){let t="Couldn't compile shader program: "+i.getProgramInfoLog(s);if(i.deleteProgram(s),!i.isContextLost())throw new Error(t)}return s}restore(){this.compile()}bind(){this.context.gl.useProgram(this.program)}unbind(){this.context.gl.useProgram(null)}setUniformi(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)}setUniformf(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)}setUniform2f(t,e,i){this.context.gl.uniform2f(this.getUniformLocation(t),e,i)}setUniform3f(t,e,i,s){this.context.gl.uniform3f(this.getUniformLocation(t),e,i,s)}setUniform4f(t,e,i,s,n){this.context.gl.uniform4f(this.getUniformLocation(t),e,i,s,n)}setUniform2x2f(t,e){let i=this.context.gl;this.tmp2x2.set(e),i.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)}setUniform3x3f(t,e){let i=this.context.gl;this.tmp3x3.set(e),i.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)}setUniform4x4f(t,e){let i=this.context.gl;this.tmp4x4.set(e),i.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)}getUniformLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getUniformLocation(this.program,t);if(!i&&!e.isContextLost())throw new Error("Couldn't find location for uniform "+t);return i}getAttributeLocation(t){let e=this.context.gl;if(!this.program)throw new Error("Shader not compiled.");let i=e.getAttribLocation(this.program,t);if(-1==i&&!e.isContextLost())throw new Error("Couldn't find location for attribute "+t);return i}dispose(){this.context.removeRestorable(this);let t=this.context.gl;this.vs&&(t.deleteShader(this.vs),this.vs=null),this.fs&&(t.deleteShader(this.fs),this.fs=null),this.program&&(t.deleteProgram(this.program),this.program=null)}static newColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n\t\t\t\t}\n\t\t\t")}static newTwoColoredTextured(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tattribute vec4 ${ji.COLOR2};\n\t\t\t\tattribute vec2 ${ji.TEXCOORDS};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = ${ji.COLOR};\n\t\t\t\t\tv_dark = ${ji.COLOR2};\n\t\t\t\t\tv_texCoords = ${ji.TEXCOORDS};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t")}static newColored(t){let e=`\n\t\t\t\tattribute vec4 ${ji.POSITION};\n\t\t\t\tattribute vec4 ${ji.COLOR};\n\t\t\t\tuniform mat4 ${ji.MVP_MATRIX};\n\t\t\t\tvarying vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = ${ji.COLOR};\n\t\t\t\t\tgl_Position = ${ji.MVP_MATRIX} * ${ji.POSITION};\n\t\t\t\t}\n\t\t\t`;return new ji(t,e,"\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_color;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")}},Hi=ji;Hi.MVP_MATRIX="u_projTrans",Hi.POSITION="a_position",Hi.COLOR="a_color",Hi.COLOR2="a_color2",Hi.TEXCOORDS="a_texCoords",Hi.SAMPLER="u_texture";var Zi=class{constructor(t,e,i,s){this.attributes=e,this.verticesBuffer=null,this.verticesLength=0,this.dirtyVertices=!1,this.indicesBuffer=null,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof yi?t:new yi(t),this.elementsPerVertex=0;for(let t=0;t<e.length;t++)this.elementsPerVertex+=e[t].numElements;this.vertices=new Float32Array(i*this.elementsPerVertex),this.indices=new Uint16Array(s),this.context.addRestorable(this)}getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(t){this.dirtyVertices=!0,this.verticesLength=t}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(t){this.dirtyIndices=!0,this.indicesLength=t}getIndices(){return this.indices}getVertexSizeInFloats(){let t=0;for(var e=0;e<this.attributes.length;e++){t+=this.attributes[e].numElements}return t}setVertices(t){if(this.dirtyVertices=!0,t.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let n=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?n.drawElements(e,s,n.UNSIGNED_SHORT,2*i):n.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s<this.attributes.length;s++){let n=this.attributes[s],r=t.getAttributeLocation(n.name);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,n.numElements,e.FLOAT,!1,4*this.elementsPerVertex,4*i),i+=n.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i<this.attributes.length;i++){let s=this.attributes[i],n=t.getAttributeLocation(s.name);e.disableVertexAttribArray(n)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},Ki=class{constructor(t,e,i){this.name=t,this.type=e,this.numElements=i}},Ji=class extends Ki{constructor(){super(Hi.POSITION,is.Float,2)}},Qi=class extends Ki{constructor(){super(Hi.POSITION,is.Float,3)}},$i=class extends Ki{constructor(t=0){super(Hi.TEXCOORDS+(0==t?"":t),is.Float,2)}},ts=class extends Ki{constructor(){super(Hi.COLOR,is.Float,4)}},es=class extends Ki{constructor(){super(Hi.COLOR2,is.Float,4)}},is=(t=>(t[t.Float=0]="Float",t))(is||{}),ss=class{constructor(t,e=!0,i=10920){if(this.drawCalls=0,this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,this.cullWasEnabled=!1,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof yi?t:new yi(t);let s=e?[new Ji,new ts,new $i,new es]:[new Ji,new ts,new $i];this.mesh=new Zi(t,s,i,3*i);let n=this.context.gl;this.srcColorBlend=n.SRC_ALPHA,this.srcAlphaBlend=n.ONE,this.dstBlend=n.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),this.cullWasEnabled=e.isEnabled(e.CULL_FACE),this.cullWasEnabled&&e.disable(e.CULL_FACE)}setBlendMode(t,e,i){if((this.srcColorBlend!=t||this.srcAlphaBlend!=e||this.dstBlend!=i)&&(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing)){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}draw(t,e,i){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();let s=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);let n=this.mesh.getIndices();for(let t=this.indicesLength,e=0;e<i.length;t++,e++)n[t]=i[e]+s;this.indicesLength+=i.length,this.mesh.setIndicesLength(this.indicesLength)}flush(){if(0!=this.verticesLength){if(!this.lastTexture)throw new Error("No texture set.");if(!this.shader)throw new Error("No shader set.");this.lastTexture.bind(),this.mesh.draw(this.shader,this.context.gl.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++,ss.globalDrawCalls++}}end(){if(!this.isDrawing)throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()");(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1;let t=this.context.gl;t.disable(t.BLEND),this.cullWasEnabled&&t.enable(t.CULL_FACE)}getDrawCalls(){return this.drawCalls}static getAndResetGlobalDrawCalls(){let t=ss.globalDrawCalls;return ss.globalDrawCalls=0,t}dispose(){this.mesh.dispose()}},ns=ss;ns.globalDrawCalls=0;var rs=class{constructor(t,e=10920){if(this.isDrawing=!1,this.shapeType=as.Filled,this.color=new h(1,1,1,1),this.shader=null,this.vertexIndex=0,this.tmp=new w,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof yi?t:new yi(t),this.mesh=new Zi(t,[new Ji,new ts],e,0);let i=this.context.gl;this.srcColorBlend=i.SRC_ALPHA,this.srcAlphaBlend=i.ONE,this.dstBlend=i.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend)}setBlendMode(t,e,i){if(this.srcColorBlend=t,this.srcAlphaBlend=e,this.dstBlend=i,this.isDrawing){this.flush(),this.context.gl.blendFuncSeparate(t,i,e,i)}}setColor(t){this.color.setFromColor(t)}setColorWith(t,e,i,s){this.color.set(t,e,i,s)}point(t,e,i){this.check(as.Point,1),i||(i=this.color),this.vertex(t,e,i)}line(t,e,i,s,n){this.check(as.Line,2);this.mesh.getVertices(),this.vertexIndex;n||(n=this.color),this.vertex(t,e,n),this.vertex(i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;o||(o=this.color),h||(h=this.color),l||(l=this.color),t?(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(r,a,l)):(this.vertex(e,i,o),this.vertex(s,n,h),this.vertex(s,n,o),this.vertex(r,a,h),this.vertex(r,a,o),this.vertex(e,i,h))}quad(t,e,i,s,n,r,a,o,h,l,c,u,d){this.check(t?as.Filled:as.Line,3);this.mesh.getVertices(),this.vertexIndex;l||(l=this.color),c||(c=this.color),u||(u=this.color),d||(d=this.color),t?(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(e,i,l)):(this.vertex(e,i,l),this.vertex(s,n,c),this.vertex(s,n,c),this.vertex(r,a,u),this.vertex(r,a,u),this.vertex(o,h,d),this.vertex(o,h,d),this.vertex(e,i,l))}rect(t,e,i,s,n,r){this.quad(t,e,i,e+s,i,e+s,i+n,e,i+n,r,r,r,r)}rectLine(t,e,i,s,n,r,a){this.check(t?as.Filled:as.Line,8),a||(a=this.color);let o=this.tmp.set(n-i,e-s);o.normalize(),r*=.5;let h=o.x*r,l=o.y*r;t?(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e-h,i-l,a)):(this.vertex(e+h,i+l,a),this.vertex(e-h,i-l,a),this.vertex(s+h,n+l,a),this.vertex(s-h,n-l,a),this.vertex(s+h,n+l,a),this.vertex(e+h,i+l,a),this.vertex(s-h,n-l,a),this.vertex(e-h,i-l,a))}x(t,e,i){this.line(t-i,e-i,t+i,e+i),this.line(t-i,e+i,t+i,e-i)}polygon(t,e,i,s){if(i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(as.Line,2*i),s||(s=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;let n=t[e<<=1],r=t[e+1],a=e+i;for(let o=e,h=e+i-2;o<h;o+=2){let e=t[o],i=t[o+1],h=0,l=0;o+2>=a?(h=n,l=r):(h=t[o+2],l=t[o+3]),this.vertex(e,i,s),this.vertex(h,l,s)}}circle(t,e,i,s,n,r=0){if(0==r&&(r=Math.max(1,6*c.cbrt(s)|0)),r<=0)throw new Error("segments must be > 0.");n||(n=this.color);let a=2*c.PI/r,o=Math.cos(a),h=Math.sin(a),l=s,u=0;if(t){this.check(as.Filled,3*r+3),r--;for(let t=0;t<r;t++){this.vertex(e,i,n),this.vertex(e+l,i+u,n);let t=l;l=o*l-h*u,u=h*t+o*u,this.vertex(e+l,i+u,n)}this.vertex(e,i,n),this.vertex(e+l,i+u,n)}else{this.check(as.Line,2*r+2);for(let t=0;t<r;t++){this.vertex(e+l,i+u,n);let t=l;l=o*l-h*u,u=h*t+o*u,this.vertex(e+l,i+u,n)}this.vertex(e+l,i+u,n)}l=s,u=0,this.vertex(e+l,i+u,n)}curve(t,e,i,s,n,r,a,o,h,l){this.check(as.Line,2*h+2),l||(l=this.color);let c=1/h,u=c*c,d=c*c*c,f=3*c,p=3*u,m=6*u,g=6*d,x=t-2*i+n,w=e-2*s+r,y=3*(i-n)-t+a,v=3*(s-r)-e+o,b=t,A=e,M=(i-t)*f+x*p+y*d,S=(s-e)*f+w*p+v*d,I=x*m+y*g,k=w*m+v*g,T=y*g,E=v*g;for(;h-- >0;)this.vertex(b,A,l),b+=M,A+=S,M+=I,S+=k,I+=T,k+=E,this.vertex(b,A,l);this.vertex(b,A,l),this.vertex(a,o,l)}vertex(t,e,i){let s=this.vertexIndex,n=this.mesh.getVertices();n[s++]=t,n[s++]=e,n[s++]=i.r,n[s++]=i.g,n[s++]=i.b,n[s++]=i.a,this.vertexIndex=s}end(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush();let t=this.context.gl;t.disable(t.BLEND),this.isDrawing=!1}flush(){if(0!=this.vertexIndex){if(!this.shader)throw new Error("No shader set.");this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0}}check(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()<e))return;this.flush()}else this.flush(),this.shapeType=t}dispose(){this.mesh.dispose()}},as=(t=>(t[t.Point=0]="Point",t[t.Line=1]="Line",t[t.Filled=4]="Filled",t))(as||{}),os=class{constructor(t){this.boneLineColor=new h(1,0,0,1),this.boneOriginColor=new h(0,1,0,1),this.attachmentLineColor=new h(0,0,1,.5),this.triangleLineColor=new h(1,.64,0,.5),this.pathColor=(new h).setFromString("FF7F00"),this.clipColor=new h(.8,0,0,2),this.aabbColor=new h(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new ci,this.temp=new Array,this.vertices=m.newFloatArray(2048),this.context=t instanceof yi?t:new yi(t)}draw(t,e,i){let s=e.x,n=e.y,r=this.context.gl,a=this.premultipliedAlpha?r.ONE:r.SRC_ALPHA;t.setBlendMode(a,r.ONE,r.ONE_MINUS_SRC_ALPHA);let o=e.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(let e=0,s=o.length;e<s;e++){let s=o[e];if(i&&i.indexOf(s.data.name)>-1)continue;if(!s.parent)continue;let n=s.data.length*s.a+s.worldX,r=s.data.length*s.c+s.worldY;t.rectLine(!0,s.worldX,s.worldY,n,r,this.boneWidth*this.scale)}this.drawSkeletonXY&&t.x(s,n,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);let i=e.slots;for(let e=0,s=i.length;e<s;e++){let s=i[e],n=s.getAttachment();if(n instanceof ne){let e=n,i=this.vertices;e.computeWorldVertices(s,i,0,2),t.line(i[0],i[1],i[2],i[3]),t.line(i[2],i[3],i[4],i[5]),t.line(i[4],i[5],i[6],i[7]),t.line(i[6],i[7],i[0],i[1])}}}if(this.drawMeshHull||this.drawMeshTriangles){let i=e.slots;for(let e=0,s=i.length;e<s;e++){let s=i[e];if(!s.bone.active)continue;let n=s.getAttachment();if(!(n instanceof te))continue;let r=n,a=this.vertices;r.computeWorldVertices(s,0,r.worldVerticesLength,a,0,2);let o=r.triangles,h=r.hullLength;if(this.drawMeshTriangles){t.setColor(this.triangleLineColor);for(let e=0,i=o.length;e<i;e+=3){let i=2*o[e],s=2*o[e+1],n=2*o[e+2];t.triangle(!1,a[i],a[i+1],a[s],a[s+1],a[n],a[n+1])}}if(this.drawMeshHull&&h>0){t.setColor(this.attachmentLineColor),h=2*(h>>1);let e=a[h-2],i=a[h-1];for(let s=0,n=h;s<n;s+=2){let n=a[s],r=a[s+1];t.line(n,r,e,i),e=n,i=r}}}}if(this.drawBoundingBoxes){let i=this.bounds;i.update(e,!0),t.setColor(this.aabbColor),t.rect(!1,i.minX,i.minY,i.getWidth(),i.getHeight());let s=i.polygons,n=i.boundingBoxes;for(let e=0,i=s.length;e<i;e++){let i=s[e];t.setColor(n[e].color),t.polygon(i,0,i.length)}}if(this.drawPaths){let i=e.slots;for(let e=0,s=i.length;e<s;e++){let s=i[e];if(!s.bone.active)continue;let n=s.getAttachment();if(!(n instanceof ee))continue;let r=n,a=r.worldVerticesLength,o=this.temp=m.setArraySize(this.temp,a,0);r.computeWorldVertices(s,0,a,o,0,2);let h=this.pathColor,l=o[2],c=o[3],u=0,d=0;if(r.closed){t.setColor(h);let e=o[0],i=o[1],s=o[a-2],n=o[a-1];u=o[a-4],d=o[a-3],t.curve(l,c,e,i,s,n,u,d,32),t.setColor(os.LIGHT_GRAY),t.line(l,c,e,i),t.line(u,d,s,n)}a-=4;for(let e=4;e<a;e+=6){let i=o[e],s=o[e+1],n=o[e+2],r=o[e+3];u=o[e+4],d=o[e+5],t.setColor(h),t.curve(l,c,i,s,n,r,u,d,32),t.setColor(os.LIGHT_GRAY),t.line(l,c,i,s),t.line(u,d,n,r),l=u,c=d}}}if(this.drawBones){t.setColor(this.boneOriginColor);for(let e=0,s=o.length;e<s;e++){let s=o[e];i&&i.indexOf(s.data.name)>-1||t.circle(!0,s.worldX,s.worldY,3*this.scale,this.boneOriginColor,8)}}if(this.drawClipping){let i=e.slots;t.setColor(this.clipColor);for(let e=0,s=i.length;e<s;e++){let s=i[e];if(!s.bone.active)continue;let n=s.getAttachment();if(!(n instanceof Wt))continue;let r=n,a=r.worldVerticesLength,o=this.temp=m.setArraySize(this.temp,a,0);r.computeWorldVertices(s,0,a,o,0,2);for(let e=0,i=o.length;e<i;e+=2){let i=o[e],s=o[e+1],n=o[(e+2)%o.length],r=o[(e+3)%o.length];t.line(i,s,n,r)}}}}dispose(){}},hs=os;hs.LIGHT_GRAY=new h(192/255,192/255,192/255,1),hs.GREEN=new h(0,1,0,1);var ls=class{constructor(t,e=!0){this.premultipliedAlpha=!1,this.tempColor=new h,this.tempColor2=new h,this.vertexSize=8,this.twoColorTint=!1,this.renderable=new class{constructor(t,e,i){this.vertices=t,this.numVertices=e,this.numFloats=i}}([],0,0),this.clipper=new di,this.temp=new w,this.temp2=new w,this.temp3=new h,this.temp4=new h,this.twoColorTint=e,e&&(this.vertexSize+=4),this.vertices=m.newFloatArray(1024*this.vertexSize)}draw(t,e,i=-1,s=-1,n=null){let r,a,o,h=this.clipper,l=this.premultipliedAlpha,c=this.twoColorTint,u=null,d=(this.temp,this.temp2,this.temp3,this.temp4,this.renderable),f=e.drawOrder,p=e.color,g=c?12:8,x=!1;-1==i&&(x=!0);for(let e=0,w=f.length;e<w;e++){let w=h.isClipping()?2:g,y=f[e];if(!y.bone.active){h.clipEndWithSlot(y);continue}if(i>=0&&i==y.data.index&&(x=!0),!x){h.clipEndWithSlot(y);continue}s>=0&&s==y.data.index&&(x=!1);let v,b=y.getAttachment();if(b instanceof ne){let t=b;d.vertices=this.vertices,d.numVertices=4,d.numFloats=w<<2,t.computeWorldVertices(y,d.vertices,0,w),a=ls.QUAD_TRIANGLES,r=t.uvs,v=t.region.renderObject.page.texture,o=t.color}else{if(!(b instanceof te)){if(b instanceof Wt){let t=b;h.clipStart(y,t);continue}h.clipEndWithSlot(y);continue}{let t=b;d.vertices=this.vertices,d.numVertices=t.worldVerticesLength>>1,d.numFloats=d.numVertices*w,d.numFloats>d.vertices.length&&(d.vertices=this.vertices=m.newFloatArray(d.numFloats)),t.computeWorldVertices(y,0,t.worldVerticesLength,d.vertices,0,w),a=t.triangles,v=t.region.renderObject.page.texture,r=t.uvs,o=t.color}}if(v){let e=y.color,i=this.tempColor;i.r=p.r*e.r*o.r,i.g=p.g*e.g*o.g,i.b=p.b*e.b*o.b,i.a=p.a*e.a*o.a,l&&(i.r*=i.a,i.g*=i.a,i.b*=i.a);let s=this.tempColor2;y.darkColor?(l?(s.r=y.darkColor.r*i.a,s.g=y.darkColor.g*i.a,s.b=y.darkColor.b*i.a):s.setFromColor(y.darkColor),s.a=l?1:0):s.set(0,0,0,1);let f=y.data.blendMode;if(f!=u&&(u=f,t.setBlendMode(vi.getSourceColorGLBlendMode(u,l),vi.getSourceAlphaGLBlendMode(u),vi.getDestGLBlendMode(u))),h.isClipping()){h.clipTriangles(d.vertices,d.numFloats,a,a.length,r,i,s,c);let e=new Float32Array(h.clippedVertices),o=h.clippedTriangles;n&&n(d.vertices,d.numFloats,g),t.draw(v,e,o)}else{let e=d.vertices;if(c)for(let t=2,n=0,a=d.numFloats;t<a;t+=g,n+=2)e[t]=i.r,e[t+1]=i.g,e[t+2]=i.b,e[t+3]=i.a,e[t+4]=r[n],e[t+5]=r[n+1],e[t+6]=s.r,e[t+7]=s.g,e[t+8]=s.b,e[t+9]=s.a;else for(let t=2,s=0,n=d.numFloats;t<n;t+=g,s+=2)e[t]=i.r,e[t+1]=i.g,e[t+2]=i.b,e[t+3]=i.a,e[t+4]=r[s],e[t+5]=r[s+1];let o=d.vertices.subarray(0,d.numFloats);n&&n(d.vertices,d.numFloats,g),t.draw(v,o,a)}}h.clipEndWithSlot(y)}h.clipEnd()}},cs=ls;cs.QUAD_TRIANGLES=[0,1,2,2,3,0];var us,ds,fs,ps=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],ms=[0,1,2,2,3,0],gs=new h(1,1,1,1),xs=class{constructor(t,e,i=!0){this.twoColorTint=!1,this.activeRenderer=null,this.canvas=t,this.context=e instanceof yi?e:new yi(e),this.twoColorTint=i,this.camera=new Ui(t.width,t.height),this.batcherShader=i?Hi.newTwoColoredTextured(this.context):Hi.newColoredTextured(this.context),this.batcher=new ns(this.context,i),this.shapesShader=Hi.newColored(this.context),this.shapes=new rs(this.context),this.skeletonRenderer=new cs(this.context,i),this.skeletonDebugRenderer=new hs(this.context)}dispose(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()}begin(){this.camera.update(),this.enableRenderer(this.batcher)}drawSkeleton(t,e=!1,i=-1,s=-1,n=null){this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,i,s,n)}drawSkeletonDebug(t,e=!1,i){this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,i)}drawTexture(t,e,i,s,n,r){this.enableRenderer(this.batcher),r||(r=gs);var a=0;ps[a++]=e,ps[a++]=i,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=0,ps[a++]=1,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e+s,ps[a++]=i,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=1,ps[a++]=1,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e+s,ps[a++]=i+n,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=1,ps[a++]=0,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e,ps[a++]=i+n,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=0,ps[a++]=0,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a]=0),this.batcher.draw(t,ps,ms)}drawTextureUV(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.batcher),l||(l=gs);var c=0;ps[c++]=e,ps[c++]=i,ps[c++]=l.r,ps[c++]=l.g,ps[c++]=l.b,ps[c++]=l.a,ps[c++]=r,ps[c++]=a,this.twoColorTint&&(ps[c++]=0,ps[c++]=0,ps[c++]=0,ps[c++]=0),ps[c++]=e+s,ps[c++]=i,ps[c++]=l.r,ps[c++]=l.g,ps[c++]=l.b,ps[c++]=l.a,ps[c++]=o,ps[c++]=a,this.twoColorTint&&(ps[c++]=0,ps[c++]=0,ps[c++]=0,ps[c++]=0),ps[c++]=e+s,ps[c++]=i+n,ps[c++]=l.r,ps[c++]=l.g,ps[c++]=l.b,ps[c++]=l.a,ps[c++]=o,ps[c++]=h,this.twoColorTint&&(ps[c++]=0,ps[c++]=0,ps[c++]=0,ps[c++]=0),ps[c++]=e,ps[c++]=i+n,ps[c++]=l.r,ps[c++]=l.g,ps[c++]=l.b,ps[c++]=l.a,ps[c++]=r,ps[c++]=h,this.twoColorTint&&(ps[c++]=0,ps[c++]=0,ps[c++]=0,ps[c]=0),this.batcher.draw(t,ps,ms)}drawTextureRotated(t,e,i,s,n,r,a,o,h){this.enableRenderer(this.batcher),h||(h=gs);let l=e+r,u=i+a,d=-r,f=-a,p=s-r,m=n-a,g=d,x=f,w=d,y=m,v=p,b=m,A=p,M=f,S=0,I=0,k=0,T=0,E=0,C=0,R=0,F=0;if(0!=o){let t=c.cosDeg(o),e=c.sinDeg(o);S=t*g-e*x,I=e*g+t*x,R=t*w-e*y,F=e*w+t*y,E=t*v-e*b,C=e*v+t*b,k=E+(S-R),T=C+(I-F)}else S=g,I=x,R=w,F=y,E=v,C=b,k=A,T=M;S+=l,I+=u,k+=l,T+=u,E+=l,C+=u,R+=l,F+=u;var Y=0;ps[Y++]=S,ps[Y++]=I,ps[Y++]=h.r,ps[Y++]=h.g,ps[Y++]=h.b,ps[Y++]=h.a,ps[Y++]=0,ps[Y++]=1,this.twoColorTint&&(ps[Y++]=0,ps[Y++]=0,ps[Y++]=0,ps[Y++]=0),ps[Y++]=k,ps[Y++]=T,ps[Y++]=h.r,ps[Y++]=h.g,ps[Y++]=h.b,ps[Y++]=h.a,ps[Y++]=1,ps[Y++]=1,this.twoColorTint&&(ps[Y++]=0,ps[Y++]=0,ps[Y++]=0,ps[Y++]=0),ps[Y++]=E,ps[Y++]=C,ps[Y++]=h.r,ps[Y++]=h.g,ps[Y++]=h.b,ps[Y++]=h.a,ps[Y++]=1,ps[Y++]=0,this.twoColorTint&&(ps[Y++]=0,ps[Y++]=0,ps[Y++]=0,ps[Y++]=0),ps[Y++]=R,ps[Y++]=F,ps[Y++]=h.r,ps[Y++]=h.g,ps[Y++]=h.b,ps[Y++]=h.a,ps[Y++]=0,ps[Y++]=0,this.twoColorTint&&(ps[Y++]=0,ps[Y++]=0,ps[Y++]=0,ps[Y]=0),this.batcher.draw(t,ps,ms)}drawRegion(t,e,i,s,n,r){this.enableRenderer(this.batcher),r||(r=gs);var a=0;ps[a++]=e,ps[a++]=i,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=t.u,ps[a++]=t.v2,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e+s,ps[a++]=i,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=t.u2,ps[a++]=t.v2,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e+s,ps[a++]=i+n,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=t.u2,ps[a++]=t.v,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a++]=0),ps[a++]=e,ps[a++]=i+n,ps[a++]=r.r,ps[a++]=r.g,ps[a++]=r.b,ps[a++]=r.a,ps[a++]=t.u,ps[a++]=t.v,this.twoColorTint&&(ps[a++]=0,ps[a++]=0,ps[a++]=0,ps[a]=0),this.batcher.draw(t.page.texture,ps,ms)}line(t,e,i,s,n,r){this.enableRenderer(this.shapes),this.shapes.line(t,e,i,s,n)}triangle(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.shapes),this.shapes.triangle(t,e,i,s,n,r,a,o,h,l)}quad(t,e,i,s,n,r,a,o,h,l,c,u,d){this.enableRenderer(this.shapes),this.shapes.quad(t,e,i,s,n,r,a,o,h,l,c,u,d)}rect(t,e,i,s,n,r){this.enableRenderer(this.shapes),this.shapes.rect(t,e,i,s,n,r)}rectLine(t,e,i,s,n,r,a){this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,i,s,n,r,a)}polygon(t,e,i,s){this.enableRenderer(this.shapes),this.shapes.polygon(t,e,i,s)}circle(t,e,i,s,n,r=0){this.enableRenderer(this.shapes),this.shapes.circle(t,e,i,s,n,r)}curve(t,e,i,s,n,r,a,o,h,l){this.enableRenderer(this.shapes),this.shapes.curve(t,e,i,s,n,r,a,o,h,l)}end(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null}resize(t){let e=this.canvas;var i=window.devicePixelRatio||1,s=Math.round(e.clientWidth*i),n=Math.round(e.clientHeight*i);if(e.width==s&&e.height==n||(e.width=s,e.height=n),this.context.gl.viewport(0,0,e.width,e.height),t===ws.Expand)this.camera.setViewport(s,n);else if(t===ws.Fit){let t=e.width,i=e.height,s=this.camera.viewportWidth,n=this.camera.viewportHeight,r=n/s<i/t?s/t:n/i;this.camera.setViewport(t*r,i*r)}this.camera.update()}enableRenderer(t){this.activeRenderer!==t&&(this.end(),t instanceof ns?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(Hi.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):t instanceof rs?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(Hi.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)}},ws=(t=>(t[t.Stretch=0]="Stretch",t[t.Expand=1]="Expand",t[t.Fit=2]="Fit",t))(ws||{}),ys=0,vs=class{constructor(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.fadeIn=0,this.timeKeeper=new y,this.backgroundColor=new h(.135,.135,.135,1),this.tempColor=new h,this.renderer=t,this.timeKeeper.maxDelta=9,!ds){let t=navigator.userAgent.indexOf("Safari")>-1,e=()=>ys++;(ds=new Image).src=As,t||(ds.crossOrigin="anonymous"),ds.onload=e,(us=new Image).src=bs,t||(us.crossOrigin="anonymous"),us.onload=e}}dispose(){var t,e;null==(t=this.logo)||t.dispose(),null==(e=this.spinner)||e.dispose()}draw(t=!1){if(ys<2||t&&this.fadeOut>1)return;this.timeKeeper.update();let e=Math.abs(Math.sin(this.timeKeeper.totalTime+.25));this.angle-=200*this.timeKeeper.delta*(1+1.5*Math.pow(e,5));let i=this.tempColor,s=this.renderer,n=s.canvas,r=s.context.gl;if(s.resize(1),s.camera.position.set(n.width/2,n.height/2,0),s.batcher.setBlendMode(r.ONE,r.ONE,r.ONE_MINUS_SRC_ALPHA),t){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>1)return;i.setFromColor(this.backgroundColor),e=1-this.fadeOut/1,e=1-(e-1)*(e-1),i.a*=e,i.a>0&&(s.camera.zoom=1,s.begin(),s.quad(!0,0,0,n.width,0,n.width,n.height,0,n.height,i,i,i,i),s.end())}else this.fadeIn+=this.timeKeeper.delta,this.backgroundColor.a>0&&(r.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),r.clear(r.COLOR_BUFFER_BIT)),e=1;e*=Math.min(this.fadeIn/1,1),i.set(e,e,e,e),this.logo||(this.logo=new Ai(s.context,ds),this.spinner=new Ai(s.context,us)),s.camera.zoom=Math.max(1,163/n.height),s.begin(),s.drawTexture(this.logo,(n.width-165)/2,(n.height-108)/2,165,108,i),this.spinner&&s.drawTextureRotated(this.spinner,(n.width-163)/2,(n.height-163)/2,163,163,81.5,81.5,this.angle,i),s.end()}},bs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZxvaQW6vZzto7MYnQIpNkf7kp5EuozYUroqEjcNKHHd0Tl9mBPN1pk+hFeieGBnBtog7UXjsj9pWg+m6duecw2cay1OC/uxMC47KmP9OIYfoz1YoC20J/rzRG4quTZK2EAyJGs20qwUbYw0aNRmUxtvfUW/uEtNzc1NB1/X8LVyd15hh82F43AvD+VlXcsSJEZa1CQ3ejleAO7oxR3RDP0XN91X4+NXYb8nkv7UNTwV7e0YTdu7I3g33t7tuaEbNwSZpps2fSyvs4M2Tjhot+jb0Xzbltj8r5j/xVt/6Z1Ob93U1ZYO691EhhzchcHeXosVjcNZysyezLw4xRZt05R+fTeuj8vOj+zKyG0j2aZcVVs6v+QalnjrMFZASQYl2nBoSyz06e3j/Xk8rgWYmMvEICu2pm1HOTuc7okV8FgRj0XukwzanhvCc/F+72TjoQjdObN1OFuDLmh0xP+WHtxiI10ukJlCprb4guiv1fP+avZrS1C7NAkliHZjDtZwMMgqbukAltpMlwuMy2FcEBPqvfLLar5Uqi0hBdEwryy+Mv5n6zkbjTBa+dlMlwvUZFETZKGiFM7tvbhdJ3gSVRO0wzIjnxmvl/J6a6JsGMYGrahtpssFeqbR841S3mhN80OjOaSDEdqd6SjaMKgzgzRK7q1ib3PT9sYyNo7JZoyNFNvRcVMZmy7WOvIuryv/Zvdmdt90+nY0bRp3AvROohFwdwW7dTG7RFlbwlqdrbOBYg005NAQmZU0HWt1rXMBH1Xw0dQ8pmqzoaPmdhun7bHZjNVe9qP9eFQfO1VkUmHjhAVUZ1GtnKFSbjrkrPfy4i4UW5t/6ZxM54J0CqxFe81KpGsQyE4h23oYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjLna+bdOy+IiFquIpGq16Pb79cNYv3IIK/X/ugx+Ui6TVKvYVU9Nc8gX8od8Ir/IN/KPfCQ/yVfyl/6/pfJvLChkQdD6wyqntquCXYuKWJSfRr6D0dEAxV3xlw/khyD+kd/ku/88cHo+09tS3LBpO1HHCVUqcIA6CqB4K+6X6x35L/JM2loXurlWmUmlA5XogOIcK8/If5HncrSWo7F6cKIWPjT/RXGOlWfkv8hzaWsN4uaaysE6WIkOKM6x8oz8F3kusXqo2vxC5jtYiQ4ozrH0TeS5qIZcrB7qkrwdA8U5Vp6R/yLPZV8V+2L14Cl5THGwEh1QnGPlGfkv8lyUlIzFQ1cNYVVHrcjZ0VCcFe9Y+Eb+izy3ceclUl43aFN52DXXssYpnY6a4qFS8ZcP2uIf+e7inRh6pdFrdTGrm8uiHx/L8T2V7NGWzvJBLJ/bl7mTuzO5qBNFDoiJID/IF/KHfCK/yDfyT3O7d/KbfNfS80hNIrU0g9L6HOq1x5iTQo6FNpeLfCQ/yVfyl3xmXYwxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHNk9z4JwJ0SqKTdQkbyEwhU393T6V7zzR6pieR3tE1ITeVXImhe6BXDGZFdRbVeank2TBhcaEMr0rwbixj49IBLL2/L/ffmMuNHfqO9tFZjJYBd1ewO3Lx+IcVfKhqna5nHZYR6XFPH+5R3eeI5t9fx/fvjeC9Jdew5OKZKqFR/RDVKL6vL/f9PJafmyvHsL+a/ff24V6NmjZQbGchVbY6UM2BluqHv1rCqzVZ1KQlkZboepCdQvacPsz5bjTfXao+yMEaDt7Wk9tSIMVGig3TejCtJSM2bSpkPjWPqd1S6Zao+lORSYWmgkOjORRNwZqd5ezMSiHLRooNr5XwWjS6/1XHX9vL2T67N7M1iyXa9JCrYjVrS1gbpJyw6hBfsmiNCYT0P9/A+Wj1/6qGr5YNYFlJBiWJogEzezLz/ZG8/9s4fgtSyuvNYbyp1IONFBtu7sHNv4/j9yAxUHWrdaWsG9+N8XHd+YxkMpSy+aySz841cC5oXbmHCnnI74yxAgZ3YbDeB4PEQCOpBpFNZWwa2ZWRcdnxLsl00crtRB0n2lLg8JNRfDKoM4NsolgBSmw/UMADba1+qpmqfyf6x1u/0a/og3I+aEunP6/i86osqmygcGarF4p54dex/Bo0LqfqOfVwIQ/HW5/RSkwV1oN2WLlHTc82TljAwM4M1O5LWwYKZTjibYXNS0N5KcjKTe10PadfLObFuJwK4ozp+UzXDBTUjL+M5ZcBnRkQV53dMIwNQTu6bSTbVEzbi5awuVByd2E/FgaN0Tc1fKOzBHHV2aAdVSdv6s5NNkp7cSH/++xAng2yyHx+CM/H21YhfdPp+0U1X0TbSZnXx8faG9Aop0MS0cToh1p+iLcpOkLj9t/JOk5eqoPHxnDsyf486an5yqCDK7XZ1O4oZ4dWyy3FSXHUAYq47uyYbMZoGmhpG3DlEFb6uNiVBhpyaHhnBO8oJmfqOROJjzIiP43hJ8UxITqqX56S2Hur2KsOnq3nrE6PPNKPRwrSKbAZrjTQNZmuE7oxYXMZmxWbw9dxWFu4W4ezVedOE6qzI7oyYkY+M7TPeWsPbk2UX1qioSN+E3OZqOR2cReKE+qQRFN0Pi7y73g/UawU1KzezJpXwLz5hczX1ueUPKYkNb6GJQZ+j7/aAfRZREsv+quGsMoamXZBW2Gt5eU0alorEzYsKmJRa/m4NdeyxlqZsCGa84DKnVorEzboC7podis69DfIJmwufHMc7famvvmxZiYsKOtKWbRm1OcW1syEBboSJFozLh/EcmtmwgIluaM14/phrLdmJixYXMTiaM24p5I91syEBTphFOR7Y2tmwgJNvUFOr+tov3UzoaAv44KYUatv62ZCoemdhtG0+hzqrZsJBR08DWLG0gxKrZu50qvpxos3U5NItW4mFPp1ot+lPlpq2lYXs9qamVBZUMiC1ox4pJYjvlfStAu6GmTLcLboMtPIV4/6im5fFfuUi9QIap2MiWP+D96R1vPmsD/fAAAAAElFTkSuQmCC",As="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAABsCAYAAAALzHKmAAAQ7klEQVR42u3da4xdVRUA4D0zd2Y6nZY59DVtZ1puS9+lzC0YAi2UQ8AAQczFpPgA9VIeIQbirRqJ0cBUBVGjDr/QCKSNRSMmpuODxAdxqhgwxkhFjf6Sxh/+UUNVNGJCzR7uTvas7LXX2q9zzp3em6y0gTN3Zu75utZe5+yztxC9V+/Ve5X9En1Vjd7J6SFbLNF7naPw+l2jh7YHMBWssqMHtlsRdim4qsLtIawaPiHEQOLoNrA9iIkQDnRrVA1qD2LZ8ISoxYqKo13sQAtBWBayQWZUAXGRQM9JjCngDVY0UqJNDbQrMcaGmArdUKpIjbYiQLsCZCyIMQBy8QwnilR4Q5AuCpxFYvRFmBLbEiwKwpsSaWycVQGZBKMrwBjA9BhxDe57u2L2hOoKNCbOrgAZitEVYUxoKSMErQvSxYIzCkguRg5EF4AUhqUlhy/YUKSxcRaKsioYOQhD4I0yYxkR3PcJBcuFysmgsXAWBTMJyBCMIQh9kGGxXIXvexCQXbHGAMrBWTbM2CCpMSMLIxehC77lSJwXGth7M0FzoVJIXXDWQnGmhOkL0ic7YhhtWdGGkAuPAjUWGoF4faCmwBkbZmyUqUCyMqMLRA4+E6IsdTjidUHKBYrh9CnpRcH0ypKxsyOGEYNIIeTCOz91OIJ1QYoB5eAMyZo+MFNnyVTZ0YiRC9EGEMOyAgshxErHsL2XK1gOUgwohtM1a5YNM7Rsu4K0ZkcbRm4mpPBRwFZ5hg9eCqkrUB+csWGGogzNkqEgrdnRhpGLkINudaLgwvVB6oqzCjCTZElb2Y4B0gUjBtEG0ARnDRLjjoG9DwcshtQGlIPTljVjwUySLWNkyRCQVHa0ZUUTRAwgF91a33BEy0VKAcVwwqwZC2bqbOlUurllOxQkJzNyINoAYqjWhYYjWg5SCiiG05Q1U8FMjTIoS8YE6YORi1BHtJ4KIcQEEtTXUWAxpK44YVlPBdO1jCdFWTZIE8bVGEYMIRPcZGBw4HKQcoBiOE1ZMzbMgVQwU6JMAdKEEcuIJogUvg1YCCE2gsCO42DlIIVAKZwpYJaSLVNnSU6XjYHUmxhTmXaFaMO3EYkLqMC+FsLlIoVAKZzMrEnBhJeLfLNlKMrYWRIDCbOkFSSVHbHM6AKRC6/ODUewNqQ+OLlZkxpjUmV8MBbMUJSxyzY3Q1IgTRgxiBRCHdem0KDAUkBh9sRwwjEnAXMMgTnKhFlUtiwkS5rGka4g9SaGgxFmRC7AzTCEEBcyA36dDSsXqAtOLkysjGMwY5XxVChjZ0kuSCo7YlkRQsQQYtDEFsegsLoCxUp7Kpgps2UslFGzJGccSYHUmxhOZqwzEZqAbfUMCisHKIZzgsCpl3MTzMwTpi1bYp2477gyFKUxS7qWbdjY2EBS2dGE0QQRA7gNCyHEdhjE8RhUDlBT9tzgmjWZMFNlSy+Urk1OzCyJlW0XkK4YOQh1cDtcgwBrQmoDWkdgboBZE8mYsJSHlnFbJ+5bwmOPJ7lZkirbC8aRsMvmgtTHjBhGE0QbwJ2egUE1ITVlUC5OmDVdYNrKuN70xM6WoShjlW4464dbtiFIWK6x7GjESEHUUe0iYncnbMdQSE0Z1ITTNOb0hRmjjLtmS9dmJ2rp1jtuKktyyrb6YLEMCUHq2dGG0QQRQ7f72kzc+cJecerne8Wvv7JNPHPvenEkz8Sh3UtFc92QyGt9Yko/HgOLAIUZlItTz5ouMF3KuE+2jFLCQ1D6lm6fLMkBacuOJowYRBUXyfjuHjF3NhdnsfjvAfH6E9vFt9XxKgikEKgJZyyYalzOLeMu2bLbULI6bh+QGwmQ+rgRlumdGEQAao+K56bEL2woVUwOiev0r8OAUjiJrMmFCbvykGxZRAmPitK1dHM7bohyMsuyi/I8f0+e57fJYIKEZXpXo9E4mOf5XTKyLLvCBLETF8uY2SKepkC+dpX4T02Ivepr4HvZcOZ5fmee54fyPL+DmTUhzAs6n4n8bN5dr9f3YdkSg8nsxG0lPBVKVpNjG0/aGhzfLDmRZdnumZmZp8+c+cdZPV555fSr7Xb7s0jJ3i5Pcue4MxKkPPkvvXTqz/B92u32l0wYOzG1fkhcd/py8Rcbyq/vFM/KY1WA95h/3zzP71bfU6JsNpsfgj+P/FlbrdaDGExYyuXvLz8H+DudODH700ajcSM3W6Yu4alQ1spCOTd38jcKocTZbh9+9NixY99XJ8AEUkcpo9W64yH197m5k7+bnZ19QT+J09NHntQhwji/Jg58qi6++ofLxJ8gSFneVw2Ka4QQDfh1Ok4dZavVmtZ/nrm5k7/Vf55O1tRhboUw5+ZOvqyOl5+R/FyOHj32PYVU/tloNG5IXcKrhJIzngwp3fNjomazea/64BuNxts646f50lWv169utw9/DmtqdJQyZFaSJVuV6nq9fqMEof5/vV6/CYBqgJDlee+yAbF/+4i4ZWqZeNfaIfHWzn+Hx0KcEuU9+s8jv3ej0bhVlXOZydX/k0iRMeb8P0D5e6tj8zy/Xb9UJIc56h/yqVOnXul8lmuZ2bJslKmbHG7XrbpCmCXFRLvdfqQD6jTS3Jiy5I4OykM6ADV+1Eu1DmV6evopBORexzDi1L+X/HnGxsb2w3Hm9PSRJ9QxWPOTZdmlKht2hi+w6dkox5bqffI8fye3hDteGqKaHVsHXihKl0tB+h0cY+lute54AGRKDCW89LNTRynHb7ChUWVVjetOnJh9EYBUyPZeNCoOtsbFQwdXi4/esELcd+tq8cCHJ8UXp+viy9efLz7AgamjlKXc1AA1m83DoIRDlFubzeb96hhZLVTlgJ24gttutx+ONa50bHZKRenaeTs1OfpAfnr6yOOdE7EZdNwmlKocntXLNkA5JTGq47Ds+Lf94lWsyfnXleLfnIwJUN4DOnNYwuUxh2A3Ln9XULrfK8t3J27Tu3BVwiOjXJqoAy8UZej1yclGo3GTLN+gu3w+z/P3YaWbQqk3Ne12e4ZC+c8rxWsYytcPiP9RpZxCqWDKnxOiBNlyAUpOnGsoh4tA2Rm8X9xqtT6md5wyZmYe+0YRKL+1S/wYQ3n8zctBl5SBUv5djivfjMOPduIzcizeiYfr9foVvUwZG+XCuzibZKnSceZ5/v4QlKp8y7ElhnJlTeTP7BI/kllRYfzrfvHqFy4UX1vaL/aVlSmROzwbwdS29T2UcEwZF+V8ozM2lu1VY812u/15akypGh3TmFJesJbHHD167IdUxz3YJy5bNySuX1mbvy55CbMLtzU6tjGlsdFptVqfUMc0Go23F4wy1l2dSnbfvpMwVPe9WWVLDsrOJaF9MFu2Wq1PqmNkGce67xiXhTjdNwdlvV6/BgxfbPfBfVCetxi6b9/rlCup65QzM48dl2OjLMv26CibzeZ96sTIzEFdpwQXz9U1yrtVlpR/Zll2Fec65Y6l4pbbx8XHH9kknvzJlPjlHy8Tp29eKT5ou0aJoIT3w3dBlLDzVpfAJEZ1XOdaJZxnOSlvPMjPzxFljIvng914RwebsjYO7uhMyHu46sOfnf3Oz2TXDW6vvYxdFoIXz3Wc8J5zs9n8iOn2IrxTc2BM3Glqdp7dI553uaOjxrhwcob+MyuUpjs6WZZdon8OcigjPx8V+u+GTWFTSWEx3WYcdJ225jNDSE4q0GHCzlueHOyujn6bUWYgeb9ZZUaQPe+GzQ+Gc8+oOGhC+c1d4gfI16n3XDAhQ7+9qE9l01E2Go132GYKyXE1NiFDTcpoNpv3LOYJGWXNErJNW9sEp63p2RKiVPMn1bS1DgxsyhoGdGpmizj+xtXiDYnx7/vFmce3iWdW1cTVGEY4hQ2ZW0nNq8Qm/M6XbXm3S100lwGedFybuvNOibLI+ZS2ceU4eAxiEuvCkfmU8ycToDxETe6FgCBQHeqyAbFvfEhcO7BwDuXFCEbTZF840XeHK0jYcbs2OIGle0mVJ/mmnClEPQqxyTY5I8/zFhif7fSZee4bnrPOU4AssnRXHaVTCTd14dRDY3UbTIiSeFhsN/aMjgnqthFx880rxX3yATL5p3y4LPXzOaBkUyBjZMlYpbtQlIOBD475ZEusjMNSvkXe6VEoJVDkeZ2dzIfIFsRzU+JF2OyM9M9fTC/6SUYOyFQPjQ2nWiUjxnPfw5EeHqMWIqAeIFsAU847lJM2JM6xsewt1OIDLs99P7ZFHNdB/upS8XtPiD7PfLuCXJNolYyyFiNI/Zit65ItrOVafFbHcFohY7hPTN21Tjz4uc3iqfsnxKdX1MTl1OoYRFaMsToGB6Trw2JFP/OdZC2hJZ7ZkrMoAbbSGmelDJ91hFKuJeS7jlBMkJnrAqqJlgMUZS/dArPlGHNdSg5M3xXXtvquuEatvIYtDRhpxbUJuIgqsU5lGWtUploK0KuEU9mSW8YpmFQ556xNuYW7NiW13B+FkMiKHIy+C6eGgBxJvMR0oSv5hi6+z4HJyZoU0M2RVvDlrOQbcxVfX5AhZbuqy0v7ZstYMLHlAVlLTF9ALLbvu9Y5Zylpn/XOsd0ibIvxr2KCLHpp6SCUIdnSZSF+WzfOhem6GD+1KwR3Z4jNjrtDpNoZwmWd8yrupZN6Hx3fbMmFSe0Swdq2ZIPjxk1112Duo8OBGLrBkw/IoncdK2XHsdC9dHz204m50xh3tzFq1zFqtzHXrfCw7OgDsqyNnZLszVijsmXgrmNcmGtS78lIoMX2aJz03fKO2sDJddPQSCDPiQ1DfWBycY6XtXstc2PQKuxgG2McmXTPb9/9vmuJYXKyJrWjbeg+3xPM4O73nWqvbyw7xgZZSJbEUBa157cNJjdr2vb+5iA1YV3HxYscj30PDCEHIgcjtfm8K8hSsmRotkwFk5s1TTghUAopB6xrjHMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=",Ms=class{constructor(t,e){this.time=new y,e.pathPrefix||(e.pathPrefix=""),e.app||(e.app={loadAssets:()=>{},initialize:()=>{},update:()=>{},render:()=>{},error:()=>{}}),e.webglConfig&&(e.webglConfig={alpha:!0}),this.htmlCanvas=t,this.context=new yi(t,e.webglConfig),this.renderer=new xs(t,this.context),this.gl=this.context.gl,this.assetManager=new Mi(this.context,e.pathPrefix),this.input=new Wi(t),e.app.loadAssets&&e.app.loadAssets(this);let i=()=>{requestAnimationFrame(i),this.time.update(),e.app.update&&e.app.update(this,this.time.delta),e.app.render&&e.app.render(this)},s=()=>{this.assetManager.isLoadingComplete()?this.assetManager.hasErrors()?e.app.error&&e.app.error(this,this.assetManager.getErrors()):(e.app.initialize&&e.app.initialize(this),i()):requestAnimationFrame(s)};requestAnimationFrame(s)}clear(t,e,i,s){this.gl.clearColor(t,e,i,s),this.gl.clear(this.gl.COLOR_BUFFER_BIT)}};return fs=n,((n,r,a,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let h of i(r))s.call(n,h)||h===a||t(n,h,{get:()=>r[h],enumerable:!(o=e(r,h))||o.enumerable});return n})(t({},"__esModule",{value:!0}),fs)})();t.exports=e}).call(window)},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(0),n=i(11),r=i(212),a=i(7),o=i(224),h=i(225),l=i(226),c=new s({Extends:h,initialize:function(t,e,i,s,r,c,u){var d,f,p,m=[],g=t.cacheManager.custom.spine;if(a(e)){var x=e;for(e=n(x,"key"),f=new o(t,{key:e,url:n(x,"jsonURL"),extension:n(x,"jsonExtension","json"),xhrSettings:n(x,"jsonXhrSettings")}),s=n(x,"atlasURL"),r=n(x,"preMultipliedAlpha"),Array.isArray(s)||(s=[s]),d=0;d<s.length;d++)(p=new l(t,{key:e+"!"+d,url:s[d],extension:n(x,"atlasExtension","atlas"),xhrSettings:n(x,"atlasXhrSettings")})).cache=g,m.push(p)}else for(f=new o(t,e,i,c),Array.isArray(s)||(s=[s]),d=0;d<s.length;d++)(p=new l(t,e+"!"+d,s[d],u)).cache=g,m.push(p);m.unshift(f),h.call(this,t,"spine",e,m),this.config.preMultipliedAlpha=r},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"text"===t.type)){for(var e=t.data.split("\n"),i=[e[0]],s=0;s<e.length;s++){var a=e[s];""===a.trim()&&s<e.length-1&&(a=e[s+1],i.push(a))}var o=this.config,h=this.loader,l=h.baseURL,c=h.path,u=h.prefix,d=n(o,"baseURL",this.baseURL),f=n(o,"path",t.src.match(/^.*\//))[0],p=n(o,"prefix",this.prefix),m=n(o,"textureXhrSettings");h.setBaseURL(d),h.setPath(f),h.setPrefix(p);for(var g=0;g<i.length;g++){var x=i[g],w=new r(h,x,x,m);h.keyExists(w)||(this.addToMultiFile(w),h.addFile(w))}h.setBaseURL(l),h.setPath(c),h.setPrefix(u)}},addToCache:function(){if(this.isReadyToProcess()){var t;this.files[0].addToCache();for(var e="",i="",s=!!this.config.preMultipliedAlpha,n=this.loader.textureManager,r=1;r<this.files.length;r++){var a=this.files[r];if("text"===a.type)e=a.key.replace(/![\d]$/,""),t=a.cache,i=i.concat(a.data);else{var o=a.key.trim(),h=o.indexOf("!"),l=o.substr(h+1);n.exists(l)||n.addImage(l,a.data)}a.pendingDestroy()}t.add(e,{preMultipliedAlpha:s,data:i,prefix:this.prefix}),this.complete=!0}}});t.exports=c},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(7),l=i(48),c=new s({Extends:r,initialize:function t(e,i,s,n,a){var l,c="png";if(h(i)){var u=i;i=o(u,"key"),s=o(u,"url"),l=o(u,"normalMap"),n=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:s,xhrSettings:n,config:a};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,a);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});a.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new c(this,t[s]));else this.addFile(new c(this,t,e,i));return this})),t.exports=c},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="addfile"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="complete"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="filecomplete"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="filecomplete-"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="loaderror"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="load"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="fileprogress"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="postprocess"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="progress"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="start"},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(49);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(10),l=i(7),c=new s({Extends:r,initialize:function(t,e,i,s,a){var c="json";if(l(e)){var u=e;e=o(u,"key"),i=o(u,"url"),s=o(u,"xhrSettings"),c=o(u,"extension",c),a=o(u,"dataKey",a)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:s,config:a};r.call(this,t,d),l(i)&&(this.data=a?h(i,a):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new c(this,t[n]));else this.addFile(new c(this,t,e,s,i));return this})),t.exports=c},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(12),r=i(47),a=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a<r.length;a++)r[a].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&(this.failed++,console.error('File failed: %s "%s" (via %s "%s")',this.type,this.key,t.type,t.key))},pendingDestroy:function(){if(this.state!==n.FILE_PENDING_DESTROY){var t=this.key,e=this.type;this.loader.emit(r.FILE_COMPLETE,t,e),this.loader.emit(r.FILE_KEY_COMPLETE+e+"-"+t,t,e),this.loader.flagForRemoval(this);for(var i=0;i<this.files.length;i++)this.files[i].pendingDestroy();this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.files=null,this.config=null}});t.exports=a},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(12),r=i(24),a=i(25),o=i(11),h=i(7),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",a="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=o(c,"key"),i=o(c,"url"),s=o(c,"xhrSettings"),a=o(c,"extension",a),n=o(c,"type",n),l=o(c,"cache",l)}var u={type:n,cache:l,extension:a,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(31),n=i(1),r=i(0),a=i(51),o=i(52),h=i(53),l=i(54),c=i(55),u=i(56),d=i(8),f=i(21),p=i(57),m=i(9),g=i(249),x=i(256),w=new r({Extends:p,Mixins:[a,o,h,l,c,u,x],initialize:function(t,e,i,s,n,r,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=-1,this.setPosition(i,s),n&&this.setSkeleton(n,r,a)},willRender:function(t,e){var i=!this.skeleton||!(15!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id);if(!e&&!i&&this.parentContainer){var s=this.plugin,n=s.sceneRenderer;s.gl&&n.batcher.isDrawing&&(n.end(),s.renderer.pipelines.rebind())}return i},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var i=this.findSlot(e);i&&(i.color.a=n(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=n(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var i=(t>>16&255)/255,s=(t>>8&255)/255,n=(255&t)/255,r=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=i,a.color.g=s,a.color.b=n,null!==r&&(a.color.a=r),this},setSkeletonFromJSON:function(t,e,i,s){return this.setSkeleton(t,e,i,s)},setSkeleton:function(t,e,i,s){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var n=this.plugin.createSkeleton(t,s);this.skeletonData=n.skeletonData,this.preMultipliedAlpha=n.preMultipliedAlpha;var r=n.skeleton;return r.setSkin(),r.setToSetupPose(),this.skeleton=r,n=this.plugin.createAnimationState(r),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=n.state,this.stateData=n.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(d(this.rotation))+90),this.state.apply(r),r.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(d(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,s){var n=this.skeleton;return void 0===t&&(t=n.data.width),void 0===e&&(e=n.data.height),void 0===i&&(i=0),void 0===s&&(s=0),this.width=t,this.height=e,this.displayOriginX=n.x-i,this.displayOriginY=n.y-s,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,s=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var n=this.getBounds();return this.width=n.size.x,this.height=n.size.y,this.displayOriginX=this.x-n.offset.x,this.displayOriginY=this.y-(e-(this.height+n.offset.y)),t.scaleX=i,t.scaleY=s,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i<e.bones.length;i++)t.push(e.bones[i].name);return t},getSkinList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i<e.skins.length;i++)t.push(e.skins[i].name);return t},getSlotList:function(){for(var t=[],e=this.skeleton,i=0;i<e.slots.length;i++)t.push(e.slots[i].data.name);return t},getAnimationList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i<e.animations.length;i++)t.push(e.animations[i].name);return t},getCurrentAnimation:function(t){void 0===t&&(t=0);var e=this.state.getCurrent(t);if(e)return e.animation},play:function(t,e,i){return this.setAnimation(0,t,e,i),this},setAnimation:function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),s&&this.state){var n=this.state.getCurrent(t);if(n&&n.animation.name===e&&!n.isComplete())return}if(this.findAnimation(e))return this.state.setAnimation(t,e,i)},addAnimation:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=0),this.state.addAnimation(t,e,i,s)},setEmptyAnimation:function(t,e){return this.state.setEmptyAnimation(t,e)},clearTrack:function(t){return this.state.clearTrack(t),this},clearTracks:function(){return this.state.clearTracks(),this},setSkinByName:function(t){var e=this.skeleton;return e.setSkinByName(t),e.setSlotsToSetupPose(),this.state.apply(e),this},setSkin:function(t){var e=this.skeleton;return e.setSkin(t),e.setSlotsToSetupPose(),this.state.apply(e),this},setMix:function(t,e,i){return this.stateData.setMix(t,e,i),this},getAttachment:function(t,e){return this.skeleton.getAttachment(t,e)},getAttachmentByName:function(t,e){return this.skeleton.getAttachmentByName(t,e)},setAttachment:function(t,e){if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length)for(var i=0;i<t.length;i++)this.skeleton.setAttachment(t[i],e[i]);else this.skeleton.setAttachment(t,e);return this},setToSetupPose:function(){return this.skeleton.setToSetupPose(),this},setSlotsToSetupPose:function(){return this.skeleton.setSlotsToSetupPose(),this},setBonesToSetupPose:function(){return this.skeleton.setBonesToSetupPose(),this},getRootBone:function(){return this.skeleton.getRootBone()},angleBoneToXY:function(t,e,i,r,a,o){void 0===r&&(r=0),void 0===a&&(a=0),void 0===o&&(o=360);var h=this.plugin.renderer.height,l=d(s(t.worldX,h-t.worldY,e,i)+f(r));return t.rotation=n(m(l),a,o),this},findBone:function(t){return this.skeleton.findBone(t)},findBoneIndex:function(t){return this.skeleton.findBoneIndex(t)},findSlot:function(t){return this.skeleton.findSlot(t)},findSlotIndex:function(t){return this.skeleton.findSlotIndex(t)},findSkin:function(t){return this.skeletonData.findSkin(t)},findEvent:function(t){return this.skeletonData.findEvent(t)},findAnimation:function(t){return this.skeletonData.findAnimation(t)},findIkConstraint:function(t){return this.skeletonData.findIkConstraint(t)},findTransformConstraint:function(t){return this.skeletonData.findTransformConstraint(t)},findPathConstraint:function(t){return this.skeletonData.findPathConstraint(t)},findPathConstraintIndex:function(t){return this.skeletonData.findPathConstraintIndex(t)},getBounds:function(){return this.plugin.getBounds(this.skeleton)},preUpdate:function(t,e){var i=this.skeleton;this.state.update(e/1e3*this.timeScale),this.state.apply(i)},preDestroy:function(){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.plugin=null,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null}});t.exports=w},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(229),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++)i.push(e[t[s]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,s=this.list,r=this.events,a=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return s[t]},set:function(e){if(!i._frozen){var o=s[t];s[t]=e,r.emit(n.CHANGE_DATA,a,t,e,o),r.emit(n.CHANGE_DATA_KEY+t,a,e,o)}}}),s[t]=e,r.emit(n.SET_DATA,a,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],s=1;s<arguments.length;s++)i.push(arguments[s]);for(var n in this.list)i[1]=n,i[2]=this.list[n],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(n.CHANGE_DATA),this.events.off(n.SET_DATA),this.events.off(n.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=r},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={CHANGE_DATA:i(230),CHANGE_DATA_KEY:i(231),DESTROY:i(232),REMOVE_DATA:i(233),SET_DATA:i(234)}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="changedata"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="changedata-"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="destroy"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="removedata"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="setdata"},function(t,e,i){"use strict";var s=Object.prototype.hasOwnProperty,n="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new a(i,s||t,r),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)s.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,r=i.length,a=new Array(r);s<r;s++)a[s]=i[s].fn;return a},l.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},l.prototype.emit=function(t,e,i,s,r,a){var o=n?n+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,s),!0;case 5:return c.fn.call(c.context,e,i,s,r),!0;case 6:return c.fn.call(c.context,e,i,s,r,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,s);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},l.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,i,s){var r=n?n+t:t;if(!this._events[r])return this;if(!e)return h(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||s&&!a.once||i&&a.context!==i||h(this,r);else{for(var o=0,l=[],c=a.length;o<c;o++)(a[o].fn!==e||s&&!a[o].once||i&&a[o].context!==i)&&l.push(a[o]);l.length?this._events[r]=1===l.length?l[0]:l:h(this,r)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&h(this,e)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,t.exports=l},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="addedtoscene"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="destroy"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="removedfromscene"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="complete"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="created"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="error"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="loop"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="play"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="seeked"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="seeking"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="stop"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="timeout"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="unlocked"},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={COMPLETE:i(250),DISPOSE:i(251),END:i(252),EVENT:i(253),INTERRUPTED:i(254),START:i(255)}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="complete"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="dispose"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="end"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="event"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="interrupted"},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports="start"},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(2),n=i(2),r=i(2);s=i(257),r=i(258),n=i(259),t.exports={renderWebGL:s,renderCanvas:n,renderDirect:r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(1),n=i(8),r=i(60),a=i(9),o=i(6);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.newType&&(t.pipelines.clear(),d.begin());var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=y}t.nextTypeMatch||(d.end(),t.pipelines.rebind())}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(1),n=i(8),r=i(60),a=i(9),o=i(6);t.exports=function(t,e,i,h,l){var c=e.plugin,u=e.skeleton,d=c.sceneRenderer;t.pipelines.clear(),d.begin();var f=e.scrollFactorX,p=e.scrollFactorY,m=u.color.a;l&&(e.scrollFactorX=l.scrollFactorX,e.scrollFactorY=l.scrollFactorY,u.color.a=s(m*l.alpha,0,1)),i.addToRenderList(e);var g=r(e,i,h).calc,x=t.height;if(u.x=g.tx,u.y=x-g.ty,u.scaleX=g.scaleX,u.scaleY=g.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=o(a(g.rotationNormalized)-180,0,360)):e.root.rotation=o(a(n(g.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*a(g.rotationNormalized):e.root.rotation+=2*a(g.rotationNormalized)),u.updateWorldTransform(),d.drawSkeleton(u,e.preMultipliedAlpha),l&&(e.scrollFactorX=f,e.scrollFactorY=p,u.color.a=m),c.drawDebug||e.drawDebug){var w=u.x,y=u.y;u.x=0,u.y=0,d.drawSkeletonDebug(u,e.preMultipliedAlpha),u.x=w,u.y=y}d.end(),t.pipelines.rebind()}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(8),n=i(9),r=i(6);t.exports=function(t,e,i,a){var o=t.currentContext,h=e.plugin,l=e.skeleton,c=h.skeletonRenderer,u=t._tempMatrix1,d=t._tempMatrix2,f=t._tempMatrix3;i.addToRenderList(e),d.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),u.copyFrom(i.matrix),a?(u.multiplyWithOffset(a,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),d.e=e.x,d.f=e.y,u.multiply(d,f)):(d.e-=i.scrollX*e.scrollFactorX,d.f-=i.scrollY*e.scrollFactorY,u.multiply(d,f)),l.x=f.tx,l.y=f.ty,l.scaleX=f.scaleX,l.scaleY=-1*f.scaleY,e.scaleX<0?(l.scaleX*=-1,e.root.rotation=n(f.rotationNormalized)):e.root.rotation=r(n(s(f.rotationNormalized))+90,0,360),e.scaleY<0&&(l.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*n(f.rotationNormalized):e.root.rotation+=2*n(f.rotationNormalized)),i.renderToTexture&&(l.y=f.ty,l.scaleY*=-1),l.updateWorldTransform(),c.ctx=o,c.debugRendering=h.drawDebug||e.drawDebug,o.save(),c.draw(l),o.restore()}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var s=i(0),n=i(261),r=i(347),a=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r){n.call(this,t,i,s,r),this.type="Spine",this.plugin=e},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null,this.plugin=null}});t.exports=a},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @author Felipe Alfonso <@bitnenfer>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(262),n=i(15),r=i(0),a=i(313),o=i(59),h=i(57),l=i(29),c=i(343),u=i(346),d=i(3),f=new r({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.Pipeline,a.Transform,a.Visible,c],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r<i.length;r++){var a=i[r];a.getBounds&&(a.getBounds(s),n?u(s,t,t):(t.setTo(s.x,s.y,s.width,s.height),n=!0))}}return t},addHandler:function(t){t.once(o.DESTROY,this.remove,this),this.exclusive&&(t.parentContainer&&t.parentContainer.remove(t),t.parentContainer=this,t.removeFromDisplayList(),t.addedToScene())},removeHandler:function(t){t.off(o.DESTROY,this.remove,this),this.exclusive&&(t.parentContainer=null,t.removedFromScene(),t.addToDisplayList())},pointToContainer:function(t,e){void 0===e&&(e=new d),this.parentContainer?this.parentContainer.pointToContainer(t,e):(e.x=t.x,e.y=t.y);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return s.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return s.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),s.StableSort(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e,i,n){return s.CountAllMatching(this.list,t,e,i,n)},swap:function(t,e){return s.Swap(this.list,t,e),this},moveTo:function(t,e){return s.MoveTo(this.list,t,e),this},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e),this},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e),this},remove:function(t,e){var i=s.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var n=0;n<i.length;n++)i[n].destroy()}return this},removeAt:function(t,e){var i=s.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var n=s.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var r=0;r<n.length;r++)n[r].destroy();return this},removeAll:function(t){var e=this.list;if(t){for(var i=0;i<e.length;i++)e[i]&&e[i].scene&&(e[i].off(o.DESTROY,this.remove,this),e[i].destroy());this.list=[]}else s.RemoveBetween(e,0,e.length,this.removeHandler,this);return this},bringToTop:function(t){return s.BringToTop(this.list,t),this},sendToBack:function(t){return s.SendToBack(this.list,t),this},moveUp:function(t){return s.MoveUp(this.list,t),this},moveDown:function(t){return s.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e,i){return s.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i<arguments.length;i++)s.push(arguments[i]);for(i=0;i<r;i++)s[0]=n[i],t.apply(e,s);return this},iterate:function(t,e){var i,s=[null];for(i=2;i<arguments.length;i++)s.push(arguments[i]);for(i=0;i<this.list.length;i++)s[0]=this.list[i],t.apply(e,s);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(s.SetAll(this.list,"scrollFactorX",t),s.SetAll(this.list,"scrollFactorY",e)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Matrix:i(263),Add:i(272),AddAt:i(273),BringToTop:i(274),CountAllMatching:i(275),Each:i(276),EachInRange:i(277),FindClosestInSorted:i(278),Flatten:i(279),GetAll:i(280),GetFirst:i(281),GetRandom:i(282),MoveDown:i(283),MoveTo:i(284),MoveUp:i(285),MoveAbove:i(286),MoveBelow:i(287),NumberArray:i(288),NumberArrayStep:i(289),QuickSelect:i(290),Range:i(291),Remove:i(292),RemoveAt:i(293),RemoveBetween:i(294),RemoveRandomElement:i(295),Replace:i(296),RotateLeft:i(62),RotateRight:i(63),SafeRange:i(5),SendToBack:i(297),SetAll:i(298),Shuffle:i(64),SortByDigits:i(299),SpliceOne:i(13),StableSort:i(300),Swap:i(312)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={CheckMatrix:i(27),MatrixToString:i(264),ReverseColumns:i(266),ReverseRows:i(267),Rotate180:i(268),RotateLeft:i(269),RotateMatrix:i(17),RotateRight:i(270),Translate:i(271),TransposeMatrix:i(61)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(265),n=i(27);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i<t.length;i++){for(var r=0;r<t[i].length;r++){var a=t[i][r].toString();e+="undefined"!==a?s(a,2):"?",r<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var o=0;o<t[i].length;o++)e+="---",o<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e){t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(17);t.exports=function(t){return s(t,180)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(17);t.exports=function(t){return s(t,90)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(17);t.exports=function(t){return s(t,-90)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(62),n=i(63);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r<t.length;r++){var a=t[r];e<0?s(a,Math.abs(e)):n(a,e)}return t}},function(t,e){t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.splice(a,1),a--;if(0===(a=e.length))return null;i>0&&a>r&&(e.splice(r),a=r);for(var o=0;o<a;o++){var h=e[o];t.push(h),s&&s.call(n,h)}return e}},function(t,e){t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var a=s-t.length;if(a<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.pop(),o--;if(0===(o=e.length))return null;s>0&&o>a&&(e.splice(a),o=a);for(var h=o-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=0;if(s(t,n,r))for(var o=n;o<r;o++){t[o][e]===i&&a++}return a}},function(t,e){t.exports=function(t,e,i){var s,n=[null];for(s=3;s<arguments.length;s++)n.push(arguments[s]);for(s=0;s<t.length;s++)n[0]=t[s],e.apply(i,n);return t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var a,o=[null];for(a=5;a<arguments.length;a++)o.push(arguments[a]);for(a=n;a<r;a++)o[0]=t[a],e.apply(i,o)}return t}},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(t<e[0][i])return e[0];for(;e[r][i]<t;)r++}else for(;e[r]<t;)r++;return r>e.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i=function(t,e){void 0===e&&(e=[]);for(var s=0;s<t.length;s++)Array.isArray(t[s])?i(t[s],e):e.push(t[s]);return e};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var a=[];if(s(t,n,r))for(var o=n;o<r;o++){var h=t[o];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&a.push(h)}return a}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a<r;a++){var o=t[a];if(!e||e&&void 0===i&&o.hasOwnProperty(e)||e&&void 0!==i&&o[e]===i)return o}return null}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-1){var s=t[i+1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s<n||(t.splice(s,1),0===n?t.unshift(e):t.splice(n,0,e)),t}},function(t,e){t.exports=function(t,e,i,s){var n,r=[],a=!1;if((i||s)&&(a=!0,i||(i=""),s||(s="")),e<t)for(n=t;n>=e;n--)a?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)a?r.push(i+n.toString()+s):r.push(n);return r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(43);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),a=0;a<r;a++)n.push(t),t+=i;return n}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
function i(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function s(t,e){return t<e?-1:t>e?1:0}var n=function(t,e,r,a,o){for(void 0===r&&(r=0),void 0===a&&(a=t.length-1),void 0===o&&(o=s);a>r;){if(a-r>600){var h=a-r+1,l=e-r+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*u/h+d)),p=Math.min(a,Math.floor(e+(h-l)*u/h+d));n(t,e,f,p,o)}var m=t[e],g=r,x=a;for(i(t,r,e),o(t[a],m)>0&&i(t,r,a);g<x;){for(i(t,g,x),g++,x--;o(t[g],m)<0;)g++;for(;o(t[x],m)>0;)x--}0===o(t[r],m)?i(t,r,x):i(t,++x,a),x<=e&&(r=x+1),e<=x&&(a=x-1)}};t.exports=n},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(10),n=i(64),r=function(t,e,i){for(var s=[],n=0;n<t.length;n++)for(var r=0;r<e.length;r++)for(var a=0;a<i;a++)s.push({a:t[n],b:e[r]});return s};t.exports=function(t,e,i){var a=s(i,"max",0),o=s(i,"qty",1),h=s(i,"random",!1),l=s(i,"randomB",!1),c=s(i,"repeat",0),u=s(i,"yoyo",!1),d=[];if(l&&n(e),-1===c)if(0===a)c=0;else{var f=t.length*e.length*o;u&&(f*=2),c=Math.ceil(a/f)}for(var p=0;p<=c;p++){var m=r(t,e,o);h&&n(m),d=d.concat(m),u&&(m.reverse(),d=d.concat(m))}return a&&d.splice(a),d}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(13);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var a=e.length-1,o=[];a>=0;){var h=e[a];-1!==(r=t.indexOf(h))&&(s(t,r),o.push(h),i&&i.call(n,h)),a--}return o}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(13);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var a=i-e,o=t.splice(e,a);if(n)for(var h=0;h<o.length;h++){var l=o[h];n.call(r,l)}return o}return[]}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(13);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},function(t,e){t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(5);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var a=n;a<r;a++){var o=t[a];o.hasOwnProperty(e)&&(o[e]=i)}return t}},function(t,e){t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @author Angry Bytes (and contributors)
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(301);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,a,o,h,l=t.length,c=0,u=2*i;for(n=0;n<l;n+=u)for(a=(r=n+i)+i,r>l&&(r=l),a>l&&(a=l),o=n,h=r;;)if(o<r&&h<a)e(t[o],t[h])<=0?s[c++]=t[o++]:s[c++]=t[h++];else if(o<r)s[c++]=t[o++];else{if(!(h<a))break;s[c++]=t[h++]}}t.exports=function(t,e){if(void 0===e&&(e=n),!t||t.length<2)return t;if(s.features.stableSort)return t.sort(e);var i=function(t,e){var i=t.length;if(i<=1)return t;for(var s=new Array(i),n=1;n<i;n*=2){r(t,e,n,s);var a=t;t=s,s=a}return t}(t,e);return i!==t&&r(i,null,t.length,t),t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={os:i(28),browser:i(18),features:i(303),input:i(307),audio:i(308),video:i(309),fullscreen:i(310),canvasFeatures:i(311)}},function(t,e){var i,s,n=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{s="function"==typeof clearTimeout?clearTimeout:a}catch(t){s=a}}();var h,l=[],c=!1,u=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):u=-1,l.length&&f())}function f(){if(!c){var t=o(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++u<e;)h&&h[u].run();u=-1,e=l.length}h=null,c=!1,function(t){if(s===clearTimeout)return clearTimeout(t);if((s===a||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(t);try{s(t)}catch(e){try{return s.call(null,t)}catch(e){return s.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||c||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(28),n=i(18),r=i(65),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,o=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return o=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(a.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(a.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&o,a}()},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s={VERSION:"3.60.0-beta.18",BlendModes:i(15),ScaleModes:i(305),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i,s="";t.exports={disable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!1),t},enable:function(t){return""===s&&(s=i(t)),s&&(t[s]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},isEnabled:function(t){return null!==s?t[s]:null}}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(18),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(18),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),a=parseInt(RegExp.$2,10);(10===r&&a>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return i;var t=document.createElement("video"),e=!!t.canPlayType,s=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(s,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(s,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType("video/x-m4v").replace(s,"")&&(i.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(s,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(s,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(s,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return i;var t,e="Fullscreen",s="FullScreen",n=["request"+e,"request"+s,"webkitRequest"+e,"webkitRequest"+s,"msRequest"+e,"msRequest"+s,"mozRequest"+s,"mozRequest"+e];for(t=0;t<n.length;t++)if(document.documentElement[n[t]]){i.available=!0,i.request=n[t];break}var r=["cancel"+s,"exit"+e,"webkitCancel"+s,"webkitExit"+e,"msCancel"+s,"msExit"+e,"mozCancel"+s,"mozExit"+e];if(i.available)for(t=0;t<r.length;t++)if(document[r[t]]){i.cancel=r[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(i.keyboard=!0),Object.defineProperty(i,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),i}()},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s,n,r,a=i(65),o={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(o.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=a.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;a.remove(t),o.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),o.supportInverseAlpha=function(){var t=a.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return a.remove(this),s}()),o)},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
t.exports={Alpha:i(314),AlphaSingle:i(315),BlendMode:i(316),ComputedSize:i(51),Crop:i(317),Depth:i(52),Flip:i(53),FX:i(318),GetBounds:i(319),Mask:i(328),Origin:i(333),PathFollower:i(334),Pipeline:i(337),ScrollFactor:i(54),Size:i(339),Texture:i(340),TextureCrop:i(341),Tint:i(342),ToJSON:i(58),Transform:i(55),TransformMatrix:i(26),Visible:i(56)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(1),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(1),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(15),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={fxPadding:0,setFXPadding:function(t){return void 0===t&&(t=0),this.fxPadding=t,this},onFXCopy:function(){},onFX:function(){}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(29),n=i(42),r=i(3),a={prepareBoundsOutput:function(t,e){(void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer)&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t);return t},getCenter:function(t){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,a,o,h,l;if(void 0===t&&(t=new s),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),a=t.x,o=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),a=t.x,o=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,a,h),t.y=Math.min(i,r,o,l),t.width=Math.max(e,n,a,h)-t.x,t.height=Math.max(i,r,o,l)-t.y,t}};t.exports=a},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(66),n=i(67);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var a=0;a<e;a++){var o=a/e;r.push(s(t,o))}return r}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(323),r=i(324),a=i(30),o=i(326),h=i(3),l=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.type=a.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return o(this,t)},setTo:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(14);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(325),n=i(14);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var a=t.x1,o=t.y1,h=t.x2,l=t.y2,c=0;c<e;c++){var u=c/e,d=a+(h-a)*u,f=o+(l-o)*u;r.push(new n(d,f))}return r}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(14);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(14);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(329),n=i(332),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(330),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(0),n=i(331),r=i(23),a=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(t,e){a.prototype.hasOwnProperty(t)||(a.prototype[t]=e)},a.remove=function(t){a.prototype.hasOwnProperty(t)&&delete a.prototype[t]},n.register("GameObjectFactory",a,"add"),t.exports=a},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={},s={},n={register:function(t,e,s,n){void 0===n&&(n=!1),i[t]={plugin:e,mapping:s,custom:n}},registerCustom:function(t,e,i,n){s[t]={plugin:e,mapping:i,data:n}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return s.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return s[t]},getCustomClass:function(t){return s.hasOwnProperty(t)?s[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){s.hasOwnProperty(t)&&delete s[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in s)s.hasOwnProperty(t)&&delete s[t]}};t.exports=n},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,255),s.stencilOp(s.KEEP,s.KEEP,s.INCR)):(s.stencilFunc(s.EQUAL,r+1,255),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),i?this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r+1,255):s.stencilFunc(s.EQUAL,r+1,255):this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,255):s.stencilFunc(s.EQUAL,r,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(21),n=i(335),r=i(10),a=i(336),o=i(3),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new o(this.x,this.y)),this.pathVector||(this.pathVector=new o),this.pathDelta||(this.pathDelta=new o),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===a.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==a.PLAYING_FORWARD&&e.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,o=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-o;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(338),n=i(13),r={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var a=r.get(t);a&&(this.pipeline=a),e&&(this.pipelineData=i?s(e):e)}return this},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var a=0;a<t.length;a++){var o=r.getPostPipeline(t[a],this);o&&this.postPipelines.push(o)}e&&(this.pipelineData=i?s(e):e)}return this.hasPostPipeline=this.postPipelines.length>0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n<i.length;n++){var r=i[n];(e&&r.name===t||!e&&r instanceof t)&&s.push(r)}return 1===s.length?s[0]:s},resetPipeline:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.pipeline=this.defaultPipeline,t&&(this.postPipelines=[],this.hasPostPipeline=!1),e&&(this.pipelineData={}),null!==this.pipeline},resetPostPipeline:function(t){void 0===t&&(t=!1);for(var e=this.postPipelines,i=0;i<e.length;i++)e[i].destroy();this.postPipelines=[],this.hasPostPipeline=!1,t&&(this.pipelineData={})},removePostPipeline:function(t){for(var e=this.postPipelines,i=e.length-1;i>=0;i--){var s=e[i];("string"==typeof t&&s.name===t||"string"!=typeof t&&s instanceof t)&&(s.destroy(),n(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=r},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i=function(t){var e,s,n;if("object"!=typeof t||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)s=t[n],e[n]=i(s);return e};t.exports=i},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(68),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(68),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},function(t,e){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @author Felipe Alfonso <@bitnenfer>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(2),n=s,r=s;n=i(344),r=i(345),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u<r;u++){var d=n[u];if(d.willRender(i)){var f,p,m,g;if(void 0!==d.alphaTopLeft)f=d.alphaTopLeft,p=d.alphaTopRight,m=d.alphaBottomLeft,g=d.alphaBottomRight;else{var x=d.alpha;f=x,p=x,m=x,g=x}var w=d.scrollFactorX,y=d.scrollFactorY;o||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode);var v=d.mask;v&&v.preRenderWebGL(t,d,i);var b=d.type;b!==t.currentType&&(t.newType=!0,t.currentType=b),t.nextTypeMatch=u<r-1&&n[u+1].type===t.currentType,d.setScrollFactor(w*l,y*c),d.setAlpha(f*h,p*h,m*h,g*h),d.renderWebGL(t,d,i,a,e),d.setAlpha(f,p,m,g),d.setScrollFactor(w,y),v&&v.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c<n.length;c++){var u=n[c];if(u.willRender(i)){var d=u.alpha,f=u.scrollFactorX,p=u.scrollFactorY;a||u.blendMode===t.currentBlendMode||t.setBlendMode(u.blendMode),u.setScrollFactor(f*h,p*l),u.setAlpha(d*o),u.renderCanvas(t,u,i,r),u.setAlpha(d),u.setScrollFactor(f,p)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013-2023 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(29);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),a=Math.max(t.right,e.right)-n,o=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,a,o)}},function(t,e,i){
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2022 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var s=i(2),n=i(2);s=i(348),n=i(349),t.exports={renderWebGL:s,renderCanvas:n}},function(t,e){t.exports=function(t,e,i,s){var n=e.plugin.sceneRenderer,r=e.list;if(0!==r.length){i.addToRenderList(e);var a=e.localTransform;s?(a.loadIdentity(),a.multiply(s),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.newType&&(t.pipelines.clear(),n.begin());var o=t.nextTypeMatch;t.nextTypeMatch=!0,t.newType=!1;for(var h=0;h<r.length;h++){var l=r[h];if(l.willRender(i,e)){var c=l.mask;c&&(n.end(),t.pipelines.rebind(),c.preRenderWebGL(t,l,i),t.pipelines.clear(),n.begin()),l.renderWebGL(t,l,i,a,e),c&&(n.end(),t.pipelines.rebind(),c.postRenderWebGL(t,i),t.pipelines.clear(),n.begin())}}t.nextTypeMatch=o,o||(n.end(),t.pipelines.rebind())}else n.batcher.isDrawing&&t.finalType&&(n.end(),t.pipelines.rebind())}},function(t,e){t.exports=function(t,e,i,s){var n=e.list;if(0!==n.length){i.addToRenderList(e);var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);var o=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c<n.length;c++){var u=n[c];if(u.willRender(i)){var d=u.alpha,f=u.scrollFactorX,p=u.scrollFactorY;a||u.blendMode===t.currentBlendMode||t.setBlendMode(u.blendMode),u.setScrollFactor(f*h,p*l),u.setAlpha(d*o),u.renderCanvas(t,u,i,r),u.setAlpha(d),u.setScrollFactor(f,p)}}e.mask&&e.mask.postRenderCanvas(t)}}}]);