UNPKG

pixi5-dragonbones

Version:
1 lines 232 kB
"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return r(t,e)};return function(t,e){r(t,e);function a(){this.constructor=t}t.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}();var dragonBones;(function(o){var t=function(){function e(t){this._clock=new o.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=t;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(t){if(this._objects.length>0){for(var e=0,a=this._objects;e<a.length;e++){var r=a[e];r.returnToPool()}this._objects.length=0}this._clock.advanceTime(t);if(this._events.length>0){for(var i=0;i<this._events.length;++i){var n=this._events[i];var s=n.armature;if(s._armatureData!==null){s.eventDispatcher.dispatchDBEvent(n.type,n);if(n.type===o.EventObject.SOUND_EVENT){this._eventManager.dispatchDBEvent(n.type,n)}}this.bufferObject(n)}this._events.length=0}};e.prototype.bufferEvent=function(t){if(this._events.indexOf(t)<0){this._events.push(t)}};e.prototype.bufferObject=function(t){if(this._objects.indexOf(t)<0){this._objects.push(t)}};Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"eventManager",{get:function(){return this._eventManager},enumerable:true,configurable:true});e.VERSION="5.7.000";e.yDown=true;e.debug=false;e.debugDraw=false;return e}();o.DragonBones=t})(dragonBones||(dragonBones={}));if(!console.warn){console.warn=function(){}}if(!console.assert){console.assert=function(){}}if(!Date.now){Date.now=function t(){return(new Date).getTime()}}var __extends=function(t,e){function a(){this.constructor=t}for(var r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}a.prototype=e.prototype,t.prototype=new a};if(typeof global==="undefined"&&typeof window!=="undefined"){var global=window}if(typeof exports==="object"&&typeof module==="object"){module.exports=dragonBones}else if(typeof define==="function"&&define["amd"]){define(["dragonBones"],function(){return dragonBones})}else if(typeof exports==="object"){exports=dragonBones}else if(typeof global!=="undefined"){global.dragonBones=dragonBones}var dragonBones;(function(t){var e=function(){function n(){this.hashCode=n._hashCode++;this._isInPool=false}n._returnObject=function(t){var e=String(t.constructor);var a=e in n._maxCountMap?n._maxCountMap[e]:n._defaultMaxCount;var r=n._poolsMap[e]=n._poolsMap[e]||[];if(r.length<a){if(!t._isInPool){t._isInPool=true;r.push(t)}else{console.warn("The object is already in the pool.")}}else{}};n.toString=function(){throw new Error};n.setMaxCount=function(t,e){if(e<0||e!==e){e=0}if(t!==null){var a=String(t);var r=a in n._poolsMap?n._poolsMap[a]:null;if(r!==null&&r.length>e){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}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){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){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];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_<d?_:d);t.width=Math.ceil((p>v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(m<y?m:y);t.height=Math.ceil((c>g?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation<r?t.a/Math.cos(this.rotation):t.b/Math.sin(this.rotation);this.scaleY=i>-r&&i<r?t.d/Math.cos(i):-t.c/Math.sin(i);if(e>=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}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};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}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};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t<this.ints.length?this.ints[t]:0};t.prototype.getFloat=function(t){if(t===void 0){t=0}return t>=0&&t<this.floats.length?this.floats[t]:0};t.prototype.getString=function(t){if(t===void 0){t=0}return t>=0&&t<this.strings.length?this.strings[t]:""};return t}(t.BaseObject);t.UserData=e;var a=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.data=null;return t}t.toString=function(){return"[class dragonBones.ActionData]"};t.prototype._onClear=function(){if(this.data!==null){this.data.returnToPool()}this.type=0;this.name="";this.bone=null;this.slot=null;this.data=null};return t}(t.BaseObject);t.ActionData=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.frameIndices=[];t.cachedFrames=[];t.armatureNames=[];t.armatures={};t.userData=null;return t}t.toString=function(){return"[class dragonBones.DragonBonesData]"};t.prototype._onClear=function(){for(var t in this.armatures){this.armatures[t].returnToPool();delete this.armatures[t]}if(this.userData!==null){this.userData.returnToPool()}this.autoSearch=false;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};t.prototype.addArmature=function(t){if(t.name in this.armatures){console.warn("Same armature: "+t.name);return}t.parent=this;this.armatures[t.name]=t;this.armatureNames.push(t.name)};t.prototype.getArmature=function(t){return t in this.armatures?this.armatures[t]:null};return t}(t.BaseObject);t.DragonBonesData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(a){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.aabb=new a.Rectangle;t.animationNames=[];t.sortedBones=[];t.sortedSlots=[];t.defaultActions=[];t.actions=[];t.bones={};t.slots={};t.constraints={};t.skins={};t.animations={};t.canvas=null;t.userData=null;return t}t.toString=function(){return"[class dragonBones.ArmatureData]"};t.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++){var a=e[t];a.returnToPool()}for(var r=0,i=this.actions;r<i.length;r++){var a=i[r];a.returnToPool()}for(var n in this.bones){this.bones[n].returnToPool();delete this.bones[n]}for(var n in this.slots){this.slots[n].returnToPool();delete this.slots[n]}for(var n in this.constraints){this.constraints[n].returnToPool();delete this.constraints[n]}for(var n in this.skins){this.skins[n].returnToPool();delete this.skins[n]}for(var n in this.animations){this.animations[n].returnToPool();delete this.animations[n]}if(this.canvas!==null){this.canvas.returnToPool()}if(this.userData!==null){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};t.prototype.sortBones=function(){var t=this.sortedBones.length;if(t<=0){return}var e=this.sortedBones.concat();var a=0;var r=0;this.sortedBones.length=0;while(r<t){var i=e[a++];if(a>=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){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};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.bones=[];return t}t.toString=function(){return"[class dragonBones.PathConstraintData]"};t.prototype._onClear=function(){e.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};t.prototype.AddBone=function(t){this.bones.push(t)};return t}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;a<r.length;a++){var i=r[a];if(i!==null){i.returnToPool()}}delete this.displays[t]}this.name="";this.parent=null};t.prototype.addDisplay=function(t,e){if(!(t in this.displays)){this.displays[t]=[]}if(e!==null){e.parent=this}var a=this.displays[t];a.push(e)};t.prototype.getDisplay=function(t,e){var a=this.getDisplays(t);if(a!==null){for(var r=0,i=a;r<i.length;r++){var n=i[r];if(n!==null&&n.name===e){return n}}}return null};t.prototype.getDisplays=function(t){if(!(t in this.displays)){return null}return this.displays[t]};return t}(t.BaseObject);t.SkinData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(a){var r=function(){function t(){this.weight=null}t.prototype.clear=function(){if(!this.isShared&&this.weight!==null){this.weight.returnToPool()}this.isShared=false;this.inheritDeform=false;this.offset=0;this.data=null;this.weight=null};t.prototype.shareFrom=function(t){this.isShared=true;this.offset=t.offset;this.weight=t.weight};Object.defineProperty(t.prototype,"vertexCount",{get:function(){var t=this.data.intArray;return t[this.offset+0]},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"triangleCount",{get:function(){var t=this.data.intArray;return t[this.offset+1]},enumerable:true,configurable:true});return t}();a.GeometryData=r;var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;return t}t.prototype._onClear=function(){this.name="";this.path="";this.transform.identity();this.parent=null};return t}(a.BaseObject);a.DisplayData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.pivot=new a.Point;return t}t.toString=function(){return"[class dragonBones.ImageDisplayData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=0;this.pivot.clear();this.texture=null};return t}(t);a.ImageDisplayData=e;var i=function(r){__extends(t,r);function t(){var t=r!==null&&r.apply(this,arguments)||this;t.actions=[];return t}t.toString=function(){return"[class dragonBones.ArmatureDisplayData]"};t.prototype._onClear=function(){r.prototype._onClear.call(this);for(var t=0,e=this.actions;t<e.length;t++){var a=e[t];a.returnToPool()}this.type=1;this.inheritAnimation=false;this.actions.length=0;this.armature=null};t.prototype.addAction=function(t){this.actions.push(t)};return t}(t);a.ArmatureDisplayData=i;var n=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new r;return t}t.toString=function(){return"[class dragonBones.MeshDisplayData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.geometry.clear();this.texture=null};return t}(t);a.MeshDisplayData=n;var s=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.boundingBox=null;return t}t.toString=function(){return"[class dragonBones.BoundingBoxDisplayData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this.boundingBox!==null){this.boundingBox.returnToPool()}this.type=3;this.boundingBox=null};return t}(t);a.BoundingBoxDisplayData=s;var o=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new r;t.curveLengths=[];return t}t.toString=function(){return"[class dragonBones.PathDisplayData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=4;this.closed=false;this.constantSpeed=false;this.geometry.clear();this.curveLengths.length=0};return t}(t);a.PathDisplayData=o;var l=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.bones=[];return t}t.toString=function(){return"[class dragonBones.WeightData]"};t.prototype._onClear=function(){this.count=0;this.offset=0;this.bones.length=0};t.prototype.addBone=function(t){this.bones.push(t)};return t}(a.BaseObject);a.WeightData=l})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.color=0;this.width=0;this.height=0};return e}(t.BaseObject);t.BoundingBoxData=e;var h=function(t){__extends(D,t);function D(){return t!==null&&t.apply(this,arguments)||this}D.toString=function(){return"[class dragonBones.RectangleBoundingBoxData]"};D._computeOutCode=function(t,e,a,r,i,n){var s=0;if(t<a){s|=1}else if(t>i){s|=2}if(e<r){s|=4}else if(e>n){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=t>i&&t<s&&e>n&&e<o;var _=a>i&&a<s&&r>n&&r<o;if(f&&_){return-1}var m=0;var p=D._computeOutCode(t,e,i,n,s,o);var c=D._computeOutCode(a,r,i,n,s,o);while(true){if((p|c)===0){m=2;break}else if((p&c)!==0){break}var d=0;var y=0;var v=0;var g=p!==0?p:c;if((g&4)!==0){d=t+(a-t)*(n-e)/(r-e);y=n;if(u!==null){v=-Math.PI*.5}}else if((g&8)!==0){d=t+(a-t)*(o-e)/(r-e);y=o;if(u!==null){v=Math.PI*.5}}else if((g&2)!==0){y=e+(r-e)*(s-t)/(a-t);d=s;if(u!==null){v=0}}else if((g&1)!==0){y=e+(r-e)*(i-t)/(a-t);d=i;if(u!==null){v=Math.PI}}if(g===p){t=d;e=y;p=D._computeOutCode(t,e,i,n,s,o);if(u!==null){u.x=v}}else{a=d;r=y;c=D._computeOutCode(a,r,i,n,s,o);if(u!==null){u.y=v}}}if(m){if(f){m=2;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=a}if(u!==null){u.x=u.y+Math.PI}}else if(_){m=1;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.y=u.x+Math.PI}}else{m=3;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=a;h.y=r}}}return m};D.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=0};D.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T<l;T+=2){var b=i[T];var A=i[T+1];if(m===b){m=b+1e-4}if(p===A){p=A+1e-4}var P=m-b;var S=p-A;var O=m*A-p*b;var x=h*S-u*P;var B=(f*P-h*O)/x;if((B>=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var I=B-t;if(I<0){I=-I}if(_===0){c=I;d=I;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(I<c){c=I;y=B;v=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5}}if(I>d){d=I;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r<i;r+=2){var s=this.vertices[n+1];var o=this.vertices[r+1];if(o<e&&s>=e||s<e&&o>=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h<t){a=!a}}n=r}}return a};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=0;if(h.rectangleIntersectsSegment(t,e,a,r,this.x,this.y,this.x+this.width,this.y+this.height,null,null,null)!==0){o=l.polygonIntersectsSegment(t,e,a,r,this.vertices,i,n,s)}return o};return l}(e);t.PolygonBoundingBoxData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.cachedFrames=[];t.boneTimelines={};t.slotTimelines={};t.constraintTimelines={};t.animationTimelines={};t.boneCachedFrameIndices={};t.slotCachedFrameIndices={};t.actionTimeline=null;t.zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationData]"};t.prototype._onClear=function(){for(var t in this.boneTimelines){for(var e=0,a=this.boneTimelines[t];e<a.length;e++){var r=a[e];r.returnToPool()}delete this.boneTimelines[t]}for(var t in this.slotTimelines){for(var i=0,n=this.slotTimelines[t];i<n.length;i++){var r=n[i];r.returnToPool()}delete this.slotTimelines[t]}for(var t in this.constraintTimelines){for(var s=0,o=this.constraintTimelines[t];s<o.length;s++){var r=o[s];r.returnToPool()}delete this.constraintTimelines[t]}for(var t in this.animationTimelines){for(var l=0,h=this.animationTimelines[t];l<h.length;l++){var r=h[l];r.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]}if(this.actionTimeline!==null){this.actionTimeline.returnToPool()}if(this.zOrderTimeline!==null){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};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}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,r=this.cacheFrames.length;a<r;++a){this.cachedFrames[a]=false}for(var i=0,n=this.parent.sortedBones;i<n.length;i++){var s=n[i];var o=new Array(e);for(var a=0,r=o.length;a<r;++a){o[a]=-1}this.boneCachedFrameIndices[s.name]=o}for(var l=0,h=this.parent.sortedSlots;l<h.length;l++){var u=h[l];var o=new Array(e);for(var a=0,r=o.length;a<r;++a){o[a]=-1}this.slotCachedFrameIndices[u.name]=o}};t.prototype.addBoneTimeline=function(t,e){var a=t in this.boneTimelines?this.boneTimelines[t]:this.boneTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};t.prototype.addSlotTimeline=function(t,e){var a=t in this.slotTimelines?this.slotTimelines[t]:this.slotTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};t.prototype.addConstraintTimeline=function(t,e){var a=t in this.constraintTimelines?this.constraintTimelines[t]:this.constraintTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};t.prototype.addAnimationTimeline=function(t,e){var a=t in this.animationTimelines?this.animationTimelines[t]:this.animationTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};t.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?this.boneTimelines[t]:null};t.prototype.getSlotTimelines=function(t){return t in this.slotTimelines?this.slotTimelines[t]:null};t.prototype.getConstraintTimelines=function(t){return t in this.constraintTimelines?this.constraintTimelines[t]:null};t.prototype.getAnimationTimelines=function(t){return t in this.animationTimelines?this.animationTimelines[t]:null};t.prototype.getBoneCachedFrameIndices=function(t){return t in this.boneCachedFrameIndices?this.boneCachedFrameIndices[t]:null};t.prototype.getSlotCachedFrameIndices=function(t){return t in this.slotCachedFrameIndices?this.slotCachedFrameIndices[t]:null};return t}(t.BaseObject);t.AnimationData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.TimelineData]"};e.prototype._onClear=function(){this.type=10;this.offset=0;this.frameIndicesOffset=-1};return e}(t.BaseObject);t.TimelineData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationTimelineData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.x=0;this.y=0};return e}(a);t.AnimationTimelineData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.boneMask=[];return t}t.toString=function(){return"[class dragonBones.AnimationConfig]"};t.prototype._onClear=function(){this.pauseFadeOut=true;this.fadeOutMode=4;this.fadeOutTweenType=1;this.fadeOutTime=-1;this.actionEnabled=true;this.additive=false;this.displayControl=true;this.pauseFadeIn=true;this.resetToPose=true;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};t.prototype.clear=function(){this._onClear()};t.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]}};return t}(t.BaseObject);t.AnimationConfig=e})(dragonBones||(dragonBones={}));var dragonBones;(function(r){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.textures={};return t}t.prototype._onClear=function(){for(var t in this.textures){this.textures[t].returnToPool();delete this.textures[t]}this.autoSearch=false;this.width=0;this.height=0;this.scale=1;this.name="";this.imagePath=""};t.prototype.copyFrom=function(t){this.autoSearch=t.autoSearch;this.scale=t.scale;this.width=t.width;this.height=t.height;this.name=t.name;this.imagePath=t.imagePath;for(var e in 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}};t.prototype.addTexture=function(t){if(t.name in this.textures){console.warn("Same texture: "+t.name);return}t.parent=this;this.textures[t.name]=t};t.prototype.getTexture=function(t){return t in this.textures?this.textures[t]:null};return t}(r.BaseObject);r.TextureAtlasData=t;var e=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.region=new r.Rectangle;t.frame=null;return t}a.createRectangle=function(){return new r.Rectangle};a.prototype._onClear=function(){this.rotated=false;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;if(this.frame===null&&t.frame!==null){this.frame=a.createRectangle()}else if(this.frame!==null&&t.frame===null){this.frame=null}if(this.frame!==null&&t.frame!==null){this.frame.copyFrom(t.frame)}};return a}(r.BaseObject);r.TextureData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(i){var t=function(e){__extends(y,e);function y(){var t=e!==null&&e.apply(this,arguments)||this;t._bones=[];t._slots=[];t._constraints=[];t._actions=[];t._animation=null;t._proxy=null;t._replaceTextureAtlasData=null;t._clock=null;return t}y.toString=function(){return"[class dragonBones.Armature]"};y._onSortSlots=function(t,e){return t._zIndex*1e3+t._zOrder>e._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t<e.length;t++){var a=e[t];a.returnToPool()}for(var r=0,i=this._slots;r<i.length;r++){var n=i[r];n.returnToPool()}for(var s=0,o=this._constraints;s<o.length;s++){var l=o[s];l.returnToPool()}for(var h=0,u=this._actions;h<u.length;h++){var f=u[h];f.returnToPool()}if(this._animation!==null){this._animation.returnToPool()}if(this._proxy!==null){this._proxy.dbClear()}if(this._replaceTextureAtlasData!==null){this._replaceTextureAtlasData.returnToPool()}this.inheritAnimation=true;this.userData=null;this._lockUpdate=false;this._slotsDirty=true;this._zOrderDirty=false;this._zIndexDirty=false;this._alphaDirty=true;this._flipX=false;this._flipY=false;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};y.prototype._sortZOrder=function(t,e){var a=this._armatureData.sortedSlots;var r=t===null;if(this._zOrderDirty||!r){for(var i=0,n=a.length;i<n;++i){var s=r?i:t[e+i];if(s<0||s>=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a<r;++a){this._slots[a]._setZOrder(a)}}this._slotsDirty=false;this._zIndexDirty=false}if(this._alphaDirty){this._alphaDirty=false;this._globalAlpha=this._alpha*(this._parent!==null?this._parent._globalAlpha:1);for(var i=0,n=this._bones;i<n.length;i++){var s=n[i];s._updateAlpha()}for(var o=0,l=this._slots;o<l.length;o++){var h=l[o];h._updateAlpha()}}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var a=0,r=0;for(a=0,r=this._bones.length;a<r;++a){this._bones[a].update(this._cacheFrameIndex)}for(a=0,r=this._slots.length;a<r;++a){this._slots[a].update(this._cacheFrameIndex)}}if(this._actions.length>0){for(var u=0,f=this._actions;u<f.length;u++){var _=f[u];var m=_.actionData;if(m!==null){if(m.type===0){if(_.slot!==null){var p=_.slot.childArmature;if(p!==null){p.animation.fadeIn(m.name)}}else if(_.bone!==null){for(var c=0,d=this.getSlots();c<d.length;c++){var h=d[c];if(h.parent===_.bone){var p=h.childArmature;if(p!==null){p.animation.fadeIn(m.name)}}}}else{this._animation.fadeIn(m.name)}}}_.returnToPool()}this._actions.length=0}this._lockUpdate=false;this._proxy.dbUpdate()};y.prototype.invalidUpdate=function(t,e){if(t===void 0){t=null}if(e===void 0){e=false}if(t!==null&&t.length>0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r<i.length;r++){var n=i[r];if(n.parent===a){n.invalidUpdate()}}}}}else{for(var s=0,o=this._bones;s<o.length;s++){var a=o[s];a.invalidUpdate()}if(e){for(var l=0,h=this._slots;l<h.length;l++){var n=h[l];n.invalidUpdate()}}}};y.prototype.containsPoint=function(t,e){for(var a=0,r=this._slots;a<r.length;a++){var i=r[a];if(i.containsPoint(t,e)){return i}}return null};y.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=t===a;var l=0;var h=0;var u=0;var f=0;var _=0;var m=0;var p=0;var c=0;var d=null;var y=null;for(var v=0,g=this._slots;v<g.length;v++){var D=g[v];var T=D.intersectsSegment(t,e,a,r,i,n,s);if(T>0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||b<l){l=b;u=i.x;f=i.y;d=D;if(s){p=s.x}}}if(n!==null){var b=n.x-t;if(b<0){b=-b}if(y===null||b>h){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e<a.length;e++){var r=a[e];if(r.name===t){return r}}return null};y.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return e!==null?e.parent:null};y.prototype.getSlot=function(t){for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];if(r.name===t){return r}}return null};y.prototype.getSlotByDisplay=function(t){if(t!==null){for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];if(r.display===t){return r}}}return null};y.prototype.getBones=function(){return this._bones};y.prototype.getSlots=function(){return this._slots};Object.defineProperty(y.prototype,"flipX",{get:function(){return this._flipX},set:function(t){if(this._flipX===t){return}this._flipX=t;this.invalidUpdate()},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"flipY",{get:function(){return this._flipY},set:function(t){if(this._flipY===t){return}this._flipY=t;this.invalidUpdate()},enumerable:true,configurable:true});Object.defineProperty(y.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 r=a[e];var i=r.childArmature;if(i!==null){i.cacheFrameRate=t}}}},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"name",{get:function(){return this._armatureData.name},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"animation",{get:function(){return this._animation},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"proxy",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"display",{get:function(){return this._display},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"replacedTexture",{get:function(){return this._replacedTexture},set:function(t){if(this._replacedTexture===t){return}if(this._replaceTextureAtlasData!==null){this._replaceTextureAtlasData.returnToPool();this._replaceTextureAtlasData=null}this._replacedTexture=t;for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];r.invalidUpdate();r.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock===t){return}if(this._clock!==null){this._clock.remove(this)}this._clock=t;if(this._clock){this._clock.add(this)}for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];var i=r.childArmature;if(i!==null){i.clock=this._clock}}},enumerable:true,configurable:true});Object.defineProperty(y.prototype,"parent",{get:function(){return this._parent},enumerable:true,configurable:true});y.prototype.getDisplay=function(){return this._display};return y}(i.BaseObject);i.Armature=t})(dragonBones||(dragonBones={}));var dragonBones;(function(a){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.globalTransformMatrix=new a.Matrix;t.global=new a.Transform;t.offset=new a.Transform;return t}t.prototype._onClear=function(){this.globalTransformMatrix.identity();this.global.identity();this.offset.identity();this.origin=null;this.userData=null;this._globalDirty=false;this._alpha=1;this._globalAlpha=1;this._armature=null};t.prototype.updateGlobalTransform=function(){if(this._globalDirty){this._globalDirty=false;this.global.fromMatrix(this.globalTransformMatrix)}};Object.defineProperty(t.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});t._helpMatrix=new a.Matrix;t._helpTransform=new a.Transform;t._helpPoint=new a.Point;return t}(a.BaseObject);a.TransformObject=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.animationPose=new y.Transform;return t}t.toString=function(){return"[class dragonBones.Bone]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.offsetMode=1;this.animationPose.identity();this._transformDirty=false;this._childrenTransformDirty=false;this._localDirty=true;this._hasConstraint=false;this._visible=true;this._cachedFrameIndex=-1;this._boneData=null;this._parent=null;this._cachedFrameIndices=null};t.prototype._updateGlobalTransformMatrix=function(t){var e=this._boneData;var a=this.global;var r=this.globalTransformMatrix;var i=this.origin;var n=this.offset;var s=this.animationPose;var o=this._parent;var l=this._armature.flipX;var h=this._armature.flipY===y.DragonBones.yDown;var u=o!==null;var f=0;if(this.offsetMode===1){if(i!==null){a.x=i.x+n.x+s.x;a.scaleX=i.scaleX*n.scaleX*s.scaleX;a.scaleY=i.scaleY*n.scaleY*s.scaleY;if(y.DragonBones.yDown){a.y=i.y+n.y+s.y;a.skew=i.skew+n.skew+s.skew;a.rotation=i.rotation+n.rotation+s.rotation}else{a.y=i.y-n.y+s.y;a.skew=i.skew-n.skew+s.skew;a.rotation=i.rotation-n.rotation+s.rotation}}else{a.copyFrom(n);if(!y.DragonBones.yDown){a.y=-a.y;a.skew=-a.skew;a.rotation=-a.rotation}a.add(s)}}else if(this.offsetMode===0){if(i!==null){a.copyFrom(i).add(s)}else{a.copyFrom(s)}}else{u=false;a.copyFrom(n);if(!y.DragonBones.yDown){a.y=-a.y;a.skew=-a.skew;a.rotation=-a.rotation}}if(u){var _=o._boneData.type===1;var m=_?o._bone:null;var p=_?o._getGlobalTransformMatrix(a.x,a.y):o.globalTransformMatrix;if(e.inheritScale&&(!_||m!==null)){if(_){if(e.inheritRotation){a.rotation+=o.global.rotation}m.updateGlobalTransform();a.scaleX*=m.global.scaleX;a.scaleY*=m.global.scaleY;p.transformPoint(a.x,a.y,a);a.toMatrix(r);if(e.inheritTranslation){a.x=r.tx;a.y=r.ty}else{r.tx=a.x;r.ty=a.y}}else{if(!e.inheritRotation){o.updateGlobalTransform();if(l&&h){f=a.rotation-(o.global.rotation+Math.PI)}else if(l){f=a.rotation+o.global.rotation+Math.PI}else if(h){f=a.rotation+o.global.rotation}else{f=a.rotation-o.global.rotation}a.rotation=f}a.toMatrix(r);r.concat(p);if(e.inheritTranslation){a.x=r.tx;a.y=r.ty}else{r.tx=a.x;r.ty=a.y}if(t){a.fromMatrix(r)}else{this._globalDirty=true}}}else{if(e.inheritTranslation){var c=a.x;var d=a.y;a.x=p.a*c+p.c*d+p.tx;a.y=p.b*c+p.d*d+p.ty}else{if(l){a.x=-a.x}if(h){a.y=-a.y}}if(e.inheritRotation){o.updateGlobalTransform();if(o.global.scaleX<0){f=a.rotation+o.global.rotation+Math.PI}else{f=a.rotation+o.global.rotation}if(p.a*p.d-p.b*p.c<0){f-=a.rotation*2;if(l!==h||e.inheritReflection){a.skew+=Math.PI}if(!y.DragonBones.yDown){a.skew=-a.skew}}a.rotation=f}else if(l||h){if(l&&h){f=a.rotation+Math.PI}else{if(l){f=Math.PI-a.rotation}else{f=-a.rotation}a.skew+=Math.PI}a.rotation=f}a.toMatrix(r)}}else{if(l||h){if(l){a.x=-a.x}if(h){a.y=-a.y}if(l&&h){f=a.rotation+Math.PI}else{if(l){f=Math.PI-a.rotation}else{f=-a.rotation}a.skew+=Math.PI}a.rotation=f}a.toMatrix(r)}};t.prototype._updateAlpha=function(){if(this._parent!==null){this._globalAlpha=this._alpha*this._parent._globalAlpha}else{this._globalAlpha=this._alpha*this._armature._globalAlpha}};t.prototype.init=function(t,e){if(this._boneData!==null){return}this._boneData=t;this._armature=e;this._alpha=this._boneData.alpha;if(this._boneData.parent!==null){this._parent=this._armature.getBone(this._boneData.parent.name)}this._armature._addBone(this);this.origin=this._boneData.transform};t.prototype.update=function(t){if(t>=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cach