@galacean/effects-plugin-spine 1.5.0 → 1.5.2

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/alipay.js CHANGED
@@ -13179,7 +13179,7 @@ var SpineLoader = /** @class */ (function (_super) {
13179
13179
  }(effects.AbstractPlugin));
13180
13180
 
13181
13181
  effects.registerPlugin('spine', SpineLoader, SpineVFXItem);
13182
- var version = "1.5.0";
13182
+ var version = "1.5.2";
13183
13183
  effects.logger.info('plugin spine version: ' + version);
13184
13184
 
13185
13185
  exports.AlphaTimeline = AlphaTimeline;
package/dist/alipay.mjs CHANGED
@@ -13175,7 +13175,7 @@ var SpineLoader = /** @class */ (function (_super) {
13175
13175
  }(AbstractPlugin));
13176
13176
 
13177
13177
  registerPlugin('spine', SpineLoader, SpineVFXItem);
13178
- var version = "1.5.0";
13178
+ var version = "1.5.2";
13179
13179
  logger.info('plugin spine version: ' + version);
13180
13180
 
13181
13181
  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, Inherit, InheritTimeline, 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, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, Triangulator, Utils, Vector2$1 as Vector2, VertexAttachment, WindowedMean, createSkeletonData, getAnimationDuration, getAnimationList, getAtlasFromBuffer, getSkeletonFromBuffer, getSkinList, getSpineVersion, getTextureOptions, version };
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.5.0
6
+ * Version: v1.5.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -13187,7 +13187,7 @@ var SpineLoader = /** @class */ (function (_super) {
13187
13187
  }(effects.AbstractPlugin));
13188
13188
 
13189
13189
  effects.registerPlugin('spine', SpineLoader, SpineVFXItem);
13190
- var version = "1.5.0";
13190
+ var version = "1.5.2";
13191
13191
  effects.logger.info('plugin spine version: ' + version);
13192
13192
 
13193
13193
  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.5.0
6
+ * Version: v1.5.2
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 i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function r(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{h(i.next(t))}catch(t){a(t)}}function o(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((i=i.apply(t,e||[])).next())}))}function a(t,e){var n,i,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=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],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],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 i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.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,i=t.length;n<i;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,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,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,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,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.prototype.toRgb888=function(){var t=function(t){return("0"+(255*t).toString(16)).slice(-2)};return Number("0x"+t(this.r)+t(this.g)+t(this.b))},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 i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(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 i(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 i(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,i,r){for(var a=e,s=i;a<e+r;a++,s++)n[s]=t[a]},t.arrayFill=function(t,e,n,i){for(var r=e;r<n;r++)t[r]=i},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var i=t.length;if(i==e)return t;if(t.length=e,i<e)for(var r=i;r<e;r++)t[r]=n;return t},t.ensureArrayCapacity=function(e,n,i){return void 0===i&&(i=0),e.length>=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i<t;i++)n[i]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=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 i=0;i<t.length;i++)if(t[i]==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 i=t.call(this,n)||this;return i.id=e.nextID++,i.bones=null,i.vertices=[],i.worldVerticesLength=0,i.timelineAttachment=i,i}return i(e,t),e.prototype.computeWorldVertices=function(t,e,n,i,r,a){n=r+(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(T=r,k=3*u;T<n;T+=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}i[T]=p,i[T+1]=m}else for(var y=o,x=(T=r,k=3*u,u<<1);T<n;T+=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}i[T]=p,i[T+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,I=w.c,A=w.d,C=e,T=r;T<n;C+=2,T+=a){var E=h[C],F=h[C+1];i[T]=E*S+F*k+b,i[T+1]=E*I+F*A+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 i=this.regions[n];e.region!=i&&(e.region=i,e.updateRegion())},t.prototype.getPath=function(t,e){for(var n=t,i=(this.start+e).toString(),r=this.digits-i.length;r>0;r--)n+="0";return n+=i},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 I,A,C=[h.hold,h.once,h.loop,h.pingpong,h.onceReverse,h.loopReverse,h.pingpongReverse],T=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,i,r,a,s,o){if(!t)throw new Error("skeleton cannot be null.");i&&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,r,a,s,o)},t}();t.MixBlend=void 0,(I=t.MixBlend||(t.MixBlend={}))[I.setup=0]="setup",I[I.first=1]="first",I[I.replace=2]="replace",I[I.add=3]="add",t.MixDirection=void 0,(A=t.MixDirection||(t.MixDirection={}))[A.mixIn=0]="mixIn",A[A.mixOut=1]="mixOut";var E,F={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},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,i=1;i<n;i++)if(t[i]>e)return i-1;return n-1},t.search=function(t,e,n){for(var i=t.length,r=n;r<i;r+=n)if(t[r]>e)return r-n;return i-n},t}(),Y=function(t){function e(e,n,i){var r=t.call(this,e,i)||this;return r.curves=g.newFloatArray(e+18*n),r.curves[e-1]=1,r}return i(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,i,r,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*(i-2*a+o),p=.03*(r-2*s+h),m=.006*(3*(a-o)-i+l),g=.006*(3*(s-h)-r+c),v=2*f+m,y=2*p+g,x=.3*(a-i)+f+.16666667*m,w=.3*(s-r)+p+.16666667*g,b=i+x,M=r+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,i){var r=this.curves;if(r[i]>t){var a=this.frames[e],s=this.frames[e+n];return s+(t-a)/(r[i]-a)*(r[i+1]-s)}var o=i+18;for(i+=2;i<o;i+=2)if(r[i]>=t){var h=r[i-2],l=r[i-1];return l+(t-h)/(r[i]-h)*(r[i+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)},e}(B),R=function(e){function n(t,n,i){return e.call(this,t,n,[i])||this}return i(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,i=2;i<=n;i+=2)if(e[i]>t){n=i-2;break}var r=this.curves[n>>1];switch(r){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,r-2)},n.prototype.getRelativeValue=function(e,n,i,r,a){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}var s=this.getCurveValue(e);switch(i){case t.MixBlend.setup:return a+s*n;case t.MixBlend.first:case t.MixBlend.replace:s+=a-r}return r+s*n},n.prototype.getAbsoluteValue=function(e,n,i,r,a){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}var s=this.getCurveValue(e);return i==t.MixBlend.setup?a+(s-a)*n:r+(s-r)*n},n.prototype.getAbsoluteValue2=function(e,n,i,r,a,s){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}return i==t.MixBlend.setup?a+(s-a)*n:r+(s-r)*n},n.prototype.getScaleValue=function(e,n,i,r,a,s){if(e<this.frames[0]){switch(i){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 i==t.MixBlend.add?a+o-s:o;if(r==t.MixDirection.mixOut)switch(i){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(i){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,i,r){return t.call(this,e,n,[i,r])||this}return i(e,t),e.prototype.getFrameEntries=function(){return 3},e.prototype.setFrame=function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},e}(Y),X=function(t){function e(e,n,i){var r=t.call(this,e,n,F.rotate+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(n,r,a,o.rotation,o.data.rotation))},e}(R),V=function(e){function n(t,n,i){var r=e.call(this,t,n,F.x+"|"+i,F.y+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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,i){var r=t.call(this,e,n,F.x+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(n,r,a,o.x,o.data.x))},e}(R),L=function(t){function e(e,n,i){var r=t.call(this,e,n,F.y+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(n,r,a,o.y,o.data.y))},e}(R),N=function(e){function n(t,n,i){var r=e.call(this,t,n,F.scaleX+"|"+i,F.scaleY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),p=this.curves[f/3];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2];var g=(i-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(i,f,1,p-2),u=this.getBezierValue(i,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,i){var r=t.call(this,e,n,F.scaleX+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(n,r,a,s,o.scaleX,o.data.scaleX))},e}(R),_=function(t){function e(e,n,i){var r=t.call(this,e,n,F.scaleY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(n,r,a,s,o.scaleY,o.data.scaleY))},e}(R),q=function(e){function n(t,n,i){var r=e.call(this,t,n,F.shearX+"|"+i,F.shearY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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),W=function(t){function e(e,n,i){var r=t.call(this,e,n,F.shearX+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(n,r,a,o.shearX,o.data.shearX))},e}(R),U=function(t){function e(e,n,i){var r=t.call(this,e,n,F.shearY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(n,r,a,o.shearY,o.data.shearY))},e}(R),z=function(e){function n(t,n){var i=e.call(this,t,[F.inherit+"|"+n])||this;return i.boneIndex=0,i.boneIndex=n,i}return i(n,e),n.prototype.getFrameEntries=function(){return 2},n.prototype.setFrame=function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;i<l[0]?s!=t.MixBlend.setup&&s!=t.MixBlend.first||(h.inherit=h.data.inherit):h.inherit=this.frames[B.search(l,i,2)+1]}},n}(B),G=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.alpha+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 5},n.prototype.setFrame=function(t,e,n,i,r,a){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(i<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,i,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=(i-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(i,g,1,v-2),f=this.getBezierValue(i,g,2,v+18-2),p=this.getBezierValue(i,g,3,v+36-2),m=this.getBezierValue(i,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),H=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,i,r){t<<=2,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(i<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,i,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=(i-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(i,m,1,g-2),f=this.getBezierValue(i,m,2,g+18-2),p=this.getBezierValue(i,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),j=function(e){function n(t,n,i){var r=e.call(this,t,n,F.alpha+"|"+i)||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.color;if(i<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(i);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,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.alpha+"|"+i,F.rgb2+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 8},n.prototype.setFrame=function(t,e,n,i,r,a,s,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,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,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(i<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,i,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=(i-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(i,b,1,M-2),m=this.getBezierValue(i,b,2,M+18-2),g=this.getBezierValue(i,b,3,M+36-2),v=this.getBezierValue(i,b,4,M+54-2),y=this.getBezierValue(i,b,5,M+72-2),x=this.getBezierValue(i,b,6,M+90-2),w=this.getBezierValue(i,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),K=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.rgb2+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,i,r,a,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(i<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,i,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=(i-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(i,w,1,b-2),m=this.getBezierValue(i,w,2,b+18-2),g=this.getBezierValue(i,w,3,b+36-2),v=this.getBezierValue(i,w,4,b+54-2),y=this.getBezierValue(i,w,5,b+72-2),x=this.getBezierValue(i,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),Q=function(e){function n(t,n){var i=e.call(this,t,[F.attachment+"|"+n])||this;return i.slotIndex=0,i.slotIndex=n,i.attachmentNames=new Array(t),i}return i(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,i,r,a,s,o){var h=e.slots[this.slotIndex];h.bone.active&&(o!=t.MixDirection.mixOut?i<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,i)]):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),Z=function(e){function n(t,n,i,r){var a=e.call(this,t,n,[F.deform+"|"+i+"|"+r.id])||this;return a.slotIndex=0,a.slotIndex=i,a.attachment=r,a.vertices=new Array(t),a}return i(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,i,r,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*(i-2*a+o),p=.03*h-.06*s,m=.006*(3*(a-o)-i+l),g=.018*(s-h+.33333333),v=2*f+m,y=2*p+g,x=.3*(a-i)+f+.16666667*m,w=.3*s+p+.16666667*g,b=i+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,i=n[e];switch(i){case 0:var r=this.frames[e];return(t-r)/(this.frames[e+this.getFrameEntries()]-r);case 1:return 0}if(n[i-=2]>t){var a=this.frames[e];return n[i+1]*(t-a)/(n[i]-a)}var s=i+18;for(i+=2;i<s;i+=2)if(n[i]>=t){var o=n[i-2],h=n[i-1];return h+(t-o)/(n[i]-o)*(n[i+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,i,r,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(i<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,i>=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 I=0;I<d;I++)c[I]+=(v[I]-c[I])*a;break;case t.MixBlend.add:if((q=l).bones)for(var A=0;A<d;A++)c[A]+=v[A]*a;else{p=q.vertices;for(var C=0;C<d;C++)c[C]+=(v[C]-p[C])*a}}}else{var T=B.search1(f,i),E=this.getCurvePercent(i,T),F=u[T],Y=u[T+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 W=0;W<d;W++){X=F[W];c[W]+=(X+(Y[W]-X)*E)*a}else{p=q.vertices;for(var U=0;U<d;U++){X=F[U];c[U]+=(X+(Y[U]-X)*E-p[U])*a}}}}}}},n}(Y),$=function(t){function e(n){var i=t.call(this,n,e.propertyIds)||this;return i.events=new Array(n),i}return i(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,i,r,a,s){if(i){var o=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,i,r,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++)i.push(this.events[l])}}},e.propertyIds=[""+F.event],e}(B),tt=function(e){function n(t){var i=e.call(this,t,n.propertyIds)||this;return i.drawOrders=new Array(t),i}return i(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,i,r,a,s,o){if(o!=t.MixDirection.mixOut)if(i<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,i),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),et=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.ikConstraint+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 6},n.prototype.setFrame=function(t,e,n,i,r,a,s){t*=6,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a?1:0,this.frames[t+5]=s?1:0},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.ikConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,6),f=this.curves[d/6];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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),nt=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.transformConstraint+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,i,r,a,s,o){var h=this.frames;h[t*=7]=e,h[t+1]=n,h[t+2]=i,h[t+3]=r,h[t+4]=a,h[t+5]=s,h[t+6]=o},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.transformConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,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=(i-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(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),m=this.getBezierValue(i,v,5,y+72-2),g=this.getBezierValue(i,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),it=function(t){function e(e,n,i){var r=t.call(this,e,n,F.pathConstraintPosition+"|"+i)||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(n,r,a,o.position,o.data.position))},e}(R),rt=function(t){function e(e,n,i){var r=t.call(this,e,n,F.pathConstraintSpacing+"|"+i)||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(n,r,a,o.spacing,o.data.spacing))},e}(R),at=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.pathConstraintMix+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,i,r){var a=this.frames;a[t<<=2]=e,a[t+1]=n,a[t+2]=i,a[t+3]=r},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.pathConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,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=(i-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(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,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),st=function(t){function e(e,n,i,r){var a=t.call(this,e,n,r+"|"+i)||this;return a.constraintIndex=0,a.constraintIndex=i,a}return i(e,t),e.prototype.apply=function(t,e,n,i,r,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,r,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,r,a,this.get(c),this.setup(c)))},e}(R),ot=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintInertia)||this}return i(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}(st),ht=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintStrength)||this}return i(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}(st),lt=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintDamping)||this}return i(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}(st),ct=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintMass)||this}return i(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}(st),ut=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintWind)||this}return i(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}(st),dt=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintGravity)||this}return i(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}(st),ft=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintMix)||this}return i(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}(st),pt=function(t){function e(n,i){var r=t.call(this,n,e.propertyIds)||this;return r.constraintIndex=i,r}return i(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,i,r,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,[],r,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),mt=function(e){function n(t,n,i){var r=e.call(this,t,[F.sequence+"|"+n+"|"+i.sequence.id])||this;return r.slotIndex=n,r.attachment=i,r}return i(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,i,r,a){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=i|r<<4,s[t+n.DELAY]=a},n.prototype.apply=function(e,i,r,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(r<f[0])o!=t.MixBlend.setup&&o!=t.MixBlend.first||(c.sequenceIndex=-1);else{var p=B.search(f,r,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=C[15&g];if(w!=h.hold)switch(y+=(r-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),gt=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 yt(this),this.propertyIDs=new c,this.animationsChanged=!1,this.trackEntryPool=new y((function(){return new vt})),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,i=e.length;n<i;n++){var r=e[n];if(r){r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;var a=t*r.timeScale;if(r.delay>0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=a,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(!n)return!0;var i=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)),i):(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,i=this.tracks,r=!1,a=0,s=i.length;a<s;a++){var o=i[a];if(o&&!(o.delay>0)){r=!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 Q?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]==Mt?h:t.MixBlend.setup;!b&&S instanceof X?this.applyRotateTimeline(S,e,f,l,k,o.timelinesRotation,y<<1,M):S instanceof Q?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 I=this.unkeyedState+Ct,A=e.slots,C=0,T=e.slots.length;C<T;C++){var E=A[C];if(E.attachmentState==I){var F=E.data.attachmentName;E.setAttachment(F?e.getAttachment(E.data.index,F):null)}}return this.unkeyedState+=2,this.queue.drain(),r},e.prototype.applyMixingFrom=function(e,n,i){var r=e.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,n,i);var a=0;0==e.mixDuration?(a=1,i==t.MixBlend.first&&(i=t.MixBlend.setup)):((a=e.mixTime/e.mixDuration)>1&&(a=1),i!=t.MixBlend.first&&(i=r.mixBlend));var s=a<r.mixAttachmentThreshold,o=a<r.mixDrawOrderThreshold,h=r.animation.timelines,l=h.length,c=r.alpha*e.interruptAlpha,u=c*(1-a),d=r.animationLast,f=r.getAnimationTime(),p=f,m=null;if(r.reverse?p=r.animation.duration-p:a<r.eventThreshold&&(m=this.events),i==t.MixBlend.add)for(var v=0;v<l;v++)h[v].apply(n,d,p,m,u,i,t.MixDirection.mixOut);else{var y=r.timelineMode,x=r.timelineHoldMix,w=r.shortestRotation,b=!w&&r.timelinesRotation.length!=l<<1;b&&(r.timelinesRotation.length=l<<1),r.totalAlpha=0;for(v=0;v<l;v++){var M=h[v],S=t.MixDirection.mixOut,k=void 0,I=0;switch(y[v]){case Mt:if(!o&&M instanceof tt)continue;k=i,I=u;break;case St:k=t.MixBlend.setup,I=u;break;case kt:k=i,I=c;break;case It:k=t.MixBlend.setup,I=c;break;default:k=t.MixBlend.setup;var A=x[v];I=c*Math.max(0,1-A.mixTime/A.mixDuration)}r.totalAlpha+=I,!w&&M instanceof X?this.applyRotateTimeline(M,n,p,I,k,r.timelinesRotation,v<<1,b):M instanceof Q?this.applyAttachmentTimeline(M,n,p,k,s&&I>=r.alphaAttachmentThreshold):(g.webkit602BugfixHelper(I,i),o&&M instanceof tt&&k==t.MixBlend.setup&&(S=t.MixDirection.mixIn),M.apply(n,d,p,m,I,k,S))}}return e.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,a},e.prototype.applyAttachmentTimeline=function(e,n,i,r,a){var s=n.slots[e.slotIndex];s.bone.active&&(i<e.frames[0]?r!=t.MixBlend.setup&&r!=t.MixBlend.first||this.setAttachment(n,s,s.data.attachmentName,a):this.setAttachment(n,s,e.attachmentNames[B.search1(e.frames,i)],a),s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+Ct))},e.prototype.setAttachment=function(t,e,n,i){e.setAttachment(n?t.getAttachment(e.data.index,n):null),i&&(e.attachmentState=this.unkeyedState+Tt)},e.prototype.applyRotateTimeline=function(e,n,i,r,a,s,o,h){if(h&&(s[o]=0),1!=r){var l=n.bones[e.boneIndex];if(l.active){var c=0,u=0;if(i<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(i);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*r}}else e.apply(n,0,i,null,1,a,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,a=t.trackLast%r,s=this.events,o=0,h=s.length;o<h;o++){var l=s[o];if(l.time<a)break;l.time>i||this.queue.event(t,l)}var c=!1;if(t.loop)if(0==r)c=!0;else{var u=Math.floor(t.trackTime/r);c=u>0&&u>Math.floor(t.trackLast/r)}else c=e>=i&&t.animationLast<i;for(c&&this.queue.complete(t);o<h;o++){var d=s[o];d.time<n||this.queue.event(t,d)}},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 i=n.mixingFrom;if(!i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){void 0===n&&(n=!1);var i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(void 0===n&&(n=!1),!e)throw new Error("animation cannot be null.");var i=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,i=!1):this.clearNext(r));var a=this.trackEntry(t,e,n,r);return this.setCurrent(t,a,i),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,i){void 0===n&&(n=!1),void 0===i&&(i=0);var r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=0),!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var a=this.trackEntry(t,e,n,r);return r?(r.next=a,a.previous=r,i<=0&&(i+=r.getTrackComplete()-a.mixDuration)):(this.setCurrent(t,a,!0),this.queue.drain()),a.delay=i,a},e.prototype.setEmptyAnimation=function(t,n){void 0===n&&(n=0);var i=this.setAnimationWith(t,e.emptyAnimation(),!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=0);var r=this.addAnimationWith(t,e.emptyAnimation(),!1,i);return i<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){void 0===t&&(t=0);var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n<i;n++){var r=this.tracks[n];r&&this.setEmptyAnimation(r.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,i,r){var a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=n,a.loop=i,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=r?this.data.getMix(r.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,i=e.length;n<i;n++){var r=e[n];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do{r.mixingTo&&r.mixBlend==t.MixBlend.add||this.computeHold(r),r=r.mixingTo}while(r)}}},e.prototype.computeHold=function(t){var e=t.mixingTo,n=t.animation.timelines,i=t.animation.timelines.length,r=t.timelineMode;r.length=i;var a=t.timelineHoldMix;a.length=0;var s=this.propertyIDs;if(e&&e.holdPrevious)for(var o=0;o<i;o++)r[o]=s.addAll(n[o].getPropertyIds())?It:kt;else t:for(o=0;o<i;o++){var h=n[o],l=h.getPropertyIds();if(s.addAll(l))if(!e||h instanceof Q||h instanceof tt||h instanceof $||!e.animation.hasTimeline(l))r[o]=St;else{for(var c=e.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(t.mixDuration>0){r[o]=At,a[o]=c;continue t}break}r[o]=It}else r[o]=Mt}},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 T("<empty>",[],0),e}(),vt=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},enumerable:!1,configurable:!0}),e.prototype.setMixDurationWithDelay=function(t,e){this._mixDuration=t,null!=this.previous&&e<=0&&(e+=this.previous.getTrackComplete()-t),this.delay=e},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}(),yt=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,i=0;i<e.length;i+=2){var r=e[i],a=e[i+1];switch(r){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+i++];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 xt,wt,bt=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}(),Mt=0,St=1,kt=2,It=3,At=4,Ct=1,Tt=2,Et=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 i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);var r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(i,r,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 i=t.name+"."+e.name;this.animationToMixTime[i]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,i=this.animationToMixTime[n];return void 0===i?this.defaultMix:i},t}(),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.color=new u(1,1,1,1),n}return i(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(S),Bt=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 i(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),Yt=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t}();t.TextureFilter=void 0,(xt=t.TextureFilter||(t.TextureFilter={}))[xt.Nearest=9728]="Nearest",xt[xt.Linear=9729]="Linear",xt[xt.MipMap=9987]="MipMap",xt[xt.MipMapNearestNearest=9984]="MipMapNearestNearest",xt[xt.MipMapLinearNearest=9985]="MipMapLinearNearest",xt[xt.MipMapNearestLinear=9986]="MipMapNearestLinear",xt[xt.MipMapLinearLinear=9987]="MipMapLinearLinear",t.TextureWrap=void 0,(wt=t.TextureWrap||(t.TextureWrap={}))[wt.MirroredRepeat=33648]="MirroredRepeat",wt[wt.ClampToEdge=33071]="ClampToEdge",wt[wt.Repeat=10497]="Repeat";var Rt,Pt=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},Xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(Yt),Vt=function(){function e(e){this.pages=new Array,this.regions=new Array;for(var n=new Dt(e),i=new Array(4),r={size:function(t){t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:function(){},filter:function(e){e.minFilter=g.enumValue(t.TextureFilter,i[1]),e.magFilter=g.enumValue(t.TextureFilter,i[2])},repeat:function(e){-1!=i[1].indexOf("x")&&(e.uWrap=t.TextureWrap.Repeat),-1!=i[1].indexOf("y")&&(e.vWrap=t.TextureWrap.Repeat)},pma:function(t){t.pma="true"==i[1]}},a={xy:function(t){t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:function(t){t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:function(t){t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:function(t){t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:function(t){t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:function(t){t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:function(t){var e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:function(t){t.index=parseInt(i[1])}},s=n.readLine();s&&0==s.trim().length;)s=n.readLine();for(;s&&0!=s.trim().length&&0!=n.readEntry(i,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 Nt(o,s);;){var u=n.readEntry(i,s=n.readLine());if(0==u)break;if(p=a[i[0]])p(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);for(var d=[],f=0;f<u;f++)d.push(parseInt(i[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 Lt(s.trim());0!=n.readEntry(i,s=n.readLine());){var p;(p=r[i[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,i;void 0===e&&(e="");try{for(var r=s(this.pages),a=r.next();!a.done;a=r.next()){var o=a.value;o.setTexture(t.get(e+o.name))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}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}(),Dt=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 i=1,r=n+1;;i++){var a=e.indexOf(",",r);if(-1==a)return t[i]=e.substr(r).trim(),i;if(t[i]=e.substr(r,a-r).trim(),r=a+1,4==i)return 4}},t}(),Lt=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 i=s(this.regions),r=i.next();!r.done;r=i.next()){r.value.texture=t}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},e}(),Nt=function(t){function e(e,n){var i=t.call(this)||this;return i.x=0,i.y=0,i.offsetX=0,i.offsetY=0,i.originalWidth=0,i.originalHeight=0,i.index=0,i.degrees=0,i.names=null,i.values=null,i.page=e,i.name=n,e.regions.push(i),i}return i(e,t),e}(Pt),Ot=function(t){function e(e,n){var i=t.call(this,e)||this;return i.region=null,i.regionUVs=[],i.uvs=[],i.triangles=[],i.color=new u(1,1,1,1),i.width=0,i.height=0,i.hullLength=0,i.edges=[],i.parentMesh=null,i.sequence=null,i.tempColor=new u(0,0,0,0),i.path=n,i}return i(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,i=this.region.u,r=this.region.v,a=0,s=0;if(this.region instanceof Nt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:i-=(o.originalHeight-o.offsetY-o.height)/l,r-=(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]=i+t[u+1]*a,e[u+1]=r+(1-t[u])*s;return;case 180:i-=(o.originalWidth-o.offsetX-o.width)/l,r-=o.offsetY/c,a=o.originalWidth/l,s=o.originalHeight/c;for(u=0;u<n;u+=2)e[u]=i+(1-t[u])*a,e[u+1]=r+(1-t[u+1])*s;return;case 270:i-=o.offsetY/l,r-=o.offsetX/c,a=o.originalHeight/l,s=o.originalWidth/c;for(u=0;u<n;u+=2)e[u]=i+(1-t[u+1])*a,e[u+1]=r+t[u]*s;return}i-=o.offsetX/l,r-=(o.originalHeight-o.offsetY-o.height)/c,a=o.originalWidth/l,s=o.originalHeight/c}else this.region?(a=this.region.u2-i,s=this.region.v2-r):(i=r=0,a=s=1);for(u=0;u<n;u+=2)e[u]=i+t[u]*a,e[u+1]=r+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,i,r,a,s){null!=this.sequence&&this.sequence.apply(e,this),t.prototype.computeWorldVertices.call(this,e,n,i,r,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),_t=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 i(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),qt=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 i(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),i=Math.sin(e),r=n*t.a+i*t.b,a=n*t.c+i*t.d;return d.atan2Deg(a,r)},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),Wt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.x=0,i.y=0,i.scaleX=1,i.scaleY=1,i.rotation=0,i.width=0,i.height=0,i.color=new u(1,1,1,1),i.region=null,i.sequence=null,i.offset=g.newFloatArray(8),i.uvs=g.newFloatArray(8),i.tempColor=new u(1,1,1,1),i.path=n,i}return i(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,i=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*n,a=-this.height/2*this.scaleY+this.region.offsetY*i,s=r+this.region.width*n,o=a+this.region.height*i,h=this.rotation*d.degRad,l=Math.cos(h),c=Math.sin(h),u=this.x,f=this.y,p=r*l+u,m=r*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,i){null!=this.sequence&&this.sequence.apply(t,this);var r=t.bone,a=this.offset,s=r.worldX,o=r.worldY,h=r.a,l=r.b,c=r.c,u=r.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+=i,d=a[2],f=a[3],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=i,d=a[4],f=a[5],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=i,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 i=n.regions,r=0,a=i.length;r<a;r++){var s=n.getPath(e,r),o=this.atlas.findRegion(s);if(null==o)throw new Error("Region not found in atlas: "+s+" (sequence: "+t+")");i[r]=o}},t.prototype.newRegionAttachment=function(t,e,n,i){var r=new Wt(e,n);if(null!=i)this.loadSequence(e,n,i);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");r.region=a}return r},t.prototype.newMeshAttachment=function(t,e,n,i){var r=new Ot(e,n);if(null!=i)this.loadSequence(e,n,i);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");r.region=a}return r},t.prototype.newBoundingBoxAttachment=function(t,e){return new Ft(e)},t.prototype.newPathAttachment=function(t,e){return new _t(e)},t.prototype.newPointAttachment=function(t,e){return new qt(e)},t.prototype.newClippingAttachment=function(t,e){return new Bt(e)},t}(),zt=function(e,n,i){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.inherit=t.Inherit.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=i};t.Inherit=void 0,(Rt=t.Inherit||(t.Inherit={}))[Rt.Normal=0]="Normal",Rt[Rt.OnlyTranslation=1]="OnlyTranslation",Rt[Rt.NoRotationOrReflection=2]="NoRotationOrReflection",Rt[Rt.NoScale=3]="NoScale",Rt[Rt.NoScaleOrReflection=4]="NoScaleOrReflection";var Gt,Ht,jt,Jt=function(){function e(e,n,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.inherit=t.Inherit.Normal,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=i,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,i,r,a,s,o){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=r,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=(i+s)*d.degRad,p=(i+90+o)*d.degRad;return this.a=Math.cos(f)*r*c,this.b=Math.cos(p)*a*c,this.c=Math.sin(f)*r*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.inherit){case t.Inherit.Normal:f=(i+s)*d.degRad,p=(i+90+o)*d.degRad;var x=Math.cos(f)*r,w=Math.cos(p)*a,b=Math.sin(f)*r,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.Inherit.OnlyTranslation:f=(i+s)*d.degRad,p=(i+90+o)*d.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(p)*a,this.c=Math.sin(f)*r,this.d=Math.sin(p)*a;break;case t.Inherit.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=(i+s-S)*d.degRad,p=(i+o-S+90)*d.degRad,x=Math.cos(f)*r,w=Math.cos(p)*a,b=Math.sin(f)*r,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.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:i*=d.degRad;var k,I=Math.cos(i),A=Math.sin(i),C=(m*I+g*A)/this.skeleton.scaleX,T=(v*I+y*A)/this.skeleton.scaleY;(k=Math.sqrt(C*C+T*T))>1e-5&&(k=1/k),C*=k,T*=k,k=Math.sqrt(C*C+T*T),this.inherit==t.Inherit.NoScale&&m*y-g*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(k=-k),i=Math.PI/2+Math.atan2(T,C);var E=Math.cos(i)*k,F=Math.sin(i)*k;s*=d.degRad,o=(90+o)*d.degRad;x=Math.cos(s)*r,w=Math.cos(o)*a,b=Math.sin(s)*r,M=Math.sin(o)*a;this.a=C*x+E*b,this.b=C*w+E*M,this.c=T*x+F*b,this.d=T*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,this.inherit=t.inherit},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,i,r,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.inherit==t.Inherit.OnlyTranslation)n=this.a,i=this.b,r=this.c,a=this.d;else{switch(this.inherit){case t.Inherit.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.Inherit.NoScale:case t.Inherit.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.inherit==t.Inherit.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,i=u*this.b-f*this.d,r=m*this.c-p*this.a,a=m*this.d-p*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(n*n+r*r),this.ascaleX>1e-4){var k=n*a-i*r;this.ascaleY=k/this.ascaleX,this.ashearY=-Math.atan2(n*i+r*a,k)*d.radDeg,this.arotation=Math.atan2(r,n)*d.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(i*i+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,i)*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,i=t.y-this.worldY;return t.x=n*this.d*e-i*this.b*e,t.y=i*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),i=this.a,r=this.b;this.a=n*i-e*this.c,this.b=n*r-e*this.d,this.c=e*i+n*this.c,this.d=e*r+n*this.d},e}(),Kt=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},Qt=function(){function t(t,e,n){void 0===e&&(e=""),void 0===n&&(n=new Zt),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 i=function(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(i)};requestAnimationFrame(i)}))},t.prototype.setRawDataURI=function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e},t.prototype.loadBinary=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadBinary(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadText=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadText(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load text ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadJson=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadJson(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadTexture=function(t,e,n){var i=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():(i.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&&i.success(e,t,i.textureLoader(n))}));else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(){i.success(e,t,i.textureLoader(r))},r.onerror=function(){i.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}},t.prototype.loadTextureAtlas=function(t,e,n,i){var r=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 Vt(a),u=c.pages.length,d=!1,f=function(a){r.loadTexture(i?i[a.name]:o+a.name,(function(n,i){d||(a.setTexture(i),0==--u&&r.success(e,t,c))}),(function(e,i){d||r.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){r.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(e.message))}}),(function(e,i){r.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(e,", ").concat(i))}))},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}(),Zt=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,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.charCodeAt(r);return i},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 i=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var r=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(r))}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(){i.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 i=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var r=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(r))}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(){i.finish(t,a.status,a.response)};a.onload=function(){200==a.status||0==a.status?i.finish(t,200,new Uint8Array(a.response)):s()},a.onerror=s,a.send()}},t.prototype.start=function(t,e,n){var i=this.callbacks[t];try{if(i)return!0;this.callbacks[t]=i=[]}finally{i.push(e,n)}},t.prototype.finish=function(t,e,n){var i=this.callbacks[t];delete this.callbacks[t];for(var r=200==e||0==e?[n]:[e,n],a=r.length-1,s=i.length;a<s;a+=2)i[a].apply(null,r)},t}(),$t=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},te=function(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t},ee=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.bones=new Array;for(var n=0;n<t.bones.length;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 r=e.findBone(t.target.name);if(!r)throw new Error("Couldn't find bone ".concat(t.target.name));this.target=r,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}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,i,r,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.inherit){case t.Inherit.OnlyTranslation:m=(n-e.worldX)*d.signum(e.skeleton.scaleX),g=(i-e.worldY)*d.signum(e.skeleton.scaleY);break;case t.Inherit.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=i-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(r||a){switch(e.inherit){case t.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:m=n-e.worldX,g=i-e.worldY}var I=e.data.length*S;if(I>1e-4){var A=m*m+g*g;if(r&&A<I*I||a&&A>I*I)S*=v=(Math.sqrt(A)/I-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(e,n,i,r,a,s,o,h,l){if(e.inherit==t.Inherit.Normal&&n.inherit==t.Inherit.Normal){var c=e.ax,u=e.ay,f=e.ascaleX,p=e.ascaleY,m=f,g=p,v=n.ascaleX,y=0,x=0,w=0;f<0?(f=-f,y=180,w=-1):(y=0,w=1),p<0&&(p=-p,w=-w),v<0?(v=-v,x=180):x=0;var b=n.ax,M=0,S=0,k=0,I=e.a,A=e.b,C=e.c,T=e.d,E=Math.abs(f-p)<=1e-4;!E||s?(M=0,S=I*b+e.worldX,k=C*b+e.worldY):(S=I*b+A*(M=n.ay)+e.worldX,k=C*b+T*M+e.worldY);var F=e.parent;if(!F)throw new Error("IK parent must itself have a parent.");I=F.a,A=F.b,C=F.c;var B,Y,R=I*(T=F.d)-A*C,P=S-F.worldX,X=k-F.worldY,V=(P*T-X*A)*(R=Math.abs(R)<=1e-4?0:1/R)-c,D=(X*I-P*C)*R-u,L=Math.sqrt(V*V+D*D),N=n.data.length*v;if(L<1e-4)return this.apply1(e,i,r,!1,s,!1,l),void n.updateWorldTransformWith(b,M,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var O=((P=i-F.worldX)*T-(X=r-F.worldY)*A)*R-c,_=(X*I-P*C)*R-u,q=O*O+_*_;if(0!=h){h*=f*(v+1)*.5;var W=Math.sqrt(q),U=W-L-N*f+h;if(U>0){var z=Math.min(1,U/(2*h))-1;q=(O-=(z=(U-h*(1-z*z))/W)*O)*O+(_-=z*_)*_}}t:if(E){var G=(q-L*L-(N*=f)*N)/(2*L*N);G<-1?(G=-1,Y=Math.PI*a):G>1?(G=1,Y=0,s&&(m*=I=(Math.sqrt(q)/(L+N)-1)*l+1,o&&(g*=I))):Y=Math.acos(G)*a,I=L+N*G,A=N*Math.sin(Y),B=Math.atan2(_*I-O*A,O*I+_*A)}else{var H=(I=f*N)*I,j=(A=p*N)*A,J=Math.atan2(_,O),K=-2*j*L,Q=j-H;if((T=K*K-4*Q*(C=j*L*L+H*q-H*j))>=0){var Z=Math.sqrt(T);K<0&&(Z=-Z);var $=(Z=.5*-(K+Z))/Q,tt=C/Z,et=Math.abs($)<Math.abs(tt)?$:tt;if(et*et<=q){X=Math.sqrt(q-et*et)*a,B=J-Math.atan2(X,et),Y=Math.atan2(X/p,(et-L)/f);break t}}var nt=d.PI,it=L-I,rt=it*it,at=0,st=0,ot=L+I,ht=ot*ot,lt=0;(C=-I*L/(H-j))>=-1&&C<=1&&(C=Math.acos(C),(T=(P=I*Math.cos(C)+L)*P+(X=A*Math.sin(C))*X)<rt&&(nt=C,rt=T,it=P,at=X),T>ht&&(st=C,ht=T,ot=P,lt=X)),q<=.5*(rt+ht)?(B=J-Math.atan2(at*a,it),Y=nt*a):(B=J-Math.atan2(lt*a,ot),Y=st*a)}var ct=Math.atan2(M,b)*w,ut=e.arotation;(B=(B-ct)*d.radDeg+y-ut)>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(c,u,ut+B*l,m,g,0,0),ut=n.arotation,(Y=((Y+ct)*d.radDeg-n.ashearX)*w+x-ut)>180?Y-=360:Y<-180&&(Y+=360),n.updateWorldTransformWith(b,M,ut+Y*l,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}},e}(),ne=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.bendDirection=0,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=0,n.softness=0,n}return i(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}(Kt),ie=function(e){function n(n){var i=e.call(this,n,0,!1)||this;return i.bones=new Array,i._target=null,i.positionMode=t.PositionMode.Fixed,i.spacingMode=t.SpacingMode.Fixed,i.rotateMode=t.RotateMode.Chain,i.offsetRotation=0,i.position=0,i.spacing=0,i.mixRotate=0,i.mixX=0,i.mixY=0,i}return i(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}(Kt);t.PositionMode=void 0,(Gt=t.PositionMode||(t.PositionMode={}))[Gt.Fixed=0]="Fixed",Gt[Gt.Percent=1]="Percent",t.SpacingMode=void 0,(Ht=t.SpacingMode||(t.SpacingMode={}))[Ht.Length=0]="Length",Ht[Ht.Fixed=1]="Fixed",Ht[Ht.Percent=2]="Percent",Ht[Ht.Proportional=3]="Proportional",t.RotateMode=void 0,(jt=t.RotateMode||(t.RotateMode={}))[jt.Tangent=0]="Tangent",jt[jt.Chain=1]="Chain",jt[jt.ChainScale=2]="ChainScale";var re,ae=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,i=t.bones.length;n<i;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 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 i=this.target.getAttachment();if(i instanceof _t){var r=this.mixRotate,a=this.mixX,s=this.mixY;if(0!=r||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=(I=(R=c[y]).data.length)*R.a,b=I*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((I=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=I*R.a,b=I*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 I;if((I=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=I*R.a,b=I*R.c;var A=Math.sqrt(w*w+b*b);l&&(m[y]=A),p[++y]=(k?I+v:v)*A/I}}}var C=this.computeWorldPositions(i,f,h),T=C[0],E=C[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+=(T-R.worldX)*a,R.worldY+=(E-R.worldY)*s;var P=(w=C[Y])-T,X=(b=C[Y+1])-E;if(l){var V=m[y];if(0!=V){var D=(Math.sqrt(P*P+X*X)/V-1)*r+1;R.a*=D,R.c*=D}}if(T=w,E=b,r>0){var L=R.a,N=R.b,O=R.c,_=R.d,q=0,W=0,U=0;if(q=h?C[Y-1]:0==p[y+1]?C[Y+2]:Math.atan2(X,P),q-=Math.atan2(O,L),B){W=Math.cos(q),U=Math.sin(q);var z=R.data.length;T+=(z*(W*L-U*O)-P)*r,E+=(z*(U*L+W*O)-X)*r}else q+=F;q>d.PI?q-=d.PI2:q<-d.PI&&(q+=d.PI2),q*=r,W=Math.cos(q),U=Math.sin(q),R.a=W*L-U*O,R.b=W*N-U*_,R.c=U*L+W*O,R.d=U*N+W*_}R.updateAppliedTransform()}}}},e.prototype.computeWorldPositions=function(n,i,r){var a=this.target,s=this.position,o=this.spaces,h=g.setArraySize(this.positions,3*i+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/i;break;default:p=1}l=g.setArraySize(this.world,8);for(var y=0,x=0,w=0;y<i;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,r||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),I=0,A=l[0],C=l[1],T=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)T=l[q],E=l[q+1],F=l[q+2],B=l[q+3],L=2*(P=.1875*(A-2*T+F))+(V=.09375*(3*(T-F)-A+(Y=l[q+4]))),N=2*(X=.1875*(C-2*E+B))+(D=.09375*(3*(E-B)-C+(R=l[q+5]))),O=.75*(T-A)+P+.16666667*V,_=.75*(E-C)+X+.16666667*D,I+=Math.sqrt(O*O+_*_),O+=L,_+=N,L+=V,N+=D,I+=Math.sqrt(O*O+_*_),O+=L,_+=N,I+=Math.sqrt(O*O+_*_),O+=L+V,_+=N+D,I+=Math.sqrt(O*O+_*_),k[y]=I,A=Y,C=R;switch(this.data.positionMode==t.PositionMode.Percent&&(s*=I),this.data.spacingMode){case t.SpacingMode.Percent:S=I;break;case t.SpacingMode.Proportional:S=I/i;break;default:S=1}for(var W=this.segments,U=0,z=(y=0,x=0,w=0,0);y<i;y++,x+=3){var G;b=s+=G=o[y]*S;if(c)(b%=I)<0&&(b+=I),w=0;else{if(b<0){this.addBeforePosition(b,l,0,h,x);continue}if(b>I){this.addAfterPosition(b-I,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(A=l[j],C=l[j+1],T=l[j+2],E=l[j+3],F=l[j+4],B=l[j+5],L=2*(P=.03*(A-2*T+F))+(V=.006*(3*(T-F)-A+(Y=l[j+6]))),N=2*(X=.03*(C-2*E+B))+(D=.006*(3*(E-B)-C+(R=l[j+7]))),O=.3*(T-A)+P+.16666667*V,_=.3*(E-C)+X+.16666667*D,U=Math.sqrt(O*O+_*_),W[0]=U,j=1;j<8;j++)O+=L,_+=N,L+=V,N+=D,U+=Math.sqrt(O*O+_*_),W[j]=U;O+=L,_+=N,U+=Math.sqrt(O*O+_*_),W[8]=U,O+=L+V,_+=N+D,U+=Math.sqrt(O*O+_*_),W[9]=U,z=0}for(b*=U;;z++){var J=W[z];if(!(b>J)){var K;if(0==z)b/=J;else b=z+(b-(K=W[z-1]))/(J-K);break}}this.addCurvePosition(.1*b,A,C,T,E,F,B,Y,R,h,x,r||y>0&&0==G)}return h},e.prototype.addBeforePosition=function(t,e,n,i,r){var a=e[n],s=e[n+1],o=e[n+2]-a,h=e[n+3]-s,l=Math.atan2(h,o);i[r]=a+t*Math.cos(l),i[r+1]=s+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var a=e[n+2],s=e[n+3],o=a-e[n],h=s-e[n+1],l=Math.atan2(h,o);i[r]=a+t*Math.cos(l),i[r+1]=s+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,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(r-n,i-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+i*x+a*w+o*f,M=n*g+r*x+s*w+h*f;l[c]=b,l[c+1]=M,u&&(l[c+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(M-(n*m+r*v*2+s*d),b-(e*m+i*v*2+a*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}(),se=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 i=this.data.x>0,r=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:var l=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=l,this.lastTime=this.skeleton.time;var c=o.worldX,u=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=u;else{var f=this.remaining,p=this.inertia,m=this.data.limit*l,g=this.data.step,v=this.skeleton.data.referenceScale,y=-1;if(i||r){if(i){var x=(this.ux-c)*p;this.xOffset+=x>m?m:x<-m?-m:x,this.ux=c}if(r){x=(this.uy-u)*p;this.yOffset+=x>m?m:x<-m?-m:x,this.uy=u}if(f>=g){y=Math.pow(this.damping,60*g);var w=this.massInverse*g,b=this.strength,M=this.wind*v,S=(le.yDown?-this.gravity:this.gravity)*v;do{i&&(this.xVelocity+=(M-this.xOffset*b)*w,this.xOffset+=this.xVelocity*g,this.xVelocity*=y),r&&(this.yVelocity-=(S+this.yOffset*b)*w,this.yOffset+=this.yVelocity*g,this.yVelocity*=y),f-=g}while(f>=g)}i&&(o.worldX+=this.xOffset*n*this.data.x),r&&(o.worldY+=this.yOffset*n*this.data.y)}if(a||s){var k=Math.atan2(o.c,o.a),I=0,A=0,C=0,T=this.cx-o.worldX,E=this.cy-o.worldY;if(T>m?T=m:T<-m&&(T=-m),E>m?E=m:E<-m&&(E=-m),a){C=(this.data.rotate+this.data.shearX)*n;var F=Math.atan2(E+this.ty,T+this.tx)-k-this.rotateOffset*C;this.rotateOffset+=(F-Math.ceil(F*d.invPI2-.5)*d.PI2)*p,F=this.rotateOffset*C+k,I=Math.cos(F),A=Math.sin(F),s&&(F=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(T*I+E*A)*p/F)}else{I=Math.cos(k),A=Math.sin(k),(F=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(T*I+E*A)*p/F)}if((f=this.remaining)>=g){-1==y&&(y=Math.pow(this.damping,60*g));w=this.massInverse*g,b=this.strength,M=this.wind,S=le.yDown?-this.gravity:this.gravity;for(var B=h/v;;)if(f-=g,s&&(this.scaleVelocity+=(M*I-S*A-this.scaleOffset*b)*w,this.scaleOffset+=this.scaleVelocity*g,this.scaleVelocity*=y),a){if(this.rotateVelocity-=((M*A+S*I)*B+this.rotateOffset*b)*w,this.rotateOffset+=this.rotateVelocity*g,this.rotateVelocity*=y,f<g)break;F=this.rotateOffset*C+k;I=Math.cos(F),A=Math.sin(F)}else if(f<g)break}}this.remaining=f}this.cx=o.worldX,this.cy=o.worldY;break;case t.Physics.pose:i&&(o.worldX+=this.xOffset*n*this.data.x),r&&(o.worldY+=this.yOffset*n*this.data.y)}if(a){var Y=this.rotateOffset*n;A=0,I=0,f=0;if(this.data.shearX>0){F=0;this.data.rotate>0&&(F=Y*this.data.rotate,A=Math.sin(F),I=Math.cos(F),f=o.b,o.b=I*f-A*o.d,o.d=A*f+I*o.d),F+=Y*this.data.shearX,A=Math.sin(F),I=Math.cos(F),f=o.a,o.a=I*f-A*o.c,o.c=A*f+I*o.c}else Y*=this.data.rotate,A=Math.sin(Y),I=Math.cos(Y),f=o.a,o.a=I*f-A*o.c,o.c=A*f+I*o.c,f=o.b,o.b=I*f-A*o.d,o.d=A*f+I*o.d}if(s){A=1+this.scaleOffset*n*this.data.scaleX;o.a*=A,o.c*=A}e!=t.Physics.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}},e.prototype.translate=function(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e},e.prototype.rotate=function(t,e,n){var i=n*d.degRad,r=Math.cos(i),a=Math.sin(i),s=this.cx-t,o=this.cy-e;this.translate(s*r-o*a-s,s*a+o*r-o)},e}(),oe=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}(),he=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.bones=new Array;for(var n=0;n<t.bones.length;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 r=e.findBone(t.target.name);if(!r)throw new Error("Couldn't find target bone ".concat(t.target.name,"."));this.target=r,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}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,i=this.mixScaleX,r=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)-Math.atan2(M,w)+p)>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C*=t;var k=Math.cos(C),I=Math.sin(C);x.a=k*w-I*M,x.b=k*b-I*S,x.c=I*w+k*M,x.d=I*b+k*S}if(s){var A=this.temp;o.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(A.x-x.worldX)*e,x.worldY+=(A.y-x.worldY)*n}if(0!=i)0!=(E=Math.sqrt(x.a*x.a+x.c*x.c))&&(E=(E+(Math.sqrt(h*h+c*c)-E+this.data.offsetScaleX)*i)/E),x.a*=E,x.c*=E;if(0!=r)0!=(E=Math.sqrt(x.b*x.b+x.d*x.d))&&(E=(E+(Math.sqrt(l*l+u*u)-E+this.data.offsetScaleY)*r)/E),x.b*=E,x.d*=E;if(a>0){b=x.b,S=x.d;var C,T=Math.atan2(S,b);(C=Math.atan2(u,l)-Math.atan2(c,h)-(T-Math.atan2(x.c,x.a)))>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C=T+(C+m)*a;var E=Math.sqrt(b*b+S*S);x.b=Math.cos(C)*E,x.d=Math.sin(C)*E}x.updateAppliedTransform()}},t.prototype.applyRelativeWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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)+p)>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T*=t;var k=Math.cos(T),I=Math.sin(T);x.a=k*w-I*M,x.b=k*b-I*S,x.c=I*w+k*M,x.d=I*b+k*S}if(s){var A=this.temp;o.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),x.worldX+=A.x*e,x.worldY+=A.y*n}if(0!=i){var C=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*i+1;x.a*=C,x.c*=C}if(0!=r){C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;x.b*=C,x.d*=C}if(a>0){var T;(T=Math.atan2(u,l)-Math.atan2(c,h))>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2);b=x.b,S=x.d;T=Math.atan2(S,b)+(T-d.PI/2+m)*a;C=Math.sqrt(b*b+S*S);x.b=Math.cos(T)*C,x.d=Math.sin(T)*C}x.updateAppliedTransform()}},t.prototype.applyAbsoluteLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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;0!=t&&(u+=(s.arotation-u+this.data.offsetRotation)*t);var d=c.ax,f=c.ay;d+=(s.ax-d+this.data.offsetX)*e,f+=(s.ay-f+this.data.offsetY)*n;var p=c.ascaleX,m=c.ascaleY;0!=i&&0!=p&&(p=(p+(s.ascaleX-p+this.data.offsetScaleX)*i)/p),0!=r&&0!=m&&(m=(m+(s.ascaleY-m+this.data.offsetScaleY)*r)/m);var g=c.ashearY;0!=a&&(g+=(s.ashearY-g+this.data.offsetShearY)*a),c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t.prototype.applyRelativeLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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)*i+1),m=c.ascaleY*((s.ascaleY-1+this.data.offsetScaleY)*r+1),g=c.ashearY+(s.ashearY+this.data.offsetShearY)*a;c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t}(),le=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],i=void 0;if(n.parent){var r=this.bones[n.parent.index];i=new Jt(n,this,r),r.children.push(i)}else i=new Jt(n,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(e=0;e<t.slots.length;e++){var a=t.slots[e],s=(i=this.bones[a.boneData.index],new oe(a,i));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 ee(o,this))}this.transformConstraints=new Array;for(e=0;e<t.transformConstraints.length;e++){var h=t.transformConstraints[e];this.transformConstraints.push(new he(h,this))}this.pathConstraints=new Array;for(e=0;e<t.pathConstraints.length;e++){var l=t.pathConstraints[e];this.pathConstraints.push(new ae(l,this))}this.physicsConstraints=new Array;for(e=0;e<t.physicsConstraints.length;e++){var c=t.physicsConstraints[e];this.physicsConstraints.push(new se(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++){(r=t[e]).sorted=r.data.skinRequired,r.active=!r.sorted}if(this.skin){var i=this.skin.bones;for(e=0,n=this.skin.bones.length;e<n;e++){var r=this.bones[i[e].index];do{r.sorted=!1,r.active=!0,r=r.parent}while(r)}}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,i=n[0];if(this.sortBone(i),1==n.length)this._updateCache.push(t),this.sortReset(i.children);else{var r=n[n.length-1];this.sortBone(r),this._updateCache.push(t),this.sortReset(i.children),r.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,i=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,n,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,i);for(var r=0,a=this.data.skins.length;r<a;r++)this.sortPathConstraintAttachment(this.data.skins[r],n,i);var s=e.getAttachment();s instanceof _t&&this.sortPathConstraintAttachmentWith(s,i);var o=t.bones,h=o.length;for(r=0;r<h;r++)this.sortBone(o[r]);this._updateCache.push(t);for(r=0;r<h;r++)this.sortReset(o[r].children);for(r=0;r<h;r++)o[r].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 i=0;i<n;i++){var r=e[i];this.sortBone(r.parent),this.sortBone(r)}else for(i=0;i<n;i++)this.sortBone(e[i]);this._updateCache.push(t);for(i=0;i<n;i++)this.sortReset(e[i].children);for(i=0;i<n;i++)e[i].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(t,e,n){var i=t.attachments[e];if(i)for(var r in i)this.sortPathConstraintAttachmentWith(i[r],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,e){if(t instanceof _t){var n=t.bones;if(n)for(var i=this.bones,r=0,a=n.length;r<a;){var s=n[r++];for(s+=r;r<s;)this.sortBone(i[n[r++]])}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 i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}},t.prototype.updateWorldTransform=function(t){if(null==t)throw new Error("physics is undefined");for(var e=this.bones,n=0,i=e.length;n<i;n++){var r=e[n];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}var a=this._updateCache;for(n=0,i=a.length;n<i;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 i=e.a,r=e.b,a=e.c,s=e.d;n.worldX=i*this.x+r*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=(i*l+r*u)*this.scaleX,n.b=(i*c+r*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,i,r,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&&(i=f.return)&&i.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){r={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(r)throw r.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,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}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,i=e.length;n<i;n++){var r=e[n],a=r.data.attachmentName;if(a){var s=t.getAttachment(n,a);s&&r.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,i=0,r=n.length;i<r;i++){var a=n[i];if(a.data.name==t){var s=null;if(e&&!(s=this.getAttachment(i,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(e,n,i,r){if(void 0===i&&(i=new Array(2)),void 0===r&&(r=null),!e)throw new Error("offset cannot be null.");if(!n)throw new Error("size cannot be null.");for(var a=this.drawOrder,s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,u=a.length;c<u;c++){var d=a[c];if(d.bone.active){var f=0,p=null,m=null,v=d.getAttachment();if(v instanceof Wt)f=8,p=g.setArraySize(i,f,0),v.computeWorldVertices(d,p,0,2),m=t.quadTriangles;else if(v instanceof Ot){var y=v;f=y.worldVerticesLength,p=g.setArraySize(i,f,0),y.computeWorldVertices(d,0,f,p,0,2),m=y.triangles}else if(v instanceof Bt&&null!=r){r.clipStart(d,v);continue}if(p&&m){null!=r&&r.isClipping()&&(r.clipTriangles(p,f,m,m.length),p=r.clippedVertices,f=r.clippedVertices.length);for(var x=0,w=p.length;x<w;x+=2){var b=p[x],M=p[x+1];s=Math.min(s,b),o=Math.min(o,M),h=Math.max(h,b),l=Math.max(l,M)}}null!=r&&r.clipEndWithSlot(d)}}null!=r&&r.clipEnd(),e.set(s,o),n.set(h-s,l-o)},t.prototype.update=function(t){this.time+=t},t.prototype.physicsTranslate=function(t,e){for(var n=this.physicsConstraints,i=0,r=n.length;i<r;i++)n[i].translate(t,e)},t.prototype.physicsRotate=function(t,e,n){for(var i=this.physicsConstraints,r=0,a=i.length;r<a;r++)i[r].rotate(t,e,n)},t.quadTriangles=[0,1,2,2,3,0],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 ce,ue=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.limit=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 i(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}(Kt),de=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.referenceScale=100,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,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findSkin=function(t){if(!t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findEvent=function(t){if(!t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findAnimation=function(t){if(!t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findIkConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findTransformConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPathConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPhysicsConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.physicsConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t}(),fe=function(t,e,n){void 0===t&&(t=0),this.slotIndex=t,this.name=e,this.attachment=n},pe=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 i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},t.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var n=t.bones[e],i=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==n){i=!0;break}i||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(i=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==a){i=!0;break}i||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],i=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==n){i=!0;break}i||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(i=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==a){i=!0;break}i||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];o.attachment&&(o.attachment instanceof Ot?(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 i in n){var r=n[i];r&&t.push(new fe(e,i,r))}}return t},t.prototype.getAttachmentsForSlot=function(t,e){var n=this.attachments[t];if(n)for(var i in n){var r=n[i];r&&e.push(new fe(t,i,r))}},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,i=0;i<t.slots.length;i++){var r=t.slots[i],a=r.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&&r.setAttachment(h);break}}}n++}},t}(),me=function(e,n,i){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(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i};t.BlendMode=void 0,(ce=t.BlendMode||(t.BlendMode={}))[ce.Normal=0]="Normal",ce[ce.Additive=1]="Additive",ce[ce.Multiply=2]="Multiply",ce[ce.Screen=3]="Screen";var ge,ve=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 i(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}(Kt),ye=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,i=this.scale,r=new de;r.name="";var a=new xe(e),s=a.readInt32(),o=a.readInt32();r.hash=0==o&&0==s?null:o.toString(16)+s.toString(16),r.version=a.readString(),r.x=a.readFloat(),r.y=a.readFloat(),r.width=a.readFloat(),r.height=a.readFloat(),r.referenceScale=a.readFloat()*i;var h=a.readBoolean();h&&(r.fps=a.readFloat(),r.imagesPath=a.readString(),r.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:r.bones[a.readInt(!0)];(y=new zt(c,f,p)).rotation=a.readFloat(),y.x=a.readFloat()*i,y.y=a.readFloat()*i,y.scaleX=a.readFloat(),y.scaleY=a.readFloat(),y.shearX=a.readFloat(),y.shearY=a.readFloat(),y.length=a.readFloat()*i,y.inherit=a.readByte(),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()),r.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=r.bones[a.readInt(!0)],y=new me(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()),r.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 ne(b)).order=a.readInt(!0),w=a.readInt(!0);for(var M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.bones[a.readInt(!0)];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),0!=(32&S)&&(y.mix=0!=(64&S)?a.readFloat():1),0!=(128&S)&&(y.softness=a.readFloat()*i),r.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 ve(k)).order=a.readInt(!0),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),y.local=0!=(2&S),y.relative=0!=(4&S),0!=(8&S)&&(y.offsetRotation=a.readFloat()),0!=(16&S)&&(y.offsetX=a.readFloat()*i),0!=(32&S)&&(y.offsetY=a.readFloat()*i),0!=(64&S)&&(y.offsetScaleX=a.readFloat()),0!=(128&S)&&(y.offsetScaleY=a.readFloat()),0!=(1&(S=a.readByte()))&&(y.offsetShearY=a.readFloat()),0!=(2&S)&&(y.mixRotate=a.readFloat()),0!=(4&S)&&(y.mixX=a.readFloat()),0!=(8&S)&&(y.mixY=a.readFloat()),0!=(16&S)&&(y.mixScaleX=a.readFloat()),0!=(32&S)&&(y.mixScaleY=a.readFloat()),0!=(64&S)&&(y.mixShearY=a.readFloat()),r.transformConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var I=a.readString();if(!I)throw new Error("Path constraint data name must not be null.");(y=new ie(I)).order=a.readInt(!0),y.skinRequired=a.readBoolean(),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.slots[a.readInt(!0)];S=a.readByte();y.positionMode=1&S,y.spacingMode=S>>1&3,y.rotateMode=S>>3&3,0!=(128&S)&&(y.offsetRotation=a.readFloat()),y.position=a.readFloat(),y.positionMode==t.PositionMode.Fixed&&(y.position*=i),y.spacing=a.readFloat(),y.spacingMode!=t.SpacingMode.Length&&y.spacingMode!=t.SpacingMode.Fixed||(y.spacing*=i),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),r.pathConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var A=a.readString();if(!A)throw new Error("Physics constraint data name must not be null.");(y=new ue(A)).order=a.readInt(!0),y.bone=r.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.limit=(0!=(64&S)?a.readFloat():5e3)*i,y.step=1/a.readUnsignedByte(),y.inertia=a.readFloat(),y.strength=a.readFloat(),y.damping=a.readFloat(),y.massInverse=0!=(128&S)?a.readFloat():1,y.wind=a.readFloat(),y.gravity=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),y.mix=0!=(128&S)?a.readFloat():1,r.physicsConstraints.push(y)}var C=this.readSkin(a,r,!0,h);C&&(r.defaultSkin=C,r.skins.push(C));c=r.skins.length;for(g.setArraySize(r.skins,l=c+a.readInt(!0));c<l;c++){if(!(E=this.readSkin(a,r,!1,h)))throw new Error("readSkin() should not have returned null.");r.skins[c]=E}l=this.linkedMeshes.length;for(c=0;c<l;c++){var T=this.linkedMeshes[c],E=r.skins[T.skinIndex];if(!T.parent)throw new Error("Linked mesh parent must not be null");var F=E.getAttachment(T.slotIndex,T.parent);if(!F)throw new Error("Parent mesh not found: ".concat(T.parent));T.mesh.timelineAttachment=T.inheritTimeline?F:T.mesh,T.mesh.setParentMesh(F),null!=T.mesh.region&&T.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 te(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()),r.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.");r.animations.push(this.readAnimation(a,Y,r))}return r},e.prototype.readSkin=function(t,e,n,i){var r=null,a=0;if(n){if(0==(a=t.readInt(!0)))return null;r=new pe("default")}else{var s=t.readString();if(!s)throw new Error("Skin name must not be null.");r=new pe(s),i&&u.rgba8888ToColor(r.color,t.readInt32()),r.bones.length=t.readInt(!0);for(var o=0,h=r.bones.length;o<h;o++)r.bones[o]=e.bones[t.readInt(!0)];for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.ikConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.transformConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.pathConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.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,r,l,f,i);p&&r.setAttachment(l,f,p)}return r},e.prototype.readAttachment=function(t,e,n,i,r,a){var s=this.scale,o=t.readByte(),h=0!=(8&o)?t.readStringRef():r;if(!h)throw new Error("Attachment name must not be null");switch(7&o){case ge.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=0!=(128&o)?t.readFloat():0,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 ge.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 ge.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),I=(M=this.readVertices(t,0!=(128&o)),this.readFloatArray(t,M.length,1)),A=this.readShortArray(t,3*(M.length-k-2)),C=[];x=0,w=0;return a&&(C=this.readShortArray(t,t.readInt(!0)),x=t.readFloat(),w=t.readFloat()),l||(l=h),(T=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(T.path=l,u.rgba8888ToColor(T.color,c),T.bones=M.bones,T.vertices=M.vertices,T.worldVerticesLength=M.length,T.triangles=A,T.regionUVs=I,null==d&&T.updateRegion(),T.hullLength=k<<1,T.sequence=d,a&&(T.edges=C,T.width=x*s,T.height=w*s),T):null;case ge.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 T,E=0!=(128&o),F=t.readInt(!0),B=t.readStringRef();x=0,w=0;return a&&(x=t.readFloat(),w=t.readFloat()),(T=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(T.path=l,u.rgba8888ToColor(T.color,c),T.sequence=d,a&&(T.width=x*s,T.height=w*s),this.linkedMeshes.push(new we(T,F,i,B,E)),T):null;case ge.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 ge.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 ge.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){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,i=t.readInt(!0),r=new be;if(r.length=i<<1,!e)return r.vertices=this.readFloatArray(t,r.length,n),r;for(var a=new Array,s=new Array,o=0;o<i;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 r.vertices=g.toFloatArray(a),r.bones=s,r},e.prototype.readFloatArray=function(t,e,n){var i=new Array(e);if(1==n)for(var r=0;r<e;r++)i[r]=t.readFloat();else for(r=0;r<e;r++)i[r]=t.readFloat()*n;return i},e.prototype.readShortArray=function(t,e){for(var n=new Array(e),i=0;i<e;i++)n[i]=t.readInt(!0);return n},e.prototype.readAnimation=function(e,n,i){e.readInt(!0);for(var r=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=(xt=e.readInt(!0))-1;switch(u){case De:for(var f=new Q(xt,h),p=0;p<xt;p++)f.setFrame(p,e.readFloat(),e.readStringRef());r.push(f);break;case Le:for(var m=e.readInt(!0),v=(f=new G(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,k,1),ke(e,f,M++,p,1,v,S,x,I,1),ke(e,f,M++,p,2,v,S,w,A,1),ke(e,f,M++,p,3,v,S,b,E,1)}v=S,y=k,x=I,w=A,b=E}r.push(f);break;case Ne:for(m=e.readInt(!0),f=new H(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,k,1),ke(e,f,M++,p,1,v,S,x,I,1),ke(e,f,M++,p,2,v,S,w,A,1)}v=S,y=k,x=I,w=A}r.push(f);break;case Oe:for(m=e.readInt(!0),f=new J(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,b,k,I,A),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,st=e.readUnsignedByte()/255,gt=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,F,1),ke(e,f,M++,p,1,v,S,x,B,1),ke(e,f,M++,p,2,v,S,w,Y,1),ke(e,f,M++,p,3,v,S,b,R,1),ke(e,f,M++,p,4,v,S,k,P,1),ke(e,f,M++,p,5,v,S,I,st,1),ke(e,f,M++,p,6,v,S,A,gt,1)}v=S,y=F,x=B,w=Y,b=R,k=P,I=st,A=gt}r.push(f);break;case _e:for(m=e.readInt(!0),f=new K(xt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,k,I,A),p!=d;p++){S=e.readFloat(),F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,st=e.readUnsignedByte()/255,gt=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,F,1),ke(e,f,M++,p,1,v,S,x,B,1),ke(e,f,M++,p,2,v,S,w,Y,1),ke(e,f,M++,p,3,v,S,k,P,1),ke(e,f,M++,p,4,v,S,I,st,1),ke(e,f,M++,p,5,v,S,A,gt,1)}v=S,y=F,x=B,w=Y,k=P,I=st,A=gt}r.push(f);break;case qe:for(f=new j(xt,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 nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,b,E,1)}v=S,b=E}r.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var vt=e.readInt(!0);for(l=0,c=e.readInt(!0);l<c;l++){var yt=e.readByte(),xt=e.readInt(!0);if(yt!=Ve){m=e.readInt(!0);switch(yt){case Ae:r.push(Me(e,new X(xt,m,vt),1));break;case Ce:r.push(Se(e,new V(xt,m,vt),a));break;case Te:r.push(Me(e,new D(xt,m,vt),a));break;case Ee:r.push(Me(e,new L(xt,m,vt),a));break;case Fe:r.push(Se(e,new N(xt,m,vt),1));break;case Be:r.push(Me(e,new O(xt,m,vt),1));break;case Ye:r.push(Me(e,new _(xt,m,vt),1));break;case Re:r.push(Se(e,new q(xt,m,vt),1));break;case Pe:r.push(Me(e,new W(xt,m,vt),1));break;case Xe:r.push(Me(e,new U(xt,m,vt),1))}}else{for(f=new z(xt,vt),p=0;p<xt;p++)f.setFrame(p,e.readFloat(),e.readByte());r.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++){var wt=e.readInt(!0),bt=(d=(xt=e.readInt(!0))-1,f=new et(xt,e.readInt(!0),wt),e.readByte()),Mt=(v=e.readFloat(),0!=(1&bt)?0!=(2&bt)?e.readFloat():1:0),St=0!=(4&bt)?e.readFloat()*a:0;for(p=0,M=0;f.setFrame(p,v,Mt,St,0!=(8&bt)?1:-1,0!=(16&bt),0!=(32&bt)),p!=d;p++){bt=e.readByte();S=e.readFloat();var kt=0!=(1&bt)?0!=(2&bt)?e.readFloat():1:0,It=0!=(4&bt)?e.readFloat()*a:0;0!=(64&bt)?f.setStepped(p):0!=(128&bt)&&(ke(e,f,M++,p,0,v,S,Mt,kt,1),ke(e,f,M++,p,1,v,S,St,It,a)),v=S,Mt=kt,St=It}r.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){wt=e.readInt(!0),d=(xt=e.readInt(!0))-1,f=new nt(xt,e.readInt(!0),wt),v=e.readFloat();var At=e.readFloat(),Ct=e.readFloat(),Tt=e.readFloat(),Et=e.readFloat(),Ft=e.readFloat(),Bt=e.readFloat();for(p=0,M=0;f.setFrame(p,v,At,Ct,Tt,Et,Ft,Bt),p!=d;p++){S=e.readFloat();var Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat(),Xt=e.readFloat(),Vt=e.readFloat(),Dt=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,At,Yt,1),ke(e,f,M++,p,1,v,S,Ct,Rt,1),ke(e,f,M++,p,2,v,S,Tt,Pt,1),ke(e,f,M++,p,3,v,S,Et,Xt,1),ke(e,f,M++,p,4,v,S,Ft,Vt,1),ke(e,f,M++,p,5,v,S,Bt,Dt,1)}v=S,At=Yt,Ct=Rt,Tt=Pt,Et=Xt,Ft=Vt,Bt=Dt}r.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){wt=e.readInt(!0);var Lt=i.pathConstraints[wt];for(l=0,c=e.readInt(!0);l<c;l++){yt=e.readByte(),xt=e.readInt(!0),m=e.readInt(!0);switch(yt){case ze:r.push(Me(e,new it(xt,m,wt),Lt.positionMode==t.PositionMode.Fixed?a:1));break;case Ge:r.push(Me(e,new rt(xt,m,wt),Lt.spacingMode==t.SpacingMode.Length||Lt.spacingMode==t.SpacingMode.Fixed?a:1));break;case He:for(f=new at(xt,m,wt),v=e.readFloat(),At=e.readFloat(),Ct=e.readFloat(),Tt=e.readFloat(),p=0,M=0,d=f.getFrameCount()-1;f.setFrame(p,v,At,Ct,Tt),p!=d;p++){S=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,At,Yt,1),ke(e,f,M++,p,1,v,S,Ct,Rt,1),ke(e,f,M++,p,2,v,S,Tt,Pt,1)}v=S,At=Yt,Ct=Rt,Tt=Pt}r.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++)for(wt=e.readInt(!0)-1,l=0,c=e.readInt(!0);l<c;l++){yt=e.readByte(),xt=e.readInt(!0);if(yt!=en){m=e.readInt(!0);switch(yt){case je:r.push(Me(e,new ot(xt,m,wt),1));break;case Je:r.push(Me(e,new ht(xt,m,wt),1));break;case Ke:r.push(Me(e,new lt(xt,m,wt),1));break;case Qe:r.push(Me(e,new ct(xt,m,wt),1));break;case Ze:r.push(Me(e,new ut(xt,m,wt),1));break;case $e:r.push(Me(e,new dt(xt,m,wt),1));break;case tn:r.push(Me(e,new ft(xt,m,wt),1))}}else{for(f=new pt(xt,wt),p=0;p<xt;p++)f.setFrame(p,e.readFloat());r.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var Nt=i.skins[e.readInt(!0)];for(l=0,c=e.readInt(!0);l<c;l++){h=e.readInt(!0);for(var Ot=0,_t=e.readInt(!0);Ot<_t;Ot++){var qt=e.readStringRef();if(!qt)throw new Error("attachmentName must not be null.");var Wt=Nt.getAttachment(h,qt);u=e.readByte(),d=(xt=e.readInt(!0))-1;switch(u){case We:var Ut=Wt,zt=Ut.bones,Gt=Ut.vertices,Ht=zt?Gt.length/3*2:Gt.length;for(m=e.readInt(!0),f=new Z(xt,m,h,Ut),v=e.readFloat(),p=0,M=0;;p++){var jt=void 0,Jt=e.readInt(!0);if(0==Jt)jt=zt?g.newFloatArray(Ht):Gt;else{jt=g.newFloatArray(Ht);var Kt=e.readInt(!0);if(Jt+=Kt,1==a)for(var Qt=Kt;Qt<Jt;Qt++)jt[Qt]=e.readFloat();else for(Qt=Kt;Qt<Jt;Qt++)jt[Qt]=e.readFloat()*a;if(!zt){Qt=0;for(var Zt=jt.length;Qt<Zt;Qt++)jt[Qt]+=Gt[Qt]}}if(f.setFrame(p,v,jt),p==d)break;S=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,0,1,1)}v=S}r.push(f);break;case Ue:for(f=new mt(xt,h,Wt),p=0;p<xt;p++){v=e.readFloat();var te=e.readInt32();f.setFrame(p,v,C[15&te],te>>4,e.readFloat())}r.push(f)}}}}var ee=e.readInt(!0);if(ee>0){f=new tt(ee);var ne=i.slots.length;for(s=0;s<ee;s++){v=e.readFloat();var ie=e.readInt(!0),re=g.newArray(ne,0);for(l=ne-1;l>=0;l--)re[l]=-1;var ae=g.newArray(ne-ie,0),se=0,oe=0;for(l=0;l<ie;l++){for(h=e.readInt(!0);se!=h;)ae[oe++]=se++;re[se+e.readInt(!0)]=se++}for(;se<ne;)ae[oe++]=se++;for(l=ne-1;l>=0;l--)-1==re[l]&&(re[l]=ae[--oe]);f.setFrame(s,v,re)}r.push(f)}var he=e.readInt(!0);if(he>0){for(f=new $(he),s=0;s<he;s++){v=e.readFloat();var le=i.events[e.readInt(!0)],ce=new $t(v,le);ce.intValue=e.readInt(!1),ce.floatValue=e.readFloat(),ce.stringValue=e.readString(),null==ce.stringValue&&(ce.stringValue=le.stringValue),ce.data.audioPath&&(ce.volume=e.readFloat(),ce.balance=e.readFloat()),f.setFrame(s,ce)}r.push(f)}var ue=0;for(s=0,o=r.length;s<o;s++)ue=Math.max(ue,r[s].getDuration());return new T(n,r,ue)},e}(),xe=function(){function t(t,e,n,i){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===i&&(i=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=i}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 i=this.readUnsignedByte();switch(i>>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),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}(),we=function(t,e,n,i,r){this.mesh=t,this.skinIndex=e,this.slotIndex=n,this.parent=i,this.inheritTimeline=r},be=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 Me(t,e,n){for(var i=t.readFloat(),r=t.readFloat()*n,a=0,s=0,o=e.getFrameCount()-1;e.setFrame(a,i,r),a!=o;a++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case nn:e.setStepped(a);break;case rn:ke(t,e,s++,a,0,i,h,r,l,n)}i=h,r=l}return e}function Se(t,e,n){for(var i=t.readFloat(),r=t.readFloat()*n,a=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,i,r,a),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case nn:e.setStepped(s);break;case rn:ke(t,e,o++,s,0,i,l,r,c,n),ke(t,e,o++,s,1,i,l,a,u,n)}i=l,r=c,a=u}return e}function ke(t,e,n,i,r,a,s,o,h,l){e.setBezier(n,i,r,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"}(ge||(ge={}));var Ie,Ae=0,Ce=1,Te=2,Ee=3,Fe=4,Be=5,Ye=6,Re=7,Pe=8,Xe=9,Ve=10,De=0,Le=1,Ne=2,Oe=3,_e=4,qe=5,We=0,Ue=1,ze=0,Ge=1,He=2,je=0,Je=1,Ke=2,Qe=4,Ze=5,$e=6,tn=7,en=8,nn=1,rn=2,an=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,i=this.polygons,r=this.polygonPool,a=t.slots,s=a.length;n.length=0,r.freeAll(i),i.length=0;for(var o=0;o<s;o++){var h=a[o];if(h.bone.active){var l=h.getAttachment();if(l instanceof Ft){var c=l;n.push(c);var u=r.obtain();u.length!=c.worldVerticesLength&&(u=g.newFloatArray(c.worldVerticesLength)),i.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,i=Number.NEGATIVE_INFINITY,r=this.polygons,a=0,s=r.length;a<s;a++)for(var o=r[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),i=Math.max(i,d)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=i},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,i){var r=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=a&&i<=a||t>=s&&n>=s||e>=o&&i>=o)return!1;var h=(i-e)/(n-t),l=h*(r-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>r&&c<s||(c=(o-e)/h+t)>r&&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,i=0,r=n.length;i<r;i++)if(this.containsPointPolygon(n[i],t,e))return this.boundingBoxes[i];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var i=t,r=t.length,a=r-2,s=!1,o=0;o<r;o+=2){var h=i[o+1],l=i[a+1];if(h<n&&l>=n||l<n&&h>=n){var c=i[o];c+(n-h)/(l-h)*(i[a]-c)<e&&(s=!s)}a=o}return s},t.prototype.intersectsSegment=function(t,e,n,i){for(var r=this.polygons,a=0,s=r.length;a<s;a++)if(this.intersectsSegmentPolygon(r[a],t,e,n,i))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,i,r){for(var a=t,s=t.length,o=e-i,h=n-r,l=e*r-n*i,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<=i||x>=i&&x<=e)){var w=(l*v-h*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=r||w>=r&&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}(),sn=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,i=e.length>>1,r=this.indicesArray;r.length=0;for(var a=0;a<i;a++)r[a]=a;var s=this.isConcaveArray;s.length=0;a=0;for(var o=i;a<o;++a)s[a]=t.isConcave(a,i,n,r);var h=this.triangles;for(h.length=0;i>3;){for(var l=i-1,c=(a=0,1);;){t:if(!s[a]){for(var u=r[l]<<1,d=r[a]<<1,f=r[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)%i;w!=l;w=(w+1)%i)if(s[w]){var b=r[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)%i}h.push(r[(i+a-1)%i]),h.push(r[a]),h.push(r[(a+1)%i]),r.splice(a,1),s.splice(a,1);var k=(--i+a-1)%i,I=a==i?0:a;s[k]=t.isConcave(k,i,n,r),s[I]=t.isConcave(I,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},t.prototype.decompose=function(e,n){var i=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.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=i[d],g=i[d+1],v=i[f],y=i[f+1],x=i[p],w=i[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?(r.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&&(r.push(o),a.push(s));for(c=0,u=r.length;c<u;c++)if(0!=(s=a[c]).length)for(var I=s[0],A=s[s.length-1],C=(o=r[c])[M=o.length-4],T=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(C,T,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],_=r[V];x=_[_.length-2],w=_[_.length-1];if(L==I&&N==A){S=t.winding(C,T,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),C=E,T=F,E=x,F=w,V=0)}}}for(c=r.length-1;c>=0;c--)0==(o=r[c]).length&&(r.splice(c,1),this.polygonPool.free(o),s=a[c],a.splice(c,1),this.polygonIndicesPool.free(s));return r},t.isConcave=function(t,e,n,i){var r=i[(e+t-1)%e]<<1,a=i[t]<<1,s=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[a],n[a+1],n[s],n[s+1])},t.positiveArea=function(t,e,n,i,r,a){return t*(a-i)+n*(e-a)+r*(i-e)>=0},t.winding=function(t,e,n,i,r,a){var s=n-t,o=i-e;return r*o-a*s+s*e-t*o>=0?1:-1},t}(),on=function(){function t(){this.triangulator=new sn,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 i=n.worldVerticesLength,r=g.setArraySize(this.clippingPolygon,i);n.computeWorldVertices(e,0,i,r,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,i,r,a,s,o){r&&a&&s&&"boolean"==typeof o?this.clipTrianglesRender(t,e,n,i,r,a,s,o):this.clipTrianglesNoRender(t,e,n,i)},t.prototype.clipTrianglesNoRender=function(t,e,n,i){var r=this.clipOutput,a=this.clippedVertices,s=this.clippedTriangles,o=this.clippingPolygons,h=o.length,l=0;a.length=0,s.length=0;t:for(var c=0;c<i;c+=3)for(var u=n[c]<<1,d=t[u],f=t[u+1],p=t[u=n[c+1]<<1],m=t[u+1],v=t[u=n[c+2]<<1],y=t[u+1],x=0;x<h;x++){var w=a.length;if(!this.clip(d,f,p,m,v,y,o[x],r)){(k=g.setArraySize(a,w+6))[w]=d,k[w+1]=f,k[w+2]=p,k[w+3]=m,k[w+4]=v,k[w+5]=y,w=s.length,(T=g.setArraySize(s,w+3))[w]=l,T[w+1]=l+1,T[w+2]=l+2,l+=3;continue t}var b=r.length;if(0!=b){for(var M=b>>1,S=this.clipOutput,k=g.setArraySize(a,w+2*M),I=0;I<b;I+=2){var A=S[I],C=S[I+1];k[w]=A,k[w+1]=C,w+=2}w=s.length;var T=g.setArraySize(s,w+3*(M-2));M--;for(I=1;I<M;I++)T[w]=l,T[w+1]=l+I,T[w+2]=l+I+1,w+=3;l+=M+1}}},t.prototype.clipTrianglesRender=function(t,e,n,i,r,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<i;m+=3)for(var v=n[m]<<1,y=t[v],x=t[v+1],w=r[v],b=r[v+1],M=t[v=n[m+1]<<1],S=t[v+1],k=r[v],I=r[v+1],A=t[v=n[m+2]<<1],C=t[v+1],T=r[v],E=r[v+1],F=0;F<d;F++){var B=l.length;if(!this.clip(y,x,M,S,A,C,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]=I,O[B+20]=s.r,O[B+21]=s.g,O[B+22]=s.b,O[B+23]=s.a,O[B+24]=A,O[B+25]=C,O[B+26]=a.r,O[B+27]=a.g,O[B+28]=a.b,O[B+29]=a.a,O[B+30]=T,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]=I,O[B+16]=A,O[B+17]=C,O[B+18]=a.r,O[B+19]=a.g,O[B+20]=a.b,O[B+21]=a.a,O[B+22]=T,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-C,P=A-M,X=y-A,V=C-x,D=1/(R*X+P*(x-C)),L=Y>>1,N=this.clipOutput,O=g.setArraySize(l,B+L*f),_=0;_<Y;_+=2){var q=N[_],W=N[_+1];O[B]=q,O[B+1]=W,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a;var U=q-A,z=W-C,G=(R*U+P*z)*D,H=(V*U+X*z)*D,j=1-G-H;O[B+6]=w*G+k*H+T*j,O[B+7]=b*G+I*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,i,r,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(i),h.push(r),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],I=w[S+1],A=w[S+2],C=w[S+3],T=y*(C-v)-x*(A-g)>0;if(y*(I-v)-x*(k-g)>0){if(T){o.push(A),o.push(C);continue}var E=(B=C-I)*(g-p)-(Y=A-k)*(v-m);if(Math.abs(E)>1e-6){var F=(Y*(m-I)-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(T){var B,Y;E=(B=C-I)*(g-p)-(Y=A-k)*(v-m);if(Math.abs(E)>1e-6){F=(Y*(m-I)-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(A),o.push(C)}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,i=e[n-2]*e[1]-e[0]*e[n-1],r=0,a=0,s=0,o=0,h=n-3;o<h;o+=2)r=e[o],a=e[o+1],s=e[o+2],i+=r*e[o+3]-s*a;if(!(i<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}(),hn=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,i,r=this.scale,a=new de,s="string"==typeof e?JSON.parse(e):e,o=s.skeleton;if(o&&(a.hash=o.hash,a.version=o.spine,a.x=o.x,a.y=o.y,a.width=o.width,a.height=o.height,a.referenceScale=fn(o,"referenceScale",100)*r,a.fps=o.fps,a.imagesPath=null!==(n=o.images)&&void 0!==n?n:null,a.audioPath=null!==(i=o.audio)&&void 0!==i?i:null),s.bones)for(var h=0;h<s.bones.length;h++){var l=s.bones[h],c=null,d=fn(l,"parent",null);d&&(c=a.findBone(d)),(v=new zt(a.bones.length,l.name,c)).length=fn(l,"length",0)*r,v.x=fn(l,"x",0)*r,v.y=fn(l,"y",0)*r,v.rotation=fn(l,"rotation",0),v.scaleX=fn(l,"scaleX",1),v.scaleY=fn(l,"scaleY",1),v.shearX=fn(l,"shearX",0),v.shearY=fn(l,"shearY",0),v.inherit=g.enumValue(t.Inherit,fn(l,"inherit","Normal")),v.skinRequired=fn(l,"skin",!1),(m=fn(l,"color",null))&&v.color.setFromString(m),a.bones.push(v)}if(s.slots)for(h=0;h<s.slots.length;h++){var f=(F=s.slots[h]).name,p=a.findBone(F.bone);if(!p)throw new Error("Couldn't find bone ".concat(F.bone," for slot ").concat(f));var m,v=new me(a.slots.length,f,p);(m=fn(F,"color",null))&&v.color.setFromString(m);var y=fn(F,"dark",null);y&&(v.darkColor=u.fromString(y)),v.attachmentName=fn(F,"attachment",null),v.blendMode=g.enumValue(t.BlendMode,fn(F,"blend","normal")),v.visible=fn(F,"visible",!0),a.slots.push(v)}if(s.ik)for(h=0;h<s.ik.length;h++){var x=s.ik[h];(v=new ne(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(var w=0;w<x.bones.length;w++){if(!(A=a.findBone(x.bones[w])))throw new Error("Couldn't find bone ".concat(x.bones[w]," for IK constraint ").concat(x.name,"."));v.bones.push(A)}if(!(S=a.findBone(x.target)))throw new Error("Couldn't find target bone ".concat(x.target," for IK constraint ").concat(x.name,"."));v.target=S,v.mix=fn(x,"mix",1),v.softness=fn(x,"softness",0)*r,v.bendDirection=fn(x,"bendPositive",!0)?1:-1,v.compress=fn(x,"compress",!1),v.stretch=fn(x,"stretch",!1),v.uniform=fn(x,"uniform",!1),a.ikConstraints.push(v)}if(s.transform)for(h=0;h<s.transform.length;h++){x=s.transform[h];(v=new ve(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(w=0;w<x.bones.length;w++){var b=x.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for transform constraint ").concat(x.name,"."));v.bones.push(A)}var M=x.target;if(!(S=a.findBone(M)))throw new Error("Couldn't find target bone ".concat(M," for transform constraint ").concat(x.name,"."));v.target=S,v.local=fn(x,"local",!1),v.relative=fn(x,"relative",!1),v.offsetRotation=fn(x,"rotation",0),v.offsetX=fn(x,"x",0)*r,v.offsetY=fn(x,"y",0)*r,v.offsetScaleX=fn(x,"scaleX",0),v.offsetScaleY=fn(x,"scaleY",0),v.offsetShearY=fn(x,"shearY",0),v.mixRotate=fn(x,"mixRotate",1),v.mixX=fn(x,"mixX",1),v.mixY=fn(x,"mixY",v.mixX),v.mixScaleX=fn(x,"mixScaleX",1),v.mixScaleY=fn(x,"mixScaleY",v.mixScaleX),v.mixShearY=fn(x,"mixShearY",1),a.transformConstraints.push(v)}if(s.path)for(h=0;h<s.path.length;h++){x=s.path[h];(v=new ie(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(w=0;w<x.bones.length;w++){b=x.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for path constraint ").concat(x.name,"."));v.bones.push(A)}var S;M=x.target;if(!(S=a.findSlot(M)))throw new Error("Couldn't find target slot ".concat(M," for path constraint ").concat(x.name,"."));v.target=S,v.positionMode=g.enumValue(t.PositionMode,fn(x,"positionMode","Percent")),v.spacingMode=g.enumValue(t.SpacingMode,fn(x,"spacingMode","Length")),v.rotateMode=g.enumValue(t.RotateMode,fn(x,"rotateMode","Tangent")),v.offsetRotation=fn(x,"rotation",0),v.position=fn(x,"position",0),v.positionMode==t.PositionMode.Fixed&&(v.position*=r),v.spacing=fn(x,"spacing",0),v.spacingMode!=t.SpacingMode.Length&&v.spacingMode!=t.SpacingMode.Fixed||(v.spacing*=r),v.mixRotate=fn(x,"mixRotate",1),v.mixX=fn(x,"mixX",1),v.mixY=fn(x,"mixY",v.mixX),a.pathConstraints.push(v)}if(s.physics)for(h=0;h<s.physics.length;h++){x=s.physics[h];(v=new ue(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);b=x.bone;if(null==(A=a.findBone(b)))throw new Error("Physics bone not found: "+b);v.bone=A,v.x=fn(x,"x",0),v.y=fn(x,"y",0),v.rotate=fn(x,"rotate",0),v.scaleX=fn(x,"scaleX",0),v.shearX=fn(x,"shearX",0),v.limit=fn(x,"limit",5e3)*r,v.step=1/fn(x,"fps",60),v.inertia=fn(x,"inertia",1),v.strength=fn(x,"strength",100),v.damping=fn(x,"damping",1),v.massInverse=1/fn(x,"mass",1),v.wind=fn(x,"wind",0),v.gravity=fn(x,"gravity",0),v.mix=fn(x,"mix",1),v.inertiaGlobal=fn(x,"inertiaGlobal",!1),v.strengthGlobal=fn(x,"strengthGlobal",!1),v.dampingGlobal=fn(x,"dampingGlobal",!1),v.massGlobal=fn(x,"massGlobal",!1),v.windGlobal=fn(x,"windGlobal",!1),v.gravityGlobal=fn(x,"gravityGlobal",!1),v.mixGlobal=fn(x,"mixGlobal",!1),a.physicsConstraints.push(v)}if(s.skins)for(h=0;h<s.skins.length;h++){var k=s.skins[h],I=new pe(k.name);if(k.bones)for(w=0;w<k.bones.length;w++){var A;b=k.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for skin ").concat(k.name,"."));I.bones.push(A)}if(k.ik)for(w=0;w<k.ik.length;w++){var C=k.ik[w];if(!(T=a.findIkConstraint(C)))throw new Error("Couldn't find IK constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.transform)for(w=0;w<k.transform.length;w++){C=k.transform[w];if(!(T=a.findTransformConstraint(C)))throw new Error("Couldn't find transform constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.path)for(w=0;w<k.path.length;w++){C=k.path[w];if(!(T=a.findPathConstraint(C)))throw new Error("Couldn't find path constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.physics)for(w=0;w<k.physics.length;w++){var T;C=k.physics[w];if(!(T=a.findPhysicsConstraint(C)))throw new Error("Couldn't find physics constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}for(var f in k.attachments){var E=a.findSlot(f);if(!E)throw new Error("Couldn't find slot ".concat(f," for skin ").concat(k.name,"."));var F=k.attachments[f];for(var B in F){var Y=this.readAttachment(F[B],I,E.index,B,a);Y&&I.setAttachment(E.index,B,Y)}}a.skins.push(I),"default"==I.name&&(a.defaultSkin=I)}h=0;for(var R=this.linkedMeshes.length;h<R;h++){var P=this.linkedMeshes[h];if(!(I=P.skin?a.findSkin(P.skin):a.defaultSkin))throw new Error("Skin not found: ".concat(P.skin));var X=I.getAttachment(P.slotIndex,P.parent);if(!X)throw new Error("Parent mesh not found: ".concat(P.parent));P.mesh.timelineAttachment=P.inheritTimeline?X:P.mesh,P.mesh.setParentMesh(X),null!=P.mesh.region&&P.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(var V in s.events){var D=s.events[V];(v=new te(V)).intValue=fn(D,"int",0),v.floatValue=fn(D,"float",0),v.stringValue=fn(D,"string",""),v.audioPath=fn(D,"audio",null),v.audioPath&&(v.volume=fn(D,"volume",1),v.balance=fn(D,"balance",0)),a.events.push(v)}if(s.animations)for(var L in s.animations){var N=s.animations[L];this.readAnimation(N,L,a)}return a},e.prototype.readAttachment=function(t,e,n,i,r){var a=this.scale;switch(i=fn(t,"name",i),fn(t,"type","region")){case"region":var s=fn(t,"path",i),o=this.readSequence(fn(t,"sequence",null)),h=this.attachmentLoader.newRegionAttachment(e,i,s,o);return h?(h.path=s,h.x=fn(t,"x",0)*a,h.y=fn(t,"y",0)*a,h.scaleX=fn(t,"scaleX",1),h.scaleY=fn(t,"scaleY",1),h.rotation=fn(t,"rotation",0),h.width=t.width*a,h.height=t.height*a,h.sequence=o,(w=fn(t,"color",null))&&h.color.setFromString(w),null!=h.region&&h.updateRegion(),h):null;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,i);return l?(this.readVertices(t,l,t.vertexCount<<1),(w=fn(t,"color",null))&&l.color.setFromString(w),l):null;case"mesh":case"linkedmesh":s=fn(t,"path",i),o=this.readSequence(fn(t,"sequence",null));var c=this.attachmentLoader.newMeshAttachment(e,i,s,o);if(!c)return null;c.path=s,(w=fn(t,"color",null))&&c.color.setFromString(w),c.width=fn(t,"width",0)*a,c.height=fn(t,"height",0)*a,c.sequence=o;var u=fn(t,"parent",null);if(u)return this.linkedMeshes.push(new ln(c,fn(t,"skin",null),n,u,fn(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=fn(t,"edges",null),c.hullLength=2*fn(t,"hull",0),c;case"path":if(!(s=this.attachmentLoader.newPathAttachment(e,i)))return null;s.closed=fn(t,"closed",!1),s.constantSpeed=fn(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=fn(t,"color",null))&&s.color.setFromString(w),s;case"point":var v=this.attachmentLoader.newPointAttachment(e,i);return v?(v.x=fn(t,"x",0)*a,v.y=fn(t,"y",0)*a,v.rotation=fn(t,"rotation",0),(w=fn(t,"color",null))&&v.color.setFromString(w),v):null;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,i);if(!y)return null;var x=fn(t,"end",null);x&&(y.endSlot=r.findSlot(x));var w;f=t.vertexCount;return this.readVertices(t,y,f<<1),(w=fn(t,"color",null))&&y.color.setFromString(w),y}return null},e.prototype.readSequence=function(t){if(null==t)return null;var e=new k(fn(t,"count",0));return e.start=fn(t,"start",1),e.digits=fn(t,"digits",0),e.setupIndex=fn(t,"setup",0),e},e.prototype.readVertices=function(t,e,n){var i=this.scale;e.worldVerticesLength=n;var r=t.vertices;if(n!=r.length){var a=new Array,s=new Array;for(c=0,u=r.length;c<u;){var o=r[c++];s.push(o);for(var h=c+4*o;c<h;c+=4)s.push(r[c]),a.push(r[c+1]*i),a.push(r[c+2]*i),a.push(r[c+3])}e.bones=s,e.vertices=g.toFloatArray(a)}else{var l=g.toFloatArray(r);if(1!=i)for(var c=0,u=r.length;c<u;c++)l[c]*=i;e.vertices=l}},e.prototype.readAnimation=function(e,n,i){var r=this.scale,a=new Array;if(e.slots)for(var s in e.slots){var o=e.slots[s];if(!(de=i.findSlot(s)))throw new Error("Slot not found: "+s);var l=de.index;for(var c in o){if(qt=o[c]){var d=qt.length;if("attachment"==c){for(var f=new Q(d,l),p=0;p<d;p++){var m=qt[p];f.setFrame(p,fn(m,"time",0),fn(m,"name",null))}a.push(f)}else if("rgba"==c){f=new G(d,d<<2,l);for(var v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}var w=fn(Gt,"time",0),b=u.fromString(Gt.color);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,y.a,b.a,1)),v=w,y=b,m=Gt}a.push(f)}else if("rgb"==c){for(f=new H(d,3*d,l),v=fn(m=qt[0],"time",0),y=u.fromString(m.color),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.color);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1)),v=w,y=b,m=Gt}a.push(f)}else if("alpha"==c)a.push(cn(qt,new j(d,d,l),0,1));else if("rgba2"==c){f=new J(d,7*d,l),v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.light);var S=u.fromString(Gt.dark);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,y.a,b.a,1),x=dn(Zt,f,x,p,4,v,w,M.r,S.r,1),x=dn(Zt,f,x,p,5,v,w,M.g,S.g,1),x=dn(Zt,f,x,p,6,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=Gt}a.push(f)}else if("rgb2"==c){for(f=new K(d,6*d,l),v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.light),S=u.fromString(Gt.dark);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,M.r,S.r,1),x=dn(Zt,f,x,p,4,v,w,M.g,S.g,1),x=dn(Zt,f,x,p,5,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=Gt}a.push(f)}}}}if(e.bones)for(var k in e.bones){var I=e.bones[k],A=i.findBone(k);if(!A)throw new Error("Bone not found: "+k);var C=A.index;for(var c in I){var E=(qt=I[c]).length;if(0!=E)if("rotate"===c)a.push(cn(qt,new X(E,E,C),0,1));else if("translate"===c){f=new V(E,E<<1,C);a.push(un(qt,f,"x","y",0,r))}else if("translatex"===c){f=new D(E,E,C);a.push(cn(qt,f,0,r))}else if("translatey"===c){f=new L(E,E,C);a.push(cn(qt,f,0,r))}else if("scale"===c){f=new N(E,E<<1,C);a.push(un(qt,f,"x","y",1,1))}else if("scalex"===c){f=new O(E,E,C);a.push(cn(qt,f,1,1))}else if("scaley"===c){f=new _(E,E,C);a.push(cn(qt,f,1,1))}else if("shear"===c){f=new q(E,E<<1,C);a.push(un(qt,f,"x","y",0,1))}else if("shearx"===c){f=new W(E,E,C);a.push(cn(qt,f,0,1))}else if("sheary"===c){f=new U(E,E,C);a.push(cn(qt,f,0,1))}else if("inherit"===c){for(f=new z(E,A.index),p=0;p<qt.length;p++){var F=qt[p];f.setFrame(p,fn(F,"time",0),g.enumValue(t.Inherit,fn(F,"inherit","Normal")))}a.push(f)}}}if(e.ik)for(var B in e.ik){if(m=(Et=e.ik[B])[0]){if(!(Bt=i.findIkConstraint(B)))throw new Error("IK Constraint not found: "+B);var Y=i.ikConstraints.indexOf(Bt),R=(f=new et(Et.length,Et.length<<1,Y),v=fn(m,"time",0),fn(m,"mix",1)),P=fn(m,"softness",0)*r;for(p=0,x=0;;p++){if(f.setFrame(p,v,R,P,fn(m,"bendPositive",!0)?1:-1,fn(m,"compress",!1),fn(m,"stretch",!1)),!(Gt=Et[p+1])){f.shrink(x);break}w=fn(Gt,"time",0);var st=fn(Gt,"mix",1),gt=fn(Gt,"softness",0)*r;(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,R,st,1),x=dn(Zt,f,x,p,1,v,w,P,gt,r)),v=w,R=st,P=gt,m=Gt}a.push(f)}}if(e.transform)for(var B in e.transform){if(m=(qt=e.transform[B])[0]){if(!(Bt=i.findTransformConstraint(B)))throw new Error("Transform constraint not found: "+B);Y=i.transformConstraints.indexOf(Bt),f=new nt(qt.length,6*qt.length,Y),v=fn(m,"time",0);var vt=fn(m,"mixRotate",1),yt=fn(m,"mixX",1),xt=fn(m,"mixY",yt),wt=fn(m,"mixScaleX",1),bt=fn(m,"mixScaleY",wt),Mt=fn(m,"mixShearY",1);for(p=0,x=0;;p++){if(f.setFrame(p,v,vt,yt,xt,wt,bt,Mt),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0);var St=fn(Gt,"mixRotate",1),kt=fn(Gt,"mixX",1),It=fn(Gt,"mixY",kt),At=fn(Gt,"mixScaleX",1),Ct=fn(Gt,"mixScaleY",At),Tt=fn(Gt,"mixShearY",1);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,vt,St,1),x=dn(Zt,f,x,p,1,v,w,yt,kt,1),x=dn(Zt,f,x,p,2,v,w,xt,It,1),x=dn(Zt,f,x,p,3,v,w,wt,At,1),x=dn(Zt,f,x,p,4,v,w,bt,Ct,1),x=dn(Zt,f,x,p,5,v,w,Mt,Tt,1)),v=w,vt=St,yt=kt,xt=It,wt=At,bt=Ct,wt=At,m=Gt}a.push(f)}}if(e.path)for(var B in e.path){var Et=e.path[B];if(!(Bt=i.findPathConstraint(B)))throw new Error("Path constraint not found: "+B);Y=i.pathConstraints.indexOf(Bt);for(var c in Et){if(m=(qt=Et[c])[0]){var Ft=qt.length;if("position"===c){f=new it(Ft,Ft,Y);a.push(cn(qt,f,0,Bt.positionMode==t.PositionMode.Fixed?r:1))}else if("spacing"===c){f=new rt(Ft,Ft,Y);a.push(cn(qt,f,0,Bt.spacingMode==t.SpacingMode.Length||Bt.spacingMode==t.SpacingMode.Fixed?r:1))}else if("mix"===c){for(f=new at(Ft,3*Ft,Y),v=fn(m,"time",0),vt=fn(m,"mixRotate",1),yt=fn(m,"mixX",1),xt=fn(m,"mixY",yt),p=0,x=0;;p++){if(f.setFrame(p,v,vt,yt,xt),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),St=fn(Gt,"mixRotate",1),kt=fn(Gt,"mixX",1),It=fn(Gt,"mixY",kt);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,vt,St,1),x=dn(Zt,f,x,p,1,v,w,yt,kt,1),x=dn(Zt,f,x,p,2,v,w,xt,It,1)),v=w,vt=St,yt=kt,xt=It,m=Gt}a.push(f)}}}}if(e.physics)for(var B in e.physics){Et=e.physics[B],Y=-1;if(B.length>0){var Bt;if(!(Bt=i.findPhysicsConstraint(B)))throw new Error("Physics constraint not found: "+B);Y=i.physicsConstraints.indexOf(Bt)}for(var c in Et){if(m=(qt=Et[c])[0]){var Yt=qt.length;if("reset"!=c){f=void 0;if("inertia"==c)f=new ot(Yt,Yt,Y);else if("strength"==c)f=new ht(Yt,Yt,Y);else if("damping"==c)f=new lt(Yt,Yt,Y);else if("mass"==c)f=new ct(Yt,Yt,Y);else if("wind"==c)f=new ut(Yt,Yt,Y);else if("gravity"==c)f=new dt(Yt,Yt,Y);else{if("mix"!=c)continue;f=new ft(Yt,Yt,Y)}a.push(cn(qt,f,0,1))}else{var Rt=new pt(Yt,Y);for(p=0;null!=m;m=qt[p+1],p++)Rt.setFrame(p,fn(m,"time",0));a.push(Rt)}}}}if(e.attachments)for(var Pt in e.attachments){var Xt=e.attachments[Pt],Vt=i.findSkin(Pt);if(!Vt)throw new Error("Skin not found: "+Pt);for(var Dt in Xt){o=Xt[Dt];if(!(de=i.findSlot(Dt)))throw new Error("Slot not found: "+Dt);l=de.index;for(var Lt in o){var Nt=o[Lt],Ot=Vt.getAttachment(l,Lt);for(var _t in Nt){var qt;if(m=(qt=Nt[_t])[0])if("deform"==_t){var Wt=Ot.bones,Ut=Ot.vertices,zt=Wt?Ut.length/3*2:Ut.length;for(f=new Z(qt.length,qt.length,l,Ot),v=fn(m,"time",0),p=0,x=0;;p++){var Gt,Ht=void 0,jt=fn(m,"vertices",null);if(jt){Ht=g.newFloatArray(zt);var Jt=fn(m,"offset",0);if(g.arrayCopy(jt,0,Ht,Jt,jt.length),1!=r)for(var Kt=(Qt=Jt)+jt.length;Qt<Kt;Qt++)Ht[Qt]*=r;if(!Wt)for(var Qt=0;Qt<zt;Qt++)Ht[Qt]+=Ut[Qt]}else Ht=Wt?g.newFloatArray(zt):Ut;if(f.setFrame(p,v,Ht),!(Gt=qt[p+1])){f.shrink(x);break}var Zt;w=fn(Gt,"time",0);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,0,1,1)),v=w,m=Gt}a.push(f)}else if("sequence"==_t){f=new mt(qt.length,l,Ot);var te=0;for(p=0;p<qt.length;p++){var ee=fn(m,"delay",te),ne=(v=fn(m,"time",0),h[fn(m,"mode","hold")]),ie=fn(m,"index",0);f.setFrame(p,v,ne,ie,ee),te=ee,m=qt[p+1]}a.push(f)}}}}}if(e.drawOrder){f=new tt(e.drawOrder.length);var re=i.slots.length;for(p=0,Qt=0;Qt<e.drawOrder.length;Qt++,p++){var ae=e.drawOrder[Qt],se=null,oe=fn(ae,"offsets",null);if(oe){se=g.newArray(re,-1);for(var he=g.newArray(re-oe.length,0),le=0,ce=0,ue=0;ue<oe.length;ue++){var de,fe=oe[ue];if(!(de=i.findSlot(fe.slot)))throw new Error("Slot not found: "+de);for(l=de.index;le!=l;)he[ce++]=le++;se[le+fe.offset]=le++}for(;le<re;)he[ce++]=le++;for(ue=re-1;ue>=0;ue--)-1==se[ue]&&(se[ue]=he[--ce])}f.setFrame(p,fn(ae,"time",0),se)}a.push(f)}if(e.events){for(f=new $(e.events.length),p=0,Qt=0;Qt<e.events.length;Qt++,p++){var pe=e.events[Qt],me=i.findEvent(pe.name);if(!me)throw new Error("Event not found: "+pe.name);var ge=new $t(g.toSinglePrecision(fn(pe,"time",0)),me);ge.intValue=fn(pe,"int",me.intValue),ge.floatValue=fn(pe,"float",me.floatValue),ge.stringValue=fn(pe,"string",me.stringValue),ge.data.audioPath&&(ge.volume=fn(pe,"volume",1),ge.balance=fn(pe,"balance",0)),f.setFrame(p,ge)}a.push(f)}var ve=0;for(Qt=0,Kt=a.length;Qt<Kt;Qt++)ve=Math.max(ve,a[Qt].getDuration());i.animations.push(new T(n,a,ve))},e}(),ln=function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritTimeline=r};function cn(t,e,n,i){for(var r=t[0],a=fn(r,"time",0),s=fn(r,"value",n)*i,o=0,h=0;;h++){e.setFrame(h,a,s);var l=t[h+1];if(!l)return e.shrink(o),e;var c=fn(l,"time",0),u=fn(l,"value",n)*i;r.curve&&(o=dn(r.curve,e,o,h,0,a,c,s,u,i)),a=c,s=u,r=l}}function un(t,e,n,i,r,a){for(var s=t[0],o=fn(s,"time",0),h=fn(s,n,r)*a,l=fn(s,i,r)*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=fn(d,"time",0),p=fn(d,n,r)*a,m=fn(d,i,r)*a,g=s.curve;g&&(c=dn(g,e,c,u,0,o,f,h,p,a),c=dn(g,e,c,u,1,o,f,l,m,a)),o=f,h=p,l=m,s=d}}function dn(t,e,n,i,r,a,s,o,h,l){if("stepped"==t)return e.setStepped(i),n;var c=r<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(n,i,r,a,o,u,d,f,p,s,h),n+1}function fn(t,e,n){return void 0!==t[e]?t[e]:n}function pn(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(encodeURIComponent(e))}function mn(t,e,n){var i,r=new Ut(t);if("skel"===n){i=new ye(r);var a=new xe(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 i=new hn(r);return i.readSkeletonData(e)}function gn(t){return t.animations.map((function(t){return t.name}))}function vn(t,n){var i=t.findAnimation(n);return e.assertExist(i),i.duration}function yn(t){return t.skins.filter((function(t){return"default"!==t.name})).map((function(t){return t.name}))}function xn(t){var e=pn(new Uint8Array(t));return new Vt(e)}function wn(t,e){var n=new Uint8Array(t);return"json"===e?pn(n):new DataView(n.buffer)}void 0===Math.fround&&(Math.fround=(Ie=new Float32Array(1),function(t){return Ie[0]=t,Ie[0]}));var bn=1,Mn=function(){function n(t){this.verticesLength=0,this.indicesLength=0;var n=t.blendMode,i=t.texture,r=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=i,this.priority=r,this.engine=l,this.geometry=this.createGeometry(),this.material=this.createMaterial(s,f,u),this.mesh=e.Mesh.create(l,{name:h+bn++,priority:this.priority,material:this.material,geometry:this.geometry}),this.vertices=new Float32Array(Sn.MAX_VERTICES*Sn.VERTEX_SIZE),this.indices=new Uint16Array(Sn.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*Sn.VERTEX_SIZE,i={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:i,indices:{data:new Uint16Array(0),releasable:!0},mode:e.glContext.TRIANGLES,maxVertex:Sn.MAX_VERTICES})},n.prototype.createMaterial=function(n,i,r){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!==r?[r,r]:void 0,function(n,i,r){switch(n.blendEquation=[e.glContext.FUNC_ADD,e.glContext.FUNC_ADD],i){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=[r?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE,e.glContext.ONE,e.glContext.ONE];break;case t.BlendMode.Normal:n.blendFunction=[r?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(i))}}(l,this.blendMode,n),e.setMaskMode(l,i),l},n.prototype.updateMesh=function(t,e,n){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");var i=this.verticesLength,r=this.indicesLength,a=this.verticesLength/Sn.VERTEX_SIZE;this.vertices.set(t,i),this.verticesLength+=n;for(var s=0,o=r;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 Sn=function(){function t(t,n){this.slotList=[],this.vertices=[],this.clipper=new on,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,i,r=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 Wt){var S=x;w=S.color,h=this.vertices,M=y<<2,S.computeWorldVertices(v,h,0,y),l=t.QUAD_TRIANGLES,i=S.uvs,b=S.region.page.texture}else{if(!(x instanceof Ot)){if(x instanceof Bt){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,i=k.uvs,b=k.region.page.texture}if(b){var I=v.bone.skeleton.color,A=v.color,C=this.tempColor,T=this.tempDark;if(C.set(I.r*A.r*w.r,I.g*A.g*w.g,I.b*A.b*w.b,I.a*A.a*w.a),o&&(C.r*=C.a,C.g*=C.a,C.b*=C.a),v.darkColor?o?(T.r=v.darkColor.r*C.a,T.g=v.darkColor.g*C.a,T.b=v.darkColor.b*C.a,T.a=1):(T.setFromColor(v.darkColor),T.a=0):T.set(0,0,0,1),a.isClipping())a.clipTriangles(h,M,l,l.length,i,C,T,!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]=C.r,h[E+1]=C.g,h[E+2]=C.b,h[E+3]=C.a,h[E+4]=i[F],h[E+5]=i[F+1],h[E+6]=T.r,h[E+7]=T.g,h[E+8]=T.b,h[E+9]=T.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 Mn({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(r.wm)}))},t.prototype.findMeshIndex=function(e,n,i,r){for(var a=-1,s=e;s<this.meshGroups.length;s++){var o=this.meshGroups[s];if(o&&o.blending===n&&o.texture.name===i.name&&r+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}(),kn=e.math.Vector2,In=e.math.Vector3,An=function(n){function r(t,i){var r,a=n.call(this,t,i)||this;a.offset=new kn,a.size=new kn,a._contentVisible=!0;var s=null===(r=a.composition)||void 0===r?void 0:r.renderer.engine;return e.assertExist(s),a.engine=s,a}return i(r,n),Object.defineProperty(r.prototype,"type",{get:function(){return e.spec.ItemType.spine},enumerable:!1,configurable:!0}),r.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},r.prototype.initContent=function(t,e){var n=t.spine;if(!isNaN(n)){var i=e[n],r=i.atlas,a=i.skeletonFile,s=i.skeletonType,o=i.skinList,h=i.animationList,l="string"==typeof t.activeAnimation?[t.activeAnimation]:t.activeAnimation;if(this.skeletonData=mn(r,a,s),this.animationStateData=new Et(this.skeletonData),this.animationStateData.defaultMix=t.mixDuration||0,this.spineDataCache=e[n],this.skinList=o.slice(),this.animationList=h.slice(),this.skeleton=new le(this.skeletonData),this.setSkin(t.activeSkin||(o.length?o[0]:"default")),this.state=new gt(this.animationStateData),this.resizeRule=t.resizeRule,1===l.length)if(isNaN(t.speed)){var c=Number((vn(this.skeletonData,l[0])/this.duration).toFixed(2));this.setAnimation(l[0],c)}else this.setAnimation(l[0],t.speed);else this.setAnimationList(l,t.speed);this.pma=r.pages[0].pma}},r.prototype.doCreateContent=function(){if(this.skeleton)return new Sn(this.skeleton.drawOrder,{listIndex:this.listIndex,meshName:this.name,transform:this.transform,pma:this.pma,renderer:this.renderer,engine:this.engine})},r.prototype.onLifetimeBegin=function(){this.state&&this.skeleton&&(this.state.apply(this.skeleton),this.resize(),this.updateState(0))},r.prototype.onItemUpdate=function(t,e){var n=this.content;if(n){var i=this.contentVisible;n.meshGroups.map((function(t){t.mesh.setVisible(i)})),i&&this.updateState(t/1e3)}},r.prototype.onItemRemoved=function(){var t=this.content;t&&t.meshGroups.map((function(t){t.dispose()}))},r.prototype.onEnd=function(){this.endBehavior===e.spec.END_BEHAVIOR_DESTROY&&this.state&&(this.state.clearListeners(),this.state.clearTracks())},r.prototype.handleVisibleChanged=function(t){this.content&&this.content.meshGroups.map((function(e){e.mesh.setVisible(t)}))},r.prototype.getBoundingBox=function(){var t=this.getBounds(),n={type:e.HitTestType.triangle,area:[]};if(!t)return n;var i=t.x,r=t.y,a=t.width,s=t.height,o=this.transform.getWorldMatrix(),h=i+a/2,l=r+s/2,c=new In(h-a/2,l-s/2,0),u=new In(h+a/2,l-s/2,0),d=new In(h+a/2,l+s/2,0),f=new In(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},r.prototype.getHitTestParams=function(t){var n,i=this.getBoundingBox(),r=null===(n=this.engine.renderer)||void 0===n?void 0:n.env;if(i.area.length)return t&&r===e.PLAYER_OPTIONS_ENV_EDITOR?{type:e.HitTestType.triangle,triangles:i.area,backfaceCulling:!1,behavior:e.spec.InteractBehavior.NOTIFY}:void 0},r.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())},r.prototype.setAnimation=function(t,n){var i;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 r=this.endBehavior===e.spec.ItemEndBehavior.loop,a=null===(i=this.state.tracks[0])||void 0===i?void 0:i.listener;a&&(a.end=function(){}),this.state.setEmptyAnimation(0),this.animationList.includes(t)?(this.state.setAnimation(0,t,r),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],r),this.activeAnimation=[this.animationList[0]]),isNaN(n)||this.setSpeed(n)},r.prototype.setAnimationList=function(t,n){var i,r,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 i={end:function(){o.state.addAnimation(0,t,!1).listener=i}};n.listener=i}},c=this;try{for(var u=s(t),d=u.next();!d.done;d=u.next()){l(d.value)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}this.activeAnimation=t,isNaN(n)||this.setSpeed(n)}else this.setAnimation(t[0],n)},r.prototype.setSpeed=function(t){this.state&&(this.state.timeScale=t)},r.prototype.getSpeed=function(){return this.state.timeScale||1},r.prototype.getActiveAnimation=function(){return this.activeAnimation},r.prototype.setMixDuration=function(t,e,n){this.animationStateData&&this.animationStateData.setMix(t,e,n)},r.prototype.setDefaultMixDuration=function(t){this.state&&(this.animationStateData.defaultMix=t,this.state.tracks[0]&&(this.state.tracks[0].mixDuration=t))},r.prototype.deleteMixForLoop=function(){var t=this.activeAnimation[this.activeAnimation.length-1],e=this.activeAnimation[0];this.animationStateData.setMix(t,e,0)},r.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()},r.prototype.resize=function(){var t=this.getBounds();if(t&&this.composition){var e,n=this.transform.scale,i=t.width;if(this.resizeRule){var r=this.transform.getWorldPosition().z;e=this.composition.camera.getInverseVPRatio(r).x/1500}else e=1/i;this.scaleFactor=e,this.transform.setScale(this.startSize*e,this.startSize*e,n.z)}},r.prototype.setScale=function(t,e,n){var i=this.transform.scale,r=i.x,a=i.y,s=i.z;this.transform.setScale(r*t,a*e,s*n)},r.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}},r}(e.VFXItem),Cn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.slotGroups=[],e.meshToRemove=[],e}return i(n,t),n.processRawJSON=function(t,e){return r(this,void 0,void 0,(function(){return a(this,(function(t){return[2,Promise.resolve()]}))}))},n.prepareResource=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r,h,l,c,u,d,f,p,m,g,v,y,x,w,b,M,S,k,I,A,C,T,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");i=[],r=e.bins;try{for(h=s(n.spines),l=h.next();!l.done;l=h.next())(c=l.value).spineData?i.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?r[x].slice(b,b+M):r[x].slice(b),k=o(d[1],3),I=k[0],A=k[1],C=void 0===A?0:A,T=k[2],E=T?r[I].slice(C,C+T):r[I].slice(C),F=xn(S),B=wn(E,p),Y=mn(F,B,p),R=yn(Y),P=gn(Y),i.push({atlas:F,skeletonFile:B,skeletonData:Y,images:f,texturesOptions:v,skeletonType:p,skeletonInstance:new le(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=i,[2]}))}))},n.prototype.onCompositionConstructed=function(t,e){this.slotGroups=[];var n=t.textures;if(e.jsonScene.spines){var i=e.jsonScene.spines;i.map((function(t,e){var i=t.atlas,r=t.images,a=i.pages.length;if(r.length!==a)throw new Error("atlas.page's length not equal spine.textures' length");for(var s=0;s<a;s++){var o=i.pages[s],h=n[r[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=i}},n.prototype.onCompositionItemLifeBegin=function(t,e){e instanceof An&&e.content&&this.slotGroups.push(e.content)},n.prototype.onCompositionItemRemoved=function(t,e){var n;if(e instanceof An&&e.content){e.spineDataCache=void 0;var i=e.content;i&&((n=this.meshToRemove).push.apply(n,function(t,e,n){if(n||2===arguments.length)for(var i,r=0,a=e.length;r<a;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}([],o(i.meshGroups),!1)),this.slotGroups.splice(this.slotGroups.indexOf(i),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",Cn,An);var Tn="1.5.0";e.logger.info("plugin spine version: "+Tn),t.AlphaTimeline=j,t.Animation=T,t.AnimationState=gt,t.AnimationStateAdapter=bt,t.AnimationStateData=Et,t.AssetManagerBase=Qt,t.AtlasAttachmentLoader=Ut,t.Attachment=M,t.AttachmentTimeline=Q,t.BinaryInput=xe,t.Bone=Jt,t.BoneData=zt,t.BoundingBoxAttachment=Ft,t.CURRENT=Tt,t.ClippingAttachment=Bt,t.Color=u,t.ConstraintData=Kt,t.CurveTimeline=Y,t.CurveTimeline1=R,t.CurveTimeline2=P,t.DebugUtils=v,t.DeformTimeline=Z,t.Downloader=Zt,t.DrawOrderTimeline=tt,t.Event=$t,t.EventData=te,t.EventQueue=yt,t.EventTimeline=$,t.FIRST=St,t.FakeTexture=Xt,t.HOLD_FIRST=It,t.HOLD_MIX=At,t.HOLD_SUBSEQUENT=kt,t.IkConstraint=ee,t.IkConstraintData=ne,t.IkConstraintTimeline=et,t.InheritTimeline=z,t.IntSet=l,t.Interpolation=f,t.MathUtils=d,t.MeshAttachment=Ot,t.PathAttachment=_t,t.PathConstraint=ae,t.PathConstraintData=ie,t.PathConstraintMixTimeline=at,t.PathConstraintPositionTimeline=it,t.PathConstraintSpacingTimeline=rt,t.PhysicsConstraintDampingTimeline=lt,t.PhysicsConstraintGravityTimeline=dt,t.PhysicsConstraintInertiaTimeline=ot,t.PhysicsConstraintMassTimeline=ct,t.PhysicsConstraintMixTimeline=ft,t.PhysicsConstraintResetTimeline=pt,t.PhysicsConstraintStrengthTimeline=ht,t.PhysicsConstraintTimeline=st,t.PhysicsConstraintWindTimeline=ut,t.PointAttachment=qt,t.Pool=y,t.Pow=p,t.PowOut=m,t.RGB2Timeline=K,t.RGBA2Timeline=J,t.RGBATimeline=G,t.RGBTimeline=H,t.RegionAttachment=Wt,t.RotateTimeline=X,t.SETUP=Ct,t.SUBSEQUENT=Mt,t.ScaleTimeline=N,t.ScaleXTimeline=O,t.ScaleYTimeline=_,t.SequenceTimeline=mt,t.ShearTimeline=q,t.ShearXTimeline=W,t.ShearYTimeline=U,t.Skeleton=le,t.SkeletonBinary=ye,t.SkeletonBounds=an,t.SkeletonClipping=on,t.SkeletonData=de,t.SkeletonJson=hn,t.Skin=pe,t.SkinEntry=fe,t.Slot=oe,t.SlotData=me,t.SpineLoader=Cn,t.SpineVFXItem=An,t.StringSet=c,t.Texture=Yt,t.TextureAtlas=Vt,t.TextureAtlasPage=Lt,t.TextureAtlasRegion=Nt,t.TextureRegion=Pt,t.TimeKeeper=w,t.Timeline=B,t.TrackEntry=vt,t.TransformConstraint=he,t.TransformConstraintData=ve,t.TransformConstraintTimeline=nt,t.TranslateTimeline=V,t.TranslateXTimeline=D,t.TranslateYTimeline=L,t.Triangulator=sn,t.Utils=g,t.Vector2=x,t.VertexAttachment=S,t.WindowedMean=b,t.createSkeletonData=mn,t.getAnimationDuration=vn,t.getAnimationList=gn,t.getAtlasFromBuffer=xn,t.getSkeletonFromBuffer=wn,t.getSkinList=yn,t.getSpineVersion=function(t){var e=new xe(t);return e.readInt32(),e.readInt32(),e.readString()},t.getTextureOptions=function(e){var n,i,r=pn(new Uint8Array(e,0)),a=new Vt(r),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&&(i=l.return)&&i.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=Tn,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 i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function r(t,e,n,i){return new(n||(n=Promise))((function(r,a){function s(t){try{h(i.next(t))}catch(t){a(t)}}function o(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,o)}h((i=i.apply(t,e||[])).next())}))}function a(t,e){var n,i,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=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],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],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 i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.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,i=t.length;n<i;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,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,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,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,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.prototype.toRgb888=function(){var t=function(t){return("0"+(255*t).toString(16)).slice(-2)};return Number("0x"+t(this.r)+t(this.g)+t(this.b))},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 i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(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 i(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 i(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,i,r){for(var a=e,s=i;a<e+r;a++,s++)n[s]=t[a]},t.arrayFill=function(t,e,n,i){for(var r=e;r<n;r++)t[r]=i},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var i=t.length;if(i==e)return t;if(t.length=e,i<e)for(var r=i;r<e;r++)t[r]=n;return t},t.ensureArrayCapacity=function(e,n,i){return void 0===i&&(i=0),e.length>=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i<t;i++)n[i]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=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 i=0;i<t.length;i++)if(t[i]==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 i=t.call(this,n)||this;return i.id=e.nextID++,i.bones=null,i.vertices=[],i.worldVerticesLength=0,i.timelineAttachment=i,i}return i(e,t),e.prototype.computeWorldVertices=function(t,e,n,i,r,a){n=r+(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(T=r,k=3*u;T<n;T+=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}i[T]=p,i[T+1]=m}else for(var y=o,x=(T=r,k=3*u,u<<1);T<n;T+=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}i[T]=p,i[T+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,I=w.c,A=w.d,C=e,T=r;T<n;C+=2,T+=a){var E=h[C],F=h[C+1];i[T]=E*S+F*k+b,i[T+1]=E*I+F*A+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 i=this.regions[n];e.region!=i&&(e.region=i,e.updateRegion())},t.prototype.getPath=function(t,e){for(var n=t,i=(this.start+e).toString(),r=this.digits-i.length;r>0;r--)n+="0";return n+=i},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 I,A,C=[h.hold,h.once,h.loop,h.pingpong,h.onceReverse,h.loopReverse,h.pingpongReverse],T=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,i,r,a,s,o){if(!t)throw new Error("skeleton cannot be null.");i&&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,r,a,s,o)},t}();t.MixBlend=void 0,(I=t.MixBlend||(t.MixBlend={}))[I.setup=0]="setup",I[I.first=1]="first",I[I.replace=2]="replace",I[I.add=3]="add",t.MixDirection=void 0,(A=t.MixDirection||(t.MixDirection={}))[A.mixIn=0]="mixIn",A[A.mixOut=1]="mixOut";var E,F={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28},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,i=1;i<n;i++)if(t[i]>e)return i-1;return n-1},t.search=function(t,e,n){for(var i=t.length,r=n;r<i;r+=n)if(t[r]>e)return r-n;return i-n},t}(),Y=function(t){function e(e,n,i){var r=t.call(this,e,i)||this;return r.curves=g.newFloatArray(e+18*n),r.curves[e-1]=1,r}return i(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,i,r,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*(i-2*a+o),p=.03*(r-2*s+h),m=.006*(3*(a-o)-i+l),g=.006*(3*(s-h)-r+c),v=2*f+m,y=2*p+g,x=.3*(a-i)+f+.16666667*m,w=.3*(s-r)+p+.16666667*g,b=i+x,M=r+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,i){var r=this.curves;if(r[i]>t){var a=this.frames[e],s=this.frames[e+n];return s+(t-a)/(r[i]-a)*(r[i+1]-s)}var o=i+18;for(i+=2;i<o;i+=2)if(r[i]>=t){var h=r[i-2],l=r[i-1];return l+(t-h)/(r[i]-h)*(r[i+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)},e}(B),R=function(e){function n(t,n,i){return e.call(this,t,n,[i])||this}return i(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,i=2;i<=n;i+=2)if(e[i]>t){n=i-2;break}var r=this.curves[n>>1];switch(r){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,r-2)},n.prototype.getRelativeValue=function(e,n,i,r,a){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}var s=this.getCurveValue(e);switch(i){case t.MixBlend.setup:return a+s*n;case t.MixBlend.first:case t.MixBlend.replace:s+=a-r}return r+s*n},n.prototype.getAbsoluteValue=function(e,n,i,r,a){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}var s=this.getCurveValue(e);return i==t.MixBlend.setup?a+(s-a)*n:r+(s-r)*n},n.prototype.getAbsoluteValue2=function(e,n,i,r,a,s){if(e<this.frames[0]){switch(i){case t.MixBlend.setup:return a;case t.MixBlend.first:return r+(a-r)*n}return r}return i==t.MixBlend.setup?a+(s-a)*n:r+(s-r)*n},n.prototype.getScaleValue=function(e,n,i,r,a,s){if(e<this.frames[0]){switch(i){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 i==t.MixBlend.add?a+o-s:o;if(r==t.MixDirection.mixOut)switch(i){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(i){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,i,r){return t.call(this,e,n,[i,r])||this}return i(e,t),e.prototype.getFrameEntries=function(){return 3},e.prototype.setFrame=function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},e}(Y),X=function(t){function e(e,n,i){var r=t.call(this,e,n,F.rotate+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(n,r,a,o.rotation,o.data.rotation))},e}(R),V=function(e){function n(t,n,i){var r=e.call(this,t,n,F.x+"|"+i,F.y+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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,i){var r=t.call(this,e,n,F.x+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(n,r,a,o.x,o.data.x))},e}(R),L=function(t){function e(e,n,i){var r=t.call(this,e,n,F.y+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(n,r,a,o.y,o.data.y))},e}(R),N=function(e){function n(t,n,i){var r=e.call(this,t,n,F.scaleX+"|"+i,F.scaleY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),p=this.curves[f/3];switch(p){case 0:var m=l[f];c=l[f+1],u=l[f+2];var g=(i-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(i,f,1,p-2),u=this.getBezierValue(i,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,i){var r=t.call(this,e,n,F.scaleX+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(n,r,a,s,o.scaleX,o.data.scaleX))},e}(R),_=function(t){function e(e,n,i){var r=t.call(this,e,n,F.scaleY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(n,r,a,s,o.scaleY,o.data.scaleY))},e}(R),q=function(e){function n(t,n,i){var r=e.call(this,t,n,F.shearX+"|"+i,F.shearY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;if(i<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,i,3),f=this.curves[d/3];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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),W=function(t){function e(e,n,i){var r=t.call(this,e,n,F.shearX+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(n,r,a,o.shearX,o.data.shearX))},e}(R),U=function(t){function e(e,n,i){var r=t.call(this,e,n,F.shearY+"|"+i)||this;return r.boneIndex=0,r.boneIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(n,r,a,o.shearY,o.data.shearY))},e}(R),z=function(e){function n(t,n){var i=e.call(this,t,[F.inherit+"|"+n])||this;return i.boneIndex=0,i.boneIndex=n,i}return i(n,e),n.prototype.getFrameEntries=function(){return 2},n.prototype.setFrame=function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.bones[this.boneIndex];if(h.active){var l=this.frames;i<l[0]?s!=t.MixBlend.setup&&s!=t.MixBlend.first||(h.inherit=h.data.inherit):h.inherit=this.frames[B.search(l,i,2)+1]}},n}(B),G=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.alpha+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 5},n.prototype.setFrame=function(t,e,n,i,r,a){t*=5,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(i<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,i,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=(i-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(i,g,1,v-2),f=this.getBezierValue(i,g,2,v+18-2),p=this.getBezierValue(i,g,3,v+36-2),m=this.getBezierValue(i,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),H=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,i,r){t<<=2,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color;if(i<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,i,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=(i-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(i,m,1,g-2),f=this.getBezierValue(i,m,2,g+18-2),p=this.getBezierValue(i,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),j=function(e){function n(t,n,i){var r=e.call(this,t,n,F.alpha+"|"+i)||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=h.color;if(i<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(i);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,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.alpha+"|"+i,F.rgb2+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 8},n.prototype.setFrame=function(t,e,n,i,r,a,s,o,h){t<<=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,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,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(i<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,i,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=(i-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(i,b,1,M-2),m=this.getBezierValue(i,b,2,M+18-2),g=this.getBezierValue(i,b,3,M+36-2),v=this.getBezierValue(i,b,4,M+54-2),y=this.getBezierValue(i,b,5,M+72-2),x=this.getBezierValue(i,b,6,M+90-2),w=this.getBezierValue(i,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),K=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.rgb+"|"+i,F.rgb2+"|"+i])||this;return r.slotIndex=0,r.slotIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,i,r,a,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a,this.frames[t+5]=s,this.frames[t+6]=o},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.slots[this.slotIndex];if(h.bone.active){var l=this.frames,c=h.color,u=h.darkColor;if(i<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,i,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=(i-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(i,w,1,b-2),m=this.getBezierValue(i,w,2,b+18-2),g=this.getBezierValue(i,w,3,b+36-2),v=this.getBezierValue(i,w,4,b+54-2),y=this.getBezierValue(i,w,5,b+72-2),x=this.getBezierValue(i,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),Q=function(e){function n(t,n){var i=e.call(this,t,[F.attachment+"|"+n])||this;return i.slotIndex=0,i.slotIndex=n,i.attachmentNames=new Array(t),i}return i(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,i,r,a,s,o){var h=e.slots[this.slotIndex];h.bone.active&&(o!=t.MixDirection.mixOut?i<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,i)]):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),Z=function(e){function n(t,n,i,r){var a=e.call(this,t,n,[F.deform+"|"+i+"|"+r.id])||this;return a.slotIndex=0,a.slotIndex=i,a.attachment=r,a.vertices=new Array(t),a}return i(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,i,r,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*(i-2*a+o),p=.03*h-.06*s,m=.006*(3*(a-o)-i+l),g=.018*(s-h+.33333333),v=2*f+m,y=2*p+g,x=.3*(a-i)+f+.16666667*m,w=.3*s+p+.16666667*g,b=i+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,i=n[e];switch(i){case 0:var r=this.frames[e];return(t-r)/(this.frames[e+this.getFrameEntries()]-r);case 1:return 0}if(n[i-=2]>t){var a=this.frames[e];return n[i+1]*(t-a)/(n[i]-a)}var s=i+18;for(i+=2;i<s;i+=2)if(n[i]>=t){var o=n[i-2],h=n[i-1];return h+(t-o)/(n[i]-o)*(n[i+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,i,r,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(i<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,i>=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 I=0;I<d;I++)c[I]+=(v[I]-c[I])*a;break;case t.MixBlend.add:if((q=l).bones)for(var A=0;A<d;A++)c[A]+=v[A]*a;else{p=q.vertices;for(var C=0;C<d;C++)c[C]+=(v[C]-p[C])*a}}}else{var T=B.search1(f,i),E=this.getCurvePercent(i,T),F=u[T],Y=u[T+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 W=0;W<d;W++){X=F[W];c[W]+=(X+(Y[W]-X)*E)*a}else{p=q.vertices;for(var U=0;U<d;U++){X=F[U];c[U]+=(X+(Y[U]-X)*E-p[U])*a}}}}}}},n}(Y),$=function(t){function e(n){var i=t.call(this,n,e.propertyIds)||this;return i.events=new Array(n),i}return i(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,i,r,a,s){if(i){var o=this.frames,h=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,i,r,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++)i.push(this.events[l])}}},e.propertyIds=[""+F.event],e}(B),tt=function(e){function n(t){var i=e.call(this,t,n.propertyIds)||this;return i.drawOrders=new Array(t),i}return i(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,i,r,a,s,o){if(o!=t.MixDirection.mixOut)if(i<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,i),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),et=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.ikConstraint+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 6},n.prototype.setFrame=function(t,e,n,i,r,a,s){t*=6,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i,this.frames[t+3]=r,this.frames[t+4]=a?1:0,this.frames[t+5]=s?1:0},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.ikConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,6),f=this.curves[d/6];switch(f){case 0:var p=l[d];c=l[d+1],u=l[d+2];var m=(i-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(i,d,1,f-2),u=this.getBezierValue(i,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),nt=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.transformConstraint+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 7},n.prototype.setFrame=function(t,e,n,i,r,a,s,o){var h=this.frames;h[t*=7]=e,h[t+1]=n,h[t+2]=i,h[t+3]=r,h[t+4]=a,h[t+5]=s,h[t+6]=o},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.transformConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,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=(i-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(i,v,1,y-2),d=this.getBezierValue(i,v,2,y+18-2),f=this.getBezierValue(i,v,3,y+36-2),p=this.getBezierValue(i,v,4,y+54-2),m=this.getBezierValue(i,v,5,y+72-2),g=this.getBezierValue(i,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),it=function(t){function e(e,n,i){var r=t.call(this,e,n,F.pathConstraintPosition+"|"+i)||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(n,r,a,o.position,o.data.position))},e}(R),rt=function(t){function e(e,n,i){var r=t.call(this,e,n,F.pathConstraintSpacing+"|"+i)||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(e,t),e.prototype.apply=function(t,e,n,i,r,a,s){var o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(n,r,a,o.spacing,o.data.spacing))},e}(R),at=function(e){function n(t,n,i){var r=e.call(this,t,n,[F.pathConstraintMix+"|"+i])||this;return r.constraintIndex=0,r.constraintIndex=i,r}return i(n,e),n.prototype.getFrameEntries=function(){return 4},n.prototype.setFrame=function(t,e,n,i,r){var a=this.frames;a[t<<=2]=e,a[t+1]=n,a[t+2]=i,a[t+3]=r},n.prototype.apply=function(e,n,i,r,a,s,o){var h=e.pathConstraints[this.constraintIndex];if(h.active){var l=this.frames;if(i<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,i,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=(i-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(i,f,1,p-2),u=this.getBezierValue(i,f,2,p+18-2),d=this.getBezierValue(i,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),st=function(t){function e(e,n,i,r){var a=t.call(this,e,n,r+"|"+i)||this;return a.constraintIndex=0,a.constraintIndex=i,a}return i(e,t),e.prototype.apply=function(t,e,n,i,r,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,r,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,r,a,this.get(c),this.setup(c)))},e}(R),ot=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintInertia)||this}return i(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}(st),ht=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintStrength)||this}return i(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}(st),lt=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintDamping)||this}return i(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}(st),ct=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintMass)||this}return i(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}(st),ut=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintWind)||this}return i(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}(st),dt=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintGravity)||this}return i(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}(st),ft=function(t){function e(e,n,i){return t.call(this,e,n,i,F.physicsConstraintMix)||this}return i(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}(st),pt=function(t){function e(n,i){var r=t.call(this,n,e.propertyIds)||this;return r.constraintIndex=i,r}return i(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,i,r,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,[],r,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),mt=function(e){function n(t,n,i){var r=e.call(this,t,[F.sequence+"|"+n+"|"+i.sequence.id])||this;return r.slotIndex=n,r.attachment=i,r}return i(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,i,r,a){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=i|r<<4,s[t+n.DELAY]=a},n.prototype.apply=function(e,i,r,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(r<f[0])o!=t.MixBlend.setup&&o!=t.MixBlend.first||(c.sequenceIndex=-1);else{var p=B.search(f,r,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=C[15&g];if(w!=h.hold)switch(y+=(r-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),gt=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 yt(this),this.propertyIDs=new c,this.animationsChanged=!1,this.trackEntryPool=new y((function(){return new vt})),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,i=e.length;n<i;n++){var r=e[n];if(r){r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;var a=t*r.timeScale;if(r.delay>0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=a,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(!n)return!0;var i=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)),i):(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,i=this.tracks,r=!1,a=0,s=i.length;a<s;a++){var o=i[a];if(o&&!(o.delay>0)){r=!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 Q?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]==Mt?h:t.MixBlend.setup;!b&&S instanceof X?this.applyRotateTimeline(S,e,f,l,k,o.timelinesRotation,y<<1,M):S instanceof Q?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 I=this.unkeyedState+Ct,A=e.slots,C=0,T=e.slots.length;C<T;C++){var E=A[C];if(E.attachmentState==I){var F=E.data.attachmentName;E.setAttachment(F?e.getAttachment(E.data.index,F):null)}}return this.unkeyedState+=2,this.queue.drain(),r},e.prototype.applyMixingFrom=function(e,n,i){var r=e.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,n,i);var a=0;0==e.mixDuration?(a=1,i==t.MixBlend.first&&(i=t.MixBlend.setup)):((a=e.mixTime/e.mixDuration)>1&&(a=1),i!=t.MixBlend.first&&(i=r.mixBlend));var s=a<r.mixAttachmentThreshold,o=a<r.mixDrawOrderThreshold,h=r.animation.timelines,l=h.length,c=r.alpha*e.interruptAlpha,u=c*(1-a),d=r.animationLast,f=r.getAnimationTime(),p=f,m=null;if(r.reverse?p=r.animation.duration-p:a<r.eventThreshold&&(m=this.events),i==t.MixBlend.add)for(var v=0;v<l;v++)h[v].apply(n,d,p,m,u,i,t.MixDirection.mixOut);else{var y=r.timelineMode,x=r.timelineHoldMix,w=r.shortestRotation,b=!w&&r.timelinesRotation.length!=l<<1;b&&(r.timelinesRotation.length=l<<1),r.totalAlpha=0;for(v=0;v<l;v++){var M=h[v],S=t.MixDirection.mixOut,k=void 0,I=0;switch(y[v]){case Mt:if(!o&&M instanceof tt)continue;k=i,I=u;break;case St:k=t.MixBlend.setup,I=u;break;case kt:k=i,I=c;break;case It:k=t.MixBlend.setup,I=c;break;default:k=t.MixBlend.setup;var A=x[v];I=c*Math.max(0,1-A.mixTime/A.mixDuration)}r.totalAlpha+=I,!w&&M instanceof X?this.applyRotateTimeline(M,n,p,I,k,r.timelinesRotation,v<<1,b):M instanceof Q?this.applyAttachmentTimeline(M,n,p,k,s&&I>=r.alphaAttachmentThreshold):(g.webkit602BugfixHelper(I,i),o&&M instanceof tt&&k==t.MixBlend.setup&&(S=t.MixDirection.mixIn),M.apply(n,d,p,m,I,k,S))}}return e.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,a},e.prototype.applyAttachmentTimeline=function(e,n,i,r,a){var s=n.slots[e.slotIndex];s.bone.active&&(i<e.frames[0]?r!=t.MixBlend.setup&&r!=t.MixBlend.first||this.setAttachment(n,s,s.data.attachmentName,a):this.setAttachment(n,s,e.attachmentNames[B.search1(e.frames,i)],a),s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+Ct))},e.prototype.setAttachment=function(t,e,n,i){e.setAttachment(n?t.getAttachment(e.data.index,n):null),i&&(e.attachmentState=this.unkeyedState+Tt)},e.prototype.applyRotateTimeline=function(e,n,i,r,a,s,o,h){if(h&&(s[o]=0),1!=r){var l=n.bones[e.boneIndex];if(l.active){var c=0,u=0;if(i<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(i);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*r}}else e.apply(n,0,i,null,1,a,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,a=t.trackLast%r,s=this.events,o=0,h=s.length;o<h;o++){var l=s[o];if(l.time<a)break;l.time>i||this.queue.event(t,l)}var c=!1;if(t.loop)if(0==r)c=!0;else{var u=Math.floor(t.trackTime/r);c=u>0&&u>Math.floor(t.trackLast/r)}else c=e>=i&&t.animationLast<i;for(c&&this.queue.complete(t);o<h;o++){var d=s[o];d.time<n||this.queue.event(t,d)}},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 i=n.mixingFrom;if(!i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){void 0===n&&(n=!1);var i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(void 0===n&&(n=!1),!e)throw new Error("animation cannot be null.");var i=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,i=!1):this.clearNext(r));var a=this.trackEntry(t,e,n,r);return this.setCurrent(t,a,i),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,i){void 0===n&&(n=!1),void 0===i&&(i=0);var r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=0),!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var a=this.trackEntry(t,e,n,r);return r?(r.next=a,a.previous=r,i<=0&&(i+=r.getTrackComplete()-a.mixDuration)):(this.setCurrent(t,a,!0),this.queue.drain()),a.delay=i,a},e.prototype.setEmptyAnimation=function(t,n){void 0===n&&(n=0);var i=this.setAnimationWith(t,e.emptyAnimation(),!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=0);var r=this.addAnimationWith(t,e.emptyAnimation(),!1,i);return i<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){void 0===t&&(t=0);var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n<i;n++){var r=this.tracks[n];r&&this.setEmptyAnimation(r.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,i,r){var a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=n,a.loop=i,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=r?this.data.getMix(r.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,i=e.length;n<i;n++){var r=e[n];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do{r.mixingTo&&r.mixBlend==t.MixBlend.add||this.computeHold(r),r=r.mixingTo}while(r)}}},e.prototype.computeHold=function(t){var e=t.mixingTo,n=t.animation.timelines,i=t.animation.timelines.length,r=t.timelineMode;r.length=i;var a=t.timelineHoldMix;a.length=0;var s=this.propertyIDs;if(e&&e.holdPrevious)for(var o=0;o<i;o++)r[o]=s.addAll(n[o].getPropertyIds())?It:kt;else t:for(o=0;o<i;o++){var h=n[o],l=h.getPropertyIds();if(s.addAll(l))if(!e||h instanceof Q||h instanceof tt||h instanceof $||!e.animation.hasTimeline(l))r[o]=St;else{for(var c=e.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(t.mixDuration>0){r[o]=At,a[o]=c;continue t}break}r[o]=It}else r[o]=Mt}},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 T("<empty>",[],0),e}(),vt=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},enumerable:!1,configurable:!0}),e.prototype.setMixDurationWithDelay=function(t,e){this._mixDuration=t,null!=this.previous&&e<=0&&(e+=this.previous.getTrackComplete()-t),this.delay=e},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}(),yt=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,i=0;i<e.length;i+=2){var r=e[i],a=e[i+1];switch(r){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+i++];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 xt,wt,bt=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}(),Mt=0,St=1,kt=2,It=3,At=4,Ct=1,Tt=2,Et=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 i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);var r=this.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);this.setMixWith(i,r,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 i=t.name+"."+e.name;this.animationToMixTime[i]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,i=this.animationToMixTime[n];return void 0===i?this.defaultMix:i},t}(),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.color=new u(1,1,1,1),n}return i(e,t),e.prototype.copy=function(){var t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t},e}(S),Bt=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 i(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),Yt=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t}();t.TextureFilter=void 0,(xt=t.TextureFilter||(t.TextureFilter={}))[xt.Nearest=9728]="Nearest",xt[xt.Linear=9729]="Linear",xt[xt.MipMap=9987]="MipMap",xt[xt.MipMapNearestNearest=9984]="MipMapNearestNearest",xt[xt.MipMapLinearNearest=9985]="MipMapLinearNearest",xt[xt.MipMapNearestLinear=9986]="MipMapNearestLinear",xt[xt.MipMapLinearLinear=9987]="MipMapLinearLinear",t.TextureWrap=void 0,(wt=t.TextureWrap||(t.TextureWrap={}))[wt.MirroredRepeat=33648]="MirroredRepeat",wt[wt.ClampToEdge=33071]="ClampToEdge",wt[wt.Repeat=10497]="Repeat";var Rt,Pt=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},Xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(Yt),Vt=function(){function e(e){this.pages=new Array,this.regions=new Array;for(var n=new Dt(e),i=new Array(4),r={size:function(t){t.width=parseInt(i[1]),t.height=parseInt(i[2])},format:function(){},filter:function(e){e.minFilter=g.enumValue(t.TextureFilter,i[1]),e.magFilter=g.enumValue(t.TextureFilter,i[2])},repeat:function(e){-1!=i[1].indexOf("x")&&(e.uWrap=t.TextureWrap.Repeat),-1!=i[1].indexOf("y")&&(e.vWrap=t.TextureWrap.Repeat)},pma:function(t){t.pma="true"==i[1]}},a={xy:function(t){t.x=parseInt(i[1]),t.y=parseInt(i[2])},size:function(t){t.width=parseInt(i[1]),t.height=parseInt(i[2])},bounds:function(t){t.x=parseInt(i[1]),t.y=parseInt(i[2]),t.width=parseInt(i[3]),t.height=parseInt(i[4])},offset:function(t){t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2])},orig:function(t){t.originalWidth=parseInt(i[1]),t.originalHeight=parseInt(i[2])},offsets:function(t){t.offsetX=parseInt(i[1]),t.offsetY=parseInt(i[2]),t.originalWidth=parseInt(i[3]),t.originalHeight=parseInt(i[4])},rotate:function(t){var e=i[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:function(t){t.index=parseInt(i[1])}},s=n.readLine();s&&0==s.trim().length;)s=n.readLine();for(;s&&0!=s.trim().length&&0!=n.readEntry(i,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 Nt(o,s);;){var u=n.readEntry(i,s=n.readLine());if(0==u)break;if(p=a[i[0]])p(c);else{h||(h=[]),l||(l=[]),h.push(i[0]);for(var d=[],f=0;f<u;f++)d.push(parseInt(i[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 Lt(s.trim());0!=n.readEntry(i,s=n.readLine());){var p;(p=r[i[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,i;void 0===e&&(e="");try{for(var r=s(this.pages),a=r.next();!a.done;a=r.next()){var o=a.value;o.setTexture(t.get(e+o.name))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}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}(),Dt=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 i=1,r=n+1;;i++){var a=e.indexOf(",",r);if(-1==a)return t[i]=e.substr(r).trim(),i;if(t[i]=e.substr(r,a-r).trim(),r=a+1,4==i)return 4}},t}(),Lt=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 i=s(this.regions),r=i.next();!r.done;r=i.next()){r.value.texture=t}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},e}(),Nt=function(t){function e(e,n){var i=t.call(this)||this;return i.x=0,i.y=0,i.offsetX=0,i.offsetY=0,i.originalWidth=0,i.originalHeight=0,i.index=0,i.degrees=0,i.names=null,i.values=null,i.page=e,i.name=n,e.regions.push(i),i}return i(e,t),e}(Pt),Ot=function(t){function e(e,n){var i=t.call(this,e)||this;return i.region=null,i.regionUVs=[],i.uvs=[],i.triangles=[],i.color=new u(1,1,1,1),i.width=0,i.height=0,i.hullLength=0,i.edges=[],i.parentMesh=null,i.sequence=null,i.tempColor=new u(0,0,0,0),i.path=n,i}return i(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,i=this.region.u,r=this.region.v,a=0,s=0;if(this.region instanceof Nt){var o=this.region,h=o.page,l=h.width,c=h.height;switch(o.degrees){case 90:i-=(o.originalHeight-o.offsetY-o.height)/l,r-=(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]=i+t[u+1]*a,e[u+1]=r+(1-t[u])*s;return;case 180:i-=(o.originalWidth-o.offsetX-o.width)/l,r-=o.offsetY/c,a=o.originalWidth/l,s=o.originalHeight/c;for(u=0;u<n;u+=2)e[u]=i+(1-t[u])*a,e[u+1]=r+(1-t[u+1])*s;return;case 270:i-=o.offsetY/l,r-=o.offsetX/c,a=o.originalHeight/l,s=o.originalWidth/c;for(u=0;u<n;u+=2)e[u]=i+(1-t[u+1])*a,e[u+1]=r+t[u]*s;return}i-=o.offsetX/l,r-=(o.originalHeight-o.offsetY-o.height)/c,a=o.originalWidth/l,s=o.originalHeight/c}else this.region?(a=this.region.u2-i,s=this.region.v2-r):(i=r=0,a=s=1);for(u=0;u<n;u+=2)e[u]=i+t[u]*a,e[u+1]=r+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,i,r,a,s){null!=this.sequence&&this.sequence.apply(e,this),t.prototype.computeWorldVertices.call(this,e,n,i,r,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),_t=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 i(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),qt=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 i(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),i=Math.sin(e),r=n*t.a+i*t.b,a=n*t.c+i*t.d;return d.atan2Deg(a,r)},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),Wt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.x=0,i.y=0,i.scaleX=1,i.scaleY=1,i.rotation=0,i.width=0,i.height=0,i.color=new u(1,1,1,1),i.region=null,i.sequence=null,i.offset=g.newFloatArray(8),i.uvs=g.newFloatArray(8),i.tempColor=new u(1,1,1,1),i.path=n,i}return i(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,i=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*n,a=-this.height/2*this.scaleY+this.region.offsetY*i,s=r+this.region.width*n,o=a+this.region.height*i,h=this.rotation*d.degRad,l=Math.cos(h),c=Math.sin(h),u=this.x,f=this.y,p=r*l+u,m=r*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,i){null!=this.sequence&&this.sequence.apply(t,this);var r=t.bone,a=this.offset,s=r.worldX,o=r.worldY,h=r.a,l=r.b,c=r.c,u=r.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+=i,d=a[2],f=a[3],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=i,d=a[4],f=a[5],e[n]=d*h+f*l+s,e[n+1]=d*c+f*u+o,n+=i,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 i=n.regions,r=0,a=i.length;r<a;r++){var s=n.getPath(e,r),o=this.atlas.findRegion(s);if(null==o)throw new Error("Region not found in atlas: "+s+" (sequence: "+t+")");i[r]=o}},t.prototype.newRegionAttachment=function(t,e,n,i){var r=new Wt(e,n);if(null!=i)this.loadSequence(e,n,i);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (region attachment: "+e+")");r.region=a}return r},t.prototype.newMeshAttachment=function(t,e,n,i){var r=new Ot(e,n);if(null!=i)this.loadSequence(e,n,i);else{var a=this.atlas.findRegion(n);if(!a)throw new Error("Region not found in atlas: "+n+" (mesh attachment: "+e+")");r.region=a}return r},t.prototype.newBoundingBoxAttachment=function(t,e){return new Ft(e)},t.prototype.newPathAttachment=function(t,e){return new _t(e)},t.prototype.newPointAttachment=function(t,e){return new qt(e)},t.prototype.newClippingAttachment=function(t,e){return new Bt(e)},t}(),zt=function(e,n,i){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.inherit=t.Inherit.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=i};t.Inherit=void 0,(Rt=t.Inherit||(t.Inherit={}))[Rt.Normal=0]="Normal",Rt[Rt.OnlyTranslation=1]="OnlyTranslation",Rt[Rt.NoRotationOrReflection=2]="NoRotationOrReflection",Rt[Rt.NoScale=3]="NoScale",Rt[Rt.NoScaleOrReflection=4]="NoScaleOrReflection";var Gt,Ht,jt,Jt=function(){function e(e,n,i){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.inherit=t.Inherit.Normal,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=i,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,i,r,a,s,o){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=r,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=(i+s)*d.degRad,p=(i+90+o)*d.degRad;return this.a=Math.cos(f)*r*c,this.b=Math.cos(p)*a*c,this.c=Math.sin(f)*r*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.inherit){case t.Inherit.Normal:f=(i+s)*d.degRad,p=(i+90+o)*d.degRad;var x=Math.cos(f)*r,w=Math.cos(p)*a,b=Math.sin(f)*r,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.Inherit.OnlyTranslation:f=(i+s)*d.degRad,p=(i+90+o)*d.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(p)*a,this.c=Math.sin(f)*r,this.d=Math.sin(p)*a;break;case t.Inherit.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=(i+s-S)*d.degRad,p=(i+o-S+90)*d.degRad,x=Math.cos(f)*r,w=Math.cos(p)*a,b=Math.sin(f)*r,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.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:i*=d.degRad;var k,I=Math.cos(i),A=Math.sin(i),C=(m*I+g*A)/this.skeleton.scaleX,T=(v*I+y*A)/this.skeleton.scaleY;(k=Math.sqrt(C*C+T*T))>1e-5&&(k=1/k),C*=k,T*=k,k=Math.sqrt(C*C+T*T),this.inherit==t.Inherit.NoScale&&m*y-g*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(k=-k),i=Math.PI/2+Math.atan2(T,C);var E=Math.cos(i)*k,F=Math.sin(i)*k;s*=d.degRad,o=(90+o)*d.degRad;x=Math.cos(s)*r,w=Math.cos(o)*a,b=Math.sin(s)*r,M=Math.sin(o)*a;this.a=C*x+E*b,this.b=C*w+E*M,this.c=T*x+F*b,this.d=T*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,this.inherit=t.inherit},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,i,r,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.inherit==t.Inherit.OnlyTranslation)n=this.a,i=this.b,r=this.c,a=this.d;else{switch(this.inherit){case t.Inherit.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.Inherit.NoScale:case t.Inherit.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.inherit==t.Inherit.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,i=u*this.b-f*this.d,r=m*this.c-p*this.a,a=m*this.d-p*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(n*n+r*r),this.ascaleX>1e-4){var k=n*a-i*r;this.ascaleY=k/this.ascaleX,this.ashearY=-Math.atan2(n*i+r*a,k)*d.radDeg,this.arotation=Math.atan2(r,n)*d.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(i*i+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,i)*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,i=t.y-this.worldY;return t.x=n*this.d*e-i*this.b*e,t.y=i*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),i=this.a,r=this.b;this.a=n*i-e*this.c,this.b=n*r-e*this.d,this.c=e*i+n*this.c,this.d=e*r+n*this.d},e}(),Kt=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},Qt=function(){function t(t,e,n){void 0===e&&(e=""),void 0===n&&(n=new Zt),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 i=function(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(i)};requestAnimationFrame(i)}))},t.prototype.setRawDataURI=function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e},t.prototype.loadBinary=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadBinary(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadText=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadText(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load text ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadJson=function(t,e,n){var i=this;void 0===e&&(e=function(){}),void 0===n&&(n=function(){}),t=this.start(t),this.downloader.downloadJson(t,(function(n){i.success(e,t,n)}),(function(e,r){i.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(e,", ").concat(r))}))},t.prototype.loadTexture=function(t,e,n){var i=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():(i.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&&i.success(e,t,i.textureLoader(n))}));else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(){i.success(e,t,i.textureLoader(r))},r.onerror=function(){i.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}},t.prototype.loadTextureAtlas=function(t,e,n,i){var r=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 Vt(a),u=c.pages.length,d=!1,f=function(a){r.loadTexture(i?i[a.name]:o+a.name,(function(n,i){d||(a.setTexture(i),0==--u&&r.success(e,t,c))}),(function(e,i){d||r.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){r.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(e.message))}}),(function(e,i){r.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(e,", ").concat(i))}))},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}(),Zt=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,i=new Uint8Array(n),r=0;r<n;r++)i[r]=e.charCodeAt(r);return i},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 i=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var r=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(r))}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(){i.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 i=this;if(!this.start(t,e,n))if(this.rawDataUris[t])try{var r=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(r))}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(){i.finish(t,a.status,a.response)};a.onload=function(){200==a.status||0==a.status?i.finish(t,200,new Uint8Array(a.response)):s()},a.onerror=s,a.send()}},t.prototype.start=function(t,e,n){var i=this.callbacks[t];try{if(i)return!0;this.callbacks[t]=i=[]}finally{i.push(e,n)}},t.prototype.finish=function(t,e,n){var i=this.callbacks[t];delete this.callbacks[t];for(var r=200==e||0==e?[n]:[e,n],a=r.length-1,s=i.length;a<s;a+=2)i[a].apply(null,r)},t}(),$t=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},te=function(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t},ee=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.bones=new Array;for(var n=0;n<t.bones.length;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 r=e.findBone(t.target.name);if(!r)throw new Error("Couldn't find bone ".concat(t.target.name));this.target=r,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}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,i,r,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.inherit){case t.Inherit.OnlyTranslation:m=(n-e.worldX)*d.signum(e.skeleton.scaleX),g=(i-e.worldY)*d.signum(e.skeleton.scaleY);break;case t.Inherit.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=i-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(r||a){switch(e.inherit){case t.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:m=n-e.worldX,g=i-e.worldY}var I=e.data.length*S;if(I>1e-4){var A=m*m+g*g;if(r&&A<I*I||a&&A>I*I)S*=v=(Math.sqrt(A)/I-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(e,n,i,r,a,s,o,h,l){if(e.inherit==t.Inherit.Normal&&n.inherit==t.Inherit.Normal){var c=e.ax,u=e.ay,f=e.ascaleX,p=e.ascaleY,m=f,g=p,v=n.ascaleX,y=0,x=0,w=0;f<0?(f=-f,y=180,w=-1):(y=0,w=1),p<0&&(p=-p,w=-w),v<0?(v=-v,x=180):x=0;var b=n.ax,M=0,S=0,k=0,I=e.a,A=e.b,C=e.c,T=e.d,E=Math.abs(f-p)<=1e-4;!E||s?(M=0,S=I*b+e.worldX,k=C*b+e.worldY):(S=I*b+A*(M=n.ay)+e.worldX,k=C*b+T*M+e.worldY);var F=e.parent;if(!F)throw new Error("IK parent must itself have a parent.");I=F.a,A=F.b,C=F.c;var B,Y,R=I*(T=F.d)-A*C,P=S-F.worldX,X=k-F.worldY,V=(P*T-X*A)*(R=Math.abs(R)<=1e-4?0:1/R)-c,D=(X*I-P*C)*R-u,L=Math.sqrt(V*V+D*D),N=n.data.length*v;if(L<1e-4)return this.apply1(e,i,r,!1,s,!1,l),void n.updateWorldTransformWith(b,M,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var O=((P=i-F.worldX)*T-(X=r-F.worldY)*A)*R-c,_=(X*I-P*C)*R-u,q=O*O+_*_;if(0!=h){h*=f*(v+1)*.5;var W=Math.sqrt(q),U=W-L-N*f+h;if(U>0){var z=Math.min(1,U/(2*h))-1;q=(O-=(z=(U-h*(1-z*z))/W)*O)*O+(_-=z*_)*_}}t:if(E){var G=(q-L*L-(N*=f)*N)/(2*L*N);G<-1?(G=-1,Y=Math.PI*a):G>1?(G=1,Y=0,s&&(m*=I=(Math.sqrt(q)/(L+N)-1)*l+1,o&&(g*=I))):Y=Math.acos(G)*a,I=L+N*G,A=N*Math.sin(Y),B=Math.atan2(_*I-O*A,O*I+_*A)}else{var H=(I=f*N)*I,j=(A=p*N)*A,J=Math.atan2(_,O),K=-2*j*L,Q=j-H;if((T=K*K-4*Q*(C=j*L*L+H*q-H*j))>=0){var Z=Math.sqrt(T);K<0&&(Z=-Z);var $=(Z=.5*-(K+Z))/Q,tt=C/Z,et=Math.abs($)<Math.abs(tt)?$:tt;if(et*et<=q){X=Math.sqrt(q-et*et)*a,B=J-Math.atan2(X,et),Y=Math.atan2(X/p,(et-L)/f);break t}}var nt=d.PI,it=L-I,rt=it*it,at=0,st=0,ot=L+I,ht=ot*ot,lt=0;(C=-I*L/(H-j))>=-1&&C<=1&&(C=Math.acos(C),(T=(P=I*Math.cos(C)+L)*P+(X=A*Math.sin(C))*X)<rt&&(nt=C,rt=T,it=P,at=X),T>ht&&(st=C,ht=T,ot=P,lt=X)),q<=.5*(rt+ht)?(B=J-Math.atan2(at*a,it),Y=nt*a):(B=J-Math.atan2(lt*a,ot),Y=st*a)}var ct=Math.atan2(M,b)*w,ut=e.arotation;(B=(B-ct)*d.radDeg+y-ut)>180?B-=360:B<-180&&(B+=360),e.updateWorldTransformWith(c,u,ut+B*l,m,g,0,0),ut=n.arotation,(Y=((Y+ct)*d.radDeg-n.ashearX)*w+x-ut)>180?Y-=360:Y<-180&&(Y+=360),n.updateWorldTransformWith(b,M,ut+Y*l,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}},e}(),ne=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n._target=null,n.bendDirection=0,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=0,n.softness=0,n}return i(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}(Kt),ie=function(e){function n(n){var i=e.call(this,n,0,!1)||this;return i.bones=new Array,i._target=null,i.positionMode=t.PositionMode.Fixed,i.spacingMode=t.SpacingMode.Fixed,i.rotateMode=t.RotateMode.Chain,i.offsetRotation=0,i.position=0,i.spacing=0,i.mixRotate=0,i.mixX=0,i.mixY=0,i}return i(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}(Kt);t.PositionMode=void 0,(Gt=t.PositionMode||(t.PositionMode={}))[Gt.Fixed=0]="Fixed",Gt[Gt.Percent=1]="Percent",t.SpacingMode=void 0,(Ht=t.SpacingMode||(t.SpacingMode={}))[Ht.Length=0]="Length",Ht[Ht.Fixed=1]="Fixed",Ht[Ht.Percent=2]="Percent",Ht[Ht.Proportional=3]="Proportional",t.RotateMode=void 0,(jt=t.RotateMode||(t.RotateMode={}))[jt.Tangent=0]="Tangent",jt[jt.Chain=1]="Chain",jt[jt.ChainScale=2]="ChainScale";var re,ae=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,i=t.bones.length;n<i;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 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 i=this.target.getAttachment();if(i instanceof _t){var r=this.mixRotate,a=this.mixX,s=this.mixY;if(0!=r||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=(I=(R=c[y]).data.length)*R.a,b=I*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((I=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=I*R.a,b=I*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 I;if((I=(R=c[y]).data.length)<e.epsilon)l&&(m[y]=0),p[++y]=v;else{w=I*R.a,b=I*R.c;var A=Math.sqrt(w*w+b*b);l&&(m[y]=A),p[++y]=(k?I+v:v)*A/I}}}var C=this.computeWorldPositions(i,f,h),T=C[0],E=C[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+=(T-R.worldX)*a,R.worldY+=(E-R.worldY)*s;var P=(w=C[Y])-T,X=(b=C[Y+1])-E;if(l){var V=m[y];if(0!=V){var D=(Math.sqrt(P*P+X*X)/V-1)*r+1;R.a*=D,R.c*=D}}if(T=w,E=b,r>0){var L=R.a,N=R.b,O=R.c,_=R.d,q=0,W=0,U=0;if(q=h?C[Y-1]:0==p[y+1]?C[Y+2]:Math.atan2(X,P),q-=Math.atan2(O,L),B){W=Math.cos(q),U=Math.sin(q);var z=R.data.length;T+=(z*(W*L-U*O)-P)*r,E+=(z*(U*L+W*O)-X)*r}else q+=F;q>d.PI?q-=d.PI2:q<-d.PI&&(q+=d.PI2),q*=r,W=Math.cos(q),U=Math.sin(q),R.a=W*L-U*O,R.b=W*N-U*_,R.c=U*L+W*O,R.d=U*N+W*_}R.updateAppliedTransform()}}}},e.prototype.computeWorldPositions=function(n,i,r){var a=this.target,s=this.position,o=this.spaces,h=g.setArraySize(this.positions,3*i+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/i;break;default:p=1}l=g.setArraySize(this.world,8);for(var y=0,x=0,w=0;y<i;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,r||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),I=0,A=l[0],C=l[1],T=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)T=l[q],E=l[q+1],F=l[q+2],B=l[q+3],L=2*(P=.1875*(A-2*T+F))+(V=.09375*(3*(T-F)-A+(Y=l[q+4]))),N=2*(X=.1875*(C-2*E+B))+(D=.09375*(3*(E-B)-C+(R=l[q+5]))),O=.75*(T-A)+P+.16666667*V,_=.75*(E-C)+X+.16666667*D,I+=Math.sqrt(O*O+_*_),O+=L,_+=N,L+=V,N+=D,I+=Math.sqrt(O*O+_*_),O+=L,_+=N,I+=Math.sqrt(O*O+_*_),O+=L+V,_+=N+D,I+=Math.sqrt(O*O+_*_),k[y]=I,A=Y,C=R;switch(this.data.positionMode==t.PositionMode.Percent&&(s*=I),this.data.spacingMode){case t.SpacingMode.Percent:S=I;break;case t.SpacingMode.Proportional:S=I/i;break;default:S=1}for(var W=this.segments,U=0,z=(y=0,x=0,w=0,0);y<i;y++,x+=3){var G;b=s+=G=o[y]*S;if(c)(b%=I)<0&&(b+=I),w=0;else{if(b<0){this.addBeforePosition(b,l,0,h,x);continue}if(b>I){this.addAfterPosition(b-I,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(A=l[j],C=l[j+1],T=l[j+2],E=l[j+3],F=l[j+4],B=l[j+5],L=2*(P=.03*(A-2*T+F))+(V=.006*(3*(T-F)-A+(Y=l[j+6]))),N=2*(X=.03*(C-2*E+B))+(D=.006*(3*(E-B)-C+(R=l[j+7]))),O=.3*(T-A)+P+.16666667*V,_=.3*(E-C)+X+.16666667*D,U=Math.sqrt(O*O+_*_),W[0]=U,j=1;j<8;j++)O+=L,_+=N,L+=V,N+=D,U+=Math.sqrt(O*O+_*_),W[j]=U;O+=L,_+=N,U+=Math.sqrt(O*O+_*_),W[8]=U,O+=L+V,_+=N+D,U+=Math.sqrt(O*O+_*_),W[9]=U,z=0}for(b*=U;;z++){var J=W[z];if(!(b>J)){var K;if(0==z)b/=J;else b=z+(b-(K=W[z-1]))/(J-K);break}}this.addCurvePosition(.1*b,A,C,T,E,F,B,Y,R,h,x,r||y>0&&0==G)}return h},e.prototype.addBeforePosition=function(t,e,n,i,r){var a=e[n],s=e[n+1],o=e[n+2]-a,h=e[n+3]-s,l=Math.atan2(h,o);i[r]=a+t*Math.cos(l),i[r+1]=s+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var a=e[n+2],s=e[n+3],o=a-e[n],h=s-e[n+1],l=Math.atan2(h,o);i[r]=a+t*Math.cos(l),i[r+1]=s+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,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(r-n,i-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+i*x+a*w+o*f,M=n*g+r*x+s*w+h*f;l[c]=b,l[c+1]=M,u&&(l[c+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(M-(n*m+r*v*2+s*d),b-(e*m+i*v*2+a*d)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}(),se=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 i=this.data.x>0,r=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:var l=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=l,this.lastTime=this.skeleton.time;var c=o.worldX,u=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=u;else{var f=this.remaining,p=this.inertia,m=this.data.limit*l,g=this.data.step,v=this.skeleton.data.referenceScale,y=-1;if(i||r){if(i){var x=(this.ux-c)*p;this.xOffset+=x>m?m:x<-m?-m:x,this.ux=c}if(r){x=(this.uy-u)*p;this.yOffset+=x>m?m:x<-m?-m:x,this.uy=u}if(f>=g){y=Math.pow(this.damping,60*g);var w=this.massInverse*g,b=this.strength,M=this.wind*v,S=(le.yDown?-this.gravity:this.gravity)*v;do{i&&(this.xVelocity+=(M-this.xOffset*b)*w,this.xOffset+=this.xVelocity*g,this.xVelocity*=y),r&&(this.yVelocity-=(S+this.yOffset*b)*w,this.yOffset+=this.yVelocity*g,this.yVelocity*=y),f-=g}while(f>=g)}i&&(o.worldX+=this.xOffset*n*this.data.x),r&&(o.worldY+=this.yOffset*n*this.data.y)}if(a||s){var k=Math.atan2(o.c,o.a),I=0,A=0,C=0,T=this.cx-o.worldX,E=this.cy-o.worldY;if(T>m?T=m:T<-m&&(T=-m),E>m?E=m:E<-m&&(E=-m),a){C=(this.data.rotate+this.data.shearX)*n;var F=Math.atan2(E+this.ty,T+this.tx)-k-this.rotateOffset*C;this.rotateOffset+=(F-Math.ceil(F*d.invPI2-.5)*d.PI2)*p,F=this.rotateOffset*C+k,I=Math.cos(F),A=Math.sin(F),s&&(F=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(T*I+E*A)*p/F)}else{I=Math.cos(k),A=Math.sin(k),(F=h*o.getWorldScaleX())>0&&(this.scaleOffset+=(T*I+E*A)*p/F)}if((f=this.remaining)>=g){-1==y&&(y=Math.pow(this.damping,60*g));w=this.massInverse*g,b=this.strength,M=this.wind,S=le.yDown?-this.gravity:this.gravity;for(var B=h/v;;)if(f-=g,s&&(this.scaleVelocity+=(M*I-S*A-this.scaleOffset*b)*w,this.scaleOffset+=this.scaleVelocity*g,this.scaleVelocity*=y),a){if(this.rotateVelocity-=((M*A+S*I)*B+this.rotateOffset*b)*w,this.rotateOffset+=this.rotateVelocity*g,this.rotateVelocity*=y,f<g)break;F=this.rotateOffset*C+k;I=Math.cos(F),A=Math.sin(F)}else if(f<g)break}}this.remaining=f}this.cx=o.worldX,this.cy=o.worldY;break;case t.Physics.pose:i&&(o.worldX+=this.xOffset*n*this.data.x),r&&(o.worldY+=this.yOffset*n*this.data.y)}if(a){var Y=this.rotateOffset*n;A=0,I=0,f=0;if(this.data.shearX>0){F=0;this.data.rotate>0&&(F=Y*this.data.rotate,A=Math.sin(F),I=Math.cos(F),f=o.b,o.b=I*f-A*o.d,o.d=A*f+I*o.d),F+=Y*this.data.shearX,A=Math.sin(F),I=Math.cos(F),f=o.a,o.a=I*f-A*o.c,o.c=A*f+I*o.c}else Y*=this.data.rotate,A=Math.sin(Y),I=Math.cos(Y),f=o.a,o.a=I*f-A*o.c,o.c=A*f+I*o.c,f=o.b,o.b=I*f-A*o.d,o.d=A*f+I*o.d}if(s){A=1+this.scaleOffset*n*this.data.scaleX;o.a*=A,o.c*=A}e!=t.Physics.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}},e.prototype.translate=function(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e},e.prototype.rotate=function(t,e,n){var i=n*d.degRad,r=Math.cos(i),a=Math.sin(i),s=this.cx-t,o=this.cy-e;this.translate(s*r-o*a-s,s*a+o*r-o)},e}(),oe=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}(),he=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.bones=new Array;for(var n=0;n<t.bones.length;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 r=e.findBone(t.target.name);if(!r)throw new Error("Couldn't find target bone ".concat(t.target.name,"."));this.target=r,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}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,i=this.mixScaleX,r=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)-Math.atan2(M,w)+p)>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C*=t;var k=Math.cos(C),I=Math.sin(C);x.a=k*w-I*M,x.b=k*b-I*S,x.c=I*w+k*M,x.d=I*b+k*S}if(s){var A=this.temp;o.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(A.x-x.worldX)*e,x.worldY+=(A.y-x.worldY)*n}if(0!=i)0!=(E=Math.sqrt(x.a*x.a+x.c*x.c))&&(E=(E+(Math.sqrt(h*h+c*c)-E+this.data.offsetScaleX)*i)/E),x.a*=E,x.c*=E;if(0!=r)0!=(E=Math.sqrt(x.b*x.b+x.d*x.d))&&(E=(E+(Math.sqrt(l*l+u*u)-E+this.data.offsetScaleY)*r)/E),x.b*=E,x.d*=E;if(a>0){b=x.b,S=x.d;var C,T=Math.atan2(S,b);(C=Math.atan2(u,l)-Math.atan2(c,h)-(T-Math.atan2(x.c,x.a)))>d.PI?C-=d.PI2:C<-d.PI&&(C+=d.PI2),C=T+(C+m)*a;var E=Math.sqrt(b*b+S*S);x.b=Math.cos(C)*E,x.d=Math.sin(C)*E}x.updateAppliedTransform()}},t.prototype.applyRelativeWorld=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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)+p)>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2),T*=t;var k=Math.cos(T),I=Math.sin(T);x.a=k*w-I*M,x.b=k*b-I*S,x.c=I*w+k*M,x.d=I*b+k*S}if(s){var A=this.temp;o.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),x.worldX+=A.x*e,x.worldY+=A.y*n}if(0!=i){var C=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*i+1;x.a*=C,x.c*=C}if(0!=r){C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;x.b*=C,x.d*=C}if(a>0){var T;(T=Math.atan2(u,l)-Math.atan2(c,h))>d.PI?T-=d.PI2:T<-d.PI&&(T+=d.PI2);b=x.b,S=x.d;T=Math.atan2(S,b)+(T-d.PI/2+m)*a;C=Math.sqrt(b*b+S*S);x.b=Math.cos(T)*C,x.d=Math.sin(T)*C}x.updateAppliedTransform()}},t.prototype.applyAbsoluteLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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;0!=t&&(u+=(s.arotation-u+this.data.offsetRotation)*t);var d=c.ax,f=c.ay;d+=(s.ax-d+this.data.offsetX)*e,f+=(s.ay-f+this.data.offsetY)*n;var p=c.ascaleX,m=c.ascaleY;0!=i&&0!=p&&(p=(p+(s.ascaleX-p+this.data.offsetScaleX)*i)/p),0!=r&&0!=m&&(m=(m+(s.ascaleY-m+this.data.offsetScaleY)*r)/m);var g=c.ashearY;0!=a&&(g+=(s.ashearY-g+this.data.offsetShearY)*a),c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t.prototype.applyRelativeLocal=function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,i=this.mixScaleX,r=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)*i+1),m=c.ascaleY*((s.ascaleY-1+this.data.offsetScaleY)*r+1),g=c.ashearY+(s.ashearY+this.data.offsetShearY)*a;c.updateWorldTransformWith(d,f,u,p,m,c.ashearX,g)}},t}(),le=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],i=void 0;if(n.parent){var r=this.bones[n.parent.index];i=new Jt(n,this,r),r.children.push(i)}else i=new Jt(n,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(e=0;e<t.slots.length;e++){var a=t.slots[e],s=(i=this.bones[a.boneData.index],new oe(a,i));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 ee(o,this))}this.transformConstraints=new Array;for(e=0;e<t.transformConstraints.length;e++){var h=t.transformConstraints[e];this.transformConstraints.push(new he(h,this))}this.pathConstraints=new Array;for(e=0;e<t.pathConstraints.length;e++){var l=t.pathConstraints[e];this.pathConstraints.push(new ae(l,this))}this.physicsConstraints=new Array;for(e=0;e<t.physicsConstraints.length;e++){var c=t.physicsConstraints[e];this.physicsConstraints.push(new se(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++){(r=t[e]).sorted=r.data.skinRequired,r.active=!r.sorted}if(this.skin){var i=this.skin.bones;for(e=0,n=this.skin.bones.length;e<n;e++){var r=this.bones[i[e].index];do{r.sorted=!1,r.active=!0,r=r.parent}while(r)}}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,i=n[0];if(this.sortBone(i),1==n.length)this._updateCache.push(t),this.sortReset(i.children);else{var r=n[n.length-1];this.sortBone(r),this._updateCache.push(t),this.sortReset(i.children),r.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,i=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,n,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,i);for(var r=0,a=this.data.skins.length;r<a;r++)this.sortPathConstraintAttachment(this.data.skins[r],n,i);var s=e.getAttachment();s instanceof _t&&this.sortPathConstraintAttachmentWith(s,i);var o=t.bones,h=o.length;for(r=0;r<h;r++)this.sortBone(o[r]);this._updateCache.push(t);for(r=0;r<h;r++)this.sortReset(o[r].children);for(r=0;r<h;r++)o[r].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 i=0;i<n;i++){var r=e[i];this.sortBone(r.parent),this.sortBone(r)}else for(i=0;i<n;i++)this.sortBone(e[i]);this._updateCache.push(t);for(i=0;i<n;i++)this.sortReset(e[i].children);for(i=0;i<n;i++)e[i].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(t,e,n){var i=t.attachments[e];if(i)for(var r in i)this.sortPathConstraintAttachmentWith(i[r],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,e){if(t instanceof _t){var n=t.bones;if(n)for(var i=this.bones,r=0,a=n.length;r<a;){var s=n[r++];for(s+=r;r<s;)this.sortBone(i[n[r++]])}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 i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}},t.prototype.updateWorldTransform=function(t){if(null==t)throw new Error("physics is undefined");for(var e=this.bones,n=0,i=e.length;n<i;n++){var r=e[n];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}var a=this._updateCache;for(n=0,i=a.length;n<i;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 i=e.a,r=e.b,a=e.c,s=e.d;n.worldX=i*this.x+r*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=(i*l+r*u)*this.scaleX,n.b=(i*c+r*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,i,r,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&&(i=f.return)&&i.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){r={error:t}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(r)throw r.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,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}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,i=e.length;n<i;n++){var r=e[n],a=r.data.attachmentName;if(a){var s=t.getAttachment(n,a);s&&r.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,i=0,r=n.length;i<r;i++){var a=n[i];if(a.data.name==t){var s=null;if(e&&!(s=this.getAttachment(i,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(e,n,i,r){if(void 0===i&&(i=new Array(2)),void 0===r&&(r=null),!e)throw new Error("offset cannot be null.");if(!n)throw new Error("size cannot be null.");for(var a=this.drawOrder,s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,u=a.length;c<u;c++){var d=a[c];if(d.bone.active){var f=0,p=null,m=null,v=d.getAttachment();if(v instanceof Wt)f=8,p=g.setArraySize(i,f,0),v.computeWorldVertices(d,p,0,2),m=t.quadTriangles;else if(v instanceof Ot){var y=v;f=y.worldVerticesLength,p=g.setArraySize(i,f,0),y.computeWorldVertices(d,0,f,p,0,2),m=y.triangles}else if(v instanceof Bt&&null!=r){r.clipStart(d,v);continue}if(p&&m){null!=r&&r.isClipping()&&(r.clipTriangles(p,f,m,m.length),p=r.clippedVertices,f=r.clippedVertices.length);for(var x=0,w=p.length;x<w;x+=2){var b=p[x],M=p[x+1];s=Math.min(s,b),o=Math.min(o,M),h=Math.max(h,b),l=Math.max(l,M)}}null!=r&&r.clipEndWithSlot(d)}}null!=r&&r.clipEnd(),e.set(s,o),n.set(h-s,l-o)},t.prototype.update=function(t){this.time+=t},t.prototype.physicsTranslate=function(t,e){for(var n=this.physicsConstraints,i=0,r=n.length;i<r;i++)n[i].translate(t,e)},t.prototype.physicsRotate=function(t,e,n){for(var i=this.physicsConstraints,r=0,a=i.length;r<a;r++)i[r].rotate(t,e,n)},t.quadTriangles=[0,1,2,2,3,0],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 ce,ue=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.limit=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 i(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}(Kt),de=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.referenceScale=100,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,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findSlot=function(t){if(!t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findSkin=function(t){if(!t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findEvent=function(t){if(!t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findAnimation=function(t){if(!t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findIkConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findTransformConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPathConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPhysicsConstraint=function(t){if(!t)throw new Error("constraintName cannot be null.");for(var e=this.physicsConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t}(),fe=function(t,e,n){void 0===t&&(t=0),this.slotIndex=t,this.name=e,this.attachment=n},pe=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 i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},t.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var n=t.bones[e],i=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==n){i=!0;break}i||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(i=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==a){i=!0;break}i||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],i=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==n){i=!0;break}i||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var a=t.constraints[e];for(i=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==a){i=!0;break}i||this.constraints.push(a)}var s=t.getAttachments();for(e=0;e<s.length;e++){var o=s[e];o.attachment&&(o.attachment instanceof Ot?(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 i in n){var r=n[i];r&&t.push(new fe(e,i,r))}}return t},t.prototype.getAttachmentsForSlot=function(t,e){var n=this.attachments[t];if(n)for(var i in n){var r=n[i];r&&e.push(new fe(t,i,r))}},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,i=0;i<t.slots.length;i++){var r=t.slots[i],a=r.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&&r.setAttachment(h);break}}}n++}},t}(),me=function(e,n,i){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(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i};t.BlendMode=void 0,(ce=t.BlendMode||(t.BlendMode={}))[ce.Normal=0]="Normal",ce[ce.Additive=1]="Additive",ce[ce.Multiply=2]="Multiply",ce[ce.Screen=3]="Screen";var ge,ve=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 i(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}(Kt),ye=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,i=this.scale,r=new de;r.name="";var a=new xe(e),s=a.readInt32(),o=a.readInt32();r.hash=0==o&&0==s?null:o.toString(16)+s.toString(16),r.version=a.readString(),r.x=a.readFloat(),r.y=a.readFloat(),r.width=a.readFloat(),r.height=a.readFloat(),r.referenceScale=a.readFloat()*i;var h=a.readBoolean();h&&(r.fps=a.readFloat(),r.imagesPath=a.readString(),r.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:r.bones[a.readInt(!0)];(y=new zt(c,f,p)).rotation=a.readFloat(),y.x=a.readFloat()*i,y.y=a.readFloat()*i,y.scaleX=a.readFloat(),y.scaleY=a.readFloat(),y.shearX=a.readFloat(),y.shearY=a.readFloat(),y.length=a.readFloat()*i,y.inherit=a.readByte(),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()),r.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=r.bones[a.readInt(!0)],y=new me(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()),r.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 ne(b)).order=a.readInt(!0),w=a.readInt(!0);for(var M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.bones[a.readInt(!0)];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),0!=(32&S)&&(y.mix=0!=(64&S)?a.readFloat():1),0!=(128&S)&&(y.softness=a.readFloat()*i),r.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 ve(k)).order=a.readInt(!0),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.bones[a.readInt(!0)];S=a.readByte();y.skinRequired=0!=(1&S),y.local=0!=(2&S),y.relative=0!=(4&S),0!=(8&S)&&(y.offsetRotation=a.readFloat()),0!=(16&S)&&(y.offsetX=a.readFloat()*i),0!=(32&S)&&(y.offsetY=a.readFloat()*i),0!=(64&S)&&(y.offsetScaleX=a.readFloat()),0!=(128&S)&&(y.offsetScaleY=a.readFloat()),0!=(1&(S=a.readByte()))&&(y.offsetShearY=a.readFloat()),0!=(2&S)&&(y.mixRotate=a.readFloat()),0!=(4&S)&&(y.mixX=a.readFloat()),0!=(8&S)&&(y.mixY=a.readFloat()),0!=(16&S)&&(y.mixScaleX=a.readFloat()),0!=(32&S)&&(y.mixScaleY=a.readFloat()),0!=(64&S)&&(y.mixShearY=a.readFloat()),r.transformConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var I=a.readString();if(!I)throw new Error("Path constraint data name must not be null.");(y=new ie(I)).order=a.readInt(!0),y.skinRequired=a.readBoolean(),w=a.readInt(!0);for(M=0;M<w;M++)y.bones.push(r.bones[a.readInt(!0)]);y.target=r.slots[a.readInt(!0)];S=a.readByte();y.positionMode=1&S,y.spacingMode=S>>1&3,y.rotateMode=S>>3&3,0!=(128&S)&&(y.offsetRotation=a.readFloat()),y.position=a.readFloat(),y.positionMode==t.PositionMode.Fixed&&(y.position*=i),y.spacing=a.readFloat(),y.spacingMode!=t.SpacingMode.Length&&y.spacingMode!=t.SpacingMode.Fixed||(y.spacing*=i),y.mixRotate=a.readFloat(),y.mixX=a.readFloat(),y.mixY=a.readFloat(),r.pathConstraints.push(y)}l=a.readInt(!0);for(c=0,w=void 0;c<l;c++){var A=a.readString();if(!A)throw new Error("Physics constraint data name must not be null.");(y=new ue(A)).order=a.readInt(!0),y.bone=r.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.limit=(0!=(64&S)?a.readFloat():5e3)*i,y.step=1/a.readUnsignedByte(),y.inertia=a.readFloat(),y.strength=a.readFloat(),y.damping=a.readFloat(),y.massInverse=0!=(128&S)?a.readFloat():1,y.wind=a.readFloat(),y.gravity=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),y.mix=0!=(128&S)?a.readFloat():1,r.physicsConstraints.push(y)}var C=this.readSkin(a,r,!0,h);C&&(r.defaultSkin=C,r.skins.push(C));c=r.skins.length;for(g.setArraySize(r.skins,l=c+a.readInt(!0));c<l;c++){if(!(E=this.readSkin(a,r,!1,h)))throw new Error("readSkin() should not have returned null.");r.skins[c]=E}l=this.linkedMeshes.length;for(c=0;c<l;c++){var T=this.linkedMeshes[c],E=r.skins[T.skinIndex];if(!T.parent)throw new Error("Linked mesh parent must not be null");var F=E.getAttachment(T.slotIndex,T.parent);if(!F)throw new Error("Parent mesh not found: ".concat(T.parent));T.mesh.timelineAttachment=T.inheritTimeline?F:T.mesh,T.mesh.setParentMesh(F),null!=T.mesh.region&&T.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 te(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()),r.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.");r.animations.push(this.readAnimation(a,Y,r))}return r},e.prototype.readSkin=function(t,e,n,i){var r=null,a=0;if(n){if(0==(a=t.readInt(!0)))return null;r=new pe("default")}else{var s=t.readString();if(!s)throw new Error("Skin name must not be null.");r=new pe(s),i&&u.rgba8888ToColor(r.color,t.readInt32()),r.bones.length=t.readInt(!0);for(var o=0,h=r.bones.length;o<h;o++)r.bones[o]=e.bones[t.readInt(!0)];for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.ikConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.transformConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.constraints.push(e.pathConstraints[t.readInt(!0)]);for(o=0,h=t.readInt(!0);o<h;o++)r.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,r,l,f,i);p&&r.setAttachment(l,f,p)}return r},e.prototype.readAttachment=function(t,e,n,i,r,a){var s=this.scale,o=t.readByte(),h=0!=(8&o)?t.readStringRef():r;if(!h)throw new Error("Attachment name must not be null");switch(7&o){case ge.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=0!=(128&o)?t.readFloat():0,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 ge.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 ge.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),I=(M=this.readVertices(t,0!=(128&o)),this.readFloatArray(t,M.length,1)),A=this.readShortArray(t,3*(M.length-k-2)),C=[];x=0,w=0;return a&&(C=this.readShortArray(t,t.readInt(!0)),x=t.readFloat(),w=t.readFloat()),l||(l=h),(T=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(T.path=l,u.rgba8888ToColor(T.color,c),T.bones=M.bones,T.vertices=M.vertices,T.worldVerticesLength=M.length,T.triangles=A,T.regionUVs=I,null==d&&T.updateRegion(),T.hullLength=k<<1,T.sequence=d,a&&(T.edges=C,T.width=x*s,T.height=w*s),T):null;case ge.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 T,E=0!=(128&o),F=t.readInt(!0),B=t.readStringRef();x=0,w=0;return a&&(x=t.readFloat(),w=t.readFloat()),(T=this.attachmentLoader.newMeshAttachment(n,h,l,d))?(T.path=l,u.rgba8888ToColor(T.color,c),T.sequence=d,a&&(T.width=x*s,T.height=w*s),this.linkedMeshes.push(new we(T,F,i,B,E)),T):null;case ge.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 ge.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 ge.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){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,i=t.readInt(!0),r=new be;if(r.length=i<<1,!e)return r.vertices=this.readFloatArray(t,r.length,n),r;for(var a=new Array,s=new Array,o=0;o<i;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 r.vertices=g.toFloatArray(a),r.bones=s,r},e.prototype.readFloatArray=function(t,e,n){var i=new Array(e);if(1==n)for(var r=0;r<e;r++)i[r]=t.readFloat();else for(r=0;r<e;r++)i[r]=t.readFloat()*n;return i},e.prototype.readShortArray=function(t,e){for(var n=new Array(e),i=0;i<e;i++)n[i]=t.readInt(!0);return n},e.prototype.readAnimation=function(e,n,i){e.readInt(!0);for(var r=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=(xt=e.readInt(!0))-1;switch(u){case De:for(var f=new Q(xt,h),p=0;p<xt;p++)f.setFrame(p,e.readFloat(),e.readStringRef());r.push(f);break;case Le:for(var m=e.readInt(!0),v=(f=new G(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,k,1),ke(e,f,M++,p,1,v,S,x,I,1),ke(e,f,M++,p,2,v,S,w,A,1),ke(e,f,M++,p,3,v,S,b,E,1)}v=S,y=k,x=I,w=A,b=E}r.push(f);break;case Ne:for(m=e.readInt(!0),f=new H(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,k,1),ke(e,f,M++,p,1,v,S,x,I,1),ke(e,f,M++,p,2,v,S,w,A,1)}v=S,y=k,x=I,w=A}r.push(f);break;case Oe:for(m=e.readInt(!0),f=new J(xt,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,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,b,k,I,A),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,st=e.readUnsignedByte()/255,gt=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,F,1),ke(e,f,M++,p,1,v,S,x,B,1),ke(e,f,M++,p,2,v,S,w,Y,1),ke(e,f,M++,p,3,v,S,b,R,1),ke(e,f,M++,p,4,v,S,k,P,1),ke(e,f,M++,p,5,v,S,I,st,1),ke(e,f,M++,p,6,v,S,A,gt,1)}v=S,y=F,x=B,w=Y,b=R,k=P,I=st,A=gt}r.push(f);break;case _e:for(m=e.readInt(!0),f=new K(xt,m,h),v=e.readFloat(),y=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,p=0,M=0;f.setFrame(p,v,y,x,w,k,I,A),p!=d;p++){S=e.readFloat(),F=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,st=e.readUnsignedByte()/255,gt=e.readUnsignedByte()/255;switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,y,F,1),ke(e,f,M++,p,1,v,S,x,B,1),ke(e,f,M++,p,2,v,S,w,Y,1),ke(e,f,M++,p,3,v,S,k,P,1),ke(e,f,M++,p,4,v,S,I,st,1),ke(e,f,M++,p,5,v,S,A,gt,1)}v=S,y=F,x=B,w=Y,k=P,I=st,A=gt}r.push(f);break;case qe:for(f=new j(xt,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 nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,b,E,1)}v=S,b=E}r.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var vt=e.readInt(!0);for(l=0,c=e.readInt(!0);l<c;l++){var yt=e.readByte(),xt=e.readInt(!0);if(yt!=Ve){m=e.readInt(!0);switch(yt){case Ae:r.push(Me(e,new X(xt,m,vt),1));break;case Ce:r.push(Se(e,new V(xt,m,vt),a));break;case Te:r.push(Me(e,new D(xt,m,vt),a));break;case Ee:r.push(Me(e,new L(xt,m,vt),a));break;case Fe:r.push(Se(e,new N(xt,m,vt),1));break;case Be:r.push(Me(e,new O(xt,m,vt),1));break;case Ye:r.push(Me(e,new _(xt,m,vt),1));break;case Re:r.push(Se(e,new q(xt,m,vt),1));break;case Pe:r.push(Me(e,new W(xt,m,vt),1));break;case Xe:r.push(Me(e,new U(xt,m,vt),1))}}else{for(f=new z(xt,vt),p=0;p<xt;p++)f.setFrame(p,e.readFloat(),e.readByte());r.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++){var wt=e.readInt(!0),bt=(d=(xt=e.readInt(!0))-1,f=new et(xt,e.readInt(!0),wt),e.readByte()),Mt=(v=e.readFloat(),0!=(1&bt)?0!=(2&bt)?e.readFloat():1:0),St=0!=(4&bt)?e.readFloat()*a:0;for(p=0,M=0;f.setFrame(p,v,Mt,St,0!=(8&bt)?1:-1,0!=(16&bt),0!=(32&bt)),p!=d;p++){bt=e.readByte();S=e.readFloat();var kt=0!=(1&bt)?0!=(2&bt)?e.readFloat():1:0,It=0!=(4&bt)?e.readFloat()*a:0;0!=(64&bt)?f.setStepped(p):0!=(128&bt)&&(ke(e,f,M++,p,0,v,S,Mt,kt,1),ke(e,f,M++,p,1,v,S,St,It,a)),v=S,Mt=kt,St=It}r.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){wt=e.readInt(!0),d=(xt=e.readInt(!0))-1,f=new nt(xt,e.readInt(!0),wt),v=e.readFloat();var At=e.readFloat(),Ct=e.readFloat(),Tt=e.readFloat(),Et=e.readFloat(),Ft=e.readFloat(),Bt=e.readFloat();for(p=0,M=0;f.setFrame(p,v,At,Ct,Tt,Et,Ft,Bt),p!=d;p++){S=e.readFloat();var Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat(),Xt=e.readFloat(),Vt=e.readFloat(),Dt=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,At,Yt,1),ke(e,f,M++,p,1,v,S,Ct,Rt,1),ke(e,f,M++,p,2,v,S,Tt,Pt,1),ke(e,f,M++,p,3,v,S,Et,Xt,1),ke(e,f,M++,p,4,v,S,Ft,Vt,1),ke(e,f,M++,p,5,v,S,Bt,Dt,1)}v=S,At=Yt,Ct=Rt,Tt=Pt,Et=Xt,Ft=Vt,Bt=Dt}r.push(f)}for(s=0,o=e.readInt(!0);s<o;s++){wt=e.readInt(!0);var Lt=i.pathConstraints[wt];for(l=0,c=e.readInt(!0);l<c;l++){yt=e.readByte(),xt=e.readInt(!0),m=e.readInt(!0);switch(yt){case ze:r.push(Me(e,new it(xt,m,wt),Lt.positionMode==t.PositionMode.Fixed?a:1));break;case Ge:r.push(Me(e,new rt(xt,m,wt),Lt.spacingMode==t.SpacingMode.Length||Lt.spacingMode==t.SpacingMode.Fixed?a:1));break;case He:for(f=new at(xt,m,wt),v=e.readFloat(),At=e.readFloat(),Ct=e.readFloat(),Tt=e.readFloat(),p=0,M=0,d=f.getFrameCount()-1;f.setFrame(p,v,At,Ct,Tt),p!=d;p++){S=e.readFloat(),Yt=e.readFloat(),Rt=e.readFloat(),Pt=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,At,Yt,1),ke(e,f,M++,p,1,v,S,Ct,Rt,1),ke(e,f,M++,p,2,v,S,Tt,Pt,1)}v=S,At=Yt,Ct=Rt,Tt=Pt}r.push(f)}}}for(s=0,o=e.readInt(!0);s<o;s++)for(wt=e.readInt(!0)-1,l=0,c=e.readInt(!0);l<c;l++){yt=e.readByte(),xt=e.readInt(!0);if(yt!=en){m=e.readInt(!0);switch(yt){case je:r.push(Me(e,new ot(xt,m,wt),1));break;case Je:r.push(Me(e,new ht(xt,m,wt),1));break;case Ke:r.push(Me(e,new lt(xt,m,wt),1));break;case Qe:r.push(Me(e,new ct(xt,m,wt),1));break;case Ze:r.push(Me(e,new ut(xt,m,wt),1));break;case $e:r.push(Me(e,new dt(xt,m,wt),1));break;case tn:r.push(Me(e,new ft(xt,m,wt),1))}}else{for(f=new pt(xt,wt),p=0;p<xt;p++)f.setFrame(p,e.readFloat());r.push(f)}}for(s=0,o=e.readInt(!0);s<o;s++){var Nt=i.skins[e.readInt(!0)];for(l=0,c=e.readInt(!0);l<c;l++){h=e.readInt(!0);for(var Ot=0,_t=e.readInt(!0);Ot<_t;Ot++){var qt=e.readStringRef();if(!qt)throw new Error("attachmentName must not be null.");var Wt=Nt.getAttachment(h,qt);u=e.readByte(),d=(xt=e.readInt(!0))-1;switch(u){case We:var Ut=Wt,zt=Ut.bones,Gt=Ut.vertices,Ht=zt?Gt.length/3*2:Gt.length;for(m=e.readInt(!0),f=new Z(xt,m,h,Ut),v=e.readFloat(),p=0,M=0;;p++){var jt=void 0,Jt=e.readInt(!0);if(0==Jt)jt=zt?g.newFloatArray(Ht):Gt;else{jt=g.newFloatArray(Ht);var Kt=e.readInt(!0);if(Jt+=Kt,1==a)for(var Qt=Kt;Qt<Jt;Qt++)jt[Qt]=e.readFloat();else for(Qt=Kt;Qt<Jt;Qt++)jt[Qt]=e.readFloat()*a;if(!zt){Qt=0;for(var Zt=jt.length;Qt<Zt;Qt++)jt[Qt]+=Gt[Qt]}}if(f.setFrame(p,v,jt),p==d)break;S=e.readFloat();switch(e.readByte()){case nn:f.setStepped(p);break;case rn:ke(e,f,M++,p,0,v,S,0,1,1)}v=S}r.push(f);break;case Ue:for(f=new mt(xt,h,Wt),p=0;p<xt;p++){v=e.readFloat();var te=e.readInt32();f.setFrame(p,v,C[15&te],te>>4,e.readFloat())}r.push(f)}}}}var ee=e.readInt(!0);if(ee>0){f=new tt(ee);var ne=i.slots.length;for(s=0;s<ee;s++){v=e.readFloat();var ie=e.readInt(!0),re=g.newArray(ne,0);for(l=ne-1;l>=0;l--)re[l]=-1;var ae=g.newArray(ne-ie,0),se=0,oe=0;for(l=0;l<ie;l++){for(h=e.readInt(!0);se!=h;)ae[oe++]=se++;re[se+e.readInt(!0)]=se++}for(;se<ne;)ae[oe++]=se++;for(l=ne-1;l>=0;l--)-1==re[l]&&(re[l]=ae[--oe]);f.setFrame(s,v,re)}r.push(f)}var he=e.readInt(!0);if(he>0){for(f=new $(he),s=0;s<he;s++){v=e.readFloat();var le=i.events[e.readInt(!0)],ce=new $t(v,le);ce.intValue=e.readInt(!1),ce.floatValue=e.readFloat(),ce.stringValue=e.readString(),null==ce.stringValue&&(ce.stringValue=le.stringValue),ce.data.audioPath&&(ce.volume=e.readFloat(),ce.balance=e.readFloat()),f.setFrame(s,ce)}r.push(f)}var ue=0;for(s=0,o=r.length;s<o;s++)ue=Math.max(ue,r[s].getDuration());return new T(n,r,ue)},e}(),xe=function(){function t(t,e,n,i){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===i&&(i=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=i}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 i=this.readUnsignedByte();switch(i>>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),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}(),we=function(t,e,n,i,r){this.mesh=t,this.skinIndex=e,this.slotIndex=n,this.parent=i,this.inheritTimeline=r},be=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 Me(t,e,n){for(var i=t.readFloat(),r=t.readFloat()*n,a=0,s=0,o=e.getFrameCount()-1;e.setFrame(a,i,r),a!=o;a++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case nn:e.setStepped(a);break;case rn:ke(t,e,s++,a,0,i,h,r,l,n)}i=h,r=l}return e}function Se(t,e,n){for(var i=t.readFloat(),r=t.readFloat()*n,a=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,i,r,a),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case nn:e.setStepped(s);break;case rn:ke(t,e,o++,s,0,i,l,r,c,n),ke(t,e,o++,s,1,i,l,a,u,n)}i=l,r=c,a=u}return e}function ke(t,e,n,i,r,a,s,o,h,l){e.setBezier(n,i,r,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"}(ge||(ge={}));var Ie,Ae=0,Ce=1,Te=2,Ee=3,Fe=4,Be=5,Ye=6,Re=7,Pe=8,Xe=9,Ve=10,De=0,Le=1,Ne=2,Oe=3,_e=4,qe=5,We=0,Ue=1,ze=0,Ge=1,He=2,je=0,Je=1,Ke=2,Qe=4,Ze=5,$e=6,tn=7,en=8,nn=1,rn=2,an=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,i=this.polygons,r=this.polygonPool,a=t.slots,s=a.length;n.length=0,r.freeAll(i),i.length=0;for(var o=0;o<s;o++){var h=a[o];if(h.bone.active){var l=h.getAttachment();if(l instanceof Ft){var c=l;n.push(c);var u=r.obtain();u.length!=c.worldVerticesLength&&(u=g.newFloatArray(c.worldVerticesLength)),i.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,i=Number.NEGATIVE_INFINITY,r=this.polygons,a=0,s=r.length;a<s;a++)for(var o=r[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),i=Math.max(i,d)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=i},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,i){var r=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=a&&i<=a||t>=s&&n>=s||e>=o&&i>=o)return!1;var h=(i-e)/(n-t),l=h*(r-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>r&&c<s||(c=(o-e)/h+t)>r&&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,i=0,r=n.length;i<r;i++)if(this.containsPointPolygon(n[i],t,e))return this.boundingBoxes[i];return null},t.prototype.containsPointPolygon=function(t,e,n){for(var i=t,r=t.length,a=r-2,s=!1,o=0;o<r;o+=2){var h=i[o+1],l=i[a+1];if(h<n&&l>=n||l<n&&h>=n){var c=i[o];c+(n-h)/(l-h)*(i[a]-c)<e&&(s=!s)}a=o}return s},t.prototype.intersectsSegment=function(t,e,n,i){for(var r=this.polygons,a=0,s=r.length;a<s;a++)if(this.intersectsSegmentPolygon(r[a],t,e,n,i))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(t,e,n,i,r){for(var a=t,s=t.length,o=e-i,h=n-r,l=e*r-n*i,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<=i||x>=i&&x<=e)){var w=(l*v-h*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=r||w>=r&&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}(),sn=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,i=e.length>>1,r=this.indicesArray;r.length=0;for(var a=0;a<i;a++)r[a]=a;var s=this.isConcaveArray;s.length=0;a=0;for(var o=i;a<o;++a)s[a]=t.isConcave(a,i,n,r);var h=this.triangles;for(h.length=0;i>3;){for(var l=i-1,c=(a=0,1);;){t:if(!s[a]){for(var u=r[l]<<1,d=r[a]<<1,f=r[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)%i;w!=l;w=(w+1)%i)if(s[w]){var b=r[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)%i}h.push(r[(i+a-1)%i]),h.push(r[a]),h.push(r[(a+1)%i]),r.splice(a,1),s.splice(a,1);var k=(--i+a-1)%i,I=a==i?0:a;s[k]=t.isConcave(k,i,n,r),s[I]=t.isConcave(I,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},t.prototype.decompose=function(e,n){var i=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.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=i[d],g=i[d+1],v=i[f],y=i[f+1],x=i[p],w=i[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?(r.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&&(r.push(o),a.push(s));for(c=0,u=r.length;c<u;c++)if(0!=(s=a[c]).length)for(var I=s[0],A=s[s.length-1],C=(o=r[c])[M=o.length-4],T=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(C,T,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],_=r[V];x=_[_.length-2],w=_[_.length-1];if(L==I&&N==A){S=t.winding(C,T,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),C=E,T=F,E=x,F=w,V=0)}}}for(c=r.length-1;c>=0;c--)0==(o=r[c]).length&&(r.splice(c,1),this.polygonPool.free(o),s=a[c],a.splice(c,1),this.polygonIndicesPool.free(s));return r},t.isConcave=function(t,e,n,i){var r=i[(e+t-1)%e]<<1,a=i[t]<<1,s=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[a],n[a+1],n[s],n[s+1])},t.positiveArea=function(t,e,n,i,r,a){return t*(a-i)+n*(e-a)+r*(i-e)>=0},t.winding=function(t,e,n,i,r,a){var s=n-t,o=i-e;return r*o-a*s+s*e-t*o>=0?1:-1},t}(),on=function(){function t(){this.triangulator=new sn,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 i=n.worldVerticesLength,r=g.setArraySize(this.clippingPolygon,i);n.computeWorldVertices(e,0,i,r,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,i,r,a,s,o){r&&a&&s&&"boolean"==typeof o?this.clipTrianglesRender(t,e,n,i,r,a,s,o):this.clipTrianglesNoRender(t,e,n,i)},t.prototype.clipTrianglesNoRender=function(t,e,n,i){var r=this.clipOutput,a=this.clippedVertices,s=this.clippedTriangles,o=this.clippingPolygons,h=o.length,l=0;a.length=0,s.length=0;t:for(var c=0;c<i;c+=3)for(var u=n[c]<<1,d=t[u],f=t[u+1],p=t[u=n[c+1]<<1],m=t[u+1],v=t[u=n[c+2]<<1],y=t[u+1],x=0;x<h;x++){var w=a.length;if(!this.clip(d,f,p,m,v,y,o[x],r)){(k=g.setArraySize(a,w+6))[w]=d,k[w+1]=f,k[w+2]=p,k[w+3]=m,k[w+4]=v,k[w+5]=y,w=s.length,(T=g.setArraySize(s,w+3))[w]=l,T[w+1]=l+1,T[w+2]=l+2,l+=3;continue t}var b=r.length;if(0!=b){for(var M=b>>1,S=this.clipOutput,k=g.setArraySize(a,w+2*M),I=0;I<b;I+=2){var A=S[I],C=S[I+1];k[w]=A,k[w+1]=C,w+=2}w=s.length;var T=g.setArraySize(s,w+3*(M-2));M--;for(I=1;I<M;I++)T[w]=l,T[w+1]=l+I,T[w+2]=l+I+1,w+=3;l+=M+1}}},t.prototype.clipTrianglesRender=function(t,e,n,i,r,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<i;m+=3)for(var v=n[m]<<1,y=t[v],x=t[v+1],w=r[v],b=r[v+1],M=t[v=n[m+1]<<1],S=t[v+1],k=r[v],I=r[v+1],A=t[v=n[m+2]<<1],C=t[v+1],T=r[v],E=r[v+1],F=0;F<d;F++){var B=l.length;if(!this.clip(y,x,M,S,A,C,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]=I,O[B+20]=s.r,O[B+21]=s.g,O[B+22]=s.b,O[B+23]=s.a,O[B+24]=A,O[B+25]=C,O[B+26]=a.r,O[B+27]=a.g,O[B+28]=a.b,O[B+29]=a.a,O[B+30]=T,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]=I,O[B+16]=A,O[B+17]=C,O[B+18]=a.r,O[B+19]=a.g,O[B+20]=a.b,O[B+21]=a.a,O[B+22]=T,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-C,P=A-M,X=y-A,V=C-x,D=1/(R*X+P*(x-C)),L=Y>>1,N=this.clipOutput,O=g.setArraySize(l,B+L*f),_=0;_<Y;_+=2){var q=N[_],W=N[_+1];O[B]=q,O[B+1]=W,O[B+2]=a.r,O[B+3]=a.g,O[B+4]=a.b,O[B+5]=a.a;var U=q-A,z=W-C,G=(R*U+P*z)*D,H=(V*U+X*z)*D,j=1-G-H;O[B+6]=w*G+k*H+T*j,O[B+7]=b*G+I*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,i,r,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(i),h.push(r),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],I=w[S+1],A=w[S+2],C=w[S+3],T=y*(C-v)-x*(A-g)>0;if(y*(I-v)-x*(k-g)>0){if(T){o.push(A),o.push(C);continue}var E=(B=C-I)*(g-p)-(Y=A-k)*(v-m);if(Math.abs(E)>1e-6){var F=(Y*(m-I)-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(T){var B,Y;E=(B=C-I)*(g-p)-(Y=A-k)*(v-m);if(Math.abs(E)>1e-6){F=(Y*(m-I)-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(A),o.push(C)}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,i=e[n-2]*e[1]-e[0]*e[n-1],r=0,a=0,s=0,o=0,h=n-3;o<h;o+=2)r=e[o],a=e[o+1],s=e[o+2],i+=r*e[o+3]-s*a;if(!(i<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}(),hn=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(e){var n,i,r=this.scale,a=new de,s="string"==typeof e?JSON.parse(e):e,o=s.skeleton;if(o&&(a.hash=o.hash,a.version=o.spine,a.x=o.x,a.y=o.y,a.width=o.width,a.height=o.height,a.referenceScale=fn(o,"referenceScale",100)*r,a.fps=o.fps,a.imagesPath=null!==(n=o.images)&&void 0!==n?n:null,a.audioPath=null!==(i=o.audio)&&void 0!==i?i:null),s.bones)for(var h=0;h<s.bones.length;h++){var l=s.bones[h],c=null,d=fn(l,"parent",null);d&&(c=a.findBone(d)),(v=new zt(a.bones.length,l.name,c)).length=fn(l,"length",0)*r,v.x=fn(l,"x",0)*r,v.y=fn(l,"y",0)*r,v.rotation=fn(l,"rotation",0),v.scaleX=fn(l,"scaleX",1),v.scaleY=fn(l,"scaleY",1),v.shearX=fn(l,"shearX",0),v.shearY=fn(l,"shearY",0),v.inherit=g.enumValue(t.Inherit,fn(l,"inherit","Normal")),v.skinRequired=fn(l,"skin",!1),(m=fn(l,"color",null))&&v.color.setFromString(m),a.bones.push(v)}if(s.slots)for(h=0;h<s.slots.length;h++){var f=(F=s.slots[h]).name,p=a.findBone(F.bone);if(!p)throw new Error("Couldn't find bone ".concat(F.bone," for slot ").concat(f));var m,v=new me(a.slots.length,f,p);(m=fn(F,"color",null))&&v.color.setFromString(m);var y=fn(F,"dark",null);y&&(v.darkColor=u.fromString(y)),v.attachmentName=fn(F,"attachment",null),v.blendMode=g.enumValue(t.BlendMode,fn(F,"blend","normal")),v.visible=fn(F,"visible",!0),a.slots.push(v)}if(s.ik)for(h=0;h<s.ik.length;h++){var x=s.ik[h];(v=new ne(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(var w=0;w<x.bones.length;w++){if(!(A=a.findBone(x.bones[w])))throw new Error("Couldn't find bone ".concat(x.bones[w]," for IK constraint ").concat(x.name,"."));v.bones.push(A)}if(!(S=a.findBone(x.target)))throw new Error("Couldn't find target bone ".concat(x.target," for IK constraint ").concat(x.name,"."));v.target=S,v.mix=fn(x,"mix",1),v.softness=fn(x,"softness",0)*r,v.bendDirection=fn(x,"bendPositive",!0)?1:-1,v.compress=fn(x,"compress",!1),v.stretch=fn(x,"stretch",!1),v.uniform=fn(x,"uniform",!1),a.ikConstraints.push(v)}if(s.transform)for(h=0;h<s.transform.length;h++){x=s.transform[h];(v=new ve(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(w=0;w<x.bones.length;w++){var b=x.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for transform constraint ").concat(x.name,"."));v.bones.push(A)}var M=x.target;if(!(S=a.findBone(M)))throw new Error("Couldn't find target bone ".concat(M," for transform constraint ").concat(x.name,"."));v.target=S,v.local=fn(x,"local",!1),v.relative=fn(x,"relative",!1),v.offsetRotation=fn(x,"rotation",0),v.offsetX=fn(x,"x",0)*r,v.offsetY=fn(x,"y",0)*r,v.offsetScaleX=fn(x,"scaleX",0),v.offsetScaleY=fn(x,"scaleY",0),v.offsetShearY=fn(x,"shearY",0),v.mixRotate=fn(x,"mixRotate",1),v.mixX=fn(x,"mixX",1),v.mixY=fn(x,"mixY",v.mixX),v.mixScaleX=fn(x,"mixScaleX",1),v.mixScaleY=fn(x,"mixScaleY",v.mixScaleX),v.mixShearY=fn(x,"mixShearY",1),a.transformConstraints.push(v)}if(s.path)for(h=0;h<s.path.length;h++){x=s.path[h];(v=new ie(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);for(w=0;w<x.bones.length;w++){b=x.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for path constraint ").concat(x.name,"."));v.bones.push(A)}var S;M=x.target;if(!(S=a.findSlot(M)))throw new Error("Couldn't find target slot ".concat(M," for path constraint ").concat(x.name,"."));v.target=S,v.positionMode=g.enumValue(t.PositionMode,fn(x,"positionMode","Percent")),v.spacingMode=g.enumValue(t.SpacingMode,fn(x,"spacingMode","Length")),v.rotateMode=g.enumValue(t.RotateMode,fn(x,"rotateMode","Tangent")),v.offsetRotation=fn(x,"rotation",0),v.position=fn(x,"position",0),v.positionMode==t.PositionMode.Fixed&&(v.position*=r),v.spacing=fn(x,"spacing",0),v.spacingMode!=t.SpacingMode.Length&&v.spacingMode!=t.SpacingMode.Fixed||(v.spacing*=r),v.mixRotate=fn(x,"mixRotate",1),v.mixX=fn(x,"mixX",1),v.mixY=fn(x,"mixY",v.mixX),a.pathConstraints.push(v)}if(s.physics)for(h=0;h<s.physics.length;h++){x=s.physics[h];(v=new ue(x.name)).order=fn(x,"order",0),v.skinRequired=fn(x,"skin",!1);b=x.bone;if(null==(A=a.findBone(b)))throw new Error("Physics bone not found: "+b);v.bone=A,v.x=fn(x,"x",0),v.y=fn(x,"y",0),v.rotate=fn(x,"rotate",0),v.scaleX=fn(x,"scaleX",0),v.shearX=fn(x,"shearX",0),v.limit=fn(x,"limit",5e3)*r,v.step=1/fn(x,"fps",60),v.inertia=fn(x,"inertia",1),v.strength=fn(x,"strength",100),v.damping=fn(x,"damping",1),v.massInverse=1/fn(x,"mass",1),v.wind=fn(x,"wind",0),v.gravity=fn(x,"gravity",0),v.mix=fn(x,"mix",1),v.inertiaGlobal=fn(x,"inertiaGlobal",!1),v.strengthGlobal=fn(x,"strengthGlobal",!1),v.dampingGlobal=fn(x,"dampingGlobal",!1),v.massGlobal=fn(x,"massGlobal",!1),v.windGlobal=fn(x,"windGlobal",!1),v.gravityGlobal=fn(x,"gravityGlobal",!1),v.mixGlobal=fn(x,"mixGlobal",!1),a.physicsConstraints.push(v)}if(s.skins)for(h=0;h<s.skins.length;h++){var k=s.skins[h],I=new pe(k.name);if(k.bones)for(w=0;w<k.bones.length;w++){var A;b=k.bones[w];if(!(A=a.findBone(b)))throw new Error("Couldn't find bone ".concat(b," for skin ").concat(k.name,"."));I.bones.push(A)}if(k.ik)for(w=0;w<k.ik.length;w++){var C=k.ik[w];if(!(T=a.findIkConstraint(C)))throw new Error("Couldn't find IK constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.transform)for(w=0;w<k.transform.length;w++){C=k.transform[w];if(!(T=a.findTransformConstraint(C)))throw new Error("Couldn't find transform constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.path)for(w=0;w<k.path.length;w++){C=k.path[w];if(!(T=a.findPathConstraint(C)))throw new Error("Couldn't find path constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}if(k.physics)for(w=0;w<k.physics.length;w++){var T;C=k.physics[w];if(!(T=a.findPhysicsConstraint(C)))throw new Error("Couldn't find physics constraint ".concat(C," for skin ").concat(k.name,"."));I.constraints.push(T)}for(var f in k.attachments){var E=a.findSlot(f);if(!E)throw new Error("Couldn't find slot ".concat(f," for skin ").concat(k.name,"."));var F=k.attachments[f];for(var B in F){var Y=this.readAttachment(F[B],I,E.index,B,a);Y&&I.setAttachment(E.index,B,Y)}}a.skins.push(I),"default"==I.name&&(a.defaultSkin=I)}h=0;for(var R=this.linkedMeshes.length;h<R;h++){var P=this.linkedMeshes[h];if(!(I=P.skin?a.findSkin(P.skin):a.defaultSkin))throw new Error("Skin not found: ".concat(P.skin));var X=I.getAttachment(P.slotIndex,P.parent);if(!X)throw new Error("Parent mesh not found: ".concat(P.parent));P.mesh.timelineAttachment=P.inheritTimeline?X:P.mesh,P.mesh.setParentMesh(X),null!=P.mesh.region&&P.mesh.updateRegion()}if(this.linkedMeshes.length=0,s.events)for(var V in s.events){var D=s.events[V];(v=new te(V)).intValue=fn(D,"int",0),v.floatValue=fn(D,"float",0),v.stringValue=fn(D,"string",""),v.audioPath=fn(D,"audio",null),v.audioPath&&(v.volume=fn(D,"volume",1),v.balance=fn(D,"balance",0)),a.events.push(v)}if(s.animations)for(var L in s.animations){var N=s.animations[L];this.readAnimation(N,L,a)}return a},e.prototype.readAttachment=function(t,e,n,i,r){var a=this.scale;switch(i=fn(t,"name",i),fn(t,"type","region")){case"region":var s=fn(t,"path",i),o=this.readSequence(fn(t,"sequence",null)),h=this.attachmentLoader.newRegionAttachment(e,i,s,o);return h?(h.path=s,h.x=fn(t,"x",0)*a,h.y=fn(t,"y",0)*a,h.scaleX=fn(t,"scaleX",1),h.scaleY=fn(t,"scaleY",1),h.rotation=fn(t,"rotation",0),h.width=t.width*a,h.height=t.height*a,h.sequence=o,(w=fn(t,"color",null))&&h.color.setFromString(w),null!=h.region&&h.updateRegion(),h):null;case"boundingbox":var l=this.attachmentLoader.newBoundingBoxAttachment(e,i);return l?(this.readVertices(t,l,t.vertexCount<<1),(w=fn(t,"color",null))&&l.color.setFromString(w),l):null;case"mesh":case"linkedmesh":s=fn(t,"path",i),o=this.readSequence(fn(t,"sequence",null));var c=this.attachmentLoader.newMeshAttachment(e,i,s,o);if(!c)return null;c.path=s,(w=fn(t,"color",null))&&c.color.setFromString(w),c.width=fn(t,"width",0)*a,c.height=fn(t,"height",0)*a,c.sequence=o;var u=fn(t,"parent",null);if(u)return this.linkedMeshes.push(new ln(c,fn(t,"skin",null),n,u,fn(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=fn(t,"edges",null),c.hullLength=2*fn(t,"hull",0),c;case"path":if(!(s=this.attachmentLoader.newPathAttachment(e,i)))return null;s.closed=fn(t,"closed",!1),s.constantSpeed=fn(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=fn(t,"color",null))&&s.color.setFromString(w),s;case"point":var v=this.attachmentLoader.newPointAttachment(e,i);return v?(v.x=fn(t,"x",0)*a,v.y=fn(t,"y",0)*a,v.rotation=fn(t,"rotation",0),(w=fn(t,"color",null))&&v.color.setFromString(w),v):null;case"clipping":var y=this.attachmentLoader.newClippingAttachment(e,i);if(!y)return null;var x=fn(t,"end",null);x&&(y.endSlot=r.findSlot(x));var w;f=t.vertexCount;return this.readVertices(t,y,f<<1),(w=fn(t,"color",null))&&y.color.setFromString(w),y}return null},e.prototype.readSequence=function(t){if(null==t)return null;var e=new k(fn(t,"count",0));return e.start=fn(t,"start",1),e.digits=fn(t,"digits",0),e.setupIndex=fn(t,"setup",0),e},e.prototype.readVertices=function(t,e,n){var i=this.scale;e.worldVerticesLength=n;var r=t.vertices;if(n!=r.length){var a=new Array,s=new Array;for(c=0,u=r.length;c<u;){var o=r[c++];s.push(o);for(var h=c+4*o;c<h;c+=4)s.push(r[c]),a.push(r[c+1]*i),a.push(r[c+2]*i),a.push(r[c+3])}e.bones=s,e.vertices=g.toFloatArray(a)}else{var l=g.toFloatArray(r);if(1!=i)for(var c=0,u=r.length;c<u;c++)l[c]*=i;e.vertices=l}},e.prototype.readAnimation=function(e,n,i){var r=this.scale,a=new Array;if(e.slots)for(var s in e.slots){var o=e.slots[s];if(!(de=i.findSlot(s)))throw new Error("Slot not found: "+s);var l=de.index;for(var c in o){if(qt=o[c]){var d=qt.length;if("attachment"==c){for(var f=new Q(d,l),p=0;p<d;p++){var m=qt[p];f.setFrame(p,fn(m,"time",0),fn(m,"name",null))}a.push(f)}else if("rgba"==c){f=new G(d,d<<2,l);for(var v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}var w=fn(Gt,"time",0),b=u.fromString(Gt.color);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,y.a,b.a,1)),v=w,y=b,m=Gt}a.push(f)}else if("rgb"==c){for(f=new H(d,3*d,l),v=fn(m=qt[0],"time",0),y=u.fromString(m.color),p=0,x=0;;p++){if(f.setFrame(p,v,y.r,y.g,y.b),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.color);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1)),v=w,y=b,m=Gt}a.push(f)}else if("alpha"==c)a.push(cn(qt,new j(d,d,l),0,1));else if("rgba2"==c){f=new J(d,7*d,l),v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.light);var S=u.fromString(Gt.dark);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,y.a,b.a,1),x=dn(Zt,f,x,p,4,v,w,M.r,S.r,1),x=dn(Zt,f,x,p,5,v,w,M.g,S.g,1),x=dn(Zt,f,x,p,6,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=Gt}a.push(f)}else if("rgb2"==c){for(f=new K(d,6*d,l),v=fn(m=qt[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),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),b=u.fromString(Gt.light),S=u.fromString(Gt.dark);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,y.r,b.r,1),x=dn(Zt,f,x,p,1,v,w,y.g,b.g,1),x=dn(Zt,f,x,p,2,v,w,y.b,b.b,1),x=dn(Zt,f,x,p,3,v,w,M.r,S.r,1),x=dn(Zt,f,x,p,4,v,w,M.g,S.g,1),x=dn(Zt,f,x,p,5,v,w,M.b,S.b,1)),v=w,y=b,M=S,m=Gt}a.push(f)}}}}if(e.bones)for(var k in e.bones){var I=e.bones[k],A=i.findBone(k);if(!A)throw new Error("Bone not found: "+k);var C=A.index;for(var c in I){var E=(qt=I[c]).length;if(0!=E)if("rotate"===c)a.push(cn(qt,new X(E,E,C),0,1));else if("translate"===c){f=new V(E,E<<1,C);a.push(un(qt,f,"x","y",0,r))}else if("translatex"===c){f=new D(E,E,C);a.push(cn(qt,f,0,r))}else if("translatey"===c){f=new L(E,E,C);a.push(cn(qt,f,0,r))}else if("scale"===c){f=new N(E,E<<1,C);a.push(un(qt,f,"x","y",1,1))}else if("scalex"===c){f=new O(E,E,C);a.push(cn(qt,f,1,1))}else if("scaley"===c){f=new _(E,E,C);a.push(cn(qt,f,1,1))}else if("shear"===c){f=new q(E,E<<1,C);a.push(un(qt,f,"x","y",0,1))}else if("shearx"===c){f=new W(E,E,C);a.push(cn(qt,f,0,1))}else if("sheary"===c){f=new U(E,E,C);a.push(cn(qt,f,0,1))}else if("inherit"===c){for(f=new z(E,A.index),p=0;p<qt.length;p++){var F=qt[p];f.setFrame(p,fn(F,"time",0),g.enumValue(t.Inherit,fn(F,"inherit","Normal")))}a.push(f)}}}if(e.ik)for(var B in e.ik){if(m=(Et=e.ik[B])[0]){if(!(Bt=i.findIkConstraint(B)))throw new Error("IK Constraint not found: "+B);var Y=i.ikConstraints.indexOf(Bt),R=(f=new et(Et.length,Et.length<<1,Y),v=fn(m,"time",0),fn(m,"mix",1)),P=fn(m,"softness",0)*r;for(p=0,x=0;;p++){if(f.setFrame(p,v,R,P,fn(m,"bendPositive",!0)?1:-1,fn(m,"compress",!1),fn(m,"stretch",!1)),!(Gt=Et[p+1])){f.shrink(x);break}w=fn(Gt,"time",0);var st=fn(Gt,"mix",1),gt=fn(Gt,"softness",0)*r;(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,R,st,1),x=dn(Zt,f,x,p,1,v,w,P,gt,r)),v=w,R=st,P=gt,m=Gt}a.push(f)}}if(e.transform)for(var B in e.transform){if(m=(qt=e.transform[B])[0]){if(!(Bt=i.findTransformConstraint(B)))throw new Error("Transform constraint not found: "+B);Y=i.transformConstraints.indexOf(Bt),f=new nt(qt.length,6*qt.length,Y),v=fn(m,"time",0);var vt=fn(m,"mixRotate",1),yt=fn(m,"mixX",1),xt=fn(m,"mixY",yt),wt=fn(m,"mixScaleX",1),bt=fn(m,"mixScaleY",wt),Mt=fn(m,"mixShearY",1);for(p=0,x=0;;p++){if(f.setFrame(p,v,vt,yt,xt,wt,bt,Mt),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0);var St=fn(Gt,"mixRotate",1),kt=fn(Gt,"mixX",1),It=fn(Gt,"mixY",kt),At=fn(Gt,"mixScaleX",1),Ct=fn(Gt,"mixScaleY",At),Tt=fn(Gt,"mixShearY",1);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,vt,St,1),x=dn(Zt,f,x,p,1,v,w,yt,kt,1),x=dn(Zt,f,x,p,2,v,w,xt,It,1),x=dn(Zt,f,x,p,3,v,w,wt,At,1),x=dn(Zt,f,x,p,4,v,w,bt,Ct,1),x=dn(Zt,f,x,p,5,v,w,Mt,Tt,1)),v=w,vt=St,yt=kt,xt=It,wt=At,bt=Ct,wt=At,m=Gt}a.push(f)}}if(e.path)for(var B in e.path){var Et=e.path[B];if(!(Bt=i.findPathConstraint(B)))throw new Error("Path constraint not found: "+B);Y=i.pathConstraints.indexOf(Bt);for(var c in Et){if(m=(qt=Et[c])[0]){var Ft=qt.length;if("position"===c){f=new it(Ft,Ft,Y);a.push(cn(qt,f,0,Bt.positionMode==t.PositionMode.Fixed?r:1))}else if("spacing"===c){f=new rt(Ft,Ft,Y);a.push(cn(qt,f,0,Bt.spacingMode==t.SpacingMode.Length||Bt.spacingMode==t.SpacingMode.Fixed?r:1))}else if("mix"===c){for(f=new at(Ft,3*Ft,Y),v=fn(m,"time",0),vt=fn(m,"mixRotate",1),yt=fn(m,"mixX",1),xt=fn(m,"mixY",yt),p=0,x=0;;p++){if(f.setFrame(p,v,vt,yt,xt),!(Gt=qt[p+1])){f.shrink(x);break}w=fn(Gt,"time",0),St=fn(Gt,"mixRotate",1),kt=fn(Gt,"mixX",1),It=fn(Gt,"mixY",kt);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,vt,St,1),x=dn(Zt,f,x,p,1,v,w,yt,kt,1),x=dn(Zt,f,x,p,2,v,w,xt,It,1)),v=w,vt=St,yt=kt,xt=It,m=Gt}a.push(f)}}}}if(e.physics)for(var B in e.physics){Et=e.physics[B],Y=-1;if(B.length>0){var Bt;if(!(Bt=i.findPhysicsConstraint(B)))throw new Error("Physics constraint not found: "+B);Y=i.physicsConstraints.indexOf(Bt)}for(var c in Et){if(m=(qt=Et[c])[0]){var Yt=qt.length;if("reset"!=c){f=void 0;if("inertia"==c)f=new ot(Yt,Yt,Y);else if("strength"==c)f=new ht(Yt,Yt,Y);else if("damping"==c)f=new lt(Yt,Yt,Y);else if("mass"==c)f=new ct(Yt,Yt,Y);else if("wind"==c)f=new ut(Yt,Yt,Y);else if("gravity"==c)f=new dt(Yt,Yt,Y);else{if("mix"!=c)continue;f=new ft(Yt,Yt,Y)}a.push(cn(qt,f,0,1))}else{var Rt=new pt(Yt,Y);for(p=0;null!=m;m=qt[p+1],p++)Rt.setFrame(p,fn(m,"time",0));a.push(Rt)}}}}if(e.attachments)for(var Pt in e.attachments){var Xt=e.attachments[Pt],Vt=i.findSkin(Pt);if(!Vt)throw new Error("Skin not found: "+Pt);for(var Dt in Xt){o=Xt[Dt];if(!(de=i.findSlot(Dt)))throw new Error("Slot not found: "+Dt);l=de.index;for(var Lt in o){var Nt=o[Lt],Ot=Vt.getAttachment(l,Lt);for(var _t in Nt){var qt;if(m=(qt=Nt[_t])[0])if("deform"==_t){var Wt=Ot.bones,Ut=Ot.vertices,zt=Wt?Ut.length/3*2:Ut.length;for(f=new Z(qt.length,qt.length,l,Ot),v=fn(m,"time",0),p=0,x=0;;p++){var Gt,Ht=void 0,jt=fn(m,"vertices",null);if(jt){Ht=g.newFloatArray(zt);var Jt=fn(m,"offset",0);if(g.arrayCopy(jt,0,Ht,Jt,jt.length),1!=r)for(var Kt=(Qt=Jt)+jt.length;Qt<Kt;Qt++)Ht[Qt]*=r;if(!Wt)for(var Qt=0;Qt<zt;Qt++)Ht[Qt]+=Ut[Qt]}else Ht=Wt?g.newFloatArray(zt):Ut;if(f.setFrame(p,v,Ht),!(Gt=qt[p+1])){f.shrink(x);break}var Zt;w=fn(Gt,"time",0);(Zt=m.curve)&&(x=dn(Zt,f,x,p,0,v,w,0,1,1)),v=w,m=Gt}a.push(f)}else if("sequence"==_t){f=new mt(qt.length,l,Ot);var te=0;for(p=0;p<qt.length;p++){var ee=fn(m,"delay",te),ne=(v=fn(m,"time",0),h[fn(m,"mode","hold")]),ie=fn(m,"index",0);f.setFrame(p,v,ne,ie,ee),te=ee,m=qt[p+1]}a.push(f)}}}}}if(e.drawOrder){f=new tt(e.drawOrder.length);var re=i.slots.length;for(p=0,Qt=0;Qt<e.drawOrder.length;Qt++,p++){var ae=e.drawOrder[Qt],se=null,oe=fn(ae,"offsets",null);if(oe){se=g.newArray(re,-1);for(var he=g.newArray(re-oe.length,0),le=0,ce=0,ue=0;ue<oe.length;ue++){var de,fe=oe[ue];if(!(de=i.findSlot(fe.slot)))throw new Error("Slot not found: "+de);for(l=de.index;le!=l;)he[ce++]=le++;se[le+fe.offset]=le++}for(;le<re;)he[ce++]=le++;for(ue=re-1;ue>=0;ue--)-1==se[ue]&&(se[ue]=he[--ce])}f.setFrame(p,fn(ae,"time",0),se)}a.push(f)}if(e.events){for(f=new $(e.events.length),p=0,Qt=0;Qt<e.events.length;Qt++,p++){var pe=e.events[Qt],me=i.findEvent(pe.name);if(!me)throw new Error("Event not found: "+pe.name);var ge=new $t(g.toSinglePrecision(fn(pe,"time",0)),me);ge.intValue=fn(pe,"int",me.intValue),ge.floatValue=fn(pe,"float",me.floatValue),ge.stringValue=fn(pe,"string",me.stringValue),ge.data.audioPath&&(ge.volume=fn(pe,"volume",1),ge.balance=fn(pe,"balance",0)),f.setFrame(p,ge)}a.push(f)}var ve=0;for(Qt=0,Kt=a.length;Qt<Kt;Qt++)ve=Math.max(ve,a[Qt].getDuration());i.animations.push(new T(n,a,ve))},e}(),ln=function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritTimeline=r};function cn(t,e,n,i){for(var r=t[0],a=fn(r,"time",0),s=fn(r,"value",n)*i,o=0,h=0;;h++){e.setFrame(h,a,s);var l=t[h+1];if(!l)return e.shrink(o),e;var c=fn(l,"time",0),u=fn(l,"value",n)*i;r.curve&&(o=dn(r.curve,e,o,h,0,a,c,s,u,i)),a=c,s=u,r=l}}function un(t,e,n,i,r,a){for(var s=t[0],o=fn(s,"time",0),h=fn(s,n,r)*a,l=fn(s,i,r)*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=fn(d,"time",0),p=fn(d,n,r)*a,m=fn(d,i,r)*a,g=s.curve;g&&(c=dn(g,e,c,u,0,o,f,h,p,a),c=dn(g,e,c,u,1,o,f,l,m,a)),o=f,h=p,l=m,s=d}}function dn(t,e,n,i,r,a,s,o,h,l){if("stepped"==t)return e.setStepped(i),n;var c=r<<2,u=t[c],d=t[c+1]*l,f=t[c+2],p=t[c+3]*l;return e.setBezier(n,i,r,a,o,u,d,f,p,s,h),n+1}function fn(t,e,n){return void 0!==t[e]?t[e]:n}function pn(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);return decodeURIComponent(encodeURIComponent(e))}function mn(t,e,n){var i,r=new Ut(t);if("skel"===n){i=new ye(r);var a=new xe(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 i=new hn(r);return i.readSkeletonData(e)}function gn(t){return t.animations.map((function(t){return t.name}))}function vn(t,n){var i=t.findAnimation(n);return e.assertExist(i),i.duration}function yn(t){return t.skins.filter((function(t){return"default"!==t.name})).map((function(t){return t.name}))}function xn(t){var e=pn(new Uint8Array(t));return new Vt(e)}function wn(t,e){var n=new Uint8Array(t);return"json"===e?pn(n):new DataView(n.buffer)}void 0===Math.fround&&(Math.fround=(Ie=new Float32Array(1),function(t){return Ie[0]=t,Ie[0]}));var bn=1,Mn=function(){function n(t){this.verticesLength=0,this.indicesLength=0;var n=t.blendMode,i=t.texture,r=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=i,this.priority=r,this.engine=l,this.geometry=this.createGeometry(),this.material=this.createMaterial(s,f,u),this.mesh=e.Mesh.create(l,{name:h+bn++,priority:this.priority,material:this.material,geometry:this.geometry}),this.vertices=new Float32Array(Sn.MAX_VERTICES*Sn.VERTEX_SIZE),this.indices=new Uint16Array(Sn.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*Sn.VERTEX_SIZE,i={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:i,indices:{data:new Uint16Array(0),releasable:!0},mode:e.glContext.TRIANGLES,maxVertex:Sn.MAX_VERTICES})},n.prototype.createMaterial=function(n,i,r){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!==r?[r,r]:void 0,function(n,i,r){switch(n.blendEquation=[e.glContext.FUNC_ADD,e.glContext.FUNC_ADD],i){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=[r?e.glContext.ONE:e.glContext.SRC_ALPHA,e.glContext.ONE,e.glContext.ONE,e.glContext.ONE];break;case t.BlendMode.Normal:n.blendFunction=[r?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(i))}}(l,this.blendMode,n),e.setMaskMode(l,i),l},n.prototype.updateMesh=function(t,e,n){if(!this.vertices||!this.indices)throw new Error("Can not update SpineMesh after dispose");var i=this.verticesLength,r=this.indicesLength,a=this.verticesLength/Sn.VERTEX_SIZE;this.vertices.set(t,i),this.verticesLength+=n;for(var s=0,o=r;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 Sn=function(){function t(t,n){this.slotList=[],this.vertices=[],this.clipper=new on,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,i,r=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 Wt){var S=x;w=S.color,h=this.vertices,M=y<<2,S.computeWorldVertices(v,h,0,y),l=t.QUAD_TRIANGLES,i=S.uvs,b=S.region.page.texture}else{if(!(x instanceof Ot)){if(x instanceof Bt){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,i=k.uvs,b=k.region.page.texture}if(b){var I=v.bone.skeleton.color,A=v.color,C=this.tempColor,T=this.tempDark;if(C.set(I.r*A.r*w.r,I.g*A.g*w.g,I.b*A.b*w.b,I.a*A.a*w.a),o&&(C.r*=C.a,C.g*=C.a,C.b*=C.a),v.darkColor?o?(T.r=v.darkColor.r*C.a,T.g=v.darkColor.g*C.a,T.b=v.darkColor.b*C.a,T.a=1):(T.setFromColor(v.darkColor),T.a=0):T.set(0,0,0,1),a.isClipping())a.clipTriangles(h,M,l,l.length,i,C,T,!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]=C.r,h[E+1]=C.g,h[E+2]=C.b,h[E+3]=C.a,h[E+4]=i[F],h[E+5]=i[F+1],h[E+6]=T.r,h[E+7]=T.g,h[E+8]=T.b,h[E+9]=T.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 Mn({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(r.wm)}))},t.prototype.findMeshIndex=function(e,n,i,r){for(var a=-1,s=e;s<this.meshGroups.length;s++){var o=this.meshGroups[s];if(o&&o.blending===n&&o.texture.name===i.name&&r+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}(),kn=e.math.Vector2,In=e.math.Vector3,An=function(n){function r(t,i){var r,a=n.call(this,t,i)||this;a.offset=new kn,a.size=new kn,a._contentVisible=!0;var s=null===(r=a.composition)||void 0===r?void 0:r.renderer.engine;return e.assertExist(s),a.engine=s,a}return i(r,n),Object.defineProperty(r.prototype,"type",{get:function(){return e.spec.ItemType.spine},enumerable:!1,configurable:!0}),r.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},r.prototype.initContent=function(t,e){var n=t.spine;if(!isNaN(n)){var i=e[n],r=i.atlas,a=i.skeletonFile,s=i.skeletonType,o=i.skinList,h=i.animationList,l="string"==typeof t.activeAnimation?[t.activeAnimation]:t.activeAnimation;if(this.skeletonData=mn(r,a,s),this.animationStateData=new Et(this.skeletonData),this.animationStateData.defaultMix=t.mixDuration||0,this.spineDataCache=e[n],this.skinList=o.slice(),this.animationList=h.slice(),this.skeleton=new le(this.skeletonData),this.setSkin(t.activeSkin||(o.length?o[0]:"default")),this.state=new gt(this.animationStateData),this.resizeRule=t.resizeRule,1===l.length)if(isNaN(t.speed)){var c=Number((vn(this.skeletonData,l[0])/this.duration).toFixed(2));this.setAnimation(l[0],c)}else this.setAnimation(l[0],t.speed);else this.setAnimationList(l,t.speed);this.pma=r.pages[0].pma}},r.prototype.doCreateContent=function(){if(this.skeleton)return new Sn(this.skeleton.drawOrder,{listIndex:this.listIndex,meshName:this.name,transform:this.transform,pma:this.pma,renderer:this.renderer,engine:this.engine})},r.prototype.onLifetimeBegin=function(){this.state&&this.skeleton&&(this.state.apply(this.skeleton),this.resize(),this.updateState(0))},r.prototype.onItemUpdate=function(t,e){var n=this.content;if(n){var i=this.contentVisible;n.meshGroups.map((function(t){t.mesh.setVisible(i)})),i&&this.updateState(t/1e3)}},r.prototype.onItemRemoved=function(){var t=this.content;t&&t.meshGroups.map((function(t){t.dispose()}))},r.prototype.onEnd=function(){this.endBehavior===e.spec.END_BEHAVIOR_DESTROY&&this.state&&(this.state.clearListeners(),this.state.clearTracks())},r.prototype.handleVisibleChanged=function(t){this.content&&this.content.meshGroups.map((function(e){e.mesh.setVisible(t)}))},r.prototype.getBoundingBox=function(){var t=this.getBounds(),n={type:e.HitTestType.triangle,area:[]};if(!t)return n;var i=t.x,r=t.y,a=t.width,s=t.height,o=this.transform.getWorldMatrix(),h=i+a/2,l=r+s/2,c=new In(h-a/2,l-s/2,0),u=new In(h+a/2,l-s/2,0),d=new In(h+a/2,l+s/2,0),f=new In(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},r.prototype.getHitTestParams=function(t){var n,i=this.getBoundingBox(),r=null===(n=this.engine.renderer)||void 0===n?void 0:n.env;if(i.area.length)return t&&r===e.PLAYER_OPTIONS_ENV_EDITOR?{type:e.HitTestType.triangle,triangles:i.area,backfaceCulling:!1,behavior:e.spec.InteractBehavior.NOTIFY}:void 0},r.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())},r.prototype.setAnimation=function(t,n){var i;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 r=this.endBehavior===e.spec.ItemEndBehavior.loop,a=null===(i=this.state.tracks[0])||void 0===i?void 0:i.listener;a&&(a.end=function(){}),this.state.setEmptyAnimation(0),this.animationList.includes(t)?(this.state.setAnimation(0,t,r),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],r),this.activeAnimation=[this.animationList[0]]),isNaN(n)||this.setSpeed(n)},r.prototype.setAnimationList=function(t,n){var i,r,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 i={end:function(){o.state.addAnimation(0,t,!1).listener=i}};n.listener=i}},c=this;try{for(var u=s(t),d=u.next();!d.done;d=u.next()){l(d.value)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}this.activeAnimation=t,isNaN(n)||this.setSpeed(n)}else this.setAnimation(t[0],n)},r.prototype.setSpeed=function(t){this.state&&(this.state.timeScale=t)},r.prototype.getSpeed=function(){return this.state.timeScale||1},r.prototype.getActiveAnimation=function(){return this.activeAnimation},r.prototype.setMixDuration=function(t,e,n){this.animationStateData&&this.animationStateData.setMix(t,e,n)},r.prototype.setDefaultMixDuration=function(t){this.state&&(this.animationStateData.defaultMix=t,this.state.tracks[0]&&(this.state.tracks[0].mixDuration=t))},r.prototype.deleteMixForLoop=function(){var t=this.activeAnimation[this.activeAnimation.length-1],e=this.activeAnimation[0];this.animationStateData.setMix(t,e,0)},r.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()},r.prototype.resize=function(){var t=this.getBounds();if(t&&this.composition){var e,n=this.transform.scale,i=t.width;if(this.resizeRule){var r=this.transform.getWorldPosition().z;e=this.composition.camera.getInverseVPRatio(r).x/1500}else e=1/i;this.scaleFactor=e,this.transform.setScale(this.startSize*e,this.startSize*e,n.z)}},r.prototype.setScale=function(t,e,n){var i=this.transform.scale,r=i.x,a=i.y,s=i.z;this.transform.setScale(r*t,a*e,s*n)},r.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}},r}(e.VFXItem),Cn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.slotGroups=[],e.meshToRemove=[],e}return i(n,t),n.processRawJSON=function(t,e){return r(this,void 0,void 0,(function(){return a(this,(function(t){return[2,Promise.resolve()]}))}))},n.prepareResource=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r,h,l,c,u,d,f,p,m,g,v,y,x,w,b,M,S,k,I,A,C,T,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");i=[],r=e.bins;try{for(h=s(n.spines),l=h.next();!l.done;l=h.next())(c=l.value).spineData?i.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?r[x].slice(b,b+M):r[x].slice(b),k=o(d[1],3),I=k[0],A=k[1],C=void 0===A?0:A,T=k[2],E=T?r[I].slice(C,C+T):r[I].slice(C),F=xn(S),B=wn(E,p),Y=mn(F,B,p),R=yn(Y),P=gn(Y),i.push({atlas:F,skeletonFile:B,skeletonData:Y,images:f,texturesOptions:v,skeletonType:p,skeletonInstance:new le(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=i,[2]}))}))},n.prototype.onCompositionConstructed=function(t,e){this.slotGroups=[];var n=t.textures;if(e.jsonScene.spines){var i=e.jsonScene.spines;i.map((function(t,e){var i=t.atlas,r=t.images,a=i.pages.length;if(r.length!==a)throw new Error("atlas.page's length not equal spine.textures' length");for(var s=0;s<a;s++){var o=i.pages[s],h=n[r[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=i}},n.prototype.onCompositionItemLifeBegin=function(t,e){e instanceof An&&e.content&&this.slotGroups.push(e.content)},n.prototype.onCompositionItemRemoved=function(t,e){var n;if(e instanceof An&&e.content){e.spineDataCache=void 0;var i=e.content;i&&((n=this.meshToRemove).push.apply(n,function(t,e,n){if(n||2===arguments.length)for(var i,r=0,a=e.length;r<a;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}([],o(i.meshGroups),!1)),this.slotGroups.splice(this.slotGroups.indexOf(i),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",Cn,An);var Tn="1.5.2";e.logger.info("plugin spine version: "+Tn),t.AlphaTimeline=j,t.Animation=T,t.AnimationState=gt,t.AnimationStateAdapter=bt,t.AnimationStateData=Et,t.AssetManagerBase=Qt,t.AtlasAttachmentLoader=Ut,t.Attachment=M,t.AttachmentTimeline=Q,t.BinaryInput=xe,t.Bone=Jt,t.BoneData=zt,t.BoundingBoxAttachment=Ft,t.CURRENT=Tt,t.ClippingAttachment=Bt,t.Color=u,t.ConstraintData=Kt,t.CurveTimeline=Y,t.CurveTimeline1=R,t.CurveTimeline2=P,t.DebugUtils=v,t.DeformTimeline=Z,t.Downloader=Zt,t.DrawOrderTimeline=tt,t.Event=$t,t.EventData=te,t.EventQueue=yt,t.EventTimeline=$,t.FIRST=St,t.FakeTexture=Xt,t.HOLD_FIRST=It,t.HOLD_MIX=At,t.HOLD_SUBSEQUENT=kt,t.IkConstraint=ee,t.IkConstraintData=ne,t.IkConstraintTimeline=et,t.InheritTimeline=z,t.IntSet=l,t.Interpolation=f,t.MathUtils=d,t.MeshAttachment=Ot,t.PathAttachment=_t,t.PathConstraint=ae,t.PathConstraintData=ie,t.PathConstraintMixTimeline=at,t.PathConstraintPositionTimeline=it,t.PathConstraintSpacingTimeline=rt,t.PhysicsConstraintDampingTimeline=lt,t.PhysicsConstraintGravityTimeline=dt,t.PhysicsConstraintInertiaTimeline=ot,t.PhysicsConstraintMassTimeline=ct,t.PhysicsConstraintMixTimeline=ft,t.PhysicsConstraintResetTimeline=pt,t.PhysicsConstraintStrengthTimeline=ht,t.PhysicsConstraintTimeline=st,t.PhysicsConstraintWindTimeline=ut,t.PointAttachment=qt,t.Pool=y,t.Pow=p,t.PowOut=m,t.RGB2Timeline=K,t.RGBA2Timeline=J,t.RGBATimeline=G,t.RGBTimeline=H,t.RegionAttachment=Wt,t.RotateTimeline=X,t.SETUP=Ct,t.SUBSEQUENT=Mt,t.ScaleTimeline=N,t.ScaleXTimeline=O,t.ScaleYTimeline=_,t.SequenceTimeline=mt,t.ShearTimeline=q,t.ShearXTimeline=W,t.ShearYTimeline=U,t.Skeleton=le,t.SkeletonBinary=ye,t.SkeletonBounds=an,t.SkeletonClipping=on,t.SkeletonData=de,t.SkeletonJson=hn,t.Skin=pe,t.SkinEntry=fe,t.Slot=oe,t.SlotData=me,t.SpineLoader=Cn,t.SpineVFXItem=An,t.StringSet=c,t.Texture=Yt,t.TextureAtlas=Vt,t.TextureAtlasPage=Lt,t.TextureAtlasRegion=Nt,t.TextureRegion=Pt,t.TimeKeeper=w,t.Timeline=B,t.TrackEntry=vt,t.TransformConstraint=he,t.TransformConstraintData=ve,t.TransformConstraintTimeline=nt,t.TranslateTimeline=V,t.TranslateXTimeline=D,t.TranslateYTimeline=L,t.Triangulator=sn,t.Utils=g,t.Vector2=x,t.VertexAttachment=S,t.WindowedMean=b,t.createSkeletonData=mn,t.getAnimationDuration=vn,t.getAnimationList=gn,t.getAtlasFromBuffer=xn,t.getSkeletonFromBuffer=wn,t.getSkinList=yn,t.getSpineVersion=function(t){var e=new xe(t);return e.readInt32(),e.readInt32(),e.readString()},t.getTextureOptions=function(e){var n,i,r=pn(new Uint8Array(e,0)),a=new Vt(r),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&&(i=l.return)&&i.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=Tn,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.5.0
6
+ * Version: v1.5.2
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';
@@ -13183,7 +13183,7 @@ var SpineLoader = /** @class */ (function (_super) {
13183
13183
  }(AbstractPlugin));
13184
13184
 
13185
13185
  registerPlugin('spine', SpineLoader, SpineVFXItem);
13186
- var version = "1.5.0";
13186
+ var version = "1.5.2";
13187
13187
  logger.info('plugin spine version: ' + version);
13188
13188
 
13189
13189
  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, Inherit, InheritTimeline, 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, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, Triangulator, Utils, Vector2$1 as Vector2, VertexAttachment, WindowedMean, createSkeletonData, getAnimationDuration, getAnimationList, getAtlasFromBuffer, getSkeletonFromBuffer, getSkinList, getSpineVersion, getTextureOptions, version };
@@ -24,8 +24,9 @@ export declare class SpineVFXItem extends VFXItem<SpineContent> {
24
24
  */
25
25
  private size;
26
26
  /**
27
- * 是否使用新的默认大小计算规则:相机逆投影 + 固定画布大小
28
- * 旧版规则:除以包围盒大小
27
+ * 默认大小计算规则
28
+ * 1: 相机逆投影 + 固定画布大小
29
+ * 0: 除以包围盒大小
29
30
  */
30
31
  private resizeRule;
31
32
  startSize: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-spine",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Galacean Effects player spine plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "fpsmeter": "^0.3.1",
37
- "@galacean/effects": "1.5.0"
37
+ "@galacean/effects": "1.5.2"
38
38
  },
39
39
  "dependencies": {
40
40
  "@esotericsoftware/spine-core": "~4.2.43"