@galacean/effects-plugin-spine 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v1.2.2
6
+ * Version: v1.2.4
7
7
  */
8
8
 
9
9
  'use strict';
@@ -12967,7 +12967,7 @@ var SpineLoader = /** @class */ (function (_super) {
12967
12967
  }(effects.AbstractPlugin));
12968
12968
 
12969
12969
  effects.registerPlugin('spine', SpineLoader, SpineVFXItem);
12970
- var version = "1.2.2";
12970
+ var version = "1.2.4";
12971
12971
  effects.logger.info('plugin spine version: ' + version);
12972
12972
 
12973
12973
  exports.AlphaTimeline = AlphaTimeline;
package/dist/index.min.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v1.2.2
6
+ * Version: v1.2.4
7
7
  */
8
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.spinePlugin={}),t.ge)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function i(t,e,n,r){return new(n||(n=Promise))((function(i,a){function s(t){try{h(r.next(t))}catch(t){a(t)}}function o(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((r=r.apply(t,e||[])).next())}))}function a(t,e){var n,r,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(h){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,h])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var h,l=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}(),c=function(){function t(){this.entries={},this.size=0}return t.prototype.add=function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)},t.prototype.addAll=function(t){for(var e=this.size,n=0,r=t.length;n<r;n++)this.add(t[n]);return e!=this.size},t.prototype.contains=function(t){return this.entries[t]},t.prototype.clear=function(){this.entries={},this.size=0},t}(),u=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp()},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?1:parseInt(t.substr(6,2),16)/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp()},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.fromString=function(e){return(new t).setFromString(e)},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}(),d=function(){function t(){}return t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.atan2Deg=function(e,n){return Math.atan2(e,n)*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,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(e-n))},t.isPowerOfTwo=function(t){return t&&0==(t&t-1)},t.PI=3.1415927,t.PI2=2*t.PI,t.invPI2=1/t.PI2,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}(),f=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}(),p=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return r(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}(f),m=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(p),g=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,s=r;a<e+i;a++,s++)n[s]=t[a]},t.arrayFill=function(t,e,n,r){for(var i=e;i<n;i++)t[i]=r},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var r=t.length;if(r==e)return t;if(t.length=e,r<e)for(var i=r;i<e;i++)t[i]=n;return t},t.ensureArrayCapacity=function(e,n,r){return void 0===r&&(r=0),e.length>=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r<t;r++)n[r]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},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,n){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},t.enumValue=function(t,e){return t[e[0].toUpperCase()+e.slice(1)]},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}(),v=function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var n=t.bones[e];console.log(n.data.name+", "+n.a+", "+n.b+", "+n.c+", "+n.d+", "+n.worldX+", "+n.worldY)}},t}(),y=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++)this.free(t[e])},t.prototype.clear=function(){this.items.length=0},t}(),x=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}(),w=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}(),b=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)}return 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},t}(),M=function(t){if(!t)throw new Error("name cannot be null.");this.name=t},S=function(t){function e(n){var r=t.call(this,n)||this;return r.id=e.nextID++,r.bones=null,r.vertices=[],r.worldVerticesLength=0,r.timelineAttachment=r,r}return r(e,t),e.prototype.computeWorldVertices=function(t,e,n,r,i,a){n=i+(n>>1)*a;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,d=0;d<e;d+=2){c+=(g=l[c])+1,u+=g}var f=s.bones;if(0==o.length)for(C=i,k=3*u;C<n;C+=a){var p=0,m=0,g=l[c++];for(g+=c;c<g;c++,k+=3){w=f[l[c]],E=h[k],F=h[k+1];var v=h[k+2];p+=(E*w.a+F*w.b+w.worldX)*v,m+=(E*w.c+F*w.d+w.worldY)*v}r[C]=p,r[C+1]=m}else for(var y=o,x=(C=i,k=3*u,u<<1);C<n;C+=a){p=0,m=0,g=l[c++];for(g+=c;c<g;c++,k+=3,x+=2){w=f[l[c]],E=h[k]+y[x],F=h[k+1]+y[x+1],v=h[k+2];p+=(E*w.a+F*w.b+w.worldX)*v,m+=(E*w.c+F*w.d+w.worldY)*v}r[C]=p,r[C+1]=m}}else{o.length>0&&(h=o);for(var w,b=(w=t.bone).worldX,M=w.worldY,S=w.a,k=w.b,A=w.c,I=w.d,T=e,C=i;C<n;T+=2,C+=a){var E=h[T],F=h[T+1];r[C]=E*S+F*k+b,r[C+1]=E*A+F*I+M}}},e.prototype.copyTo=function(t){this.bones?(t.bones=new Array(this.bones.length),g.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=g.newFloatArray(this.vertices.length),g.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment},e.nextID=0,e}(M),k=function(){function t(e){this.id=t.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}return t.prototype.copy=function(){var e=new t(this.regions.length);return g.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e},t.prototype.apply=function(t,e){var n=t.sequenceIndex;-1==n&&(n=this.setupIndex),n>=this.regions.length&&(n=this.regions.length-1);var r=this.regions[n];e.region!=r&&(e.region=r,e.updateRegion())},t.prototype.getPath=function(t,e){for(var n=t,r=(this.start+e).toString(),i=this.digits-r.length;i>0;i--)n+="0";return n+=r},t.nextID=function(){return t._nextID++},t._nextID=0,t}();!function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(h||(h={}));var A,I,T=[h.hold,h.once,h.loop,h.pingpong,h.onceReverse,h.loopReverse,h.pingpongReverse],C=function(){function t(t,e,n){if(this.timelines=[],this.timelineIds=new c,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=n}return t.prototype.setTimelines=function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())},t.prototype.hasTimeline=function(t){for(var e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1},t.prototype.apply=function(t,e,n,r,i,a,s,o){if(!t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;l<c;l++)h[l].apply(t,e,n,i,a,s,o)},t}();t.MixBlend=void 0,(A=t.MixBlend||(t.MixBlend={}))[A.setup=0]="setup",A[A.first=1]="first",A[A.replace=2]="replace",A[A.add=3]="add",t.MixDirection=void 0,(I=t.MixDirection||(t.MixDirection={}))[I.mixIn=0]="mixIn",I[I.mixOut=1]="mixOut";var E,F={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,physicsConstraintInertia:19,physicsConstraintStrength:20,physicsConstraintDamping:21,physicsConstraintMass:22,physicsConstraintWind:23,physicsConstraintGravity:24,physicsConstraintMix:25,physicsConstraintReset:26,sequence:27},B=function(){function t(t,e){this.propertyIds=e,this.frames=g.newFloatArray(t*this.getFrameEntries())}return t.prototype.getPropertyIds=function(){return this.propertyIds},t.prototype.getFrameEntries=function(){return 1},t.prototype.getFrameCount=function(){return this.frames.length/this.getFrameEntries()},t.prototype.getDuration=function(){return this.frames[this.frames.length-this.getFrameEntries()]},t.search1=function(t,e){for(var n=t.length,r=1;r<n;r++)if(t[r]>e)return r-1;return n-1},t.search=function(t,e,n){for(var r=t.length,i=n;i<r;i+=n)if(t[i]>e)return i-n;return r-n},t}(),Y=function(t){function e(e,n,r){var i=t.call(this,e,r)||this;return i.curves=g.newFloatArray(e+18*n),i.curves[e-1]=1,i}return r(e,t),e.prototype.setLinear=function(t){this.curves[t]=0},e.prototype.setStepped=function(t){this.curves[t]=1},e.prototype.shrink=function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=g.newFloatArray(e);g.arrayCopy(this.curves,0,n,0,e),this.curves=n}},e.prototype.setBezier=function(t,e,n,r,i,a,s,o,h,l,c){var u=this.curves,d=this.getFrameCount()+18*t;0==n&&(u[e]=2+d);for(var f=.03*(r-2*a+o),p=.03*(i-2*s+h),m=.006*(3*(a-o)-r+l),g=.006*(3*(s-h)-i+c),v=2*f+m,y=2*p+g,x=.3*(a-r)+f+.16666667*m,w=.3*(s-i)+p+.16666667*g,b=r+x,M=i+w,S=d+18;d<S;d+=2)u[d]=b,u[d+1]=M,x+=v,w+=y,v+=m,y+=g,b+=x,M+=w},e.prototype.getBezierValue=function(t,e,n,r){var i=this.curves;if(i[r]>t){var a=this.frames[e],s=this.frames[e+n];return s+(t-a)/(i[r]-a)*(i[r+1]-s)}var o=r+18;for(r+=2;r<o;r+=2)if(i[r]>=t){var h=i[r-2],l=i[r-1];return l+(t-h)/(i[r]-h)*(i[r+1]-l)}e+=this.getFrameEntries();var c=i[o-2],u=i[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)},e}(B),R=function(e){function n(t,n,r){return e.call(this,t,n,[r])||this}return r(n,e),n.prototype.getFrameEntries=function(){return 2},n.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n},n.prototype.getCurveValue=function(t){for(var e=this.frames,n=e.length-2,r=2;r<=n;r+=2)if(e[r]>t){n=r-2;break}var i=this.curves[n>>1];switch(i){case 0:var a=e[n],s=e[n+1];return s+(t-a)/(e[n+2]-a)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,i-2)},n.prototype.getRelativeValue=function(e,n,r,i,a){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}var s=this.getCurveValue(e);switch(r){case t.MixBlend.setup:return a+s*n;case t.MixBlend.first:case t.MixBlend.replace:s+=a-i}return i+s*n},n.prototype.getAbsoluteValue=function(e,n,r,i,a){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}var s=this.getCurveValue(e);return r==t.MixBlend.setup?a+(s-a)*n:i+(s-i)*n},n.prototype.getAbsoluteValue2=function(e,n,r,i,a,s){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}return r==t.MixBlend.setup?a+(s-a)*n:i+(s-i)*n},n.prototype.getScaleValue=function(e,n,r,i,a,s){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return s;case t.MixBlend.first:return a+(s-a)*n}return a}var o=this.getCurveValue(e)*s;if(1==n)return r==t.MixBlend.add?a+o-s:o;if(i==t.MixDirection.mixOut)switch(r){case t.MixBlend.setup:return s+(Math.abs(o)*d.signum(s)-s)*n;case t.MixBlend.first:case t.MixBlend.replace:return a+(Math.abs(o)*d.signum(a)-a)*n}else{var h=0;switch(r){case t.MixBlend.setup:return(h=Math.abs(s)*d.signum(o))+(o-h)*n;case t.MixBlend.first:case t.MixBlend.replace:return(h=Math.abs(a)*d.signum(o))+(o-h)*n}}return a+(o-s)*n},n}(Y),P=function(t){function e(e,n,r,i){return t.call(this,e,n,[r,i])||this}return r(e,t),e.prototype.getFrameEntries=function(){return 3},e.prototype.setFrame=function(t,e,n,r){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r},e}(Y),X=function(t){function e(e,n,r){var i=t.call(this,e,n,F.rotate+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(n,i,a,o.rotation,o.data.rotation))},e}(R),V=function(e){function n(t,n,r){var i=e.call(this,t,n,F.x+"|"+r,F.y+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.x=h.data.x,void(h.y=h.data.y);case t.MixBlend.first:h.x+=(h.data.x-h.x)*a,h.y+=(h.data.y-h.y)*a}else{var c=0,u=0,d=B.search(l,r,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+3]-p);c+=(l[d+3+1]-c)*m,u+=(l[d+3+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}switch(s){case t.MixBlend.setup:h.x=h.data.x+c*a,h.y=h.data.y+u*a;break;case t.MixBlend.first:case t.MixBlend.replace:h.x+=(h.data.x+c-h.x)*a,h.y+=(h.data.y+u-h.y)*a;break;case t.MixBlend.add:h.x+=c*a,h.y+=u*a}}}},n}(P),D=function(t){function e(e,n,r){var i=t.call(this,e,n,F.x+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(n,i,a,o.x,o.data.x))},e}(R),L=function(t){function e(e,n,r){var i=t.call(this,e,n,F.y+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(n,i,a,o.y,o.data.y))},e}(R),N=function(e){function n(t,n,r){var i=e.call(this,t,n,F.scaleX+"|"+r,F.scaleY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.scaleX=h.data.scaleX,void(h.scaleY=h.data.scaleY);case t.MixBlend.first:h.scaleX+=(h.data.scaleX-h.scaleX)*a,h.scaleY+=(h.data.scaleY-h.scaleY)*a}else{var c,u,f=B.search(l,r,3),p=this.curves[f/3];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2];var g=(r-m)/(l[f+3]-m);c+=(l[f+3+1]-c)*g,u+=(l[f+3+2]-u)*g;break;case 1:c=l[f+1],u=l[f+2];break;default:c=this.getBezierValue(r,f,1,p-2),u=this.getBezierValue(r,f,2,p+18-2)}if(c*=h.data.scaleX,u*=h.data.scaleY,1==a)s==t.MixBlend.add?(h.scaleX+=c-h.data.scaleX,h.scaleY+=u-h.data.scaleY):(h.scaleX=c,h.scaleY=u);else{var v=0,y=0;if(o==t.MixDirection.mixOut)switch(s){case t.MixBlend.setup:v=h.data.scaleX,y=h.data.scaleY,h.scaleX=v+(Math.abs(c)*d.signum(v)-v)*a,h.scaleY=y+(Math.abs(u)*d.signum(y)-y)*a;break;case t.MixBlend.first:case t.MixBlend.replace:v=h.scaleX,y=h.scaleY,h.scaleX=v+(Math.abs(c)*d.signum(v)-v)*a,h.scaleY=y+(Math.abs(u)*d.signum(y)-y)*a;break;case t.MixBlend.add:h.scaleX+=(c-h.data.scaleX)*a,h.scaleY+=(u-h.data.scaleY)*a}else switch(s){case t.MixBlend.setup:v=Math.abs(h.data.scaleX)*d.signum(c),y=Math.abs(h.data.scaleY)*d.signum(u),h.scaleX=v+(c-v)*a,h.scaleY=y+(u-y)*a;break;case t.MixBlend.first:case t.MixBlend.replace:v=Math.abs(h.scaleX)*d.signum(c),y=Math.abs(h.scaleY)*d.signum(u),h.scaleX=v+(c-v)*a,h.scaleY=y+(u-y)*a;break;case t.MixBlend.add:h.scaleX+=(c-h.data.scaleX)*a,h.scaleY+=(u-h.data.scaleY)*a}}}}},n}(P),O=function(t){function e(e,n,r){var i=t.call(this,e,n,F.scaleX+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(n,i,a,s,o.scaleX,o.data.scaleX))},e}(R),_=function(t){function e(e,n,r){var i=t.call(this,e,n,F.scaleY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(n,i,a,s,o.scaleX,o.data.scaleY))},e}(R),q=function(e){function n(t,n,r){var i=e.call(this,t,n,F.shearX+"|"+r,F.shearY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.shearX=h.data.shearX,void(h.shearY=h.data.shearY);case t.MixBlend.first:h.shearX+=(h.data.shearX-h.shearX)*a,h.shearY+=(h.data.shearY-h.shearY)*a}else{var c=0,u=0,d=B.search(l,r,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+3]-p);c+=(l[d+3+1]-c)*m,u+=(l[d+3+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}switch(s){case t.MixBlend.setup:h.shearX=h.data.shearX+c*a,h.shearY=h.data.shearY+u*a;break;case t.MixBlend.first:case t.MixBlend.replace:h.shearX+=(h.data.shearX+c-h.shearX)*a,h.shearY+=(h.data.shearY+u-h.shearY)*a;break;case t.MixBlend.add:h.shearX+=c*a,h.shearY+=u*a}}}},n}(P),U=function(t){function e(e,n,r){var i=t.call(this,e,n,F.shearX+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(n,i,a,o.shearX,o.data.shearX))},e}(R),W=function(t){function e(e,n,r){var i=t.call(this,e,n,F.shearY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(n,i,a,o.shearX,o.data.shearY))},e}(R),z=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.alpha+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 5},n.prototype.setFrame=function(t,e,n,r,i,a){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(r<l[0]){var u=h.data.color;switch(s){case t.MixBlend.setup:return void c.setFromColor(u);case t.MixBlend.first:c.add((u.r-c.r)*a,(u.g-c.g)*a,(u.b-c.b)*a,(u.a-c.a)*a)}}else{var d=0,f=0,p=0,m=0,g=B.search(l,r,5),v=this.curves[g/5];switch(v){case 0:var y=l[g];d=l[g+1],f=l[g+2],p=l[g+3],m=l[g+4];var x=(r-y)/(l[g+5]-y);d+=(l[g+5+1]-d)*x,f+=(l[g+5+2]-f)*x,p+=(l[g+5+3]-p)*x,m+=(l[g+5+4]-m)*x;break;case 1:d=l[g+1],f=l[g+2],p=l[g+3],m=l[g+4];break;default:d=this.getBezierValue(r,g,1,v-2),f=this.getBezierValue(r,g,2,v+18-2),p=this.getBezierValue(r,g,3,v+36-2),m=this.getBezierValue(r,g,4,v+54-2)}1==a?c.set(d,f,p,m):(s==t.MixBlend.setup&&c.setFromColor(h.data.color),c.add((d-c.r)*a,(f-c.g)*a,(p-c.b)*a,(m-c.a)*a))}}},n}(Y),G=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,r,i){t<<=2,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(r<l[0]){var u=h.data.color;switch(s){case t.MixBlend.setup:return c.r=u.r,c.g=u.g,void(c.b=u.b);case t.MixBlend.first:c.r+=(u.r-c.r)*a,c.g+=(u.g-c.g)*a,c.b+=(u.b-c.b)*a}}else{var d=0,f=0,p=0,m=B.search(l,r,4),g=this.curves[m>>2];switch(g){case 0:var v=l[m];d=l[m+1],f=l[m+2],p=l[m+3];var y=(r-v)/(l[m+4]-v);d+=(l[m+4+1]-d)*y,f+=(l[m+4+2]-f)*y,p+=(l[m+4+3]-p)*y;break;case 1:d=l[m+1],f=l[m+2],p=l[m+3];break;default:d=this.getBezierValue(r,m,1,g-2),f=this.getBezierValue(r,m,2,g+18-2),p=this.getBezierValue(r,m,3,g+36-2)}if(1==a)c.r=d,c.g=f,c.b=p;else{if(s==t.MixBlend.setup){var x=h.data.color;c.r=x.r,c.g=x.g,c.b=x.b}c.r+=(d-c.r)*a,c.g+=(f-c.g)*a,c.b+=(p-c.b)*a}}}},n}(Y),H=function(e){function n(t,n,r){var i=e.call(this,t,n,F.alpha+"|"+r)||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.color;if(r<this.frames[0]){var c=h.data.color;switch(s){case t.MixBlend.setup:return void(l.a=c.a);case t.MixBlend.first:l.a+=(c.a-l.a)*a}}else{var u=this.getCurveValue(r);1==a?l.a=u:(s==t.MixBlend.setup&&(l.a=h.data.color.a),l.a+=(u-l.a)*a)}}},n}(R),j=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.alpha+"|"+r,F.rgb2+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 8},n.prototype.setFrame=function(t,e,n,r,i,a,s,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o,this.frames[t+7]=h},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(r<l[0]){var d=h.data.color,f=h.data.darkColor;switch(s){case t.MixBlend.setup:return c.setFromColor(d),u.r=f.r,u.g=f.g,void(u.b=f.b);case t.MixBlend.first:c.add((d.r-c.r)*a,(d.g-c.g)*a,(d.b-c.b)*a,(d.a-c.a)*a),u.r+=(f.r-u.r)*a,u.g+=(f.g-u.g)*a,u.b+=(f.b-u.b)*a}}else{var p=0,m=0,g=0,v=0,y=0,x=0,w=0,b=B.search(l,r,8),M=this.curves[b>>3];switch(M){case 0:var S=l[b];p=l[b+1],m=l[b+2],g=l[b+3],v=l[b+4],y=l[b+5],x=l[b+6],w=l[b+7];var k=(r-S)/(l[b+8]-S);p+=(l[b+8+1]-p)*k,m+=(l[b+8+2]-m)*k,g+=(l[b+8+3]-g)*k,v+=(l[b+8+4]-v)*k,y+=(l[b+8+5]-y)*k,x+=(l[b+8+6]-x)*k,w+=(l[b+8+7]-w)*k;break;case 1:p=l[b+1],m=l[b+2],g=l[b+3],v=l[b+4],y=l[b+5],x=l[b+6],w=l[b+7];break;default:p=this.getBezierValue(r,b,1,M-2),m=this.getBezierValue(r,b,2,M+18-2),g=this.getBezierValue(r,b,3,M+36-2),v=this.getBezierValue(r,b,4,M+54-2),y=this.getBezierValue(r,b,5,M+72-2),x=this.getBezierValue(r,b,6,M+90-2),w=this.getBezierValue(r,b,7,M+108-2)}if(1==a)c.set(p,m,g,v),u.r=y,u.g=x,u.b=w;else{if(s==t.MixBlend.setup){c.setFromColor(h.data.color);f=h.data.darkColor;u.r=f.r,u.g=f.g,u.b=f.b}c.add((p-c.r)*a,(m-c.g)*a,(g-c.b)*a,(v-c.a)*a),u.r+=(y-u.r)*a,u.g+=(x-u.g)*a,u.b+=(w-u.b)*a}}}},n}(Y),J=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.rgb2+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,r,i,a,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(r<l[0]){var d=h.data.color,f=h.data.darkColor;switch(s){case t.MixBlend.setup:return c.r=d.r,c.g=d.g,c.b=d.b,u.r=f.r,u.g=f.g,void(u.b=f.b);case t.MixBlend.first:c.r+=(d.r-c.r)*a,c.g+=(d.g-c.g)*a,c.b+=(d.b-c.b)*a,u.r+=(f.r-u.r)*a,u.g+=(f.g-u.g)*a,u.b+=(f.b-u.b)*a}}else{var p=0,m=0,g=0,v=0,y=0,x=0,w=B.search(l,r,7),b=this.curves[w/7];switch(b){case 0:var M=l[w];p=l[w+1],m=l[w+2],g=l[w+3],v=l[w+4],y=l[w+5],x=l[w+6];var S=(r-M)/(l[w+7]-M);p+=(l[w+7+1]-p)*S,m+=(l[w+7+2]-m)*S,g+=(l[w+7+3]-g)*S,v+=(l[w+7+4]-v)*S,y+=(l[w+7+5]-y)*S,x+=(l[w+7+6]-x)*S;break;case 1:p=l[w+1],m=l[w+2],g=l[w+3],v=l[w+4],y=l[w+5],x=l[w+6];break;default:p=this.getBezierValue(r,w,1,b-2),m=this.getBezierValue(r,w,2,b+18-2),g=this.getBezierValue(r,w,3,b+36-2),v=this.getBezierValue(r,w,4,b+54-2),y=this.getBezierValue(r,w,5,b+72-2),x=this.getBezierValue(r,w,6,b+90-2)}if(1==a)c.r=p,c.g=m,c.b=g,u.r=v,u.g=y,u.b=x;else{if(s==t.MixBlend.setup){d=h.data.color,f=h.data.darkColor;c.r=d.r,c.g=d.g,c.b=d.b,u.r=f.r,u.g=f.g,u.b=f.b}c.r+=(p-c.r)*a,c.g+=(m-c.g)*a,c.b+=(g-c.b)*a,u.r+=(v-u.r)*a,u.g+=(y-u.g)*a,u.b+=(x-u.b)*a}}}},n}(Y),K=function(e){function n(t,n){var r=e.call(this,t,[F.attachment+"|"+n])||this;return r.slotIndex=0,r.slotIndex=n,r.attachmentNames=new Array(t),r}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];h.bone.active&&(o!=t.MixDirection.mixOut?r<this.frames[0]?s!=t.MixBlend.setup&&s!=t.MixBlend.first||this.setAttachment(e,h,h.data.attachmentName):this.setAttachment(e,h,this.attachmentNames[B.search1(this.frames,r)]):s==t.MixBlend.setup&&this.setAttachment(e,h,h.data.attachmentName))},n.prototype.setAttachment=function(t,e,n){e.setAttachment(n?t.getAttachment(this.slotIndex,n):null)},n}(B),Q=function(e){function n(t,n,r,i){var a=e.call(this,t,n,[F.deform+"|"+r+"|"+i.id])||this;return a.slotIndex=0,a.slotIndex=r,a.attachment=i,a.vertices=new Array(t),a}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.vertices[t]=n},n.prototype.setBezier=function(t,e,n,r,i,a,s,o,h,l,c){var u=this.curves,d=this.getFrameCount()+18*t;0==n&&(u[e]=2+d);for(var f=.03*(r-2*a+o),p=.03*h-.06*s,m=.006*(3*(a-o)-r+l),g=.018*(s-h+.33333333),v=2*f+m,y=2*p+g,x=.3*(a-r)+f+.16666667*m,w=.3*s+p+.16666667*g,b=r+x,M=w,S=d+18;d<S;d+=2)u[d]=b,u[d+1]=M,x+=v,w+=y,v+=m,y+=g,b+=x,M+=w},n.prototype.getCurvePercent=function(t,e){var n=this.curves,r=n[e];switch(r){case 0:var i=this.frames[e];return(t-i)/(this.frames[e+this.getFrameEntries()]-i);case 1:return 0}if(n[r-=2]>t){var a=this.frames[e];return n[r+1]*(t-a)/(n[r]-a)}var s=r+18;for(r+=2;r<s;r+=2)if(n[r]>=t){var o=n[r-2],h=n[r-1];return h+(t-o)/(n[r]-o)*(n[r+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.getAttachment();if(l&&l instanceof S&&l.timelineAttachment==this.attachment){var c=h.deform;0==c.length&&(s=t.MixBlend.setup);var u=this.vertices,d=u[0].length,f=this.frames;if(r<f[0])switch(s){case t.MixBlend.setup:return void(c.length=0);case t.MixBlend.first:if(1==a)return void(c.length=0);if(c.length=d,(q=l).bones){a=1-a;for(m=0;m<d;m++)c[m]*=a}else for(var p=q.vertices,m=0;m<d;m++)c[m]+=(p[m]-c[m])*a}else if(c.length=d,r>=f[f.length-1]){var v=u[f.length-1];if(1==a)if(s==t.MixBlend.add)if((q=l).bones)for(var y=0;y<d;y++)c[y]+=v[y];else{p=q.vertices;for(var x=0;x<d;x++)c[x]+=v[x]-p[x]}else g.arrayCopy(v,0,c,0,d);else switch(s){case t.MixBlend.setup:var w=l;if(w.bones)for(var b=0;b<d;b++)c[b]=v[b]*a;else{p=w.vertices;for(var M=0;M<d;M++){var k=p[M];c[M]=k+(v[M]-k)*a}}break;case t.MixBlend.first:case t.MixBlend.replace:for(var A=0;A<d;A++)c[A]+=(v[A]-c[A])*a;break;case t.MixBlend.add:if((q=l).bones)for(var I=0;I<d;I++)c[I]+=v[I]*a;else{p=q.vertices;for(var T=0;T<d;T++)c[T]+=(v[T]-p[T])*a}}}else{var C=B.search1(f,r),E=this.getCurvePercent(r,C),F=u[C],Y=u[C+1];if(1==a)if(s==t.MixBlend.add)if((q=l).bones)for(var R=0;R<d;R++){X=F[R];c[R]+=X+(Y[R]-X)*E}else{p=q.vertices;for(var P=0;P<d;P++){var X=F[P];c[P]+=X+(Y[P]-X)*E-p[P]}}else for(var V=0;V<d;V++){X=F[V];c[V]=X+(Y[V]-X)*E}else switch(s){case t.MixBlend.setup:var D=l;if(D.bones)for(var L=0;L<d;L++){X=F[L];c[L]=(X+(Y[L]-X)*E)*a}else{p=D.vertices;for(var N=0;N<d;N++){var X=F[N],O=p[N];c[N]=O+(X+(Y[N]-X)*E-O)*a}}break;case t.MixBlend.first:case t.MixBlend.replace:for(var _=0;_<d;_++){X=F[_];c[_]+=(X+(Y[_]-X)*E-c[_])*a}break;case t.MixBlend.add:var q;if((q=l).bones)for(var U=0;U<d;U++){X=F[U];c[U]+=(X+(Y[U]-X)*E)*a}else{p=q.vertices;for(var W=0;W<d;W++){X=F[W];c[W]+=(X+(Y[W]-X)*E-p[W])*a}}}}}}},n}(Y),Z=function(t){function e(n){var r=t.call(this,n,e.propertyIds)||this;return r.events=new Array(n),r}return r(e,t),e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,n,r,i,a,s){if(r){var o=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,i,a,s),e=-1;else if(e>=o[h-1])return;if(!(n<o[0])){var l=0;if(e<o[0])l=0;else for(var c=o[l=B.search1(o,e)+1];l>0&&o[l-1]==c;)l--;for(;l<h&&n>=o[l];l++)r.push(this.events[l])}}},e.propertyIds=[""+F.event],e}(B),$=function(e){function n(t){var r=e.call(this,t,n.propertyIds)||this;return r.drawOrders=new Array(t),r}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},n.prototype.apply=function(e,n,r,i,a,s,o){if(o!=t.MixDirection.mixOut)if(r<this.frames[0])s!=t.MixBlend.setup&&s!=t.MixBlend.first||g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{var h=B.search1(this.frames,r),l=this.drawOrders[h];if(l)for(var c=e.drawOrder,u=e.slots,d=0,f=l.length;d<f;d++)c[d]=u[l[d]];else g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length)}else s==t.MixBlend.setup&&g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length)},n.propertyIds=[""+F.drawOrder],n}(B),tt=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.ikConstraint+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 6},n.prototype.setFrame=function(t,e,n,r,i,a,s){t*=6,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a?1:0,this.frames[t+5]=s?1:0},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.ikConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case t.MixBlend.first:h.mix+=(h.data.mix-h.mix)*a,h.softness+=(h.data.softness-h.softness)*a,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}else{var c=0,u=0,d=B.search(l,r,6),f=this.curves[d/6];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+6]-p);c+=(l[d+6+1]-c)*m,u+=(l[d+6+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}s==t.MixBlend.setup?(h.mix=h.data.mix+(c-h.data.mix)*a,h.softness=h.data.softness+(u-h.data.softness)*a,o==t.MixDirection.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[d+3],h.compress=0!=l[d+4],h.stretch=0!=l[d+5])):(h.mix+=(c-h.mix)*a,h.softness+=(u-h.softness)*a,o==t.MixDirection.mixIn&&(h.bendDirection=l[d+3],h.compress=0!=l[d+4],h.stretch=0!=l[d+5]))}}},n}(Y),et=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.transformConstraint+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,r,i,a,s,o){var h=this.frames;h[t*=7]=e,h[t+1]=n,h[t+2]=r,h[t+3]=i,h[t+4]=a,h[t+5]=s,h[t+6]=o},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.transformConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0]){var c=h.data;switch(s){case t.MixBlend.setup:return h.mixRotate=c.mixRotate,h.mixX=c.mixX,h.mixY=c.mixY,h.mixScaleX=c.mixScaleX,h.mixScaleY=c.mixScaleY,void(h.mixShearY=c.mixShearY);case t.MixBlend.first:h.mixRotate+=(c.mixRotate-h.mixRotate)*a,h.mixX+=(c.mixX-h.mixX)*a,h.mixY+=(c.mixY-h.mixY)*a,h.mixScaleX+=(c.mixScaleX-h.mixScaleX)*a,h.mixScaleY+=(c.mixScaleY-h.mixScaleY)*a,h.mixShearY+=(c.mixShearY-h.mixShearY)*a}}else{var u,d,f,p,m,g,v=B.search(l,r,7),y=this.curves[v/7];switch(y){case 0:var x=l[v];u=l[v+1],d=l[v+2],f=l[v+3],p=l[v+4],m=l[v+5],g=l[v+6];var w=(r-x)/(l[v+7]-x);u+=(l[v+7+1]-u)*w,d+=(l[v+7+2]-d)*w,f+=(l[v+7+3]-f)*w,p+=(l[v+7+4]-p)*w,m+=(l[v+7+5]-m)*w,g+=(l[v+7+6]-g)*w;break;case 1:u=l[v+1],d=l[v+2],f=l[v+3],p=l[v+4],m=l[v+5],g=l[v+6];break;default:u=this.getBezierValue(r,v,1,y-2),d=this.getBezierValue(r,v,2,y+18-2),f=this.getBezierValue(r,v,3,y+36-2),p=this.getBezierValue(r,v,4,y+54-2),m=this.getBezierValue(r,v,5,y+72-2),g=this.getBezierValue(r,v,6,y+90-2)}if(s==t.MixBlend.setup){c=h.data;h.mixRotate=c.mixRotate+(u-c.mixRotate)*a,h.mixX=c.mixX+(d-c.mixX)*a,h.mixY=c.mixY+(f-c.mixY)*a,h.mixScaleX=c.mixScaleX+(p-c.mixScaleX)*a,h.mixScaleY=c.mixScaleY+(m-c.mixScaleY)*a,h.mixShearY=c.mixShearY+(g-c.mixShearY)*a}else h.mixRotate+=(u-h.mixRotate)*a,h.mixX+=(d-h.mixX)*a,h.mixY+=(f-h.mixY)*a,h.mixScaleX+=(p-h.mixScaleX)*a,h.mixScaleY+=(m-h.mixScaleY)*a,h.mixShearY+=(g-h.mixShearY)*a}}},n}(Y),nt=function(t){function e(e,n,r){var i=t.call(this,e,n,F.pathConstraintPosition+"|"+r)||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(n,i,a,o.position,o.data.position))},e}(R),rt=function(t){function e(e,n,r){var i=t.call(this,e,n,F.pathConstraintSpacing+"|"+r)||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(n,i,a,o.spacing,o.data.spacing))},e}(R),it=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.pathConstraintMix+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,r,i){var a=this.frames;a[t<<=2]=e,a[t+1]=n,a[t+2]=r,a[t+3]=i},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.pathConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.mixRotate=h.data.mixRotate,h.mixX=h.data.mixX,void(h.mixY=h.data.mixY);case t.MixBlend.first:h.mixRotate+=(h.data.mixRotate-h.mixRotate)*a,h.mixX+=(h.data.mixX-h.mixX)*a,h.mixY+=(h.data.mixY-h.mixY)*a}else{var c,u,d,f=B.search(l,r,4),p=this.curves[f>>2];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2],d=l[f+3];var g=(r-m)/(l[f+4]-m);c+=(l[f+4+1]-c)*g,u+=(l[f+4+2]-u)*g,d+=(l[f+4+3]-d)*g;break;case 1:c=l[f+1],u=l[f+2],d=l[f+3];break;default:c=this.getBezierValue(r,f,1,p-2),u=this.getBezierValue(r,f,2,p+18-2),d=this.getBezierValue(r,f,3,p+36-2)}if(s==t.MixBlend.setup){var v=h.data;h.mixRotate=v.mixRotate+(c-v.mixRotate)*a,h.mixX=v.mixX+(u-v.mixX)*a,h.mixY=v.mixY+(d-v.mixY)*a}else h.mixRotate+=(c-h.mixRotate)*a,h.mixX+=(u-h.mixX)*a,h.mixY+=(d-h.mixY)*a}}},n}(Y),at=function(t){function e(e,n,r,i){var a=t.call(this,e,n,i+"|"+r)||this;return a.constraintIndex=0,a.constraintIndex=r,a}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,o){var h,l,c;if(-1==this.constraintIndex){var u=n>=this.frames[0]?this.getCurveValue(n):0;try{for(var d=s(t.physicsConstraints),f=d.next();!f.done;f=d.next()){var p=f.value;p.active&&this.global(p.data)&&this.set(p,this.getAbsoluteValue2(n,i,a,this.get(p),this.setup(p),u))}}catch(t){h={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(h)throw h.error}}}else(c=t.physicsConstraints[this.constraintIndex]).active&&this.set(c,this.getAbsoluteValue(n,i,a,this.get(c),this.setup(c)))},e}(R),st=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintInertia)||this}return r(e,t),e.prototype.setup=function(t){return t.data.inertia},e.prototype.get=function(t){return t.inertia},e.prototype.set=function(t,e){t.inertia=e},e.prototype.global=function(t){return t.inertiaGlobal},e}(at),ot=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintStrength)||this}return r(e,t),e.prototype.setup=function(t){return t.data.strength},e.prototype.get=function(t){return t.strength},e.prototype.set=function(t,e){t.strength=e},e.prototype.global=function(t){return t.strengthGlobal},e}(at),ht=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintDamping)||this}return r(e,t),e.prototype.setup=function(t){return t.data.damping},e.prototype.get=function(t){return t.damping},e.prototype.set=function(t,e){t.damping=e},e.prototype.global=function(t){return t.dampingGlobal},e}(at),lt=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintMass)||this}return r(e,t),e.prototype.setup=function(t){return 1/t.data.massInverse},e.prototype.get=function(t){return 1/t.massInverse},e.prototype.set=function(t,e){t.massInverse=1/e},e.prototype.global=function(t){return t.massGlobal},e}(at),ct=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintWind)||this}return r(e,t),e.prototype.setup=function(t){return t.data.wind},e.prototype.get=function(t){return t.wind},e.prototype.set=function(t,e){t.wind=e},e.prototype.global=function(t){return t.windGlobal},e}(at),ut=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintGravity)||this}return r(e,t),e.prototype.setup=function(t){return t.data.gravity},e.prototype.get=function(t){return t.gravity},e.prototype.set=function(t,e){t.gravity=e},e.prototype.global=function(t){return t.gravityGlobal},e}(at),dt=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintMix)||this}return r(e,t),e.prototype.setup=function(t){return t.data.mix},e.prototype.get=function(t){return t.mix},e.prototype.set=function(t,e){t.mix=e},e.prototype.global=function(t){return t.mixGlobal},e}(at),ft=function(t){function e(n,r){var i=t.call(this,n,e.propertyIds)||this;return i.constraintIndex=r,i}return r(e,t),e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e},e.prototype.apply=function(t,e,n,r,i,a,o){var h,l,c;if(-1==this.constraintIndex||(c=t.physicsConstraints[this.constraintIndex]).active){var u=this.frames;if(e>n)this.apply(t,e,Number.MAX_VALUE,[],i,a,o),e=-1;else if(e>=u[u.length-1])return;if(!(n<u[0])&&(e<u[0]||n>=u[B.search1(u,e)+1]))if(null!=c)c.reset();else try{for(var d=s(t.physicsConstraints),f=d.next();!f.done;f=d.next()){var p=f.value;p.active&&p.reset()}}catch(t){h={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(h)throw h.error}}}},e.propertyIds=[F.physicsConstraintReset.toString()],e}(B),pt=function(e){function n(t,n,r){var i=e.call(this,t,[F.sequence+"|"+n+"|"+r.sequence.id])||this;return i.slotIndex=n,i.attachment=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return n.ENTRIES},n.prototype.getSlotIndex=function(){return this.slotIndex},n.prototype.getAttachment=function(){return this.attachment},n.prototype.setFrame=function(t,e,r,i,a){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=r|i<<4,s[t+n.DELAY]=a},n.prototype.apply=function(e,r,i,a,s,o,l){var c=e.slots[this.slotIndex];if(c.bone.active){var u=c.attachment,d=this.attachment;if(u==d||u instanceof S&&u.timelineAttachment==d){var f=this.frames;if(i<f[0])o!=t.MixBlend.setup&&o!=t.MixBlend.first||(c.sequenceIndex=-1);else{var p=B.search(f,i,n.ENTRIES),m=f[p],g=f[p+n.MODE],v=f[p+n.DELAY];if(this.attachment.sequence){var y=g>>4,x=this.attachment.sequence.regions.length,w=T[15&g];if(w!=h.hold)switch(y+=(i-m)/v+1e-5|0,w){case h.once:y=Math.min(x-1,y);break;case h.loop:y%=x;break;case h.pingpong:(y=0==(b=(x<<1)-2)?0:y%b)>=x&&(y=b-y);break;case h.onceReverse:y=Math.max(x-1-y,0);break;case h.loopReverse:y=x-1-y%x;break;case h.pingpongReverse:var b;(y=0==(b=(x<<1)-2)?0:(y+x-1)%b)>=x&&(y=b-y)}c.sequenceIndex=y}}}}},n.ENTRIES=3,n.MODE=1,n.DELAY=2,n}(B),mt=function(){function e(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new vt(this),this.propertyIDs=new c,this.animationsChanged=!1,this.trackEntryPool=new y((function(){return new gt})),this.data=t}return e.emptyAnimation=function(){return e._emptyAnimation},e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n<r;n++){var i=e[n];if(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(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(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&!i.mixingFrom){e[n]=null,this.queue.end(i),this.clearNext(i);continue}if(i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(!n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,i=!1,a=0,s=r.length;a<s;a++){var o=r[a];if(o&&!(o.delay>0)){i=!0;var h=0==a?t.MixBlend.first:o.mixBlend,l=o.alpha;o.mixingFrom?l*=this.applyMixingFrom(o,e,h):o.trackTime>=o.trackEnd&&!o.next&&(l=0);var c=l>=o.alphaAttachmentThreshold,u=o.animationLast,d=o.getAnimationTime(),f=d,p=n;o.reverse&&(f=o.animation.duration-f,p=null);var m=o.animation.timelines,v=m.length;if(0==a&&1==l||h==t.MixBlend.add){0==a&&(c=!0);for(var y=0;y<v;y++){g.webkit602BugfixHelper(l,h);var x=m[y];x instanceof K?this.applyAttachmentTimeline(x,e,f,h,c):x.apply(e,u,f,p,l,h,t.MixDirection.mixIn)}}else{var w=o.timelineMode,b=o.shortestRotation,M=!b&&o.timelinesRotation.length!=v<<1;M&&(o.timelinesRotation.length=v<<1);for(y=0;y<v;y++){var S=m[y],k=w[y]==bt?h:t.MixBlend.setup;!b&&S instanceof X?this.applyRotateTimeline(S,e,f,l,k,o.timelinesRotation,y<<1,M):S instanceof K?this.applyAttachmentTimeline(S,e,f,h,c):(g.webkit602BugfixHelper(l,h),S.apply(e,u,f,p,l,k,t.MixDirection.mixIn))}}this.queueEvents(o,d),n.length=0,o.nextAnimationLast=d,o.nextTrackLast=o.trackTime}}for(var A=this.unkeyedState+It,I=e.slots,T=0,C=e.slots.length;T<C;T++){var E=I[T];if(E.attachmentState==A){var F=E.data.attachmentName;E.setAttachment(F?e.getAttachment(E.data.index,F):null)}}return this.unkeyedState+=2,this.queue.drain(),i},e.prototype.applyMixingFrom=function(e,n,r){var i=e.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,n,r);var a=0;0==e.mixDuration?(a=1,r==t.MixBlend.first&&(r=t.MixBlend.setup)):((a=e.mixTime/e.mixDuration)>1&&(a=1),r!=t.MixBlend.first&&(r=i.mixBlend));var s=a<i.mixAttachmentThreshold,o=a<i.mixDrawOrderThreshold,h=i.animation.timelines,l=h.length,c=i.alpha*e.interruptAlpha,u=c*(1-a),d=i.animationLast,f=i.getAnimationTime(),p=f,m=null;if(i.reverse?p=i.animation.duration-p:a<i.eventThreshold&&(m=this.events),r==t.MixBlend.add)for(var v=0;v<l;v++)h[v].apply(n,d,p,m,u,r,t.MixDirection.mixOut);else{var y=i.timelineMode,x=i.timelineHoldMix,w=i.shortestRotation,b=!w&&i.timelinesRotation.length!=l<<1;b&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(v=0;v<l;v++){var M=h[v],S=t.MixDirection.mixOut,k=void 0,A=0;switch(y[v]){case bt:if(!o&&M instanceof $)continue;k=r,A=u;break;case Mt:k=t.MixBlend.setup,A=u;break;case St:k=r,A=c;break;case kt:k=t.MixBlend.setup,A=c;break;default:k=t.MixBlend.setup;var I=x[v];A=c*Math.max(0,1-I.mixTime/I.mixDuration)}i.totalAlpha+=A,!w&&M instanceof X?this.applyRotateTimeline(M,n,p,A,k,i.timelinesRotation,v<<1,b):M instanceof K?this.applyAttachmentTimeline(M,n,p,k,s&&A>=i.alphaAttachmentThreshold):(g.webkit602BugfixHelper(A,r),o&&M instanceof $&&k==t.MixBlend.setup&&(S=t.MixDirection.mixIn),M.apply(n,d,p,m,A,k,S))}}return e.mixDuration>0&&this.queueEvents(i,f),this.events.length=0,i.nextAnimationLast=f,i.nextTrackLast=i.trackTime,a},e.prototype.applyAttachmentTimeline=function(e,n,r,i,a){var s=n.slots[e.slotIndex];s.bone.active&&(r<e.frames[0]?i!=t.MixBlend.setup&&i!=t.MixBlend.first||this.setAttachment(n,s,s.data.attachmentName,a):this.setAttachment(n,s,e.attachmentNames[B.search1(e.frames,r)],a),s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+It))},e.prototype.setAttachment=function(t,e,n,r){e.setAttachment(n?t.getAttachment(e.data.index,n):null),r&&(e.attachmentState=this.unkeyedState+Tt)},e.prototype.applyRotateTimeline=function(e,n,r,i,a,s,o,h){if(h&&(s[o]=0),1!=i){var l=n.bones[e.boneIndex];if(l.active){var c=0,u=0;if(r<e.frames[0])switch(a){case t.MixBlend.setup:l.rotation=l.data.rotation;default:return;case t.MixBlend.first:c=l.rotation,u=l.data.rotation}else c=a==t.MixBlend.setup?l.data.rotation:l.rotation,u=l.data.rotation+e.getCurveValue(r);var f=0,p=u-c;if(0==(p-=360*Math.ceil(p/360-.5)))f=s[o];else{var m=0,g=0;h?(m=0,g=p):(m=s[o],g=s[o+1]);var v=m-m%360;f=p+v;var y=p>=0,x=m>=0;Math.abs(g)<=90&&d.signum(g)!=d.signum(p)&&(Math.abs(m-v)>180?(f+=360*d.signum(m),x=y):0!=v?f-=360*d.signum(m):x=y),x!=y&&(f+=360*d.signum(m)),s[o]=f}s[o+1]=p,l.rotation=c+f*i}}else e.apply(n,0,r,null,1,a,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,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>r||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&t.animationLast<r)&&this.queue.complete(t);o<h;o++){var c=s[o];c.time<n||this.queue.event(t,c)}},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,n=this.tracks.length;e<n;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var r=n.mixingFrom;if(!r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){void 0===n&&(n=!1);var r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(void 0===n&&(n=!1),!e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,r=!1):this.clearNext(i));var a=this.trackEntry(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=0);var i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=0),!e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(i)for(;i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);return i?(i.next=a,a.previous=i,r<=0&&(r+=i.getTrackComplete()-a.mixDuration)):(this.setCurrent(t,a,!0),this.queue.drain()),a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){void 0===n&&(n=0);var r=this.setAnimationWith(t,e.emptyAnimation(),!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=this.addAnimationWith(t,e.emptyAnimation(),!1,r);return r<=0&&(i.delay+=i.mixDuration-n),i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){void 0===t&&(t=0);var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n<r;n++){var i=this.tracks[n];i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(g.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},e.prototype.trackEntry=function(e,n,r,i){var a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=n,a.loop=r,a.holdPrevious=!1,a.reverse=!1,a.shortestRotation=!1,a.eventThreshold=0,a.alphaAttachmentThreshold=0,a.mixAttachmentThreshold=0,a.mixDrawOrderThreshold=0,a.animationStart=0,a.animationEnd=n.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.mixTime=0,a.mixDuration=i?this.data.getMix(i.animation,n):0,a.interruptAlpha=1,a.totalAlpha=0,a.mixBlend=t.MixBlend.replace,a},e.prototype.clearNext=function(t){for(var e=t.next;e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=this.tracks,n=0,r=e.length;n<r;n++){var i=e[n];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&i.mixBlend==t.MixBlend.add||this.computeHold(i),i=i.mixingTo}while(i)}}},e.prototype.computeHold=function(t){var e=t.mixingTo,n=t.animation.timelines,r=t.animation.timelines.length,i=t.timelineMode;i.length=r;var a=t.timelineHoldMix;a.length=0;var s=this.propertyIDs;if(e&&e.holdPrevious)for(var o=0;o<r;o++)i[o]=s.addAll(n[o].getPropertyIds())?kt:St;else t:for(o=0;o<r;o++){var h=n[o],l=h.getPropertyIds();if(s.addAll(l))if(!e||h instanceof K||h instanceof $||h instanceof Z||!e.animation.hasTimeline(l))i[o]=Mt;else{for(var c=e.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(t.mixDuration>0){i[o]=At,a[o]=c;continue t}break}i[o]=kt}else i[o]=bt}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e._emptyAnimation=new C("<empty>",[],0),e}(),gt=function(){function e(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.mixAttachmentThreshold=0,this.alphaAttachmentThreshold=0,this.mixDrawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this._mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return Object.defineProperty(e.prototype,"mixDuration",{get:function(){return this._mixDuration},set:function(t){this._mixDuration=t,null!=this.previous&&this.delay<=0&&(this.delay+=this.previous.getTrackComplete()-t),this.delay=this.delay},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.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)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e.prototype.getTrackComplete=function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime},e.prototype.wasApplied=function(){return-1!=this.nextTrackLast},e}(),vt=function(){function e(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return e.prototype.start=function(e){this.objects.push(t.EventType.start),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.interrupt=function(e){this.objects.push(t.EventType.interrupt),this.objects.push(e)},e.prototype.end=function(e){this.objects.push(t.EventType.end),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.dispose=function(e){this.objects.push(t.EventType.dispose),this.objects.push(e)},e.prototype.complete=function(e){this.objects.push(t.EventType.complete),this.objects.push(e)},e.prototype.event=function(e,n){this.objects.push(t.EventType.event),this.objects.push(e),this.objects.push(n)},e.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var e=this.objects,n=this.animState.listeners,r=0;r<e.length;r+=2){var i=e[r],a=e[r+1];switch(i){case t.EventType.start:a.listener&&a.listener.start&&a.listener.start(a);for(var s=0;s<n.length;s++){(h=n[s]).start&&h.start(a)}break;case t.EventType.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(s=0;s<n.length;s++){(h=n[s]).interrupt&&h.interrupt(a)}break;case t.EventType.end:a.listener&&a.listener.end&&a.listener.end(a);for(s=0;s<n.length;s++){(h=n[s]).end&&h.end(a)}case t.EventType.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(s=0;s<n.length;s++){(h=n[s]).dispose&&h.dispose(a)}this.animState.trackEntryPool.free(a);break;case t.EventType.complete:a.listener&&a.listener.complete&&a.listener.complete(a);for(s=0;s<n.length;s++){(h=n[s]).complete&&h.complete(a)}break;case t.EventType.event:var o=e[2+r++];a.listener&&a.listener.event&&a.listener.event(a,o);for(s=0;s<n.length;s++){var h;(h=n[s]).event&&h.event(a,o)}}}this.clear(),this.drainDisabled=!1}},e.prototype.clear=function(){this.objects.length=0},e}();t.EventType=void 0,(E=t.EventType||(t.EventType={}))[E.start=0]="start",E[E.interrupt=1]="interrupt",E[E.end=2]="end",E[E.dispose=3]="dispose",E[E.complete=4]="complete",E[E.event=5]="event";var yt,xt,wt=function(){function t(){}return 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){},t}(),bt=0,Mt=1,St=2,kt=3,At=4,It=1,Tt=2,Ct=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);var i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);this.setMixWith(r,i,n)},t.prototype.setMixWith=function(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");var r=t.name+"."+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t}(),Et=function(t){function e(e){var n=t.call(this,e)||this;return n.color=new u(1,1,1,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(S),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.endSlot=null,n.color=new u(.2275,.2275,.8078,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},e}(S),Bt=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t}();t.TextureFilter=void 0,(yt=t.TextureFilter||(t.TextureFilter={}))[yt.Nearest=9728]="Nearest",yt[yt.Linear=9729]="Linear",yt[yt.MipMap=9987]="MipMap",yt[yt.MipMapNearestNearest=9984]="MipMapNearestNearest",yt[yt.MipMapLinearNearest=9985]="MipMapLinearNearest",yt[yt.MipMapNearestLinear=9986]="MipMapNearestLinear",yt[yt.MipMapLinearLinear=9987]="MipMapLinearLinear",t.TextureWrap=void 0,(xt=t.TextureWrap||(t.TextureWrap={}))[xt.MirroredRepeat=33648]="MirroredRepeat",xt[xt.ClampToEdge=33071]="ClampToEdge",xt[xt.Repeat=10497]="Repeat";var Yt,Rt=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0},Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(Bt),Xt=function(){function e(e){this.pages=new Array,this.regions=new Array;for(var n=new Vt(e),r=new Array(4),i={size:function(t){t.width=parseInt(r[1]),t.height=parseInt(r[2])},format:function(){},filter:function(e){e.minFilter=g.enumValue(t.TextureFilter,r[1]),e.magFilter=g.enumValue(t.TextureFilter,r[2])},repeat:function(e){-1!=r[1].indexOf("x")&&(e.uWrap=t.TextureWrap.Repeat),-1!=r[1].indexOf("y")&&(e.vWrap=t.TextureWrap.Repeat)},pma:function(t){t.pma="true"==r[1]}},a={xy:function(t){t.x=parseInt(r[1]),t.y=parseInt(r[2])},size:function(t){t.width=parseInt(r[1]),t.height=parseInt(r[2])},bounds:function(t){t.x=parseInt(r[1]),t.y=parseInt(r[2]),t.width=parseInt(r[3]),t.height=parseInt(r[4])},offset:function(t){t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2])},orig:function(t){t.originalWidth=parseInt(r[1]),t.originalHeight=parseInt(r[2])},offsets:function(t){t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2]),t.originalWidth=parseInt(r[3]),t.originalHeight=parseInt(r[4])},rotate:function(t){var e=r[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:function(t){t.index=parseInt(r[1])}},s=n.readLine();s&&0==s.trim().length;)s=n.readLine();for(;s&&0!=s.trim().length&&0!=n.readEntry(r,s);)s=n.readLine();for(var o=null,h=null,l=null;null!==s;)if(0==s.trim().length)o=null,s=n.readLine();else if(o){for(var c=new Lt(o,s);;){var u=n.readEntry(r,s=n.readLine());if(0==u)break;if(p=a[r[0]])p(c);else{h||(h=[]),l||(l=[]),h.push(r[0]);for(var d=[],f=0;f<u;f++)d.push(parseInt(r[f+1]));l.push(d)}}0==c.originalWidth&&0==c.originalHeight&&(c.originalWidth=c.width,c.originalHeight=c.height),h&&h.length>0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,90==c.degrees?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new Dt(s.trim());0!=n.readEntry(r,s=n.readLine());){var p;(p=i[r[0]])&&p(o)}this.pages.push(o)}}return e.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},e.prototype.setTextures=function(t,e){var n,r;void 0===e&&(e="");try{for(var i=s(this.pages),a=i.next();!a.done;a=i.next()){var o=a.value;o.setTexture(t.get(e+o.name))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.dispose=function(){for(var t,e=0;e<this.pages.length;e++)null===(t=this.pages[e].texture)||void 0===t||t.dispose()},e}(),Vt=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.readEntry=function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var r=1,i=n+1;;r++){var a=e.indexOf(",",i);if(-1==a)return t[r]=e.substr(i).trim(),r;if(t[r]=e.substr(i,a-i).trim(),i=a+1,4==r)return 4}},t}(),Dt=function(){function e(e){this.minFilter=t.TextureFilter.Nearest,this.magFilter=t.TextureFilter.Nearest,this.uWrap=t.TextureWrap.ClampToEdge,this.vWrap=t.TextureWrap.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}return e.prototype.setTexture=function(t){var e,n;this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);try{for(var r=s(this.regions),i=r.next();!i.done;i=r.next()){i.value.texture=t}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e}(),Lt=function(t){function e(e,n){var r=t.call(this)||this;return r.x=0,r.y=0,r.offsetX=0,r.offsetY=0,r.originalWidth=0,r.originalHeight=0,r.index=0,r.degrees=0,r.names=null,r.values=null,r.page=e,r.name=n,e.regions.push(r),r}return r(e,t),e}(Rt),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.region=null,r.regionUVs=[],r.uvs=[],r.triangles=[],r.color=new u(1,1,1,1),r.width=0,r.height=0,r.hullLength=0,r.edges=[],r.parentMesh=null,r.sequence=null,r.tempColor=new u(0,0,0,0),r.path=n,r}return r(e,t),e.prototype.updateRegion=function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=g.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,r=this.region.u,i=this.region.v,a=0,s=0;if(this.region instanceof Lt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:r-=(o.originalHeight-o.offsetY-o.height)/l,i-=(o.originalWidth-o.offsetX-o.width)/c,a=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u<n;u+=2)e[u]=r+t[u+1]*a,e[u+1]=i+(1-t[u])*s;return;case 180:r-=(o.originalWidth-o.offsetX-o.width)/l,i-=o.offsetY/c,a=o.originalWidth/l,s=o.originalHeight/c;for(u=0;u<n;u+=2)e[u]=r+(1-t[u])*a,e[u+1]=i+(1-t[u+1])*s;return;case 270:r-=o.offsetY/l,i-=o.offsetX/c,a=o.originalHeight/l,s=o.originalWidth/c;for(u=0;u<n;u+=2)e[u]=r+(1-t[u+1])*a,e[u+1]=i+t[u]*s;return}r-=o.offsetX/l,i-=(o.originalHeight-o.offsetY-o.height)/c,a=o.originalWidth/l,s=o.originalHeight/c}else this.region?(a=this.region.u2-r,s=this.region.v2-i):(r=i=0,a=s=1);for(u=0;u<n;u+=2)e[u]=r+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,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(this.parentMesh)return this.newLinkedMesh();var t=new e(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),g.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),g.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),g.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),g.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},e.prototype.computeWorldVertices=function(e,n,r,i,a,s){null!=this.sequence&&this.sequence.apply(e,this),t.prototype.computeWorldVertices.call(this,e,n,r,i,a,s)},e.prototype.newLinkedMesh=function(){var t=new e(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t},e}(S),Ot=function(t){function e(e){var n=t.call(this,e)||this;return n.lengths=[],n.closed=!1,n.constantSpeed=!1,n.color=new u(1,1,1,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),g.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},e}(S),_t=function(t){function e(e){var n=t.call(this,e)||this;return n.x=0,n.y=0,n.rotation=0,n.color=new u(.38,.94,0,1),n}return r(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=this.rotation*d.degRad,n=Math.cos(e),r=Math.sin(e),i=n*t.a+r*t.b,a=n*t.c+r*t.d;return d.atan2Deg(a,i)},e.prototype.copy=function(){var t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},e}(S),qt=function(t){function e(e,n){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 u(1,1,1,1),r.region=null,r.sequence=null,r.offset=g.newFloatArray(8),r.uvs=g.newFloatArray(8),r.tempColor=new u(1,1,1,1),r.path=n,r}return r(e,t),e.prototype.updateRegion=function(){if(!this.region)throw new Error("Region not set.");var t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);var n=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.region.offsetX*n,a=-this.height/2*this.scaleY+this.region.offsetY*r,s=i+this.region.width*n,o=a+this.region.height*r,h=this.rotation*d.degRad,l=Math.cos(h),c=Math.sin(h),u=this.x,f=this.y,p=i*l+u,m=i*c,g=a*l+f,v=a*c,y=s*l+u,x=s*c,w=o*l+f,b=o*c,M=this.offset;M[0]=p-v,M[1]=g+m,M[2]=p-b,M[3]=w+m,M[4]=y-b,M[5]=w+x,M[6]=y-v,M[7]=g+x,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},e.prototype.computeWorldVertices=function(t,e,n,r){null!=this.sequence&&this.sequence.apply(t,this);var i=t.bone,a=this.offset,s=i.worldX,o=i.worldY,h=i.a,l=i.b,c=i.c,u=i.d,d=0,f=0;d=a[0],f=a[1],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[2],f=a[3],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[4],f=a[5],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[6],f=a[7],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o},e.prototype.copy=function(){var t=new e(this.name,this.path);return t.region=this.region,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,g.arrayCopy(this.uvs,0,t.uvs,0,8),g.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t},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}(M),Ut=function(){function t(t){this.atlas=t}return t.prototype.loadSequence=function(t,e,n){for(var r=n.regions,i=0,a=r.length;i<a;i++){var s=n.getPath(e,i),o=this.atlas.findRegion(s);if(null==o)throw new Error("Region not found in atlas: "+s+" (sequence: "+t+")");r[i]=o}},t.prototype.newRegionAttachment=function(t,e,n,r){var i=new qt(e,n);if(null!=r)this.loadSequence(e,n,r);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");i.region=a}return i},t.prototype.newMeshAttachment=function(t,e,n,r){var i=new Nt(e,n);if(null!=r)this.loadSequence(e,n,r);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");i.region=a}return i},t.prototype.newBoundingBoxAttachment=function(t,e){return new Et(e)},t.prototype.newPathAttachment=function(t,e){return new Ot(e)},t.prototype.newPointAttachment=function(t,e){return new _t(e)},t.prototype.newClippingAttachment=function(t,e){return new Ft(e)},t}(),Wt=function(e,n,r){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=t.TransformMode.Normal,this.skinRequired=!1,this.color=new u,this.visible=!1,e<0)throw new Error("index must be >= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=r};t.TransformMode=void 0,(Yt=t.TransformMode||(t.TransformMode={}))[Yt.Normal=0]="Normal",Yt[Yt.OnlyTranslation=1]="OnlyTranslation",Yt[Yt.NoRotationOrReflection=2]="NoRotationOrReflection",Yt[Yt.NoScale=3]="NoScale",Yt[Yt.NoScaleOrReflection=4]="NoScaleOrReflection";var zt,Gt,Ht,jt=function(){function e(t,e,n){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,i,a,s,o){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=s,this.ashearY=o;var h=this.parent;if(!h){var l=this.skeleton,c=l.scaleX,u=l.scaleY,f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;return this.a=Math.cos(f)*i*c,this.b=Math.cos(p)*a*c,this.c=Math.sin(f)*i*u,this.d=Math.sin(p)*a*u,this.worldX=e*c+l.x,void(this.worldY=n*u+l.y)}var m=h.a,g=h.b,v=h.c,y=h.d;switch(this.worldX=m*e+g*n+h.worldX,this.worldY=v*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;var x=Math.cos(f)*i,w=Math.cos(p)*a,b=Math.sin(f)*i,M=Math.sin(p)*a;return this.a=m*x+g*b,this.b=m*w+g*M,this.c=v*x+y*b,void(this.d=v*w+y*M);case t.TransformMode.OnlyTranslation:f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;this.a=Math.cos(f)*i,this.b=Math.cos(p)*a,this.c=Math.sin(f)*i,this.d=Math.sin(p)*a;break;case t.TransformMode.NoRotationOrReflection:var S=0;(k=m*m+v*v)>1e-4?(k=Math.abs(m*y-g*v)/k,m/=this.skeleton.scaleX,g=(v/=this.skeleton.scaleY)*k,y=m*k,S=Math.atan2(v,m)*d.radDeg):(m=0,v=0,S=90-Math.atan2(y,g)*d.radDeg);f=(r+s-S)*d.degRad,p=(r+o-S+90)*d.degRad,x=Math.cos(f)*i,w=Math.cos(p)*a,b=Math.sin(f)*i,M=Math.sin(p)*a;this.a=m*x-g*b,this.b=m*w-g*M,this.c=v*x+y*b,this.d=v*w+y*M;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:r*=d.degRad;var k,A=Math.cos(r),I=Math.sin(r),T=(m*A+g*I)/this.skeleton.scaleX,C=(v*A+y*I)/this.skeleton.scaleY;(k=Math.sqrt(T*T+C*C))>1e-5&&(k=1/k),T*=k,C*=k,k=Math.sqrt(T*T+C*C),this.data.transformMode==t.TransformMode.NoScale&&m*y-g*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(k=-k),r=Math.PI/2+Math.atan2(C,T);var E=Math.cos(r)*k,F=Math.sin(r)*k;s*=d.degRad,o=(90+o)*d.degRad;x=Math.cos(s)*i,w=Math.cos(o)*a,b=Math.sin(s)*i,M=Math.sin(o)*a;this.a=T*x+E*b,this.b=T*w+E*M,this.c=C*x+F*b,this.d=C*w+F*M}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.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},e.prototype.updateAppliedTransform=function(){var e=this.parent;if(!e)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*d.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)*d.radDeg);var n,r,i,a,s=e.a,o=e.b,h=e.c,l=e.d,c=1/(s*l-o*h),u=l*c,f=o*c,p=h*c,m=s*c,g=this.worldX-e.worldX,v=this.worldY-e.worldY;if(this.ax=g*u-v*f,this.ay=v*m-g*p,this.data.transformMode==t.TransformMode.OnlyTranslation)n=this.a,r=this.b,i=this.c,a=this.d;else{switch(this.data.transformMode){case t.TransformMode.NoRotationOrReflection:var y=Math.abs(s*l-o*h)/(s*s+h*h),x=s/this.skeleton.scaleX;o=-(h/this.skeleton.scaleY)*y*this.skeleton.scaleX,u=(l=x*y*this.skeleton.scaleY)*(c=1/(s*l-o*h)),f=o*c;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var w=d.cosDeg(this.rotation),b=d.sinDeg(this.rotation);s=(s*w+o*b)/this.skeleton.scaleX,h=(h*w+l*b)/this.skeleton.scaleY;var M=Math.sqrt(s*s+h*h);M>1e-5&&(M=1/M),s*=M,h*=M,M=Math.sqrt(s*s+h*h),this.data.transformMode==t.TransformMode.NoScale&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var S=d.PI/2+Math.atan2(h,s);o=Math.cos(S)*M,u=(l=Math.sin(S)*M)*(c=1/(s*l-o*h)),f=o*c,p=h*c,m=s*c}n=u*this.a-f*this.c,r=u*this.b-f*this.d,i=m*this.c-p*this.a,a=m*this.d-p*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(n*n+i*i),this.ascaleX>1e-4){var k=n*a-r*i;this.ascaleY=k/this.ascaleX,this.ashearY=-Math.atan2(n*r+i*a,k)*d.radDeg,this.arotation=Math.atan2(i,n)*d.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(r*r+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,r)*d.radDeg},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*d.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*d.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.worldToLocal=function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,r=t.y-this.worldY;return t.x=n*this.d*e-r*this.b*e,t.y=r*this.a*e-n*this.c*e,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToParent=function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)},e.prototype.parentToWorld=function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)},e.prototype.worldToLocalRotation=function(t){var e=d.sinDeg(t),n=d.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*d.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var e=d.sinDeg(t),n=d.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*d.radDeg},e.prototype.rotateWorld=function(t){t*=d.degRad;var e=Math.sin(t),n=Math.cos(t),r=this.a,i=this.b;this.a=n*r-e*this.c,this.b=n*i-e*this.d,this.c=e*r+n*this.c,this.d=e*i+n*this.d},e}(),Jt=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},Kt=function(){function t(t,e,n){void 0===e&&(e=""),void 0===n&&(n=new Qt),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=n}return t.prototype.start=function(t){return this.toLoad++,this.pathPrefix+t},t.prototype.success=function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)},t.prototype.error=function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)},t.prototype.loadAll=function(){var t=this;return new Promise((function(e,n){var r=function(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(r)};requestAnimationFrame(r)}))},t.prototype.setRawDataURI=function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e},t.prototype.loadBinary=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadBinary(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadText=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadText(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load text ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadJson=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadJson(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadTexture=function(t,e,n){var r=this;if(void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(e){return e.ok?e.blob():(r.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&r.success(e,t,r.textureLoader(n))}));else{var i=new Image;i.crossOrigin="anonymous",i.onload=function(){r.success(e,t,r.textureLoader(i))},i.onerror=function(){r.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),i.src=t}},t.prototype.loadTextureAtlas=function(t,e,n,r){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){});var a=t.lastIndexOf("/"),o=a>=0?t.substring(0,a+1):"";t=this.start(t),this.downloader.downloadText(t,(function(a){var h,l;try{var c=new Xt(a),u=c.pages.length,d=!1,f=function(a){i.loadTexture(r?r[a.name]:o+a.name,(function(n,r){d||(a.setTexture(r),0==--u&&i.success(e,t,c))}),(function(e,r){d||i.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(e)),d=!0}))};try{for(var p=s(c.pages),m=p.next();!m.done;m=p.next()){f(m.value)}}catch(t){h={error:t}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(h)throw h.error}}}catch(e){i.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(e.message))}}),(function(e,r){i.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.get=function(t){return this.assets[this.pathPrefix+t]},t.prototype.require=function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))},t.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e},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}(),Qt=function(){function t(){this.callbacks={},this.rawDataUris={}}return t.prototype.dataUriToString=function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)},t.prototype.base64ToUint8Array=function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=e.charCodeAt(i);return r},t.prototype.dataUriToUint8Array=function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))},t.prototype.downloadText=function(t,e,n){var r=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var i=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(i))}catch(e){this.finish(t,400,JSON.stringify(e))}else{var a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",t,!0);var s=function(){r.finish(t,a.status,a.responseText)};a.onload=s,a.onerror=s,a.send()}},t.prototype.downloadJson=function(t,e,n){this.downloadText(t,(function(t){e(JSON.parse(t))}),n)},t.prototype.downloadBinary=function(t,e,n){var r=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var i=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(i))}catch(e){this.finish(t,400,JSON.stringify(e))}else{var a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType="arraybuffer";var s=function(){r.finish(t,a.status,a.response)};a.onload=function(){200==a.status||0==a.status?r.finish(t,200,new Uint8Array(a.response)):s()},a.onerror=s,a.send()}},t.prototype.start=function(t,e,n){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,n)}},t.prototype.finish=function(t,e,n){var r=this.callbacks[t];delete this.callbacks[t];for(var i=200==e||0==e?[n]:[e,n],a=i.length-1,s=r.length;a<s;a+=2)r[a].apply(null,i)},t}(),Zt=function(t,e){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!e)throw new Error("data cannot be null.");this.time=t,this.data=e},$t=function(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t},te=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n<t.bones.length;n++){var r=e.findBone(t.bones[n].name);if(!r)throw new Error("Couldn't find bone ".concat(t.bones[n].name));this.bones.push(r)}var i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find bone ".concat(t.target.name));this.target=i}return e.prototype.isActive=function(){return this.active},e.prototype.setToSetupPose=function(){var t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch},e.prototype.update=function(t){if(0!=this.mix){var e=this.target,n=this.bones;switch(n.length){case 1:this.apply1(n[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(n[0],n[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}},e.prototype.apply1=function(e,n,r,i,a,s,o){var h=e.parent;if(!h)throw new Error("IK bone must have parent.");var l=h.a,c=h.b,u=h.c,f=h.d,p=-e.ashearX-e.arotation,m=0,g=0;switch(e.data.transformMode){case t.TransformMode.OnlyTranslation:m=(n-e.worldX)*d.signum(e.skeleton.scaleX),g=(r-e.worldY)*d.signum(e.skeleton.scaleY);break;case t.TransformMode.NoRotationOrReflection:var v=Math.abs(l*f-c*u)/Math.max(1e-4,l*l+u*u),y=l/e.skeleton.scaleX,x=u/e.skeleton.scaleY;c=-x*v*e.skeleton.scaleX,f=y*v*e.skeleton.scaleY,p+=Math.atan2(x,y)*d.radDeg;default:var w=n-h.worldX,b=r-h.worldY,M=l*f-c*u;Math.abs(M)<=1e-4?(m=0,g=0):(m=(w*f-b*c)/M-e.ax,g=(b*l-w*u)/M-e.ay)}p+=Math.atan2(g,m)*d.radDeg,e.ascaleX<0&&(p+=180),p>180?p-=360:p<-180&&(p+=360);var S=e.ascaleX,k=e.ascaleY;if(i||a){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:m=n-e.worldX,g=r-e.worldY}var A=e.data.length*S;if(A>1e-4){var I=m*m+g*g;if(i&&I<A*A||a&&I>A*A)S*=v=(Math.sqrt(I)/A-1)*o+1,s&&(k*=v)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*o,S,k,e.ashearX,e.ashearY)},e.prototype.apply2=function(t,e,n,r,i,a,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,p=u,m=f,g=e.ascaleX,v=0,y=0,x=0;u<0?(u=-u,v=180,x=-1):(v=0,x=1),f<0&&(f=-f,x=-x),g<0?(g=-g,y=180):y=0;var w=e.ax,b=0,M=0,S=0,k=t.a,A=t.b,I=t.c,T=t.d,C=Math.abs(u-f)<=1e-4;!C||a?(b=0,M=k*w+t.worldX,S=I*w+t.worldY):(M=k*w+A*(b=e.ay)+t.worldX,S=I*w+T*b+t.worldY);var E=t.parent;if(!E)throw new Error("IK parent must itself have a parent.");k=E.a,A=E.b,I=E.c;var F,B,Y=k*(T=E.d)-A*I,R=M-E.worldX,P=S-E.worldY,X=(R*T-P*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,V=(P*k-R*I)*Y-c,D=Math.sqrt(X*X+V*V),L=e.data.length*g;if(D<1e-4)return this.apply1(t,n,r,!1,a,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var N=((R=n-E.worldX)*T-(P=r-E.worldY)*A)*Y-l,O=(P*k-R*I)*Y-c,_=N*N+O*O;if(0!=o){o*=u*(g+1)*.5;var q=Math.sqrt(_),U=q-D-L*u+o;if(U>0){var W=Math.min(1,U/(2*o))-1;_=(N-=(W=(U-o*(1-W*W))/q)*N)*N+(O-=W*O)*O}}t:if(C){var z=(_-D*D-(L*=u)*L)/(2*D*L);z<-1?(z=-1,B=Math.PI*i):z>1?(z=1,B=0,a&&(p*=k=(Math.sqrt(_)/(D+L)-1)*h+1,s&&(m*=k))):B=Math.acos(z)*i,k=D+L*z,A=L*Math.sin(B),F=Math.atan2(O*k-N*A,N*k+O*A)}else{var G=(k=u*L)*k,H=(A=f*L)*A,j=Math.atan2(O,N),J=-2*H*D,K=H-G;if((T=J*J-4*K*(I=H*D*D+G*_-G*H))>=0){var Q=Math.sqrt(T);J<0&&(Q=-Q);var Z=(Q=.5*-(J+Q))/K,$=I/Q,tt=Math.abs(Z)<Math.abs($)?Z:$;if(tt*tt<=_){P=Math.sqrt(_-tt*tt)*i,F=j-Math.atan2(P,tt),B=Math.atan2(P/f,(tt-D)/u);break t}}var et=d.PI,nt=D-k,rt=nt*nt,it=0,at=0,st=D+k,ot=st*st,ht=0;(I=-k*D/(G-H))>=-1&&I<=1&&(I=Math.acos(I),(T=(R=k*Math.cos(I)+D)*R+(P=A*Math.sin(I))*P)<rt&&(et=I,rt=T,nt=R,it=P),T>ot&&(at=I,ot=T,st=R,ht=P)),_<=.5*(rt+ot)?(F=j-Math.atan2(it*i,nt),B=et*i):(F=j-Math.atan2(ht*i,st),B=at*i)}var lt=Math.atan2(b,w)*x,ct=t.arotation;(F=(F-lt)*d.radDeg+v-ct)>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(l,c,ct+F*h,p,m,0,0),ct=e.arotation,(B=((B+lt)*d.radDeg-e.ashearX)*x+y-ct)>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(w,b,ct+B*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e}(),ee=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return r(e,t),Object.defineProperty(e.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),e}(Jt),ne=function(e){function n(n){var r=e.call(this,n,0,!1)||this;return r.bones=new Array,r._target=null,r.positionMode=t.PositionMode.Fixed,r.spacingMode=t.SpacingMode.Fixed,r.rotateMode=t.RotateMode.Chain,r.offsetRotation=0,r.position=0,r.spacing=0,r.mixRotate=0,r.mixX=0,r.mixY=0,r}return r(n,e),Object.defineProperty(n.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),n}(Jt);t.PositionMode=void 0,(zt=t.PositionMode||(t.PositionMode={}))[zt.Fixed=0]="Fixed",zt[zt.Percent=1]="Percent",t.SpacingMode=void 0,(Gt=t.SpacingMode||(t.SpacingMode={}))[Gt.Length=0]="Length",Gt[Gt.Fixed=1]="Fixed",Gt[Gt.Percent=2]="Percent",Gt[Gt.Proportional=3]="Proportional",t.RotateMode=void 0,(Ht=t.RotateMode||(t.RotateMode={}))[Ht.Tangent=0]="Tangent",Ht[Ht.Chain=1]="Chain",Ht[Ht.ChainScale=2]="ChainScale";var re,ie=function(){function e(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n<r;n++){var i=e.findBone(t.bones[n].name);if(!i)throw new Error("Couldn't find bone ".concat(t.bones[n].name,"."));this.bones.push(i)}var a=e.findSlot(t.target.name);if(!a)throw new Error("Couldn't find target bone ".concat(t.target.name));this.target=a,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}return e.prototype.isActive=function(){return this.active},e.prototype.setToSetupPose=function(){var t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY},e.prototype.update=function(n){var r=this.target.getAttachment();if(r instanceof Ot){var i=this.mixRotate,a=this.mixX,s=this.mixY;if(0!=i||0!=a||0!=s){var o=this.data,h=o.rotateMode==t.RotateMode.Tangent,l=o.rotateMode==t.RotateMode.ChainScale,c=this.bones,u=c.length,f=h?u:u+1,p=g.setArraySize(this.spaces,f),m=l?this.lengths=g.setArraySize(this.lengths,u):[],v=this.spacing;switch(o.spacingMode){case t.SpacingMode.Percent:if(l)for(var y=0,x=f-1;y<x;y++){var w=(A=(R=c[y]).data.length)*R.a,b=A*R.c;m[y]=Math.sqrt(w*w+b*b)}g.arrayFill(p,1,f,v);break;case t.SpacingMode.Proportional:var M=0;for(y=0,x=f-1;y<x;){if((A=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=A*R.a,b=A*R.c;var S=Math.sqrt(w*w+b*b);l&&(m[y]=S),p[++y]=S,M+=S}}if(M>0){M=f/M*v;for(y=1;y<f;y++)p[y]*=M}break;default:var k=o.spacingMode==t.SpacingMode.Length;for(y=0,x=f-1;y<x;){var A;if((A=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=A*R.a,b=A*R.c;var I=Math.sqrt(w*w+b*b);l&&(m[y]=I),p[++y]=(k?A+v:v)*I/A}}}var T=this.computeWorldPositions(r,f,h),C=T[0],E=T[1],F=o.offsetRotation,B=!1;if(0==F)B=o.rotateMode==t.RotateMode.Chain;else B=!1,F*=(Y=this.target.bone).a*Y.d-Y.b*Y.c>0?d.degRad:-d.degRad;y=0;for(var Y=3;y<u;y++,Y+=3){var R;(R=c[y]).worldX+=(C-R.worldX)*a,R.worldY+=(E-R.worldY)*s;var P=(w=T[Y])-C,X=(b=T[Y+1])-E;if(l){var V=m[y];if(0!=V){var D=(Math.sqrt(P*P+X*X)/V-1)*i+1;R.a*=D,R.c*=D}}if(C=w,E=b,i>0){var L=R.a,N=R.b,O=R.c,_=R.d,q=0,U=0,W=0;if(q=h?T[Y-1]:0==p[y+1]?T[Y+2]:Math.atan2(X,P),q-=Math.atan2(O,L),B){U=Math.cos(q),W=Math.sin(q);var z=R.data.length;C+=(z*(U*L-W*O)-P)*i,E+=(z*(W*L+U*O)-X)*i}else q+=F;q>d.PI?q-=d.PI2:q<-d.PI&&(q+=d.PI2),q*=i,U=Math.cos(q),W=Math.sin(q),R.a=U*L-W*O,R.b=U*N-W*_,R.c=W*L+U*O,R.d=W*N+U*_}R.updateAppliedTransform()}}}},e.prototype.computeWorldPositions=function(n,r,i){var a=this.target,s=this.position,o=this.spaces,h=g.setArraySize(this.positions,3*r+2),l=this.world,c=n.closed,u=n.worldVerticesLength,d=u/6,f=e.NONE;if(!n.constantSpeed){var p,m=n.lengths,v=m[d-=c?1:2];switch(this.data.positionMode==t.PositionMode.Percent&&(s*=v),this.data.spacingMode){case t.SpacingMode.Percent:p=v;break;case t.SpacingMode.Proportional:p=v/r;break;default:p=1}l=g.setArraySize(this.world,8);for(var y=0,x=0,w=0;y<r;y++,x+=3){var b=s+=G=o[y]*p;if(c)(b%=v)<0&&(b+=v),w=0;else{if(b<0){f!=e.BEFORE&&(f=e.BEFORE,n.computeWorldVertices(a,2,4,l,0,2)),this.addBeforePosition(b,l,0,h,x);continue}if(b>v){f!=e.AFTER&&(f=e.AFTER,n.computeWorldVertices(a,u-6,4,l,0,2)),this.addAfterPosition(b-v,l,0,h,x);continue}}for(;;w++){var M=m[w];if(!(b>M)){if(0==w)b/=M;else b=(b-(K=m[w-1]))/(M-K);break}}w!=f&&(f=w,c&&w==d?(n.computeWorldVertices(a,u-4,4,l,0,2),n.computeWorldVertices(a,0,4,l,4,2)):n.computeWorldVertices(a,6*w+2,8,l,0,2)),this.addCurvePosition(b,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,x,i||y>0&&0==G)}return h}c?(u+=2,l=g.setArraySize(this.world,u),n.computeWorldVertices(a,2,u-4,l,0,2),n.computeWorldVertices(a,0,2,l,u-4,2),l[u-2]=l[0],l[u-1]=l[1]):(d--,u-=4,l=g.setArraySize(this.world,u),n.computeWorldVertices(a,2,u,l,0,2));for(var S,k=g.setArraySize(this.curves,d),A=0,I=l[0],T=l[1],C=0,E=0,F=0,B=0,Y=0,R=0,P=0,X=0,V=0,D=0,L=0,N=0,O=0,_=0,q=(y=0,2);y<d;y++,q+=6)C=l[q],E=l[q+1],F=l[q+2],B=l[q+3],L=2*(P=.1875*(I-2*C+F))+(V=.09375*(3*(C-F)-I+(Y=l[q+4]))),N=2*(X=.1875*(T-2*E+B))+(D=.09375*(3*(E-B)-T+(R=l[q+5]))),O=.75*(C-I)+P+.16666667*V,_=.75*(E-T)+X+.16666667*D,A+=Math.sqrt(O*O+_*_),O+=L,_+=N,L+=V,N+=D,A+=Math.sqrt(O*O+_*_),O+=L,_+=N,A+=Math.sqrt(O*O+_*_),O+=L+V,_+=N+D,A+=Math.sqrt(O*O+_*_),k[y]=A,I=Y,T=R;switch(this.data.positionMode==t.PositionMode.Percent&&(s*=A),this.data.spacingMode){case t.SpacingMode.Percent:S=A;break;case t.SpacingMode.Proportional:S=A/r;break;default:S=1}for(var U=this.segments,W=0,z=(y=0,x=0,w=0,0);y<r;y++,x+=3){var G;b=s+=G=o[y]*S;if(c)(b%=A)<0&&(b+=A),w=0;else{if(b<0){this.addBeforePosition(b,l,0,h,x);continue}if(b>A){this.addAfterPosition(b-A,l,u-4,h,x);continue}}for(;;w++){var H=k[w];if(!(b>H)){if(0==w)b/=H;else b=(b-(K=k[w-1]))/(H-K);break}}if(w!=f){f=w;var j=6*w;for(I=l[j],T=l[j+1],C=l[j+2],E=l[j+3],F=l[j+4],B=l[j+5],L=2*(P=.03*(I-2*C+F))+(V=.006*(3*(C-F)-I+(Y=l[j+6]))),N=2*(X=.03*(T-2*E+B))+(D=.006*(3*(E-B)-T+(R=l[j+7]))),O=.3*(C-I)+P+.16666667*V,_=.3*(E-T)+X+.16666667*D,W=Math.sqrt(O*O+_*_),U[0]=W,j=1;j<8;j++)O+=L,_+=N,L+=V,N+=D,W+=Math.sqrt(O*O+_*_),U[j]=W;O+=L,_+=N,W+=Math.sqrt(O*O+_*_),U[8]=W,O+=L+V,_+=N+D,W+=Math.sqrt(O*O+_*_),U[9]=W,z=0}for(b*=W;;z++){var J=U[z];if(!(b>J)){var K;if(0==z)b/=J;else b=z+(b-(K=U[z-1]))/(J-K);break}}this.addCurvePosition(.1*b,I,T,C,E,F,B,Y,R,h,x,i||y>0&&0==G)}return h},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],s=e[n+1],o=e[n+2]-a,h=e[n+3]-s,l=Math.atan2(h,o);r[i]=a+t*Math.cos(l),r[i+1]=s+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],s=e[n+3],o=a-e[n],h=s-e[n+1],l=Math.atan2(h,o);r[i]=a+t*Math.cos(l),r[i+1]=s+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(i-n,r-e));var d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,v=p*t,y=3*v,x=p*y,w=y*t,b=e*g+r*x+a*w+o*f,M=n*g+i*x+s*w+h*f;l[c]=b,l[c+1]=M,u&&(l[c+2]=t<.001?Math.atan2(i-n,r-e):Math.atan2(M-(n*m+i*v*2+s*d),b-(e*m+r*v*2+a*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}(),ae=function(){function e(t,e){this._bone=null,this.inertia=0,this.strength=0,this.damping=0,this.massInverse=0,this.wind=0,this.gravity=0,this.mix=0,this._reset=!0,this.ux=0,this.uy=0,this.cx=0,this.cy=0,this.tx=0,this.ty=0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0,this.active=!1,this.remaining=0,this.lastTime=0,this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}return Object.defineProperty(e.prototype,"bone",{get:function(){if(this._bone)return this._bone;throw new Error("Bone not set.")},set:function(t){this._bone=t},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0},e.prototype.setToSetupPose=function(){var t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix},e.prototype.isActive=function(){return this.active},e.prototype.update=function(e){var n=this.mix;if(0!=n){var r=this.data.x>0,i=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,s=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(e){case t.Physics.none:return;case t.Physics.reset:this.reset();case t.Physics.update:this.remaining+=Math.max(this.skeleton.time-this.lastTime,0),this.lastTime=this.skeleton.time;var l=o.worldX,c=o.worldY;if(this._reset)this._reset=!1,this.ux=l,this.uy=c;else{var u=this.remaining,f=this.inertia,p=this.data.step;if(r||i){if(r&&(this.xOffset+=(this.ux-l)*f,this.ux=l),i&&(this.yOffset+=(this.uy-c)*f,this.uy=c),u>=p){var m=this.massInverse*p,g=this.strength,v=100*this.wind,y=-100*this.gravity,x=Math.pow(this.damping,60*p);do{r&&(this.xVelocity+=(v-this.xOffset*g)*m,this.xOffset+=this.xVelocity*p,this.xVelocity*=x),i&&(this.yVelocity+=(y-this.yOffset*g)*m,this.yOffset+=this.yVelocity*p,this.yVelocity*=x),u-=p}while(u>=p)}r&&(o.worldX+=this.xOffset*n*this.data.x),i&&(o.worldY+=this.yOffset*n*this.data.y)}if(a||s){var w=Math.atan2(o.c,o.a),b=0,M=0,S=0;if(a){S=(this.data.rotate+this.data.shearX)*n;var k=this.cx-o.worldX,A=this.cy-o.worldY,I=Math.atan2(A+this.ty,k+this.tx)-w-this.rotateOffset*S;this.rotateOffset+=(I-Math.ceil(I*d.invPI2-.5)*d.PI2)*f,I=this.rotateOffset*S+w,b=Math.cos(I),M=Math.sin(I),s&&(I=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(k*b+A*M)*f/I)}else{b=Math.cos(w),M=Math.sin(w),(I=h*o.getWorldScaleX())>0&&(this.scaleOffset+=((this.cx-o.worldX)*b+(this.cy-o.worldY)*M)*f/I)}if((u=this.remaining)>=p)for(m=this.massInverse*p,g=this.strength,v=this.wind,y=this.gravity,x=Math.pow(this.damping,60*p);;)if(u-=p,s&&(this.scaleVelocity+=(v*b-y*M-this.scaleOffset*g)*m,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=x),a){if(this.rotateVelocity+=(-.01*h*(v*M+y*b)-this.rotateOffset*g)*m,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=x,u<p)break;I=this.rotateOffset*S+w;b=Math.cos(I),M=Math.sin(I)}else if(u<p)break}this.remaining=u}this.cx=o.worldX,this.cy=o.worldY;break;case t.Physics.pose:r&&(o.worldX+=this.xOffset*n*this.data.x),i&&(o.worldY+=this.yOffset*n*this.data.y)}if(a){var T=this.rotateOffset*n,C=(M=0,b=0,0);if(this.data.shearX>0){I=0;this.data.rotate>0&&(I=T*this.data.rotate,M=Math.sin(I),b=Math.cos(I),C=o.b,o.b=b*C-M*o.d,o.d=M*C+b*o.d),I+=T*this.data.shearX,M=Math.sin(I),b=Math.cos(I),C=o.a,o.a=b*C-M*o.c,o.c=M*C+b*o.c}else T*=this.data.rotate,M=Math.sin(T),b=Math.cos(T),C=o.a,o.a=b*C-M*o.c,o.c=M*C+b*o.c,C=o.b,o.b=b*C-M*o.d,o.d=M*C+b*o.d}if(s){M=1+this.scaleOffset*n*this.data.scaleX;o.a*=M,o.c*=M}e!=t.Physics.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}},e}(),se=function(){function t(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new u,this.darkColor=t.darkColor?new u:null,this.setToSetupPose()}return t.prototype.getSkeleton=function(){return this.bone.skeleton},t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(t){this.attachment!=t&&(t instanceof S&&this.attachment instanceof S&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null},t}(),oe=function(){function t(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new x,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(var n=0;n<t.bones.length;n++){var r=e.findBone(t.bones[n].name);if(!r)throw new Error("Couldn't find bone ".concat(t.bones[n].name,"."));this.bones.push(r)}var i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find target bone ".concat(t.target.name,"."));this.target=i}return t.prototype.isActive=function(){return this.active},t.prototype.setToSetupPose=function(){var t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY},t.prototype.update=function(t){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())},t.prototype.applyAbsoluteWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?d.degRad:-d.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones,v=0,y=g.length;v<y;v++){var x=g[v];if(0!=t){var w=x.a,b=x.b,M=x.c,S=x.d;(T=Math.atan2(c,h)-Math.atan2(M,w)+p)>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T*=t;var k=Math.cos(T),A=Math.sin(T);x.a=k*w-A*M,x.b=k*b-A*S,x.c=A*w+k*M,x.d=A*b+k*S}if(s){var I=this.temp;o.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(I.x-x.worldX)*e,x.worldY+=(I.y-x.worldY)*n}if(0!=r)0!=(E=Math.sqrt(x.a*x.a+x.c*x.c))&&(E=(E+(Math.sqrt(h*h+c*c)-E+this.data.offsetScaleX)*r)/E),x.a*=E,x.c*=E;if(0!=i)0!=(E=Math.sqrt(x.b*x.b+x.d*x.d))&&(E=(E+(Math.sqrt(l*l+u*u)-E+this.data.offsetScaleY)*i)/E),x.b*=E,x.d*=E;if(a>0){b=x.b,S=x.d;var T,C=Math.atan2(S,b);(T=Math.atan2(u,l)-Math.atan2(c,h)-(C-Math.atan2(x.c,x.a)))>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T=C+(T+m)*a;var E=Math.sqrt(b*b+S*S);x.b=Math.cos(T)*E,x.d=Math.sin(T)*E}x.updateAppliedTransform()}},t.prototype.applyRelativeWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?d.degRad:-d.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones,v=0,y=g.length;v<y;v++){var x=g[v];if(0!=t){var w=x.a,b=x.b,M=x.c,S=x.d;(C=Math.atan2(c,h)+p)>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C*=t;var k=Math.cos(C),A=Math.sin(C);x.a=k*w-A*M,x.b=k*b-A*S,x.c=A*w+k*M,x.d=A*b+k*S}if(s){var I=this.temp;o.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),x.worldX+=I.x*e,x.worldY+=I.y*n}if(0!=r){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*r+1;x.a*=T,x.c*=T}if(0!=i){T=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*i+1;x.b*=T,x.d*=T}if(a>0){var C;(C=Math.atan2(u,l)-Math.atan2(c,h))>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2);b=x.b,S=x.d;C=Math.atan2(S,b)+(C-d.PI/2+m)*a;T=Math.sqrt(b*b+S*S);x.b=Math.cos(C)*T,x.d=Math.sin(C)*T}x.updateAppliedTransform()}},t.prototype.applyAbsoluteLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h<l;h++){var c=o[h],u=c.arotation;if(0!=t){var d=s.arotation-u+this.data.offsetRotation;u+=(d-=360*Math.ceil(d/360-.5))*t}var f=c.ax,p=c.ay;f+=(s.ax-f+this.data.offsetX)*e,p+=(s.ay-p+this.data.offsetY)*n;var m=c.ascaleX,g=c.ascaleY;0!=r&&0!=m&&(m=(m+(s.ascaleX-m+this.data.offsetScaleX)*r)/m),0!=i&&0!=g&&(g=(g+(s.ascaleY-g+this.data.offsetScaleY)*i)/g);var v=c.ashearY;if(0!=a){d=s.ashearY-v+this.data.offsetShearY;v+=(d-=360*Math.ceil(d/360-.5))*a}c.updateWorldTransformWith(f,p,u,m,g,c.ashearX,v)}},t.prototype.applyRelativeLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h<l;h++){var c=o[h],u=c.arotation+(s.arotation+this.data.offsetRotation)*t,d=c.ax+(s.ax+this.data.offsetX)*e,f=c.ay+(s.ay+this.data.offsetY)*n,p=c.ascaleX*((s.ascaleX-1+this.data.offsetScaleX)*r+1),m=c.ascaleY*((s.ascaleY-1+this.data.offsetScaleY)*i+1),g=c.ashearY+(s.ashearY+this.data.offsetShearY)*a;c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t}(),he=function(){function t(t){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,this.time=0,!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 n=t.bones[e],r=void 0;if(n.parent){var i=this.bones[n.parent.index];r=new jt(n,this,i),i.children.push(r)}else r=new jt(n,this,null);this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(e=0;e<t.slots.length;e++){var a=t.slots[e],s=(r=this.bones[a.boneData.index],new se(a,r));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 te(o,this))}this.transformConstraints=new Array;for(e=0;e<t.transformConstraints.length;e++){var h=t.transformConstraints[e];this.transformConstraints.push(new oe(h,this))}this.pathConstraints=new Array;for(e=0;e<t.pathConstraints.length;e++){var l=t.pathConstraints[e];this.pathConstraints.push(new ie(l,this))}this.physicsConstraints=new Array;for(e=0;e<t.physicsConstraints.length;e++){var c=t.physicsConstraints[e];this.physicsConstraints.push(new ae(c,this))}this.color=new u(1,1,1,1),this.updateCache()}return Object.defineProperty(t.prototype,"scaleY",{get:function(){return t.yDown?-this._scaleY:this._scaleY},set:function(t){this._scaleY=t},enumerable:!1,configurable:!0}),t.prototype.updateCache=function(){this._updateCache.length=0;for(var t=this.bones,e=0,n=t.length;e<n;e++){(i=t[e]).sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin){var r=this.skin.bones;for(e=0,n=this.skin.bones.length;e<n;e++){var i=this.bones[r[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(i)}}var a=this.ikConstraints,s=this.transformConstraints,o=this.pathConstraints,h=this.physicsConstraints,l=a.length,c=s.length,u=o.length,d=this.physicsConstraints.length,f=l+c+u+d;t:for(e=0;e<f;e++){for(var p=0;p<l;p++){if((m=a[p]).data.order==e){this.sortIkConstraint(m);continue t}}for(p=0;p<c;p++){if((m=s[p]).data.order==e){this.sortTransformConstraint(m);continue t}}for(p=0;p<u;p++){if((m=o[p]).data.order==e){this.sortPathConstraint(m);continue t}}for(p=0;p<d;p++){var m;if((m=h[p]).data.order==e){this.sortPhysicsConstraint(m);continue t}}}for(e=0,n=t.length;e<n;e++)this.sortBone(t[e])},t.prototype.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target;this.sortBone(e);var n=t.bones,r=n[0];if(this.sortBone(r),1==n.length)this._updateCache.push(t),this.sortReset(r.children);else{var i=n[n.length-1];this.sortBone(i),this._updateCache.push(t),this.sortReset(r.children),i.sorted=!0}}},t.prototype.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target,n=e.data.index,r=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var i=0,a=this.data.skins.length;i<a;i++)this.sortPathConstraintAttachment(this.data.skins[i],n,r);var s=e.getAttachment();s instanceof Ot&&this.sortPathConstraintAttachmentWith(s,r);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||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var e=t.bones,n=e.length;if(t.data.local)for(var r=0;r<n;r++){var i=e[r];this.sortBone(i.parent),this.sortBone(i)}else for(r=0;r<n;r++)this.sortBone(e[r]);this._updateCache.push(t);for(r=0;r<n;r++)this.sortReset(e[r].children);for(r=0;r<n;r++)e[r].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(t,e,n){var r=t.attachments[e];if(r)for(var i in r)this.sortPathConstraintAttachmentWith(r[i],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,e){if(t instanceof Ot){var n=t.bones;if(n)for(var r=this.bones,i=0,a=n.length;i<a;){var s=n[i++];for(s+=i;i<s;)this.sortBone(r[n[i++]])}else this.sortBone(e)}},t.prototype.sortPhysicsConstraint=function(t){var e=t.bone;t.active=e.active&&(!t.data.skinRequired||null!=this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)},t.prototype.sortBone=function(t){if(t&&!t.sorted){var e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},t.prototype.sortReset=function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}},t.prototype.updateWorldTransform=function(t){if(!t)throw new Error("physics is undefined");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}var a=this._updateCache;for(n=0,r=a.length;n<r;n++)a[n].update(t)},t.prototype.updateWorldTransformWith=function(t,e){var n=this.getRootBone();if(!n)throw new Error("Root bone must not be null.");var r=e.a,i=e.b,a=e.c,s=e.d;n.worldX=r*this.x+i*this.y+e.worldX,n.worldY=a*this.x+s*this.y+e.worldY;var o=(n.rotation+n.shearX)*d.degRad,h=(n.rotation+90+n.shearY)*d.degRad,l=Math.cos(o)*n.scaleX,c=Math.cos(h)*n.scaleY,u=Math.sin(o)*n.scaleX,f=Math.sin(h)*n.scaleY;n.a=(r*l+i*u)*this.scaleX,n.b=(r*c+i*f)*this.scaleX,n.c=(a*l+s*u)*this.scaleY,n.d=(a*c+s*f)*this.scaleY;for(var p=this._updateCache,m=0,g=p.length;m<g;m++){var v=p[m];v!=n&&v.update(t)}},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){var t,e,n,r,i,a,o,h,l,c;try{for(var u=s(this.bones),d=u.next();!d.done;d=u.next()){d.value.setToSetupPose()}}catch(e){t={error:e}}finally{try{d&&!d.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}try{for(var f=s(this.ikConstraints),p=f.next();!p.done;p=f.next()){p.value.setToSetupPose()}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var m=s(this.transformConstraints),g=m.next();!g.done;g=m.next()){g.value.setToSetupPose()}}catch(t){i={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var v=s(this.pathConstraints),y=v.next();!y.done;y=v.next()){y.value.setToSetupPose()}}catch(t){o={error:t}}finally{try{y&&!y.done&&(h=v.return)&&h.call(v)}finally{if(o)throw o.error}}try{for(var x=s(this.physicsConstraints),w=x.next();!w.done;w=x.next()){w.value.setToSetupPose()}}catch(t){l={error:t}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;g.arrayCopy(t,0,this.drawOrder,0,t.length);for(var e=0,n=t.length;e<n;e++)t[e].setToSetupPose()},t.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},t.prototype.findBone=function(t){if(!t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];if(i.data.name==t)return i}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n];if(i.data.name==t)return i}return null},t.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)},t.prototype.setSkin=function(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n],a=i.data.attachmentName;if(a){var s=t.getAttachment(n,a);s&&i.setAttachment(s)}}this.skin=t,this.updateCache()}},t.prototype.getAttachmentByName=function(t,e){var n=this.data.findSlot(t);if(!n)throw new Error("Can't find slot with name ".concat(t));return this.getAttachment(n.index,e)},t.prototype.getAttachment=function(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){var n=this.skin.getAttachment(t,e);if(n)return n}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},t.prototype.setAttachment=function(t,e){if(!t)throw new Error("slotName cannot be null.");for(var n=this.slots,r=0,i=n.length;r<i;r++){var a=n[r];if(a.data.name==t){var s=null;if(e&&!(s=this.getAttachment(r,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){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.ikConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findTransformConstraint=function(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.transformConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findPathConstraint=function(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.pathConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findPhysicsConstraint=function(t){var e;if(null==t)throw new Error("constraintName cannot be null.");return null!==(e=this.physicsConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.getBoundsRect=function(){var t=new x,e=new x;return this.getBounds(t,e),{x:t.x,y:t.y,width:e.x,height:e.y}},t.prototype.getBounds=function(t,e,n){if(void 0===n&&(n=new Array(2)),!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var r=this.drawOrder,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=r.length;h<l;h++){var c=r[h];if(c.bone.active){var u=0,d=null,f=c.getAttachment();if(f instanceof qt)u=8,d=g.setArraySize(n,u,0),f.computeWorldVertices(c,d,0,2);else if(f instanceof Nt){var p=f;u=p.worldVerticesLength,d=g.setArraySize(n,u,0),p.computeWorldVertices(c,0,u,d,0,2)}if(d)for(var m=0,v=d.length;m<v;m+=2){var y=d[m],x=d[m+1];i=Math.min(i,y),a=Math.min(a,x),s=Math.max(s,y),o=Math.max(o,x)}}}t.set(i,a),e.set(s-i,o-a)},t.prototype.update=function(t){this.time+=t},t.yDown=!1,t}();t.Physics=void 0,(re=t.Physics||(t.Physics={}))[re.none=0]="none",re[re.reset=1]="reset",re[re.update=2]="update",re[re.pose=3]="pose";var le,ce=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n._bone=null,n.x=0,n.y=0,n.rotate=0,n.scaleX=0,n.shearX=0,n.step=0,n.inertia=0,n.strength=0,n.damping=0,n.massInverse=0,n.wind=0,n.gravity=0,n.mix=0,n.inertiaGlobal=!1,n.strengthGlobal=!1,n.dampingGlobal=!1,n.massGlobal=!1,n.windGlobal=!1,n.gravityGlobal=!1,n.mixGlobal=!1,n}return r(e,t),Object.defineProperty(e.prototype,"bone",{get:function(){if(this._bone)return this._bone;throw new Error("BoneData not set.")},set:function(t){this._bone=t},enumerable:!1,configurable:!0}),e}(Jt),ue=function(){function t(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.physicsConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}return t.prototype.findBone=function(t){if(!t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findSkin=function(t){if(!t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findEvent=function(t){if(!t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findAnimation=function(t){if(!t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findIkConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findTransformConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findPathConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findPhysicsConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.physicsConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t}(),de=function(t,e,n){void 0===t&&(t=0),this.slotIndex=t,this.name=e,this.attachment=n},fe=function(){function t(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,this.color=new u(.99607843,.61960787,.30980393,1),!t)throw new Error("name cannot be null.");this.name=t}return t.prototype.setAttachment=function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var n=t.bones[e],r=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==n){r=!0;break}r||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(r=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){r=!0;break}r||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 n=t.bones[e],r=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==n){r=!0;break}r||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(r=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){r=!0;break}r||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];o.attachment&&(o.attachment instanceof Nt?(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 n=this.attachments[t];return n?n[e]:null},t.prototype.removeAttachment=function(t,e){var n=this.attachments[t];n&&delete n[e]},t.prototype.getAttachments=function(){for(var t=new Array,e=0;e<this.attachments.length;e++){var n=this.attachments[e];if(n)for(var r in n){var i=n[r];i&&t.push(new de(e,r,i))}}return t},t.prototype.getAttachmentsForSlot=function(t,e){var n=this.attachments[t];if(n)for(var r in n){var i=n[r];i&&e.push(new de(t,r,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 n=0,r=0;r<t.slots.length;r++){var i=t.slots[r],a=i.getAttachment();if(a&&n<e.attachments.length){var s=e.attachments[n];for(var o in s){if(a==s[o]){var h=this.getAttachment(n,o);h&&i.setAttachment(h);break}}}n++}},t}(),pe=function(e,n,r){if(this.index=0,this.color=new u(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=t.BlendMode.Normal,this.visible=!0,e<0)throw new Error("index must be >= 0.");if(!n)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.BlendMode=void 0,(le=t.BlendMode||(t.BlendMode={}))[le.Normal=0]="Normal",le[le.Additive=1]="Additive",le[le.Multiply=2]="Multiply",le[le.Screen=3]="Screen";var me,ge=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=0,n.offsetRotation=0,n.offsetX=0,n.offsetY=0,n.offsetScaleX=0,n.offsetScaleY=0,n.offsetShearY=0,n.relative=!1,n.local=!1,n}return r(e,t),Object.defineProperty(e.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),e}(Jt),ve=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,r=this.scale,i=new ue;i.name="";var a=new ye(e),s=a.readInt32(),o=a.readInt32();i.hash=0==o&&0==s?null:o.toString(16)+s.toString(16),i.version=a.readString(),i.x=a.readFloat(),i.y=a.readFloat(),i.width=a.readFloat(),i.height=a.readFloat();var h=a.readBoolean();h&&(i.fps=a.readFloat(),i.imagesPath=a.readString(),i.audioPath=a.readString());var l=0;l=a.readInt(!0);for(var c=0;c<l;c++){var d=a.readString();if(!d)throw new Error("String in string table must not be null.");a.strings.push(d)}l=a.readInt(!0);for(c=0;c<l;c++){var f=a.readString();if(!f)throw new Error("Bone name must not be null.");var p=0==c?null:i.bones[a.readInt(!0)];(y=new Wt(c,f,p)).rotation=a.readFloat(),y.x=a.readFloat()*r,y.y=a.readFloat()*r,y.scaleX=a.readFloat(),y.scaleY=a.readFloat(),y.shearX=a.readFloat(),y.shearY=a.readFloat(),y.length=a.readFloat()*r,y.transformMode=a.readInt(!0),y.skinRequired=a.readBoolean(),h&&(u.rgba8888ToColor(y.color,a.readInt32()),y.icon=null!==(n=a.readString())&&void 0!==n?n:void 0,y.visible=a.readBoolean()),i.bones.push(y)}l=a.readInt(!0);for(c=0;c<l;c++){var m=a.readString();if(!m)throw new Error("Slot name must not be null.");var v=i.bones[a.readInt(!0)],y=new pe(c,m,v);u.rgba8888ToColor(y.color,a.readInt32());var x=a.readInt32();-1!=x&&u.rgb888ToColor(y.darkColor=new u,x),y.attachmentName=a.readStringRef(),y.blendMode=a.readInt(!0),h&&(y.visible=a.readBoolean()),i.slots.push(y)}l=a.readInt(!0);c=0;for(var w=void 0;c<l;c++){var b=a.readString();if(!b)throw new Error("IK constraint data name must not be null.");(y=new ee(b)).order=a.readInt(!0),w=a.readInt(!0);for(var M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.bones[a.readInt(!0)],y.mix=a.readFloat(),y.softness=a.readFloat()*r;var S=a.readByte();y.skinRequired=0!=(1&S),y.bendDirection=0!=(2&S)?1:-1,y.compress=0!=(4&S),y.stretch=0!=(8&S),y.uniform=0!=(16&S),i.ikConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var k=a.readString();if(!k)throw new Error("Transform constraint data name must not be null.");(y=new ge(k)).order=a.readInt(!0),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),y.local=0!=(2&S),y.relative=0!=(4&S),y.offsetRotation=a.readFloat(),y.offsetX=a.readFloat()*r,y.offsetY=a.readFloat()*r,y.offsetScaleX=a.readFloat(),y.offsetScaleY=a.readFloat(),y.offsetShearY=a.readFloat(),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),y.mixScaleX=a.readFloat(),y.mixScaleY=a.readFloat(),y.mixShearY=a.readFloat(),i.transformConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var A=a.readString();if(!A)throw new Error("Path constraint data name must not be null.");(y=new ne(A)).order=a.readInt(!0),y.skinRequired=a.readBoolean(),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.slots[a.readInt(!0)],y.positionMode=a.readInt(!0),y.spacingMode=a.readInt(!0),y.rotateMode=a.readInt(!0),y.offsetRotation=a.readFloat(),y.position=a.readFloat(),y.positionMode==t.PositionMode.Fixed&&(y.position*=r),y.spacing=a.readFloat(),y.spacingMode!=t.SpacingMode.Length&&y.spacingMode!=t.SpacingMode.Fixed||(y.spacing*=r),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),i.pathConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var I=a.readString();if(!I)throw new Error("Physics constraint data name must not be null.");(y=new ce(I)).order=a.readInt(!0),y.bone=i.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),0!=(2&S)&&(y.x=a.readFloat()),0!=(4&S)&&(y.y=a.readFloat()),0!=(8&S)&&(y.rotate=a.readFloat()),0!=(16&S)&&(y.scaleX=a.readFloat()),0!=(32&S)&&(y.shearX=a.readFloat()),y.step=1/a.readByte(),y.inertia=a.readFloat(),y.strength=a.readFloat(),y.damping=a.readFloat(),y.massInverse=a.readFloat(),y.wind=a.readFloat()*r,y.gravity=a.readFloat()*r,y.mix=a.readFloat(),0!=(1&(S=a.readByte()))&&(y.inertiaGlobal=!0),0!=(2&S)&&(y.strengthGlobal=!0),0!=(4&S)&&(y.dampingGlobal=!0),0!=(8&S)&&(y.massGlobal=!0),0!=(16&S)&&(y.windGlobal=!0),0!=(32&S)&&(y.gravityGlobal=!0),0!=(64&S)&&(y.mixGlobal=!0),i.physicsConstraints.push(y)}var T=this.readSkin(a,i,!0,h);T&&(i.defaultSkin=T,i.skins.push(T));c=i.skins.length;for(g.setArraySize(i.skins,l=c+a.readInt(!0));c<l;c++){if(!(E=this.readSkin(a,i,!1,h)))throw new Error("readSkin() should not have returned null.");i.skins[c]=E}l=this.linkedMeshes.length;for(c=0;c<l;c++){var C=this.linkedMeshes[c],E=i.skins[C.skinIndex];if(!C.parent)throw new Error("Linked mesh parent must not be null");var F=E.getAttachment(C.slotIndex,C.parent);if(!F)throw new Error("Parent mesh not found: ".concat(C.parent));C.mesh.timelineAttachment=C.inheritTimeline?F:C.mesh,C.mesh.setParentMesh(F),null!=C.mesh.region&&C.mesh.updateRegion()}this.linkedMeshes.length=0,l=a.readInt(!0);for(c=0;c<l;c++){var B=a.readString();if(!B)throw new Error("Event data name must not be null");(y=new $t(B)).intValue=a.readInt(!1),y.floatValue=a.readFloat(),y.stringValue=a.readString(),y.audioPath=a.readString(),y.audioPath&&(y.volume=a.readFloat(),y.balance=a.readFloat()),i.events.push(y)}l=a.readInt(!0);for(c=0;c<l;c++){var Y=a.readString();if(!Y)throw new Error("Animatio name must not be null.");i.animations.push(this.readAnimation(a,Y,i))}return i},e.prototype.readSkin=function(t,e,n,r){var i=null,a=0;if(n){if(0==(a=t.readInt(!0)))return null;i=new fe("default")}else{var s=t.readString();if(!s)throw new Error("Skin name must not be null.");i=new fe(s),r&&u.rgba8888ToColor(i.color,t.readInt32()),i.bones.length=t.readInt(!0);for(var o=0,h=i.bones.length;o<h;o++)i.bones[o]=e.bones[t.readInt(!0)];for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.ikConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.transformConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.pathConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.physicsConstraints[t.readInt(!0)]);a=t.readInt(!0)}for(o=0;o<a;o++)for(var l=t.readInt(!0),c=0,d=t.readInt(!0);c<d;c++){var f=t.readStringRef();if(!f)throw new Error("Attachment name must not be null");var p=this.readAttachment(t,e,i,l,f,r);p&&i.setAttachment(l,f,p)}return i},e.prototype.readAttachment=function(t,e,n,r,i,a){var s=this.scale,o=t.readByte(),h=0!=(8&o)?t.readStringRef():i;if(!h)throw new Error("Attachment name must not be null");switch(7&o){case me.Region:var l=0!=(16&o)?t.readStringRef():null,c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null,f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),v=t.readFloat(),y=t.readFloat(),x=t.readFloat(),w=t.readFloat();l||(l=h);var b=this.attachmentLoader.newRegionAttachment(n,h,l,d);return b?(b.path=l,b.x=p*s,b.y=m*s,b.scaleX=v,b.scaleY=y,b.rotation=f,b.width=x*s,b.height=w*s,u.rgba8888ToColor(b.color,c),b.sequence=d,null==d&&b.updateRegion(),b):null;case me.BoundingBox:var M=this.readVertices(t,0!=(16&o)),S=(c=a?t.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(n,h));return S?(S.worldVerticesLength=M.length,S.vertices=M.vertices,S.bones=M.bones,a&&u.rgba8888ToColor(S.color,c),S):null;case me.Mesh:l=0!=(16&o)?t.readStringRef():h,c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null;var k=t.readInt(!0),A=(M=this.readVertices(t,0!=(128&o)),this.readFloatArray(t,M.length,1)),I=this.readShortArray(t,3*(M.length-k-2)),T=[];x=0,w=0;return a&&(T=this.readShortArray(t,t.readInt(!0)),x=t.readFloat(),w=t.readFloat()),l||(l=h),(C=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(C.path=l,u.rgba8888ToColor(C.color,c),C.bones=M.bones,C.vertices=M.vertices,C.worldVerticesLength=M.length,C.triangles=I,C.regionUVs=A,null==d&&C.updateRegion(),C.hullLength=k<<1,C.sequence=d,a&&(C.edges=T,C.width=x*s,C.height=w*s),C):null;case me.LinkedMesh:if(null==(l=0!=(16&o)?t.readStringRef():h))throw new Error("Path of linked mesh must not be null");c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null;var C,E=0!=(128&o),F=t.readInt(!0),B=t.readStringRef();x=0,w=0;return a&&(x=t.readFloat(),w=t.readFloat()),(C=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(C.path=l,u.rgba8888ToColor(C.color,c),C.sequence=d,a&&(C.width=x*s,C.height=w*s),this.linkedMeshes.push(new xe(C,F,r,B,E)),C):null;case me.Path:for(var Y=0!=(16&o),R=0!=(32&o),P=(M=this.readVertices(t,0!=(64&o)),g.newArray(M.length/6,0)),X=0,V=P.length;X<V;X++)P[X]=t.readFloat()*s;c=a?t.readInt32():0;return(l=this.attachmentLoader.newPathAttachment(n,h))?(l.closed=Y,l.constantSpeed=R,l.worldVerticesLength=M.length,l.vertices=M.vertices,l.bones=M.bones,l.lengths=P,a&&u.rgba8888ToColor(l.color,c),l):null;case me.Point:f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),c=a?t.readInt32():0;var D=this.attachmentLoader.newPointAttachment(n,h);return D?(D.x=p*s,D.y=m*s,D.rotation=f,a&&u.rgba8888ToColor(D.color,c),D):null;case me.Clipping:var L=t.readInt(!0),N=(M=this.readVertices(t,0!=(16&o)),c=a?t.readInt32():0,this.attachmentLoader.newClippingAttachment(n,h));return N?(N.endSlot=e.slots[L],N.worldVerticesLength=M.length,N.vertices=M.vertices,N.bones=M.bones,a&&u.rgba8888ToColor(N.color,c),N):null}return null},e.prototype.readSequence=function(t){if(!t.readBoolean())return null;var e=new k(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e},e.prototype.readVertices=function(t,e){var n=this.scale,r=t.readInt(!0),i=new we;if(i.length=r<<1,!e)return i.vertices=this.readFloatArray(t,i.length,n),i;for(var a=new Array,s=new Array,o=0;o<r;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()*n),a.push(t.readFloat()*n),a.push(t.readFloat())}return i.vertices=g.toFloatArray(a),i.bones=s,i},e.prototype.readFloatArray=function(t,e,n){var r=new Array(e);if(1==n)for(var i=0;i<e;i++)r[i]=t.readFloat();else for(i=0;i<e;i++)r[i]=t.readFloat()*n;return r},e.prototype.readShortArray=function(t,e){for(var n=new Array(e),r=0;r<e;r++)n[r]=t.readInt(!0);return n},e.prototype.readAnimation=function(e,n,r){e.readInt(!0);for(var i=new Array,a=this.scale,s=0,o=e.readInt(!0);s<o;s++)for(var h=e.readInt(!0),l=0,c=e.readInt(!0);l<c;l++){var u=e.readByte(),d=(yt=e.readInt(!0))-1;switch(u){case Xe:for(var f=new K(yt,h),p=0;p<yt;p++)f.setFrame(p,e.readFloat(),e.readStringRef());i.push(f);break;case Ve:for(var m=e.readInt(!0),v=(f=new z(yt,m,h),e.readFloat()),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,M=(p=0,0);f.setFrame(p,v,y,x,w,b),p!=d;p++){var S=e.readFloat(),k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,k,1),Se(e,f,M++,p,1,v,S,x,A,1),Se(e,f,M++,p,2,v,S,w,I,1),Se(e,f,M++,p,3,v,S,b,E,1)}v=S,y=k,x=A,w=I,b=E}i.push(f);break;case De:for(m=e.readInt(!0),f=new G(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w),p!=d;p++){S=e.readFloat(),k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,k,1),Se(e,f,M++,p,1,v,S,x,A,1),Se(e,f,M++,p,2,v,S,w,I,1)}v=S,y=k,x=A,w=I}i.push(f);break;case Le:for(m=e.readInt(!0),f=new j(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,b,k,A,I),p!=d;p++){S=e.readFloat();var F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,at=e.readUnsignedByte()/255,mt=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,F,1),Se(e,f,M++,p,1,v,S,x,B,1),Se(e,f,M++,p,2,v,S,w,Y,1),Se(e,f,M++,p,3,v,S,b,R,1),Se(e,f,M++,p,4,v,S,k,P,1),Se(e,f,M++,p,5,v,S,A,at,1),Se(e,f,M++,p,6,v,S,I,mt,1)}v=S,y=F,x=B,w=Y,b=R,k=P,A=at,I=mt}i.push(f);break;case Ne:for(m=e.readInt(!0),f=new J(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,k,A,I),p!=d;p++){S=e.readFloat(),F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,at=e.readUnsignedByte()/255,mt=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,F,1),Se(e,f,M++,p,1,v,S,x,B,1),Se(e,f,M++,p,2,v,S,w,Y,1),Se(e,f,M++,p,3,v,S,k,P,1),Se(e,f,M++,p,4,v,S,A,at,1),Se(e,f,M++,p,5,v,S,I,mt,1)}v=S,y=F,x=B,w=Y,k=P,A=at,I=mt}i.push(f);break;case Oe:for(f=new H(yt,e.readInt(!0),h),v=e.readFloat(),b=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,b),p!=d;p++){S=e.readFloat(),E=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,b,E,1)}v=S,b=E}i.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var gt=e.readInt(!0);for(l=0,c=e.readInt(!0);l<c;l++){var vt=e.readByte(),yt=e.readInt(!0);m=e.readInt(!0);switch(vt){case Ae:i.push(be(e,new X(yt,m,gt),1));break;case Ie:i.push(Me(e,new V(yt,m,gt),a));break;case Te:i.push(be(e,new D(yt,m,gt),a));break;case Ce:i.push(be(e,new L(yt,m,gt),a));break;case Ee:i.push(Me(e,new N(yt,m,gt),1));break;case Fe:i.push(be(e,new O(yt,m,gt),1));break;case Be:i.push(be(e,new _(yt,m,gt),1));break;case Ye:i.push(Me(e,new q(yt,m,gt),1));break;case Re:i.push(be(e,new U(yt,m,gt),1));break;case Pe:i.push(be(e,new W(yt,m,gt),1))}}}for(s=0,o=e.readInt(!0);s<o;s++){var xt=e.readInt(!0),wt=(d=(yt=e.readInt(!0))-1,f=new tt(yt,e.readInt(!0),xt),v=e.readFloat(),e.readFloat()),bt=e.readFloat()*a;for(p=0,M=0;;p++){var Mt=e.readByte();if(f.setFrame(p,v,wt,bt,e.readByte(),0!=(1&Mt),0!=(2&Mt)),p==d)break;S=e.readFloat();var St=e.readFloat(),kt=e.readFloat()*a;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,wt,St,1),Se(e,f,M++,p,1,v,S,bt,kt,a)}v=S,wt=St,bt=kt}i.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){xt=e.readInt(!0),d=(yt=e.readInt(!0))-1,f=new et(yt,e.readInt(!0),xt),v=e.readFloat();var At=e.readFloat(),It=e.readFloat(),Tt=e.readFloat(),Ct=e.readFloat(),Et=e.readFloat(),Ft=e.readFloat();for(p=0,M=0;f.setFrame(p,v,At,It,Tt,Ct,Et,Ft),p!=d;p++){S=e.readFloat();var Bt=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat(),Xt=e.readFloat(),Vt=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,At,Bt,1),Se(e,f,M++,p,1,v,S,It,Yt,1),Se(e,f,M++,p,2,v,S,Tt,Rt,1),Se(e,f,M++,p,3,v,S,Ct,Pt,1),Se(e,f,M++,p,4,v,S,Et,Xt,1),Se(e,f,M++,p,5,v,S,Ft,Vt,1)}v=S,At=Bt,It=Yt,Tt=Rt,Ct=Pt,Et=Xt,Ft=Vt}i.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){xt=e.readInt(!0);var Dt=r.pathConstraints[xt];for(l=0,c=e.readInt(!0);l<c;l++){vt=e.readByte(),yt=e.readInt(!0),m=e.readInt(!0);switch(vt){case Ue:i.push(be(e,new nt(yt,m,xt),Dt.positionMode==t.PositionMode.Fixed?a:1));break;case We:i.push(be(e,new rt(yt,m,xt),Dt.spacingMode==t.SpacingMode.Length||Dt.spacingMode==t.SpacingMode.Fixed?a:1));break;case ze:for(f=new it(yt,m,xt),v=e.readFloat(),At=e.readFloat(),It=e.readFloat(),Tt=e.readFloat(),p=0,M=0,d=f.getFrameCount()-1;f.setFrame(p,v,At,It,Tt),p!=d;p++){S=e.readFloat(),Bt=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,At,Bt,1),Se(e,f,M++,p,1,v,S,It,Yt,1),Se(e,f,M++,p,2,v,S,Tt,Rt,1)}v=S,At=Bt,It=Yt,Tt=Rt}i.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++)for(xt=e.readInt(!0)-1,l=0,c=e.readInt(!0);l<c;l++){vt=e.readByte(),yt=e.readInt(!0);if(vt!=$e){m=e.readInt(!0);switch(vt){case Ge:i.push(be(e,new st(yt,m,xt),1));break;case He:i.push(be(e,new ot(yt,m,xt),1));break;case je:i.push(be(e,new ht(yt,m,xt),1));break;case Je:i.push(be(e,new lt(yt,m,xt),1));break;case Ke:i.push(be(e,new ct(yt,m,xt),a));break;case Qe:i.push(be(e,new ut(yt,m,xt),a));break;case Ze:i.push(be(e,new dt(yt,m,xt),1))}}else{for(f=new ft(yt,xt),p=0;p<yt;p++)f.setFrame(p,e.readFloat());i.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var Lt=r.skins[e.readInt(!0)];for(l=0,c=e.readInt(!0);l<c;l++){h=e.readInt(!0);for(var Nt=0,Ot=e.readInt(!0);Nt<Ot;Nt++){var _t=e.readStringRef();if(!_t)throw new Error("attachmentName must not be null.");var qt=Lt.getAttachment(h,_t);u=e.readByte(),d=(yt=e.readInt(!0))-1;switch(u){case _e:var Ut=qt,Wt=Ut.bones,zt=Ut.vertices,Gt=Wt?zt.length/3*2:zt.length;for(m=e.readInt(!0),f=new Q(yt,m,h,Ut),v=e.readFloat(),p=0,M=0;;p++){var Ht=void 0,jt=e.readInt(!0);if(0==jt)Ht=Wt?g.newFloatArray(Gt):zt;else{Ht=g.newFloatArray(Gt);var Jt=e.readInt(!0);if(jt+=Jt,1==a)for(var Kt=Jt;Kt<jt;Kt++)Ht[Kt]=e.readFloat();else for(Kt=Jt;Kt<jt;Kt++)Ht[Kt]=e.readFloat()*a;if(!Wt){Kt=0;for(var Qt=Ht.length;Kt<Qt;Kt++)Ht[Kt]+=zt[Kt]}}if(f.setFrame(p,v,Ht),p==d)break;S=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,0,1,1)}v=S}i.push(f);break;case qe:for(f=new pt(yt,h,qt),p=0;p<yt;p++){v=e.readFloat();var $t=e.readInt32();f.setFrame(p,v,T[15&$t],$t>>4,e.readFloat())}i.push(f)}}}}var te=e.readInt(!0);if(te>0){f=new $(te);var ee=r.slots.length;for(s=0;s<te;s++){v=e.readFloat();var ne=e.readInt(!0),re=g.newArray(ee,0);for(l=ee-1;l>=0;l--)re[l]=-1;var ie=g.newArray(ee-ne,0),ae=0,se=0;for(l=0;l<ne;l++){for(h=e.readInt(!0);ae!=h;)ie[se++]=ae++;re[ae+e.readInt(!0)]=ae++}for(;ae<ee;)ie[se++]=ae++;for(l=ee-1;l>=0;l--)-1==re[l]&&(re[l]=ie[--se]);f.setFrame(s,v,re)}i.push(f)}var oe=e.readInt(!0);if(oe>0){for(f=new Z(oe),s=0;s<oe;s++){v=e.readFloat();var he=r.events[e.readInt(!0)],le=new Zt(v,he);le.intValue=e.readInt(!1),le.floatValue=e.readFloat(),le.stringValue=e.readString(),null==le.stringValue&&(le.stringValue=he.stringValue),le.data.audioPath&&(le.volume=e.readFloat(),le.balance=e.readFloat()),f.setFrame(s,le)}i.push(f)}var ce=0;for(s=0,o=i.length;s<o;s++)ce=Math.max(ce,i[s].getDuration());return new C(n,i,ce)},e}(),ye=function(){function t(t,e,n,r){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===r&&(r=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=r}return t.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},t.prototype.readUnsignedByte=function(){return this.buffer.getUint8(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(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)},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="",n=0;n<t;){var r=this.readUnsignedByte();switch(r>>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}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}(),xe=function(t,e,n,r,i){this.mesh=t,this.skinIndex=e,this.slotIndex=n,this.parent=r,this.inheritTimeline=i},we=function(t,e,n){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=0),this.bones=t,this.vertices=e,this.length=n};function be(t,e,n){for(var r=t.readFloat(),i=t.readFloat()*n,a=0,s=0,o=e.getFrameCount()-1;e.setFrame(a,r,i),a!=o;a++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case tn:e.setStepped(a);break;case en:Se(t,e,s++,a,0,r,h,i,l,n)}r=h,i=l}return e}function Me(t,e,n){for(var r=t.readFloat(),i=t.readFloat()*n,a=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,r,i,a),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case tn:e.setStepped(s);break;case en:Se(t,e,o++,s,0,r,l,i,c,n),Se(t,e,o++,s,1,r,l,a,u,n)}r=l,i=c,a=u}return e}function Se(t,e,n,r,i,a,s,o,h,l){e.setBezier(n,r,i,a,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(me||(me={}));var ke,Ae=0,Ie=1,Te=2,Ce=3,Ee=4,Fe=5,Be=6,Ye=7,Re=8,Pe=9,Xe=0,Ve=1,De=2,Le=3,Ne=4,Oe=5,_e=0,qe=1,Ue=0,We=1,ze=2,Ge=0,He=1,je=2,Je=4,Ke=5,Qe=6,Ze=7,$e=8,tn=1,en=2,nn=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 y((function(){return g.newFloatArray(16)}))}return t.prototype.update=function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,i=this.polygonPool,a=t.slots,s=a.length;n.length=0,i.freeAll(r),r.length=0;for(var o=0;o<s;o++){var h=a[o];if(h.bone.active){var l=h.getAttachment();if(l instanceof Et){var c=l;n.push(c);var u=i.obtain();u.length!=c.worldVerticesLength&&(u=g.newFloatArray(c.worldVerticesLength)),r.push(u),c.computeWorldVertices(h,0,c.worldVerticesLength,u,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,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=this.polygons,a=0,s=i.length;a<s;a++)for(var o=i[a],h=o,l=0,c=o.length;l<c;l+=2){var u=h[l],d=h[l+1];t=Math.min(t,u),e=Math.min(e,d),n=Math.max(n,u),r=Math.max(r,d)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=r},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,n,r){var i=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=s&&n>=s||e>=o&&r>=o)return!1;var h=(r-e)/(n-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 c=(a-e)/h+t;return c>i&&c<s||(c=(o-e)/h+t)>i&&c<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 n=this.polygons,r=0,i=n.length;r<i;r++)if(this.containsPointPolygon(n[r],t,e))return this.boundingBoxes[r];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var r=t,i=t.length,a=i-2,s=!1,o=0;o<i;o+=2){var h=r[o+1],l=r[a+1];if(h<n&&l>=n||l<n&&h>=n){var c=r[o];c+(n-h)/(l-h)*(r[a]-c)<e&&(s=!s)}a=o}return s},t.prototype.intersectsSegment=function(t,e,n,r){for(var i=this.polygons,a=0,s=i.length;a<s;a++)if(this.intersectsSegmentPolygon(i[a],t,e,n,r))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,r,i){for(var a=t,s=t.length,o=e-r,h=n-i,l=e*i-n*r,c=a[s-2],u=a[s-1],d=0;d<s;d+=2){var f=a[d],p=a[d+1],m=c*p-u*f,g=c-f,v=u-p,y=o*v-h*g,x=(l*g-o*m)/y;if((x>=c&&x<=f||x>=f&&x<=c)&&(x>=e&&x<=r||x>=r&&x<=e)){var w=(l*v-h*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}c=f,u=p}return!1},t.prototype.getPolygon=function(t){if(!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}(),rn=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 y((function(){return new Array})),this.polygonIndicesPool=new y((function(){return new Array}))}return t.prototype.triangulate=function(e){var n=e,r=e.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a<r;a++)i[a]=a;var s=this.isConcaveArray;s.length=0;a=0;for(var o=r;a<o;++a)s[a]=t.isConcave(a,r,n,i);var h=this.triangles;for(h.length=0;r>3;){for(var l=r-1,c=(a=0,1);;){t:if(!s[a]){for(var u=i[l]<<1,d=i[a]<<1,f=i[c]<<1,p=n[u],m=n[u+1],g=n[d],v=n[d+1],y=n[f],x=n[f+1],w=(c+1)%r;w!=l;w=(w+1)%r)if(s[w]){var b=i[w]<<1,M=n[b],S=n[b+1];if(t.positiveArea(y,x,p,m,M,S)&&t.positiveArea(p,m,g,v,M,S)&&t.positiveArea(g,v,y,x,M,S))break t}break}if(0==c){do{if(!s[a])break;a--}while(a>0);break}l=a,a=c,c=(c+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),s.splice(a,1);var k=(--r+a-1)%r,A=a==r?0:a;s[k]=t.isConcave(k,r,n,i),s[A]=t.isConcave(A,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},t.prototype.decompose=function(e,n){var r=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,c=0,u=n.length;c<u;c+=3){var d=n[c]<<1,f=n[c+1]<<1,p=n[c+2]<<1,m=r[d],g=r[d+1],v=r[f],y=r[f+1],x=r[p],w=r[p+1],b=!1;if(h==d){var M=o.length-4,S=t.winding(o[M],o[M+1],o[M+2],o[M+3],x,w),k=t.winding(x,w,o[0],o[1],o[2],o[3]);S==l&&k==l&&(o.push(x),o.push(w),s.push(p),b=!0)}b||(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(x),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(d),s.push(f),s.push(p),l=t.winding(m,g,v,y,x,w),h=d)}o.length>0&&(i.push(o),a.push(s));for(c=0,u=i.length;c<u;c++)if(0!=(s=a[c]).length)for(var A=s[0],I=s[s.length-1],T=(o=i[c])[M=o.length-4],C=o[M+1],E=o[M+2],F=o[M+3],B=o[0],Y=o[1],R=o[2],P=o[3],X=t.winding(T,C,E,F,B,Y),V=0;V<u;V++)if(V!=c){var D=a[V];if(3==D.length){var L=D[0],N=D[1],O=D[2],_=i[V];x=_[_.length-2],w=_[_.length-1];if(L==A&&N==I){S=t.winding(T,C,E,F,x,w),k=t.winding(x,w,B,Y,R,P);S==X&&k==X&&(_.length=0,D.length=0,o.push(x),o.push(w),s.push(O),T=E,C=F,E=x,F=w,V=0)}}}for(c=i.length-1;c>=0;c--)0==(o=i[c]).length&&(i.splice(c,1),this.polygonPool.free(o),s=a[c],a.splice(c,1),this.polygonIndicesPool.free(s));return i},t.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[s],n[s+1])},t.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},t.winding=function(t,e,n,r,i,a){var s=n-t,o=r-e;return i*o-a*s+s*e-t*o>=0?1:-1},t}(),an=function(){function t(){this.triangulator=new rn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return t.prototype.clipStart=function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,i=g.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(e,0,r,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){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},t.prototype.clipEnd=function(){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,n,r,i,a,s,o){var h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,f=o?12:8,p=0;l.length=0,c.length=0;t:for(var m=0;m<r;m+=3)for(var v=n[m]<<1,y=t[v],x=t[v+1],w=i[v],b=i[v+1],M=t[v=n[m+1]<<1],S=t[v+1],k=i[v],A=i[v+1],I=t[v=n[m+2]<<1],T=t[v+1],C=i[v],E=i[v+1],F=0;F<d;F++){var B=l.length;if(!this.clip(y,x,M,S,I,T,u[F],h)){(O=g.setArraySize(l,B+3*f))[B]=y,O[B+1]=x,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a,o?(O[B+6]=w,O[B+7]=b,O[B+8]=s.r,O[B+9]=s.g,O[B+10]=s.b,O[B+11]=s.a,O[B+12]=M,O[B+13]=S,O[B+14]=a.r,O[B+15]=a.g,O[B+16]=a.b,O[B+17]=a.a,O[B+18]=k,O[B+19]=A,O[B+20]=s.r,O[B+21]=s.g,O[B+22]=s.b,O[B+23]=s.a,O[B+24]=I,O[B+25]=T,O[B+26]=a.r,O[B+27]=a.g,O[B+28]=a.b,O[B+29]=a.a,O[B+30]=C,O[B+31]=E,O[B+32]=s.r,O[B+33]=s.g,O[B+34]=s.b,O[B+35]=s.a):(O[B+6]=w,O[B+7]=b,O[B+8]=M,O[B+9]=S,O[B+10]=a.r,O[B+11]=a.g,O[B+12]=a.b,O[B+13]=a.a,O[B+14]=k,O[B+15]=A,O[B+16]=I,O[B+17]=T,O[B+18]=a.r,O[B+19]=a.g,O[B+20]=a.b,O[B+21]=a.a,O[B+22]=C,O[B+23]=E),B=c.length,(J=g.setArraySize(c,B+3))[B]=p,J[B+1]=p+1,J[B+2]=p+2,p+=3;continue t}var Y=h.length;if(0!=Y){for(var R=S-T,P=I-M,X=y-I,V=T-x,D=1/(R*X+P*(x-T)),L=Y>>1,N=this.clipOutput,O=g.setArraySize(l,B+L*f),_=0;_<Y;_+=2){var q=N[_],U=N[_+1];O[B]=q,O[B+1]=U,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a;var W=q-I,z=U-T,G=(R*W+P*z)*D,H=(V*W+X*z)*D,j=1-G-H;O[B+6]=w*G+k*H+C*j,O[B+7]=b*G+A*H+E*j,o&&(O[B+8]=s.r,O[B+9]=s.g,O[B+10]=s.b,O[B+11]=s.a),B+=f}B=c.length;var J=g.setArraySize(c,B+3*(L-2));L--;for(_=1;_<L;_++)J[B]=p,J[B+1]=p+_,J[B+2]=p+_+1,B+=3;p+=L+1}}},t.prototype.clip=function(t,e,n,r,i,a,s,o){var h,l=o,c=!1;s.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(r),h.push(i),h.push(a),h.push(t),h.push(e),o.length=0;for(var u=s,d=s.length-4,f=0;;f+=2){for(var p=u[f],m=u[f+1],g=u[f+2],v=u[f+3],y=p-g,x=m-v,w=h,b=h.length-2,M=o.length,S=0;S<b;S+=2){var k=w[S],A=w[S+1],I=w[S+2],T=w[S+3],C=y*(T-v)-x*(I-g)>0;if(y*(A-v)-x*(k-g)>0){if(C){o.push(I),o.push(T);continue}var E=(B=T-A)*(g-p)-(Y=I-k)*(v-m);if(Math.abs(E)>1e-6){var F=(Y*(m-A)-B*(p-k))/E;o.push(p+(g-p)*F),o.push(m+(v-m)*F)}else o.push(p),o.push(m)}else if(C){var B,Y;E=(B=T-A)*(g-p)-(Y=I-k)*(v-m);if(Math.abs(E)>1e-6){F=(Y*(m-A)-B*(p-k))/E;o.push(p+(g-p)*F),o.push(m+(v-m)*F)}else o.push(p),o.push(m);o.push(I),o.push(T)}c=!0}if(M==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var R=o;(o=h).length=0,h=R}if(l!=o){l.length=0;f=0;for(var P=o.length-2;f<P;f++)l[f]=o[f]}else l.length=l.length-2;return c},t.makeClockwise=function(t){for(var e=t,n=t.length,r=e[n-2]*e[1]-e[0]*e[n-1],i=0,a=0,s=0,o=0,h=n-3;o<h;o+=2)i=e[o],a=e[o+1],s=e[o+2],r+=i*e[o+3]-s*a;if(!(r<0)){o=0;var l=n-2;for(h=n>>1;o<h;o+=2){var c=e[o],u=e[o+1],d=l-o;e[o]=e[d],e[o+1]=e[d+1],e[d]=c,e[d+1]=u}}},t}(),sn=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n=this.scale,r=new ue,i="string"==typeof e?JSON.parse(e):e,a=i.skeleton;if(a&&(r.hash=a.hash,r.version=a.spine,r.x=a.x,r.y=a.y,r.width=a.width,r.height=a.height,r.fps=a.fps,r.imagesPath=a.images),i.bones)for(var s=0;s<i.bones.length;s++){var o=i.bones[s],h=null,l=un(o,"parent",null);l&&(h=r.findBone(l)),(p=new Wt(r.bones.length,o.name,h)).length=un(o,"length",0)*n,p.x=un(o,"x",0)*n,p.y=un(o,"y",0)*n,p.rotation=un(o,"rotation",0),p.scaleX=un(o,"scaleX",1),p.scaleY=un(o,"scaleY",1),p.shearX=un(o,"shearX",0),p.shearY=un(o,"shearY",0),p.transformMode=g.enumValue(t.TransformMode,un(o,"transform","Normal")),p.skinRequired=un(o,"skin",!1),(f=un(o,"color",null))&&p.color.setFromString(f),r.bones.push(p)}if(i.slots)for(s=0;s<i.slots.length;s++){var c=i.slots[s],d=r.findBone(c.bone);if(!d)throw new Error("Couldn't find bone ".concat(c.bone," for slot ").concat(c.name));var f,p=new pe(r.slots.length,c.name,d);(f=un(c,"color",null))&&p.color.setFromString(f);var m=un(c,"dark",null);m&&(p.darkColor=u.fromString(m)),p.attachmentName=un(c,"attachment",null),p.blendMode=g.enumValue(t.BlendMode,un(c,"blend","normal")),r.slots.push(p)}if(i.ik)for(s=0;s<i.ik.length;s++){var v=i.ik[s];(p=new ee(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(var y=0;y<v.bones.length;y++){if(!(k=r.findBone(v.bones[y])))throw new Error("Couldn't find bone ".concat(v.bones[y]," for IK constraint ").concat(v.name,"."));p.bones.push(k)}if(!(b=r.findBone(v.target)))throw new Error("Couldn't find target bone ".concat(v.target," for IK constraint ").concat(v.name,"."));p.target=b,p.mix=un(v,"mix",1),p.softness=un(v,"softness",0)*n,p.bendDirection=un(v,"bendPositive",!0)?1:-1,p.compress=un(v,"compress",!1),p.stretch=un(v,"stretch",!1),p.uniform=un(v,"uniform",!1),r.ikConstraints.push(p)}if(i.transform)for(s=0;s<i.transform.length;s++){v=i.transform[s];(p=new ge(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(y=0;y<v.bones.length;y++){var x=v.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for transform constraint ").concat(v.name,"."));p.bones.push(k)}var w=v.target;if(!(b=r.findBone(w)))throw new Error("Couldn't find target bone ".concat(w," for transform constraint ").concat(v.name,"."));p.target=b,p.local=un(v,"local",!1),p.relative=un(v,"relative",!1),p.offsetRotation=un(v,"rotation",0),p.offsetX=un(v,"x",0)*n,p.offsetY=un(v,"y",0)*n,p.offsetScaleX=un(v,"scaleX",0),p.offsetScaleY=un(v,"scaleY",0),p.offsetShearY=un(v,"shearY",0),p.mixRotate=un(v,"mixRotate",1),p.mixX=un(v,"mixX",1),p.mixY=un(v,"mixY",p.mixX),p.mixScaleX=un(v,"mixScaleX",1),p.mixScaleY=un(v,"mixScaleY",p.mixScaleX),p.mixShearY=un(v,"mixShearY",1),r.transformConstraints.push(p)}if(i.path)for(s=0;s<i.path.length;s++){v=i.path[s];(p=new ne(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(y=0;y<v.bones.length;y++){x=v.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for path constraint ").concat(v.name,"."));p.bones.push(k)}var b;w=v.target;if(!(b=r.findSlot(w)))throw new Error("Couldn't find target slot ".concat(w," for path constraint ").concat(v.name,"."));p.target=b,p.positionMode=g.enumValue(t.PositionMode,un(v,"positionMode","Percent")),p.spacingMode=g.enumValue(t.SpacingMode,un(v,"spacingMode","Length")),p.rotateMode=g.enumValue(t.RotateMode,un(v,"rotateMode","Tangent")),p.offsetRotation=un(v,"rotation",0),p.position=un(v,"position",0),p.positionMode==t.PositionMode.Fixed&&(p.position*=n),p.spacing=un(v,"spacing",0),p.spacingMode!=t.SpacingMode.Length&&p.spacingMode!=t.SpacingMode.Fixed||(p.spacing*=n),p.mixRotate=un(v,"mixRotate",1),p.mixX=un(v,"mixX",1),p.mixY=un(v,"mixY",p.mixX),r.pathConstraints.push(p)}if(i.physics)for(s=0;s<i.physics.length;s++){v=i.physics[s];(p=new ce(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);x=v.bone;if(null==(k=r.findBone(x)))throw new Error("Physics bone not found: "+x);p.bone=k,p.x=un(v,"x",0),p.y=un(v,"y",0),p.rotate=un(v,"rotate",0),p.scaleX=un(v,"scaleX",0),p.shearX=un(v,"shearX",0),p.step=1/un(v,"fps",60),p.inertia=un(v,"inertia",1),p.strength=un(v,"strength",100),p.damping=un(v,"damping",1),p.massInverse=1/un(v,"mass",1),p.wind=un(v,"wind",0)*n,p.gravity=un(v,"gravity",0)*n,p.mix=un(v,"mix",1),p.inertiaGlobal=un(v,"inertiaGlobal",!1),p.strengthGlobal=un(v,"strengthGlobal",!1),p.dampingGlobal=un(v,"dampingGlobal",!1),p.massGlobal=un(v,"massGlobal",!1),p.windGlobal=un(v,"windGlobal",!1),p.gravityGlobal=un(v,"gravityGlobal",!1),p.mixGlobal=un(v,"mixGlobal",!1),r.physicsConstraints.push(p)}if(i.skins)for(s=0;s<i.skins.length;s++){var M=i.skins[s],S=new fe(M.name);if(M.bones)for(y=0;y<M.bones.length;y++){var k;x=M.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for skin ").concat(M.name,"."));S.bones.push(k)}if(M.ik)for(y=0;y<M.ik.length;y++){var A=M.ik[y];if(!(I=r.findIkConstraint(A)))throw new Error("Couldn't find IK constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.transform)for(y=0;y<M.transform.length;y++){A=M.transform[y];if(!(I=r.findTransformConstraint(A)))throw new Error("Couldn't find transform constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.path)for(y=0;y<M.path.length;y++){A=M.path[y];if(!(I=r.findPathConstraint(A)))throw new Error("Couldn't find path constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.physics)for(y=0;y<M.physics.length;y++){var I;A=M.physics[y];if(!(I=r.findPhysicsConstraint(A)))throw new Error("Couldn't find physics constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}for(var T in M.attachments){var C=r.findSlot(T);if(!C)throw new Error("Couldn't find slot ".concat(T," for skin ").concat(M.name,"."));c=M.attachments[T];for(var E in c){var F=this.readAttachment(c[E],S,C.index,E,r);F&&S.setAttachment(C.index,E,F)}}r.skins.push(S),"default"==S.name&&(r.defaultSkin=S)}s=0;for(var B=this.linkedMeshes.length;s<B;s++){var Y=this.linkedMeshes[s];if(!(S=Y.skin?r.findSkin(Y.skin):r.defaultSkin))throw new Error("Skin not found: ".concat(Y.skin));var R=S.getAttachment(Y.slotIndex,Y.parent);if(!R)throw new Error("Parent mesh not found: ".concat(Y.parent));Y.mesh.timelineAttachment=Y.inheritTimeline?R:Y.mesh,Y.mesh.setParentMesh(R),null!=Y.mesh.region&&Y.mesh.updateRegion()}if(this.linkedMeshes.length=0,i.events)for(var P in i.events){var X=i.events[P];(p=new $t(P)).intValue=un(X,"int",0),p.floatValue=un(X,"float",0),p.stringValue=un(X,"string",""),p.audioPath=un(X,"audio",null),p.audioPath&&(p.volume=un(X,"volume",1),p.balance=un(X,"balance",0)),r.events.push(p)}if(i.animations)for(var V in i.animations){var D=i.animations[V];this.readAnimation(D,V,r)}return r},e.prototype.readAttachment=function(t,e,n,r,i){var a=this.scale;switch(r=un(t,"name",r),un(t,"type","region")){case"region":var s=un(t,"path",r),o=this.readSequence(un(t,"sequence",null)),h=this.attachmentLoader.newRegionAttachment(e,r,s,o);return h?(h.path=s,h.x=un(t,"x",0)*a,h.y=un(t,"y",0)*a,h.scaleX=un(t,"scaleX",1),h.scaleY=un(t,"scaleY",1),h.rotation=un(t,"rotation",0),h.width=t.width*a,h.height=t.height*a,h.sequence=o,(w=un(t,"color",null))&&h.color.setFromString(w),null!=h.region&&h.updateRegion(),h):null;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,r);return l?(this.readVertices(t,l,t.vertexCount<<1),(w=un(t,"color",null))&&l.color.setFromString(w),l):null;case"mesh":case"linkedmesh":s=un(t,"path",r),o=this.readSequence(un(t,"sequence",null));var c=this.attachmentLoader.newMeshAttachment(e,r,s,o);if(!c)return null;c.path=s,(w=un(t,"color",null))&&c.color.setFromString(w),c.width=un(t,"width",0)*a,c.height=un(t,"height",0)*a,c.sequence=o;var u=un(t,"parent",null);if(u)return this.linkedMeshes.push(new on(c,un(t,"skin",null),n,u,un(t,"timelines",!0))),c;var d=t.uvs;return this.readVertices(t,c,d.length),c.triangles=t.triangles,c.regionUVs=d,null!=c.region&&c.updateRegion(),c.edges=un(t,"edges",null),c.hullLength=2*un(t,"hull",0),c;case"path":if(!(s=this.attachmentLoader.newPathAttachment(e,r)))return null;s.closed=un(t,"closed",!1),s.constantSpeed=un(t,"constantSpeed",!0);var f=t.vertexCount;this.readVertices(t,s,f<<1);for(var p=g.newArray(f/3,0),m=0;m<t.lengths.length;m++)p[m]=t.lengths[m]*a;return s.lengths=p,(w=un(t,"color",null))&&s.color.setFromString(w),s;case"point":var v=this.attachmentLoader.newPointAttachment(e,r);return v?(v.x=un(t,"x",0)*a,v.y=un(t,"y",0)*a,v.rotation=un(t,"rotation",0),(w=un(t,"color",null))&&v.color.setFromString(w),v):null;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,r);if(!y)return null;var x=un(t,"end",null);x&&(y.endSlot=i.findSlot(x));var w;f=t.vertexCount;return this.readVertices(t,y,f<<1),(w=un(t,"color",null))&&y.color.setFromString(w),y}return null},e.prototype.readSequence=function(t){if(null==t)return null;var e=new k(un(t,"count",0));return e.start=un(t,"start",1),e.digits=un(t,"digits",0),e.setupIndex=un(t,"setup",0),e},e.prototype.readVertices=function(t,e,n){var r=this.scale;e.worldVerticesLength=n;var i=t.vertices;if(n!=i.length){var a=new Array,s=new Array;for(c=0,u=i.length;c<u;){var o=i[c++];s.push(o);for(var h=c+4*o;c<h;c+=4)s.push(i[c]),a.push(i[c+1]*r),a.push(i[c+2]*r),a.push(i[c+3])}e.bones=s,e.vertices=g.toFloatArray(a)}else{var l=g.toFloatArray(i);if(1!=r)for(var c=0,u=i.length;c<u;c++)l[c]*=r;e.vertices=l}},e.prototype.readAnimation=function(e,n,r){var i=this.scale,a=new Array;if(e.slots)for(var s in e.slots){var o=e.slots[s];if(!(ue=r.findSlot(s)))throw new Error("Slot not found: "+s);var l=ue.index;for(var c in o){if(_t=o[c]){var d=_t.length;if("attachment"==c){for(var f=new K(d,l),p=0;p<d;p++){var m=_t[p];f.setFrame(p,un(m,"time",0),un(m,"name",null))}a.push(f)}else if("rgba"==c){f=new z(d,d<<2,l);for(var v=un(m=_t[0],"time",0),y=u.fromString(m.color),x=(p=0,0);;p++){if(f.setFrame(p,v,y.r,y.g,y.b,y.a),!(zt=_t[p+1])){f.shrink(x);break}var w=un(zt,"time",0),b=u.fromString(zt.color);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,y.a,b.a,1)),v=w,y=b,m=zt}a.push(f)}else if("rgb"==c){for(f=new G(d,3*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.color),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.color);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1)),v=w,y=b,m=zt}a.push(f)}else if("alpha"==c)a.push(hn(_t,new H(d,d,l),0,1));else if("rgba2"==c){f=new j(d,7*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.light);var M=u.fromString(m.dark);for(p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b,y.a,M.r,M.g,M.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.light);var S=u.fromString(zt.dark);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,y.a,b.a,1),x=cn(Qt,f,x,p,4,v,w,M.r,S.r,1),x=cn(Qt,f,x,p,5,v,w,M.g,S.g,1),x=cn(Qt,f,x,p,6,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=zt}a.push(f)}else if("rgb2"==c){for(f=new J(d,6*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.light),M=u.fromString(m.dark),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b,M.r,M.g,M.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.light),S=u.fromString(zt.dark);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,M.r,S.r,1),x=cn(Qt,f,x,p,4,v,w,M.g,S.g,1),x=cn(Qt,f,x,p,5,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=zt}a.push(f)}}}}if(e.bones)for(var k in e.bones){var A=e.bones[k],I=r.findBone(k);if(!I)throw new Error("Bone not found: "+k);var T=I.index;for(var c in A){var E=(_t=A[c]).length;if(0!=E)if("rotate"===c)a.push(hn(_t,new X(E,E,T),0,1));else if("translate"===c){f=new V(E,E<<1,T);a.push(ln(_t,f,"x","y",0,i))}else if("translatex"===c){f=new D(E,E,T);a.push(hn(_t,f,0,i))}else if("translatey"===c){f=new L(E,E,T);a.push(hn(_t,f,0,i))}else if("scale"===c){f=new N(E,E<<1,T);a.push(ln(_t,f,"x","y",1,1))}else if("scalex"===c){f=new O(E,E,T);a.push(hn(_t,f,1,1))}else if("scaley"===c){f=new _(E,E,T);a.push(hn(_t,f,1,1))}else if("shear"===c){f=new q(E,E<<1,T);a.push(ln(_t,f,"x","y",0,1))}else if("shearx"===c){f=new U(E,E,T);a.push(hn(_t,f,0,1))}else if("sheary"===c){f=new W(E,E,T);a.push(hn(_t,f,0,1))}}}if(e.ik)for(var F in e.ik){if(m=(Tt=e.ik[F])[0]){if(!(Et=r.findIkConstraint(F)))throw new Error("IK Constraint not found: "+F);var B=r.ikConstraints.indexOf(Et),Y=(f=new tt(Tt.length,Tt.length<<1,B),v=un(m,"time",0),un(m,"mix",1)),R=un(m,"softness",0)*i;for(p=0,x=0;;p++){if(f.setFrame(p,v,Y,R,un(m,"bendPositive",!0)?1:-1,un(m,"compress",!1),un(m,"stretch",!1)),!(zt=Tt[p+1])){f.shrink(x);break}w=un(zt,"time",0);var P=un(zt,"mix",1),at=un(zt,"softness",0)*i;(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,Y,P,1),x=cn(Qt,f,x,p,1,v,w,R,at,i)),v=w,Y=P,R=at,m=zt}a.push(f)}}if(e.transform)for(var F in e.transform){if(m=(_t=e.transform[F])[0]){if(!(Et=r.findTransformConstraint(F)))throw new Error("Transform constraint not found: "+F);B=r.transformConstraints.indexOf(Et),f=new et(_t.length,6*_t.length,B),v=un(m,"time",0);var mt=un(m,"mixRotate",1),gt=un(m,"mixX",1),vt=un(m,"mixY",gt),yt=un(m,"mixScaleX",1),xt=un(m,"mixScaleY",yt),wt=un(m,"mixShearY",1);for(p=0,x=0;;p++){if(f.setFrame(p,v,mt,gt,vt,yt,xt,wt),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0);var bt=un(zt,"mixRotate",1),Mt=un(zt,"mixX",1),St=un(zt,"mixY",Mt),kt=un(zt,"mixScaleX",1),At=un(zt,"mixScaleY",kt),It=un(zt,"mixShearY",1);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,mt,bt,1),x=cn(Qt,f,x,p,1,v,w,gt,Mt,1),x=cn(Qt,f,x,p,2,v,w,vt,St,1),x=cn(Qt,f,x,p,3,v,w,yt,kt,1),x=cn(Qt,f,x,p,4,v,w,xt,At,1),x=cn(Qt,f,x,p,5,v,w,wt,It,1)),v=w,mt=bt,gt=Mt,vt=St,yt=kt,xt=At,yt=kt,m=zt}a.push(f)}}if(e.path)for(var F in e.path){var Tt=e.path[F];if(!(Et=r.findPathConstraint(F)))throw new Error("Path constraint not found: "+F);B=r.pathConstraints.indexOf(Et);for(var c in Tt){if(m=(_t=Tt[c])[0]){var Ct=_t.length;if("position"===c){f=new nt(Ct,Ct,B);a.push(hn(_t,f,0,Et.positionMode==t.PositionMode.Fixed?i:1))}else if("spacing"===c){f=new rt(Ct,Ct,B);a.push(hn(_t,f,0,Et.spacingMode==t.SpacingMode.Length||Et.spacingMode==t.SpacingMode.Fixed?i:1))}else if("mix"===c){for(f=new it(Ct,3*Ct,B),v=un(m,"time",0),mt=un(m,"mixRotate",1),gt=un(m,"mixX",1),vt=un(m,"mixY",gt),p=0,x=0;;p++){if(f.setFrame(p,v,mt,gt,vt),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),bt=un(zt,"mixRotate",1),Mt=un(zt,"mixX",1),St=un(zt,"mixY",Mt);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,mt,bt,1),x=cn(Qt,f,x,p,1,v,w,gt,Mt,1),x=cn(Qt,f,x,p,2,v,w,vt,St,1)),v=w,mt=bt,gt=Mt,vt=St,m=zt}a.push(f)}}}}if(e.physics)for(var F in e.physics){Tt=e.physics[F],B=-1;if(F.length>0){var Et;if(!(Et=r.findPhysicsConstraint(F)))throw new Error("Physics constraint not found: "+F);B=r.physicsConstraints.indexOf(Et)}for(var c in Tt){if(m=(_t=Tt[c])[0]){var Ft=_t.length;if("reset"!=c){f=void 0;var Bt=1;if("inertia"==c)f=new st(Ft,Ft,B);else if("strength"==c)f=new ot(Ft,Ft,B);else if("damping"==c)f=new ht(Ft,Ft,B);else if("mass"==c)f=new lt(Ft,Ft,B);else if("wind"==c)f=new ct(Ft,Ft,B),Bt=i;else if("gravity"==c)f=new ut(Ft,Ft,B),Bt=i;else{if("mix"!=c)continue;f=new dt(Ft,Ft,B)}a.push(hn(_t,f,0,Bt))}else{var Yt=new ft(_t.size,B);for(p=0;null!=m;m=_t[p+1],p++)Yt.setFrame(p,un(m,"time",0));a.push(Yt)}}}}if(e.attachments)for(var Rt in e.attachments){var Pt=e.attachments[Rt],Xt=r.findSkin(Rt);if(!Xt)throw new Error("Skin not found: "+Rt);for(var Vt in Pt){o=Pt[Vt];if(!(ue=r.findSlot(Vt)))throw new Error("Slot not found: "+Vt);l=ue.index;for(var Dt in o){var Lt=o[Dt],Nt=Xt.getAttachment(l,Dt);for(var Ot in Lt){var _t;if(m=(_t=Lt[Ot])[0])if("deform"==Ot){var qt=Nt.bones,Ut=Nt.vertices,Wt=qt?Ut.length/3*2:Ut.length;for(f=new Q(_t.length,_t.length,l,Nt),v=un(m,"time",0),p=0,x=0;;p++){var zt,Gt=void 0,Ht=un(m,"vertices",null);if(Ht){Gt=g.newFloatArray(Wt);var jt=un(m,"offset",0);if(g.arrayCopy(Ht,0,Gt,jt,Ht.length),1!=i)for(var Jt=(Kt=jt)+Ht.length;Kt<Jt;Kt++)Gt[Kt]*=i;if(!qt)for(var Kt=0;Kt<Wt;Kt++)Gt[Kt]+=Ut[Kt]}else Gt=qt?g.newFloatArray(Wt):Ut;if(f.setFrame(p,v,Gt),!(zt=_t[p+1])){f.shrink(x);break}var Qt;w=un(zt,"time",0);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,0,1,1)),v=w,m=zt}a.push(f)}else if("sequence"==Ot){f=new pt(_t.length,l,Nt);var $t=0;for(p=0;p<_t.length;p++){var te=un(m,"delay",$t),ee=(v=un(m,"time",0),h[un(m,"mode","hold")]),ne=un(m,"index",0);f.setFrame(p,v,ee,ne,te),$t=te,m=_t[p+1]}a.push(f)}}}}}if(e.drawOrder){f=new $(e.drawOrder.length);var re=r.slots.length;for(p=0,Kt=0;Kt<e.drawOrder.length;Kt++,p++){var ie=e.drawOrder[Kt],ae=null,se=un(ie,"offsets",null);if(se){ae=g.newArray(re,-1);for(var oe=g.newArray(re-se.length,0),he=0,le=0,ce=0;ce<se.length;ce++){var ue,de=se[ce];if(!(ue=r.findSlot(de.slot)))throw new Error("Slot not found: "+ue);for(l=ue.index;he!=l;)oe[le++]=he++;ae[he+de.offset]=he++}for(;he<re;)oe[le++]=he++;for(ce=re-1;ce>=0;ce--)-1==ae[ce]&&(ae[ce]=oe[--le])}f.setFrame(p,un(ie,"time",0),ae)}a.push(f)}if(e.events){for(f=new Z(e.events.length),p=0,Kt=0;Kt<e.events.length;Kt++,p++){var fe=e.events[Kt],pe=r.findEvent(fe.name);if(!pe)throw new Error("Event not found: "+fe.name);var me=new Zt(g.toSinglePrecision(un(fe,"time",0)),pe);me.intValue=un(fe,"int",pe.intValue),me.floatValue=un(fe,"float",pe.floatValue),me.stringValue=un(fe,"string",pe.stringValue),me.data.audioPath&&(me.volume=un(fe,"volume",1),me.balance=un(fe,"balance",0)),f.setFrame(p,me)}a.push(f)}var ge=0;for(Kt=0,Jt=a.length;Kt<Jt;Kt++)ge=Math.max(ge,a[Kt].getDuration());r.animations.push(new C(n,a,ge))},e}(),on=function(t,e,n,r,i){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritTimeline=i};function hn(t,e,n,r){for(var i=t[0],a=un(i,"time",0),s=un(i,"value",n)*r,o=0,h=0;;h++){e.setFrame(h,a,s);var l=t[h+1];if(!l)return e.shrink(o),e;var c=un(l,"time",0),u=un(l,"value",n)*r;i.curve&&(o=cn(i.curve,e,o,h,0,a,c,s,u,r)),a=c,s=u,i=l}}function ln(t,e,n,r,i,a){for(var s=t[0],o=un(s,"time",0),h=un(s,n,i)*a,l=un(s,r,i)*a,c=0,u=0;;u++){e.setFrame(u,o,h,l);var d=t[u+1];if(!d)return e.shrink(c),e;var f=un(d,"time",0),p=un(d,n,i)*a,m=un(d,r,i)*a,g=s.curve;g&&(c=cn(g,e,c,u,0,o,f,h,p,a),c=cn(g,e,c,u,1,o,f,l,m,a)),o=f,h=p,l=m,s=d}}function cn(t,e,n,r,i,a,s,o,h,l){if("stepped"==t)return e.setStepped(r),n;var c=i<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(n,r,i,a,o,u,d,f,p,s,h),n+1}function un(t,e,n){return void 0!==t[e]?t[e]:n}function dn(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(encodeURIComponent(e))}function fn(t,e,n){var r,i=new Ut(t);if("skel"===n){r=new ve(i);var a=new ye(e);a.readInt32(),a.readInt32();var s=a.readString();if(!s)throw new Error("未获取到 Spine 版本信息,请使用 Spine 4.2 导出二进制数据");if(s&&"2"!==s.split(".")[1])throw new Error("请使用 Spine 4.2 导出二进制数据, 当前版本: ".concat(s))}else r=new sn(i);return r.readSkeletonData(e)}function pn(t){return t.animations.map((function(t){return t.name}))}function mn(t,n){var r=t.findAnimation(n);return e.assertExist(r),r.duration}function gn(t){return t.skins.filter((function(t){return"default"!==t.name})).map((function(t){return t.name}))}function vn(t){var e=dn(new Uint8Array(t));return new Xt(e)}function yn(t,e){var n=new Uint8Array(t);return"json"===e?dn(n):new DataView(n.buffer)}void 0===Math.fround&&(Math.fround=(ke=new Float32Array(1),function(t){return ke[0]=t,ke[0]}));var xn=1,wn=function(){function n(t){this.verticesLength=0,this.indicesLength=0;var n=t.blendMode,r=t.texture,i=t.priority,a=t.renderer,s=t.pma,o=t.name,h=void 0===o?"MSpine":o,l=t.engine,c=a.mask,u=void 0===c?0:c,d=a.maskMode,f=void 0===d?0:d;this.blendMode=n,this.lastTexture=r,this.priority=i,this.engine=l,this.geometry=this.createGeometry(),this.material=this.createMaterial(s,f,u),this.mesh=e.Mesh.create(l,{name:h+xn++,priority:this.priority,material:this.material,geometry:this.geometry}),this.vertices=new Float32Array(bn.MAX_VERTICES*bn.VERTEX_SIZE),this.indices=new Uint16Array(bn.MAX_VERTICES)}return Object.defineProperty(n.prototype,"blending",{get:function(){return this.blendMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.lastTexture},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"indicesNum",{get:function(){return this.indicesLength},enumerable:!1,configurable:!0}),n.prototype.createGeometry=function(){var t=Float32Array.BYTES_PER_ELEMENT,n=t*bn.VERTEX_SIZE,r={aPosition:{size:2,offset:0,stride:n,data:new Float32Array(0)},aColor:{size:4,offset:2*t,stride:n,dataSource:"aPosition"},aTexCoords:{size:2,offset:6*t,stride:n,dataSource:"aPosition"},aColor2:{size:4,offset:8*t,stride:n,dataSource:"aPosition"}};return e.Geometry.create(this.engine,{attributes:r,indices:{data:new Uint16Array(0),releasable:!0},mode:e.glContext.TRIANGLES,maxVertex:bn.MAX_VERTICES})},n.prototype.createMaterial=function(n,r,i){var a,s,o,h,l=e.Material.create(this.engine,{shader:(a=this.engine,s=a.renderer.env,o=a.gpuCapability.level,h=[["ENV_EDITOR",s===e.PLAYER_OPTIONS_ENV_EDITOR]],{fragment:e.createShaderWithMarcos(h,"precision mediump float;varying mediump vec4 vLight;varying mediump vec4 vDark;varying vec2 vTexCoords;uniform sampler2D uTexture;void main(){vec4 texColor=texture2D(uTexture,vTexCoords);gl_FragColor.a=texColor.a*vLight.a;gl_FragColor.rgb=((texColor.a-1.0)*vDark.a+1.0-texColor.rgb)*vDark.rgb+texColor.rgb*vLight.rgb;}",e.ShaderType.fragment,o),vertex:e.createShaderWithMarcos(h,"attribute vec2 aPosition;attribute vec4 aColor;attribute vec4 aColor2;attribute vec2 aTexCoords;uniform mat4 uModel;uniform mat4 effects_MatrixVP;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvarying vec4 vLight;varying vec4 vDark;varying vec2 vTexCoords;void main(){vLight=aColor;vDark=aColor2;vTexCoords=aTexCoords;gl_Position=effects_MatrixVP*uModel*vec4(aPosition,0.0,1.0);\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}",e.ShaderType.vertex,o),glslVersion:e.GLSLVersion.GLSL1,marcos:h,shared:!0}),uniformSemantics:{effects_MatrixVP:"VIEWPROJECTION",uEditorTransform:"EDITOR_TRANSFORM"}});return l.setTexture("uTexture",this.lastTexture),l.setMatrix("uModel",e.math.Matrix4.fromIdentity()),l.blending=!0,l.culling=!1,l.depthTest=!1,l.depthMask=!1,l.stencilRef=void 0!==i?[i,i]:void 0,function(n,r,i){switch(n.blendEquation=[e.glContext.FUNC_ADD,e.glContext.FUNC_ADD],r){case t.BlendMode.Multiply:n.blendFunction=[e.glContext.DST_COLOR,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA];break;case t.BlendMode.Screen:n.blendFunction=[e.glContext.ONE,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_COLOR,e.glContext.ONE_MINUS_SRC_ALPHA];break;case t.BlendMode.Additive:n.blendFunction=[i?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE,e.glContext.ONE,e.glContext.ONE];break;case t.BlendMode.Normal:n.blendFunction=[i?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE,e.glContext.ONE_MINUS_SRC_ALPHA];break;default:throw new Error("Unknown blend mode: ".concat(r))}}(l,this.blendMode,n),e.setMaskMode(l,r),l},n.prototype.updateMesh=function(t,e,n){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");var r=this.verticesLength,i=this.indicesLength,a=this.verticesLength/bn.VERTEX_SIZE;this.vertices.set(t,r),this.verticesLength+=n;for(var s=0,o=i;s<e.length;s++,o++)this.indices[o]=e[s]+a;this.indicesLength+=e.length},n.prototype.endUpdate=function(t){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");for(var e=this.verticesLength;e<this.vertices.length;e++)this.vertices[e]=0;for(e=this.indicesLength;e<this.indices.length;e++)this.indices[e]=0;this.geometry.setAttributeData("aPosition",this.vertices),this.geometry.setIndexData(this.indices),this.geometry.setDrawCount(this.indicesLength),this.material.setMatrix("uModel",t)},n.prototype.startUpdate=function(){this.verticesLength=0,this.indicesLength=0},n.prototype.dispose=function(){this.geometry.dispose(),this.vertices=null,this.indices=null},n}();var bn=function(){function t(t,n){this.slotList=[],this.vertices=[],this.clipper=new an,this.tempColor=new u,this.tempDark=new u,this.wm=e.math.Matrix4.fromIdentity(),this.meshGroups=[],this.meshToAdd=[],this.slotList=t,this.meshName=n.meshName,this.transform=n.transform,this.listIndex=n.listIndex,this.pma=n.pma,this.renderer=n.renderer,this.engine=n.engine}return t.prototype.resetMeshes=function(){this.meshToAdd.length=0},t.prototype.update=function(){var e,n,r,i=this,a=this.clipper,o=this.pma,h=this.vertices,l=[],c=[],u=0,d=[],f=0,p=0;this.currentMesh=this.meshGroups[p],this.meshGroups.map((function(t){return t.startUpdate()}));try{for(var m=s(this.slotList),g=m.next();!g.done;g=m.next()){var v=g.value,y=a.isClipping()?2:t.VERTEX_SIZE,x=v.getAttachment(),w=void 0,b=void 0,M=0;if(c=[],d=[],u=0,f=0,v.bone.active){if(x instanceof qt){var S=x;w=S.color,h=this.vertices,M=y<<2,S.computeWorldVertices(v,h,0,y),l=t.QUAD_TRIANGLES,r=S.uvs,b=S.region.page.texture}else{if(!(x instanceof Nt)){if(x instanceof Ft){a.clipStart(v,x);continue}a.clipEndWithSlot(v);continue}var k=x;w=k.color,h=this.vertices,M=(k.worldVerticesLength>>1)*y,k.computeWorldVertices(v,0,k.worldVerticesLength,h,0,y),l=k.triangles,r=k.uvs,b=k.region.page.texture}if(b){var A=v.bone.skeleton.color,I=v.color,T=this.tempColor,C=this.tempDark;if(T.set(A.r*I.r*w.r,A.g*I.g*w.g,A.b*I.b*w.b,A.a*I.a*w.a),o&&(T.r*=T.a,T.g*=T.a,T.b*=T.a),v.darkColor?o?(C.r=v.darkColor.r*T.a,C.g=v.darkColor.g*T.a,C.b=v.darkColor.b*T.a,C.a=1):(C.setFromColor(v.darkColor),C.a=0):C.set(0,0,0,1),a.isClipping())a.clipTriangles(h,M,l,l.length,r,T,C,!0),u=(c=a.clippedVertices).length,f=(d=a.clippedTriangles).length;else{for(var E=2,F=0,B=M;E<B;E+=y,F+=2)h[E]=T.r,h[E+1]=T.g,h[E+2]=T.b,h[E+3]=T.a,h[E+4]=r[F],h[E+5]=r[F+1],h[E+6]=C.r,h[E+7]=C.g,h[E+8]=C.b,h[E+9]=C.a;c=h.slice(0,M),u=M,d=l,f=l.length}if(0==u||0==f){a.clipEndWithSlot(v);continue}var Y=this.findMeshIndex(p,v.data.blendMode,b,f);if(-1===Y){var R=this.currentMesh=new wn({blendMode:v.data.blendMode,texture:b,name:this.meshName,priority:this.listIndex+=.01,pma:o,renderer:this.renderer,engine:this.engine});p=this.meshGroups.length,this.meshGroups.push(R),this.meshToAdd.push(R.mesh)}else p=Y,this.currentMesh=this.meshGroups[Y];this.currentMesh.updateMesh(c,d,u)}a.clipEndWithSlot(v)}else a.clipEndWithSlot(v)}}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(e)throw e.error}}a.clipEnd(),this.wm=this.transform.getWorldMatrix(),this.meshGroups.map((function(t){return t.endUpdate(i.wm)}))},t.prototype.findMeshIndex=function(e,n,r,i){for(var a=-1,s=e;s<this.meshGroups.length;s++){var o=this.meshGroups[s];if(o&&o.blending===n&&o.texture.name===r.name&&i+o.indicesNum<t.MAX_VERTICES){a=s;break}}return a},t.QUAD_TRIANGLES=[0,1,2,2,3,0],t.VERTEX_SIZE=12,t.MAX_VERTICES=10920,t}(),Mn=e.math.Vector2,Sn=e.math.Vector3,kn=function(n){function i(t,r){var i,a=n.call(this,t,r)||this;a.offset=new Mn,a.size=new Mn,a._contentVisible=!0;var s=null===(i=a.composition)||void 0===i?void 0:i.renderer.engine;return e.assertExist(s),a.engine=s,a}return r(i,n),Object.defineProperty(i.prototype,"type",{get:function(){return e.spec.ItemType.spine},enumerable:!1,configurable:!0}),i.prototype.onConstructed=function(t){var e;this.initContent(t.content.options,null===(e=this.composition)||void 0===e?void 0:e.loaderData.spineDatas),this.startSize=t.content.options.startSize,this.renderer=t.content.renderer},i.prototype.initContent=function(t,e){var n=t.spine;if(!isNaN(n)){var r=t.activeSkin||"default",i=e[n],a=i.atlas,s=i.skeletonFile,o=i.skeletonType,h=i.skinList,l=i.animationList,c="string"==typeof t.activeAnimation?[t.activeAnimation]:t.activeAnimation;if(this.skeletonData=fn(a,s,o),this.animationStateData=new Ct(this.skeletonData),this.animationStateData.defaultMix=t.mixDuration||0,this.spineDataCache=e[n],this.skinList=h.slice(),this.animationList=l.slice(),this.skeleton=new he(this.skeletonData),this.setSkin(r),this.state=new mt(this.animationStateData),1===c.length)if(isNaN(t.speed)){var u=Number((mn(this.skeletonData,c[0])/this.duration).toFixed(2));this.setAnimation(c[0],u)}else this.setAnimation(c[0],t.speed);else this.setAnimationList(c,t.speed);this.pma=a.pages[0].pma}},i.prototype.doCreateContent=function(){if(this.skeleton)return new bn(this.skeleton.drawOrder,{listIndex:this.listIndex,meshName:this.name,transform:this.transform,pma:this.pma,renderer:this.renderer,engine:this.engine})},i.prototype.onLifetimeBegin=function(){this.state&&this.skeleton&&(this.state.apply(this.skeleton),this.resize(),this.updateState(0))},i.prototype.onItemUpdate=function(t,e){var n=this.content;if(n){var r=this.contentVisible;n.meshGroups.map((function(t){t.mesh.setVisible(r)})),r&&this.updateState(t/1e3)}},i.prototype.onItemRemoved=function(){var t=this.content;t&&t.meshGroups.map((function(t){t.dispose()}))},i.prototype.onEnd=function(){this.endBehavior===e.spec.END_BEHAVIOR_DESTROY&&this.state&&(this.state.clearListeners(),this.state.clearTracks())},i.prototype.handleVisibleChanged=function(t){this.content&&this.content.meshGroups.map((function(e){e.mesh.setVisible(t)}))},i.prototype.getBoundingBox=function(){var t=this.getBounds(),n={type:e.HitTestType.triangle,area:[]};if(!t)return n;var r=t.x,i=t.y,a=t.width,s=t.height,o=this.transform.getWorldMatrix(),h=r+a/2,l=i+s/2,c=new Sn(h-a/2,l-s/2,0),u=new Sn(h+a/2,l-s/2,0),d=new Sn(h+a/2,l+s/2,0),f=new Sn(h-a/2,l+s/2,0);return o.projectPoint(c),o.projectPoint(u),o.projectPoint(d),o.projectPoint(f),n.area=[{p0:c,p1:u,p2:d},{p0:c,p1:d,p2:f}],n},i.prototype.getHitTestParams=function(t){var n,r=this.getBoundingBox(),i=null===(n=this.engine.renderer)||void 0===n?void 0:n.env;if(r.area.length)return t&&i===e.PLAYER_OPTIONS_ENV_EDITOR?{type:e.HitTestType.triangle,triangles:r.area,backfaceCulling:!1,behavior:e.spec.InteractBehavior.NOTIFY}:void 0},i.prototype.updateState=function(e){var n;this.state&&this.skeleton&&(this.state.update(e),this.state.apply(this.skeleton),this.skeleton.update(e),this.skeleton.updateWorldTransform(t.Physics.update),null===(n=this.content)||void 0===n||n.update())},i.prototype.setAnimation=function(t,n){var r;if(!this.skeleton||!this.state)throw new Error("Set animation before skeleton create");if(!this.animationList.length)throw new Error("animationList is empty, check your spine file");var i=this.endBehavior===e.spec.ItemEndBehavior.loop,a=null===(r=this.state.tracks[0])||void 0===r?void 0:r.listener;a&&(a.end=function(){}),this.state.setEmptyAnimation(0),this.animationList.includes(t)?(this.state.setAnimation(0,t,i),this.activeAnimation=[t]):(console.warn("animation ".concat(JSON.stringify(t)," not exists in animationList: ").concat(this.animationList,", set to ").concat(this.animationList[0])),this.state.setAnimation(0,this.animationList[0],i),this.activeAnimation=[this.animationList[0]]),isNaN(n)||this.setSpeed(n)},i.prototype.setAnimationList=function(t,n){var r,i,a,o=this;if(!this.skeleton||!this.state)throw new Error("Set animation before skeleton create");if(!this.animationList.length)throw new Error("animationList is empty, please check your setting");if(1!==t.length){var h=null===(a=this.state.tracks[0])||void 0===a?void 0:a.listener;h&&(h.end=function(){}),this.state.setEmptyAnimation(0);var l=function(t){var n=c.state.addAnimation(0,t,!1);if(c.endBehavior===e.spec.ItemEndBehavior.loop){var r={end:function(){o.state.addAnimation(0,t,!1).listener=r}};n.listener=r}},c=this;try{for(var u=s(t),d=u.next();!d.done;d=u.next()){l(d.value)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}this.activeAnimation=t,isNaN(n)||this.setSpeed(n)}else this.setAnimation(t[0],n)},i.prototype.setSpeed=function(t){this.state&&(this.state.timeScale=t)},i.prototype.getSpeed=function(){return this.state.timeScale||1},i.prototype.getActiveAnimation=function(){return this.activeAnimation},i.prototype.setMixDuration=function(t,e,n){this.animationStateData&&this.animationStateData.setMix(t,e,n)},i.prototype.setDefaultMixDuration=function(t){this.state&&(this.animationStateData.defaultMix=t,this.state.tracks[0]&&(this.state.tracks[0].mixDuration=t))},i.prototype.deleteMixForLoop=function(){var t=this.activeAnimation[this.activeAnimation.length-1],e=this.activeAnimation[0];this.animationStateData.setMix(t,e,0)},i.prototype.setSkin=function(t){if(!this.skeleton)throw new Error("Set skin before skeleton create");if(!t||"default"!==t&&!this.skinList.includes(t))throw new Error("skin ".concat(t," not exists in skinList: ").concat(this.skinList));this.skeleton.setSkinByName(t),this.skeleton.setToSetupPose()},i.prototype.resize=function(){var t=this.getBounds();if(t){var e=t.width,n=this.transform.scale,r=1/e;this.scaleFactor=r,this.transform.setScale(this.startSize*r,this.startSize*r,n.z)}},i.prototype.setScale=function(t,e,n){var r=this.transform.scale,i=r.x,a=r.y,s=r.z;this.transform.setScale(i*t,a*e,s*n)},i.prototype.getBounds=function(){if(this.state&&this.skeleton&&this.contentVisible)return this.skeleton.updateWorldTransform(t.Physics.update),this.skeleton.getBounds(this.offset,this.size),{x:this.offset.x,y:this.offset.y,width:this.size.x,height:this.size.y}},i}(e.VFXItem),An=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.slotGroups=[],e.meshToRemove=[],e}return r(n,t),n.processRawJSON=function(t,e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,Promise.resolve()]}))}))},n.prepareResource=function(t){return i(this,void 0,void 0,(function(){var e,n,r,i,h,l,c,u,d,f,p,m,g,v,y,x,w,b,M,S,k,A,I,T,C,E,F,B,Y,R,P,X,V;return a(this,(function(a){if(n=(e=t).jsonScene,!(e&&n&&n.spines))throw new Error("scene not contain spine content");r=[],i=e.bins;try{for(h=s(n.spines),l=h.next();!l.done;l=h.next())(c=l.value).spineData?r.push(c.spineData):(u=c.atlas,d=c.skeleton,f=c.images,p=c.skeletonType,m=c.id,g=void 0===m?"":m,v=f.map((function(t){return n.textures[t]})),y=o(u[1],3),x=y[0],w=y[1],b=void 0===w?0:w,M=y[2],S=M?i[x].slice(b,b+M):i[x].slice(b),k=o(d[1],3),A=k[0],I=k[1],T=void 0===I?0:I,C=k[2],E=C?i[A].slice(T,T+C):i[A].slice(T),F=vn(S),B=yn(E,p),Y=fn(F,B,p),R=gn(Y),P=pn(Y),r.push({atlas:F,skeletonFile:B,skeletonData:Y,images:f,texturesOptions:v,skeletonType:p,skeletonInstance:new he(Y),skinList:R,animationList:P,id:g}))}catch(t){X={error:t}}finally{try{l&&!l.done&&(V=h.return)&&V.call(h)}finally{if(X)throw X.error}}return n.spines=r,[2]}))}))},n.prototype.onCompositionConstructed=function(t,e){this.slotGroups=[];var n=t.textures;if(e.jsonScene.spines){var r=e.jsonScene.spines;r.map((function(t,e){var r=t.atlas,i=t.images,a=r.pages.length;if(i.length!==a)throw new Error("atlas.page's length not equal spine.textures' length");for(var s=0;s<a;s++){var o=r.pages[s],h=n[i[s]];if(!h)throw new Error("Can not find page ".concat(o.name,"'s texture, check the texture name"));o.texture=h}})),t.loaderData.spineDatas=r}},n.prototype.onCompositionItemLifeBegin=function(t,e){e instanceof kn&&e.content&&this.slotGroups.push(e.content)},n.prototype.onCompositionItemRemoved=function(t,e){var n;if(e instanceof kn&&e.content){e.spineDataCache=void 0;var r=e.content;r&&((n=this.meshToRemove).push.apply(n,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([],o(r.meshGroups),!1)),this.slotGroups.splice(this.slotGroups.indexOf(r),1))}},n.prototype.onCompositionDestroyed=function(t){t.reusable||t.keepResource?this.slotGroups.map((function(t){t&&t.meshGroups.map((function(t){return t.mesh.dispose({material:{textures:e.DestroyOptions.keep}})}))})):(t.loaderData.spineDatas&&delete t.loaderData.spineDatas,this.slotGroups=[])},n.prototype.prepareRenderFrame=function(t,e){return this.meshToRemove.map((function(t){return e.removeMeshFromDefaultRenderPass(t.mesh)})),this.slotGroups.length&&this.slotGroups.map((function(t){t&&(t.meshToAdd.forEach((function(t){t.getVisible()&&e.addMeshToDefaultRenderPass(t)})),t.resetMeshes())})),this.meshToRemove.length=0,!1},n}(e.AbstractPlugin);e.registerPlugin("spine",An,kn);var In="1.2.2";e.logger.info("plugin spine version: "+In),t.AlphaTimeline=H,t.Animation=C,t.AnimationState=mt,t.AnimationStateAdapter=wt,t.AnimationStateData=Ct,t.AssetManagerBase=Kt,t.AtlasAttachmentLoader=Ut,t.Attachment=M,t.AttachmentTimeline=K,t.BinaryInput=ye,t.Bone=jt,t.BoneData=Wt,t.BoundingBoxAttachment=Et,t.CURRENT=Tt,t.ClippingAttachment=Ft,t.Color=u,t.ConstraintData=Jt,t.CurveTimeline=Y,t.CurveTimeline1=R,t.CurveTimeline2=P,t.DebugUtils=v,t.DeformTimeline=Q,t.Downloader=Qt,t.DrawOrderTimeline=$,t.Event=Zt,t.EventData=$t,t.EventQueue=vt,t.EventTimeline=Z,t.FIRST=Mt,t.FakeTexture=Pt,t.HOLD_FIRST=kt,t.HOLD_MIX=At,t.HOLD_SUBSEQUENT=St,t.IkConstraint=te,t.IkConstraintData=ee,t.IkConstraintTimeline=tt,t.IntSet=l,t.Interpolation=f,t.MathUtils=d,t.MeshAttachment=Nt,t.PathAttachment=Ot,t.PathConstraint=ie,t.PathConstraintData=ne,t.PathConstraintMixTimeline=it,t.PathConstraintPositionTimeline=nt,t.PathConstraintSpacingTimeline=rt,t.PhysicsConstraintDampingTimeline=ht,t.PhysicsConstraintGravityTimeline=ut,t.PhysicsConstraintInertiaTimeline=st,t.PhysicsConstraintMassTimeline=lt,t.PhysicsConstraintMixTimeline=dt,t.PhysicsConstraintResetTimeline=ft,t.PhysicsConstraintStrengthTimeline=ot,t.PhysicsConstraintTimeline=at,t.PhysicsConstraintWindTimeline=ct,t.PointAttachment=_t,t.Pool=y,t.Pow=p,t.PowOut=m,t.RGB2Timeline=J,t.RGBA2Timeline=j,t.RGBATimeline=z,t.RGBTimeline=G,t.RegionAttachment=qt,t.RotateTimeline=X,t.SETUP=It,t.SUBSEQUENT=bt,t.ScaleTimeline=N,t.ScaleXTimeline=O,t.ScaleYTimeline=_,t.SequenceTimeline=pt,t.ShearTimeline=q,t.ShearXTimeline=U,t.ShearYTimeline=W,t.Skeleton=he,t.SkeletonBinary=ve,t.SkeletonBounds=nn,t.SkeletonClipping=an,t.SkeletonData=ue,t.SkeletonJson=sn,t.Skin=fe,t.SkinEntry=de,t.Slot=se,t.SlotData=pe,t.SpineLoader=An,t.SpineVFXItem=kn,t.StringSet=c,t.Texture=Bt,t.TextureAtlas=Xt,t.TextureAtlasPage=Dt,t.TextureAtlasRegion=Lt,t.TextureRegion=Rt,t.TimeKeeper=w,t.Timeline=B,t.TrackEntry=gt,t.TransformConstraint=oe,t.TransformConstraintData=ge,t.TransformConstraintTimeline=et,t.TranslateTimeline=V,t.TranslateXTimeline=D,t.TranslateYTimeline=L,t.Triangulator=rn,t.Utils=g,t.Vector2=x,t.VertexAttachment=S,t.WindowedMean=b,t.createSkeletonData=fn,t.getAnimationDuration=mn,t.getAnimationList=pn,t.getAtlasFromBuffer=vn,t.getSkeletonFromBuffer=yn,t.getSkinList=gn,t.getSpineVersion=function(t){var e=new ye(t);return e.readInt32(),e.readInt32(),e.readString()},t.getTextureOptions=function(e){var n,r,i=dn(new Uint8Array(e,0)),a=new Xt(i),o=[],h=a.pages[0];try{for(var l=s(a.pages),c=l.next();!c.done;c=l.next()){var u=c.value;o.push(u.name)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var d=h.magFilter,f=void 0===d?t.TextureFilter.Linear:d,p=h.minFilter,m=void 0===p?t.TextureFilter.Linear:p,g=h.uWrap,v=void 0===g?t.TextureWrap.ClampToEdge:g,y=h.vWrap,x=void 0===y?t.TextureWrap.ClampToEdge:y;return{images:o,pma:h.pma,magFilter:f,minFilter:m,wrapS:v,wrapT:x}},t.version=In,Object.defineProperty(t,"__esModule",{value:!0})}));
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.spinePlugin={}),t.ge)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function i(t,e,n,r){return new(n||(n=Promise))((function(i,a){function s(t){try{h(r.next(t))}catch(t){a(t)}}function o(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((r=r.apply(t,e||[])).next())}))}function a(t,e){var n,r,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(h){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,h])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var h,l=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}(),c=function(){function t(){this.entries={},this.size=0}return t.prototype.add=function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)},t.prototype.addAll=function(t){for(var e=this.size,n=0,r=t.length;n<r;n++)this.add(t[n]);return e!=this.size},t.prototype.contains=function(t){return this.entries[t]},t.prototype.clear=function(){this.entries={},this.size=0},t}(),u=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp()},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?1:parseInt(t.substr(6,2),16)/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp()},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.fromString=function(e){return(new t).setFromString(e)},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}(),d=function(){function t(){}return t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.atan2Deg=function(e,n){return Math.atan2(e,n)*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,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(e-n))},t.isPowerOfTwo=function(t){return t&&0==(t&t-1)},t.PI=3.1415927,t.PI2=2*t.PI,t.invPI2=1/t.PI2,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}(),f=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}(),p=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return r(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}(f),m=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(p),g=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,s=r;a<e+i;a++,s++)n[s]=t[a]},t.arrayFill=function(t,e,n,r){for(var i=e;i<n;i++)t[i]=r},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var r=t.length;if(r==e)return t;if(t.length=e,r<e)for(var i=r;i<e;i++)t[i]=n;return t},t.ensureArrayCapacity=function(e,n,r){return void 0===r&&(r=0),e.length>=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r<t;r++)n[r]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),r=0;r<n.length;r++)n[r]=0;return n},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,n){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},t.enumValue=function(t,e){return t[e[0].toUpperCase()+e.slice(1)]},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}(),v=function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var n=t.bones[e];console.log(n.data.name+", "+n.a+", "+n.b+", "+n.c+", "+n.d+", "+n.worldX+", "+n.worldY)}},t}(),y=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++)this.free(t[e])},t.prototype.clear=function(){this.items.length=0},t}(),x=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}(),w=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}(),b=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)}return 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},t}(),M=function(t){if(!t)throw new Error("name cannot be null.");this.name=t},S=function(t){function e(n){var r=t.call(this,n)||this;return r.id=e.nextID++,r.bones=null,r.vertices=[],r.worldVerticesLength=0,r.timelineAttachment=r,r}return r(e,t),e.prototype.computeWorldVertices=function(t,e,n,r,i,a){n=i+(n>>1)*a;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,d=0;d<e;d+=2){c+=(g=l[c])+1,u+=g}var f=s.bones;if(0==o.length)for(C=i,k=3*u;C<n;C+=a){var p=0,m=0,g=l[c++];for(g+=c;c<g;c++,k+=3){w=f[l[c]],E=h[k],F=h[k+1];var v=h[k+2];p+=(E*w.a+F*w.b+w.worldX)*v,m+=(E*w.c+F*w.d+w.worldY)*v}r[C]=p,r[C+1]=m}else for(var y=o,x=(C=i,k=3*u,u<<1);C<n;C+=a){p=0,m=0,g=l[c++];for(g+=c;c<g;c++,k+=3,x+=2){w=f[l[c]],E=h[k]+y[x],F=h[k+1]+y[x+1],v=h[k+2];p+=(E*w.a+F*w.b+w.worldX)*v,m+=(E*w.c+F*w.d+w.worldY)*v}r[C]=p,r[C+1]=m}}else{o.length>0&&(h=o);for(var w,b=(w=t.bone).worldX,M=w.worldY,S=w.a,k=w.b,A=w.c,I=w.d,T=e,C=i;C<n;T+=2,C+=a){var E=h[T],F=h[T+1];r[C]=E*S+F*k+b,r[C+1]=E*A+F*I+M}}},e.prototype.copyTo=function(t){this.bones?(t.bones=new Array(this.bones.length),g.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=g.newFloatArray(this.vertices.length),g.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment},e.nextID=0,e}(M),k=function(){function t(e){this.id=t.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}return t.prototype.copy=function(){var e=new t(this.regions.length);return g.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e},t.prototype.apply=function(t,e){var n=t.sequenceIndex;-1==n&&(n=this.setupIndex),n>=this.regions.length&&(n=this.regions.length-1);var r=this.regions[n];e.region!=r&&(e.region=r,e.updateRegion())},t.prototype.getPath=function(t,e){for(var n=t,r=(this.start+e).toString(),i=this.digits-r.length;i>0;i--)n+="0";return n+=r},t.nextID=function(){return t._nextID++},t._nextID=0,t}();!function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(h||(h={}));var A,I,T=[h.hold,h.once,h.loop,h.pingpong,h.onceReverse,h.loopReverse,h.pingpongReverse],C=function(){function t(t,e,n){if(this.timelines=[],this.timelineIds=new c,!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=n}return t.prototype.setTimelines=function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())},t.prototype.hasTimeline=function(t){for(var e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1},t.prototype.apply=function(t,e,n,r,i,a,s,o){if(!t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;l<c;l++)h[l].apply(t,e,n,i,a,s,o)},t}();t.MixBlend=void 0,(A=t.MixBlend||(t.MixBlend={}))[A.setup=0]="setup",A[A.first=1]="first",A[A.replace=2]="replace",A[A.add=3]="add",t.MixDirection=void 0,(I=t.MixDirection||(t.MixDirection={}))[I.mixIn=0]="mixIn",I[I.mixOut=1]="mixOut";var E,F={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,physicsConstraintInertia:19,physicsConstraintStrength:20,physicsConstraintDamping:21,physicsConstraintMass:22,physicsConstraintWind:23,physicsConstraintGravity:24,physicsConstraintMix:25,physicsConstraintReset:26,sequence:27},B=function(){function t(t,e){this.propertyIds=e,this.frames=g.newFloatArray(t*this.getFrameEntries())}return t.prototype.getPropertyIds=function(){return this.propertyIds},t.prototype.getFrameEntries=function(){return 1},t.prototype.getFrameCount=function(){return this.frames.length/this.getFrameEntries()},t.prototype.getDuration=function(){return this.frames[this.frames.length-this.getFrameEntries()]},t.search1=function(t,e){for(var n=t.length,r=1;r<n;r++)if(t[r]>e)return r-1;return n-1},t.search=function(t,e,n){for(var r=t.length,i=n;i<r;i+=n)if(t[i]>e)return i-n;return r-n},t}(),Y=function(t){function e(e,n,r){var i=t.call(this,e,r)||this;return i.curves=g.newFloatArray(e+18*n),i.curves[e-1]=1,i}return r(e,t),e.prototype.setLinear=function(t){this.curves[t]=0},e.prototype.setStepped=function(t){this.curves[t]=1},e.prototype.shrink=function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=g.newFloatArray(e);g.arrayCopy(this.curves,0,n,0,e),this.curves=n}},e.prototype.setBezier=function(t,e,n,r,i,a,s,o,h,l,c){var u=this.curves,d=this.getFrameCount()+18*t;0==n&&(u[e]=2+d);for(var f=.03*(r-2*a+o),p=.03*(i-2*s+h),m=.006*(3*(a-o)-r+l),g=.006*(3*(s-h)-i+c),v=2*f+m,y=2*p+g,x=.3*(a-r)+f+.16666667*m,w=.3*(s-i)+p+.16666667*g,b=r+x,M=i+w,S=d+18;d<S;d+=2)u[d]=b,u[d+1]=M,x+=v,w+=y,v+=m,y+=g,b+=x,M+=w},e.prototype.getBezierValue=function(t,e,n,r){var i=this.curves;if(i[r]>t){var a=this.frames[e],s=this.frames[e+n];return s+(t-a)/(i[r]-a)*(i[r+1]-s)}var o=r+18;for(r+=2;r<o;r+=2)if(i[r]>=t){var h=i[r-2],l=i[r-1];return l+(t-h)/(i[r]-h)*(i[r+1]-l)}e+=this.getFrameEntries();var c=i[o-2],u=i[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)},e}(B),R=function(e){function n(t,n,r){return e.call(this,t,n,[r])||this}return r(n,e),n.prototype.getFrameEntries=function(){return 2},n.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n},n.prototype.getCurveValue=function(t){for(var e=this.frames,n=e.length-2,r=2;r<=n;r+=2)if(e[r]>t){n=r-2;break}var i=this.curves[n>>1];switch(i){case 0:var a=e[n],s=e[n+1];return s+(t-a)/(e[n+2]-a)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,i-2)},n.prototype.getRelativeValue=function(e,n,r,i,a){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}var s=this.getCurveValue(e);switch(r){case t.MixBlend.setup:return a+s*n;case t.MixBlend.first:case t.MixBlend.replace:s+=a-i}return i+s*n},n.prototype.getAbsoluteValue=function(e,n,r,i,a){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}var s=this.getCurveValue(e);return r==t.MixBlend.setup?a+(s-a)*n:i+(s-i)*n},n.prototype.getAbsoluteValue2=function(e,n,r,i,a,s){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return a;case t.MixBlend.first:return i+(a-i)*n}return i}return r==t.MixBlend.setup?a+(s-a)*n:i+(s-i)*n},n.prototype.getScaleValue=function(e,n,r,i,a,s){if(e<this.frames[0]){switch(r){case t.MixBlend.setup:return s;case t.MixBlend.first:return a+(s-a)*n}return a}var o=this.getCurveValue(e)*s;if(1==n)return r==t.MixBlend.add?a+o-s:o;if(i==t.MixDirection.mixOut)switch(r){case t.MixBlend.setup:return s+(Math.abs(o)*d.signum(s)-s)*n;case t.MixBlend.first:case t.MixBlend.replace:return a+(Math.abs(o)*d.signum(a)-a)*n}else{var h=0;switch(r){case t.MixBlend.setup:return(h=Math.abs(s)*d.signum(o))+(o-h)*n;case t.MixBlend.first:case t.MixBlend.replace:return(h=Math.abs(a)*d.signum(o))+(o-h)*n}}return a+(o-s)*n},n}(Y),P=function(t){function e(e,n,r,i){return t.call(this,e,n,[r,i])||this}return r(e,t),e.prototype.getFrameEntries=function(){return 3},e.prototype.setFrame=function(t,e,n,r){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r},e}(Y),X=function(t){function e(e,n,r){var i=t.call(this,e,n,F.rotate+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(n,i,a,o.rotation,o.data.rotation))},e}(R),V=function(e){function n(t,n,r){var i=e.call(this,t,n,F.x+"|"+r,F.y+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.x=h.data.x,void(h.y=h.data.y);case t.MixBlend.first:h.x+=(h.data.x-h.x)*a,h.y+=(h.data.y-h.y)*a}else{var c=0,u=0,d=B.search(l,r,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+3]-p);c+=(l[d+3+1]-c)*m,u+=(l[d+3+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}switch(s){case t.MixBlend.setup:h.x=h.data.x+c*a,h.y=h.data.y+u*a;break;case t.MixBlend.first:case t.MixBlend.replace:h.x+=(h.data.x+c-h.x)*a,h.y+=(h.data.y+u-h.y)*a;break;case t.MixBlend.add:h.x+=c*a,h.y+=u*a}}}},n}(P),D=function(t){function e(e,n,r){var i=t.call(this,e,n,F.x+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(n,i,a,o.x,o.data.x))},e}(R),L=function(t){function e(e,n,r){var i=t.call(this,e,n,F.y+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(n,i,a,o.y,o.data.y))},e}(R),N=function(e){function n(t,n,r){var i=e.call(this,t,n,F.scaleX+"|"+r,F.scaleY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.scaleX=h.data.scaleX,void(h.scaleY=h.data.scaleY);case t.MixBlend.first:h.scaleX+=(h.data.scaleX-h.scaleX)*a,h.scaleY+=(h.data.scaleY-h.scaleY)*a}else{var c,u,f=B.search(l,r,3),p=this.curves[f/3];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2];var g=(r-m)/(l[f+3]-m);c+=(l[f+3+1]-c)*g,u+=(l[f+3+2]-u)*g;break;case 1:c=l[f+1],u=l[f+2];break;default:c=this.getBezierValue(r,f,1,p-2),u=this.getBezierValue(r,f,2,p+18-2)}if(c*=h.data.scaleX,u*=h.data.scaleY,1==a)s==t.MixBlend.add?(h.scaleX+=c-h.data.scaleX,h.scaleY+=u-h.data.scaleY):(h.scaleX=c,h.scaleY=u);else{var v=0,y=0;if(o==t.MixDirection.mixOut)switch(s){case t.MixBlend.setup:v=h.data.scaleX,y=h.data.scaleY,h.scaleX=v+(Math.abs(c)*d.signum(v)-v)*a,h.scaleY=y+(Math.abs(u)*d.signum(y)-y)*a;break;case t.MixBlend.first:case t.MixBlend.replace:v=h.scaleX,y=h.scaleY,h.scaleX=v+(Math.abs(c)*d.signum(v)-v)*a,h.scaleY=y+(Math.abs(u)*d.signum(y)-y)*a;break;case t.MixBlend.add:h.scaleX+=(c-h.data.scaleX)*a,h.scaleY+=(u-h.data.scaleY)*a}else switch(s){case t.MixBlend.setup:v=Math.abs(h.data.scaleX)*d.signum(c),y=Math.abs(h.data.scaleY)*d.signum(u),h.scaleX=v+(c-v)*a,h.scaleY=y+(u-y)*a;break;case t.MixBlend.first:case t.MixBlend.replace:v=Math.abs(h.scaleX)*d.signum(c),y=Math.abs(h.scaleY)*d.signum(u),h.scaleX=v+(c-v)*a,h.scaleY=y+(u-y)*a;break;case t.MixBlend.add:h.scaleX+=(c-h.data.scaleX)*a,h.scaleY+=(u-h.data.scaleY)*a}}}}},n}(P),O=function(t){function e(e,n,r){var i=t.call(this,e,n,F.scaleX+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(n,i,a,s,o.scaleX,o.data.scaleX))},e}(R),_=function(t){function e(e,n,r){var i=t.call(this,e,n,F.scaleY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(n,i,a,s,o.scaleX,o.data.scaleY))},e}(R),q=function(e){function n(t,n,r){var i=e.call(this,t,n,F.shearX+"|"+r,F.shearY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.shearX=h.data.shearX,void(h.shearY=h.data.shearY);case t.MixBlend.first:h.shearX+=(h.data.shearX-h.shearX)*a,h.shearY+=(h.data.shearY-h.shearY)*a}else{var c=0,u=0,d=B.search(l,r,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+3]-p);c+=(l[d+3+1]-c)*m,u+=(l[d+3+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}switch(s){case t.MixBlend.setup:h.shearX=h.data.shearX+c*a,h.shearY=h.data.shearY+u*a;break;case t.MixBlend.first:case t.MixBlend.replace:h.shearX+=(h.data.shearX+c-h.shearX)*a,h.shearY+=(h.data.shearY+u-h.shearY)*a;break;case t.MixBlend.add:h.shearX+=c*a,h.shearY+=u*a}}}},n}(P),U=function(t){function e(e,n,r){var i=t.call(this,e,n,F.shearX+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(n,i,a,o.shearX,o.data.shearX))},e}(R),W=function(t){function e(e,n,r){var i=t.call(this,e,n,F.shearY+"|"+r)||this;return i.boneIndex=0,i.boneIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(n,i,a,o.shearX,o.data.shearY))},e}(R),z=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.alpha+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 5},n.prototype.setFrame=function(t,e,n,r,i,a){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(r<l[0]){var u=h.data.color;switch(s){case t.MixBlend.setup:return void c.setFromColor(u);case t.MixBlend.first:c.add((u.r-c.r)*a,(u.g-c.g)*a,(u.b-c.b)*a,(u.a-c.a)*a)}}else{var d=0,f=0,p=0,m=0,g=B.search(l,r,5),v=this.curves[g/5];switch(v){case 0:var y=l[g];d=l[g+1],f=l[g+2],p=l[g+3],m=l[g+4];var x=(r-y)/(l[g+5]-y);d+=(l[g+5+1]-d)*x,f+=(l[g+5+2]-f)*x,p+=(l[g+5+3]-p)*x,m+=(l[g+5+4]-m)*x;break;case 1:d=l[g+1],f=l[g+2],p=l[g+3],m=l[g+4];break;default:d=this.getBezierValue(r,g,1,v-2),f=this.getBezierValue(r,g,2,v+18-2),p=this.getBezierValue(r,g,3,v+36-2),m=this.getBezierValue(r,g,4,v+54-2)}1==a?c.set(d,f,p,m):(s==t.MixBlend.setup&&c.setFromColor(h.data.color),c.add((d-c.r)*a,(f-c.g)*a,(p-c.b)*a,(m-c.a)*a))}}},n}(Y),G=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,r,i){t<<=2,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(r<l[0]){var u=h.data.color;switch(s){case t.MixBlend.setup:return c.r=u.r,c.g=u.g,void(c.b=u.b);case t.MixBlend.first:c.r+=(u.r-c.r)*a,c.g+=(u.g-c.g)*a,c.b+=(u.b-c.b)*a}}else{var d=0,f=0,p=0,m=B.search(l,r,4),g=this.curves[m>>2];switch(g){case 0:var v=l[m];d=l[m+1],f=l[m+2],p=l[m+3];var y=(r-v)/(l[m+4]-v);d+=(l[m+4+1]-d)*y,f+=(l[m+4+2]-f)*y,p+=(l[m+4+3]-p)*y;break;case 1:d=l[m+1],f=l[m+2],p=l[m+3];break;default:d=this.getBezierValue(r,m,1,g-2),f=this.getBezierValue(r,m,2,g+18-2),p=this.getBezierValue(r,m,3,g+36-2)}if(1==a)c.r=d,c.g=f,c.b=p;else{if(s==t.MixBlend.setup){var x=h.data.color;c.r=x.r,c.g=x.g,c.b=x.b}c.r+=(d-c.r)*a,c.g+=(f-c.g)*a,c.b+=(p-c.b)*a}}}},n}(Y),H=function(e){function n(t,n,r){var i=e.call(this,t,n,F.alpha+"|"+r)||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.color;if(r<this.frames[0]){var c=h.data.color;switch(s){case t.MixBlend.setup:return void(l.a=c.a);case t.MixBlend.first:l.a+=(c.a-l.a)*a}}else{var u=this.getCurveValue(r);1==a?l.a=u:(s==t.MixBlend.setup&&(l.a=h.data.color.a),l.a+=(u-l.a)*a)}}},n}(R),j=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.alpha+"|"+r,F.rgb2+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 8},n.prototype.setFrame=function(t,e,n,r,i,a,s,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o,this.frames[t+7]=h},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(r<l[0]){var d=h.data.color,f=h.data.darkColor;switch(s){case t.MixBlend.setup:return c.setFromColor(d),u.r=f.r,u.g=f.g,void(u.b=f.b);case t.MixBlend.first:c.add((d.r-c.r)*a,(d.g-c.g)*a,(d.b-c.b)*a,(d.a-c.a)*a),u.r+=(f.r-u.r)*a,u.g+=(f.g-u.g)*a,u.b+=(f.b-u.b)*a}}else{var p=0,m=0,g=0,v=0,y=0,x=0,w=0,b=B.search(l,r,8),M=this.curves[b>>3];switch(M){case 0:var S=l[b];p=l[b+1],m=l[b+2],g=l[b+3],v=l[b+4],y=l[b+5],x=l[b+6],w=l[b+7];var k=(r-S)/(l[b+8]-S);p+=(l[b+8+1]-p)*k,m+=(l[b+8+2]-m)*k,g+=(l[b+8+3]-g)*k,v+=(l[b+8+4]-v)*k,y+=(l[b+8+5]-y)*k,x+=(l[b+8+6]-x)*k,w+=(l[b+8+7]-w)*k;break;case 1:p=l[b+1],m=l[b+2],g=l[b+3],v=l[b+4],y=l[b+5],x=l[b+6],w=l[b+7];break;default:p=this.getBezierValue(r,b,1,M-2),m=this.getBezierValue(r,b,2,M+18-2),g=this.getBezierValue(r,b,3,M+36-2),v=this.getBezierValue(r,b,4,M+54-2),y=this.getBezierValue(r,b,5,M+72-2),x=this.getBezierValue(r,b,6,M+90-2),w=this.getBezierValue(r,b,7,M+108-2)}if(1==a)c.set(p,m,g,v),u.r=y,u.g=x,u.b=w;else{if(s==t.MixBlend.setup){c.setFromColor(h.data.color);f=h.data.darkColor;u.r=f.r,u.g=f.g,u.b=f.b}c.add((p-c.r)*a,(m-c.g)*a,(g-c.b)*a,(v-c.a)*a),u.r+=(y-u.r)*a,u.g+=(x-u.g)*a,u.b+=(w-u.b)*a}}}},n}(Y),J=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.rgb+"|"+r,F.rgb2+"|"+r])||this;return i.slotIndex=0,i.slotIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,r,i,a,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(r<l[0]){var d=h.data.color,f=h.data.darkColor;switch(s){case t.MixBlend.setup:return c.r=d.r,c.g=d.g,c.b=d.b,u.r=f.r,u.g=f.g,void(u.b=f.b);case t.MixBlend.first:c.r+=(d.r-c.r)*a,c.g+=(d.g-c.g)*a,c.b+=(d.b-c.b)*a,u.r+=(f.r-u.r)*a,u.g+=(f.g-u.g)*a,u.b+=(f.b-u.b)*a}}else{var p=0,m=0,g=0,v=0,y=0,x=0,w=B.search(l,r,7),b=this.curves[w/7];switch(b){case 0:var M=l[w];p=l[w+1],m=l[w+2],g=l[w+3],v=l[w+4],y=l[w+5],x=l[w+6];var S=(r-M)/(l[w+7]-M);p+=(l[w+7+1]-p)*S,m+=(l[w+7+2]-m)*S,g+=(l[w+7+3]-g)*S,v+=(l[w+7+4]-v)*S,y+=(l[w+7+5]-y)*S,x+=(l[w+7+6]-x)*S;break;case 1:p=l[w+1],m=l[w+2],g=l[w+3],v=l[w+4],y=l[w+5],x=l[w+6];break;default:p=this.getBezierValue(r,w,1,b-2),m=this.getBezierValue(r,w,2,b+18-2),g=this.getBezierValue(r,w,3,b+36-2),v=this.getBezierValue(r,w,4,b+54-2),y=this.getBezierValue(r,w,5,b+72-2),x=this.getBezierValue(r,w,6,b+90-2)}if(1==a)c.r=p,c.g=m,c.b=g,u.r=v,u.g=y,u.b=x;else{if(s==t.MixBlend.setup){d=h.data.color,f=h.data.darkColor;c.r=d.r,c.g=d.g,c.b=d.b,u.r=f.r,u.g=f.g,u.b=f.b}c.r+=(p-c.r)*a,c.g+=(m-c.g)*a,c.b+=(g-c.b)*a,u.r+=(v-u.r)*a,u.g+=(y-u.g)*a,u.b+=(x-u.b)*a}}}},n}(Y),K=function(e){function n(t,n){var r=e.call(this,t,[F.attachment+"|"+n])||this;return r.slotIndex=0,r.slotIndex=n,r.attachmentNames=new Array(t),r}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];h.bone.active&&(o!=t.MixDirection.mixOut?r<this.frames[0]?s!=t.MixBlend.setup&&s!=t.MixBlend.first||this.setAttachment(e,h,h.data.attachmentName):this.setAttachment(e,h,this.attachmentNames[B.search1(this.frames,r)]):s==t.MixBlend.setup&&this.setAttachment(e,h,h.data.attachmentName))},n.prototype.setAttachment=function(t,e,n){e.setAttachment(n?t.getAttachment(this.slotIndex,n):null)},n}(B),Q=function(e){function n(t,n,r,i){var a=e.call(this,t,n,[F.deform+"|"+r+"|"+i.id])||this;return a.slotIndex=0,a.slotIndex=r,a.attachment=i,a.vertices=new Array(t),a}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.vertices[t]=n},n.prototype.setBezier=function(t,e,n,r,i,a,s,o,h,l,c){var u=this.curves,d=this.getFrameCount()+18*t;0==n&&(u[e]=2+d);for(var f=.03*(r-2*a+o),p=.03*h-.06*s,m=.006*(3*(a-o)-r+l),g=.018*(s-h+.33333333),v=2*f+m,y=2*p+g,x=.3*(a-r)+f+.16666667*m,w=.3*s+p+.16666667*g,b=r+x,M=w,S=d+18;d<S;d+=2)u[d]=b,u[d+1]=M,x+=v,w+=y,v+=m,y+=g,b+=x,M+=w},n.prototype.getCurvePercent=function(t,e){var n=this.curves,r=n[e];switch(r){case 0:var i=this.frames[e];return(t-i)/(this.frames[e+this.getFrameEntries()]-i);case 1:return 0}if(n[r-=2]>t){var a=this.frames[e];return n[r+1]*(t-a)/(n[r]-a)}var s=r+18;for(r+=2;r<s;r+=2)if(n[r]>=t){var o=n[r-2],h=n[r-1];return h+(t-o)/(n[r]-o)*(n[r+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.getAttachment();if(l&&l instanceof S&&l.timelineAttachment==this.attachment){var c=h.deform;0==c.length&&(s=t.MixBlend.setup);var u=this.vertices,d=u[0].length,f=this.frames;if(r<f[0])switch(s){case t.MixBlend.setup:return void(c.length=0);case t.MixBlend.first:if(1==a)return void(c.length=0);if(c.length=d,(q=l).bones){a=1-a;for(m=0;m<d;m++)c[m]*=a}else for(var p=q.vertices,m=0;m<d;m++)c[m]+=(p[m]-c[m])*a}else if(c.length=d,r>=f[f.length-1]){var v=u[f.length-1];if(1==a)if(s==t.MixBlend.add)if((q=l).bones)for(var y=0;y<d;y++)c[y]+=v[y];else{p=q.vertices;for(var x=0;x<d;x++)c[x]+=v[x]-p[x]}else g.arrayCopy(v,0,c,0,d);else switch(s){case t.MixBlend.setup:var w=l;if(w.bones)for(var b=0;b<d;b++)c[b]=v[b]*a;else{p=w.vertices;for(var M=0;M<d;M++){var k=p[M];c[M]=k+(v[M]-k)*a}}break;case t.MixBlend.first:case t.MixBlend.replace:for(var A=0;A<d;A++)c[A]+=(v[A]-c[A])*a;break;case t.MixBlend.add:if((q=l).bones)for(var I=0;I<d;I++)c[I]+=v[I]*a;else{p=q.vertices;for(var T=0;T<d;T++)c[T]+=(v[T]-p[T])*a}}}else{var C=B.search1(f,r),E=this.getCurvePercent(r,C),F=u[C],Y=u[C+1];if(1==a)if(s==t.MixBlend.add)if((q=l).bones)for(var R=0;R<d;R++){X=F[R];c[R]+=X+(Y[R]-X)*E}else{p=q.vertices;for(var P=0;P<d;P++){var X=F[P];c[P]+=X+(Y[P]-X)*E-p[P]}}else for(var V=0;V<d;V++){X=F[V];c[V]=X+(Y[V]-X)*E}else switch(s){case t.MixBlend.setup:var D=l;if(D.bones)for(var L=0;L<d;L++){X=F[L];c[L]=(X+(Y[L]-X)*E)*a}else{p=D.vertices;for(var N=0;N<d;N++){var X=F[N],O=p[N];c[N]=O+(X+(Y[N]-X)*E-O)*a}}break;case t.MixBlend.first:case t.MixBlend.replace:for(var _=0;_<d;_++){X=F[_];c[_]+=(X+(Y[_]-X)*E-c[_])*a}break;case t.MixBlend.add:var q;if((q=l).bones)for(var U=0;U<d;U++){X=F[U];c[U]+=(X+(Y[U]-X)*E)*a}else{p=q.vertices;for(var W=0;W<d;W++){X=F[W];c[W]+=(X+(Y[W]-X)*E-p[W])*a}}}}}}},n}(Y),Z=function(t){function e(n){var r=t.call(this,n,e.propertyIds)||this;return r.events=new Array(n),r}return r(e,t),e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,n,r,i,a,s){if(r){var o=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,i,a,s),e=-1;else if(e>=o[h-1])return;if(!(n<o[0])){var l=0;if(e<o[0])l=0;else for(var c=o[l=B.search1(o,e)+1];l>0&&o[l-1]==c;)l--;for(;l<h&&n>=o[l];l++)r.push(this.events[l])}}},e.propertyIds=[""+F.event],e}(B),$=function(e){function n(t){var r=e.call(this,t,n.propertyIds)||this;return r.drawOrders=new Array(t),r}return r(n,e),n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},n.prototype.apply=function(e,n,r,i,a,s,o){if(o!=t.MixDirection.mixOut)if(r<this.frames[0])s!=t.MixBlend.setup&&s!=t.MixBlend.first||g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{var h=B.search1(this.frames,r),l=this.drawOrders[h];if(l)for(var c=e.drawOrder,u=e.slots,d=0,f=l.length;d<f;d++)c[d]=u[l[d]];else g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length)}else s==t.MixBlend.setup&&g.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length)},n.propertyIds=[""+F.drawOrder],n}(B),tt=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.ikConstraint+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 6},n.prototype.setFrame=function(t,e,n,r,i,a,s){t*=6,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=a?1:0,this.frames[t+5]=s?1:0},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.ikConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case t.MixBlend.first:h.mix+=(h.data.mix-h.mix)*a,h.softness+=(h.data.softness-h.softness)*a,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}else{var c=0,u=0,d=B.search(l,r,6),f=this.curves[d/6];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(r-p)/(l[d+6]-p);c+=(l[d+6+1]-c)*m,u+=(l[d+6+2]-u)*m;break;case 1:c=l[d+1],u=l[d+2];break;default:c=this.getBezierValue(r,d,1,f-2),u=this.getBezierValue(r,d,2,f+18-2)}s==t.MixBlend.setup?(h.mix=h.data.mix+(c-h.data.mix)*a,h.softness=h.data.softness+(u-h.data.softness)*a,o==t.MixDirection.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[d+3],h.compress=0!=l[d+4],h.stretch=0!=l[d+5])):(h.mix+=(c-h.mix)*a,h.softness+=(u-h.softness)*a,o==t.MixDirection.mixIn&&(h.bendDirection=l[d+3],h.compress=0!=l[d+4],h.stretch=0!=l[d+5]))}}},n}(Y),et=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.transformConstraint+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,r,i,a,s,o){var h=this.frames;h[t*=7]=e,h[t+1]=n,h[t+2]=r,h[t+3]=i,h[t+4]=a,h[t+5]=s,h[t+6]=o},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.transformConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0]){var c=h.data;switch(s){case t.MixBlend.setup:return h.mixRotate=c.mixRotate,h.mixX=c.mixX,h.mixY=c.mixY,h.mixScaleX=c.mixScaleX,h.mixScaleY=c.mixScaleY,void(h.mixShearY=c.mixShearY);case t.MixBlend.first:h.mixRotate+=(c.mixRotate-h.mixRotate)*a,h.mixX+=(c.mixX-h.mixX)*a,h.mixY+=(c.mixY-h.mixY)*a,h.mixScaleX+=(c.mixScaleX-h.mixScaleX)*a,h.mixScaleY+=(c.mixScaleY-h.mixScaleY)*a,h.mixShearY+=(c.mixShearY-h.mixShearY)*a}}else{var u,d,f,p,m,g,v=B.search(l,r,7),y=this.curves[v/7];switch(y){case 0:var x=l[v];u=l[v+1],d=l[v+2],f=l[v+3],p=l[v+4],m=l[v+5],g=l[v+6];var w=(r-x)/(l[v+7]-x);u+=(l[v+7+1]-u)*w,d+=(l[v+7+2]-d)*w,f+=(l[v+7+3]-f)*w,p+=(l[v+7+4]-p)*w,m+=(l[v+7+5]-m)*w,g+=(l[v+7+6]-g)*w;break;case 1:u=l[v+1],d=l[v+2],f=l[v+3],p=l[v+4],m=l[v+5],g=l[v+6];break;default:u=this.getBezierValue(r,v,1,y-2),d=this.getBezierValue(r,v,2,y+18-2),f=this.getBezierValue(r,v,3,y+36-2),p=this.getBezierValue(r,v,4,y+54-2),m=this.getBezierValue(r,v,5,y+72-2),g=this.getBezierValue(r,v,6,y+90-2)}if(s==t.MixBlend.setup){c=h.data;h.mixRotate=c.mixRotate+(u-c.mixRotate)*a,h.mixX=c.mixX+(d-c.mixX)*a,h.mixY=c.mixY+(f-c.mixY)*a,h.mixScaleX=c.mixScaleX+(p-c.mixScaleX)*a,h.mixScaleY=c.mixScaleY+(m-c.mixScaleY)*a,h.mixShearY=c.mixShearY+(g-c.mixShearY)*a}else h.mixRotate+=(u-h.mixRotate)*a,h.mixX+=(d-h.mixX)*a,h.mixY+=(f-h.mixY)*a,h.mixScaleX+=(p-h.mixScaleX)*a,h.mixScaleY+=(m-h.mixScaleY)*a,h.mixShearY+=(g-h.mixShearY)*a}}},n}(Y),nt=function(t){function e(e,n,r){var i=t.call(this,e,n,F.pathConstraintPosition+"|"+r)||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(n,i,a,o.position,o.data.position))},e}(R),rt=function(t){function e(e,n,r){var i=t.call(this,e,n,F.pathConstraintSpacing+"|"+r)||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(n,i,a,o.spacing,o.data.spacing))},e}(R),it=function(e){function n(t,n,r){var i=e.call(this,t,n,[F.pathConstraintMix+"|"+r])||this;return i.constraintIndex=0,i.constraintIndex=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,r,i){var a=this.frames;a[t<<=2]=e,a[t+1]=n,a[t+2]=r,a[t+3]=i},n.prototype.apply=function(e,n,r,i,a,s,o){var h=e.pathConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(r<l[0])switch(s){case t.MixBlend.setup:return h.mixRotate=h.data.mixRotate,h.mixX=h.data.mixX,void(h.mixY=h.data.mixY);case t.MixBlend.first:h.mixRotate+=(h.data.mixRotate-h.mixRotate)*a,h.mixX+=(h.data.mixX-h.mixX)*a,h.mixY+=(h.data.mixY-h.mixY)*a}else{var c,u,d,f=B.search(l,r,4),p=this.curves[f>>2];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2],d=l[f+3];var g=(r-m)/(l[f+4]-m);c+=(l[f+4+1]-c)*g,u+=(l[f+4+2]-u)*g,d+=(l[f+4+3]-d)*g;break;case 1:c=l[f+1],u=l[f+2],d=l[f+3];break;default:c=this.getBezierValue(r,f,1,p-2),u=this.getBezierValue(r,f,2,p+18-2),d=this.getBezierValue(r,f,3,p+36-2)}if(s==t.MixBlend.setup){var v=h.data;h.mixRotate=v.mixRotate+(c-v.mixRotate)*a,h.mixX=v.mixX+(u-v.mixX)*a,h.mixY=v.mixY+(d-v.mixY)*a}else h.mixRotate+=(c-h.mixRotate)*a,h.mixX+=(u-h.mixX)*a,h.mixY+=(d-h.mixY)*a}}},n}(Y),at=function(t){function e(e,n,r,i){var a=t.call(this,e,n,i+"|"+r)||this;return a.constraintIndex=0,a.constraintIndex=r,a}return r(e,t),e.prototype.apply=function(t,e,n,r,i,a,o){var h,l,c;if(-1==this.constraintIndex){var u=n>=this.frames[0]?this.getCurveValue(n):0;try{for(var d=s(t.physicsConstraints),f=d.next();!f.done;f=d.next()){var p=f.value;p.active&&this.global(p.data)&&this.set(p,this.getAbsoluteValue2(n,i,a,this.get(p),this.setup(p),u))}}catch(t){h={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(h)throw h.error}}}else(c=t.physicsConstraints[this.constraintIndex]).active&&this.set(c,this.getAbsoluteValue(n,i,a,this.get(c),this.setup(c)))},e}(R),st=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintInertia)||this}return r(e,t),e.prototype.setup=function(t){return t.data.inertia},e.prototype.get=function(t){return t.inertia},e.prototype.set=function(t,e){t.inertia=e},e.prototype.global=function(t){return t.inertiaGlobal},e}(at),ot=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintStrength)||this}return r(e,t),e.prototype.setup=function(t){return t.data.strength},e.prototype.get=function(t){return t.strength},e.prototype.set=function(t,e){t.strength=e},e.prototype.global=function(t){return t.strengthGlobal},e}(at),ht=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintDamping)||this}return r(e,t),e.prototype.setup=function(t){return t.data.damping},e.prototype.get=function(t){return t.damping},e.prototype.set=function(t,e){t.damping=e},e.prototype.global=function(t){return t.dampingGlobal},e}(at),lt=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintMass)||this}return r(e,t),e.prototype.setup=function(t){return 1/t.data.massInverse},e.prototype.get=function(t){return 1/t.massInverse},e.prototype.set=function(t,e){t.massInverse=1/e},e.prototype.global=function(t){return t.massGlobal},e}(at),ct=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintWind)||this}return r(e,t),e.prototype.setup=function(t){return t.data.wind},e.prototype.get=function(t){return t.wind},e.prototype.set=function(t,e){t.wind=e},e.prototype.global=function(t){return t.windGlobal},e}(at),ut=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintGravity)||this}return r(e,t),e.prototype.setup=function(t){return t.data.gravity},e.prototype.get=function(t){return t.gravity},e.prototype.set=function(t,e){t.gravity=e},e.prototype.global=function(t){return t.gravityGlobal},e}(at),dt=function(t){function e(e,n,r){return t.call(this,e,n,r,F.physicsConstraintMix)||this}return r(e,t),e.prototype.setup=function(t){return t.data.mix},e.prototype.get=function(t){return t.mix},e.prototype.set=function(t,e){t.mix=e},e.prototype.global=function(t){return t.mixGlobal},e}(at),ft=function(t){function e(n,r){var i=t.call(this,n,e.propertyIds)||this;return i.constraintIndex=r,i}return r(e,t),e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e},e.prototype.apply=function(t,e,n,r,i,a,o){var h,l,c;if(-1==this.constraintIndex||(c=t.physicsConstraints[this.constraintIndex]).active){var u=this.frames;if(e>n)this.apply(t,e,Number.MAX_VALUE,[],i,a,o),e=-1;else if(e>=u[u.length-1])return;if(!(n<u[0])&&(e<u[0]||n>=u[B.search1(u,e)+1]))if(null!=c)c.reset();else try{for(var d=s(t.physicsConstraints),f=d.next();!f.done;f=d.next()){var p=f.value;p.active&&p.reset()}}catch(t){h={error:t}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(h)throw h.error}}}},e.propertyIds=[F.physicsConstraintReset.toString()],e}(B),pt=function(e){function n(t,n,r){var i=e.call(this,t,[F.sequence+"|"+n+"|"+r.sequence.id])||this;return i.slotIndex=n,i.attachment=r,i}return r(n,e),n.prototype.getFrameEntries=function(){return n.ENTRIES},n.prototype.getSlotIndex=function(){return this.slotIndex},n.prototype.getAttachment=function(){return this.attachment},n.prototype.setFrame=function(t,e,r,i,a){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=r|i<<4,s[t+n.DELAY]=a},n.prototype.apply=function(e,r,i,a,s,o,l){var c=e.slots[this.slotIndex];if(c.bone.active){var u=c.attachment,d=this.attachment;if(u==d||u instanceof S&&u.timelineAttachment==d){var f=this.frames;if(i<f[0])o!=t.MixBlend.setup&&o!=t.MixBlend.first||(c.sequenceIndex=-1);else{var p=B.search(f,i,n.ENTRIES),m=f[p],g=f[p+n.MODE],v=f[p+n.DELAY];if(this.attachment.sequence){var y=g>>4,x=this.attachment.sequence.regions.length,w=T[15&g];if(w!=h.hold)switch(y+=(i-m)/v+1e-5|0,w){case h.once:y=Math.min(x-1,y);break;case h.loop:y%=x;break;case h.pingpong:(y=0==(b=(x<<1)-2)?0:y%b)>=x&&(y=b-y);break;case h.onceReverse:y=Math.max(x-1-y,0);break;case h.loopReverse:y=x-1-y%x;break;case h.pingpongReverse:var b;(y=0==(b=(x<<1)-2)?0:(y+x-1)%b)>=x&&(y=b-y)}c.sequenceIndex=y}}}}},n.ENTRIES=3,n.MODE=1,n.DELAY=2,n}(B),mt=function(){function e(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new vt(this),this.propertyIDs=new c,this.animationsChanged=!1,this.trackEntryPool=new y((function(){return new gt})),this.data=t}return e.emptyAnimation=function(){return e._emptyAnimation},e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n<r;n++){var i=e[n];if(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(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(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&!i.mixingFrom){e[n]=null,this.queue.end(i),this.clearNext(i);continue}if(i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(!n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var n=this.events,r=this.tracks,i=!1,a=0,s=r.length;a<s;a++){var o=r[a];if(o&&!(o.delay>0)){i=!0;var h=0==a?t.MixBlend.first:o.mixBlend,l=o.alpha;o.mixingFrom?l*=this.applyMixingFrom(o,e,h):o.trackTime>=o.trackEnd&&!o.next&&(l=0);var c=l>=o.alphaAttachmentThreshold,u=o.animationLast,d=o.getAnimationTime(),f=d,p=n;o.reverse&&(f=o.animation.duration-f,p=null);var m=o.animation.timelines,v=m.length;if(0==a&&1==l||h==t.MixBlend.add){0==a&&(c=!0);for(var y=0;y<v;y++){g.webkit602BugfixHelper(l,h);var x=m[y];x instanceof K?this.applyAttachmentTimeline(x,e,f,h,c):x.apply(e,u,f,p,l,h,t.MixDirection.mixIn)}}else{var w=o.timelineMode,b=o.shortestRotation,M=!b&&o.timelinesRotation.length!=v<<1;M&&(o.timelinesRotation.length=v<<1);for(y=0;y<v;y++){var S=m[y],k=w[y]==bt?h:t.MixBlend.setup;!b&&S instanceof X?this.applyRotateTimeline(S,e,f,l,k,o.timelinesRotation,y<<1,M):S instanceof K?this.applyAttachmentTimeline(S,e,f,h,c):(g.webkit602BugfixHelper(l,h),S.apply(e,u,f,p,l,k,t.MixDirection.mixIn))}}this.queueEvents(o,d),n.length=0,o.nextAnimationLast=d,o.nextTrackLast=o.trackTime}}for(var A=this.unkeyedState+It,I=e.slots,T=0,C=e.slots.length;T<C;T++){var E=I[T];if(E.attachmentState==A){var F=E.data.attachmentName;E.setAttachment(F?e.getAttachment(E.data.index,F):null)}}return this.unkeyedState+=2,this.queue.drain(),i},e.prototype.applyMixingFrom=function(e,n,r){var i=e.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,n,r);var a=0;0==e.mixDuration?(a=1,r==t.MixBlend.first&&(r=t.MixBlend.setup)):((a=e.mixTime/e.mixDuration)>1&&(a=1),r!=t.MixBlend.first&&(r=i.mixBlend));var s=a<i.mixAttachmentThreshold,o=a<i.mixDrawOrderThreshold,h=i.animation.timelines,l=h.length,c=i.alpha*e.interruptAlpha,u=c*(1-a),d=i.animationLast,f=i.getAnimationTime(),p=f,m=null;if(i.reverse?p=i.animation.duration-p:a<i.eventThreshold&&(m=this.events),r==t.MixBlend.add)for(var v=0;v<l;v++)h[v].apply(n,d,p,m,u,r,t.MixDirection.mixOut);else{var y=i.timelineMode,x=i.timelineHoldMix,w=i.shortestRotation,b=!w&&i.timelinesRotation.length!=l<<1;b&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(v=0;v<l;v++){var M=h[v],S=t.MixDirection.mixOut,k=void 0,A=0;switch(y[v]){case bt:if(!o&&M instanceof $)continue;k=r,A=u;break;case Mt:k=t.MixBlend.setup,A=u;break;case St:k=r,A=c;break;case kt:k=t.MixBlend.setup,A=c;break;default:k=t.MixBlend.setup;var I=x[v];A=c*Math.max(0,1-I.mixTime/I.mixDuration)}i.totalAlpha+=A,!w&&M instanceof X?this.applyRotateTimeline(M,n,p,A,k,i.timelinesRotation,v<<1,b):M instanceof K?this.applyAttachmentTimeline(M,n,p,k,s&&A>=i.alphaAttachmentThreshold):(g.webkit602BugfixHelper(A,r),o&&M instanceof $&&k==t.MixBlend.setup&&(S=t.MixDirection.mixIn),M.apply(n,d,p,m,A,k,S))}}return e.mixDuration>0&&this.queueEvents(i,f),this.events.length=0,i.nextAnimationLast=f,i.nextTrackLast=i.trackTime,a},e.prototype.applyAttachmentTimeline=function(e,n,r,i,a){var s=n.slots[e.slotIndex];s.bone.active&&(r<e.frames[0]?i!=t.MixBlend.setup&&i!=t.MixBlend.first||this.setAttachment(n,s,s.data.attachmentName,a):this.setAttachment(n,s,e.attachmentNames[B.search1(e.frames,r)],a),s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+It))},e.prototype.setAttachment=function(t,e,n,r){e.setAttachment(n?t.getAttachment(e.data.index,n):null),r&&(e.attachmentState=this.unkeyedState+Tt)},e.prototype.applyRotateTimeline=function(e,n,r,i,a,s,o,h){if(h&&(s[o]=0),1!=i){var l=n.bones[e.boneIndex];if(l.active){var c=0,u=0;if(r<e.frames[0])switch(a){case t.MixBlend.setup:l.rotation=l.data.rotation;default:return;case t.MixBlend.first:c=l.rotation,u=l.data.rotation}else c=a==t.MixBlend.setup?l.data.rotation:l.rotation,u=l.data.rotation+e.getCurveValue(r);var f=0,p=u-c;if(0==(p-=360*Math.ceil(p/360-.5)))f=s[o];else{var m=0,g=0;h?(m=0,g=p):(m=s[o],g=s[o+1]);var v=m-m%360;f=p+v;var y=p>=0,x=m>=0;Math.abs(g)<=90&&d.signum(g)!=d.signum(p)&&(Math.abs(m-v)>180?(f+=360*d.signum(m),x=y):0!=v?f-=360*d.signum(m):x=y),x!=y&&(f+=360*d.signum(m)),s[o]=f}s[o+1]=p,l.rotation=c+f*i}}else e.apply(n,0,r,null,1,a,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,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>r||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&t.animationLast<r)&&this.queue.complete(t);o<h;o++){var c=s[o];c.time<n||this.queue.event(t,c)}},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,n=this.tracks.length;e<n;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var r=n.mixingFrom;if(!r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){void 0===n&&(n=!1);var r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(void 0===n&&(n=!1),!e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,r=!1):this.clearNext(i));var a=this.trackEntry(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=0);var i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=0),!e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(i)for(;i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);return i?(i.next=a,a.previous=i,r<=0&&(r+=i.getTrackComplete()-a.mixDuration)):(this.setCurrent(t,a,!0),this.queue.drain()),a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){void 0===n&&(n=0);var r=this.setAnimationWith(t,e.emptyAnimation(),!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=this.addAnimationWith(t,e.emptyAnimation(),!1,r);return r<=0&&(i.delay+=i.mixDuration-n),i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){void 0===t&&(t=0);var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n<r;n++){var i=this.tracks[n];i&&this.setEmptyAnimation(i.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(g.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},e.prototype.trackEntry=function(e,n,r,i){var a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=n,a.loop=r,a.holdPrevious=!1,a.reverse=!1,a.shortestRotation=!1,a.eventThreshold=0,a.alphaAttachmentThreshold=0,a.mixAttachmentThreshold=0,a.mixDrawOrderThreshold=0,a.animationStart=0,a.animationEnd=n.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.mixTime=0,a.mixDuration=i?this.data.getMix(i.animation,n):0,a.interruptAlpha=1,a.totalAlpha=0,a.mixBlend=t.MixBlend.replace,a},e.prototype.clearNext=function(t){for(var e=t.next;e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=this.tracks,n=0,r=e.length;n<r;n++){var i=e[n];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&i.mixBlend==t.MixBlend.add||this.computeHold(i),i=i.mixingTo}while(i)}}},e.prototype.computeHold=function(t){var e=t.mixingTo,n=t.animation.timelines,r=t.animation.timelines.length,i=t.timelineMode;i.length=r;var a=t.timelineHoldMix;a.length=0;var s=this.propertyIDs;if(e&&e.holdPrevious)for(var o=0;o<r;o++)i[o]=s.addAll(n[o].getPropertyIds())?kt:St;else t:for(o=0;o<r;o++){var h=n[o],l=h.getPropertyIds();if(s.addAll(l))if(!e||h instanceof K||h instanceof $||h instanceof Z||!e.animation.hasTimeline(l))i[o]=Mt;else{for(var c=e.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(t.mixDuration>0){i[o]=At,a[o]=c;continue t}break}i[o]=kt}else i[o]=bt}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e._emptyAnimation=new C("<empty>",[],0),e}(),gt=function(){function e(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.mixAttachmentThreshold=0,this.alphaAttachmentThreshold=0,this.mixDrawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this._mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return Object.defineProperty(e.prototype,"mixDuration",{get:function(){return this._mixDuration},set:function(t){this._mixDuration=t,null!=this.previous&&this.delay<=0&&(this.delay+=this.previous.getTrackComplete()-t),this.delay=this.delay},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.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)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e.prototype.getTrackComplete=function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime},e.prototype.wasApplied=function(){return-1!=this.nextTrackLast},e}(),vt=function(){function e(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return e.prototype.start=function(e){this.objects.push(t.EventType.start),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.interrupt=function(e){this.objects.push(t.EventType.interrupt),this.objects.push(e)},e.prototype.end=function(e){this.objects.push(t.EventType.end),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.dispose=function(e){this.objects.push(t.EventType.dispose),this.objects.push(e)},e.prototype.complete=function(e){this.objects.push(t.EventType.complete),this.objects.push(e)},e.prototype.event=function(e,n){this.objects.push(t.EventType.event),this.objects.push(e),this.objects.push(n)},e.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var e=this.objects,n=this.animState.listeners,r=0;r<e.length;r+=2){var i=e[r],a=e[r+1];switch(i){case t.EventType.start:a.listener&&a.listener.start&&a.listener.start(a);for(var s=0;s<n.length;s++){(h=n[s]).start&&h.start(a)}break;case t.EventType.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(s=0;s<n.length;s++){(h=n[s]).interrupt&&h.interrupt(a)}break;case t.EventType.end:a.listener&&a.listener.end&&a.listener.end(a);for(s=0;s<n.length;s++){(h=n[s]).end&&h.end(a)}case t.EventType.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(s=0;s<n.length;s++){(h=n[s]).dispose&&h.dispose(a)}this.animState.trackEntryPool.free(a);break;case t.EventType.complete:a.listener&&a.listener.complete&&a.listener.complete(a);for(s=0;s<n.length;s++){(h=n[s]).complete&&h.complete(a)}break;case t.EventType.event:var o=e[2+r++];a.listener&&a.listener.event&&a.listener.event(a,o);for(s=0;s<n.length;s++){var h;(h=n[s]).event&&h.event(a,o)}}}this.clear(),this.drainDisabled=!1}},e.prototype.clear=function(){this.objects.length=0},e}();t.EventType=void 0,(E=t.EventType||(t.EventType={}))[E.start=0]="start",E[E.interrupt=1]="interrupt",E[E.end=2]="end",E[E.dispose=3]="dispose",E[E.complete=4]="complete",E[E.event=5]="event";var yt,xt,wt=function(){function t(){}return 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){},t}(),bt=0,Mt=1,St=2,kt=3,At=4,It=1,Tt=2,Ct=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var r=this.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);var i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);this.setMixWith(r,i,n)},t.prototype.setMixWith=function(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");var r=t.name+"."+e.name;this.animationToMixTime[r]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,r=this.animationToMixTime[n];return void 0===r?this.defaultMix:r},t}(),Et=function(t){function e(e){var n=t.call(this,e)||this;return n.color=new u(1,1,1,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(S),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.endSlot=null,n.color=new u(.2275,.2275,.8078,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},e}(S),Bt=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t}();t.TextureFilter=void 0,(yt=t.TextureFilter||(t.TextureFilter={}))[yt.Nearest=9728]="Nearest",yt[yt.Linear=9729]="Linear",yt[yt.MipMap=9987]="MipMap",yt[yt.MipMapNearestNearest=9984]="MipMapNearestNearest",yt[yt.MipMapLinearNearest=9985]="MipMapLinearNearest",yt[yt.MipMapNearestLinear=9986]="MipMapNearestLinear",yt[yt.MipMapLinearLinear=9987]="MipMapLinearLinear",t.TextureWrap=void 0,(xt=t.TextureWrap||(t.TextureWrap={}))[xt.MirroredRepeat=33648]="MirroredRepeat",xt[xt.ClampToEdge=33071]="ClampToEdge",xt[xt.Repeat=10497]="Repeat";var Yt,Rt=function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0},Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(Bt),Xt=function(){function e(e){this.pages=new Array,this.regions=new Array;for(var n=new Vt(e),r=new Array(4),i={size:function(t){t.width=parseInt(r[1]),t.height=parseInt(r[2])},format:function(){},filter:function(e){e.minFilter=g.enumValue(t.TextureFilter,r[1]),e.magFilter=g.enumValue(t.TextureFilter,r[2])},repeat:function(e){-1!=r[1].indexOf("x")&&(e.uWrap=t.TextureWrap.Repeat),-1!=r[1].indexOf("y")&&(e.vWrap=t.TextureWrap.Repeat)},pma:function(t){t.pma="true"==r[1]}},a={xy:function(t){t.x=parseInt(r[1]),t.y=parseInt(r[2])},size:function(t){t.width=parseInt(r[1]),t.height=parseInt(r[2])},bounds:function(t){t.x=parseInt(r[1]),t.y=parseInt(r[2]),t.width=parseInt(r[3]),t.height=parseInt(r[4])},offset:function(t){t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2])},orig:function(t){t.originalWidth=parseInt(r[1]),t.originalHeight=parseInt(r[2])},offsets:function(t){t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2]),t.originalWidth=parseInt(r[3]),t.originalHeight=parseInt(r[4])},rotate:function(t){var e=r[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:function(t){t.index=parseInt(r[1])}},s=n.readLine();s&&0==s.trim().length;)s=n.readLine();for(;s&&0!=s.trim().length&&0!=n.readEntry(r,s);)s=n.readLine();for(var o=null,h=null,l=null;null!==s;)if(0==s.trim().length)o=null,s=n.readLine();else if(o){for(var c=new Lt(o,s);;){var u=n.readEntry(r,s=n.readLine());if(0==u)break;if(p=a[r[0]])p(c);else{h||(h=[]),l||(l=[]),h.push(r[0]);for(var d=[],f=0;f<u;f++)d.push(parseInt(r[f+1]));l.push(d)}}0==c.originalWidth&&0==c.originalHeight&&(c.originalWidth=c.width,c.originalHeight=c.height),h&&h.length>0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,90==c.degrees?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new Dt(s.trim());0!=n.readEntry(r,s=n.readLine());){var p;(p=i[r[0]])&&p(o)}this.pages.push(o)}}return e.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},e.prototype.setTextures=function(t,e){var n,r;void 0===e&&(e="");try{for(var i=s(this.pages),a=i.next();!a.done;a=i.next()){var o=a.value;o.setTexture(t.get(e+o.name))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.dispose=function(){for(var t,e=0;e<this.pages.length;e++)null===(t=this.pages[e].texture)||void 0===t||t.dispose()},e}(),Vt=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.readEntry=function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var r=1,i=n+1;;r++){var a=e.indexOf(",",i);if(-1==a)return t[r]=e.substr(i).trim(),r;if(t[r]=e.substr(i,a-i).trim(),i=a+1,4==r)return 4}},t}(),Dt=function(){function e(e){this.minFilter=t.TextureFilter.Nearest,this.magFilter=t.TextureFilter.Nearest,this.uWrap=t.TextureWrap.ClampToEdge,this.vWrap=t.TextureWrap.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}return e.prototype.setTexture=function(t){var e,n;this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);try{for(var r=s(this.regions),i=r.next();!i.done;i=r.next()){i.value.texture=t}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e}(),Lt=function(t){function e(e,n){var r=t.call(this)||this;return r.x=0,r.y=0,r.offsetX=0,r.offsetY=0,r.originalWidth=0,r.originalHeight=0,r.index=0,r.degrees=0,r.names=null,r.values=null,r.page=e,r.name=n,e.regions.push(r),r}return r(e,t),e}(Rt),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.region=null,r.regionUVs=[],r.uvs=[],r.triangles=[],r.color=new u(1,1,1,1),r.width=0,r.height=0,r.hullLength=0,r.edges=[],r.parentMesh=null,r.sequence=null,r.tempColor=new u(0,0,0,0),r.path=n,r}return r(e,t),e.prototype.updateRegion=function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=g.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,r=this.region.u,i=this.region.v,a=0,s=0;if(this.region instanceof Lt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:r-=(o.originalHeight-o.offsetY-o.height)/l,i-=(o.originalWidth-o.offsetX-o.width)/c,a=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u<n;u+=2)e[u]=r+t[u+1]*a,e[u+1]=i+(1-t[u])*s;return;case 180:r-=(o.originalWidth-o.offsetX-o.width)/l,i-=o.offsetY/c,a=o.originalWidth/l,s=o.originalHeight/c;for(u=0;u<n;u+=2)e[u]=r+(1-t[u])*a,e[u+1]=i+(1-t[u+1])*s;return;case 270:r-=o.offsetY/l,i-=o.offsetX/c,a=o.originalHeight/l,s=o.originalWidth/c;for(u=0;u<n;u+=2)e[u]=r+(1-t[u+1])*a,e[u+1]=i+t[u]*s;return}r-=o.offsetX/l,i-=(o.originalHeight-o.offsetY-o.height)/c,a=o.originalWidth/l,s=o.originalHeight/c}else this.region?(a=this.region.u2-r,s=this.region.v2-i):(r=i=0,a=s=1);for(u=0;u<n;u+=2)e[u]=r+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,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(this.parentMesh)return this.newLinkedMesh();var t=new e(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),g.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=new Array(this.uvs.length),g.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),g.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),g.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},e.prototype.computeWorldVertices=function(e,n,r,i,a,s){null!=this.sequence&&this.sequence.apply(e,this),t.prototype.computeWorldVertices.call(this,e,n,r,i,a,s)},e.prototype.newLinkedMesh=function(){var t=new e(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t},e}(S),Ot=function(t){function e(e){var n=t.call(this,e)||this;return n.lengths=[],n.closed=!1,n.constantSpeed=!1,n.color=new u(1,1,1,1),n}return r(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),g.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},e}(S),_t=function(t){function e(e){var n=t.call(this,e)||this;return n.x=0,n.y=0,n.rotation=0,n.color=new u(.38,.94,0,1),n}return r(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=this.rotation*d.degRad,n=Math.cos(e),r=Math.sin(e),i=n*t.a+r*t.b,a=n*t.c+r*t.d;return d.atan2Deg(a,i)},e.prototype.copy=function(){var t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},e}(S),qt=function(t){function e(e,n){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 u(1,1,1,1),r.region=null,r.sequence=null,r.offset=g.newFloatArray(8),r.uvs=g.newFloatArray(8),r.tempColor=new u(1,1,1,1),r.path=n,r}return r(e,t),e.prototype.updateRegion=function(){if(!this.region)throw new Error("Region not set.");var t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);var n=this.width/this.region.originalWidth*this.scaleX,r=this.height/this.region.originalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.region.offsetX*n,a=-this.height/2*this.scaleY+this.region.offsetY*r,s=i+this.region.width*n,o=a+this.region.height*r,h=this.rotation*d.degRad,l=Math.cos(h),c=Math.sin(h),u=this.x,f=this.y,p=i*l+u,m=i*c,g=a*l+f,v=a*c,y=s*l+u,x=s*c,w=o*l+f,b=o*c,M=this.offset;M[0]=p-v,M[1]=g+m,M[2]=p-b,M[3]=w+m,M[4]=y-b,M[5]=w+x,M[6]=y-v,M[7]=g+x,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},e.prototype.computeWorldVertices=function(t,e,n,r){null!=this.sequence&&this.sequence.apply(t,this);var i=t.bone,a=this.offset,s=i.worldX,o=i.worldY,h=i.a,l=i.b,c=i.c,u=i.d,d=0,f=0;d=a[0],f=a[1],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[2],f=a[3],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[4],f=a[5],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=r,d=a[6],f=a[7],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o},e.prototype.copy=function(){var t=new e(this.name,this.path);return t.region=this.region,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,g.arrayCopy(this.uvs,0,t.uvs,0,8),g.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t},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}(M),Ut=function(){function t(t){this.atlas=t}return t.prototype.loadSequence=function(t,e,n){for(var r=n.regions,i=0,a=r.length;i<a;i++){var s=n.getPath(e,i),o=this.atlas.findRegion(s);if(null==o)throw new Error("Region not found in atlas: "+s+" (sequence: "+t+")");r[i]=o}},t.prototype.newRegionAttachment=function(t,e,n,r){var i=new qt(e,n);if(null!=r)this.loadSequence(e,n,r);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");i.region=a}return i},t.prototype.newMeshAttachment=function(t,e,n,r){var i=new Nt(e,n);if(null!=r)this.loadSequence(e,n,r);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");i.region=a}return i},t.prototype.newBoundingBoxAttachment=function(t,e){return new Et(e)},t.prototype.newPathAttachment=function(t,e){return new Ot(e)},t.prototype.newPointAttachment=function(t,e){return new _t(e)},t.prototype.newClippingAttachment=function(t,e){return new Ft(e)},t}(),Wt=function(e,n,r){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=t.TransformMode.Normal,this.skinRequired=!1,this.color=new u,this.visible=!1,e<0)throw new Error("index must be >= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=r};t.TransformMode=void 0,(Yt=t.TransformMode||(t.TransformMode={}))[Yt.Normal=0]="Normal",Yt[Yt.OnlyTranslation=1]="OnlyTranslation",Yt[Yt.NoRotationOrReflection=2]="NoRotationOrReflection",Yt[Yt.NoScale=3]="NoScale",Yt[Yt.NoScaleOrReflection=4]="NoScaleOrReflection";var zt,Gt,Ht,jt=function(){function e(t,e,n){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,i,a,s,o){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=s,this.ashearY=o;var h=this.parent;if(!h){var l=this.skeleton,c=l.scaleX,u=l.scaleY,f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;return this.a=Math.cos(f)*i*c,this.b=Math.cos(p)*a*c,this.c=Math.sin(f)*i*u,this.d=Math.sin(p)*a*u,this.worldX=e*c+l.x,void(this.worldY=n*u+l.y)}var m=h.a,g=h.b,v=h.c,y=h.d;switch(this.worldX=m*e+g*n+h.worldX,this.worldY=v*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;var x=Math.cos(f)*i,w=Math.cos(p)*a,b=Math.sin(f)*i,M=Math.sin(p)*a;return this.a=m*x+g*b,this.b=m*w+g*M,this.c=v*x+y*b,void(this.d=v*w+y*M);case t.TransformMode.OnlyTranslation:f=(r+s)*d.degRad,p=(r+90+o)*d.degRad;this.a=Math.cos(f)*i,this.b=Math.cos(p)*a,this.c=Math.sin(f)*i,this.d=Math.sin(p)*a;break;case t.TransformMode.NoRotationOrReflection:var S=0;(k=m*m+v*v)>1e-4?(k=Math.abs(m*y-g*v)/k,m/=this.skeleton.scaleX,g=(v/=this.skeleton.scaleY)*k,y=m*k,S=Math.atan2(v,m)*d.radDeg):(m=0,v=0,S=90-Math.atan2(y,g)*d.radDeg);f=(r+s-S)*d.degRad,p=(r+o-S+90)*d.degRad,x=Math.cos(f)*i,w=Math.cos(p)*a,b=Math.sin(f)*i,M=Math.sin(p)*a;this.a=m*x-g*b,this.b=m*w-g*M,this.c=v*x+y*b,this.d=v*w+y*M;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:r*=d.degRad;var k,A=Math.cos(r),I=Math.sin(r),T=(m*A+g*I)/this.skeleton.scaleX,C=(v*A+y*I)/this.skeleton.scaleY;(k=Math.sqrt(T*T+C*C))>1e-5&&(k=1/k),T*=k,C*=k,k=Math.sqrt(T*T+C*C),this.data.transformMode==t.TransformMode.NoScale&&m*y-g*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(k=-k),r=Math.PI/2+Math.atan2(C,T);var E=Math.cos(r)*k,F=Math.sin(r)*k;s*=d.degRad,o=(90+o)*d.degRad;x=Math.cos(s)*i,w=Math.cos(o)*a,b=Math.sin(s)*i,M=Math.sin(o)*a;this.a=T*x+E*b,this.b=T*w+E*M,this.c=C*x+F*b,this.d=C*w+F*M}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.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},e.prototype.updateAppliedTransform=function(){var e=this.parent;if(!e)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*d.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)*d.radDeg);var n,r,i,a,s=e.a,o=e.b,h=e.c,l=e.d,c=1/(s*l-o*h),u=l*c,f=o*c,p=h*c,m=s*c,g=this.worldX-e.worldX,v=this.worldY-e.worldY;if(this.ax=g*u-v*f,this.ay=v*m-g*p,this.data.transformMode==t.TransformMode.OnlyTranslation)n=this.a,r=this.b,i=this.c,a=this.d;else{switch(this.data.transformMode){case t.TransformMode.NoRotationOrReflection:var y=Math.abs(s*l-o*h)/(s*s+h*h),x=s/this.skeleton.scaleX;o=-(h/this.skeleton.scaleY)*y*this.skeleton.scaleX,u=(l=x*y*this.skeleton.scaleY)*(c=1/(s*l-o*h)),f=o*c;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var w=d.cosDeg(this.rotation),b=d.sinDeg(this.rotation);s=(s*w+o*b)/this.skeleton.scaleX,h=(h*w+l*b)/this.skeleton.scaleY;var M=Math.sqrt(s*s+h*h);M>1e-5&&(M=1/M),s*=M,h*=M,M=Math.sqrt(s*s+h*h),this.data.transformMode==t.TransformMode.NoScale&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var S=d.PI/2+Math.atan2(h,s);o=Math.cos(S)*M,u=(l=Math.sin(S)*M)*(c=1/(s*l-o*h)),f=o*c,p=h*c,m=s*c}n=u*this.a-f*this.c,r=u*this.b-f*this.d,i=m*this.c-p*this.a,a=m*this.d-p*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(n*n+i*i),this.ascaleX>1e-4){var k=n*a-r*i;this.ascaleY=k/this.ascaleX,this.ashearY=-Math.atan2(n*r+i*a,k)*d.radDeg,this.arotation=Math.atan2(i,n)*d.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(r*r+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,r)*d.radDeg},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*d.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*d.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.worldToLocal=function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,r=t.y-this.worldY;return t.x=n*this.d*e-r*this.b*e,t.y=r*this.a*e-n*this.c*e,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToParent=function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)},e.prototype.parentToWorld=function(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)},e.prototype.worldToLocalRotation=function(t){var e=d.sinDeg(t),n=d.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*d.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var e=d.sinDeg(t),n=d.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*d.radDeg},e.prototype.rotateWorld=function(t){t*=d.degRad;var e=Math.sin(t),n=Math.cos(t),r=this.a,i=this.b;this.a=n*r-e*this.c,this.b=n*i-e*this.d,this.c=e*r+n*this.c,this.d=e*i+n*this.d},e}(),Jt=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},Kt=function(){function t(t,e,n){void 0===e&&(e=""),void 0===n&&(n=new Qt),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e,this.downloader=n}return t.prototype.start=function(t){return this.toLoad++,this.pathPrefix+t},t.prototype.success=function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)},t.prototype.error=function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)},t.prototype.loadAll=function(){var t=this;return new Promise((function(e,n){var r=function(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(r)};requestAnimationFrame(r)}))},t.prototype.setRawDataURI=function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e},t.prototype.loadBinary=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadBinary(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadText=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadText(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load text ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadJson=function(t,e,n){var r=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadJson(t,(function(n){r.success(e,t,n)}),(function(e,i){r.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(e,", ").concat(i))}))},t.prototype.loadTexture=function(t,e,n){var r=this;if(void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(e){return e.ok?e.blob():(r.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&r.success(e,t,r.textureLoader(n))}));else{var i=new Image;i.crossOrigin="anonymous",i.onload=function(){r.success(e,t,r.textureLoader(i))},i.onerror=function(){r.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),i.src=t}},t.prototype.loadTextureAtlas=function(t,e,n,r){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){});var a=t.lastIndexOf("/"),o=a>=0?t.substring(0,a+1):"";t=this.start(t),this.downloader.downloadText(t,(function(a){var h,l;try{var c=new Xt(a),u=c.pages.length,d=!1,f=function(a){i.loadTexture(r?r[a.name]:o+a.name,(function(n,r){d||(a.setTexture(r),0==--u&&i.success(e,t,c))}),(function(e,r){d||i.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(e)),d=!0}))};try{for(var p=s(c.pages),m=p.next();!m.done;m=p.next()){f(m.value)}}catch(t){h={error:t}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(h)throw h.error}}}catch(e){i.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(e.message))}}),(function(e,r){i.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.get=function(t){return this.assets[this.pathPrefix+t]},t.prototype.require=function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))},t.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e},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}(),Qt=function(){function t(){this.callbacks={},this.rawDataUris={}}return t.prototype.dataUriToString=function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)},t.prototype.base64ToUint8Array=function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=e.charCodeAt(i);return r},t.prototype.dataUriToUint8Array=function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))},t.prototype.downloadText=function(t,e,n){var r=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var i=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(i))}catch(e){this.finish(t,400,JSON.stringify(e))}else{var a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",t,!0);var s=function(){r.finish(t,a.status,a.responseText)};a.onload=s,a.onerror=s,a.send()}},t.prototype.downloadJson=function(t,e,n){this.downloadText(t,(function(t){e(JSON.parse(t))}),n)},t.prototype.downloadBinary=function(t,e,n){var r=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var i=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(i))}catch(e){this.finish(t,400,JSON.stringify(e))}else{var a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType="arraybuffer";var s=function(){r.finish(t,a.status,a.response)};a.onload=function(){200==a.status||0==a.status?r.finish(t,200,new Uint8Array(a.response)):s()},a.onerror=s,a.send()}},t.prototype.start=function(t,e,n){var r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,n)}},t.prototype.finish=function(t,e,n){var r=this.callbacks[t];delete this.callbacks[t];for(var i=200==e||0==e?[n]:[e,n],a=i.length-1,s=r.length;a<s;a+=2)r[a].apply(null,i)},t}(),Zt=function(t,e){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!e)throw new Error("data cannot be null.");this.time=t,this.data=e},$t=function(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t},te=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n<t.bones.length;n++){var r=e.findBone(t.bones[n].name);if(!r)throw new Error("Couldn't find bone ".concat(t.bones[n].name));this.bones.push(r)}var i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find bone ".concat(t.target.name));this.target=i}return e.prototype.isActive=function(){return this.active},e.prototype.setToSetupPose=function(){var t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch},e.prototype.update=function(t){if(0!=this.mix){var e=this.target,n=this.bones;switch(n.length){case 1:this.apply1(n[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(n[0],n[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}},e.prototype.apply1=function(e,n,r,i,a,s,o){var h=e.parent;if(!h)throw new Error("IK bone must have parent.");var l=h.a,c=h.b,u=h.c,f=h.d,p=-e.ashearX-e.arotation,m=0,g=0;switch(e.data.transformMode){case t.TransformMode.OnlyTranslation:m=(n-e.worldX)*d.signum(e.skeleton.scaleX),g=(r-e.worldY)*d.signum(e.skeleton.scaleY);break;case t.TransformMode.NoRotationOrReflection:var v=Math.abs(l*f-c*u)/Math.max(1e-4,l*l+u*u),y=l/e.skeleton.scaleX,x=u/e.skeleton.scaleY;c=-x*v*e.skeleton.scaleX,f=y*v*e.skeleton.scaleY,p+=Math.atan2(x,y)*d.radDeg;default:var w=n-h.worldX,b=r-h.worldY,M=l*f-c*u;Math.abs(M)<=1e-4?(m=0,g=0):(m=(w*f-b*c)/M-e.ax,g=(b*l-w*u)/M-e.ay)}p+=Math.atan2(g,m)*d.radDeg,e.ascaleX<0&&(p+=180),p>180?p-=360:p<-180&&(p+=360);var S=e.ascaleX,k=e.ascaleY;if(i||a){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:m=n-e.worldX,g=r-e.worldY}var A=e.data.length*S;if(A>1e-4){var I=m*m+g*g;if(i&&I<A*A||a&&I>A*A)S*=v=(Math.sqrt(I)/A-1)*o+1,s&&(k*=v)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*o,S,k,e.ashearX,e.ashearY)},e.prototype.apply2=function(t,e,n,r,i,a,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,p=u,m=f,g=e.ascaleX,v=0,y=0,x=0;u<0?(u=-u,v=180,x=-1):(v=0,x=1),f<0&&(f=-f,x=-x),g<0?(g=-g,y=180):y=0;var w=e.ax,b=0,M=0,S=0,k=t.a,A=t.b,I=t.c,T=t.d,C=Math.abs(u-f)<=1e-4;!C||a?(b=0,M=k*w+t.worldX,S=I*w+t.worldY):(M=k*w+A*(b=e.ay)+t.worldX,S=I*w+T*b+t.worldY);var E=t.parent;if(!E)throw new Error("IK parent must itself have a parent.");k=E.a,A=E.b,I=E.c;var F,B,Y=k*(T=E.d)-A*I,R=M-E.worldX,P=S-E.worldY,X=(R*T-P*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,V=(P*k-R*I)*Y-c,D=Math.sqrt(X*X+V*V),L=e.data.length*g;if(D<1e-4)return this.apply1(t,n,r,!1,a,!1,h),void e.updateWorldTransformWith(w,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var N=((R=n-E.worldX)*T-(P=r-E.worldY)*A)*Y-l,O=(P*k-R*I)*Y-c,_=N*N+O*O;if(0!=o){o*=u*(g+1)*.5;var q=Math.sqrt(_),U=q-D-L*u+o;if(U>0){var W=Math.min(1,U/(2*o))-1;_=(N-=(W=(U-o*(1-W*W))/q)*N)*N+(O-=W*O)*O}}t:if(C){var z=(_-D*D-(L*=u)*L)/(2*D*L);z<-1?(z=-1,B=Math.PI*i):z>1?(z=1,B=0,a&&(p*=k=(Math.sqrt(_)/(D+L)-1)*h+1,s&&(m*=k))):B=Math.acos(z)*i,k=D+L*z,A=L*Math.sin(B),F=Math.atan2(O*k-N*A,N*k+O*A)}else{var G=(k=u*L)*k,H=(A=f*L)*A,j=Math.atan2(O,N),J=-2*H*D,K=H-G;if((T=J*J-4*K*(I=H*D*D+G*_-G*H))>=0){var Q=Math.sqrt(T);J<0&&(Q=-Q);var Z=(Q=.5*-(J+Q))/K,$=I/Q,tt=Math.abs(Z)<Math.abs($)?Z:$;if(tt*tt<=_){P=Math.sqrt(_-tt*tt)*i,F=j-Math.atan2(P,tt),B=Math.atan2(P/f,(tt-D)/u);break t}}var et=d.PI,nt=D-k,rt=nt*nt,it=0,at=0,st=D+k,ot=st*st,ht=0;(I=-k*D/(G-H))>=-1&&I<=1&&(I=Math.acos(I),(T=(R=k*Math.cos(I)+D)*R+(P=A*Math.sin(I))*P)<rt&&(et=I,rt=T,nt=R,it=P),T>ot&&(at=I,ot=T,st=R,ht=P)),_<=.5*(rt+ot)?(F=j-Math.atan2(it*i,nt),B=et*i):(F=j-Math.atan2(ht*i,st),B=at*i)}var lt=Math.atan2(b,w)*x,ct=t.arotation;(F=(F-lt)*d.radDeg+v-ct)>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(l,c,ct+F*h,p,m,0,0),ct=e.arotation,(B=((B+lt)*d.radDeg-e.ashearX)*x+y-ct)>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(w,b,ct+B*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e}(),ee=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return r(e,t),Object.defineProperty(e.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),e}(Jt),ne=function(e){function n(n){var r=e.call(this,n,0,!1)||this;return r.bones=new Array,r._target=null,r.positionMode=t.PositionMode.Fixed,r.spacingMode=t.SpacingMode.Fixed,r.rotateMode=t.RotateMode.Chain,r.offsetRotation=0,r.position=0,r.spacing=0,r.mixRotate=0,r.mixX=0,r.mixY=0,r}return r(n,e),Object.defineProperty(n.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),n}(Jt);t.PositionMode=void 0,(zt=t.PositionMode||(t.PositionMode={}))[zt.Fixed=0]="Fixed",zt[zt.Percent=1]="Percent",t.SpacingMode=void 0,(Gt=t.SpacingMode||(t.SpacingMode={}))[Gt.Length=0]="Length",Gt[Gt.Fixed=1]="Fixed",Gt[Gt.Percent=2]="Percent",Gt[Gt.Proportional=3]="Proportional",t.RotateMode=void 0,(Ht=t.RotateMode||(t.RotateMode={}))[Ht.Tangent=0]="Tangent",Ht[Ht.Chain=1]="Chain",Ht[Ht.ChainScale=2]="ChainScale";var re,ie=function(){function e(t,e){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n<r;n++){var i=e.findBone(t.bones[n].name);if(!i)throw new Error("Couldn't find bone ".concat(t.bones[n].name,"."));this.bones.push(i)}var a=e.findSlot(t.target.name);if(!a)throw new Error("Couldn't find target bone ".concat(t.target.name));this.target=a,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}return e.prototype.isActive=function(){return this.active},e.prototype.setToSetupPose=function(){var t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY},e.prototype.update=function(n){var r=this.target.getAttachment();if(r instanceof Ot){var i=this.mixRotate,a=this.mixX,s=this.mixY;if(0!=i||0!=a||0!=s){var o=this.data,h=o.rotateMode==t.RotateMode.Tangent,l=o.rotateMode==t.RotateMode.ChainScale,c=this.bones,u=c.length,f=h?u:u+1,p=g.setArraySize(this.spaces,f),m=l?this.lengths=g.setArraySize(this.lengths,u):[],v=this.spacing;switch(o.spacingMode){case t.SpacingMode.Percent:if(l)for(var y=0,x=f-1;y<x;y++){var w=(A=(R=c[y]).data.length)*R.a,b=A*R.c;m[y]=Math.sqrt(w*w+b*b)}g.arrayFill(p,1,f,v);break;case t.SpacingMode.Proportional:var M=0;for(y=0,x=f-1;y<x;){if((A=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=A*R.a,b=A*R.c;var S=Math.sqrt(w*w+b*b);l&&(m[y]=S),p[++y]=S,M+=S}}if(M>0){M=f/M*v;for(y=1;y<f;y++)p[y]*=M}break;default:var k=o.spacingMode==t.SpacingMode.Length;for(y=0,x=f-1;y<x;){var A;if((A=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=A*R.a,b=A*R.c;var I=Math.sqrt(w*w+b*b);l&&(m[y]=I),p[++y]=(k?A+v:v)*I/A}}}var T=this.computeWorldPositions(r,f,h),C=T[0],E=T[1],F=o.offsetRotation,B=!1;if(0==F)B=o.rotateMode==t.RotateMode.Chain;else B=!1,F*=(Y=this.target.bone).a*Y.d-Y.b*Y.c>0?d.degRad:-d.degRad;y=0;for(var Y=3;y<u;y++,Y+=3){var R;(R=c[y]).worldX+=(C-R.worldX)*a,R.worldY+=(E-R.worldY)*s;var P=(w=T[Y])-C,X=(b=T[Y+1])-E;if(l){var V=m[y];if(0!=V){var D=(Math.sqrt(P*P+X*X)/V-1)*i+1;R.a*=D,R.c*=D}}if(C=w,E=b,i>0){var L=R.a,N=R.b,O=R.c,_=R.d,q=0,U=0,W=0;if(q=h?T[Y-1]:0==p[y+1]?T[Y+2]:Math.atan2(X,P),q-=Math.atan2(O,L),B){U=Math.cos(q),W=Math.sin(q);var z=R.data.length;C+=(z*(U*L-W*O)-P)*i,E+=(z*(W*L+U*O)-X)*i}else q+=F;q>d.PI?q-=d.PI2:q<-d.PI&&(q+=d.PI2),q*=i,U=Math.cos(q),W=Math.sin(q),R.a=U*L-W*O,R.b=U*N-W*_,R.c=W*L+U*O,R.d=W*N+U*_}R.updateAppliedTransform()}}}},e.prototype.computeWorldPositions=function(n,r,i){var a=this.target,s=this.position,o=this.spaces,h=g.setArraySize(this.positions,3*r+2),l=this.world,c=n.closed,u=n.worldVerticesLength,d=u/6,f=e.NONE;if(!n.constantSpeed){var p,m=n.lengths,v=m[d-=c?1:2];switch(this.data.positionMode==t.PositionMode.Percent&&(s*=v),this.data.spacingMode){case t.SpacingMode.Percent:p=v;break;case t.SpacingMode.Proportional:p=v/r;break;default:p=1}l=g.setArraySize(this.world,8);for(var y=0,x=0,w=0;y<r;y++,x+=3){var b=s+=G=o[y]*p;if(c)(b%=v)<0&&(b+=v),w=0;else{if(b<0){f!=e.BEFORE&&(f=e.BEFORE,n.computeWorldVertices(a,2,4,l,0,2)),this.addBeforePosition(b,l,0,h,x);continue}if(b>v){f!=e.AFTER&&(f=e.AFTER,n.computeWorldVertices(a,u-6,4,l,0,2)),this.addAfterPosition(b-v,l,0,h,x);continue}}for(;;w++){var M=m[w];if(!(b>M)){if(0==w)b/=M;else b=(b-(K=m[w-1]))/(M-K);break}}w!=f&&(f=w,c&&w==d?(n.computeWorldVertices(a,u-4,4,l,0,2),n.computeWorldVertices(a,0,4,l,4,2)):n.computeWorldVertices(a,6*w+2,8,l,0,2)),this.addCurvePosition(b,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,x,i||y>0&&0==G)}return h}c?(u+=2,l=g.setArraySize(this.world,u),n.computeWorldVertices(a,2,u-4,l,0,2),n.computeWorldVertices(a,0,2,l,u-4,2),l[u-2]=l[0],l[u-1]=l[1]):(d--,u-=4,l=g.setArraySize(this.world,u),n.computeWorldVertices(a,2,u,l,0,2));for(var S,k=g.setArraySize(this.curves,d),A=0,I=l[0],T=l[1],C=0,E=0,F=0,B=0,Y=0,R=0,P=0,X=0,V=0,D=0,L=0,N=0,O=0,_=0,q=(y=0,2);y<d;y++,q+=6)C=l[q],E=l[q+1],F=l[q+2],B=l[q+3],L=2*(P=.1875*(I-2*C+F))+(V=.09375*(3*(C-F)-I+(Y=l[q+4]))),N=2*(X=.1875*(T-2*E+B))+(D=.09375*(3*(E-B)-T+(R=l[q+5]))),O=.75*(C-I)+P+.16666667*V,_=.75*(E-T)+X+.16666667*D,A+=Math.sqrt(O*O+_*_),O+=L,_+=N,L+=V,N+=D,A+=Math.sqrt(O*O+_*_),O+=L,_+=N,A+=Math.sqrt(O*O+_*_),O+=L+V,_+=N+D,A+=Math.sqrt(O*O+_*_),k[y]=A,I=Y,T=R;switch(this.data.positionMode==t.PositionMode.Percent&&(s*=A),this.data.spacingMode){case t.SpacingMode.Percent:S=A;break;case t.SpacingMode.Proportional:S=A/r;break;default:S=1}for(var U=this.segments,W=0,z=(y=0,x=0,w=0,0);y<r;y++,x+=3){var G;b=s+=G=o[y]*S;if(c)(b%=A)<0&&(b+=A),w=0;else{if(b<0){this.addBeforePosition(b,l,0,h,x);continue}if(b>A){this.addAfterPosition(b-A,l,u-4,h,x);continue}}for(;;w++){var H=k[w];if(!(b>H)){if(0==w)b/=H;else b=(b-(K=k[w-1]))/(H-K);break}}if(w!=f){f=w;var j=6*w;for(I=l[j],T=l[j+1],C=l[j+2],E=l[j+3],F=l[j+4],B=l[j+5],L=2*(P=.03*(I-2*C+F))+(V=.006*(3*(C-F)-I+(Y=l[j+6]))),N=2*(X=.03*(T-2*E+B))+(D=.006*(3*(E-B)-T+(R=l[j+7]))),O=.3*(C-I)+P+.16666667*V,_=.3*(E-T)+X+.16666667*D,W=Math.sqrt(O*O+_*_),U[0]=W,j=1;j<8;j++)O+=L,_+=N,L+=V,N+=D,W+=Math.sqrt(O*O+_*_),U[j]=W;O+=L,_+=N,W+=Math.sqrt(O*O+_*_),U[8]=W,O+=L+V,_+=N+D,W+=Math.sqrt(O*O+_*_),U[9]=W,z=0}for(b*=W;;z++){var J=U[z];if(!(b>J)){var K;if(0==z)b/=J;else b=z+(b-(K=U[z-1]))/(J-K);break}}this.addCurvePosition(.1*b,I,T,C,E,F,B,Y,R,h,x,i||y>0&&0==G)}return h},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],s=e[n+1],o=e[n+2]-a,h=e[n+3]-s,l=Math.atan2(h,o);r[i]=a+t*Math.cos(l),r[i+1]=s+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],s=e[n+3],o=a-e[n],h=s-e[n+1],l=Math.atan2(h,o);r[i]=a+t*Math.cos(l),r[i+1]=s+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(i-n,r-e));var d=t*t,f=d*t,p=1-t,m=p*p,g=m*p,v=p*t,y=3*v,x=p*y,w=y*t,b=e*g+r*x+a*w+o*f,M=n*g+i*x+s*w+h*f;l[c]=b,l[c+1]=M,u&&(l[c+2]=t<.001?Math.atan2(i-n,r-e):Math.atan2(M-(n*m+i*v*2+s*d),b-(e*m+r*v*2+a*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}(),ae=function(){function e(t,e){this._bone=null,this.inertia=0,this.strength=0,this.damping=0,this.massInverse=0,this.wind=0,this.gravity=0,this.mix=0,this._reset=!0,this.ux=0,this.uy=0,this.cx=0,this.cy=0,this.tx=0,this.ty=0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0,this.active=!1,this.remaining=0,this.lastTime=0,this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}return Object.defineProperty(e.prototype,"bone",{get:function(){if(this._bone)return this._bone;throw new Error("Bone not set.")},set:function(t){this._bone=t},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0},e.prototype.setToSetupPose=function(){var t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix},e.prototype.isActive=function(){return this.active},e.prototype.update=function(e){var n=this.mix;if(0!=n){var r=this.data.x>0,i=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,s=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(e){case t.Physics.none:return;case t.Physics.reset:this.reset();case t.Physics.update:this.remaining+=Math.max(this.skeleton.time-this.lastTime,0),this.lastTime=this.skeleton.time;var l=o.worldX,c=o.worldY;if(this._reset)this._reset=!1,this.ux=l,this.uy=c;else{var u=this.remaining,f=this.inertia,p=this.data.step;if(r||i){if(r&&(this.xOffset+=(this.ux-l)*f,this.ux=l),i&&(this.yOffset+=(this.uy-c)*f,this.uy=c),u>=p){var m=this.massInverse*p,g=this.strength,v=100*this.wind,y=-100*this.gravity,x=Math.pow(this.damping,60*p);do{r&&(this.xVelocity+=(v-this.xOffset*g)*m,this.xOffset+=this.xVelocity*p,this.xVelocity*=x),i&&(this.yVelocity+=(y-this.yOffset*g)*m,this.yOffset+=this.yVelocity*p,this.yVelocity*=x),u-=p}while(u>=p)}r&&(o.worldX+=this.xOffset*n*this.data.x),i&&(o.worldY+=this.yOffset*n*this.data.y)}if(a||s){var w=Math.atan2(o.c,o.a),b=0,M=0,S=0;if(a){S=(this.data.rotate+this.data.shearX)*n;var k=this.cx-o.worldX,A=this.cy-o.worldY,I=Math.atan2(A+this.ty,k+this.tx)-w-this.rotateOffset*S;this.rotateOffset+=(I-Math.ceil(I*d.invPI2-.5)*d.PI2)*f,I=this.rotateOffset*S+w,b=Math.cos(I),M=Math.sin(I),s&&(I=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(k*b+A*M)*f/I)}else{b=Math.cos(w),M=Math.sin(w),(I=h*o.getWorldScaleX())>0&&(this.scaleOffset+=((this.cx-o.worldX)*b+(this.cy-o.worldY)*M)*f/I)}if((u=this.remaining)>=p)for(m=this.massInverse*p,g=this.strength,v=this.wind,y=this.gravity,x=Math.pow(this.damping,60*p);;)if(u-=p,s&&(this.scaleVelocity+=(v*b-y*M-this.scaleOffset*g)*m,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=x),a){if(this.rotateVelocity+=(-.01*h*(v*M+y*b)-this.rotateOffset*g)*m,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=x,u<p)break;I=this.rotateOffset*S+w;b=Math.cos(I),M=Math.sin(I)}else if(u<p)break}this.remaining=u}this.cx=o.worldX,this.cy=o.worldY;break;case t.Physics.pose:r&&(o.worldX+=this.xOffset*n*this.data.x),i&&(o.worldY+=this.yOffset*n*this.data.y)}if(a){var T=this.rotateOffset*n,C=(M=0,b=0,0);if(this.data.shearX>0){I=0;this.data.rotate>0&&(I=T*this.data.rotate,M=Math.sin(I),b=Math.cos(I),C=o.b,o.b=b*C-M*o.d,o.d=M*C+b*o.d),I+=T*this.data.shearX,M=Math.sin(I),b=Math.cos(I),C=o.a,o.a=b*C-M*o.c,o.c=M*C+b*o.c}else T*=this.data.rotate,M=Math.sin(T),b=Math.cos(T),C=o.a,o.a=b*C-M*o.c,o.c=M*C+b*o.c,C=o.b,o.b=b*C-M*o.d,o.d=M*C+b*o.d}if(s){M=1+this.scaleOffset*n*this.data.scaleX;o.a*=M,o.c*=M}e!=t.Physics.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}},e}(),se=function(){function t(t,e){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new u,this.darkColor=t.darkColor?new u:null,this.setToSetupPose()}return t.prototype.getSkeleton=function(){return this.bone.skeleton},t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(t){this.attachment!=t&&(t instanceof S&&this.attachment instanceof S&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null},t}(),oe=function(){function t(t,e){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new x,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY,this.bones=new Array;for(var n=0;n<t.bones.length;n++){var r=e.findBone(t.bones[n].name);if(!r)throw new Error("Couldn't find bone ".concat(t.bones[n].name,"."));this.bones.push(r)}var i=e.findBone(t.target.name);if(!i)throw new Error("Couldn't find target bone ".concat(t.target.name,"."));this.target=i}return t.prototype.isActive=function(){return this.active},t.prototype.setToSetupPose=function(){var t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY},t.prototype.update=function(t){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())},t.prototype.applyAbsoluteWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?d.degRad:-d.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones,v=0,y=g.length;v<y;v++){var x=g[v];if(0!=t){var w=x.a,b=x.b,M=x.c,S=x.d;(T=Math.atan2(c,h)-Math.atan2(M,w)+p)>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T*=t;var k=Math.cos(T),A=Math.sin(T);x.a=k*w-A*M,x.b=k*b-A*S,x.c=A*w+k*M,x.d=A*b+k*S}if(s){var I=this.temp;o.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(I.x-x.worldX)*e,x.worldY+=(I.y-x.worldY)*n}if(0!=r)0!=(E=Math.sqrt(x.a*x.a+x.c*x.c))&&(E=(E+(Math.sqrt(h*h+c*c)-E+this.data.offsetScaleX)*r)/E),x.a*=E,x.c*=E;if(0!=i)0!=(E=Math.sqrt(x.b*x.b+x.d*x.d))&&(E=(E+(Math.sqrt(l*l+u*u)-E+this.data.offsetScaleY)*i)/E),x.b*=E,x.d*=E;if(a>0){b=x.b,S=x.d;var T,C=Math.atan2(S,b);(T=Math.atan2(u,l)-Math.atan2(c,h)-(C-Math.atan2(x.c,x.a)))>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T=C+(T+m)*a;var E=Math.sqrt(b*b+S*S);x.b=Math.cos(T)*E,x.d=Math.sin(T)*E}x.updateAppliedTransform()}},t.prototype.applyRelativeWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?d.degRad:-d.degRad,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones,v=0,y=g.length;v<y;v++){var x=g[v];if(0!=t){var w=x.a,b=x.b,M=x.c,S=x.d;(C=Math.atan2(c,h)+p)>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C*=t;var k=Math.cos(C),A=Math.sin(C);x.a=k*w-A*M,x.b=k*b-A*S,x.c=A*w+k*M,x.d=A*b+k*S}if(s){var I=this.temp;o.localToWorld(I.set(this.data.offsetX,this.data.offsetY)),x.worldX+=I.x*e,x.worldY+=I.y*n}if(0!=r){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*r+1;x.a*=T,x.c*=T}if(0!=i){T=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*i+1;x.b*=T,x.d*=T}if(a>0){var C;(C=Math.atan2(u,l)-Math.atan2(c,h))>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2);b=x.b,S=x.d;C=Math.atan2(S,b)+(C-d.PI/2+m)*a;T=Math.sqrt(b*b+S*S);x.b=Math.cos(C)*T,x.d=Math.sin(C)*T}x.updateAppliedTransform()}},t.prototype.applyAbsoluteLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h<l;h++){var c=o[h],u=c.arotation;if(0!=t){var d=s.arotation-u+this.data.offsetRotation;u+=(d-=360*Math.ceil(d/360-.5))*t}var f=c.ax,p=c.ay;f+=(s.ax-f+this.data.offsetX)*e,p+=(s.ay-p+this.data.offsetY)*n;var m=c.ascaleX,g=c.ascaleY;0!=r&&0!=m&&(m=(m+(s.ascaleX-m+this.data.offsetScaleX)*r)/m),0!=i&&0!=g&&(g=(g+(s.ascaleY-g+this.data.offsetScaleY)*i)/g);var v=c.ashearY;if(0!=a){d=s.ashearY-v+this.data.offsetShearY;v+=(d-=360*Math.ceil(d/360-.5))*a}c.updateWorldTransformWith(f,p,u,m,g,c.ashearX,v)}},t.prototype.applyRelativeLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,i=this.mixScaleY,a=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h<l;h++){var c=o[h],u=c.arotation+(s.arotation+this.data.offsetRotation)*t,d=c.ax+(s.ax+this.data.offsetX)*e,f=c.ay+(s.ay+this.data.offsetY)*n,p=c.ascaleX*((s.ascaleX-1+this.data.offsetScaleX)*r+1),m=c.ascaleY*((s.ascaleY-1+this.data.offsetScaleY)*i+1),g=c.ashearY+(s.ashearY+this.data.offsetShearY)*a;c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t}(),he=function(){function t(t){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,this.time=0,!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 n=t.bones[e],r=void 0;if(n.parent){var i=this.bones[n.parent.index];r=new jt(n,this,i),i.children.push(r)}else r=new jt(n,this,null);this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(e=0;e<t.slots.length;e++){var a=t.slots[e],s=(r=this.bones[a.boneData.index],new se(a,r));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 te(o,this))}this.transformConstraints=new Array;for(e=0;e<t.transformConstraints.length;e++){var h=t.transformConstraints[e];this.transformConstraints.push(new oe(h,this))}this.pathConstraints=new Array;for(e=0;e<t.pathConstraints.length;e++){var l=t.pathConstraints[e];this.pathConstraints.push(new ie(l,this))}this.physicsConstraints=new Array;for(e=0;e<t.physicsConstraints.length;e++){var c=t.physicsConstraints[e];this.physicsConstraints.push(new ae(c,this))}this.color=new u(1,1,1,1),this.updateCache()}return Object.defineProperty(t.prototype,"scaleY",{get:function(){return t.yDown?-this._scaleY:this._scaleY},set:function(t){this._scaleY=t},enumerable:!1,configurable:!0}),t.prototype.updateCache=function(){this._updateCache.length=0;for(var t=this.bones,e=0,n=t.length;e<n;e++){(i=t[e]).sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin){var r=this.skin.bones;for(e=0,n=this.skin.bones.length;e<n;e++){var i=this.bones[r[e].index];do{i.sorted=!1,i.active=!0,i=i.parent}while(i)}}var a=this.ikConstraints,s=this.transformConstraints,o=this.pathConstraints,h=this.physicsConstraints,l=a.length,c=s.length,u=o.length,d=this.physicsConstraints.length,f=l+c+u+d;t:for(e=0;e<f;e++){for(var p=0;p<l;p++){if((m=a[p]).data.order==e){this.sortIkConstraint(m);continue t}}for(p=0;p<c;p++){if((m=s[p]).data.order==e){this.sortTransformConstraint(m);continue t}}for(p=0;p<u;p++){if((m=o[p]).data.order==e){this.sortPathConstraint(m);continue t}}for(p=0;p<d;p++){var m;if((m=h[p]).data.order==e){this.sortPhysicsConstraint(m);continue t}}}for(e=0,n=t.length;e<n;e++)this.sortBone(t[e])},t.prototype.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target;this.sortBone(e);var n=t.bones,r=n[0];if(this.sortBone(r),1==n.length)this._updateCache.push(t),this.sortReset(r.children);else{var i=n[n.length-1];this.sortBone(i),this._updateCache.push(t),this.sortReset(r.children),i.sorted=!0}}},t.prototype.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){var e=t.target,n=e.data.index,r=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var i=0,a=this.data.skins.length;i<a;i++)this.sortPathConstraintAttachment(this.data.skins[i],n,r);var s=e.getAttachment();s instanceof Ot&&this.sortPathConstraintAttachmentWith(s,r);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||this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var e=t.bones,n=e.length;if(t.data.local)for(var r=0;r<n;r++){var i=e[r];this.sortBone(i.parent),this.sortBone(i)}else for(r=0;r<n;r++)this.sortBone(e[r]);this._updateCache.push(t);for(r=0;r<n;r++)this.sortReset(e[r].children);for(r=0;r<n;r++)e[r].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(t,e,n){var r=t.attachments[e];if(r)for(var i in r)this.sortPathConstraintAttachmentWith(r[i],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,e){if(t instanceof Ot){var n=t.bones;if(n)for(var r=this.bones,i=0,a=n.length;i<a;){var s=n[i++];for(s+=i;i<s;)this.sortBone(r[n[i++]])}else this.sortBone(e)}},t.prototype.sortPhysicsConstraint=function(t){var e=t.bone;t.active=e.active&&(!t.data.skinRequired||null!=this.skin&&g.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)},t.prototype.sortBone=function(t){if(t&&!t.sorted){var e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},t.prototype.sortReset=function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}},t.prototype.updateWorldTransform=function(t){if(!t)throw new Error("physics is undefined");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}var a=this._updateCache;for(n=0,r=a.length;n<r;n++)a[n].update(t)},t.prototype.updateWorldTransformWith=function(t,e){var n=this.getRootBone();if(!n)throw new Error("Root bone must not be null.");var r=e.a,i=e.b,a=e.c,s=e.d;n.worldX=r*this.x+i*this.y+e.worldX,n.worldY=a*this.x+s*this.y+e.worldY;var o=(n.rotation+n.shearX)*d.degRad,h=(n.rotation+90+n.shearY)*d.degRad,l=Math.cos(o)*n.scaleX,c=Math.cos(h)*n.scaleY,u=Math.sin(o)*n.scaleX,f=Math.sin(h)*n.scaleY;n.a=(r*l+i*u)*this.scaleX,n.b=(r*c+i*f)*this.scaleX,n.c=(a*l+s*u)*this.scaleY,n.d=(a*c+s*f)*this.scaleY;for(var p=this._updateCache,m=0,g=p.length;m<g;m++){var v=p[m];v!=n&&v.update(t)}},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){var t,e,n,r,i,a,o,h,l,c;try{for(var u=s(this.bones),d=u.next();!d.done;d=u.next()){d.value.setToSetupPose()}}catch(e){t={error:e}}finally{try{d&&!d.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}try{for(var f=s(this.ikConstraints),p=f.next();!p.done;p=f.next()){p.value.setToSetupPose()}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var m=s(this.transformConstraints),g=m.next();!g.done;g=m.next()){g.value.setToSetupPose()}}catch(t){i={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var v=s(this.pathConstraints),y=v.next();!y.done;y=v.next()){y.value.setToSetupPose()}}catch(t){o={error:t}}finally{try{y&&!y.done&&(h=v.return)&&h.call(v)}finally{if(o)throw o.error}}try{for(var x=s(this.physicsConstraints),w=x.next();!w.done;w=x.next()){w.value.setToSetupPose()}}catch(t){l={error:t}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;g.arrayCopy(t,0,this.drawOrder,0,t.length);for(var e=0,n=t.length;e<n;e++)t[e].setToSetupPose()},t.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},t.prototype.findBone=function(t){if(!t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];if(i.data.name==t)return i}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n];if(i.data.name==t)return i}return null},t.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)},t.prototype.setSkin=function(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n],a=i.data.attachmentName;if(a){var s=t.getAttachment(n,a);s&&i.setAttachment(s)}}this.skin=t,this.updateCache()}},t.prototype.getAttachmentByName=function(t,e){var n=this.data.findSlot(t);if(!n)throw new Error("Can't find slot with name ".concat(t));return this.getAttachment(n.index,e)},t.prototype.getAttachment=function(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){var n=this.skin.getAttachment(t,e);if(n)return n}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},t.prototype.setAttachment=function(t,e){if(!t)throw new Error("slotName cannot be null.");for(var n=this.slots,r=0,i=n.length;r<i;r++){var a=n[r];if(a.data.name==t){var s=null;if(e&&!(s=this.getAttachment(r,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){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.ikConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findTransformConstraint=function(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.transformConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findPathConstraint=function(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.pathConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.findPhysicsConstraint=function(t){var e;if(null==t)throw new Error("constraintName cannot be null.");return null!==(e=this.physicsConstraints.find((function(e){return e.data.name==t})))&&void 0!==e?e:null},t.prototype.getBoundsRect=function(){var t=new x,e=new x;return this.getBounds(t,e),{x:t.x,y:t.y,width:e.x,height:e.y}},t.prototype.getBounds=function(t,e,n){if(void 0===n&&(n=new Array(2)),!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var r=this.drawOrder,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=r.length;h<l;h++){var c=r[h];if(c.bone.active){var u=0,d=null,f=c.getAttachment();if(f instanceof qt)u=8,d=g.setArraySize(n,u,0),f.computeWorldVertices(c,d,0,2);else if(f instanceof Nt){var p=f;u=p.worldVerticesLength,d=g.setArraySize(n,u,0),p.computeWorldVertices(c,0,u,d,0,2)}if(d)for(var m=0,v=d.length;m<v;m+=2){var y=d[m],x=d[m+1];i=Math.min(i,y),a=Math.min(a,x),s=Math.max(s,y),o=Math.max(o,x)}}}t.set(i,a),e.set(s-i,o-a)},t.prototype.update=function(t){this.time+=t},t.yDown=!1,t}();t.Physics=void 0,(re=t.Physics||(t.Physics={}))[re.none=0]="none",re[re.reset=1]="reset",re[re.update=2]="update",re[re.pose=3]="pose";var le,ce=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n._bone=null,n.x=0,n.y=0,n.rotate=0,n.scaleX=0,n.shearX=0,n.step=0,n.inertia=0,n.strength=0,n.damping=0,n.massInverse=0,n.wind=0,n.gravity=0,n.mix=0,n.inertiaGlobal=!1,n.strengthGlobal=!1,n.dampingGlobal=!1,n.massGlobal=!1,n.windGlobal=!1,n.gravityGlobal=!1,n.mixGlobal=!1,n}return r(e,t),Object.defineProperty(e.prototype,"bone",{get:function(){if(this._bone)return this._bone;throw new Error("BoneData not set.")},set:function(t){this._bone=t},enumerable:!1,configurable:!0}),e}(Jt),ue=function(){function t(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.physicsConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}return t.prototype.findBone=function(t){if(!t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findSkin=function(t){if(!t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findEvent=function(t){if(!t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findAnimation=function(t){if(!t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findIkConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findTransformConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findPathConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t.prototype.findPhysicsConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.physicsConstraints,n=0,r=e.length;n<r;n++){var i=e[n];if(i.name==t)return i}return null},t}(),de=function(t,e,n){void 0===t&&(t=0),this.slotIndex=t,this.name=e,this.attachment=n},fe=function(){function t(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,this.color=new u(.99607843,.61960787,.30980393,1),!t)throw new Error("name cannot be null.");this.name=t}return t.prototype.setAttachment=function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var n=t.bones[e],r=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==n){r=!0;break}r||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(r=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){r=!0;break}r||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 n=t.bones[e],r=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==n){r=!0;break}r||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(r=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){r=!0;break}r||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];o.attachment&&(o.attachment instanceof Nt?(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 n=this.attachments[t];return n?n[e]:null},t.prototype.removeAttachment=function(t,e){var n=this.attachments[t];n&&delete n[e]},t.prototype.getAttachments=function(){for(var t=new Array,e=0;e<this.attachments.length;e++){var n=this.attachments[e];if(n)for(var r in n){var i=n[r];i&&t.push(new de(e,r,i))}}return t},t.prototype.getAttachmentsForSlot=function(t,e){var n=this.attachments[t];if(n)for(var r in n){var i=n[r];i&&e.push(new de(t,r,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 n=0,r=0;r<t.slots.length;r++){var i=t.slots[r],a=i.getAttachment();if(a&&n<e.attachments.length){var s=e.attachments[n];for(var o in s){if(a==s[o]){var h=this.getAttachment(n,o);h&&i.setAttachment(h);break}}}n++}},t}(),pe=function(e,n,r){if(this.index=0,this.color=new u(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=t.BlendMode.Normal,this.visible=!0,e<0)throw new Error("index must be >= 0.");if(!n)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.BlendMode=void 0,(le=t.BlendMode||(t.BlendMode={}))[le.Normal=0]="Normal",le[le.Additive=1]="Additive",le[le.Multiply=2]="Multiply",le[le.Screen=3]="Screen";var me,ge=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=0,n.offsetRotation=0,n.offsetX=0,n.offsetY=0,n.offsetScaleX=0,n.offsetScaleY=0,n.offsetShearY=0,n.relative=!1,n.local=!1,n}return r(e,t),Object.defineProperty(e.prototype,"target",{get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t},enumerable:!1,configurable:!0}),e}(Jt),ve=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,r=this.scale,i=new ue;i.name="";var a=new ye(e),s=a.readInt32(),o=a.readInt32();i.hash=0==o&&0==s?null:o.toString(16)+s.toString(16),i.version=a.readString(),i.x=a.readFloat(),i.y=a.readFloat(),i.width=a.readFloat(),i.height=a.readFloat();var h=a.readBoolean();h&&(i.fps=a.readFloat(),i.imagesPath=a.readString(),i.audioPath=a.readString());var l=0;l=a.readInt(!0);for(var c=0;c<l;c++){var d=a.readString();if(!d)throw new Error("String in string table must not be null.");a.strings.push(d)}l=a.readInt(!0);for(c=0;c<l;c++){var f=a.readString();if(!f)throw new Error("Bone name must not be null.");var p=0==c?null:i.bones[a.readInt(!0)];(y=new Wt(c,f,p)).rotation=a.readFloat(),y.x=a.readFloat()*r,y.y=a.readFloat()*r,y.scaleX=a.readFloat(),y.scaleY=a.readFloat(),y.shearX=a.readFloat(),y.shearY=a.readFloat(),y.length=a.readFloat()*r,y.transformMode=a.readInt(!0),y.skinRequired=a.readBoolean(),h&&(u.rgba8888ToColor(y.color,a.readInt32()),y.icon=null!==(n=a.readString())&&void 0!==n?n:void 0,y.visible=a.readBoolean()),i.bones.push(y)}l=a.readInt(!0);for(c=0;c<l;c++){var m=a.readString();if(!m)throw new Error("Slot name must not be null.");var v=i.bones[a.readInt(!0)],y=new pe(c,m,v);u.rgba8888ToColor(y.color,a.readInt32());var x=a.readInt32();-1!=x&&u.rgb888ToColor(y.darkColor=new u,x),y.attachmentName=a.readStringRef(),y.blendMode=a.readInt(!0),h&&(y.visible=a.readBoolean()),i.slots.push(y)}l=a.readInt(!0);c=0;for(var w=void 0;c<l;c++){var b=a.readString();if(!b)throw new Error("IK constraint data name must not be null.");(y=new ee(b)).order=a.readInt(!0),w=a.readInt(!0);for(var M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.bones[a.readInt(!0)],y.mix=a.readFloat(),y.softness=a.readFloat()*r;var S=a.readByte();y.skinRequired=0!=(1&S),y.bendDirection=0!=(2&S)?1:-1,y.compress=0!=(4&S),y.stretch=0!=(8&S),y.uniform=0!=(16&S),i.ikConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var k=a.readString();if(!k)throw new Error("Transform constraint data name must not be null.");(y=new ge(k)).order=a.readInt(!0),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),y.local=0!=(2&S),y.relative=0!=(4&S),y.offsetRotation=a.readFloat(),y.offsetX=a.readFloat()*r,y.offsetY=a.readFloat()*r,y.offsetScaleX=a.readFloat(),y.offsetScaleY=a.readFloat(),y.offsetShearY=a.readFloat(),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),y.mixScaleX=a.readFloat(),y.mixScaleY=a.readFloat(),y.mixShearY=a.readFloat(),i.transformConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var A=a.readString();if(!A)throw new Error("Path constraint data name must not be null.");(y=new ne(A)).order=a.readInt(!0),y.skinRequired=a.readBoolean(),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(i.bones[a.readInt(!0)]);y.target=i.slots[a.readInt(!0)],y.positionMode=a.readInt(!0),y.spacingMode=a.readInt(!0),y.rotateMode=a.readInt(!0),y.offsetRotation=a.readFloat(),y.position=a.readFloat(),y.positionMode==t.PositionMode.Fixed&&(y.position*=r),y.spacing=a.readFloat(),y.spacingMode!=t.SpacingMode.Length&&y.spacingMode!=t.SpacingMode.Fixed||(y.spacing*=r),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),i.pathConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var I=a.readString();if(!I)throw new Error("Physics constraint data name must not be null.");(y=new ce(I)).order=a.readInt(!0),y.bone=i.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),0!=(2&S)&&(y.x=a.readFloat()),0!=(4&S)&&(y.y=a.readFloat()),0!=(8&S)&&(y.rotate=a.readFloat()),0!=(16&S)&&(y.scaleX=a.readFloat()),0!=(32&S)&&(y.shearX=a.readFloat()),y.step=1/a.readByte(),y.inertia=a.readFloat(),y.strength=a.readFloat(),y.damping=a.readFloat(),y.massInverse=a.readFloat(),y.wind=a.readFloat()*r,y.gravity=a.readFloat()*r,y.mix=a.readFloat(),0!=(1&(S=a.readByte()))&&(y.inertiaGlobal=!0),0!=(2&S)&&(y.strengthGlobal=!0),0!=(4&S)&&(y.dampingGlobal=!0),0!=(8&S)&&(y.massGlobal=!0),0!=(16&S)&&(y.windGlobal=!0),0!=(32&S)&&(y.gravityGlobal=!0),0!=(64&S)&&(y.mixGlobal=!0),i.physicsConstraints.push(y)}var T=this.readSkin(a,i,!0,h);T&&(i.defaultSkin=T,i.skins.push(T));c=i.skins.length;for(g.setArraySize(i.skins,l=c+a.readInt(!0));c<l;c++){if(!(E=this.readSkin(a,i,!1,h)))throw new Error("readSkin() should not have returned null.");i.skins[c]=E}l=this.linkedMeshes.length;for(c=0;c<l;c++){var C=this.linkedMeshes[c],E=i.skins[C.skinIndex];if(!C.parent)throw new Error("Linked mesh parent must not be null");var F=E.getAttachment(C.slotIndex,C.parent);if(!F)throw new Error("Parent mesh not found: ".concat(C.parent));C.mesh.timelineAttachment=C.inheritTimeline?F:C.mesh,C.mesh.setParentMesh(F),null!=C.mesh.region&&C.mesh.updateRegion()}this.linkedMeshes.length=0,l=a.readInt(!0);for(c=0;c<l;c++){var B=a.readString();if(!B)throw new Error("Event data name must not be null");(y=new $t(B)).intValue=a.readInt(!1),y.floatValue=a.readFloat(),y.stringValue=a.readString(),y.audioPath=a.readString(),y.audioPath&&(y.volume=a.readFloat(),y.balance=a.readFloat()),i.events.push(y)}l=a.readInt(!0);for(c=0;c<l;c++){var Y=a.readString();if(!Y)throw new Error("Animatio name must not be null.");i.animations.push(this.readAnimation(a,Y,i))}return i},e.prototype.readSkin=function(t,e,n,r){var i=null,a=0;if(n){if(0==(a=t.readInt(!0)))return null;i=new fe("default")}else{var s=t.readString();if(!s)throw new Error("Skin name must not be null.");i=new fe(s),r&&u.rgba8888ToColor(i.color,t.readInt32()),i.bones.length=t.readInt(!0);for(var o=0,h=i.bones.length;o<h;o++)i.bones[o]=e.bones[t.readInt(!0)];for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.ikConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.transformConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.pathConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)i.constraints.push(e.physicsConstraints[t.readInt(!0)]);a=t.readInt(!0)}for(o=0;o<a;o++)for(var l=t.readInt(!0),c=0,d=t.readInt(!0);c<d;c++){var f=t.readStringRef();if(!f)throw new Error("Attachment name must not be null");var p=this.readAttachment(t,e,i,l,f,r);p&&i.setAttachment(l,f,p)}return i},e.prototype.readAttachment=function(t,e,n,r,i,a){var s=this.scale,o=t.readByte(),h=0!=(8&o)?t.readStringRef():i;if(!h)throw new Error("Attachment name must not be null");switch(7&o){case me.Region:var l=0!=(16&o)?t.readStringRef():null,c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null,f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),v=t.readFloat(),y=t.readFloat(),x=t.readFloat(),w=t.readFloat();l||(l=h);var b=this.attachmentLoader.newRegionAttachment(n,h,l,d);return b?(b.path=l,b.x=p*s,b.y=m*s,b.scaleX=v,b.scaleY=y,b.rotation=f,b.width=x*s,b.height=w*s,u.rgba8888ToColor(b.color,c),b.sequence=d,null==d&&b.updateRegion(),b):null;case me.BoundingBox:var M=this.readVertices(t,0!=(16&o)),S=(c=a?t.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(n,h));return S?(S.worldVerticesLength=M.length,S.vertices=M.vertices,S.bones=M.bones,a&&u.rgba8888ToColor(S.color,c),S):null;case me.Mesh:l=0!=(16&o)?t.readStringRef():h,c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null;var k=t.readInt(!0),A=(M=this.readVertices(t,0!=(128&o)),this.readFloatArray(t,M.length,1)),I=this.readShortArray(t,3*(M.length-k-2)),T=[];x=0,w=0;return a&&(T=this.readShortArray(t,t.readInt(!0)),x=t.readFloat(),w=t.readFloat()),l||(l=h),(C=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(C.path=l,u.rgba8888ToColor(C.color,c),C.bones=M.bones,C.vertices=M.vertices,C.worldVerticesLength=M.length,C.triangles=I,C.regionUVs=A,null==d&&C.updateRegion(),C.hullLength=k<<1,C.sequence=d,a&&(C.edges=T,C.width=x*s,C.height=w*s),C):null;case me.LinkedMesh:if(null==(l=0!=(16&o)?t.readStringRef():h))throw new Error("Path of linked mesh must not be null");c=0!=(32&o)?t.readInt32():4294967295,d=0!=(64&o)?this.readSequence(t):null;var C,E=0!=(128&o),F=t.readInt(!0),B=t.readStringRef();x=0,w=0;return a&&(x=t.readFloat(),w=t.readFloat()),(C=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(C.path=l,u.rgba8888ToColor(C.color,c),C.sequence=d,a&&(C.width=x*s,C.height=w*s),this.linkedMeshes.push(new xe(C,F,r,B,E)),C):null;case me.Path:for(var Y=0!=(16&o),R=0!=(32&o),P=(M=this.readVertices(t,0!=(64&o)),g.newArray(M.length/6,0)),X=0,V=P.length;X<V;X++)P[X]=t.readFloat()*s;c=a?t.readInt32():0;return(l=this.attachmentLoader.newPathAttachment(n,h))?(l.closed=Y,l.constantSpeed=R,l.worldVerticesLength=M.length,l.vertices=M.vertices,l.bones=M.bones,l.lengths=P,a&&u.rgba8888ToColor(l.color,c),l):null;case me.Point:f=t.readFloat(),p=t.readFloat(),m=t.readFloat(),c=a?t.readInt32():0;var D=this.attachmentLoader.newPointAttachment(n,h);return D?(D.x=p*s,D.y=m*s,D.rotation=f,a&&u.rgba8888ToColor(D.color,c),D):null;case me.Clipping:var L=t.readInt(!0),N=(M=this.readVertices(t,0!=(16&o)),c=a?t.readInt32():0,this.attachmentLoader.newClippingAttachment(n,h));return N?(N.endSlot=e.slots[L],N.worldVerticesLength=M.length,N.vertices=M.vertices,N.bones=M.bones,a&&u.rgba8888ToColor(N.color,c),N):null}return null},e.prototype.readSequence=function(t){if(!t.readBoolean())return null;var e=new k(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e},e.prototype.readVertices=function(t,e){var n=this.scale,r=t.readInt(!0),i=new we;if(i.length=r<<1,!e)return i.vertices=this.readFloatArray(t,i.length,n),i;for(var a=new Array,s=new Array,o=0;o<r;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()*n),a.push(t.readFloat()*n),a.push(t.readFloat())}return i.vertices=g.toFloatArray(a),i.bones=s,i},e.prototype.readFloatArray=function(t,e,n){var r=new Array(e);if(1==n)for(var i=0;i<e;i++)r[i]=t.readFloat();else for(i=0;i<e;i++)r[i]=t.readFloat()*n;return r},e.prototype.readShortArray=function(t,e){for(var n=new Array(e),r=0;r<e;r++)n[r]=t.readInt(!0);return n},e.prototype.readAnimation=function(e,n,r){e.readInt(!0);for(var i=new Array,a=this.scale,s=0,o=e.readInt(!0);s<o;s++)for(var h=e.readInt(!0),l=0,c=e.readInt(!0);l<c;l++){var u=e.readByte(),d=(yt=e.readInt(!0))-1;switch(u){case Xe:for(var f=new K(yt,h),p=0;p<yt;p++)f.setFrame(p,e.readFloat(),e.readStringRef());i.push(f);break;case Ve:for(var m=e.readInt(!0),v=(f=new z(yt,m,h),e.readFloat()),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,M=(p=0,0);f.setFrame(p,v,y,x,w,b),p!=d;p++){var S=e.readFloat(),k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,k,1),Se(e,f,M++,p,1,v,S,x,A,1),Se(e,f,M++,p,2,v,S,w,I,1),Se(e,f,M++,p,3,v,S,b,E,1)}v=S,y=k,x=A,w=I,b=E}i.push(f);break;case De:for(m=e.readInt(!0),f=new G(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w),p!=d;p++){S=e.readFloat(),k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,k,1),Se(e,f,M++,p,1,v,S,x,A,1),Se(e,f,M++,p,2,v,S,w,I,1)}v=S,y=k,x=A,w=I}i.push(f);break;case Le:for(m=e.readInt(!0),f=new j(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,b,k,A,I),p!=d;p++){S=e.readFloat();var F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,at=e.readUnsignedByte()/255,mt=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,F,1),Se(e,f,M++,p,1,v,S,x,B,1),Se(e,f,M++,p,2,v,S,w,Y,1),Se(e,f,M++,p,3,v,S,b,R,1),Se(e,f,M++,p,4,v,S,k,P,1),Se(e,f,M++,p,5,v,S,A,at,1),Se(e,f,M++,p,6,v,S,I,mt,1)}v=S,y=F,x=B,w=Y,b=R,k=P,A=at,I=mt}i.push(f);break;case Ne:for(m=e.readInt(!0),f=new J(yt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,k,A,I),p!=d;p++){S=e.readFloat(),F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,at=e.readUnsignedByte()/255,mt=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,y,F,1),Se(e,f,M++,p,1,v,S,x,B,1),Se(e,f,M++,p,2,v,S,w,Y,1),Se(e,f,M++,p,3,v,S,k,P,1),Se(e,f,M++,p,4,v,S,A,at,1),Se(e,f,M++,p,5,v,S,I,mt,1)}v=S,y=F,x=B,w=Y,k=P,A=at,I=mt}i.push(f);break;case Oe:for(f=new H(yt,e.readInt(!0),h),v=e.readFloat(),b=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,b),p!=d;p++){S=e.readFloat(),E=e.readUnsignedByte()/255;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,b,E,1)}v=S,b=E}i.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var gt=e.readInt(!0);for(l=0,c=e.readInt(!0);l<c;l++){var vt=e.readByte(),yt=e.readInt(!0);m=e.readInt(!0);switch(vt){case Ae:i.push(be(e,new X(yt,m,gt),1));break;case Ie:i.push(Me(e,new V(yt,m,gt),a));break;case Te:i.push(be(e,new D(yt,m,gt),a));break;case Ce:i.push(be(e,new L(yt,m,gt),a));break;case Ee:i.push(Me(e,new N(yt,m,gt),1));break;case Fe:i.push(be(e,new O(yt,m,gt),1));break;case Be:i.push(be(e,new _(yt,m,gt),1));break;case Ye:i.push(Me(e,new q(yt,m,gt),1));break;case Re:i.push(be(e,new U(yt,m,gt),1));break;case Pe:i.push(be(e,new W(yt,m,gt),1))}}}for(s=0,o=e.readInt(!0);s<o;s++){var xt=e.readInt(!0),wt=(d=(yt=e.readInt(!0))-1,f=new tt(yt,e.readInt(!0),xt),v=e.readFloat(),e.readFloat()),bt=e.readFloat()*a;for(p=0,M=0;;p++){var Mt=e.readByte();if(f.setFrame(p,v,wt,bt,e.readByte(),0!=(1&Mt),0!=(2&Mt)),p==d)break;S=e.readFloat();var St=e.readFloat(),kt=e.readFloat()*a;switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,wt,St,1),Se(e,f,M++,p,1,v,S,bt,kt,a)}v=S,wt=St,bt=kt}i.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){xt=e.readInt(!0),d=(yt=e.readInt(!0))-1,f=new et(yt,e.readInt(!0),xt),v=e.readFloat();var At=e.readFloat(),It=e.readFloat(),Tt=e.readFloat(),Ct=e.readFloat(),Et=e.readFloat(),Ft=e.readFloat();for(p=0,M=0;f.setFrame(p,v,At,It,Tt,Ct,Et,Ft),p!=d;p++){S=e.readFloat();var Bt=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat(),Xt=e.readFloat(),Vt=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,At,Bt,1),Se(e,f,M++,p,1,v,S,It,Yt,1),Se(e,f,M++,p,2,v,S,Tt,Rt,1),Se(e,f,M++,p,3,v,S,Ct,Pt,1),Se(e,f,M++,p,4,v,S,Et,Xt,1),Se(e,f,M++,p,5,v,S,Ft,Vt,1)}v=S,At=Bt,It=Yt,Tt=Rt,Ct=Pt,Et=Xt,Ft=Vt}i.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){xt=e.readInt(!0);var Dt=r.pathConstraints[xt];for(l=0,c=e.readInt(!0);l<c;l++){vt=e.readByte(),yt=e.readInt(!0),m=e.readInt(!0);switch(vt){case Ue:i.push(be(e,new nt(yt,m,xt),Dt.positionMode==t.PositionMode.Fixed?a:1));break;case We:i.push(be(e,new rt(yt,m,xt),Dt.spacingMode==t.SpacingMode.Length||Dt.spacingMode==t.SpacingMode.Fixed?a:1));break;case ze:for(f=new it(yt,m,xt),v=e.readFloat(),At=e.readFloat(),It=e.readFloat(),Tt=e.readFloat(),p=0,M=0,d=f.getFrameCount()-1;f.setFrame(p,v,At,It,Tt),p!=d;p++){S=e.readFloat(),Bt=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,At,Bt,1),Se(e,f,M++,p,1,v,S,It,Yt,1),Se(e,f,M++,p,2,v,S,Tt,Rt,1)}v=S,At=Bt,It=Yt,Tt=Rt}i.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++)for(xt=e.readInt(!0)-1,l=0,c=e.readInt(!0);l<c;l++){vt=e.readByte(),yt=e.readInt(!0);if(vt!=$e){m=e.readInt(!0);switch(vt){case Ge:i.push(be(e,new st(yt,m,xt),1));break;case He:i.push(be(e,new ot(yt,m,xt),1));break;case je:i.push(be(e,new ht(yt,m,xt),1));break;case Je:i.push(be(e,new lt(yt,m,xt),1));break;case Ke:i.push(be(e,new ct(yt,m,xt),a));break;case Qe:i.push(be(e,new ut(yt,m,xt),a));break;case Ze:i.push(be(e,new dt(yt,m,xt),1))}}else{for(f=new ft(yt,xt),p=0;p<yt;p++)f.setFrame(p,e.readFloat());i.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var Lt=r.skins[e.readInt(!0)];for(l=0,c=e.readInt(!0);l<c;l++){h=e.readInt(!0);for(var Nt=0,Ot=e.readInt(!0);Nt<Ot;Nt++){var _t=e.readStringRef();if(!_t)throw new Error("attachmentName must not be null.");var qt=Lt.getAttachment(h,_t);u=e.readByte(),d=(yt=e.readInt(!0))-1;switch(u){case _e:var Ut=qt,Wt=Ut.bones,zt=Ut.vertices,Gt=Wt?zt.length/3*2:zt.length;for(m=e.readInt(!0),f=new Q(yt,m,h,Ut),v=e.readFloat(),p=0,M=0;;p++){var Ht=void 0,jt=e.readInt(!0);if(0==jt)Ht=Wt?g.newFloatArray(Gt):zt;else{Ht=g.newFloatArray(Gt);var Jt=e.readInt(!0);if(jt+=Jt,1==a)for(var Kt=Jt;Kt<jt;Kt++)Ht[Kt]=e.readFloat();else for(Kt=Jt;Kt<jt;Kt++)Ht[Kt]=e.readFloat()*a;if(!Wt){Kt=0;for(var Qt=Ht.length;Kt<Qt;Kt++)Ht[Kt]+=zt[Kt]}}if(f.setFrame(p,v,Ht),p==d)break;S=e.readFloat();switch(e.readByte()){case tn:f.setStepped(p);break;case en:Se(e,f,M++,p,0,v,S,0,1,1)}v=S}i.push(f);break;case qe:for(f=new pt(yt,h,qt),p=0;p<yt;p++){v=e.readFloat();var $t=e.readInt32();f.setFrame(p,v,T[15&$t],$t>>4,e.readFloat())}i.push(f)}}}}var te=e.readInt(!0);if(te>0){f=new $(te);var ee=r.slots.length;for(s=0;s<te;s++){v=e.readFloat();var ne=e.readInt(!0),re=g.newArray(ee,0);for(l=ee-1;l>=0;l--)re[l]=-1;var ie=g.newArray(ee-ne,0),ae=0,se=0;for(l=0;l<ne;l++){for(h=e.readInt(!0);ae!=h;)ie[se++]=ae++;re[ae+e.readInt(!0)]=ae++}for(;ae<ee;)ie[se++]=ae++;for(l=ee-1;l>=0;l--)-1==re[l]&&(re[l]=ie[--se]);f.setFrame(s,v,re)}i.push(f)}var oe=e.readInt(!0);if(oe>0){for(f=new Z(oe),s=0;s<oe;s++){v=e.readFloat();var he=r.events[e.readInt(!0)],le=new Zt(v,he);le.intValue=e.readInt(!1),le.floatValue=e.readFloat(),le.stringValue=e.readString(),null==le.stringValue&&(le.stringValue=he.stringValue),le.data.audioPath&&(le.volume=e.readFloat(),le.balance=e.readFloat()),f.setFrame(s,le)}i.push(f)}var ce=0;for(s=0,o=i.length;s<o;s++)ce=Math.max(ce,i[s].getDuration());return new C(n,i,ce)},e}(),ye=function(){function t(t,e,n,r){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===r&&(r=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=r}return t.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},t.prototype.readUnsignedByte=function(){return this.buffer.getUint8(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(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)},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="",n=0;n<t;){var r=this.readUnsignedByte();switch(r>>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}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}(),xe=function(t,e,n,r,i){this.mesh=t,this.skinIndex=e,this.slotIndex=n,this.parent=r,this.inheritTimeline=i},we=function(t,e,n){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=0),this.bones=t,this.vertices=e,this.length=n};function be(t,e,n){for(var r=t.readFloat(),i=t.readFloat()*n,a=0,s=0,o=e.getFrameCount()-1;e.setFrame(a,r,i),a!=o;a++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case tn:e.setStepped(a);break;case en:Se(t,e,s++,a,0,r,h,i,l,n)}r=h,i=l}return e}function Me(t,e,n){for(var r=t.readFloat(),i=t.readFloat()*n,a=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,r,i,a),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case tn:e.setStepped(s);break;case en:Se(t,e,o++,s,0,r,l,i,c,n),Se(t,e,o++,s,1,r,l,a,u,n)}r=l,i=c,a=u}return e}function Se(t,e,n,r,i,a,s,o,h,l){e.setBezier(n,r,i,a,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(me||(me={}));var ke,Ae=0,Ie=1,Te=2,Ce=3,Ee=4,Fe=5,Be=6,Ye=7,Re=8,Pe=9,Xe=0,Ve=1,De=2,Le=3,Ne=4,Oe=5,_e=0,qe=1,Ue=0,We=1,ze=2,Ge=0,He=1,je=2,Je=4,Ke=5,Qe=6,Ze=7,$e=8,tn=1,en=2,nn=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 y((function(){return g.newFloatArray(16)}))}return t.prototype.update=function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,i=this.polygonPool,a=t.slots,s=a.length;n.length=0,i.freeAll(r),r.length=0;for(var o=0;o<s;o++){var h=a[o];if(h.bone.active){var l=h.getAttachment();if(l instanceof Et){var c=l;n.push(c);var u=i.obtain();u.length!=c.worldVerticesLength&&(u=g.newFloatArray(c.worldVerticesLength)),r.push(u),c.computeWorldVertices(h,0,c.worldVerticesLength,u,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,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=this.polygons,a=0,s=i.length;a<s;a++)for(var o=i[a],h=o,l=0,c=o.length;l<c;l+=2){var u=h[l],d=h[l+1];t=Math.min(t,u),e=Math.min(e,d),n=Math.max(n,u),r=Math.max(r,d)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=r},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,n,r){var i=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=s&&n>=s||e>=o&&r>=o)return!1;var h=(r-e)/(n-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 c=(a-e)/h+t;return c>i&&c<s||(c=(o-e)/h+t)>i&&c<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 n=this.polygons,r=0,i=n.length;r<i;r++)if(this.containsPointPolygon(n[r],t,e))return this.boundingBoxes[r];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var r=t,i=t.length,a=i-2,s=!1,o=0;o<i;o+=2){var h=r[o+1],l=r[a+1];if(h<n&&l>=n||l<n&&h>=n){var c=r[o];c+(n-h)/(l-h)*(r[a]-c)<e&&(s=!s)}a=o}return s},t.prototype.intersectsSegment=function(t,e,n,r){for(var i=this.polygons,a=0,s=i.length;a<s;a++)if(this.intersectsSegmentPolygon(i[a],t,e,n,r))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,r,i){for(var a=t,s=t.length,o=e-r,h=n-i,l=e*i-n*r,c=a[s-2],u=a[s-1],d=0;d<s;d+=2){var f=a[d],p=a[d+1],m=c*p-u*f,g=c-f,v=u-p,y=o*v-h*g,x=(l*g-o*m)/y;if((x>=c&&x<=f||x>=f&&x<=c)&&(x>=e&&x<=r||x>=r&&x<=e)){var w=(l*v-h*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}c=f,u=p}return!1},t.prototype.getPolygon=function(t){if(!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}(),rn=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 y((function(){return new Array})),this.polygonIndicesPool=new y((function(){return new Array}))}return t.prototype.triangulate=function(e){var n=e,r=e.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a<r;a++)i[a]=a;var s=this.isConcaveArray;s.length=0;a=0;for(var o=r;a<o;++a)s[a]=t.isConcave(a,r,n,i);var h=this.triangles;for(h.length=0;r>3;){for(var l=r-1,c=(a=0,1);;){t:if(!s[a]){for(var u=i[l]<<1,d=i[a]<<1,f=i[c]<<1,p=n[u],m=n[u+1],g=n[d],v=n[d+1],y=n[f],x=n[f+1],w=(c+1)%r;w!=l;w=(w+1)%r)if(s[w]){var b=i[w]<<1,M=n[b],S=n[b+1];if(t.positiveArea(y,x,p,m,M,S)&&t.positiveArea(p,m,g,v,M,S)&&t.positiveArea(g,v,y,x,M,S))break t}break}if(0==c){do{if(!s[a])break;a--}while(a>0);break}l=a,a=c,c=(c+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),s.splice(a,1);var k=(--r+a-1)%r,A=a==r?0:a;s[k]=t.isConcave(k,r,n,i),s[A]=t.isConcave(A,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},t.prototype.decompose=function(e,n){var r=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,c=0,u=n.length;c<u;c+=3){var d=n[c]<<1,f=n[c+1]<<1,p=n[c+2]<<1,m=r[d],g=r[d+1],v=r[f],y=r[f+1],x=r[p],w=r[p+1],b=!1;if(h==d){var M=o.length-4,S=t.winding(o[M],o[M+1],o[M+2],o[M+3],x,w),k=t.winding(x,w,o[0],o[1],o[2],o[3]);S==l&&k==l&&(o.push(x),o.push(w),s.push(p),b=!0)}b||(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(x),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(d),s.push(f),s.push(p),l=t.winding(m,g,v,y,x,w),h=d)}o.length>0&&(i.push(o),a.push(s));for(c=0,u=i.length;c<u;c++)if(0!=(s=a[c]).length)for(var A=s[0],I=s[s.length-1],T=(o=i[c])[M=o.length-4],C=o[M+1],E=o[M+2],F=o[M+3],B=o[0],Y=o[1],R=o[2],P=o[3],X=t.winding(T,C,E,F,B,Y),V=0;V<u;V++)if(V!=c){var D=a[V];if(3==D.length){var L=D[0],N=D[1],O=D[2],_=i[V];x=_[_.length-2],w=_[_.length-1];if(L==A&&N==I){S=t.winding(T,C,E,F,x,w),k=t.winding(x,w,B,Y,R,P);S==X&&k==X&&(_.length=0,D.length=0,o.push(x),o.push(w),s.push(O),T=E,C=F,E=x,F=w,V=0)}}}for(c=i.length-1;c>=0;c--)0==(o=i[c]).length&&(i.splice(c,1),this.polygonPool.free(o),s=a[c],a.splice(c,1),this.polygonIndicesPool.free(s));return i},t.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[s],n[s+1])},t.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},t.winding=function(t,e,n,r,i,a){var s=n-t,o=r-e;return i*o-a*s+s*e-t*o>=0?1:-1},t}(),an=function(){function t(){this.triangulator=new rn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return t.prototype.clipStart=function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,i=g.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(e,0,r,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){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},t.prototype.clipEnd=function(){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,n,r,i,a,s,o){var h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,f=o?12:8,p=0;l.length=0,c.length=0;t:for(var m=0;m<r;m+=3)for(var v=n[m]<<1,y=t[v],x=t[v+1],w=i[v],b=i[v+1],M=t[v=n[m+1]<<1],S=t[v+1],k=i[v],A=i[v+1],I=t[v=n[m+2]<<1],T=t[v+1],C=i[v],E=i[v+1],F=0;F<d;F++){var B=l.length;if(!this.clip(y,x,M,S,I,T,u[F],h)){(O=g.setArraySize(l,B+3*f))[B]=y,O[B+1]=x,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a,o?(O[B+6]=w,O[B+7]=b,O[B+8]=s.r,O[B+9]=s.g,O[B+10]=s.b,O[B+11]=s.a,O[B+12]=M,O[B+13]=S,O[B+14]=a.r,O[B+15]=a.g,O[B+16]=a.b,O[B+17]=a.a,O[B+18]=k,O[B+19]=A,O[B+20]=s.r,O[B+21]=s.g,O[B+22]=s.b,O[B+23]=s.a,O[B+24]=I,O[B+25]=T,O[B+26]=a.r,O[B+27]=a.g,O[B+28]=a.b,O[B+29]=a.a,O[B+30]=C,O[B+31]=E,O[B+32]=s.r,O[B+33]=s.g,O[B+34]=s.b,O[B+35]=s.a):(O[B+6]=w,O[B+7]=b,O[B+8]=M,O[B+9]=S,O[B+10]=a.r,O[B+11]=a.g,O[B+12]=a.b,O[B+13]=a.a,O[B+14]=k,O[B+15]=A,O[B+16]=I,O[B+17]=T,O[B+18]=a.r,O[B+19]=a.g,O[B+20]=a.b,O[B+21]=a.a,O[B+22]=C,O[B+23]=E),B=c.length,(J=g.setArraySize(c,B+3))[B]=p,J[B+1]=p+1,J[B+2]=p+2,p+=3;continue t}var Y=h.length;if(0!=Y){for(var R=S-T,P=I-M,X=y-I,V=T-x,D=1/(R*X+P*(x-T)),L=Y>>1,N=this.clipOutput,O=g.setArraySize(l,B+L*f),_=0;_<Y;_+=2){var q=N[_],U=N[_+1];O[B]=q,O[B+1]=U,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a;var W=q-I,z=U-T,G=(R*W+P*z)*D,H=(V*W+X*z)*D,j=1-G-H;O[B+6]=w*G+k*H+C*j,O[B+7]=b*G+A*H+E*j,o&&(O[B+8]=s.r,O[B+9]=s.g,O[B+10]=s.b,O[B+11]=s.a),B+=f}B=c.length;var J=g.setArraySize(c,B+3*(L-2));L--;for(_=1;_<L;_++)J[B]=p,J[B+1]=p+_,J[B+2]=p+_+1,B+=3;p+=L+1}}},t.prototype.clip=function(t,e,n,r,i,a,s,o){var h,l=o,c=!1;s.length%4>=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(r),h.push(i),h.push(a),h.push(t),h.push(e),o.length=0;for(var u=s,d=s.length-4,f=0;;f+=2){for(var p=u[f],m=u[f+1],g=u[f+2],v=u[f+3],y=p-g,x=m-v,w=h,b=h.length-2,M=o.length,S=0;S<b;S+=2){var k=w[S],A=w[S+1],I=w[S+2],T=w[S+3],C=y*(T-v)-x*(I-g)>0;if(y*(A-v)-x*(k-g)>0){if(C){o.push(I),o.push(T);continue}var E=(B=T-A)*(g-p)-(Y=I-k)*(v-m);if(Math.abs(E)>1e-6){var F=(Y*(m-A)-B*(p-k))/E;o.push(p+(g-p)*F),o.push(m+(v-m)*F)}else o.push(p),o.push(m)}else if(C){var B,Y;E=(B=T-A)*(g-p)-(Y=I-k)*(v-m);if(Math.abs(E)>1e-6){F=(Y*(m-A)-B*(p-k))/E;o.push(p+(g-p)*F),o.push(m+(v-m)*F)}else o.push(p),o.push(m);o.push(I),o.push(T)}c=!0}if(M==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),f==d)break;var R=o;(o=h).length=0,h=R}if(l!=o){l.length=0;f=0;for(var P=o.length-2;f<P;f++)l[f]=o[f]}else l.length=l.length-2;return c},t.makeClockwise=function(t){for(var e=t,n=t.length,r=e[n-2]*e[1]-e[0]*e[n-1],i=0,a=0,s=0,o=0,h=n-3;o<h;o+=2)i=e[o],a=e[o+1],s=e[o+2],r+=i*e[o+3]-s*a;if(!(r<0)){o=0;var l=n-2;for(h=n>>1;o<h;o+=2){var c=e[o],u=e[o+1],d=l-o;e[o]=e[d],e[o+1]=e[d+1],e[d]=c,e[d+1]=u}}},t}(),sn=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n=this.scale,r=new ue,i="string"==typeof e?JSON.parse(e):e,a=i.skeleton;if(a&&(r.hash=a.hash,r.version=a.spine,r.x=a.x,r.y=a.y,r.width=a.width,r.height=a.height,r.fps=a.fps,r.imagesPath=a.images),i.bones)for(var s=0;s<i.bones.length;s++){var o=i.bones[s],h=null,l=un(o,"parent",null);l&&(h=r.findBone(l)),(p=new Wt(r.bones.length,o.name,h)).length=un(o,"length",0)*n,p.x=un(o,"x",0)*n,p.y=un(o,"y",0)*n,p.rotation=un(o,"rotation",0),p.scaleX=un(o,"scaleX",1),p.scaleY=un(o,"scaleY",1),p.shearX=un(o,"shearX",0),p.shearY=un(o,"shearY",0),p.transformMode=g.enumValue(t.TransformMode,un(o,"transform","Normal")),p.skinRequired=un(o,"skin",!1),(f=un(o,"color",null))&&p.color.setFromString(f),r.bones.push(p)}if(i.slots)for(s=0;s<i.slots.length;s++){var c=i.slots[s],d=r.findBone(c.bone);if(!d)throw new Error("Couldn't find bone ".concat(c.bone," for slot ").concat(c.name));var f,p=new pe(r.slots.length,c.name,d);(f=un(c,"color",null))&&p.color.setFromString(f);var m=un(c,"dark",null);m&&(p.darkColor=u.fromString(m)),p.attachmentName=un(c,"attachment",null),p.blendMode=g.enumValue(t.BlendMode,un(c,"blend","normal")),r.slots.push(p)}if(i.ik)for(s=0;s<i.ik.length;s++){var v=i.ik[s];(p=new ee(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(var y=0;y<v.bones.length;y++){if(!(k=r.findBone(v.bones[y])))throw new Error("Couldn't find bone ".concat(v.bones[y]," for IK constraint ").concat(v.name,"."));p.bones.push(k)}if(!(b=r.findBone(v.target)))throw new Error("Couldn't find target bone ".concat(v.target," for IK constraint ").concat(v.name,"."));p.target=b,p.mix=un(v,"mix",1),p.softness=un(v,"softness",0)*n,p.bendDirection=un(v,"bendPositive",!0)?1:-1,p.compress=un(v,"compress",!1),p.stretch=un(v,"stretch",!1),p.uniform=un(v,"uniform",!1),r.ikConstraints.push(p)}if(i.transform)for(s=0;s<i.transform.length;s++){v=i.transform[s];(p=new ge(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(y=0;y<v.bones.length;y++){var x=v.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for transform constraint ").concat(v.name,"."));p.bones.push(k)}var w=v.target;if(!(b=r.findBone(w)))throw new Error("Couldn't find target bone ".concat(w," for transform constraint ").concat(v.name,"."));p.target=b,p.local=un(v,"local",!1),p.relative=un(v,"relative",!1),p.offsetRotation=un(v,"rotation",0),p.offsetX=un(v,"x",0)*n,p.offsetY=un(v,"y",0)*n,p.offsetScaleX=un(v,"scaleX",0),p.offsetScaleY=un(v,"scaleY",0),p.offsetShearY=un(v,"shearY",0),p.mixRotate=un(v,"mixRotate",1),p.mixX=un(v,"mixX",1),p.mixY=un(v,"mixY",p.mixX),p.mixScaleX=un(v,"mixScaleX",1),p.mixScaleY=un(v,"mixScaleY",p.mixScaleX),p.mixShearY=un(v,"mixShearY",1),r.transformConstraints.push(p)}if(i.path)for(s=0;s<i.path.length;s++){v=i.path[s];(p=new ne(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);for(y=0;y<v.bones.length;y++){x=v.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for path constraint ").concat(v.name,"."));p.bones.push(k)}var b;w=v.target;if(!(b=r.findSlot(w)))throw new Error("Couldn't find target slot ".concat(w," for path constraint ").concat(v.name,"."));p.target=b,p.positionMode=g.enumValue(t.PositionMode,un(v,"positionMode","Percent")),p.spacingMode=g.enumValue(t.SpacingMode,un(v,"spacingMode","Length")),p.rotateMode=g.enumValue(t.RotateMode,un(v,"rotateMode","Tangent")),p.offsetRotation=un(v,"rotation",0),p.position=un(v,"position",0),p.positionMode==t.PositionMode.Fixed&&(p.position*=n),p.spacing=un(v,"spacing",0),p.spacingMode!=t.SpacingMode.Length&&p.spacingMode!=t.SpacingMode.Fixed||(p.spacing*=n),p.mixRotate=un(v,"mixRotate",1),p.mixX=un(v,"mixX",1),p.mixY=un(v,"mixY",p.mixX),r.pathConstraints.push(p)}if(i.physics)for(s=0;s<i.physics.length;s++){v=i.physics[s];(p=new ce(v.name)).order=un(v,"order",0),p.skinRequired=un(v,"skin",!1);x=v.bone;if(null==(k=r.findBone(x)))throw new Error("Physics bone not found: "+x);p.bone=k,p.x=un(v,"x",0),p.y=un(v,"y",0),p.rotate=un(v,"rotate",0),p.scaleX=un(v,"scaleX",0),p.shearX=un(v,"shearX",0),p.step=1/un(v,"fps",60),p.inertia=un(v,"inertia",1),p.strength=un(v,"strength",100),p.damping=un(v,"damping",1),p.massInverse=1/un(v,"mass",1),p.wind=un(v,"wind",0)*n,p.gravity=un(v,"gravity",0)*n,p.mix=un(v,"mix",1),p.inertiaGlobal=un(v,"inertiaGlobal",!1),p.strengthGlobal=un(v,"strengthGlobal",!1),p.dampingGlobal=un(v,"dampingGlobal",!1),p.massGlobal=un(v,"massGlobal",!1),p.windGlobal=un(v,"windGlobal",!1),p.gravityGlobal=un(v,"gravityGlobal",!1),p.mixGlobal=un(v,"mixGlobal",!1),r.physicsConstraints.push(p)}if(i.skins)for(s=0;s<i.skins.length;s++){var M=i.skins[s],S=new fe(M.name);if(M.bones)for(y=0;y<M.bones.length;y++){var k;x=M.bones[y];if(!(k=r.findBone(x)))throw new Error("Couldn't find bone ".concat(x," for skin ").concat(M.name,"."));S.bones.push(k)}if(M.ik)for(y=0;y<M.ik.length;y++){var A=M.ik[y];if(!(I=r.findIkConstraint(A)))throw new Error("Couldn't find IK constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.transform)for(y=0;y<M.transform.length;y++){A=M.transform[y];if(!(I=r.findTransformConstraint(A)))throw new Error("Couldn't find transform constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.path)for(y=0;y<M.path.length;y++){A=M.path[y];if(!(I=r.findPathConstraint(A)))throw new Error("Couldn't find path constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}if(M.physics)for(y=0;y<M.physics.length;y++){var I;A=M.physics[y];if(!(I=r.findPhysicsConstraint(A)))throw new Error("Couldn't find physics constraint ".concat(A," for skin ").concat(M.name,"."));S.constraints.push(I)}for(var T in M.attachments){var C=r.findSlot(T);if(!C)throw new Error("Couldn't find slot ".concat(T," for skin ").concat(M.name,"."));c=M.attachments[T];for(var E in c){var F=this.readAttachment(c[E],S,C.index,E,r);F&&S.setAttachment(C.index,E,F)}}r.skins.push(S),"default"==S.name&&(r.defaultSkin=S)}s=0;for(var B=this.linkedMeshes.length;s<B;s++){var Y=this.linkedMeshes[s];if(!(S=Y.skin?r.findSkin(Y.skin):r.defaultSkin))throw new Error("Skin not found: ".concat(Y.skin));var R=S.getAttachment(Y.slotIndex,Y.parent);if(!R)throw new Error("Parent mesh not found: ".concat(Y.parent));Y.mesh.timelineAttachment=Y.inheritTimeline?R:Y.mesh,Y.mesh.setParentMesh(R),null!=Y.mesh.region&&Y.mesh.updateRegion()}if(this.linkedMeshes.length=0,i.events)for(var P in i.events){var X=i.events[P];(p=new $t(P)).intValue=un(X,"int",0),p.floatValue=un(X,"float",0),p.stringValue=un(X,"string",""),p.audioPath=un(X,"audio",null),p.audioPath&&(p.volume=un(X,"volume",1),p.balance=un(X,"balance",0)),r.events.push(p)}if(i.animations)for(var V in i.animations){var D=i.animations[V];this.readAnimation(D,V,r)}return r},e.prototype.readAttachment=function(t,e,n,r,i){var a=this.scale;switch(r=un(t,"name",r),un(t,"type","region")){case"region":var s=un(t,"path",r),o=this.readSequence(un(t,"sequence",null)),h=this.attachmentLoader.newRegionAttachment(e,r,s,o);return h?(h.path=s,h.x=un(t,"x",0)*a,h.y=un(t,"y",0)*a,h.scaleX=un(t,"scaleX",1),h.scaleY=un(t,"scaleY",1),h.rotation=un(t,"rotation",0),h.width=t.width*a,h.height=t.height*a,h.sequence=o,(w=un(t,"color",null))&&h.color.setFromString(w),null!=h.region&&h.updateRegion(),h):null;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,r);return l?(this.readVertices(t,l,t.vertexCount<<1),(w=un(t,"color",null))&&l.color.setFromString(w),l):null;case"mesh":case"linkedmesh":s=un(t,"path",r),o=this.readSequence(un(t,"sequence",null));var c=this.attachmentLoader.newMeshAttachment(e,r,s,o);if(!c)return null;c.path=s,(w=un(t,"color",null))&&c.color.setFromString(w),c.width=un(t,"width",0)*a,c.height=un(t,"height",0)*a,c.sequence=o;var u=un(t,"parent",null);if(u)return this.linkedMeshes.push(new on(c,un(t,"skin",null),n,u,un(t,"timelines",!0))),c;var d=t.uvs;return this.readVertices(t,c,d.length),c.triangles=t.triangles,c.regionUVs=d,null!=c.region&&c.updateRegion(),c.edges=un(t,"edges",null),c.hullLength=2*un(t,"hull",0),c;case"path":if(!(s=this.attachmentLoader.newPathAttachment(e,r)))return null;s.closed=un(t,"closed",!1),s.constantSpeed=un(t,"constantSpeed",!0);var f=t.vertexCount;this.readVertices(t,s,f<<1);for(var p=g.newArray(f/3,0),m=0;m<t.lengths.length;m++)p[m]=t.lengths[m]*a;return s.lengths=p,(w=un(t,"color",null))&&s.color.setFromString(w),s;case"point":var v=this.attachmentLoader.newPointAttachment(e,r);return v?(v.x=un(t,"x",0)*a,v.y=un(t,"y",0)*a,v.rotation=un(t,"rotation",0),(w=un(t,"color",null))&&v.color.setFromString(w),v):null;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,r);if(!y)return null;var x=un(t,"end",null);x&&(y.endSlot=i.findSlot(x));var w;f=t.vertexCount;return this.readVertices(t,y,f<<1),(w=un(t,"color",null))&&y.color.setFromString(w),y}return null},e.prototype.readSequence=function(t){if(null==t)return null;var e=new k(un(t,"count",0));return e.start=un(t,"start",1),e.digits=un(t,"digits",0),e.setupIndex=un(t,"setup",0),e},e.prototype.readVertices=function(t,e,n){var r=this.scale;e.worldVerticesLength=n;var i=t.vertices;if(n!=i.length){var a=new Array,s=new Array;for(c=0,u=i.length;c<u;){var o=i[c++];s.push(o);for(var h=c+4*o;c<h;c+=4)s.push(i[c]),a.push(i[c+1]*r),a.push(i[c+2]*r),a.push(i[c+3])}e.bones=s,e.vertices=g.toFloatArray(a)}else{var l=g.toFloatArray(i);if(1!=r)for(var c=0,u=i.length;c<u;c++)l[c]*=r;e.vertices=l}},e.prototype.readAnimation=function(e,n,r){var i=this.scale,a=new Array;if(e.slots)for(var s in e.slots){var o=e.slots[s];if(!(ue=r.findSlot(s)))throw new Error("Slot not found: "+s);var l=ue.index;for(var c in o){if(_t=o[c]){var d=_t.length;if("attachment"==c){for(var f=new K(d,l),p=0;p<d;p++){var m=_t[p];f.setFrame(p,un(m,"time",0),un(m,"name",null))}a.push(f)}else if("rgba"==c){f=new z(d,d<<2,l);for(var v=un(m=_t[0],"time",0),y=u.fromString(m.color),x=(p=0,0);;p++){if(f.setFrame(p,v,y.r,y.g,y.b,y.a),!(zt=_t[p+1])){f.shrink(x);break}var w=un(zt,"time",0),b=u.fromString(zt.color);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,y.a,b.a,1)),v=w,y=b,m=zt}a.push(f)}else if("rgb"==c){for(f=new G(d,3*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.color),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.color);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1)),v=w,y=b,m=zt}a.push(f)}else if("alpha"==c)a.push(hn(_t,new H(d,d,l),0,1));else if("rgba2"==c){f=new j(d,7*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.light);var M=u.fromString(m.dark);for(p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b,y.a,M.r,M.g,M.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.light);var S=u.fromString(zt.dark);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,y.a,b.a,1),x=cn(Qt,f,x,p,4,v,w,M.r,S.r,1),x=cn(Qt,f,x,p,5,v,w,M.g,S.g,1),x=cn(Qt,f,x,p,6,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=zt}a.push(f)}else if("rgb2"==c){for(f=new J(d,6*d,l),v=un(m=_t[0],"time",0),y=u.fromString(m.light),M=u.fromString(m.dark),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b,M.r,M.g,M.b),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),b=u.fromString(zt.light),S=u.fromString(zt.dark);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,y.r,b.r,1),x=cn(Qt,f,x,p,1,v,w,y.g,b.g,1),x=cn(Qt,f,x,p,2,v,w,y.b,b.b,1),x=cn(Qt,f,x,p,3,v,w,M.r,S.r,1),x=cn(Qt,f,x,p,4,v,w,M.g,S.g,1),x=cn(Qt,f,x,p,5,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=zt}a.push(f)}}}}if(e.bones)for(var k in e.bones){var A=e.bones[k],I=r.findBone(k);if(!I)throw new Error("Bone not found: "+k);var T=I.index;for(var c in A){var E=(_t=A[c]).length;if(0!=E)if("rotate"===c)a.push(hn(_t,new X(E,E,T),0,1));else if("translate"===c){f=new V(E,E<<1,T);a.push(ln(_t,f,"x","y",0,i))}else if("translatex"===c){f=new D(E,E,T);a.push(hn(_t,f,0,i))}else if("translatey"===c){f=new L(E,E,T);a.push(hn(_t,f,0,i))}else if("scale"===c){f=new N(E,E<<1,T);a.push(ln(_t,f,"x","y",1,1))}else if("scalex"===c){f=new O(E,E,T);a.push(hn(_t,f,1,1))}else if("scaley"===c){f=new _(E,E,T);a.push(hn(_t,f,1,1))}else if("shear"===c){f=new q(E,E<<1,T);a.push(ln(_t,f,"x","y",0,1))}else if("shearx"===c){f=new U(E,E,T);a.push(hn(_t,f,0,1))}else if("sheary"===c){f=new W(E,E,T);a.push(hn(_t,f,0,1))}}}if(e.ik)for(var F in e.ik){if(m=(Tt=e.ik[F])[0]){if(!(Et=r.findIkConstraint(F)))throw new Error("IK Constraint not found: "+F);var B=r.ikConstraints.indexOf(Et),Y=(f=new tt(Tt.length,Tt.length<<1,B),v=un(m,"time",0),un(m,"mix",1)),R=un(m,"softness",0)*i;for(p=0,x=0;;p++){if(f.setFrame(p,v,Y,R,un(m,"bendPositive",!0)?1:-1,un(m,"compress",!1),un(m,"stretch",!1)),!(zt=Tt[p+1])){f.shrink(x);break}w=un(zt,"time",0);var P=un(zt,"mix",1),at=un(zt,"softness",0)*i;(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,Y,P,1),x=cn(Qt,f,x,p,1,v,w,R,at,i)),v=w,Y=P,R=at,m=zt}a.push(f)}}if(e.transform)for(var F in e.transform){if(m=(_t=e.transform[F])[0]){if(!(Et=r.findTransformConstraint(F)))throw new Error("Transform constraint not found: "+F);B=r.transformConstraints.indexOf(Et),f=new et(_t.length,6*_t.length,B),v=un(m,"time",0);var mt=un(m,"mixRotate",1),gt=un(m,"mixX",1),vt=un(m,"mixY",gt),yt=un(m,"mixScaleX",1),xt=un(m,"mixScaleY",yt),wt=un(m,"mixShearY",1);for(p=0,x=0;;p++){if(f.setFrame(p,v,mt,gt,vt,yt,xt,wt),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0);var bt=un(zt,"mixRotate",1),Mt=un(zt,"mixX",1),St=un(zt,"mixY",Mt),kt=un(zt,"mixScaleX",1),At=un(zt,"mixScaleY",kt),It=un(zt,"mixShearY",1);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,mt,bt,1),x=cn(Qt,f,x,p,1,v,w,gt,Mt,1),x=cn(Qt,f,x,p,2,v,w,vt,St,1),x=cn(Qt,f,x,p,3,v,w,yt,kt,1),x=cn(Qt,f,x,p,4,v,w,xt,At,1),x=cn(Qt,f,x,p,5,v,w,wt,It,1)),v=w,mt=bt,gt=Mt,vt=St,yt=kt,xt=At,yt=kt,m=zt}a.push(f)}}if(e.path)for(var F in e.path){var Tt=e.path[F];if(!(Et=r.findPathConstraint(F)))throw new Error("Path constraint not found: "+F);B=r.pathConstraints.indexOf(Et);for(var c in Tt){if(m=(_t=Tt[c])[0]){var Ct=_t.length;if("position"===c){f=new nt(Ct,Ct,B);a.push(hn(_t,f,0,Et.positionMode==t.PositionMode.Fixed?i:1))}else if("spacing"===c){f=new rt(Ct,Ct,B);a.push(hn(_t,f,0,Et.spacingMode==t.SpacingMode.Length||Et.spacingMode==t.SpacingMode.Fixed?i:1))}else if("mix"===c){for(f=new it(Ct,3*Ct,B),v=un(m,"time",0),mt=un(m,"mixRotate",1),gt=un(m,"mixX",1),vt=un(m,"mixY",gt),p=0,x=0;;p++){if(f.setFrame(p,v,mt,gt,vt),!(zt=_t[p+1])){f.shrink(x);break}w=un(zt,"time",0),bt=un(zt,"mixRotate",1),Mt=un(zt,"mixX",1),St=un(zt,"mixY",Mt);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,mt,bt,1),x=cn(Qt,f,x,p,1,v,w,gt,Mt,1),x=cn(Qt,f,x,p,2,v,w,vt,St,1)),v=w,mt=bt,gt=Mt,vt=St,m=zt}a.push(f)}}}}if(e.physics)for(var F in e.physics){Tt=e.physics[F],B=-1;if(F.length>0){var Et;if(!(Et=r.findPhysicsConstraint(F)))throw new Error("Physics constraint not found: "+F);B=r.physicsConstraints.indexOf(Et)}for(var c in Tt){if(m=(_t=Tt[c])[0]){var Ft=_t.length;if("reset"!=c){f=void 0;var Bt=1;if("inertia"==c)f=new st(Ft,Ft,B);else if("strength"==c)f=new ot(Ft,Ft,B);else if("damping"==c)f=new ht(Ft,Ft,B);else if("mass"==c)f=new lt(Ft,Ft,B);else if("wind"==c)f=new ct(Ft,Ft,B),Bt=i;else if("gravity"==c)f=new ut(Ft,Ft,B),Bt=i;else{if("mix"!=c)continue;f=new dt(Ft,Ft,B)}a.push(hn(_t,f,0,Bt))}else{var Yt=new ft(_t.size,B);for(p=0;null!=m;m=_t[p+1],p++)Yt.setFrame(p,un(m,"time",0));a.push(Yt)}}}}if(e.attachments)for(var Rt in e.attachments){var Pt=e.attachments[Rt],Xt=r.findSkin(Rt);if(!Xt)throw new Error("Skin not found: "+Rt);for(var Vt in Pt){o=Pt[Vt];if(!(ue=r.findSlot(Vt)))throw new Error("Slot not found: "+Vt);l=ue.index;for(var Dt in o){var Lt=o[Dt],Nt=Xt.getAttachment(l,Dt);for(var Ot in Lt){var _t;if(m=(_t=Lt[Ot])[0])if("deform"==Ot){var qt=Nt.bones,Ut=Nt.vertices,Wt=qt?Ut.length/3*2:Ut.length;for(f=new Q(_t.length,_t.length,l,Nt),v=un(m,"time",0),p=0,x=0;;p++){var zt,Gt=void 0,Ht=un(m,"vertices",null);if(Ht){Gt=g.newFloatArray(Wt);var jt=un(m,"offset",0);if(g.arrayCopy(Ht,0,Gt,jt,Ht.length),1!=i)for(var Jt=(Kt=jt)+Ht.length;Kt<Jt;Kt++)Gt[Kt]*=i;if(!qt)for(var Kt=0;Kt<Wt;Kt++)Gt[Kt]+=Ut[Kt]}else Gt=qt?g.newFloatArray(Wt):Ut;if(f.setFrame(p,v,Gt),!(zt=_t[p+1])){f.shrink(x);break}var Qt;w=un(zt,"time",0);(Qt=m.curve)&&(x=cn(Qt,f,x,p,0,v,w,0,1,1)),v=w,m=zt}a.push(f)}else if("sequence"==Ot){f=new pt(_t.length,l,Nt);var $t=0;for(p=0;p<_t.length;p++){var te=un(m,"delay",$t),ee=(v=un(m,"time",0),h[un(m,"mode","hold")]),ne=un(m,"index",0);f.setFrame(p,v,ee,ne,te),$t=te,m=_t[p+1]}a.push(f)}}}}}if(e.drawOrder){f=new $(e.drawOrder.length);var re=r.slots.length;for(p=0,Kt=0;Kt<e.drawOrder.length;Kt++,p++){var ie=e.drawOrder[Kt],ae=null,se=un(ie,"offsets",null);if(se){ae=g.newArray(re,-1);for(var oe=g.newArray(re-se.length,0),he=0,le=0,ce=0;ce<se.length;ce++){var ue,de=se[ce];if(!(ue=r.findSlot(de.slot)))throw new Error("Slot not found: "+ue);for(l=ue.index;he!=l;)oe[le++]=he++;ae[he+de.offset]=he++}for(;he<re;)oe[le++]=he++;for(ce=re-1;ce>=0;ce--)-1==ae[ce]&&(ae[ce]=oe[--le])}f.setFrame(p,un(ie,"time",0),ae)}a.push(f)}if(e.events){for(f=new Z(e.events.length),p=0,Kt=0;Kt<e.events.length;Kt++,p++){var fe=e.events[Kt],pe=r.findEvent(fe.name);if(!pe)throw new Error("Event not found: "+fe.name);var me=new Zt(g.toSinglePrecision(un(fe,"time",0)),pe);me.intValue=un(fe,"int",pe.intValue),me.floatValue=un(fe,"float",pe.floatValue),me.stringValue=un(fe,"string",pe.stringValue),me.data.audioPath&&(me.volume=un(fe,"volume",1),me.balance=un(fe,"balance",0)),f.setFrame(p,me)}a.push(f)}var ge=0;for(Kt=0,Jt=a.length;Kt<Jt;Kt++)ge=Math.max(ge,a[Kt].getDuration());r.animations.push(new C(n,a,ge))},e}(),on=function(t,e,n,r,i){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritTimeline=i};function hn(t,e,n,r){for(var i=t[0],a=un(i,"time",0),s=un(i,"value",n)*r,o=0,h=0;;h++){e.setFrame(h,a,s);var l=t[h+1];if(!l)return e.shrink(o),e;var c=un(l,"time",0),u=un(l,"value",n)*r;i.curve&&(o=cn(i.curve,e,o,h,0,a,c,s,u,r)),a=c,s=u,i=l}}function ln(t,e,n,r,i,a){for(var s=t[0],o=un(s,"time",0),h=un(s,n,i)*a,l=un(s,r,i)*a,c=0,u=0;;u++){e.setFrame(u,o,h,l);var d=t[u+1];if(!d)return e.shrink(c),e;var f=un(d,"time",0),p=un(d,n,i)*a,m=un(d,r,i)*a,g=s.curve;g&&(c=cn(g,e,c,u,0,o,f,h,p,a),c=cn(g,e,c,u,1,o,f,l,m,a)),o=f,h=p,l=m,s=d}}function cn(t,e,n,r,i,a,s,o,h,l){if("stepped"==t)return e.setStepped(r),n;var c=i<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(n,r,i,a,o,u,d,f,p,s,h),n+1}function un(t,e,n){return void 0!==t[e]?t[e]:n}function dn(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(encodeURIComponent(e))}function fn(t,e,n){var r,i=new Ut(t);if("skel"===n){r=new ve(i);var a=new ye(e);a.readInt32(),a.readInt32();var s=a.readString();if(!s)throw new Error("未获取到 Spine 版本信息,请使用 Spine 4.2 导出二进制数据");if(s&&"2"!==s.split(".")[1])throw new Error("请使用 Spine 4.2 导出二进制数据, 当前版本: ".concat(s))}else r=new sn(i);return r.readSkeletonData(e)}function pn(t){return t.animations.map((function(t){return t.name}))}function mn(t,n){var r=t.findAnimation(n);return e.assertExist(r),r.duration}function gn(t){return t.skins.filter((function(t){return"default"!==t.name})).map((function(t){return t.name}))}function vn(t){var e=dn(new Uint8Array(t));return new Xt(e)}function yn(t,e){var n=new Uint8Array(t);return"json"===e?dn(n):new DataView(n.buffer)}void 0===Math.fround&&(Math.fround=(ke=new Float32Array(1),function(t){return ke[0]=t,ke[0]}));var xn=1,wn=function(){function n(t){this.verticesLength=0,this.indicesLength=0;var n=t.blendMode,r=t.texture,i=t.priority,a=t.renderer,s=t.pma,o=t.name,h=void 0===o?"MSpine":o,l=t.engine,c=a.mask,u=void 0===c?0:c,d=a.maskMode,f=void 0===d?0:d;this.blendMode=n,this.lastTexture=r,this.priority=i,this.engine=l,this.geometry=this.createGeometry(),this.material=this.createMaterial(s,f,u),this.mesh=e.Mesh.create(l,{name:h+xn++,priority:this.priority,material:this.material,geometry:this.geometry}),this.vertices=new Float32Array(bn.MAX_VERTICES*bn.VERTEX_SIZE),this.indices=new Uint16Array(bn.MAX_VERTICES)}return Object.defineProperty(n.prototype,"blending",{get:function(){return this.blendMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.lastTexture},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"indicesNum",{get:function(){return this.indicesLength},enumerable:!1,configurable:!0}),n.prototype.createGeometry=function(){var t=Float32Array.BYTES_PER_ELEMENT,n=t*bn.VERTEX_SIZE,r={aPosition:{size:2,offset:0,stride:n,data:new Float32Array(0)},aColor:{size:4,offset:2*t,stride:n,dataSource:"aPosition"},aTexCoords:{size:2,offset:6*t,stride:n,dataSource:"aPosition"},aColor2:{size:4,offset:8*t,stride:n,dataSource:"aPosition"}};return e.Geometry.create(this.engine,{attributes:r,indices:{data:new Uint16Array(0),releasable:!0},mode:e.glContext.TRIANGLES,maxVertex:bn.MAX_VERTICES})},n.prototype.createMaterial=function(n,r,i){var a,s,o,h,l=e.Material.create(this.engine,{shader:(a=this.engine,s=a.renderer.env,o=a.gpuCapability.level,h=[["ENV_EDITOR",s===e.PLAYER_OPTIONS_ENV_EDITOR]],{fragment:e.createShaderWithMarcos(h,"precision mediump float;varying mediump vec4 vLight;varying mediump vec4 vDark;varying vec2 vTexCoords;uniform sampler2D uTexture;void main(){vec4 texColor=texture2D(uTexture,vTexCoords);gl_FragColor.a=texColor.a*vLight.a;gl_FragColor.rgb=((texColor.a-1.0)*vDark.a+1.0-texColor.rgb)*vDark.rgb+texColor.rgb*vLight.rgb;}",e.ShaderType.fragment,o),vertex:e.createShaderWithMarcos(h,"attribute vec2 aPosition;attribute vec4 aColor;attribute vec4 aColor2;attribute vec2 aTexCoords;uniform mat4 uModel;uniform mat4 effects_MatrixVP;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvarying vec4 vLight;varying vec4 vDark;varying vec2 vTexCoords;void main(){vLight=aColor;vDark=aColor2;vTexCoords=aTexCoords;gl_Position=effects_MatrixVP*uModel*vec4(aPosition,0.0,1.0);\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}",e.ShaderType.vertex,o),glslVersion:e.GLSLVersion.GLSL1,marcos:h,shared:!0}),uniformSemantics:{effects_MatrixVP:"VIEWPROJECTION",uEditorTransform:"EDITOR_TRANSFORM"}});return l.setTexture("uTexture",this.lastTexture),l.setMatrix("uModel",e.math.Matrix4.fromIdentity()),l.blending=!0,l.culling=!1,l.depthTest=!1,l.depthMask=!1,l.stencilRef=void 0!==i?[i,i]:void 0,function(n,r,i){switch(n.blendEquation=[e.glContext.FUNC_ADD,e.glContext.FUNC_ADD],r){case t.BlendMode.Multiply:n.blendFunction=[e.glContext.DST_COLOR,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA];break;case t.BlendMode.Screen:n.blendFunction=[e.glContext.ONE,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE_MINUS_SRC_COLOR,e.glContext.ONE_MINUS_SRC_ALPHA];break;case t.BlendMode.Additive:n.blendFunction=[i?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE,e.glContext.ONE,e.glContext.ONE];break;case t.BlendMode.Normal:n.blendFunction=[i?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE_MINUS_SRC_ALPHA,e.glContext.ONE,e.glContext.ONE_MINUS_SRC_ALPHA];break;default:throw new Error("Unknown blend mode: ".concat(r))}}(l,this.blendMode,n),e.setMaskMode(l,r),l},n.prototype.updateMesh=function(t,e,n){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");var r=this.verticesLength,i=this.indicesLength,a=this.verticesLength/bn.VERTEX_SIZE;this.vertices.set(t,r),this.verticesLength+=n;for(var s=0,o=i;s<e.length;s++,o++)this.indices[o]=e[s]+a;this.indicesLength+=e.length},n.prototype.endUpdate=function(t){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");for(var e=this.verticesLength;e<this.vertices.length;e++)this.vertices[e]=0;for(e=this.indicesLength;e<this.indices.length;e++)this.indices[e]=0;this.geometry.setAttributeData("aPosition",this.vertices),this.geometry.setIndexData(this.indices),this.geometry.setDrawCount(this.indicesLength),this.material.setMatrix("uModel",t)},n.prototype.startUpdate=function(){this.verticesLength=0,this.indicesLength=0},n.prototype.dispose=function(){this.geometry.dispose(),this.vertices=null,this.indices=null},n}();var bn=function(){function t(t,n){this.slotList=[],this.vertices=[],this.clipper=new an,this.tempColor=new u,this.tempDark=new u,this.wm=e.math.Matrix4.fromIdentity(),this.meshGroups=[],this.meshToAdd=[],this.slotList=t,this.meshName=n.meshName,this.transform=n.transform,this.listIndex=n.listIndex,this.pma=n.pma,this.renderer=n.renderer,this.engine=n.engine}return t.prototype.resetMeshes=function(){this.meshToAdd.length=0},t.prototype.update=function(){var e,n,r,i=this,a=this.clipper,o=this.pma,h=this.vertices,l=[],c=[],u=0,d=[],f=0,p=0;this.currentMesh=this.meshGroups[p],this.meshGroups.map((function(t){return t.startUpdate()}));try{for(var m=s(this.slotList),g=m.next();!g.done;g=m.next()){var v=g.value,y=a.isClipping()?2:t.VERTEX_SIZE,x=v.getAttachment(),w=void 0,b=void 0,M=0;if(c=[],d=[],u=0,f=0,v.bone.active){if(x instanceof qt){var S=x;w=S.color,h=this.vertices,M=y<<2,S.computeWorldVertices(v,h,0,y),l=t.QUAD_TRIANGLES,r=S.uvs,b=S.region.page.texture}else{if(!(x instanceof Nt)){if(x instanceof Ft){a.clipStart(v,x);continue}a.clipEndWithSlot(v);continue}var k=x;w=k.color,h=this.vertices,M=(k.worldVerticesLength>>1)*y,k.computeWorldVertices(v,0,k.worldVerticesLength,h,0,y),l=k.triangles,r=k.uvs,b=k.region.page.texture}if(b){var A=v.bone.skeleton.color,I=v.color,T=this.tempColor,C=this.tempDark;if(T.set(A.r*I.r*w.r,A.g*I.g*w.g,A.b*I.b*w.b,A.a*I.a*w.a),o&&(T.r*=T.a,T.g*=T.a,T.b*=T.a),v.darkColor?o?(C.r=v.darkColor.r*T.a,C.g=v.darkColor.g*T.a,C.b=v.darkColor.b*T.a,C.a=1):(C.setFromColor(v.darkColor),C.a=0):C.set(0,0,0,1),a.isClipping())a.clipTriangles(h,M,l,l.length,r,T,C,!0),u=(c=a.clippedVertices).length,f=(d=a.clippedTriangles).length;else{for(var E=2,F=0,B=M;E<B;E+=y,F+=2)h[E]=T.r,h[E+1]=T.g,h[E+2]=T.b,h[E+3]=T.a,h[E+4]=r[F],h[E+5]=r[F+1],h[E+6]=C.r,h[E+7]=C.g,h[E+8]=C.b,h[E+9]=C.a;c=h.slice(0,M),u=M,d=l,f=l.length}if(0==u||0==f){a.clipEndWithSlot(v);continue}var Y=this.findMeshIndex(p,v.data.blendMode,b,f);if(-1===Y){var R=this.currentMesh=new wn({blendMode:v.data.blendMode,texture:b,name:this.meshName,priority:this.listIndex+=.01,pma:o,renderer:this.renderer,engine:this.engine});p=this.meshGroups.length,this.meshGroups.push(R),this.meshToAdd.push(R.mesh)}else p=Y,this.currentMesh=this.meshGroups[Y];this.currentMesh.updateMesh(c,d,u)}a.clipEndWithSlot(v)}else a.clipEndWithSlot(v)}}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(e)throw e.error}}a.clipEnd(),this.wm=this.transform.getWorldMatrix(),this.meshGroups.map((function(t){return t.endUpdate(i.wm)}))},t.prototype.findMeshIndex=function(e,n,r,i){for(var a=-1,s=e;s<this.meshGroups.length;s++){var o=this.meshGroups[s];if(o&&o.blending===n&&o.texture.name===r.name&&i+o.indicesNum<t.MAX_VERTICES){a=s;break}}return a},t.QUAD_TRIANGLES=[0,1,2,2,3,0],t.VERTEX_SIZE=12,t.MAX_VERTICES=10920,t}(),Mn=e.math.Vector2,Sn=e.math.Vector3,kn=function(n){function i(t,r){var i,a=n.call(this,t,r)||this;a.offset=new Mn,a.size=new Mn,a._contentVisible=!0;var s=null===(i=a.composition)||void 0===i?void 0:i.renderer.engine;return e.assertExist(s),a.engine=s,a}return r(i,n),Object.defineProperty(i.prototype,"type",{get:function(){return e.spec.ItemType.spine},enumerable:!1,configurable:!0}),i.prototype.onConstructed=function(t){var e;this.initContent(t.content.options,null===(e=this.composition)||void 0===e?void 0:e.loaderData.spineDatas),this.startSize=t.content.options.startSize,this.renderer=t.content.renderer},i.prototype.initContent=function(t,e){var n=t.spine;if(!isNaN(n)){var r=t.activeSkin||"default",i=e[n],a=i.atlas,s=i.skeletonFile,o=i.skeletonType,h=i.skinList,l=i.animationList,c="string"==typeof t.activeAnimation?[t.activeAnimation]:t.activeAnimation;if(this.skeletonData=fn(a,s,o),this.animationStateData=new Ct(this.skeletonData),this.animationStateData.defaultMix=t.mixDuration||0,this.spineDataCache=e[n],this.skinList=h.slice(),this.animationList=l.slice(),this.skeleton=new he(this.skeletonData),this.setSkin(r),this.state=new mt(this.animationStateData),1===c.length)if(isNaN(t.speed)){var u=Number((mn(this.skeletonData,c[0])/this.duration).toFixed(2));this.setAnimation(c[0],u)}else this.setAnimation(c[0],t.speed);else this.setAnimationList(c,t.speed);this.pma=a.pages[0].pma}},i.prototype.doCreateContent=function(){if(this.skeleton)return new bn(this.skeleton.drawOrder,{listIndex:this.listIndex,meshName:this.name,transform:this.transform,pma:this.pma,renderer:this.renderer,engine:this.engine})},i.prototype.onLifetimeBegin=function(){this.state&&this.skeleton&&(this.state.apply(this.skeleton),this.resize(),this.updateState(0))},i.prototype.onItemUpdate=function(t,e){var n=this.content;if(n){var r=this.contentVisible;n.meshGroups.map((function(t){t.mesh.setVisible(r)})),r&&this.updateState(t/1e3)}},i.prototype.onItemRemoved=function(){var t=this.content;t&&t.meshGroups.map((function(t){t.dispose()}))},i.prototype.onEnd=function(){this.endBehavior===e.spec.END_BEHAVIOR_DESTROY&&this.state&&(this.state.clearListeners(),this.state.clearTracks())},i.prototype.handleVisibleChanged=function(t){this.content&&this.content.meshGroups.map((function(e){e.mesh.setVisible(t)}))},i.prototype.getBoundingBox=function(){var t=this.getBounds(),n={type:e.HitTestType.triangle,area:[]};if(!t)return n;var r=t.x,i=t.y,a=t.width,s=t.height,o=this.transform.getWorldMatrix(),h=r+a/2,l=i+s/2,c=new Sn(h-a/2,l-s/2,0),u=new Sn(h+a/2,l-s/2,0),d=new Sn(h+a/2,l+s/2,0),f=new Sn(h-a/2,l+s/2,0);return o.projectPoint(c),o.projectPoint(u),o.projectPoint(d),o.projectPoint(f),n.area=[{p0:c,p1:u,p2:d},{p0:c,p1:d,p2:f}],n},i.prototype.getHitTestParams=function(t){var n,r=this.getBoundingBox(),i=null===(n=this.engine.renderer)||void 0===n?void 0:n.env;if(r.area.length)return t&&i===e.PLAYER_OPTIONS_ENV_EDITOR?{type:e.HitTestType.triangle,triangles:r.area,backfaceCulling:!1,behavior:e.spec.InteractBehavior.NOTIFY}:void 0},i.prototype.updateState=function(e){var n;this.state&&this.skeleton&&(this.state.update(e),this.state.apply(this.skeleton),this.skeleton.update(e),this.skeleton.updateWorldTransform(t.Physics.update),null===(n=this.content)||void 0===n||n.update())},i.prototype.setAnimation=function(t,n){var r;if(!this.skeleton||!this.state)throw new Error("Set animation before skeleton create");if(!this.animationList.length)throw new Error("animationList is empty, check your spine file");var i=this.endBehavior===e.spec.ItemEndBehavior.loop,a=null===(r=this.state.tracks[0])||void 0===r?void 0:r.listener;a&&(a.end=function(){}),this.state.setEmptyAnimation(0),this.animationList.includes(t)?(this.state.setAnimation(0,t,i),this.activeAnimation=[t]):(console.warn("animation ".concat(JSON.stringify(t)," not exists in animationList: ").concat(this.animationList,", set to ").concat(this.animationList[0])),this.state.setAnimation(0,this.animationList[0],i),this.activeAnimation=[this.animationList[0]]),isNaN(n)||this.setSpeed(n)},i.prototype.setAnimationList=function(t,n){var r,i,a,o=this;if(!this.skeleton||!this.state)throw new Error("Set animation before skeleton create");if(!this.animationList.length)throw new Error("animationList is empty, please check your setting");if(1!==t.length){var h=null===(a=this.state.tracks[0])||void 0===a?void 0:a.listener;h&&(h.end=function(){}),this.state.setEmptyAnimation(0);var l=function(t){var n=c.state.addAnimation(0,t,!1);if(c.endBehavior===e.spec.ItemEndBehavior.loop){var r={end:function(){o.state.addAnimation(0,t,!1).listener=r}};n.listener=r}},c=this;try{for(var u=s(t),d=u.next();!d.done;d=u.next()){l(d.value)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}this.activeAnimation=t,isNaN(n)||this.setSpeed(n)}else this.setAnimation(t[0],n)},i.prototype.setSpeed=function(t){this.state&&(this.state.timeScale=t)},i.prototype.getSpeed=function(){return this.state.timeScale||1},i.prototype.getActiveAnimation=function(){return this.activeAnimation},i.prototype.setMixDuration=function(t,e,n){this.animationStateData&&this.animationStateData.setMix(t,e,n)},i.prototype.setDefaultMixDuration=function(t){this.state&&(this.animationStateData.defaultMix=t,this.state.tracks[0]&&(this.state.tracks[0].mixDuration=t))},i.prototype.deleteMixForLoop=function(){var t=this.activeAnimation[this.activeAnimation.length-1],e=this.activeAnimation[0];this.animationStateData.setMix(t,e,0)},i.prototype.setSkin=function(t){if(!this.skeleton)throw new Error("Set skin before skeleton create");if(!t||"default"!==t&&!this.skinList.includes(t))throw new Error("skin ".concat(t," not exists in skinList: ").concat(this.skinList));this.skeleton.setSkinByName(t),this.skeleton.setToSetupPose()},i.prototype.resize=function(){var t=this.getBounds();if(t){var e=t.width,n=this.transform.scale,r=1/e;this.scaleFactor=r,this.transform.setScale(this.startSize*r,this.startSize*r,n.z)}},i.prototype.setScale=function(t,e,n){var r=this.transform.scale,i=r.x,a=r.y,s=r.z;this.transform.setScale(i*t,a*e,s*n)},i.prototype.getBounds=function(){if(this.state&&this.skeleton&&this.contentVisible)return this.skeleton.updateWorldTransform(t.Physics.update),this.skeleton.getBounds(this.offset,this.size),{x:this.offset.x,y:this.offset.y,width:this.size.x,height:this.size.y}},i}(e.VFXItem),An=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.slotGroups=[],e.meshToRemove=[],e}return r(n,t),n.processRawJSON=function(t,e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,Promise.resolve()]}))}))},n.prepareResource=function(t){return i(this,void 0,void 0,(function(){var e,n,r,i,h,l,c,u,d,f,p,m,g,v,y,x,w,b,M,S,k,A,I,T,C,E,F,B,Y,R,P,X,V;return a(this,(function(a){if(n=(e=t).jsonScene,!(e&&n&&n.spines))throw new Error("scene not contain spine content");r=[],i=e.bins;try{for(h=s(n.spines),l=h.next();!l.done;l=h.next())(c=l.value).spineData?r.push(c.spineData):(u=c.atlas,d=c.skeleton,f=c.images,p=c.skeletonType,m=c.id,g=void 0===m?"":m,v=f.map((function(t){return n.textures[t]})),y=o(u[1],3),x=y[0],w=y[1],b=void 0===w?0:w,M=y[2],S=M?i[x].slice(b,b+M):i[x].slice(b),k=o(d[1],3),A=k[0],I=k[1],T=void 0===I?0:I,C=k[2],E=C?i[A].slice(T,T+C):i[A].slice(T),F=vn(S),B=yn(E,p),Y=fn(F,B,p),R=gn(Y),P=pn(Y),r.push({atlas:F,skeletonFile:B,skeletonData:Y,images:f,texturesOptions:v,skeletonType:p,skeletonInstance:new he(Y),skinList:R,animationList:P,id:g}))}catch(t){X={error:t}}finally{try{l&&!l.done&&(V=h.return)&&V.call(h)}finally{if(X)throw X.error}}return n.spines=r,[2]}))}))},n.prototype.onCompositionConstructed=function(t,e){this.slotGroups=[];var n=t.textures;if(e.jsonScene.spines){var r=e.jsonScene.spines;r.map((function(t,e){var r=t.atlas,i=t.images,a=r.pages.length;if(i.length!==a)throw new Error("atlas.page's length not equal spine.textures' length");for(var s=0;s<a;s++){var o=r.pages[s],h=n[i[s]];if(!h)throw new Error("Can not find page ".concat(o.name,"'s texture, check the texture name"));o.texture=h}})),t.loaderData.spineDatas=r}},n.prototype.onCompositionItemLifeBegin=function(t,e){e instanceof kn&&e.content&&this.slotGroups.push(e.content)},n.prototype.onCompositionItemRemoved=function(t,e){var n;if(e instanceof kn&&e.content){e.spineDataCache=void 0;var r=e.content;r&&((n=this.meshToRemove).push.apply(n,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([],o(r.meshGroups),!1)),this.slotGroups.splice(this.slotGroups.indexOf(r),1))}},n.prototype.onCompositionDestroyed=function(t){t.reusable||t.keepResource?this.slotGroups.map((function(t){t&&t.meshGroups.map((function(t){return t.mesh.dispose({material:{textures:e.DestroyOptions.keep}})}))})):(t.loaderData.spineDatas&&delete t.loaderData.spineDatas,this.slotGroups=[])},n.prototype.prepareRenderFrame=function(t,e){return this.meshToRemove.map((function(t){return e.removeMeshFromDefaultRenderPass(t.mesh)})),this.slotGroups.length&&this.slotGroups.map((function(t){t&&(t.meshToAdd.forEach((function(t){t.getVisible()&&e.addMeshToDefaultRenderPass(t)})),t.resetMeshes())})),this.meshToRemove.length=0,!1},n}(e.AbstractPlugin);e.registerPlugin("spine",An,kn);var In="1.2.4";e.logger.info("plugin spine version: "+In),t.AlphaTimeline=H,t.Animation=C,t.AnimationState=mt,t.AnimationStateAdapter=wt,t.AnimationStateData=Ct,t.AssetManagerBase=Kt,t.AtlasAttachmentLoader=Ut,t.Attachment=M,t.AttachmentTimeline=K,t.BinaryInput=ye,t.Bone=jt,t.BoneData=Wt,t.BoundingBoxAttachment=Et,t.CURRENT=Tt,t.ClippingAttachment=Ft,t.Color=u,t.ConstraintData=Jt,t.CurveTimeline=Y,t.CurveTimeline1=R,t.CurveTimeline2=P,t.DebugUtils=v,t.DeformTimeline=Q,t.Downloader=Qt,t.DrawOrderTimeline=$,t.Event=Zt,t.EventData=$t,t.EventQueue=vt,t.EventTimeline=Z,t.FIRST=Mt,t.FakeTexture=Pt,t.HOLD_FIRST=kt,t.HOLD_MIX=At,t.HOLD_SUBSEQUENT=St,t.IkConstraint=te,t.IkConstraintData=ee,t.IkConstraintTimeline=tt,t.IntSet=l,t.Interpolation=f,t.MathUtils=d,t.MeshAttachment=Nt,t.PathAttachment=Ot,t.PathConstraint=ie,t.PathConstraintData=ne,t.PathConstraintMixTimeline=it,t.PathConstraintPositionTimeline=nt,t.PathConstraintSpacingTimeline=rt,t.PhysicsConstraintDampingTimeline=ht,t.PhysicsConstraintGravityTimeline=ut,t.PhysicsConstraintInertiaTimeline=st,t.PhysicsConstraintMassTimeline=lt,t.PhysicsConstraintMixTimeline=dt,t.PhysicsConstraintResetTimeline=ft,t.PhysicsConstraintStrengthTimeline=ot,t.PhysicsConstraintTimeline=at,t.PhysicsConstraintWindTimeline=ct,t.PointAttachment=_t,t.Pool=y,t.Pow=p,t.PowOut=m,t.RGB2Timeline=J,t.RGBA2Timeline=j,t.RGBATimeline=z,t.RGBTimeline=G,t.RegionAttachment=qt,t.RotateTimeline=X,t.SETUP=It,t.SUBSEQUENT=bt,t.ScaleTimeline=N,t.ScaleXTimeline=O,t.ScaleYTimeline=_,t.SequenceTimeline=pt,t.ShearTimeline=q,t.ShearXTimeline=U,t.ShearYTimeline=W,t.Skeleton=he,t.SkeletonBinary=ve,t.SkeletonBounds=nn,t.SkeletonClipping=an,t.SkeletonData=ue,t.SkeletonJson=sn,t.Skin=fe,t.SkinEntry=de,t.Slot=se,t.SlotData=pe,t.SpineLoader=An,t.SpineVFXItem=kn,t.StringSet=c,t.Texture=Bt,t.TextureAtlas=Xt,t.TextureAtlasPage=Dt,t.TextureAtlasRegion=Lt,t.TextureRegion=Rt,t.TimeKeeper=w,t.Timeline=B,t.TrackEntry=gt,t.TransformConstraint=oe,t.TransformConstraintData=ge,t.TransformConstraintTimeline=et,t.TranslateTimeline=V,t.TranslateXTimeline=D,t.TranslateYTimeline=L,t.Triangulator=rn,t.Utils=g,t.Vector2=x,t.VertexAttachment=S,t.WindowedMean=b,t.createSkeletonData=fn,t.getAnimationDuration=mn,t.getAnimationList=pn,t.getAtlasFromBuffer=vn,t.getSkeletonFromBuffer=yn,t.getSkinList=gn,t.getSpineVersion=function(t){var e=new ye(t);return e.readInt32(),e.readInt32(),e.readString()},t.getTextureOptions=function(e){var n,r,i=dn(new Uint8Array(e,0)),a=new Xt(i),o=[],h=a.pages[0];try{for(var l=s(a.pages),c=l.next();!c.done;c=l.next()){var u=c.value;o.push(u.name)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var d=h.magFilter,f=void 0===d?t.TextureFilter.Linear:d,p=h.minFilter,m=void 0===p?t.TextureFilter.Linear:p,g=h.uWrap,v=void 0===g?t.TextureWrap.ClampToEdge:g,y=h.vWrap,x=void 0===y?t.TextureWrap.ClampToEdge:y;return{images:o,pma:h.pma,magFilter:f,minFilter:m,wrapS:v,wrapT:x}},t.version=In,Object.defineProperty(t,"__esModule",{value:!0})}));
9
9
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player spine plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 十弦
6
- * Version: v1.2.2
6
+ * Version: v1.2.4
7
7
  */
8
8
 
9
9
  import { glContext, assertExist, Geometry, Material, math, setMaskMode, createShaderWithMarcos, ShaderType, GLSLVersion, Mesh, PLAYER_OPTIONS_ENV_EDITOR, spec, HitTestType, VFXItem, DestroyOptions, AbstractPlugin, registerPlugin, logger } from '@galacean/effects';
@@ -12963,7 +12963,7 @@ var SpineLoader = /** @class */ (function (_super) {
12963
12963
  }(AbstractPlugin));
12964
12964
 
12965
12965
  registerPlugin('spine', SpineLoader, SpineVFXItem);
12966
- var version = "1.2.2";
12966
+ var version = "1.2.4";
12967
12967
  logger.info('plugin spine version: ' + version);
12968
12968
 
12969
12969
  export { AlphaTimeline, Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AssetManagerBase, AtlasAttachmentLoader, Attachment, AttachmentTimeline, BinaryInput, BlendMode, Bone, BoneData, BoundingBoxAttachment, CURRENT, ClippingAttachment, Color, ConstraintData, CurveTimeline, CurveTimeline1, CurveTimeline2, DebugUtils, DeformTimeline, Downloader, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, FIRST, FakeTexture, HOLD_FIRST, HOLD_MIX, HOLD_SUBSEQUENT, IkConstraint, IkConstraintData, IkConstraintTimeline, IntSet, Interpolation, MathUtils, MeshAttachment, MixBlend, MixDirection, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, Physics, PhysicsConstraintDampingTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintMixTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintTimeline, PhysicsConstraintWindTimeline, PointAttachment, Pool, PositionMode, Pow, PowOut, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RegionAttachment, RotateMode, RotateTimeline, SETUP, SUBSEQUENT, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonClipping, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, SpineLoader, SpineVFXItem, StringSet, Texture, TextureAtlas, TextureAtlasPage, TextureAtlasRegion, TextureFilter, TextureRegion, TextureWrap, TimeKeeper, Timeline, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TransformMode, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, Triangulator, Utils, Vector2$1 as Vector2, VertexAttachment, WindowedMean, createSkeletonData, getAnimationDuration, getAnimationList, getAtlasFromBuffer, getSkeletonFromBuffer, getSkinList, getSpineVersion, getTextureOptions, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-spine",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Galacean Effects player spine plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "fpsmeter": "^0.3.1",
32
- "@galacean/effects": "1.2.2"
32
+ "@galacean/effects": "1.2.4"
33
33
  },
34
34
  "dependencies": {
35
35
  "@esotericsoftware/spine-core": "~4.2.35"