-
Notifications
You must be signed in to change notification settings - Fork 0
/
pixi-spine.min.js
3 lines (2 loc) · 56 KB
/
pixi-spine.min.js
1
2
3
!function t(e,n,i){function r(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var m=n[o]={exports:{}};e[o][0].call(m.exports,function(t){var n=e[o][1][t];return r(n?n:t)},m,m.exports,t,e,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(t,e,n){e.exports=PIXI.spine={Spine:t("./Spine"),SpineRuntime:t("./SpineRuntime"),loaders:t("./loaders")}},{"./Spine":43,"./SpineRuntime":41,"./loaders":46}],2:[function(t,e,n){var i=t("../SpineUtil");i.Animation=function(t,e,n){this.name=t,this.timelines=e,this.duration=n},i.Animation.prototype={apply:function(t,e,n,i,r){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var a=this.timelines,o=0,s=a.length;s>o;o++)a[o].apply(t,e,n,r,1)},mix:function(t,e,n,i,r,a){i&&0!=this.duration&&(n%=this.duration,e%=this.duration);for(var o=this.timelines,s=0,l=o.length;l>s;s++)o[s].apply(t,e,n,r,a)}},i.Animation.binarySearch=function(t,e,n){var i=0,r=Math.floor(t.length/n)-2;if(!r)return n;for(var a=r>>>1;;){if(t[(a+1)*n]<=e?i=a+1:r=a,i==r)return(i+1)*n;a=i+r>>>1}},i.Animation.binarySearch1=function(t,e){var n=0,i=t.length-2;if(!i)return 1;for(var r=i>>>1;;){if(t[r+1]<=e?n=r+1:i=r,n==i)return n+1;r=n+i>>>1}},i.Animation.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;r>=i;i+=n)if(t[i]>e)return i;return-1},e.exports=i.Animation},{"../SpineUtil":42}],3:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=t("./TrackEntry"),i.AnimationState=function(t){this.data=t,this.tracks=[],this.events=[]},i.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(t){t*=this.timeScale;for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){if(n.time+=t*n.timeScale,n.previous){var i=t*n.previous.timeScale;n.previous.time+=i,n.mixTime+=i}var r=n.next;r?(r.time=n.lastTime-r.delay,r.time>=0&&this.setCurrent(e,r)):!n.loop&&n.lastTime>=n.endTime&&this.clearTrack(e)}}},apply:function(t){t.resetDrawOrder();for(var e=0;e<this.tracks.length;e++){var n=this.tracks[e];if(n){this.events.length=0;var i=n.time,r=n.lastTime,a=n.endTime,o=n.loop;!o&&i>a&&(i=a);var s=n.previous;if(s){var l=s.time;!s.loop&&l>s.endTime&&(l=s.endTime),s.animation.apply(t,l,l,s.loop,null);var h=n.mixTime/n.mixDuration*n.mix;h>=1&&(h=1,n.previous=null),n.animation.mix(t,n.lastTime,i,o,this.events,h)}else 1==n.mix?n.animation.apply(t,n.lastTime,i,o,this.events):n.animation.mix(t,n.lastTime,i,o,this.events,n.mix);for(var m=0,u=this.events.length;u>m;m++){var f=this.events[m];n.onEvent&&n.onEvent(e,f),this.onEvent&&this.onEvent(e,f)}if(o?r%a>i%a:a>r&&i>=a){var c=Math.floor(i/a);n.onComplete&&n.onComplete(e,c),this.onComplete&&this.onComplete(e,c)}n.lastTime=n.time}}},clearTracks:function(){for(var t=0,e=this.tracks.length;e>t;t++)this.clearTrack(t);this.tracks.length=0},clearTrack:function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null)}},_expandToIndex:function(t){if(t<this.tracks.length)return this.tracks[t];for(;t>=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(t,e){var n=this._expandToIndex(t);if(n){var i=n.previous;n.previous=null,n.onEnd&&n.onEnd(t),this.onEnd&&this.onEnd(t),e.mixDuration=this.data.getMix(n.animation,e.animation),e.mixDuration>0&&(e.mixTime=0,e.previous=i&&n.mixTime/n.mixDuration<.5?i:n)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},setAnimationByName:function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(!i)throw"Animation not found: "+e;return this.setAnimation(t,i,n)},setAnimation:function(t,e,n){var r=new i.TrackEntry;return r.animation=e,r.loop=n,r.endTime=e.duration,this.setCurrent(t,r),r},addAnimationByName:function(t,e,n,i){var r=this.data.skeletonData.findAnimation(e);if(!r)throw"Animation not found: "+e;return this.addAnimation(t,r,n,i)},addAnimation:function(t,e,n,r){var a=new i.TrackEntry;a.animation=e,a.loop=n,a.endTime=e.duration;var o=this._expandToIndex(t);if(o){for(;o.next;)o=o.next;o.next=a}else this.tracks[t]=a;return 0>=r&&(o?r+=o.endTime-this.data.getMix(o.animation,e):r=0),a.delay=r,a},getCurrent:function(t){return t>=this.tracks.length?null:this.tracks[t]}},e.exports=i.AnimationState},{"../SpineUtil":42,"./TrackEntry":39}],4:[function(t,e,n){var i=t("../SpineUtil");i.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},i.AnimationStateData.prototype={defaultMix:0,setMixByName:function(t,e,n){var i=this.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;var r=this.skeletonData.findAnimation(e);if(!r)throw"Animation not found: "+e;this.setMix(i,r,n)},setMix:function(t,e,n){this.animationToMixTime[t.name+":"+e.name]=n},getMix:function(t,e){var n=t.name+":"+e.name;return this.animationToMixTime.hasOwnProperty(n)?this.animationToMixTime[n]:this.defaultMix}},e.exports=i.AnimationStateData},{"../SpineUtil":42}],5:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=t("./AtlasReader"),i.AtlasPage=t("./AtlasPage"),i.AtlasRegion=t("./AtlasRegion"),i.Atlas=function(t,e,n){e&&e.indexOf("/")!==e.length&&(e+="/"),this.pages=[],this.regions=[],this.texturesLoading=0;var r=new i.AtlasReader(t),a=[];a.length=4;for(var o=null;;){var s=r.readLine();if(null===s)break;if(s=r.trim(s),s.length)if(o){var l=new i.AtlasRegion;l.name=s,l.page=o,l.rotate="true"==r.readValue(),r.readTuple(a);var h=parseInt(a[0]),m=parseInt(a[1]);r.readTuple(a);var u=parseInt(a[0]),f=parseInt(a[1]);l.u=h/o.width,l.v=m/o.height,l.rotate?(l.u2=(h+f)/o.width,l.v2=(m+u)/o.height):(l.u2=(h+u)/o.width,l.v2=(m+f)/o.height),l.x=h,l.y=m,l.width=Math.abs(u),l.height=Math.abs(f),4==r.readTuple(a)&&(l.splits=[parseInt(a[0]),parseInt(a[1]),parseInt(a[2]),parseInt(a[3])],4==r.readTuple(a)&&(l.pads=[parseInt(a[0]),parseInt(a[1]),parseInt(a[2]),parseInt(a[3])],r.readTuple(a))),l.originalWidth=parseInt(a[0]),l.originalHeight=parseInt(a[1]),r.readTuple(a),l.offsetX=parseInt(a[0]),l.offsetY=parseInt(a[1]),l.index=parseInt(r.readValue()),this.regions.push(l)}else{o=new i.AtlasPage,o.name=s,2==r.readTuple(a)&&(o.width=parseInt(a[0]),o.height=parseInt(a[1]),r.readTuple(a)),o.format=i.Atlas.Format[a[0]],r.readTuple(a),o.minFilter=i.Atlas.TextureFilter[a[0]],o.magFilter=i.Atlas.TextureFilter[a[1]];var c=r.readValue();o.uWrap=i.Atlas.TextureWrap.clampToEdge,o.vWrap=i.Atlas.TextureWrap.clampToEdge,"x"==c?o.uWrap=i.Atlas.TextureWrap.repeat:"y"==c?o.vWrap=i.Atlas.TextureWrap.repeat:"xy"==c&&(o.uWrap=o.vWrap=i.Atlas.TextureWrap.repeat),o.rendererObject=PIXI.BaseTexture.fromImage(e+s,n),this.pages.push(o)}else o=null}},i.Atlas.prototype={findRegion:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},dispose:function(){for(var t=this.pages,e=0,n=t.length;n>e;e++)t[e].rendererObject.destroy(!0)},updateUVs:function(t){for(var e=this.regions,n=0,i=e.length;i>n;n++){var r=e[n];r.page==t&&(r.u=r.x/t.width,r.v=r.y/t.height,r.rotate?(r.u2=(r.x+r.height)/t.width,r.v2=(r.y+r.width)/t.height):(r.u2=(r.x+r.width)/t.width,r.v2=(r.y+r.height)/t.height))}}},i.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},i.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},i.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},e.exports=i.Atlas},{"../SpineUtil":42,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9}],6:[function(t,e,n){var i=t("../SpineUtil");i.RegionAttachment=t("./RegionAttachment"),i.MeshAttachment=t("./MeshAttachment"),i.SkinnedMeshAttachment=t("./SkinnedMeshAttachment"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.AtlasAttachmentParser=function(t){this.atlas=t},i.AtlasAttachmentParser.prototype={newRegionAttachment:function(t,e,n){var r=this.atlas.findRegion(n);if(!r)throw"Region not found in atlas: "+n+" (region attachment: "+e+")";var a=new i.RegionAttachment(e);return a.rendererObject=r,a.setUVs(r.u,r.v,r.u2,r.v2,r.rotate),a.regionOffsetX=r.offsetX,a.regionOffsetY=r.offsetY,a.regionWidth=r.width,a.regionHeight=r.height,a.regionOriginalWidth=r.originalWidth,a.regionOriginalHeight=r.originalHeight,a},newMeshAttachment:function(t,e,n){var r=this.atlas.findRegion(n);if(!r)throw"Region not found in atlas: "+n+" (mesh attachment: "+e+")";var a=new i.MeshAttachment(e);return a.rendererObject=r,a.regionU=r.u,a.regionV=r.v,a.regionU2=r.u2,a.regionV2=r.v2,a.regionRotate=r.rotate,a.regionOffsetX=r.offsetX,a.regionOffsetY=r.offsetY,a.regionWidth=r.width,a.regionHeight=r.height,a.regionOriginalWidth=r.originalWidth,a.regionOriginalHeight=r.originalHeight,a},newSkinnedMeshAttachment:function(t,e,n){var r=this.atlas.findRegion(n);if(!r)throw"Region not found in atlas: "+n+" (skinned mesh attachment: "+e+")";var a=new i.SkinnedMeshAttachment(e);return a.rendererObject=r,a.regionU=r.u,a.regionV=r.v,a.regionU2=r.u2,a.regionV2=r.v2,a.regionRotate=r.rotate,a.regionOffsetX=r.offsetX,a.regionOffsetY=r.offsetY,a.regionWidth=r.width,a.regionHeight=r.height,a.regionOriginalWidth=r.originalWidth,a.regionOriginalHeight=r.originalHeight,a},newBoundingBoxAttachment:function(t,e){return new i.BoundingBoxAttachment(e)}},e.exports=i.AtlasAttachmentParser},{"../SpineUtil":42,"./BoundingBoxAttachment":14,"./MeshAttachment":27,"./RegionAttachment":28,"./SkinnedMeshAttachment":36}],7:[function(t,e,n){var i=t("../SpineUtil");i.AtlasPage=function(){},i.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},e.exports=i.AtlasPage},{"../SpineUtil":42}],8:[function(t,e,n){var i=t("../SpineUtil");i.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},i.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw"Invalid line: "+e;for(var i=0,r=n+1;3>i;i++){var a=e.indexOf(",",r);if(-1==a)break;t[i]=this.trim(e.substr(r,a-r)),r=a+1}return t[i]=this.trim(e.substring(r)),i+1}},e.exports=i.AtlasReader},{"../SpineUtil":42}],9:[function(t,e,n){var i=t("../SpineUtil");i.AtlasRegion=function(){},i.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},e.exports=i.AtlasRegion},{"../SpineUtil":42}],10:[function(t,e,n){var i=t("../SpineUtil");i.Curves=t("./Curves"),i.Animation=t("./Animation"),i.AttachmentTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},i.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},apply:function(t,e,n,r,a){var o=this.frames;if(n<o[0])return void(e>n&&this.apply(t,e,Number.MAX_VALUE,null,0));e>n&&(e=-1);var s=n>=o[o.length-1]?o.length-1:i.Animation.binarySearch1(o,n)-1;if(!(o[s]<e)){var l=this.attachmentNames[s];t.slots[this.slotIndex].setAttachment(l?t.getAttachmentBySlotIndex(this.slotIndex,l):null)}}},e.exports=i.AttachmentTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],11:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},e.exports=i.AttachmentType},{"../SpineUtil":42}],12:[function(t,e,n){var i=t("../SpineUtil");i.Bone=function(t,e,n){this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()},i.Bone.yDown=!1,i.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var t=this.parent;if(t)this.worldX=this.x*t.m00+this.y*t.m01+t.worldX,this.worldY=this.x*t.m10+this.y*t.m11+t.worldY,this.data.inheritScale?(this.worldScaleX=t.worldScaleX*this.scaleX,this.worldScaleY=t.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?t.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=t.worldFlipX!=this.flipX,this.worldFlipY=t.worldFlipY!=this.flipY;else{var e=this.skeleton.flipX,n=this.skeleton.flipY;this.worldX=e?-this.x:this.x,this.worldY=n!=i.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=e!=this.flipX,this.worldFlipY=n!=this.flipY}var r=this.worldRotation*i.degRad,a=Math.cos(r),o=Math.sin(r);this.worldFlipX?(this.m00=-a*this.worldScaleX,this.m01=o*this.worldScaleY):(this.m00=a*this.worldScaleX,this.m01=-o*this.worldScaleY),this.worldFlipY!=i.Bone.yDown?(this.m10=-o*this.worldScaleX,this.m11=-a*this.worldScaleY):(this.m10=o*this.worldScaleX,this.m11=a*this.worldScaleY)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.rotationIK=this.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.flipX=t.flipX,this.flipY=t.flipY},worldToLocal:function(t){var e=t[0]-this.worldX,n=t[1]-this.worldY,r=this.m00,a=this.m10,o=this.m01,s=this.m11;this.worldFlipX!=(this.worldFlipY!=i.Bone.yDown)&&(r=-r,s=-s);var l=1/(r*s-o*a);t[0]=e*r*l-n*o*l,t[1]=n*s*l-e*a*l},localToWorld:function(t){var e=t[0],n=t[1];t[0]=e*this.m00+n*this.m01+this.worldX,t[1]=e*this.m10+n*this.m11+this.worldY}},e.exports=i.Bone},{"../SpineUtil":42}],13:[function(t,e,n){var i=t("../SpineUtil");i.BoneData=function(t,e){this.name=t,this.parent=e},i.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},e.exports=i.BoneData},{"../SpineUtil":42}],14:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.BoundingBoxAttachment=function(t){this.name=t,this.vertices=[]},i.BoundingBoxAttachment.prototype={type:i.AttachmentType.boundingbox,computeWorldVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;for(var r=n.m00,a=n.m01,o=n.m10,s=n.m11,l=this.vertices,h=0,m=l.length;m>h;h+=2){var u=l[h],f=l[h+1];i[h]=u*r+f*a+t,i[h+1]=u*o+f*s+e}}},e.exports=i.BoundingBoxAttachment},{"../SpineUtil":42,"./AttachmentType":11}],15:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ColorTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=5*t},i.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},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},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s,l,h,m;if(n>=o[o.length-5]){var u=o.length-1;s=o[u-3],l=o[u-2],h=o[u-1],m=o[u]}else{var f=i.Animation.binarySearch(o,n,5),c=o[f-4],p=o[f-3],d=o[f-2],g=o[f-1],v=o[f],A=1-(n-v)/(o[f-5]-v);A=this.curves.getCurvePercent(f/5-1,A),s=c+(o[f+1]-c)*A,l=p+(o[f+2]-p)*A,h=d+(o[f+3]-d)*A,m=g+(o[f+4]-g)*A}var S=t.slots[this.slotIndex];1>a?(S.r+=(s-S.r)*a,S.g+=(l-S.g)*a,S.b+=(h-S.b)*a,S.a+=(m-S.a)*a):(S.r=s,S.g=l,S.b=h,S.a=m)}}},e.exports=i.ColorTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],16:[function(t,e,n){var i=t("../SpineUtil");i.Curves=function(t){this.curves=[]},i.Curves.prototype={setLinear:function(t){this.curves[19*t]=0},setStepped:function(t){this.curves[19*t]=1},setCurve:function(t,e,n,i,r){var a=.1,o=a*a,s=o*a,l=3*a,h=3*o,m=6*o,u=6*s,f=2*-e+i,c=2*-n+r,p=3*(e-i)+1,d=3*(n-r)+1,g=e*l+f*h+p*s,v=n*l+c*h+d*s,A=f*m+p*u,S=c*m+d*u,y=p*u,w=d*u,T=19*t,x=this.curves;x[T++]=2;for(var b=g,C=v,k=T+19-1;k>T;T+=2)x[T]=b,x[T+1]=C,g+=A,v+=S,A+=y,S+=w,b+=g,C+=v},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var n=this.curves,i=19*t,r=n[i];if(0===r)return e;if(1==r)return 0;i++;for(var a=0,o=i,s=i+19-1;s>i;i+=2)if(a=n[i],a>=e){var l,h;return i==o?(l=0,h=0):(l=n[i-2],h=n[i-1]),h+(n[i+1]-h)*(e-l)/(a-l)}var m=n[i-1];return m+(1-m)*(e-a)/(1-a)}},e.exports=i.Curves},{"../SpineUtil":42}],17:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.DrawOrderTimeline=function(t){this.frames=[],this.frames.length=t,this.drawOrders=[],this.drawOrders.length=t},i.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s;s=n>=o[o.length-1]?o.length-1:i.Animation.binarySearch1(o,n)-1;var l=t.drawOrder,h=(t.slots,this.drawOrders[s]);if(h)for(var m=0,u=h.length;u>m;m++)l[m]=h[m]}}},e.exports=i.DrawOrderTimeline},{"../SpineUtil":42,"./Animation":2}],18:[function(t,e,n){var i=t("../SpineUtil");i.Event=function(t){this.data=t},i.Event.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.Event},{"../SpineUtil":42}],19:[function(t,e,n){var i=t("../SpineUtil");i.EventData=function(t){this.name=t},i.EventData.prototype={intValue:0,floatValue:0,stringValue:null},e.exports=i.EventData},{"../SpineUtil":42}],20:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.EventTimeline=function(t){this.frames=[],this.frames.length=t,this.events=[],this.events.length=t},i.EventTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.events[t]=n},apply:function(t,e,n,r,a){if(r){var o=this.frames,s=o.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,r,a),e=-1;else if(e>=o[s-1])return;if(!(n<o[0])){var l;if(e<o[0])l=0;else{l=i.Animation.binarySearch1(o,e);for(var h=o[l];l>0&&o[l-1]==h;)l--}for(var m=this.events;s>l&&n>=o[l];l++)r.push(m[l])}}}},e.exports=i.EventTimeline},{"../SpineUtil":42,"./Animation":2}],21:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.FfdTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.frameVertices=[],this.frameVertices.length=t},i.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},apply:function(t,e,n,r,a){var o=t.slots[this.slotIndex];if(o.attachment==this.attachment){var s=this.frames;if(!(n<s[0])){var l=this.frameVertices,h=l[0].length,m=o.attachmentVertices;if(m.length!=h){m=o.attachmentVertices=[];for(var u=0;h>u;u++)m.push(0);a=1}if(n>=s[s.length-1]){var f=l[s.length-1];if(1>a)for(var c=0;h>c;c++)m[c]+=(f[c]-m[c])*a;else for(var c=0;h>c;c++)m[c]=f[c]}else{var p=i.Animation.binarySearch1(s,n),d=s[p],g=1-(n-d)/(s[p-1]-d);g=this.curves.getCurvePercent(p-1,0>g?0:g>1?1:g);var v=l[p-1],A=l[p];if(1>a)for(var c=0;h>c;c++){var S=v[c];m[c]+=(S+(A[c]-S)*g-m[c])*a}else for(var c=0;h>c;c++){var S=v[c];m[c]=S+(A[c]-S)*g}}}}}},e.exports=i.FfdTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],22:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.FlipXTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n?1:0},apply:function(t,e,n,r,a){var o=this.frames;if(n<o[0])return void(e>n&&this.apply(t,e,Number.MAX_VALUE,null,0));e>n&&(e=-1);var s=(n>=o[o.length-2]?o.length:i.Animation.binarySearch(o,n,2))-2;o[s]<e||(t.bones[this.boneIndex].flipX=0!=o[s+1])}},e.exports=i.FlipXTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],23:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.FlipYTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.FlipYTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n?1:0},apply:function(t,e,n,r,a){var o=this.frames;if(n<o[0])return void(e>n&&this.apply(t,e,Number.MAX_VALUE,null,0));e>n&&(e=-1);var s=(n>=o[o.length-2]?o.length:i.Animation.binarySearch(o,n,2))-2;o[s]<e||(t.bones[this.boneIndex].flipY=0!=o[s+1])}},e.exports=i.FlipYTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],24:[function(t,e,n){var i=t("../SpineUtil");i.IkConstraint=function(t,e){this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=[];for(var n=0,i=t.bones.length;i>n;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)},i.IkConstraint.prototype={apply:function(){var t=this.target,e=this.bones;switch(e.length){case 1:i.IkConstraint.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:i.IkConstraint.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}}},i.IkConstraint.apply1=function(t,e,n,r){var a=t.data.inheritRotation&&t.parent?t.parent.worldRotation:0,o=t.rotation,s=(i.Bone.yDown?-i.radDeg:i.radDeg)*Math.atan2(n-t.worldY,e-t.worldX)-a;t.rotationIK=o+(s-o)*r},i.IkConstraint.apply2=function(t,e,n,r,a,o){var s=e.rotation,l=t.rotation;if(!o)return e.rotationIK=s,void(t.rotationIK=l);var h,m,u=i.temp,f=t.parent;f?(u[0]=n,u[1]=r,f.worldToLocal(u),n=(u[0]-t.x)*f.worldScaleX,r=(u[1]-t.y)*f.worldScaleY):(n-=t.x,r-=t.y),e.parent==t?(h=e.x,m=e.y):(u[0]=e.x,u[1]=e.y,e.parent.localToWorld(u),t.worldToLocal(u),h=u[0],m=u[1]);var c=h*t.worldScaleX,p=m*t.worldScaleY,d=Math.atan2(p,c),g=Math.sqrt(c*c+p*p),v=e.data.length*e.worldScaleX,A=2*g*v;if(1e-4>A)return void(e.rotationIK=s+(Math.atan2(r,n)*i.radDeg-l-s)*o);var S=(n*n+r*r-g*g-v*v)/A;-1>S?S=-1:S>1&&(S=1);var y=Math.acos(S)*a,w=g+v*S,T=v*Math.sin(y),x=Math.atan2(r*w-n*T,n*w+r*T),b=(x-d)*i.radDeg-l;b>180?b-=360:-180>b&&(b+=360),t.rotationIK=l+b*o,b=(y+d)*i.radDeg-s,b>180?b-=360:-180>b&&(b+=360),e.rotationIK=s+(b+t.worldRotation-e.parent.worldRotation)*o},e.exports=i.IkConstraint},{"../SpineUtil":42}],25:[function(t,e,n){var i=t("../SpineUtil")||{};i.IkConstraintData=function(t){this.name=t,this.bones=[]},i.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},e.exports=i.IkConstraintData},{"../SpineUtil":42}],26:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.IkConstraintTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s=t.ikConstraints[this.ikConstraintIndex];if(n>=o[o.length-3])return s.mix+=(o[o.length-2]-s.mix)*a,void(s.bendDirection=o[o.length-1]);var l=i.Animation.binarySearch(o,n,3),h=o[l+-2],m=o[l],u=1-(n-m)/(o[l+-3]-m);u=this.curves.getCurvePercent(l/3-1,u);var f=h+(o[l+1]-h)*u;s.mix+=(f-s.mix)*a,s.bendDirection=o[l+-1]}}},e.exports=i.IkConstraintTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],27:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.MeshAttachment=function(t){this.name=t},i.MeshAttachment.prototype={type:i.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var t=this.regionU2-this.regionU,e=this.regionV2-this.regionV,n=this.regionUVs.length;if(this.uvs&&this.uvs.length==n||(this.uvs=new i.Float32Array(n)),this.regionRotate)for(var r=0;n>r;r+=2)this.uvs[r]=this.regionU+this.regionUVs[r+1]*t,this.uvs[r+1]=this.regionV+e-this.regionUVs[r]*e;else for(var r=0;n>r;r+=2)this.uvs[r]=this.regionU+this.regionUVs[r]*t,this.uvs[r+1]=this.regionV+this.regionUVs[r+1]*e},computeWorldVertices:function(t,e,n,i){var r=n.bone;t+=r.worldX,e+=r.worldY;var a=r.m00,o=r.m01,s=r.m10,l=r.m11,h=this.vertices,m=h.length;n.attachmentVertices.length==m&&(h=n.attachmentVertices);for(var u=0;m>u;u+=2){var f=h[u],c=h[u+1];i[u]=f*a+c*o+t,i[u+1]=f*s+c*l+e}}},e.exports=i.MeshAttachment},{"../SpineUtil":42,"./AttachmentType":11}],28:[function(t,e,n){var i=t("../SpineUtil");i.AttachmentType=t("./AttachmentType"),i.RegionAttachment=function(t){this.name=t,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},i.RegionAttachment.prototype={type:i.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,n,i,r){var a=this.uvs;r?(a[2]=t,a[3]=i,a[4]=t,a[5]=e,a[6]=n,a[7]=e,a[0]=n,a[1]=i):(a[0]=t,a[1]=i,a[2]=t,a[3]=e,a[4]=n,a[5]=e,a[6]=n,a[7]=i)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.regionOffsetX*t,r=-this.height/2*this.scaleY+this.regionOffsetY*e,a=n+this.regionWidth*t,o=r+this.regionHeight*e,s=this.rotation*i.degRad,l=Math.cos(s),h=Math.sin(s),m=n*l+this.x,u=n*h,f=r*l+this.y,c=r*h,p=a*l+this.x,d=a*h,g=o*l+this.y,v=o*h,A=this.offset;A[0]=m-c,A[1]=f+u,A[2]=m-v,A[3]=g+u,A[4]=p-v,A[5]=g+d,A[6]=p-c,A[7]=f+d},computeVertices:function(t,e,n,i){t+=n.worldX,e+=n.worldY;var r=n.m00,a=n.m01,o=n.m10,s=n.m11,l=this.offset;i[0]=l[0]*r+l[1]*a+t,i[1]=l[0]*o+l[1]*s+e,i[2]=l[2]*r+l[3]*a+t,i[3]=l[2]*o+l[3]*s+e,i[4]=l[4]*r+l[5]*a+t,i[5]=l[4]*o+l[5]*s+e,i[6]=l[6]*r+l[7]*a+t,i[7]=l[6]*o+l[7]*s+e}},e.exports=i.RegionAttachment},{"../SpineUtil":42,"./AttachmentType":11}],29:[function(t,e,n){var i=t("../SpineUtil")||{};i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.RotateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,n){t*=2,this.frames[t]=e,this.frames[t+1]=n},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s=t.bones[this.boneIndex];if(n>=o[o.length-2]){for(var l=s.data.rotation+o[o.length-1]-s.rotation;l>180;)l-=360;for(;-180>l;)l+=360;return void(s.rotation+=l*a)}var h=i.Animation.binarySearch(o,n,2),m=o[h-1],u=o[h],f=1-(n-u)/(o[h-2]-u);f=this.curves.getCurvePercent(h/2-1,f);for(var l=o[h+1]-m;l>180;)l-=360;for(;-180>l;)l+=360;for(l=s.data.rotation+(m+l*f)-s.rotation;l>180;)l-=360;for(;-180>l;)l+=360;s.rotation+=l*a}}},e.exports=i.RotateTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],30:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.ScaleTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s=t.bones[this.boneIndex];if(n>=o[o.length-3])return s.scaleX+=(s.data.scaleX*o[o.length-2]-s.scaleX)*a,void(s.scaleY+=(s.data.scaleY*o[o.length-1]-s.scaleY)*a);var l=i.Animation.binarySearch(o,n,3),h=o[l-2],m=o[l-1],u=o[l],f=1-(n-u)/(o[l+-3]-u);f=this.curves.getCurvePercent(l/3-1,f),s.scaleX+=(s.data.scaleX*(h+(o[l+1]-h)*f)-s.scaleX)*a,s.scaleY+=(s.data.scaleY*(m+(o[l+2]-m)*f)-s.scaleY)*a}}},e.exports=i.ScaleTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],31:[function(t,e,n){var i=t("../SpineUtil");i.Bone=t("./Bone"),i.Slot=t("./Slot"),i.IkConstraint=t("./IkConstraint"),i.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,n=t.bones.length;n>e;e++){var r=t.bones[e],a=r.parent?this.bones[t.bones.indexOf(r.parent)]:null;this.bones.push(new i.Bone(r,this,a))}this.slots=[],this.drawOrder=[];for(var e=0,n=t.slots.length;n>e;e++){var o=t.slots[e],s=this.bones[t.bones.indexOf(o.boneData)],l=new i.Slot(o,s);this.slots.push(l),this.drawOrder.push(e)}this.ikConstraints=[];for(var e=0,n=t.ikConstraints.length;n>e;e++)this.ikConstraints.push(new i.IkConstraint(t.ikConstraints[e],this));this.boneCache=[],this.updateCache()},i.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var t=this.ikConstraints,e=t.length,n=e+1,i=this.boneCache;i.length>n&&(i.length=n);for(var r=0,a=i.length;a>r;r++)i[r].length=0;for(;i.length<n;)i[i.length]=[];var o=i[0],s=this.bones;t:for(var r=0,a=s.length;a>r;r++){var l=s[r],h=l;do{for(var m=0;e>m;m++)for(var u=t[m],f=u.bones[0],c=u.bones[u.bones.length-1];;){if(h==c){i[m].push(l),i[m+1].push(l);continue t}if(c==f)break;c=c.parent}h=h.parent}while(h);o[o.length]=l}},updateWorldTransform:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++){var i=t[e];i.rotationIK=i.rotation}for(var e=0,r=this.boneCache.length-1;;){for(var a=this.boneCache[e],o=0,s=a.length;s>o;o++)a[o].updateWorldTransform();if(e==r)break;this.ikConstraints[e].apply(),e++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,n=t.length;n>e;e++)t[e].setToSetupPose();for(var i=this.ikConstraints,e=0,n=i.length;n>e;e++){var r=i[e];r.bendDirection=r.data.bendDirection,r.mix=r.data.mix}},setSlotsToSetupPose:function(){for(var t=this.slots,e=0,n=t.length;n>e;e++)t[e].setToSetupPose(e);this.resetDrawOrder()},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n;return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return n;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){if(t)if(this.skin)t._attachAll(this,this.skin);else for(var e=this.slots,n=0,i=e.length;i>n;n++){var r=e[n],a=r.data.attachmentName;if(a){var o=t.getAttachment(n,a);o&&r.setAttachment(o)}}this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){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},setAttachment:function(t,e){for(var n=this.slots,i=0,r=n.length;r>i;i++){var a=n[i];if(a.data.name==t){var o=null;if(e&&(o=this.getAttachmentBySlotIndex(i,e),!o))throw"Attachment not found: "+e+", for slot: "+t;return void a.setAttachment(o)}}throw"Slot not found: "+t},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].data.name==t)return e[n];return null},update:function(t){this.time+=t},resetDrawOrder:function(){for(var t=0,e=this.drawOrder.length;e>t;t++)this.drawOrder[t]=t}},e.exports=i.Skeleton},{"../SpineUtil":42,"./Bone":12,"./IkConstraint":24,"./Slot":37}],32:[function(t,e,n){var i=t("../SpineRuntime")||{};i.AttachmentType=t("./AttachmentType"),i.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},i.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(t,e){var n=t.slots,r=n.length,a=t.x,o=t.y,s=this.boundingBoxes,l=this.polygonPool,h=this.polygons;s.length=0;for(var m=0,u=h.length;u>m;m++)l.push(h[m]);h.length=0;for(var m=0;r>m;m++){var f=n[m],c=f.attachment;if(c.type==i.AttachmentType.boundingbox){s.push(c);var p,d=l.length;d>0?(p=l[d-1],l.splice(d-1,1)):p=[],h.push(p),p.length=c.vertices.length,c.computeWorldVertices(a,o,f.bone,p);
}}e&&this.aabbCompute()},aabbCompute:function(){for(var t=this.polygons,e=Number.MAX_VALUE,n=Number.MAX_VALUE,i=Number.MIN_VALUE,r=Number.MIN_VALUE,a=0,o=t.length;o>a;a++)for(var s=t[a],l=0,h=s.length;h>l;l+=2){var m=s[l],u=s[l+1];e=Math.min(e,m),n=Math.min(n,u),i=Math.max(i,m),r=Math.max(r,u)}this.minX=e,this.minY=n,this.maxX=i,this.maxY=r},aabbContainsPoint:function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},aabbIntersectsSegment:function(t,e,n,i){var r=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(r>=t&&r>=n||a>=e&&a>=i||t>=o&&n>=o||e>=s&&i>=s)return!1;var l=(i-e)/(n-t),h=l*(r-t)+e;if(h>a&&s>h)return!0;if(h=l*(o-t)+e,h>a&&s>h)return!0;var m=(a-e)/l+t;return m>r&&o>m?!0:(m=(s-e)/l+t,m>r&&o>m?!0:!1)},aabbIntersectsSkeleton:function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},containsPoint:function(t,e){for(var n=this.polygons,i=0,r=n.length;r>i;i++)if(this.polygonContainsPoint(n[i],t,e))return this.boundingBoxes[i];return null},intersectsSegment:function(t,e,n,i){for(var r=this.polygons,a=0,o=r.length;o>a;a++)if(r[a].intersectsSegment(t,e,n,i))return this.boundingBoxes[a];return null},polygonContainsPoint:function(t,e,n){for(var i=t.length,r=i-2,a=!1,o=0;i>o;o+=2){var s=t[o+1],l=t[r+1];if(n>s&&l>=n||n>l&&s>=n){var h=t[o];h+(n-s)/(l-s)*(t[r]-h)<e&&(a=!a)}r=o}return a},polygonIntersectsSegment:function(t,e,n,i,r){for(var a=t.length,o=e-i,s=n-r,l=e*r-n*i,h=t[a-2],m=t[a-1],u=0;a>u;u+=2){var f=t[u],c=t[u+1],p=h*c-m*f,d=h-f,g=m-c,v=o*g-s*d,A=(l*d-o*p)/v;if((A>=h&&f>=A||A>=f&&h>=A)&&(A>=e&&i>=A||A>=i&&e>=A)){var S=(l*g-s*p)/v;if((S>=m&&c>=S||S>=c&&m>=S)&&(S>=n&&r>=S||S>=r&&n>=S))return!0}h=f,m=c}return!1},getPolygon:function(t){var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}},e.exports=i.SkeletonBounds},{"../SpineRuntime":41,"./AttachmentType":11}],33:[function(t,e,n){var i=t("../SpineUtil");i.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[]},i.SkeletonData.prototype={name:null,defaultSkin:null,width:0,height:0,version:null,hash:null,findBone:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findBoneIndex:function(t){for(var e=this.bones,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSlot:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return this.slots[n];return null},findSlotIndex:function(t){for(var e=this.slots,n=0,i=e.length;i>n;n++)if(e[n].name==t)return n;return-1},findSkin:function(t){for(var e=this.skins,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findEvent:function(t){for(var e=this.events,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findAnimation:function(t){for(var e=this.animations,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null},findIkConstraint:function(t){for(var e=this.ikConstraints,n=0,i=e.length;i>n;n++)if(e[n].name==t)return e[n];return null}},e.exports=i.SkeletonData},{"../SpineUtil":42}],34:[function(t,e,n){var i=t("../SpineUtil");i.SkeletonData=t("./SkeletonData"),i.BoneData=t("./BoneData"),i.IkConstraintData=t("./IkConstraintData"),i.SlotData=t("./SlotData"),i.Skin=t("./Skin"),i.EventData=t("./EventData"),i.AttachmentType=t("./AttachmentType"),i.ColorTimeline=t("./ColorTimeline"),i.AttachmentTimeline=t("./AttachmentTimeline"),i.RotateTimeline=t("./RotateTimeline"),i.ScaleTimeline=t("./ScaleTimeline"),i.TranslateTimeline=t("./TranslateTimeline"),i.FlipXTimeline=t("./FlipXTimeline"),i.FlipYTimeline=t("./FlipYTimeline"),i.IkConstraintTimeline=t("./IkConstraintTimeline"),i.FfdTimeline=t("./FfdTimeline"),i.DrawOrderTimeline=t("./DrawOrderTimeline"),i.EventTimeline=t("./EventTimeline"),i.Event=t("./Event"),i.Animation=t("./Animation"),i.SkeletonJsonParser=function(t){this.attachmentLoader=t},i.SkeletonJsonParser.prototype={scale:1,readSkeletonData:function(t,e){var n=new i.SkeletonData;n.name=e;var r=t.skeleton;r&&(n.hash=r.hash,n.version=r.spine,n.width=r.width||0,n.height=r.height||0);for(var a=t.bones,o=0,s=a.length;s>o;o++){var l=a[o],h=null;if(l.parent&&(h=n.findBone(l.parent),!h))throw"Parent bone not found: "+l.parent;var m=new i.BoneData(l.name,h);m.length=(l.length||0)*this.scale,m.x=(l.x||0)*this.scale,m.y=(l.y||0)*this.scale,m.rotation=l.rotation||0,m.scaleX=l.hasOwnProperty("scaleX")?l.scaleX:1,m.scaleY=l.hasOwnProperty("scaleY")?l.scaleY:1,m.inheritScale=l.hasOwnProperty("inheritScale")?l.inheritScale:!0,m.inheritRotation=l.hasOwnProperty("inheritRotation")?l.inheritRotation:!0,n.bones.push(m)}var u=t.ik;if(u)for(var o=0,s=u.length;s>o;o++){for(var f=u[o],c=new i.IkConstraintData(f.name),a=f.bones,p=0,d=a.length;d>p;p++){var g=n.findBone(a[p]);if(!g)throw"IK bone not found: "+a[p];c.bones.push(g)}if(c.target=n.findBone(f.target),!c.target)throw"Target bone not found: "+f.target;c.bendDirection=!f.hasOwnProperty("bendPositive")||f.bendPositive?1:-1,c.mix=f.hasOwnProperty("mix")?f.mix:1,n.ikConstraints.push(c)}for(var v=t.slots,o=0,s=v.length;s>o;o++){var A=v[o],m=n.findBone(A.bone);if(!m)throw"Slot bone not found: "+A.bone;var S=new i.SlotData(A.name,m),y=A.color;y&&(S.r=this.toColor(y,0),S.g=this.toColor(y,1),S.b=this.toColor(y,2),S.a=this.toColor(y,3)),S.attachmentName=A.attachment,S.blendMode=A.blend&&i.SlotData.PIXI_BLEND_MODE_MAP[A.blend]||i.SlotData.PIXI_BLEND_MODE_MAP.normal,n.slots.push(S)}var w=t.skins;for(var T in w)if(w.hasOwnProperty(T)){var x=w[T],b=new i.Skin(T);for(var C in x)if(x.hasOwnProperty(C)){var k=n.findSlotIndex(C),I=x[C];for(var D in I)if(I.hasOwnProperty(D)){var X=this.readAttachment(b,D,I[D]);X&&b.addAttachment(k,D,X)}}n.skins.push(b),"default"==b.name&&(n.defaultSkin=b)}var U=t.events;for(var O in U)if(U.hasOwnProperty(O)){var P=U[O],M=new i.EventData(O);M.intValue=P["int"]||0,M.floatValue=P["float"]||0,M.stringValue=P.string||null,n.events.push(M)}var F=t.animations;for(var Y in F)F.hasOwnProperty(Y)&&this.readAnimation(Y,F[Y],n);return n},readAttachment:function(t,e,n){e=n.name||e;var r=i.AttachmentType[n.type||"region"],a=n.path||e,o=this.scale;if(r==i.AttachmentType.region){var s=this.attachmentLoader.newRegionAttachment(t,e,a);if(!s)return null;s.path=a,s.x=(n.x||0)*o,s.y=(n.y||0)*o,s.scaleX=n.hasOwnProperty("scaleX")?n.scaleX:1,s.scaleY=n.hasOwnProperty("scaleY")?n.scaleY:1,s.rotation=n.rotation||0,s.width=(n.width||0)*o,s.height=(n.height||0)*o;var l=n.color;return l&&(s.r=this.toColor(l,0),s.g=this.toColor(l,1),s.b=this.toColor(l,2),s.a=this.toColor(l,3)),s.updateOffset(),s}if(r==i.AttachmentType.mesh){var h=this.attachmentLoader.newMeshAttachment(t,e,a);return h?(h.path=a,h.vertices=this.getFloatArray(n,"vertices",o),h.triangles=this.getIntArray(n,"triangles"),h.regionUVs=this.getFloatArray(n,"uvs",1),h.updateUVs(),l=n.color,l&&(h.r=this.toColor(l,0),h.g=this.toColor(l,1),h.b=this.toColor(l,2),h.a=this.toColor(l,3)),h.hullLength=2*(n.hull||0),n.edges&&(h.edges=this.getIntArray(n,"edges")),h.width=(n.width||0)*o,h.height=(n.height||0)*o,h):null}if(r==i.AttachmentType.skinnedmesh){var h=this.attachmentLoader.newSkinnedMeshAttachment(t,e,a);if(!h)return null;h.path=a;for(var m=this.getFloatArray(n,"uvs",1),u=this.getFloatArray(n,"vertices",1),f=[],c=[],p=0,d=u.length;d>p;){var g=0|u[p++];c[c.length]=g;for(var v=p+4*g;v>p;)c[c.length]=u[p],f[f.length]=u[p+1]*o,f[f.length]=u[p+2]*o,f[f.length]=u[p+3],p+=4}return h.bones=c,h.weights=f,h.triangles=this.getIntArray(n,"triangles"),h.regionUVs=m,h.updateUVs(),l=n.color,l&&(h.r=this.toColor(l,0),h.g=this.toColor(l,1),h.b=this.toColor(l,2),h.a=this.toColor(l,3)),h.hullLength=2*(n.hull||0),n.edges&&(h.edges=this.getIntArray(n,"edges")),h.width=(n.width||0)*o,h.height=(n.height||0)*o,h}if(r==i.AttachmentType.boundingbox){for(var A=this.attachmentLoader.newBoundingBoxAttachment(t,e),u=n.vertices,p=0,d=u.length;d>p;p++)A.vertices.push(u[p]*o);return A}throw"Unknown attachment type: "+r},readAnimation:function(t,e,n){var r=[],a=0,o=e.slots;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],h=n.findSlotIndex(s);for(var m in l)if(l.hasOwnProperty(m)){var u=l[m];if("color"==m){var f=new i.ColorTimeline(u.length);f.slotIndex=h;for(var c=0,p=0,d=u.length;d>p;p++){var g=u[p],v=g.color,A=this.toColor(v,0),S=this.toColor(v,1),y=this.toColor(v,2),w=this.toColor(v,3);f.setFrame(c,g.time,A,S,y,w),this.readCurve(f,c,g),c++}r.push(f),a=Math.max(a,f.frames[5*f.getFrameCount()-5])}else{if("attachment"!=m)throw"Invalid timeline type for a slot: "+m+" ("+s+")";var f=new i.AttachmentTimeline(u.length);f.slotIndex=h;for(var c=0,p=0,d=u.length;d>p;p++){var g=u[p];f.setFrame(c++,g.time,g.name)}r.push(f),a=Math.max(a,f.frames[f.getFrameCount()-1])}}}var T=e.bones;for(var x in T)if(T.hasOwnProperty(x)){var b=n.findBoneIndex(x);if(-1==b)throw"Bone not found: "+x;var C=T[x];for(var m in C)if(C.hasOwnProperty(m)){var u=C[m];if("rotate"==m){var f=new i.RotateTimeline(u.length);f.boneIndex=b;for(var c=0,p=0,d=u.length;d>p;p++){var g=u[p];f.setFrame(c,g.time,g.angle),this.readCurve(f,c,g),c++}r.push(f),a=Math.max(a,f.frames[2*f.getFrameCount()-2])}else if("translate"==m||"scale"==m){var f,k=1;"scale"==m?f=new i.ScaleTimeline(u.length):(f=new i.TranslateTimeline(u.length),k=this.scale),f.boneIndex=b;for(var c=0,p=0,d=u.length;d>p;p++){var g=u[p],I=(g.x||0)*k,D=(g.y||0)*k;f.setFrame(c,g.time,I,D),this.readCurve(f,c,g),c++}r.push(f),a=Math.max(a,f.frames[3*f.getFrameCount()-3])}else{if("flipX"!=m&&"flipY"!=m)throw"Invalid timeline type for a bone: "+m+" ("+x+")";var I="flipX"==m,f=I?new i.FlipXTimeline(u.length):new i.FlipYTimeline(u.length);f.boneIndex=b;for(var X=I?"x":"y",c=0,p=0,d=u.length;d>p;p++){var g=u[p];f.setFrame(c,g.time,g[X]||!1),c++}r.push(f),a=Math.max(a,f.frames[2*f.getFrameCount()-2])}}}var U=e.ik;for(var O in U)if(U.hasOwnProperty(O)){var P=n.findIkConstraint(O),u=U[O],f=new i.IkConstraintTimeline(u.length);f.ikConstraintIndex=n.ikConstraints.indexOf(P);for(var c=0,p=0,d=u.length;d>p;p++){var g=u[p],M=g.hasOwnProperty("mix")?g.mix:1,F=!g.hasOwnProperty("bendPositive")||g.bendPositive?1:-1;f.setFrame(c,g.time,M,F),this.readCurve(f,c,g),c++}r.push(f),a=Math.max(a,f.frames[3*f.getFrameCount()-3])}var Y=e.ffd;for(var E in Y){var R=n.findSkin(E),l=Y[E];for(s in l){var h=n.findSlotIndex(s),B=l[s];for(var V in B){var u=B[V],f=new i.FfdTimeline(u.length),N=R.getAttachment(h,V);if(!N)throw"FFD attachment not found: "+V;f.slotIndex=h,f.attachment=N;var L,W=N.type==i.AttachmentType.mesh;L=W?N.vertices.length:N.weights.length/3*2;for(var c=0,p=0,d=u.length;d>p;p++){var _,g=u[p];if(g.vertices){var j=g.vertices;_=[];for(var H=0;L>H;++H)_.push(0);var K=g.offset||0,J=j.length;if(1==this.scale)for(var q=0;J>q;q++)_[q+K]=j[q];else for(var q=0;J>q;q++)_[q+K]=j[q]*this.scale;if(W)for(var G=N.vertices,q=0,J=_.length;J>q;q++)_[q]+=G[q]}else if(W)_=N.vertices;else{_=[];for(var H=0;L>H;++H)_.push(0)}f.setFrame(c,g.time,_),this.readCurve(f,c,g),c++}r[r.length]=f,a=Math.max(a,f.frames[f.getFrameCount()-1])}}}var $=e.drawOrder;if($||($=e.draworder),$){for(var f=new i.DrawOrderTimeline($.length),z=n.slots.length,c=0,p=0,d=$.length;d>p;p++){var Q=$[p],Z=null;if(Q.offsets){Z=[],Z.length=z;for(var q=z-1;q>=0;q--)Z[q]=-1;var tt=Q.offsets,et=[];et.length=z-tt.length;for(var nt=0,it=0,q=0,J=tt.length;J>q;q++){var rt=tt[q],h=n.findSlotIndex(rt.slot);if(-1==h)throw"Slot not found: "+rt.slot;for(;nt!=h;)et[it++]=nt++;Z[nt+rt.offset]=nt++}for(;z>nt;)et[it++]=nt++;for(var q=z-1;q>=0;q--)-1==Z[q]&&(Z[q]=et[--it])}f.setFrame(c++,Q.time,Z)}r.push(f),a=Math.max(a,f.frames[f.getFrameCount()-1])}var at=e.events;if(at){for(var f=new i.EventTimeline(at.length),c=0,p=0,d=at.length;d>p;p++){var ot=at[p],st=n.findEvent(ot.name);if(!st)throw"Event not found: "+ot.name;var lt=new i.Event(st);lt.intValue=ot.hasOwnProperty("int")?ot["int"]:st.intValue,lt.floatValue=ot.hasOwnProperty("float")?ot["float"]:st.floatValue,lt.stringValue=ot.hasOwnProperty("string")?ot.string:st.stringValue,f.setFrame(c++,ot.time,lt)}r.push(f),a=Math.max(a,f.frames[f.getFrameCount()-1])}n.animations.push(new i.Animation(t,r,a))},readCurve:function(t,e,n){var i=n.curve;i?"stepped"==i?t.curves.setStepped(e):i instanceof Array&&t.curves.setCurve(e,i[0],i[1],i[2],i[3]):t.curves.setLinear(e)},toColor:function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2*e+2),16)/255},getFloatArray:function(t,e,n){var r=t[e],a=new i.Float32Array(r.length),o=0,s=r.length;if(1==n)for(;s>o;o++)a[o]=r[o];else for(;s>o;o++)a[o]=r[o]*n;return a},getIntArray:function(t,e){for(var n=t[e],r=new i.Uint16Array(n.length),a=0,o=n.length;o>a;a++)r[a]=0|n[a];return r}},e.exports=i.SkeletonJsonParser},{"../SpineUtil":42,"./Animation":2,"./AttachmentTimeline":10,"./AttachmentType":11,"./BoneData":13,"./ColorTimeline":15,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./FlipXTimeline":22,"./FlipYTimeline":23,"./IkConstraintData":25,"./IkConstraintTimeline":26,"./RotateTimeline":29,"./ScaleTimeline":30,"./SkeletonData":33,"./Skin":35,"./SlotData":38,"./TranslateTimeline":40}],35:[function(t,e,n){var i=t("../SpineUtil");i.Skin=function(t){this.name=t,this.attachments={}},i.Skin.prototype={addAttachment:function(t,e,n){this.attachments[t+":"+e]=n},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var n in e.attachments){var i=n.indexOf(":"),r=parseInt(n.substring(0,i)),a=n.substring(i+1),o=t.slots[r];if(o.attachment&&o.attachment.name==a){var s=this.getAttachment(r,a);s&&o.setAttachment(s)}}}},e.exports=i.Skin},{"../SpineUtil":42}],36:[function(t,e,n){var i=t("../SpineUtil")||{};i.AttachmentType=t("./AttachmentType"),i.SkinnedMeshAttachment=function(t){this.name=t},i.SkinnedMeshAttachment.prototype={type:i.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(t,e,n,r,a){var o=this.regionU2-this.regionU,s=this.regionV2-this.regionV,l=this.regionUVs.length;if(this.uvs&&this.uvs.length==l||(this.uvs=new i.Float32Array(l)),this.regionRotate)for(var h=0;l>h;h+=2)this.uvs[h]=this.regionU+this.regionUVs[h+1]*o,this.uvs[h+1]=this.regionV+s-this.regionUVs[h]*s;else for(var h=0;l>h;h+=2)this.uvs[h]=this.regionU+this.regionUVs[h]*o,this.uvs[h+1]=this.regionV+this.regionUVs[h+1]*s},computeWorldVertices:function(t,e,n,i){var r,a,o,s,l,h,m,u=n.bone.skeleton.bones,f=this.weights,c=this.bones,p=0,d=0,g=0,v=0,A=c.length;if(n.attachmentVertices.length)for(var S=n.attachmentVertices;A>d;p+=2){for(a=0,o=0,r=c[d++]+d;r>d;d++,g+=3,v+=2)s=u[c[d]],l=f[g]+S[v],h=f[g+1]+S[v+1],m=f[g+2],a+=(l*s.m00+h*s.m01+s.worldX)*m,o+=(l*s.m10+h*s.m11+s.worldY)*m;i[p]=a+t,i[p+1]=o+e}else for(;A>d;p+=2){for(a=0,o=0,r=c[d++]+d;r>d;d++,g+=3)s=u[c[d]],l=f[g],h=f[g+1],m=f[g+2],a+=(l*s.m00+h*s.m01+s.worldX)*m,o+=(l*s.m10+h*s.m11+s.worldY)*m;i[p]=a+t,i[p+1]=o+e}}},e.exports=i.SkinnedMeshAttachment},{"../SpineUtil":42,"./AttachmentType":11}],37:[function(t,e,n){var i=t("../SpineUtil");i.Slot=function(t,e){this.data=t,this.bone=e,this.setToSetupPose()},i.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(t){this.attachment=t,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(t){this._attachmentTime=this.bone.skeleton.time-t},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.blendMode=t.blendMode;for(var e=this.bone.skeleton.data.slots,n=0,i=e.length;i>n;n++)if(e[n]==t){this.setAttachment(t.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(n,t.attachmentName):null);break}}},e.exports=i.Slot},{"../SpineUtil":42}],38:[function(t,e,n){var i=t("../SpineUtil");i.SlotData=function(t,e){this.name=t,this.boneData=e},i.SlotData.PIXI_BLEND_MODE_MAP={multiply:PIXI.BLEND_MODES.MULTIPLY,screen:PIXI.BLEND_MODES.SCREEN,additive:PIXI.BLEND_MODES.ADD,normal:PIXI.BLEND_MODES.NORMAL},i.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,blendMode:PIXI.BLEND_MODES.NORMAL},e.exports=i.SlotData},{"../SpineUtil":42}],39:[function(t,e,n){var i=t("../SpineUtil");i.TrackEntry=function(){},i.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},e.exports=i.TrackEntry},{"../SpineUtil":42}],40:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.Curves=t("./Curves"),i.TranslateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,n,i){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=i},apply:function(t,e,n,r,a){var o=this.frames;if(!(n<o[0])){var s=t.bones[this.boneIndex];if(n>=o[o.length-3])return s.x+=(s.data.x+o[o.length-2]-s.x)*a,void(s.y+=(s.data.y+o[o.length-1]-s.y)*a);var l=i.Animation.binarySearch(o,n,3),h=o[l-2],m=o[l-1],u=o[l],f=1-(n-u)/(o[l+-3]-u);f=this.curves.getCurvePercent(l/3-1,f),s.x+=(s.data.x+h+(o[l+1]-h)*f-s.x)*a,s.y+=(s.data.y+m+(o[l+2]-m)*f-s.y)*a}}},e.exports=i.TranslateTimeline},{"../SpineUtil":42,"./Animation":2,"./Curves":16}],41:[function(t,e,n){var i=t("../SpineUtil");i.Animation=t("./Animation"),i.AnimationStateData=t("./AnimationStateData"),i.AnimationState=t("./AnimationState"),i.AtlasAttachmentParser=t("./AtlasAttachmentParser"),i.Atlas=t("./Atlas"),i.AtlasPage=t("./AtlasPage"),i.AtlasReader=t("./AtlasReader"),i.AtlasRegion=t("./AtlasRegion"),i.AttachmentTimeline=t("./AttachmentTimeline"),i.AttachmentType=t("./AttachmentType"),i.BoneData=t("./BoneData"),i.Bone=t("./Bone"),i.BoundingBoxAttachment=t("./BoundingBoxAttachment"),i.ColorTimeline=t("./ColorTimeline"),i.Curves=t("./Curves"),i.DrawOrderTimeline=t("./DrawOrderTimeline"),i.EventData=t("./EventData"),i.Event=t("./Event"),i.EventTimeline=t("./EventTimeline"),i.FfdTimeline=t("./FfdTimeline"),i.FlipXTimeline=t("./FlipXTimeline"),i.FlipYTimeline=t("./FlipYTimeline"),i.IkConstraintData=t("./IkConstraintData"),i.IkConstraint=t("./IkConstraint"),i.IkConstraintTimeline=t("./IkConstraintTimeline"),i.MeshAttachment=t("./MeshAttachment"),i.RegionAttachment=t("./RegionAttachment"),i.RotateTimeline=t("./RotateTimeline"),i.ScaleTimeline=t("./ScaleTimeline"),i.SkeletonBounds=t("./SkeletonBounds"),i.SkeletonData=t("./SkeletonData"),i.Skeleton=t("./Skeleton"),i.SkeletonJsonParser=t("./SkeletonJsonParser"),i.Skin=t("./Skin.js"),i.SkinnedMeshAttachment=t("./SkinnedMeshAttachment"),i.SlotData=t("./SlotData"),i.Slot=t("./Slot"),i.TrackEntry=t("./TrackEntry"),i.TranslateTimeline=t("./TranslateTimeline"),e.exports=i},{"../SpineUtil":42,"./Animation":2,"./AnimationState":3,"./AnimationStateData":4,"./Atlas":5,"./AtlasAttachmentParser":6,"./AtlasPage":7,"./AtlasReader":8,"./AtlasRegion":9,"./AttachmentTimeline":10,"./AttachmentType":11,"./Bone":12,"./BoneData":13,"./BoundingBoxAttachment":14,"./ColorTimeline":15,"./Curves":16,"./DrawOrderTimeline":17,"./Event":18,"./EventData":19,"./EventTimeline":20,"./FfdTimeline":21,"./FlipXTimeline":22,"./FlipYTimeline":23,"./IkConstraint":24,"./IkConstraintData":25,"./IkConstraintTimeline":26,"./MeshAttachment":27,"./RegionAttachment":28,"./RotateTimeline":29,"./ScaleTimeline":30,"./Skeleton":31,"./SkeletonBounds":32,"./SkeletonData":33,"./SkeletonJsonParser":34,"./Skin.js":35,"./SkinnedMeshAttachment":36,"./Slot":37,"./SlotData":38,"./TrackEntry":39,"./TranslateTimeline":40}],42:[function(t,e,n){e.exports={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array}},{}],43:[function(t,e,n){function i(t){if(PIXI.Container.call(this),!t)throw new Error("The spineData param is required.");if("string"==typeof t)throw new Error('spineData param cant be string. Please use PIXI.spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=t,this.skeleton=new r.Skeleton(t),this.skeleton.updateWorldTransform(),this.stateData=new r.AnimationStateData(t),this.state=new r.AnimationState(this.stateData),this.slotContainers=[];for(var e=0,n=this.skeleton.slots.length;n>e;e++){var i=this.skeleton.slots[e],a=i.attachment,o=new PIXI.Container;if(this.slotContainers.push(o),this.addChild(o),a instanceof r.RegionAttachment){var s=a.rendererObject.name,l=this.createSprite(i,a);i.currentSprite=l,i.currentSpriteName=s,o.addChild(l)}else{if(!(a instanceof r.MeshAttachment))continue;var h=this.createMesh(i,a);i.currentMesh=h,i.currentMeshName=a.name,o.addChild(h)}}this.autoUpdate=!0}var r=t("../SpineRuntime"),a=t("../loaders/atlasParser");r.Bone.yDown=!0,i.fromAtlas=function(t){var e=a.AnimCache[t];if(!e)throw new Error('Spine data "'+t+'" does not exist in the animation cache');return new i(e)},i.prototype=Object.create(PIXI.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{autoUpdate:{get:function(){return this.updateTransform===i.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?i.prototype.autoUpdateTransform:PIXI.Container.prototype.updateTransform}}}),i.prototype.update=function(t){this.state.update(t),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var e=this.skeleton.drawOrder,n=this.skeleton.slots,i=0,a=e.length;a>i;i++)this.children[i]=this.slotContainers[e[i]];for(i=0,a=n.length;a>i;i++){var o=n[i],s=o.attachment,l=this.slotContainers[i];if(s){var h=s.type;if(h===r.AttachmentType.region){if(s.rendererObject&&(!o.currentSpriteName||o.currentSpriteName!==s.rendererObject.name)){var m=s.rendererObject.name;if(void 0!==o.currentSprite&&(o.currentSprite.visible=!1),o.sprites=o.sprites||{},void 0!==o.sprites[m])o.sprites[m].visible=!0;else{var u=this.createSprite(o,s);l.addChild(u)}o.currentSprite=o.sprites[m],o.currentSpriteName=m}var f=o.bone;l.position.x=f.worldX+s.x*f.m00+s.y*f.m01,l.position.y=f.worldY+s.x*f.m10+s.y*f.m11,l.scale.x=f.worldScaleX,l.scale.y=f.worldScaleY,l.rotation=-(o.bone.worldRotation*r.degRad),f.worldFlipX&&(l.scale.x=-l.scale.x,l.rotation=-l.rotation),f.worldFlipY==r.Bone.yDown&&(l.scale.y=-l.scale.y,l.rotation=-l.rotation),o.currentSprite.blendMode=o.blendMode,o.currentSprite.tint=PIXI.utils.rgb2hex([o.r,o.g,o.b])}else{if(h!==r.AttachmentType.skinnedmesh&&h!==r.AttachmentType.mesh){l.visible=!1;continue}if(!o.currentMeshName||o.currentMeshName!==s.name){var c=s.name;if(void 0!==o.currentMesh&&(o.currentMesh.visible=!1),o.meshes=o.meshes||{},void 0!==o.meshes[c])o.meshes[c].visible=!0;else{var p=this.createMesh(o,s);l.addChild(p)}o.currentMesh=o.meshes[c],o.currentMeshName=c}s.computeWorldVertices(o.bone.skeleton.x,o.bone.skeleton.y,o,o.currentMesh.vertices)}l.visible=!0,l.alpha=o.a}else l.visible=!1}},i.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var t=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(t),PIXI.Container.prototype.updateTransform.call(this)},i.prototype.createSprite=function(t,e){var n=e.rendererObject,i=n.page.rendererObject,a=new PIXI.Rectangle(n.x,n.y,n.rotate?n.height:n.width,n.rotate?n.width:n.height),o=new PIXI.Texture(i,a),s=new PIXI.Sprite(o),l=n.rotate?.5*Math.PI:0;return s.scale.x=n.width/n.originalWidth*e.scaleX,s.scale.y=n.height/n.originalHeight*e.scaleY,s.rotation=l-e.rotation*r.degRad,s.anchor.x=s.anchor.y=.5,s.alpha=e.a,t.sprites=t.sprites||{},t.sprites[n.name]=s,s},i.prototype.createMesh=function(t,e){var n=e.rendererObject,i=n.page.rendererObject,r=new PIXI.Texture(i),a=new PIXI.mesh.Mesh(r,new Float32Array(e.uvs.length),new Float32Array(e.uvs),new Uint16Array(e.triangles),PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES);return a.canvasPadding=1.5,a.alpha=e.a,t.meshes=t.meshes||{},t.meshes[e.name]=a,a}},{"../SpineRuntime":41,"../loaders/atlasParser":45}],44:[function(t,e,n){var i=t("./atlasParser");PIXI.loaders.Loader.addPixiMiddleware(i),PIXI.loader.use(i())},{"./atlasParser":45}],45:[function(t,e,n){var i=PIXI.loaders.Resource,r=PIXI.utils.async,a=t("../SpineRuntime"),o=e.exports=function(){return function(t,e){if(!t.data||!t.isJson||!t.data.bones)return e();var n=t.url.substr(0,t.url.lastIndexOf("."))+".atlas",s={crossOrigin:t.crossOrigin,xhrType:i.XHR_RESPONSE_TYPE.TEXT},l=t.url.substr(0,t.url.lastIndexOf("/")+1);this.add(t.name+"_atlas",n,s,function(n){var i=new a.Atlas(this.xhr.responseText,l,n.crossOrigin),s=new a.SkeletonJsonParser(new a.AtlasAttachmentParser(i)),h=s.readSkeletonData(t.data);t.spineData=h,t.spineAtlas=i,o.enableCaching&&(o.AnimCache[t.name]=t.spineData),r.each(i.pages,function(t,e){t.rendererObject.hasLoaded?e():t.rendererObject.once("loaded",e)},e)})}};o.AnimCache={},o.enableCaching=!0},{"../SpineRuntime":41}],46:[function(t,e,n){e.exports={atlasParser:t("./atlasParser"),Loader:t("./Loader")}},{"./Loader":44,"./atlasParser":45}]},{},[1]);