window.QySkeleton=function(t){t||(t={});this.json=t.json;this.plist=t.plist;this.image=t.image;this.size=t.size;this.pivot=t.pivot;this.animation=t.animation;this.events=t.events;var e=[];e=e.concat(this.json);e=e.concat(this.plist);this.urls=e};inherits(QySkeleton,PIXI.Spine);QySkeleton.prototype.load=function(t){var e=this,o=this.assetLoader;o||(o=this.assetLoader=new PIXI.AssetLoader);o.assetURLs=this.urls;o.onComplete=function(){e.onLoad();t&&t()};o.load()};QySkeleton.prototype.onLoad=function(){var t=this.json;if(t.length){PIXI.Spine.call(this,t[0]);var e=this;this.state.onComplete=function(t,o){var i,n=e.getLoop();i=n===!0||isNaN(n-0)?1/0:n-0;if(o>=i){var s=e.state.getCurrent(0),a=s.animation.name;e.state.clearTracks();var l=new PIXI.Event(this,"skeletonEnd");l.animation=a;e.dispatchEvent(l)}}}};QySkeleton.prototype.setStartAnimation=function(t,e){this.state.setAnimationByName(0,t,!0)};QySkeleton.prototype.setLoop=function(t){this.loop=t};QySkeleton.prototype.getLoop=function(){return void 0===this.loop?1:this.loop};QySkeleton.prototype.setSpeed=function(t,e){t&&this.state&&(e?this.state.timeScale*=1+t/100:this.state.timeScale=t/100)};QySkeleton.prototype.setAnimation=function(t,e){var o=this,i=o.skeleton;if(i){for(var n=i.slots,s=i.data.animations,a=null,l=0;l<s.length;l++)s[l].name==t&&(a=s[l]);if(a){for(l=0;l<n.length;l++)n[l].currentSpriteName&&(n[l].a=0);var r,h=a.timelines;for(l=0;l<h.length;l++){r=h[l].slotIndex;r>=0&&(n[r].a=1)}this.setStartAnimation(t,e);this.setLoop(e)}}};