ngx-spine
Version:
[](https://travis-ci.org/PoiScript/ngx-spine)
2 lines • 233 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-spine",["exports","@angular/core"],e):e((t=t||self)["ngx-spine"]={},t.ng.core)}(this,(function(t,e){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function i(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}var a=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return s.Nearest;case"linear":return s.Linear;case"mipmap":return s.MipMap;case"mipmapnearestnearest":return s.MipMapNearestNearest;case"mipmaplinearnearest":return s.MipMapLinearNearest;case"mipmapnearestlinear":return s.MipMapNearestLinear;case"mipmaplinearlinear":return s.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return o.MirroredRepeat;case"clamptoedge":return o.ClampToEdge;case"repeat":return o.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();var s={Nearest:9728,Linear:9729,MipMap:9987,MipMapNearestNearest:9984,MipMapLinearNearest:9985,MipMapNearestLinear:9986,MipMapLinearLinear:9987};s[s.Nearest]="Nearest",s[s.Linear]="Linear",s[s.MipMap]="MipMap",s[s.MipMapNearestNearest]="MipMapNearestNearest",s[s.MipMapLinearNearest]="MipMapLinearNearest",s[s.MipMapNearestLinear]="MipMapNearestLinear",s[s.MipMapLinearLinear]="MipMapLinearLinear";var o={MirroredRepeat:33648,ClampToEdge:33071,Repeat:10497};o[o.MirroredRepeat]="MirroredRepeat",o[o.ClampToEdge]="ClampToEdge",o[o.Repeat]="Repeat";var h=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(a),u=function(){function t(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return t.prototype.load=function(t,e){if(null==e)throw new Error("textureLoader cannot be null.");for(var r=new d(t),n=new Array(4),i=null;;){var s=r.readLine();if(null==s)break;if(0==(s=s.trim()).length)i=null;else if(i){var h=new p;h.name=s,h.page=i;var l=r.readValue();"true"==l.toLocaleLowerCase()?h.degrees=90:"false"==l.toLocaleLowerCase()?h.degrees=0:h.degrees=parseFloat(l),h.rotate=90==h.degrees,r.readTuple(n);var u=parseInt(n[0]),f=parseInt(n[1]);r.readTuple(n);var m=parseInt(n[0]),g=parseInt(n[1]);h.u=u/i.width,h.v=f/i.height,h.rotate?(h.u2=(u+g)/i.width,h.v2=(f+m)/i.height):(h.u2=(u+m)/i.width,h.v2=(f+g)/i.height),h.x=u,h.y=f,h.width=Math.abs(m),h.height=Math.abs(g),4==r.readTuple(n)&&4==r.readTuple(n)&&r.readTuple(n),h.originalWidth=parseInt(n[0]),h.originalHeight=parseInt(n[1]),r.readTuple(n),h.offsetX=parseInt(n[0]),h.offsetY=parseInt(n[1]),h.index=parseInt(r.readValue()),h.texture=i.texture,this.regions.push(h)}else{(i=new c).name=s,2==r.readTuple(n)&&(i.width=parseInt(n[0]),i.height=parseInt(n[1]),r.readTuple(n)),r.readTuple(n),i.minFilter=a.filterFromString(n[0]),i.magFilter=a.filterFromString(n[1]);var v=r.readValue();i.uWrap=o.ClampToEdge,i.vWrap=o.ClampToEdge,"x"==v?i.uWrap=o.Repeat:"y"==v?i.vWrap=o.Repeat:"xy"==v&&(i.uWrap=i.vWrap=o.Repeat),i.texture=e(s),i.texture.setFilters(i.minFilter,i.magFilter),i.texture.setWraps(i.uWrap,i.vWrap),i.width=i.texture.getImage().width,i.height=i.texture.getImage().height,this.pages.push(i)}}},t.prototype.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},t.prototype.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},t}();var d=function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return t.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),r=e.indexOf(":");if(-1==r)throw new Error("Invalid line: "+e);for(var n=0,i=r+1;n<3;n++){var a=e.indexOf(",",i);if(-1==a)break;t[n]=e.substr(i,a-i).trim(),i=a+1}return t[n]=e.substring(i).trim(),n+1},t}();var c=function(){};var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(h);var f=function(){function t(t,e){void 0===e&&(e=""),this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e}return t.downloadText=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.onload=function(){200==n.status?e(n.responseText):r(n.status,n.responseText)},n.onerror=function(){r(n.status,n.responseText)},n.send()},t.downloadBinary=function(t,e,r){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status?e(new Uint8Array(n.response)):r(n.status,n.responseText)},n.onerror=function(){r(n.status,n.responseText)},n.send()},t.prototype.loadBinary=function(e,r,n){var i=this;void 0===r&&(r=null),void 0===n&&(n=null),e=this.pathPrefix+e,this.toLoad++,t.downloadBinary(e,(function(t){i.assets[e]=t,r&&r(e,t),i.toLoad--,i.loaded++}),(function(t,r){i.errors[e]="Couldn't load binary "+e+": status "+status+", "+r,n&&n(e,"Couldn't load binary "+e+": status "+status+", "+r),i.toLoad--,i.loaded++}))},t.prototype.loadText=function(e,r,n){var i=this;void 0===r&&(r=null),void 0===n&&(n=null),e=this.pathPrefix+e,this.toLoad++,t.downloadText(e,(function(t){i.assets[e]=t,r&&r(e,t),i.toLoad--,i.loaded++}),(function(t,r){i.errors[e]="Couldn't load text "+e+": status "+status+", "+r,n&&n(e,"Couldn't load text "+e+": status "+status+", "+r),i.toLoad--,i.loaded++}))},t.prototype.loadTexture=function(t,e,r){var n=this;void 0===e&&(e=null),void 0===r&&(r=null),t=this.pathPrefix+t,this.toLoad++;var i=new Image;i.crossOrigin="anonymous",i.onload=function(r){var a=n.textureLoader(i);n.assets[t]=a,n.toLoad--,n.loaded++,e&&e(t,i)},i.onerror=function(e){n.errors[t]="Couldn't load image "+t,n.toLoad--,n.loaded++,r&&r(t,"Couldn't load image "+t)},i.src=t},t.prototype.loadTextureData=function(t,e,r,n){var i=this;void 0===r&&(r=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++;var a=new Image;a.onload=function(e){var n=i.textureLoader(a);i.assets[t]=n,i.toLoad--,i.loaded++,r&&r(t,a)},a.onerror=function(e){i.errors[t]="Couldn't load image "+t,i.toLoad--,i.loaded++,n&&n(t,"Couldn't load image "+t)},a.src=e},t.prototype.loadTextureAtlas=function(e,r,n){var a=this;void 0===r&&(r=null),void 0===n&&(n=null);var s=e.lastIndexOf("/")>=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,t.downloadText(e,(function(t){var o,h,d={count:0},c=new Array;try{new u(t,(function(t){c.push(s+"/"+t);var e=document.createElement("img");return e.width=16,e.height=16,new l(e)}))}catch(t){var p=t;return a.errors[e]="Couldn't load texture atlas "+e+": "+p.message,n&&n(e,"Couldn't load texture atlas "+e+": "+p.message),a.toLoad--,void a.loaded++}var f=function(i){var o=!1;a.loadTexture(i,(function(i,h){if(d.count++,d.count==c.length)if(o)a.errors[e]="Couldn't load texture atlas page "+i+"} of atlas "+e,n&&n(e,"Couldn't load texture atlas page "+i+" of atlas "+e),a.toLoad--,a.loaded++;else try{var l=new u(t,(function(t){return a.get(s+"/"+t)}));a.assets[e]=l,r&&r(e,l),a.toLoad--,a.loaded++}catch(t){var p=t;a.errors[e]="Couldn't load texture atlas "+e+": "+p.message,n&&n(e,"Couldn't load texture atlas "+e+": "+p.message),a.toLoad--,a.loaded++}}),(function(t,r){o=!0,d.count++,d.count==c.length&&(a.errors[e]="Couldn't load texture atlas page "+t+"} of atlas "+e,n&&n(e,"Couldn't load texture atlas page "+t+" of atlas "+e),a.toLoad--,a.loaded++)}))};try{for(var m=i(c),g=m.next();!g.done;g=m.next()){f(g.value)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(h=m.return)&&h.call(m)}finally{if(o)throw o.error}}}),(function(t,r){a.errors[e]="Couldn't load texture atlas "+e+": status "+status+", "+r,n&&n(e,"Couldn't load texture atlas "+e+": status "+status+", "+r),a.toLoad--,a.loaded++}))},t.prototype.get=function(t){return t=this.pathPrefix+t,this.assets[t]},t.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null},t.prototype.removeAll=function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}},t.prototype.isLoadingComplete=function(){return 0==this.toLoad},t.prototype.getToLoad=function(){return this.toLoad},t.prototype.getLoaded=function(){return this.loaded},t.prototype.dispose=function(){this.removeAll()},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors},t}();var m={Normal:0,Additive:1,Multiply:2,Screen:3};m[m.Normal]="Normal",m[m.Additive]="Additive",m[m.Multiply]="Multiply",m[m.Screen]="Screen";var g=function(){function t(t,e){var r=this;if(void 0===e&&(e={alpha:"true"}),this.restorables=new Array,t instanceof HTMLCanvasElement){var n=t;this.gl=n.getContext("webgl",e)||n.getContext("experimental-webgl",e),this.canvas=n,n.addEventListener("webglcontextlost",(function(t){t&&t.preventDefault()})),n.addEventListener("webglcontextrestored",(function(t){for(var e=0,n=r.restorables.length;e<n;e++)r.restorables[e].restore()}))}else this.gl=t,this.canvas=this.gl.canvas}return t.prototype.addRestorable=function(t){this.restorables.push(t)},t.prototype.removeRestorable=function(t){var e=this.restorables.indexOf(t);e>-1&&this.restorables.splice(e,1)},t}();var v=function(){function t(){}return t.getDestGLBlendMode=function(e){switch(e){case m.Normal:return t.ONE_MINUS_SRC_ALPHA;case m.Additive:return t.ONE;case m.Multiply:case m.Screen:return t.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+e)}},t.getSourceGLBlendMode=function(e,r){switch(void 0===r&&(r=!1),e){case m.Normal:case m.Additive:return r?t.ONE:t.SRC_ALPHA;case m.Multiply:return t.DST_COLOR;case m.Screen:return t.ONE;default:throw new Error("Unknown blend mode: "+e)}},t.ZERO=0,t.ONE=1,t.SRC_COLOR=768,t.ONE_MINUS_SRC_COLOR=769,t.SRC_ALPHA=770,t.ONE_MINUS_SRC_ALPHA=771,t.DST_ALPHA=772,t.ONE_MINUS_DST_ALPHA=773,t.DST_COLOR=774,t}();var y=function(t){function e(e,r,n){void 0===n&&(n=!1);var i=t.call(this,r)||this;return i.texture=null,i.boundUnit=0,i.useMipMaps=!1,i.context=e instanceof g?e:new g(e),i.useMipMaps=n,i.restore(),i.context.addRestorable(i),i}return n(e,t),e.prototype.setFilters=function(t,e){var r=this.context.gl;this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e)},e.prototype.setWraps=function(t,e){var r=this.context.gl;this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e)},e.prototype.update=function(t){var e=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),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)},e.prototype.restore=function(){this.texture=null,this.update(this.useMipMaps)},e.prototype.bind=function(t){void 0===t&&(t=0);var e=this.context.gl;this.boundUnit=t,e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},e.prototype.unbind=function(){var t=this.context.gl;t.activeTexture(t.TEXTURE0+this.boundUnit),t.bindTexture(t.TEXTURE_2D,null)},e.prototype.dispose=function(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)},e}(a);var w=function(t){function e(e,r){return void 0===r&&(r=""),t.call(this,(function(t){return new y(e,t)}),r)||this}return n(e,t),e}(f),x=0,I=5,b=10,E=15,A=function(){function t(){this.temp=new Float32Array(16),this.values=new Float32Array(16);var t=this.values;t[x]=1,t[I]=1,t[b]=1,t[E]=1}return t.prototype.set=function(t){return this.values.set(t),this},t.prototype.transpose=function(){var t=this.temp,e=this.values;return t[x]=e[x],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[I]=e[I],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[b]=e[b],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[E]=e[E],this.set(t)},t.prototype.identity=function(){var t=this.values;return t[x]=1,t[4]=0,t[8]=0,t[12]=0,t[1]=0,t[I]=1,t[9]=0,t[13]=0,t[2]=0,t[6]=0,t[b]=1,t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[E]=1,this},t.prototype.invert=function(){var t=this.values,e=this.temp,r=t[3]*t[6]*t[9]*t[12]-t[2]*t[7]*t[9]*t[12]-t[3]*t[I]*t[b]*t[12]+t[1]*t[7]*t[b]*t[12]+t[2]*t[I]*t[11]*t[12]-t[1]*t[6]*t[11]*t[12]-t[3]*t[6]*t[8]*t[13]+t[2]*t[7]*t[8]*t[13]+t[3]*t[4]*t[b]*t[13]-t[x]*t[7]*t[b]*t[13]-t[2]*t[4]*t[11]*t[13]+t[x]*t[6]*t[11]*t[13]+t[3]*t[I]*t[8]*t[14]-t[1]*t[7]*t[8]*t[14]-t[3]*t[4]*t[9]*t[14]+t[x]*t[7]*t[9]*t[14]+t[1]*t[4]*t[11]*t[14]-t[x]*t[I]*t[11]*t[14]-t[2]*t[I]*t[8]*t[E]+t[1]*t[6]*t[8]*t[E]+t[2]*t[4]*t[9]*t[E]-t[x]*t[6]*t[9]*t[E]-t[1]*t[4]*t[b]*t[E]+t[x]*t[I]*t[b]*t[E];if(0==r)throw new Error("non-invertible matrix");var n=1/r;return e[x]=t[9]*t[14]*t[7]-t[13]*t[b]*t[7]+t[13]*t[6]*t[11]-t[I]*t[14]*t[11]-t[9]*t[6]*t[E]+t[I]*t[b]*t[E],e[4]=t[12]*t[b]*t[7]-t[8]*t[14]*t[7]-t[12]*t[6]*t[11]+t[4]*t[14]*t[11]+t[8]*t[6]*t[E]-t[4]*t[b]*t[E],e[8]=t[8]*t[13]*t[7]-t[12]*t[9]*t[7]+t[12]*t[I]*t[11]-t[4]*t[13]*t[11]-t[8]*t[I]*t[E]+t[4]*t[9]*t[E],e[12]=t[12]*t[9]*t[6]-t[8]*t[13]*t[6]-t[12]*t[I]*t[b]+t[4]*t[13]*t[b]+t[8]*t[I]*t[14]-t[4]*t[9]*t[14],e[1]=t[13]*t[b]*t[3]-t[9]*t[14]*t[3]-t[13]*t[2]*t[11]+t[1]*t[14]*t[11]+t[9]*t[2]*t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[4]*t[1]*t[b]+t[x]*t[I]*t[b],t[x]=e[x]*n,t[4]=e[4]*n,t[8]=e[8]*n,t[12]=e[12]*n,t[1]=e[1]*n,t[I]=e[I]*n,t[9]=e[9]*n,t[13]=e[13]*n,t[2]=e[2]*n,t[6]=e[6]*n,t[b]=e[b]*n,t[14]=e[14]*n,t[3]=e[3]*n,t[7]=e[7]*n,t[11]=e[11]*n,t[E]=e[E]*n,this},t.prototype.determinant=function(){var t=this.values;return t[3]*t[6]*t[9]*t[12]-t[2]*t[7]*t[9]*t[12]-t[3]*t[I]*t[b]*t[12]+t[1]*t[7]*t[b]*t[12]+t[2]*t[I]*t[11]*t[12]-t[1]*t[6]*t[11]*t[12]-t[3]*t[6]*t[8]*t[13]+t[2]*t[7]*t[8]*t[13]+t[3]*t[4]*t[b]*t[13]-t[x]*t[7]*t[b]*t[13]-t[2]*t[4]*t[11]*t[13]+t[x]*t[6]*t[11]*t[13]+t[3]*t[I]*t[8]*t[14]-t[1]*t[7]*t[8]*t[14]-t[3]*t[4]*t[9]*t[14]+t[x]*t[7]*t[9]*t[14]+t[1]*t[4]*t[11]*t[14]-t[x]*t[I]*t[11]*t[14]-t[2]*t[I]*t[8]*t[E]+t[1]*t[6]*t[8]*t[E]+t[2]*t[4]*t[9]*t[E]-t[x]*t[6]*t[9]*t[E]-t[1]*t[4]*t[b]*t[E]+t[x]*t[I]*t[b]*t[E]},t.prototype.translate=function(t,e,r){var n=this.values;return n[12]+=t,n[13]+=e,n[14]+=r,this},t.prototype.copy=function(){return(new t).set(this.values)},t.prototype.projection=function(t,e,r,n){this.identity();var i=1/Math.tan(r*(Math.PI/180)/2),a=(e+t)/(t-e),s=2*e*t/(t-e),o=this.values;return o[x]=i/n,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[I]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[b]=a,o[11]=-1,o[12]=0,o[13]=0,o[14]=s,o[E]=0,this},t.prototype.ortho2d=function(t,e,r,n){return this.ortho(t,t+r,e,e+n,0,1)},t.prototype.ortho=function(t,e,r,n,i,a){this.identity();var s=2/(e-t),o=2/(n-r),h=-2/(a-i),l=-(e+t)/(e-t),u=-(n+r)/(n-r),d=-(a+i)/(a-i),c=this.values;return c[x]=s,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[I]=o,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[b]=h,c[11]=0,c[12]=l,c[13]=u,c[14]=d,c[E]=1,this},t.prototype.multiply=function(t){var e=this.temp,r=this.values,n=t.values;return e[x]=r[x]*n[x]+r[4]*n[1]+r[8]*n[2]+r[12]*n[3],e[4]=r[x]*n[4]+r[4]*n[I]+r[8]*n[6]+r[12]*n[7],e[8]=r[x]*n[8]+r[4]*n[9]+r[8]*n[b]+r[12]*n[11],e[12]=r[x]*n[12]+r[4]*n[13]+r[8]*n[14]+r[12]*n[E],e[1]=r[1]*n[x]+r[I]*n[1]+r[9]*n[2]+r[13]*n[3],e[I]=r[1]*n[4]+r[I]*n[I]+r[9]*n[6]+r[13]*n[7],e[9]=r[1]*n[8]+r[I]*n[9]+r[9]*n[b]+r[13]*n[11],e[13]=r[1]*n[12]+r[I]*n[13]+r[9]*n[14]+r[13]*n[E],e[2]=r[2]*n[x]+r[6]*n[1]+r[b]*n[2]+r[14]*n[3],e[6]=r[2]*n[4]+r[6]*n[I]+r[b]*n[6]+r[14]*n[7],e[b]=r[2]*n[8]+r[6]*n[9]+r[b]*n[b]+r[14]*n[11],e[14]=r[2]*n[12]+r[6]*n[13]+r[b]*n[14]+r[14]*n[E],e[3]=r[3]*n[x]+r[7]*n[1]+r[11]*n[2]+r[E]*n[3],e[7]=r[3]*n[4]+r[7]*n[I]+r[11]*n[6]+r[E]*n[7],e[11]=r[3]*n[8]+r[7]*n[9]+r[11]*n[b]+r[E]*n[11],e[E]=r[3]*n[12]+r[7]*n[13]+r[11]*n[14]+r[E]*n[E],this.set(this.temp)},t.prototype.multiplyLeft=function(t){var e=this.temp,r=this.values,n=t.values;return e[x]=n[x]*r[x]+n[4]*r[1]+n[8]*r[2]+n[12]*r[3],e[4]=n[x]*r[4]+n[4]*r[I]+n[8]*r[6]+n[12]*r[7],e[8]=n[x]*r[8]+n[4]*r[9]+n[8]*r[b]+n[12]*r[11],e[12]=n[x]*r[12]+n[4]*r[13]+n[8]*r[14]+n[12]*r[E],e[1]=n[1]*r[x]+n[I]*r[1]+n[9]*r[2]+n[13]*r[3],e[I]=n[1]*r[4]+n[I]*r[I]+n[9]*r[6]+n[13]*r[7],e[9]=n[1]*r[8]+n[I]*r[9]+n[9]*r[b]+n[13]*r[11],e[13]=n[1]*r[12]+n[I]*r[13]+n[9]*r[14]+n[13]*r[E],e[2]=n[2]*r[x]+n[6]*r[1]+n[b]*r[2]+n[14]*r[3],e[6]=n[2]*r[4]+n[6]*r[I]+n[b]*r[6]+n[14]*r[7],e[b]=n[2]*r[8]+n[6]*r[9]+n[b]*r[b]+n[14]*r[11],e[14]=n[2]*r[12]+n[6]*r[13]+n[b]*r[14]+n[14]*r[E],e[3]=n[3]*r[x]+n[7]*r[1]+n[11]*r[2]+n[E]*r[3],e[7]=n[3]*r[4]+n[7]*r[I]+n[11]*r[6]+n[E]*r[7],e[11]=n[3]*r[8]+n[7]*r[9]+n[11]*r[b]+n[E]*r[11],e[E]=n[3]*r[12]+n[7]*r[13]+n[11]*r[14]+n[E]*r[E],this.set(this.temp)},t.prototype.lookAt=function(e,r,n){t.initTemps();var i=t.xAxis,a=t.yAxis,s=t.zAxis;s.setFrom(r).normalize(),i.setFrom(r).normalize(),i.cross(n).normalize(),a.setFrom(i).cross(s).normalize(),this.identity();var o=this.values;return o[x]=i.x,o[4]=i.y,o[8]=i.z,o[1]=a.x,o[I]=a.y,o[9]=a.z,o[2]=-s.x,o[6]=-s.y,o[b]=-s.z,t.tmpMatrix.identity(),t.tmpMatrix.values[12]=-e.x,t.tmpMatrix.values[13]=-e.y,t.tmpMatrix.values[14]=-e.z,this.multiply(t.tmpMatrix),this},t.initTemps=function(){null===t.xAxis&&(t.xAxis=new M),null===t.yAxis&&(t.yAxis=new M),null===t.zAxis&&(t.zAxis=new M)},t.xAxis=null,t.yAxis=null,t.zAxis=null,t.tmpMatrix=new t,t}();var M=function(){function t(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=0,this.y=0,this.z=0,this.x=t,this.y=e,this.z=r}return t.prototype.setFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},t.prototype.set=function(t,e,r){return this.x=t,this.y=e,this.z=r,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},t.prototype.scale=function(t){return this.x*=t,this.y*=t,this.z*=t,this},t.prototype.normalize=function(){var t=this.length();return 0==t?this:(t=1/t,this.x*=t,this.y*=t,this.z*=t,this)},t.prototype.cross=function(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)},t.prototype.multiply=function(t){var e=t.values;return this.set(this.x*e[x]+this.y*e[4]+this.z*e[8]+e[12],this.x*e[1]+this.y*e[I]+this.z*e[9]+e[13],this.x*e[2]+this.y*e[6]+this.z*e[b]+e[14])},t.prototype.project=function(t){var e=t.values,r=1/(this.x*e[3]+this.y*e[7]+this.z*e[11]+e[E]);return this.set((this.x*e[x]+this.y*e[4]+this.z*e[8]+e[12])*r,(this.x*e[1]+this.y*e[I]+this.z*e[9]+e[13])*r,(this.x*e[2]+this.y*e[6]+this.z*e[b]+e[14])*r)},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.prototype.distance=function(t){var e=t.x-this.x,r=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+r*r+n*n)},t}();var R=function(){function t(t,e){this.position=new M(0,0,0),this.direction=new M(0,0,-1),this.up=new M(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHeight=0,this.projectionView=new A,this.inverseProjectionView=new A,this.projection=new A,this.view=new A,this.tmp=new M,this.viewportWidth=t,this.viewportHeight=e,this.update()}return t.prototype.update=function(){var t=this.projection,e=this.view,r=this.projectionView,n=this.inverseProjectionView,i=this.zoom,a=this.viewportWidth,s=this.viewportHeight;t.ortho(i*(-a/2),i*(a/2),i*(-s/2),i*(s/2),this.near,this.far),e.lookAt(this.position,this.direction,this.up),r.set(t.values),r.multiply(e),n.set(r.values).invert()},t.prototype.screenToWorld=function(t,e,r){var n=t.x,i=r-t.y-1,a=this.tmp;return a.x=2*n/e-1,a.y=2*i/r-1,a.z=2*t.z-1,a.project(this.inverseProjectionView),t.set(a.x,a.y,a.z),t},t.prototype.setViewport=function(t,e){this.viewportWidth=t,this.viewportHeight=e},t}();var S=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();var T=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=r,this.a=n}return t.prototype.set=function(t,e,r,n){return this.r=t,this.g=e,this.b=r,this.a=n,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(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?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,r,n){return this.r+=t,this.g+=e,this.b+=r,this.a+=n,this.clamp(),this},t.prototype.clamp=function(){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},t.rgba8888ToColor=function(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},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();var C=function(){function t(){}return t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,r){return t.randomTriangularWith(e,r,.5*(e+r))},t.randomTriangularWith=function(t,e,r){var n=Math.random(),i=e-t;return n<=(r-t)/i?t+Math.sqrt(n*i*(r-t)):e-Math.sqrt((1-n)*i*(e-r))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();var V=function(){function t(){}return t.prototype.apply=function(t,e,r){return t+(e-t)*this.applyInternal(r)},t}();var F=function(t){function e(e){var r=t.call(this)||this;return r.power=2,r.power=e,r}return n(e,t),e.prototype.applyInternal=function(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},e}(V);var P=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(F),k=function(){function t(){}return t.arrayCopy=function(t,e,r,n,i){for(var a=e,s=n;a<e+i;a++,s++)r[s]=t[a]},t.setArraySize=function(t,e,r){void 0===r&&(r=0);var n=t.length;if(n==e)return t;if(t.length=e,n<e)for(var i=n;i<e;i++)t[i]=r;return t},t.ensureArrayCapacity=function(e,r,n){return void 0===n&&(n=0),e.length>=r?e:t.setArraySize(e,r,n)},t.newArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var r=new Array(e),n=0;n<r.length;n++)r[n]=0;return r},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var r=new Array(e),n=0;n<r.length;n++)r[n]=0;return r},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.contains=function(t,e,r){void 0===r&&(r=!0);for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}();!function(){function t(){}t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var r=t.bones[e];console.log(r.data.name+", "+r.a+", "+r.b+", "+r.c+", "+r.d+", "+r.worldX+", "+r.worldY)}}}();var N=function(){function t(t){this.items=new Array,this.instantiator=t}return t.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;e<t.length;e++)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function(){this.items.length=0},t}();var L=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}();var O=function(){function t(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return t.prototype.update=function(){var 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)},t}();!function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(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},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,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}}();!function(){function t(t){this.lastX=0,this.lastY=0,this.buttonDown=!1,this.currTouch=null,this.touchesPool=new N((function(){return new Y(0,0,0)})),this.listeners=new Array,this.element=t,this.setupCallbacks(t)}t.prototype.setupCallbacks=function(t){var e=this,r=function(r){if(r instanceof MouseEvent){for(var n=t.getBoundingClientRect(),i=r.clientX-n.left,a=r.clientY-n.top,s=e.listeners,o=0;o<s.length;o++)e.buttonDown?s[o].dragged(i,a):s[o].moved(i,a);e.lastX=i,e.lastY=a}},n=function(i){if(i instanceof MouseEvent){for(var a=t.getBoundingClientRect(),s=i.clientX-a.left,o=i.clientY-a.top,h=e.listeners,l=0;l<h.length;l++)h[l].up(s,o);e.lastX=s,e.lastY=o,e.buttonDown=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n)}};t.addEventListener("mousedown",(function(i){if(i instanceof MouseEvent){for(var a=t.getBoundingClientRect(),s=i.clientX-a.left,o=i.clientY-a.top,h=e.listeners,l=0;l<h.length;l++)h[l].down(s,o);e.lastX=s,e.lastY=o,e.buttonDown=!0,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n)}}),!0),t.addEventListener("mousemove",r,!0),t.addEventListener("mouseup",n,!0),t.addEventListener("touchstart",(function(r){if(null==e.currTouch){for(var n=r.changedTouches,i=0;i<n.length;i++){var a=n[i],s=t.getBoundingClientRect(),o=a.clientX-s.left,h=a.clientY-s.top;e.currTouch=e.touchesPool.obtain(),e.currTouch.identifier=a.identifier,e.currTouch.x=o,e.currTouch.y=h;break}for(var l=e.listeners,u=0;u<l.length;u++)l[u].down(e.currTouch.x,e.currTouch.y);console.log("Start "+e.currTouch.x+", "+e.currTouch.y),e.lastX=e.currTouch.x,e.lastY=e.currTouch.y,e.buttonDown=!0,r.preventDefault()}}),!1),t.addEventListener("touchend",(function(r){for(var n=r.changedTouches,i=0;i<n.length;i++){var a=n[i];if(e.currTouch.identifier===a.identifier){var s=t.getBoundingClientRect(),o=e.currTouch.x=a.clientX-s.left,h=e.currTouch.y=a.clientY-s.top;e.touchesPool.free(e.currTouch);for(var l=e.listeners,u=0;u<l.length;u++)l[u].up(o,h);console.log("End "+o+", "+h),e.lastX=o,e.lastY=h,e.buttonDown=!1,e.currTouch=null;break}}r.preventDefault()}),!1),t.addEventListener("touchcancel",(function(r){for(var n=r.changedTouches,i=0;i<n.length;i++){var a=n[i];if(e.currTouch.identifier===a.identifier){var s=t.getBoundingClientRect(),o=e.currTouch.x=a.clientX-s.left,h=e.currTouch.y=a.clientY-s.top;e.touchesPool.free(e.currTouch);for(var l=e.listeners,u=0;u<l.length;u++)l[u].up(o,h);console.log("End "+o+", "+h),e.lastX=o,e.lastY=h,e.buttonDown=!1,e.currTouch=null;break}}r.preventDefault()}),!1),t.addEventListener("touchmove",(function(r){if(null!=e.currTouch){for(var n=r.changedTouches,i=0;i<n.length;i++){var a=n[i];if(e.currTouch.identifier===a.identifier){for(var s=t.getBoundingClientRect(),o=a.clientX-s.left,h=a.clientY-s.top,l=e.listeners,u=0;u<l.length;u++)l[u].dragged(o,h);console.log("Drag "+o+", "+h),e.lastX=e.currTouch.x=o,e.lastY=e.currTouch.y=h;break}}r.preventDefault()}}),!1)},t.prototype.addListener=function(t){this.listeners.push(t)},t.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>-1&&this.listeners.splice(e,1)}}();var Y=function(t,e,r){this.identifier=t,this.x=e,this.y=r};var D=function(){function t(t,e,r){this.vertexShader=e,this.fragmentShader=r,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=r,this.context=t instanceof g?t:new g(t),this.context.addRestorable(this),this.compile()}return t.prototype.getProgram=function(){return this.program},t.prototype.getVertexShader=function(){return this.vertexShader},t.prototype.getFragmentShader=function(){return this.fragmentShader},t.prototype.getVertexShaderSource=function(){return this.vsSource},t.prototype.getFragmentSource=function(){return this.fsSource},t.prototype.compile=function(){var t=this.context.gl;try{this.vs=this.compileShader(t.VERTEX_SHADER,this.vertexShader),this.fs=this.compileShader(t.FRAGMENT_SHADER,this.fragmentShader),this.program=this.compileProgram(this.vs,this.fs)}catch(t){throw this.dispose(),t}},t.prototype.compileShader=function(t,e){var r=this.context.gl,n=r.createShader(t);if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS)){var i="Couldn't compile shader: "+r.getShaderInfoLog(n);if(r.deleteShader(n),!r.isContextLost())throw new Error(i)}return n},t.prototype.compileProgram=function(t,e){var r=this.context.gl,n=r.createProgram();if(r.attachShader(n,t),r.attachShader(n,e),r.linkProgram(n),!r.getProgramParameter(n,r.LINK_STATUS)){var i="Couldn't compile shader program: "+r.getProgramInfoLog(n);if(r.deleteProgram(n),!r.isContextLost())throw new Error(i)}return n},t.prototype.restore=function(){this.compile()},t.prototype.bind=function(){this.context.gl.useProgram(this.program)},t.prototype.unbind=function(){this.context.gl.useProgram(null)},t.prototype.setUniformi=function(t,e){this.context.gl.uniform1i(this.getUniformLocation(t),e)},t.prototype.setUniformf=function(t,e){this.context.gl.uniform1f(this.getUniformLocation(t),e)},t.prototype.setUniform2f=function(t,e,r){this.context.gl.uniform2f(this.getUniformLocation(t),e,r)},t.prototype.setUniform3f=function(t,e,r,n){this.context.gl.uniform3f(this.getUniformLocation(t),e,r,n)},t.prototype.setUniform4f=function(t,e,r,n,i){this.context.gl.uniform4f(this.getUniformLocation(t),e,r,n,i)},t.prototype.setUniform2x2f=function(t,e){var r=this.context.gl;this.tmp2x2.set(e),r.uniformMatrix2fv(this.getUniformLocation(t),!1,this.tmp2x2)},t.prototype.setUniform3x3f=function(t,e){var r=this.context.gl;this.tmp3x3.set(e),r.uniformMatrix3fv(this.getUniformLocation(t),!1,this.tmp3x3)},t.prototype.setUniform4x4f=function(t,e){var r=this.context.gl;this.tmp4x4.set(e),r.uniformMatrix4fv(this.getUniformLocation(t),!1,this.tmp4x4)},t.prototype.getUniformLocation=function(t){var e=this.context.gl,r=e.getUniformLocation(this.program,t);if(!r&&!e.isContextLost())throw new Error("Couldn't find location for uniform "+t);return r},t.prototype.getAttributeLocation=function(t){var e=this.context.gl,r=e.getAttribLocation(this.program,t);if(-1==r&&!e.isContextLost())throw new Error("Couldn't find location for attribute "+t);return r},t.prototype.dispose=function(){this.context.removeRestorable(this);var 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)},t.newColoredTextured=function(e){return new t(e,"\n\t\t\t\tattribute vec4 "+t.POSITION+";\n\t\t\t\tattribute vec4 "+t.COLOR+";\n\t\t\t\tattribute vec2 "+t.TEXCOORDS+";\n\t\t\t\tuniform mat4 "+t.MVP_MATRIX+";\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = "+t.COLOR+";\n\t\t\t\t\tv_texCoords = "+t.TEXCOORDS+";\n\t\t\t\t\tgl_Position = "+t.MVP_MATRIX+" * "+t.POSITION+";\n\t\t\t\t}\n\t\t\t","\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\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")},t.newTwoColoredTextured=function(e){return new t(e,"\n\t\t\t\tattribute vec4 "+t.POSITION+";\n\t\t\t\tattribute vec4 "+t.COLOR+";\n\t\t\t\tattribute vec4 "+t.COLOR2+";\n\t\t\t\tattribute vec2 "+t.TEXCOORDS+";\n\t\t\t\tuniform mat4 "+t.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\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = "+t.COLOR+";\n\t\t\t\t\tv_dark = "+t.COLOR2+";\n\t\t\t\t\tv_texCoords = "+t.TEXCOORDS+";\n\t\t\t\t\tgl_Position = "+t.MVP_MATRIX+" * "+t.POSITION+";\n\t\t\t\t}\n\t\t\t","\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\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")},t.newColored=function(e){return new t(e,"\n\t\t\t\tattribute vec4 "+t.POSITION+";\n\t\t\t\tattribute vec4 "+t.COLOR+";\n\t\t\t\tuniform mat4 "+t.MVP_MATRIX+";\n\t\t\t\tvarying vec4 v_color;\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_color = "+t.COLOR+";\n\t\t\t\t\tgl_Position = "+t.MVP_MATRIX+" * "+t.POSITION+";\n\t\t\t\t}\n\t\t\t","\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\tvoid main () {\n\t\t\t\t\tgl_FragColor = v_color;\n\t\t\t\t}\n\t\t\t")},t.MVP_MATRIX="u_projTrans",t.POSITION="a_position",t.COLOR="a_color",t.COLOR2="a_color2",t.TEXCOORDS="a_texCoords",t.SAMPLER="u_texture",t}();var B=function(){function t(t,e,r,n){this.attributes=e,this.verticesLength=0,this.dirtyVertices=!1,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof g?t:new g(t),this.elementsPerVertex=0;for(var i=0;i<e.length;i++)this.elementsPerVertex+=e[i].numElements;this.vertices=new Float32Array(r*this.elementsPerVertex),this.indices=new Uint16Array(n),this.context.addRestorable(this)}return t.prototype.getAttributes=function(){return this.attributes},t.prototype.maxVertices=function(){return this.vertices.length/this.elementsPerVertex},t.prototype.numVertices=function(){return this.verticesLength/this.elementsPerVertex},t.prototype.setVerticesLength=function(t){this.dirtyVertices=!0,this.verticesLength=t},t.prototype.getVertices=function(){return this.vertices},t.prototype.maxIndices=function(){return this.indices.length},t.prototype.numIndices=function(){return this.indicesLength},t.prototype.setIndicesLength=function(t){this.dirtyIndices=!0,this.indicesLength=t},t.prototype.getIndices=function(){return this.indices},t.prototype.getVertexSizeInFloats=function(){for(var t=0,e=0;e<this.attributes.length;e++){t+=this.attributes[e].numElements}return t},t.prototype.setVertices=function(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},t.prototype.setIndices=function(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},t.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},t.prototype.drawWithOffset=function(t,e,r,n){var i=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?i.drawElements(e,n,i.UNSIGNED_SHORT,2*r):i.drawArrays(e,r,n),this.unbind(t)},t.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var r=0,n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=t.getAttributeLocation(i.name);e.enableVertexAttribArray(a),e.vertexAttribPointer(a,i.numElements,e.FLOAT,!1,4*this.elementsPerVertex,4*r),r+=i.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},t.prototype.unbind=function(t){for(var e=this.context.gl,r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=t.getAttributeLocation(n.name);e.disableVertexAttribArray(i)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},t.prototype.update=function(){var 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)},t.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},t.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},t}();var X=function(t,e,r){this.name=t,this.type=e,this.numElements=r};var W=function(t){function e(){return t.call(this,D.POSITION,_.Float,2)||this}return n(e,t),e}(X),G=(function(t){function e(){return t.call(this,D.POSITION,_.Float,3)||this}n(e,t)}(X),function(t){function e(e){return void 0===e&&(e=0),t.call(this,D.TEXCOORDS+(0==e?"":e),_.Float,2)||this}return n(e,t),e}(X)),Z=function(t){function e(){return t.call(this,D.COLOR,_.Float,4)||this}return n(e,t),e}(X),U=function(t){function e(){return t.call(this,D.COLOR2,_.Float,4)||this}return n(e,t),e}(X),_={Float:0};_[_.Float]="Float";var j=function(){function t(t,e,r){if(void 0===e&&(e=!0),void 0===r&&(r=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,r>10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=t instanceof g?t:new g(t);var n=e?[new W,new Z,new G,new U]:[new W,new Z,new G];this.mesh=new B(t,n,r,3*r),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return t.prototype.begin=function(t){var e=this.context.gl;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,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},t.prototype.setBlendMode=function(t,e){var r=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),r.blendFunc(this.srcBlend,this.dstBlend))},t.prototype.draw=function(t,e,r){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+r.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var i=this.mesh.getIndices(),a=this.indicesLength,s=0;s<r.length;a++,s++)i[a]=r[s]+n;this.indicesLength+=r.length,this.mesh.setIndicesLength(this.indicesLength)},t.prototype.flush=function(){var t=this.context.gl;0!=this.verticesLength&&(this.lastTexture.bind(),this.mesh.draw(this.shader,t.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++)},t.prototype.end=function(){var t=this.context.gl;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,t.disable(t.BLEND)},t.prototype.getDrawCalls=function(){return this.drawCalls},t.prototype.dispose=function(){this.mesh.dispose()},t}();var z=function(){function t(t,e){if(void 0===e&&(e=10920),this.isDrawing=!1,this.shapeType=H.Filled,this.color=new T(1,1,1,1),this.vertexIndex=0,this.tmp=new L,e>10920)throw new Error("Can't have more than 10920 triangles per batch: "+e);this.context=t instanceof g?t:new g(t),this.mesh=new B(t,[new W,new Z],e,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return t.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},t.prototype.setBlendMode=function(t,e){var r=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),r.blendFunc(this.srcBlend,this.dstBlend))},t.prototype.setColor=function(t){this.color.setFromColor(t)},t.prototype.setColorWith=function(t,e,r,n){this.color.set(t,e,r,n)},t.prototype.point=function(t,e,r){void 0===r&&(r=null),this.check(H.Point,1),null===r&&(r=this.color),this.vertex(t,e,r)},t.prototype.line=function(t,e,r,n,i){void 0===i&&(i=null),this.check(H.Line,2);this.mesh.getVertices(),this.vertexIndex;null===i&&(i=this.color),this.vertex(t,e,i),this.vertex(r,n,i)},t.prototype.triangle=function(t,e,r,n,i,a,s,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.check(t?H.Filled:H.Line,3);this.mesh.getVertices(),this.vertexIndex;null===o&&(o=this.color),null===h&&(h=this.color),null===l&&(l=this.color),t?(this.vertex(e,r,o),this.vertex(n,i,h),this.vertex(a,s,l)):(this.vertex(e,r,o),this.vertex(n,i,h),this.vertex(n,i,o),this.vertex(a,s,h),this.vertex(a,s,o),this.vertex(e,r,h))},t.prototype.quad=function(t,e,r,n,i,a,s,o,h,l,u,d,c){void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===c&&(c=null),this.check(t?H.Filled:H.Line,3);this.mesh.getVertices(),this.vertexIndex;null===l&&(l=this.color),null===u&&(u=this.color),null===d&&(d=this.color),null===c&&(c=this.color),t?(this.vertex(e,r,l),this.vertex(n,i,u),this.vertex(a,s,d),this.vertex(a,s,d),this.vertex(o,h,c),this.vertex(e,r,l)):(this.vertex(e,r,l),this.vertex(n,i,u),this.vertex(n,i,u),this.vertex(a,s,d),this.vertex(a,s,d),this.vertex(o,h,c),this.vertex(o,h,c),this.vertex(e,r,l))},t.prototype.rect=function(t,e,r,n,i,a){void 0===a&&(a=null),this.quad(t,e,r,e+n,r,e+n,r+i,e,r+i,a,a,a,a)},t.prototype.rectLine=function(t,e,r,n,i,a,s){void 0===s&&(s=null),this.check(t?H.Filled:H.Line,8),null===s&&(s=this.color);var o=this.tmp.set(i-r,e-n);o.normalize(),a*=.5;var h=o.x*a,l=o.y*a;t?(this.vertex(e+h,r+l,s),this.vertex(e-h,r-l,s),this.vertex(n+h,i+l,s),this.vertex(n-h,i-l,s),this.vertex(n+h,i+l,s),this.vertex(e-h,r-l,s)):(this.vertex(e+h,r+l,s),this.vertex(e-h,r-l,s),this.vertex(n+h,i+l,s),this.vertex(n-h,i-l,s),this.vertex(n+h,i+l,s),this.vertex(e+h,r+l,s),this.vertex(n-h,i-l,s),this.vertex(e-h,r-l,s))},t.prototype.x=function(t,e,r){this.line(t-r,e-r,t+r,e+r),this.line(t-r,e+r,t+r,e-r)},t.prototype.polygon=function(t,e,r,n){if(void 0===n&&(n=null),r<3)throw new Error("Polygon must contain at least 3 vertices");this.check(H.Line,2*r),null===n&&(n=this.color);this.mesh.getVertices(),this.vertexIndex;r<<=1;for(var i=t[e<<=1],a=t[e+1],s=e+r,o=e,h=e+r-2;o<h;o+=2){var l=t[o],u=t[o+1],d=0,c=0;o+2>=s?(d=i,c=a):(d=t[o+2],c=t[o+3]),this.vertex(l,u,n),this.vertex(d,c,n)}},t.prototype.circle=function(t,e,r,n,i,a){if(void 0===i&&(i=null),void 0===a&&(a=0),0===a&&(a=Math.max(1,6*C.cbrt(n)|0)),a<=0)throw new Error("segments must be > 0.");null===i&&(i=this.color);var s=2*C.PI/a,o=Math.cos(s),h=Math.sin(s),l=n,u=0;if(t){this.check(H.Filled,3*a+3),a--;for(c=0;c<a;c++){this.vertex(e,r,i),this.vertex(e+l,r+u,i);var d=l;l=o*l-h*u,u=h*d+o*u,this.vertex(e+l,r+u,i)}this.vertex(e,r,i),this.vertex(e+l,r+u,i)}else{this.check(H.Line,2*a+2);for(var c=0;c<a;c++){this.vertex(e+l,r+u,i);var p=l;l=o*l-h*u,u=h*p+o*u,this.vertex(e+l,r+u,i)}this.vertex(e+l,r+u,i)}l=n,u=0,this.vertex(e+l,r+u,i)},t.prototype.curve=function(t,e,r,n,i,a,s,o,h,l){void 0===l&&(l=null),this.check(H.Line,2*h+2),null===l&&(l=this.color);for(var u=1/h,d=u*u,c=u*u*u,p=3*u,f=3*d,m=6*d,g=6*c,v=t-2*r+i,y=e-2*n+a,w=3*(r-i)-t+s,x=3*(n-a)-e+o,I=t,b=e,E=(r-t)*p+v*f+w*c,A=(n-e)*p+y*f+x*c,M=v*m+w*g,R=y*m+x*g,S=w*g,T=x*g;h-- >0;)this.vertex(I,b,l),I+=E,b+=A,E+=M,A+=R,M+=S,R+=T,this.vertex(I,b,l);this.vertex(I,b,l),this.vertex(s,o,l)},t.prototype.vertex=function(t,e,r){var n=this.vertexIndex,i=this.mesh.getVertices();i[n++]=t,i[n++]=e,i[n++]=r.r,i[n++]=r.g,i[n++]=r.b,i[n++]=r.a,this.vertexIndex=n},t.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},t.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},t.prototype.check=function(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},t.prototype.dispose=function(){this.mesh.dispose()},t}();var H={Point:0,Line:1,Filled:4};H[H.Point]="Point",H[H.Line]="Line",H[H.Filled]="Filled";var J=function(){function t(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new N((function(){return new Array})),this.polygonIndicesPool=new N((function(){return new Array}))}return t.prototype.triangulate=function(e){var r=e,n=e.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a<n;a++)i[a]=a;var s=this.isConcaveArray;s.length=0;a=0;for(var o=n;a<o;++a)s[a]=t.isConcave(a,n,r,i);var h=this.triangles;for(h.length=0;n>3;){for(var l=n-1,u=(a=0,1);;){t:if(!s[a]){for(var d=i[l]<<1,c=i[a]<<1,p=i[u]<<1,f=r[d],m=r[d+1],g=r[c],v=r[c+1],y=r[p],w=r[p+1],x=(u+1)%n;x!=l;x=(x+1)%n)if(s[x]){var I=i[x]<<1,b=r[I],E=r[I+1];if(t.positiveArea(y,w,f,m,b,E)&&t.positiveArea(f,m,g,v,b,E)&&t.positiveArea(g,v,y,w,b,E))break t}break}if(0==u){do{if(!s[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%n}h.push(i[(n+a-1)%n]),h.push(i[a]),h.push(i[(a+1)%n]),i.splice(a,1),s.splice(a,1);var A=(--n+a-1)%n,M=a==n?0:a;s[A]=t.isConcave(A,n,r,i),s[M]=t.isConcave(M,n,r,i)}return 3==n&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},t.prototype.decompose=function(e,r){var n=e,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;var a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,d=r.length;u<d;u+=3){var c=r[u]<<1,p=r[u+1]<<1,f=r[u+2]<<1,m=n[c],g=n[c+1],v=n[p],y=n[p+1],w=n[f],x=n[f+1],I=!1;if(h==c){var b=o.length-4,E=t.winding(o[b],o[b+1],o[b+2],o[b+3],w,x),A=t.winding(w,x,o[0],o[1],o[2],o[3]);E==l&&A==l&&(o.push(w),o.push(x),s.push(f),I=!0)}I||(o.length>0?(i.push(o),a.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(g),o.push(v),o.push(y),o.push(w),o.push(x),(s=this.polygonIndicesPool.obtain()).length=0,s.push(c),s.push(p),s.push(f),l=t.winding(m,g,v,y,w,x),h=c)}o.length>0&&(i.push(o),a.push(s));for(u=0,d=i.length;u<d;u++)if(0!=(s=a[u]).length)for(var M=s[0],R=s[s.length-1],S=(o=i[u])[b=o.length-4],T=o[b+1],C=o[b+2],V=o[b+3],F=o[0],P=o[1],k=o[2],N=o[3],L=t.winding(S,T,C,V,F,P),O=0;O<d;O++)if(O!=u){var Y=a[O];if(3==Y.length){var D=Y[0],B=Y[1],X=Y[2],W=i[O];w=W[W.length-2],x=W[W.length-1];if(D==M&&B==R){E=t.winding(S,T,C,V,w,x),A=t.winding(w,x,F,P,k,N);E==L&&A==L&&(W.length=0,Y.length=0,o.push(w),o.push(x),s.push(X),S=C,T=V,C=w,V=x,O=0)}}}for(u=i.length-1;u>=0;u--)0==(o=i[u]).length&&(i.splice(u,1),this.polygonPool.free(o),s=a[u],a.splice(u,1),this.polygonIndicesPool.free(s));return i},t.isConcave=function(t,e,r,n){var i=n[(e+t-1)%e]<<1,a=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(r[i],r[i+1],r[a],r[a+1],r[s],r[s+1])},t.positiveArea=function(t,e,r,n,i,a){return t*(a-n)+r*(e-a)+i*(n-e)>=0},t.winding=function(t,e,r,n,i,a){var s=r-t,o=n-e;return i*o-a*s+s*e-t*o>=0?1:-1},t}();var Q=function(){function t(){this.triangulator=new J,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return t.prototype.clipStart=function(e,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var n=r.worldVerticesLength,i=k.setArraySize(this.clippingPolygon,n);r.computeWorldVertices(e,0,n,i,0,2);var a=this.clippingPolygon;t.makeClockwise(a);for(var s=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),o=0,h=s.length;o<h;o++){var l=s[o];t.makeClockwise(l),l.push(l[0]),l.push(l[1])}return s.length},t.prototype.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},t.prototype.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},t.prototype.isClipping=function(){return null!=this.clipAttachment},t.prototype.clipTriangles=function(t,e,r,n,i,a,s,o){var h=this.clipOutput,l=this.clippedVertices,u=this.clippedTriangles,d=this.clippingPolygons,c=this.clippingPolygons.length,p=o?12:8,f=0;l.length=0,u.length=0;t:for(var m=0;m<n;m+=3)for(var g=r[m]<<1,v=t[g],y=t[g+1],w=i[g],x=i[g+1],I=t[g=r[m+1]<<1],b=t[g+1],E=i[g],A=i[g+1],M=t[g=r[m+2]<<1],R=t[g+1],S=i[g],T=i[g+1],C=0;C<c;C++){var V=l.length;if(!this.clip(v,y,I,b,M,R,d[C],h)){(X=k.setArraySize(l,V+3*p))[V]=v,X[V+1]=y,X[V+2]=a.r,X[V+3]=a.g,X[V+4]=a.b,X[V+5]=a.a,o?(X[V+6]=w,X[V+7]=x,X[V+8]=s.r,X[V+9]=s.g,X[V+10]=s.b,X[V+11]=s.a,X[V+12]=I,X[V+13]=b,X[V+14]=a.r,X[V+15]=a.g,X[V+16]=a.b,X[V+17]=a.a,X[V+18]=E,X[V+19]=A,X[V+20]=s.r,X[V+21]=s.g,X[V+22]=s.b,X[V+23]=s.a,X[V+24]=M,X[V+25]=R,X[V+26]=a.r,X[V+27]=a.g,X[V+28]=a.b,X[V+29]=a.a,X[V+30]=S,X[V+31]=T,X[V+32]=s.r,X[V+33]=s.g,X[V+34]=s.b,X[V+35]=s.a):(X[V+6]=w,X[V+7]=x,X[V+8]=I,X[V+9]=b,X[V+10]=a.r,X[V+11]=a.g,X[V+12]=a.b,X[V+13]=a.a,X[V+14]=E,X[V+15]=A,X[V+16]=M,X[V+17]=R,X[V+18]=a.r,X[V+19]=a.g,X[V+20]=a.b,X[V+21]=a.a,X[V+22]=S,X[V+23]=T),V=u.length,(J=k.setArraySize(u,V+3))[V]=f,J[V+1]=f+1,J[V+2]=f+2,f+=3;continue t}var F=h.length;if(0!=F){for(var P=b-R,N=M-I,L=v-M,O=R-y,Y=1/(P*L+N*(y-R)),D=F>>1,B=this.clipOutput,X=k.setArraySize(l,V+D*p),W=0;W<F;W+=2){var G=B[W],Z=B[W+1];X[V]=G,X[V+1]=Z,X[V+2]=a.r,X[V+3]=a.g,X[V+4]=a.b,X[V+5]=a.a;var U=G-M,_=Z-R,j=(P*U+N*_)*Y,z=(O*U+L*_)*Y,H=1-j-z;X[V+6]=w*j+E*z+S*H,X[V+7]=x*j+A*z+T*H,o&&(X[V+8]=s.r,X[V+9]=s.g,X[V+10]=s.b,X[V+11]=s.a),V+=p}V=u.length;var J=k.setArraySize(u,V+3*(D-2));D--;for(W=1;W<D;W++)J[V]=f,J[V+1]=f+W,J[V+2]=f+W+1,V+=3;f+=D+1}}},t.prototype.clip=function(t,e,r,n,i,a,s,o){var h=o,l=!1,u=null;s.length%4>=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(r),u.push(n),u.push(i),u.push(a),u.push(t),u.push(e),o.length=0;for(var d=s,c=s.length-4,p=0;;p+=2){for(var f=d[p],m=d[p+1],g=d[p+2],v=d[p+3],y=f-g,w=m-v,x=u,I=u.length-2,b=o.length,E=0;E<I;E+=2){var A=x[E],M=x[E+1],R=x[E+2],S=x[E+3],T=y*(S-v)-w*(R-g)>0;if(y*(M-v)-w*(A-g)>0){if(T){o.push(R),o.push(S);continue}var C=(F=S-M)*(g-f)-(P=R-A)*(v-m);if(Math.abs(C)>1e-6){var V=(P*(m-M)-F*(f-A))/C;o.push(f+(g-f)*V),o.push(m+(v-m)*V)}else o.push(f),o.push(m)}else if(T){var F,P;C=(F=S-M)*(g-f)-(P=R-A)*(v-m);if(Math.abs(C)>1e-6){V=(P*(m-M)-F*(f-A))/C;o.push(f+(g-f)*V),o.push(m+(v-m)*V)}else o.push(f),o.push(m);o.push(R),o.push(S)}l=!0}if(b==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),p==c)break;var k=o;(o=u).length=0,u=k}if(h!=o){h.length=0;p=0;for(var N=o.length-2;p<N;p++)h[p]=o[p]}else h.length=h.length-2;return l},t.makeClockwise=function(t){for(var e=t,r=t.length,n=e[r-2]*e[1]-e[0]*e[r-1],i=0,a=0,s=0,o=0,h=r-3;o<h;o+=2)i=e[o],a=e[o+1],s=e[o+2],n+=i*e[o+3]-s*a;if(!(n<0)){o=0;var l=r-2;for(h=r>>1;o<h;o+=2){var u=e[o],d=e[o+1],c=l-o;e[o]=e[c],e[o+1]=e[c+1],e[c]=u,e[c+1]=d}}},t}();var q=function(t){if(null==t)throw new Error("name cannot be null.");this.name=t};var K=function(t){function e(r){var n=t.call(this,r)||this;return n.id=(65535&e.nextID++)<<11,n.worldVerticesLength=0,n.deformAttachment=n,n}return n(e,t),e.prototype.computeWorldVertices=function(t,e,r,n,i,a){r=i+(r>>1)*a;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,d=0,c=0;c<e;c+=2){u+=(g=l[u])+1,d+=g}var p=s.bones;if(0==o.length)for(T=i,A=3*d;T<r;T+=a){var f=0,m=0,g=l[u++];for(g+=u;u<g;u++,A+=3){x=p[l[u]],C=h[A],V=h[A+1];var v=h[A+2];f+=(C*x.a+V*x.b+x.worldX)*v,m+=(C*x.c+V*x.d+x.worldY)*v}n[T]=f,n[T+1]=m}else for(var y=o,w=(T=i,A=3*d,d<<1);T<r;T+=a){f=0,m=0,g=l[u++];for(g+=u;u<g;u++,A+=3,w+=2){x=p[l[u]],C=h[A]+y[w],V=h[A+1]+y[w+1],v=h[A+2];f+=(C*x.a+V*x.b+x.worldX)*v,m+=(C*x.c+V*x.d+x.worldY)*v}n[T]=f,n[T+1]=m}}else{o.length>0&&(h=o);for(var x,I=(x=t.bone).worldX,b=x.worldY,E=x.a,A=x.b,M=x.c,R=x.d,S=e,T=i;T<r;S+=2,T+=a){var C=h[S],V=h[S+1];n[T]=C*E+V*A+I,n[T+1]=C*M+V*R+b}}},e.prototype.copyTo=function(t){null!=this.bones?(t.bones=new Array(this.bones.length),k.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,null!=this.vertices?(t.vertices=k.newFloatArray(this.vertices.length),k.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)):t.vertices=null,t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment},e.nextID=0,e}(q);var $=function(t){function e(e){var r=t.call(this,e)||this;return r.x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new T(1,1,1,1),r.offset=k.newFloatArray(8),r.uvs=k.newFloatArray(8),r.tempColor=new T(1,1,1,1),r}return n(e,t),e.prototype.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*t,i=-this.height/2*this.scaleY+this.region.offsetY*r,a=n+this.region.width*t,s=i+this.region.height*r,o=this.rotation*Math.PI/180,h=Math.cos(o),l=Math.sin(o),u=n*h+this.x,d=n*l,c=i*h+this.y,p=i*l,f=a*h+this.x,m=a*l,g=s*h+this.y,v=s*l,y=this.offset;y[e.OX1]=u-p,y[e.OY1]=c+d,y[e.OX2]=u-v,y[e.OY2]=g+d,y[e.OX3]=f-v,y[e.OY3]=g+m,y[e.OX4]=f-p,y[e.OY4]=c+m},e.prototype.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(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.u2,e[1]=t.v2):(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)},e.prototype.computeWorldVertices=function(t,r,n,i){var a=this.offset,s=t.worldX,o=t.worldY,h=t.a,l=t.b,u=t.c,d=t.d,c=0,p=0;c=a[e.OX1],p=a[e.OY1],r[n]=c*h+p*l+s,r[n+1]=c*u+p*d+o,n+=i,c=a[e.OX2],p=a[e.OY2],r[n]=c*h+p*l+s,r[n+1]=c*u+p*d+o,n+=i,c=a[e.OX3],p=a[e.OY3],r[n]=c*h+p*l+s,r[n+1]=c*u+p*d+o,n+=i,c=a[e.OX4],p=a[e.OY4],r[n]=c*h+p*l+s,r[n+1]=c*u+p*d+o},e.prototype.copy=function(){var t=new e(name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,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,k.arrayCopy(this.uvs,0,t.uvs,0,8),k.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t},e.OX1=0,e.OY1=1,e.OX2=2,e.OY2=3,e.OX3=4,e.OY3=5,e.OX4=6,e.OY4=7,e.X1=0,e.Y1=1,e.C1R=2,e.C1G=3,e.C1B=4,e.C1A=5,e.U1=6,e.V1=7,e.X2=8,e.Y2=9,e.C2R=10,e.C2G=11,e.C2B=12,e.C2A=13,e.U2=14,e.V2=15,e.X3=16,e.Y3=17,e.C3R=18,e.C3G=19,e.C3B=20,e.C3A=21,e.U3=22,e.V3=23,e.X4=24,e.Y4=25,e.C4R=26,e.C4G=27,e.C4B=28,e.C4A=29,e.U4=30,e.V4=31,e}(q);var tt=function(t){function e(e){var r=t.call(this,e)||this;return r.color=new T(1,1,1,1),r.tempColor=new T(0,0,0,0),r}return n(e,t),e.prototype.updateUVs=function(){var t=this.regionUVs;null!=this.uvs&&this.uvs.length==t.length||(this.uvs=k.newFloatArray(t.length));var e=this.uvs,r=this.uvs.length,n=this.region.u,i=this.region.v,a=0,s=0;if(this.region instanceof p){var o=this.region,h=o.texture.getImage().width,l=o.texture.getImage().height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/h,i-=(o.originalWidth-o.offsetX-o.width)/l,a=o.originalHeight/h,s=o.originalWidth/l;for(var u=0;u<r;u+=2)e[u]=n+t[u+1]*a,e[u+1]=i+(1-t[u])*s;return;case 180:n-=(o.originalWidth-o.offsetX-o.width)/h,i-=o.offsetY/l,a=o.originalWidth/h,s=o.originalHeight/l;for(u=0;u<r;u+=2)e[u]=n+(1-t[u])*a,e[u+1]=i+(1-t[u+1])*s;return;case 270:n-=o.offsetY/h,i-=o.offsetX/l,a=o.originalHeight/h,s=o.originalWidth/l;for(u=0;u<r;u+=2)e[u]=n+(1-t[u+1])*a,e[u+1]=i+t[u]*s;return}n-=o.offsetX/h,i-=(o.originalHeight-o.offsetY-o.height)/l,a=o.originalWidth/h,s=o.originalHeight/l}else null==this.region?(n=i=0,a=s=1):(a=this.region.u2-n,s=this.region.v2-i);for(u=0;u<r;u+=2)e[u]=n+t[u]*a,e[u+1]=i+t[u+1]*s},e.prototype.getParentMesh=function(){return this.parentMesh},e.prototype.setParentMesh=function(t){this.parentMesh=t,null!=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)},e.prototype.copy=function(){if(null!=this.parentMesh)return this.newLinkedMesh();var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),k.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),k.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),k.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,null!=this.edges&&(t.edges=new Array(this.edges.length),k.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},e.prototype.newLinkedMesh=function(){var t=new e(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t.updateUVs(),t},e}(K);var et=function(t){function e(e){var r=t.call(this,e)||this;return r.color=new T(.2275,.2275,.8078,1),r}return n(e,t),e.prototype.copy=function(){var t=new e(name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},e}(K);var rt=function(t,e,r){this.vertices=t,this.numVertices=e,this.numFloats=r};var nt=function(){function t(t,e){void 0===e&&(e=!0),this.premultipliedAlpha=!1,this.vertexEffect=null,this.tempColor=new T,this.tempColor2=new T,this.vertexSize=8,this.twoColorTint=!1,this.renderable=new rt(null,0,0),this.clipper=new Q,this.temp=new L,this.temp2=new L,this.temp3=new T,this.temp4=new T,this.twoColorTint=e,e&&(this.vertexSize+=4),this.vertices=k.newFloatArray(1024*this.vertexSize)}return t.prototype.draw=function(e,r,n,i){void 0===n&&(n=-1),void 0===i&&(i=-1);var a=this.clipper,s=this.premultipliedAlpha,o=this.twoColorTint,h=null,l=this.temp,u=this.temp2,d=this.temp3,c=this.temp4,p=this.renderable,f=null,m=null,g=r.drawOrder,y=null,w=r.color,x=o?12:8,I=!1;-1==n&&(I=!0);for(var b=0,E=g.length;b<E;b++){var A=a.isClipping()?2:x,M=g[b];if(n>=0&&n==M.data.index&&(I=!0),I){i>=0&&i==M.data.index&&(I=!1);var R=M.getAttachment(),S=null;if(R instanceof $){var T=R;p.vertices=this.vertices,p.numVertices=4,p.numFloats=A<<2,T.computeWorldVertices(M.bone,p.vertices,0,A),m=t.QUAD_TRIANGLES,f=T.uvs,S=T.region.renderObject.texture,y=T.color}else{if(!(R instanceof tt)){if(R instanceof et){var C=R;a.clipStart(M,C);continue}a.clipEndWithSlot(M);continue}var V=R;p.vertices=this.vertices,p.numVertices=V.worldVerticesLength>>1,p.numFloats=p.numVertices*A,p.numFloats>p.vertices.length&&(p.vertices=this.vertices=k.newFloatArray(p.numFloats)),V.computeWorldVertices(M,0,V.worldVerticesLength,p.vertices,0,A),m=V.triangles,S=V.region.renderObject.texture,f=V.uvs,y=V.color}if(null!=S){var F=M.color,P=this.tempColor;P.r=w.r*F.r*y.r,P.g=w.g*F.g*y.g,P.b=w.b*F.b*y.b,P.a=w.a*F.a*y.a,s&&(P.r*=P.a,P.g*=P.a,P.b*=P.a);var N=this.tempColor2;null==M.darkColor?N.set(0,0,0,1):(s?(N.r=M.darkColor.r*P.a,N.g=M.darkColor.g*P.a,N.b=M.darkColor.b*P.a):N.setFromColor(M.darkColor),N.a=s?1:0);var L=M.data.blendMode;if(L!=h&&(h=L,e.setBlendMode(v.getSourceGLBlendMode(h,s),v.getDestGLBlendMode(h))),a.isClipping()){a.clipTriangles(p.vertices,p.numFloats,m,m.length,f,P,N,o);var O=new Float32Array(a.clippedVertices),Y=a.clippedTriangles;if(null!=this.vertexEffect){var D=this.vertexEffect,B=O;if(o){W=0;for(var X=O.length;W<X;W+=x)l.x=B[W],l.y=B[W+1],d.set(B[W+2],B[W+3],B[W+4],B[W+5]),u.x=B[W+6],u.y=B[W+7],c.set(B[W+8],B[W+9],B[W+10],B[W+11]),D.transform(l,u,d,c),B[W]=l.x,B[W+1]=l.y,B[W+2]=d.r,B[W+3]=d.g,B[W+4]=d.b,B[W+5]=d.a,B[W+6]=u.x,B[W+7]=u.y,B[W+8]=c.r,B[W+9]=c.g,B[W+10]=c.b,B[W+11]=c.a}else for(var W=0,G=O.length;W<G;W+=x)l.x=B[W],l.y=B[W+1],d.set(B[W+2],B[W+3],B[W+4],B[W+5]),u.x=B[W+6],u.y=B[W+7],c.set(0,0,0,0),D.transform(l,u,d,c),B[W]=l.x,B[W+1]=l.y,B[W+2]=d.r,B[W+3]=d.g,B[W+4]=d.b,B[W+5]=d.a,B[W+6]=u.x,B[W+7]=u.y}e.draw(S,O,Y)}else{B=p.vertices;if(null!=this.vertexEffect){D=this.vertexEffect;if(o){W=0,U=0;for(var Z=p.numFloats;W<Z;W+=x,U+=2)l.x=B[W],l.y=B[W+1],u.x=f[U],u.y=f[U+1],d.setFromColor(P),c.setFromColor(N),D.transform(l,u,d,c),B[W]=l.x,B[W+1]=l.y,B[W+2]=d.r,B[W+3]=d.g,B[W+4]=d.b,B[W+5]=d.a,B[W+6]=u.x,B[W+7]=u.y,B[W+8]=c.r,B[W+9]=c.g,B[W+10]=c.b,B[W+11]=c.a}else for(var W=0,U=0,_=p.numFloats;W<_;W+=x,U+=2)l.x=B[W],l.y=B[W+1],u.x=f[U],u.y=f[U+1],d.setFromColor(P),c.set(0,0,0,0),D.transform(l,u,d,c),B[W]=l.x,B[W+1]=l.y,B[W+2]=d.r,B[W+3]=d.g,B[W+4]=d.b,B[W+5]=d.a,B[W+6]=u.x,B[W+7]=u.y}else if(o){W=2,U=0;for(var j=p.numFloats;W<j;W+=x,U+=2)B[W]=P.r,B[W+1]=P.g,B[W+2]=P.b,B[W+3]=P.a,B[W+4]=f[U],B[W+5]=f[U+1],B[W+6]=N.r,B[W+7]=N.g,B[W+8]=N.b,B[W+9]=N.a}else{W=2;for(var U=0,z=p.numFloats;W<z;W+=x,U+=2)B[W]=P.r,B[W+1]=P.g,B[W+2]=P.b,B[W+3]=P.a,B[W+4]=f[U],B[W+5]=f[U+1]}var H=p.vertices.subarray(0,p.numFloats);e.draw(S,H,m)}}a.clipEndWithSlot(M)}else a.clipEndWithSlot(M)}a.clipEnd()},t.QUAD_TRIANGLES=[0,1,2,2,3,0],t}();var it=function(t){function e(e){var r=t.call(this,e)||this;return r.color=new T(1,1,1,1),r}return n(e,t),e.prototype.copy=function(){var t=new e(name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(K);var at=function(){function t(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new N((function(){return k.newFloatArray(16)}))}return t.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var r=this.boundingBoxes,n=this.polygons,i=this.polygonPool,a=t.slots,s=a.length;r.length=0,i.freeAll(n),n.length=0;for(var o=0;o<s;o++){var h=a[o];if(h.bone.active){var l=h.getAttachment();if(l instanceof it){var u=l;r.push(u);var d=i.obtain();d.length!=u.worldVerticesLength&&(d=k.newFloatArray(u.worldVerticesLength)),n.push(d),u.computeWorldVertices(h,0,u.worldVerticesLength,d,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)},t.prototype.aabbCompute=function(){for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=this.polygons,a=0,s=i.length;a<s;a++)for(var o=i[a],h=o,l=0,u=o.length;l<u;l+=2){var d=h[l],c=h[l+1];t=Math.min(t,d),e=Math.min(e,c),r=Math.max(r,d),n=Math.max(n,c)}this.minX=t,this.minY=e,this.maxX=r,this.maxY=n},t.prototype.aabbContainsPoint=function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},t.prototype.aabbIntersectsSegment=function(t,e,r,n){var i=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=i&&r<=i||e<=a&&n<=a||t>=s&&r>=s||e>=o&&n>=o)return!1;var h=(n-e)/(r-t),l=h*(i-t)+e;if(l>a&&l<o)return!0;if((l=h*(s-t)+e)>a&&l<o)return!0;var u=(a-e)/h+t;return u>i&&u<s||(u=(o-e)/h+t)>i&&u<s},t.prototype.aabbIntersectsSkeleton=function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},t.prototype.containsPoint=function(t,e){for(var r=this.polygons,n=0,i=r.length;n<i;n++)if(this.containsPointPolygon(r[n],t,e))return this.boundingBoxes[n];return null},t.prototype.containsPointPolygon=function(t,e,r){for(var n=t,i=t.length,a=i-2,s=!1,o=0;o<i;o+=2){var h=n[o+1],l=n[a+1];if(h<r&&l>=r||l<r&&h>=r){var u=n[o];u+(r-h)/(l-h)*(n[a]-u)<e&&(s=!s)}a=o}return s},t.prototype.intersectsSegment=function(t,e,r,n){for(var i=this.polygons,a=0,s=i.length;a<s;a++)if(this.intersectsSegmentPolygon(i[a],t,e,r,n))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(t,e,r,n,i){for(var a=t,s=t.length,o=e-n,h=r-i,l=e*i-r*n,u=a[s-2],d=a[s-1],c=0;c<s;c+=2){var p=a[c],f=a[c+1],m=u*f-d*p,g=u-p,v=d-f,y=o*v-h*g,w=(l*g-o*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=e&&w<=n||w>=n&&w<=e)){var x=(l*v-h*m)/y;if((x>=d&&x<=f||x>=f&&x<=d)&&(x>=r&&x<=i||x>=i&&x<=r))return!0}u=p,d=f}return!1},t.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t}();var st=function(t){function e(e){var r=t.call(this,e)||this;return r.closed=!1,r.constantSpeed=!1,r.color=new T(1,1,1,1),r}return n(e,t),e.prototype.copy=function(){var t=new e(name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),k.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},e}(K);var ot=function(){function t(t){this.boneLineColor=new T(1,0,0,1),this.boneOriginColor=new T(0,1,0,1),this.attachmentLineColor=new T(0,0,1,.5),this.triangleLineColor=new T(1,.64,0,.5),this.pathColor=(new T).setFromString("FF7F00"),this.clipColor=new T(.8,0,0,2),this.aabbColor=new T(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 at,this.temp=new Array,this.vertices=k.newFloatArray(2048),this.context=t instanceof g?t:new g(t)}return t.prototype.draw=function(e,r,n){void 0===n&&(n=null);var i=r.x,a=r.y,s=this.context.gl,o=this.premultipliedAlpha?s.ONE:s.SRC_ALPHA;e.setBlendMode(o,s.ONE_MINUS_SRC_ALPHA);var h=r.bones;if(this.drawBones){e.setColor(this.boneLineColor);for(var l=0,u=h.length;l<u;l++){var d=h[l];if(!(n&&n.indexOf(d.data.name)>-1)&&null!=d.parent){var c=i+d.data.length*d.a+d.worldX,p=a+d.data.length*d.c+d.worldY;e.rectLine(!0,i+d.worldX,a+d.worldY,c,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(i,a,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(l=0,u=(G=r.slots).length;l<u;l++){if((U=(Z=G[l]).getAttachment())instanceof $){var f=U,m=this.vertices;f.computeWorldVertices(Z.bone,m,0,2),e.line(m[0],m[1],m[2],m[3]),e.line(m[2],m[3],m[4],m[5]),e.line(m[4],m[5],m[6],m[7]),e.line(m[6],m[7],m[0],m[1])}}}if(this.drawMeshHull||this.drawMeshTriangles)for(l=0,u=(G=r.slots).length;l<u;l++){if((U=(Z=G[l]).getAttachment())instanceof tt){var g=U;m=this.vertices;g.computeWorldVertices(Z,0,g.worldVerticesLength,m,0,2);var v=g.triangles,y=g.hullLength;if(this.drawMeshTriangles){e.setColor(this.triangleLineColor);for(var w=0,x=v.length;w<x;w+=3){var I=2*v[w],b=2*v[w+1],E=2*v[w+2];e.triangle(!1,m[I],m[I+1],m[b],m[b+1],m[E],m[E+1])}}if(this.drawMeshHull&&y>0){e.setColor(this.attachmentLineColor);var A=m[(y=2*(y>>1))-2],M=m[y-1];for(w=0,x=y;w<x;w+=2){c=m[w],p=m[w+1];e.line(c,p,A,M),A=c,M=p}}}}if(this.drawBoundingBoxes){var R=this.bounds;R.update(r,!0),e.setColor(this.aabbColor),e.rect(!1,R.minX,R.minY,R.getWidth(),R.getHeight());var S=R.polygons,T=R.boundingBoxes;for(l=0,u=S.length;l<u;l++){var C=S[l];e.setColor(T[l].color),e.polygon(C,0,C.length)}}if(this.drawPaths)for(l=0,u=(G=r.slots).length;l<u;l++){if((U=(Z=G[l]).getAttachment())instanceof st){var V=U,F=(x=V.worldVerticesLength,this.temp=k.setArraySize(this.temp,x,0));V.computeWorldVertices(Z,0,x,F,0,2);var P=this.pathColor,N=F[2],L=F[3],O=0,Y=0;if(V.closed){e.setColor(P);var D=F[0],B=F[1],X=F[x-2],W=F[x-1];O=F[x-4],Y=F[x-3],e.curve(N,L,D,B,X,W,O,Y,32),e.setColor(t.LIGHT_GRAY),e.line(N,L,D,B),e.line(O,Y,X,W)}x-=4;for(w=4;w<x;w+=6){D=F[w],B=F[w+1],X=F[w+2],W=F[w+3];O=F[w+4],Y=F[w+5],e.setColor(P),e.curve(N,L,D,B,X,W,O,Y,32),e.setColor(t.LIGHT_GRAY),e.line(N,L,D,B),e.line(O,Y,X,W),N=O,L=Y}}}if(this.drawBones){e.setColor(this.boneOriginColor);for(l=0,u=h.length;l<u;l++){d=h[l];n&&n.indexOf(d.data.name)>-1||e.circle(!0,i+d.worldX,a+d.worldY,3*this.scale,t.GREEN,8)}}if(this.drawClipping){var G=r.slots;e.setColor(this.clipColor);for(l=0,u=G.length;l<u;l++){var Z,U;if((U=(Z=G[l]).getAttachment())instanceof et){var _=U;x=_.worldVerticesLength,F=this.temp=k.setArraySize(this.temp,x,0);_.computeWorldVertices(Z,0,x,F,0,2);for(var j=0,z=F.length;j<z;j+=2){c=F[j],p=F[j+1],O=F[(j+2)%F.length],Y=F[(j+3)%F.length];e.line(c,p,O,Y)}}}}},t.prototype.dispose=function(){},t.LIGHT_GRAY=new T(192/255,192/255,192/255,1),t.GREEN=new T(0,1,0,1),t}();var ht=function(){function t(t,e,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[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],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new T(1,1,1,1),this.canvas=t,this.context=e instanceof g?e:new g(e),this.twoColorTint=r,this.camera=new R(t.width,t.height),this.batcherShader=r?D.newTwoColoredTextured(this.context):D.newColoredTextured(this.context),this.batcher=new j(this.context,r),this.shapesShader=D.newColored(this.context),this.shapes=new z(this.context),this.skeletonRenderer=new nt(this.context,r),this.skeletonDebugRenderer=new ot(this.context)}return t.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},t.prototype.drawSkeleton=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r=-1),void 0===n&&(n=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,r,n)},t.prototype.drawSkeletonDebug=function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,r)},t.prototype.drawTexture=function(t,e,r,n,i,a){void 0===a&&(a=null),this.enableRenderer(this.batcher),null===a&&(a=this.WHITE);var s=this.QUAD,o=0;s[o++]=e,s[o++]=r,s[o++]=a.r,s[o++]=a.g,s[o++]=a.b,s[o++]=a.a,s[o++]=0,s[o++]=1,this.twoColorTint&&(s[o++]=0,s[o++]=0,s[o++]=0,s[o++]=0),s[o++]=e+n,s[o++]=r,s[o++]=a.r,s[o++]=a.g,s[o++]=a.b,s[o++]=a.a,s[o++]=1,s[o++]=1,this.twoColorTint&&(s[o++]=0,s[o++]=0,s[o++]=0,s[o++]=0),s[o++]=e+n,s[o++]=r+i,s[o++]=a.r,s[o++]=a.g,s[o++]=a.b,s[o++]=a.a,s[o++]=1,s[o++]=0,this.twoColorTint&&(s[o++]=0,s[o++]=0,s[o++]=0,s[o++]=0),s[o++]=e,s[o++]=r+i,s[o++]=a.r,s[o++]=a.g,s[o++]=a.b,s[o++]=a.a,s[o++]=0,s[o++]=0,this.twoColorTint&&(s[o++]=0,s[o++]=0,s[o++]=0,s[o++]=0),this.batcher.draw(t,s,this.QUAD_TRIANGLES)},t.prototype.drawTextureUV=function(t,e,r,n,i,a,s,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,d=0;u[d++]=e,u[d++]=r,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=a,u[d++]=s,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=e+n,u[d++]=r,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=o,u[d++]=s,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=e+n,u[d++]=r+i,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=o,u[d++]=h,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=e,u[d++]=r+i,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=a,u[d++]=h,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},t.prototype.drawTextureRotated=function(t,e,r,n,i,a,s,o,h,l){void 0===h&&(h=null),void 0===l&&(l=!1),this.enableRenderer(this.batcher),null===h&&(h=this.WHITE);var u=this.QUAD,d=e+a,c=r+s,p=-a,f=-s,m=n-a,g=i-s,v=p,y=f,w=p,x=g,I=m,b=g,E=m,A=f,M=0,R=0,S=0,T=0,V=0,F=0,P=0,k=0;if(0!=o){var N=C.cosDeg(o),L=C.sinDeg(o);S=(V=N*I-L*b)+((M=N*v-L*y)-(P=N*w-L*x)),T=(F=L*I+N*b)+((R=L*v+N*y)-(k=L*w+N*x))}else M=v,R=y,P=w,k=x,V=I,F=b,S=E,T=A;M+=d,R+=c,S+=d,T+=c,V+=d,F+=c,P+=d,k+=c;var O=0;u[O++]=M,u[O++]=R,u[O++]=h.r,u[O++]=h.g,u[O++]=h.b,u[O++]=h.a,u[O++]=0,u[O++]=1,this.twoColorTint&&(u[O++]=0,u[O++]=0,u[O++]=0,u[O++]=0),u[O++]=S,u[O++]=T,u[O++]=h.r,u[O++]=h.g,u[O++]=h.b,u[O++]=h.a,u[O++]=1,u[O++]=1,this.twoColorTint&&(u[O++]=0,u[O++]=0,u[O++]=0,u[O++]=0),u[O++]=V,u[O++]=F,u[O++]=h.r,u[O++]=h.g,u[O++]=h.b,u[O++]=h.a,u[O++]=1,u[O++]=0,this.twoColorTint&&(u[O++]=0,u[O++]=0,u[O++]=0,u[O++]=0),u[O++]=P,u[O++]=k,u[O++]=h.r,u[O++]=h.g,u[O++]=h.b,u[O++]=h.a,u[O++]=0,u[O++]=0,this.twoColorTint&&(u[O++]=0,u[O++]=0,u[O++]=0,u[O++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},t.prototype.drawRegion=function(t,e,r,n,i,a,s){void 0===a&&(a=null),void 0===s&&(s=!1),this.enableRenderer(this.batcher),null===a&&(a=this.WHITE);var o=this.QUAD,h=0;o[h++]=e,o[h++]=r,o[h++]=a.r,o[h++]=a.g,o[h++]=a.b,o[h++]=a.a,o[h++]=t.u,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=r,o[h++]=a.r,o[h++]=a.g,o[h++]=a.b,o[h++]=a.a,o[h++]=t.u2,o[h++]=t.v2,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e+n,o[h++]=r+i,o[h++]=a.r,o[h++]=a.g,o[h++]=a.b,o[h++]=a.a,o[h++]=t.u2,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),o[h++]=e,o[h++]=r+i,o[h++]=a.r,o[h++]=a.g,o[h++]=a.b,o[h++]=a.a,o[h++]=t.u,o[h++]=t.v,this.twoColorTint&&(o[h++]=0,o[h++]=0,o[h++]=0,o[h++]=0),this.batcher.draw(t.texture,o,this.QUAD_TRIANGLES)},t.prototype.line=function(t,e,r,n,i,a){void 0===i&&(i=null),void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,r,n,i)},t.prototype.triangle=function(t,e,r,n,i,a,s,o,h,l){void 0===o&&(o=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,r,n,i,a,s,o,h,l)},t.prototype.quad=function(t,e,r,n,i,a,s,o,h,l,u,d,c){void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===c&&(c=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,r,n,i,a,s,o,h,l,u,d,c)},t.prototype.rect=function(t,e,r,n,i,a){void 0===a&&(a=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,r,n,i,a)},t.prototype.rectLine=function(t,e,r,n,i,a,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,r,n,i,a,s)},t.prototype.polygon=function(t,e,r,n){void 0===n&&(n=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,r,n)},t.prototype.circle=function(t,e,r,n,i,a){void 0===i&&(i=null),void 0===a&&(a=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,r,n,i,a)},t.prototype.curve=function(t,e,r,n,i,a,s,o,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,r,n,i,a,s,o,h,l)},t.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},t.prototype.resize=function(t){var e=this.canvas,r=e.clientWidth,n=e.clientHeight;if(e.width==r&&e.height==n||(e.width=r,e.height=n),this.context.gl.viewport(0,0,e.width,e.height),t===lt.Stretch);else if(t===lt.Expand)this.camera.setViewport(r,n);else if(t===lt.Fit){var i=e.width,a=e.height,s=this.camera.viewportWidth,o=this.camera.viewportHeight,h=o/s<a/i?s/i:o/a;this.camera.viewportWidth=i*h,this.camera.viewportHeight=a*h}this.camera.update()},t.prototype.enableRenderer=function(t){this.activeRenderer!==t&&(this.end(),t instanceof j?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(D.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi("u_texture",0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):t instanceof z?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(D.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)},t.prototype.dispose=function(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()},t}();var lt={Stretch:0,Expand:1,Fit:2};lt[lt.Stretch]="Stretch",lt[lt.Expand]="Expand",lt[lt.Fit]="Fit";!function(){function t(e){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.timeKeeper=new O,this.backgroundColor=new T(.135,.135,.135,1),this.tempColor=new T,this.firstDraw=0,this.renderer=e,this.timeKeeper.maxDelta=9,null===t.logoImg){var r=navigator.userAgent.indexOf("Safari")>-1;t.logoImg=new Image,t.logoImg.src=t.SPINE_LOGO_DATA,r||(t.logoImg.crossOrigin="anonymous"),t.logoImg.onload=function(e){t.loaded++},t.spinnerImg=new Image,t.spinnerImg.src=t.SPINNER_DATA,r||(t.spinnerImg.crossOrigin="anonymous"),t.spinnerImg.onload=function(e){t.loaded++}}}t.prototype.draw=function(e){if(void 0===e&&(e=!1),!(e&&this.fadeOut>t.FADE_SECONDS)){this.timeKeeper.update();var r=Math.abs(Math.sin(this.timeKeeper.totalTime+.75));this.angle-=this.timeKeeper.delta/1.4*360*(1+1.5*Math.pow(r,5));var n=this.renderer,i=n.canvas,a=n.context.gl;n.resize(lt.Stretch);var s=n.camera.position.x,o=n.camera.position.y;if(n.camera.position.set(i.width/2,i.height/2,0),n.camera.viewportWidth=i.width,n.camera.viewportHeight=i.height,e){if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>t.FADE_SECONDS)return void n.camera.position.set(s,o,0);r=1-this.fadeOut/t.FADE_SECONDS,this.tempColor.setFromColor(this.backgroundColor),this.tempColor.a=1-(r-1)*(r-1),n.begin(),n.quad(!0,0,0,i.width,0,i.width,i.height,0,i.height,this.tempColor,this.tempColor,this.tempColor,this.tempColor),n.end()}else a.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),a.clear(a.COLOR_BUFFER_BIT),this.tempColor.a=1;if(this.tempColor.set(1,1,1,this.tempColor.a),2==t.loaded){null===this.logo&&(this.logo=new y(n.context,t.logoImg),this.spinner=new y(n.context,t.spinnerImg)),this.logo.update(!1),this.spinner.update(!1);var h=this.logo.getImage().width,l=this.logo.getImage().height,u=this.spinner.getImage().width,d=this.spinner.getImage().height;n.batcher.setBlendMode(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),n.begin(),n.drawTexture(this.logo,(i.width-h)/2,(i.height-l)/2,h,l,this.tempColor),n.drawTextureRotated(this.spinner,(i.width-u)/2,(i.height-d)/2,u,d,u/2,d/2,this.angle,this.tempColor),n.end(),n.camera.position.set(s,o,0)}}},t.FADE_SECONDS=1,t.loaded=0,t.spinnerImg=null,t.logoImg=null,t.SPINNER_DATA="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAP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82UkAVmnhymKIgi0TnA/8hRNPKmqqHkVUsnwBR91Meqjiocd5ZASgQKFT4nT1DDA6TUdSOaymXAFEkniZp7FSOBdAU9LOkVqgBQp4BkLieKgLUqkzXvVuDx7EMEQl35URHoIAmODMAqFJIZyjjNKqriE8a8yXynAxsIdgRrp/KabxkYow6kjFKIqqjKZDnhvAFELYNO8w3Jjuc15yLmmjWoUQZlnIT5UgGmjGqyjLtUrXy6oGRRTl2QivqwrJaJG2KZ5DQvsKwmmccHZVVD2fSSLmXk6XxRSHgVU5U6iqqnFJSyYKqAU+QGiJVAh2oClUdhqeLjSgOpSjFkTbwOVRXNGEDB9aCSwFIFHa3DFZBRfi1Q6gBTFk4Rs63zGijrFIg/ylRt7lW3m6kOUagQqiJ5orFONKJtHR0ok/vUAaPKOrbRt2owZZVTJmhRDaKOYW26I1st06yoBFKmk4jD61UCShSfq1OdpTLgUDW6R8t87rqcfZ1BlMr6uq6Vjhf2owGvozDKmG9dyiQCeTSAiwXVdNIP1A2uls7QkYhW/fgzVgIeXVOe6ISFOnSOjjn+uuHsK5F2NM1hLG/jSGfpjoSdjLSJg7Cp7FjaR7ZzXEGcinBJDF8DnZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII="}();var ut=function(){function t(t,e,r){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n<e.length;n++)this.timelineIds[e[n].getPropertyId()]=!0;this.duration=r}return t.prototype.hasTimeline=function(t){return 1==this.timelineIds[t]},t.prototype.apply=function(t,e,r,n,i,a,s,o){if(null==t)throw new Error("skeleton cannot be null.");n&&0!=this.duration&&(r%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l<u;l++)h[l].apply(t,e,r,i,a,s,o)},t.binarySearch=function(t,e,r){void 0===r&&(r=1);var n=0,i=t.length/r-2;if(0==i)return r;for(var a=i>>>1;;){if(t[(a+1)*r]<=e?n=a+1:i=a,n==i)return(n+1)*r;a=n+i>>>1}},t.linearSearch=function(t,e,r){for(var n=0,i=t.length-r;n<=i;n+=r)if(t[n]>e)return n;return-1},t}();var dt={setup:0,first:1,replace:2,add:3};dt[dt.setup]="setup",dt[dt.first]="first",dt[dt.replace]="replace",dt[dt.add]="add";var ct={mixIn:0,mixOut:1};ct[ct.mixIn]="mixIn",ct[ct.mixOut]="mixOut";var pt={rotate:0,translate:1,scale:2,shear:3,attachment:4,color:5,deform:6,event:7,drawOrder:8,ikConstraint:9,transformConstraint:10,pathConstraintPosition:11,pathConstraintSpacing:12,pathConstraintMix:13,twoColor:14};pt[pt.rotate]="rotate",pt[pt.translate]="translate",pt[pt.scale]="scale",pt[pt.shear]="shear",pt[pt.attachment]="attachment",pt[pt.color]="color",pt[pt.deform]="deform",pt[pt.event]="event",pt[pt.drawOrder]="drawOrder",pt[pt.ikConstraint]="ikConstraint",pt[pt.transformConstraint]="transformConstraint",pt[pt.pathConstraintPosition]="pathConstraintPosition",pt[pt.pathConstraintSpacing]="pathConstraintSpacing",pt[pt.pathConstraintMix]="pathConstraintMix",pt[pt.twoColor]="twoColor";var ft=function(){function t(e){if(e<=0)throw new Error("frameCount must be > 0: "+e);this.curves=k.newFloatArray((e-1)*t.BEZIER_SIZE)}return t.prototype.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},t.prototype.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},t.prototype.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},t.prototype.getCurveType=function(e){var r=e*t.BEZIER_SIZE;if(r==this.curves.length)return t.LINEAR;var n=this.curves[r];return n==t.LINEAR?t.LINEAR:n==t.STEPPED?t.STEPPED:t.BEZIER},t.prototype.setCurve=function(e,r,n,i,a){var s=.03*(2*-r+i),o=.03*(2*-n+a),h=.006*(3*(r-i)+1),l=.006*(3*(n-a)+1),u=2*s+h,d=2*o+l,c=.3*r+s+.16666667*h,p=.3*n+o+.16666667*l,f=e*t.BEZIER_SIZE,m=this.curves;m[f++]=t.BEZIER;for(var g=c,v=p,y=f+t.BEZIER_SIZE-1;f<y;f+=2)m[f]=g,m[f+1]=v,c+=u,p+=d,u+=h,d+=l,g+=c,v+=p},t.prototype.getCurvePercent=function(e,r){r=C.clamp(r,0,1);var n=this.curves,i=e*t.BEZIER_SIZE,a=n[i];if(a==t.LINEAR)return r;if(a==t.STEPPED)return 0;for(var s=0,o=++i,h=i+t.BEZIER_SIZE-1;i<h;i+=2)if((s=n[i])>=r){var l=void 0,u=void 0;return i==o?(l=0,u=0):(l=n[i-2],u=n[i-1]),u+(n[i+1]-u)*(r-l)/(s-l)}var d=n[i-1];return d+(1-d)*(r-s)/(1-s)},t.LINEAR=0,t.STEPPED=1,t.BEZIER=2,t.BEZIER_SIZE=19,t}();var mt=function(t){function e(e){var r=t.call(this,e)||this;return r.frames=k.newFloatArray(e<<1),r}return n(e,t),e.prototype.getPropertyId=function(){return(pt.rotate<<24)+this.boneIndex},e.prototype.setFrame=function(t,r,n){t<<=1,this.frames[t]=r,this.frames[t+e.ROTATION]=n},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return void(l.rotation=l.data.rotation);case dt.first:var u=l.data.rotation-l.rotation;l.rotation+=(u-360*(16384-(16384.499999999996-u/360|0)))*a}else if(n>=h[h.length-e.ENTRIES]){var d=h[h.length+e.PREV_ROTATION];switch(s){case dt.setup:l.rotation=l.data.rotation+d*a;break;case dt.first:case dt.replace:d+=l.data.rotation-l.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case dt.add:l.rotation+=d*a}}else{var c=ut.binarySearch(h,n,e.ENTRIES),p=h[c+e.PREV_ROTATION],f=h[c],m=this.getCurvePercent((c>>1)-1,1-(n-f)/(h[c+e.PREV_TIME]-f)),g=h[c+e.ROTATION]-p;switch(g=p+(g-360*(16384-(16384.499999999996-g/360|0)))*m,s){case dt.setup:l.rotation=l.data.rotation+(g-360*(16384-(16384.499999999996-g/360|0)))*a;break;case dt.first:case dt.replace:g+=l.data.rotation-l.rotation;case dt.add:l.rotation+=(g-360*(16384-(16384.499999999996-g/360|0)))*a}}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_ROTATION=-1,e.ROTATION=1,e}(ft);var gt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.translate<<24)+this.boneIndex},e.prototype.setFrame=function(t,r,n,i){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.X]=n,this.frames[t+e.Y]=i},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return l.x=l.data.x,void(l.y=l.data.y);case dt.first:l.x+=(l.data.x-l.x)*a,l.y+=(l.data.y-l.y)*a}else{var u=0,d=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],d=h[h.length+e.PREV_Y];else{var c=ut.binarySearch(h,n,e.ENTRIES);u=h[c+e.PREV_X],d=h[c+e.PREV_Y];var p=h[c],f=this.getCurvePercent(c/e.ENTRIES-1,1-(n-p)/(h[c+e.PREV_TIME]-p));u+=(h[c+e.X]-u)*f,d+=(h[c+e.Y]-d)*f}switch(s){case dt.setup:l.x=l.data.x+u*a,l.y=l.data.y+d*a;break;case dt.first:case dt.replace:l.x+=(l.data.x+u-l.x)*a,l.y+=(l.data.y+d-l.y)*a;break;case dt.add:l.x+=u*a,l.y+=d*a}}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_X=-2,e.PREV_Y=-1,e.X=1,e.Y=2,e}(ft);var vt=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getPropertyId=function(){return(pt.scale<<24)+this.boneIndex},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return l.scaleX=l.data.scaleX,void(l.scaleY=l.data.scaleY);case dt.first:l.scaleX+=(l.data.scaleX-l.scaleX)*a,l.scaleY+=(l.data.scaleY-l.scaleY)*a}else{var u=0,d=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X]*l.data.scaleX,d=h[h.length+e.PREV_Y]*l.data.scaleY;else{var c=ut.binarySearch(h,n,e.ENTRIES);u=h[c+e.PREV_X],d=h[c+e.PREV_Y];var p=h[c],f=this.getCurvePercent(c/e.ENTRIES-1,1-(n-p)/(h[c+e.PREV_TIME]-p));u=(u+(h[c+e.X]-u)*f)*l.data.scaleX,d=(d+(h[c+e.Y]-d)*f)*l.data.scaleY}if(1==a)s==dt.add?(l.scaleX+=u-l.data.scaleX,l.scaleY+=d-l.data.scaleY):(l.scaleX=u,l.scaleY=d);else{var m=0,g=0;if(o==ct.mixOut)switch(s){case dt.setup:m=l.data.scaleX,g=l.data.scaleY,l.scaleX=m+(Math.abs(u)*C.signum(m)-m)*a,l.scaleY=g+(Math.abs(d)*C.signum(g)-g)*a;break;case dt.first:case dt.replace:m=l.scaleX,g=l.scaleY,l.scaleX=m+(Math.abs(u)*C.signum(m)-m)*a,l.scaleY=g+(Math.abs(d)*C.signum(g)-g)*a;break;case dt.add:m=l.scaleX,g=l.scaleY,l.scaleX=m+(Math.abs(u)*C.signum(m)-l.data.scaleX)*a,l.scaleY=g+(Math.abs(d)*C.signum(g)-l.data.scaleY)*a}else switch(s){case dt.setup:m=Math.abs(l.data.scaleX)*C.signum(u),g=Math.abs(l.data.scaleY)*C.signum(d),l.scaleX=m+(u-m)*a,l.scaleY=g+(d-g)*a;break;case dt.first:case dt.replace:m=Math.abs(l.scaleX)*C.signum(u),g=Math.abs(l.scaleY)*C.signum(d),l.scaleX=m+(u-m)*a,l.scaleY=g+(d-g)*a;break;case dt.add:m=C.signum(u),g=C.signum(d),l.scaleX=Math.abs(l.scaleX)*m+(u-Math.abs(l.data.scaleX)*m)*a,l.scaleY=Math.abs(l.scaleY)*g+(d-Math.abs(l.data.scaleY)*g)*a}}}},e}(gt),yt=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getPropertyId=function(){return(pt.shear<<24)+this.boneIndex},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.bones[this.boneIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return l.shearX=l.data.shearX,void(l.shearY=l.data.shearY);case dt.first:l.shearX+=(l.data.shearX-l.shearX)*a,l.shearY+=(l.data.shearY-l.shearY)*a}else{var u=0,d=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_X],d=h[h.length+e.PREV_Y];else{var c=ut.binarySearch(h,n,e.ENTRIES);u=h[c+e.PREV_X],d=h[c+e.PREV_Y];var p=h[c],f=this.getCurvePercent(c/e.ENTRIES-1,1-(n-p)/(h[c+e.PREV_TIME]-p));u+=(h[c+e.X]-u)*f,d+=(h[c+e.Y]-d)*f}switch(s){case dt.setup:l.shearX=l.data.shearX+u*a,l.shearY=l.data.shearY+d*a;break;case dt.first:case dt.replace:l.shearX+=(l.data.shearX+u-l.shearX)*a,l.shearY+=(l.data.shearY+d-l.shearY)*a;break;case dt.add:l.shearX+=u*a,l.shearY+=d*a}}},e}(gt),wt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.color<<24)+this.slotIndex},e.prototype.setFrame=function(t,r,n,i,a,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=n,this.frames[t+e.G]=i,this.frames[t+e.B]=a,this.frames[t+e.A]=s},e.prototype.apply=function(t,r,n,i,a,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(n<l[0])switch(s){case dt.setup:return void h.color.setFromColor(h.data.color);case dt.first:var u=h.color,d=h.data.color;u.add((d.r-u.r)*a,(d.g-u.g)*a,(d.b-u.b)*a,(d.a-u.a)*a)}else{var c=0,p=0,f=0,m=0;if(n>=l[l.length-e.ENTRIES]){var g=l.length;c=l[g+e.PREV_R],p=l[g+e.PREV_G],f=l[g+e.PREV_B],m=l[g+e.PREV_A]}else{var v=ut.binarySearch(l,n,e.ENTRIES);c=l[v+e.PREV_R],p=l[v+e.PREV_G],f=l[v+e.PREV_B],m=l[v+e.PREV_A];var y=l[v],w=this.getCurvePercent(v/e.ENTRIES-1,1-(n-y)/(l[v+e.PREV_TIME]-y));c+=(l[v+e.R]-c)*w,p+=(l[v+e.G]-p)*w,f+=(l[v+e.B]-f)*w,m+=(l[v+e.A]-m)*w}if(1==a)h.color.set(c,p,f,m);else{u=h.color;s==dt.setup&&u.setFromColor(h.data.color),u.add((c-u.r)*a,(p-u.g)*a,(f-u.b)*a,(m-u.a)*a)}}}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_R=-4,e.PREV_G=-3,e.PREV_B=-2,e.PREV_A=-1,e.R=1,e.G=2,e.B=3,e.A=4,e}(ft);var xt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.twoColor<<24)+this.slotIndex},e.prototype.setFrame=function(t,r,n,i,a,s,o,h,l){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.R]=n,this.frames[t+e.G]=i,this.frames[t+e.B]=a,this.frames[t+e.A]=s,this.frames[t+e.R2]=o,this.frames[t+e.G2]=h,this.frames[t+e.B2]=l},e.prototype.apply=function(t,r,n,i,a,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=this.frames;if(n<l[0])switch(s){case dt.setup:return h.color.setFromColor(h.data.color),void h.darkColor.setFromColor(h.data.darkColor);case dt.first:var u=h.color,d=h.darkColor,c=h.data.color,p=h.data.darkColor;u.add((c.r-u.r)*a,(c.g-u.g)*a,(c.b-u.b)*a,(c.a-u.a)*a),d.add((p.r-d.r)*a,(p.g-d.g)*a,(p.b-d.b)*a,0)}else{var f=0,m=0,g=0,v=0,y=0,w=0,x=0;if(n>=l[l.length-e.ENTRIES]){var I=l.length;f=l[I+e.PREV_R],m=l[I+e.PREV_G],g=l[I+e.PREV_B],v=l[I+e.PREV_A],y=l[I+e.PREV_R2],w=l[I+e.PREV_G2],x=l[I+e.PREV_B2]}else{var b=ut.binarySearch(l,n,e.ENTRIES);f=l[b+e.PREV_R],m=l[b+e.PREV_G],g=l[b+e.PREV_B],v=l[b+e.PREV_A],y=l[b+e.PREV_R2],w=l[b+e.PREV_G2],x=l[b+e.PREV_B2];var E=l[b],A=this.getCurvePercent(b/e.ENTRIES-1,1-(n-E)/(l[b+e.PREV_TIME]-E));f+=(l[b+e.R]-f)*A,m+=(l[b+e.G]-m)*A,g+=(l[b+e.B]-g)*A,v+=(l[b+e.A]-v)*A,y+=(l[b+e.R2]-y)*A,w+=(l[b+e.G2]-w)*A,x+=(l[b+e.B2]-x)*A}if(1==a)h.color.set(f,m,g,v),h.darkColor.set(y,w,x,1);else{u=h.color,d=h.darkColor;s==dt.setup&&(u.setFromColor(h.data.color),d.setFromColor(h.data.darkColor)),u.add((f-u.r)*a,(m-u.g)*a,(g-u.b)*a,(v-u.a)*a),d.add((y-d.r)*a,(w-d.g)*a,(x-d.b)*a,0)}}}},e.ENTRIES=8,e.PREV_TIME=-8,e.PREV_R=-7,e.PREV_G=-6,e.PREV_B=-5,e.PREV_A=-4,e.PREV_R2=-3,e.PREV_G2=-2,e.PREV_B2=-1,e.R=1,e.G=2,e.B=3,e.A=4,e.R2=5,e.G2=6,e.B2=7,e}(ft);var It=function(){function t(t){this.frames=k.newFloatArray(t),this.attachmentNames=new Array(t)}return t.prototype.getPropertyId=function(){return(pt.attachment<<24)+this.slotIndex},t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,r){this.frames[t]=e,this.attachmentNames[t]=r},t.prototype.apply=function(t,e,r,n,i,a,s){var o=t.slots[this.slotIndex];if(o.bone.active)if(s!=ct.mixOut||a!=dt.setup){var h=this.frames;if(r<h[0]){if(a==dt.setup||a==dt.first){var l=o.data.attachmentName;o.setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))}}else{var u=0;u=r>=h[h.length-1]?h.length-1:ut.binarySearch(h,r,1)-1;var d=this.attachmentNames[u];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var c=o.data.attachmentName;o.setAttachment(null==c?null:t.getAttachment(this.slotIndex,c))}},t}();var bt=null,Et=function(t){function e(e){var r=t.call(this,e)||this;return r.frames=k.newFloatArray(e),r.frameVertices=new Array(e),null==bt&&(bt=k.newFloatArray(64)),r}return n(e,t),e.prototype.getPropertyId=function(){return(pt.deform<<27)+ +this.attachment.id+this.slotIndex},e.prototype.setFrame=function(t,e,r){this.frames[t]=e,this.frameVertices[t]=r},e.prototype.apply=function(t,e,r,n,i,a,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof K&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(a=dt.setup);var u=this.frameVertices,d=u[0].length,c=this.frames;if(r<c[0]){var p=h;switch(a){case dt.setup:return void(l.length=0);case dt.first:if(1==i){l.length=0;break}var f=k.setArraySize(l,d);if(null==p.bones)for(var m=p.vertices,g=0;g<d;g++)f[g]+=(m[g]-f[g])*i;else{i=1-i;for(g=0;g<d;g++)f[g]*=i}}}else{var v=k.setArraySize(l,d);if(r>=c[c.length-1]){var y=u[c.length-1];if(1==i)if(a==dt.add)if(null==(p=h).bones){m=p.vertices;for(var w=0;w<d;w++)v[w]+=y[w]-m[w]}else for(var x=0;x<d;x++)v[x]+=y[x];else k.arrayCopy(y,0,v,0,d);else switch(a){case dt.setup:var I=h;if(null==I.bones){m=I.vertices;for(var b=0;b<d;b++){var E=m[b];v[b]=E+(y[b]-E)*i}}else for(var A=0;A<d;A++)v[A]=y[A]*i;break;case dt.first:case dt.replace:for(var M=0;M<d;M++)v[M]+=(y[M]-v[M])*i;case dt.add:if(null==(p=h).bones){m=p.vertices;for(var R=0;R<d;R++)v[R]+=(y[R]-m[R])*i}else for(var S=0;S<d;S++)v[S]+=y[S]*i}}else{var T=ut.binarySearch(c,r),C=u[T-1],V=u[T],F=c[T],P=this.getCurvePercent(T-1,1-(r-F)/(c[T-1]-F));if(1==i)if(a==dt.add)if(null==(p=h).bones){m=p.vertices;for(var N=0;N<d;N++){var L=C[N];v[N]+=L+(V[N]-L)*P-m[N]}}else for(var O=0;O<d;O++){L=C[O];v[O]+=L+(V[O]-L)*P}else for(var Y=0;Y<d;Y++){L=C[Y];v[Y]=L+(V[Y]-L)*P}else switch(a){case dt.setup:var D=h;if(null==D.bones){m=D.vertices;for(var B=0;B<d;B++){L=C[B],E=m[B];v[B]=E+(L+(V[B]-L)*P-E)*i}}else for(var X=0;X<d;X++){L=C[X];v[X]=(L+(V[X]-L)*P)*i}break;case dt.first:case dt.replace:for(var W=0;W<d;W++){L=C[W];v[W]+=(L+(V[W]-L)*P-v[W])*i}break;case dt.add:if(null==(p=h).bones){m=p.vertices;for(var G=0;G<d;G++){L=C[G];v[G]+=(L+(V[G]-L)*P-m[G])*i}}else for(var Z=0;Z<d;Z++){L=C[Z];v[Z]+=(L+(V[Z]-L)*P)*i}}}}}}},e}(ft);var At=function(){function t(t){this.frames=k.newFloatArray(t),this.events=new Array(t)}return t.prototype.getPropertyId=function(){return pt.event<<24},t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},t.prototype.apply=function(t,e,r,n,i,a,s){if(null!=n){var o=this.frames,h=this.frames.length;if(e>r)this.apply(t,e,Number.MAX_VALUE,n,i,a,s),e=-1;else if(e>=o[h-1])return;if(!(r<o[0])){var l=0;if(e<o[0])l=0;else for(var u=o[l=ut.binarySearch(o,e)];l>0&&o[l-1]==u;)l--;for(;l<h&&r>=o[l];l++)n.push(this.events[l])}}},t}();var Mt=function(){function t(t){this.frames=k.newFloatArray(t),this.drawOrders=new Array(t)}return t.prototype.getPropertyId=function(){return pt.drawOrder<<24},t.prototype.getFrameCount=function(){return this.frames.length},t.prototype.setFrame=function(t,e,r){this.frames[t]=e,this.drawOrders[t]=r},t.prototype.apply=function(t,e,r,n,i,a,s){var o=t.drawOrder,h=t.slots;if(s!=ct.mixOut||a!=dt.setup){var l=this.frames;if(r<l[0])a!=dt.setup&&a!=dt.first||k.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);else{var u=0;u=r>=l[l.length-1]?l.length-1:ut.binarySearch(l,r)-1;var d=this.drawOrders[u];if(null==d)k.arrayCopy(h,0,o,0,h.length);else for(var c=0,p=d.length;c<p;c++)o[c]=h[d[c]]}}else k.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)},t}();var Rt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.ikConstraint<<24)+this.ikConstraintIndex},e.prototype.setFrame=function(t,r,n,i,a,s,o){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.MIX]=n,this.frames[t+e.SOFTNESS]=i,this.frames[t+e.BEND_DIRECTION]=a,this.frames[t+e.COMPRESS]=s?1:0,this.frames[t+e.STRETCH]=o?1:0},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.ikConstraints[this.ikConstraintIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,void(l.stretch=l.data.stretch);case dt.first:l.mix+=(l.data.mix-l.mix)*a,l.softness+=(l.data.softness-l.softness)*a,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}else if(n>=h[h.length-e.ENTRIES])s==dt.setup?(l.mix=l.data.mix+(h[h.length+e.PREV_MIX]-l.data.mix)*a,l.softness=l.data.softness+(h[h.length+e.PREV_SOFTNESS]-l.data.softness)*a,o==ct.mixOut?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH])):(l.mix+=(h[h.length+e.PREV_MIX]-l.mix)*a,l.softness+=(h[h.length+e.PREV_SOFTNESS]-l.softness)*a,o==ct.mixIn&&(l.bendDirection=h[h.length+e.PREV_BEND_DIRECTION],l.compress=0!=h[h.length+e.PREV_COMPRESS],l.stretch=0!=h[h.length+e.PREV_STRETCH]));else{var u=ut.binarySearch(h,n,e.ENTRIES),d=h[u+e.PREV_MIX],c=h[u+e.PREV_SOFTNESS],p=h[u],f=this.getCurvePercent(u/e.ENTRIES-1,1-(n-p)/(h[u+e.PREV_TIME]-p));s==dt.setup?(l.mix=l.data.mix+(d+(h[u+e.MIX]-d)*f-l.data.mix)*a,l.softness=l.data.softness+(c+(h[u+e.SOFTNESS]-c)*f-l.data.softness)*a,o==ct.mixOut?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH])):(l.mix+=(d+(h[u+e.MIX]-d)*f-l.mix)*a,l.softness+=(c+(h[u+e.SOFTNESS]-c)*f-l.softness)*a,o==ct.mixIn&&(l.bendDirection=h[u+e.PREV_BEND_DIRECTION],l.compress=0!=h[u+e.PREV_COMPRESS],l.stretch=0!=h[u+e.PREV_STRETCH]))}},e.ENTRIES=6,e.PREV_TIME=-6,e.PREV_MIX=-5,e.PREV_SOFTNESS=-4,e.PREV_BEND_DIRECTION=-3,e.PREV_COMPRESS=-2,e.PREV_STRETCH=-1,e.MIX=1,e.SOFTNESS=2,e.BEND_DIRECTION=3,e.COMPRESS=4,e.STRETCH=5,e}(ft);var St=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.transformConstraint<<24)+this.transformConstraintIndex},e.prototype.setFrame=function(t,r,n,i,a,s){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=n,this.frames[t+e.TRANSLATE]=i,this.frames[t+e.SCALE]=a,this.frames[t+e.SHEAR]=s},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.transformConstraints[this.transformConstraintIndex];if(l.active)if(n<h[0]){var u=l.data;switch(s){case dt.setup:return l.rotateMix=u.rotateMix,l.translateMix=u.translateMix,l.scaleMix=u.scaleMix,void(l.shearMix=u.shearMix);case dt.first:l.rotateMix+=(u.rotateMix-l.rotateMix)*a,l.translateMix+=(u.translateMix-l.translateMix)*a,l.scaleMix+=(u.scaleMix-l.scaleMix)*a,l.shearMix+=(u.shearMix-l.shearMix)*a}}else{var d=0,c=0,p=0,f=0;if(n>=h[h.length-e.ENTRIES]){var m=h.length;d=h[m+e.PREV_ROTATE],c=h[m+e.PREV_TRANSLATE],p=h[m+e.PREV_SCALE],f=h[m+e.PREV_SHEAR]}else{var g=ut.binarySearch(h,n,e.ENTRIES);d=h[g+e.PREV_ROTATE],c=h[g+e.PREV_TRANSLATE],p=h[g+e.PREV_SCALE],f=h[g+e.PREV_SHEAR];var v=h[g],y=this.getCurvePercent(g/e.ENTRIES-1,1-(n-v)/(h[g+e.PREV_TIME]-v));d+=(h[g+e.ROTATE]-d)*y,c+=(h[g+e.TRANSLATE]-c)*y,p+=(h[g+e.SCALE]-p)*y,f+=(h[g+e.SHEAR]-f)*y}if(s==dt.setup){u=l.data;l.rotateMix=u.rotateMix+(d-u.rotateMix)*a,l.translateMix=u.translateMix+(c-u.translateMix)*a,l.scaleMix=u.scaleMix+(p-u.scaleMix)*a,l.shearMix=u.shearMix+(f-u.shearMix)*a}else l.rotateMix+=(d-l.rotateMix)*a,l.translateMix+=(c-l.translateMix)*a,l.scaleMix+=(p-l.scaleMix)*a,l.shearMix+=(f-l.shearMix)*a}},e.ENTRIES=5,e.PREV_TIME=-5,e.PREV_ROTATE=-4,e.PREV_TRANSLATE=-3,e.PREV_SCALE=-2,e.PREV_SHEAR=-1,e.ROTATE=1,e.TRANSLATE=2,e.SCALE=3,e.SHEAR=4,e}(ft);var Tt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.pathConstraintPosition<<24)+this.pathConstraintIndex},e.prototype.setFrame=function(t,r,n){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.VALUE]=n},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return void(l.position=l.data.position);case dt.first:l.position+=(l.data.position-l.position)*a}else{var u=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var d=ut.binarySearch(h,n,e.ENTRIES);u=h[d+e.PREV_VALUE];var c=h[d],p=this.getCurvePercent(d/e.ENTRIES-1,1-(n-c)/(h[d+e.PREV_TIME]-c));u+=(h[d+e.VALUE]-u)*p}s==dt.setup?l.position=l.data.position+(u-l.data.position)*a:l.position+=(u-l.position)*a}},e.ENTRIES=2,e.PREV_TIME=-2,e.PREV_VALUE=-1,e.VALUE=1,e}(ft);var Ct=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.getPropertyId=function(){return(pt.pathConstraintSpacing<<24)+this.pathConstraintIndex},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return void(l.spacing=l.data.spacing);case dt.first:l.spacing+=(l.data.spacing-l.spacing)*a}else{var u=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_VALUE];else{var d=ut.binarySearch(h,n,e.ENTRIES);u=h[d+e.PREV_VALUE];var c=h[d],p=this.getCurvePercent(d/e.ENTRIES-1,1-(n-c)/(h[d+e.PREV_TIME]-c));u+=(h[d+e.VALUE]-u)*p}s==dt.setup?l.spacing=l.data.spacing+(u-l.data.spacing)*a:l.spacing+=(u-l.spacing)*a}},e}(Tt),Vt=function(t){function e(r){var n=t.call(this,r)||this;return n.frames=k.newFloatArray(r*e.ENTRIES),n}return n(e,t),e.prototype.getPropertyId=function(){return(pt.pathConstraintMix<<24)+this.pathConstraintIndex},e.prototype.setFrame=function(t,r,n,i){t*=e.ENTRIES,this.frames[t]=r,this.frames[t+e.ROTATE]=n,this.frames[t+e.TRANSLATE]=i},e.prototype.apply=function(t,r,n,i,a,s,o){var h=this.frames,l=t.pathConstraints[this.pathConstraintIndex];if(l.active)if(n<h[0])switch(s){case dt.setup:return l.rotateMix=l.data.rotateMix,void(l.translateMix=l.data.translateMix);case dt.first:l.rotateMix+=(l.data.rotateMix-l.rotateMix)*a,l.translateMix+=(l.data.translateMix-l.translateMix)*a}else{var u=0,d=0;if(n>=h[h.length-e.ENTRIES])u=h[h.length+e.PREV_ROTATE],d=h[h.length+e.PREV_TRANSLATE];else{var c=ut.binarySearch(h,n,e.ENTRIES);u=h[c+e.PREV_ROTATE],d=h[c+e.PREV_TRANSLATE];var p=h[c],f=this.getCurvePercent(c/e.ENTRIES-1,1-(n-p)/(h[c+e.PREV_TIME]-p));u+=(h[c+e.ROTATE]-u)*f,d+=(h[c+e.TRANSLATE]-d)*f}s==dt.setup?(l.rotateMix=l.data.rotateMix+(u-l.data.rotateMix)*a,l.translateMix=l.data.translateMix+(d-l.data.translateMix)*a):(l.rotateMix+=(u-l.rotateMix)*a,l.translateMix+=(d-l.translateMix)*a)}},e.ENTRIES=3,e.PREV_TIME=-3,e.PREV_ROTATE=-2,e.PREV_TRANSLATE=-1,e.ROTATE=1,e.TRANSLATE=2,e}(ft);var Ft=function(){function t(t){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new kt(this),this.propertyIDs=new S,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new N((function(){return new Pt})),this.data=t}return t.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,r=0,n=e.length;r<n;r++){var i=e[r];if(null!=i){i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;var a=t*i.timeScale;if(i.delay>0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var s=i.next;if(null!=s){var o=i.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==i.timeScale?0:(o/i.timeScale+t)*s.timeScale,i.trackTime+=a,this.setCurrent(r,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[r]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},t.prototype.updateMixingFrom=function(t,e){var r=t.mixingFrom;if(null==r)return!0;var n=this.updateMixingFrom(r,e);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=r.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=r.mixingFrom,null!=r.mixingFrom&&(r.mixingFrom.mixingTo=t),t.interruptAlpha=r.interruptAlpha,this.queue.end(r)),n):(r.trackTime+=e*r.timeScale,t.mixTime+=e,!1)},t.prototype.apply=function(e){if(null==e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,n=this.tracks,i=!1,a=0,s=n.length;a<s;a++){var o=n[a];if(!(null==o||o.delay>0)){i=!0;var h=0==a?dt.first:o.mixBlend,l=o.alpha;null!=o.mixingFrom?l*=this.applyMixingFrom(o,e,h):o.trackTime>=o.trackEnd&&null==o.next&&(l=0);var u=o.animationLast,d=o.getAnimationTime(),c=o.animation.timelines.length,p=o.animation.timelines;if(0==a&&1==l||h==dt.add)for(var f=0;f<c;f++)k.webkit602BugfixHelper(l,h),p[f].apply(e,u,d,r,l,h,ct.mixIn);else{var m=o.timelineMode,g=0==o.timelinesRotation.length;g&&k.setArraySize(o.timelinesRotation,c<<1,null);var v=o.timelinesRotation;for(f=0;f<c;f++){var y=p[f],w=(m[f]&t.NOT_LAST-1)==t.SUBSEQUENT?h:dt.setup;y instanceof mt?this.applyRotateTimeline(y,e,d,l,w,v,f<<1,g):(k.webkit602BugfixHelper(l,h),y.apply(e,u,d,r,l,w,ct.mixIn))}}this.queueEvents(o,d),r.length=0,o.nextAnimationLast=d,o.nextTrackLast=o.trackTime}}return this.queue.drain(),i},t.prototype.applyMixingFrom=function(e,r,n){var i=e.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,r,n);var a=0;0==e.mixDuration?(a=1,n==dt.first&&(n=dt.setup)):((a=e.mixTime/e.mixDuration)>1&&(a=1),n!=dt.first&&(n=i.mixBlend));var s=a<i.eventThreshold?this.events:null,o=a<i.attachmentThreshold,h=a<i.drawOrderThreshold,l=i.animationLast,u=i.getAnimationTime(),d=i.animation.timelines.length,c=i.animation.timelines,p=i.alpha*e.interruptAlpha,f=p*(1-a);if(n==dt.add)for(var m=0;m<d;m++)c[m].apply(r,l,u,s,f,n,ct.mixOut);else{var g=i.timelineMode,v=i.timelineHoldMix,y=0==i.timelinesRotation.length;y&&k.setArraySize(i.timelinesRotation,d<<1,null);var w=i.timelinesRotation;i.totalAlpha=0;for(m=0;m<d;m++){var x=c[m],I=ct.mixOut,b=void 0,E=0;switch(g[m]&t.NOT_LAST-1){case t.SUBSEQUENT:if(b=n,!o&&x instanceof It){if((g[m]&t.NOT_LAST)==t.NOT_LAST)continue;b=dt.setup}if(!h&&x instanceof Mt)continue;E=f;break;case t.FIRST:b=dt.setup,E=f;break;case t.HOLD:b=dt.setup,E=p;break;default:b=dt.setup;var A=v[m];E=p*Math.max(0,1-A.mixTime/A.mixDuration)}i.totalAlpha+=E,x instanceof mt?this.applyRotateTimeline(x,r,u,E,b,w,m<<1,y):(k.webkit602BugfixHelper(E,n),b==dt.setup&&(x instanceof It?(o||(g[m]&t.NOT_LAST)==t.NOT_LAST)&&(I=ct.mixIn):x instanceof Mt&&h&&(I=ct.mixIn)),x.apply(r,l,u,s,E,b,I))}}return e.mixDuration>0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,a},t.prototype.applyRotateTimeline=function(t,e,r,n,i,a,s,o){if(o&&(a[s]=0),1!=n){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var d=0,c=0;if(r<l[0])switch(i){case dt.setup:u.rotation=u.data.rotation;default:return;case dt.first:d=u.rotation,c=u.data.rotation}else if(d=i==dt.setup?u.data.rotation:u.rotation,r>=l[l.length-mt.ENTRIES])c=u.data.rotation+l[l.length+mt.PREV_ROTATION];else{var p=ut.binarySearch(l,r,mt.ENTRIES),f=l[p+mt.PREV_ROTATION],m=l[p],g=h.getCurvePercent((p>>1)-1,1-(r-m)/(l[p+mt.PREV_TIME]-m));c=l[p+mt.ROTATION]-f,c=f+(c-=360*(16384-(16384.499999999996-c/360|0)))*g+u.data.rotation,c-=360*(16384-(16384.499999999996-c/360|0))}var v=0,y=c-d;if(0==(y-=360*(16384-(16384.499999999996-y/360|0))))v=a[s];else{var w=0,x=0;o?(w=0,x=y):(w=a[s],x=a[s+1]);var I=y>0,b=w>=0;C.signum(x)!=C.signum(y)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*C.signum(w)),b=I),v=y+w-w%360,b!=I&&(v+=360*C.signum(w)),a[s]=v}a[s+1]=y,d+=v*n,u.rotation=d-360*(16384-(16384.499999999996-d/360|0))}}else t.apply(e,0,r,null,1,i,ct.mixIn)},t.prototype.queueEvents=function(t,e){for(var r=t.animationStart,n=t.animationEnd,i=n-r,a=t.trackLast%i,s=this.events,o=0,h=s.length;o<h;o++){var l=s[o];if(l.time<a)break;l.time>n||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=n&&t.animationLast<n)&&this.queue.complete(t);o<h;o++){s[o].time<r||this.queue.event(t,s[o])}},t.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,r=this.tracks.length;e<r;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},t.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var r=e;;){var n=r.mixingFrom;if(null==n)break;this.queue.end(n),r.mixingFrom=null,r.mixingTo=null,r=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},t.prototype.setCurrent=function(t,e,r){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(r&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,null!=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)},t.prototype.setAnimation=function(t,e,r){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,r)},t.prototype.setAnimationWith=function(t,e,r){if(null==e)throw new Error("animation cannot be null.");var n=!0,i=this.expandToIndex(t);null!=i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.disposeNext(i),i=i.mixingFrom,n=!1):this.disposeNext(i));var a=this.trackEntry(t,e,r,i);return this.setCurrent(t,a,n),this.queue.drain(),a},t.prototype.addAnimation=function(t,e,r,n){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,r,n)},t.prototype.addAnimationWith=function(t,e,r,n){if(null==e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(null!=i)for(;null!=i.next;)i=i.next;var a=this.trackEntry(t,e,r,i);if(null==i)this.setCurrent(t,a,!0),this.queue.drain();else if(i.next=a,n<=0){var s=i.animationEnd-i.animationStart;0!=s?(i.loop?n+=s*(1+(i.trackTime/s|0)):n+=Math.max(s,i.trackTime),n-=this.data.getMix(i.animation,e)):n=i.trackTime}return a.delay=n,a},t.prototype.setEmptyAnimation=function(e,r){var n=this.setAnimationWith(e,t.emptyAnimation,!1);return n.mixDuration=r,n.trackEnd=r,n},t.prototype.addEmptyAnimation=function(e,r,n){n<=0&&(n-=r);var i=this.addAnimationWith(e,t.emptyAnimation,!1,n);return i.mixDuration=r,i.trackEnd=r,i},t.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var r=0,n=this.tracks.length;r<n;r++){var i=this.tracks[r];null!=i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},t.prototype.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(k.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},t.prototype.trackEntry=function(t,e,r,n){var i=this.trackEntryPool.obtain();return i.trackIndex=t,i.animation=e,i.loop=r,i.holdPrevious=!1,i.eventThreshold=0,i.attachmentThreshold=0,i.drawOrderThreshold=0,i.animationStart=0,i.animationEnd=e.duration,i.animationLast=-1,i.nextAnimationLast=-1,i.delay=0,i.trackTime=0,i.trackLast=-1,i.nextTrackLast=-1,i.trackEnd=Number.MAX_VALUE,i.timeScale=1,i.alpha=1,i.interruptAlpha=1,i.mixTime=0,i.mixDuration=null==n?0:this.data.getMix(n.animation,e),i},t.prototype.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},t.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var t=0,e=this.tracks.length;t<e;t++){if(null!=(r=this.tracks[t])){for(;null!=r.mixingFrom;)r=r.mixingFrom;do{null!=r.mixingFrom&&r.mixBlend==dt.add||this.computeHold(r),r=r.mixingTo}while(null!=r)}}this.propertyIDs.clear();for(t=this.tracks.length-1;t>=0;t--)for(var r=this.tracks[t];null!=r;)this.computeNotLast(r),r=r.mixingFrom},t.prototype.computeHold=function(e){var r=e.mixingTo,n=e.animation.timelines,i=e.animation.timelines.length,a=k.setArraySize(e.timelineMode,i);e.timelineHoldMix.length=0;var s=k.setArraySize(e.timelineHoldMix,i),o=this.propertyIDs;if(null!=r&&r.holdPrevious)for(var h=0;h<i;h++)o.add(n[h].getPropertyId()),a[h]=t.HOLD;else t:for(h=0;h<i;h++){var l=n[h],u=l.getPropertyId();if(o.add(u))if(null==r||l instanceof It||l instanceof Mt||l instanceof At||!r.animation.hasTimeline(u))a[h]=t.FIRST;else{for(var d=r.mixingTo;null!=d;d=d.mixingTo)if(!d.animation.hasTimeline(u)){if(e.mixDuration>0){a[h]=t.HOLD_MIX,s[h]=d;continue t}break}a[h]=t.HOLD}else a[h]=t.SUBSEQUENT}},t.prototype.computeNotLast=function(e){for(var r=e.animation.timelines,n=e.animation.timelines.length,i=e.timelineMode,a=this.propertyIDs,s=0;s<n;s++)if(r[s]instanceof It){var o=r[s];a.add(o.slotIndex)||(i[s]|=t.NOT_LAST)}},t.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},t.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},t.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},t.prototype.clearListeners=function(){this.listeners.length=0},t.prototype.clearListenerNotifications=function(){this.queue.clear()},t.emptyAnimation=new ut("<empty>",[],0),t.SUBSEQUENT=0,t.FIRST=1,t.HOLD=2,t.HOLD_MIX=3,t.NOT_LAST=4,t}();var Pt=function(){function t(){this.mixBlend=dt.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return t.prototype.reset=function(){this.next=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},t.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},t.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},t.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},t.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},t}();var kt=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(Nt.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(Nt.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(Nt.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(Nt.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(Nt.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(Nt.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];switch(n){case Nt.start:null!=i.listener&&i.listener.start&&i.listener.start(i);for(var a=0;a<e.length;a++)e[a].start&&e[a].start(i);break;case Nt.interrupt:null!=i.listener&&i.listener.interrupt&&i.listener.interrupt(i);for(a=0;a<e.length;a++)e[a].interrupt&&e[a].interrupt(i);break;case Nt.end:null!=i.listener&&i.listener.end&&i.listener.end(i);for(a=0;a<e.length;a++)e[a].end&&e[a].end(i);case Nt.dispose:null!=i.listener&&i.listener.dispose&&i.listener.dispose(i);for(a=0;a<e.length;a++)e[a].dispose&&e[a].dispose(i);this.animState.trackEntryPool.free(i);break;case Nt.complete:null!=i.listener&&i.listener.complete&&i.listener.complete(i);for(a=0;a<e.length;a++)e[a].complete&&e[a].complete(i);break;case Nt.event:var s=t[2+r++];null!=i.listener&&i.listener.event&&i.listener.event(i,s);for(a=0;a<e.length;a++)e[a].event&&e[a].event(i,s)}}this.clear(),this.drainDisabled=!1}},t.prototype.clear=function(){this.objects.length=0},t}();var Nt={start:0,interrupt:1,end:2,dispose:3,complete:4,event:5};Nt[Nt.start]="start",Nt[Nt.interrupt]="interrupt",Nt[Nt.end]="end",Nt[Nt.dispose]="dispose",Nt[Nt.complete]="complete",Nt[Nt.event]="event";!function(){function t(){}t.prototype.start=function(t){},t.prototype.interrupt=function(t){},t.prototype.end=function(t){},t.prototype.dispose=function(t){},t.prototype.complete=function(t){},t.prototype.event=function(t,e){}}();var Lt=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,r){var n=this.skeletonData.findAnimation(t);if(null==n)throw new Error("Animation not found: "+t);var i=this.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);this.setMixWith(n,i,r)},t.prototype.setMixWith=function(t,e,r){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var n=t.name+"."+e.name;this.animationToMixTime[n]=r},t.prototype.getMix=function(t,e){var r=t.name+"."+e.name,n=this.animationToMixTime[r];return void 0===n?this.defaultMix:n},t}();var Ot=function(t){function e(e){var r=t.call(this,e)||this;return r.color=new T(.38,.94,0,1),r}return n(e,t),e.prototype.computeWorldPosition=function(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},e.prototype.computeWorldRotation=function(t){var e=C.cosDeg(this.rotation),r=C.sinDeg(this.rotation),n=e*t.a+r*t.b,i=e*t.c+r*t.d;return Math.atan2(i,n)*C.radDeg},e.prototype.copy=function(){var t=new e(name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},e}(K);var Yt=function(){function t(t){this.atlas=t}return t.prototype.newRegionAttachment=function(t,e,r){var n=this.atlas.findRegion(r);if(null==n)throw new Error("Region not found in atlas: "+r+" (region attachment: "+e+")");n.renderObject=n;var i=new $(e);return i.setRegion(n),i},t.prototype.newMeshAttachment=function(t,e,r){var n=this.atlas.findRegion(r);if(null==n)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+e+")");n.renderObject=n;var i=new tt(e);return i.region=n,i},t.prototype.newBoundingBoxAttachment=function(t,e){return new it(e)},t.prototype.newPathAttachment=function(t,e){return new st(e)},t.prototype.newPointAttachment=function(t,e){return new Ot(e)},t.prototype.newClippingAttachment=function(t,e){return new et(e)},t}();var Dt=function(t,e,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=Bt.Normal,this.skinRequired=!1,this.color=new T,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=r};var Bt={Normal:0,OnlyTranslation:1,NoRotationOrReflection:2,NoScale:3,NoScaleOrReflection:4};Bt[Bt.Normal]="Normal",Bt[Bt.OnlyTranslation]="OnlyTranslation",Bt[Bt.NoRotationOrReflection]="NoRotationOrReflection",Bt[Bt.NoScale]="NoScale",Bt[Bt.NoScaleOrReflection]="NoScaleOrReflection";var Xt=function(){function t(t,e,r){if(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.appliedValid=!1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=r,this.setToSetupPose()}return t.prototype.isActive=function(){return this.active},t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(t,e,r,n,i,a,s){this.ax=t,this.ay=e,this.arotation=r,this.ascaleX=n,this.ascaleY=i,this.ashearX=a,this.ashearY=s,this.appliedValid=!0;var o=this.parent;if(null==o){var h=this.skeleton,l=r+90+s,u=h.scaleX,d=h.scaleY;return this.a=C.cosDeg(r+a)*n*u,this.b=C.cosDeg(l)*i*u,this.c=C.sinDeg(r+a)*n*d,this.d=C.sinDeg(l)*i*d,this.worldX=t*u+h.x,void(this.worldY=e*d+h.y)}var c=o.a,p=o.b,f=o.c,m=o.d;switch(this.worldX=c*t+p*e+o.worldX,this.worldY=f*t+m*e+o.worldY,this.data.transformMode){case Bt.Normal:l=r+90+s;var g=C.cosDeg(r+a)*n,v=C.cosDeg(l)*i,y=C.sinDeg(r+a)*n,w=C.sinDeg(l)*i;return this.a=c*g+p*y,this.b=c*v+p*w,this.c=f*g+m*y,void(this.d=f*v+m*w);case Bt.OnlyTranslation:l=r+90+s;this.a=C.cosDeg(r+a)*n,this.b=C.cosDeg(l)*i,this.c=C.sinDeg(r+a)*n,this.d=C.sinDeg(l)*i;break;case Bt.NoRotationOrReflection:var x=0;(E=c*c+f*f)>1e-4?(p=f*(E=Math.abs(c*m-p*f)/E),m=c*E,x=Math.atan2(f,c)*C.radDeg):(c=0,f=0,x=90-Math.atan2(m,p)*C.radDeg);var I=r+a-x,b=r+s-x+90;g=C.cosDeg(I)*n,v=C.cosDeg(b)*i,y=C.sinDeg(I)*n,w=C.sinDeg(b)*i;this.a=c*g-p*y,this.b=c*v-p*w,this.c=f*g+m*y,this.d=f*v+m*w;break;case Bt.NoScale:case Bt.NoScaleOrReflection:var E,A=C.cosDeg(r),M=C.sinDeg(r),R=(c*A+p*M)/this.skeleton.scaleX,S=(f*A+m*M)/this.skeleton.scaleY;(E=Math.sqrt(R*R+S*S))>1e-5&&(E=1/E),R*=E,S*=E,E=Math.sqrt(R*R+S*S),this.data.transformMode==Bt.NoScale&&c*m-p*f<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(E=-E);var T=Math.PI/2+Math.atan2(S,R),V=Math.cos(T)*E,F=Math.sin(T)*E;g=C.cosDeg(a)*n,v=C.cosDeg(90+s)*i,y=C.sinDeg(a)*n,w=C.sinDeg(90+s)*i;this.a=R*g+V*y,this.b=R*v+V*w,this.c=S*g+F*y,this.d=S*v+F*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},t.prototype.setToSetupPose=function(){var 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},t.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*C.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*C.radDeg},t.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},t.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},t.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent;if(null==t)return this.ax=this.worldX,this.ay=this.worldY,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);var e=t.a,r=t.b,n=t.c,i=t.d,a=1/(e*i-r*n),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*i*a-o*r*a,this.ay=o*e*a-s*n*a;var h=a*i,l=a*e,u=a*r,d=a*n,c=h*this.a-u*this.c,p=h*this.b-u*this.d,f=l*this.c-d*this.a,m=l*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(c*c+f*f),this.ascaleX>1e-4){var g=c*m-p*f;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(c*p+f*m,g)*C.radDeg,this.arotation=Math.atan2(f,c)*C.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,p)*C.radDeg},t.prototype.worldToLocal=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,a=1/(e*i-r*n),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*i*a-o*r*a,t.y=o*e*a-s*n*a,t},t.prototype.localToWorld=function(t){var e=t.x,r=t.y;return t.x=e*this.a+r*this.b+this.worldX,t.y=e*this.c+r*this.d+this.worldY,t},t.prototype.worldToLocalRotation=function(t){var e=C.sinDeg(t),r=C.cosDeg(t);return Math.atan2(this.a*e-this.c*r,this.d*r-this.b*e)*C.radDeg+this.rotation-this.shearX},t.prototype.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var e=C.sinDeg(t),r=C.cosDeg(t);return Math.atan2(r*this.c+e*this.d,r*this.a+e*this.b)*C.radDeg},t.prototype.rotateWorld=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,a=C.cosDeg(t),s=C.sinDeg(t);this.a=a*e-s*n,this.b=a*r-s*i,this.c=s*e+a*n,this.d=s*r+a*i,this.appliedValid=!1},t}();var Wt=function(t,e,r){this.name=t,this.order=e,this.skinRequired=r};var Gt=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};var Zt=function(t){this.name=t};var Ut=function(){function t(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==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(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var 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.softness,this.mix)}},t.prototype.apply1=function(t,e,r,n,i,a,s){t.appliedValid||t.updateAppliedTransform();var o=t.parent,h=1/(o.a*o.d-o.b*o.c),l=e-o.worldX,u=r-o.worldY,d=(l*o.d-u*o.b)*h-t.ax,c=(u*o.a-l*o.c)*h-t.ay,p=Math.atan2(c,d)*C.radDeg-t.ashearX-t.arotation;t.ascaleX<0&&(p+=180),p>180?p-=360:p<-180&&(p+=360);var f=t.ascaleX,m=t.ascaleY;if(n||i){var g=t.data.length*f,v=Math.sqrt(d*d+c*c);if(n&&v<g||i&&v>g&&g>1e-4){var y=(v/g-1)*s+1;f*=y,a&&(m*=y)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+p*s,f,m,t.ashearX,t.ashearY)},t.prototype.apply2=function(t,e,r,n,i,a,s,o){if(0!=o){t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();var h=t.ax,l=t.ay,u=t.ascaleX,d=u,c=t.ascaleY,p=e.ascaleX,f=0,m=0,g=0;u<0?(u=-u,f=180,g=-1):(f=0,g=1),c<0&&(c=-c,g=-g),p<0?(p=-p,m=180):m=0;var v=e.ax,y=0,w=0,x=0,I=t.a,b=t.b,E=t.c,A=t.d,M=Math.abs(u-c)<=1e-4;M?(w=I*v+b*(y=e.ay)+t.worldX,x=E*v+A*y+t.worldY):(y=0,w=I*v+t.worldX,x=E*v+t.worldY);var R=t.parent;I=R.a,b=R.b,E=R.c;var S,T,V=1/(I*(A=R.d)-b*E),F=w-R.worldX,P=x-R.worldY,k=(F*A-P*b)*V-h,N=(P*I-F*E)*V-l,L=Math.sqrt(k*k+N*N),O=e.data.length*p;if(L<1e-4)return this.apply1(t,r,n,!1,a,!1,o),void e.updateWorldTransformWith(v,y,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var Y=((F=r-R.worldX)*A-(P=n-R.worldY)*b)*V-h,D=(P*I-F*E)*V-l,B=Y*Y+D*D;if(0!=s){s*=u*(p+1)/2;var X=Math.sqrt(B),W=X-L-O*u+s;if(W>0){var G=Math.min(1,W/(2*s))-1;B=(Y-=(G=(W-s*(1-G*G))/X)*Y)*Y+(D-=G*D)*D}}t:if(M){var Z=(B-L*L-(O*=u)*O)/(2*L*O);Z<-1?Z=-1:Z>1&&(Z=1,a&&(d*=(Math.sqrt(B)/(L+O)-1)*o+1)),T=Math.acos(Z)*i,I=L+O*Z,b=O*Math.sin(T),S=Math.atan2(D*I-Y*b,Y*I+D*b)}else{var U=(I=u*O)*I,_=(b=c*O)*b,j=Math.atan2(D,Y),z=-2*_*L,H=_-U;if((A=z*z-4*H*(E=_*L*L+U*B-U*_))>=0){var J=Math.sqrt(A);z<0&&(J=-J);var Q=(J=-(z+J)/2)/H,q=E/J,K=Math.abs(Q)<Math.abs(q)?Q:q;if(K*K<=B){P=Math.sqrt(B-K*K)*i,S=j-Math.atan2(P,K),T=Math.atan2(P/c,(K-L)/u);break t}}var $=C.PI,tt=L-I,et=tt*tt,rt=0,nt=0,it=L+I,at=it*it,st=0;(E=-I*L/(U-_))>=-1&&E<=1&&(E=Math.acos(E),(A=(F=I*Math.cos(E)+L)*F+(P=b*Math.sin(E))*P)<et&&($=E,et=A,tt=F,rt=P),A>at&&(nt=E,at=A,it=F,st=P)),B<=(et+at)/2?(S=j-Math.atan2(rt*i,tt),T=$*i):(S=j-Math.atan2(st*i,it),T=nt*i)}var ot=Math.atan2(y,v)*g,ht=t.arotation;(S=(S-ot)*C.radDeg+f-ht)>180?S-=360:S<-180&&(S+=360),t.updateWorldTransformWith(h,l,ht+S*o,d,t.ascaleY,0,0),ht=e.arotation,(T=((T+ot)*C.radDeg-e.ashearX)*g+m-ht)>180?T-=360:T<-180&&(T+=360),e.updateWorldTransformWith(v,y,ht+T*o,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}else e.updateWorldTransform()},t}();var _t=function(t){function e(e){var r=t.call(this,e,0,!1)||this;return r.bones=new Array,r.bendDirection=1,r.compress=!1,r.stretch=!1,r.uniform=!1,r.mix=1,r.softness=0,r}return n(e,t),e}(Wt);var jt=function(t){function e(e){var r=t.call(this,e,0,!1)||this;return r.bones=new Array,r}return n(e,t),e}(Wt);var zt={Fixed:0,Percent:1};zt[zt.Fixed]="Fixed",zt[zt.Percent]="Percent";var Ht={Length:0,Fixed:1,Percent:2};Ht[Ht.Length]="Length",Ht[Ht.Fixed]="Fixed",Ht[Ht.Percent]="Percent";var Jt={Tangent:0,Chain:1,ChainScale:2};Jt[Jt.Tangent]="Tangent",Jt[Jt.Chain]="Chain",Jt[Jt.ChainScale]="ChainScale";var Qt=function(){function t(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var r=0,n=t.bones.length;r<n;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var e=this.target.getAttachment();if(e instanceof st){var r=this.rotateMix,n=this.translateMix,i=r>0;if(n>0||i){var a=this.data,s=a.spacingMode==Ht.Percent,o=a.rotateMode,h=o==Jt.Tangent,l=o==Jt.ChainScale,u=this.bones.length,d=h?u:u+1,c=this.bones,p=k.setArraySize(this.spaces,d),f=null,m=this.spacing;if(l||!s){l&&(f=k.setArraySize(this.lengths,u));for(var g=a.spacingMode==Ht.Length,v=0,y=d-1;v<y;){var w=(F=c[v]).data.length;if(w<t.epsilon)l&&(f[v]=0),p[++v]=0;else if(s){if(l){var x=w*F.a,I=w*F.c,b=Math.sqrt(x*x+I*I);f[v]=b}p[++v]=m}else{x=w*F.a,I=w*F.c;var E=Math.sqrt(x*x+I*I);l&&(f[v]=E),p[++v]=(g?w+m:m)*E/w}}}else for(v=1;v<d;v++)p[v]=m;var A=this.computeWorldPositions(e,d,h,a.positionMode==zt.Percent,s),M=A[0],R=A[1],S=a.offsetRotation,T=!1;if(0==S)T=o==Jt.Chain;else T=!1,S*=(V=this.target.bone).a*V.d-V.b*V.c>0?C.degRad:-C.degRad;v=0;for(var V=3;v<u;v++,V+=3){var F;(F=c[v]).worldX+=(M-F.worldX)*n,F.worldY+=(R-F.worldY)*n;var P=(x=A[V])-M,N=(I=A[V+1])-R;if(l){var L=f[v];if(0!=L){var O=(Math.sqrt(P*P+N*N)/L-1)*r+1;F.a*=O,F.c*=O}}if(M=x,R=I,i){var Y=F.a,D=F.b,B=F.c,X=F.d,W=0,G=0,Z=0;if(W=h?A[V-1]:0==p[v+1]?A[V+2]:Math.atan2(N,P),W-=Math.atan2(B,Y),T){G=Math.cos(W),Z=Math.sin(W);var U=F.data.length;M+=(U*(G*Y-Z*B)-P)*r,R+=(U*(Z*Y+G*B)-N)*r}else W+=S;W>C.PI?W-=C.PI2:W<-C.PI&&(W+=C.PI2),W*=r,G=Math.cos(W),Z=Math.sin(W),F.a=G*Y-Z*B,F.b=G*D-Z*X,F.c=Z*Y+G*B,F.d=Z*D+G*X}F.appliedValid=!1}}}},t.prototype.computeWorldPositions=function(e,r,n,i,a){var s=this.target,o=this.position,h=this.spaces,l=k.setArraySize(this.positions,3*r+2),u=null,d=e.closed,c=e.worldVerticesLength,p=c/6,f=t.NONE;if(!e.constantSpeed){var m=e.lengths,g=m[p-=d?1:2];if(i&&(o*=g),a)for(var v=1;v<r;v++)h[v]*=g;u=k.setArraySize(this.world,8);v=0;for(var y=0,w=0;v<r;v++,y+=3){var x=o+=_=h[v];if(d)(x%=g)<0&&(x+=g),w=0;else{if(x<0){f!=t.BEFORE&&(f=t.BEFORE,e.computeWorldVertices(s,2,4,u,0,2)),this.addBeforePosition(x,u,0,l,y);continue}if(x>g){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(s,c-6,4,u,0,2)),this.addAfterPosition(x-g,u,0,l,y);continue}}for(;;w++){var I=m[w];if(!(x>I)){if(0==w)x/=I;else x=(x-(J=m[w-1]))/(I-J);break}}w!=f&&(f=w,d&&w==p?(e.computeWorldVertices(s,c-4,4,u,0,2),e.computeWorldVertices(s,0,4,u,4,2)):e.computeWorldVertices(s,6*w+2,8,u,0,2)),this.addCurvePosition(x,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,y,n||v>0&&0==_)}return l}d?(c+=2,u=k.setArraySize(this.world,c),e.computeWorldVertices(s,2,c-4,u,0,2),e.computeWorldVertices(s,0,2,u,c-4,2),u[c-2]=u[0],u[c-1]=u[1]):(p--,c-=4,u=k.setArraySize(this.world,c),e.computeWorldVertices(s,2,c,u,0,2));for(var b=k.setArraySize(this.curves,p),E=0,A=u[0],M=u[1],R=0,S=0,T=0,C=0,V=0,F=0,P=0,N=0,L=0,O=0,Y=0,D=0,B=0,X=0,W=(v=0,2);v<p;v++,W+=6)R=u[W],S=u[W+1],T=u[W+2],C=u[W+3],Y=2*(P=.1875*(A-2*R+T))+(L=.09375*(3*(R-T)-A+(V=u[W+4]))),D=2*(N=.1875*(M-2*S+C))+(O=.09375*(3*(S-C)-M+(F=u[W+5]))),B=.75*(R-A)+P+.16666667*L,X=.75*(S-M)+N+.16666667*O,E+=Math.sqrt(B*B+X*X),B+=Y,X+=D,Y+=L,D+=O,E+=Math.sqrt(B*B+X*X),B+=Y,X+=D,E+=Math.sqrt(B*B+X*X),B+=Y+L,X+=D+O,E+=Math.sqrt(B*B+X*X),b[v]=E,A=V,M=F;if(o*=i?E:E/e.lengths[p-1],a)for(v=1;v<r;v++)h[v]*=E;for(var G=this.segments,Z=0,U=(v=0,y=0,w=0,0);v<r;v++,y+=3){var _;x=o+=_=h[v];if(d)(x%=E)<0&&(x+=E),w=0;else{if(x<0){this.addBeforePosition(x,u,0,l,y);continue}if(x>E){this.addAfterPosition(x-E,u,c-4,l,y);continue}}for(;;w++){var j=b[w];if(!(x>j)){if(0==w)x/=j;else x=(x-(J=b[w-1]))/(j-J);break}}if(w!=f){f=w;var z=6*w;for(A=u[z],M=u[z+1],R=u[z+2],S=u[z+3],T=u[z+4],C=u[z+5],Y=2*(P=.03*(A-2*R+T))+(L=.006*(3*(R-T)-A+(V=u[z+6]))),D=2*(N=.03*(M-2*S+C))+(O=.006*(3*(S-C)-M+(F=u[z+7]))),B=.3*(R-A)+P+.16666667*L,X=.3*(S-M)+N+.16666667*O,Z=Math.sqrt(B*B+X*X),G[0]=Z,z=1;z<8;z++)B+=Y,X+=D,Y+=L,D+=O,Z+=Math.sqrt(B*B+X*X),G[z]=Z;B+=Y,X+=D,Z+=Math.sqrt(B*B+X*X),G[8]=Z,B+=Y+L,X+=D+O,Z+=Math.sqrt(B*B+X*X),G[9]=Z,U=0}for(x*=Z;;U++){var H=G[U];if(!(x>H)){var J;if(0==U)x/=H;else x=U+(x-(J=G[U-1]))/(H-J);break}}this.addCurvePosition(.1*x,A,M,R,S,T,C,V,F,l,y,n||v>0&&0==_)}return l},t.prototype.addBeforePosition=function(t,e,r,n,i){var a=e[r],s=e[r+1],o=e[r+2]-a,h=e[r+3]-s,l=Math.atan2(h,o);n[i]=a+t*Math.cos(l),n[i+1]=s+t*Math.sin(l),n[i+2]=l},t.prototype.addAfterPosition=function(t,e,r,n,i){var a=e[r+2],s=e[r+3],o=a-e[r],h=s-e[r+1],l=Math.atan2(h,o);n[i]=a+t*Math.cos(l),n[i+1]=s+t*Math.sin(l),n[i+2]=l},t.prototype.addCurvePosition=function(t,e,r,n,i,a,s,o,h,l,u,d){if(0==t||isNaN(t))return l[u]=e,l[u+1]=r,void(l[u+2]=Math.atan2(i-r,n-e));var c=t*t,p=c*t,f=1-t,m=f*f,g=m*f,v=f*t,y=3*v,w=f*y,x=y*t,I=e*g+n*w+a*x+o*p,b=r*g+i*w+s*x+h*p;l[u]=I,l[u+1]=b,d&&(l[u+2]=t<.001?Math.atan2(i-r,n-e):Math.atan2(b-(r*m+i*v*2+s*c),I-(e*m+n*v*2+a*c)))},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t.epsilon=1e-5,t}();var qt=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}();!function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}t.prototype.queueAsset=function(t,e,r){var n=this.clientAssets[t];return null==n&&(n=new qt(t),this.clientAssets[t]=n),null!==e&&(n.textureLoader=e),n.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var r=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?r.rawAssets[e]=n.responseText:r.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadJson=function(t,e){var r=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?r.rawAssets[e]=JSON.parse(n.responseText):r.errors[e]="Couldn't load text "+e+": status "+n.status+", "+n.responseText)},n.open("GET",e,!0),n.send()}},t.prototype.loadTexture=function(t,e,r){var n=this;if(r=this.pathPrefix+r,this.queueAsset(t,e,r)){var i=new Image;i.src=r,i.crossOrigin="anonymous",i.onload=function(t){n.rawAssets[r]=i},i.onerror=function(t){n.errors[r]="Couldn't load image "+r}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var r=this.clientAssets[t];return null==r||r.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e<t.toLoad.length;e++){var r=t.toLoad[e],n=t.assets[r];if(null==n){var i=this.rawAssets[r];if(null==i)continue;i instanceof HTMLImageElement?t.assets[r]=t.textureLoader(i):t.assets[r]=i}}},t.prototype.isLoadingComplete=function(t){var e=this.clientAssets[t];return null==e||(this.updateClientAssets(e),e.toLoad.length==e.loaded())},t.prototype.dispose=function(){},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors}}();var Kt=function(){function t(t,e){if(this.deform=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new T,this.darkColor=null==t.darkColor?null:new T,this.setToSetupPose()}return t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},t.prototype.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},t.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t}();var $t=function(){function t(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new L,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var r=0;r<t.bones.length;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)}return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},t.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,n=this.shearMix,i=this.target,a=i.a,s=i.b,o=i.c,h=i.d,l=a*h-s*o>0?C.degRad:-C.degRad,u=this.data.offsetRotation*l,d=this.data.offsetShearY*l,c=this.bones,p=0,f=c.length;p<f;p++){var m=c[p],g=!1;if(0!=t){var v=m.a,y=m.b,w=m.c,x=m.d;(R=Math.atan2(o,a)-Math.atan2(w,v)+u)>C.PI?R-=C.PI2:R<-C.PI&&(R+=C.PI2),R*=t;var I=Math.cos(R),b=Math.sin(R);m.a=I*v-b*w,m.b=I*y-b*x,m.c=b*v+I*w,m.d=b*y+I*x,g=!0}if(0!=e){var E=this.temp;i.localToWorld(E.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(E.x-m.worldX)*e,m.worldY+=(E.y-m.worldY)*e,g=!0}if(r>0){var A=Math.sqrt(m.a*m.a+m.c*m.c),M=Math.sqrt(a*a+o*o);A>1e-5&&(A=(A+(M-A+this.data.offsetScaleX)*r)/A),m.a*=A,m.c*=A,A=Math.sqrt(m.b*m.b+m.d*m.d),M=Math.sqrt(s*s+h*h),A>1e-5&&(A=(A+(M-A+this.data.offsetScaleY)*r)/A),m.b*=A,m.d*=A,g=!0}if(n>0){y=m.b,x=m.d;var R,S=Math.atan2(x,y);(R=Math.atan2(h,s)-Math.atan2(o,a)-(S-Math.atan2(m.c,m.a)))>C.PI?R-=C.PI2:R<-C.PI&&(R+=C.PI2),R=S+(R+d)*n;A=Math.sqrt(y*y+x*x);m.b=Math.cos(R)*A,m.d=Math.sin(R)*A,g=!0}g&&(m.appliedValid=!1)}},t.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,n=this.shearMix,i=this.target,a=i.a,s=i.b,o=i.c,h=i.d,l=a*h-s*o>0?C.degRad:-C.degRad,u=this.data.offsetRotation*l,d=this.data.offsetShearY*l,c=this.bones,p=0,f=c.length;p<f;p++){var m=c[p],g=!1;if(0!=t){var v=m.a,y=m.b,w=m.c,x=m.d;(M=Math.atan2(o,a)+u)>C.PI?M-=C.PI2:M<-C.PI&&(M+=C.PI2),M*=t;var I=Math.cos(M),b=Math.sin(M);m.a=I*v-b*w,m.b=I*y-b*x,m.c=b*v+I*w,m.d=b*y+I*x,g=!0}if(0!=e){var E=this.temp;i.localToWorld(E.set(this.data.offsetX,this.data.offsetY)),m.worldX+=E.x*e,m.worldY+=E.y*e,g=!0}if(r>0){var A=(Math.sqrt(a*a+o*o)-1+this.data.offsetScaleX)*r+1;m.a*=A,m.c*=A,A=(Math.sqrt(s*s+h*h)-1+this.data.offsetScaleY)*r+1,m.b*=A,m.d*=A,g=!0}if(n>0){var M;(M=Math.atan2(h,s)-Math.atan2(o,a))>C.PI?M-=C.PI2:M<-C.PI&&(M+=C.PI2);y=m.b,x=m.d;M=Math.atan2(x,y)+(M-C.PI/2+d)*n;A=Math.sqrt(y*y+x*x);m.b=Math.cos(M)*A,m.d=Math.sin(M)*A,g=!0}g&&(m.appliedValid=!1)}},t.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,n=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s<o;s++){var h=a[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;if(0!=t){var u=i.arotation-l+this.data.offsetRotation;l+=(u-=360*(16384-(16384.499999999996-u/360|0)))*t}var d=h.ax,c=h.ay;0!=e&&(d+=(i.ax-d+this.data.offsetX)*e,c+=(i.ay-c+this.data.offsetY)*e);var p=h.ascaleX,f=h.ascaleY;0!=r&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*r)/p),f>1e-5&&(f=(f+(i.ascaleY-f+this.data.offsetScaleY)*r)/f));var m=h.ashearY;if(0!=n){u=i.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*n}h.updateWorldTransformWith(d,c,l,p,f,h.ashearX,m)}},t.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,r=this.scaleMix,n=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s<o;s++){var h=a[s];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;0!=t&&(l+=(i.arotation+this.data.offsetRotation)*t);var u=h.ax,d=h.ay;0!=e&&(u+=(i.ax+this.data.offsetX)*e,d+=(i.ay+this.data.offsetY)*e);var c=h.ascaleX,p=h.ascaleY;0!=r&&(c>1e-5&&(c*=(i.ascaleX-1+this.data.offsetScaleX)*r+1),p>1e-5&&(p*=(i.ascaleY-1+this.data.offsetScaleY)*r+1));var f=h.ashearY;0!=n&&(f+=(i.ashearY+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,d,l,c,p,h.ashearX,f)}},t}();var te=function(){function t(t){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(var e=0;e<t.bones.length;e++){var r=t.bones[e],n=void 0;if(null==r.parent)n=new Xt(r,this,null);else{var i=this.bones[r.parent.index];n=new Xt(r,this,i),i.children.push(n)}this.bones.push(n)}this.slots=new Array,this.drawOrder=new Array;for(e=0;e<t.slots.length;e++){var a=t.slots[e],s=(n=this.bones[a.boneData.index],new Kt(a,n));this.slots.push(s),this.drawOrder.push(s)}this.ikConstraints=new Array;for(e=0;e<t.ikConstraints.length;e++){var o=t.ikConstraints[e];this.ikConstraints.push(new Ut(o,this))}this.transformConstraints=new Array;for(e=0;e<t.transformConstraints.length;e++){var h=t.transformConstraints[e];this.transformConstraints.push(new $t(h,this))}this.pathConstraints=new Array;for(e=0;e<t.pathConstraints.length;e++){var l=t.pathConstraints[e];this.pathConstraints.push(new Qt(l,this))}this.color=new T(1,1,1,1),this.updateCache()}return t.prototype.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,r=t.length;e<r;e++){(i=t[e]).sorted=i.data.skinRequired,i.active=!i.sorted}if(null!=this.skin){var n=this.skin.bones;for(e=0,r=this.skin.bones.length;e<r;e++){var i=this.bones[n[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(null!=i)}}var a=this.ikConstraints,s=this.transformConstraints,o=this.pathConstraints,h=a.length,l=s.length,u=o.length,d=h+l+u;t:for(e=0;e<d;e++){for(var c=0;c<h;c++){if((p=a[c]).data.order==e){this.sortIkConstraint(p);continue t}}for(c=0;c<l;c++){if((p=s[c]).data.order==e){this.sortTransformConstraint(p);continue t}}for(c=0;c<u;c++){var p;if((p=o[c]).data.order==e){this.sortPathConstraint(p);continue t}}}for(e=0,r=t.length;e<r;e++)this.sortBone(t[e])},t.prototype.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&k.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target;this.sortBone(e);var r=t.bones,n=r[0];if(this.sortBone(n),r.length>1){var i=r[r.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(t),this.sortReset(n.children),r[r.length-1].sorted=!0}},t.prototype.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||null!=this.skin&&k.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target,r=e.data.index,n=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,n),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,n);for(var i=0,a=this.data.skins.length;i<a;i++)this.sortPathConstraintAttachment(this.data.skins[i],r,n);var s=e.getAttachment();s instanceof st&&this.sortPathConstraintAttachmentWith(s,n);var o=t.bones,h=o.length;for(i=0;i<h;i++)this.sortBone(o[i]);this._updateCache.push(t);for(i=0;i<h;i++)this.sortReset(o[i].children);for(i=0;i<h;i++)o[i].sorted=!0}},t.prototype.sortTransformConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||null!=this.skin&&k.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var e=t.bones,r=e.length;if(t.data.local)for(var n=0;n<r;n++){var i=e[n];this.sortBone(i.parent),this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}else for(n=0;n<r;n++)this.sortBone(e[n]);this._updateCache.push(t);for(var a=0;a<r;a++)this.sortReset(e[a].children);for(a=0;a<r;a++)e[a].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(t,e,r){var n=t.attachments[e];if(n)for(var i in n)this.sortPathConstraintAttachmentWith(n[i],r)},t.prototype.sortPathConstraintAttachmentWith=function(t,e){if(t instanceof st){var r=t.bones;if(null==r)this.sortBone(e);else for(var n=this.bones,i=0;i<r.length;)for(var a=r[i++],s=i+a;i<s;i++){var o=r[i];this.sortBone(n[o])}}},t.prototype.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},t.prototype.sortReset=function(t){for(var e=0,r=t.length;e<r;e++){var n=t[e];n.active&&(n.sorted&&this.sortReset(n.children),n.sorted=!1)}},t.prototype.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,r=t.length;e<r;e++){var n=t[e];n.ax=n.x,n.ay=n.y,n.arotation=n.rotation,n.ascaleX=n.scaleX,n.ascaleY=n.scaleY,n.ashearX=n.shearX,n.ashearY=n.shearY,n.appliedValid=!0}var i=this._updateCache;for(e=0,r=i.length;e<r;e++)i[e].update()},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){for(var t=this.bones,e=0,r=t.length;e<r;e++)t[e].setToSetupPose();var n=this.ikConstraints;for(e=0,r=n.length;e<r;e++){(o=n[e]).mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}var i=this.transformConstraints;for(e=0,r=i.length;e<r;e++){var a=(o=i[e]).data;o.rotateMix=a.rotateMix,o.translateMix=a.translateMix,o.scaleMix=a.scaleMix,o.shearMix=a.shearMix}var s=this.pathConstraints;for(e=0,r=s.length;e<r;e++){var o;a=(o=s[e]).data;o.position=a.position,o.spacing=a.spacing,o.rotateMix=a.rotateMix,o.translateMix=a.translateMix}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;k.arrayCopy(t,0,this.drawOrder,0,t.length);for(var e=0,r=t.length;e<r;e++)t[e].setToSetupPose()},t.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,r=0,n=e.length;r<n;r++){var i=e[r];if(i.data.name==t)return i}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,r=0,n=e.length;r<n;r++)if(e[r].data.name==t)return r;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,r=0,n=e.length;r<n;r++){var i=e[r];if(i.data.name==t)return i}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,r=0,n=e.length;r<n;r++)if(e[r].data.name==t)return r;return-1},t.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)},t.prototype.setSkin=function(t){if(t!=this.skin){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,r=0,n=e.length;r<n;r++){var i=e[r],a=i.data.attachmentName;if(null!=a){var s=t.getAttachment(r,a);null!=s&&i.setAttachment(s)}}this.skin=t,this.updateCache()}},t.prototype.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},t.prototype.getAttachment=function(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){var r=this.skin.getAttachment(t,e);if(null!=r)return r}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},t.prototype.setAttachment=function(t,e){if(null==t)throw new Error("slotName cannot be null.");for(var r=this.slots,n=0,i=r.length;n<i;n++){var a=r[n];if(a.data.name==t){var s=null;if(null!=e&&null==(s=this.getAttachment(n,e)))throw new Error("Attachment not found: "+e+", for slot: "+t);return void a.setAttachment(s)}}throw new Error("Slot not found: "+t)},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.data.name==t)return i}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.data.name==t)return i}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.data.name==t)return i}return null},t.prototype.getBounds=function(t,e,r){if(void 0===r&&(r=new Array(2)),null==t)throw new Error("offset cannot be null.");if(null==e)throw new Error("size cannot be null.");for(var n=this.drawOrder,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=n.length;h<l;h++){var u=n[h];if(u.bone.active){var d=0,c=null,p=u.getAttachment();if(p instanceof $)d=8,c=k.setArraySize(r,d,0),p.computeWorldVertices(u.bone,c,0,2);else if(p instanceof tt){var f=p;d=f.worldVerticesLength,c=k.setArraySize(r,d,0),f.computeWorldVertices(u,0,d,c,0,2)}if(null!=c)for(var m=0,g=c.length;m<g;m+=2){var v=c[m],y=c[m+1];i=Math.min(i,v),a=Math.min(a,y),s=Math.max(s,v),o=Math.max(o,y)}}}t.set(i,a),e.set(s-i,o-a)},t.prototype.update=function(t){this.time+=t},t}();var ee=function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,r=0,n=e.length;r<n;r++)if(e[r].name==t)return r;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,r=0,n=e.length;r<n;r++)if(e[r].name==t)return r;return-1},t.prototype.findSkin=function(t){if(null==t)throw new Error("skinName cannot be null.");for(var e=this.skins,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName cannot be null.");for(var e=this.events,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findAnimation=function(t){if(null==t)throw new Error("animationName cannot be null.");for(var e=this.animations,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,r=0,n=e.length;r<n;r++){var i=e[r];if(i.name==t)return i}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,r=0,n=e.length;r<n;r++)if(e[r].name==t)return r;return-1},t}();var re=function(t,e,r){if(this.color=new T(1,1,1,1),t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=r};var ne=function(t,e,r){this.slotIndex=t,this.name=e,this.attachment=r};var ie=function(){function t(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,null==t)throw new Error("name cannot be null.");this.name=t}return t.prototype.setAttachment=function(t,e,r){if(null==r)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=r},t.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var r=t.bones[e],n=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==r){n=!0;break}n||this.bones.push(r)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(n=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){n=!0;break}n||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];this.setAttachment(o.slotIndex,o.name,o.attachment)}},t.prototype.copySkin=function(t){for(var e=0;e<t.bones.length;e++){for(var r=t.bones[e],n=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==r){n=!0;break}n||this.bones.push(r)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(n=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){n=!0;break}n||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];null!=o.attachment&&(o.attachment instanceof tt?(o.attachment=o.attachment.newLinkedMesh(),this.setAttachment(o.slotIndex,o.name,o.attachment)):(o.attachment=o.attachment.copy(),this.setAttachment(o.slotIndex,o.name,o.attachment)))}},t.prototype.getAttachment=function(t,e){var r=this.attachments[t];return r?r[e]:null},t.prototype.removeAttachment=function(t,e){var r=this.attachments[t];r&&(r[e]=null)},t.prototype.getAttachments=function(){for(var t=new Array,e=0;e<this.attachments.length;e++){var r=this.attachments[e];if(r)for(var n in r){var i=r[n];i&&t.push(new ne(e,n,i))}}return t},t.prototype.getAttachmentsForSlot=function(t,e){var r=this.attachments[t];if(r)for(var n in r){var i=r[n];i&&e.push(new ne(t,n,i))}},t.prototype.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},t.prototype.attachAll=function(t,e){for(var r=0,n=0;n<t.slots.length;n++){var i=t.slots[n],a=i.getAttachment();if(a&&r<e.attachments.length){var s=e.attachments[r];for(var o in s){if(a==s[o]){var h=this.getAttachment(r,o);null!=h&&i.setAttachment(h);break}}}r++}},t}();var ae=function(t){function e(e){var r=t.call(this,e,0,!1)||this;return r.bones=new Array,r.rotateMix=0,r.translateMix=0,r.scaleMix=0,r.shearMix=0,r.offsetRotation=0,r.offsetX=0,r.offsetY=0,r.offsetScaleX=0,r.offsetScaleY=0,r.offsetShearY=0,r.relative=!1,r.local=!1,r}return n(e,t),e}(Wt);var se={Region:0,BoundingBox:1,Mesh:2,LinkedMesh:3,Path:4,Point:5,Clipping:6};se[se.Region]="Region",se[se.BoundingBox]="BoundingBox",se[se.Mesh]="Mesh",se[se.LinkedMesh]="LinkedMesh",se[se.Path]="Path",se[se.Point]="Point",se[se.Clipping]="Clipping";var oe=function(){function t(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return t.prototype.readSkeletonData=function(e){var r=this.scale,n=new ue(e),i=n.readString(),a=n.readString();if(a.startsWith("3.6"))return new le(this.attachmentLoader).readSkeletonData(e);if(a.startsWith("3.7"))return new he(this.attachmentLoader).readSkeletonData(e);var s=new ee;s.name="",s.hash=i,s.version=a,s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat();var o=n.readBoolean();o&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());var h=0;h=n.readInt(!0);for(var l=0;l<h;l++)n.strings.push(n.readString());h=n.readInt(!0);for(l=0;l<h;l++){var u=n.readString(),d=0==l?null:s.bones[n.readInt(!0)];(f=new Dt(l,u,d)).rotation=n.readFloat(),f.x=n.readFloat()*r,f.y=n.readFloat()*r,f.scaleX=n.readFloat(),f.scaleY=n.readFloat(),f.shearX=n.readFloat(),f.shearY=n.readFloat(),f.length=n.readFloat()*r,f.transformMode=t.TransformModeValues[n.readInt(!0)],f.skinRequired=n.readBoolean(),o&&T.rgba8888ToColor(f.color,n.readInt32()),s.bones.push(f)}h=n.readInt(!0);for(l=0;l<h;l++){var c=n.readString(),p=s.bones[n.readInt(!0)],f=new re(l,c,p);T.rgba8888ToColor(f.color,n.readInt32());var m=n.readInt32();-1!=m&&T.rgb888ToColor(f.darkColor=new T,m),f.attachmentName=n.readStringRef(),f.blendMode=t.BlendModeValues[n.readInt(!0)],s.slots.push(f)}h=n.readInt(!0);l=0;for(var g=void 0;l<h;l++){(f=new _t(n.readString())).order=n.readInt(!0),f.skinRequired=n.readBoolean(),g=n.readInt(!0);for(var v=0;v<g;v++)f.bones.push(s.bones[n.readInt(!0)]);f.target=s.bones[n.readInt(!0)],f.mix=n.readFloat(),f.softness=n.readFloat()*r,f.bendDirection=n.readByte(),f.compress=n.readBoolean(),f.stretch=n.readBoolean(),f.uniform=n.readBoolean(),s.ikConstraints.push(f)}h=n.readInt(!0);for(l=0,g=void 0;l<h;l++){(f=new ae(n.readString())).order=n.readInt(!0),f.skinRequired=n.readBoolean(),g=n.readInt(!0);for(v=0;v<g;v++)f.bones.push(s.bones[n.readInt(!0)]);f.target=s.bones[n.readInt(!0)],f.local=n.readBoolean(),f.relative=n.readBoolean(),f.offsetRotation=n.readFloat(),f.offsetX=n.readFloat()*r,f.offsetY=n.readFloat()*r,f.offsetScaleX=n.readFloat(),f.offsetScaleY=n.readFloat(),f.offsetShearY=n.readFloat(),f.rotateMix=n.readFloat(),f.translateMix=n.readFloat(),f.scaleMix=n.readFloat(),f.shearMix=n.readFloat(),s.transformConstraints.push(f)}h=n.readInt(!0);for(l=0,g=void 0;l<h;l++){(f=new jt(n.readString())).order=n.readInt(!0),f.skinRequired=n.readBoolean(),g=n.readInt(!0);for(v=0;v<g;v++)f.bones.push(s.bones[n.readInt(!0)]);f.target=s.slots[n.readInt(!0)],f.positionMode=t.PositionModeValues[n.readInt(!0)],f.spacingMode=t.SpacingModeValues[n.readInt(!0)],f.rotateMode=t.RotateModeValues[n.readInt(!0)],f.offsetRotation=n.readFloat(),f.position=n.readFloat(),f.positionMode==zt.Fixed&&(f.position*=r),f.spacing=n.readFloat(),f.spacingMode!=Ht.Length&&f.spacingMode!=Ht.Fixed||(f.spacing*=r),f.rotateMix=n.readFloat(),f.translateMix=n.readFloat(),s.pathConstraints.push(f)}var y=this.readSkin(n,s,!0,o);null!=y&&(s.defaultSkin=y,s.skins.push(y));l=s.skins.length;for(k.setArraySize(s.skins,h=l+n.readInt(!0));l<h;l++)s.skins[l]=this.readSkin(n,s,!1,o);h=this.linkedMeshes.length;for(l=0;l<h;l++){var w=this.linkedMeshes[l],x=null==w.skin?s.defaultSkin:s.findSkin(w.skin);if(null==x)throw new Error("Skin not found: "+w.skin);var I=x.getAttachment(w.slotIndex,w.parent);if(null==I)throw new Error("Parent mesh not found: "+w.parent);w.mesh.deformAttachment=w.inheritDeform?I:w.mesh,w.mesh.setParentMesh(I),w.mesh.updateUVs()}this.linkedMeshes.length=0,h=n.readInt(!0);for(l=0;l<h;l++){(f=new Zt(n.readStringRef())).intValue=n.readInt(!1),f.floatValue=n.readFloat(),f.stringValue=n.readString(),f.audioPath=n.readString(),null!=f.audioPath&&(f.volume=n.readFloat(),f.balance=n.readFloat()),s.events.push(f)}h=n.readInt(!0);for(l=0;l<h;l++)s.animations.push(this.readAnimation(n,n.readString(),s));return s},t.prototype.readSkin=function(t,e,r,n){var i=null,a=0;if(r){if(0==(a=t.readInt(!0)))return null;i=new ie("default")}else{(i=new ie(t.readStringRef())).bones.length=t.readInt(!0);for(var s=0,o=i.bones.length;s<o;s++)i.bones[s]=e.bones[t.readInt(!0)];for(s=0,o=t.readInt(!0);s<o;s++)i.constraints.push(e.ikConstraints[t.readInt(!0)]);for(s=0,o=t.readInt(!0);s<o;s++)i.constraints.push(e.transformConstraints[t.readInt(!0)]);for(s=0,o=t.readInt(!0);s<o;s++)i.constraints.push(e.pathConstraints[t.readInt(!0)]);a=t.readInt(!0)}for(s=0;s<a;s++)for(var h=t.readInt(!0),l=0,u=t.readInt(!0);l<u;l++){var d=t.readStringRef(),c=this.readAttachment(t,e,i,h,d,n);null!=c&&i.setAttachment(h,d,c)}return i},t.prototype.readAttachment=function(e,r,n,i,a,s){var o=this.scale,h=e.readStringRef();null==h&&(h=a);var l=e.readByte();switch(t.AttachmentTypeValues[l]){case se.Region:var u=e.readStringRef(),d=e.readFloat(),c=e.readFloat(),p=e.readFloat(),f=e.readFloat(),m=e.readFloat(),g=e.readFloat(),v=e.readFloat(),y=e.readInt32();null==u&&(u=h);var w=this.attachmentLoader.newRegionAttachment(n,h,u);return null==w?null:(w.path=u,w.x=c*o,w.y=p*o,w.scaleX=f,w.scaleY=m,w.rotation=d,w.width=g*o,w.height=v*o,T.rgba8888ToColor(w.color,y),w.updateOffset(),w);case se.BoundingBox:var x=e.readInt(!0),I=this.readVertices(e,x),b=(y=s?e.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(n,h));return null==b?null:(b.worldVerticesLength=x<<1,b.vertices=I.vertices,b.bones=I.bones,s&&T.rgba8888ToColor(b.color,y),b);case se.Mesh:u=e.readStringRef(),y=e.readInt32(),x=e.readInt(!0);var E=this.readFloatArray(e,x<<1,1),A=this.readShortArray(e),M=(I=this.readVertices(e,x),e.readInt(!0)),R=null;g=0,v=0;return s&&(R=this.readShortArray(e),g=e.readFloat(),v=e.readFloat()),null==u&&(u=h),null==(S=this.attachmentLoader.newMeshAttachment(n,h,u))?null:(S.path=u,T.rgba8888ToColor(S.color,y),S.bones=I.bones,S.vertices=I.vertices,S.worldVerticesLength=x<<1,S.triangles=A,S.regionUVs=E,S.updateUVs(),S.hullLength=M<<1,s&&(S.edges=R,S.width=g*o,S.height=v*o),S);case se.LinkedMesh:u=e.readStringRef(),y=e.readInt32();var S,C=e.readStringRef(),V=e.readStringRef(),F=e.readBoolean();g=0,v=0;return s&&(g=e.readFloat(),v=e.readFloat()),null==u&&(u=h),null==(S=this.attachmentLoader.newMeshAttachment(n,h,u))?null:(S.path=u,T.rgba8888ToColor(S.color,y),s&&(S.width=g*o,S.height=v*o),this.linkedMeshes.push(new de(S,C,i,V,F)),S);case se.Path:for(var P=e.readBoolean(),N=e.readBoolean(),L=(x=e.readInt(!0),I=this.readVertices(e,x),k.newArray(x/3,0)),O=0,Y=L.length;O<Y;O++)L[O]=e.readFloat()*o;y=s?e.readInt32():0;return null==(u=this.attachmentLoader.newPathAttachment(n,h))?null:(u.closed=P,u.constantSpeed=N,u.worldVerticesLength=x<<1,u.vertices=I.vertices,u.bones=I.bones,u.lengths=L,s&&T.rgba8888ToColor(u.color,y),u);case se.Point:d=e.readFloat(),c=e.readFloat(),p=e.readFloat(),y=s?e.readInt32():0;var D=this.attachmentLoader.newPointAttachment(n,h);return null==D?null:(D.x=c*o,D.y=p*o,D.rotation=d,s&&T.rgba8888ToColor(D.color,y),D);case se.Clipping:var B=e.readInt(!0),X=(x=e.readInt(!0),I=this.readVertices(e,x),y=s?e.readInt32():0,this.attachmentLoader.newClippingAttachment(n,h));return null==X?null:(X.endSlot=r.slots[B],X.worldVerticesLength=x<<1,X.vertices=I.vertices,X.bones=I.bones,s&&T.rgba8888ToColor(X.color,y),X)}return null},t.prototype.readVertices=function(t,e){var r=e<<1,n=new ce,i=this.scale;if(!t.readBoolean())return n.vertices=this.readFloatArray(t,r,i),n;for(var a=new Array,s=new Array,o=0;o<e;o++){var h=t.readInt(!0);s.push(h);for(var l=0;l<h;l++)s.push(t.readInt(!0)),a.push(t.readFloat()*i),a.push(t.readFloat()*i),a.push(t.readFloat())}return n.vertices=k.toFloatArray(a),n.bones=s,n},t.prototype.readFloatArray=function(t,e,r){var n=new Array(e);if(1==r)for(var i=0;i<e;i++)n[i]=t.readFloat();else for(i=0;i<e;i++)n[i]=t.readFloat()*r;return n},t.prototype.readShortArray=function(t){for(var e=t.readInt(!0),r=new Array(e),n=0;n<e;n++)r[n]=t.readShort();return r},t.prototype.readAnimation=function(e,r,n){for(var i=new Array,a=this.scale,s=0,o=new T,h=new T,l=0,u=e.readInt(!0);l<u;l++)for(var d=e.readInt(!0),c=0,p=e.readInt(!0);c<p;c++){var f=e.readByte(),m=e.readInt(!0);switch(f){case t.SLOT_ATTACHMENT:(w=new It(m)).slotIndex=d;for(var g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readStringRef());i.push(w),s=Math.max(s,w.frames[m-1]);break;case t.SLOT_COLOR:(w=new wt(m)).slotIndex=d;for(g=0;g<m;g++){var v=e.readFloat();T.rgba8888ToColor(o,e.readInt32()),w.setFrame(g,v,o.r,o.g,o.b,o.a),g<m-1&&this.readCurve(e,g,w)}i.push(w),s=Math.max(s,w.frames[(m-1)*wt.ENTRIES]);break;case t.SLOT_TWO_COLOR:(w=new xt(m)).slotIndex=d;for(g=0;g<m;g++){v=e.readFloat();T.rgba8888ToColor(o,e.readInt32()),T.rgb888ToColor(h,e.readInt32()),w.setFrame(g,v,o.r,o.g,o.b,o.a,h.r,h.g,h.b),g<m-1&&this.readCurve(e,g,w)}i.push(w),s=Math.max(s,w.frames[(m-1)*xt.ENTRIES])}}for(l=0,u=e.readInt(!0);l<u;l++){var y=e.readInt(!0);for(c=0,p=e.readInt(!0);c<p;c++){f=e.readByte(),m=e.readInt(!0);switch(f){case t.BONE_ROTATE:(w=new mt(m)).boneIndex=y;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat()),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*mt.ENTRIES]);break;case t.BONE_TRANSLATE:case t.BONE_SCALE:case t.BONE_SHEAR:var w=void 0,x=1;f==t.BONE_SCALE?w=new vt(m):f==t.BONE_SHEAR?w=new yt(m):(w=new gt(m),x=a),w.boneIndex=y;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat()*x,e.readFloat()*x),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*gt.ENTRIES])}}}for(l=0,u=e.readInt(!0);l<u;l++){var I=e.readInt(!0);m=e.readInt(!0);(w=new Rt(m)).ikConstraintIndex=I;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat(),e.readFloat()*a,e.readByte(),e.readBoolean(),e.readBoolean()),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*Rt.ENTRIES])}for(l=0,u=e.readInt(!0);l<u;l++){I=e.readInt(!0),m=e.readInt(!0);(w=new St(m)).transformConstraintIndex=I;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*St.ENTRIES])}for(l=0,u=e.readInt(!0);l<u;l++){I=e.readInt(!0);var b=n.pathConstraints[I];for(c=0,p=e.readInt(!0);c<p;c++){f=e.readByte(),m=e.readInt(!0);switch(f){case t.PATH_POSITION:case t.PATH_SPACING:w=void 0,x=1;f==t.PATH_SPACING?(w=new Ct(m),b.spacingMode!=Ht.Length&&b.spacingMode!=Ht.Fixed||(x=a)):(w=new Tt(m),b.positionMode==zt.Fixed&&(x=a)),w.pathConstraintIndex=I;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat()*x),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*Tt.ENTRIES]);break;case t.PATH_MIX:(w=new Vt(m)).pathConstraintIndex=I;for(g=0;g<m;g++)w.setFrame(g,e.readFloat(),e.readFloat(),e.readFloat()),g<m-1&&this.readCurve(e,g,w);i.push(w),s=Math.max(s,w.frames[(m-1)*Vt.ENTRIES])}}}for(l=0,u=e.readInt(!0);l<u;l++){var E=n.skins[e.readInt(!0)];for(c=0,p=e.readInt(!0);c<p;c++){d=e.readInt(!0);for(var A=0,M=e.readInt(!0);A<M;A++){var R=E.getAttachment(d,e.readStringRef()),S=null!=R.bones,C=R.vertices,V=S?C.length/3*2:C.length;m=e.readInt(!0);(w=new Et(m)).slotIndex=d,w.attachment=R;for(g=0;g<m;g++){v=e.readFloat();var F=void 0,P=e.readInt(!0);if(0==P)F=S?k.newFloatArray(V):C;else{F=k.newFloatArray(V);var N=e.readInt(!0);if(P+=N,1==a)for(var L=N;L<P;L++)F[L]=e.readFloat();else for(L=N;L<P;L++)F[L]=e.readFloat()*a;if(!S){L=0;for(var O=F.length;L<O;L++)F[L]+=C[L]}}w.setFrame(g,v,F),g<m-1&&this.readCurve(e,g,w)}i.push(w),s=Math.max(s,w.frames[m-1])}}}var Y=e.readInt(!0);if(Y>0){w=new Mt(Y);var D=n.slots.length;for(l=0;l<Y;l++){v=e.readFloat();var B=e.readInt(!0),X=k.newArray(D,0);for(c=D-1;c>=0;c--)X[c]=-1;var W=k.newArray(D-B,0),G=0,Z=0;for(c=0;c<B;c++){for(d=e.readInt(!0);G!=d;)W[Z++]=G++;X[G+e.readInt(!0)]=G++}for(;G<D;)W[Z++]=G++;for(c=D-1;c>=0;c--)-1==X[c]&&(X[c]=W[--Z]);w.setFrame(l,v,X)}i.push(w),s=Math.max(s,w.frames[Y-1])}var U=e.readInt(!0);if(U>0){for(w=new At(U),l=0;l<U;l++){v=e.readFloat();var _=n.events[e.readInt(!0)],j=new Gt(v,_);j.intValue=e.readInt(!1),j.floatValue=e.readFloat(),j.stringValue=e.readBoolean()?e.readString():_.stringValue,null!=j.data.audioPath&&(j.volume=e.readFloat(),j.balance=e.readFloat()),w.setFrame(l,j)}i.push(w),s=Math.max(s,w.frames[U-1])}return new ut(r,i,s)},t.prototype.readCurve=function(e,r,n){switch(e.readByte()){case t.CURVE_STEPPED:n.setStepped(r);break;case t.CURVE_BEZIER:this.setCurve(n,r,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat())}},t.prototype.setCurve=function(t,e,r,n,i,a){t.setCurve(e,r,n,i,a)},t.AttachmentTypeValues=[0,1,2,3,4,5,6],t.TransformModeValues=[Bt.Normal,Bt.OnlyTranslation,Bt.NoRotationOrReflection,Bt.NoScale,Bt.NoScaleOrReflection],t.PositionModeValues=[zt.Fixed,zt.Percent],t.SpacingModeValues=[Ht.Length,Ht.Fixed,Ht.Percent],t.RotateModeValues=[Jt.Tangent,Jt.Chain,Jt.ChainScale],t.BlendModeValues=[m.Normal,m.Additive,m.Multiply,m.Screen],t.BONE_ROTATE=0,t.BONE_TRANSLATE=1,t.BONE_SCALE=2,t.BONE_SHEAR=3,t.SLOT_ATTACHMENT=0,t.SLOT_COLOR=1,t.SLOT_TWO_COLOR=2,t.PATH_POSITION=0,t.PATH_SPACING=1,t.PATH_MIX=2,t.CURVE_LINEAR=0,t.CURVE_STEPPED=1,t.CURVE_BEZIER=2,t}();var he=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.readSkeletonData=function(t){var e=this.scale,r=new ue(t),n=r.readString(),i=r.readString(),a=new ee;a.name="",a.hash=n,a.version=i,a.width=r.readFloat(),a.height=r.readFloat();var s=r.readBoolean();s&&(a.fps=r.readFloat(),a.imagesPath=r.readString(),a.audioPath=r.readString());var o=0;o=r.readInt(!0);for(var h=0;h<o;h++){var l=r.readString(),u=0==h?null:a.bones[r.readInt(!0)];(p=new Dt(h,l,u)).rotation=r.readFloat(),p.x=r.readFloat()*e,p.y=r.readFloat()*e,p.scaleX=r.readFloat(),p.scaleY=r.readFloat(),p.shearX=r.readFloat(),p.shearY=r.readFloat(),p.length=r.readFloat()*e,p.transformMode=oe.TransformModeValues[r.readInt(!0)],s&&T.rgba8888ToColor(p.color,r.readInt32()),a.bones.push(p)}o=r.readInt(!0);for(h=0;h<o;h++){var d=r.readString(),c=a.bones[r.readInt(!0)],p=new re(h,d,c);T.rgba8888ToColor(p.color,r.readInt32());var f=r.readInt32();-1!=f&&T.rgb888ToColor(p.darkColor=new T,f),p.attachmentName=r.readString(),p.blendMode=oe.BlendModeValues[r.readInt(!0)],a.slots.push(p)}o=r.readInt(!0);h=0;for(var m=void 0;h<o;h++){(p=new _t(r.readString())).order=r.readInt(!0),m=r.readInt(!0);for(var g=0;g<m;g++)p.bones.push(a.bones[r.readInt(!0)]);p.target=a.bones[r.readInt(!0)],p.mix=r.readFloat(),p.bendDirection=r.readByte(),p.compress=r.readBoolean(),p.stretch=r.readBoolean(),p.uniform=r.readBoolean(),a.ikConstraints.push(p)}o=r.readInt(!0);for(h=0,m=void 0;h<o;h++){(p=new ae(r.readString())).order=r.readInt(!0),m=r.readInt(!0);for(g=0;g<m;g++)p.bones.push(a.bones[r.readInt(!0)]);p.target=a.bones[r.readInt(!0)],p.local=r.readBoolean(),p.relative=r.readBoolean(),p.offsetRotation=r.readFloat(),p.offsetX=r.readFloat()*e,p.offsetY=r.readFloat()*e,p.offsetScaleX=r.readFloat(),p.offsetScaleY=r.readFloat(),p.offsetShearY=r.readFloat(),p.rotateMix=r.readFloat(),p.translateMix=r.readFloat(),p.scaleMix=r.readFloat(),p.shearMix=r.readFloat(),a.transformConstraints.push(p)}o=r.readInt(!0);for(h=0,m=void 0;h<o;h++){(p=new jt(r.readString())).order=r.readInt(!0),m=r.readInt(!0);for(g=0;g<m;g++)p.bones.push(a.bones[r.readInt(!0)]);p.target=a.slots[r.readInt(!0)],p.positionMode=oe.PositionModeValues[r.readInt(!0)],p.spacingMode=oe.SpacingModeValues[r.readInt(!0)],p.rotateMode=oe.RotateModeValues[r.readInt(!0)],p.offsetRotation=r.readFloat(),p.position=r.readFloat(),p.positionMode==zt.Fixed&&(p.position*=e),p.spacing=r.readFloat(),p.spacingMode!=Ht.Length&&p.spacingMode!=Ht.Fixed||(p.spacing*=e),p.rotateMix=r.readFloat(),p.translateMix=r.readFloat(),a.pathConstraints.push(p)}var v=this.readSkin(r,a,!0,s);null!=v&&(a.defaultSkin=v,a.skins.push(v));h=a.skins.length;for(k.setArraySize(a.skins,o=h+r.readInt(!0));h<o;h++)a.skins[h]=this.readSkin(r,a,!1,s);o=this.linkedMeshes.length;for(h=0;h<o;h++){var y=this.linkedMeshes[h],w=null==y.skin?a.defaultSkin:a.findSkin(y.skin);if(null==w)throw new Error("Skin not found: "+y.skin);var x=w.getAttachment(y.slotIndex,y.parent);if(null==x)throw new Error("Parent mesh not found: "+y.parent);y.mesh.deformAttachment=y.inheritDeform?x:y.mesh,y.mesh.setParentMesh(x),y.mesh.updateUVs()}this.linkedMeshes.length=0,o=r.readInt(!0);for(h=0;h<o;h++){(p=new Zt(r.readString())).intValue=r.readInt(!1),p.floatValue=r.readFloat(),p.stringValue=r.readString(),p.audioPath=r.readString(),null!=p.audioPath&&(p.volume=r.readFloat(),p.balance=r.readFloat()),a.events.push(p)}o=r.readInt(!0);for(h=0;h<o;h++)a.animations.push(this.readAnimation(r,r.readString(),a));return a},e.prototype.readSkin=function(t,e,r,n){var i=new ie(r?"default":t.readString()),a=t.readInt(!0);if(0==a)return null;for(var s=0;s<a;s++)for(var o=t.readInt(!0),h=0,l=t.readInt(!0);h<l;h++){var u=t.readString(),d=this.readAttachment(t,e,i,o,u,n);null!=d&&i.setAttachment(o,u,d)}return i},e.prototype.readAnimation=function(t,e,r){for(var n=new Array,i=this.scale,a=0,s=new T,o=new T,h=0,l=t.readInt(!0);h<l;h++)for(var u=t.readInt(!0),d=0,c=t.readInt(!0);d<c;d++){var p=t.readByte(),f=t.readInt(!0);switch(p){case oe.SLOT_ATTACHMENT:(y=new It(f)).slotIndex=u;for(var m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readString());n.push(y),a=Math.max(a,y.frames[f-1]);break;case oe.SLOT_COLOR:(y=new wt(f)).slotIndex=u;for(m=0;m<f;m++){var g=t.readFloat();T.rgba8888ToColor(s,t.readInt32()),y.setFrame(m,g,s.r,s.g,s.b,s.a),m<f-1&&this.readCurve(t,m,y)}n.push(y),a=Math.max(a,y.frames[(f-1)*wt.ENTRIES]);break;case oe.SLOT_TWO_COLOR:(y=new xt(f)).slotIndex=u;for(m=0;m<f;m++){g=t.readFloat();T.rgba8888ToColor(s,t.readInt32()),T.rgb888ToColor(o,t.readInt32()),y.setFrame(m,g,s.r,s.g,s.b,s.a,o.r,o.g,o.b),m<f-1&&this.readCurve(t,m,y)}n.push(y),a=Math.max(a,y.frames[(f-1)*xt.ENTRIES])}}for(h=0,l=t.readInt(!0);h<l;h++){var v=t.readInt(!0);for(d=0,c=t.readInt(!0);d<c;d++){p=t.readByte(),f=t.readInt(!0);switch(p){case oe.BONE_ROTATE:(y=new mt(f)).boneIndex=v;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat()),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*mt.ENTRIES]);break;case oe.BONE_TRANSLATE:case oe.BONE_SCALE:case oe.BONE_SHEAR:var y=void 0,w=1;p==oe.BONE_SCALE?y=new vt(f):p==oe.BONE_SHEAR?y=new yt(f):(y=new gt(f),w=i),y.boneIndex=v;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat()*w,t.readFloat()*w),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*gt.ENTRIES])}}}for(h=0,l=t.readInt(!0);h<l;h++){var x=t.readInt(!0);f=t.readInt(!0);(y=new Rt(f)).ikConstraintIndex=x;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat(),1,t.readByte(),t.readBoolean(),t.readBoolean()),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*Rt.ENTRIES])}for(h=0,l=t.readInt(!0);h<l;h++){x=t.readInt(!0),f=t.readInt(!0);(y=new St(f)).transformConstraintIndex=x;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat()),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*St.ENTRIES])}for(h=0,l=t.readInt(!0);h<l;h++){x=t.readInt(!0);var I=r.pathConstraints[x];for(d=0,c=t.readInt(!0);d<c;d++){p=t.readByte(),f=t.readInt(!0);switch(p){case oe.PATH_POSITION:case oe.PATH_SPACING:y=void 0,w=1;p==oe.PATH_SPACING?(y=new Ct(f),I.spacingMode!=Ht.Length&&I.spacingMode!=Ht.Fixed||(w=i)):(y=new Tt(f),I.positionMode==zt.Fixed&&(w=i)),y.pathConstraintIndex=x;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat()*w),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*Tt.ENTRIES]);break;case oe.PATH_MIX:(y=new Vt(f)).pathConstraintIndex=x;for(m=0;m<f;m++)y.setFrame(m,t.readFloat(),t.readFloat(),t.readFloat()),m<f-1&&this.readCurve(t,m,y);n.push(y),a=Math.max(a,y.frames[(f-1)*Vt.ENTRIES])}}}for(h=0,l=t.readInt(!0);h<l;h++){var b=r.skins[t.readInt(!0)];for(d=0,c=t.readInt(!0);d<c;d++){u=t.readInt(!0);for(var E=0,A=t.readInt(!0);E<A;E++){var M=b.getAttachment(u,t.readString()),R=null!=M.bones,S=M.vertices,C=R?S.length/3*2:S.length;f=t.readInt(!0);(y=new Et(f)).slotIndex=u,y.attachment=M;for(m=0;m<f;m++){g=t.readFloat();var V=void 0,F=t.readInt(!0);if(0==F)V=R?k.newFloatArray(C):S;else{V=k.newFloatArray(C);var P=t.readInt(!0);if(F+=P,1==i)for(var N=P;N<F;N++)V[N]=t.readFloat();else for(N=P;N<F;N++)V[N]=t.readFloat()*i;if(!R){N=0;for(var L=V.length;N<L;N++)V[N]+=S[N]}}y.setFrame(m,g,V),m<f-1&&this.readCurve(t,m,y)}n.push(y),a=Math.max(a,y.frames[f-1])}}}var O=t.readInt(!0);if(O>0){y=new Mt(O);var Y=r.slots.length;for(h=0;h<O;h++){g=t.readFloat();var D=t.readInt(!0),B=k.newArray(Y,0);for(d=Y-1;d>=0;d--)B[d]=-1;var X=k.newArray(Y-D,0),W=0,G=0;for(d=0;d<D;d++){for(u=t.readInt(!0);W!=u;)X[G++]=W++;B[W+t.readInt(!0)]=W++}for(;W<Y;)X[G++]=W++;for(d=Y-1;d>=0;d--)-1==B[d]&&(B[d]=X[--G]);y.setFrame(h,g,B)}n.push(y),a=Math.max(a,y.frames[O-1])}var Z=t.readInt(!0);if(Z>0){for(y=new At(Z),h=0;h<Z;h++){g=t.readFloat();var U=r.events[t.readInt(!0)],_=new Gt(g,U);_.intValue=t.readInt(!1),_.floatValue=t.readFloat(),_.stringValue=t.readBoolean()?t.readString():U.stringValue,null!=_.data.audioPath&&(_.volume=t.readFloat(),_.balance=t.readFloat()),y.setFrame(h,_)}n.push(y),a=Math.max(a,y.frames[Z-1])}return new ut(e,n,a)},e}(oe),le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.readSkeletonData=function(t){var e=this.scale,r=new ee;r.name="";var n=new ue(t);r.hash=n.readString(),r.version=n.readString(),r.width=n.readFloat(),r.height=n.readFloat();var i=n.readBoolean();i&&(r.fps=n.readFloat(),r.imagesPath=n.readString());var a=0;a=n.readInt(!0);for(var s=0;s<a;s++){var o=n.readString(),h=0==s?null:r.bones[n.readInt(!0)];(d=new Dt(s,o,h)).rotation=n.readFloat(),d.x=n.readFloat()*e,d.y=n.readFloat()*e,d.scaleX=n.readFloat(),d.scaleY=n.readFloat(),d.shearX=n.readFloat(),d.shearY=n.readFloat(),d.length=n.readFloat()*e,d.transformMode=oe.TransformModeValues[n.readInt(!0)],i&&T.rgba8888ToColor(d.color,n.readInt32()),r.bones.push(d)}a=n.readInt(!0);for(s=0;s<a;s++){var l=n.readString(),u=r.bones[n.readInt(!0)],d=new re(s,l,u);T.rgba8888ToColor(d.color,n.readInt32());var c=n.readInt32();-1!=c&&T.rgb888ToColor(d.darkColor=new T,c),d.attachmentName=n.readString(),d.blendMode=oe.BlendModeValues[n.readInt(!0)],r.slots.push(d)}a=n.readInt(!0);s=0;for(var p=void 0;s<a;s++){(d=new _t(n.readString())).order=n.readInt(!0),p=n.readInt(!0);for(var f=0;f<p;f++)d.bones.push(r.bones[n.readInt(!0)]);d.target=r.bones[n.readInt(!0)],d.mix=n.readFloat(),d.bendDirection=n.readByte(),r.ikConstraints.push(d)}a=n.readInt(!0);for(s=0,p=void 0;s<a;s++){(d=new ae(n.readString())).order=n.readInt(!0),p=n.readInt(!0);for(f=0;f<p;f++)d.bones.push(r.bones[n.readInt(!0)]);d.target=r.bones[n.readInt(!0)],d.local=n.readBoolean(),d.relative=n.readBoolean(),d.offsetRotation=n.readFloat(),d.offsetX=n.readFloat()*e,d.offsetY=n.readFloat()*e,d.offsetScaleX=n.readFloat(),d.offsetScaleY=n.readFloat(),d.offsetShearY=n.readFloat(),d.rotateMix=n.readFloat(),d.translateMix=n.readFloat(),d.scaleMix=n.readFloat(),d.shearMix=n.readFloat(),r.transformConstraints.push(d)}a=n.readInt(!0);for(s=0,p=void 0;s<a;s++){(d=new jt(n.readString())).order=n.readInt(!0),p=n.readInt(!0);for(f=0;f<p;f++)d.bones.push(r.bones[n.readInt(!0)]);d.target=r.slots[n.readInt(!0)],d.positionMode=oe.PositionModeValues[n.readInt(!0)],d.spacingMode=oe.SpacingModeValues[n.readInt(!0)],d.rotateMode=oe.RotateModeValues[n.readInt(!0)],d.offsetRotation=n.readFloat(),d.position=n.readFloat(),d.positionMode==zt.Fixed&&(d.position*=e),d.spacing=n.readFloat(),d.spacingMode!=Ht.Length&&d.spacingMode!=Ht.Fixed||(d.spacing*=e),d.rotateMix=n.readFloat(),d.translateMix=n.readFloat(),r.pathConstraints.push(d)}var m=this.readSkin(n,r,!0,i);null!=m&&(r.defaultSkin=m,r.skins.push(m));s=r.skins.length;for(k.setArraySize(r.skins,a=s+n.readInt(!0));s<a;s++)r.skins[s]=this.readSkin(n,r,!1,i);a=n.readInt(!0);for(s=0;s<a;s++){(d=new Zt(n.readString())).intValue=n.readInt(!1),d.floatValue=n.readFloat(),d.stringValue=n.readString(),r.events.push(d)}a=n.readInt(!0);for(s=0;s<a;s++){var g=n.readString(),v=this.readAnimation(n,g,r);r.animations.push(v)}return r},e.prototype.readSkin=function(t,e,r,n){var i=new ie(r?"default":t.readString()),a=t.readInt(!0);if(0==a)return null;for(var s=0;s<a;s++)for(var o=t.readInt(!0),h=0,l=t.readInt(!0);h<l;h++){var u=t.readString(),d=this.readAttachment(t,e,i,o,u,n);null!=d&&i.setAttachment(o,u,d)}return i},e.prototype.readAttachment=function(t,e,r,n,i,a){var s=this.scale,o=t.readString();null==o&&(o=i);var h=t.readByte();switch(oe.AttachmentTypeValues[h]){case se.Region:var l=t.readString(),u=t.readFloat(),d=t.readFloat(),c=t.readFloat(),p=t.readFloat(),f=t.readFloat(),m=t.readFloat(),g=t.readFloat(),v=t.readInt32();null==l&&(l=o);var y=this.attachmentLoader.newRegionAttachment(r,o,l);return null==y?null:(y.path=l.trim(),y.x=d*s,y.y=c*s,y.scaleX=p,y.scaleY=f,y.rotation=u,y.width=m*s,y.height=g*s,T.rgba8888ToColor(y.color,v),y.updateOffset(),y);case se.BoundingBox:var w=t.readInt(!0),x=this.readVertices(t,w),I=(v=a?t.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(r,o));return null==I?null:(I.worldVerticesLength=w<<1,I.vertices=x.vertices,I.bones=x.bones,a&&T.rgba8888ToColor(I.color,v),I);case se.Mesh:l=t.readString(),v=t.readInt32(),w=t.readInt(!0);var b=this.readFloatArray(t,w<<1,1),E=this.readShortArray(t),A=(x=this.readVertices(t,w),t.readInt(!0)),M=null;m=0,g=0;return a&&(M=this.readShortArray(t),m=t.readFloat(),g=t.readFloat()),null==l&&(l=o),null==(R=this.attachmentLoader.newMeshAttachment(r,o,l))?null:(R.path=l,T.rgba8888ToColor(R.color,v),R.bones=x.bones,R.vertices=x.vertices,R.worldVerticesLength=w<<1,R.triangles=E,R.regionUVs=b,R.updateUVs(),R.hullLength=A<<1,a&&(R.edges=M,R.width=m*s,R.height=g*s),R);case se.LinkedMesh:l=t.readString(),v=t.readInt32();var R,S=t.readString(),C=t.readStringRef(),V=t.readBoolean();m=0,g=0;return a&&(m=t.readFloat(),g=t.readFloat()),null==l&&(l=o),null==(R=this.attachmentLoader.newMeshAttachment(r,o,l))?null:(R.path=l,T.rgba8888ToColor(R.color,v),a&&(R.width=m*s,R.height=g*s),this.linkedMeshes.push(new de(R,S,n,C,V)),R);case se.Path:for(var F=t.readBoolean(),P=t.readBoolean(),N=(w=t.readInt(!0),x=this.readVertices(t,w),k.newArray(w/3,0)),L=0,O=N.length;L<O;L++)N[L]=t.readFloat()*s;v=a?t.readInt32():0;return null==(l=this.attachmentLoader.newPathAttachment(r,o))?null:(l.closed=F,l.constantSpeed=P,l.worldVerticesLength=w<<1,l.vertices=x.vertices,l.bones=x.bones,l.lengths=N,a&&T.rgba8888ToColor(l.color,v),l);case se.Point:u=t.readFloat(),d=t.readFloat(),c=t.readFloat(),v=a?t.readInt32():0;var Y=this.attachmentLoader.newPointAttachment(r,o);return null==Y?null:(Y.x=d*s,Y.y=c*s,Y.rotation=u,a&&T.rgba8888ToColor(Y.color,v),Y);case se.Clipping:var D=t.readInt(!0),B=(w=t.readInt(!0),x=this.readVertices(t,w),v=a?t.readInt32():0,this.attachmentLoader.newClippingAttachment(r,o));return null==B?null:(B.endSlot=e.slots[D],B.worldVerticesLength=w<<1,B.vertices=x.vertices,B.bones=x.bones,a&&T.rgba8888ToColor(B.color,v),B)}return null},e.prototype.readAnimation=function(t,e,r){for(var n=new Array,i=this.scale,a=0,s=new T,o=new T,h=0,l=t.readInt(!0);h<l;h++)for(var u=t.readInt(!0),d=0,c=t.readInt(!0);d<c;d++){var p=t.readByte();if(0!=(y=t.readInt(!0)))switch(p){case oe.SLOT_ATTACHMENT:(w=new It(y)).slotIndex=u;for(var f=0;f<y;f++){var m=t.readFloat(),g=t.readString();w.setFrame(f,m,g)}n.push(w),a=Math.max(a,w.frames[y-1]);break;case oe.SLOT_COLOR:(w=new wt(y)).slotIndex=u;for(f=0;f<y;f++){m=t.readFloat();T.rgba8888ToColor(s,t.readInt32()),w.setFrame(f,m,s.r,s.g,s.b,s.a),f<y-1&&this.readCurve(t,f,w)}n.push(w),a=Math.max(a,w.frames[(y-1)*wt.ENTRIES]);break;case oe.SLOT_TWO_COLOR:(w=new xt(y)).slotIndex=u;for(f=0;f<y;f++){m=t.readFloat();T.rgba8888ToColor(s,t.readInt32()),T.rgb888ToColor(o,t.readInt32()),w.setFrame(f,m,s.r,s.g,s.b,s.a,o.r,o.g,o.b),f<y-1&&this.readCurve(t,f,w)}n.push(w),a=Math.max(a,w.frames[(y-1)*xt.ENTRIES])}}for(h=0,l=t.readInt(!0);h<l;h++){var v=t.readInt(!0);for(d=0,c=t.readInt(!0);d<c;d++){p=t.readByte();var y=t.readInt(!0);switch(p){case oe.BONE_ROTATE:(w=new mt(y)).boneIndex=v;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat()),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*mt.ENTRIES]);break;case oe.BONE_TRANSLATE:case oe.BONE_SCALE:case oe.BONE_SHEAR:var w=void 0,x=1;p==oe.BONE_SCALE?w=new vt(y):p==oe.BONE_SHEAR?w=new yt(y):(w=new gt(y),x=i),w.boneIndex=v;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat()*x,t.readFloat()*x),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*gt.ENTRIES])}}}for(h=0,l=t.readInt(!0);h<l;h++){var I=t.readInt(!0);y=t.readInt(!0);(w=new Rt(y)).ikConstraintIndex=I;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat(),1,t.readByte(),!1,!1),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*Rt.ENTRIES])}for(h=0,l=t.readInt(!0);h<l;h++){I=t.readInt(!0),y=t.readInt(!0);(w=new St(y)).transformConstraintIndex=I;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat()),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*St.ENTRIES])}for(h=0,l=t.readInt(!0);h<l;h++){I=t.readInt(!0);var b=r.pathConstraints[I];for(d=0,c=t.readInt(!0);d<c;d++){p=t.readByte(),y=t.readInt(!0);switch(p){case oe.PATH_POSITION:case oe.PATH_SPACING:w=void 0,x=1;p==oe.PATH_SPACING?(w=new Ct(y),b.spacingMode!=Ht.Length&&b.spacingMode!=Ht.Fixed||(x=i)):(w=new Tt(y),b.positionMode==zt.Fixed&&(x=i)),w.pathConstraintIndex=I;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat()*x),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*Tt.ENTRIES]);break;case oe.PATH_MIX:(w=new Vt(y)).pathConstraintIndex=I;for(f=0;f<y;f++)w.setFrame(f,t.readFloat(),t.readFloat(),t.readFloat()),f<y-1&&this.readCurve(t,f,w);n.push(w),a=Math.max(a,w.frames[(y-1)*Vt.ENTRIES])}}}for(h=0,l=t.readInt(!0);h<l;h++){var E=r.skins[t.readInt(!0)];for(d=0,c=t.readInt(!0);d<c;d++){u=t.readInt(!0);for(var A=0,M=t.readInt(!0);A<M;A++){var R=E.getAttachment(u,t.readString()),S=null!=R.bones,C=R.vertices,V=S?C.length/3*2:C.length;y=t.readInt(!0);(w=new Et(y)).slotIndex=u,w.attachment=R;for(f=0;f<y;f++){m=t.readFloat();var F=void 0,P=t.readInt(!0);if(0==P)F=S?k.newFloatArray(V):C;else{F=k.newFloatArray(V);var N=t.readInt(!0);if(P+=N,1==i)for(var L=N;L<P;L++)F[L]=t.readFloat();else for(L=N;L<P;L++)F[L]=t.readFloat()*i;if(!S){L=0;for(var O=F.length;L<O;L++)F[L]+=C[L]}}w.setFrame(f,m,F),f<y-1&&this.readCurve(t,f,w)}n.push(w),a=Math.max(a,w.frames[y-1])}}}var Y=t.readInt(!0);if(Y>0){w=new Mt(Y);var D=r.slots.length;for(h=0;h<Y;h++){m=t.readFloat();var B=t.readInt(!0),X=k.newArray(D,0);for(d=D-1;d>=0;d--)X[d]=-1;var W=k.newArray(D-B,0),G=0,Z=0;for(d=0;d<B;d++){for(u=t.readInt(!0);G!=u;)W[Z++]=G++;X[G+t.readInt(!0)]=G++}for(;G<D;)W[Z++]=G++;for(d=D-1;d>=0;d--)-1==X[d]&&(X[d]=W[--Z]);w.setFrame(h,m,X)}n.push(w),a=Math.max(a,w.frames[Y-1])}var U=t.readInt(!0);if(U>0){for(w=new At(U),h=0;h<U;h++){m=t.readFloat();var _=r.events[t.readInt(!0)],j=new Gt(m,_);j.intValue=t.readInt(!1),j.floatValue=t.readFloat(),j.stringValue=t.readBoolean()?t.readString():_.stringValue,null!=j.data.audioPath&&(j.volume=t.readFloat(),j.balance=t.readFloat()),w.setFrame(h,j)}n.push(w),a=Math.max(a,w.frames[U-1])}return new ut(e,n,a)},e}(oe),ue=function(){function t(t,e,r,n){void 0===e&&(e=new Array),void 0===r&&(r=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=r,this.buffer=n}return t.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},t.prototype.readShort=function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t},t.prototype.readInt32=function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t},t.prototype.readInt=function(t){var e=this.readByte(),r=127&e;return 0!=(128&e)&&(r|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(r|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(r|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(r|=(127&(e=this.readByte()))<<28)))),t?r:r>>>1^-(1&r)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",r=0;r<t;){var n=this.readByte();switch(n>>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),r+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),r+=3;break;default:e+=String.fromCharCode(n),r++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}();var de=function(t,e,r,n,i){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=n,this.inheritDeform=i};var ce=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e};var pe=function(){function t(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return t.prototype.readSkeletonData=function(e){var r=this.scale,n=new ee,i="string"==typeof e?JSON.parse(e):e,a=i.skeleton;if(null!=a&&(n.hash=a.hash,n.version=a.spine,n.x=a.x,n.y=a.y,n.width=a.width,n.height=a.height,n.fps=a.fps,n.imagesPath=a.images),i.bones)for(var s=0;s<i.bones.length;s++){var o=i.bones[s],h=null,l=this.getValue(o,"parent",null);if(null!=l&&null==(h=n.findBone(l)))throw new Error("Parent bone not found: "+l);(p=new Dt(n.bones.length,o.name,h)).length=this.getValue(o,"length",0)*r,p.x=this.getValue(o,"x",0)*r,p.y=this.getValue(o,"y",0)*r,p.rotation=this.getValue(o,"rotation",0),p.scaleX=this.getValue(o,"scaleX",1),p.scaleY=this.getValue(o,"scaleY",1),p.shearX=this.getValue(o,"shearX",0),p.shearY=this.getValue(o,"shearY",0),p.transformMode=t.transformModeFromString(this.getValue(o,"transform","normal")),p.skinRequired=this.getValue(o,"skin",!1),n.bones.push(p)}if(i.slots)for(s=0;s<i.slots.length;s++){var u=(M=i.slots[s]).name,d=M.bone,c=n.findBone(d);if(null==c)throw new Error("Slot bone not found: "+d);var p=new re(n.slots.length,u,c),f=this.getValue(M,"color",null);null!=f&&p.color.setFromString(f);var m=this.getValue(M,"dark",null);null!=m&&(p.darkColor=new T(1,1,1,1),p.darkColor.setFromString(m)),p.attachmentName=this.getValue(M,"attachment",null),p.blendMode=t.blendModeFromString(this.getValue(M,"blend","normal")),n.slots.push(p)}if(i.ik)for(s=0;s<i.ik.length;s++){var g=i.ik[s];(p=new _t(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(var v=0;v<g.bones.length;v++){d=g.bones[v];if(null==(b=n.findBone(d)))throw new Error("IK bone not found: "+d);p.bones.push(b)}var y=g.target;if(p.target=n.findBone(y),null==p.target)throw new Error("IK target bone not found: "+y);p.mix=this.getValue(g,"mix",1),p.softness=this.getValue(g,"softness",0)*r,p.bendDirection=this.getValue(g,"bendPositive",!0)?1:-1,p.compress=this.getValue(g,"compress",!1),p.stretch=this.getValue(g,"stretch",!1),p.uniform=this.getValue(g,"uniform",!1),n.ikConstraints.push(p)}if(i.transform)for(s=0;s<i.transform.length;s++){g=i.transform[s];(p=new ae(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(v=0;v<g.bones.length;v++){d=g.bones[v];if(null==(b=n.findBone(d)))throw new Error("Transform constraint bone not found: "+d);p.bones.push(b)}y=g.target;if(p.target=n.findBone(y),null==p.target)throw new Error("Transform constraint target bone not found: "+y);p.local=this.getValue(g,"local",!1),p.relative=this.getValue(g,"relative",!1),p.offsetRotation=this.getValue(g,"rotation",0),p.offsetX=this.getValue(g,"x",0)*r,p.offsetY=this.getValue(g,"y",0)*r,p.offsetScaleX=this.getValue(g,"scaleX",0),p.offsetScaleY=this.getValue(g,"scaleY",0),p.offsetShearY=this.getValue(g,"shearY",0),p.rotateMix=this.getValue(g,"rotateMix",1),p.translateMix=this.getValue(g,"translateMix",1),p.scaleMix=this.getValue(g,"scaleMix",1),p.shearMix=this.getValue(g,"shearMix",1),n.transformConstraints.push(p)}if(i.path)for(s=0;s<i.path.length;s++){g=i.path[s];(p=new jt(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(v=0;v<g.bones.length;v++){d=g.bones[v];if(null==(b=n.findBone(d)))throw new Error("Transform constraint bone not found: "+d);p.bones.push(b)}y=g.target;if(p.target=n.findSlot(y),null==p.target)throw new Error("Path target slot not found: "+y);p.positionMode=t.positionModeFromString(this.getValue(g,"positionMode","percent")),p.spacingMode=t.spacingModeFromString(this.getValue(g,"spacingMode","length")),p.rotateMode=t.rotateModeFromString(this.getValue(g,"rotateMode","tangent")),p.offsetRotation=this.getValue(g,"rotation",0),p.position=this.getValue(g,"position",0),p.positionMode==zt.Fixed&&(p.position*=r),p.spacing=this.getValue(g,"spacing",0),p.spacingMode!=Ht.Length&&p.spacingMode!=Ht.Fixed||(p.spacing*=r),p.rotateMix=this.getValue(g,"rotateMix",1),p.translateMix=this.getValue(g,"translateMix",1),n.pathConstraints.push(p)}if(i.skins)for(s=0;s<i.skins.length;s++){var w=i.skins[s],x=new ie(w.name);if(w.bones)for(var I=0;I<w.bones.length;I++){var b;if(null==(b=n.findBone(w.bones[I])))throw new Error("Skin bone not found: "+w.bones[s]);x.bones.push(b)}if(w.ik)for(I=0;I<w.ik.length;I++){if(null==(E=n.findIkConstraint(w.ik[I])))throw new Error("Skin IK constraint not found: "+w.ik[s]);x.constraints.push(E)}if(w.transform)for(I=0;I<w.transform.length;I++){if(null==(E=n.findTransformConstraint(w.transform[I])))throw new Error("Skin transform constraint not found: "+w.transform[s]);x.constraints.push(E)}if(w.path)for(I=0;I<w.path.length;I++){var E;if(null==(E=n.findPathConstraint(w.path[I])))throw new Error("Skin path constraint not found: "+w.path[s]);x.constraints.push(E)}for(var u in w.attachments){var A=n.findSlot(u);if(null==A)throw new Error("Slot not found: "+u);var M=w.attachments[u];for(var R in M){var S=this.readAttachment(M[R],x,A.index,R,n);null!=S&&x.setAttachment(A.index,R,S)}}n.skins.push(x),"default"==x.name&&(n.defaultSkin=x)}s=0;for(var C=this.linkedMeshes.length;s<C;s++){var V=this.linkedMeshes[s];if(null==(x=null==V.skin?n.defaultSkin:n.findSkin(V.skin)))throw new Error("Skin not found: "+V.skin);var F=x.getAttachment(V.slotIndex,V.parent);if(null==F)throw new Error("Parent mesh not found: "+V.parent);V.mesh.deformAttachment=V.inheritDeform?F:V.mesh,V.mesh.setParentMesh(F),V.mesh.updateUVs()}if(this.linkedMeshes.length=0,i.events)for(var P in i.events){var k=i.events[P];(p=new Zt(P)).intValue=this.getValue(k,"int",0),p.floatValue=this.getValue(k,"float",0),p.stringValue=this.getValue(k,"string",""),p.audioPath=this.getValue(k,"audio",null),null!=p.audioPath&&(p.volume=this.getValue(k,"volume",1),p.balance=this.getValue(k,"balance",0)),n.events.push(p)}if(i.animations)for(var N in i.animations){var L=i.animations[N];this.readAnimation(L,N,n)}return n},t.prototype.readAttachment=function(t,e,r,n,i){var a=this.scale;switch(n=this.getValue(t,"name",n),this.getValue(t,"type","region")){case"region":var s=this.getValue(t,"path",n),o=this.attachmentLoader.newRegionAttachment(e,n,s);return null==o?null:(o.path=s,o.x=this.getValue(t,"x",0)*a,o.y=this.getValue(t,"y",0)*a,o.scaleX=this.getValue(t,"scaleX",1),o.scaleY=this.getValue(t,"scaleY",1),o.rotation=this.getValue(t,"rotation",0),o.width=t.width*a,o.height=t.height*a,null!=(w=this.getValue(t,"color",null))&&o.color.setFromString(w),o.updateOffset(),o);case"boundingbox":var h=this.attachmentLoader.newBoundingBoxAttachment(e,n);return null==h?null:(this.readVertices(t,h,t.vertexCount<<1),null!=(w=this.getValue(t,"color",null))&&h.color.setFromString(w),h);case"mesh":case"linkedmesh":s=this.getValue(t,"path",n);var l=this.attachmentLoader.newMeshAttachment(e,n,s);if(null==l)return null;l.path=s,null!=(w=this.getValue(t,"color",null))&&l.color.setFromString(w),l.width=this.getValue(t,"width",0)*a,l.height=this.getValue(t,"height",0)*a;var u=this.getValue(t,"parent",null);if(null!=u)return this.linkedMeshes.push(new fe(l,this.getValue(t,"skin",null),r,u,this.getValue(t,"deform",!0))),l;var d=t.uvs;return this.readVertices(t,l,d.length),l.triangles=t.triangles,l.regionUVs=d,l.updateUVs(),l.edges=this.getValue(t,"edges",null),l.hullLength=2*this.getValue(t,"hull",0),l;case"path":if(null==(s=this.attachmentLoader.newPathAttachment(e,n)))return null;s.closed=this.getValue(t,"closed",!1),s.constantSpeed=this.getValue(t,"constantSpeed",!0);var c=t.vertexCount;this.readVertices(t,s,c<<1);for(var p=k.newArray(c/3,0),f=0;f<t.lengths.length;f++)p[f]=t.lengths[f]*a;return s.lengths=p,null!=(w=this.getValue(t,"color",null))&&s.color.setFromString(w),s;case"point":var m=this.attachmentLoader.newPointAttachment(e,n);return null==m?null:(m.x=this.getValue(t,"x",0)*a,m.y=this.getValue(t,"y",0)*a,m.rotation=this.getValue(t,"rotation",0),null!=(w=this.getValue(t,"color",null))&&m.color.setFromString(w),m);case"clipping":var g=this.attachmentLoader.newClippingAttachment(e,n);if(null==g)return null;var v=this.getValue(t,"end",null);if(null!=v){var y=i.findSlot(v);if(null==y)throw new Error("Clipping end slot not found: "+v);g.endSlot=y}var w;c=t.vertexCount;return this.readVertices(t,g,c<<1),null!=(w=this.getValue(t,"color",null))&&g.color.setFromString(w),g}return null},t.prototype.readVertices=function(t,e,r){var n=this.scale;e.worldVerticesLength=r;var i=t.vertices;if(r!=i.length){var a=new Array,s=new Array;for(u=0,d=i.length;u<d;){var o=i[u++];s.push(o);for(var h=u+4*o;u<h;u+=4)s.push(i[u]),a.push(i[u+1]*n),a.push(i[u+2]*n),a.push(i[u+3])}e.bones=s,e.vertices=k.toFloatArray(a)}else{var l=k.toFloatArray(i);if(1!=n)for(var u=0,d=i.length;u<d;u++)l[u]*=n;e.vertices=l}},t.prototype.readAnimation=function(t,e,r){var n=this.scale,i=new Array,a=0;if(t.slots)for(var s in t.slots){var o=t.slots[s];if(-1==(q=r.findSlotIndex(s)))throw new Error("Slot not found: "+s);for(var h in o){var l=o[h];if("attachment"==h){(w=new It(l.length)).slotIndex=q;for(var u=0,d=0;d<l.length;d++){var c=l[d];w.setFrame(u++,this.getValue(c,"time",0),c.name)}i.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}else if("color"==h){(w=new wt(l.length)).slotIndex=q;for(u=0,d=0;d<l.length;d++){c=l[d];var p=new T;p.setFromString(c.color),w.setFrame(u,this.getValue(c,"time",0),p.r,p.g,p.b,p.a),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*wt.ENTRIES])}else{if("twoColor"!=h)throw new Error("Invalid timeline type for a slot: "+h+" ("+s+")");(w=new xt(l.length)).slotIndex=q;for(u=0,d=0;d<l.length;d++){c=l[d];var f=new T,m=new T;f.setFromString(c.light),m.setFromString(c.dark),w.setFrame(u,this.getValue(c,"time",0),f.r,f.g,f.b,f.a,m.r,m.g,m.b),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*xt.ENTRIES])}}}if(t.bones)for(var g in t.bones){var v=t.bones[g],y=r.findBoneIndex(g);if(-1==y)throw new Error("Bone not found: "+g);for(var h in v){l=v[h];if("rotate"===h){(w=new mt(l.length)).boneIndex=y;for(u=0,d=0;d<l.length;d++){c=l[d];w.setFrame(u,this.getValue(c,"time",0),this.getValue(c,"angle",0)),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*mt.ENTRIES])}else{if("translate"!==h&&"scale"!==h&&"shear"!==h)throw new Error("Invalid timeline type for a bone: "+h+" ("+g+")");var w=null,x=1,I=0;"scale"===h?(w=new vt(l.length),I=1):"shear"===h?w=new yt(l.length):(w=new gt(l.length),x=n),w.boneIndex=y;for(u=0,d=0;d<l.length;d++){c=l[d];var b=this.getValue(c,"x",I),E=this.getValue(c,"y",I);w.setFrame(u,this.getValue(c,"time",0),b*x,E*x),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*gt.ENTRIES])}}}if(t.ik)for(var A in t.ik){var M=t.ik[A],R=r.findIkConstraint(A);(w=new Rt(M.length)).ikConstraintIndex=r.ikConstraints.indexOf(R);for(u=0,d=0;d<M.length;d++){c=M[d];w.setFrame(u,this.getValue(c,"time",0),this.getValue(c,"mix",1),this.getValue(c,"softness",0)*n,this.getValue(c,"bendPositive",!0)?1:-1,this.getValue(c,"compress",!1),this.getValue(c,"stretch",!1)),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*Rt.ENTRIES])}if(t.transform)for(var A in t.transform){M=t.transform[A],R=r.findTransformConstraint(A);(w=new St(M.length)).transformConstraintIndex=r.transformConstraints.indexOf(R);for(u=0,d=0;d<M.length;d++){c=M[d];w.setFrame(u,this.getValue(c,"time",0),this.getValue(c,"rotateMix",1),this.getValue(c,"translateMix",1),this.getValue(c,"scaleMix",1),this.getValue(c,"shearMix",1)),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*St.ENTRIES])}if(t.path)for(var A in t.path){M=t.path[A];var S=r.findPathConstraintIndex(A);if(-1==S)throw new Error("Path constraint not found: "+A);var C=r.pathConstraints[S];for(var h in M){l=M[h];if("position"===h||"spacing"===h){w=null,x=1;"spacing"===h?(w=new Ct(l.length),C.spacingMode!=Ht.Length&&C.spacingMode!=Ht.Fixed||(x=n)):(w=new Tt(l.length),C.positionMode==zt.Fixed&&(x=n)),w.pathConstraintIndex=S;for(u=0,d=0;d<l.length;d++){c=l[d];w.setFrame(u,this.getValue(c,"time",0),this.getValue(c,h,0)*x),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*Tt.ENTRIES])}else if("mix"===h){(w=new Vt(l.length)).pathConstraintIndex=S;for(u=0,d=0;d<l.length;d++){c=l[d];w.setFrame(u,this.getValue(c,"time",0),this.getValue(c,"rotateMix",1),this.getValue(c,"translateMix",1)),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*Vt.ENTRIES])}}}if(t.deform)for(var V in t.deform){var F=t.deform[V],P=r.findSkin(V);if(null==P)throw new Error("Skin not found: "+V);for(var s in F){o=F[s];if(-1==(q=r.findSlotIndex(s)))throw new Error("Slot not found: "+o.name);for(var h in o){l=o[h];var N=P.getAttachment(q,h);if(null==N)throw new Error("Deform attachment not found: "+l.name);var L=null!=N.bones,O=N.vertices,Y=L?O.length/3*2:O.length;(w=new Et(l.length)).slotIndex=q,w.attachment=N;u=0;for(var D=0;D<l.length;D++){c=l[D];var B=void 0,X=this.getValue(c,"vertices",null);if(null==X)B=L?k.newFloatArray(Y):O;else{B=k.newFloatArray(Y);var W=this.getValue(c,"offset",0);if(k.arrayCopy(X,0,B,W,X.length),1!=n)for(var G=(d=W)+X.length;d<G;d++)B[d]*=n;if(!L)for(d=0;d<Y;d++)B[d]+=O[d]}w.setFrame(u,this.getValue(c,"time",0),B),this.readCurve(c,w,u),u++}i.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}}}var Z=t.drawOrder;if(null==Z&&(Z=t.draworder),null!=Z){w=new Mt(Z.length);var U=r.slots.length;for(u=0,D=0;D<Z.length;D++){var _=Z[D],j=null,z=this.getValue(_,"offsets",null);if(null!=z){j=k.newArray(U,-1);var H=k.newArray(U-z.length,0),J=0,Q=0;for(d=0;d<z.length;d++){var q,K=z[d];if(-1==(q=r.findSlotIndex(K.slot)))throw new Error("Slot not found: "+K.slot);for(;J!=q;)H[Q++]=J++;j[J+K.offset]=J++}for(;J<U;)H[Q++]=J++;for(d=U-1;d>=0;d--)-1==j[d]&&(j[d]=H[--Q])}w.setFrame(u++,this.getValue(_,"time",0),j)}i.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(t.events){for(w=new At(t.events.length),u=0,d=0;d<t.events.length;d++){var $=t.events[d],tt=r.findEvent($.name);if(null==tt)throw new Error("Event not found: "+$.name);var et=new Gt(k.toSinglePrecision(this.getValue($,"time",0)),tt);et.intValue=this.getValue($,"int",tt.intValue),et.floatValue=this.getValue($,"float",tt.floatValue),et.stringValue=this.getValue($,"string",tt.stringValue),null!=et.data.audioPath&&(et.volume=this.getValue($,"volume",1),et.balance=this.getValue($,"balance",0)),w.setFrame(u++,et)}i.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(isNaN(a))throw new Error("Error while parsing animation, duration is NaN");r.animations.push(new ut(e,i,a))},t.prototype.readCurve=function(t,e,r){if(t.curve)if("stepped"==t.curve)e.setStepped(r);else{var n=t.curve;e.setCurve(r,n,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1))}},t.prototype.getValue=function(t,e,r){return void 0!==t[e]?t[e]:r},t.blendModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return m.Normal;if("additive"==t)return m.Additive;if("multiply"==t)return m.Multiply;if("screen"==t)return m.Screen;throw new Error("Unknown blend mode: "+t)},t.positionModeFromString=function(t){if("fixed"==(t=t.toLowerCase()))return zt.Fixed;if("percent"==t)return zt.Percent;throw new Error("Unknown position mode: "+t)},t.spacingModeFromString=function(t){if("length"==(t=t.toLowerCase()))return Ht.Length;if("fixed"==t)return Ht.Fixed;if("percent"==t)return Ht.Percent;throw new Error("Unknown position mode: "+t)},t.rotateModeFromString=function(t){if("tangent"==(t=t.toLowerCase()))return Jt.Tangent;if("chain"==t)return Jt.Chain;if("chainscale"==t)return Jt.ChainScale;throw new Error("Unknown rotate mode: "+t)},t.transformModeFromString=function(t){if("normal"==(t=t.toLowerCase()))return Bt.Normal;if("onlytranslation"==t)return Bt.OnlyTranslation;if("norotationorreflection"==t)return Bt.NoRotationOrReflection;if("noscale"==t)return Bt.NoScale;if("noscaleorreflection"==t)return Bt.NoScaleOrReflection;throw new Error("Unknown transform mode: "+t)},t}();var fe=function(t,e,r,n,i){this.mesh=t,this.skin=e,this.slotIndex=r,this.parent=n,this.inheritDeform=i};!function(){function t(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}t.prototype.begin=function(t){},t.prototype.transform=function(t,e,r,n){t.x+=C.randomTriangular(-this.jitterX,this.jitterY),t.y+=C.randomTriangular(-this.jitterX,this.jitterY)},t.prototype.end=function(){}}();!function(){function t(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}t.prototype.begin=function(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},t.prototype.transform=function(e,r,n,i){var a=this.angle*C.degreesToRadians,s=e.x-this.worldX,o=e.y-this.worldY,h=Math.sqrt(s*s+o*o);if(h<this.radius){var l=t.interpolation.apply(0,a,(this.radius-h)/this.radius),u=Math.cos(l),d=Math.sin(l);e.x=u*s-d*o+this.worldX,e.y=d*s+u*o+this.worldY}},t.prototype.end=function(){},t.interpolation=new P(2)}();var me=function(){function t(){this.defaultMix=.25,this.premultipliedAlpha=!0,this.transitionTime=.2,this.speed=1,this.animationValue=null,this.animationChange=new e.EventEmitter,this.animationsValue=[],this.animationsChange=new e.EventEmitter,this.skinValue=null,this.skinChange=new e.EventEmitter,this.skinsValue=[],this.skinsChange=new e.EventEmitter,this.loaded=new e.EventEmitter,this.time=new O,this.paused=!0,this.playTime=0,this.currentViewport=null,this.previousViewport=null,this.viewportTransitionStart=0,this.init=!1}return Object.defineProperty(t.prototype,"dataUrls",{get:function(){return this.urls},set:function(t){var e=this;if(this.urls=t,!this.urls.json&&!this.urls.skel)throw new Error("Please specify the URL of the skeleton JSON or .skel file.");if(!this.urls.atlas)throw new Error("Please specify the URL of the atlas file.");this.init&&(this.loaded.emit(!1),this.loadAsset().then((function(){console.log("load assets"),e.loadSkeleton(),e.loaded.emit(!0),requestAnimationFrame((function(){return e.drawFrame()}))})))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animation",{get:function(){return this.animationValue},set:function(t){this.animationValue=t,this.animationChange.emit(t),this.skeleton&&this.animations.length>0&&(this.playTime=0,this.setAnimation(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animations",{get:function(){return this.animationsValue},set:function(t){this.animationsValue=t,this.animationsChange.emit(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skin",{get:function(){return this.skinValue},set:function(t){this.skinValue=t,this.skinChange.emit(this.skinValue),this.skeleton&&this.animations.length>0&&(this.skeleton.setSkinByName(t),this.skeleton.setSlotsToSetupPose())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skins",{get:function(){return this.skinsValue},set:function(t){this.skinsValue=t,this.skinsChange.emit(t)},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.loaded.emit(!1),this.context=new g(this.canvas.nativeElement,{alpha:!0}),this.sceneRenderer=new ht(this.canvas.nativeElement,this.context,!0),this.assetManager=new w(this.context),this.init=!0,this.loadAsset().then((function(){console.log("load assets"),t.loadSkeleton(),t.loaded.emit(!0),requestAnimationFrame((function(){return t.drawFrame()}))}))},t.prototype.loadAsset=function(){var t=this,e=[];return e.push(new Promise((function(e,r){t.assetManager.loadTextureAtlas(t.dataUrls.atlas,e,r)}))),this.dataUrls.json?e.push(new Promise((function(e,r){t.assetManager.loadText(t.dataUrls.json,e,r)}))):e.push(new Promise((function(e,r){t.assetManager.loadBinary(t.dataUrls.skel,e,r)}))),Promise.all(e)},t.prototype.loadSkeleton=function(){var t,e=this.assetManager.get(this.dataUrls.atlas);if(this.dataUrls.json){var r=this.assetManager.get(this.dataUrls.json);t=new pe(new Yt(e)).readSkeletonData(r)}else{var n=this.assetManager.get(this.dataUrls.skel);t=new oe(new Yt(e)).readSkeletonData(n)}this.skeleton=new te(t);var i=new Lt(t);if(i.defaultMix=this.defaultMix,this.animationState=new Ft(i),!(t.skins.length>0))throw new Error("");if(this.skins=t.skins.map((function(t){return t.name})),this.skin){if(!this.skins.includes(this.skin))throw new Error("");this.skeleton.setSkinByName(this.skin),this.skeleton.setSlotsToSetupPose()}else this.skin=this.skins[0];if(t.animations.length>0&&(this.animations=t.animations.map((function(t){return t.name}))),this.animation){if(!this.animations.includes(this.animation))throw new Error("")}else this.animation=this.animations[0];this.play()},t.prototype.drawFrame=function(t){var e=this;void 0===t&&(t=!0),t&&requestAnimationFrame((function(){return e.drawFrame()}));var r=this.context.gl;if(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),this.sceneRenderer.resize(lt.Expand),!this.paused&&this.animation){this.time.update();var n=this.time.delta*this.speed,i=this.animationState.getCurrent(0).animation.duration;for(this.playTime+=n;this.playTime>=i&&0!==i;)this.playTime-=i;this.playTime=Math.max(0,Math.min(this.playTime,i)),this.animationState.update(n),this.animationState.apply(this.skeleton)}this.skeleton.updateWorldTransform();var a={x:this.currentViewport.x-this.currentViewport.padLeft,y:this.currentViewport.y-this.currentViewport.padBottom,width:this.currentViewport.width+this.currentViewport.padLeft+this.currentViewport.padRight,height:this.currentViewport.height+this.currentViewport.padBottom+this.currentViewport.padTop},s=(performance.now()-this.viewportTransitionStart)/1e3/this.transitionTime;if(this.previousViewport&&s<1){var o={x:this.previousViewport.x-this.previousViewport.padLeft,y:this.previousViewport.y-this.previousViewport.padBottom,width:this.previousViewport.width+this.previousViewport.padLeft+this.previousViewport.padRight,height:this.previousViewport.height+this.previousViewport.padBottom+this.previousViewport.padTop};a={x:o.x+(a.x-o.x)*s,y:o.y+(a.y-o.y)*s,width:o.width+(a.width-o.width)*s,height:o.height+(a.height-o.height)*s}}var h=this.scale(a.width,a.height,this.canvas.nativeElement.width,this.canvas.nativeElement.height);this.sceneRenderer.camera.zoom=a.width/h.x,this.sceneRenderer.camera.position.x=a.x+a.width/2,this.sceneRenderer.camera.position.y=a.y+a.height/2,this.sceneRenderer.begin(),this.sceneRenderer.drawSkeleton(this.skeleton,this.premultipliedAlpha),this.sceneRenderer.end(),this.sceneRenderer.camera.zoom=0},t.prototype.play=function(){this.paused=!1,this.setAnimation(this.animation)},t.prototype.pause=function(){this.paused=!0},t.prototype.setAnimation=function(t){this.previousViewport=this.currentViewport;var e=this.calculateAnimationViewport(t),r={x:e.x,y:e.y,width:e.width,height:e.height,padLeft:"10%",padRight:"10%",padTop:"10%",padBottom:"10%"};r.padLeft=this.percentageToWorldUnit(r.width,r.padLeft),r.padRight=this.percentageToWorldUnit(r.width,r.padRight),r.padBottom=this.percentageToWorldUnit(r.height,r.padBottom),r.padTop=this.percentageToWorldUnit(r.height,r.padTop),this.currentViewport=r,this.viewportTransitionStart=performance.now(),this.animationState.clearTracks(),this.skeleton.setToSetupPose(),this.animationState.setAnimation(0,t,!0)},t.prototype.percentageToWorldUnit=function(t,e){return"string"==typeof e?t*parseFloat(e.substr(0,e.length-1))/100:e},t.prototype.calculateAnimationViewport=function(t){var e=this.skeleton.data.findAnimation(t);this.animationState.clearTracks(),this.skeleton.setToSetupPose(),this.animationState.setAnimationWith(0,e,!0);for(var r=e.duration>0?e.duration/100:0,n=new L,i=new L,a=1e8,s=-1e8,o=1e8,h=-1e8,l=0;l<100;l++)this.animationState.update(r),this.animationState.apply(this.skeleton),this.skeleton.updateWorldTransform(),this.skeleton.getBounds(n,i),a=Math.min(n.x,a),s=Math.max(n.x+i.x,s),o=Math.min(n.y,o),h=Math.max(n.y+i.y,h);return n.x=a,n.y=o,i.x=s-a,i.y=h-o,{x:n.x,y:n.y,width:i.x,height:i.y}},t.prototype.scale=function(t,e,r,n){var i=n/r>e/t?r/t:n/e,a=new L;return a.x=t*i,a.y=e*i,a},t.decorators=[{type:e.Component,args:[{selector:"ngx-spine-webgl",template:'\n <canvas class="ngx-spine-webgl" #canvas></canvas>\n',changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.propDecorators={dataUrls:[{type:e.Input}],defaultMix:[{type:e.Input}],premultipliedAlpha:[{type:e.Input}],transitionTime:[{type:e.Input}],speed:[{type:e.Input}],canvas:[{type:e.ViewChild,args:["canvas",{static:!0,read:e.ElementRef}]}],animationChange:[{type:e.Output}],animation:[{type:e.Input}],animationsChange:[{type:e.Output}],animations:[{type:e.Input}],skinChange:[{type:e.Output}],skin:[{type:e.Input}],skinsChange:[{type:e.Output}],skins:[{type:e.Input}],loaded:[{type:e.Output}]},t}();var ge=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[me],exports:[me]}]}],t}();t.NgxSpineModule=ge,t.NgxSpineWebglComponent=me,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-spine.umd.min.js.map