@eva/plugin-renderer-dragonbone 2.0.0-beta.1 → 2.0.0-beta.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.
@@ -1 +1,16 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/inspector-decorator"),e=require("@eva/eva.js"),a=require("pixi.js"),i=require("@eva/plugin-renderer"),r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])},r(t,e)};function n(t,e){function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}function s(t,e,a,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,a,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(n<3?r(s):n>3?r(e,a,s):r(e,a))||s);return n>3&&s&&Object.defineProperty(e,a,s),s}function o(t,e,a,i){return new(a||(a=Promise))((function(r,n){function s(t){try{l(i.next(t))}catch(t){n(t)}}function o(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){t.done?r(t.value):new a((function(e){e(t.value)})).then(s,o)}l((i=i.apply(t,e||[])).next())}))}function l(t,e){var a,i,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,i&&(r=2&n[0]?i.return:n[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,n[1])).done)return r;switch(i=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,i=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){s.label=n[1];break}if(6===n[0]&&s.label<r[1]){s.label=r[1],r=n;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(n);break}r[2]&&s.ops.pop(),s.trys.pop();continue}n=e.call(t,s)}catch(t){n=[6,t],i=0}finally{a=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}}var h=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.waitPlay=!1,t.waitStop=!1,t.waitPlayInfo={animationName:null},t.resource="",t.armatureName="",t.animationName="",t.autoPlay=!0,t}return n(a,e),a.prototype.init=function(t){if(t){if(!t.armatureName)throw new Error("The dragonBone component on "+this.gameObject.name+", armatureName is required!");Object.assign(this,t),this.autoPlay&&this.play(this.animationName)}},a.prototype.play=function(t,e){t&&(this.animationName=t),this.armature?this.armature.play(this.animationName,e):(this.waitPlayInfo={animationName:t,times:e},this.waitPlay=!0)},a.prototype.stop=function(t){this.armature?this.armature.stop(t):(this.waitPlayInfo={animationName:t},this.waitStop=!0),this.animationName=null},Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},set:function(t){if(this._armature=t,t){var e=this.waitPlayInfo,a=e.animationName,i=e.times;this.waitPlay&&this.play(a,i),this.waitStop&&this.stop(a),this.waitPlay=!1,this.waitStop=!1}},enumerable:!1,configurable:!0}),a.prototype.onDestroy=function(){this.removeAllListeners()},a.componentName="DragonBone",s([t.type("string")],a.prototype,"resource",void 0),s([t.type("string")],a.prototype,"armatureName",void 0),s([t.type("string")],a.prototype,"animationName",void 0),s([t.type("boolean")],a.prototype,"autoPlay",void 0),a}(e.Component),u=h;const _={Texture:a.Texture,Rectangle:a.Rectangle,Sprite:a.Sprite,Graphics:a.Graphics,BLEND_MODES:a.BLEND_MODES,mesh:a.mesh,ticker:a.ticker};var f,m,p,c=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])};return function(e,a){function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}();!function(t){var e=function(){function e(a){this._clock=new t.WorldClock,this._events=[],this._objects=[],this._eventManager=null,this._eventManager=a,console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}return e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,i=this._objects;a<i.length;a++){i[a].returnToPool()}this._objects.length=0}if(this._clock.advanceTime(e),this._events.length>0){for(var r=0;r<this._events.length;++r){var n=this._events[r],s=n.armature;null!==s._armatureData&&(s.eventDispatcher.dispatchDBEvent(n.type,n),n.type===t.EventObject.SOUND_EVENT&&this._eventManager.dispatchDBEvent(n.type,n)),this.bufferObject(n)}this._events.length=0}},e.prototype.bufferEvent=function(t){this._events.indexOf(t)<0&&this._events.push(t)},e.prototype.bufferObject=function(t){this._objects.indexOf(t)<0&&this._objects.push(t)},Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventManager",{get:function(){return this._eventManager},enumerable:!0,configurable:!0}),e.VERSION="5.7.000",e.yDown=!0,e.debug=!1,e.debugDraw=!1,e}();t.DragonBones=e}(f||(f={})),console.warn||(console.warn=function(){}),console.assert||(console.assert=function(){}),Date.now||(Date.now=function(){return(new Date).getTime()}),function(t){var e=function(){function t(){this.hashCode=t._hashCode++,this._isInPool=!1}return t._returnObject=function(e){var a=String(e.constructor),i=a in t._maxCountMap?t._maxCountMap[a]:t._defaultMaxCount,r=t._poolsMap[a]=t._poolsMap[a]||[];r.length<i&&(e._isInPool?console.warn("The object is already in the pool."):(e._isInPool=!0,r.push(e)))},t.toString=function(){throw new Error},t.setMaxCount=function(e,a){if((a<0||a!=a)&&(a=0),null!==e)null!==(r=(i=String(e))in t._poolsMap?t._poolsMap[i]:null)&&r.length>a&&(r.length=a),t._maxCountMap[i]=a;else for(var i in t._defaultMaxCount=a,t._poolsMap){var r;(r=t._poolsMap[i]).length>a&&(r.length=a),i in t._maxCountMap&&(t._maxCountMap[i]=a)}},t.clearPool=function(e){if(void 0===e&&(e=null),null!==e){var a=String(e);null!==(r=a in t._poolsMap?t._poolsMap[a]:null)&&r.length>0&&(r.length=0)}else for(var i in t._poolsMap){var r;(r=t._poolsMap[i]).length=0}},t.borrowObject=function(e){var a=String(e),i=a in t._poolsMap?t._poolsMap[a]:null;if(null!==i&&i.length>0){var r=i.pop();return r._isInPool=!1,r}var n=new e;return n._onClear(),n},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._maxCountMap={},t._poolsMap={},t}();t.BaseObject=e}(f||(f={})),function(t){var e=function(){function t(t,e,a,i,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===n&&(n=0),this.a=t,this.b=e,this.c=a,this.d=i,this.tx=r,this.ty=n}return t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.copyFromArray=function(t,e){return void 0===e&&(e=0),this.a=t[e],this.b=t[e+1],this.c=t[e+2],this.d=t[e+3],this.tx=t[e+4],this.ty=t[e+5],this},t.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this},t.prototype.concat=function(t){var e=this.a*t.a,a=0,i=0,r=this.d*t.d,n=this.tx*t.a+t.tx,s=this.ty*t.d+t.ty;return 0===this.b&&0===this.c||(e+=this.b*t.c,a+=this.b*t.d,i+=this.c*t.a,r+=this.c*t.b),0===t.b&&0===t.c||(a+=this.a*t.b,i+=this.d*t.c,n+=this.ty*t.c,s+=this.tx*t.b),this.a=e,this.b=a,this.c=i,this.d=r,this.tx=n,this.ty=s,this},t.prototype.invert=function(){var t=this.a,e=this.b,a=this.c,i=this.d,r=this.tx,n=this.ty;if(0===e&&0===a)return this.b=this.c=0,0===t||0===i?this.a=this.b=this.tx=this.ty=0:(t=this.a=1/t,i=this.d=1/i,this.tx=-t*r,this.ty=-i*n),this;var s=t*i-e*a;if(0===s)return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;s=1/s;var o=this.a=i*s;return e=this.b=-e*s,a=this.c=-a*s,i=this.d=t*s,this.tx=-(o*r+a*n),this.ty=-(e*r+i*n),this},t.prototype.transformPoint=function(t,e,a,i){void 0===i&&(i=!1),a.x=this.a*t+this.c*e,a.y=this.b*t+this.d*e,i||(a.x+=this.tx,a.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void 0===e&&(e=!1);var a=this.a,i=this.b,r=this.c,n=this.d,s=e?0:this.tx,o=e?0:this.ty,l=t.x,h=t.y,u=l+t.width,_=h+t.height,f=a*l+r*h+s,m=i*l+n*h+o,p=a*u+r*h+s,c=i*u+n*h+o,y=a*u+r*_+s,d=i*u+n*_+o,g=a*l+r*_+s,D=i*l+n*_+o,v=0;f>p&&(v=f,f=p,p=v),y>g&&(v=y,y=g,g=v),t.x=Math.floor(f<y?f:y),t.width=Math.ceil((p>g?p:g)-t.x),m>c&&(v=m,m=c,c=v),d>D&&(v=d,d=D,D=v),t.y=Math.floor(m<d?m:d),t.height=Math.ceil((c>D?c:D)-t.y)},t}();t.Matrix=e}(f||(f={})),function(t){var e=function(){function t(t,e,a,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=1),this.x=t,this.y=e,this.skew=a,this.rotation=i,this.scaleX=r,this.scaleY=n}return t.normalizeRadian=function(t){return t=(t+Math.PI)%(2*Math.PI),t+=t>0?-Math.PI:Math.PI},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skew/Math.PI+" skewY:"+180*this.rotation/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skew=t.skew,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=0,this.skew=this.rotation=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skew+=t.skew,this.rotation+=t.rotation,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(t){return this.x-=t.x,this.y-=t.y,this.skew-=t.skew,this.rotation-=t.rotation,this.scaleX/=t.scaleX,this.scaleY/=t.scaleY,this},t.prototype.fromMatrix=function(e){var a=this.scaleX,i=this.scaleY,r=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);return this.scaleX=this.rotation>-r&&this.rotation<r?e.a/Math.cos(this.rotation):e.b/Math.sin(this.rotation),this.scaleY=n>-r&&n<r?e.d/Math.cos(n):-e.c/Math.sin(n),a>=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.rotation=this.rotation-Math.PI),i>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,n-=Math.PI),this.skew=n-this.rotation,this},t.prototype.toMatrix=function(t){return 0===this.rotation?(t.a=1,t.b=0):(t.a=Math.cos(this.rotation),t.b=Math.sin(this.rotation)),0===this.skew?(t.c=-t.b,t.d=t.a):(t.c=-Math.sin(this.skew+this.rotation),t.d=Math.cos(this.skew+this.rotation)),1!==this.scaleX&&(t.a*=this.scaleX,t.b*=this.scaleX),1!==this.scaleY&&(t.c*=this.scaleY,t.d*=this.scaleY),t.tx=this.x,t.ty=this.y,this},t.PI=Math.PI,t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.RAD_DEG=180/Math.PI,t.DEG_RAD=Math.PI/180,t}();t.Transform=e}(f||(f={})),function(t){var e=function(){function t(t,e,a,i,r,n,s,o){void 0===t&&(t=1),void 0===e&&(e=1),void 0===a&&(a=1),void 0===i&&(i=1),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=a,this.blueMultiplier=i,this.alphaOffset=r,this.redOffset=n,this.greenOffset=s,this.blueOffset=o}return t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.greenMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffset=t.alphaOffset,this.redOffset=t.redOffset,this.greenOffset=t.greenOffset,this.blueOffset=t.blueOffset},t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1,this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0},t}();t.ColorTransform=e}(f||(f={})),function(t){var e=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t}();t.Point=e}(f||(f={})),function(t){var e=function(){function t(t,e,a,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=a,this.height=i}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.clear=function(){this.x=this.y=0,this.width=this.height=0},t}();t.Rectangle=e}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ints=[],e.floats=[],e.strings=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.UserData]"},e.prototype._onClear=function(){this.ints.length=0,this.floats.length=0,this.strings.length=0},e.prototype.addInt=function(t){this.ints.push(t)},e.prototype.addFloat=function(t){this.floats.push(t)},e.prototype.addString=function(t){this.strings.push(t)},e.prototype.getInt=function(t){return void 0===t&&(t=0),t>=0&&t<this.ints.length?this.ints[t]:0},e.prototype.getFloat=function(t){return void 0===t&&(t=0),t>=0&&t<this.floats.length?this.floats[t]:0},e.prototype.getString=function(t){return void 0===t&&(t=0),t>=0&&t<this.strings.length?this.strings[t]:""},e}(t.BaseObject);t.UserData=e;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.ActionData]"},e.prototype._onClear=function(){null!==this.data&&this.data.returnToPool(),this.type=0,this.name="",this.bone=null,this.slot=null,this.data=null},e}(t.BaseObject);t.ActionData=a}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameIndices=[],e.cachedFrames=[],e.armatureNames=[],e.armatures={},e.userData=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.DragonBonesData]"},e.prototype._onClear=function(){for(var t in this.armatures)this.armatures[t].returnToPool(),delete this.armatures[t];null!==this.userData&&this.userData.returnToPool(),this.autoSearch=!1,this.frameRate=0,this.version="",this.name="",this.stage=null,this.frameIndices.length=0,this.cachedFrames.length=0,this.armatureNames.length=0,this.binary=null,this.intArray=null,this.floatArray=null,this.frameIntArray=null,this.frameFloatArray=null,this.frameArray=null,this.timelineArray=null,this.colorArray=null,this.userData=null},e.prototype.addArmature=function(t){t.name in this.armatures?console.warn("Same armature: "+t.name):(t.parent=this,this.armatures[t.name]=t,this.armatureNames.push(t.name))},e.prototype.getArmature=function(t){return t in this.armatures?this.armatures[t]:null},e}(t.BaseObject);t.DragonBonesData=e}(f||(f={})),function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.aabb=new t.Rectangle,a.animationNames=[],a.sortedBones=[],a.sortedSlots=[],a.defaultActions=[],a.actions=[],a.bones={},a.slots={},a.constraints={},a.skins={},a.animations={},a.canvas=null,a.userData=null,a}return c(a,e),a.toString=function(){return"[class dragonBones.ArmatureData]"},a.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++){e[t].returnToPool()}for(var a=0,i=this.actions;a<i.length;a++){i[a].returnToPool()}for(var r in this.bones)this.bones[r].returnToPool(),delete this.bones[r];for(var r in this.slots)this.slots[r].returnToPool(),delete this.slots[r];for(var r in this.constraints)this.constraints[r].returnToPool(),delete this.constraints[r];for(var r in this.skins)this.skins[r].returnToPool(),delete this.skins[r];for(var r in this.animations)this.animations[r].returnToPool(),delete this.animations[r];null!==this.canvas&&this.canvas.returnToPool(),null!==this.userData&&this.userData.returnToPool(),this.type=0,this.frameRate=0,this.cacheFrameRate=0,this.scale=1,this.name="",this.aabb.clear(),this.animationNames.length=0,this.sortedBones.length=0,this.sortedSlots.length=0,this.defaultActions.length=0,this.actions.length=0,this.defaultSkin=null,this.defaultAnimation=null,this.canvas=null,this.userData=null,this.parent=null},a.prototype.sortBones=function(){var t=this.sortedBones.length;if(!(t<=0)){var e=this.sortedBones.concat(),a=0,i=0;for(this.sortedBones.length=0;i<t;){var r=e[a++];if(a>=t&&(a=0),!(this.sortedBones.indexOf(r)>=0)){var n=!1;for(var s in this.constraints){var o=this.constraints[s];if(o.root===r&&this.sortedBones.indexOf(o.target)<0){n=!0;break}}n||null!==r.parent&&this.sortedBones.indexOf(r.parent)<0||(this.sortedBones.push(r),i++)}}}},a.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0))for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames,i=a.length;return a.length+=10,a[i]=t.a,a[i+1]=t.b,a[i+2]=t.c,a[i+3]=t.d,a[i+4]=t.tx,a[i+5]=t.ty,a[i+6]=e.rotation,a[i+7]=e.skew,a[i+8]=e.scaleX,a[i+9]=e.scaleY,i},a.prototype.getCacheFrame=function(t,e,a){var i=this.parent.cachedFrames;t.a=i[a],t.b=i[a+1],t.c=i[a+2],t.d=i[a+3],t.tx=i[a+4],t.ty=i[a+5],e.rotation=i[a+6],e.skew=i[a+7],e.scaleX=i[a+8],e.scaleY=i[a+9],e.x=t.tx,e.y=t.ty},a.prototype.addBone=function(t){t.name in this.bones?console.warn("Same bone: "+t.name):(this.bones[t.name]=t,this.sortedBones.push(t))},a.prototype.addSlot=function(t){t.name in this.slots?console.warn("Same slot: "+t.name):(this.slots[t.name]=t,this.sortedSlots.push(t))},a.prototype.addConstraint=function(t){t.name in this.constraints?console.warn("Same constraint: "+t.name):this.constraints[t.name]=t},a.prototype.addSkin=function(t){t.name in this.skins?console.warn("Same skin: "+t.name):(t.parent=this,this.skins[t.name]=t,null===this.defaultSkin&&(this.defaultSkin=t),"default"===t.name&&(this.defaultSkin=t))},a.prototype.addAnimation=function(t){t.name in this.animations?console.warn("Same animation: "+t.name):(t.parent=this,this.animations[t.name]=t,this.animationNames.push(t.name),null===this.defaultAnimation&&(this.defaultAnimation=t))},a.prototype.addAction=function(t,e){e?this.defaultActions.push(t):this.actions.push(t)},a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null},a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null},a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null},a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null},a.prototype.getMesh=function(t,e,a){var i=this.getSkin(t);return null===i?null:i.getDisplay(e,a)},a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null},a}(t.BaseObject);t.ArmatureData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.transform=new t.Transform,a.userData=null,a}return c(a,e),a.toString=function(){return"[class dragonBones.BoneData]"},a.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.inheritTranslation=!1,this.inheritRotation=!1,this.inheritScale=!1,this.inheritReflection=!1,this.type=0,this.length=0,this.alpha=1,this.name="",this.transform.identity(),this.userData=null,this.parent=null},a}(t.BaseObject);t.BoneData=a;var i=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.geometry=new t.GeometryData,a}return c(a,e),a.toString=function(){return"[class dragonBones.SurfaceData]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.geometry.clear()},a}(a);t.SurfaceData=i;var r=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.color=null,t.userData=null,t}return c(a,e),a.createColor=function(){return new t.ColorTransform},a.toString=function(){return"[class dragonBones.SlotData]"},a.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.blendMode=0,this.displayIndex=0,this.zOrder=0,this.zIndex=0,this.alpha=1,this.name="",this.color=null,this.userData=null,this.parent=null},a.DEFAULT_COLOR=new t.ColorTransform,a}(t.BaseObject);t.SlotData=r}(f||(f={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._onClear=function(){this.order=0,this.name="",this.type=0,this.target=null,this.root=null,this.bone=null},e}(t.BaseObject);t.ConstraintData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.IKConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.scaleEnabled=!1,this.bendPositive=!1,this.weight=1},e}(e);t.IKConstraintData=a;var i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.PathConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.pathSlot=null,this.pathDisplayData=null,this.bones.length=0,this.positionMode=0,this.spacingMode=1,this.rotateMode=1,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=0,this.translateMix=0},e.prototype.AddBone=function(t){this.bones.push(t)},e}(e);t.PathConstraintData=i}(f||(f={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.CanvasData]"},e.prototype._onClear=function(){this.hasBackground=!1,this.color=0,this.x=0,this.y=0,this.width=0,this.height=0},e}(t.BaseObject);t.CanvasData=e}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return c(e,t),e.toString=function(){return"[class dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays){for(var e=0,a=this.displays[t];e<a.length;e++){var i=a[e];null!==i&&i.returnToPool()}delete this.displays[t]}this.name="",this.parent=null},e.prototype.addDisplay=function(t,e){t in this.displays||(this.displays[t]=[]),null!==e&&(e.parent=this),this.displays[t].push(e)},e.prototype.getDisplay=function(t,e){var a=this.getDisplays(t);if(null!==a)for(var i=0,r=a;i<r.length;i++){var n=r[i];if(null!==n&&n.name===e)return n}return null},e.prototype.getDisplays=function(t){return t in this.displays?this.displays[t]:null},e}(t.BaseObject);t.SkinData=e}(f||(f={})),function(t){var e=function(){function t(){this.weight=null}return t.prototype.clear=function(){this.isShared||null===this.weight||this.weight.returnToPool(),this.isShared=!1,this.inheritDeform=!1,this.offset=0,this.data=null,this.weight=null},t.prototype.shareFrom=function(t){this.isShared=!0,this.offset=t.offset,this.weight=t.weight},Object.defineProperty(t.prototype,"vertexCount",{get:function(){return this.data.intArray[this.offset+0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"triangleCount",{get:function(){return this.data.intArray[this.offset+1]},enumerable:!0,configurable:!0}),t}();t.GeometryData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.transform=new t.Transform,a}return c(a,e),a.prototype._onClear=function(){this.name="",this.path="",this.transform.identity(),this.parent=null},a}(t.BaseObject);t.DisplayData=a;var i=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.pivot=new t.Point,a}return c(a,e),a.toString=function(){return"[class dragonBones.ImageDisplayData]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=0,this.pivot.clear(),this.texture=null},a}(a);t.ImageDisplayData=i;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.actions=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.ArmatureDisplayData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this);for(var e=0,a=this.actions;e<a.length;e++){a[e].returnToPool()}this.type=1,this.inheritAnimation=!1,this.actions.length=0,this.armature=null},e.prototype.addAction=function(t){this.actions.push(t)},e}(a);t.ArmatureDisplayData=r;var n=function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.geometry=new e,a}return c(a,t),a.toString=function(){return"[class dragonBones.MeshDisplayData]"},a.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.geometry.clear(),this.texture=null},a}(a);t.MeshDisplayData=n;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boundingBox=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.BoundingBoxDisplayData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),null!==this.boundingBox&&this.boundingBox.returnToPool(),this.type=3,this.boundingBox=null},e}(a);t.BoundingBoxDisplayData=s;var o=function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.geometry=new e,a.curveLengths=[],a}return c(a,t),a.toString=function(){return"[class dragonBones.PathDisplayData]"},a.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=4,this.closed=!1,this.constantSpeed=!1,this.geometry.clear(),this.curveLengths.length=0},a}(a);t.PathDisplayData=o;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.WeightData]"},e.prototype._onClear=function(){this.count=0,this.offset=0,this.bones.length=0},e.prototype.addBone=function(t){this.bones.push(t)},e}(t.BaseObject);t.WeightData=l}(f||(f={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._onClear=function(){this.color=0,this.width=0,this.height=0},e}(t.BaseObject);t.BoundingBoxData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.RectangleBoundingBoxData]"},e._computeOutCode=function(t,e,a,i,r,n){var s=0;return t<a?s|=1:t>r&&(s|=2),e<i?s|=4:e>n&&(s|=8),s},e.rectangleIntersectsSegment=function(t,a,i,r,n,s,o,l,h,u,_){void 0===h&&(h=null),void 0===u&&(u=null),void 0===_&&(_=null);var f=t>n&&t<o&&a>s&&a<l,m=i>n&&i<o&&r>s&&r<l;if(f&&m)return-1;for(var p=0,c=e._computeOutCode(t,a,n,s,o,l),y=e._computeOutCode(i,r,n,s,o,l);;){if(!(c|y)){p=2;break}if(c&y)break;var d=0,g=0,D=0,v=0!==c?c:y;4&v?(d=t+(i-t)*(s-a)/(r-a),g=s,null!==_&&(D=.5*-Math.PI)):8&v?(d=t+(i-t)*(l-a)/(r-a),g=l,null!==_&&(D=.5*Math.PI)):2&v?(g=a+(r-a)*(o-t)/(i-t),d=o,null!==_&&(D=0)):1&v&&(g=a+(r-a)*(n-t)/(i-t),d=n,null!==_&&(D=Math.PI)),v===c?(t=d,a=g,c=e._computeOutCode(t,a,n,s,o,l),null!==_&&(_.x=D)):(i=d,r=g,y=e._computeOutCode(i,r,n,s,o,l),null!==_&&(_.y=D))}return p&&(f?(p=2,null!==h&&(h.x=i,h.y=r),null!==u&&(u.x=i,u.y=i),null!==_&&(_.x=_.y+Math.PI)):m?(p=1,null!==h&&(h.x=t,h.y=a),null!==u&&(u.x=t,u.y=a),null!==_&&(_.y=_.x+Math.PI)):(p=3,null!==h&&(h.x=t,h.y=a),null!==u&&(u.x=i,u.y=r))),p},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=0},e.prototype.containsPoint=function(t,e){var a=.5*this.width;if(t>=-a&&t<=a){var i=.5*this.height;if(e>=-i&&e<=i)return!0}return!1},e.prototype.intersectsSegment=function(t,a,i,r,n,s,o){void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null);var l=.5*this.width,h=.5*this.height;return e.rectangleIntersectsSegment(t,a,i,r,-l,-h,l,h,n,s,o)},e}(e);t.RectangleBoundingBoxData=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,a,i,r,n,s,o,l,h,u){void 0===l&&(l=null),void 0===h&&(h=null),void 0===u&&(u=null);var _=s/o,f=_*_,m=a-t,p=(i*=_)-(e*=_),c=Math.sqrt(m*m+p*p),y=m/c,d=p/c,g=(r-t)*y+(n-e)*d,D=s*s,v=D-(t*t+e*e)+g*g,T=0;if(v>=0){var b=Math.sqrt(v),A=g-b,P=g+b,S=A<0?-1:A<=c?0:1,O=P<0?-1:P<=c?0:1,x=S*O;if(x<0)return-1;0===x&&(-1===S?(T=2,a=t+P*y,i=(e+P*d)/_,null!==l&&(l.x=a,l.y=i),null!==h&&(h.x=a,h.y=i),null!==u&&(u.x=Math.atan2(i/D*f,a/D),u.y=u.x+Math.PI)):1===O?(T=1,t+=A*y,e=(e+A*d)/_,null!==l&&(l.x=t,l.y=e),null!==h&&(h.x=t,h.y=e),null!==u&&(u.x=Math.atan2(e/D*f,t/D),u.y=u.x+Math.PI)):(T=3,null!==l&&(l.x=t+A*y,l.y=(e+A*d)/_,null!==u&&(u.x=Math.atan2(l.y/D*f,l.x/D))),null!==h&&(h.x=t+P*y,h.y=(e+P*d)/_,null!==u&&(u.y=Math.atan2(h.y/D*f,h.x/D)))))}return T},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,e){var a=.5*this.width;if(t>=-a&&t<=a){var i=.5*this.height;if(e>=-i&&e<=i)return e*=a/i,Math.sqrt(t*t+e*e)<=a}return!1},e.prototype.intersectsSegment=function(t,a,i,r,n,s,o){return void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),e.ellipseIntersectsSegment(t,a,i,r,0,0,.5*this.width,.5*this.height,n,s,o)},e}(e);t.EllipseBoundingBoxData=i;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,a,i,r,n,s,o){void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),t===a&&(t=a+1e-6),e===i&&(e=i+1e-6);for(var l=r.length,h=t-a,u=e-i,_=t*i-e*a,f=0,m=r[l-2],p=r[l-1],c=0,y=0,d=0,g=0,D=0,v=0,T=0;T<l;T+=2){var b=r[T],A=r[T+1];m===b&&(m=b+1e-4),p===A&&(p=A+1e-4);var P=m-b,S=p-A,O=m*A-p*b,x=h*S-u*P,E=(_*P-h*O)/x;if((E>=m&&E<=b||E>=b&&E<=m)&&(0===h||E>=t&&E<=a||E>=a&&E<=t)){var M=(_*S-u*O)/x;if((M>=p&&M<=A||M>=A&&M<=p)&&(0===u||M>=e&&M<=i||M>=i&&M<=e)){if(null===s){d=E,g=M,D=E,v=M,f++,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI,o.y=o.x);break}var B=E-t;B<0&&(B=-B),0===f?(c=B,y=B,d=E,g=M,D=E,v=M,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI,o.y=o.x)):(B<c&&(c=B,d=E,g=M,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI)),B>y&&(y=B,D=E,v=M,null!==o&&(o.y=Math.atan2(A-p,b-m)-.5*Math.PI))),f++}}m=b,p=A}return 1===f?(null!==n&&(n.x=d,n.y=g),null!==s&&(s.x=d,s.y=g),null!==o&&(o.y=o.x+Math.PI)):f>1&&(f++,null!==n&&(n.x=d,n.y=g),null!==s&&(s.x=D,s.y=v)),f},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.x=0,this.y=0,this.vertices.length=0},e.prototype.containsPoint=function(t,e){var a=!1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var i=0,r=this.vertices.length,n=r-2;i<r;i+=2){var s=this.vertices[n+1],o=this.vertices[i+1];if(o<e&&s>=e||s<e&&o>=e){var l=this.vertices[n],h=this.vertices[i];(e-o)*(l-h)/(s-o)+h<t&&(a=!a)}n=i}return a},e.prototype.intersectsSegment=function(t,i,r,n,s,o,l){void 0===s&&(s=null),void 0===o&&(o=null),void 0===l&&(l=null);var h=0;return 0!==a.rectangleIntersectsSegment(t,i,r,n,this.x,this.y,this.x+this.width,this.y+this.height,null,null,null)&&(h=e.polygonIntersectsSegment(t,i,r,n,this.vertices,s,o,l)),h},e}(e);t.PolygonBoundingBoxData=r}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cachedFrames=[],e.boneTimelines={},e.slotTimelines={},e.constraintTimelines={},e.animationTimelines={},e.boneCachedFrameIndices={},e.slotCachedFrameIndices={},e.actionTimeline=null,e.zOrderTimeline=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationData]"},e.prototype._onClear=function(){for(var t in this.boneTimelines){for(var e=0,a=this.boneTimelines[t];e<a.length;e++){a[e].returnToPool()}delete this.boneTimelines[t]}for(var t in this.slotTimelines){for(var i=0,r=this.slotTimelines[t];i<r.length;i++){r[i].returnToPool()}delete this.slotTimelines[t]}for(var t in this.constraintTimelines){for(var n=0,s=this.constraintTimelines[t];n<s.length;n++){s[n].returnToPool()}delete this.constraintTimelines[t]}for(var t in this.animationTimelines){for(var o=0,l=this.animationTimelines[t];o<l.length;o++){l[o].returnToPool()}delete this.animationTimelines[t]}for(var t in this.boneCachedFrameIndices)delete this.boneCachedFrameIndices[t];for(var t in this.slotCachedFrameIndices)delete this.slotCachedFrameIndices[t];null!==this.actionTimeline&&this.actionTimeline.returnToPool(),null!==this.zOrderTimeline&&this.zOrderTimeline.returnToPool(),this.frameIntOffset=0,this.frameFloatOffset=0,this.frameOffset=0,this.blendType=0,this.frameCount=0,this.playTimes=0,this.duration=0,this.scale=1,this.fadeInTime=0,this.cacheFrameRate=0,this.name="",this.cachedFrames.length=0,this.actionTimeline=null,this.zOrderTimeline=null,this.parent=null},e.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0)){this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,i=this.cacheFrames.length;a<i;++a)this.cachedFrames[a]=!1;for(var r=0,n=this.parent.sortedBones;r<n.length;r++){var s=n[r];for(a=0,i=(h=new Array(e)).length;a<i;++a)h[a]=-1;this.boneCachedFrameIndices[s.name]=h}for(var o=0,l=this.parent.sortedSlots;o<l.length;o++){var h,u=l[o];for(a=0,i=(h=new Array(e)).length;a<i;++a)h[a]=-1;this.slotCachedFrameIndices[u.name]=h}}},e.prototype.addBoneTimeline=function(t,e){var a=t in this.boneTimelines?this.boneTimelines[t]:this.boneTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addSlotTimeline=function(t,e){var a=t in this.slotTimelines?this.slotTimelines[t]:this.slotTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addConstraintTimeline=function(t,e){var a=t in this.constraintTimelines?this.constraintTimelines[t]:this.constraintTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addAnimationTimeline=function(t,e){var a=t in this.animationTimelines?this.animationTimelines[t]:this.animationTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?this.boneTimelines[t]:null},e.prototype.getSlotTimelines=function(t){return t in this.slotTimelines?this.slotTimelines[t]:null},e.prototype.getConstraintTimelines=function(t){return t in this.constraintTimelines?this.constraintTimelines[t]:null},e.prototype.getAnimationTimelines=function(t){return t in this.animationTimelines?this.animationTimelines[t]:null},e.prototype.getBoneCachedFrameIndices=function(t){return t in this.boneCachedFrameIndices?this.boneCachedFrameIndices[t]:null},e.prototype.getSlotCachedFrameIndices=function(t){return t in this.slotCachedFrameIndices?this.slotCachedFrameIndices[t]:null},e}(t.BaseObject);t.AnimationData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.TimelineData]"},e.prototype._onClear=function(){this.type=10,this.offset=0,this.frameIndicesOffset=-1},e}(t.BaseObject);t.TimelineData=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationTimelineData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.x=0,this.y=0},e}(a);t.AnimationTimelineData=i}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boneMask=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationConfig]"},e.prototype._onClear=function(){this.pauseFadeOut=!0,this.fadeOutMode=4,this.fadeOutTweenType=1,this.fadeOutTime=-1,this.actionEnabled=!0,this.additive=!1,this.displayControl=!0,this.pauseFadeIn=!0,this.resetToPose=!0,this.fadeInTweenType=1,this.playTimes=-1,this.layer=0,this.position=0,this.duration=-1,this.timeScale=-100,this.weight=1,this.fadeInTime=-1,this.autoFadeOutTime=-1,this.name="",this.animation="",this.group="",this.boneMask.length=0},e.prototype.clear=function(){this._onClear()},e.prototype.copyFrom=function(t){this.pauseFadeOut=t.pauseFadeOut,this.fadeOutMode=t.fadeOutMode,this.autoFadeOutTime=t.autoFadeOutTime,this.fadeOutTweenType=t.fadeOutTweenType,this.actionEnabled=t.actionEnabled,this.additive=t.additive,this.displayControl=t.displayControl,this.pauseFadeIn=t.pauseFadeIn,this.resetToPose=t.resetToPose,this.playTimes=t.playTimes,this.layer=t.layer,this.position=t.position,this.duration=t.duration,this.timeScale=t.timeScale,this.fadeInTime=t.fadeInTime,this.fadeOutTime=t.fadeOutTime,this.fadeInTweenType=t.fadeInTweenType,this.weight=t.weight,this.name=t.name,this.animation=t.animation,this.group=t.group,this.boneMask.length=t.boneMask.length;for(var e=0,a=this.boneMask.length;e<a;++e)this.boneMask[e]=t.boneMask[e]},e}(t.BaseObject);t.AnimationConfig=e}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.textures={},e}return c(e,t),e.prototype._onClear=function(){for(var t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];this.autoSearch=!1,this.width=0,this.height=0,this.scale=1,this.name="",this.imagePath=""},e.prototype.copyFrom=function(t){for(var e in this.autoSearch=t.autoSearch,this.scale=t.scale,this.width=t.width,this.height=t.height,this.name=t.name,this.imagePath=t.imagePath,this.textures)this.textures[e].returnToPool(),delete this.textures[e];for(var e in t.textures){var a=this.createTexture();a.copyFrom(t.textures[e]),this.textures[e]=a}},e.prototype.addTexture=function(t){t.name in this.textures?console.warn("Same texture: "+t.name):(t.parent=this,this.textures[t.name]=t)},e.prototype.getTexture=function(t){return t in this.textures?this.textures[t]:null},e}(t.BaseObject);t.TextureAtlasData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.region=new t.Rectangle,a.frame=null,a}return c(a,e),a.createRectangle=function(){return new t.Rectangle},a.prototype._onClear=function(){this.rotated=!1,this.name="",this.region.clear(),this.parent=null,this.frame=null},a.prototype.copyFrom=function(t){this.rotated=t.rotated,this.name=t.name,this.region.copyFrom(t.region),this.parent=t.parent,null===this.frame&&null!==t.frame?this.frame=a.createRectangle():null!==this.frame&&null===t.frame&&(this.frame=null),null!==this.frame&&null!==t.frame&&this.frame.copyFrom(t.frame)},a}(t.BaseObject);t.TextureData=a}(f||(f={})),m=f||(f={}),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._bones=[],e._slots=[],e._constraints=[],e._actions=[],e._animation=null,e._proxy=null,e._replaceTextureAtlasData=null,e._clock=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.Armature]"},e._onSortSlots=function(t,e){return 1e3*t._zIndex+t._zOrder>1e3*e._zIndex+e._zOrder?1:-1},e.prototype._onClear=function(){null!==this._clock&&this._clock.remove(this);for(var t=0,e=this._bones;t<e.length;t++)e[t].returnToPool();for(var a=0,i=this._slots;a<i.length;a++)i[a].returnToPool();for(var r=0,n=this._constraints;r<n.length;r++)n[r].returnToPool();for(var s=0,o=this._actions;s<o.length;s++)o[s].returnToPool();null!==this._animation&&this._animation.returnToPool(),null!==this._proxy&&this._proxy.dbClear(),null!==this._replaceTextureAtlasData&&this._replaceTextureAtlasData.returnToPool(),this.inheritAnimation=!0,this.userData=null,this._lockUpdate=!1,this._slotsDirty=!0,this._zOrderDirty=!1,this._zIndexDirty=!1,this._alphaDirty=!0,this._flipX=!1,this._flipY=!1,this._cacheFrameIndex=-1,this._alpha=1,this._globalAlpha=1,this._bones.length=0,this._slots.length=0,this._constraints.length=0,this._actions.length=0,this._armatureData=null,this._animation=null,this._proxy=null,this._display=null,this._replaceTextureAtlasData=null,this._replacedTexture=null,this._dragonBones=null,this._clock=null,this._parent=null},e.prototype._sortZOrder=function(t,e){var a=this._armatureData.sortedSlots,i=null===t;if(this._zOrderDirty||!i){for(var r=0,n=a.length;r<n;++r){var s=i?r:t[e+r];if(!(s<0||s>=n)){var o=a[s],l=this.getSlot(o.name);null!==l&&l._setZOrder(r)}}this._slotsDirty=!0,this._zOrderDirty=!i}},e.prototype._addBone=function(t){this._bones.indexOf(t)<0&&this._bones.push(t)},e.prototype._addSlot=function(t){this._slots.indexOf(t)<0&&this._slots.push(t)},e.prototype._addConstraint=function(t){this._constraints.indexOf(t)<0&&this._constraints.push(t)},e.prototype._bufferAction=function(t,e){this._actions.indexOf(t)<0&&(e?this._actions.push(t):this._actions.unshift(t))},e.prototype.dispose=function(){null!==this._armatureData&&(this._lockUpdate=!0,this._dragonBones.bufferObject(this))},e.prototype.init=function(t,e,a,i){null===this._armatureData&&(this._armatureData=t,this._animation=m.BaseObject.borrowObject(m.Animation),this._proxy=e,this._display=a,this._dragonBones=i,this._proxy.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureData.animations)},e.prototype.advanceTime=function(t){if(!this._lockUpdate)if(this._lockUpdate=!0,null!==this._armatureData)if(null!==this._armatureData.parent){var a=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._slotsDirty||this._zIndexDirty){if(this._slots.sort(e._onSortSlots),this._zIndexDirty)for(var i=0,r=this._slots.length;i<r;++i)this._slots[i]._setZOrder(i);this._slotsDirty=!1,this._zIndexDirty=!1}if(this._alphaDirty){this._alphaDirty=!1,this._globalAlpha=this._alpha*(null!==this._parent?this._parent._globalAlpha:1);for(var n=0,s=this._bones;n<s.length;n++)s[n]._updateAlpha();for(var o=0,l=this._slots;o<l.length;o++)(c=l[o])._updateAlpha()}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==a){for(i=0,r=0,i=0,r=this._bones.length;i<r;++i)this._bones[i].update(this._cacheFrameIndex);for(i=0,r=this._slots.length;i<r;++i)this._slots[i].update(this._cacheFrameIndex)}if(this._actions.length>0){for(var h=0,u=this._actions;h<u.length;h++){var _=u[h],f=_.actionData;if(null!==f&&0===f.type)if(null!==_.slot)null!==(y=_.slot.childArmature)&&y.animation.fadeIn(f.name);else if(null!==_.bone)for(var m=0,p=this.getSlots();m<p.length;m++){var c,y;(c=p[m]).parent===_.bone&&null!==(y=c.childArmature)&&y.animation.fadeIn(f.name)}else this._animation.fadeIn(f.name);_.returnToPool()}this._actions.length=0}this._lockUpdate=!1,this._proxy.dbUpdate()}else console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");else console.warn("The armature has been disposed.")},e.prototype.invalidUpdate=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=!1),null!==t&&t.length>0){if(null!==(s=this.getBone(t))&&(s.invalidUpdate(),e))for(var a=0,i=this._slots;a<i.length;a++)(h=i[a]).parent===s&&h.invalidUpdate()}else{for(var r=0,n=this._bones;r<n.length;r++){var s;(s=n[r]).invalidUpdate()}if(e)for(var o=0,l=this._slots;o<l.length;o++){var h;(h=l[o]).invalidUpdate()}}},e.prototype.containsPoint=function(t,e){for(var a=0,i=this._slots;a<i.length;a++){var r=i[a];if(r.containsPoint(t,e))return r}return null},e.prototype.intersectsSegment=function(t,e,a,i,r,n,s){void 0===r&&(r=null),void 0===n&&(n=null),void 0===s&&(s=null);for(var o=t===a,l=0,h=0,u=0,_=0,f=0,m=0,p=0,c=0,y=null,d=null,g=0,D=this._slots;g<D.length;g++){var v=D[g];if(v.intersectsSegment(t,e,a,i,r,n,s)>0){if(null===r&&null===n){y=v;break}var T;null!==r&&((T=o?r.y-e:r.x-t)<0&&(T=-T),(null===y||T<l)&&(l=T,u=r.x,_=r.y,y=v,s&&(p=s.x))),null!==n&&((T=n.x-t)<0&&(T=-T),(null===d||T>h)&&(h=T,f=n.x,m=n.y,d=v,null!==s&&(c=s.y)))}}return null!==y&&null!==r&&(r.x=u,r.y=_,null!==s&&(s.x=p)),null!==d&&null!==n&&(n.x=f,n.y=m,null!==s&&(s.y=c)),y},e.prototype.getBone=function(t){for(var e=0,a=this._bones;e<a.length;e++){var i=a[e];if(i.name===t)return i}return null},e.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return null!==e?e.parent:null},e.prototype.getSlot=function(t){for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];if(i.name===t)return i}return null},e.prototype.getSlotByDisplay=function(t){if(null!==t)for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];if(i.display===t)return i}return null},e.prototype.getBones=function(){return this._bones},e.prototype.getSlots=function(){return this._slots},Object.defineProperty(e.prototype,"flipX",{get:function(){return this._flipX},set:function(t){this._flipX!==t&&(this._flipX=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flipY",{get:function(){return this._flipY},set:function(t){this._flipY!==t&&(this._flipY=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheFrameRate",{get:function(){return this._armatureData.cacheFrameRate},set:function(t){if(this._armatureData.cacheFrameRate!==t){this._armatureData.cacheFrames(t);for(var e=0,a=this._slots;e<a.length;e++){var i=a[e].childArmature;null!==i&&(i.cacheFrameRate=t)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._armatureData.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proxy",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"display",{get:function(){return this._display},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"replacedTexture",{get:function(){return this._replacedTexture},set:function(t){if(this._replacedTexture!==t){null!==this._replaceTextureAtlasData&&(this._replaceTextureAtlasData.returnToPool(),this._replaceTextureAtlasData=null),this._replacedTexture=t;for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];i.invalidUpdate(),i.update(-1)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock!==t){null!==this._clock&&this._clock.remove(this),this._clock=t,this._clock&&this._clock.add(this);for(var e=0,a=this._slots;e<a.length;e++){var i=a[e].childArmature;null!==i&&(i.clock=this._clock)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),e.prototype.getDisplay=function(){return this._display},e}(m.BaseObject),m.Armature=p,function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.globalTransformMatrix=new t.Matrix,a.global=new t.Transform,a.offset=new t.Transform,a}return c(a,e),a.prototype._onClear=function(){this.globalTransformMatrix.identity(),this.global.identity(),this.offset.identity(),this.origin=null,this.userData=null,this._globalDirty=!1,this._alpha=1,this._globalAlpha=1,this._armature=null},a.prototype.updateGlobalTransform=function(){this._globalDirty&&(this._globalDirty=!1,this.global.fromMatrix(this.globalTransformMatrix))},Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),a._helpMatrix=new t.Matrix,a._helpTransform=new t.Transform,a._helpPoint=new t.Point,a}(t.BaseObject);t.TransformObject=e}(f||(f={})),function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.animationPose=new t.Transform,a}return c(a,e),a.toString=function(){return"[class dragonBones.Bone]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.offsetMode=1,this.animationPose.identity(),this._transformDirty=!1,this._childrenTransformDirty=!1,this._localDirty=!0,this._hasConstraint=!1,this._visible=!0,this._cachedFrameIndex=-1,this._boneData=null,this._parent=null,this._cachedFrameIndices=null},a.prototype._updateGlobalTransformMatrix=function(e){var a=this._boneData,i=this.global,r=this.globalTransformMatrix,n=this.origin,s=this.offset,o=this.animationPose,l=this._parent,h=this._armature.flipX,u=this._armature.flipY===t.DragonBones.yDown,_=null!==l,f=0;if(1===this.offsetMode?null!==n?(i.x=n.x+s.x+o.x,i.y=n.y+s.y+o.y,i.skew=n.skew+s.skew+o.skew,i.rotation=n.rotation+s.rotation+o.rotation,i.scaleX=n.scaleX*s.scaleX*o.scaleX,i.scaleY=n.scaleY*s.scaleY*o.scaleY):i.copyFrom(s).add(o):0===this.offsetMode?null!==n?i.copyFrom(n).add(o):i.copyFrom(o):(_=!1,i.copyFrom(s)),_){var m=1===l._boneData.type,p=m?l._bone:null,c=m?l._getGlobalTransformMatrix(i.x,i.y):l.globalTransformMatrix;if(!a.inheritScale||m&&null===p){if(a.inheritTranslation){var y=i.x,d=i.y;i.x=c.a*y+c.c*d+c.tx,i.y=c.b*y+c.d*d+c.ty}else h&&(i.x=-i.x),u&&(i.y=-i.y);a.inheritRotation?(l.updateGlobalTransform(),f=l.global.scaleX<0?i.rotation+l.global.rotation+Math.PI:i.rotation+l.global.rotation,c.a*c.d-c.b*c.c<0&&(f-=2*i.rotation,(h!==u||a.inheritReflection)&&(i.skew+=Math.PI)),i.rotation=f):(h||u)&&(h&&u?f=i.rotation+Math.PI:(f=h?Math.PI-i.rotation:-i.rotation,i.skew+=Math.PI),i.rotation=f),i.toMatrix(r)}else m?(a.inheritRotation&&(i.rotation+=l.global.rotation),p.updateGlobalTransform(),i.scaleX*=p.global.scaleX,i.scaleY*=p.global.scaleY,c.transformPoint(i.x,i.y,i),i.toMatrix(r),a.inheritTranslation?(i.x=r.tx,i.y=r.ty):(r.tx=i.x,r.ty=i.y)):(a.inheritRotation||(l.updateGlobalTransform(),f=h&&u?i.rotation-(l.global.rotation+Math.PI):h?i.rotation+l.global.rotation+Math.PI:u?i.rotation+l.global.rotation:i.rotation-l.global.rotation,i.rotation=f),i.toMatrix(r),r.concat(c),a.inheritTranslation?(i.x=r.tx,i.y=r.ty):(r.tx=i.x,r.ty=i.y),e?i.fromMatrix(r):this._globalDirty=!0)}else(h||u)&&(h&&(i.x=-i.x),u&&(i.y=-i.y),h&&u?f=i.rotation+Math.PI:(f=h?Math.PI-i.rotation:-i.rotation,i.skew+=Math.PI),i.rotation=f),i.toMatrix(r)},a.prototype._updateAlpha=function(){null!==this._parent?this._globalAlpha=this._alpha*this._parent._globalAlpha:this._globalAlpha=this._alpha*this._armature._globalAlpha},a.prototype.init=function(t,e){null===this._boneData&&(this._boneData=t,this._armature=e,this._alpha=this._boneData.alpha,null!==this._boneData.parent&&(this._parent=this._armature.getBone(this._boneData.parent.name)),this._armature._addBone(this),this.origin=this._boneData.transform)},a.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDirty=!1;else if(e>=0)this._transformDirty=!0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var a=0,i=this._armature._constraints;a<i.length;a++){(s=i[a])._root===this&&s.update()}this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var r=0,n=this._armature._constraints;r<n.length;r++){var s;(s=n[r])._root===this&&s.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty)if(this._transformDirty=!1,this._childrenTransformDirty=!0,this._cachedFrameIndex<0){var o=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(o),o&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},a.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!1,(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformMatrix(!0),this._transformDirty=!0)},a.prototype.invalidUpdate=function(){this._transformDirty=!0},a.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.parent;return e===this},Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var e=0,a=this._armature.getSlots();e<a.length;e++){var i=a[e];i.parent===this&&i._updateVisible()}}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._boneData.name},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),a}(t.TransformObject);t.Bone=e}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._vertices=[],e._deformVertices=[],e._hullCache=[],e._matrixCahce=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.Surface]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._dX=0,this._dY=0,this._k=0,this._kX=0,this._kY=0,this._vertices.length=0,this._deformVertices.length=0,this._matrixCahce.length=0,this._hullCache.length=0,this._bone=null},e.prototype._getAffineTransform=function(t,e,a,i,r,n,s,o,l,h,u,_,f){var m=s-r,p=o-n,c=l-r,y=h-n;u.rotation=Math.atan2(p,m),u.skew=Math.atan2(y,c)-.5*Math.PI-u.rotation,f&&(u.rotation+=Math.PI),u.scaleX=Math.sqrt(m*m+p*p)/a,u.scaleY=Math.sqrt(c*c+y*y)/i,u.toMatrix(_),u.x=_.tx=r-(_.a*t+_.c*e),u.y=_.ty=n-(_.b*t+_.d*e)},e.prototype._updateVertices=function(){var t=this._armature.armatureData.parent,e=this._boneData.geometry,a=t.intArray,i=t.floatArray,r=a[e.offset+0],n=a[e.offset+2],s=this._vertices,o=this._deformVertices;if(null!==this._parent)if(1===this._parent._boneData.type)for(var l=0,h=r;l<h;++l){var u=i[n+(p=2*l)]+o[p],_=i[n+p+1]+o[p+1],f=this._parent._getGlobalTransformMatrix(u,_);s[p]=f.a*u+f.c*_+f.tx,s[p+1]=f.b*u+f.d*_+f.ty}else{var m=this._parent.globalTransformMatrix;for(l=0,h=r;l<h;++l){u=i[n+(p=2*l)]+o[p],_=i[n+p+1]+o[p+1];s[p]=m.a*u+m.c*_+m.tx,s[p+1]=m.b*u+m.d*_+m.ty}}else for(l=0,h=r;l<h;++l){var p;s[p=2*l]=i[n+p]+o[p],s[p+1]=i[n+p+1]+o[p+1]}},e.prototype._updateGlobalTransformMatrix=function(t){var e=2*this._boneData.segmentX,a=this._vertices.length-2,i=this._vertices[0],r=this._vertices[1],n=this._vertices[e],s=this._vertices[e+1],o=this._vertices[a],l=this._vertices[a+1],h=this._vertices[a-e],u=this._vertices[a-e+1],_=i+.5*(o-i),f=r+.5*(l-r),m=_+.5*(n+.5*(h-n)-_),p=f+.5*(s+.5*(u-s)-f),c=n+.5*(o-n),y=s+.5*(l-s),d=h+.5*(o-h),g=u+.5*(l-u);this._getAffineTransform(0,0,200,200,m,p,c,y,d,g,this.global,this.globalTransformMatrix,!1),this._globalDirty=!1},e.prototype._getGlobalTransformMatrix=function(t,a){var i=200,r=1e3;if(t<-r||r<t||a<-r||r<a)return this.globalTransformMatrix;var n=!1,s=this._boneData,o=s.segmentX,l=s.segmentY,h=2*s.segmentX,u=this._dX,_=this._dY,f=Math.floor((t+i)/u),m=Math.floor((a+i)/_),p=0,c=f*u-i,y=m*_-i,d=this._matrixCahce,g=e._helpMatrix;if(t<-i){if(a<-i||a>=i)return this.globalTransformMatrix;if(d[p=7*(2*(o*l+o+l+l+m)+((n=a>this._kX*(t+i)+y)?1:0))]>0)g.copyFromArray(d,p+1);else{var D=m*(h+2),v=this._hullCache[4],T=this._hullCache[5],b=this._hullCache[2]-(l-m)*v,A=this._hullCache[3]-(l-m)*T,P=this._vertices;n?this._getAffineTransform(-i,y+_,800,_,P[D+h+2],P[D+h+3],b+v,A+T,P[D],P[D+1],e._helpTransform,g,!0):this._getAffineTransform(-r,y,800,_,b,A,P[D],P[D+1],b+v,A+T,e._helpTransform,g,!1),d[p]=1,d[p+1]=g.a,d[p+2]=g.b,d[p+3]=g.c,d[p+4]=g.d,d[p+5]=g.tx,d[p+6]=g.ty}}else if(t>=i){if(a<-i||a>=i)return this.globalTransformMatrix;if(d[p=7*(2*(o*l+o+m)+((n=a>this._kX*(t-r)+y)?1:0))]>0)g.copyFromArray(d,p+1);else{D=(m+1)*(h+2)-2,v=this._hullCache[4],T=this._hullCache[5],b=this._hullCache[0]+m*v,A=this._hullCache[1]+m*T,P=this._vertices;n?this._getAffineTransform(r,y+_,800,_,b+v,A+T,P[D+h+2],P[D+h+3],b,A,e._helpTransform,g,!0):this._getAffineTransform(i,y,800,_,P[D],P[D+1],b,A,P[D+h+2],P[D+h+3],e._helpTransform,g,!1),d[p]=1,d[p+1]=g.a,d[p+2]=g.b,d[p+3]=g.c,d[p+4]=g.d,d[p+5]=g.tx,d[p+6]=g.ty}}else if(a<-i){if(t<-i||t>=i)return this.globalTransformMatrix;if(d[p=7*(2*(o*l+f)+((n=a>this._kY*(t-c-u)-r)?1:0))]>0)g.copyFromArray(d,p+1);else{D=2*f,v=this._hullCache[10],T=this._hullCache[11],b=this._hullCache[8]+f*v,A=this._hullCache[9]+f*T,P=this._vertices;n?this._getAffineTransform(c+u,-i,u,800,P[D+2],P[D+3],P[D],P[D+1],b+v,A+T,e._helpTransform,g,!0):this._getAffineTransform(c,-r,u,800,b,A,b+v,A+T,P[D],P[D+1],e._helpTransform,g,!1),d[p]=1,d[p+1]=g.a,d[p+2]=g.b,d[p+3]=g.c,d[p+4]=g.d,d[p+5]=g.tx,d[p+6]=g.ty}}else if(a>=i){if(t<-i||t>=i)return this.globalTransformMatrix;if(d[p=7*(2*(o*l+o+l+f)+((n=a>this._kY*(t-c-u)+i)?1:0))]>0)g.copyFromArray(d,p+1);else{D=l*(h+2)+2*f,v=this._hullCache[10],T=this._hullCache[11],b=this._hullCache[6]-(o-f)*v,A=this._hullCache[7]-(o-f)*T,P=this._vertices;n?this._getAffineTransform(c+u,r,u,800,b+v,A+T,b,A,P[D+2],P[D+3],e._helpTransform,g,!0):this._getAffineTransform(c,i,u,800,P[D],P[D+1],P[D+2],P[D+3],b,A,e._helpTransform,g,!1),d[p]=1,d[p+1]=g.a,d[p+2]=g.b,d[p+3]=g.c,d[p+4]=g.d,d[p+5]=g.tx,d[p+6]=g.ty}}else if(d[p=7*(2*(o*m+f)+((n=a>this._k*(t-c-u)+y)?1:0))]>0)g.copyFromArray(d,p+1);else{D=2*f+m*(h+2),P=this._vertices;n?this._getAffineTransform(c+u,y+_,u,_,P[D+h+4],P[D+h+5],P[D+h+2],P[D+h+3],P[D+2],P[D+3],e._helpTransform,g,!0):this._getAffineTransform(c,y,u,_,P[D],P[D+1],P[D+2],P[D+3],P[D+h+2],P[D+h+3],e._helpTransform,g,!1),d[p]=1,d[p+1]=g.a,d[p+2]=g.b,d[p+3]=g.c,d[p+4]=g.d,d[p+5]=g.tx,d[p+6]=g.ty}return g},e.prototype.init=function(e,a){if(null===this._boneData){t.prototype.init.call(this,e,a);var i=e.segmentX,r=e.segmentY,n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];this._dX=400/i,this._dY=400/r,this._k=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-800/this._dX,this._vertices.length=2*n,this._deformVertices.length=2*n,this._matrixCahce.length=2*(i*r+2*i+2*r)*7,this._hullCache.length=10;for(var s=0;s<2*n;++s)this._deformVertices[s]=0;null!==this._parent&&(0===this._parent.boneData.type?this._bone=this._parent:this._bone=this._parent._bone)}},e.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a)this._transformDirty=!1;else if(a>=0)this._transformDirty=!0,this._cachedFrameIndex=a;else{if(this._hasConstraint)for(var i=0,r=this._armature._constraints;i<r.length;i++){(o=r[i])._root===this&&o.update()}this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var n=0,s=this._armature._constraints;n<s.length;n++){var o;(o=s[n])._root===this&&o.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty){this._transformDirty=!1,this._childrenTransformDirty=!0;for(var l=0,h=this._matrixCahce.length;l<h;l+=7)this._matrixCahce[l]=-1;if(this._updateVertices(),this._cachedFrameIndex<0){var u=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(u),u&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);var _=2*this.global.x,f=2*this.global.y,m=e._helpPoint;this.globalTransformMatrix.transformPoint(1e3,-200,m),this._hullCache[0]=m.x,this._hullCache[1]=m.y,this._hullCache[2]=_-m.x,this._hullCache[3]=f-m.y,this.globalTransformMatrix.transformPoint(0,this._dY,m,!0),this._hullCache[4]=m.x,this._hullCache[5]=m.y,this.globalTransformMatrix.transformPoint(200,1e3,m),this._hullCache[6]=m.x,this._hullCache[7]=m.y,this._hullCache[8]=_-m.x,this._hullCache[9]=f-m.y,this.globalTransformMatrix.transformPoint(this._dX,0,m,!0),this._hullCache[10]=m.x,this._hullCache[11]=m.y}else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},e}(t.Bone);t.Surface=e}(f||(f={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deformVertices=[],e}return c(e,t),e.toString=function(){return"[class dragonBones.DisplayFrame]"},e.prototype._onClear=function(){this.rawDisplayData=null,this.displayData=null,this.textureData=null,this.display=null,this.deformVertices.length=0},e.prototype.updateDeformVertices=function(){if(null!==this.rawDisplayData&&0===this.deformVertices.length){var t;if(2===this.rawDisplayData.type)t=this.rawDisplayData.geometry;else{if(4!==this.rawDisplayData.type)return;t=this.rawDisplayData.geometry}var e=0;e=null!==t.weight?2*t.weight.count:2*t.data.intArray[t.offset+0],this.deformVertices.length=e;for(var a=0,i=this.deformVertices.length;a<i;++a)this.deformVertices[a]=0}},e.prototype.getGeometryData=function(){if(null!==this.displayData){if(2===this.displayData.type)return this.displayData.geometry;if(4===this.displayData.type)return this.displayData.geometry}if(null!==this.rawDisplayData){if(2===this.rawDisplayData.type)return this.rawDisplayData.geometry;if(4===this.rawDisplayData.type)return this.rawDisplayData.geometry}return null},e.prototype.getBoundingBox=function(){return null!==this.displayData&&3===this.displayData.type?this.displayData.boundingBox:null!==this.rawDisplayData&&3===this.rawDisplayData.type?this.rawDisplayData.boundingBox:null},e.prototype.getTextureData=function(){if(null!==this.displayData){if(0===this.displayData.type)return this.displayData.texture;if(2===this.displayData.type)return this.displayData.texture}if(null!==this.textureData)return this.textureData;if(null!==this.rawDisplayData){if(0===this.rawDisplayData.type)return this.rawDisplayData.texture;if(2===this.rawDisplayData.type)return this.rawDisplayData.texture}return null},e}(t.BaseObject);t.DisplayFrame=e;var a=function(a){function i(){var e=null!==a&&a.apply(this,arguments)||this;return e._localMatrix=new t.Matrix,e._colorTransform=new t.ColorTransform,e._displayFrames=[],e._geometryBones=[],e._rawDisplay=null,e._meshDisplay=null,e._display=null,e}return c(i,a),i.prototype._onClear=function(){a.prototype._onClear.call(this);for(var e=[],i=0,r=this._displayFrames;i<r.length;i++){var n=r[i],s=n.display;s!==this._rawDisplay&&s!==this._meshDisplay&&e.indexOf(s)<0&&e.push(s),n.returnToPool()}for(var o=0,l=e;o<l.length;o++){var h=l[o];h instanceof t.Armature?h.dispose():this._disposeDisplay(h,!0)}null!==this._meshDisplay&&this._meshDisplay!==this._rawDisplay&&this._disposeDisplay(this._meshDisplay,!1),null!==this._rawDisplay&&this._disposeDisplay(this._rawDisplay,!1),this.displayController=null,this._displayDataDirty=!1,this._displayDirty=!1,this._geometryDirty=!1,this._textureDirty=!1,this._visibleDirty=!1,this._blendModeDirty=!1,this._zOrderDirty=!1,this._colorDirty=!1,this._verticesDirty=!1,this._transformDirty=!1,this._visible=!0,this._blendMode=0,this._displayIndex=-1,this._animationDisplayIndex=-1,this._zOrder=0,this._zIndex=0,this._cachedFrameIndex=-1,this._pivotX=0,this._pivotY=0,this._localMatrix.identity(),this._colorTransform.identity(),this._displayFrames.length=0,this._geometryBones.length=0,this._slotData=null,this._displayFrame=null,this._geometryData=null,this._boundingBoxData=null,this._textureData=null,this._rawDisplay=null,this._meshDisplay=null,this._display=null,this._childArmature=null,this._parent=null,this._cachedFrameIndices=null},i.prototype._hasDisplay=function(t){for(var e=0,a=this._displayFrames;e<a.length;e++){if(a[e].display===t)return!0}return!1},i.prototype._isBonesUpdate=function(){for(var t=0,e=this._geometryBones;t<e.length;t++){var a=e[t];if(null!==a&&a._childrenTransformDirty)return!0}return!1},i.prototype._updateAlpha=function(){var t=this._alpha*this._parent._globalAlpha;this._globalAlpha!==t&&(this._globalAlpha=t,this._colorDirty=!0)},i.prototype._updateDisplayData=function(){var e=this._displayFrame,a=this._geometryData,r=this._textureData,n=null,s=null;if(this._displayFrame=null,this._geometryData=null,this._boundingBoxData=null,this._textureData=null,this._displayIndex>=0&&this._displayIndex<this._displayFrames.length&&(this._displayFrame=this._displayFrames[this._displayIndex],n=this._displayFrame.rawDisplayData,s=this._displayFrame.displayData,this._geometryData=this._displayFrame.getGeometryData(),this._boundingBoxData=this._displayFrame.getBoundingBox(),this._textureData=this._displayFrame.getTextureData()),this._displayFrame!==e||this._geometryData!==a||this._textureData!==r){if(null===this._geometryData&&null!==this._textureData){var o=null!==s&&0===s.type?s:n,l=this._textureData.parent.scale*this._armature._armatureData.scale,h=this._textureData.frame;this._pivotX=o.pivot.x,this._pivotY=o.pivot.y;var u=null!==h?h:this._textureData.region,_=u.width,f=u.height;this._textureData.rotated&&null===h&&(_=u.height,f=u.width),this._pivotX*=_*l,this._pivotY*=f*l,null!==h&&(this._pivotX+=h.x*l,this._pivotY+=h.y*l),null!==n&&o!==n&&(n.transform.toMatrix(i._helpMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX-=i._helpPoint.x,this._pivotY-=i._helpPoint.y,o.transform.toMatrix(i._helpMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX+=i._helpPoint.x,this._pivotY+=i._helpPoint.y),t.DragonBones.yDown||(this._pivotY=(this._textureData.rotated?this._textureData.region.width:this._textureData.region.height)*l-this._pivotY)}else this._pivotX=0,this._pivotY=0;if(this.origin=null!==n?n.transform:null!==s?s.transform:null,null!==this.origin?this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix):this.global.copyFrom(this.offset).toMatrix(this._localMatrix),this._geometryData!==a)if(this._geometryDirty=!0,this._verticesDirty=!0,null!==this._geometryData){if(this._geometryBones.length=0,null!==this._geometryData.weight)for(var m=0,p=this._geometryData.weight.bones.length;m<p;++m){var c=this._armature.getBone(this._geometryData.weight.bones[m].name);this._geometryBones.push(c)}}else this._geometryBones.length=0,this._geometryData=null;this._textureDirty=this._textureData!==r,this._transformDirty=!0}},i.prototype._updateDisplay=function(){var e=null!==this._display?this._display:this._rawDisplay,a=this._childArmature;if(null!==this._displayFrame?(this._display=this._displayFrame.display,null!==this._display&&this._display instanceof t.Armature?(this._childArmature=this._display,this._display=this._childArmature.display):this._childArmature=null):(this._display=null,this._childArmature=null),(null!==this._display?this._display:this._rawDisplay)!==e&&(this._textureDirty=!0,this._visibleDirty=!0,this._blendModeDirty=!0,this._colorDirty=!0,this._transformDirty=!0,this._onUpdateDisplay(),this._replaceDisplay(e)),this._childArmature!==a&&(null!==a&&(a._parent=null,a.clock=null,a.inheritAnimation&&a.animation.reset()),null!==this._childArmature&&(this._childArmature._parent=this,this._childArmature.clock=this._armature.clock,this._childArmature.inheritAnimation))){if(0===this._childArmature.cacheFrameRate){var i=this._armature.cacheFrameRate;0!==i&&(this._childArmature.cacheFrameRate=i)}if(null!==this._displayFrame){var r=null,n=null!==this._displayFrame.displayData?this._displayFrame.displayData:this._displayFrame.rawDisplayData;if(null!==n&&1===n.type&&(r=n.actions),null!==r&&r.length>0)for(var s=0,o=r;s<o.length;s++){var l=o[s],h=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(l,h,this._armature),h.slot=this,this._armature._bufferAction(h,!1)}else this._childArmature.animation.play()}}},i.prototype._updateGlobalTransformMatrix=function(t){var e=0===this._parent._boneData.type?this._parent.globalTransformMatrix:this._parent._getGlobalTransformMatrix(this.global.x,this.global.y);this.globalTransformMatrix.copyFrom(this._localMatrix),this.globalTransformMatrix.concat(e),t?this.global.fromMatrix(this.globalTransformMatrix):this._globalDirty=!0},i.prototype._setDisplayIndex=function(t,e){if(void 0===e&&(e=!1),e){if(this._animationDisplayIndex===t)return;this._animationDisplayIndex=t}this._displayIndex!==t&&(this._displayIndex=t<this._displayFrames.length?t:this._displayFrames.length-1,this._displayDataDirty=!0,this._displayDirty=this._displayIndex<0||this._display!==this._displayFrames[this._displayIndex].display)},i.prototype._setZOrder=function(t){return this._zOrder,this._zOrder=t,this._zOrderDirty=!0,this._zOrderDirty},i.prototype._setColor=function(t){return this._colorTransform.copyFrom(t),this._colorDirty=!0},i.prototype.init=function(t,e,a,i){if(null===this._slotData){this._slotData=t,this._colorDirty=!0,this._blendModeDirty=!0,this._blendMode=this._slotData.blendMode,this._zOrder=this._slotData.zOrder,this._zIndex=this._slotData.zIndex,this._alpha=this._slotData.alpha,this._colorTransform.copyFrom(this._slotData.color),this._rawDisplay=a,this._meshDisplay=i,this._armature=e;var r=this._armature.getBone(this._slotData.parent.name);null!==r&&(this._parent=r),this._armature._addSlot(this),this._initDisplay(this._rawDisplay,!1),this._rawDisplay!==this._meshDisplay&&this._initDisplay(this._meshDisplay,!1),this._onUpdateDisplay(),this._addDisplay()}},i.prototype.update=function(t){if(this._displayDataDirty&&(this._updateDisplayData(),this._displayDataDirty=!1),this._displayDirty&&(this._updateDisplay(),this._displayDirty=!1),(this._geometryDirty||this._textureDirty)&&(null!==this._display&&this._display!==this._rawDisplay&&this._display!==this._meshDisplay||this._updateFrame(),this._geometryDirty=!1,this._textureDirty=!1),null!==this._display){if(this._visibleDirty&&(this._updateVisible(),this._visibleDirty=!1),this._blendModeDirty&&(this._updateBlendMode(),this._blendModeDirty=!1),this._colorDirty&&(this._updateColor(),this._colorDirty=!1),this._zOrderDirty&&(this._updateZOrder(),this._zOrderDirty=!1),null!==this._geometryData&&this._display===this._meshDisplay){var e=null!==this._geometryData.weight,a=0!==this._parent._boneData.type;if((this._verticesDirty||e&&this._isBonesUpdate()||a&&this._parent._childrenTransformDirty)&&(this._updateMesh(),this._verticesDirty=!1),e||a)return}if(t>=0&&null!==this._cachedFrameIndices){var i=this._cachedFrameIndices[t];i>=0&&this._cachedFrameIndex===i?this._transformDirty=!1:i>=0?(this._transformDirty=!0,this._cachedFrameIndex=i):this._transformDirty||this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}else(this._transformDirty||this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1);if(this._transformDirty){if(this._cachedFrameIndex<0){var r=t>=0;this._updateGlobalTransformMatrix(r),r&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);this._updateTransform(),this._transformDirty=!1}}},i.prototype.invalidUpdate=function(){this._displayDataDirty=!0,this._displayDirty=!0,this._transformDirty=!0},i.prototype.updateTransformAndMatrix=function(){this._transformDirty&&(this._updateGlobalTransformMatrix(!1),this._transformDirty=!1)},i.prototype.replaceRawDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];if(a.rawDisplayData!==t){if(a.deformVertices.length=0,a.rawDisplayData=t,null===a.rawDisplayData){var i=this._armature._armatureData.defaultSkin;if(null!==i){var r=i.getDisplays(this._slotData.name);null!==r&&e<r.length&&(a.rawDisplayData=r[e])}}e===this._displayIndex&&(this._displayDataDirty=!0)}},i.prototype.replaceDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];a.displayData!==t&&a.rawDisplayData!==t&&(a.displayData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},i.prototype.replaceTextureData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];a.textureData!==t&&(a.textureData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},i.prototype.replaceDisplay=function(e,a){if(void 0===a&&(a=-1),a<0)a=this._displayIndex<0?0:this._displayIndex;else if(a>=this._displayFrames.length)return;var i=this._displayFrames[a];if(i.display!==e){var r=i.display;i.display=e,null===r||r===this._rawDisplay||r===this._meshDisplay||this._hasDisplay(r)||r instanceof t.Armature||this._disposeDisplay(r,!0),null===e||e===this._rawDisplay||e===this._meshDisplay||this._hasDisplay(r)||e instanceof t.Armature||this._initDisplay(e,!0),a===this._displayIndex&&(this._displayDirty=!0)}},i.prototype.containsPoint=function(t,e){return null!==this._boundingBoxData&&(this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(t,e,i._helpPoint),this._boundingBoxData.containsPoint(i._helpPoint.x,i._helpPoint.y))},i.prototype.intersectsSegment=function(t,e,a,r,n,s,o){if(void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),null===this._boundingBoxData)return 0;this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(t,e,i._helpPoint),t=i._helpPoint.x,e=i._helpPoint.y,i._helpMatrix.transformPoint(a,r,i._helpPoint),a=i._helpPoint.x,r=i._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,r,n,s,o);return l>0&&(1===l||2===l?null!==n?(this.globalTransformMatrix.transformPoint(n.x,n.y,n),null!==s&&(s.x=n.x,s.y=n.y)):null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s):(null!==n&&this.globalTransformMatrix.transformPoint(n.x,n.y,n),null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s)),null!==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),i._helpPoint,!0),o.x=Math.atan2(i._helpPoint.y,i._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),i._helpPoint,!0),o.y=Math.atan2(i._helpPoint.y,i._helpPoint.x))),l},i.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]},Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._updateVisible())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var i=this._displayFrames.length;if(i<a){this._displayFrames.length=a;for(var r=i;r<a;++r)this._displayFrames[r]=t.BaseObject.borrowObject(e)}else if(i>a){for(r=i-1;r<a;--r)this.replaceDisplay(null,r),this._displayFrames[r].returnToPool();this._displayFrames.length=a}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){this._setDisplayIndex(t),this.update(-1)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._slotData.name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayList",{get:function(){for(var t=new Array,e=0,a=this._displayFrames;e<a.length;e++){var i=a[e];t.push(i.display)}return t},set:function(t){this.displayFrameCount=t.length;for(var e=0,a=0,i=t;a<i.length;a++){var r=i[a];this.replaceDisplay(r,e++)}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"slotData",{get:function(){return this._slotData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"boundingBoxData",{get:function(){return this._boundingBoxData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rawDisplay",{get:function(){return this._rawDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"meshDisplay",{get:function(){return this._meshDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"display",{get:function(){return this._display},set:function(t){this._display!==t&&(0===this._displayFrames.length&&(this.displayFrameCount=1,this._displayIndex=0),this.replaceDisplay(t,this._displayIndex))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"childArmature",{get:function(){return this._childArmature},set:function(t){this._childArmature!==t&&(this.display=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),i.prototype.getDisplay=function(){return this._display},i.prototype.setDisplay=function(t){this.display=t},i}(t.TransformObject);t.Slot=a}(f||(f={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.prototype._onClear=function(){this._armature=null,this._target=null,this._root=null,this._bone=null},Object.defineProperty(a.prototype,"name",{get:function(){return this._constraintData.name},enumerable:!0,configurable:!0}),a._helpMatrix=new t.Matrix,a._helpTransform=new t.Transform,a._helpPoint=new t.Point,a}(t.BaseObject);t.Constraint=e;var a=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.toString=function(){return"[class dragonBones.IKConstraint]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this._scaleEnabled=!1,this._bendPositive=!1,this._weight=1,this._constraintData=null},a.prototype._computeA=function(){var e=this._target.global,a=this._root.global,i=this._root.globalTransformMatrix,r=Math.atan2(e.y-a.y,e.x-a.x);a.scaleX<0&&(r+=Math.PI),a.rotation+=t.Transform.normalizeRadian(r-a.rotation)*this._weight,a.toMatrix(i)},a.prototype._computeB=function(){var e=this._bone._boneData.length,a=this._root,i=this._target.global,r=a.global,n=this._bone.global,s=this._bone.globalTransformMatrix,o=s.a*e,l=s.b*e,h=o*o+l*l,u=Math.sqrt(h),_=n.x-r.x,f=n.y-r.y,m=_*_+f*f,p=Math.sqrt(m),c=n.rotation,y=r.rotation,d=Math.atan2(f,_),g=(_=i.x-r.x)*_+(f=i.y-r.y)*f,D=Math.sqrt(g),v=0;if(u+p<=D||D+u<=p||D+p<=u)v=Math.atan2(i.y-r.y,i.x-r.x),u+p<=D||p<u&&(v+=Math.PI);else{var T=(m-h+g)/(2*g),b=Math.sqrt(m-T*T*g)/D,A=r.x+_*T,P=r.y+f*T,S=-f*b,O=_*b,x=!1,E=a.parent;if(null!==E){var M=E.globalTransformMatrix;x=M.a*M.d-M.b*M.c<0}x!==this._bendPositive?(n.x=A-S,n.y=P-O):(n.x=A+S,n.y=P+O),v=Math.atan2(n.y-r.y,n.x-r.x)}var B=t.Transform.normalizeRadian(v-d);r.rotation=y+B*this._weight,r.toMatrix(a.globalTransformMatrix);var I=d+B*this._weight;n.x=r.x+Math.cos(I)*p,n.y=r.y+Math.sin(I)*p;var F=Math.atan2(i.y-n.y,i.x-n.x);n.scaleX<0&&(F+=Math.PI),n.rotation=r.rotation+c-y+t.Transform.normalizeRadian(F-B-c)*this._weight,n.toMatrix(s)},a.prototype.init=function(t,e){if(null===this._constraintData){this._constraintData=t,this._armature=e,this._target=this._armature.getBone(this._constraintData.target.name),this._root=this._armature.getBone(this._constraintData.root.name),this._bone=null!==this._constraintData.bone?this._armature.getBone(this._constraintData.bone.name):null;var a=this._constraintData;this._scaleEnabled=a.scaleEnabled,this._bendPositive=a.bendPositive,this._weight=a.weight,this._root._hasConstraint=!0}},a.prototype.update=function(){this._root.updateByConstraint(),null!==this._bone?(this._bone.updateByConstraint(),this._computeB()):this._computeA()},a.prototype.invalidUpdate=function(){this._root.invalidUpdate(),null!==this._bone&&this._bone.invalidUpdate()},a}(e);t.IKConstraint=a;var i=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t._bones=[],t._spaces=[],t._positions=[],t._curves=[],t._boneLengths=[],t._pathGlobalVertices=[],t._segments=[10],t}return c(a,e),a.toString=function(){return"[class dragonBones.PathConstraint]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.dirty=!1,this.pathOffset=0,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=1,this.translateMix=1,this._pathSlot=null,this._bones.length=0,this._spaces.length=0,this._positions.length=0,this._curves.length=0,this._boneLengths.length=0,this._pathGlobalVertices.length=0},a.prototype._updatePathVertices=function(t){var e=this._armature,a=e.armatureData.parent,i=e.armatureData.scale,r=a.intArray,n=a.floatArray,s=t.offset,o=r[s+0],l=r[s+2];this._pathGlobalVertices.length=2*o;var h=t.weight;if(null!==h)for(var u=this._pathSlot._geometryBones,_=h.bones.length,f=h.offset,m=r[f+1],p=f+2+_,c=(P=0,0);P<o;P++){for(var y=0,d=0,g=0,D=r[p++];g<D;g++){var v=u[r[p++]];if(null!==v){v.updateByConstraint();A=v.globalTransformMatrix;var T=n[m++];O=n[m++]*i,x=n[m++]*i;y+=(A.a*O+A.c*x+A.tx)*T,d+=(A.b*O+A.d*x+A.ty)*T}}this._pathGlobalVertices[c++]=y,this._pathGlobalVertices[c++]=d}else{var b=this._pathSlot.parent;b.updateByConstraint();for(var A=b.globalTransformMatrix,P=0,S=l;P<o;P+=2){var O=n[S++]*i,x=n[S++]*i,E=A.a*O+A.c*x+A.tx,M=A.b*O+A.d*x+A.ty;this._pathGlobalVertices[P]=E,this._pathGlobalVertices[P+1]=M}}},a.prototype._computeVertices=function(t,e,a,i){for(var r=a,n=t;r<e;r+=2)i[r]=this._pathGlobalVertices[n++],i[r+1]=this._pathGlobalVertices[n++]},a.prototype._computeBezierCurve=function(t,e,a,i,r){var n=this._armature.armatureData.parent.intArray[t.geometry.offset+0],s=this._positions,o=this._spaces,l=t.closed,h=Array(),u=2*n,_=u/6,f=-1,m=this.position;s.length=3*e+2;var p=0;if(t.constantSpeed){l?(u+=2,h.length=n,this._computeVertices(2,u-4,0,h),this._computeVertices(0,2,u-4,h),h[u-2]=h[0],h[u-1]=h[1]):(_--,u-=4,h.length=u,this._computeVertices(2,u,0,h));var c=new Array(_);p=0;for(var y,d,g,D,v,T,b,A,P=h[0],S=h[1],O=0,x=0,E=0,M=0,B=0,I=0,F=(U=0,2);U<_;U++,F+=6)O=h[F],x=h[F+1],E=h[F+2],M=h[F+3],v=2*(y=.1875*(P-2*O+E))+(g=.09375*(3*(O-E)-P+(B=h[F+4]))),T=2*(d=.1875*(S-2*x+M))+(D=.09375*(3*(x-M)-S+(I=h[F+5]))),b=.75*(O-P)+y+.16666667*g,A=.75*(x-S)+d+.16666667*D,p+=Math.sqrt(b*b+A*A),b+=v,A+=T,v+=g,T+=D,p+=Math.sqrt(b*b+A*A),b+=v,A+=T,p+=Math.sqrt(b*b+A*A),b+=v+g,A+=T+D,p+=Math.sqrt(b*b+A*A),c[U]=p,P=B,S=I;if(i&&(m*=p),r)for(U=0;U<e;U++)o[U]*=p;for(var C=this._segments,w=0,N=(U=0,X=0,G=0,0);U<e;U++,X+=3){var R=m+=o[U];if(l)(R%=p)<0&&(R+=p),G=0;else{if(R<0)continue;if(R>p)continue}for(;;G++){var j=c[G];if(!(R>j)){if(0===G)R/=j;else R=(R-(V=c[G-1]))/(j-V);break}}if(G!==f){f=G;var k=6*G;for(P=h[k],S=h[k+1],O=h[k+2],x=h[k+3],E=h[k+4],M=h[k+5],v=2*(y=.03*(P-2*O+E))+(g=.006*(3*(O-E)-P+(B=h[k+6]))),T=2*(d=.03*(S-2*x+M))+(D=.006*(3*(x-M)-S+(I=h[k+7]))),b=.3*(O-P)+y+.16666667*g,A=.3*(x-S)+d+.16666667*D,w=Math.sqrt(b*b+A*A),C[0]=w,k=1;k<8;k++)b+=v,A+=T,v+=g,T+=D,w+=Math.sqrt(b*b+A*A),C[k]=w;b+=v,A+=T,w+=Math.sqrt(b*b+A*A),C[8]=w,b+=v+g,A+=T+D,w+=Math.sqrt(b*b+A*A),C[9]=w,N=0}for(R*=w;;N++){var L=C[N];if(!(R>L)){var V;if(0===N)R/=L;else R=N+(R-(V=C[N-1]))/(L-V);break}}this.addCurvePosition(.1*R,P,S,O,x,E,M,B,I,s,X,a)}}else{var Y=t.curveLengths;if(p=Y[_-=l?1:2],i&&(m*=p),r)for(var U=0;U<e;U++)o[U]*=p;h.length=8;for(var U=0,X=0,G=0;U<e;U++,X+=3){if(m+=o[U],l)(m%=p)<0&&(m+=p),G=0;else{if(m<0)continue;if(m>p)continue}for(var H=0;;G++){var z=Y[G];if(!(m>z)){if(0===G)H=m/z;else{var W=Y[G-1];H=(m-W)/(z-W)}break}}G!==f&&(f=G,l&&G===_?(this._computeVertices(u-4,4,0,h),this._computeVertices(0,4,4,h)):this._computeVertices(6*G+2,8,0,h)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],s,X,a)}}},a.prototype.addCurvePosition=function(t,e,a,i,r,n,s,o,l,h,u,_){if(0===t)return h[u]=e,h[u+1]=a,void(h[u+2]=0);if(1===t)return h[u]=o,h[u+1]=l,void(h[u+2]=0);var f=1-t,m=f*f,p=t*t,c=m*f,y=m*t*3,d=f*p*3,g=t*p,D=c*e+y*i+d*n+g*o,v=c*a+y*r+d*s+g*l;h[u]=D,h[u+1]=v,h[u+2]=_?Math.atan2(v-(c*a+y*r+d*s),D-(c*e+y*i+d*n)):0},a.prototype.init=function(t,e){this._constraintData=t,this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset,this.position=a.position,this.spacing=a.spacing,this.rotateOffset=a.rotateOffset,this.rotateMix=a.rotateMix,this.translateMix=a.translateMix,this._root=this._armature.getBone(a.root.name),this._target=this._armature.getBone(a.target.name),this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var i=0,r=a.bones.length;i<r;i++){var n=this._armature.getBone(a.bones[i].name);null!==n&&this._bones.push(n)}2===a.rotateMode&&(this._boneLengths.length=this._bones.length),this._root._hasConstraint=!0},a.prototype.update=function(){var e=this._pathSlot;if(null!==e._geometryData&&e._geometryData.offset===this.pathOffset){var a=this._constraintData,i=!1;if(this._root._childrenTransformDirty?(this._updatePathVertices(e._geometryData),i=!0):(e._verticesDirty||e._isBonesUpdate())&&(this._updatePathVertices(e._geometryData),e._verticesDirty=!1,i=!0),i||this.dirty){var r=a.positionMode,n=a.spacingMode,s=a.rotateMode,o=this._bones,l=0===n,h=2===s,u=0===s,_=o.length,f=u?_:_+1,m=this.spacing,p=this._spaces;if(p.length=f,h||l){p[0]=0;for(var c=0,y=f-1;c<y;c++){(M=o[c]).updateByConstraint();var d=M._boneData.length,g=d*(B=M.globalTransformMatrix).a,D=d*B.b,v=Math.sqrt(g*g+D*D);h&&(this._boneLengths[c]=v),p[c+1]=(d+m)*v/d}}else for(c=0;c<f;c++)p[c]=m;this._computeBezierCurve(e._displayFrame.rawDisplayData,f,u,1===r,2===n);var T,b=this._positions,A=this.rotateOffset,P=b[0],S=b[1];if(0===A)T=1===s;else if(T=!1,null!==(M=e.parent))A*=(B=M.globalTransformMatrix).a*B.d-B.b*B.c>0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD;for(var O=this.rotateMix,x=this.translateMix,E=(c=0,3);c<_;c++,E+=3){var M,B;(M=o[c]).updateByConstraint(),(B=M.globalTransformMatrix).tx+=(P-B.tx)*x,B.ty+=(S-B.ty)*x;var I=(g=b[E])-P,F=(D=b[E+1])-S;if(h){var C=this._boneLengths[c],w=(Math.sqrt(I*I+F*F)/C-1)*O+1;B.a*=w,B.b*=w}if(P=g,S=D,O>0){var N=B.a,R=B.b,j=B.c,k=B.d,L=void 0,V=void 0,Y=void 0;if(L=u?b[E-1]:Math.atan2(F,I),L-=Math.atan2(R,N),T){V=Math.cos(L),Y=Math.sin(L);var U=M._boneData.length;P+=(U*(V*N-Y*R)-I)*O,S+=(U*(Y*N+V*R)-F)*O}else L+=A;L>t.Transform.PI?L-=t.Transform.PI_D:L<-t.Transform.PI&&(L+=t.Transform.PI_D),L*=O,V=Math.cos(L),Y=Math.sin(L),B.a=V*N-Y*R,B.b=Y*N+V*R,B.c=V*j-Y*k,B.d=Y*j+V*k}M.global.fromMatrix(B)}this.dirty=!1}}},a.prototype.invalidUpdate=function(){},a}(e);t.PathConstraint=i}(f||(f={})),function(t){var e=function(){function t(t){void 0===t&&(t=0),this.time=0,this.timeScale=1,this._systemTime=0,this._animatebles=[],this._clock=null,this.time=t,this._systemTime=.001*(new Date).getTime()}return t.prototype.advanceTime=function(t){t!=t&&(t=0);var e=.001*Date.now();if(t<0&&(t=e-this._systemTime),this._systemTime=e,1!==this.timeScale&&(t*=this.timeScale),0!==t){t<0?this.time-=t:this.time+=t;for(var a=0,i=0,r=this._animatebles.length;a<r;++a){var n=this._animatebles[a];null!==n?(i>0&&(this._animatebles[a-i]=n,this._animatebles[a]=null),n.advanceTime(t)):i++}if(i>0){for(r=this._animatebles.length;a<r;++a){var s=this._animatebles[a];null!==s?this._animatebles[a-i]=s:i++}this._animatebles.length-=i}}},t.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.clock;return e===this},t.prototype.add=function(t){this._animatebles.indexOf(t)<0&&(this._animatebles.push(t),t.clock=this)},t.prototype.remove=function(t){var e=this._animatebles.indexOf(t);e>=0&&(this._animatebles[e]=null,t.clock=null)},t.prototype.clear=function(){for(var t=0,e=this._animatebles;t<e.length;t++){var a=e[t];null!==a&&(a.clock=null)}},Object.defineProperty(t.prototype,"clock",{get:function(){return this._clock},set:function(t){this._clock!==t&&(null!==this._clock&&this._clock.remove(this),this._clock=t,null!==this._clock&&this._clock.add(this))},enumerable:!0,configurable:!0}),t}();t.WorldClock=e}(f||(f={})),function(t){var e=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t._animationNames=[],t._animationStates=[],t._animations={},t._blendStates={},t._animationConfig=null,t}return c(a,e),a.toString=function(){return"[class dragonBones.Animation]"},a.prototype._onClear=function(){for(var t=0,e=this._animationStates;t<e.length;t++){e[t].returnToPool()}for(var a in this._animations)delete this._animations[a];for(var a in this._blendStates){var i=this._blendStates[a];for(var r in i)i[r].returnToPool();delete this._blendStates[a]}null!==this._animationConfig&&this._animationConfig.returnToPool(),this.timeScale=1,this._animationDirty=!1,this._inheritTimeScale=1,this._animationNames.length=0,this._animationStates.length=0,this._armature=null,this._animationConfig=null,this._lastAnimationState=null},a.prototype._fadeOut=function(t){switch(t.fadeOutMode){case 1:for(var e=0,a=this._animationStates;e<a.length;e++){null===(h=a[e])._parent&&(h.layer===t.layer&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 2:for(var i=0,r=this._animationStates;i<r.length;i++){null===(h=r[i])._parent&&(h.group===t.group&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 3:for(var n=0,s=this._animationStates;n<s.length;n++){null===(h=s[n])._parent&&(h.layer===t.layer&&h.group===t.group&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 4:for(var o=0,l=this._animationStates;o<l.length;o++){var h;null===(h=l[o])._parent&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}},a.prototype.init=function(e){null===this._armature&&(this._armature=e,this._animationConfig=t.BaseObject.borrowObject(t.AnimationConfig))},a.prototype.advanceTime=function(t){for(var e in t<0&&(t=-t),this._armature.inheritAnimation&&null!==this._armature._parent?this._inheritTimeScale=this._armature._parent._armature.animation._inheritTimeScale*this.timeScale:this._inheritTimeScale=this.timeScale,1!==this._inheritTimeScale&&(t*=this._inheritTimeScale),this._blendStates){var a=this._blendStates[e];for(var i in a)a[i].reset()}var r=this._animationStates.length;if(1===r)if((y=this._animationStates[0])._fadeState>0&&y._subFadeState>0)this._armature._dragonBones.bufferObject(y),this._animationStates.length=0,this._lastAnimationState=null;else{var n=y.animationData,s=n.cacheFrameRate;if(this._animationDirty&&s>0){this._animationDirty=!1;for(var o=0,l=this._armature.getBones();o<l.length;o++){var h=l[o];h._cachedFrameIndices=n.getBoneCachedFrameIndices(h.name)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var f=_[u];if(f.displayFrameCount>0){var m=f.getDisplayFrameAt(0).rawDisplayData;if(null!==m&&m.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=n.getSlotCachedFrameIndices(f.name);continue}}f._cachedFrameIndices=null}}y.advanceTime(t,s)}else if(r>1){for(var p=0,c=0;p<r;++p){var y;(y=this._animationStates[p])._fadeState>0&&y._subFadeState>0?(c++,this._armature._dragonBones.bufferObject(y),this._animationDirty=!0,this._lastAnimationState===y&&(this._lastAnimationState=null)):(c>0&&(this._animationStates[p-c]=y),y.advanceTime(t,0)),p===r-1&&c>0&&(this._animationStates.length-=c,null===this._lastAnimationState&&this._animationStates.length>0&&(this._lastAnimationState=this._animationStates[this._animationStates.length-1]))}this._armature._cacheFrameIndex=-1}else this._armature._cacheFrameIndex=-1},a.prototype.reset=function(){for(var t=0,e=this._animationStates;t<e.length;t++){e[t].returnToPool()}this._animationDirty=!1,this._animationConfig.clear(),this._animationStates.length=0,this._lastAnimationState=null},a.prototype.stop=function(t){if(void 0===t&&(t=null),null!==t)null!==(i=this.getState(t))&&i.stop();else for(var e=0,a=this._animationStates;e<a.length;e++){var i;(i=a[e]).stop()}},a.prototype.playConfig=function(e){var a=e.animation;if(!(a in this._animations))return console.warn("Non-existent animation.\n","DragonBones name: "+this._armature.armatureData.parent.name,"Armature name: "+this._armature.name,"Animation name: "+a),null;var i=this._animations[a];if(5===e.fadeOutMode)for(var r=0,n=this._animationStates;r<n.length;r++){var s=n[r];if(s._fadeState<1&&s.layer===e.layer&&s.animationData===i)return s}0===this._animationStates.length?e.fadeInTime=0:e.fadeInTime<0&&(e.fadeInTime=i.fadeInTime),e.fadeOutTime<0&&(e.fadeOutTime=e.fadeInTime),e.timeScale<=-100&&(e.timeScale=1/i.scale),i.frameCount>0?(e.position<0?(e.position%=i.duration,e.position=i.duration-e.position):e.position===i.duration?e.position-=1e-6:e.position>i.duration&&(e.position%=i.duration),e.duration>0&&e.position+e.duration>i.duration&&(e.duration=i.duration-e.position),e.playTimes<0&&(e.playTimes=i.playTimes)):(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.duration=-1),this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,i,e),this._animationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0){for(var l=!1,h=0,u=this._animationStates.length;h<u;++h){if(o.layer>this._animationStates[h].layer){l=!0,this._animationStates.splice(h,0,o);break}if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=!0,this._animationStates.splice(h+1,0,o);break}}l||this._animationStates.push(o)}else this._animationStates.push(o);for(var _=0,f=this._armature.getSlots();_<f.length;_++){var m=f[_].childArmature;null!==m&&m.inheritAnimation&&m.animation.hasAnimation(a)&&null===m.animation.getState(a)&&m.animation.fadeIn(a)}for(var p in i.animationTimelines){var c=this.fadeIn(p,0,1,o.layer,"",5);if(null!==c){var y=i.animationTimelines[p];c.actionEnabled=!1,c.resetToPose=!1,c.stop(),o.addState(c,y);var d=this._animationStates.indexOf(o),g=this._animationStates.indexOf(c);g<d&&(this._animationStates.splice(d,1),this._animationStates.splice(g,0,o))}}return this._lastAnimationState=o,o},a.prototype.play=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=null!==t?t:"",null!==t&&t.length>0)this.playConfig(this._animationConfig);else if(null===this._lastAnimationState){var a=this._armature.armatureData.defaultAnimation;null!==a&&(this._animationConfig.animation=a.name,this.playConfig(this._animationConfig))}else this._lastAnimationState.isPlaying||this._lastAnimationState.isCompleted?(this._animationConfig.animation=this._lastAnimationState.name,this.playConfig(this._animationConfig)):this._lastAnimationState.play();return this._lastAnimationState},a.prototype.fadeIn=function(t,e,a,i,r,n){return void 0===e&&(e=-1),void 0===a&&(a=-1),void 0===i&&(i=0),void 0===r&&(r=null),void 0===n&&(n=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=n,this._animationConfig.playTimes=a,this._animationConfig.layer=i,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==r?r:"",this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByTime=function(t,e,a){return void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.position=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByFrame=function(t,e,a){void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var i=t in this._animations?this._animations[t]:null;return null!==i&&(this._animationConfig.position=i.frameCount>0?i.duration*e/i.frameCount:0),this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByProgress=function(t,e,a){void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var i=t in this._animations?this._animations[t]:null;return null!==i&&(this._animationConfig.position=i.duration*(e>0?e:0)),this.playConfig(this._animationConfig)},a.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByTime(t,e,1);return null!==a&&a.stop(),a},a.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByFrame(t,e,1);return null!==a&&a.stop(),a},a.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByProgress(t,e,1);return null!==a&&a.stop(),a},a.prototype.getBlendState=function(e,a,i){e in this._blendStates||(this._blendStates[e]={});var r=this._blendStates[e];a in r||((r[a]=t.BaseObject.borrowObject(t.BlendState)).target=i);return r[a]},a.prototype.getState=function(t,e){void 0===e&&(e=-1);for(var a=this._animationStates.length;a--;){var i=this._animationStates[a];if(i.name===t&&(e<0||i.layer===e))return i}return null},a.prototype.hasAnimation=function(t){return t in this._animations},a.prototype.getStates=function(){return this._animationStates},Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){if(e[t].isPlaying)return!0}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCompleted",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){if(!e[t].isCompleted)return!1}return this._animationStates.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations!==t){for(var e in this._animationNames.length=0,this._animations)delete this._animations[e];for(var e in t)this._animationNames.push(e),this._animations[e]=t[e]}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animationConfig",{get:function(){return this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:!0,configurable:!0}),a}(t.BaseObject);t.Animation=e}(f||(f={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._boneMask=[],t._boneTimelines=[],t._boneBlendTimelines=[],t._slotTimelines=[],t._slotBlendTimelines=[],t._constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._actionTimeline=null,t._zOrderTimeline=null,t}return c(i,e),i.toString=function(){return"[class dragonBones.AnimationState]"},i.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t<e.length;t++){(f=e[t]).returnToPool()}for(var a=0,i=this._boneBlendTimelines;a<i.length;a++){(f=i[a]).returnToPool()}for(var r=0,n=this._slotTimelines;r<n.length;r++){(f=n[r]).returnToPool()}for(var s=0,o=this._slotBlendTimelines;s<o.length;s++){(f=o[s]).returnToPool()}for(var l=0,h=this._constraintTimelines;l<h.length;l++){(f=h[l]).returnToPool()}for(var u=0,_=this._animationTimelines;u<_.length;u++){var f,m=(f=_[u]).target;m._parent===this&&(m._fadeState=1,m._subFadeState=1,m._parent=null),f.returnToPool()}null!==this._actionTimeline&&this._actionTimeline.returnToPool(),null!==this._zOrderTimeline&&this._zOrderTimeline.returnToPool(),this.actionEnabled=!1,this.additive=!1,this.displayControl=!1,this.resetToPose=!1,this.blendType=0,this.playTimes=1,this.layer=0,this.timeScale=1,this._weight=1,this.parameterX=0,this.parameterY=0,this.positionX=0,this.positionY=0,this.autoFadeOutTime=0,this.fadeTotalTime=0,this.name="",this.group="",this._timelineDirty=2,this._playheadState=0,this._fadeState=-1,this._subFadeState=-1,this._position=0,this._duration=0,this._fadeTime=0,this._time=0,this._fadeProgress=0,this._weightResult=0,this._boneMask.length=0,this._boneTimelines.length=0,this._boneBlendTimelines.length=0,this._slotTimelines.length=0,this._slotBlendTimelines.length=0,this._constraintTimelines.length=0,this._animationTimelines.length=0,this._poseTimelines.length=0,this._animationData=null,this._armature=null,this._actionTimeline=null,this._zOrderTimeline=null,this._activeChildA=null,this._activeChildB=null,this._parent=null},i.prototype._updateTimelines=function(){for(var e=0,a=this._armature._constraints;e<a.length;e++){var i=a[e],r=this._animationData.getConstraintTimelines(i.name);if(null!==r)for(var n=0,s=r;n<s.length;n++){var o=s[n];if(30===o.type)(l=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).target=i,l.init(this._armature,this,o),this._constraintTimelines.push(l)}else if(this.resetToPose){var l;(l=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).target=i,l.init(this._armature,this,null),this._constraintTimelines.push(l),this._poseTimelines.push(l)}}},i.prototype._updateBoneAndSlotTimelines=function(){for(var e={},i=0,r=this._boneTimelines;i<r.length;i++){(u=(g=r[i]).target.target.name)in e||(e[u]=[]),e[u].push(g)}for(var n=0,s=this._boneBlendTimelines;n<s.length;n++){(u=(g=s[n]).target.target.name)in e||(e[u]=[]),e[u].push(g)}for(var o=0,l=this._armature.getBones();o<l.length;o++){var h=l[o],u=h.name;if(this.containsBoneMask(u))if(u in e)delete e[u];else{var _=this._animationData.getBoneTimelines(u),f=this._armature.animation.getBlendState(a.BONE_TRANSFORM,h.name,h);if(null!==_)for(var m=0,p=_;m<p.length;m++){switch((C=p[m]).type){case 10:(g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 11:(g=t.BaseObject.borrowObject(t.BoneTranslateTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 12:(g=t.BaseObject.borrowObject(t.BoneRotateTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 13:(g=t.BaseObject.borrowObject(t.BoneScaleTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 60:(g=t.BaseObject.borrowObject(t.AlphaTimelineState)).target=this._armature.animation.getBlendState(a.BONE_ALPHA,h.name,h),g.init(this._armature,this,C),this._boneBlendTimelines.push(g);break;case 50:(g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).target=this._armature.animation.getBlendState(a.SURFACE,h.name,h),g.init(this._armature,this,C),this._boneBlendTimelines.push(g)}}else if(this.resetToPose){if(0===h._boneData.type)(g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).target=f,g.init(this._armature,this,null),this._boneTimelines.push(g),this._poseTimelines.push(g);else(g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).target=this._armature.animation.getBlendState(a.SURFACE,h.name,h),g.init(this._armature,this,null),this._boneBlendTimelines.push(g),this._poseTimelines.push(g)}}}for(var c in e)for(var y=0,d=e[c];y<d.length;y++){var g=d[y];(V=this._boneTimelines.indexOf(g))>=0&&(this._boneTimelines.splice(V,1),g.returnToPool()),(V=this._boneBlendTimelines.indexOf(g))>=0&&(this._boneBlendTimelines.splice(V,1),g.returnToPool())}for(var D={},v=[],T=0,b=this._slotTimelines;T<b.length;T++){(u=(g=b[T]).target.name)in D||(D[u]=[]),D[u].push(g)}for(var A=0,P=this._slotBlendTimelines;A<P.length;A++){(u=(g=P[A]).target.target.name)in D||(D[u]=[]),D[u].push(g)}for(var S=0,O=this._armature.getSlots();S<O.length;S++){var x=O[S],E=x.parent.name;if(this.containsBoneMask(E))if((u=x.name)in D)delete D[u];else{var M=!1,B=!1;if(v.length=0,null!==(_=this._animationData.getSlotTimelines(u)))for(var I=0,F=_;I<F.length;I++){var C;switch((C=F[I]).type){case 20:(g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).target=x,g.init(this._armature,this,C),this._slotTimelines.push(g),M=!0;break;case 23:(g=t.BaseObject.borrowObject(t.SlotZIndexTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_Z_INDEX,x.name,x),g.init(this._armature,this,C),this._slotBlendTimelines.push(g);break;case 21:(g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).target=x,g.init(this._armature,this,C),this._slotTimelines.push(g),B=!0;break;case 22:(g=t.BaseObject.borrowObject(t.DeformTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_DEFORM,x.name,x),g.init(this._armature,this,C),null!==g.target?(this._slotBlendTimelines.push(g),v.push(g.geometryOffset)):g.returnToPool();break;case 24:(g=t.BaseObject.borrowObject(t.AlphaTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_ALPHA,x.name,x),g.init(this._armature,this,C),this._slotBlendTimelines.push(g)}}if(this.resetToPose){if(!M)(g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).target=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g);if(!B)(g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).target=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g);for(var w=0,N=x.displayFrameCount;w<N;++w){var R=x.getDisplayFrameAt(w);if(0!==R.deformVertices.length){var j=R.getGeometryData();if(null!==j&&v.indexOf(j.offset)<0)(g=t.BaseObject.borrowObject(t.DeformTimelineState)).geometryOffset=j.offset,g.displayFrame=R,g.target=this._armature.animation.getBlendState(a.SLOT_DEFORM,x.name,x),g.init(this._armature,this,null),this._slotBlendTimelines.push(g),this._poseTimelines.push(g)}}}}}for(var c in D)for(var k=0,L=D[c];k<L.length;k++){var V;g=L[k];(V=this._slotTimelines.indexOf(g))>=0&&(this._slotTimelines.splice(V,1),g.returnToPool()),(V=this._slotBlendTimelines.indexOf(g))>=0&&(this._slotBlendTimelines.splice(V,1),g.returnToPool())}},i.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0&&(this._subFadeState=0,null===this._parent&&this.actionEnabled)){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i))(r=t.BaseObject.borrowObject(t.EventObject)).type=i,r.armature=this._armature,r.animationState=this,this._armature._dragonBones.bufferEvent(r)}if((e<0&&(e=-e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?(this._subFadeState=1,this._fadeProgress=a?0:1):this._fadeTime>0?this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgress=a?1:0,this._subFadeState>0)&&(a||(this._playheadState|=1,this._fadeState=0),null===this._parent&&this.actionEnabled)){var r;i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i))(r=t.BaseObject.borrowObject(t.EventObject)).type=i,r.armature=this._armature,r.animationState=this,this._armature._dragonBones.bufferEvent(r)}},i.prototype.init=function(e,a,i){if(null===this._armature){if(this._armature=e,this._animationData=a,this.resetToPose=i.resetToPose,this.additive=i.additive,this.displayControl=i.displayControl,this.actionEnabled=i.actionEnabled,this.blendType=a.blendType,this.layer=i.layer,this.playTimes=i.playTimes,this.timeScale=i.timeScale,this.fadeTotalTime=i.fadeInTime,this.autoFadeOutTime=i.autoFadeOutTime,this.name=i.name.length>0?i.name:i.animation,this.group=i.group,this._weight=i.weight,i.pauseFadeIn?this._playheadState=2:this._playheadState=3,i.duration<0?(this._position=0,this._duration=this._animationData.duration,0!==i.position?this.timeScale>=0?this._time=i.position:this._time=i.position-this._duration:this._time=0):(this._position=i.position,this._duration=i.duration,this._time=0),this.timeScale<0&&0===this._time&&(this._time=-1e-6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),i.boneMask.length>0){this._boneMask.length=i.boneMask.length;for(var r=0,n=this._boneMask.length;r<n;++r)this._boneMask[r]=i.boneMask[r]}this._actionTimeline=t.BaseObject.borrowObject(t.ActionTimelineState),this._actionTimeline.init(this._armature,this,this._animationData.actionTimeline),this._actionTimeline.currentTime=this._time,this._actionTimeline.currentTime<0&&(this._actionTimeline.currentTime=this._duration-this._actionTimeline.currentTime),null!==this._animationData.zOrderTimeline&&(this._zOrderTimeline=t.BaseObject.borrowObject(t.ZOrderTimelineState),this._zOrderTimeline.init(this._armature,this,this._animationData.zOrderTimeline))}},i.prototype.advanceTime=function(t,e){0===this._fadeState&&0===this._subFadeState||this._advanceFadeTime(t),3===this._playheadState&&(1!==this.timeScale&&(t*=this.timeScale),this._time+=t),0!==this._timelineDirty&&(2===this._timelineDirty&&this._updateTimelines(),this._timelineDirty=0,this._updateBoneAndSlotTimelines());var a=0!==this._fadeState||0===this._subFadeState,i=0===this._fadeState&&e>0,r=!0,n=!0,s=this._time;if(this._weightResult=this._weight*this._fadeProgress,null!==this._parent&&(this._weightResult*=this._parent._weightResult),this._actionTimeline.playState<=0&&this._actionTimeline.update(s),0!==this._weight){if(i){var o=2*e;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(null!==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.update(s),i){var l=Math.floor(this._actionTimeline.currentTime*e);this._armature._cacheFrameIndex===l?(r=!1,n=!1):(this._armature._cacheFrameIndex=l,this._animationData.cachedFrames[l]?n=!1:this._animationData.cachedFrames[l]=!0)}if(r){var h=!1,u=null;if(n)for(var _=0,f=this._boneTimelines.length;_<f;++_){if((P=this._boneTimelines[_]).playState<=0&&P.update(s),P.target!==u)if(h=(c=P.target).update(this),u=c,1===c.dirty){var m=c.target.animationPose;m.x=0,m.y=0,m.rotation=0,m.skew=0,m.scaleX=1,m.scaleY=1}h&&P.blend(a)}for(_=0,f=this._boneBlendTimelines.length;_<f;++_){(P=this._boneBlendTimelines[_]).playState<=0&&P.update(s),P.target.update(this)&&P.blend(a)}if(this.displayControl)for(_=0,f=this._slotTimelines.length;_<f;++_){if((P=this._slotTimelines[_]).playState<=0){var p=P.target.displayController;null!==p&&p!==this.name&&p!==this.group||P.update(s)}}for(_=0,f=this._slotBlendTimelines.length;_<f;++_){if((P=this._slotBlendTimelines[_]).playState<=0){var c=P.target;P.update(s),c.update(this)&&P.blend(a)}}for(_=0,f=this._constraintTimelines.length;_<f;++_){(P=this._constraintTimelines[_]).playState<=0&&P.update(s)}if(this._animationTimelines.length>0){var y=100,d=100,g=null,D=null;for(_=0,f=this._animationTimelines.length;_<f;++_){if((P=this._animationTimelines[_]).playState<=0&&P.update(s),1===this.blendType){var v=P.target,T=this.parameterX-v.positionX;T>=0?T<y&&(y=T,g=v):-T<d&&(d=-T,D=v)}}null!==g&&(this._activeChildA!==g&&(null!==this._activeChildA&&(this._activeChildA.weight=0),this._activeChildA=g,this._activeChildA.activeTimeline()),this._activeChildB!==D&&(null!==this._activeChildB&&(this._activeChildB.weight=0),this._activeChildB=D),g.weight=d/(y+d),D&&(D.weight=1-g.weight))}}if(0===this._fadeState){if(this._subFadeState>0&&(this._subFadeState=0,this._poseTimelines.length>0)){for(var b=0,A=this._poseTimelines;b<A.length;b++){var P=A[b],S=this._boneTimelines.indexOf(P);S>=0?(this._boneTimelines.splice(S,1),P.returnToPool()):(S=this._boneBlendTimelines.indexOf(P))>=0?(this._boneBlendTimelines.splice(S,1),P.returnToPool()):(S=this._slotTimelines.indexOf(P))>=0?(this._slotTimelines.splice(S,1),P.returnToPool()):(S=this._slotBlendTimelines.indexOf(P))>=0?(this._slotBlendTimelines.splice(S,1),P.returnToPool()):(S=this._constraintTimelines.indexOf(P))>=0&&(this._constraintTimelines.splice(S,1),P.returnToPool())}this._poseTimelines.length=0}this._actionTimeline.playState>0&&this.autoFadeOutTime>=0&&this.fadeOut(this.autoFadeOutTime)}}},i.prototype.play=function(){this._playheadState=3},i.prototype.stop=function(){this._playheadState&=1},i.prototype.fadeOut=function(t,e){if(void 0===e&&(e=!0),t<0&&(t=0),e&&(this._playheadState&=2),this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime)return}else{this._fadeState=1,this._subFadeState=-1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var a=0,i=this._boneTimelines;a<i.length;a++){(p=i[a]).fadeOut()}for(var r=0,n=this._boneBlendTimelines;r<n.length;r++){(p=n[r]).fadeOut()}for(var s=0,o=this._slotTimelines;s<o.length;s++){(p=o[s]).fadeOut()}for(var l=0,h=this._slotBlendTimelines;l<h.length;l++){(p=h[l]).fadeOut()}for(var u=0,_=this._constraintTimelines;u<_.length;u++){(p=_[u]).fadeOut()}for(var f=0,m=this._animationTimelines;f<m.length;f++){var p;(p=m[f]).fadeOut(),p.target.fadeOut(999999,!0)}}this.displayControl=!1,this.fadeTotalTime=this._fadeProgress>1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},i.prototype.containsBoneMask=function(t){return 0===this._boneMask.length||this._boneMask.indexOf(t)>=0},i.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var a=this._armature.getBone(t);if(null!==a){if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var i=0,r=this._armature.getBones();i<r.length;i++){var n=r[i];this._boneMask.indexOf(n.name)<0&&a.contains(n)&&this._boneMask.push(n.name)}this._timelineDirty=1}},i.prototype.removeBoneMask=function(t,e){void 0===e&&(e=!0);var a=this._boneMask.indexOf(t);if(a>=0&&this._boneMask.splice(a,1),e){var i=this._armature.getBone(t);if(null!==i){var r=this._armature.getBones();if(this._boneMask.length>0)for(var n=0,s=r;n<s.length;n++){var o=s[n],l=this._boneMask.indexOf(o.name);l>=0&&i.contains(o)&&this._boneMask.splice(l,1)}else for(var h=0,u=r;h<u.length;h++){(o=u[h])!==i&&(i.contains(o)||this._boneMask.push(o.name))}}}this._timelineDirty=1},i.prototype.removeAllBoneMask=function(){this._boneMask.length=0,this._timelineDirty=1},i.prototype.addState=function(e,a){if(void 0===a&&(a=null),null!==a)for(var i=0,r=a;i<r.length;i++){var n=r[i];switch(n.type){case 40:if((o=t.BaseObject.borrowObject(t.AnimationProgressTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o),0!==this.blendType){var s=n;e.positionX=s.x,e.positionY=s.y,e.weight=0}e._parent=this,this.resetToPose=!1;break;case 41:(o=t.BaseObject.borrowObject(t.AnimationWeightTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o);break;case 42:var o;(o=t.BaseObject.borrowObject(t.AnimationParametersTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o)}}null===e._parent&&(e._parent=this)},i.prototype.activeTimeline=function(){for(var t=0,e=this._slotTimelines;t<e.length;t++){var a=e[t];a.dirty=!0,a.currentTime=-1}},Object.defineProperty(i.prototype,"isFadeIn",{get:function(){return this._fadeState<0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFadeOut",{get:function(){return this._fadeState>0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return 0===this._fadeState},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isPlaying",{get:function(){return!!(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if((t<0||this._duration<t)&&(t=t%this._duration+e*this._duration)<0&&(t+=this._duration),this.playTimes>0&&e===this.playTimes-1&&t===this._duration&&null===this._parent&&(t=this._duration-1e-6),this._time!==t){this._time=t,this._actionTimeline.setCurrentTime(this._time),null!==this._zOrderTimeline&&(this._zOrderTimeline.playState=-1);for(var a=0,i=this._boneTimelines;a<i.length;a++){i[a].playState=-1}for(var r=0,n=this._slotTimelines;r<n.length;r++){n[r].playState=-1}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"weight",{get:function(){return this._weight},set:function(t){if(this._weight!==t){this._weight=t;for(var e=0,a=this._boneTimelines;e<a.length;e++){a[e].dirty=!0}for(var i=0,r=this._boneBlendTimelines;i<r.length;i++){r[i].dirty=!0}for(var n=0,s=this._slotBlendTimelines;n<s.length;n++){s[n].dirty=!0}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationData",{get:function(){return this._animationData},enumerable:!0,configurable:!0}),i}(t.BaseObject);t.AnimationState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.BlendState]"},e.prototype._onClear=function(){this.reset(),this.target=null},e.prototype.update=function(t){var e=t.layer,a=t._weightResult;if(this.dirty>0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return this.dirty++,this.layer=e,this.leftWeight=0,this.blendWeight=0,!1;this.layer=e,this.leftWeight-=this.layerWeight,this.layerWeight=0}return a*=this.leftWeight,this.dirty++,this.blendWeight=a,this.layerWeight+=this.blendWeight,!0}return!1}return this.dirty++,this.layer=e,this.leftWeight=1,this.blendWeight=a,this.layerWeight=a,!0},e.prototype.reset=function(){this.dirty=0,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},e.BONE_TRANSFORM="boneTransform",e.BONE_ALPHA="boneAlpha",e.SURFACE="surface",e.SLOT_DEFORM="slotDeform",e.SLOT_ALPHA="slotAlpha",e.SLOT_Z_INDEX="slotZIndex",e}(t.BaseObject);t.BlendState=a}(f||(f={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._onClear=function(){this.dirty=!1,this.playState=-1,this.currentPlayTimes=-1,this.currentTime=-1,this.target=null,this._isTween=!1,this._valueOffset=0,this._frameValueOffset=0,this._frameOffset=0,this._frameRate=0,this._frameCount=0,this._frameIndex=-1,this._frameRateR=0,this._position=0,this._duration=0,this._timeScale=1,this._timeOffset=0,this._animationData=null,this._timelineData=null,this._armature=null,this._animationState=null,this._actionTimeline=null,this._frameArray=null,this._valueArray=null,this._timelineArray=null,this._frameIndices=null},e.prototype._setCurrentTime=function(t){var e=this.playState,a=this.currentPlayTimes,i=this.currentTime;if(null!==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.playState>=0?1:-1,this.currentPlayTimes=1,this.currentTime=this._actionTimeline.currentTime;else if(null===this._actionTimeline||1!==this._timeScale||0!==this._timeOffset){var r=this._animationState.playTimes,n=r*this._duration;t*=this._timeScale,0!==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),r>0&&(t>=n||t<=-n)?(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),this.currentPlayTimes=r,this.currentTime=t<0?0:this._duration+1e-6):(0!==this.playState&&3===this._animationState._playheadState&&(this.playState=0),t<0?(t=-t,this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=this._duration-t%this._duration):(this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=t%this._duration)),this.currentTime+=this._position}else this.playState=this._actionTimeline.playState,this.currentPlayTimes=this._actionTimeline.currentPlayTimes,this.currentTime=this._actionTimeline.currentTime;return(this.currentPlayTimes!==a||this.currentTime!==i)&&((e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a)&&(this._frameIndex=-1),!0)},e.prototype.init=function(t,e,a){if(this._armature=t,this._animationState=e,this._timelineData=a,this._actionTimeline=this._animationState._actionTimeline,this===this._actionTimeline&&(this._actionTimeline=null),this._animationData=this._animationState.animationData,this._frameRate=this._animationData.parent.frameRate,this._frameRateR=1/this._frameRate,this._position=this._animationState._position,this._duration=this._animationState._duration,null!==this._timelineData){var i=this._animationData.parent.parent;this._frameArray=i.frameArray,this._timelineArray=i.timelineArray,this._frameIndices=i.frameIndices,this._frameCount=this._timelineArray[this._timelineData.offset+2],this._frameValueOffset=this._timelineArray[this._timelineData.offset+4],this._timeScale=100/this._timelineArray[this._timelineData.offset+0],this._timeOffset=.01*this._timelineArray[this._timelineData.offset+1]}},e.prototype.fadeOut=function(){this.dirty=!1},e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate),a=this._frameIndices[this._timelineData.frameIndicesOffset+e];this._frameIndex!==a&&(this._frameIndex=a,this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]),this._onArriveAtFrame());(this._isTween||this.dirty)&&this._onUpdateFrame()}},e.prototype.blend=function(t){},e}(t.BaseObject);t.TimelineState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e._getEasingValue=function(t,e,a){var i=e;switch(t){case 3:i=Math.pow(e,2);break;case 4:i=1-Math.pow(1-e,2);break;case 5:i=.5*(1-Math.cos(e*Math.PI))}return(i-e)*a+e},e._getEasingCurveValue=function(t,e,a,i){if(t<=0)return 0;if(t>=1)return 1;var r=a>0,n=a+1,s=Math.floor(t*n),o=0,l=0;return r?(o=0===s?0:e[i+s-1],l=s===n-1?1e4:e[i+s]):(o=e[i+s-1],l=e[i+s]),1e-4*(o+(l-o)*(t*n-s))},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._tweenType=0,this._curveCount=0,this._framePosition=0,this._frameDurationR=0,this._tweenEasing=0,this._tweenProgress=0,this._valueScale=1},e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||0===this._animationState.playTimes||this._animationState.currentPlayTimes<this._animationState.playTimes-1))if(this._tweenType=this._frameArray[this._frameOffset+1],this._isTween=0!==this._tweenType,this._isTween?2===this._tweenType?this._curveCount=this._frameArray[this._frameOffset+2]:0!==this._tweenType&&1!==this._tweenType&&(this._tweenEasing=.01*this._frameArray[this._frameOffset+2]):this.dirty=!0,this._framePosition=this._frameArray[this._frameOffset]*this._frameRateR,this._frameIndex===this._frameCount-1)this._frameDurationR=1/(this._animationData.duration-this._framePosition);else{var t=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex+1],e=this._frameArray[t]*this._frameRateR-this._framePosition;this._frameDurationR=e>0?1/e:0}else this.dirty=!0,this._isTween=!1},e.prototype._onUpdateFrame=function(){this._isTween&&(this.dirty=!0,this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR,2===this._tweenType?this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3):1!==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)))},e}(e);t.TweenTimelineState=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._current=0,this._difference=0,this._result=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,a=this._valueArray,i=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+1;1===e?(this._current=a[i],this._difference=a[r]-this._current):(this._current=a[i]*e,this._difference=a[r]*e-this._current)}else this._result=a[i]*e}else this._result=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result=this._current+this._difference*this._tweenProgress)},e}(a);t.SingleValueTimelineState=i;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._currentA=0,this._currentB=0,this._differenceA=0,this._differenceB=0,this._resultA=0,this._resultB=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,a=this._valueArray,i=this._valueOffset+this._frameValueOffset+2*this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+2;1===e?(this._currentA=a[i],this._currentB=a[i+1],this._differenceA=a[r]-this._currentA,this._differenceB=a[r+1]-this._currentB):(this._currentA=a[i]*e,this._currentB=a[i+1]*e,this._differenceA=a[r]*e-this._currentA,this._differenceB=a[r+1]*e-this._currentB)}else this._resultA=a[i]*e,this._resultB=a[i+1]*e}else this._resultA=0,this._resultB=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._resultA=this._currentA+this._differenceA*this._tweenProgress,this._resultB=this._currentB+this._differenceB*this._tweenProgress)},e}(a);t.DoubleValueTimelineState=r;var n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._rd=[],e}return c(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._valueCount=0,this._rd.length=0},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount,a=this._rd;if(null!==this._timelineData){var i=this._valueScale,r=this._valueArray,n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(1===i)for(var o=0;o<e;++o)a[e+o]=r[s+o]-r[n+o];else for(o=0;o<e;++o)a[e+o]=(r[s+o]-r[n+o])*i}else if(1===i)for(o=0;o<e;++o)a[o]=r[n+o];else for(o=0;o<e;++o)a[o]=r[n+o]*i}else for(o=0;o<e;++o)a[o]=0},e.prototype._onUpdateFrame=function(){if(t.prototype._onUpdateFrame.call(this),this._isTween){var e=this._valueCount,a=this._valueScale,i=this._tweenProgress,r=this._valueArray,n=this._rd,s=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(1===a)for(var o=0;o<e;++o)n[o]=r[s+o]+n[e+o]*i;else for(o=0;o<e;++o)n[o]=r[s+o]*a+n[e+o]*i}},e}(a);t.MutilpleValueTimelineState=n}(f||(f={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.toString=function(){return"[class dragonBones.ActionTimelineState]"},a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled)for(var i=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e],r=this._frameArray[i+1],n=this._animationData.parent.actions,s=0;s<r;++s){var o=n[this._frameArray[i+2+s]];if(0===o.type){(l=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[i]/this._frameRate,l.animationState=this._animationState,t.EventObject.actionDataToInstance(o,l,this._armature),this._armature._bufferAction(l,!0)}else{var l,h=10===o.type?t.EventObject.FRAME_EVENT:t.EventObject.SOUND_EVENT;if(11===o.type||a.hasDBEventListener(h))(l=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[i]/this._frameRate,l.animationState=this._animationState,t.EventObject.actionDataToInstance(o,l,this._armature),this._armature._dragonBones.bufferEvent(l)}}},a.prototype._onArriveAtFrame=function(){},a.prototype._onUpdateFrame=function(){},a.prototype.update=function(e){var a=this.playState,i=this.currentPlayTimes,r=this.currentTime;if(this._setCurrentTime(e)){var n=null===this._animationState._parent&&this._animationState.actionEnabled,s=this._armature.eventDispatcher;if(a<0){if(this.playState===a)return;if(this._animationState.displayControl&&this._animationState.resetToPose&&this._armature._sortZOrder(null,0),i=this.currentPlayTimes,n&&s.hasDBEventListener(t.EventObject.START)){var o=t.BaseObject.borrowObject(t.EventObject);o.type=t.EventObject.START,o.armature=this._armature,o.animationState=this._animationState,this._armature._dragonBones.bufferEvent(o)}}var l=this._animationState.timeScale<0,h=null,u=null;if(n&&this.currentPlayTimes!==i&&(s.hasDBEventListener(t.EventObject.LOOP_COMPLETE)&&((h=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.LOOP_COMPLETE,h.armature=this._armature,h.animationState=this._animationState),this.playState>0&&s.hasDBEventListener(t.EventObject.COMPLETE)&&((u=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.COMPLETE,u.armature=this._armature,u.animationState=this._animationState)),this._frameCount>1){var _=this._timelineData,f=Math.floor(this.currentTime*this._frameRate),m=this._frameIndices[_.frameIndicesOffset+f];if(this._frameIndex!==m){var p=this._frameIndex;if(this._frameIndex=m,null!==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._timelineArray[_.offset+5+this._frameIndex],l){if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[_.frameIndicesOffset+c],this.currentPlayTimes===i&&p===m&&(p=-1)}for(;p>=0;){var y=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],d=this._frameArray[y]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration&&this._onCrossFrame(p),null!==h&&0===p&&(this._armature._dragonBones.bufferEvent(h),h=null),p>0?p--:p=this._frameCount-1,p===m)break}}else{if(p<0){c=Math.floor(r*this._frameRate);p=this._frameIndices[_.frameIndicesOffset+c];y=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],d=this._frameArray[y]/this._frameRate;this.currentPlayTimes===i&&(r<=d?p>0?p--:p=this._frameCount-1:p===m&&(p=-1))}for(;p>=0;){p<this._frameCount-1?p++:p=0;y=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],d=this._frameArray[y]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration&&this._onCrossFrame(p),null!==h&&0===p&&(this._armature._dragonBones.bufferEvent(h),h=null),p===m)break}}}}else if(this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData)){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5];d=this._frameArray[this._frameOffset]/this._frameRate;this.currentPlayTimes===i?r<=d&&this._onCrossFrame(this._frameIndex):this._position<=d&&(l||null===h||(this._armature._dragonBones.bufferEvent(h),h=null),this._onCrossFrame(this._frameIndex))}null!==h&&this._armature._dragonBones.bufferEvent(h),null!==u&&this._armature._dragonBones.bufferEvent(u)}},a.prototype.setCurrentTime=function(t){this._setCurrentTime(t),this._frameIndex=-1},a}(t.TimelineState);t.ActionTimelineState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.ZOrderTimelineState]"},e.prototype._onArriveAtFrame=function(){this.playState>=0&&(this._frameArray[this._frameOffset+1]>0?this._armature._sortZOrder(this._frameArray,this._frameOffset+2):this._armature._sortZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.ZOrderTimelineState=a;var i=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"},a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])),null===this._timelineData&&(this._rd[4]=1,this._rd[5]=1)},a.prototype.init=function(t,a,i){e.prototype.init.call(this,t,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=6,this._valueArray=this._animationData.parent.parent.frameFloatArray},a.prototype.fadeOut=function(){this.dirty=!1,this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])},a.prototype.blend=function(t){var e=this._armature.armatureData.scale,a=this._rd,i=this.target,r=i.target,n=i.blendWeight,s=r.animationPose;i.dirty>1?(s.x+=a[0]*n*e,s.y+=a[1]*n*e,s.rotation+=a[2]*n,s.skew+=a[3]*n,s.scaleX+=(a[4]-1)*n,s.scaleY+=(a[5]-1)*n):(s.x=a[0]*n*e,s.y=a[1]*n*e,s.rotation=a[2]*n,s.skew=a[3]*n,s.scaleX=(a[4]-1)*n+1,s.scaleY=(a[5]-1)*n+1),(t||this.dirty)&&(this.dirty=!1,r._transformDirty=!0)},a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=i;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.x+=this._resultA*i,r.y+=this._resultB*i):1!==i?(r.x=this._resultA*i,r.y=this._resultB*i):(r.x=this._resultA,r.y=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=r;var n=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"},a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._differenceA=t.Transform.normalizeRadian(this._differenceA),this._differenceB=t.Transform.normalizeRadian(this._differenceB))},a.prototype.init=function(t,a,i){e.prototype.init.call(this,t,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},a.prototype.fadeOut=function(){this.dirty=!1,this._resultA=t.Transform.normalizeRadian(this._resultA),this._resultB=t.Transform.normalizeRadian(this._resultB)},a.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.rotation+=this._resultA*i,r.skew+=this._resultB*i):1!==i?(r.rotation=this._resultA*i,r.skew=this._resultB*i):(r.rotation=this._resultA,r.skew=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._resultA=1,this._resultB=1)},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.scaleX+=(this._resultA-1)*i,r.scaleY+=(this._resultB-1)*i):1!==i?(r.scaleX=(this._resultA-1)*i+1,r.scaleY=(this._resultB-1)*i+1):(r.scaleX=this._resultA,r.scaleY=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,a,i){if(t.prototype.init.call(this,e,a,i),null!==this._timelineData){var r=this._animationData.parent.parent,n=r.frameIntArray,s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=n[s+2],this._deformCount=n[s+1],this._deformOffset=n[s+3],this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=r.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.target.target._deformVertices.length},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a._deformVertices,n=this._valueArray;if(null!==n)for(var s=this._valueCount,o=this._deformOffset,l=this._sameValueOffset,h=this._rd,u=0;u<this._deformCount;++u){var _=0;_=u<o?n[l+u]:u<o+s?h[u-o]:n[l+u-s],e.dirty>1?r[u]+=_*i:r[u]=_*i}else if(1===e.dirty)for(u=0;u<this._deformCount;++u)r[u]=0;(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.MutilpleValueTimelineState);t.SurfaceTimelineState=o;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.AlphaTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._result=1)},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight;e.dirty>1?(a._alpha+=this._result*i,a._alpha>1&&(a._alpha=1)):a._alpha=this._result*i,(t||this.dirty)&&(this.dirty=!1,this._armature._alphaDirty=!0)},e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"},e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target,e=null!==this._timelineData?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;t.displayIndex!==e&&t._setDisplayIndex(e,!0)}},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[0,0,0,0,0,0,0,0],e._difference=[0,0,0,0,0,0,0,0],e._result=[0,0,0,0,0,0,0,0],e}return c(e,t),e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.parent.parent,a=e.colorArray,i=e.frameIntArray,r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex,n=i[r];n<0&&(n+=65536),this._isTween?(this._current[0]=a[n++],this._current[1]=a[n++],this._current[2]=a[n++],this._current[3]=a[n++],this._current[4]=a[n++],this._current[5]=a[n++],this._current[6]=a[n++],this._current[7]=a[n++],(n=this._frameIndex===this._frameCount-1?i[this._animationData.frameIntOffset+this._frameValueOffset]:i[r+1])<0&&(n+=65536),this._difference[0]=a[n++]-this._current[0],this._difference[1]=a[n++]-this._current[1],this._difference[2]=a[n++]-this._current[2],this._difference[3]=a[n++]-this._current[3],this._difference[4]=a[n++]-this._current[4],this._difference[5]=a[n++]-this._current[5],this._difference[6]=a[n++]-this._current[6],this._difference[7]=a[n++]-this._current[7]):(this._result[0]=.01*a[n++],this._result[1]=.01*a[n++],this._result[2]=.01*a[n++],this._result[3]=.01*a[n++],this._result[4]=a[n++],this._result[5]=a[n++],this._result[6]=a[n++],this._result[7]=a[n++])}else{var s=this.target.slotData.color;this._result[0]=s.alphaMultiplier,this._result[1]=s.redMultiplier,this._result[2]=s.greenMultiplier,this._result[3]=s.blueMultiplier,this._result[4]=s.alphaOffset,this._result[5]=s.redOffset,this._result[6]=s.greenOffset,this._result[7]=s.blueOffset}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result[0]=.01*(this._current[0]+this._difference[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._difference[1]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._difference[2]*this._tweenProgress),this._result[3]=.01*(this._current[3]+this._difference[3]*this._tweenProgress),this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress,this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress,this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress,this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress)},e.prototype.fadeOut=function(){this._isTween=!1},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this._isTween||this.dirty){var a=this.target,i=a._colorTransform;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){if(i.alphaMultiplier!==this._result[0]||i.redMultiplier!==this._result[1]||i.greenMultiplier!==this._result[2]||i.blueMultiplier!==this._result[3]||i.alphaOffset!==this._result[4]||i.redOffset!==this._result[5]||i.greenOffset!==this._result[6]||i.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);i.alphaMultiplier+=(this._result[0]-i.alphaMultiplier)*r,i.redMultiplier+=(this._result[1]-i.redMultiplier)*r,i.greenMultiplier+=(this._result[2]-i.greenMultiplier)*r,i.blueMultiplier+=(this._result[3]-i.blueMultiplier)*r,i.alphaOffset+=(this._result[4]-i.alphaOffset)*r,i.redOffset+=(this._result[5]-i.redOffset)*r,i.greenOffset+=(this._result[6]-i.greenOffset)*r,i.blueOffset+=(this._result[7]-i.blueOffset)*r,a._colorDirty=!0}}else this.dirty&&(this.dirty=!1,i.alphaMultiplier===this._result[0]&&i.redMultiplier===this._result[1]&&i.greenMultiplier===this._result[2]&&i.blueMultiplier===this._result[3]&&i.alphaOffset===this._result[4]&&i.redOffset===this._result[5]&&i.greenOffset===this._result[6]&&i.blueOffset===this._result[7]||(i.alphaMultiplier=this._result[0],i.redMultiplier=this._result[1],i.greenMultiplier=this._result[2],i.blueMultiplier=this._result[3],i.alphaOffset=this._result[4],i.redOffset=this._result[5],i.greenOffset=this._result[6],i.blueOffset=this._result[7],a._colorDirty=!0))}},e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null===this._timelineData){var e=this.target.target;this._result=e.slotData.zIndex}},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight;e.dirty>1?a._zIndex+=this._result*i:a._zIndex=this._result*i,(t||this.dirty)&&(this.dirty=!1,this._armature._zIndexDirty=!0)},e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=_;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.DeformTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.geometryOffset=0,this.displayFrame=null,this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,a,i){if(t.prototype.init.call(this,e,a,i),null!==this._timelineData){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3],n=this._animationData.parent.parent,s=n.frameIntArray,o=this.target.target;this.geometryOffset=s[r+0],this.geometryOffset<0&&(this.geometryOffset+=65536);for(var l=0,h=o.displayFrameCount;l<h;++l){var u=o.getDisplayFrameAt(l),_=u.getGeometryData();if(null!==_&&_.offset===this.geometryOffset){this.displayFrame=u,this.displayFrame.updateDeformVertices();break}}if(null===this.displayFrame)return void this.returnToPool();this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=s[r+2],this._deformCount=s[r+1],this._deformOffset=s[r+3],this._sameValueOffset=s[r+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=n.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.displayFrame.deformVertices.length},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=this.displayFrame.deformVertices,n=this._valueArray;if(null!==n)for(var s=this._valueCount,o=this._deformOffset,l=this._sameValueOffset,h=this._rd,u=0;u<this._deformCount;++u){var _=0;_=u<o?n[l+u]:u<o+s?h[u-o]:n[l+u-s],e.dirty>1?r[u]+=_*i:r[u]=_*i}else if(1===e.dirty)for(u=0;u<this._deformCount;++u)r[u]=0;(t||this.dirty)&&(this.dirty=!1,a._geometryData===this.displayFrame.getGeometryData()&&(a._verticesDirty=!0))},e}(t.MutilpleValueTimelineState);t.DeformTimelineState=f;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.IKConstraintTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(null!==this._timelineData)e._bendPositive=this._currentA>0,e._weight=this._currentB;else{var a=e._constraintData;e._bendPositive=a.bendPositive,e._weight=a.weight}e.invalidUpdate(),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=m;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.currentTime=this._result*e.totalTime),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=p;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.weight=this._result),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=y;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.parameterX=this._resultA,e.parameterY=this._resultB),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=d}(f||(f={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.actionDataToInstance=function(t,a,i){0===t.type?a.type=e.FRAME_EVENT:a.type=10===t.type?e.FRAME_EVENT:e.SOUND_EVENT,a.name=t.name,a.armature=i,a.actionData=t,a.data=t.data,null!==t.bone&&(a.bone=i.getBone(t.bone.name)),null!==t.slot&&(a.slot=i.getSlot(t.slot.name))},e.toString=function(){return"[class dragonBones.EventObject]"},e.prototype._onClear=function(){this.time=0,this.type="",this.name="",this.armature=null,this.bone=null,this.slot=null,this.animationState=null,this.actionData=null,this.data=null},e.START="start",e.LOOP_COMPLETE="loopComplete",e.COMPLETE="complete",e.FADE_IN="fadeIn",e.FADE_IN_COMPLETE="fadeInComplete",e.FADE_OUT="fadeOut",e.FADE_OUT_COMPLETE="fadeOutComplete",e.FRAME_EVENT="frameEvent",e.SOUND_EVENT="soundEvent",e}(t.BaseObject);t.EventObject=e}(f||(f={})),function(t){var e=function(){function t(){}return t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":default:return 0;case"movieclip":return 1}},t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":default:return 0;case"surface":return 1}},t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":default:return 1;case"fixed":return 0}},t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":default:return 0;case"percent":return 2;case"fixed":return 1}},t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":default:return 0;case"chain":return 1;case"chainscale":return 2}},t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":default:return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4}},t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":default:return 0;case"ellipse":return 1;case"polygon":return 2}},t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":default:return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13}},t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":default:return 0;case"1d":return 1}},t._getActionType=function(t){switch(t.toLowerCase()){case"play":default:return 0;case"frame":return 10;case"sound":return 11}},t.DATA_VERSION_2_3="2.3",t.DATA_VERSION_3_0="3.0",t.DATA_VERSION_4_0="4.0",t.DATA_VERSION_4_5="4.5",t.DATA_VERSION_5_0="5.0",t.DATA_VERSION_5_5="5.5",t.DATA_VERSION_5_6="5.6",t.DATA_VERSION=t.DATA_VERSION_5_6,t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6],t.TEXTURE_ATLAS="textureAtlas",t.SUB_TEXTURE="SubTexture",t.FORMAT="format",t.IMAGE_PATH="imagePath",t.WIDTH="width",t.HEIGHT="height",t.ROTATED="rotated",t.FRAME_X="frameX",t.FRAME_Y="frameY",t.FRAME_WIDTH="frameWidth",t.FRAME_HEIGHT="frameHeight",t.DRADON_BONES="dragonBones",t.USER_DATA="userData",t.ARMATURE="armature",t.CANVAS="canvas",t.BONE="bone",t.SURFACE="surface",t.SLOT="slot",t.CONSTRAINT="constraint",t.SKIN="skin",t.DISPLAY="display",t.FRAME="frame",t.IK="ik",t.PATH_CONSTRAINT="path",t.ANIMATION="animation",t.TIMELINE="timeline",t.FFD="ffd",t.TRANSLATE_FRAME="translateFrame",t.ROTATE_FRAME="rotateFrame",t.SCALE_FRAME="scaleFrame",t.DISPLAY_FRAME="displayFrame",t.COLOR_FRAME="colorFrame",t.DEFAULT_ACTIONS="defaultActions",t.ACTIONS="actions",t.EVENTS="events",t.INTS="ints",t.FLOATS="floats",t.STRINGS="strings",t.TRANSFORM="transform",t.PIVOT="pivot",t.AABB="aabb",t.COLOR="color",t.VERSION="version",t.COMPATIBLE_VERSION="compatibleVersion",t.FRAME_RATE="frameRate",t.TYPE="type",t.SUB_TYPE="subType",t.NAME="name",t.PARENT="parent",t.TARGET="target",t.STAGE="stage",t.SHARE="share",t.PATH="path",t.LENGTH="length",t.DISPLAY_INDEX="displayIndex",t.Z_ORDER="zOrder",t.Z_INDEX="zIndex",t.BLEND_MODE="blendMode",t.INHERIT_TRANSLATION="inheritTranslation",t.INHERIT_ROTATION="inheritRotation",t.INHERIT_SCALE="inheritScale",t.INHERIT_REFLECTION="inheritReflection",t.INHERIT_ANIMATION="inheritAnimation",t.INHERIT_DEFORM="inheritDeform",t.SEGMENT_X="segmentX",t.SEGMENT_Y="segmentY",t.BEND_POSITIVE="bendPositive",t.CHAIN="chain",t.WEIGHT="weight",t.BLEND_TYPE="blendType",t.FADE_IN_TIME="fadeInTime",t.PLAY_TIMES="playTimes",t.SCALE="scale",t.OFFSET="offset",t.POSITION="position",t.DURATION="duration",t.TWEEN_EASING="tweenEasing",t.TWEEN_ROTATE="tweenRotate",t.TWEEN_SCALE="tweenScale",t.CLOCK_WISE="clockwise",t.CURVE="curve",t.SOUND="sound",t.EVENT="event",t.ACTION="action",t.X="x",t.Y="y",t.SKEW_X="skX",t.SKEW_Y="skY",t.SCALE_X="scX",t.SCALE_Y="scY",t.VALUE="value",t.ROTATE="rotate",t.SKEW="skew",t.ALPHA="alpha",t.ALPHA_OFFSET="aO",t.RED_OFFSET="rO",t.GREEN_OFFSET="gO",t.BLUE_OFFSET="bO",t.ALPHA_MULTIPLIER="aM",t.RED_MULTIPLIER="rM",t.GREEN_MULTIPLIER="gM",t.BLUE_MULTIPLIER="bM",t.UVS="uvs",t.VERTICES="vertices",t.TRIANGLES="triangles",t.WEIGHTS="weights",t.SLOT_POSE="slotPose",t.BONE_POSE="bonePose",t.BONES="bones",t.POSITION_MODE="positionMode",t.SPACING_MODE="spacingMode",t.ROTATE_MODE="rotateMode",t.SPACING="spacing",t.ROTATE_OFFSET="rotateOffset",t.ROTATE_MIX="rotateMix",t.TRANSLATE_MIX="translateMix",t.TARGET_DISPLAY="targetDisplay",t.CLOSED="closed",t.CONSTANT_SPEED="constantSpeed",t.VERTEX_COUNT="vertexCount",t.LENGTHS="lengths",t.GOTO_AND_PLAY="gotoAndPlay",t.DEFAULT_NAME="default",t}();t.DataParser=e}(f||(f={})),function(t){var e=function(e){function i(){var a=null!==e&&e.apply(this,arguments)||this;return a._rawTextureAtlasIndex=0,a._rawBones=[],a._data=null,a._armature=null,a._bone=null,a._geometry=null,a._slot=null,a._skin=null,a._mesh=null,a._animation=null,a._timeline=null,a._rawTextureAtlases=null,a._frameValueType=0,a._defaultColorOffset=-1,a._prevClockwise=0,a._prevRotation=0,a._frameDefaultValue=0,a._frameValueScale=1,a._helpMatrixA=new t.Matrix,a._helpMatrixB=new t.Matrix,a._helpTransform=new t.Transform,a._helpColorTransform=new t.ColorTransform,a._helpPoint=new t.Point,a._helpArray=[],a._intArray=[],a._floatArray=[],a._frameIntArray=[],a._frameFloatArray=[],a._frameArray=[],a._timelineArray=[],a._colorArray=[],a._cacheRawMeshes=[],a._cacheMeshes=[],a._actionFrames=[],a._weightSlotPose={},a._weightBonePoses={},a._cacheBones={},a._slotChildActions={},a}return c(i,e),i._getBoolean=function(t,e,a){if(e in t){var i=t[e],r=typeof i;if("boolean"===r)return i;if("string"!==r)return!!i;switch(i){case"0":case"NaN":case"":case"false":case"null":case"undefined":return!1;default:return!0}}return a},i._getNumber=function(t,e,a){if(e in t){var i=t[e];return null===i||"NaN"===i?a:+i||0}return a},i._getString=function(t,e,a){if(e in t){var i=t[e];return"string"===typeof i?i:String(i)}return a},i.prototype._getCurvePoint=function(t,e,a,i,r,n,s,o,l,h){var u=1-l,_=u*u,f=l*l,m=u*_,p=3*l*_,c=3*u*f,y=l*f;h.x=m*t+p*a+c*r+y*s,h.y=m*e+p*i+c*n+y*o},i.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3==1){for(var i=-2,r=0,n=e.length;r<n;++r){for(var s=(r+1)/(n+1);(i+6<a?t[i+6]:1)<s;)i+=6;for(var o=i>=0&&i+6<a,l=o?t[i]:0,h=o?t[i+1]:0,u=t[i+2],_=t[i+3],f=t[i+4],m=t[i+5],p=o?t[i+6]:1,c=o?t[i+7]:1,y=0,d=1;d-y>1e-4;){var g=.5*(d+y);this._getCurvePoint(l,h,u,_,f,m,p,c,g,this._helpPoint),s-this._helpPoint.x>0?y=g:d=g}e[r]=this._helpPoint.y}return!0}for(i=0,r=0,n=e.length;r<n;++r){for(s=(r+1)/(n+1);t[i+6]<s;)i+=6;for(l=t[i],h=t[i+1],u=t[i+2],_=t[i+3],f=t[i+4],m=t[i+5],p=t[i+6],c=t[i+7],y=0,d=1;d-y>1e-4;){g=.5*(d+y);this._getCurvePoint(l,h,u,_,f,m,p,c,g,this._helpPoint),s-this._helpPoint.x>0?y=g:d=g}e[r]=this._helpPoint.y}return!1},i.prototype._parseActionDataInFrame=function(e,a,i,r){t.DataParser.EVENT in e&&this._mergeActionFrame(e[t.DataParser.EVENT],a,10,i,r),t.DataParser.SOUND in e&&this._mergeActionFrame(e[t.DataParser.SOUND],a,11,i,r),t.DataParser.ACTION in e&&this._mergeActionFrame(e[t.DataParser.ACTION],a,0,i,r),t.DataParser.EVENTS in e&&this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,i,r),t.DataParser.ACTIONS in e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,i,r)},i.prototype._mergeActionFrame=function(t,e,i,r,n){for(var s=this._armature.actions.length,o=this._parseActionData(t,i,r,n),l=0,h=null,u=0,_=o;u<_.length;u++){var f=_[u];this._armature.addAction(f,!1)}0===this._actionFrames.length&&((h=new a).frameStart=0,this._actionFrames.push(h),h=null);for(var m=0,p=this._actionFrames;m<p.length;m++){var c=p[m];if(c.frameStart===e){h=c;break}if(c.frameStart>e)break;l++}null===h&&((h=new a).frameStart=e,this._actionFrames.splice(l,0,h));for(var y=0;y<o.length;++y)h.actions.push(s+y)},i.prototype._parseArmature=function(e,a){var r=t.BaseObject.borrowObject(t.ArmatureData);if(r.name=i._getString(e,t.DataParser.NAME,""),r.frameRate=i._getNumber(e,t.DataParser.FRAME_RATE,this._data.frameRate),r.scale=a,t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?r.type=t.DataParser._getArmatureType(e[t.DataParser.TYPE]):r.type=i._getNumber(e,t.DataParser.TYPE,0),0===r.frameRate&&(r.frameRate=24),this._armature=r,t.DataParser.CANVAS in e){var n=e[t.DataParser.CANVAS],s=t.BaseObject.borrowObject(t.CanvasData);t.DataParser.COLOR in n?s.hasBackground=!0:s.hasBackground=!1,s.color=i._getNumber(n,t.DataParser.COLOR,0),s.x=i._getNumber(n,t.DataParser.X,0)*r.scale,s.y=i._getNumber(n,t.DataParser.Y,0)*r.scale,s.width=i._getNumber(n,t.DataParser.WIDTH,0)*r.scale,s.height=i._getNumber(n,t.DataParser.HEIGHT,0)*r.scale,r.canvas=s}if(t.DataParser.AABB in e){var o=e[t.DataParser.AABB];r.aabb.x=i._getNumber(o,t.DataParser.X,0)*r.scale,r.aabb.y=i._getNumber(o,t.DataParser.Y,0)*r.scale,r.aabb.width=i._getNumber(o,t.DataParser.WIDTH,0)*r.scale,r.aabb.height=i._getNumber(o,t.DataParser.HEIGHT,0)*r.scale}if(t.DataParser.BONE in e)for(var l=0,h=e[t.DataParser.BONE];l<h.length;l++){var u=h[l],_=i._getString(u,t.DataParser.PARENT,""),f=this._parseBone(u);if(_.length>0){var m=r.getBone(_);null!==m?f.parent=m:(_ in this._cacheBones||(this._cacheBones[_]=[]),this._cacheBones[_].push(f))}if(f.name in this._cacheBones){for(var p=0,c=this._cacheBones[f.name];p<c.length;p++){c[p].parent=f}delete this._cacheBones[f.name]}r.addBone(f),this._rawBones.push(f)}if(t.DataParser.IK in e)for(var y=0,d=e[t.DataParser.IK];y<d.length;y++){var g=d[y];(E=this._parseIKConstraint(g))&&r.addConstraint(E)}if(r.sortBones(),t.DataParser.SLOT in e)for(var D=0,v=0,T=e[t.DataParser.SLOT];v<T.length;v++){var b=T[v];r.addSlot(this._parseSlot(b,D++))}if(t.DataParser.SKIN in e)for(var A=0,P=e[t.DataParser.SKIN];A<P.length;A++){var S=P[A];r.addSkin(this._parseSkin(S))}if(t.DataParser.PATH_CONSTRAINT in e)for(var O=0,x=e[t.DataParser.PATH_CONSTRAINT];O<x.length;O++){var E,M=x[O];(E=this._parsePathConstraint(M))&&r.addConstraint(E)}for(var B=0,I=this._cacheRawMeshes.length;B<I;++B){var F=this._cacheRawMeshes[B],C=i._getString(F,t.DataParser.SHARE,"");if(0!==C.length){var w=i._getString(F,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME);0===w.length&&(w=t.DataParser.DEFAULT_NAME);var N=r.getMesh(w,"",C);if(null!==N)this._cacheMeshes[B].geometry.shareFrom(N.geometry)}}if(t.DataParser.ANIMATION in e)for(var R=0,j=e[t.DataParser.ANIMATION];R<j.length;R++){var k=j[R],L=this._parseAnimation(k);r.addAnimation(L)}if(t.DataParser.DEFAULT_ACTIONS in e)for(var V=0,Y=this._parseActionData(e[t.DataParser.DEFAULT_ACTIONS],0,null,null);V<Y.length;V++){var U=Y[V];if(r.addAction(U,!0),0===U.type)null!==(L=r.getAnimation(U.name))&&(r.defaultAnimation=L)}if(t.DataParser.ACTIONS in e)for(var X=0,G=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);X<G.length;X++){U=G[X];r.addAction(U,!1)}for(var H in this._rawBones.length=0,this._cacheRawMeshes.length=0,this._cacheMeshes.length=0,this._armature=null,this._weightSlotPose)delete this._weightSlotPose[H];for(var H in this._weightBonePoses)delete this._weightBonePoses[H];for(var H in this._cacheBones)delete this._cacheBones[H];for(var H in this._slotChildActions)delete this._slotChildActions[H];return r},i.prototype._parseBone=function(e){if(0===(t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getBoneType(e[t.DataParser.TYPE]):i._getNumber(e,t.DataParser.TYPE,0))){var a=this._armature.scale,r=t.BaseObject.borrowObject(t.BoneData);return r.inheritTranslation=i._getBoolean(e,t.DataParser.INHERIT_TRANSLATION,!0),r.inheritRotation=i._getBoolean(e,t.DataParser.INHERIT_ROTATION,!0),r.inheritScale=i._getBoolean(e,t.DataParser.INHERIT_SCALE,!0),r.inheritReflection=i._getBoolean(e,t.DataParser.INHERIT_REFLECTION,!0),r.length=i._getNumber(e,t.DataParser.LENGTH,0)*a,r.alpha=i._getNumber(e,t.DataParser.ALPHA,1),r.name=i._getString(e,t.DataParser.NAME,""),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],r.transform,a),r}var n=t.BaseObject.borrowObject(t.SurfaceData);return n.alpha=i._getNumber(e,t.DataParser.ALPHA,1),n.name=i._getString(e,t.DataParser.NAME,""),n.segmentX=i._getNumber(e,t.DataParser.SEGMENT_X,0),n.segmentY=i._getNumber(e,t.DataParser.SEGMENT_Y,0),this._parseGeometry(e,n.geometry),n},i.prototype._parseIKConstraint=function(e){var a=this._armature.getBone(i._getString(e,t.DataParser.BONE,""));if(null===a)return null;var r=this._armature.getBone(i._getString(e,t.DataParser.TARGET,""));if(null===r)return null;var n=i._getNumber(e,t.DataParser.CHAIN,0),s=t.BaseObject.borrowObject(t.IKConstraintData);return s.scaleEnabled=i._getBoolean(e,t.DataParser.SCALE,!1),s.bendPositive=i._getBoolean(e,t.DataParser.BEND_POSITIVE,!0),s.weight=i._getNumber(e,t.DataParser.WEIGHT,1),s.name=i._getString(e,t.DataParser.NAME,""),s.type=0,s.target=r,n>0&&null!==a.parent?(s.root=a.parent,s.bone=a):(s.root=a,s.bone=null),s},i.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(i._getString(e,t.DataParser.TARGET,""));if(null===a)return null;var r=this._armature.defaultSkin;if(null===r)return null;var n=r.getDisplay(a.name,i._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(null===n||!(n instanceof t.PathDisplayData))return null;var s=e[t.DataParser.BONES];if(null===s||0===s.length)return null;var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=i._getString(e,t.DataParser.NAME,""),o.type=1,o.pathSlot=a,o.pathDisplayData=n,o.target=a.parent,o.positionMode=t.DataParser._getPositionMode(i._getString(e,t.DataParser.POSITION_MODE,"")),o.spacingMode=t.DataParser._getSpacingMode(i._getString(e,t.DataParser.SPACING_MODE,"")),o.rotateMode=t.DataParser._getRotateMode(i._getString(e,t.DataParser.ROTATE_MODE,"")),o.position=i._getNumber(e,t.DataParser.POSITION,0),o.spacing=i._getNumber(e,t.DataParser.SPACING,0),o.rotateOffset=i._getNumber(e,t.DataParser.ROTATE_OFFSET,0),o.rotateMix=i._getNumber(e,t.DataParser.ROTATE_MIX,1),o.translateMix=i._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l<h.length;l++){var u=h[l],_=this._armature.getBone(u);null!==_&&(o.AddBone(_),null===o.root&&(o.root=_))}return o},i.prototype._parseSlot=function(e,a){var r=t.BaseObject.borrowObject(t.SlotData);return r.displayIndex=i._getNumber(e,t.DataParser.DISPLAY_INDEX,0),r.zOrder=a,r.zIndex=i._getNumber(e,t.DataParser.Z_INDEX,0),r.alpha=i._getNumber(e,t.DataParser.ALPHA,1),r.name=i._getString(e,t.DataParser.NAME,""),r.parent=this._armature.getBone(i._getString(e,t.DataParser.PARENT,"")),t.DataParser.BLEND_MODE in e&&"string"==typeof e[t.DataParser.BLEND_MODE]?r.blendMode=t.DataParser._getBlendMode(e[t.DataParser.BLEND_MODE]):r.blendMode=i._getNumber(e,t.DataParser.BLEND_MODE,0),t.DataParser.COLOR in e?(r.color=t.SlotData.createColor(),this._parseColorTransform(e[t.DataParser.COLOR],r.color)):r.color=t.SlotData.DEFAULT_COLOR,t.DataParser.ACTIONS in e&&(this._slotChildActions[r.name]=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null)),r},i.prototype._parseSkin=function(e){var a=t.BaseObject.borrowObject(t.SkinData);if(a.name=i._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME),t.DataParser.SLOT in e){var r=e[t.DataParser.SLOT];this._skin=a;for(var n=0,s=r;n<s.length;n++){var o=s[n],l=i._getString(o,t.DataParser.NAME,""),h=this._armature.getSlot(l);if(null!==h){if(this._slot=h,t.DataParser.DISPLAY in o)for(var u=0,_=o[t.DataParser.DISPLAY];u<_.length;u++){var f=_[u];f?a.addDisplay(l,this._parseDisplay(f)):a.addDisplay(l,null)}this._slot=null}}this._skin=null}return a},i.prototype._parseDisplay=function(e){var a=i._getString(e,t.DataParser.NAME,""),r=i._getString(e,t.DataParser.PATH,""),n=0,s=null;switch(n=t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getDisplayType(e[t.DataParser.TYPE]):i._getNumber(e,t.DataParser.TYPE,n)){case 0:var o=s=t.BaseObject.borrowObject(t.ImageDisplayData);o.name=a,o.path=r.length>0?r:a,this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(l.name=a,l.path=r.length>0?r:a,l.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var h=0,u=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);h<u.length;h++){var _=u[h];l.addAction(_)}else if(this._slot.name in this._slotChildActions){var f=this._skin.getDisplays(this._slot.name);if(null===f?0===this._slot.displayIndex:this._slot.displayIndex===f.length){for(var m=0,p=this._slotChildActions[this._slot.name];m<p.length;m++){_=p[m];l.addAction(_)}delete this._slotChildActions[this._slot.name]}}break;case 2:var c=s=t.BaseObject.borrowObject(t.MeshDisplayData);c.geometry.inheritDeform=i._getBoolean(e,t.DataParser.INHERIT_DEFORM,!0),c.name=a,c.path=r.length>0?r:a,t.DataParser.SHARE in e?(c.geometry.data=this._data,this._cacheRawMeshes.push(e),this._cacheMeshes.push(c)):this._parseMesh(e,c);break;case 3:var y=this._parseBoundingBox(e);if(null!==y){var d=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);d.name=a,d.path=r.length>0?r:a,d.boundingBox=y}break;case 4:var g=e[t.DataParser.LENGTHS],D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=i._getBoolean(e,t.DataParser.CLOSED,!1),D.constantSpeed=i._getBoolean(e,t.DataParser.CONSTANT_SPEED,!1),D.name=a,D.path=r.length>0?r:a,D.curveLengths.length=g.length;for(var v=0,T=g.length;v<T;++v)D.curveLengths[v]=g[v];this._parsePath(e,D)}return null!==s&&t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],s.transform,this._armature.scale),s},i.prototype._parsePath=function(t,e){this._parseGeometry(t,e.geometry)},i.prototype._parsePivot=function(e,a){if(t.DataParser.PIVOT in e){var r=e[t.DataParser.PIVOT];a.pivot.x=i._getNumber(r,t.DataParser.X,0),a.pivot.y=i._getNumber(r,t.DataParser.Y,0)}else a.pivot.x=.5,a.pivot.y=.5},i.prototype._parseMesh=function(e,a){if(this._parseGeometry(e,a.geometry),t.DataParser.WEIGHTS in e){var i=e[t.DataParser.SLOT_POSE],r=e[t.DataParser.BONE_POSE],n=this._skin.name+"_"+this._slot.name+"_"+a.name;this._weightSlotPose[n]=i,this._weightBonePoses[n]=r}},i.prototype._parseBoundingBox=function(e){var a=null,r=0;switch(r=t.DataParser.SUB_TYPE in e&&"string"==typeof e[t.DataParser.SUB_TYPE]?t.DataParser._getBoundingBoxType(e[t.DataParser.SUB_TYPE]):i._getNumber(e,t.DataParser.SUB_TYPE,r)){case 0:a=t.BaseObject.borrowObject(t.RectangleBoundingBoxData);break;case 1:a=t.BaseObject.borrowObject(t.EllipseBoundingBoxData);break;case 2:a=this._parsePolygonBoundingBox(e)}return null!==a&&(a.color=i._getNumber(e,t.DataParser.COLOR,0),0!==a.type&&1!==a.type||(a.width=i._getNumber(e,t.DataParser.WIDTH,0),a.height=i._getNumber(e,t.DataParser.HEIGHT,0))),a},i.prototype._parsePolygonBoundingBox=function(e){var a=t.BaseObject.borrowObject(t.PolygonBoundingBoxData);if(t.DataParser.VERTICES in e){var i=this._armature.scale,r=e[t.DataParser.VERTICES],n=a.vertices;n.length=r.length;for(var s=0,o=r.length;s<o;s+=2){var l=r[s]*i,h=r[s+1]*i;n[s]=l,n[s+1]=h,0===s?(a.x=l,a.y=h,a.width=l,a.height=h):(l<a.x?a.x=l:l>a.width&&(a.width=l),h<a.y?a.y=h:h>a.height&&(a.height=h))}a.width-=a.x,a.height-=a.y}else console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.");return a},i.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);if(a.blendType=t.DataParser._getAnimationBlendType(i._getString(e,t.DataParser.BLEND_TYPE,"")),a.frameCount=i._getNumber(e,t.DataParser.DURATION,0),a.playTimes=i._getNumber(e,t.DataParser.PLAY_TIMES,1),a.duration=a.frameCount/this._armature.frameRate,a.fadeInTime=i._getNumber(e,t.DataParser.FADE_IN_TIME,0),a.scale=i._getNumber(e,t.DataParser.SCALE,1),a.name=i._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME),a.frameIntOffset=this._frameIntArray.length,a.frameFloatOffset=this._frameFloatArray.length,a.frameOffset=this._frameArray.length,this._animation=a,t.DataParser.FRAME in e){var r=e[t.DataParser.FRAME],n=r.length;if(n>0)for(var s=0,o=0;s<n;++s){var l=r[s];this._parseActionDataInFrame(l,o,null,null),o+=i._getNumber(l,t.DataParser.DURATION,1)}}if(t.DataParser.Z_ORDER in e&&(this._animation.zOrderTimeline=this._parseTimeline(e[t.DataParser.Z_ORDER],null,t.DataParser.FRAME,1,0,0,this._parseZOrderFrame)),t.DataParser.BONE in e)for(var h=0,u=e[t.DataParser.BONE];h<u.length;h++){var _=u[h];this._parseBoneTimeline(_)}if(t.DataParser.SLOT in e)for(var f=0,m=e[t.DataParser.SLOT];f<m.length;f++){_=m[f];this._parseSlotTimeline(_)}if(t.DataParser.FFD in e)for(var p=0,c=e[t.DataParser.FFD];p<c.length;p++){_=c[p];var y=i._getString(_,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME),d=i._getString(_,t.DataParser.SLOT,""),g=i._getString(_,t.DataParser.NAME,"");if(0===y.length&&(y=t.DataParser.DEFAULT_NAME),this._slot=this._armature.getSlot(d),this._mesh=this._armature.getMesh(y,d,g),null!==this._slot&&null!==this._mesh)null!==(O=this._parseTimeline(_,null,t.DataParser.FRAME,22,2,0,this._parseSlotDeformFrame))&&this._animation.addSlotTimeline(d,O),this._slot=null,this._mesh=null}if(t.DataParser.IK in e)for(var D=0,v=e[t.DataParser.IK];D<v.length;D++){_=v[D];var T=i._getString(_,t.DataParser.NAME,"");if(null!==this._armature.getConstraint(T))null!==(O=this._parseTimeline(_,null,t.DataParser.FRAME,30,1,2,this._parseIKConstraintFrame))&&this._animation.addConstraintTimeline(T,O)}if(this._actionFrames.length>0&&(this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame),this._actionFrames.length=0),t.DataParser.TIMELINE in e)for(var b=0,A=e[t.DataParser.TIMELINE];b<A.length;b++){_=A[b];var P=i._getNumber(_,t.DataParser.TYPE,0),S=i._getString(_,t.DataParser.NAME,""),O=null;switch(P){case 0:case 1:break;case 20:case 23:case 60:case 24:case 40:case 41:if(20===P?(this._frameValueType=0,this._frameValueScale=1):(this._frameValueType=1,this._frameValueScale=23===P?1:40===P||41===P?1e4:100),this._frameDefaultValue=60===P||24===P||41===P?1:0,40===P&&0!==a.blendType){var x=O=t.BaseObject.borrowObject(t.AnimationTimelineData);x.x=i._getNumber(_,t.DataParser.X,0),x.y=i._getNumber(_,t.DataParser.Y,0)}O=this._parseTimeline(_,null,t.DataParser.FRAME,P,this._frameValueType,1,this._parseSingleValueFrame,O);break;case 11:case 12:case 13:case 30:case 42:30===P||42===P?(this._frameValueType=1,this._frameValueScale=42===P?1e4:100):(this._frameValueScale=12===P?t.Transform.DEG_RAD:1,this._frameValueType=2),this._frameDefaultValue=13===P||30===P?1:0,O=this._parseTimeline(_,null,t.DataParser.FRAME,P,this._frameValueType,2,this._parseDoubleValueFrame);break;case 50:var E=this._armature.getBone(S);if(null===E)continue;this._geometry=E.geometry,O=this._parseTimeline(_,null,t.DataParser.FRAME,P,2,0,this._parseDeformFrame),this._geometry=null;break;case 22:for(var y in this._geometry=null,this._armature.skins){var M=this._armature.skins[y];for(var B in M.displays)for(var I=0,F=M.displays[B];I<F.length;I++){var C=F[I];if(null!==C&&C.name===S){this._geometry=C.geometry;break}}}if(null===this._geometry)continue;O=this._parseTimeline(_,null,t.DataParser.FRAME,P,2,0,this._parseDeformFrame),this._geometry=null;break;case 21:O=this._parseTimeline(_,null,t.DataParser.FRAME,P,1,1,this._parseSlotColorFrame)}if(null!==O)switch(P){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(S,O);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(S,O);break;case 30:this._animation.addConstraintTimeline(S,O);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(S,O)}}return this._animation=null,a},i.prototype._parseTimeline=function(e,r,n,s,o,l,h,u){if(void 0===u&&(u=null),null!==e&&n.length>0&&n in e&&(r=e[n]),null===r)return null;var _=r.length;if(0===_)return null;var f=this._frameIntArray.length,m=this._frameFloatArray.length,p=this._timelineArray.length;switch(null===u&&(u=t.BaseObject.borrowObject(t.TimelineData)),u.type=s,u.offset=p,this._frameValueType=o,this._timeline=u,this._timelineArray.length+=5+_,null!==e?(this._timelineArray[p+0]=Math.round(100*i._getNumber(e,t.DataParser.SCALE,1)),this._timelineArray[p+1]=Math.round(100*i._getNumber(e,t.DataParser.OFFSET,0))):(this._timelineArray[p+0]=100,this._timelineArray[p+1]=0),this._timelineArray[p+2]=_,this._timelineArray[p+3]=l,this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=f-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset}if(1===_)u.frameIndicesOffset=-1,this._timelineArray[p+5+0]=h.call(this,r[0],0,0)-this._animation.frameOffset;else{var c=this._animation.frameCount+1,y=this._data.frameIndices,d=y.length;y.length+=c,u.frameIndicesOffset=d;for(var g=0,D=0,v=0,T=0;g<c;++g){if(v+T<=g&&D<_){var b=r[D];v=g,T=D===_-1?this._animation.frameCount-v:b instanceof a?this._actionFrames[D+1].frameStart-v:i._getNumber(b,t.DataParser.DURATION,1),this._timelineArray[p+5+D]=h.call(this,b,v,T)-this._animation.frameOffset,D++}y[d+g]=D-1}}return this._timeline=null,u},i.prototype._parseBoneTimeline=function(e){var a=this._armature.getBone(i._getString(e,t.DataParser.NAME,""));if(null!==a){var r;if(this._bone=a,this._slot=this._armature.getSlot(this._bone.name),t.DataParser.TRANSLATE_FRAME in e)this._frameDefaultValue=0,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.TRANSLATE_FRAME,11,2,2,this._parseDoubleValueFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.ROTATE_FRAME in e)this._frameDefaultValue=0,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.ROTATE_FRAME,12,2,2,this._parseBoneRotateFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.SCALE_FRAME in e)this._frameDefaultValue=1,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.SCALE_FRAME,13,2,2,this._parseBoneScaleFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.FRAME in e)null!==(r=this._parseTimeline(e,null,t.DataParser.FRAME,10,2,6,this._parseBoneAllFrame))&&this._animation.addBoneTimeline(a.name,r);this._bone=null,this._slot=null}},i.prototype._parseSlotTimeline=function(e){var a=this._armature.getSlot(i._getString(e,t.DataParser.NAME,""));if(null!==a){var r=null,n=null;this._slot=a,r=t.DataParser.DISPLAY_FRAME in e?this._parseTimeline(e,null,t.DataParser.DISPLAY_FRAME,20,0,0,this._parseSlotDisplayFrame):this._parseTimeline(e,null,t.DataParser.FRAME,20,0,0,this._parseSlotDisplayFrame),n=t.DataParser.COLOR_FRAME in e?this._parseTimeline(e,null,t.DataParser.COLOR_FRAME,21,1,1,this._parseSlotColorFrame):this._parseTimeline(e,null,t.DataParser.FRAME,21,1,1,this._parseSlotColorFrame),null!==r&&this._animation.addSlotTimeline(a.name,r),null!==n&&this._animation.addSlotTimeline(a.name,n),this._slot=null}},i.prototype._parseFrame=function(t,e,a){var i=this._frameArray.length;return this._frameArray.length+=1,this._frameArray[i+0]=e,i},i.prototype._parseTweenFrame=function(e,a,r){var n=this._parseFrame(e,a,r);if(r>0)if(t.DataParser.CURVE in e){var s=r+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=2+this._helpArray.length,this._frameArray[n+1]=2,this._frameArray[n+2]=o?s:-s;for(var l=0;l<s;++l)this._frameArray[n+3+l]=Math.round(1e4*this._helpArray[l])}else{var h=-2;t.DataParser.TWEEN_EASING in e&&(h=i._getNumber(e,t.DataParser.TWEEN_EASING,-2)),-2===h?(this._frameArray.length+=1,this._frameArray[n+1]=0):0===h?(this._frameArray.length+=1,this._frameArray[n+1]=1):h<0?(this._frameArray.length+=2,this._frameArray[n+1]=3,this._frameArray[n+2]=Math.round(100*-h)):h<=1?(this._frameArray.length+=2,this._frameArray[n+1]=4,this._frameArray[n+2]=Math.round(100*h)):(this._frameArray.length+=2,this._frameArray[n+1]=5,this._frameArray[n+2]=Math.round(100*h-100))}else this._frameArray.length+=1,this._frameArray[n+1]=0;return n},i.prototype._parseSingleValueFrame=function(e,a,r){var n=0;switch(this._frameValueType){case 0:n=this._parseFrame(e,a,r),this._frameArray.length+=1,this._frameArray[n+1]=i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue);break;case 1:n=this._parseTweenFrame(e,a,r);var s=this._frameIntArray.length;this._frameIntArray.length+=1,this._frameIntArray[s]=Math.round(i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue)*this._frameValueScale);break;case 2:n=this._parseTweenFrame(e,a,r);s=this._frameFloatArray.length;this._frameFloatArray.length+=1,this._frameFloatArray[s]=i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue)*this._frameValueScale}return n},i.prototype._parseDoubleValueFrame=function(e,a,r){var n=0;switch(this._frameValueType){case 0:n=this._parseFrame(e,a,r),this._frameArray.length+=2,this._frameArray[n+1]=i._getNumber(e,t.DataParser.X,this._frameDefaultValue),this._frameArray[n+2]=i._getNumber(e,t.DataParser.Y,this._frameDefaultValue);break;case 1:n=this._parseTweenFrame(e,a,r);var s=this._frameIntArray.length;this._frameIntArray.length+=2,this._frameIntArray[s]=Math.round(i._getNumber(e,t.DataParser.X,this._frameDefaultValue)*this._frameValueScale),this._frameIntArray[s+1]=Math.round(i._getNumber(e,t.DataParser.Y,this._frameDefaultValue)*this._frameValueScale);break;case 2:n=this._parseTweenFrame(e,a,r);s=this._frameFloatArray.length;this._frameFloatArray.length+=2,this._frameFloatArray[s]=i._getNumber(e,t.DataParser.X,this._frameDefaultValue)*this._frameValueScale,this._frameFloatArray[s+1]=i._getNumber(e,t.DataParser.Y,this._frameDefaultValue)*this._frameValueScale}return n},i.prototype._parseActionFrame=function(t,e,a){var i=this._frameArray.length,r=t.actions.length;this._frameArray.length+=2+r,this._frameArray[i+0]=e,this._frameArray[i+0+1]=r;for(var n=0;n<r;++n)this._frameArray[i+0+2+n]=t.actions[n];return i},i.prototype._parseZOrderFrame=function(e,a,i){var r=this._parseFrame(e,a,i);if(t.DataParser.Z_ORDER in e){var n=e[t.DataParser.Z_ORDER];if(n.length>0){for(var s=this._armature.sortedSlots.length,o=new Array(s-n.length/2),l=new Array(s),h=0;h<o.length;++h)o[h]=0;for(var u=0;u<s;++u)l[u]=-1;for(var _=0,f=0,m=0,p=n.length;m<p;m+=2){for(var c=n[m],y=n[m+1];_!==c;)o[f++]=_++;l[_+y]=_++}for(;_<s;)o[f++]=_++;this._frameArray.length+=1+s,this._frameArray[r+1]=s;for(var d=s;d--;)-1===l[d]?this._frameArray[r+2+d]=o[--f]||0:this._frameArray[r+2+d]=l[d]||0;return r}}return this._frameArray.length+=1,this._frameArray[r+1]=0,r},i.prototype._parseBoneAllFrame=function(e,a,r){this._helpTransform.identity(),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],this._helpTransform,1);var n=this._helpTransform.rotation;0!==a&&(0===this._prevClockwise?n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation):((this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=i._getNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=n;var s=this._parseTweenFrame(e,a,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=6,this._frameFloatArray[o++]=this._helpTransform.x,this._frameFloatArray[o++]=this._helpTransform.y,this._frameFloatArray[o++]=n,this._frameFloatArray[o++]=this._helpTransform.skew,this._frameFloatArray[o++]=this._helpTransform.scaleX,this._frameFloatArray[o++]=this._helpTransform.scaleY,this._parseActionDataInFrame(e,a,this._bone,this._slot),s},i.prototype._parseBoneTranslateFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.X,0),this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.Y,0),n},i.prototype._parseBoneRotateFrame=function(e,a,r){var n=i._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!==a&&(0===this._prevClockwise?n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation):((this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=i._getNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=n;var s=this._parseTweenFrame(e,a,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[o++]=n,this._frameFloatArray[o++]=i._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,s},i.prototype._parseBoneScaleFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.X,1),this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.Y,1),n},i.prototype._parseSlotDisplayFrame=function(e,a,r){var n=this._parseFrame(e,a,r);return this._frameArray.length+=1,t.DataParser.VALUE in e?this._frameArray[n+1]=i._getNumber(e,t.DataParser.VALUE,0):this._frameArray[n+1]=i._getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,a,this._slot.parent,this._slot),n},i.prototype._parseSlotColorFrame=function(e,a,i){var r=this._parseTweenFrame(e,a,i),n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){this._parseColorTransform(s,this._helpColorTransform),n=this._colorArray.length,this._colorArray.length+=8,this._colorArray[n++]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.redMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.greenMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.blueMultiplier),this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset),n-=8;break}}n<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=n=this._colorArray.length,this._colorArray.length+=8,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=0,this._colorArray[n++]=0,this._colorArray[n++]=0,this._colorArray[n++]=0),n=this._defaultColorOffset);var l=this._frameIntArray.length;return this._frameIntArray.length+=1,this._frameIntArray[l]=n,r},i.prototype._parseSlotDeformFrame=function(e,a,r){var n=this._frameFloatArray.length,s=this._parseTweenFrame(e,a,r),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null,l=i._getNumber(e,t.DataParser.OFFSET,0),h=this._intArray[this._mesh.geometry.offset+0],u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name,_=this._mesh.geometry.weight,f=0,m=0,p=0,c=0;if(null!==_){var y=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(y,0),this._frameFloatArray.length+=2*_.count,p=_.offset+2+_.bones.length}else this._frameFloatArray.length+=2*h;for(var d=0;d<2*h;d+=2)if(null===o?(f=0,m=0):(f=d<l||d-l>=o.length?0:o[d-l],m=d+1<l||d+1-l>=o.length?0:o[d+1-l]),null!==_){var g=this._weightBonePoses[u],D=this._intArray[p++];this._helpMatrixA.transformPoint(f,m,this._helpPoint,!0),f=this._helpPoint.x,m=this._helpPoint.y;for(var v=0;v<D;++v){var T=this._intArray[p++];this._helpMatrixB.copyFromArray(g,7*T+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(f,m,this._helpPoint,!0),this._frameFloatArray[n+c++]=this._helpPoint.x,this._frameFloatArray[n+c++]=this._helpPoint.y}}else this._frameFloatArray[n+d]=f,this._frameFloatArray[n+d+1]=m;if(0===a){var b=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[b+0]=this._mesh.geometry.offset,this._frameIntArray[b+1]=this._frameFloatArray.length-n,this._frameIntArray[b+2]=this._frameFloatArray.length-n,this._frameIntArray[b+3]=0,this._frameIntArray[b+4]=n-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=b-this._animation.frameIntOffset}return s},i.prototype._parseIKConstraintFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameIntArray.length;return this._frameIntArray.length+=2,this._frameIntArray[s++]=i._getBoolean(e,t.DataParser.BEND_POSITIVE,!0)?1:0,this._frameIntArray[s++]=Math.round(100*i._getNumber(e,t.DataParser.WEIGHT,1)),n},i.prototype._parseActionData=function(e,a,r,n){var s=new Array;if("string"==typeof e)(u=t.BaseObject.borrowObject(t.ActionData)).type=a,u.name=e,u.bone=r,u.slot=n,s.push(u);else if(e instanceof Array)for(var o=0,l=e;o<l.length;o++){var h=l[o],u=t.BaseObject.borrowObject(t.ActionData);if(t.DataParser.GOTO_AND_PLAY in h?(u.type=0,u.name=i._getString(h,t.DataParser.GOTO_AND_PLAY,"")):(t.DataParser.TYPE in h&&"string"==typeof h[t.DataParser.TYPE]?u.type=t.DataParser._getActionType(h[t.DataParser.TYPE]):u.type=i._getNumber(h,t.DataParser.TYPE,a),u.name=i._getString(h,t.DataParser.NAME,"")),t.DataParser.BONE in h){var _=i._getString(h,t.DataParser.BONE,"");u.bone=this._armature.getBone(_)}else u.bone=r;if(t.DataParser.SLOT in h){var f=i._getString(h,t.DataParser.SLOT,"");u.slot=this._armature.getSlot(f)}else u.slot=n;var m=null;if(t.DataParser.INTS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var p=0,c=h[t.DataParser.INTS];p<c.length;p++){var y=c[p];m.addInt(y)}}if(t.DataParser.FLOATS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var d=0,g=h[t.DataParser.FLOATS];d<g.length;d++){y=g[d];m.addFloat(y)}}if(t.DataParser.STRINGS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var D=0,v=h[t.DataParser.STRINGS];D<v.length;D++){y=v[D];m.addString(y)}}u.data=m,s.push(u)}return s},i.prototype._parseDeformFrame=function(e,a,r){var n=this._frameFloatArray.length,s=this._parseTweenFrame(e,a,r),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:t.DataParser.VALUE in e?e[t.DataParser.VALUE]:null,l=i._getNumber(e,t.DataParser.OFFSET,0),h=this._intArray[this._geometry.offset+0],u=0,_=0;if(null!==this._geometry.weight);else{this._frameFloatArray.length+=2*h;for(var f=0;f<2*h;f+=2)null!==o?(u=f<l||f-l>=o.length?0:o[f-l],_=f+1<l||f+1-l>=o.length?0:o[f+1-l]):(u=0,_=0),this._frameFloatArray[n+f]=u,this._frameFloatArray[n+f+1]=_}if(0===a){var m=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[m+0]=this._geometry.offset,this._frameIntArray[m+1]=this._frameFloatArray.length-n,this._frameIntArray[m+2]=this._frameFloatArray.length-n,this._frameIntArray[m+3]=0,this._frameIntArray[m+4]=n-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=m-this._animation.frameIntOffset}return s},i.prototype._parseTransform=function(e,a,r){a.x=i._getNumber(e,t.DataParser.X,0)*r,a.y=i._getNumber(e,t.DataParser.Y,0)*r,t.DataParser.ROTATE in e||t.DataParser.SKEW in e?(a.rotation=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD),a.skew=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e)&&(a.rotation=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD),a.skew=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation),a.scaleX=i._getNumber(e,t.DataParser.SCALE_X,1),a.scaleY=i._getNumber(e,t.DataParser.SCALE_Y,1)},i.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=.01*i._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),a.redMultiplier=.01*i._getNumber(e,t.DataParser.RED_MULTIPLIER,100),a.greenMultiplier=.01*i._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),a.blueMultiplier=.01*i._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100),a.alphaOffset=i._getNumber(e,t.DataParser.ALPHA_OFFSET,0),a.redOffset=i._getNumber(e,t.DataParser.RED_OFFSET,0),a.greenOffset=i._getNumber(e,t.DataParser.GREEN_OFFSET,0),a.blueOffset=i._getNumber(e,t.DataParser.BLUE_OFFSET,0)},i.prototype._parseGeometry=function(e,a){var i=e[t.DataParser.VERTICES],r=Math.floor(i.length/2),n=0,s=this._intArray.length,o=this._floatArray.length;a.offset=s,a.data=this._data,this._intArray.length+=4,this._intArray[s+0]=r,this._intArray[s+2]=o,this._intArray[s+3]=-1,this._floatArray.length+=2*r;for(var l=0,h=2*r;l<h;++l)this._floatArray[o+l]=i[l];if(t.DataParser.TRIANGLES in e){var u=e[t.DataParser.TRIANGLES];n=Math.floor(u.length/3),this._intArray.length+=3*n;for(l=0,h=3*n;l<h;++l)this._intArray[s+4+l]=u[l]}if(this._intArray[s+1]=n,t.DataParser.UVS in e){var _=e[t.DataParser.UVS],f=o+2*r;this._floatArray.length+=2*r;for(l=0,h=2*r;l<h;++l)this._floatArray[f+l]=_[l]}if(t.DataParser.WEIGHTS in e){var m=e[t.DataParser.WEIGHTS],p=Math.floor(m.length-r)/2,c=this._intArray.length,y=this._floatArray.length,d=0,g=this._armature.sortedBones,D=t.BaseObject.borrowObject(t.WeightData);if(D.count=p,D.offset=c,this._intArray.length+=2+d+r+p,this._intArray[c+1]=y,t.DataParser.BONE_POSE in e){var v=e[t.DataParser.SLOT_POSE],T=e[t.DataParser.BONE_POSE],b=new Array;d=Math.floor(T.length/7),b.length=d;for(l=0;l<d;++l){var A=T[7*l],P=this._rawBones[A];D.addBone(P),b[l]=A,this._intArray[c+2+l]=g.indexOf(P)}this._floatArray.length+=3*p,this._helpMatrixA.copyFromArray(v,0);l=0;for(var S=0,O=c+2+d,x=y;l<r;++l){var E=2*l,M=this._intArray[O++]=m[S++],B=this._floatArray[o+E],I=this._floatArray[o+E+1];this._helpMatrixA.transformPoint(B,I,this._helpPoint),B=this._helpPoint.x,I=this._helpPoint.y;for(var F=0;F<M;++F){A=m[S++];var C=b.indexOf(A);this._helpMatrixB.copyFromArray(T,7*C+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(B,I,this._helpPoint),this._intArray[O++]=C,this._floatArray[x++]=m[S++],this._floatArray[x++]=this._helpPoint.x,this._floatArray[x++]=this._helpPoint.y}}}else{var w=e[t.DataParser.BONES];d=w.length;for(l=0;l<d;l++){A=w[l],P=this._rawBones[A];D.addBone(P),this._intArray[c+2+l]=g.indexOf(P)}this._floatArray.length+=3*p;l=0,S=0,x=0,O=c+2+d;for(var N=y;l<p;l++){M=m[S++];this._intArray[O++]=M;for(F=0;F<M;F++){C=m[S++];var R=m[S++];B=i[x++],I=i[x++];this._intArray[O++]=w.indexOf(C),this._floatArray[N++]=R,this._floatArray[N++]=B,this._floatArray[N++]=I}}}a.weight=D}},i.prototype._parseArray=function(t){this._intArray.length=0,this._floatArray.length=0,this._frameIntArray.length=0,this._frameFloatArray.length=0,this._frameArray.length=0,this._timelineArray.length=0,this._colorArray.length=0},i.prototype._modifyArray=function(){this._intArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._intArray.push(0),this._frameIntArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameIntArray.push(0),this._frameArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameArray.push(0),this._timelineArray.length%Uint16Array.BYTES_PER_ELEMENT!=0&&this._timelineArray.push(0),this._timelineArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._colorArray.push(0);for(var t=this._intArray.length*Int16Array.BYTES_PER_ELEMENT,e=this._floatArray.length*Float32Array.BYTES_PER_ELEMENT,a=this._frameIntArray.length*Int16Array.BYTES_PER_ELEMENT,i=this._frameFloatArray.length*Float32Array.BYTES_PER_ELEMENT,r=this._frameArray.length*Int16Array.BYTES_PER_ELEMENT,n=this._timelineArray.length*Uint16Array.BYTES_PER_ELEMENT,s=this._colorArray.length*Int16Array.BYTES_PER_ELEMENT,o=new ArrayBuffer(t+e+a+i+r+n+s),l=new Int16Array(o,0,this._intArray.length),h=new Float32Array(o,t,this._floatArray.length),u=new Int16Array(o,t+e,this._frameIntArray.length),_=new Float32Array(o,t+e+a,this._frameFloatArray.length),f=new Int16Array(o,t+e+a+i,this._frameArray.length),m=new Uint16Array(o,t+e+a+i+r,this._timelineArray.length),p=new Int16Array(o,t+e+a+i+r+n,this._colorArray.length),c=0,y=this._intArray.length;c<y;++c)l[c]=this._intArray[c];for(c=0,y=this._floatArray.length;c<y;++c)h[c]=this._floatArray[c];for(c=0,y=this._frameIntArray.length;c<y;++c)u[c]=this._frameIntArray[c];for(c=0,y=this._frameFloatArray.length;c<y;++c)_[c]=this._frameFloatArray[c];for(c=0,y=this._frameArray.length;c<y;++c)f[c]=this._frameArray[c];for(c=0,y=this._timelineArray.length;c<y;++c)m[c]=this._timelineArray[c];for(c=0,y=this._colorArray.length;c<y;++c)p[c]=this._colorArray[c];this._data.binary=o,this._data.intArray=l,this._data.floatArray=h,this._data.frameIntArray=u,this._data.frameFloatArray=_,this._data.frameArray=f,this._data.timelineArray=m,this._data.colorArray=p,this._defaultColorOffset=-1},i.prototype.parseDragonBonesData=function(e,a){void 0===a&&(a=1),console.assert(null!=e,"Data error.");var r=i._getString(e,t.DataParser.VERSION,""),n=i._getString(e,t.DataParser.COMPATIBLE_VERSION,"");if(t.DataParser.DATA_VERSIONS.indexOf(r)>=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);if(s.version=r,s.name=i._getString(e,t.DataParser.NAME,""),s.frameRate=i._getNumber(e,t.DataParser.FRAME_RATE,24),0===s.frameRate&&(s.frameRate=24),t.DataParser.ARMATURE in e){this._data=s,this._parseArray(e);for(var o=0,l=e[t.DataParser.ARMATURE];o<l.length;o++){var h=l[o];s.addArmature(this._parseArmature(h,a))}this._data.binary||this._modifyArray(),t.DataParser.STAGE in e?s.stage=s.getArmature(i._getString(e,t.DataParser.STAGE,"")):s.armatureNames.length>0&&(s.stage=s.getArmature(s.armatureNames[0])),this._data=null}return t.DataParser.TEXTURE_ATLAS in e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),s}return console.assert(!1,"Nonsupport data version: "+r+"\nPlease convert DragonBones data to support version.\nRead more: https://github.com/DragonBones/Tools/"),null},i.prototype.parseTextureAtlasData=function(e,a,r){if(void 0===r&&(r=1),console.assert(void 0!==e),null===e){if(null===this._rawTextureAtlases||0===this._rawTextureAtlases.length)return!1;var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return this.parseTextureAtlasData(n,a,r),this._rawTextureAtlasIndex>=this._rawTextureAtlases.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!0}if(a.width=i._getNumber(e,t.DataParser.WIDTH,0),a.height=i._getNumber(e,t.DataParser.HEIGHT,0),a.scale=1===r?1/i._getNumber(e,t.DataParser.SCALE,1):r,a.name=i._getString(e,t.DataParser.NAME,""),a.imagePath=i._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE in e)for(var s=e[t.DataParser.SUB_TEXTURE],o=0,l=s.length;o<l;++o){var h=s[o],u=i._getNumber(h,t.DataParser.FRAME_WIDTH,-1),_=i._getNumber(h,t.DataParser.FRAME_HEIGHT,-1),f=a.createTexture();f.rotated=i._getBoolean(h,t.DataParser.ROTATED,!1),f.name=i._getString(h,t.DataParser.NAME,""),f.region.x=i._getNumber(h,t.DataParser.X,0),f.region.y=i._getNumber(h,t.DataParser.Y,0),f.region.width=i._getNumber(h,t.DataParser.WIDTH,0),f.region.height=i._getNumber(h,t.DataParser.HEIGHT,0),u>0&&_>0&&(f.frame=t.TextureData.createRectangle(),f.frame.x=i._getNumber(h,t.DataParser.FRAME_X,0),f.frame.y=i._getNumber(h,t.DataParser.FRAME_Y,0),f.frame.width=u,f.frame.height=_),a.addTexture(f)}return!0},i.getInstance=function(){return null===i._objectDataParserInstance&&(i._objectDataParserInstance=new i),i._objectDataParserInstance},i._objectDataParserInstance=null,i}(t.DataParser);t.ObjectDataParser=e;var a=function(){this.frameStart=0,this.actions=[]};t.ActionFrame=a}(f||(f={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.prototype._inRange=function(t,e,a){return e<=t&&t<=a},a.prototype._decodeUTF8=function(t){for(var e,a=0,i="",r=0,n=0,s=0,o=0;t.length>a;){var l=t[a++];if(-1===l)e=0!==n?65533:-1;else if(0===n)this._inRange(l,0,127)?e=l:(this._inRange(l,194,223)?(n=1,o=128,r=l-192):this._inRange(l,224,239)?(n=2,o=2048,r=l-224):this._inRange(l,240,244)&&(n=3,o=65536,r=l-240),r*=Math.pow(64,n),e=null);else if(this._inRange(l,128,191))if(s+=1,r+=(l-128)*Math.pow(64,n-s),s!==n)e=null;else{var h=r,u=o;r=0,n=0,s=0,o=0,e=this._inRange(h,u,1114111)&&!this._inRange(h,55296,57343)?h:l}else r=0,n=0,s=0,o=0,a--,e=l;null!==e&&-1!==e&&(e<=65535?e>0&&(i+=String.fromCharCode(e)):(e-=65536,i+=String.fromCharCode(55296+(e>>10&1023)),i+=String.fromCharCode(56320+(1023&e))))}return i},a.prototype._parseBinaryTimeline=function(e,a,i){void 0===i&&(i=null);var r=null!==i?i:t.BaseObject.borrowObject(t.TimelineData);r.type=e,r.offset=a,this._timeline=r;var n=this._timelineArrayBuffer[r.offset+2];if(1===n)r.frameIndicesOffset=-1;else{var s,o=this._animation.frameCount+1,l=this._data.frameIndices;s=l.length,l.length+=o,r.frameIndicesOffset=s;for(var h=0,u=0,_=0,f=0;h<o;++h)_+f<=h&&u<n&&(_=this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+u]],f=u===n-1?this._animation.frameCount-_:this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+u+1]]-_,u++),l[s+h]=u-1}return this._timeline=null,r},a.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(t.ObjectDataParser._getString(e,t.DataParser.BLEND_TYPE,"")),a.frameCount=t.ObjectDataParser._getNumber(e,t.DataParser.DURATION,0),a.playTimes=t.ObjectDataParser._getNumber(e,t.DataParser.PLAY_TIMES,1),a.duration=a.frameCount/this._armature.frameRate,a.fadeInTime=t.ObjectDataParser._getNumber(e,t.DataParser.FADE_IN_TIME,0),a.scale=t.ObjectDataParser._getNumber(e,t.DataParser.SCALE,1),a.name=t.ObjectDataParser._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME);var i=e[t.DataParser.OFFSET];if(a.frameIntOffset=i[0],a.frameFloatOffset=i[1],a.frameOffset=i[2],this._animation=a,t.DataParser.ACTION in e&&(a.actionTimeline=this._parseBinaryTimeline(0,e[t.DataParser.ACTION])),t.DataParser.Z_ORDER in e&&(a.zOrderTimeline=this._parseBinaryTimeline(1,e[t.DataParser.Z_ORDER])),t.DataParser.BONE in e){var r=e[t.DataParser.BONE];for(var n in r){var s=r[n],o=this._armature.getBone(n);if(null!==o)for(var l=0,h=s.length;l<h;l+=2){var u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addBoneTimeline(o.name,f)}}}if(t.DataParser.SLOT in e){r=e[t.DataParser.SLOT];for(var n in r){s=r[n];var m=this._armature.getSlot(n);if(null!==m)for(l=0,h=s.length;l<h;l+=2){u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addSlotTimeline(m.name,f)}}}if(t.DataParser.CONSTRAINT in e){r=e[t.DataParser.CONSTRAINT];for(var n in r){s=r[n];var p=this._armature.getConstraint(n);if(null!==p)for(l=0,h=s.length;l<h;l+=2){u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addConstraintTimeline(p.name,f)}}}if(t.DataParser.TIMELINE in e)for(var c=0,y=s=e[t.DataParser.TIMELINE];c<y.length;c++){var d=y[c];if((_=t.ObjectDataParser._getNumber(d,t.DataParser.OFFSET,0))>=0){u=t.ObjectDataParser._getNumber(d,t.DataParser.TYPE,0);var g=t.ObjectDataParser._getString(d,t.DataParser.NAME,"");f=null;if(40===u&&0!==a.blendType){var D=f=t.BaseObject.borrowObject(t.AnimationTimelineData);D.x=t.ObjectDataParser._getNumber(d,t.DataParser.X,0),D.y=t.ObjectDataParser._getNumber(d,t.DataParser.Y,0)}switch(f=this._parseBinaryTimeline(u,_,f),u){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(g,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(g,f);break;case 30:this._animation.addConstraintTimeline(g,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(g,f)}}}return this._animation=null,a},a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET],a.data=this._data;var i=this._intArrayBuffer[a.offset+3];if(i>=0){var r=t.BaseObject.borrowObject(t.WeightData),n=this._intArrayBuffer[a.offset+0],s=this._intArrayBuffer[i+0];r.offset=i;for(var o=0;o<s;++o){var l=this._intArrayBuffer[i+2+o];r.addBone(this._rawBones[l])}for(var h=i+2+s,u=0,_=(o=0,n);o<_;++o){var f=this._intArrayBuffer[h++];u+=f,h+=f}r.count=u,a.weight=r}},a.prototype._parseArray=function(e){var a=e[t.DataParser.OFFSET],i=a[1],r=a[3],n=a[5],s=a[7],o=a[9],l=a[11],h=a.length>12?a[13]:0,u=new Int16Array(this._binary,this._binaryOffset+a[0],i/Int16Array.BYTES_PER_ELEMENT),_=new Float32Array(this._binary,this._binaryOffset+a[2],r/Float32Array.BYTES_PER_ELEMENT),f=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT),m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT),p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT),c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT),y=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=u,this._data.floatArray=_,this._data.frameIntArray=f,this._data.frameFloatArray=m,this._data.frameArray=this._frameArrayBuffer=p,this._data.timelineArray=this._timelineArrayBuffer=c,this._data.colorArray=y},a.prototype.parseDragonBonesData=function(t,a){void 0===a&&(a=1),console.assert(null!=t&&t instanceof ArrayBuffer,"Data error.");var i=new Uint8Array(t,0,8);if(i[0]!=="D".charCodeAt(0)||i[1]!=="B".charCodeAt(0)||i[2]!=="D".charCodeAt(0)||i[3]!=="T".charCodeAt(0))return console.assert(!1,"Nonsupport data."),null;var r=new Uint32Array(t,8,1)[0],n=new Uint8Array(t,12,r),s=this._decodeUTF8(n),o=JSON.parse(s);return this._binaryOffset=12+r,this._binary=t,e.prototype.parseDragonBonesData.call(this,o,a)},a.getInstance=function(){return null===a._binaryDataParserInstance&&(a._binaryDataParserInstance=new a),a._binaryDataParserInstance},a._binaryDataParserInstance=null,a}(t.ObjectDataParser);t.BinaryDataParser=e}(f||(f={})),function(t){var e=function(){function e(a){void 0===a&&(a=null),this.autoSearch=!1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,this._dataParser=null,null===e._objectParser&&(e._objectParser=new t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new t.BinaryDataParser),this._dataParser=null!==a?a:e._objectParser}return e.prototype._isSupportMesh=function(){return!0},e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap)for(var a=0,i=this._textureAtlasDataMap[t];a<i.length;a++){if(null!==(l=(o=i[a]).getTexture(e)))return l}if(this.autoSearch)for(var r in this._textureAtlasDataMap)for(var n=0,s=this._textureAtlasDataMap[r];n<s.length;n++){var o,l;if((o=s[n]).autoSearch)if(null!==(l=o.getTexture(e)))return l}return null},e.prototype._fillBuildArmaturePackage=function(t,e,a,i,r){var n=null,s=null;if(e.length>0&&e in this._dragonBonesDataMap&&(s=(n=this._dragonBonesDataMap[e]).getArmature(a)),null===s&&(0===e.length||this.autoSearch))for(var o in this._dragonBonesDataMap)if(n=this._dragonBonesDataMap[o],(0===e.length||n.autoSearch)&&null!==(s=n.getArmature(a))){e=o;break}if(null!==s){if(t.dataName=e,t.textureAtlasName=r,t.data=n,t.armature=s,t.skin=null,i.length>0&&(t.skin=s.getSkin(i),null===t.skin&&this.autoSearch))for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o].getArmature(i);if(null!==l){t.skin=l.defaultSkin;break}}return null===t.skin&&(t.skin=s.defaultSkin),!0}return!1},e.prototype._buildBones=function(e,a){for(var i=0,r=e.armature.sortedBones;i<r.length;i++){var n=r[i];t.BaseObject.borrowObject(0===n.type?t.Bone:t.Surface).init(n,a)}},e.prototype._buildSlots=function(t,e){var a=t.skin,i=t.armature.defaultSkin;if(null!==a&&null!==i){var r={};for(var n in i.displays){var s=i.getDisplays(n);r[n]=s}if(a!==i)for(var n in a.displays){s=a.getDisplays(n);r[n]=s}for(var o=0,l=t.armature.sortedSlots;o<l.length;o++){var h=l[o],u=h.name in r?r[h.name]:null,_=this._buildSlot(t,h,e);if(null!==u){_.displayFrameCount=u.length;for(var f=0,m=_.displayFrameCount;f<m;++f){var p=u[f];if(_.replaceRawDisplayData(p,f),null!==p){if(t.textureAtlasName.length>0){var c=this._getTextureData(t.textureAtlasName,p.path);_.replaceTextureData(c,f)}var y=this._getSlotDisplay(t,p,_);_.replaceDisplay(y,f)}else _.replaceDisplay(null)}}_._setDisplayIndex(h.displayIndex,!0)}}},e.prototype._buildConstraints=function(e,a){var i=e.armature.constraints;for(var r in i){var n=i[r];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a),a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a),a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a),a._addConstraint(l)}}},e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,null!==t?t.dataName:"","",null!==t?t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(e,a,i){var r=null!==e?e.dataName:a.parent.parent.parent.name,n=null;switch(a.type){case 0:var s=a;null===s.texture&&(s.texture=this._getTextureData(r,a.path)),n=i.rawDisplay;break;case 2:var o=a;null===o.texture&&(o.texture=this._getTextureData(r,o.path)),n=this._isSupportMesh()?i.meshDisplay:i.rawDisplay;break;case 1:var l=a,h=this._buildChildArmature(e,i,l);if(null!==h){if(h.inheritAnimation=l.inheritAnimation,!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0)for(var _=0,f=u;_<f.length;_++){var m=f[_],p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,i.armature),p.slot=i,i.armature._bufferAction(p,!1)}else h.animation.play()}l.armature=h.armatureData}n=h}return n},e.prototype.parseDragonBonesData=function(t,a,i){void 0===a&&(a=null),void 0===i&&(i=1);for(var r=t instanceof ArrayBuffer?e._binaryParser:this._dataParser,n=r.parseDragonBonesData(t,i);;){var s=this._buildTextureAtlasData(null,null);if(!r.parseTextureAtlasData(null,s,i)){s.returnToPool();break}this.addTextureAtlasData(s,a)}return null!==n&&this.addDragonBonesData(n,a),n},e.prototype.parseTextureAtlasData=function(t,e,a,i){void 0===a&&(a=null),void 0===i&&(i=1);var r=this._buildTextureAtlasData(null,null);return this._dataParser.parseTextureAtlasData(t,r,i),this._buildTextureAtlasData(r,e||null),this.addTextureAtlasData(r,a),r},e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(null!==a)for(var i=0,r=a.length;i<r;++i)i<t.length&&this._buildTextureAtlasData(a[i],t[i])},e.prototype.getDragonBonesData=function(t){return t in this._dragonBonesDataMap?this._dragonBonesDataMap[t]:null},e.prototype.addDragonBonesData=function(t,e){if(void 0===e&&(e=null),(e=null!==e?e:t.name)in this._dragonBonesDataMap){if(this._dragonBonesDataMap[e]===t)return;console.warn("Can not add same name data: "+e)}else this._dragonBonesDataMap[e]=t},e.prototype.removeDragonBonesData=function(t,e){void 0===e&&(e=!0),t in this._dragonBonesDataMap&&(e&&this._dragonBones.bufferObject(this._dragonBonesDataMap[t]),delete this._dragonBonesDataMap[t])},e.prototype.getTextureAtlasData=function(t){return t in this._textureAtlasDataMap?this._textureAtlasDataMap[t]:null},e.prototype.addTextureAtlasData=function(t,e){void 0===e&&(e=null);var a=(e=null!==e?e:t.name)in this._textureAtlasDataMap?this._textureAtlasDataMap[e]:this._textureAtlasDataMap[e]=[];a.indexOf(t)<0&&a.push(t)},e.prototype.removeTextureAtlasData=function(t,e){if(void 0===e&&(e=!0),t in this._textureAtlasDataMap){var a=this._textureAtlasDataMap[t];if(e)for(var i=0,r=a;i<r.length;i++){var n=r[i];this._dragonBones.bufferObject(n)}delete this._textureAtlasDataMap[t]}},e.prototype.getArmatureData=function(t,e){void 0===e&&(e="");var i=new a;return this._fillBuildArmaturePackage(i,e,t,"","")?i.armature:null},e.prototype.clear=function(t){for(var e in void 0===t&&(t=!0),this._dragonBonesDataMap)t&&this._dragonBones.bufferObject(this._dragonBonesDataMap[e]),delete this._dragonBonesDataMap[e];for(var e in this._textureAtlasDataMap){if(t)for(var a=0,i=this._textureAtlasDataMap[e];a<i.length;a++){var r=i[a];this._dragonBones.bufferObject(r)}delete this._textureAtlasDataMap[e]}},e.prototype.buildArmature=function(t,e,i,r){void 0===e&&(e=""),void 0===i&&(i=""),void 0===r&&(r="");var n=new a;if(!this._fillBuildArmaturePackage(n,e||"",t,i||"",r||""))return console.warn("No armature data: "+t+", "+(null!==e?e:"")),null;var s=this._buildArmature(n);return this._buildBones(n,s),this._buildSlots(n,s),this._buildConstraints(n,s),s.invalidUpdate(null,!0),s.advanceTime(0),s},e.prototype.replaceDisplay=function(t,e,a){if(void 0===a&&(a=-1),a<0&&(a=t.displayIndex),a<0&&(a=0),t.replaceDisplayData(e,a),null!==e){var i=this._getSlotDisplay(null,e,t);if(0===e.type){var r=t.getDisplayFrameAt(a).rawDisplayData;null!==r&&2===r.type&&(i=t.meshDisplay)}t.replaceDisplay(i,a)}else t.replaceDisplay(null,a)},e.prototype.replaceSlotDisplay=function(t,e,a,i,r,n){void 0===n&&(n=-1);var s=this.getArmatureData(e,t||"");if(null===s||null===s.defaultSkin)return!1;var o=s.defaultSkin.getDisplay(a,i);return this.replaceDisplay(r,o,n),!0},e.prototype.replaceSlotDisplayList=function(t,e,a,i){var r=this.getArmatureData(e,t||"");if(!r||!r.defaultSkin)return!1;var n=r.defaultSkin.getDisplays(a);if(!n)return!1;i.displayFrameCount=n.length;for(var s=0,o=i.displayFrameCount;s<o;++s){var l=n[s];this.replaceDisplay(i,l,s)}return!0},e.prototype.replaceSkin=function(t,e,a,i){void 0===a&&(a=!1),void 0===i&&(i=null);for(var r=!1,n=e.parent.defaultSkin,s=0,o=t.getSlots();s<o.length;s++){var l=o[s];if(!(null!==i&&i.indexOf(l.name)>=0)){var h=e.getDisplays(l.name);if(null!==h||(null!==n&&e!==n&&(h=n.getDisplays(l.name)),null!==h)){l.displayFrameCount=h.length;for(var u=0,_=l.displayFrameCount;u<_;++u){var f=h[u];l.replaceRawDisplayData(f,u),null!==f?l.replaceDisplay(this._getSlotDisplay(null,f,l),u):l.replaceDisplay(null,u)}r=!0}else a&&(l.displayFrameCount=0)}}return r},e.prototype.replaceAnimation=function(e,a,i){void 0===i&&(i=!0);var r=a.defaultSkin;if(null===r)return!1;if(i)e.animation.animations=a.animations;else{var n=e.animation.animations,s={};for(var o in n)s[o]=n[o];for(var o in a.animations)s[o]=a.animations[o];e.animation.animations=s}for(var l=0,h=e.getSlots();l<h.length;l++)for(var u=h[l],_=0,f=0,m=u.displayList;f<m.length;f++){var p=m[f];if(p instanceof t.Armature){var c=r.getDisplays(u.name);if(null!==c&&_<c.length){var y=c[_];if(null!==y&&1===y.type){var d=this.getArmatureData(y.path,y.parent.parent.parent.name);d&&this.replaceAnimation(p,d,i)}}}_++}return!0},e.prototype.getAllDragonBonesData=function(){return this._dragonBonesDataMap},e.prototype.getAllTextureAtlasData=function(){return this._textureAtlasDataMap},Object.defineProperty(e.prototype,"clock",{get:function(){return this._dragonBones.clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragonBones",{get:function(){return this._dragonBones},enumerable:!0,configurable:!0}),e._objectParser=null,e._binaryParser=null,e}();t.BaseFactory=e;var a=function(){this.dataName="",this.textureAtlasName="",this.skin=null};t.BuildArmaturePackage=a}(f||(f={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._renderTexture=null,t}return c(i,e),i.toString=function(){return"[class dragonBones.PixiTextureAtlasData]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._renderTexture,this._renderTexture=null},i.prototype.createTexture=function(){return t.BaseObject.borrowObject(a)},Object.defineProperty(i.prototype,"renderTexture",{get:function(){return this._renderTexture},set:function(t){if(this._renderTexture!==t)if(this._renderTexture=t,null!==this._renderTexture)for(var e in this.textures){(a=this.textures[e]).renderTexture=new _.Texture(this._renderTexture,new _.Rectangle(a.region.x,a.region.y,a.region.width,a.region.height),new _.Rectangle(a.region.x,a.region.y,a.region.width,a.region.height),new _.Rectangle(0,0,a.region.width,a.region.height),a.rotated)}else for(var e in this.textures){var a;(a=this.textures[e]).renderTexture=null}},enumerable:!0,configurable:!0}),i}(t.TextureAtlasData);t.PixiTextureAtlasData=e;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.renderTexture=null,e}return c(e,t),e.toString=function(){return"[class dragonBones.PixiTextureData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),null!==this.renderTexture&&this.renderTexture.destroy(!1),this.renderTexture=null},e}(t.TextureData);t.PixiTextureData=a}(f||(f={})),function(t){var e=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.debugDraw=!1,t._debugDraw=!1,t._armature=null,t._debugDrawer=null,t}return c(a,e),a.prototype.dbInit=function(t){this._armature=t},a.prototype.dbClear=function(){null!==this._debugDrawer&&this._debugDrawer.destroy(!0),this._armature=null,this._debugDrawer=null,e.prototype.destroy.call(this)},a.prototype.dbUpdate=function(){var e=t.DragonBones.debugDraw||this.debugDraw;if(e||this._debugDraw)if(this._debugDraw=e,this._debugDraw){if(null===this._debugDrawer){this._debugDrawer=new _.Sprite;var a=new _.Graphics;this._debugDrawer.addChild(a)}this.addChild(this._debugDrawer);var i=this._debugDrawer.getChildAt(0);i.clear();for(var r=this._armature.getBones(),n=0,s=r.length;n<s;++n){var o=r[n],l=o.boneData.length,h=o.globalTransformMatrix.tx,u=o.globalTransformMatrix.ty,f=h+o.globalTransformMatrix.a*l,m=u+o.globalTransformMatrix.b*l;i.lineStyle(2,65535,.7),i.moveTo(h,u),i.lineTo(f,m),i.lineStyle(0,0,0),i.beginFill(65535,.7),i.drawCircle(h,u,3),i.endFill()}var p=this._armature.getSlots();for(n=0,s=p.length;n<s;++n){var c=p[n],y=c.boundingBoxData;if(y){switch((A=this._debugDrawer.getChildByName(c.name))||((A=new _.Graphics).name=c.name,this._debugDrawer.addChild(A)),A.clear(),A.lineStyle(2,16711935,.7),y.type){case 0:A.drawRect(.5*-y.width,.5*-y.height,y.width,y.height);break;case 1:A.drawEllipse(.5*-y.width,.5*-y.height,y.width,y.height);break;case 2:for(var d=y.vertices,g=0,D=d.length;g<D;g+=2){var v=d[g],T=d[g+1];0===g?A.moveTo(v,T):A.lineTo(v,T)}A.lineTo(d[0],d[1])}A.endFill(),c.updateTransformAndMatrix(),c.updateGlobalTransform();var b=c.global;A.setTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skew,0,c._pivotX,c._pivotY)}else{var A;(A=this._debugDrawer.getChildByName(c.name))&&this._debugDrawer.removeChild(A)}}}else null!==this._debugDrawer&&this._debugDrawer.parent===this&&this.removeChild(this._debugDrawer)},a.prototype.dispose=function(t){null!==this._armature&&(this._armature.dispose(),this._armature=null)},a.prototype.destroy=function(){this.dispose()},a.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)},a.prototype.hasDBEventListener=function(t){return this.listeners(t,!0)},a.prototype.addDBEventListener=function(t,e,a){this.addListener(t,e,a)},a.prototype.removeDBEventListener=function(t,e,a){this.removeListener(t,e,a)},Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animation",{get:function(){return this._armature.animation},enumerable:!0,configurable:!0}),a}(_.Sprite);t.PixiArmatureDisplay=e}(f||(f={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return c(a,e),a.toString=function(){return"[class dragonBones.PixiSlot]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this._textureScale=1,this._renderDisplay=null,this._updateTransform=this._updateTransformV4},a.prototype._initDisplay=function(t,e){},a.prototype._disposeDisplay=function(t,e){e||t.destroy()},a.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay},a.prototype._addDisplay=function(){this._armature.display.addChild(this._renderDisplay)},a.prototype._replaceDisplay=function(t){var e=this._armature.display,a=t;e.addChild(this._renderDisplay),e.swapChildren(this._renderDisplay,a),e.removeChild(a),this._textureScale=1},a.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)},a.prototype._updateZOrder=function(){var t=this._armature.display;t.getChildIndex(this._renderDisplay)!==this._zOrder&&t.addChildAt(this._renderDisplay,this._zOrder)},a.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible},a.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof _.Sprite)switch(this._blendMode){case 0:this._renderDisplay.blendMode=_.BLEND_MODES.NORMAL;break;case 1:this._renderDisplay.blendMode=_.BLEND_MODES.ADD;break;case 3:this._renderDisplay.blendMode=_.BLEND_MODES.DARKEN;break;case 4:this._renderDisplay.blendMode=_.BLEND_MODES.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=_.BLEND_MODES.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=_.BLEND_MODES.LIGHTEN;break;case 10:this._renderDisplay.blendMode=_.BLEND_MODES.MULTIPLY;break;case 11:this._renderDisplay.blendMode=_.BLEND_MODES.OVERLAY;break;case 12:this._renderDisplay.blendMode=_.BLEND_MODES.SCREEN}},a.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;if(this._renderDisplay.alpha=t,this._renderDisplay instanceof _.Sprite||this._renderDisplay instanceof _.mesh.Mesh){var e=(Math.round(255*this._colorTransform.redMultiplier)<<16)+(Math.round(255*this._colorTransform.greenMultiplier)<<8)+Math.round(255*this._colorTransform.blueMultiplier);this._renderDisplay.tint=e}},a.prototype._updateFrame=function(){var e=this._textureData;if(this._displayIndex>=0&&null!==this._display&&null!==e){var a=e.parent;null!==this._armature.replacedTexture&&(null===this._armature._replaceTextureAtlasData?((a=t.BaseObject.borrowObject(t.PixiTextureAtlasData)).copyFrom(e.parent),a.renderTexture=this._armature.replacedTexture,this._armature._replaceTextureAtlasData=a):a=this._armature._replaceTextureAtlasData,e=a.getTexture(e.name));var i=e.renderTexture;if(null!==i){if(null!==this._geometryData){var r=this._geometryData.data,n=r.intArray,s=r.floatArray,o=n[this._geometryData.offset+0],l=n[this._geometryData.offset+1],h=n[this._geometryData.offset+2];h<0&&(h+=65536);var u=h+2*o,_=this._armature._armatureData.scale,f=this._renderDisplay,m=a.width>0?a.width:i.baseTexture.width,p=a.height>0?a.height:i.baseTexture.height,c=e.region;f.vertices=new Float32Array(2*o),f.uvs=new Float32Array(2*o),f.indices=new Uint16Array(3*l);for(var y=0,d=2*o;y<d;++y)f.vertices[y]=s[h+y]*_;for(y=0;y<3*l;++y)f.indices[y]=n[this._geometryData.offset+4+y];for(y=0,d=2*o;y<d;y+=2){var g=s[u+y],D=s[u+y+1];e.rotated?(f.uvs[y]=(c.x+(1-D)*c.width)/m,f.uvs[y+1]=(c.y+g*c.height)/p):(f.uvs[y]=(c.x+g*c.width)/m,f.uvs[y+1]=(c.y+D*c.height)/p)}this._textureScale=1,f.texture=i,f.dirty++,f.indexDirty++;var v=null!==this._geometryData.weight,T=0!==this._parent._boneData.type;(v||T)&&this._identityTransform()}else{var b;this._textureScale=e.parent.scale*this._armature._armatureData.scale,(b=this._renderDisplay).texture=i}return void(this._visibleDirty=!0)}}null!==this._geometryData?((f=this._renderDisplay).texture=null,f.x=0,f.y=0,f.visible=!1):((b=this._renderDisplay).texture=null,b.x=0,b.y=0,b.visible=!1)},a.prototype._updateMesh=function(){var t=this._armature._armatureData.scale,e=this._displayFrame.deformVertices,a=this._geometryBones,i=this._geometryData,r=i.weight,n=e.length>0&&i.inheritDeform,s=this._renderDisplay;if(null!==r){var o=(S=i.data).intArray,l=S.floatArray,h=o[i.offset+0],u=o[r.offset+1];u<0&&(u+=65536);for(var _=0,f=0,m=r.offset+2+a.length,p=u,c=0;_<h;++_){for(var y=o[m++],d=0,g=0,D=0;D<y;++D){var v=a[o[m++]];if(null!==v){var T=v.globalTransformMatrix,b=l[p++],A=l[p++]*t,P=l[p++]*t;n&&(A+=e[c++],P+=e[c++]),d+=(T.a*A+T.c*P+T.tx)*b,g+=(T.b*A+T.d*P+T.ty)*b}}s.vertices[f++]=d,s.vertices[f++]=g}}else{var S,O=0!==this._parent._boneData.type,x=(o=(S=i.data).intArray,l=S.floatArray,h=o[i.offset+0],o[i.offset+2]);x<0&&(x+=65536);_=0;for(var E=2*h;_<E;_+=2){var M=l[x+_]*t,B=l[x+_+1]*t;if(n&&(M+=e[_],B+=e[_+1]),O){T=this._parent._getGlobalTransformMatrix(M,B);s.vertices[_]=T.a*M+T.c*B+T.tx,s.vertices[_+1]=T.b*M+T.d*B+T.ty}else s.vertices[_]=M,s.vertices[_+1]=B}}},a.prototype._updateTransform=function(){throw new Error},a.prototype._updateTransformV3=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY),a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.setTransform(e,a,t.scaleX*this._textureScale,t.scaleY*this._textureScale,t.rotation,t.skew,0)}else this._renderDisplay.position.set(t.x,t.y),this._renderDisplay.rotation=t.rotation,this._renderDisplay.skew.set(t.skew,0),this._renderDisplay.scale.set(t.scaleX,t.scaleY)},a.prototype._updateTransformV4=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY),a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.setTransform(e,a,t.scaleX*this._textureScale,t.scaleY*this._textureScale,t.rotation,-t.skew,0)}else this._renderDisplay.position.set(t.x,t.y),this._renderDisplay.rotation=t.rotation,this._renderDisplay.skew.set(-t.skew,0),this._renderDisplay.scale.set(t.scaleX,t.scaleY)},a.prototype._identityTransform=function(){this._renderDisplay.setTransform(0,0,1,1,0,0,0)},a}(t.Slot);t.PixiSlot=e}(f||(f={})),function(t){var e=function(e){function a(i){void 0===i&&(i=null);var r=e.call(this,i)||this;if(null===a._dragonBonesInstance){var n=new t.PixiArmatureDisplay;a._dragonBonesInstance=new t.DragonBones(n)}return r._dragonBones=a._dragonBonesInstance,r}return c(a,e),a._clockHandler=function(t){this._dragonBonesInstance.advanceTime(_.ticker.shared.elapsedMS*t*.001)},Object.defineProperty(a,"factory",{get:function(){return null===a._factory&&(a._factory=new a),a._factory},enumerable:!0,configurable:!0}),a.prototype._buildTextureAtlasData=function(e,a){return e?e.renderTexture=a:e=t.BaseObject.borrowObject(t.PixiTextureAtlasData),e},a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature),i=new t.PixiArmatureDisplay;return a.init(e.armature,i,i,this._dragonBones),a},a.prototype._buildSlot=function(e,a,i){var r=t.BaseObject.borrowObject(t.PixiSlot);return r.init(a,i,new _.Sprite,new _.mesh.Mesh(null,null,null,null,_.mesh.Mesh.DRAW_MODES.TRIANGLES)),r},a.prototype.buildArmatureDisplay=function(t,e,a,i){void 0===e&&(e=""),void 0===a&&(a=""),void 0===i&&(i="");var r=this.buildArmature(t,e||"",a||"",i||"");return null!==r?(this._dragonBones.clock.add(r),r.display):null},a.prototype.getTextureDisplay=function(t,e){void 0===e&&(e=null);var a=this._getTextureData(null!==e?e:"",t);return null!==a&&null!==a.renderTexture?new _.Sprite(a.renderTexture):null},Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:!0,configurable:!0}),a._dragonBonesInstance=null,a._factory=null,a}(t.BaseFactory);t.PixiFactory=e}(f||(f={}));var y=f,d=function(){function t(t){var e=t.armatureName;this.factory=y.PixiFactory.factory,this.armature=this.factory.buildArmatureDisplay(e)}return t.prototype.play=function(t,e){return this.armature.animation.play(t,e)},t.prototype.stop=function(t){return this.armature.animation.stop(t)},t}(),g=d,D={START:"start",LOOP_COMPLETE:"loopComplete",COMPLETE:"complete",FADE_IN:"fadeIn",FADE_IN_COMPLETE:"fadeInComplete",FADE_OUT:"fadeOut",FADE_OUT_COMPLETE:"fadeOutComplete",FRAME_EVENT:"frameEvent",SOUND_EVENT:"soundEvent"},v=y.PixiFactory.factory;e.resource.registerResourceType("DRAGONBONE"),e.resource.registerInstance(e.RESOURCE_TYPE.DRAGONBONE,(function(t){var e=t.data,i=t.name;v.parseDragonBonesData(e.ske,i),v.parseTextureAtlasData(e.tex,a.Texture.from(e.image),i)})),e.resource.registerDestroy(e.RESOURCE_TYPE.DRAGONBONE,(function(t){var e=t.name;v.removeDragonBonesData(e),v.removeTextureAtlasData(e)}));var T=function(t){function a(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="DragonBone",e.armatures={},e.autoPlay={},e.isRemovedMap=new Map,e}return n(a,t),a.prototype.init=function(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this),this.renderSystem.application.ticker.add(y.PixiFactory._clockHandler,y.PixiFactory)},a.prototype.onDestroy=function(){this.renderSystem.application.ticker.remove(y.PixiFactory._clockHandler,y.PixiFactory)},a.prototype.componentChanged=function(t){return o(this,void 0,void 0,(function(){return l(this,(function(a){if(this.autoPlay[t.gameObject.id]=t.component.autoPlay,"DragonBone"===t.componentName)if(t.type===e.OBSERVER_TYPE.ADD)this.add(t);else if(t.type===e.OBSERVER_TYPE.CHANGE){if("armature"===t.prop.prop[0])this.change(t)}else t.type===e.OBSERVER_TYPE.REMOVE&&this.remove(t);return[2]}))}))},a.prototype.add=function(t){return o(this,void 0,void 0,(function(){var a,i,r,n,s;return l(this,(function(o){switch(o.label){case 0:return a=t.component,this.isRemovedMap.delete(a),i=this.increaseAsyncId(t.gameObject.id),[4,e.resource.getResource(a.resource)];case 1:if(o.sent(),!this.validateAsyncId(t.gameObject.id,i))return[2];if(this.isRemovedMap.get(a))return this.isRemovedMap.delete(a),[2];for(s in r=new g({armatureName:a.armatureName}),this.armatures[t.gameObject.id]=r,this.renderSystem.containerManager.getContainer(t.gameObject.id).addChildAt(r.armature,0),a.armature=r,n=function(t){r.armature.on(D[t],(function(e){a.emit(D[t],e)}))},D)n(s);return[2]}}))}))},a.prototype.change=function(t){if(this.remove(t),this.add(t),this.autoPlay[t.gameObject.id]){var e=t.component;e.play(e.animationName)}},a.prototype.remove=function(t){var a=this.armatures[t.gameObject.id];if(a){this.autoPlay[t.gameObject.id]=a.armature.animation.isPlaying,this.renderSystem.containerManager.getContainer(t.gameObject.id).removeChild(a.armature),a.armature.removeAllListeners(),a.armature.destroy({children:!0});var i=t.component;i.armature=null,delete this.armatures[t.gameObject.id],t.type===e.OBSERVER_TYPE.CHANGE&&(delete this.autoPlay[t.gameObject.id],i.removeAllListeners())}else this.isRemovedMap.set(t.component,!0)},a.systemName="DragonBone",a=s([e.decorators.componentObserver({DragonBone:["armatureName"]})],a)}(i.Renderer);exports.DragonBone=u,exports.DragonBoneSystem=T;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@eva/inspector-decorator"),e=require("@eva/eva.js"),a=require("pixi.js"),i=require("@eva/plugin-renderer");
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
+ this file except in compliance with the License. You may obtain a copy of the
6
+ License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
+ MERCHANTABLITY OR NON-INFRINGEMENT.
12
+
13
+ See the Apache Version 2.0 License for specific language governing permissions
14
+ and limitations under the License.
15
+ ***************************************************************************** */
16
+ function r(t,e,a,i){var r,n=arguments.length,s=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,a,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(n<3?r(s):n>3?r(e,a,s):r(e,a))||s);return n>3&&s&&Object.defineProperty(e,a,s),s}function n(t,e,a,i){return new(a||(a=Promise))((function(r,n){function s(t){try{l(i.next(t))}catch(t){n(t)}}function o(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){t.done?r(t.value):new a((function(e){e(t.value)})).then(s,o)}l((i=i.apply(t,e||[])).next())}))}class s extends e.Component{constructor(){super(...arguments),this.waitPlay=!1,this.waitStop=!1,this.waitPlayInfo={animationName:null},this.resource="",this.armatureName="",this.animationName="",this.autoPlay=!0}init(t){if(t){if(!t.armatureName)throw new Error(`The dragonBone component on ${this.gameObject.name}, armatureName is required!`);Object.assign(this,t),this.autoPlay&&this.play(this.animationName)}}play(t,e){t&&(this.animationName=t),this.armature?this.armature.play(this.animationName,e):(this.waitPlayInfo={animationName:t,times:e},this.waitPlay=!0)}stop(t){this.armature?this.armature.stop(t):(this.waitPlayInfo={animationName:t},this.waitStop=!0),this.animationName=null}set armature(t){if(this._armature=t,!t)return;const{animationName:e,times:a}=this.waitPlayInfo;this.waitPlay&&this.play(e,a),this.waitStop&&this.stop(e),this.waitPlay=!1,this.waitStop=!1}get armature(){return this._armature}onDestroy(){this.removeAllListeners()}}s.componentName="DragonBone",r([t.type("string")],s.prototype,"resource",void 0),r([t.type("string")],s.prototype,"armatureName",void 0),r([t.type("string")],s.prototype,"animationName",void 0),r([t.type("boolean")],s.prototype,"autoPlay",void 0);const o={Texture:a.Texture,Rectangle:a.Rectangle,Sprite:a.Sprite,Graphics:a.Graphics,BLEND_MODES:a.BLEND_MODES,mesh:a.mesh,ticker:a.ticker};var l,h,u,_,f=(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])},function(t,e){function a(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)});!function(t){var e=function(){function e(a){this._clock=new t.WorldClock,this._events=[],this._objects=[],this._eventManager=null,this._eventManager=a,console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}return e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,i=this._objects;a<i.length;a++){i[a].returnToPool()}this._objects.length=0}if(this._clock.advanceTime(e),this._events.length>0){for(var r=0;r<this._events.length;++r){var n=this._events[r],s=n.armature;null!==s._armatureData&&(s.eventDispatcher.dispatchDBEvent(n.type,n),n.type===t.EventObject.SOUND_EVENT&&this._eventManager.dispatchDBEvent(n.type,n)),this.bufferObject(n)}this._events.length=0}},e.prototype.bufferEvent=function(t){this._events.indexOf(t)<0&&this._events.push(t)},e.prototype.bufferObject=function(t){this._objects.indexOf(t)<0&&this._objects.push(t)},Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventManager",{get:function(){return this._eventManager},enumerable:!0,configurable:!0}),e.VERSION="5.7.000",e.yDown=!0,e.debug=!1,e.debugDraw=!1,e}();t.DragonBones=e}(l||(l={})),console.warn||(console.warn=function(){}),console.assert||(console.assert=function(){}),Date.now||(Date.now=function(){return(new Date).getTime()}),function(t){var e=function(){function t(){this.hashCode=t._hashCode++,this._isInPool=!1}return t._returnObject=function(e){var a=String(e.constructor),i=a in t._maxCountMap?t._maxCountMap[a]:t._defaultMaxCount,r=t._poolsMap[a]=t._poolsMap[a]||[];r.length<i&&(e._isInPool?console.warn("The object is already in the pool."):(e._isInPool=!0,r.push(e)))},t.toString=function(){throw new Error},t.setMaxCount=function(e,a){if((a<0||a!=a)&&(a=0),null!==e)null!==(r=(i=String(e))in t._poolsMap?t._poolsMap[i]:null)&&r.length>a&&(r.length=a),t._maxCountMap[i]=a;else for(var i in t._defaultMaxCount=a,t._poolsMap){var r;(r=t._poolsMap[i]).length>a&&(r.length=a),i in t._maxCountMap&&(t._maxCountMap[i]=a)}},t.clearPool=function(e){if(void 0===e&&(e=null),null!==e){var a=String(e);null!==(r=a in t._poolsMap?t._poolsMap[a]:null)&&r.length>0&&(r.length=0)}else for(var i in t._poolsMap){var r;(r=t._poolsMap[i]).length=0}},t.borrowObject=function(e){var a=String(e),i=a in t._poolsMap?t._poolsMap[a]:null;if(null!==i&&i.length>0){var r=i.pop();return r._isInPool=!1,r}var n=new e;return n._onClear(),n},t.prototype.returnToPool=function(){this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._maxCountMap={},t._poolsMap={},t}();t.BaseObject=e}(l||(l={})),function(t){var e=function(){function t(t,e,a,i,r,n){void 0===t&&(t=1),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===n&&(n=0),this.a=t,this.b=e,this.c=a,this.d=i,this.tx=r,this.ty=n}return t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.copyFromArray=function(t,e){return void 0===e&&(e=0),this.a=t[e],this.b=t[e+1],this.c=t[e+2],this.d=t[e+3],this.tx=t[e+4],this.ty=t[e+5],this},t.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this},t.prototype.concat=function(t){var e=this.a*t.a,a=0,i=0,r=this.d*t.d,n=this.tx*t.a+t.tx,s=this.ty*t.d+t.ty;return 0===this.b&&0===this.c||(e+=this.b*t.c,a+=this.b*t.d,i+=this.c*t.a,r+=this.c*t.b),0===t.b&&0===t.c||(a+=this.a*t.b,i+=this.d*t.c,n+=this.ty*t.c,s+=this.tx*t.b),this.a=e,this.b=a,this.c=i,this.d=r,this.tx=n,this.ty=s,this},t.prototype.invert=function(){var t=this.a,e=this.b,a=this.c,i=this.d,r=this.tx,n=this.ty;if(0===e&&0===a)return this.b=this.c=0,0===t||0===i?this.a=this.b=this.tx=this.ty=0:(t=this.a=1/t,i=this.d=1/i,this.tx=-t*r,this.ty=-i*n),this;var s=t*i-e*a;if(0===s)return this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;s=1/s;var o=this.a=i*s;return e=this.b=-e*s,a=this.c=-a*s,i=this.d=t*s,this.tx=-(o*r+a*n),this.ty=-(e*r+i*n),this},t.prototype.transformPoint=function(t,e,a,i){void 0===i&&(i=!1),a.x=this.a*t+this.c*e,a.y=this.b*t+this.d*e,i||(a.x+=this.tx,a.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void 0===e&&(e=!1);var a=this.a,i=this.b,r=this.c,n=this.d,s=e?0:this.tx,o=e?0:this.ty,l=t.x,h=t.y,u=l+t.width,_=h+t.height,f=a*l+r*h+s,m=i*l+n*h+o,p=a*u+r*h+s,c=i*u+n*h+o,d=a*u+r*_+s,y=i*u+n*_+o,g=a*l+r*_+s,D=i*l+n*_+o,v=0;f>p&&(v=f,f=p,p=v),d>g&&(v=d,d=g,g=v),t.x=Math.floor(f<d?f:d),t.width=Math.ceil((p>g?p:g)-t.x),m>c&&(v=m,m=c,c=v),y>D&&(v=y,y=D,D=v),t.y=Math.floor(m<y?m:y),t.height=Math.ceil((c>D?c:D)-t.y)},t}();t.Matrix=e}(l||(l={})),function(t){var e=function(){function t(t,e,a,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=1),this.x=t,this.y=e,this.skew=a,this.rotation=i,this.scaleX=r,this.scaleY=n}return t.normalizeRadian=function(t){return t=(t+Math.PI)%(2*Math.PI),t+=t>0?-Math.PI:Math.PI},t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+180*this.skew/Math.PI+" skewY:"+180*this.rotation/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.skew=t.skew,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this},t.prototype.identity=function(){return this.x=this.y=0,this.skew=this.rotation=0,this.scaleX=this.scaleY=1,this},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this.skew+=t.skew,this.rotation+=t.rotation,this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this},t.prototype.minus=function(t){return this.x-=t.x,this.y-=t.y,this.skew-=t.skew,this.rotation-=t.rotation,this.scaleX/=t.scaleX,this.scaleY/=t.scaleY,this},t.prototype.fromMatrix=function(e){var a=this.scaleX,i=this.scaleY,r=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);return this.scaleX=this.rotation>-r&&this.rotation<r?e.a/Math.cos(this.rotation):e.b/Math.sin(this.rotation),this.scaleY=n>-r&&n<r?e.d/Math.cos(n):-e.c/Math.sin(n),a>=0&&this.scaleX<0&&(this.scaleX=-this.scaleX,this.rotation=this.rotation-Math.PI),i>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,n-=Math.PI),this.skew=n-this.rotation,this},t.prototype.toMatrix=function(t){return 0===this.rotation?(t.a=1,t.b=0):(t.a=Math.cos(this.rotation),t.b=Math.sin(this.rotation)),0===this.skew?(t.c=-t.b,t.d=t.a):(t.c=-Math.sin(this.skew+this.rotation),t.d=Math.cos(this.skew+this.rotation)),1!==this.scaleX&&(t.a*=this.scaleX,t.b*=this.scaleX),1!==this.scaleY&&(t.c*=this.scaleY,t.d*=this.scaleY),t.tx=this.x,t.ty=this.y,this},t.PI=Math.PI,t.PI_D=2*Math.PI,t.PI_H=Math.PI/2,t.PI_Q=Math.PI/4,t.RAD_DEG=180/Math.PI,t.DEG_RAD=Math.PI/180,t}();t.Transform=e}(l||(l={})),function(t){var e=function(){function t(t,e,a,i,r,n,s,o){void 0===t&&(t=1),void 0===e&&(e=1),void 0===a&&(a=1),void 0===i&&(i=1),void 0===r&&(r=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=a,this.blueMultiplier=i,this.alphaOffset=r,this.redOffset=n,this.greenOffset=s,this.blueOffset=o}return t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.greenMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffset=t.alphaOffset,this.redOffset=t.redOffset,this.greenOffset=t.greenOffset,this.blueOffset=t.blueOffset},t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1,this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0},t}();t.ColorTransform=e}(l||(l={})),function(t){var e=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clear=function(){this.x=this.y=0},t}();t.Point=e}(l||(l={})),function(t){var e=function(){function t(t,e,a,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===a&&(a=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=a,this.height=i}return t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.clear=function(){this.x=this.y=0,this.width=this.height=0},t}();t.Rectangle=e}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ints=[],e.floats=[],e.strings=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.UserData]"},e.prototype._onClear=function(){this.ints.length=0,this.floats.length=0,this.strings.length=0},e.prototype.addInt=function(t){this.ints.push(t)},e.prototype.addFloat=function(t){this.floats.push(t)},e.prototype.addString=function(t){this.strings.push(t)},e.prototype.getInt=function(t){return void 0===t&&(t=0),t>=0&&t<this.ints.length?this.ints[t]:0},e.prototype.getFloat=function(t){return void 0===t&&(t=0),t>=0&&t<this.floats.length?this.floats[t]:0},e.prototype.getString=function(t){return void 0===t&&(t=0),t>=0&&t<this.strings.length?this.strings[t]:""},e}(t.BaseObject);t.UserData=e;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.ActionData]"},e.prototype._onClear=function(){null!==this.data&&this.data.returnToPool(),this.type=0,this.name="",this.bone=null,this.slot=null,this.data=null},e}(t.BaseObject);t.ActionData=a}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameIndices=[],e.cachedFrames=[],e.armatureNames=[],e.armatures={},e.userData=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.DragonBonesData]"},e.prototype._onClear=function(){for(var t in this.armatures)this.armatures[t].returnToPool(),delete this.armatures[t];null!==this.userData&&this.userData.returnToPool(),this.autoSearch=!1,this.frameRate=0,this.version="",this.name="",this.stage=null,this.frameIndices.length=0,this.cachedFrames.length=0,this.armatureNames.length=0,this.binary=null,this.intArray=null,this.floatArray=null,this.frameIntArray=null,this.frameFloatArray=null,this.frameArray=null,this.timelineArray=null,this.colorArray=null,this.userData=null},e.prototype.addArmature=function(t){t.name in this.armatures?console.warn("Same armature: "+t.name):(t.parent=this,this.armatures[t.name]=t,this.armatureNames.push(t.name))},e.prototype.getArmature=function(t){return t in this.armatures?this.armatures[t]:null},e}(t.BaseObject);t.DragonBonesData=e}(l||(l={})),function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.aabb=new t.Rectangle,a.animationNames=[],a.sortedBones=[],a.sortedSlots=[],a.defaultActions=[],a.actions=[],a.bones={},a.slots={},a.constraints={},a.skins={},a.animations={},a.canvas=null,a.userData=null,a}return f(a,e),a.toString=function(){return"[class dragonBones.ArmatureData]"},a.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++){e[t].returnToPool()}for(var a=0,i=this.actions;a<i.length;a++){i[a].returnToPool()}for(var r in this.bones)this.bones[r].returnToPool(),delete this.bones[r];for(var r in this.slots)this.slots[r].returnToPool(),delete this.slots[r];for(var r in this.constraints)this.constraints[r].returnToPool(),delete this.constraints[r];for(var r in this.skins)this.skins[r].returnToPool(),delete this.skins[r];for(var r in this.animations)this.animations[r].returnToPool(),delete this.animations[r];null!==this.canvas&&this.canvas.returnToPool(),null!==this.userData&&this.userData.returnToPool(),this.type=0,this.frameRate=0,this.cacheFrameRate=0,this.scale=1,this.name="",this.aabb.clear(),this.animationNames.length=0,this.sortedBones.length=0,this.sortedSlots.length=0,this.defaultActions.length=0,this.actions.length=0,this.defaultSkin=null,this.defaultAnimation=null,this.canvas=null,this.userData=null,this.parent=null},a.prototype.sortBones=function(){var t=this.sortedBones.length;if(!(t<=0)){var e=this.sortedBones.concat(),a=0,i=0;for(this.sortedBones.length=0;i<t;){var r=e[a++];if(a>=t&&(a=0),!(this.sortedBones.indexOf(r)>=0)){var n=!1;for(var s in this.constraints){var o=this.constraints[s];if(o.root===r&&this.sortedBones.indexOf(o.target)<0){n=!0;break}}n||null!==r.parent&&this.sortedBones.indexOf(r.parent)<0||(this.sortedBones.push(r),i++)}}}},a.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0))for(var e in this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFrameRate)},a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames,i=a.length;return a.length+=10,a[i]=t.a,a[i+1]=t.b,a[i+2]=t.c,a[i+3]=t.d,a[i+4]=t.tx,a[i+5]=t.ty,a[i+6]=e.rotation,a[i+7]=e.skew,a[i+8]=e.scaleX,a[i+9]=e.scaleY,i},a.prototype.getCacheFrame=function(t,e,a){var i=this.parent.cachedFrames;t.a=i[a],t.b=i[a+1],t.c=i[a+2],t.d=i[a+3],t.tx=i[a+4],t.ty=i[a+5],e.rotation=i[a+6],e.skew=i[a+7],e.scaleX=i[a+8],e.scaleY=i[a+9],e.x=t.tx,e.y=t.ty},a.prototype.addBone=function(t){t.name in this.bones?console.warn("Same bone: "+t.name):(this.bones[t.name]=t,this.sortedBones.push(t))},a.prototype.addSlot=function(t){t.name in this.slots?console.warn("Same slot: "+t.name):(this.slots[t.name]=t,this.sortedSlots.push(t))},a.prototype.addConstraint=function(t){t.name in this.constraints?console.warn("Same constraint: "+t.name):this.constraints[t.name]=t},a.prototype.addSkin=function(t){t.name in this.skins?console.warn("Same skin: "+t.name):(t.parent=this,this.skins[t.name]=t,null===this.defaultSkin&&(this.defaultSkin=t),"default"===t.name&&(this.defaultSkin=t))},a.prototype.addAnimation=function(t){t.name in this.animations?console.warn("Same animation: "+t.name):(t.parent=this,this.animations[t.name]=t,this.animationNames.push(t.name),null===this.defaultAnimation&&(this.defaultAnimation=t))},a.prototype.addAction=function(t,e){e?this.defaultActions.push(t):this.actions.push(t)},a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null},a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null},a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null},a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null},a.prototype.getMesh=function(t,e,a){var i=this.getSkin(t);return null===i?null:i.getDisplay(e,a)},a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null},a}(t.BaseObject);t.ArmatureData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.transform=new t.Transform,a.userData=null,a}return f(a,e),a.toString=function(){return"[class dragonBones.BoneData]"},a.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.inheritTranslation=!1,this.inheritRotation=!1,this.inheritScale=!1,this.inheritReflection=!1,this.type=0,this.length=0,this.alpha=1,this.name="",this.transform.identity(),this.userData=null,this.parent=null},a}(t.BaseObject);t.BoneData=a;var i=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.geometry=new t.GeometryData,a}return f(a,e),a.toString=function(){return"[class dragonBones.SurfaceData]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.geometry.clear()},a}(a);t.SurfaceData=i;var r=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.color=null,t.userData=null,t}return f(a,e),a.createColor=function(){return new t.ColorTransform},a.toString=function(){return"[class dragonBones.SlotData]"},a.prototype._onClear=function(){null!==this.userData&&this.userData.returnToPool(),this.blendMode=0,this.displayIndex=0,this.zOrder=0,this.zIndex=0,this.alpha=1,this.name="",this.color=null,this.userData=null,this.parent=null},a.DEFAULT_COLOR=new t.ColorTransform,a}(t.BaseObject);t.SlotData=r}(l||(l={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype._onClear=function(){this.order=0,this.name="",this.type=0,this.target=null,this.root=null,this.bone=null},e}(t.BaseObject);t.ConstraintData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.IKConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.scaleEnabled=!1,this.bendPositive=!1,this.weight=1},e}(e);t.IKConstraintData=a;var i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.PathConstraintData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.pathSlot=null,this.pathDisplayData=null,this.bones.length=0,this.positionMode=0,this.spacingMode=1,this.rotateMode=1,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=0,this.translateMix=0},e.prototype.AddBone=function(t){this.bones.push(t)},e}(e);t.PathConstraintData=i}(l||(l={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.CanvasData]"},e.prototype._onClear=function(){this.hasBackground=!1,this.color=0,this.x=0,this.y=0,this.width=0,this.height=0},e}(t.BaseObject);t.CanvasData=e}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return f(e,t),e.toString=function(){return"[class dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays){for(var e=0,a=this.displays[t];e<a.length;e++){var i=a[e];null!==i&&i.returnToPool()}delete this.displays[t]}this.name="",this.parent=null},e.prototype.addDisplay=function(t,e){t in this.displays||(this.displays[t]=[]),null!==e&&(e.parent=this),this.displays[t].push(e)},e.prototype.getDisplay=function(t,e){var a=this.getDisplays(t);if(null!==a)for(var i=0,r=a;i<r.length;i++){var n=r[i];if(null!==n&&n.name===e)return n}return null},e.prototype.getDisplays=function(t){return t in this.displays?this.displays[t]:null},e}(t.BaseObject);t.SkinData=e}(l||(l={})),function(t){var e=function(){function t(){this.weight=null}return t.prototype.clear=function(){this.isShared||null===this.weight||this.weight.returnToPool(),this.isShared=!1,this.inheritDeform=!1,this.offset=0,this.data=null,this.weight=null},t.prototype.shareFrom=function(t){this.isShared=!0,this.offset=t.offset,this.weight=t.weight},Object.defineProperty(t.prototype,"vertexCount",{get:function(){return this.data.intArray[this.offset+0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"triangleCount",{get:function(){return this.data.intArray[this.offset+1]},enumerable:!0,configurable:!0}),t}();t.GeometryData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.transform=new t.Transform,a}return f(a,e),a.prototype._onClear=function(){this.name="",this.path="",this.transform.identity(),this.parent=null},a}(t.BaseObject);t.DisplayData=a;var i=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.pivot=new t.Point,a}return f(a,e),a.toString=function(){return"[class dragonBones.ImageDisplayData]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.type=0,this.pivot.clear(),this.texture=null},a}(a);t.ImageDisplayData=i;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.actions=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.ArmatureDisplayData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this);for(var e=0,a=this.actions;e<a.length;e++){a[e].returnToPool()}this.type=1,this.inheritAnimation=!1,this.actions.length=0,this.armature=null},e.prototype.addAction=function(t){this.actions.push(t)},e}(a);t.ArmatureDisplayData=r;var n=function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.geometry=new e,a}return f(a,t),a.toString=function(){return"[class dragonBones.MeshDisplayData]"},a.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.geometry.clear(),this.texture=null},a}(a);t.MeshDisplayData=n;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boundingBox=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.BoundingBoxDisplayData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),null!==this.boundingBox&&this.boundingBox.returnToPool(),this.type=3,this.boundingBox=null},e}(a);t.BoundingBoxDisplayData=s;var o=function(t){function a(){var a=null!==t&&t.apply(this,arguments)||this;return a.geometry=new e,a.curveLengths=[],a}return f(a,t),a.toString=function(){return"[class dragonBones.PathDisplayData]"},a.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=4,this.closed=!1,this.constantSpeed=!1,this.geometry.clear(),this.curveLengths.length=0},a}(a);t.PathDisplayData=o;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bones=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.WeightData]"},e.prototype._onClear=function(){this.count=0,this.offset=0,this.bones.length=0},e.prototype.addBone=function(t){this.bones.push(t)},e}(t.BaseObject);t.WeightData=l}(l||(l={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype._onClear=function(){this.color=0,this.width=0,this.height=0},e}(t.BaseObject);t.BoundingBoxData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.RectangleBoundingBoxData]"},e._computeOutCode=function(t,e,a,i,r,n){var s=0;return t<a?s|=1:t>r&&(s|=2),e<i?s|=4:e>n&&(s|=8),s},e.rectangleIntersectsSegment=function(t,a,i,r,n,s,o,l,h,u,_){void 0===h&&(h=null),void 0===u&&(u=null),void 0===_&&(_=null);var f=t>n&&t<o&&a>s&&a<l,m=i>n&&i<o&&r>s&&r<l;if(f&&m)return-1;for(var p=0,c=e._computeOutCode(t,a,n,s,o,l),d=e._computeOutCode(i,r,n,s,o,l);;){if(!(c|d)){p=2;break}if(c&d)break;var y=0,g=0,D=0,v=0!==c?c:d;4&v?(y=t+(i-t)*(s-a)/(r-a),g=s,null!==_&&(D=.5*-Math.PI)):8&v?(y=t+(i-t)*(l-a)/(r-a),g=l,null!==_&&(D=.5*Math.PI)):2&v?(g=a+(r-a)*(o-t)/(i-t),y=o,null!==_&&(D=0)):1&v&&(g=a+(r-a)*(n-t)/(i-t),y=n,null!==_&&(D=Math.PI)),v===c?(t=y,a=g,c=e._computeOutCode(t,a,n,s,o,l),null!==_&&(_.x=D)):(i=y,r=g,d=e._computeOutCode(i,r,n,s,o,l),null!==_&&(_.y=D))}return p&&(f?(p=2,null!==h&&(h.x=i,h.y=r),null!==u&&(u.x=i,u.y=i),null!==_&&(_.x=_.y+Math.PI)):m?(p=1,null!==h&&(h.x=t,h.y=a),null!==u&&(u.x=t,u.y=a),null!==_&&(_.y=_.x+Math.PI)):(p=3,null!==h&&(h.x=t,h.y=a),null!==u&&(u.x=i,u.y=r))),p},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=0},e.prototype.containsPoint=function(t,e){var a=.5*this.width;if(t>=-a&&t<=a){var i=.5*this.height;if(e>=-i&&e<=i)return!0}return!1},e.prototype.intersectsSegment=function(t,a,i,r,n,s,o){void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null);var l=.5*this.width,h=.5*this.height;return e.rectangleIntersectsSegment(t,a,i,r,-l,-h,l,h,n,s,o)},e}(e);t.RectangleBoundingBoxData=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,a,i,r,n,s,o,l,h,u){void 0===l&&(l=null),void 0===h&&(h=null),void 0===u&&(u=null);var _=s/o,f=_*_,m=a-t,p=(i*=_)-(e*=_),c=Math.sqrt(m*m+p*p),d=m/c,y=p/c,g=(r-t)*d+(n-e)*y,D=s*s,v=D-(t*t+e*e)+g*g,T=0;if(v>=0){var b=Math.sqrt(v),A=g-b,P=g+b,S=A<0?-1:A<=c?0:1,O=P<0?-1:P<=c?0:1,x=S*O;if(x<0)return-1;0===x&&(-1===S?(T=2,a=t+P*d,i=(e+P*y)/_,null!==l&&(l.x=a,l.y=i),null!==h&&(h.x=a,h.y=i),null!==u&&(u.x=Math.atan2(i/D*f,a/D),u.y=u.x+Math.PI)):1===O?(T=1,t+=A*d,e=(e+A*y)/_,null!==l&&(l.x=t,l.y=e),null!==h&&(h.x=t,h.y=e),null!==u&&(u.x=Math.atan2(e/D*f,t/D),u.y=u.x+Math.PI)):(T=3,null!==l&&(l.x=t+A*d,l.y=(e+A*y)/_,null!==u&&(u.x=Math.atan2(l.y/D*f,l.x/D))),null!==h&&(h.x=t+P*d,h.y=(e+P*y)/_,null!==u&&(u.y=Math.atan2(h.y/D*f,h.x/D)))))}return T},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,e){var a=.5*this.width;if(t>=-a&&t<=a){var i=.5*this.height;if(e>=-i&&e<=i)return e*=a/i,Math.sqrt(t*t+e*e)<=a}return!1},e.prototype.intersectsSegment=function(t,a,i,r,n,s,o){return void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),e.ellipseIntersectsSegment(t,a,i,r,0,0,.5*this.width,.5*this.height,n,s,o)},e}(e);t.EllipseBoundingBoxData=i;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,a,i,r,n,s,o){void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),t===a&&(t=a+1e-6),e===i&&(e=i+1e-6);for(var l=r.length,h=t-a,u=e-i,_=t*i-e*a,f=0,m=r[l-2],p=r[l-1],c=0,d=0,y=0,g=0,D=0,v=0,T=0;T<l;T+=2){var b=r[T],A=r[T+1];m===b&&(m=b+1e-4),p===A&&(p=A+1e-4);var P=m-b,S=p-A,O=m*A-p*b,x=h*S-u*P,E=(_*P-h*O)/x;if((E>=m&&E<=b||E>=b&&E<=m)&&(0===h||E>=t&&E<=a||E>=a&&E<=t)){var M=(_*S-u*O)/x;if((M>=p&&M<=A||M>=A&&M<=p)&&(0===u||M>=e&&M<=i||M>=i&&M<=e)){if(null===s){y=E,g=M,D=E,v=M,f++,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI,o.y=o.x);break}var B=E-t;B<0&&(B=-B),0===f?(c=B,d=B,y=E,g=M,D=E,v=M,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI,o.y=o.x)):(B<c&&(c=B,y=E,g=M,null!==o&&(o.x=Math.atan2(A-p,b-m)-.5*Math.PI)),B>d&&(d=B,D=E,v=M,null!==o&&(o.y=Math.atan2(A-p,b-m)-.5*Math.PI))),f++}}m=b,p=A}return 1===f?(null!==n&&(n.x=y,n.y=g),null!==s&&(s.x=y,s.y=g),null!==o&&(o.y=o.x+Math.PI)):f>1&&(f++,null!==n&&(n.x=y,n.y=g),null!==s&&(s.x=D,s.y=v)),f},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.type=2,this.x=0,this.y=0,this.vertices.length=0},e.prototype.containsPoint=function(t,e){var a=!1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var i=0,r=this.vertices.length,n=r-2;i<r;i+=2){var s=this.vertices[n+1],o=this.vertices[i+1];if(o<e&&s>=e||s<e&&o>=e){var l=this.vertices[n],h=this.vertices[i];(e-o)*(l-h)/(s-o)+h<t&&(a=!a)}n=i}return a},e.prototype.intersectsSegment=function(t,i,r,n,s,o,l){void 0===s&&(s=null),void 0===o&&(o=null),void 0===l&&(l=null);var h=0;return 0!==a.rectangleIntersectsSegment(t,i,r,n,this.x,this.y,this.x+this.width,this.y+this.height,null,null,null)&&(h=e.polygonIntersectsSegment(t,i,r,n,this.vertices,s,o,l)),h},e}(e);t.PolygonBoundingBoxData=r}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cachedFrames=[],e.boneTimelines={},e.slotTimelines={},e.constraintTimelines={},e.animationTimelines={},e.boneCachedFrameIndices={},e.slotCachedFrameIndices={},e.actionTimeline=null,e.zOrderTimeline=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationData]"},e.prototype._onClear=function(){for(var t in this.boneTimelines){for(var e=0,a=this.boneTimelines[t];e<a.length;e++){a[e].returnToPool()}delete this.boneTimelines[t]}for(var t in this.slotTimelines){for(var i=0,r=this.slotTimelines[t];i<r.length;i++){r[i].returnToPool()}delete this.slotTimelines[t]}for(var t in this.constraintTimelines){for(var n=0,s=this.constraintTimelines[t];n<s.length;n++){s[n].returnToPool()}delete this.constraintTimelines[t]}for(var t in this.animationTimelines){for(var o=0,l=this.animationTimelines[t];o<l.length;o++){l[o].returnToPool()}delete this.animationTimelines[t]}for(var t in this.boneCachedFrameIndices)delete this.boneCachedFrameIndices[t];for(var t in this.slotCachedFrameIndices)delete this.slotCachedFrameIndices[t];null!==this.actionTimeline&&this.actionTimeline.returnToPool(),null!==this.zOrderTimeline&&this.zOrderTimeline.returnToPool(),this.frameIntOffset=0,this.frameFloatOffset=0,this.frameOffset=0,this.blendType=0,this.frameCount=0,this.playTimes=0,this.duration=0,this.scale=1,this.fadeInTime=0,this.cacheFrameRate=0,this.name="",this.cachedFrames.length=0,this.actionTimeline=null,this.zOrderTimeline=null,this.parent=null},e.prototype.cacheFrames=function(t){if(!(this.cacheFrameRate>0)){this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,i=this.cacheFrames.length;a<i;++a)this.cachedFrames[a]=!1;for(var r=0,n=this.parent.sortedBones;r<n.length;r++){var s=n[r];for(a=0,i=(h=new Array(e)).length;a<i;++a)h[a]=-1;this.boneCachedFrameIndices[s.name]=h}for(var o=0,l=this.parent.sortedSlots;o<l.length;o++){var h,u=l[o];for(a=0,i=(h=new Array(e)).length;a<i;++a)h[a]=-1;this.slotCachedFrameIndices[u.name]=h}}},e.prototype.addBoneTimeline=function(t,e){var a=t in this.boneTimelines?this.boneTimelines[t]:this.boneTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addSlotTimeline=function(t,e){var a=t in this.slotTimelines?this.slotTimelines[t]:this.slotTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addConstraintTimeline=function(t,e){var a=t in this.constraintTimelines?this.constraintTimelines[t]:this.constraintTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.addAnimationTimeline=function(t,e){var a=t in this.animationTimelines?this.animationTimelines[t]:this.animationTimelines[t]=[];a.indexOf(e)<0&&a.push(e)},e.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?this.boneTimelines[t]:null},e.prototype.getSlotTimelines=function(t){return t in this.slotTimelines?this.slotTimelines[t]:null},e.prototype.getConstraintTimelines=function(t){return t in this.constraintTimelines?this.constraintTimelines[t]:null},e.prototype.getAnimationTimelines=function(t){return t in this.animationTimelines?this.animationTimelines[t]:null},e.prototype.getBoneCachedFrameIndices=function(t){return t in this.boneCachedFrameIndices?this.boneCachedFrameIndices[t]:null},e.prototype.getSlotCachedFrameIndices=function(t){return t in this.slotCachedFrameIndices?this.slotCachedFrameIndices[t]:null},e}(t.BaseObject);t.AnimationData=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.TimelineData]"},e.prototype._onClear=function(){this.type=10,this.offset=0,this.frameIndicesOffset=-1},e}(t.BaseObject);t.TimelineData=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationTimelineData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.x=0,this.y=0},e}(a);t.AnimationTimelineData=i}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boneMask=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationConfig]"},e.prototype._onClear=function(){this.pauseFadeOut=!0,this.fadeOutMode=4,this.fadeOutTweenType=1,this.fadeOutTime=-1,this.actionEnabled=!0,this.additive=!1,this.displayControl=!0,this.pauseFadeIn=!0,this.resetToPose=!0,this.fadeInTweenType=1,this.playTimes=-1,this.layer=0,this.position=0,this.duration=-1,this.timeScale=-100,this.weight=1,this.fadeInTime=-1,this.autoFadeOutTime=-1,this.name="",this.animation="",this.group="",this.boneMask.length=0},e.prototype.clear=function(){this._onClear()},e.prototype.copyFrom=function(t){this.pauseFadeOut=t.pauseFadeOut,this.fadeOutMode=t.fadeOutMode,this.autoFadeOutTime=t.autoFadeOutTime,this.fadeOutTweenType=t.fadeOutTweenType,this.actionEnabled=t.actionEnabled,this.additive=t.additive,this.displayControl=t.displayControl,this.pauseFadeIn=t.pauseFadeIn,this.resetToPose=t.resetToPose,this.playTimes=t.playTimes,this.layer=t.layer,this.position=t.position,this.duration=t.duration,this.timeScale=t.timeScale,this.fadeInTime=t.fadeInTime,this.fadeOutTime=t.fadeOutTime,this.fadeInTweenType=t.fadeInTweenType,this.weight=t.weight,this.name=t.name,this.animation=t.animation,this.group=t.group,this.boneMask.length=t.boneMask.length;for(var e=0,a=this.boneMask.length;e<a;++e)this.boneMask[e]=t.boneMask[e]},e}(t.BaseObject);t.AnimationConfig=e}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.textures={},e}return f(e,t),e.prototype._onClear=function(){for(var t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];this.autoSearch=!1,this.width=0,this.height=0,this.scale=1,this.name="",this.imagePath=""},e.prototype.copyFrom=function(t){for(var e in this.autoSearch=t.autoSearch,this.scale=t.scale,this.width=t.width,this.height=t.height,this.name=t.name,this.imagePath=t.imagePath,this.textures)this.textures[e].returnToPool(),delete this.textures[e];for(var e in t.textures){var a=this.createTexture();a.copyFrom(t.textures[e]),this.textures[e]=a}},e.prototype.addTexture=function(t){t.name in this.textures?console.warn("Same texture: "+t.name):(t.parent=this,this.textures[t.name]=t)},e.prototype.getTexture=function(t){return t in this.textures?this.textures[t]:null},e}(t.BaseObject);t.TextureAtlasData=e;var a=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.region=new t.Rectangle,a.frame=null,a}return f(a,e),a.createRectangle=function(){return new t.Rectangle},a.prototype._onClear=function(){this.rotated=!1,this.name="",this.region.clear(),this.parent=null,this.frame=null},a.prototype.copyFrom=function(t){this.rotated=t.rotated,this.name=t.name,this.region.copyFrom(t.region),this.parent=t.parent,null===this.frame&&null!==t.frame?this.frame=a.createRectangle():null!==this.frame&&null===t.frame&&(this.frame=null),null!==this.frame&&null!==t.frame&&this.frame.copyFrom(t.frame)},a}(t.BaseObject);t.TextureData=a}(l||(l={})),u=l||(l={}),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._bones=[],e._slots=[],e._constraints=[],e._actions=[],e._animation=null,e._proxy=null,e._replaceTextureAtlasData=null,e._clock=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.Armature]"},e._onSortSlots=function(t,e){return 1e3*t._zIndex+t._zOrder>1e3*e._zIndex+e._zOrder?1:-1},e.prototype._onClear=function(){null!==this._clock&&this._clock.remove(this);for(var t=0,e=this._bones;t<e.length;t++)e[t].returnToPool();for(var a=0,i=this._slots;a<i.length;a++)i[a].returnToPool();for(var r=0,n=this._constraints;r<n.length;r++)n[r].returnToPool();for(var s=0,o=this._actions;s<o.length;s++)o[s].returnToPool();null!==this._animation&&this._animation.returnToPool(),null!==this._proxy&&this._proxy.dbClear(),null!==this._replaceTextureAtlasData&&this._replaceTextureAtlasData.returnToPool(),this.inheritAnimation=!0,this.userData=null,this._lockUpdate=!1,this._slotsDirty=!0,this._zOrderDirty=!1,this._zIndexDirty=!1,this._alphaDirty=!0,this._flipX=!1,this._flipY=!1,this._cacheFrameIndex=-1,this._alpha=1,this._globalAlpha=1,this._bones.length=0,this._slots.length=0,this._constraints.length=0,this._actions.length=0,this._armatureData=null,this._animation=null,this._proxy=null,this._display=null,this._replaceTextureAtlasData=null,this._replacedTexture=null,this._dragonBones=null,this._clock=null,this._parent=null},e.prototype._sortZOrder=function(t,e){var a=this._armatureData.sortedSlots,i=null===t;if(this._zOrderDirty||!i){for(var r=0,n=a.length;r<n;++r){var s=i?r:t[e+r];if(!(s<0||s>=n)){var o=a[s],l=this.getSlot(o.name);null!==l&&l._setZOrder(r)}}this._slotsDirty=!0,this._zOrderDirty=!i}},e.prototype._addBone=function(t){this._bones.indexOf(t)<0&&this._bones.push(t)},e.prototype._addSlot=function(t){this._slots.indexOf(t)<0&&this._slots.push(t)},e.prototype._addConstraint=function(t){this._constraints.indexOf(t)<0&&this._constraints.push(t)},e.prototype._bufferAction=function(t,e){this._actions.indexOf(t)<0&&(e?this._actions.push(t):this._actions.unshift(t))},e.prototype.dispose=function(){null!==this._armatureData&&(this._lockUpdate=!0,this._dragonBones.bufferObject(this))},e.prototype.init=function(t,e,a,i){null===this._armatureData&&(this._armatureData=t,this._animation=u.BaseObject.borrowObject(u.Animation),this._proxy=e,this._display=a,this._dragonBones=i,this._proxy.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureData.animations)},e.prototype.advanceTime=function(t){if(!this._lockUpdate)if(this._lockUpdate=!0,null!==this._armatureData)if(null!==this._armatureData.parent){var a=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._slotsDirty||this._zIndexDirty){if(this._slots.sort(e._onSortSlots),this._zIndexDirty)for(var i=0,r=this._slots.length;i<r;++i)this._slots[i]._setZOrder(i);this._slotsDirty=!1,this._zIndexDirty=!1}if(this._alphaDirty){this._alphaDirty=!1,this._globalAlpha=this._alpha*(null!==this._parent?this._parent._globalAlpha:1);for(var n=0,s=this._bones;n<s.length;n++)s[n]._updateAlpha();for(var o=0,l=this._slots;o<l.length;o++)(c=l[o])._updateAlpha()}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==a){for(i=0,r=0,i=0,r=this._bones.length;i<r;++i)this._bones[i].update(this._cacheFrameIndex);for(i=0,r=this._slots.length;i<r;++i)this._slots[i].update(this._cacheFrameIndex)}if(this._actions.length>0){for(var h=0,u=this._actions;h<u.length;h++){var _=u[h],f=_.actionData;if(null!==f&&0===f.type)if(null!==_.slot)null!==(d=_.slot.childArmature)&&d.animation.fadeIn(f.name);else if(null!==_.bone)for(var m=0,p=this.getSlots();m<p.length;m++){var c,d;(c=p[m]).parent===_.bone&&null!==(d=c.childArmature)&&d.animation.fadeIn(f.name)}else this._animation.fadeIn(f.name);_.returnToPool()}this._actions.length=0}this._lockUpdate=!1,this._proxy.dbUpdate()}else console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");else console.warn("The armature has been disposed.")},e.prototype.invalidUpdate=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=!1),null!==t&&t.length>0){if(null!==(s=this.getBone(t))&&(s.invalidUpdate(),e))for(var a=0,i=this._slots;a<i.length;a++)(h=i[a]).parent===s&&h.invalidUpdate()}else{for(var r=0,n=this._bones;r<n.length;r++){var s;(s=n[r]).invalidUpdate()}if(e)for(var o=0,l=this._slots;o<l.length;o++){var h;(h=l[o]).invalidUpdate()}}},e.prototype.containsPoint=function(t,e){for(var a=0,i=this._slots;a<i.length;a++){var r=i[a];if(r.containsPoint(t,e))return r}return null},e.prototype.intersectsSegment=function(t,e,a,i,r,n,s){void 0===r&&(r=null),void 0===n&&(n=null),void 0===s&&(s=null);for(var o=t===a,l=0,h=0,u=0,_=0,f=0,m=0,p=0,c=0,d=null,y=null,g=0,D=this._slots;g<D.length;g++){var v=D[g];if(v.intersectsSegment(t,e,a,i,r,n,s)>0){if(null===r&&null===n){d=v;break}var T;null!==r&&((T=o?r.y-e:r.x-t)<0&&(T=-T),(null===d||T<l)&&(l=T,u=r.x,_=r.y,d=v,s&&(p=s.x))),null!==n&&((T=n.x-t)<0&&(T=-T),(null===y||T>h)&&(h=T,f=n.x,m=n.y,y=v,null!==s&&(c=s.y)))}}return null!==d&&null!==r&&(r.x=u,r.y=_,null!==s&&(s.x=p)),null!==y&&null!==n&&(n.x=f,n.y=m,null!==s&&(s.y=c)),d},e.prototype.getBone=function(t){for(var e=0,a=this._bones;e<a.length;e++){var i=a[e];if(i.name===t)return i}return null},e.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return null!==e?e.parent:null},e.prototype.getSlot=function(t){for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];if(i.name===t)return i}return null},e.prototype.getSlotByDisplay=function(t){if(null!==t)for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];if(i.display===t)return i}return null},e.prototype.getBones=function(){return this._bones},e.prototype.getSlots=function(){return this._slots},Object.defineProperty(e.prototype,"flipX",{get:function(){return this._flipX},set:function(t){this._flipX!==t&&(this._flipX=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"flipY",{get:function(){return this._flipY},set:function(t){this._flipY!==t&&(this._flipY=t,this.invalidUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheFrameRate",{get:function(){return this._armatureData.cacheFrameRate},set:function(t){if(this._armatureData.cacheFrameRate!==t){this._armatureData.cacheFrames(t);for(var e=0,a=this._slots;e<a.length;e++){var i=a[e].childArmature;null!==i&&(i.cacheFrameRate=t)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._armatureData.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proxy",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"display",{get:function(){return this._display},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"replacedTexture",{get:function(){return this._replacedTexture},set:function(t){if(this._replacedTexture!==t){null!==this._replaceTextureAtlasData&&(this._replaceTextureAtlasData.returnToPool(),this._replaceTextureAtlasData=null),this._replacedTexture=t;for(var e=0,a=this._slots;e<a.length;e++){var i=a[e];i.invalidUpdate(),i.update(-1)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock!==t){null!==this._clock&&this._clock.remove(this),this._clock=t,this._clock&&this._clock.add(this);for(var e=0,a=this._slots;e<a.length;e++){var i=a[e].childArmature;null!==i&&(i.clock=this._clock)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),e.prototype.getDisplay=function(){return this._display},e}(u.BaseObject),u.Armature=_,function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.globalTransformMatrix=new t.Matrix,a.global=new t.Transform,a.offset=new t.Transform,a}return f(a,e),a.prototype._onClear=function(){this.globalTransformMatrix.identity(),this.global.identity(),this.offset.identity(),this.origin=null,this.userData=null,this._globalDirty=!1,this._alpha=1,this._globalAlpha=1,this._armature=null},a.prototype.updateGlobalTransform=function(){this._globalDirty&&(this._globalDirty=!1,this.global.fromMatrix(this.globalTransformMatrix))},Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),a._helpMatrix=new t.Matrix,a._helpTransform=new t.Transform,a._helpPoint=new t.Point,a}(t.BaseObject);t.TransformObject=e}(l||(l={})),function(t){var e=function(e){function a(){var a=null!==e&&e.apply(this,arguments)||this;return a.animationPose=new t.Transform,a}return f(a,e),a.toString=function(){return"[class dragonBones.Bone]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.offsetMode=1,this.animationPose.identity(),this._transformDirty=!1,this._childrenTransformDirty=!1,this._localDirty=!0,this._hasConstraint=!1,this._visible=!0,this._cachedFrameIndex=-1,this._boneData=null,this._parent=null,this._cachedFrameIndices=null},a.prototype._updateGlobalTransformMatrix=function(e){var a=this._boneData,i=this.global,r=this.globalTransformMatrix,n=this.origin,s=this.offset,o=this.animationPose,l=this._parent,h=this._armature.flipX,u=this._armature.flipY===t.DragonBones.yDown,_=null!==l,f=0;if(1===this.offsetMode?null!==n?(i.x=n.x+s.x+o.x,i.y=n.y+s.y+o.y,i.skew=n.skew+s.skew+o.skew,i.rotation=n.rotation+s.rotation+o.rotation,i.scaleX=n.scaleX*s.scaleX*o.scaleX,i.scaleY=n.scaleY*s.scaleY*o.scaleY):i.copyFrom(s).add(o):0===this.offsetMode?null!==n?i.copyFrom(n).add(o):i.copyFrom(o):(_=!1,i.copyFrom(s)),_){var m=1===l._boneData.type,p=m?l._bone:null,c=m?l._getGlobalTransformMatrix(i.x,i.y):l.globalTransformMatrix;if(!a.inheritScale||m&&null===p){if(a.inheritTranslation){var d=i.x,y=i.y;i.x=c.a*d+c.c*y+c.tx,i.y=c.b*d+c.d*y+c.ty}else h&&(i.x=-i.x),u&&(i.y=-i.y);a.inheritRotation?(l.updateGlobalTransform(),f=l.global.scaleX<0?i.rotation+l.global.rotation+Math.PI:i.rotation+l.global.rotation,c.a*c.d-c.b*c.c<0&&(f-=2*i.rotation,(h!==u||a.inheritReflection)&&(i.skew+=Math.PI)),i.rotation=f):(h||u)&&(h&&u?f=i.rotation+Math.PI:(f=h?Math.PI-i.rotation:-i.rotation,i.skew+=Math.PI),i.rotation=f),i.toMatrix(r)}else m?(a.inheritRotation&&(i.rotation+=l.global.rotation),p.updateGlobalTransform(),i.scaleX*=p.global.scaleX,i.scaleY*=p.global.scaleY,c.transformPoint(i.x,i.y,i),i.toMatrix(r),a.inheritTranslation?(i.x=r.tx,i.y=r.ty):(r.tx=i.x,r.ty=i.y)):(a.inheritRotation||(l.updateGlobalTransform(),f=h&&u?i.rotation-(l.global.rotation+Math.PI):h?i.rotation+l.global.rotation+Math.PI:u?i.rotation+l.global.rotation:i.rotation-l.global.rotation,i.rotation=f),i.toMatrix(r),r.concat(c),a.inheritTranslation?(i.x=r.tx,i.y=r.ty):(r.tx=i.x,r.ty=i.y),e?i.fromMatrix(r):this._globalDirty=!0)}else(h||u)&&(h&&(i.x=-i.x),u&&(i.y=-i.y),h&&u?f=i.rotation+Math.PI:(f=h?Math.PI-i.rotation:-i.rotation,i.skew+=Math.PI),i.rotation=f),i.toMatrix(r)},a.prototype._updateAlpha=function(){null!==this._parent?this._globalAlpha=this._alpha*this._parent._globalAlpha:this._globalAlpha=this._alpha*this._armature._globalAlpha},a.prototype.init=function(t,e){null===this._boneData&&(this._boneData=t,this._armature=e,this._alpha=this._boneData.alpha,null!==this._boneData.parent&&(this._parent=this._armature.getBone(this._boneData.parent.name)),this._armature._addBone(this),this.origin=this._boneData.transform)},a.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDirty=!1;else if(e>=0)this._transformDirty=!0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var a=0,i=this._armature._constraints;a<i.length;a++){(s=i[a])._root===this&&s.update()}this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var r=0,n=this._armature._constraints;r<n.length;r++){var s;(s=n[r])._root===this&&s.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty)if(this._transformDirty=!1,this._childrenTransformDirty=!0,this._cachedFrameIndex<0){var o=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(o),o&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},a.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!1,(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformMatrix(!0),this._transformDirty=!0)},a.prototype.invalidUpdate=function(){this._transformDirty=!0},a.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.parent;return e===this},Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var e=0,a=this._armature.getSlots();e<a.length;e++){var i=a[e];i.parent===this&&i._updateVisible()}}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._boneData.name},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),a}(t.TransformObject);t.Bone=e}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._vertices=[],e._deformVertices=[],e._hullCache=[],e._matrixCahce=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.Surface]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._dX=0,this._dY=0,this._k=0,this._kX=0,this._kY=0,this._vertices.length=0,this._deformVertices.length=0,this._matrixCahce.length=0,this._hullCache.length=0,this._bone=null},e.prototype._getAffineTransform=function(t,e,a,i,r,n,s,o,l,h,u,_,f){var m=s-r,p=o-n,c=l-r,d=h-n;u.rotation=Math.atan2(p,m),u.skew=Math.atan2(d,c)-.5*Math.PI-u.rotation,f&&(u.rotation+=Math.PI),u.scaleX=Math.sqrt(m*m+p*p)/a,u.scaleY=Math.sqrt(c*c+d*d)/i,u.toMatrix(_),u.x=_.tx=r-(_.a*t+_.c*e),u.y=_.ty=n-(_.b*t+_.d*e)},e.prototype._updateVertices=function(){var t=this._armature.armatureData.parent,e=this._boneData.geometry,a=t.intArray,i=t.floatArray,r=a[e.offset+0],n=a[e.offset+2],s=this._vertices,o=this._deformVertices;if(null!==this._parent)if(1===this._parent._boneData.type)for(var l=0,h=r;l<h;++l){var u=i[n+(p=2*l)]+o[p],_=i[n+p+1]+o[p+1],f=this._parent._getGlobalTransformMatrix(u,_);s[p]=f.a*u+f.c*_+f.tx,s[p+1]=f.b*u+f.d*_+f.ty}else{var m=this._parent.globalTransformMatrix;for(l=0,h=r;l<h;++l){u=i[n+(p=2*l)]+o[p],_=i[n+p+1]+o[p+1];s[p]=m.a*u+m.c*_+m.tx,s[p+1]=m.b*u+m.d*_+m.ty}}else for(l=0,h=r;l<h;++l){var p;s[p=2*l]=i[n+p]+o[p],s[p+1]=i[n+p+1]+o[p+1]}},e.prototype._updateGlobalTransformMatrix=function(t){var e=2*this._boneData.segmentX,a=this._vertices.length-2,i=this._vertices[0],r=this._vertices[1],n=this._vertices[e],s=this._vertices[e+1],o=this._vertices[a],l=this._vertices[a+1],h=this._vertices[a-e],u=this._vertices[a-e+1],_=i+.5*(o-i),f=r+.5*(l-r),m=_+.5*(n+.5*(h-n)-_),p=f+.5*(s+.5*(u-s)-f),c=n+.5*(o-n),d=s+.5*(l-s),y=h+.5*(o-h),g=u+.5*(l-u);this._getAffineTransform(0,0,200,200,m,p,c,d,y,g,this.global,this.globalTransformMatrix,!1),this._globalDirty=!1},e.prototype._getGlobalTransformMatrix=function(t,a){var i=200,r=1e3;if(t<-r||r<t||a<-r||r<a)return this.globalTransformMatrix;var n=!1,s=this._boneData,o=s.segmentX,l=s.segmentY,h=2*s.segmentX,u=this._dX,_=this._dY,f=Math.floor((t+i)/u),m=Math.floor((a+i)/_),p=0,c=f*u-i,d=m*_-i,y=this._matrixCahce,g=e._helpMatrix;if(t<-i){if(a<-i||a>=i)return this.globalTransformMatrix;if(y[p=7*(2*(o*l+o+l+l+m)+((n=a>this._kX*(t+i)+d)?1:0))]>0)g.copyFromArray(y,p+1);else{var D=m*(h+2),v=this._hullCache[4],T=this._hullCache[5],b=this._hullCache[2]-(l-m)*v,A=this._hullCache[3]-(l-m)*T,P=this._vertices;n?this._getAffineTransform(-i,d+_,800,_,P[D+h+2],P[D+h+3],b+v,A+T,P[D],P[D+1],e._helpTransform,g,!0):this._getAffineTransform(-r,d,800,_,b,A,P[D],P[D+1],b+v,A+T,e._helpTransform,g,!1),y[p]=1,y[p+1]=g.a,y[p+2]=g.b,y[p+3]=g.c,y[p+4]=g.d,y[p+5]=g.tx,y[p+6]=g.ty}}else if(t>=i){if(a<-i||a>=i)return this.globalTransformMatrix;if(y[p=7*(2*(o*l+o+m)+((n=a>this._kX*(t-r)+d)?1:0))]>0)g.copyFromArray(y,p+1);else{D=(m+1)*(h+2)-2,v=this._hullCache[4],T=this._hullCache[5],b=this._hullCache[0]+m*v,A=this._hullCache[1]+m*T,P=this._vertices;n?this._getAffineTransform(r,d+_,800,_,b+v,A+T,P[D+h+2],P[D+h+3],b,A,e._helpTransform,g,!0):this._getAffineTransform(i,d,800,_,P[D],P[D+1],b,A,P[D+h+2],P[D+h+3],e._helpTransform,g,!1),y[p]=1,y[p+1]=g.a,y[p+2]=g.b,y[p+3]=g.c,y[p+4]=g.d,y[p+5]=g.tx,y[p+6]=g.ty}}else if(a<-i){if(t<-i||t>=i)return this.globalTransformMatrix;if(y[p=7*(2*(o*l+f)+((n=a>this._kY*(t-c-u)-r)?1:0))]>0)g.copyFromArray(y,p+1);else{D=2*f,v=this._hullCache[10],T=this._hullCache[11],b=this._hullCache[8]+f*v,A=this._hullCache[9]+f*T,P=this._vertices;n?this._getAffineTransform(c+u,-i,u,800,P[D+2],P[D+3],P[D],P[D+1],b+v,A+T,e._helpTransform,g,!0):this._getAffineTransform(c,-r,u,800,b,A,b+v,A+T,P[D],P[D+1],e._helpTransform,g,!1),y[p]=1,y[p+1]=g.a,y[p+2]=g.b,y[p+3]=g.c,y[p+4]=g.d,y[p+5]=g.tx,y[p+6]=g.ty}}else if(a>=i){if(t<-i||t>=i)return this.globalTransformMatrix;if(y[p=7*(2*(o*l+o+l+f)+((n=a>this._kY*(t-c-u)+i)?1:0))]>0)g.copyFromArray(y,p+1);else{D=l*(h+2)+2*f,v=this._hullCache[10],T=this._hullCache[11],b=this._hullCache[6]-(o-f)*v,A=this._hullCache[7]-(o-f)*T,P=this._vertices;n?this._getAffineTransform(c+u,r,u,800,b+v,A+T,b,A,P[D+2],P[D+3],e._helpTransform,g,!0):this._getAffineTransform(c,i,u,800,P[D],P[D+1],P[D+2],P[D+3],b,A,e._helpTransform,g,!1),y[p]=1,y[p+1]=g.a,y[p+2]=g.b,y[p+3]=g.c,y[p+4]=g.d,y[p+5]=g.tx,y[p+6]=g.ty}}else if(y[p=7*(2*(o*m+f)+((n=a>this._k*(t-c-u)+d)?1:0))]>0)g.copyFromArray(y,p+1);else{D=2*f+m*(h+2),P=this._vertices;n?this._getAffineTransform(c+u,d+_,u,_,P[D+h+4],P[D+h+5],P[D+h+2],P[D+h+3],P[D+2],P[D+3],e._helpTransform,g,!0):this._getAffineTransform(c,d,u,_,P[D],P[D+1],P[D+2],P[D+3],P[D+h+2],P[D+h+3],e._helpTransform,g,!1),y[p]=1,y[p+1]=g.a,y[p+2]=g.b,y[p+3]=g.c,y[p+4]=g.d,y[p+5]=g.tx,y[p+6]=g.ty}return g},e.prototype.init=function(e,a){if(null===this._boneData){t.prototype.init.call(this,e,a);var i=e.segmentX,r=e.segmentY,n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];this._dX=400/i,this._dY=400/r,this._k=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-800/this._dX,this._vertices.length=2*n,this._deformVertices.length=2*n,this._matrixCahce.length=2*(i*r+2*i+2*r)*7,this._hullCache.length=10;for(var s=0;s<2*n;++s)this._deformVertices[s]=0;null!==this._parent&&(0===this._parent.boneData.type?this._bone=this._parent:this._bone=this._parent._bone)}},e.prototype.update=function(t){if(t>=0&&null!==this._cachedFrameIndices){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a)this._transformDirty=!1;else if(a>=0)this._transformDirty=!0,this._cachedFrameIndex=a;else{if(this._hasConstraint)for(var i=0,r=this._armature._constraints;i<r.length;i++){(o=r[i])._root===this&&o.update()}this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}}else{if(this._hasConstraint)for(var n=0,s=this._armature._constraints;n<s.length;n++){var o;(o=s[n])._root===this&&o.update()}(this._transformDirty||null!==this._parent&&this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1)}if(this._transformDirty){this._transformDirty=!1,this._childrenTransformDirty=!0;for(var l=0,h=this._matrixCahce.length;l<h;l+=7)this._matrixCahce[l]=-1;if(this._updateVertices(),this._cachedFrameIndex<0){var u=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(u),u&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);var _=2*this.global.x,f=2*this.global.y,m=e._helpPoint;this.globalTransformMatrix.transformPoint(1e3,-200,m),this._hullCache[0]=m.x,this._hullCache[1]=m.y,this._hullCache[2]=_-m.x,this._hullCache[3]=f-m.y,this.globalTransformMatrix.transformPoint(0,this._dY,m,!0),this._hullCache[4]=m.x,this._hullCache[5]=m.y,this.globalTransformMatrix.transformPoint(200,1e3,m),this._hullCache[6]=m.x,this._hullCache[7]=m.y,this._hullCache[8]=_-m.x,this._hullCache[9]=f-m.y,this.globalTransformMatrix.transformPoint(this._dX,0,m,!0),this._hullCache[10]=m.x,this._hullCache[11]=m.y}else this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!0},e}(t.Bone);t.Surface=e}(l||(l={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deformVertices=[],e}return f(e,t),e.toString=function(){return"[class dragonBones.DisplayFrame]"},e.prototype._onClear=function(){this.rawDisplayData=null,this.displayData=null,this.textureData=null,this.display=null,this.deformVertices.length=0},e.prototype.updateDeformVertices=function(){if(null!==this.rawDisplayData&&0===this.deformVertices.length){var t;if(2===this.rawDisplayData.type)t=this.rawDisplayData.geometry;else{if(4!==this.rawDisplayData.type)return;t=this.rawDisplayData.geometry}var e=0;e=null!==t.weight?2*t.weight.count:2*t.data.intArray[t.offset+0],this.deformVertices.length=e;for(var a=0,i=this.deformVertices.length;a<i;++a)this.deformVertices[a]=0}},e.prototype.getGeometryData=function(){if(null!==this.displayData){if(2===this.displayData.type)return this.displayData.geometry;if(4===this.displayData.type)return this.displayData.geometry}if(null!==this.rawDisplayData){if(2===this.rawDisplayData.type)return this.rawDisplayData.geometry;if(4===this.rawDisplayData.type)return this.rawDisplayData.geometry}return null},e.prototype.getBoundingBox=function(){return null!==this.displayData&&3===this.displayData.type?this.displayData.boundingBox:null!==this.rawDisplayData&&3===this.rawDisplayData.type?this.rawDisplayData.boundingBox:null},e.prototype.getTextureData=function(){if(null!==this.displayData){if(0===this.displayData.type)return this.displayData.texture;if(2===this.displayData.type)return this.displayData.texture}if(null!==this.textureData)return this.textureData;if(null!==this.rawDisplayData){if(0===this.rawDisplayData.type)return this.rawDisplayData.texture;if(2===this.rawDisplayData.type)return this.rawDisplayData.texture}return null},e}(t.BaseObject);t.DisplayFrame=e;var a=function(a){function i(){var e=null!==a&&a.apply(this,arguments)||this;return e._localMatrix=new t.Matrix,e._colorTransform=new t.ColorTransform,e._displayFrames=[],e._geometryBones=[],e._rawDisplay=null,e._meshDisplay=null,e._display=null,e}return f(i,a),i.prototype._onClear=function(){a.prototype._onClear.call(this);for(var e=[],i=0,r=this._displayFrames;i<r.length;i++){var n=r[i],s=n.display;s!==this._rawDisplay&&s!==this._meshDisplay&&e.indexOf(s)<0&&e.push(s),n.returnToPool()}for(var o=0,l=e;o<l.length;o++){var h=l[o];h instanceof t.Armature?h.dispose():this._disposeDisplay(h,!0)}null!==this._meshDisplay&&this._meshDisplay!==this._rawDisplay&&this._disposeDisplay(this._meshDisplay,!1),null!==this._rawDisplay&&this._disposeDisplay(this._rawDisplay,!1),this.displayController=null,this._displayDataDirty=!1,this._displayDirty=!1,this._geometryDirty=!1,this._textureDirty=!1,this._visibleDirty=!1,this._blendModeDirty=!1,this._zOrderDirty=!1,this._colorDirty=!1,this._verticesDirty=!1,this._transformDirty=!1,this._visible=!0,this._blendMode=0,this._displayIndex=-1,this._animationDisplayIndex=-1,this._zOrder=0,this._zIndex=0,this._cachedFrameIndex=-1,this._pivotX=0,this._pivotY=0,this._localMatrix.identity(),this._colorTransform.identity(),this._displayFrames.length=0,this._geometryBones.length=0,this._slotData=null,this._displayFrame=null,this._geometryData=null,this._boundingBoxData=null,this._textureData=null,this._rawDisplay=null,this._meshDisplay=null,this._display=null,this._childArmature=null,this._parent=null,this._cachedFrameIndices=null},i.prototype._hasDisplay=function(t){for(var e=0,a=this._displayFrames;e<a.length;e++){if(a[e].display===t)return!0}return!1},i.prototype._isBonesUpdate=function(){for(var t=0,e=this._geometryBones;t<e.length;t++){var a=e[t];if(null!==a&&a._childrenTransformDirty)return!0}return!1},i.prototype._updateAlpha=function(){var t=this._alpha*this._parent._globalAlpha;this._globalAlpha!==t&&(this._globalAlpha=t,this._colorDirty=!0)},i.prototype._updateDisplayData=function(){var e=this._displayFrame,a=this._geometryData,r=this._textureData,n=null,s=null;if(this._displayFrame=null,this._geometryData=null,this._boundingBoxData=null,this._textureData=null,this._displayIndex>=0&&this._displayIndex<this._displayFrames.length&&(this._displayFrame=this._displayFrames[this._displayIndex],n=this._displayFrame.rawDisplayData,s=this._displayFrame.displayData,this._geometryData=this._displayFrame.getGeometryData(),this._boundingBoxData=this._displayFrame.getBoundingBox(),this._textureData=this._displayFrame.getTextureData()),this._displayFrame!==e||this._geometryData!==a||this._textureData!==r){if(null===this._geometryData&&null!==this._textureData){var o=null!==s&&0===s.type?s:n,l=this._textureData.parent.scale*this._armature._armatureData.scale,h=this._textureData.frame;this._pivotX=o.pivot.x,this._pivotY=o.pivot.y;var u=null!==h?h:this._textureData.region,_=u.width,f=u.height;this._textureData.rotated&&null===h&&(_=u.height,f=u.width),this._pivotX*=_*l,this._pivotY*=f*l,null!==h&&(this._pivotX+=h.x*l,this._pivotY+=h.y*l),null!==n&&o!==n&&(n.transform.toMatrix(i._helpMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX-=i._helpPoint.x,this._pivotY-=i._helpPoint.y,o.transform.toMatrix(i._helpMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX+=i._helpPoint.x,this._pivotY+=i._helpPoint.y),t.DragonBones.yDown||(this._pivotY=(this._textureData.rotated?this._textureData.region.width:this._textureData.region.height)*l-this._pivotY)}else this._pivotX=0,this._pivotY=0;if(this.origin=null!==n?n.transform:null!==s?s.transform:null,null!==this.origin?this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix):this.global.copyFrom(this.offset).toMatrix(this._localMatrix),this._geometryData!==a)if(this._geometryDirty=!0,this._verticesDirty=!0,null!==this._geometryData){if(this._geometryBones.length=0,null!==this._geometryData.weight)for(var m=0,p=this._geometryData.weight.bones.length;m<p;++m){var c=this._armature.getBone(this._geometryData.weight.bones[m].name);this._geometryBones.push(c)}}else this._geometryBones.length=0,this._geometryData=null;this._textureDirty=this._textureData!==r,this._transformDirty=!0}},i.prototype._updateDisplay=function(){var e=null!==this._display?this._display:this._rawDisplay,a=this._childArmature;if(null!==this._displayFrame?(this._display=this._displayFrame.display,null!==this._display&&this._display instanceof t.Armature?(this._childArmature=this._display,this._display=this._childArmature.display):this._childArmature=null):(this._display=null,this._childArmature=null),(null!==this._display?this._display:this._rawDisplay)!==e&&(this._textureDirty=!0,this._visibleDirty=!0,this._blendModeDirty=!0,this._colorDirty=!0,this._transformDirty=!0,this._onUpdateDisplay(),this._replaceDisplay(e)),this._childArmature!==a&&(null!==a&&(a._parent=null,a.clock=null,a.inheritAnimation&&a.animation.reset()),null!==this._childArmature&&(this._childArmature._parent=this,this._childArmature.clock=this._armature.clock,this._childArmature.inheritAnimation))){if(0===this._childArmature.cacheFrameRate){var i=this._armature.cacheFrameRate;0!==i&&(this._childArmature.cacheFrameRate=i)}if(null!==this._displayFrame){var r=null,n=null!==this._displayFrame.displayData?this._displayFrame.displayData:this._displayFrame.rawDisplayData;if(null!==n&&1===n.type&&(r=n.actions),null!==r&&r.length>0)for(var s=0,o=r;s<o.length;s++){var l=o[s],h=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(l,h,this._armature),h.slot=this,this._armature._bufferAction(h,!1)}else this._childArmature.animation.play()}}},i.prototype._updateGlobalTransformMatrix=function(t){var e=0===this._parent._boneData.type?this._parent.globalTransformMatrix:this._parent._getGlobalTransformMatrix(this.global.x,this.global.y);this.globalTransformMatrix.copyFrom(this._localMatrix),this.globalTransformMatrix.concat(e),t?this.global.fromMatrix(this.globalTransformMatrix):this._globalDirty=!0},i.prototype._setDisplayIndex=function(t,e){if(void 0===e&&(e=!1),e){if(this._animationDisplayIndex===t)return;this._animationDisplayIndex=t}this._displayIndex!==t&&(this._displayIndex=t<this._displayFrames.length?t:this._displayFrames.length-1,this._displayDataDirty=!0,this._displayDirty=this._displayIndex<0||this._display!==this._displayFrames[this._displayIndex].display)},i.prototype._setZOrder=function(t){return this._zOrder,this._zOrder=t,this._zOrderDirty=!0,this._zOrderDirty},i.prototype._setColor=function(t){return this._colorTransform.copyFrom(t),this._colorDirty=!0},i.prototype.init=function(t,e,a,i){if(null===this._slotData){this._slotData=t,this._colorDirty=!0,this._blendModeDirty=!0,this._blendMode=this._slotData.blendMode,this._zOrder=this._slotData.zOrder,this._zIndex=this._slotData.zIndex,this._alpha=this._slotData.alpha,this._colorTransform.copyFrom(this._slotData.color),this._rawDisplay=a,this._meshDisplay=i,this._armature=e;var r=this._armature.getBone(this._slotData.parent.name);null!==r&&(this._parent=r),this._armature._addSlot(this),this._initDisplay(this._rawDisplay,!1),this._rawDisplay!==this._meshDisplay&&this._initDisplay(this._meshDisplay,!1),this._onUpdateDisplay(),this._addDisplay()}},i.prototype.update=function(t){if(this._displayDataDirty&&(this._updateDisplayData(),this._displayDataDirty=!1),this._displayDirty&&(this._updateDisplay(),this._displayDirty=!1),(this._geometryDirty||this._textureDirty)&&(null!==this._display&&this._display!==this._rawDisplay&&this._display!==this._meshDisplay||this._updateFrame(),this._geometryDirty=!1,this._textureDirty=!1),null!==this._display){if(this._visibleDirty&&(this._updateVisible(),this._visibleDirty=!1),this._blendModeDirty&&(this._updateBlendMode(),this._blendModeDirty=!1),this._colorDirty&&(this._updateColor(),this._colorDirty=!1),this._zOrderDirty&&(this._updateZOrder(),this._zOrderDirty=!1),null!==this._geometryData&&this._display===this._meshDisplay){var e=null!==this._geometryData.weight,a=0!==this._parent._boneData.type;if((this._verticesDirty||e&&this._isBonesUpdate()||a&&this._parent._childrenTransformDirty)&&(this._updateMesh(),this._verticesDirty=!1),e||a)return}if(t>=0&&null!==this._cachedFrameIndices){var i=this._cachedFrameIndices[t];i>=0&&this._cachedFrameIndex===i?this._transformDirty=!1:i>=0?(this._transformDirty=!0,this._cachedFrameIndex=i):this._transformDirty||this._parent._childrenTransformDirty?(this._transformDirty=!0,this._cachedFrameIndex=-1):this._cachedFrameIndex>=0?(this._transformDirty=!1,this._cachedFrameIndices[t]=this._cachedFrameIndex):(this._transformDirty=!0,this._cachedFrameIndex=-1)}else(this._transformDirty||this._parent._childrenTransformDirty)&&(t=-1,this._transformDirty=!0,this._cachedFrameIndex=-1);if(this._transformDirty){if(this._cachedFrameIndex<0){var r=t>=0;this._updateGlobalTransformMatrix(r),r&&null!==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}else this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex);this._updateTransform(),this._transformDirty=!1}}},i.prototype.invalidUpdate=function(){this._displayDataDirty=!0,this._displayDirty=!0,this._transformDirty=!0},i.prototype.updateTransformAndMatrix=function(){this._transformDirty&&(this._updateGlobalTransformMatrix(!1),this._transformDirty=!1)},i.prototype.replaceRawDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];if(a.rawDisplayData!==t){if(a.deformVertices.length=0,a.rawDisplayData=t,null===a.rawDisplayData){var i=this._armature._armatureData.defaultSkin;if(null!==i){var r=i.getDisplays(this._slotData.name);null!==r&&e<r.length&&(a.rawDisplayData=r[e])}}e===this._displayIndex&&(this._displayDataDirty=!0)}},i.prototype.replaceDisplayData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];a.displayData!==t&&a.rawDisplayData!==t&&(a.displayData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},i.prototype.replaceTextureData=function(t,e){if(void 0===e&&(e=-1),e<0)e=this._displayIndex<0?0:this._displayIndex;else if(e>=this._displayFrames.length)return;var a=this._displayFrames[e];a.textureData!==t&&(a.textureData=t,e===this._displayIndex&&(this._displayDataDirty=!0))},i.prototype.replaceDisplay=function(e,a){if(void 0===a&&(a=-1),a<0)a=this._displayIndex<0?0:this._displayIndex;else if(a>=this._displayFrames.length)return;var i=this._displayFrames[a];if(i.display!==e){var r=i.display;i.display=e,null===r||r===this._rawDisplay||r===this._meshDisplay||this._hasDisplay(r)||r instanceof t.Armature||this._disposeDisplay(r,!0),null===e||e===this._rawDisplay||e===this._meshDisplay||this._hasDisplay(r)||e instanceof t.Armature||this._initDisplay(e,!0),a===this._displayIndex&&(this._displayDirty=!0)}},i.prototype.containsPoint=function(t,e){return null!==this._boundingBoxData&&(this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(t,e,i._helpPoint),this._boundingBoxData.containsPoint(i._helpPoint.x,i._helpPoint.y))},i.prototype.intersectsSegment=function(t,e,a,r,n,s,o){if(void 0===n&&(n=null),void 0===s&&(s=null),void 0===o&&(o=null),null===this._boundingBoxData)return 0;this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix),i._helpMatrix.invert(),i._helpMatrix.transformPoint(t,e,i._helpPoint),t=i._helpPoint.x,e=i._helpPoint.y,i._helpMatrix.transformPoint(a,r,i._helpPoint),a=i._helpPoint.x,r=i._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,r,n,s,o);return l>0&&(1===l||2===l?null!==n?(this.globalTransformMatrix.transformPoint(n.x,n.y,n),null!==s&&(s.x=n.x,s.y=n.y)):null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s):(null!==n&&this.globalTransformMatrix.transformPoint(n.x,n.y,n),null!==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s)),null!==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),i._helpPoint,!0),o.x=Math.atan2(i._helpPoint.y,i._helpPoint.x),this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),i._helpPoint,!0),o.y=Math.atan2(i._helpPoint.y,i._helpPoint.x))),l},i.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]},Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._updateVisible())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var i=this._displayFrames.length;if(i<a){this._displayFrames.length=a;for(var r=i;r<a;++r)this._displayFrames[r]=t.BaseObject.borrowObject(e)}else if(i>a){for(r=i-1;r<a;--r)this.replaceDisplay(null,r),this._displayFrames[r].returnToPool();this._displayFrames.length=a}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){this._setDisplayIndex(t),this.update(-1)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"name",{get:function(){return this._slotData.name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayList",{get:function(){for(var t=new Array,e=0,a=this._displayFrames;e<a.length;e++){var i=a[e];t.push(i.display)}return t},set:function(t){this.displayFrameCount=t.length;for(var e=0,a=0,i=t;a<i.length;a++){var r=i[a];this.replaceDisplay(r,e++)}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"slotData",{get:function(){return this._slotData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"boundingBoxData",{get:function(){return this._boundingBoxData},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rawDisplay",{get:function(){return this._rawDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"meshDisplay",{get:function(){return this._meshDisplay},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"display",{get:function(){return this._display},set:function(t){this._display!==t&&(0===this._displayFrames.length&&(this.displayFrameCount=1,this._displayIndex=0),this.replaceDisplay(t,this._displayIndex))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"childArmature",{get:function(){return this._childArmature},set:function(t){this._childArmature!==t&&(this.display=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),i.prototype.getDisplay=function(){return this._display},i.prototype.setDisplay=function(t){this.display=t},i}(t.TransformObject);t.Slot=a}(l||(l={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.prototype._onClear=function(){this._armature=null,this._target=null,this._root=null,this._bone=null},Object.defineProperty(a.prototype,"name",{get:function(){return this._constraintData.name},enumerable:!0,configurable:!0}),a._helpMatrix=new t.Matrix,a._helpTransform=new t.Transform,a._helpPoint=new t.Point,a}(t.BaseObject);t.Constraint=e;var a=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.toString=function(){return"[class dragonBones.IKConstraint]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this._scaleEnabled=!1,this._bendPositive=!1,this._weight=1,this._constraintData=null},a.prototype._computeA=function(){var e=this._target.global,a=this._root.global,i=this._root.globalTransformMatrix,r=Math.atan2(e.y-a.y,e.x-a.x);a.scaleX<0&&(r+=Math.PI),a.rotation+=t.Transform.normalizeRadian(r-a.rotation)*this._weight,a.toMatrix(i)},a.prototype._computeB=function(){var e=this._bone._boneData.length,a=this._root,i=this._target.global,r=a.global,n=this._bone.global,s=this._bone.globalTransformMatrix,o=s.a*e,l=s.b*e,h=o*o+l*l,u=Math.sqrt(h),_=n.x-r.x,f=n.y-r.y,m=_*_+f*f,p=Math.sqrt(m),c=n.rotation,d=r.rotation,y=Math.atan2(f,_),g=(_=i.x-r.x)*_+(f=i.y-r.y)*f,D=Math.sqrt(g),v=0;if(u+p<=D||D+u<=p||D+p<=u)v=Math.atan2(i.y-r.y,i.x-r.x),u+p<=D||p<u&&(v+=Math.PI);else{var T=(m-h+g)/(2*g),b=Math.sqrt(m-T*T*g)/D,A=r.x+_*T,P=r.y+f*T,S=-f*b,O=_*b,x=!1,E=a.parent;if(null!==E){var M=E.globalTransformMatrix;x=M.a*M.d-M.b*M.c<0}x!==this._bendPositive?(n.x=A-S,n.y=P-O):(n.x=A+S,n.y=P+O),v=Math.atan2(n.y-r.y,n.x-r.x)}var B=t.Transform.normalizeRadian(v-y);r.rotation=d+B*this._weight,r.toMatrix(a.globalTransformMatrix);var I=y+B*this._weight;n.x=r.x+Math.cos(I)*p,n.y=r.y+Math.sin(I)*p;var F=Math.atan2(i.y-n.y,i.x-n.x);n.scaleX<0&&(F+=Math.PI),n.rotation=r.rotation+c-d+t.Transform.normalizeRadian(F-B-c)*this._weight,n.toMatrix(s)},a.prototype.init=function(t,e){if(null===this._constraintData){this._constraintData=t,this._armature=e,this._target=this._armature.getBone(this._constraintData.target.name),this._root=this._armature.getBone(this._constraintData.root.name),this._bone=null!==this._constraintData.bone?this._armature.getBone(this._constraintData.bone.name):null;var a=this._constraintData;this._scaleEnabled=a.scaleEnabled,this._bendPositive=a.bendPositive,this._weight=a.weight,this._root._hasConstraint=!0}},a.prototype.update=function(){this._root.updateByConstraint(),null!==this._bone?(this._bone.updateByConstraint(),this._computeB()):this._computeA()},a.prototype.invalidUpdate=function(){this._root.invalidUpdate(),null!==this._bone&&this._bone.invalidUpdate()},a}(e);t.IKConstraint=a;var i=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t._bones=[],t._spaces=[],t._positions=[],t._curves=[],t._boneLengths=[],t._pathGlobalVertices=[],t._segments=[10],t}return f(a,e),a.toString=function(){return"[class dragonBones.PathConstraint]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this.dirty=!1,this.pathOffset=0,this.position=0,this.spacing=0,this.rotateOffset=0,this.rotateMix=1,this.translateMix=1,this._pathSlot=null,this._bones.length=0,this._spaces.length=0,this._positions.length=0,this._curves.length=0,this._boneLengths.length=0,this._pathGlobalVertices.length=0},a.prototype._updatePathVertices=function(t){var e=this._armature,a=e.armatureData.parent,i=e.armatureData.scale,r=a.intArray,n=a.floatArray,s=t.offset,o=r[s+0],l=r[s+2];this._pathGlobalVertices.length=2*o;var h=t.weight;if(null!==h)for(var u=this._pathSlot._geometryBones,_=h.bones.length,f=h.offset,m=r[f+1],p=f+2+_,c=(P=0,0);P<o;P++){for(var d=0,y=0,g=0,D=r[p++];g<D;g++){var v=u[r[p++]];if(null!==v){v.updateByConstraint();A=v.globalTransformMatrix;var T=n[m++];O=n[m++]*i,x=n[m++]*i;d+=(A.a*O+A.c*x+A.tx)*T,y+=(A.b*O+A.d*x+A.ty)*T}}this._pathGlobalVertices[c++]=d,this._pathGlobalVertices[c++]=y}else{var b=this._pathSlot.parent;b.updateByConstraint();for(var A=b.globalTransformMatrix,P=0,S=l;P<o;P+=2){var O=n[S++]*i,x=n[S++]*i,E=A.a*O+A.c*x+A.tx,M=A.b*O+A.d*x+A.ty;this._pathGlobalVertices[P]=E,this._pathGlobalVertices[P+1]=M}}},a.prototype._computeVertices=function(t,e,a,i){for(var r=a,n=t;r<e;r+=2)i[r]=this._pathGlobalVertices[n++],i[r+1]=this._pathGlobalVertices[n++]},a.prototype._computeBezierCurve=function(t,e,a,i,r){var n=this._armature.armatureData.parent.intArray[t.geometry.offset+0],s=this._positions,o=this._spaces,l=t.closed,h=Array(),u=2*n,_=u/6,f=-1,m=this.position;s.length=3*e+2;var p=0;if(t.constantSpeed){l?(u+=2,h.length=n,this._computeVertices(2,u-4,0,h),this._computeVertices(0,2,u-4,h),h[u-2]=h[0],h[u-1]=h[1]):(_--,u-=4,h.length=u,this._computeVertices(2,u,0,h));var c=new Array(_);p=0;for(var d,y,g,D,v,T,b,A,P=h[0],S=h[1],O=0,x=0,E=0,M=0,B=0,I=0,F=(U=0,2);U<_;U++,F+=6)O=h[F],x=h[F+1],E=h[F+2],M=h[F+3],v=2*(d=.1875*(P-2*O+E))+(g=.09375*(3*(O-E)-P+(B=h[F+4]))),T=2*(y=.1875*(S-2*x+M))+(D=.09375*(3*(x-M)-S+(I=h[F+5]))),b=.75*(O-P)+d+.16666667*g,A=.75*(x-S)+y+.16666667*D,p+=Math.sqrt(b*b+A*A),b+=v,A+=T,v+=g,T+=D,p+=Math.sqrt(b*b+A*A),b+=v,A+=T,p+=Math.sqrt(b*b+A*A),b+=v+g,A+=T+D,p+=Math.sqrt(b*b+A*A),c[U]=p,P=B,S=I;if(i&&(m*=p),r)for(U=0;U<e;U++)o[U]*=p;for(var C=this._segments,w=0,N=(U=0,X=0,G=0,0);U<e;U++,X+=3){var R=m+=o[U];if(l)(R%=p)<0&&(R+=p),G=0;else{if(R<0)continue;if(R>p)continue}for(;;G++){var j=c[G];if(!(R>j)){if(0===G)R/=j;else R=(R-(V=c[G-1]))/(j-V);break}}if(G!==f){f=G;var k=6*G;for(P=h[k],S=h[k+1],O=h[k+2],x=h[k+3],E=h[k+4],M=h[k+5],v=2*(d=.03*(P-2*O+E))+(g=.006*(3*(O-E)-P+(B=h[k+6]))),T=2*(y=.03*(S-2*x+M))+(D=.006*(3*(x-M)-S+(I=h[k+7]))),b=.3*(O-P)+d+.16666667*g,A=.3*(x-S)+y+.16666667*D,w=Math.sqrt(b*b+A*A),C[0]=w,k=1;k<8;k++)b+=v,A+=T,v+=g,T+=D,w+=Math.sqrt(b*b+A*A),C[k]=w;b+=v,A+=T,w+=Math.sqrt(b*b+A*A),C[8]=w,b+=v+g,A+=T+D,w+=Math.sqrt(b*b+A*A),C[9]=w,N=0}for(R*=w;;N++){var L=C[N];if(!(R>L)){var V;if(0===N)R/=L;else R=N+(R-(V=C[N-1]))/(L-V);break}}this.addCurvePosition(.1*R,P,S,O,x,E,M,B,I,s,X,a)}}else{var Y=t.curveLengths;if(p=Y[_-=l?1:2],i&&(m*=p),r)for(var U=0;U<e;U++)o[U]*=p;h.length=8;for(var U=0,X=0,G=0;U<e;U++,X+=3){if(m+=o[U],l)(m%=p)<0&&(m+=p),G=0;else{if(m<0)continue;if(m>p)continue}for(var H=0;;G++){var z=Y[G];if(!(m>z)){if(0===G)H=m/z;else{var W=Y[G-1];H=(m-W)/(z-W)}break}}G!==f&&(f=G,l&&G===_?(this._computeVertices(u-4,4,0,h),this._computeVertices(0,4,4,h)):this._computeVertices(6*G+2,8,0,h)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],s,X,a)}}},a.prototype.addCurvePosition=function(t,e,a,i,r,n,s,o,l,h,u,_){if(0===t)return h[u]=e,h[u+1]=a,void(h[u+2]=0);if(1===t)return h[u]=o,h[u+1]=l,void(h[u+2]=0);var f=1-t,m=f*f,p=t*t,c=m*f,d=m*t*3,y=f*p*3,g=t*p,D=c*e+d*i+y*n+g*o,v=c*a+d*r+y*s+g*l;h[u]=D,h[u+1]=v,h[u+2]=_?Math.atan2(v-(c*a+d*r+y*s),D-(c*e+d*i+y*n)):0},a.prototype.init=function(t,e){this._constraintData=t,this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset,this.position=a.position,this.spacing=a.spacing,this.rotateOffset=a.rotateOffset,this.rotateMix=a.rotateMix,this.translateMix=a.translateMix,this._root=this._armature.getBone(a.root.name),this._target=this._armature.getBone(a.target.name),this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var i=0,r=a.bones.length;i<r;i++){var n=this._armature.getBone(a.bones[i].name);null!==n&&this._bones.push(n)}2===a.rotateMode&&(this._boneLengths.length=this._bones.length),this._root._hasConstraint=!0},a.prototype.update=function(){var e=this._pathSlot;if(null!==e._geometryData&&e._geometryData.offset===this.pathOffset){var a=this._constraintData,i=!1;if(this._root._childrenTransformDirty?(this._updatePathVertices(e._geometryData),i=!0):(e._verticesDirty||e._isBonesUpdate())&&(this._updatePathVertices(e._geometryData),e._verticesDirty=!1,i=!0),i||this.dirty){var r=a.positionMode,n=a.spacingMode,s=a.rotateMode,o=this._bones,l=0===n,h=2===s,u=0===s,_=o.length,f=u?_:_+1,m=this.spacing,p=this._spaces;if(p.length=f,h||l){p[0]=0;for(var c=0,d=f-1;c<d;c++){(M=o[c]).updateByConstraint();var y=M._boneData.length,g=y*(B=M.globalTransformMatrix).a,D=y*B.b,v=Math.sqrt(g*g+D*D);h&&(this._boneLengths[c]=v),p[c+1]=(y+m)*v/y}}else for(c=0;c<f;c++)p[c]=m;this._computeBezierCurve(e._displayFrame.rawDisplayData,f,u,1===r,2===n);var T,b=this._positions,A=this.rotateOffset,P=b[0],S=b[1];if(0===A)T=1===s;else if(T=!1,null!==(M=e.parent))A*=(B=M.globalTransformMatrix).a*B.d-B.b*B.c>0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD;for(var O=this.rotateMix,x=this.translateMix,E=(c=0,3);c<_;c++,E+=3){var M,B;(M=o[c]).updateByConstraint(),(B=M.globalTransformMatrix).tx+=(P-B.tx)*x,B.ty+=(S-B.ty)*x;var I=(g=b[E])-P,F=(D=b[E+1])-S;if(h){var C=this._boneLengths[c],w=(Math.sqrt(I*I+F*F)/C-1)*O+1;B.a*=w,B.b*=w}if(P=g,S=D,O>0){var N=B.a,R=B.b,j=B.c,k=B.d,L=void 0,V=void 0,Y=void 0;if(L=u?b[E-1]:Math.atan2(F,I),L-=Math.atan2(R,N),T){V=Math.cos(L),Y=Math.sin(L);var U=M._boneData.length;P+=(U*(V*N-Y*R)-I)*O,S+=(U*(Y*N+V*R)-F)*O}else L+=A;L>t.Transform.PI?L-=t.Transform.PI_D:L<-t.Transform.PI&&(L+=t.Transform.PI_D),L*=O,V=Math.cos(L),Y=Math.sin(L),B.a=V*N-Y*R,B.b=Y*N+V*R,B.c=V*j-Y*k,B.d=Y*j+V*k}M.global.fromMatrix(B)}this.dirty=!1}}},a.prototype.invalidUpdate=function(){},a}(e);t.PathConstraint=i}(l||(l={})),function(t){var e=function(){function t(t){void 0===t&&(t=0),this.time=0,this.timeScale=1,this._systemTime=0,this._animatebles=[],this._clock=null,this.time=t,this._systemTime=.001*(new Date).getTime()}return t.prototype.advanceTime=function(t){t!=t&&(t=0);var e=.001*Date.now();if(t<0&&(t=e-this._systemTime),this._systemTime=e,1!==this.timeScale&&(t*=this.timeScale),0!==t){t<0?this.time-=t:this.time+=t;for(var a=0,i=0,r=this._animatebles.length;a<r;++a){var n=this._animatebles[a];null!==n?(i>0&&(this._animatebles[a-i]=n,this._animatebles[a]=null),n.advanceTime(t)):i++}if(i>0){for(r=this._animatebles.length;a<r;++a){var s=this._animatebles[a];null!==s?this._animatebles[a-i]=s:i++}this._animatebles.length-=i}}},t.prototype.contains=function(t){if(t===this)return!1;for(var e=t;e!==this&&null!==e;)e=e.clock;return e===this},t.prototype.add=function(t){this._animatebles.indexOf(t)<0&&(this._animatebles.push(t),t.clock=this)},t.prototype.remove=function(t){var e=this._animatebles.indexOf(t);e>=0&&(this._animatebles[e]=null,t.clock=null)},t.prototype.clear=function(){for(var t=0,e=this._animatebles;t<e.length;t++){var a=e[t];null!==a&&(a.clock=null)}},Object.defineProperty(t.prototype,"clock",{get:function(){return this._clock},set:function(t){this._clock!==t&&(null!==this._clock&&this._clock.remove(this),this._clock=t,null!==this._clock&&this._clock.add(this))},enumerable:!0,configurable:!0}),t}();t.WorldClock=e}(l||(l={})),function(t){var e=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t._animationNames=[],t._animationStates=[],t._animations={},t._blendStates={},t._animationConfig=null,t}return f(a,e),a.toString=function(){return"[class dragonBones.Animation]"},a.prototype._onClear=function(){for(var t=0,e=this._animationStates;t<e.length;t++){e[t].returnToPool()}for(var a in this._animations)delete this._animations[a];for(var a in this._blendStates){var i=this._blendStates[a];for(var r in i)i[r].returnToPool();delete this._blendStates[a]}null!==this._animationConfig&&this._animationConfig.returnToPool(),this.timeScale=1,this._animationDirty=!1,this._inheritTimeScale=1,this._animationNames.length=0,this._animationStates.length=0,this._armature=null,this._animationConfig=null,this._lastAnimationState=null},a.prototype._fadeOut=function(t){switch(t.fadeOutMode){case 1:for(var e=0,a=this._animationStates;e<a.length;e++){null===(h=a[e])._parent&&(h.layer===t.layer&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 2:for(var i=0,r=this._animationStates;i<r.length;i++){null===(h=r[i])._parent&&(h.group===t.group&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 3:for(var n=0,s=this._animationStates;n<s.length;n++){null===(h=s[n])._parent&&(h.layer===t.layer&&h.group===t.group&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut))}break;case 4:for(var o=0,l=this._animationStates;o<l.length;o++){var h;null===(h=l[o])._parent&&h.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}},a.prototype.init=function(e){null===this._armature&&(this._armature=e,this._animationConfig=t.BaseObject.borrowObject(t.AnimationConfig))},a.prototype.advanceTime=function(t){for(var e in t<0&&(t=-t),this._armature.inheritAnimation&&null!==this._armature._parent?this._inheritTimeScale=this._armature._parent._armature.animation._inheritTimeScale*this.timeScale:this._inheritTimeScale=this.timeScale,1!==this._inheritTimeScale&&(t*=this._inheritTimeScale),this._blendStates){var a=this._blendStates[e];for(var i in a)a[i].reset()}var r=this._animationStates.length;if(1===r)if((d=this._animationStates[0])._fadeState>0&&d._subFadeState>0)this._armature._dragonBones.bufferObject(d),this._animationStates.length=0,this._lastAnimationState=null;else{var n=d.animationData,s=n.cacheFrameRate;if(this._animationDirty&&s>0){this._animationDirty=!1;for(var o=0,l=this._armature.getBones();o<l.length;o++){var h=l[o];h._cachedFrameIndices=n.getBoneCachedFrameIndices(h.name)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var f=_[u];if(f.displayFrameCount>0){var m=f.getDisplayFrameAt(0).rawDisplayData;if(null!==m&&m.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=n.getSlotCachedFrameIndices(f.name);continue}}f._cachedFrameIndices=null}}d.advanceTime(t,s)}else if(r>1){for(var p=0,c=0;p<r;++p){var d;(d=this._animationStates[p])._fadeState>0&&d._subFadeState>0?(c++,this._armature._dragonBones.bufferObject(d),this._animationDirty=!0,this._lastAnimationState===d&&(this._lastAnimationState=null)):(c>0&&(this._animationStates[p-c]=d),d.advanceTime(t,0)),p===r-1&&c>0&&(this._animationStates.length-=c,null===this._lastAnimationState&&this._animationStates.length>0&&(this._lastAnimationState=this._animationStates[this._animationStates.length-1]))}this._armature._cacheFrameIndex=-1}else this._armature._cacheFrameIndex=-1},a.prototype.reset=function(){for(var t=0,e=this._animationStates;t<e.length;t++){e[t].returnToPool()}this._animationDirty=!1,this._animationConfig.clear(),this._animationStates.length=0,this._lastAnimationState=null},a.prototype.stop=function(t){if(void 0===t&&(t=null),null!==t)null!==(i=this.getState(t))&&i.stop();else for(var e=0,a=this._animationStates;e<a.length;e++){var i;(i=a[e]).stop()}},a.prototype.playConfig=function(e){var a=e.animation;if(!(a in this._animations))return console.warn("Non-existent animation.\n","DragonBones name: "+this._armature.armatureData.parent.name,"Armature name: "+this._armature.name,"Animation name: "+a),null;var i=this._animations[a];if(5===e.fadeOutMode)for(var r=0,n=this._animationStates;r<n.length;r++){var s=n[r];if(s._fadeState<1&&s.layer===e.layer&&s.animationData===i)return s}0===this._animationStates.length?e.fadeInTime=0:e.fadeInTime<0&&(e.fadeInTime=i.fadeInTime),e.fadeOutTime<0&&(e.fadeOutTime=e.fadeInTime),e.timeScale<=-100&&(e.timeScale=1/i.scale),i.frameCount>0?(e.position<0?(e.position%=i.duration,e.position=i.duration-e.position):e.position===i.duration?e.position-=1e-6:e.position>i.duration&&(e.position%=i.duration),e.duration>0&&e.position+e.duration>i.duration&&(e.duration=i.duration-e.position),e.playTimes<0&&(e.playTimes=i.playTimes)):(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.duration=-1),this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,i,e),this._animationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0){for(var l=!1,h=0,u=this._animationStates.length;h<u;++h){if(o.layer>this._animationStates[h].layer){l=!0,this._animationStates.splice(h,0,o);break}if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=!0,this._animationStates.splice(h+1,0,o);break}}l||this._animationStates.push(o)}else this._animationStates.push(o);for(var _=0,f=this._armature.getSlots();_<f.length;_++){var m=f[_].childArmature;null!==m&&m.inheritAnimation&&m.animation.hasAnimation(a)&&null===m.animation.getState(a)&&m.animation.fadeIn(a)}for(var p in i.animationTimelines){var c=this.fadeIn(p,0,1,o.layer,"",5);if(null!==c){var d=i.animationTimelines[p];c.actionEnabled=!1,c.resetToPose=!1,c.stop(),o.addState(c,d);var y=this._animationStates.indexOf(o),g=this._animationStates.indexOf(c);g<y&&(this._animationStates.splice(y,1),this._animationStates.splice(g,0,o))}}return this._lastAnimationState=o,o},a.prototype.play=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=null!==t?t:"",null!==t&&t.length>0)this.playConfig(this._animationConfig);else if(null===this._lastAnimationState){var a=this._armature.armatureData.defaultAnimation;null!==a&&(this._animationConfig.animation=a.name,this.playConfig(this._animationConfig))}else this._lastAnimationState.isPlaying||this._lastAnimationState.isCompleted?(this._animationConfig.animation=this._lastAnimationState.name,this.playConfig(this._animationConfig)):this._lastAnimationState.play();return this._lastAnimationState},a.prototype.fadeIn=function(t,e,a,i,r,n){return void 0===e&&(e=-1),void 0===a&&(a=-1),void 0===i&&(i=0),void 0===r&&(r=null),void 0===n&&(n=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=n,this._animationConfig.playTimes=a,this._animationConfig.layer=i,this._animationConfig.fadeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==r?r:"",this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByTime=function(t,e,a){return void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.position=e,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByFrame=function(t,e,a){void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var i=t in this._animations?this._animations[t]:null;return null!==i&&(this._animationConfig.position=i.frameCount>0?i.duration*e/i.frameCount:0),this.playConfig(this._animationConfig)},a.prototype.gotoAndPlayByProgress=function(t,e,a){void 0===e&&(e=0),void 0===a&&(a=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!0,this._animationConfig.playTimes=a,this._animationConfig.fadeInTime=0,this._animationConfig.animation=t;var i=t in this._animations?this._animations[t]:null;return null!==i&&(this._animationConfig.position=i.duration*(e>0?e:0)),this.playConfig(this._animationConfig)},a.prototype.gotoAndStopByTime=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByTime(t,e,1);return null!==a&&a.stop(),a},a.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByFrame(t,e,1);return null!==a&&a.stop(),a},a.prototype.gotoAndStopByProgress=function(t,e){void 0===e&&(e=0);var a=this.gotoAndPlayByProgress(t,e,1);return null!==a&&a.stop(),a},a.prototype.getBlendState=function(e,a,i){e in this._blendStates||(this._blendStates[e]={});var r=this._blendStates[e];a in r||((r[a]=t.BaseObject.borrowObject(t.BlendState)).target=i);return r[a]},a.prototype.getState=function(t,e){void 0===e&&(e=-1);for(var a=this._animationStates.length;a--;){var i=this._animationStates[a];if(i.name===t&&(e<0||i.layer===e))return i}return null},a.prototype.hasAnimation=function(t){return t in this._animations},a.prototype.getStates=function(){return this._animationStates},Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){if(e[t].isPlaying)return!0}return!1},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCompleted",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){if(!e[t].isCompleted)return!1}return this._animationStates.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations!==t){for(var e in this._animationNames.length=0,this._animations)delete this._animations[e];for(var e in t)this._animationNames.push(e),this._animations[e]=t[e]}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animationConfig",{get:function(){return this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:!0,configurable:!0}),a}(t.BaseObject);t.Animation=e}(l||(l={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._boneMask=[],t._boneTimelines=[],t._boneBlendTimelines=[],t._slotTimelines=[],t._slotBlendTimelines=[],t._constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._actionTimeline=null,t._zOrderTimeline=null,t}return f(i,e),i.toString=function(){return"[class dragonBones.AnimationState]"},i.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t<e.length;t++){(f=e[t]).returnToPool()}for(var a=0,i=this._boneBlendTimelines;a<i.length;a++){(f=i[a]).returnToPool()}for(var r=0,n=this._slotTimelines;r<n.length;r++){(f=n[r]).returnToPool()}for(var s=0,o=this._slotBlendTimelines;s<o.length;s++){(f=o[s]).returnToPool()}for(var l=0,h=this._constraintTimelines;l<h.length;l++){(f=h[l]).returnToPool()}for(var u=0,_=this._animationTimelines;u<_.length;u++){var f,m=(f=_[u]).target;m._parent===this&&(m._fadeState=1,m._subFadeState=1,m._parent=null),f.returnToPool()}null!==this._actionTimeline&&this._actionTimeline.returnToPool(),null!==this._zOrderTimeline&&this._zOrderTimeline.returnToPool(),this.actionEnabled=!1,this.additive=!1,this.displayControl=!1,this.resetToPose=!1,this.blendType=0,this.playTimes=1,this.layer=0,this.timeScale=1,this._weight=1,this.parameterX=0,this.parameterY=0,this.positionX=0,this.positionY=0,this.autoFadeOutTime=0,this.fadeTotalTime=0,this.name="",this.group="",this._timelineDirty=2,this._playheadState=0,this._fadeState=-1,this._subFadeState=-1,this._position=0,this._duration=0,this._fadeTime=0,this._time=0,this._fadeProgress=0,this._weightResult=0,this._boneMask.length=0,this._boneTimelines.length=0,this._boneBlendTimelines.length=0,this._slotTimelines.length=0,this._slotBlendTimelines.length=0,this._constraintTimelines.length=0,this._animationTimelines.length=0,this._poseTimelines.length=0,this._animationData=null,this._armature=null,this._actionTimeline=null,this._zOrderTimeline=null,this._activeChildA=null,this._activeChildB=null,this._parent=null},i.prototype._updateTimelines=function(){for(var e=0,a=this._armature._constraints;e<a.length;e++){var i=a[e],r=this._animationData.getConstraintTimelines(i.name);if(null!==r)for(var n=0,s=r;n<s.length;n++){var o=s[n];if(30===o.type)(l=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).target=i,l.init(this._armature,this,o),this._constraintTimelines.push(l)}else if(this.resetToPose){var l;(l=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).target=i,l.init(this._armature,this,null),this._constraintTimelines.push(l),this._poseTimelines.push(l)}}},i.prototype._updateBoneAndSlotTimelines=function(){for(var e={},i=0,r=this._boneTimelines;i<r.length;i++){(u=(g=r[i]).target.target.name)in e||(e[u]=[]),e[u].push(g)}for(var n=0,s=this._boneBlendTimelines;n<s.length;n++){(u=(g=s[n]).target.target.name)in e||(e[u]=[]),e[u].push(g)}for(var o=0,l=this._armature.getBones();o<l.length;o++){var h=l[o],u=h.name;if(this.containsBoneMask(u))if(u in e)delete e[u];else{var _=this._animationData.getBoneTimelines(u),f=this._armature.animation.getBlendState(a.BONE_TRANSFORM,h.name,h);if(null!==_)for(var m=0,p=_;m<p.length;m++){switch((C=p[m]).type){case 10:(g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 11:(g=t.BaseObject.borrowObject(t.BoneTranslateTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 12:(g=t.BaseObject.borrowObject(t.BoneRotateTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 13:(g=t.BaseObject.borrowObject(t.BoneScaleTimelineState)).target=f,g.init(this._armature,this,C),this._boneTimelines.push(g);break;case 60:(g=t.BaseObject.borrowObject(t.AlphaTimelineState)).target=this._armature.animation.getBlendState(a.BONE_ALPHA,h.name,h),g.init(this._armature,this,C),this._boneBlendTimelines.push(g);break;case 50:(g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).target=this._armature.animation.getBlendState(a.SURFACE,h.name,h),g.init(this._armature,this,C),this._boneBlendTimelines.push(g)}}else if(this.resetToPose){if(0===h._boneData.type)(g=t.BaseObject.borrowObject(t.BoneAllTimelineState)).target=f,g.init(this._armature,this,null),this._boneTimelines.push(g),this._poseTimelines.push(g);else(g=t.BaseObject.borrowObject(t.SurfaceTimelineState)).target=this._armature.animation.getBlendState(a.SURFACE,h.name,h),g.init(this._armature,this,null),this._boneBlendTimelines.push(g),this._poseTimelines.push(g)}}}for(var c in e)for(var d=0,y=e[c];d<y.length;d++){var g=y[d];(V=this._boneTimelines.indexOf(g))>=0&&(this._boneTimelines.splice(V,1),g.returnToPool()),(V=this._boneBlendTimelines.indexOf(g))>=0&&(this._boneBlendTimelines.splice(V,1),g.returnToPool())}for(var D={},v=[],T=0,b=this._slotTimelines;T<b.length;T++){(u=(g=b[T]).target.name)in D||(D[u]=[]),D[u].push(g)}for(var A=0,P=this._slotBlendTimelines;A<P.length;A++){(u=(g=P[A]).target.target.name)in D||(D[u]=[]),D[u].push(g)}for(var S=0,O=this._armature.getSlots();S<O.length;S++){var x=O[S],E=x.parent.name;if(this.containsBoneMask(E))if((u=x.name)in D)delete D[u];else{var M=!1,B=!1;if(v.length=0,null!==(_=this._animationData.getSlotTimelines(u)))for(var I=0,F=_;I<F.length;I++){var C;switch((C=F[I]).type){case 20:(g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).target=x,g.init(this._armature,this,C),this._slotTimelines.push(g),M=!0;break;case 23:(g=t.BaseObject.borrowObject(t.SlotZIndexTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_Z_INDEX,x.name,x),g.init(this._armature,this,C),this._slotBlendTimelines.push(g);break;case 21:(g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).target=x,g.init(this._armature,this,C),this._slotTimelines.push(g),B=!0;break;case 22:(g=t.BaseObject.borrowObject(t.DeformTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_DEFORM,x.name,x),g.init(this._armature,this,C),null!==g.target?(this._slotBlendTimelines.push(g),v.push(g.geometryOffset)):g.returnToPool();break;case 24:(g=t.BaseObject.borrowObject(t.AlphaTimelineState)).target=this._armature.animation.getBlendState(a.SLOT_ALPHA,x.name,x),g.init(this._armature,this,C),this._slotBlendTimelines.push(g)}}if(this.resetToPose){if(!M)(g=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).target=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g);if(!B)(g=t.BaseObject.borrowObject(t.SlotColorTimelineState)).target=x,g.init(this._armature,this,null),this._slotTimelines.push(g),this._poseTimelines.push(g);for(var w=0,N=x.displayFrameCount;w<N;++w){var R=x.getDisplayFrameAt(w);if(0!==R.deformVertices.length){var j=R.getGeometryData();if(null!==j&&v.indexOf(j.offset)<0)(g=t.BaseObject.borrowObject(t.DeformTimelineState)).geometryOffset=j.offset,g.displayFrame=R,g.target=this._armature.animation.getBlendState(a.SLOT_DEFORM,x.name,x),g.init(this._armature,this,null),this._slotBlendTimelines.push(g),this._poseTimelines.push(g)}}}}}for(var c in D)for(var k=0,L=D[c];k<L.length;k++){var V;g=L[k];(V=this._slotTimelines.indexOf(g))>=0&&(this._slotTimelines.splice(V,1),g.returnToPool()),(V=this._slotBlendTimelines.indexOf(g))>=0&&(this._slotBlendTimelines.splice(V,1),g.returnToPool())}},i.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0&&(this._subFadeState=0,null===this._parent&&this.actionEnabled)){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i))(r=t.BaseObject.borrowObject(t.EventObject)).type=i,r.armature=this._armature,r.animationState=this,this._armature._dragonBones.bufferEvent(r)}if((e<0&&(e=-e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?(this._subFadeState=1,this._fadeProgress=a?0:1):this._fadeTime>0?this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgress=a?1:0,this._subFadeState>0)&&(a||(this._playheadState|=1,this._fadeState=0),null===this._parent&&this.actionEnabled)){var r;i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i))(r=t.BaseObject.borrowObject(t.EventObject)).type=i,r.armature=this._armature,r.animationState=this,this._armature._dragonBones.bufferEvent(r)}},i.prototype.init=function(e,a,i){if(null===this._armature){if(this._armature=e,this._animationData=a,this.resetToPose=i.resetToPose,this.additive=i.additive,this.displayControl=i.displayControl,this.actionEnabled=i.actionEnabled,this.blendType=a.blendType,this.layer=i.layer,this.playTimes=i.playTimes,this.timeScale=i.timeScale,this.fadeTotalTime=i.fadeInTime,this.autoFadeOutTime=i.autoFadeOutTime,this.name=i.name.length>0?i.name:i.animation,this.group=i.group,this._weight=i.weight,i.pauseFadeIn?this._playheadState=2:this._playheadState=3,i.duration<0?(this._position=0,this._duration=this._animationData.duration,0!==i.position?this.timeScale>=0?this._time=i.position:this._time=i.position-this._duration:this._time=0):(this._position=i.position,this._duration=i.duration,this._time=0),this.timeScale<0&&0===this._time&&(this._time=-1e-6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),i.boneMask.length>0){this._boneMask.length=i.boneMask.length;for(var r=0,n=this._boneMask.length;r<n;++r)this._boneMask[r]=i.boneMask[r]}this._actionTimeline=t.BaseObject.borrowObject(t.ActionTimelineState),this._actionTimeline.init(this._armature,this,this._animationData.actionTimeline),this._actionTimeline.currentTime=this._time,this._actionTimeline.currentTime<0&&(this._actionTimeline.currentTime=this._duration-this._actionTimeline.currentTime),null!==this._animationData.zOrderTimeline&&(this._zOrderTimeline=t.BaseObject.borrowObject(t.ZOrderTimelineState),this._zOrderTimeline.init(this._armature,this,this._animationData.zOrderTimeline))}},i.prototype.advanceTime=function(t,e){0===this._fadeState&&0===this._subFadeState||this._advanceFadeTime(t),3===this._playheadState&&(1!==this.timeScale&&(t*=this.timeScale),this._time+=t),0!==this._timelineDirty&&(2===this._timelineDirty&&this._updateTimelines(),this._timelineDirty=0,this._updateBoneAndSlotTimelines());var a=0!==this._fadeState||0===this._subFadeState,i=0===this._fadeState&&e>0,r=!0,n=!0,s=this._time;if(this._weightResult=this._weight*this._fadeProgress,null!==this._parent&&(this._weightResult*=this._parent._weightResult),this._actionTimeline.playState<=0&&this._actionTimeline.update(s),0!==this._weight){if(i){var o=2*e;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(null!==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.update(s),i){var l=Math.floor(this._actionTimeline.currentTime*e);this._armature._cacheFrameIndex===l?(r=!1,n=!1):(this._armature._cacheFrameIndex=l,this._animationData.cachedFrames[l]?n=!1:this._animationData.cachedFrames[l]=!0)}if(r){var h=!1,u=null;if(n)for(var _=0,f=this._boneTimelines.length;_<f;++_){if((P=this._boneTimelines[_]).playState<=0&&P.update(s),P.target!==u)if(h=(c=P.target).update(this),u=c,1===c.dirty){var m=c.target.animationPose;m.x=0,m.y=0,m.rotation=0,m.skew=0,m.scaleX=1,m.scaleY=1}h&&P.blend(a)}for(_=0,f=this._boneBlendTimelines.length;_<f;++_){(P=this._boneBlendTimelines[_]).playState<=0&&P.update(s),P.target.update(this)&&P.blend(a)}if(this.displayControl)for(_=0,f=this._slotTimelines.length;_<f;++_){if((P=this._slotTimelines[_]).playState<=0){var p=P.target.displayController;null!==p&&p!==this.name&&p!==this.group||P.update(s)}}for(_=0,f=this._slotBlendTimelines.length;_<f;++_){if((P=this._slotBlendTimelines[_]).playState<=0){var c=P.target;P.update(s),c.update(this)&&P.blend(a)}}for(_=0,f=this._constraintTimelines.length;_<f;++_){(P=this._constraintTimelines[_]).playState<=0&&P.update(s)}if(this._animationTimelines.length>0){var d=100,y=100,g=null,D=null;for(_=0,f=this._animationTimelines.length;_<f;++_){if((P=this._animationTimelines[_]).playState<=0&&P.update(s),1===this.blendType){var v=P.target,T=this.parameterX-v.positionX;T>=0?T<d&&(d=T,g=v):-T<y&&(y=-T,D=v)}}null!==g&&(this._activeChildA!==g&&(null!==this._activeChildA&&(this._activeChildA.weight=0),this._activeChildA=g,this._activeChildA.activeTimeline()),this._activeChildB!==D&&(null!==this._activeChildB&&(this._activeChildB.weight=0),this._activeChildB=D),g.weight=y/(d+y),D&&(D.weight=1-g.weight))}}if(0===this._fadeState){if(this._subFadeState>0&&(this._subFadeState=0,this._poseTimelines.length>0)){for(var b=0,A=this._poseTimelines;b<A.length;b++){var P=A[b],S=this._boneTimelines.indexOf(P);S>=0?(this._boneTimelines.splice(S,1),P.returnToPool()):(S=this._boneBlendTimelines.indexOf(P))>=0?(this._boneBlendTimelines.splice(S,1),P.returnToPool()):(S=this._slotTimelines.indexOf(P))>=0?(this._slotTimelines.splice(S,1),P.returnToPool()):(S=this._slotBlendTimelines.indexOf(P))>=0?(this._slotBlendTimelines.splice(S,1),P.returnToPool()):(S=this._constraintTimelines.indexOf(P))>=0&&(this._constraintTimelines.splice(S,1),P.returnToPool())}this._poseTimelines.length=0}this._actionTimeline.playState>0&&this.autoFadeOutTime>=0&&this.fadeOut(this.autoFadeOutTime)}}},i.prototype.play=function(){this._playheadState=3},i.prototype.stop=function(){this._playheadState&=1},i.prototype.fadeOut=function(t,e){if(void 0===e&&(e=!0),t<0&&(t=0),e&&(this._playheadState&=2),this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime)return}else{this._fadeState=1,this._subFadeState=-1,(t<=0||this._fadeProgress<=0)&&(this._fadeProgress=1e-6);for(var a=0,i=this._boneTimelines;a<i.length;a++){(p=i[a]).fadeOut()}for(var r=0,n=this._boneBlendTimelines;r<n.length;r++){(p=n[r]).fadeOut()}for(var s=0,o=this._slotTimelines;s<o.length;s++){(p=o[s]).fadeOut()}for(var l=0,h=this._slotBlendTimelines;l<h.length;l++){(p=h[l]).fadeOut()}for(var u=0,_=this._constraintTimelines;u<_.length;u++){(p=_[u]).fadeOut()}for(var f=0,m=this._animationTimelines;f<m.length;f++){var p;(p=m[f]).fadeOut(),p.target.fadeOut(999999,!0)}}this.displayControl=!1,this.fadeTotalTime=this._fadeProgress>1e-6?t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)},i.prototype.containsBoneMask=function(t){return 0===this._boneMask.length||this._boneMask.indexOf(t)>=0},i.prototype.addBoneMask=function(t,e){void 0===e&&(e=!0);var a=this._armature.getBone(t);if(null!==a){if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var i=0,r=this._armature.getBones();i<r.length;i++){var n=r[i];this._boneMask.indexOf(n.name)<0&&a.contains(n)&&this._boneMask.push(n.name)}this._timelineDirty=1}},i.prototype.removeBoneMask=function(t,e){void 0===e&&(e=!0);var a=this._boneMask.indexOf(t);if(a>=0&&this._boneMask.splice(a,1),e){var i=this._armature.getBone(t);if(null!==i){var r=this._armature.getBones();if(this._boneMask.length>0)for(var n=0,s=r;n<s.length;n++){var o=s[n],l=this._boneMask.indexOf(o.name);l>=0&&i.contains(o)&&this._boneMask.splice(l,1)}else for(var h=0,u=r;h<u.length;h++){(o=u[h])!==i&&(i.contains(o)||this._boneMask.push(o.name))}}}this._timelineDirty=1},i.prototype.removeAllBoneMask=function(){this._boneMask.length=0,this._timelineDirty=1},i.prototype.addState=function(e,a){if(void 0===a&&(a=null),null!==a)for(var i=0,r=a;i<r.length;i++){var n=r[i];switch(n.type){case 40:if((o=t.BaseObject.borrowObject(t.AnimationProgressTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o),0!==this.blendType){var s=n;e.positionX=s.x,e.positionY=s.y,e.weight=0}e._parent=this,this.resetToPose=!1;break;case 41:(o=t.BaseObject.borrowObject(t.AnimationWeightTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o);break;case 42:var o;(o=t.BaseObject.borrowObject(t.AnimationParametersTimelineState)).target=e,o.init(this._armature,this,n),this._animationTimelines.push(o)}}null===e._parent&&(e._parent=this)},i.prototype.activeTimeline=function(){for(var t=0,e=this._slotTimelines;t<e.length;t++){var a=e[t];a.dirty=!0,a.currentTime=-1}},Object.defineProperty(i.prototype,"isFadeIn",{get:function(){return this._fadeState<0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFadeOut",{get:function(){return this._fadeState>0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return 0===this._fadeState},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isPlaying",{get:function(){return!!(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if((t<0||this._duration<t)&&(t=t%this._duration+e*this._duration)<0&&(t+=this._duration),this.playTimes>0&&e===this.playTimes-1&&t===this._duration&&null===this._parent&&(t=this._duration-1e-6),this._time!==t){this._time=t,this._actionTimeline.setCurrentTime(this._time),null!==this._zOrderTimeline&&(this._zOrderTimeline.playState=-1);for(var a=0,i=this._boneTimelines;a<i.length;a++){i[a].playState=-1}for(var r=0,n=this._slotTimelines;r<n.length;r++){n[r].playState=-1}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"weight",{get:function(){return this._weight},set:function(t){if(this._weight!==t){this._weight=t;for(var e=0,a=this._boneTimelines;e<a.length;e++){a[e].dirty=!0}for(var i=0,r=this._boneBlendTimelines;i<r.length;i++){r[i].dirty=!0}for(var n=0,s=this._slotBlendTimelines;n<s.length;n++){s[n].dirty=!0}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationData",{get:function(){return this._animationData},enumerable:!0,configurable:!0}),i}(t.BaseObject);t.AnimationState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.BlendState]"},e.prototype._onClear=function(){this.reset(),this.target=null},e.prototype.update=function(t){var e=t.layer,a=t._weightResult;if(this.dirty>0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return this.dirty++,this.layer=e,this.leftWeight=0,this.blendWeight=0,!1;this.layer=e,this.leftWeight-=this.layerWeight,this.layerWeight=0}return a*=this.leftWeight,this.dirty++,this.blendWeight=a,this.layerWeight+=this.blendWeight,!0}return!1}return this.dirty++,this.layer=e,this.leftWeight=1,this.blendWeight=a,this.layerWeight=a,!0},e.prototype.reset=function(){this.dirty=0,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},e.BONE_TRANSFORM="boneTransform",e.BONE_ALPHA="boneAlpha",e.SURFACE="surface",e.SLOT_DEFORM="slotDeform",e.SLOT_ALPHA="slotAlpha",e.SLOT_Z_INDEX="slotZIndex",e}(t.BaseObject);t.BlendState=a}(l||(l={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype._onClear=function(){this.dirty=!1,this.playState=-1,this.currentPlayTimes=-1,this.currentTime=-1,this.target=null,this._isTween=!1,this._valueOffset=0,this._frameValueOffset=0,this._frameOffset=0,this._frameRate=0,this._frameCount=0,this._frameIndex=-1,this._frameRateR=0,this._position=0,this._duration=0,this._timeScale=1,this._timeOffset=0,this._animationData=null,this._timelineData=null,this._armature=null,this._animationState=null,this._actionTimeline=null,this._frameArray=null,this._valueArray=null,this._timelineArray=null,this._frameIndices=null},e.prototype._setCurrentTime=function(t){var e=this.playState,a=this.currentPlayTimes,i=this.currentTime;if(null!==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.playState>=0?1:-1,this.currentPlayTimes=1,this.currentTime=this._actionTimeline.currentTime;else if(null===this._actionTimeline||1!==this._timeScale||0!==this._timeOffset){var r=this._animationState.playTimes,n=r*this._duration;t*=this._timeScale,0!==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),r>0&&(t>=n||t<=-n)?(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),this.currentPlayTimes=r,this.currentTime=t<0?0:this._duration+1e-6):(0!==this.playState&&3===this._animationState._playheadState&&(this.playState=0),t<0?(t=-t,this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=this._duration-t%this._duration):(this.currentPlayTimes=Math.floor(t/this._duration),this.currentTime=t%this._duration)),this.currentTime+=this._position}else this.playState=this._actionTimeline.playState,this.currentPlayTimes=this._actionTimeline.currentPlayTimes,this.currentTime=this._actionTimeline.currentTime;return(this.currentPlayTimes!==a||this.currentTime!==i)&&((e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a)&&(this._frameIndex=-1),!0)},e.prototype.init=function(t,e,a){if(this._armature=t,this._animationState=e,this._timelineData=a,this._actionTimeline=this._animationState._actionTimeline,this===this._actionTimeline&&(this._actionTimeline=null),this._animationData=this._animationState.animationData,this._frameRate=this._animationData.parent.frameRate,this._frameRateR=1/this._frameRate,this._position=this._animationState._position,this._duration=this._animationState._duration,null!==this._timelineData){var i=this._animationData.parent.parent;this._frameArray=i.frameArray,this._timelineArray=i.timelineArray,this._frameIndices=i.frameIndices,this._frameCount=this._timelineArray[this._timelineData.offset+2],this._frameValueOffset=this._timelineArray[this._timelineData.offset+4],this._timeScale=100/this._timelineArray[this._timelineData.offset+0],this._timeOffset=.01*this._timelineArray[this._timelineData.offset+1]}},e.prototype.fadeOut=function(){this.dirty=!1},e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate),a=this._frameIndices[this._timelineData.frameIndicesOffset+e];this._frameIndex!==a&&(this._frameIndex=a,this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}else this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]),this._onArriveAtFrame());(this._isTween||this.dirty)&&this._onUpdateFrame()}},e.prototype.blend=function(t){},e}(t.BaseObject);t.TimelineState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e._getEasingValue=function(t,e,a){var i=e;switch(t){case 3:i=Math.pow(e,2);break;case 4:i=1-Math.pow(1-e,2);break;case 5:i=.5*(1-Math.cos(e*Math.PI))}return(i-e)*a+e},e._getEasingCurveValue=function(t,e,a,i){if(t<=0)return 0;if(t>=1)return 1;var r=a>0,n=a+1,s=Math.floor(t*n),o=0,l=0;return r?(o=0===s?0:e[i+s-1],l=s===n-1?1e4:e[i+s]):(o=e[i+s-1],l=e[i+s]),1e-4*(o+(l-o)*(t*n-s))},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._tweenType=0,this._curveCount=0,this._framePosition=0,this._frameDurationR=0,this._tweenEasing=0,this._tweenProgress=0,this._valueScale=1},e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||0===this._animationState.playTimes||this._animationState.currentPlayTimes<this._animationState.playTimes-1))if(this._tweenType=this._frameArray[this._frameOffset+1],this._isTween=0!==this._tweenType,this._isTween?2===this._tweenType?this._curveCount=this._frameArray[this._frameOffset+2]:0!==this._tweenType&&1!==this._tweenType&&(this._tweenEasing=.01*this._frameArray[this._frameOffset+2]):this.dirty=!0,this._framePosition=this._frameArray[this._frameOffset]*this._frameRateR,this._frameIndex===this._frameCount-1)this._frameDurationR=1/(this._animationData.duration-this._framePosition);else{var t=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex+1],e=this._frameArray[t]*this._frameRateR-this._framePosition;this._frameDurationR=e>0?1/e:0}else this.dirty=!0,this._isTween=!1},e.prototype._onUpdateFrame=function(){this._isTween&&(this.dirty=!0,this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR,2===this._tweenType?this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3):1!==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)))},e}(e);t.TweenTimelineState=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._current=0,this._difference=0,this._result=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,a=this._valueArray,i=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+1;1===e?(this._current=a[i],this._difference=a[r]-this._current):(this._current=a[i]*e,this._difference=a[r]*e-this._current)}else this._result=a[i]*e}else this._result=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result=this._current+this._difference*this._tweenProgress)},e}(a);t.SingleValueTimelineState=i;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._currentA=0,this._currentB=0,this._differenceA=0,this._differenceB=0,this._resultA=0,this._resultB=0},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._valueScale,a=this._valueArray,i=this._valueOffset+this._frameValueOffset+2*this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+2;1===e?(this._currentA=a[i],this._currentB=a[i+1],this._differenceA=a[r]-this._currentA,this._differenceB=a[r+1]-this._currentB):(this._currentA=a[i]*e,this._currentB=a[i+1]*e,this._differenceA=a[r]*e-this._currentA,this._differenceB=a[r+1]*e-this._currentB)}else this._resultA=a[i]*e,this._resultB=a[i+1]*e}else this._resultA=0,this._resultB=0},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._resultA=this._currentA+this._differenceA*this._tweenProgress,this._resultB=this._currentB+this._differenceB*this._tweenProgress)},e}(a);t.DoubleValueTimelineState=r;var n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._rd=[],e}return f(e,t),e.prototype._onClear=function(){t.prototype._onClear.call(this),this._valueCount=0,this._rd.length=0},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount,a=this._rd;if(null!==this._timelineData){var i=this._valueScale,r=this._valueArray,n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(1===i)for(var o=0;o<e;++o)a[e+o]=r[s+o]-r[n+o];else for(o=0;o<e;++o)a[e+o]=(r[s+o]-r[n+o])*i}else if(1===i)for(o=0;o<e;++o)a[o]=r[n+o];else for(o=0;o<e;++o)a[o]=r[n+o]*i}else for(o=0;o<e;++o)a[o]=0},e.prototype._onUpdateFrame=function(){if(t.prototype._onUpdateFrame.call(this),this._isTween){var e=this._valueCount,a=this._valueScale,i=this._tweenProgress,r=this._valueArray,n=this._rd,s=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(1===a)for(var o=0;o<e;++o)n[o]=r[s+o]+n[e+o]*i;else for(o=0;o<e;++o)n[o]=r[s+o]*a+n[e+o]*i}},e}(a);t.MutilpleValueTimelineState=n}(l||(l={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.toString=function(){return"[class dragonBones.ActionTimelineState]"},a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled)for(var i=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e],r=this._frameArray[i+1],n=this._animationData.parent.actions,s=0;s<r;++s){var o=n[this._frameArray[i+2+s]];if(0===o.type){(l=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[i]/this._frameRate,l.animationState=this._animationState,t.EventObject.actionDataToInstance(o,l,this._armature),this._armature._bufferAction(l,!0)}else{var l,h=10===o.type?t.EventObject.FRAME_EVENT:t.EventObject.SOUND_EVENT;if(11===o.type||a.hasDBEventListener(h))(l=t.BaseObject.borrowObject(t.EventObject)).time=this._frameArray[i]/this._frameRate,l.animationState=this._animationState,t.EventObject.actionDataToInstance(o,l,this._armature),this._armature._dragonBones.bufferEvent(l)}}},a.prototype._onArriveAtFrame=function(){},a.prototype._onUpdateFrame=function(){},a.prototype.update=function(e){var a=this.playState,i=this.currentPlayTimes,r=this.currentTime;if(this._setCurrentTime(e)){var n=null===this._animationState._parent&&this._animationState.actionEnabled,s=this._armature.eventDispatcher;if(a<0){if(this.playState===a)return;if(this._animationState.displayControl&&this._animationState.resetToPose&&this._armature._sortZOrder(null,0),i=this.currentPlayTimes,n&&s.hasDBEventListener(t.EventObject.START)){var o=t.BaseObject.borrowObject(t.EventObject);o.type=t.EventObject.START,o.armature=this._armature,o.animationState=this._animationState,this._armature._dragonBones.bufferEvent(o)}}var l=this._animationState.timeScale<0,h=null,u=null;if(n&&this.currentPlayTimes!==i&&(s.hasDBEventListener(t.EventObject.LOOP_COMPLETE)&&((h=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.LOOP_COMPLETE,h.armature=this._armature,h.animationState=this._animationState),this.playState>0&&s.hasDBEventListener(t.EventObject.COMPLETE)&&((u=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.COMPLETE,u.armature=this._armature,u.animationState=this._animationState)),this._frameCount>1){var _=this._timelineData,f=Math.floor(this.currentTime*this._frameRate),m=this._frameIndices[_.frameIndicesOffset+f];if(this._frameIndex!==m){var p=this._frameIndex;if(this._frameIndex=m,null!==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._timelineArray[_.offset+5+this._frameIndex],l){if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[_.frameIndicesOffset+c],this.currentPlayTimes===i&&p===m&&(p=-1)}for(;p>=0;){var d=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration&&this._onCrossFrame(p),null!==h&&0===p&&(this._armature._dragonBones.bufferEvent(h),h=null),p>0?p--:p=this._frameCount-1,p===m)break}}else{if(p<0){c=Math.floor(r*this._frameRate);p=this._frameIndices[_.frameIndicesOffset+c];d=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],y=this._frameArray[d]/this._frameRate;this.currentPlayTimes===i&&(r<=y?p>0?p--:p=this._frameCount-1:p===m&&(p=-1))}for(;p>=0;){p<this._frameCount-1?p++:p=0;d=this._animationData.frameOffset+this._timelineArray[_.offset+5+p],y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration&&this._onCrossFrame(p),null!==h&&0===p&&(this._armature._dragonBones.bufferEvent(h),h=null),p===m)break}}}}else if(this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData)){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5];y=this._frameArray[this._frameOffset]/this._frameRate;this.currentPlayTimes===i?r<=y&&this._onCrossFrame(this._frameIndex):this._position<=y&&(l||null===h||(this._armature._dragonBones.bufferEvent(h),h=null),this._onCrossFrame(this._frameIndex))}null!==h&&this._armature._dragonBones.bufferEvent(h),null!==u&&this._armature._dragonBones.bufferEvent(u)}},a.prototype.setCurrentTime=function(t){this._setCurrentTime(t),this._frameIndex=-1},a}(t.TimelineState);t.ActionTimelineState=e;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.ZOrderTimelineState]"},e.prototype._onArriveAtFrame=function(){this.playState>=0&&(this._frameArray[this._frameOffset+1]>0?this._armature._sortZOrder(this._frameArray,this._frameOffset+2):this._armature._sortZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.ZOrderTimelineState=a;var i=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"},a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])),null===this._timelineData&&(this._rd[4]=1,this._rd[5]=1)},a.prototype.init=function(t,a,i){e.prototype.init.call(this,t,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=6,this._valueArray=this._animationData.parent.parent.frameFloatArray},a.prototype.fadeOut=function(){this.dirty=!1,this._rd[2]=t.Transform.normalizeRadian(this._rd[2]),this._rd[3]=t.Transform.normalizeRadian(this._rd[3])},a.prototype.blend=function(t){var e=this._armature.armatureData.scale,a=this._rd,i=this.target,r=i.target,n=i.blendWeight,s=r.animationPose;i.dirty>1?(s.x+=a[0]*n*e,s.y+=a[1]*n*e,s.rotation+=a[2]*n,s.skew+=a[3]*n,s.scaleX+=(a[4]-1)*n,s.scaleY+=(a[5]-1)*n):(s.x=a[0]*n*e,s.y=a[1]*n*e,s.rotation=a[2]*n,s.skew=a[3]*n,s.scaleX=(a[4]-1)*n+1,s.scaleY=(a[5]-1)*n+1),(t||this.dirty)&&(this.dirty=!1,r._transformDirty=!0)},a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=i;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.x+=this._resultA*i,r.y+=this._resultB*i):1!==i?(r.x=this._resultA*i,r.y=this._resultB*i):(r.x=this._resultA,r.y=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=r;var n=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"},a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this),this._isTween&&this._frameIndex===this._frameCount-1&&(this._differenceA=t.Transform.normalizeRadian(this._differenceA),this._differenceB=t.Transform.normalizeRadian(this._differenceB))},a.prototype.init=function(t,a,i){e.prototype.init.call(this,t,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},a.prototype.fadeOut=function(){this.dirty=!1,this._resultA=t.Transform.normalizeRadian(this._resultA),this._resultB=t.Transform.normalizeRadian(this._resultB)},a.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.rotation+=this._resultA*i,r.skew+=this._resultB*i):1!==i?(r.rotation=this._resultA*i,r.skew=this._resultB*i):(r.rotation=this._resultA,r.skew=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._resultA=1,this._resultB=1)},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameFloatOffset,this._valueArray=this._animationData.parent.parent.frameFloatArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a.animationPose;e.dirty>1?(r.scaleX+=(this._resultA-1)*i,r.scaleY+=(this._resultB-1)*i):1!==i?(r.scaleX=(this._resultA-1)*i+1,r.scaleY=(this._resultB-1)*i+1):(r.scaleX=this._resultA,r.scaleY=this._resultB),(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,a,i){if(t.prototype.init.call(this,e,a,i),null!==this._timelineData){var r=this._animationData.parent.parent,n=r.frameIntArray,s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=n[s+2],this._deformCount=n[s+1],this._deformOffset=n[s+3],this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=r.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.target.target._deformVertices.length},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=a._deformVertices,n=this._valueArray;if(null!==n)for(var s=this._valueCount,o=this._deformOffset,l=this._sameValueOffset,h=this._rd,u=0;u<this._deformCount;++u){var _=0;_=u<o?n[l+u]:u<o+s?h[u-o]:n[l+u-s],e.dirty>1?r[u]+=_*i:r[u]=_*i}else if(1===e.dirty)for(u=0;u<this._deformCount;++u)r[u]=0;(t||this.dirty)&&(this.dirty=!1,a._transformDirty=!0)},e}(t.MutilpleValueTimelineState);t.SurfaceTimelineState=o;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.AlphaTimelineState]"},e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this),null===this._timelineData&&(this._result=1)},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight;e.dirty>1?(a._alpha+=this._result*i,a._alpha>1&&(a._alpha=1)):a._alpha=this._result*i,(t||this.dirty)&&(this.dirty=!1,this._armature._alphaDirty=!0)},e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"},e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target,e=null!==this._timelineData?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;t.displayIndex!==e&&t._setDisplayIndex(e,!0)}},e.prototype._onUpdateFrame=function(){},e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._current=[0,0,0,0,0,0,0,0],e._difference=[0,0,0,0,0,0,0,0],e._result=[0,0,0,0,0,0,0,0],e}return f(e,t),e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var e=this._animationData.parent.parent,a=e.colorArray,i=e.frameIntArray,r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex,n=i[r];n<0&&(n+=65536),this._isTween?(this._current[0]=a[n++],this._current[1]=a[n++],this._current[2]=a[n++],this._current[3]=a[n++],this._current[4]=a[n++],this._current[5]=a[n++],this._current[6]=a[n++],this._current[7]=a[n++],(n=this._frameIndex===this._frameCount-1?i[this._animationData.frameIntOffset+this._frameValueOffset]:i[r+1])<0&&(n+=65536),this._difference[0]=a[n++]-this._current[0],this._difference[1]=a[n++]-this._current[1],this._difference[2]=a[n++]-this._current[2],this._difference[3]=a[n++]-this._current[3],this._difference[4]=a[n++]-this._current[4],this._difference[5]=a[n++]-this._current[5],this._difference[6]=a[n++]-this._current[6],this._difference[7]=a[n++]-this._current[7]):(this._result[0]=.01*a[n++],this._result[1]=.01*a[n++],this._result[2]=.01*a[n++],this._result[3]=.01*a[n++],this._result[4]=a[n++],this._result[5]=a[n++],this._result[6]=a[n++],this._result[7]=a[n++])}else{var s=this.target.slotData.color;this._result[0]=s.alphaMultiplier,this._result[1]=s.redMultiplier,this._result[2]=s.greenMultiplier,this._result[3]=s.blueMultiplier,this._result[4]=s.alphaOffset,this._result[5]=s.redOffset,this._result[6]=s.greenOffset,this._result[7]=s.blueOffset}},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this),this._isTween&&(this._result[0]=.01*(this._current[0]+this._difference[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._difference[1]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._difference[2]*this._tweenProgress),this._result[3]=.01*(this._current[3]+this._difference[3]*this._tweenProgress),this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress,this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress,this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress,this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress)},e.prototype.fadeOut=function(){this._isTween=!1},e.prototype.update=function(e){if(t.prototype.update.call(this,e),this._isTween||this.dirty){var a=this.target,i=a._colorTransform;if(0!==this._animationState._fadeState||0!==this._animationState._subFadeState){if(i.alphaMultiplier!==this._result[0]||i.redMultiplier!==this._result[1]||i.greenMultiplier!==this._result[2]||i.blueMultiplier!==this._result[3]||i.alphaOffset!==this._result[4]||i.redOffset!==this._result[5]||i.greenOffset!==this._result[6]||i.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);i.alphaMultiplier+=(this._result[0]-i.alphaMultiplier)*r,i.redMultiplier+=(this._result[1]-i.redMultiplier)*r,i.greenMultiplier+=(this._result[2]-i.greenMultiplier)*r,i.blueMultiplier+=(this._result[3]-i.blueMultiplier)*r,i.alphaOffset+=(this._result[4]-i.alphaOffset)*r,i.redOffset+=(this._result[5]-i.redOffset)*r,i.greenOffset+=(this._result[6]-i.greenOffset)*r,i.blueOffset+=(this._result[7]-i.blueOffset)*r,a._colorDirty=!0}}else this.dirty&&(this.dirty=!1,i.alphaMultiplier===this._result[0]&&i.redMultiplier===this._result[1]&&i.greenMultiplier===this._result[2]&&i.blueMultiplier===this._result[3]&&i.alphaOffset===this._result[4]&&i.redOffset===this._result[5]&&i.greenOffset===this._result[6]&&i.blueOffset===this._result[7]||(i.alphaMultiplier=this._result[0],i.redMultiplier=this._result[1],i.greenMultiplier=this._result[2],i.blueMultiplier=this._result[3],i.alphaOffset=this._result[4],i.redOffset=this._result[5],i.greenOffset=this._result[6],i.blueOffset=this._result[7],a._colorDirty=!0))}},e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"},e.prototype._onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null===this._timelineData){var e=this.target.target;this._result=e.slotData.zIndex}},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueArray=this._animationData.parent.parent.frameIntArray},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight;e.dirty>1?a._zIndex+=this._result*i:a._zIndex=this._result*i,(t||this.dirty)&&(this.dirty=!1,this._armature._zIndexDirty=!0)},e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=_;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.DeformTimelineState]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),this.geometryOffset=0,this.displayFrame=null,this._deformCount=0,this._deformOffset=0,this._sameValueOffset=0},e.prototype.init=function(e,a,i){if(t.prototype.init.call(this,e,a,i),null!==this._timelineData){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3],n=this._animationData.parent.parent,s=n.frameIntArray,o=this.target.target;this.geometryOffset=s[r+0],this.geometryOffset<0&&(this.geometryOffset+=65536);for(var l=0,h=o.displayFrameCount;l<h;++l){var u=o.getDisplayFrameAt(l),_=u.getGeometryData();if(null!==_&&_.offset===this.geometryOffset){this.displayFrame=u,this.displayFrame.updateDeformVertices();break}}if(null===this.displayFrame)return void this.returnToPool();this._valueOffset=this._animationData.frameFloatOffset,this._valueCount=s[r+2],this._deformCount=s[r+1],this._deformOffset=s[r+3],this._sameValueOffset=s[r+4]+this._animationData.frameFloatOffset,this._valueScale=this._armature.armatureData.scale,this._valueArray=n.frameFloatArray,this._rd.length=2*this._valueCount}else this._deformCount=this.displayFrame.deformVertices.length},e.prototype.blend=function(t){var e=this.target,a=e.target,i=e.blendWeight,r=this.displayFrame.deformVertices,n=this._valueArray;if(null!==n)for(var s=this._valueCount,o=this._deformOffset,l=this._sameValueOffset,h=this._rd,u=0;u<this._deformCount;++u){var _=0;_=u<o?n[l+u]:u<o+s?h[u-o]:n[l+u-s],e.dirty>1?r[u]+=_*i:r[u]=_*i}else if(1===e.dirty)for(u=0;u<this._deformCount;++u)r[u]=0;(t||this.dirty)&&(this.dirty=!1,a._geometryData===this.displayFrame.getGeometryData()&&(a._verticesDirty=!0))},e}(t.MutilpleValueTimelineState);t.DeformTimelineState=m;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.IKConstraintTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(null!==this._timelineData)e._bendPositive=this._currentA>0,e._weight=this._currentB;else{var a=e._constraintData;e._bendPositive=a.bendPositive,e._weight=a.weight}e.invalidUpdate(),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=.01,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=p;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.currentTime=this._result*e.totalTime),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=c;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.weight=this._result),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=d;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"},e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;null!==e._parent&&(e.parameterX=this._resultA,e.parameterY=this._resultB),this.dirty=!1},e.prototype.init=function(e,a,i){t.prototype.init.call(this,e,a,i),this._valueOffset=this._animationData.frameIntOffset,this._valueScale=1e-4,this._valueArray=this._animationData.parent.parent.frameIntArray},e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=y}(l||(l={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.actionDataToInstance=function(t,a,i){0===t.type?a.type=e.FRAME_EVENT:a.type=10===t.type?e.FRAME_EVENT:e.SOUND_EVENT,a.name=t.name,a.armature=i,a.actionData=t,a.data=t.data,null!==t.bone&&(a.bone=i.getBone(t.bone.name)),null!==t.slot&&(a.slot=i.getSlot(t.slot.name))},e.toString=function(){return"[class dragonBones.EventObject]"},e.prototype._onClear=function(){this.time=0,this.type="",this.name="",this.armature=null,this.bone=null,this.slot=null,this.animationState=null,this.actionData=null,this.data=null},e.START="start",e.LOOP_COMPLETE="loopComplete",e.COMPLETE="complete",e.FADE_IN="fadeIn",e.FADE_IN_COMPLETE="fadeInComplete",e.FADE_OUT="fadeOut",e.FADE_OUT_COMPLETE="fadeOutComplete",e.FRAME_EVENT="frameEvent",e.SOUND_EVENT="soundEvent",e}(t.BaseObject);t.EventObject=e}(l||(l={})),function(t){var e=function(){function t(){}return t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":default:return 0;case"movieclip":return 1}},t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":default:return 0;case"surface":return 1}},t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":default:return 1;case"fixed":return 0}},t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":default:return 0;case"percent":return 2;case"fixed":return 1}},t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":default:return 0;case"chain":return 1;case"chainscale":return 2}},t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":default:return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4}},t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":default:return 0;case"ellipse":return 1;case"polygon":return 2}},t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":default:return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13}},t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":default:return 0;case"1d":return 1}},t._getActionType=function(t){switch(t.toLowerCase()){case"play":default:return 0;case"frame":return 10;case"sound":return 11}},t.DATA_VERSION_2_3="2.3",t.DATA_VERSION_3_0="3.0",t.DATA_VERSION_4_0="4.0",t.DATA_VERSION_4_5="4.5",t.DATA_VERSION_5_0="5.0",t.DATA_VERSION_5_5="5.5",t.DATA_VERSION_5_6="5.6",t.DATA_VERSION=t.DATA_VERSION_5_6,t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6],t.TEXTURE_ATLAS="textureAtlas",t.SUB_TEXTURE="SubTexture",t.FORMAT="format",t.IMAGE_PATH="imagePath",t.WIDTH="width",t.HEIGHT="height",t.ROTATED="rotated",t.FRAME_X="frameX",t.FRAME_Y="frameY",t.FRAME_WIDTH="frameWidth",t.FRAME_HEIGHT="frameHeight",t.DRADON_BONES="dragonBones",t.USER_DATA="userData",t.ARMATURE="armature",t.CANVAS="canvas",t.BONE="bone",t.SURFACE="surface",t.SLOT="slot",t.CONSTRAINT="constraint",t.SKIN="skin",t.DISPLAY="display",t.FRAME="frame",t.IK="ik",t.PATH_CONSTRAINT="path",t.ANIMATION="animation",t.TIMELINE="timeline",t.FFD="ffd",t.TRANSLATE_FRAME="translateFrame",t.ROTATE_FRAME="rotateFrame",t.SCALE_FRAME="scaleFrame",t.DISPLAY_FRAME="displayFrame",t.COLOR_FRAME="colorFrame",t.DEFAULT_ACTIONS="defaultActions",t.ACTIONS="actions",t.EVENTS="events",t.INTS="ints",t.FLOATS="floats",t.STRINGS="strings",t.TRANSFORM="transform",t.PIVOT="pivot",t.AABB="aabb",t.COLOR="color",t.VERSION="version",t.COMPATIBLE_VERSION="compatibleVersion",t.FRAME_RATE="frameRate",t.TYPE="type",t.SUB_TYPE="subType",t.NAME="name",t.PARENT="parent",t.TARGET="target",t.STAGE="stage",t.SHARE="share",t.PATH="path",t.LENGTH="length",t.DISPLAY_INDEX="displayIndex",t.Z_ORDER="zOrder",t.Z_INDEX="zIndex",t.BLEND_MODE="blendMode",t.INHERIT_TRANSLATION="inheritTranslation",t.INHERIT_ROTATION="inheritRotation",t.INHERIT_SCALE="inheritScale",t.INHERIT_REFLECTION="inheritReflection",t.INHERIT_ANIMATION="inheritAnimation",t.INHERIT_DEFORM="inheritDeform",t.SEGMENT_X="segmentX",t.SEGMENT_Y="segmentY",t.BEND_POSITIVE="bendPositive",t.CHAIN="chain",t.WEIGHT="weight",t.BLEND_TYPE="blendType",t.FADE_IN_TIME="fadeInTime",t.PLAY_TIMES="playTimes",t.SCALE="scale",t.OFFSET="offset",t.POSITION="position",t.DURATION="duration",t.TWEEN_EASING="tweenEasing",t.TWEEN_ROTATE="tweenRotate",t.TWEEN_SCALE="tweenScale",t.CLOCK_WISE="clockwise",t.CURVE="curve",t.SOUND="sound",t.EVENT="event",t.ACTION="action",t.X="x",t.Y="y",t.SKEW_X="skX",t.SKEW_Y="skY",t.SCALE_X="scX",t.SCALE_Y="scY",t.VALUE="value",t.ROTATE="rotate",t.SKEW="skew",t.ALPHA="alpha",t.ALPHA_OFFSET="aO",t.RED_OFFSET="rO",t.GREEN_OFFSET="gO",t.BLUE_OFFSET="bO",t.ALPHA_MULTIPLIER="aM",t.RED_MULTIPLIER="rM",t.GREEN_MULTIPLIER="gM",t.BLUE_MULTIPLIER="bM",t.UVS="uvs",t.VERTICES="vertices",t.TRIANGLES="triangles",t.WEIGHTS="weights",t.SLOT_POSE="slotPose",t.BONE_POSE="bonePose",t.BONES="bones",t.POSITION_MODE="positionMode",t.SPACING_MODE="spacingMode",t.ROTATE_MODE="rotateMode",t.SPACING="spacing",t.ROTATE_OFFSET="rotateOffset",t.ROTATE_MIX="rotateMix",t.TRANSLATE_MIX="translateMix",t.TARGET_DISPLAY="targetDisplay",t.CLOSED="closed",t.CONSTANT_SPEED="constantSpeed",t.VERTEX_COUNT="vertexCount",t.LENGTHS="lengths",t.GOTO_AND_PLAY="gotoAndPlay",t.DEFAULT_NAME="default",t}();t.DataParser=e}(l||(l={})),function(t){var e=function(e){function i(){var a=null!==e&&e.apply(this,arguments)||this;return a._rawTextureAtlasIndex=0,a._rawBones=[],a._data=null,a._armature=null,a._bone=null,a._geometry=null,a._slot=null,a._skin=null,a._mesh=null,a._animation=null,a._timeline=null,a._rawTextureAtlases=null,a._frameValueType=0,a._defaultColorOffset=-1,a._prevClockwise=0,a._prevRotation=0,a._frameDefaultValue=0,a._frameValueScale=1,a._helpMatrixA=new t.Matrix,a._helpMatrixB=new t.Matrix,a._helpTransform=new t.Transform,a._helpColorTransform=new t.ColorTransform,a._helpPoint=new t.Point,a._helpArray=[],a._intArray=[],a._floatArray=[],a._frameIntArray=[],a._frameFloatArray=[],a._frameArray=[],a._timelineArray=[],a._colorArray=[],a._cacheRawMeshes=[],a._cacheMeshes=[],a._actionFrames=[],a._weightSlotPose={},a._weightBonePoses={},a._cacheBones={},a._slotChildActions={},a}return f(i,e),i._getBoolean=function(t,e,a){if(e in t){var i=t[e],r=typeof i;if("boolean"===r)return i;if("string"!==r)return!!i;switch(i){case"0":case"NaN":case"":case"false":case"null":case"undefined":return!1;default:return!0}}return a},i._getNumber=function(t,e,a){if(e in t){var i=t[e];return null===i||"NaN"===i?a:+i||0}return a},i._getString=function(t,e,a){if(e in t){var i=t[e];return"string"===typeof i?i:String(i)}return a},i.prototype._getCurvePoint=function(t,e,a,i,r,n,s,o,l,h){var u=1-l,_=u*u,f=l*l,m=u*_,p=3*l*_,c=3*u*f,d=l*f;h.x=m*t+p*a+c*r+d*s,h.y=m*e+p*i+c*n+d*o},i.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3==1){for(var i=-2,r=0,n=e.length;r<n;++r){for(var s=(r+1)/(n+1);(i+6<a?t[i+6]:1)<s;)i+=6;for(var o=i>=0&&i+6<a,l=o?t[i]:0,h=o?t[i+1]:0,u=t[i+2],_=t[i+3],f=t[i+4],m=t[i+5],p=o?t[i+6]:1,c=o?t[i+7]:1,d=0,y=1;y-d>1e-4;){var g=.5*(y+d);this._getCurvePoint(l,h,u,_,f,m,p,c,g,this._helpPoint),s-this._helpPoint.x>0?d=g:y=g}e[r]=this._helpPoint.y}return!0}for(i=0,r=0,n=e.length;r<n;++r){for(s=(r+1)/(n+1);t[i+6]<s;)i+=6;for(l=t[i],h=t[i+1],u=t[i+2],_=t[i+3],f=t[i+4],m=t[i+5],p=t[i+6],c=t[i+7],d=0,y=1;y-d>1e-4;){g=.5*(y+d);this._getCurvePoint(l,h,u,_,f,m,p,c,g,this._helpPoint),s-this._helpPoint.x>0?d=g:y=g}e[r]=this._helpPoint.y}return!1},i.prototype._parseActionDataInFrame=function(e,a,i,r){t.DataParser.EVENT in e&&this._mergeActionFrame(e[t.DataParser.EVENT],a,10,i,r),t.DataParser.SOUND in e&&this._mergeActionFrame(e[t.DataParser.SOUND],a,11,i,r),t.DataParser.ACTION in e&&this._mergeActionFrame(e[t.DataParser.ACTION],a,0,i,r),t.DataParser.EVENTS in e&&this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,i,r),t.DataParser.ACTIONS in e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,i,r)},i.prototype._mergeActionFrame=function(t,e,i,r,n){for(var s=this._armature.actions.length,o=this._parseActionData(t,i,r,n),l=0,h=null,u=0,_=o;u<_.length;u++){var f=_[u];this._armature.addAction(f,!1)}0===this._actionFrames.length&&((h=new a).frameStart=0,this._actionFrames.push(h),h=null);for(var m=0,p=this._actionFrames;m<p.length;m++){var c=p[m];if(c.frameStart===e){h=c;break}if(c.frameStart>e)break;l++}null===h&&((h=new a).frameStart=e,this._actionFrames.splice(l,0,h));for(var d=0;d<o.length;++d)h.actions.push(s+d)},i.prototype._parseArmature=function(e,a){var r=t.BaseObject.borrowObject(t.ArmatureData);if(r.name=i._getString(e,t.DataParser.NAME,""),r.frameRate=i._getNumber(e,t.DataParser.FRAME_RATE,this._data.frameRate),r.scale=a,t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?r.type=t.DataParser._getArmatureType(e[t.DataParser.TYPE]):r.type=i._getNumber(e,t.DataParser.TYPE,0),0===r.frameRate&&(r.frameRate=24),this._armature=r,t.DataParser.CANVAS in e){var n=e[t.DataParser.CANVAS],s=t.BaseObject.borrowObject(t.CanvasData);t.DataParser.COLOR in n?s.hasBackground=!0:s.hasBackground=!1,s.color=i._getNumber(n,t.DataParser.COLOR,0),s.x=i._getNumber(n,t.DataParser.X,0)*r.scale,s.y=i._getNumber(n,t.DataParser.Y,0)*r.scale,s.width=i._getNumber(n,t.DataParser.WIDTH,0)*r.scale,s.height=i._getNumber(n,t.DataParser.HEIGHT,0)*r.scale,r.canvas=s}if(t.DataParser.AABB in e){var o=e[t.DataParser.AABB];r.aabb.x=i._getNumber(o,t.DataParser.X,0)*r.scale,r.aabb.y=i._getNumber(o,t.DataParser.Y,0)*r.scale,r.aabb.width=i._getNumber(o,t.DataParser.WIDTH,0)*r.scale,r.aabb.height=i._getNumber(o,t.DataParser.HEIGHT,0)*r.scale}if(t.DataParser.BONE in e)for(var l=0,h=e[t.DataParser.BONE];l<h.length;l++){var u=h[l],_=i._getString(u,t.DataParser.PARENT,""),f=this._parseBone(u);if(_.length>0){var m=r.getBone(_);null!==m?f.parent=m:(_ in this._cacheBones||(this._cacheBones[_]=[]),this._cacheBones[_].push(f))}if(f.name in this._cacheBones){for(var p=0,c=this._cacheBones[f.name];p<c.length;p++){c[p].parent=f}delete this._cacheBones[f.name]}r.addBone(f),this._rawBones.push(f)}if(t.DataParser.IK in e)for(var d=0,y=e[t.DataParser.IK];d<y.length;d++){var g=y[d];(E=this._parseIKConstraint(g))&&r.addConstraint(E)}if(r.sortBones(),t.DataParser.SLOT in e)for(var D=0,v=0,T=e[t.DataParser.SLOT];v<T.length;v++){var b=T[v];r.addSlot(this._parseSlot(b,D++))}if(t.DataParser.SKIN in e)for(var A=0,P=e[t.DataParser.SKIN];A<P.length;A++){var S=P[A];r.addSkin(this._parseSkin(S))}if(t.DataParser.PATH_CONSTRAINT in e)for(var O=0,x=e[t.DataParser.PATH_CONSTRAINT];O<x.length;O++){var E,M=x[O];(E=this._parsePathConstraint(M))&&r.addConstraint(E)}for(var B=0,I=this._cacheRawMeshes.length;B<I;++B){var F=this._cacheRawMeshes[B],C=i._getString(F,t.DataParser.SHARE,"");if(0!==C.length){var w=i._getString(F,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME);0===w.length&&(w=t.DataParser.DEFAULT_NAME);var N=r.getMesh(w,"",C);if(null!==N)this._cacheMeshes[B].geometry.shareFrom(N.geometry)}}if(t.DataParser.ANIMATION in e)for(var R=0,j=e[t.DataParser.ANIMATION];R<j.length;R++){var k=j[R],L=this._parseAnimation(k);r.addAnimation(L)}if(t.DataParser.DEFAULT_ACTIONS in e)for(var V=0,Y=this._parseActionData(e[t.DataParser.DEFAULT_ACTIONS],0,null,null);V<Y.length;V++){var U=Y[V];if(r.addAction(U,!0),0===U.type)null!==(L=r.getAnimation(U.name))&&(r.defaultAnimation=L)}if(t.DataParser.ACTIONS in e)for(var X=0,G=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);X<G.length;X++){U=G[X];r.addAction(U,!1)}for(var H in this._rawBones.length=0,this._cacheRawMeshes.length=0,this._cacheMeshes.length=0,this._armature=null,this._weightSlotPose)delete this._weightSlotPose[H];for(var H in this._weightBonePoses)delete this._weightBonePoses[H];for(var H in this._cacheBones)delete this._cacheBones[H];for(var H in this._slotChildActions)delete this._slotChildActions[H];return r},i.prototype._parseBone=function(e){if(0===(t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getBoneType(e[t.DataParser.TYPE]):i._getNumber(e,t.DataParser.TYPE,0))){var a=this._armature.scale,r=t.BaseObject.borrowObject(t.BoneData);return r.inheritTranslation=i._getBoolean(e,t.DataParser.INHERIT_TRANSLATION,!0),r.inheritRotation=i._getBoolean(e,t.DataParser.INHERIT_ROTATION,!0),r.inheritScale=i._getBoolean(e,t.DataParser.INHERIT_SCALE,!0),r.inheritReflection=i._getBoolean(e,t.DataParser.INHERIT_REFLECTION,!0),r.length=i._getNumber(e,t.DataParser.LENGTH,0)*a,r.alpha=i._getNumber(e,t.DataParser.ALPHA,1),r.name=i._getString(e,t.DataParser.NAME,""),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],r.transform,a),r}var n=t.BaseObject.borrowObject(t.SurfaceData);return n.alpha=i._getNumber(e,t.DataParser.ALPHA,1),n.name=i._getString(e,t.DataParser.NAME,""),n.segmentX=i._getNumber(e,t.DataParser.SEGMENT_X,0),n.segmentY=i._getNumber(e,t.DataParser.SEGMENT_Y,0),this._parseGeometry(e,n.geometry),n},i.prototype._parseIKConstraint=function(e){var a=this._armature.getBone(i._getString(e,t.DataParser.BONE,""));if(null===a)return null;var r=this._armature.getBone(i._getString(e,t.DataParser.TARGET,""));if(null===r)return null;var n=i._getNumber(e,t.DataParser.CHAIN,0),s=t.BaseObject.borrowObject(t.IKConstraintData);return s.scaleEnabled=i._getBoolean(e,t.DataParser.SCALE,!1),s.bendPositive=i._getBoolean(e,t.DataParser.BEND_POSITIVE,!0),s.weight=i._getNumber(e,t.DataParser.WEIGHT,1),s.name=i._getString(e,t.DataParser.NAME,""),s.type=0,s.target=r,n>0&&null!==a.parent?(s.root=a.parent,s.bone=a):(s.root=a,s.bone=null),s},i.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(i._getString(e,t.DataParser.TARGET,""));if(null===a)return null;var r=this._armature.defaultSkin;if(null===r)return null;var n=r.getDisplay(a.name,i._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(null===n||!(n instanceof t.PathDisplayData))return null;var s=e[t.DataParser.BONES];if(null===s||0===s.length)return null;var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=i._getString(e,t.DataParser.NAME,""),o.type=1,o.pathSlot=a,o.pathDisplayData=n,o.target=a.parent,o.positionMode=t.DataParser._getPositionMode(i._getString(e,t.DataParser.POSITION_MODE,"")),o.spacingMode=t.DataParser._getSpacingMode(i._getString(e,t.DataParser.SPACING_MODE,"")),o.rotateMode=t.DataParser._getRotateMode(i._getString(e,t.DataParser.ROTATE_MODE,"")),o.position=i._getNumber(e,t.DataParser.POSITION,0),o.spacing=i._getNumber(e,t.DataParser.SPACING,0),o.rotateOffset=i._getNumber(e,t.DataParser.ROTATE_OFFSET,0),o.rotateMix=i._getNumber(e,t.DataParser.ROTATE_MIX,1),o.translateMix=i._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l<h.length;l++){var u=h[l],_=this._armature.getBone(u);null!==_&&(o.AddBone(_),null===o.root&&(o.root=_))}return o},i.prototype._parseSlot=function(e,a){var r=t.BaseObject.borrowObject(t.SlotData);return r.displayIndex=i._getNumber(e,t.DataParser.DISPLAY_INDEX,0),r.zOrder=a,r.zIndex=i._getNumber(e,t.DataParser.Z_INDEX,0),r.alpha=i._getNumber(e,t.DataParser.ALPHA,1),r.name=i._getString(e,t.DataParser.NAME,""),r.parent=this._armature.getBone(i._getString(e,t.DataParser.PARENT,"")),t.DataParser.BLEND_MODE in e&&"string"==typeof e[t.DataParser.BLEND_MODE]?r.blendMode=t.DataParser._getBlendMode(e[t.DataParser.BLEND_MODE]):r.blendMode=i._getNumber(e,t.DataParser.BLEND_MODE,0),t.DataParser.COLOR in e?(r.color=t.SlotData.createColor(),this._parseColorTransform(e[t.DataParser.COLOR],r.color)):r.color=t.SlotData.DEFAULT_COLOR,t.DataParser.ACTIONS in e&&(this._slotChildActions[r.name]=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null)),r},i.prototype._parseSkin=function(e){var a=t.BaseObject.borrowObject(t.SkinData);if(a.name=i._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME),t.DataParser.SLOT in e){var r=e[t.DataParser.SLOT];this._skin=a;for(var n=0,s=r;n<s.length;n++){var o=s[n],l=i._getString(o,t.DataParser.NAME,""),h=this._armature.getSlot(l);if(null!==h){if(this._slot=h,t.DataParser.DISPLAY in o)for(var u=0,_=o[t.DataParser.DISPLAY];u<_.length;u++){var f=_[u];f?a.addDisplay(l,this._parseDisplay(f)):a.addDisplay(l,null)}this._slot=null}}this._skin=null}return a},i.prototype._parseDisplay=function(e){var a=i._getString(e,t.DataParser.NAME,""),r=i._getString(e,t.DataParser.PATH,""),n=0,s=null;switch(n=t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?t.DataParser._getDisplayType(e[t.DataParser.TYPE]):i._getNumber(e,t.DataParser.TYPE,n)){case 0:var o=s=t.BaseObject.borrowObject(t.ImageDisplayData);o.name=a,o.path=r.length>0?r:a,this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(l.name=a,l.path=r.length>0?r:a,l.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var h=0,u=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);h<u.length;h++){var _=u[h];l.addAction(_)}else if(this._slot.name in this._slotChildActions){var f=this._skin.getDisplays(this._slot.name);if(null===f?0===this._slot.displayIndex:this._slot.displayIndex===f.length){for(var m=0,p=this._slotChildActions[this._slot.name];m<p.length;m++){_=p[m];l.addAction(_)}delete this._slotChildActions[this._slot.name]}}break;case 2:var c=s=t.BaseObject.borrowObject(t.MeshDisplayData);c.geometry.inheritDeform=i._getBoolean(e,t.DataParser.INHERIT_DEFORM,!0),c.name=a,c.path=r.length>0?r:a,t.DataParser.SHARE in e?(c.geometry.data=this._data,this._cacheRawMeshes.push(e),this._cacheMeshes.push(c)):this._parseMesh(e,c);break;case 3:var d=this._parseBoundingBox(e);if(null!==d){var y=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);y.name=a,y.path=r.length>0?r:a,y.boundingBox=d}break;case 4:var g=e[t.DataParser.LENGTHS],D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=i._getBoolean(e,t.DataParser.CLOSED,!1),D.constantSpeed=i._getBoolean(e,t.DataParser.CONSTANT_SPEED,!1),D.name=a,D.path=r.length>0?r:a,D.curveLengths.length=g.length;for(var v=0,T=g.length;v<T;++v)D.curveLengths[v]=g[v];this._parsePath(e,D)}return null!==s&&t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],s.transform,this._armature.scale),s},i.prototype._parsePath=function(t,e){this._parseGeometry(t,e.geometry)},i.prototype._parsePivot=function(e,a){if(t.DataParser.PIVOT in e){var r=e[t.DataParser.PIVOT];a.pivot.x=i._getNumber(r,t.DataParser.X,0),a.pivot.y=i._getNumber(r,t.DataParser.Y,0)}else a.pivot.x=.5,a.pivot.y=.5},i.prototype._parseMesh=function(e,a){if(this._parseGeometry(e,a.geometry),t.DataParser.WEIGHTS in e){var i=e[t.DataParser.SLOT_POSE],r=e[t.DataParser.BONE_POSE],n=this._skin.name+"_"+this._slot.name+"_"+a.name;this._weightSlotPose[n]=i,this._weightBonePoses[n]=r}},i.prototype._parseBoundingBox=function(e){var a=null,r=0;switch(r=t.DataParser.SUB_TYPE in e&&"string"==typeof e[t.DataParser.SUB_TYPE]?t.DataParser._getBoundingBoxType(e[t.DataParser.SUB_TYPE]):i._getNumber(e,t.DataParser.SUB_TYPE,r)){case 0:a=t.BaseObject.borrowObject(t.RectangleBoundingBoxData);break;case 1:a=t.BaseObject.borrowObject(t.EllipseBoundingBoxData);break;case 2:a=this._parsePolygonBoundingBox(e)}return null!==a&&(a.color=i._getNumber(e,t.DataParser.COLOR,0),0!==a.type&&1!==a.type||(a.width=i._getNumber(e,t.DataParser.WIDTH,0),a.height=i._getNumber(e,t.DataParser.HEIGHT,0))),a},i.prototype._parsePolygonBoundingBox=function(e){var a=t.BaseObject.borrowObject(t.PolygonBoundingBoxData);if(t.DataParser.VERTICES in e){var i=this._armature.scale,r=e[t.DataParser.VERTICES],n=a.vertices;n.length=r.length;for(var s=0,o=r.length;s<o;s+=2){var l=r[s]*i,h=r[s+1]*i;n[s]=l,n[s+1]=h,0===s?(a.x=l,a.y=h,a.width=l,a.height=h):(l<a.x?a.x=l:l>a.width&&(a.width=l),h<a.y?a.y=h:h>a.height&&(a.height=h))}a.width-=a.x,a.height-=a.y}else console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.");return a},i.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);if(a.blendType=t.DataParser._getAnimationBlendType(i._getString(e,t.DataParser.BLEND_TYPE,"")),a.frameCount=i._getNumber(e,t.DataParser.DURATION,0),a.playTimes=i._getNumber(e,t.DataParser.PLAY_TIMES,1),a.duration=a.frameCount/this._armature.frameRate,a.fadeInTime=i._getNumber(e,t.DataParser.FADE_IN_TIME,0),a.scale=i._getNumber(e,t.DataParser.SCALE,1),a.name=i._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME),a.frameIntOffset=this._frameIntArray.length,a.frameFloatOffset=this._frameFloatArray.length,a.frameOffset=this._frameArray.length,this._animation=a,t.DataParser.FRAME in e){var r=e[t.DataParser.FRAME],n=r.length;if(n>0)for(var s=0,o=0;s<n;++s){var l=r[s];this._parseActionDataInFrame(l,o,null,null),o+=i._getNumber(l,t.DataParser.DURATION,1)}}if(t.DataParser.Z_ORDER in e&&(this._animation.zOrderTimeline=this._parseTimeline(e[t.DataParser.Z_ORDER],null,t.DataParser.FRAME,1,0,0,this._parseZOrderFrame)),t.DataParser.BONE in e)for(var h=0,u=e[t.DataParser.BONE];h<u.length;h++){var _=u[h];this._parseBoneTimeline(_)}if(t.DataParser.SLOT in e)for(var f=0,m=e[t.DataParser.SLOT];f<m.length;f++){_=m[f];this._parseSlotTimeline(_)}if(t.DataParser.FFD in e)for(var p=0,c=e[t.DataParser.FFD];p<c.length;p++){_=c[p];var d=i._getString(_,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME),y=i._getString(_,t.DataParser.SLOT,""),g=i._getString(_,t.DataParser.NAME,"");if(0===d.length&&(d=t.DataParser.DEFAULT_NAME),this._slot=this._armature.getSlot(y),this._mesh=this._armature.getMesh(d,y,g),null!==this._slot&&null!==this._mesh)null!==(O=this._parseTimeline(_,null,t.DataParser.FRAME,22,2,0,this._parseSlotDeformFrame))&&this._animation.addSlotTimeline(y,O),this._slot=null,this._mesh=null}if(t.DataParser.IK in e)for(var D=0,v=e[t.DataParser.IK];D<v.length;D++){_=v[D];var T=i._getString(_,t.DataParser.NAME,"");if(null!==this._armature.getConstraint(T))null!==(O=this._parseTimeline(_,null,t.DataParser.FRAME,30,1,2,this._parseIKConstraintFrame))&&this._animation.addConstraintTimeline(T,O)}if(this._actionFrames.length>0&&(this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame),this._actionFrames.length=0),t.DataParser.TIMELINE in e)for(var b=0,A=e[t.DataParser.TIMELINE];b<A.length;b++){_=A[b];var P=i._getNumber(_,t.DataParser.TYPE,0),S=i._getString(_,t.DataParser.NAME,""),O=null;switch(P){case 0:case 1:break;case 20:case 23:case 60:case 24:case 40:case 41:if(20===P?(this._frameValueType=0,this._frameValueScale=1):(this._frameValueType=1,this._frameValueScale=23===P?1:40===P||41===P?1e4:100),this._frameDefaultValue=60===P||24===P||41===P?1:0,40===P&&0!==a.blendType){var x=O=t.BaseObject.borrowObject(t.AnimationTimelineData);x.x=i._getNumber(_,t.DataParser.X,0),x.y=i._getNumber(_,t.DataParser.Y,0)}O=this._parseTimeline(_,null,t.DataParser.FRAME,P,this._frameValueType,1,this._parseSingleValueFrame,O);break;case 11:case 12:case 13:case 30:case 42:30===P||42===P?(this._frameValueType=1,this._frameValueScale=42===P?1e4:100):(this._frameValueScale=12===P?t.Transform.DEG_RAD:1,this._frameValueType=2),this._frameDefaultValue=13===P||30===P?1:0,O=this._parseTimeline(_,null,t.DataParser.FRAME,P,this._frameValueType,2,this._parseDoubleValueFrame);break;case 50:var E=this._armature.getBone(S);if(null===E)continue;this._geometry=E.geometry,O=this._parseTimeline(_,null,t.DataParser.FRAME,P,2,0,this._parseDeformFrame),this._geometry=null;break;case 22:for(var d in this._geometry=null,this._armature.skins){var M=this._armature.skins[d];for(var B in M.displays)for(var I=0,F=M.displays[B];I<F.length;I++){var C=F[I];if(null!==C&&C.name===S){this._geometry=C.geometry;break}}}if(null===this._geometry)continue;O=this._parseTimeline(_,null,t.DataParser.FRAME,P,2,0,this._parseDeformFrame),this._geometry=null;break;case 21:O=this._parseTimeline(_,null,t.DataParser.FRAME,P,1,1,this._parseSlotColorFrame)}if(null!==O)switch(P){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(S,O);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(S,O);break;case 30:this._animation.addConstraintTimeline(S,O);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(S,O)}}return this._animation=null,a},i.prototype._parseTimeline=function(e,r,n,s,o,l,h,u){if(void 0===u&&(u=null),null!==e&&n.length>0&&n in e&&(r=e[n]),null===r)return null;var _=r.length;if(0===_)return null;var f=this._frameIntArray.length,m=this._frameFloatArray.length,p=this._timelineArray.length;switch(null===u&&(u=t.BaseObject.borrowObject(t.TimelineData)),u.type=s,u.offset=p,this._frameValueType=o,this._timeline=u,this._timelineArray.length+=5+_,null!==e?(this._timelineArray[p+0]=Math.round(100*i._getNumber(e,t.DataParser.SCALE,1)),this._timelineArray[p+1]=Math.round(100*i._getNumber(e,t.DataParser.OFFSET,0))):(this._timelineArray[p+0]=100,this._timelineArray[p+1]=0),this._timelineArray[p+2]=_,this._timelineArray[p+3]=l,this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=f-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset}if(1===_)u.frameIndicesOffset=-1,this._timelineArray[p+5+0]=h.call(this,r[0],0,0)-this._animation.frameOffset;else{var c=this._animation.frameCount+1,d=this._data.frameIndices,y=d.length;d.length+=c,u.frameIndicesOffset=y;for(var g=0,D=0,v=0,T=0;g<c;++g){if(v+T<=g&&D<_){var b=r[D];v=g,T=D===_-1?this._animation.frameCount-v:b instanceof a?this._actionFrames[D+1].frameStart-v:i._getNumber(b,t.DataParser.DURATION,1),this._timelineArray[p+5+D]=h.call(this,b,v,T)-this._animation.frameOffset,D++}d[y+g]=D-1}}return this._timeline=null,u},i.prototype._parseBoneTimeline=function(e){var a=this._armature.getBone(i._getString(e,t.DataParser.NAME,""));if(null!==a){var r;if(this._bone=a,this._slot=this._armature.getSlot(this._bone.name),t.DataParser.TRANSLATE_FRAME in e)this._frameDefaultValue=0,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.TRANSLATE_FRAME,11,2,2,this._parseDoubleValueFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.ROTATE_FRAME in e)this._frameDefaultValue=0,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.ROTATE_FRAME,12,2,2,this._parseBoneRotateFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.SCALE_FRAME in e)this._frameDefaultValue=1,this._frameValueScale=1,null!==(r=this._parseTimeline(e,null,t.DataParser.SCALE_FRAME,13,2,2,this._parseBoneScaleFrame))&&this._animation.addBoneTimeline(a.name,r);if(t.DataParser.FRAME in e)null!==(r=this._parseTimeline(e,null,t.DataParser.FRAME,10,2,6,this._parseBoneAllFrame))&&this._animation.addBoneTimeline(a.name,r);this._bone=null,this._slot=null}},i.prototype._parseSlotTimeline=function(e){var a=this._armature.getSlot(i._getString(e,t.DataParser.NAME,""));if(null!==a){var r=null,n=null;this._slot=a,r=t.DataParser.DISPLAY_FRAME in e?this._parseTimeline(e,null,t.DataParser.DISPLAY_FRAME,20,0,0,this._parseSlotDisplayFrame):this._parseTimeline(e,null,t.DataParser.FRAME,20,0,0,this._parseSlotDisplayFrame),n=t.DataParser.COLOR_FRAME in e?this._parseTimeline(e,null,t.DataParser.COLOR_FRAME,21,1,1,this._parseSlotColorFrame):this._parseTimeline(e,null,t.DataParser.FRAME,21,1,1,this._parseSlotColorFrame),null!==r&&this._animation.addSlotTimeline(a.name,r),null!==n&&this._animation.addSlotTimeline(a.name,n),this._slot=null}},i.prototype._parseFrame=function(t,e,a){var i=this._frameArray.length;return this._frameArray.length+=1,this._frameArray[i+0]=e,i},i.prototype._parseTweenFrame=function(e,a,r){var n=this._parseFrame(e,a,r);if(r>0)if(t.DataParser.CURVE in e){var s=r+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=2+this._helpArray.length,this._frameArray[n+1]=2,this._frameArray[n+2]=o?s:-s;for(var l=0;l<s;++l)this._frameArray[n+3+l]=Math.round(1e4*this._helpArray[l])}else{var h=-2;t.DataParser.TWEEN_EASING in e&&(h=i._getNumber(e,t.DataParser.TWEEN_EASING,-2)),-2===h?(this._frameArray.length+=1,this._frameArray[n+1]=0):0===h?(this._frameArray.length+=1,this._frameArray[n+1]=1):h<0?(this._frameArray.length+=2,this._frameArray[n+1]=3,this._frameArray[n+2]=Math.round(100*-h)):h<=1?(this._frameArray.length+=2,this._frameArray[n+1]=4,this._frameArray[n+2]=Math.round(100*h)):(this._frameArray.length+=2,this._frameArray[n+1]=5,this._frameArray[n+2]=Math.round(100*h-100))}else this._frameArray.length+=1,this._frameArray[n+1]=0;return n},i.prototype._parseSingleValueFrame=function(e,a,r){var n=0;switch(this._frameValueType){case 0:n=this._parseFrame(e,a,r),this._frameArray.length+=1,this._frameArray[n+1]=i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue);break;case 1:n=this._parseTweenFrame(e,a,r);var s=this._frameIntArray.length;this._frameIntArray.length+=1,this._frameIntArray[s]=Math.round(i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue)*this._frameValueScale);break;case 2:n=this._parseTweenFrame(e,a,r);s=this._frameFloatArray.length;this._frameFloatArray.length+=1,this._frameFloatArray[s]=i._getNumber(e,t.DataParser.VALUE,this._frameDefaultValue)*this._frameValueScale}return n},i.prototype._parseDoubleValueFrame=function(e,a,r){var n=0;switch(this._frameValueType){case 0:n=this._parseFrame(e,a,r),this._frameArray.length+=2,this._frameArray[n+1]=i._getNumber(e,t.DataParser.X,this._frameDefaultValue),this._frameArray[n+2]=i._getNumber(e,t.DataParser.Y,this._frameDefaultValue);break;case 1:n=this._parseTweenFrame(e,a,r);var s=this._frameIntArray.length;this._frameIntArray.length+=2,this._frameIntArray[s]=Math.round(i._getNumber(e,t.DataParser.X,this._frameDefaultValue)*this._frameValueScale),this._frameIntArray[s+1]=Math.round(i._getNumber(e,t.DataParser.Y,this._frameDefaultValue)*this._frameValueScale);break;case 2:n=this._parseTweenFrame(e,a,r);s=this._frameFloatArray.length;this._frameFloatArray.length+=2,this._frameFloatArray[s]=i._getNumber(e,t.DataParser.X,this._frameDefaultValue)*this._frameValueScale,this._frameFloatArray[s+1]=i._getNumber(e,t.DataParser.Y,this._frameDefaultValue)*this._frameValueScale}return n},i.prototype._parseActionFrame=function(t,e,a){var i=this._frameArray.length,r=t.actions.length;this._frameArray.length+=2+r,this._frameArray[i+0]=e,this._frameArray[i+0+1]=r;for(var n=0;n<r;++n)this._frameArray[i+0+2+n]=t.actions[n];return i},i.prototype._parseZOrderFrame=function(e,a,i){var r=this._parseFrame(e,a,i);if(t.DataParser.Z_ORDER in e){var n=e[t.DataParser.Z_ORDER];if(n.length>0){for(var s=this._armature.sortedSlots.length,o=new Array(s-n.length/2),l=new Array(s),h=0;h<o.length;++h)o[h]=0;for(var u=0;u<s;++u)l[u]=-1;for(var _=0,f=0,m=0,p=n.length;m<p;m+=2){for(var c=n[m],d=n[m+1];_!==c;)o[f++]=_++;l[_+d]=_++}for(;_<s;)o[f++]=_++;this._frameArray.length+=1+s,this._frameArray[r+1]=s;for(var y=s;y--;)-1===l[y]?this._frameArray[r+2+y]=o[--f]||0:this._frameArray[r+2+y]=l[y]||0;return r}}return this._frameArray.length+=1,this._frameArray[r+1]=0,r},i.prototype._parseBoneAllFrame=function(e,a,r){this._helpTransform.identity(),t.DataParser.TRANSFORM in e&&this._parseTransform(e[t.DataParser.TRANSFORM],this._helpTransform,1);var n=this._helpTransform.rotation;0!==a&&(0===this._prevClockwise?n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation):((this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=i._getNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=n;var s=this._parseTweenFrame(e,a,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=6,this._frameFloatArray[o++]=this._helpTransform.x,this._frameFloatArray[o++]=this._helpTransform.y,this._frameFloatArray[o++]=n,this._frameFloatArray[o++]=this._helpTransform.skew,this._frameFloatArray[o++]=this._helpTransform.scaleX,this._frameFloatArray[o++]=this._helpTransform.scaleY,this._parseActionDataInFrame(e,a,this._bone,this._slot),s},i.prototype._parseBoneTranslateFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.X,0),this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.Y,0),n},i.prototype._parseBoneRotateFrame=function(e,a,r){var n=i._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!==a&&(0===this._prevClockwise?n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation):((this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation)&&(this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1),n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=i._getNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=n;var s=this._parseTweenFrame(e,a,r),o=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[o++]=n,this._frameFloatArray[o++]=i._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,s},i.prototype._parseBoneScaleFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameFloatArray.length;return this._frameFloatArray.length+=2,this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.X,1),this._frameFloatArray[s++]=i._getNumber(e,t.DataParser.Y,1),n},i.prototype._parseSlotDisplayFrame=function(e,a,r){var n=this._parseFrame(e,a,r);return this._frameArray.length+=1,t.DataParser.VALUE in e?this._frameArray[n+1]=i._getNumber(e,t.DataParser.VALUE,0):this._frameArray[n+1]=i._getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,a,this._slot.parent,this._slot),n},i.prototype._parseSlotColorFrame=function(e,a,i){var r=this._parseTweenFrame(e,a,i),n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){this._parseColorTransform(s,this._helpColorTransform),n=this._colorArray.length,this._colorArray.length+=8,this._colorArray[n++]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.redMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.greenMultiplier),this._colorArray[n++]=Math.round(100*this._helpColorTransform.blueMultiplier),this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset),this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset),n-=8;break}}n<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=n=this._colorArray.length,this._colorArray.length+=8,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=100,this._colorArray[n++]=0,this._colorArray[n++]=0,this._colorArray[n++]=0,this._colorArray[n++]=0),n=this._defaultColorOffset);var l=this._frameIntArray.length;return this._frameIntArray.length+=1,this._frameIntArray[l]=n,r},i.prototype._parseSlotDeformFrame=function(e,a,r){var n=this._frameFloatArray.length,s=this._parseTweenFrame(e,a,r),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null,l=i._getNumber(e,t.DataParser.OFFSET,0),h=this._intArray[this._mesh.geometry.offset+0],u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name,_=this._mesh.geometry.weight,f=0,m=0,p=0,c=0;if(null!==_){var d=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(d,0),this._frameFloatArray.length+=2*_.count,p=_.offset+2+_.bones.length}else this._frameFloatArray.length+=2*h;for(var y=0;y<2*h;y+=2)if(null===o?(f=0,m=0):(f=y<l||y-l>=o.length?0:o[y-l],m=y+1<l||y+1-l>=o.length?0:o[y+1-l]),null!==_){var g=this._weightBonePoses[u],D=this._intArray[p++];this._helpMatrixA.transformPoint(f,m,this._helpPoint,!0),f=this._helpPoint.x,m=this._helpPoint.y;for(var v=0;v<D;++v){var T=this._intArray[p++];this._helpMatrixB.copyFromArray(g,7*T+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(f,m,this._helpPoint,!0),this._frameFloatArray[n+c++]=this._helpPoint.x,this._frameFloatArray[n+c++]=this._helpPoint.y}}else this._frameFloatArray[n+y]=f,this._frameFloatArray[n+y+1]=m;if(0===a){var b=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[b+0]=this._mesh.geometry.offset,this._frameIntArray[b+1]=this._frameFloatArray.length-n,this._frameIntArray[b+2]=this._frameFloatArray.length-n,this._frameIntArray[b+3]=0,this._frameIntArray[b+4]=n-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=b-this._animation.frameIntOffset}return s},i.prototype._parseIKConstraintFrame=function(e,a,r){var n=this._parseTweenFrame(e,a,r),s=this._frameIntArray.length;return this._frameIntArray.length+=2,this._frameIntArray[s++]=i._getBoolean(e,t.DataParser.BEND_POSITIVE,!0)?1:0,this._frameIntArray[s++]=Math.round(100*i._getNumber(e,t.DataParser.WEIGHT,1)),n},i.prototype._parseActionData=function(e,a,r,n){var s=new Array;if("string"==typeof e)(u=t.BaseObject.borrowObject(t.ActionData)).type=a,u.name=e,u.bone=r,u.slot=n,s.push(u);else if(e instanceof Array)for(var o=0,l=e;o<l.length;o++){var h=l[o],u=t.BaseObject.borrowObject(t.ActionData);if(t.DataParser.GOTO_AND_PLAY in h?(u.type=0,u.name=i._getString(h,t.DataParser.GOTO_AND_PLAY,"")):(t.DataParser.TYPE in h&&"string"==typeof h[t.DataParser.TYPE]?u.type=t.DataParser._getActionType(h[t.DataParser.TYPE]):u.type=i._getNumber(h,t.DataParser.TYPE,a),u.name=i._getString(h,t.DataParser.NAME,"")),t.DataParser.BONE in h){var _=i._getString(h,t.DataParser.BONE,"");u.bone=this._armature.getBone(_)}else u.bone=r;if(t.DataParser.SLOT in h){var f=i._getString(h,t.DataParser.SLOT,"");u.slot=this._armature.getSlot(f)}else u.slot=n;var m=null;if(t.DataParser.INTS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var p=0,c=h[t.DataParser.INTS];p<c.length;p++){var d=c[p];m.addInt(d)}}if(t.DataParser.FLOATS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var y=0,g=h[t.DataParser.FLOATS];y<g.length;y++){d=g[y];m.addFloat(d)}}if(t.DataParser.STRINGS in h){null===m&&(m=t.BaseObject.borrowObject(t.UserData));for(var D=0,v=h[t.DataParser.STRINGS];D<v.length;D++){d=v[D];m.addString(d)}}u.data=m,s.push(u)}return s},i.prototype._parseDeformFrame=function(e,a,r){var n=this._frameFloatArray.length,s=this._parseTweenFrame(e,a,r),o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:t.DataParser.VALUE in e?e[t.DataParser.VALUE]:null,l=i._getNumber(e,t.DataParser.OFFSET,0),h=this._intArray[this._geometry.offset+0],u=0,_=0;if(null!==this._geometry.weight);else{this._frameFloatArray.length+=2*h;for(var f=0;f<2*h;f+=2)null!==o?(u=f<l||f-l>=o.length?0:o[f-l],_=f+1<l||f+1-l>=o.length?0:o[f+1-l]):(u=0,_=0),this._frameFloatArray[n+f]=u,this._frameFloatArray[n+f+1]=_}if(0===a){var m=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[m+0]=this._geometry.offset,this._frameIntArray[m+1]=this._frameFloatArray.length-n,this._frameIntArray[m+2]=this._frameFloatArray.length-n,this._frameIntArray[m+3]=0,this._frameIntArray[m+4]=n-this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=m-this._animation.frameIntOffset}return s},i.prototype._parseTransform=function(e,a,r){a.x=i._getNumber(e,t.DataParser.X,0)*r,a.y=i._getNumber(e,t.DataParser.Y,0)*r,t.DataParser.ROTATE in e||t.DataParser.SKEW in e?(a.rotation=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD),a.skew=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e)&&(a.rotation=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD),a.skew=t.Transform.normalizeRadian(i._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation),a.scaleX=i._getNumber(e,t.DataParser.SCALE_X,1),a.scaleY=i._getNumber(e,t.DataParser.SCALE_Y,1)},i.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=.01*i._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),a.redMultiplier=.01*i._getNumber(e,t.DataParser.RED_MULTIPLIER,100),a.greenMultiplier=.01*i._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),a.blueMultiplier=.01*i._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100),a.alphaOffset=i._getNumber(e,t.DataParser.ALPHA_OFFSET,0),a.redOffset=i._getNumber(e,t.DataParser.RED_OFFSET,0),a.greenOffset=i._getNumber(e,t.DataParser.GREEN_OFFSET,0),a.blueOffset=i._getNumber(e,t.DataParser.BLUE_OFFSET,0)},i.prototype._parseGeometry=function(e,a){var i=e[t.DataParser.VERTICES],r=Math.floor(i.length/2),n=0,s=this._intArray.length,o=this._floatArray.length;a.offset=s,a.data=this._data,this._intArray.length+=4,this._intArray[s+0]=r,this._intArray[s+2]=o,this._intArray[s+3]=-1,this._floatArray.length+=2*r;for(var l=0,h=2*r;l<h;++l)this._floatArray[o+l]=i[l];if(t.DataParser.TRIANGLES in e){var u=e[t.DataParser.TRIANGLES];n=Math.floor(u.length/3),this._intArray.length+=3*n;for(l=0,h=3*n;l<h;++l)this._intArray[s+4+l]=u[l]}if(this._intArray[s+1]=n,t.DataParser.UVS in e){var _=e[t.DataParser.UVS],f=o+2*r;this._floatArray.length+=2*r;for(l=0,h=2*r;l<h;++l)this._floatArray[f+l]=_[l]}if(t.DataParser.WEIGHTS in e){var m=e[t.DataParser.WEIGHTS],p=Math.floor(m.length-r)/2,c=this._intArray.length,d=this._floatArray.length,y=0,g=this._armature.sortedBones,D=t.BaseObject.borrowObject(t.WeightData);if(D.count=p,D.offset=c,this._intArray.length+=2+y+r+p,this._intArray[c+1]=d,t.DataParser.BONE_POSE in e){var v=e[t.DataParser.SLOT_POSE],T=e[t.DataParser.BONE_POSE],b=new Array;y=Math.floor(T.length/7),b.length=y;for(l=0;l<y;++l){var A=T[7*l],P=this._rawBones[A];D.addBone(P),b[l]=A,this._intArray[c+2+l]=g.indexOf(P)}this._floatArray.length+=3*p,this._helpMatrixA.copyFromArray(v,0);l=0;for(var S=0,O=c+2+y,x=d;l<r;++l){var E=2*l,M=this._intArray[O++]=m[S++],B=this._floatArray[o+E],I=this._floatArray[o+E+1];this._helpMatrixA.transformPoint(B,I,this._helpPoint),B=this._helpPoint.x,I=this._helpPoint.y;for(var F=0;F<M;++F){A=m[S++];var C=b.indexOf(A);this._helpMatrixB.copyFromArray(T,7*C+1),this._helpMatrixB.invert(),this._helpMatrixB.transformPoint(B,I,this._helpPoint),this._intArray[O++]=C,this._floatArray[x++]=m[S++],this._floatArray[x++]=this._helpPoint.x,this._floatArray[x++]=this._helpPoint.y}}}else{var w=e[t.DataParser.BONES];y=w.length;for(l=0;l<y;l++){A=w[l],P=this._rawBones[A];D.addBone(P),this._intArray[c+2+l]=g.indexOf(P)}this._floatArray.length+=3*p;l=0,S=0,x=0,O=c+2+y;for(var N=d;l<p;l++){M=m[S++];this._intArray[O++]=M;for(F=0;F<M;F++){C=m[S++];var R=m[S++];B=i[x++],I=i[x++];this._intArray[O++]=w.indexOf(C),this._floatArray[N++]=R,this._floatArray[N++]=B,this._floatArray[N++]=I}}}a.weight=D}},i.prototype._parseArray=function(t){this._intArray.length=0,this._floatArray.length=0,this._frameIntArray.length=0,this._frameFloatArray.length=0,this._frameArray.length=0,this._timelineArray.length=0,this._colorArray.length=0},i.prototype._modifyArray=function(){this._intArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._intArray.push(0),this._frameIntArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameIntArray.push(0),this._frameArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._frameArray.push(0),this._timelineArray.length%Uint16Array.BYTES_PER_ELEMENT!=0&&this._timelineArray.push(0),this._timelineArray.length%Int16Array.BYTES_PER_ELEMENT!=0&&this._colorArray.push(0);for(var t=this._intArray.length*Int16Array.BYTES_PER_ELEMENT,e=this._floatArray.length*Float32Array.BYTES_PER_ELEMENT,a=this._frameIntArray.length*Int16Array.BYTES_PER_ELEMENT,i=this._frameFloatArray.length*Float32Array.BYTES_PER_ELEMENT,r=this._frameArray.length*Int16Array.BYTES_PER_ELEMENT,n=this._timelineArray.length*Uint16Array.BYTES_PER_ELEMENT,s=this._colorArray.length*Int16Array.BYTES_PER_ELEMENT,o=new ArrayBuffer(t+e+a+i+r+n+s),l=new Int16Array(o,0,this._intArray.length),h=new Float32Array(o,t,this._floatArray.length),u=new Int16Array(o,t+e,this._frameIntArray.length),_=new Float32Array(o,t+e+a,this._frameFloatArray.length),f=new Int16Array(o,t+e+a+i,this._frameArray.length),m=new Uint16Array(o,t+e+a+i+r,this._timelineArray.length),p=new Int16Array(o,t+e+a+i+r+n,this._colorArray.length),c=0,d=this._intArray.length;c<d;++c)l[c]=this._intArray[c];for(c=0,d=this._floatArray.length;c<d;++c)h[c]=this._floatArray[c];for(c=0,d=this._frameIntArray.length;c<d;++c)u[c]=this._frameIntArray[c];for(c=0,d=this._frameFloatArray.length;c<d;++c)_[c]=this._frameFloatArray[c];for(c=0,d=this._frameArray.length;c<d;++c)f[c]=this._frameArray[c];for(c=0,d=this._timelineArray.length;c<d;++c)m[c]=this._timelineArray[c];for(c=0,d=this._colorArray.length;c<d;++c)p[c]=this._colorArray[c];this._data.binary=o,this._data.intArray=l,this._data.floatArray=h,this._data.frameIntArray=u,this._data.frameFloatArray=_,this._data.frameArray=f,this._data.timelineArray=m,this._data.colorArray=p,this._defaultColorOffset=-1},i.prototype.parseDragonBonesData=function(e,a){void 0===a&&(a=1),console.assert(null!=e,"Data error.");var r=i._getString(e,t.DataParser.VERSION,""),n=i._getString(e,t.DataParser.COMPATIBLE_VERSION,"");if(t.DataParser.DATA_VERSIONS.indexOf(r)>=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);if(s.version=r,s.name=i._getString(e,t.DataParser.NAME,""),s.frameRate=i._getNumber(e,t.DataParser.FRAME_RATE,24),0===s.frameRate&&(s.frameRate=24),t.DataParser.ARMATURE in e){this._data=s,this._parseArray(e);for(var o=0,l=e[t.DataParser.ARMATURE];o<l.length;o++){var h=l[o];s.addArmature(this._parseArmature(h,a))}this._data.binary||this._modifyArray(),t.DataParser.STAGE in e?s.stage=s.getArmature(i._getString(e,t.DataParser.STAGE,"")):s.armatureNames.length>0&&(s.stage=s.getArmature(s.armatureNames[0])),this._data=null}return t.DataParser.TEXTURE_ATLAS in e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),s}return console.assert(!1,"Nonsupport data version: "+r+"\nPlease convert DragonBones data to support version.\nRead more: https://github.com/DragonBones/Tools/"),null},i.prototype.parseTextureAtlasData=function(e,a,r){if(void 0===r&&(r=1),console.assert(void 0!==e),null===e){if(null===this._rawTextureAtlases||0===this._rawTextureAtlases.length)return!1;var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return this.parseTextureAtlasData(n,a,r),this._rawTextureAtlasIndex>=this._rawTextureAtlases.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!0}if(a.width=i._getNumber(e,t.DataParser.WIDTH,0),a.height=i._getNumber(e,t.DataParser.HEIGHT,0),a.scale=1===r?1/i._getNumber(e,t.DataParser.SCALE,1):r,a.name=i._getString(e,t.DataParser.NAME,""),a.imagePath=i._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE in e)for(var s=e[t.DataParser.SUB_TEXTURE],o=0,l=s.length;o<l;++o){var h=s[o],u=i._getNumber(h,t.DataParser.FRAME_WIDTH,-1),_=i._getNumber(h,t.DataParser.FRAME_HEIGHT,-1),f=a.createTexture();f.rotated=i._getBoolean(h,t.DataParser.ROTATED,!1),f.name=i._getString(h,t.DataParser.NAME,""),f.region.x=i._getNumber(h,t.DataParser.X,0),f.region.y=i._getNumber(h,t.DataParser.Y,0),f.region.width=i._getNumber(h,t.DataParser.WIDTH,0),f.region.height=i._getNumber(h,t.DataParser.HEIGHT,0),u>0&&_>0&&(f.frame=t.TextureData.createRectangle(),f.frame.x=i._getNumber(h,t.DataParser.FRAME_X,0),f.frame.y=i._getNumber(h,t.DataParser.FRAME_Y,0),f.frame.width=u,f.frame.height=_),a.addTexture(f)}return!0},i.getInstance=function(){return null===i._objectDataParserInstance&&(i._objectDataParserInstance=new i),i._objectDataParserInstance},i._objectDataParserInstance=null,i}(t.DataParser);t.ObjectDataParser=e;var a=function(){this.frameStart=0,this.actions=[]};t.ActionFrame=a}(l||(l={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.prototype._inRange=function(t,e,a){return e<=t&&t<=a},a.prototype._decodeUTF8=function(t){for(var e,a=0,i="",r=0,n=0,s=0,o=0;t.length>a;){var l=t[a++];if(-1===l)e=0!==n?65533:-1;else if(0===n)this._inRange(l,0,127)?e=l:(this._inRange(l,194,223)?(n=1,o=128,r=l-192):this._inRange(l,224,239)?(n=2,o=2048,r=l-224):this._inRange(l,240,244)&&(n=3,o=65536,r=l-240),r*=Math.pow(64,n),e=null);else if(this._inRange(l,128,191))if(s+=1,r+=(l-128)*Math.pow(64,n-s),s!==n)e=null;else{var h=r,u=o;r=0,n=0,s=0,o=0,e=this._inRange(h,u,1114111)&&!this._inRange(h,55296,57343)?h:l}else r=0,n=0,s=0,o=0,a--,e=l;null!==e&&-1!==e&&(e<=65535?e>0&&(i+=String.fromCharCode(e)):(e-=65536,i+=String.fromCharCode(55296+(e>>10&1023)),i+=String.fromCharCode(56320+(1023&e))))}return i},a.prototype._parseBinaryTimeline=function(e,a,i){void 0===i&&(i=null);var r=null!==i?i:t.BaseObject.borrowObject(t.TimelineData);r.type=e,r.offset=a,this._timeline=r;var n=this._timelineArrayBuffer[r.offset+2];if(1===n)r.frameIndicesOffset=-1;else{var s,o=this._animation.frameCount+1,l=this._data.frameIndices;s=l.length,l.length+=o,r.frameIndicesOffset=s;for(var h=0,u=0,_=0,f=0;h<o;++h)_+f<=h&&u<n&&(_=this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+u]],f=u===n-1?this._animation.frameCount-_:this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.offset+5+u+1]]-_,u++),l[s+h]=u-1}return this._timeline=null,r},a.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(t.ObjectDataParser._getString(e,t.DataParser.BLEND_TYPE,"")),a.frameCount=t.ObjectDataParser._getNumber(e,t.DataParser.DURATION,0),a.playTimes=t.ObjectDataParser._getNumber(e,t.DataParser.PLAY_TIMES,1),a.duration=a.frameCount/this._armature.frameRate,a.fadeInTime=t.ObjectDataParser._getNumber(e,t.DataParser.FADE_IN_TIME,0),a.scale=t.ObjectDataParser._getNumber(e,t.DataParser.SCALE,1),a.name=t.ObjectDataParser._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===a.name.length&&(a.name=t.DataParser.DEFAULT_NAME);var i=e[t.DataParser.OFFSET];if(a.frameIntOffset=i[0],a.frameFloatOffset=i[1],a.frameOffset=i[2],this._animation=a,t.DataParser.ACTION in e&&(a.actionTimeline=this._parseBinaryTimeline(0,e[t.DataParser.ACTION])),t.DataParser.Z_ORDER in e&&(a.zOrderTimeline=this._parseBinaryTimeline(1,e[t.DataParser.Z_ORDER])),t.DataParser.BONE in e){var r=e[t.DataParser.BONE];for(var n in r){var s=r[n],o=this._armature.getBone(n);if(null!==o)for(var l=0,h=s.length;l<h;l+=2){var u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addBoneTimeline(o.name,f)}}}if(t.DataParser.SLOT in e){r=e[t.DataParser.SLOT];for(var n in r){s=r[n];var m=this._armature.getSlot(n);if(null!==m)for(l=0,h=s.length;l<h;l+=2){u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addSlotTimeline(m.name,f)}}}if(t.DataParser.CONSTRAINT in e){r=e[t.DataParser.CONSTRAINT];for(var n in r){s=r[n];var p=this._armature.getConstraint(n);if(null!==p)for(l=0,h=s.length;l<h;l+=2){u=s[l],_=s[l+1],f=this._parseBinaryTimeline(u,_);this._animation.addConstraintTimeline(p.name,f)}}}if(t.DataParser.TIMELINE in e)for(var c=0,d=s=e[t.DataParser.TIMELINE];c<d.length;c++){var y=d[c];if((_=t.ObjectDataParser._getNumber(y,t.DataParser.OFFSET,0))>=0){u=t.ObjectDataParser._getNumber(y,t.DataParser.TYPE,0);var g=t.ObjectDataParser._getString(y,t.DataParser.NAME,"");f=null;if(40===u&&0!==a.blendType){var D=f=t.BaseObject.borrowObject(t.AnimationTimelineData);D.x=t.ObjectDataParser._getNumber(y,t.DataParser.X,0),D.y=t.ObjectDataParser._getNumber(y,t.DataParser.Y,0)}switch(f=this._parseBinaryTimeline(u,_,f),u){case 0:case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(g,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(g,f);break;case 30:this._animation.addConstraintTimeline(g,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(g,f)}}}return this._animation=null,a},a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET],a.data=this._data;var i=this._intArrayBuffer[a.offset+3];if(i>=0){var r=t.BaseObject.borrowObject(t.WeightData),n=this._intArrayBuffer[a.offset+0],s=this._intArrayBuffer[i+0];r.offset=i;for(var o=0;o<s;++o){var l=this._intArrayBuffer[i+2+o];r.addBone(this._rawBones[l])}for(var h=i+2+s,u=0,_=(o=0,n);o<_;++o){var f=this._intArrayBuffer[h++];u+=f,h+=f}r.count=u,a.weight=r}},a.prototype._parseArray=function(e){var a=e[t.DataParser.OFFSET],i=a[1],r=a[3],n=a[5],s=a[7],o=a[9],l=a[11],h=a.length>12?a[13]:0,u=new Int16Array(this._binary,this._binaryOffset+a[0],i/Int16Array.BYTES_PER_ELEMENT),_=new Float32Array(this._binary,this._binaryOffset+a[2],r/Float32Array.BYTES_PER_ELEMENT),f=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT),m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT),p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT),c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT),d=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=u,this._data.floatArray=_,this._data.frameIntArray=f,this._data.frameFloatArray=m,this._data.frameArray=this._frameArrayBuffer=p,this._data.timelineArray=this._timelineArrayBuffer=c,this._data.colorArray=d},a.prototype.parseDragonBonesData=function(t,a){void 0===a&&(a=1),console.assert(null!=t&&t instanceof ArrayBuffer,"Data error.");var i=new Uint8Array(t,0,8);if(i[0]!=="D".charCodeAt(0)||i[1]!=="B".charCodeAt(0)||i[2]!=="D".charCodeAt(0)||i[3]!=="T".charCodeAt(0))return console.assert(!1,"Nonsupport data."),null;var r=new Uint32Array(t,8,1)[0],n=new Uint8Array(t,12,r),s=this._decodeUTF8(n),o=JSON.parse(s);return this._binaryOffset=12+r,this._binary=t,e.prototype.parseDragonBonesData.call(this,o,a)},a.getInstance=function(){return null===a._binaryDataParserInstance&&(a._binaryDataParserInstance=new a),a._binaryDataParserInstance},a._binaryDataParserInstance=null,a}(t.ObjectDataParser);t.BinaryDataParser=e}(l||(l={})),function(t){var e=function(){function e(a){void 0===a&&(a=null),this.autoSearch=!1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,this._dataParser=null,null===e._objectParser&&(e._objectParser=new t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new t.BinaryDataParser),this._dataParser=null!==a?a:e._objectParser}return e.prototype._isSupportMesh=function(){return!0},e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap)for(var a=0,i=this._textureAtlasDataMap[t];a<i.length;a++){if(null!==(l=(o=i[a]).getTexture(e)))return l}if(this.autoSearch)for(var r in this._textureAtlasDataMap)for(var n=0,s=this._textureAtlasDataMap[r];n<s.length;n++){var o,l;if((o=s[n]).autoSearch)if(null!==(l=o.getTexture(e)))return l}return null},e.prototype._fillBuildArmaturePackage=function(t,e,a,i,r){var n=null,s=null;if(e.length>0&&e in this._dragonBonesDataMap&&(s=(n=this._dragonBonesDataMap[e]).getArmature(a)),null===s&&(0===e.length||this.autoSearch))for(var o in this._dragonBonesDataMap)if(n=this._dragonBonesDataMap[o],(0===e.length||n.autoSearch)&&null!==(s=n.getArmature(a))){e=o;break}if(null!==s){if(t.dataName=e,t.textureAtlasName=r,t.data=n,t.armature=s,t.skin=null,i.length>0&&(t.skin=s.getSkin(i),null===t.skin&&this.autoSearch))for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o].getArmature(i);if(null!==l){t.skin=l.defaultSkin;break}}return null===t.skin&&(t.skin=s.defaultSkin),!0}return!1},e.prototype._buildBones=function(e,a){for(var i=0,r=e.armature.sortedBones;i<r.length;i++){var n=r[i];t.BaseObject.borrowObject(0===n.type?t.Bone:t.Surface).init(n,a)}},e.prototype._buildSlots=function(t,e){var a=t.skin,i=t.armature.defaultSkin;if(null!==a&&null!==i){var r={};for(var n in i.displays){var s=i.getDisplays(n);r[n]=s}if(a!==i)for(var n in a.displays){s=a.getDisplays(n);r[n]=s}for(var o=0,l=t.armature.sortedSlots;o<l.length;o++){var h=l[o],u=h.name in r?r[h.name]:null,_=this._buildSlot(t,h,e);if(null!==u){_.displayFrameCount=u.length;for(var f=0,m=_.displayFrameCount;f<m;++f){var p=u[f];if(_.replaceRawDisplayData(p,f),null!==p){if(t.textureAtlasName.length>0){var c=this._getTextureData(t.textureAtlasName,p.path);_.replaceTextureData(c,f)}var d=this._getSlotDisplay(t,p,_);_.replaceDisplay(d,f)}else _.replaceDisplay(null)}}_._setDisplayIndex(h.displayIndex,!0)}}},e.prototype._buildConstraints=function(e,a){var i=e.armature.constraints;for(var r in i){var n=i[r];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a),a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a),a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a),a._addConstraint(l)}}},e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,null!==t?t.dataName:"","",null!==t?t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(e,a,i){var r=null!==e?e.dataName:a.parent.parent.parent.name,n=null;switch(a.type){case 0:var s=a;null===s.texture&&(s.texture=this._getTextureData(r,a.path)),n=i.rawDisplay;break;case 2:var o=a;null===o.texture&&(o.texture=this._getTextureData(r,o.path)),n=this._isSupportMesh()?i.meshDisplay:i.rawDisplay;break;case 1:var l=a,h=this._buildChildArmature(e,i,l);if(null!==h){if(h.inheritAnimation=l.inheritAnimation,!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0)for(var _=0,f=u;_<f.length;_++){var m=f[_],p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,i.armature),p.slot=i,i.armature._bufferAction(p,!1)}else h.animation.play()}l.armature=h.armatureData}n=h}return n},e.prototype.parseDragonBonesData=function(t,a,i){void 0===a&&(a=null),void 0===i&&(i=1);for(var r=t instanceof ArrayBuffer?e._binaryParser:this._dataParser,n=r.parseDragonBonesData(t,i);;){var s=this._buildTextureAtlasData(null,null);if(!r.parseTextureAtlasData(null,s,i)){s.returnToPool();break}this.addTextureAtlasData(s,a)}return null!==n&&this.addDragonBonesData(n,a),n},e.prototype.parseTextureAtlasData=function(t,e,a,i){void 0===a&&(a=null),void 0===i&&(i=1);var r=this._buildTextureAtlasData(null,null);return this._dataParser.parseTextureAtlasData(t,r,i),this._buildTextureAtlasData(r,e||null),this.addTextureAtlasData(r,a),r},e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(null!==a)for(var i=0,r=a.length;i<r;++i)i<t.length&&this._buildTextureAtlasData(a[i],t[i])},e.prototype.getDragonBonesData=function(t){return t in this._dragonBonesDataMap?this._dragonBonesDataMap[t]:null},e.prototype.addDragonBonesData=function(t,e){if(void 0===e&&(e=null),(e=null!==e?e:t.name)in this._dragonBonesDataMap){if(this._dragonBonesDataMap[e]===t)return;console.warn("Can not add same name data: "+e)}else this._dragonBonesDataMap[e]=t},e.prototype.removeDragonBonesData=function(t,e){void 0===e&&(e=!0),t in this._dragonBonesDataMap&&(e&&this._dragonBones.bufferObject(this._dragonBonesDataMap[t]),delete this._dragonBonesDataMap[t])},e.prototype.getTextureAtlasData=function(t){return t in this._textureAtlasDataMap?this._textureAtlasDataMap[t]:null},e.prototype.addTextureAtlasData=function(t,e){void 0===e&&(e=null);var a=(e=null!==e?e:t.name)in this._textureAtlasDataMap?this._textureAtlasDataMap[e]:this._textureAtlasDataMap[e]=[];a.indexOf(t)<0&&a.push(t)},e.prototype.removeTextureAtlasData=function(t,e){if(void 0===e&&(e=!0),t in this._textureAtlasDataMap){var a=this._textureAtlasDataMap[t];if(e)for(var i=0,r=a;i<r.length;i++){var n=r[i];this._dragonBones.bufferObject(n)}delete this._textureAtlasDataMap[t]}},e.prototype.getArmatureData=function(t,e){void 0===e&&(e="");var i=new a;return this._fillBuildArmaturePackage(i,e,t,"","")?i.armature:null},e.prototype.clear=function(t){for(var e in void 0===t&&(t=!0),this._dragonBonesDataMap)t&&this._dragonBones.bufferObject(this._dragonBonesDataMap[e]),delete this._dragonBonesDataMap[e];for(var e in this._textureAtlasDataMap){if(t)for(var a=0,i=this._textureAtlasDataMap[e];a<i.length;a++){var r=i[a];this._dragonBones.bufferObject(r)}delete this._textureAtlasDataMap[e]}},e.prototype.buildArmature=function(t,e,i,r){void 0===e&&(e=""),void 0===i&&(i=""),void 0===r&&(r="");var n=new a;if(!this._fillBuildArmaturePackage(n,e||"",t,i||"",r||""))return console.warn("No armature data: "+t+", "+(null!==e?e:"")),null;var s=this._buildArmature(n);return this._buildBones(n,s),this._buildSlots(n,s),this._buildConstraints(n,s),s.invalidUpdate(null,!0),s.advanceTime(0),s},e.prototype.replaceDisplay=function(t,e,a){if(void 0===a&&(a=-1),a<0&&(a=t.displayIndex),a<0&&(a=0),t.replaceDisplayData(e,a),null!==e){var i=this._getSlotDisplay(null,e,t);if(0===e.type){var r=t.getDisplayFrameAt(a).rawDisplayData;null!==r&&2===r.type&&(i=t.meshDisplay)}t.replaceDisplay(i,a)}else t.replaceDisplay(null,a)},e.prototype.replaceSlotDisplay=function(t,e,a,i,r,n){void 0===n&&(n=-1);var s=this.getArmatureData(e,t||"");if(null===s||null===s.defaultSkin)return!1;var o=s.defaultSkin.getDisplay(a,i);return this.replaceDisplay(r,o,n),!0},e.prototype.replaceSlotDisplayList=function(t,e,a,i){var r=this.getArmatureData(e,t||"");if(!r||!r.defaultSkin)return!1;var n=r.defaultSkin.getDisplays(a);if(!n)return!1;i.displayFrameCount=n.length;for(var s=0,o=i.displayFrameCount;s<o;++s){var l=n[s];this.replaceDisplay(i,l,s)}return!0},e.prototype.replaceSkin=function(t,e,a,i){void 0===a&&(a=!1),void 0===i&&(i=null);for(var r=!1,n=e.parent.defaultSkin,s=0,o=t.getSlots();s<o.length;s++){var l=o[s];if(!(null!==i&&i.indexOf(l.name)>=0)){var h=e.getDisplays(l.name);if(null!==h||(null!==n&&e!==n&&(h=n.getDisplays(l.name)),null!==h)){l.displayFrameCount=h.length;for(var u=0,_=l.displayFrameCount;u<_;++u){var f=h[u];l.replaceRawDisplayData(f,u),null!==f?l.replaceDisplay(this._getSlotDisplay(null,f,l),u):l.replaceDisplay(null,u)}r=!0}else a&&(l.displayFrameCount=0)}}return r},e.prototype.replaceAnimation=function(e,a,i){void 0===i&&(i=!0);var r=a.defaultSkin;if(null===r)return!1;if(i)e.animation.animations=a.animations;else{var n=e.animation.animations,s={};for(var o in n)s[o]=n[o];for(var o in a.animations)s[o]=a.animations[o];e.animation.animations=s}for(var l=0,h=e.getSlots();l<h.length;l++)for(var u=h[l],_=0,f=0,m=u.displayList;f<m.length;f++){var p=m[f];if(p instanceof t.Armature){var c=r.getDisplays(u.name);if(null!==c&&_<c.length){var d=c[_];if(null!==d&&1===d.type){var y=this.getArmatureData(d.path,d.parent.parent.parent.name);y&&this.replaceAnimation(p,y,i)}}}_++}return!0},e.prototype.getAllDragonBonesData=function(){return this._dragonBonesDataMap},e.prototype.getAllTextureAtlasData=function(){return this._textureAtlasDataMap},Object.defineProperty(e.prototype,"clock",{get:function(){return this._dragonBones.clock},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragonBones",{get:function(){return this._dragonBones},enumerable:!0,configurable:!0}),e._objectParser=null,e._binaryParser=null,e}();t.BaseFactory=e;var a=function(){this.dataName="",this.textureAtlasName="",this.skin=null};t.BuildArmaturePackage=a}(l||(l={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._renderTexture=null,t}return f(i,e),i.toString=function(){return"[class dragonBones.PixiTextureAtlasData]"},i.prototype._onClear=function(){e.prototype._onClear.call(this),this._renderTexture,this._renderTexture=null},i.prototype.createTexture=function(){return t.BaseObject.borrowObject(a)},Object.defineProperty(i.prototype,"renderTexture",{get:function(){return this._renderTexture},set:function(t){if(this._renderTexture!==t)if(this._renderTexture=t,null!==this._renderTexture)for(var e in this.textures){(a=this.textures[e]).renderTexture=new o.Texture(this._renderTexture,new o.Rectangle(a.region.x,a.region.y,a.region.width,a.region.height),new o.Rectangle(a.region.x,a.region.y,a.region.width,a.region.height),new o.Rectangle(0,0,a.region.width,a.region.height),a.rotated)}else for(var e in this.textures){var a;(a=this.textures[e]).renderTexture=null}},enumerable:!0,configurable:!0}),i}(t.TextureAtlasData);t.PixiTextureAtlasData=e;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.renderTexture=null,e}return f(e,t),e.toString=function(){return"[class dragonBones.PixiTextureData]"},e.prototype._onClear=function(){t.prototype._onClear.call(this),null!==this.renderTexture&&this.renderTexture.destroy(!1),this.renderTexture=null},e}(t.TextureData);t.PixiTextureData=a}(l||(l={})),function(t){var e=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.debugDraw=!1,t._debugDraw=!1,t._armature=null,t._debugDrawer=null,t}return f(a,e),a.prototype.dbInit=function(t){this._armature=t},a.prototype.dbClear=function(){null!==this._debugDrawer&&this._debugDrawer.destroy(!0),this._armature=null,this._debugDrawer=null,e.prototype.destroy.call(this)},a.prototype.dbUpdate=function(){var e=t.DragonBones.debugDraw||this.debugDraw;if(e||this._debugDraw)if(this._debugDraw=e,this._debugDraw){if(null===this._debugDrawer){this._debugDrawer=new o.Sprite;var a=new o.Graphics;this._debugDrawer.addChild(a)}this.addChild(this._debugDrawer);var i=this._debugDrawer.getChildAt(0);i.clear();for(var r=this._armature.getBones(),n=0,s=r.length;n<s;++n){var l=r[n],h=l.boneData.length,u=l.globalTransformMatrix.tx,_=l.globalTransformMatrix.ty,f=u+l.globalTransformMatrix.a*h,m=_+l.globalTransformMatrix.b*h;i.lineStyle(2,65535,.7),i.moveTo(u,_),i.lineTo(f,m),i.lineStyle(0,0,0),i.beginFill(65535,.7),i.drawCircle(u,_,3),i.endFill()}var p=this._armature.getSlots();for(n=0,s=p.length;n<s;++n){var c=p[n],d=c.boundingBoxData;if(d){switch((A=this._debugDrawer.getChildByName(c.name))||((A=new o.Graphics).name=c.name,this._debugDrawer.addChild(A)),A.clear(),A.lineStyle(2,16711935,.7),d.type){case 0:A.drawRect(.5*-d.width,.5*-d.height,d.width,d.height);break;case 1:A.drawEllipse(.5*-d.width,.5*-d.height,d.width,d.height);break;case 2:for(var y=d.vertices,g=0,D=y.length;g<D;g+=2){var v=y[g],T=y[g+1];0===g?A.moveTo(v,T):A.lineTo(v,T)}A.lineTo(y[0],y[1])}A.endFill(),c.updateTransformAndMatrix(),c.updateGlobalTransform();var b=c.global;A.setTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skew,0,c._pivotX,c._pivotY)}else{var A;(A=this._debugDrawer.getChildByName(c.name))&&this._debugDrawer.removeChild(A)}}}else null!==this._debugDrawer&&this._debugDrawer.parent===this&&this.removeChild(this._debugDrawer)},a.prototype.dispose=function(t){null!==this._armature&&(this._armature.dispose(),this._armature=null)},a.prototype.destroy=function(){this.dispose()},a.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)},a.prototype.hasDBEventListener=function(t){return this.listeners(t,!0)},a.prototype.addDBEventListener=function(t,e,a){this.addListener(t,e,a)},a.prototype.removeDBEventListener=function(t,e,a){this.removeListener(t,e,a)},Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"animation",{get:function(){return this._armature.animation},enumerable:!0,configurable:!0}),a}(o.Sprite);t.PixiArmatureDisplay=e}(l||(l={})),function(t){var e=function(e){function a(){return null!==e&&e.apply(this,arguments)||this}return f(a,e),a.toString=function(){return"[class dragonBones.PixiSlot]"},a.prototype._onClear=function(){e.prototype._onClear.call(this),this._textureScale=1,this._renderDisplay=null,this._updateTransform=this._updateTransformV4},a.prototype._initDisplay=function(t,e){},a.prototype._disposeDisplay=function(t,e){e||t.destroy()},a.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay},a.prototype._addDisplay=function(){this._armature.display.addChild(this._renderDisplay)},a.prototype._replaceDisplay=function(t){var e=this._armature.display,a=t;e.addChild(this._renderDisplay),e.swapChildren(this._renderDisplay,a),e.removeChild(a),this._textureScale=1},a.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)},a.prototype._updateZOrder=function(){var t=this._armature.display;t.getChildIndex(this._renderDisplay)!==this._zOrder&&t.addChildAt(this._renderDisplay,this._zOrder)},a.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible},a.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof o.Sprite)switch(this._blendMode){case 0:this._renderDisplay.blendMode=o.BLEND_MODES.NORMAL;break;case 1:this._renderDisplay.blendMode=o.BLEND_MODES.ADD;break;case 3:this._renderDisplay.blendMode=o.BLEND_MODES.DARKEN;break;case 4:this._renderDisplay.blendMode=o.BLEND_MODES.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=o.BLEND_MODES.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=o.BLEND_MODES.LIGHTEN;break;case 10:this._renderDisplay.blendMode=o.BLEND_MODES.MULTIPLY;break;case 11:this._renderDisplay.blendMode=o.BLEND_MODES.OVERLAY;break;case 12:this._renderDisplay.blendMode=o.BLEND_MODES.SCREEN}},a.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;if(this._renderDisplay.alpha=t,this._renderDisplay instanceof o.Sprite||this._renderDisplay instanceof o.mesh.Mesh){var e=(Math.round(255*this._colorTransform.redMultiplier)<<16)+(Math.round(255*this._colorTransform.greenMultiplier)<<8)+Math.round(255*this._colorTransform.blueMultiplier);this._renderDisplay.tint=e}},a.prototype._updateFrame=function(){var e=this._textureData;if(this._displayIndex>=0&&null!==this._display&&null!==e){var a=e.parent;null!==this._armature.replacedTexture&&(null===this._armature._replaceTextureAtlasData?((a=t.BaseObject.borrowObject(t.PixiTextureAtlasData)).copyFrom(e.parent),a.renderTexture=this._armature.replacedTexture,this._armature._replaceTextureAtlasData=a):a=this._armature._replaceTextureAtlasData,e=a.getTexture(e.name));var i=e.renderTexture;if(null!==i){if(null!==this._geometryData){var r=this._geometryData.data,n=r.intArray,s=r.floatArray,o=n[this._geometryData.offset+0],l=n[this._geometryData.offset+1],h=n[this._geometryData.offset+2];h<0&&(h+=65536);var u=h+2*o,_=this._armature._armatureData.scale,f=this._renderDisplay,m=a.width>0?a.width:i.baseTexture.width,p=a.height>0?a.height:i.baseTexture.height,c=e.region;f.vertices=new Float32Array(2*o),f.uvs=new Float32Array(2*o),f.indices=new Uint16Array(3*l);for(var d=0,y=2*o;d<y;++d)f.vertices[d]=s[h+d]*_;for(d=0;d<3*l;++d)f.indices[d]=n[this._geometryData.offset+4+d];for(d=0,y=2*o;d<y;d+=2){var g=s[u+d],D=s[u+d+1];e.rotated?(f.uvs[d]=(c.x+(1-D)*c.width)/m,f.uvs[d+1]=(c.y+g*c.height)/p):(f.uvs[d]=(c.x+g*c.width)/m,f.uvs[d+1]=(c.y+D*c.height)/p)}this._textureScale=1,f.texture=i,f.dirty++,f.indexDirty++;var v=null!==this._geometryData.weight,T=0!==this._parent._boneData.type;(v||T)&&this._identityTransform()}else{var b;this._textureScale=e.parent.scale*this._armature._armatureData.scale,(b=this._renderDisplay).texture=i}return void(this._visibleDirty=!0)}}null!==this._geometryData?((f=this._renderDisplay).texture=null,f.x=0,f.y=0,f.visible=!1):((b=this._renderDisplay).texture=null,b.x=0,b.y=0,b.visible=!1)},a.prototype._updateMesh=function(){var t=this._armature._armatureData.scale,e=this._displayFrame.deformVertices,a=this._geometryBones,i=this._geometryData,r=i.weight,n=e.length>0&&i.inheritDeform,s=this._renderDisplay;if(null!==r){var o=(S=i.data).intArray,l=S.floatArray,h=o[i.offset+0],u=o[r.offset+1];u<0&&(u+=65536);for(var _=0,f=0,m=r.offset+2+a.length,p=u,c=0;_<h;++_){for(var d=o[m++],y=0,g=0,D=0;D<d;++D){var v=a[o[m++]];if(null!==v){var T=v.globalTransformMatrix,b=l[p++],A=l[p++]*t,P=l[p++]*t;n&&(A+=e[c++],P+=e[c++]),y+=(T.a*A+T.c*P+T.tx)*b,g+=(T.b*A+T.d*P+T.ty)*b}}s.vertices[f++]=y,s.vertices[f++]=g}}else{var S,O=0!==this._parent._boneData.type,x=(o=(S=i.data).intArray,l=S.floatArray,h=o[i.offset+0],o[i.offset+2]);x<0&&(x+=65536);_=0;for(var E=2*h;_<E;_+=2){var M=l[x+_]*t,B=l[x+_+1]*t;if(n&&(M+=e[_],B+=e[_+1]),O){T=this._parent._getGlobalTransformMatrix(M,B);s.vertices[_]=T.a*M+T.c*B+T.tx,s.vertices[_+1]=T.b*M+T.d*B+T.ty}else s.vertices[_]=M,s.vertices[_+1]=B}}},a.prototype._updateTransform=function(){throw new Error},a.prototype._updateTransformV3=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY),a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.setTransform(e,a,t.scaleX*this._textureScale,t.scaleY*this._textureScale,t.rotation,t.skew,0)}else this._renderDisplay.position.set(t.x,t.y),this._renderDisplay.rotation=t.rotation,this._renderDisplay.skew.set(t.skew,0),this._renderDisplay.scale.set(t.scaleX,t.scaleY)},a.prototype._updateTransformV4=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY),a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.setTransform(e,a,t.scaleX*this._textureScale,t.scaleY*this._textureScale,t.rotation,-t.skew,0)}else this._renderDisplay.position.set(t.x,t.y),this._renderDisplay.rotation=t.rotation,this._renderDisplay.skew.set(-t.skew,0),this._renderDisplay.scale.set(t.scaleX,t.scaleY)},a.prototype._identityTransform=function(){this._renderDisplay.setTransform(0,0,1,1,0,0,0)},a}(t.Slot);t.PixiSlot=e}(l||(l={})),function(t){var e=function(e){function a(i){void 0===i&&(i=null);var r=e.call(this,i)||this;if(null===a._dragonBonesInstance){var n=new t.PixiArmatureDisplay;a._dragonBonesInstance=new t.DragonBones(n)}return r._dragonBones=a._dragonBonesInstance,r}return f(a,e),a._clockHandler=function(t){this._dragonBonesInstance.advanceTime(o.ticker.shared.elapsedMS*t*.001)},Object.defineProperty(a,"factory",{get:function(){return null===a._factory&&(a._factory=new a),a._factory},enumerable:!0,configurable:!0}),a.prototype._buildTextureAtlasData=function(e,a){return e?e.renderTexture=a:e=t.BaseObject.borrowObject(t.PixiTextureAtlasData),e},a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature),i=new t.PixiArmatureDisplay;return a.init(e.armature,i,i,this._dragonBones),a},a.prototype._buildSlot=function(e,a,i){var r=t.BaseObject.borrowObject(t.PixiSlot);return r.init(a,i,new o.Sprite,new o.mesh.Mesh(null,null,null,null,o.mesh.Mesh.DRAW_MODES.TRIANGLES)),r},a.prototype.buildArmatureDisplay=function(t,e,a,i){void 0===e&&(e=""),void 0===a&&(a=""),void 0===i&&(i="");var r=this.buildArmature(t,e||"",a||"",i||"");return null!==r?(this._dragonBones.clock.add(r),r.display):null},a.prototype.getTextureDisplay=function(t,e){void 0===e&&(e=null);var a=this._getTextureData(null!==e?e:"",t);return null!==a&&null!==a.renderTexture?new o.Sprite(a.renderTexture):null},Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:!0,configurable:!0}),a._dragonBonesInstance=null,a._factory=null,a}(t.BaseFactory);t.PixiFactory=e}(l||(l={}));var m=l;class p{constructor({armatureName:t}){this.factory=m.PixiFactory.factory,this.armature=this.factory.buildArmatureDisplay(t)}play(t,e){return this.armature.animation.play(t,e)}stop(t){return this.armature.animation.stop(t)}}const c={START:"start",LOOP_COMPLETE:"loopComplete",COMPLETE:"complete",FADE_IN:"fadeIn",FADE_IN_COMPLETE:"fadeInComplete",FADE_OUT:"fadeOut",FADE_OUT_COMPLETE:"fadeOutComplete",FRAME_EVENT:"frameEvent",SOUND_EVENT:"soundEvent"},d=m.PixiFactory.factory;e.resource.registerResourceType("DRAGONBONE"),e.resource.registerInstance(e.RESOURCE_TYPE.DRAGONBONE,(({data:t,name:e})=>{d.parseDragonBonesData(t.ske,e),d.parseTextureAtlasData(t.tex,a.Texture.from(t.image),e)})),e.resource.registerDestroy(e.RESOURCE_TYPE.DRAGONBONE,(({name:t})=>{d.removeDragonBonesData(t),d.removeTextureAtlasData(t)}));let y=class extends i.Renderer{constructor(){super(...arguments),this.name="DragonBone",this.armatures={},this.autoPlay={},this.isRemovedMap=new Map}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this),this.renderSystem.application.ticker.add(m.PixiFactory._clockHandler,m.PixiFactory)}onDestroy(){this.renderSystem.application.ticker.remove(m.PixiFactory._clockHandler,m.PixiFactory)}componentChanged(t){return n(this,void 0,void 0,(function*(){if(this.autoPlay[t.gameObject.id]=t.component.autoPlay,"DragonBone"===t.componentName)if(t.type===e.OBSERVER_TYPE.ADD)this.add(t);else if(t.type===e.OBSERVER_TYPE.CHANGE){if("armature"===t.prop.prop[0])this.change(t)}else t.type===e.OBSERVER_TYPE.REMOVE&&this.remove(t)}))}add(t){return n(this,void 0,void 0,(function*(){const a=t.component;this.isRemovedMap.delete(a);const i=this.increaseAsyncId(t.gameObject.id);if(yield e.resource.getResource(a.resource),!this.validateAsyncId(t.gameObject.id,i))return;if(this.isRemovedMap.get(a))return void this.isRemovedMap.delete(a);const r=new p({armatureName:a.armatureName});this.armatures[t.gameObject.id]=r,this.renderSystem.containerManager.getContainer(t.gameObject.id).addChildAt(r.armature,0),a.armature=r;for(const t in c)r.armature.on(c[t],(e=>{a.emit(c[t],e)}))}))}change(t){if(this.remove(t),this.add(t),this.autoPlay[t.gameObject.id]){const e=t.component;e.play(e.animationName)}}remove(t){const a=this.armatures[t.gameObject.id];if(!a)return void this.isRemovedMap.set(t.component,!0);this.autoPlay[t.gameObject.id]=a.armature.animation.isPlaying,this.renderSystem.containerManager.getContainer(t.gameObject.id).removeChild(a.armature),a.armature.removeAllListeners(),a.armature.destroy({children:!0});const i=t.component;i.armature=null,delete this.armatures[t.gameObject.id],t.type===e.OBSERVER_TYPE.CHANGE&&(delete this.autoPlay[t.gameObject.id],i.removeAllListeners())}};y.systemName="DragonBone",y=r([e.decorators.componentObserver({DragonBone:["armatureName"]})],y);var g=y;exports.DragonBone=s,exports.DragonBoneSystem=g;