[go: up one dir, main page]

0% found this document useful (0 votes)
454 views459 pages

Cocos2d Js Min

The document defines several easing functions for animations in Cocos2d-js, including easeIn, easeOut, easeInOut, easeExponentialIn, easeExponentialOut, easeExponentialInOut, easeSineIn, easeSineOut, easeSineInOut, and easeElasticIn. It defines them as classes with easing and reverse functions to calculate the progress and reverse progress of animations over time.

Uploaded by

Rahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
454 views459 pages

Cocos2d Js Min

The document defines several easing functions for animations in Cocos2d-js, including easeIn, easeOut, easeInOut, easeExponentialIn, easeExponentialOut, easeExponentialInOut, easeSineIn, easeSineOut, easeSineInOut, and easeElasticIn. It defines them as classes with easing and reverse functions to calculate the progress and reverse progress of animations over time.

Uploaded by

Rahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 459

(function(t,e,i){function n(i,r){var s=e[i];if(!s){var a=t[i];if(!

a)return;var
o={};s=e[i]={exports:o},a[0]((function(t){return n(a[1][t]||t)}),s,o)}return
s.exports}for(var r=0;r<i.length;r++)n(i[r])})({1:[(function(t,e,i){"use
strict";t("../core/platform/CCClass");var
n=t("../core/utils/misc");cc.Action=cc.Class({name:"cc.Action",ctor:function()
{this.originalTarget=null,this.target=null,this.tag=cc.Action.TAG_INVALID},clone:fu
nction(){var t=new cc.Action;return
t.originalTarget=null,t.target=null,t.tag=this.tag,t},isDone:function(){return!
0},startWithTarget:function(t){this.originalTarget=t,this.target=t},stop:function()
{this.target=null},step:function(t){cc.logID(1006)},update:function(t)
{cc.logID(1007)},getTarget:function(){return this.target},setTarget:function(t)
{this.target=t},getOriginalTarget:function(){return
this.originalTarget},setOriginalTarget:function(t)
{this.originalTarget=t},getTag:function(){return this.tag},setTag:function(t)
{this.tag=t},retain:function(){},release:function(){}}),cc.Action.TAG_INVALID=-
1,cc.FiniteTimeAction=cc.Class({name:"cc.FiniteTimeAction",extends:cc.Action,ctor:f
unction(){this._duration=0},getDuration:function(){return
this._duration*(this._timesForRepeat||1)},setDuration:function(t)
{this._duration=t},reverse:function(){return cc.logID(1008),null},clone:function()
{return new
cc.FiniteTimeAction}}),cc.Speed=cc.Class({name:"cc.Speed",extends:cc.Action,ctor:fu
nction(t,e)
{this._speed=0,this._innerAction=null,t&&this.initWithAction(t,e)},getSpeed:functio
n(){return this._speed},setSpeed:function(t)
{this._speed=t},initWithAction:function(t,e){return t?
(this._innerAction=t,this._speed=e,!0):(cc.errorID(1021),!1)},clone:function(){var
t=new cc.Speed;return
t.initWithAction(this._innerAction.clone(),this._speed),t},startWithTarget:function
(t)
{cc.Action.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget
(t)},stop:function()
{this._innerAction.stop(),cc.Action.prototype.stop.call(this)},step:function(t)
{this._innerAction.step(t*this._speed)},isDone:function(){return
this._innerAction.isDone()},reverse:function(){return new
cc.Speed(this._innerAction.reverse(),this._speed)},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.speed=function(t,e){return new
cc.Speed(t,e)},cc.Follow=cc.Class({name:"cc.Follow",extends:cc.Action,ctor:function
(t,e){this._followedNode=null,this._boundarySet=!1,this._boundaryFullyCovered=!
1,this._halfScreenSize=null,this._fullScreenSize=null,this.leftBoundary=0,this.righ
tBoundary=0,this.topBoundary=0,this.bottomBoundary=0,this._worldRect=cc.rect(0,0,0,
0),t&&(e?this.initWithTarget(t,e):this.initWithTarget(t))},clone:function(){var
t=new cc.Follow,e=this._worldRect,i=new cc.Rect(e.x,e.y,e.width,e.height);return
t.initWithTarget(this._followedNode,i),t},isBoundarySet:function(){return
this._boundarySet},setBoudarySet:function(t)
{this._boundarySet=t},initWithTarget:function(t,e){if(!t)return cc.errorID(1022),!
1;e=e||cc.rect(0,0,0,0),this._followedNode=t,this._worldRect=e,this._boundarySet=!
(0===e.width&&0===e.height),this._boundaryFullyCovered=!1;var i=cc.winSize;return
this._fullScreenSize=cc.v2(i.width,i.height),this._halfScreenSize=this._fullScreenS
ize.mul(.5),this._boundarySet&&(this.leftBoundary=-(e.x+e.width-
this._fullScreenSize.x),this.rightBoundary=-e.x,this.topBoundary=-
e.y,this.bottomBoundary=-(e.y+e.height-
this._fullScreenSize.y),this.rightBoundary<this.leftBoundary&&(this.rightBoundary=t
his.leftBoundary=(this.leftBoundary+this.rightBoundary)/2),this.topBoundary<this.bo
ttomBoundary&&(this.topBoundary=this.bottomBoundary=(this.topBoundary+this.bottomBo
undary)/2),this.topBoundary===this.bottomBoundary&&this.leftBoundary===this.rightBo
undary&&(this._boundaryFullyCovered=!0)),!0},step:function(t){var
e=this.target.convertToWorldSpaceAR(cc.Vec2.ZERO),i=this._followedNode.convertToWor
ldSpaceAR(cc.Vec2.ZERO),r=e.sub(i),s=this.target.parent.convertToNodeSpaceAR(r.add(
this._halfScreenSize));if(this._boundarySet)
{if(this._boundaryFullyCovered)return;this.target.setPosition(n.clampf(s.x,this.lef
tBoundary,this.rightBoundary),n.clampf(s.y,this.bottomBoundary,this.topBoundary))}e
lse this.target.setPosition(s.x,s.y)},isDone:function(){return!
this._followedNode.activeInHierarchy},stop:function()
{this.target=null,cc.Action.prototype.stop.call(this)}}),cc.follow=function(t,e)
{return new cc.Follow(t,e)}}),
{"../core/platform/CCClass":200,"../core/utils/misc":295}],2:[(function(t,e,i){"use
strict";function n(t,e,i,n,r,s){var a=s*s,o=a*s,l=(1-r)/2,h=l*(2*a-o-s),c=l*(-o+a)
+(2*o-3*a+1),u=l*(o-2*a+s)+(-2*o+3*a),_=l*(o-
a),f=t.x*h+e.x*c+i.x*u+n.x*_,d=t.y*h+e.y*c+i.y*u+n.y*_;return cc.v2(f,d)}function
r(t,e){return t[Math.min(t.length-1,Math.max(e,0))]}function s(t){for(var
e=[],i=t.length-1;i>=0;i--)e.push(cc.v2(t[i].x,t[i].y));return e}function a(t)
{for(var e=[],i=0;i<t.length;i++)e.push(cc.v2(t[i].x,t[i].y));return
e}cc.CardinalSplineTo=cc.Class({name:"cc.CardinalSplineTo",extends:cc.ActionInterva
l,ctor:function(t,e,i)
{this._points=[],this._deltaT=0,this._tension=0,this._previousPosition=null,this._a
ccumulatedDiff=null,void 0!
==i&&cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,i)},initWithDurat
ion:function(t,e,i){return e&&0!==e.length?!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this.setPoints(e),this.
_tension=i,!0):(cc.errorID(1024),!1)},clone:function(){var t=new
cc.CardinalSplineTo;return
t.initWithDuration(this._duration,a(this._points),this._tension),t},startWithTarget
:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._deltaT=1/
(this._points.length-
1),this._previousPosition=cc.v2(this.target.x,this.target.y),this._accumulatedDiff=
cc.v2(0,0)},update:function(t){var e,i;t=this._computeEaseTime(t);var
s=this._points;if(1===t)e=s.length-1,i=1;else{var a=this._deltaT;i=(t-a*(e=0|
t/a))/a}var o,l,h=n(r(s,e-1),r(s,e-
0),r(s,e+1),r(s,e+2),this._tension,i);if(cc.macro.ENABLE_STACKABLE_ACTIONS&&(o=this
.target.x-this._previousPosition.x,l=this.target.y-this._previousPosition.y,0!==o||
0!==l)){var
c=this._accumulatedDiff;o=c.x+o,l=c.y+l,c.x=o,c.y=l,h.x+=o,h.y+=l}this.updatePositi
on(h)},reverse:function(){var t=s(this._points);return
cc.cardinalSplineTo(this._duration,t,this._tension)},updatePosition:function(t)
{this.target.setPosition(t),this._previousPosition=t},getPoints:function(){return
this._points},setPoints:function(t)
{this._points=t}}),cc.cardinalSplineTo=function(t,e,i){return new
cc.CardinalSplineTo(t,e,i)},cc.CardinalSplineBy=cc.Class({name:"cc.CardinalSplineBy
",extends:cc.CardinalSplineTo,ctor:function(t,e,i)
{this._startPosition=cc.v2(0,0),void 0!
==i&&this.initWithDuration(t,e,i)},startWithTarget:function(t)
{cc.CardinalSplineTo.prototype.startWithTarget.call(this,t),this._startPosition.x=t
.x,this._startPosition.y=t.y},reverse:function(){for(var
t,e=this._points.slice(),i=e[0],n=1;n<e.length;++n)t=e[n],e[n]=t.sub(i),i=t;var
r=s(e);i=r[r.length-1],r.pop(),i.x=-i.x,i.y=-i.y,r.unshift(i);for(n=1;n<r.length;+
+n)(t=r[n]).x=-t.x,t.y=-t.y,t.x+=i.x,t.y+=i.y,r[n]=t,i=t;return
cc.cardinalSplineBy(this._duration,r,this._tension)},updatePosition:function(t){var
e=this._startPosition,i=t.x+e.x,n=t.y+e.y;this._previousPosition.x=i,this._previous
Position.y=n,this.target.setPosition(i,n)},clone:function(){var t=new
cc.CardinalSplineBy;return
t.initWithDuration(this._duration,a(this._points),this._tension),t}}),cc.cardinalSp
lineBy=function(t,e,i){return new
cc.CardinalSplineBy(t,e,i)},cc.CatmullRomTo=cc.Class({name:"cc.CatmullRomTo",extend
s:cc.CardinalSplineTo,ctor:function(t,e)
{e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return
cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function()
{var t=new cc.CatmullRomTo;return
t.initWithDuration(this._duration,a(this._points)),t}}),cc.catmullRomTo=function(t,
e){return new
cc.CatmullRomTo(t,e)},cc.CatmullRomBy=cc.Class({name:"cc.CatmullRomBy",extends:cc.C
ardinalSplineBy,ctor:function(t,e)
{e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return
cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function()
{var t=new cc.CatmullRomBy;return
t.initWithDuration(this._duration,a(this._points)),t}}),cc.catmullRomBy=function(t,
e){return new cc.CatmullRomBy(t,e)}}),{}],3:[(function(t,e,i){"use
strict";cc.easeIn=function(t){return{_rate:t,easing:function(t){return
Math.pow(t,this._rate)},reverse:function(){return
cc.easeIn(1/this._rate)}}},cc.easeOut=function(t){return{_rate:t,easing:function(t)
{return Math.pow(t,1/this._rate)},reverse:function(){return
cc.easeOut(1/this._rate)}}},cc.easeInOut=function(t)
{return{_rate:t,easing:function(t)
{return(t*=2)<1?.5*Math.pow(t,this._rate):1-.5*Math.pow(2-
t,this._rate)},reverse:function(){return cc.easeInOut(this._rate)}}};var
n={easing:function(t){return 0===t?0:Math.pow(2,10*(t-1))},reverse:function()
{return r}};cc.easeExponentialIn=function(){return n};var r={easing:function(t)
{return 1===t?1:1-Math.pow(2,-10*t)},reverse:function(){return
n}};cc.easeExponentialOut=function(){return r};var s={easing:function(t){return 1!
==t&&0!==t?(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-
1))):t},reverse:function(){return s}};cc.easeExponentialInOut=function(){return
s};var a={easing:function(t){return 0===t||1===t?t:-
1*Math.cos(t*Math.PI/2)+1},reverse:function(){return o}};cc.easeSineIn=function()
{return a};var o={easing:function(t){return 0===t||1===t?
t:Math.sin(t*Math.PI/2)},reverse:function(){return a}};cc.easeSineOut=function()
{return o};var l={easing:function(t){return 0===t||1===t?
t:-.5*(Math.cos(Math.PI*t)-1)},reverse:function(){return
l}};cc.easeSineInOut=function(){return l};var h={easing:function(t){return 0===t||
1===t?t:(t-=1,-
Math.pow(2,10*t)*Math.sin((t-.075)*Math.PI*2/.3))},reverse:function(){return
c}};cc.easeElasticIn=function(t){return t&&.3!==t?{_period:t,easing:function(t)
{return
0===t||1===t?t:(t-=1,-Math.pow(2,10*t)*Math.sin((t-
this._period/4)*Math.PI*2/this._period))},reverse:function(){return
cc.easeElasticOut(this._period)}}:h};var c={easing:function(t){return 0===t||1===t?
t:Math.pow(2,-10*t)*Math.sin((t-.075)*Math.PI*2/.3)+1},reverse:function(){return
h}};function u(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-
=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-
=2.625/2.75)*t+.984375}cc.easeElasticOut=function(t){return t&&.3!==t?
{_period:t,easing:function(t){return 0===t||1===t?t:Math.pow(2,-10*t)*Math.sin((t-
this._period/4)*Math.PI*2/this._period)+1},reverse:function(){return
cc.easeElasticIn(this._period)}}:c},cc.easeElasticInOut=function(t)
{return{_period:t=t||.3,easing:function(t){var e=0,i=this._period;if(0===t||
1===t)e=t;else{t*=2,i||(i=this._period=.3*1.5);var n=i/4;e=(t-
=1)<0?-.5*Math.pow(2,10*t)*Math.sin((t-n)*Math.PI*2/i):Math.pow(2,-
10*t)*Math.sin((t-n)*Math.PI*2/i)*.5+1}return e},reverse:function(){return
cc.easeElasticInOut(this._period)}}};var _={easing:function(t){return 1-u(1-
t)},reverse:function(){return f}};cc.easeBounceIn=function(){return _};var
f={easing:function(t){return u(t)},reverse:function(){return
_}};cc.easeBounceOut=function(){return f};var d={easing:function(t){return
t<.5?.5*(1-u(1-(t*=2))):.5*u(2*t-1)+.5},reverse:function(){return
d}};cc.easeBounceInOut=function(){return d};var m={easing:function(t){return
0===t||1===t?t:t*t*(2.70158*t-1.70158)},reverse:function(){return
p}};cc.easeBackIn=function(){return m};var p={easing:function(t){return(t-
=1)*t*(2.70158*t+1.70158)+1},reverse:function(){return
m}};cc.easeBackOut=function(){return p};var v={easing:function(t){return(t*=2)<1?
t*t*(3.5949095*t-2.5949095)/2:(t-
=2)*t*(3.5949095*t+2.5949095)/2+1},reverse:function(){return
v}};cc.easeBackInOut=function(){return v},cc.easeBezierAction=function(t,e,i,n)
{return{easing:function(r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-
r,2)*e+3*Math.pow(r,2)*(1-r)*i+Math.pow(r,3)*n},reverse:function(){return
cc.easeBezierAction(n,i,e,t)}}};var y={easing:function(t){return
Math.pow(t,2)},reverse:function(){return y}};cc.easeQuadraticActionIn=function()
{return y};var g={easing:function(t){return-t*(t-2)},reverse:function(){return
g}};cc.easeQuadraticActionOut=function(){return g};var x={easing:function(t)
{return(t*=2)<1?t*t*.5:-.5*(--t*(t-2)-1)},reverse:function(){return
x}};cc.easeQuadraticActionInOut=function(){return x};var b={easing:function(t)
{return t*t*t*t},reverse:function(){return b}};cc.easeQuarticActionIn=function()
{return b};var A={easing:function(t){return-((t-=1)*t*t*t-1)},reverse:function()
{return A}};cc.easeQuarticActionOut=function(){return A};var C={easing:function(t)
{return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},reverse:function(){return
C}};cc.easeQuarticActionInOut=function(){return C};var S={easing:function(t){return
t*t*t*t*t},reverse:function(){return S}};cc.easeQuinticActionIn=function(){return
S};var T={easing:function(t){return(t-=1)*t*t*t*t+1},reverse:function(){return
T}};cc.easeQuinticActionOut=function(){return T};var w={easing:function(t)
{return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},reverse:function(){return
w}};cc.easeQuinticActionInOut=function(){return w};var E={easing:function(t)
{return-1*(Math.sqrt(1-t*t)-1)},reverse:function(){return
E}};cc.easeCircleActionIn=function(){return E};var M={easing:function(t){return t-
=1,Math.sqrt(1-t*t)},reverse:function(){return
M}};cc.easeCircleActionOut=function(){return M};var D={easing:function(t)
{return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)
+1))},reverse:function(){return D}};cc.easeCircleActionInOut=function(){return
D};var B={easing:function(t){return t*t*t},reverse:function(){return
B}};cc.easeCubicActionIn=function(){return B};var P={easing:function(t){return(t-
=1)*t*t+1},reverse:function(){return P}};cc.easeCubicActionOut=function(){return
P};var I={easing:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-
=2)*t*t+2)},reverse:function(){return I}};cc.easeCubicActionInOut=function(){return
I}}),{}],4:[(function(t,e,i){"use
strict";cc.ActionInstant=cc.Class({name:"cc.ActionInstant",extends:cc.FiniteTimeAct
ion,isDone:function(){return!0},step:function(t){this.update(1)},update:function(t)
{},reverse:function(){return this.clone()},clone:function(){return new
cc.ActionInstant}}),cc.Show=cc.Class({name:"cc.Show",extends:cc.ActionInstant,updat
e:function(t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i)
{e[i].enabled=!0}},reverse:function(){return new cc.Hide},clone:function(){return
new cc.Show}}),cc.show=function(){return new
cc.Show},cc.Hide=cc.Class({name:"cc.Hide",extends:cc.ActionInstant,update:function(
t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i)
{e[i].enabled=!1}},reverse:function(){return new cc.Show},clone:function(){return
new cc.Hide}}),cc.hide=function(){return new
cc.Hide},cc.ToggleVisibility=cc.Class({name:"cc.ToggleVisibility",extends:cc.Action
Instant,update:function(t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i){var
n=e[i];n.enabled=!n.enabled}},reverse:function(){return new
cc.ToggleVisibility},clone:function(){return new
cc.ToggleVisibility}}),cc.toggleVisibility=function(){return new
cc.ToggleVisibility},cc.RemoveSelf=cc.Class({name:"cc.RemoveSelf",extends:cc.Action
Instant,ctor:function(t){this._isNeedCleanUp=!0,void 0!
==t&&this.init(t)},update:function(t)
{this.target.removeFromParent(this._isNeedCleanUp)},init:function(t){return
this._isNeedCleanUp=t,!0},reverse:function(){return new
cc.RemoveSelf(this._isNeedCleanUp)},clone:function(){return new
cc.RemoveSelf(this._isNeedCleanUp)}}),cc.removeSelf=function(t){return new
cc.RemoveSelf(t)},cc.FlipX=cc.Class({name:"cc.FlipX",extends:cc.ActionInstant,ctor:
function(t){this._flippedX=!1,void 0!
==t&&this.initWithFlipX(t)},initWithFlipX:function(t){return this._flippedX=t,!
0},update:function(t)
{this.target.scaleX=Math.abs(this.target.scaleX)*(this._flippedX?-
1:1)},reverse:function(){return new cc.FlipX(!this._flippedX)},clone:function(){var
t=new cc.FlipX;return t.initWithFlipX(this._flippedX),t}}),cc.flipX=function(t)
{return new
cc.FlipX(t)},cc.FlipY=cc.Class({name:"cc.FlipY",extends:cc.ActionInstant,ctor:funct
ion(t){this._flippedY=!1,void 0!
==t&&this.initWithFlipY(t)},initWithFlipY:function(t){return this._flippedY=t,!
0},update:function(t)
{this.target.scaleY=Math.abs(this.target.scaleY)*(this._flippedY?-
1:1)},reverse:function(){return new cc.FlipY(!this._flippedY)},clone:function(){var
t=new cc.FlipY;return t.initWithFlipY(this._flippedY),t}}),cc.flipY=function(t)
{return new
cc.FlipY(t)},cc.Place=cc.Class({name:"cc.Place",extends:cc.ActionInstant,ctor:funct
ion(t,e){this._x=0,this._y=0,void 0!==t&&(void 0!
==t.x&&(e=t.y,t=t.x),this.initWithPosition(t,e))},initWithPosition:function(t,e)
{return this._x=t,this._y=e,!0},update:function(t)
{this.target.setPosition(this._x,this._y)},clone:function(){var t=new
cc.Place;return t.initWithPosition(this._x,this._y),t}}),cc.place=function(t,e)
{return new
cc.Place(t,e)},cc.CallFunc=cc.Class({name:"cc.CallFunc",extends:cc.ActionInstant,ct
or:function(t,e,i)
{this._selectorTarget=null,this._function=null,this._data=null,this.initWithFunctio
n(t,e,i)},initWithFunction:function(t,e,i){return
t&&(this._function=t),e&&(this._selectorTarget=e),void 0!==i&&(this._data=i),!
0},execute:function()
{this._function&&this._function.call(this._selectorTarget,this.target,this._data)},
update:function(t){this.execute()},getTargetCallback:function(){return
this._selectorTarget},setTargetCallback:function(t){t!
==this._selectorTarget&&(this._selectorTarget&&(this._selectorTarget=null),this._se
lectorTarget=t)},clone:function(){var t=new cc.CallFunc;return
t.initWithFunction(this._function,this._selectorTarget,this._data),t}}),cc.callFunc
=function(t,e,i){return new cc.CallFunc(t,e,i)}}),{}],5:[(function(t,e,i){"use
strict";function n(t,e,i,n,r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-
r,2)*e+3*Math.pow(r,2)*(1-
r)*i+Math.pow(r,3)*n}cc.ActionInterval=cc.Class({name:"cc.ActionInterval",extends:c
c.FiniteTimeAction,ctor:function(t)
{this.MAX_VALUE=2,this._elapsed=0,this._firstTick=!
1,this._easeList=null,this._speed=1,this._timesForRepeat=1,this._repeatForever=!
1,this._repeatMethod=!1,this._speedMethod=!1,void 0!
==t&&cc.ActionInterval.prototype.initWithDuration.call(this,t)},getElapsed:function
(){return this._elapsed},initWithDuration:function(t){return this._duration=0===t?
cc.macro.FLT_EPSILON:t,this._elapsed=0,this._firstTick=!0,!0},isDone:function()
{return this._elapsed>=this._duration},_cloneDecoration:function(t)
{t._repeatForever=this._repeatForever,t._speed=this._speed,t._timesForRepeat=this._
timesForRepeat,t._easeList=this._easeList,t._speedMethod=this._speedMethod,t._repea
tMethod=this._repeatMethod},_reverseEaseList:function(t){if(this._easeList)
{t._easeList=[];for(var e=0;e<this._easeList.length;e+
+)t._easeList.push(this._easeList[e].reverse())}},clone:function(){var t=new
cc.ActionInterval(this._duration);return
this._cloneDecoration(t),t},easing:function(t){this._easeList?
this._easeList.length=0:this._easeList=[];for(var e=0;e<arguments.length;e+
+)this._easeList.push(arguments[e]);return this},_computeEaseTime:function(t){var
e=this._easeList;if(!e||0===e.length)return t;for(var i=0,n=e.length;i<n;i+
+)t=e[i].easing(t);return t},step:function(t){this._firstTick?(this._firstTick=!
1,this._elapsed=0):this._elapsed+=t;var
e=this._elapsed/(this._duration>1.192092896e-7?this._duration:1.192092896e-
7);e=1>e?e:1,this.update(e>0?
e:0),this._repeatMethod&&this._timesForRepeat>1&&this.isDone()&&(this._repeatForeve
r||
this._timesForRepeat--,this.startWithTarget(this.target),this.step(this._elapsed-
this._duration))},startWithTarget:function(t)
{cc.Action.prototype.startWithTarget.call(this,t),this._elapsed=0,this._firstTick=!
0},reverse:function(){return cc.logID(1010),null},setAmplitudeRate:function(t)
{cc.logID(1011)},getAmplitudeRate:function(){return
cc.logID(1012),0},speed:function(t){return t<=0?(cc.logID(1013),this):
(this._speedMethod=!0,this._speed*=t,this)},getSpeed:function(){return
this._speed},setSpeed:function(t){return this._speed=t,this},repeat:function(t)
{return t=Math.round(t),isNaN(t)||t<1?(cc.logID(1014),this):(this._repeatMethod=!
0,this._timesForRepeat*=t,this)},repeatForever:function(){return
this._repeatMethod=!0,this._timesForRepeat=this.MAX_VALUE,this._repeatForever=!
0,this}}),cc.actionInterval=function(t){return new
cc.ActionInterval(t)},cc.Sequence=cc.Class({name:"cc.Sequence",extends:cc.ActionInt
erval,ctor:function(t)
{this._actions=[],this._split=null,this._last=0,this._reversed=!1;var e=t
instanceof Array?t:arguments;if(1!==e.length){var i=e.length-
1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;s<i;s+
+)e[s]&&(n=r,r=cc.Sequence._actionOneTwo(n,e[s]));this.initWithTwoActions(r,e[i])}}
else cc.errorID(1019)},initWithTwoActions:function(t,e){if(!t||!e)return
cc.errorID(1025),!1;var i=t._duration,n=e._duration,r=(i*=t._repeatMethod?
t._timesForRepeat:1)+(n*=e._repeatMethod?e._timesForRepeat:1);return
this.initWithDuration(r),this._actions[0]=t,this._actions[1]=e,!0},clone:function()
{var t=new cc.Sequence;return
this._cloneDecoration(t),t.initWithTwoActions(this._actions[0].clone(),this._action
s[1].clone()),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._split=this._actions
[0]._duration/this._duration,this._split*=this._actions[0]._repeatMethod?
this._actions[0]._timesForRepeat:1,this._last=-1},stop:function(){-1!
==this._last&&this._actions[this._last].stop(),cc.Action.prototype.stop.call(this)}
,update:function(t){var e,i,n=0,r=this._split,s=this._actions,a=this._last;
(t=this._computeEaseTime(t))<r?(e=0!==r?
t/r:1,0===n&&1===a&&this._reversed&&(s[1].update(0),s[1].stop())):(n=1,e=1===r?1:
(t-r)/(1-r),-
1===a&&(s[0].startWithTarget(this.target),s[0].update(1),s[0].stop()),0===a&&(s[0].
update(1),s[0].stop())),i=s[n],a===n&&i.isDone()||(a!
==n&&i.startWithTarget(this.target),e*=i._timesForRepeat,i.update(e>1?e
%1:e),this._last=n)},reverse:function(){var
t=cc.Sequence._actionOneTwo(this._actions[1].reverse(),this._actions[0].reverse());
return this._cloneDecoration(t),this._reverseEaseList(t),t._reversed=!
0,t}}),cc.sequence=function(t){var e=t instanceof Array?
t:arguments;if(1===e.length)return cc.errorID(1019),null;var i=e.length-
1;i>=0&&null==e[i]&&cc.logID(1015);var n=null;if(i>=0){n=e[0];for(var r=1;r<=i;r+
+)e[r]&&(n=cc.Sequence._actionOneTwo(n,e[r]))}return
n},cc.Sequence._actionOneTwo=function(t,e){var i=new cc.Sequence;return
i.initWithTwoActions(t,e),i},cc.Repeat=cc.Class({name:"cc.Repeat",extends:cc.Action
Interval,ctor:function(t,e)
{this._times=0,this._total=0,this._nextDt=0,this._actionInstant=!
1,this._innerAction=null,void 0!
==e&&this.initWithAction(t,e)},initWithAction:function(t,e){var
i=t._duration*e;return!!
this.initWithDuration(i)&&(this._times=e,this._innerAction=t,t instanceof
cc.ActionInstant&&(this._actionInstant=!0,this._times-=1),this._total=0,!
0)},clone:function(){var t=new cc.Repeat;return
this._cloneDecoration(t),t.initWithAction(this._innerAction.clone(),this._times),t}
,startWithTarget:function(t)
{this._total=0,this._nextDt=this._innerAction._duration/this._duration,cc.ActionInt
erval.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},
stop:function()
{this._innerAction.stop(),cc.Action.prototype.stop.call(this)},update:function(t)
{t=this._computeEaseTime(t);var
e=this._innerAction,i=this._duration,n=this._times,r=this._nextDt;if(t>=r)
{for(;t>r&&this._total<n;)e.update(1),this._total+
+,e.stop(),e.startWithTarget(this.target),r+=e._duration/i,this._nextDt=r>1?
1:r;t>=1&&this._total<n&&(e.update(1),this._total++),this._actionInstant||
(this._total===n?e.stop():e.update(t-(r-e._duration/i)))}else e.update(t*n
%1)},isDone:function(){return this._total===this._times},reverse:function(){var
t=new cc.Repeat(this._innerAction.reverse(),this._times);return
this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.repeat=function(t,e){return new
cc.Repeat(t,e)},cc.RepeatForever=cc.Class({name:"cc.RepeatForever",extends:cc.Actio
nInterval,ctor:function(t)
{this._innerAction=null,t&&this.initWithAction(t)},initWithAction:function(t)
{return t?(this._innerAction=t,!0):(cc.errorID(1026),!1)},clone:function(){var
t=new cc.RepeatForever;return
this._cloneDecoration(t),t.initWithAction(this._innerAction.clone()),t},startWithTa
rget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._innerAction.startWi
thTarget(t)},step:function(t){var
e=this._innerAction;e.step(t),e.isDone()&&(e.startWithTarget(this.target),e.step(e.
getElapsed()-e._duration))},isDone:function(){return!1},reverse:function(){var
t=new cc.RepeatForever(this._innerAction.reverse());return
this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.repeatForever=function(t){return new
cc.RepeatForever(t)},cc.Spawn=cc.Class({name:"cc.Spawn",extends:cc.ActionInterval,c
tor:function(t){this._one=null,this._two=null;var e=t instanceof Array?
t:arguments;if(1!==e.length){var i=e.length-
1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;s<i;s+
+)e[s]&&(n=r,r=cc.Spawn._actionOneTwo(n,e[s]));this.initWithTwoActions(r,e[i])}}els
e cc.errorID(1020)},initWithTwoActions:function(t,e){if(!t||!e)return
cc.errorID(1027),!1;var i=!1,n=t._duration,r=e._duration;return
this.initWithDuration(Math.max(n,r))&&(this._one=t,this._two=e,n>r?
this._two=cc.Sequence._actionOneTwo(e,cc.delayTime(n-
r)):n<r&&(this._one=cc.Sequence._actionOneTwo(t,cc.delayTime(r-n))),i=!
0),i},clone:function(){var t=new cc.Spawn;return
this._cloneDecoration(t),t.initWithTwoActions(this._one.clone(),this._two.clone()),
t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._one.startWithTarget
(t),this._two.startWithTarget(t)},stop:function()
{this._one.stop(),this._two.stop(),cc.Action.prototype.stop.call(this)},update:func
tion(t)
{t=this._computeEaseTime(t),this._one&&this._one.update(t),this._two&&this._two.upd
ate(t)},reverse:function(){var
t=cc.Spawn._actionOneTwo(this._one.reverse(),this._two.reverse());return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.spawn=function(t){var e=t
instanceof Array?t:arguments;if(1===e.length)return
cc.errorID(1020),null;e.length>0&&null==e[e.length-1]&&cc.logID(1015);for(var
i=e[0],n=1;n<e.length;n++)null!=e[n]&&(i=cc.Spawn._actionOneTwo(i,e[n]));return
i},cc.Spawn._actionOneTwo=function(t,e){var i=new cc.Spawn;return
i.initWithTwoActions(t,e),i},cc.RotateTo=cc.Class({name:"cc.RotateTo",extends:cc.Ac
tionInterval,ctor:function(t,e)
{this._startAngle=0,this._dstAngle=0,this._angle=0,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._dstAngle=e,!
0)},clone:function(){var t=new cc.RotateTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._dstAngle),t},start
WithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngle=t.angle
%360;var e=this._dstAngle-this._startAngle;e>180&&(e-=360),e<-
180&&(e+=360),this._angle=e},reverse:function(){cc.logID(1016)},update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._
angle*t)}}),cc.rotateTo=function(t,e){return new
cc.RotateTo(t,e)},cc.RotateBy=cc.Class({name:"cc.RotateBy",extends:cc.ActionInterva
l,ctor:function(t,e){this._deltaAngle=cc.v3(),this._startAngle=0,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaAngle=e,!
0)},clone:function(){var t=new cc.RotateBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaAngle),t},sta
rtWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngle=t.angle}
,update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._
deltaAngle*t)},reverse:function(){var t=new cc.RotateBy(this._duration,-
this._deltaAngle);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.rotateBy=function(t,e)
{return new
cc.RotateBy(t,e)},cc.MoveBy=cc.Class({name:"cc.MoveBy",extends:cc.ActionInterval,ct
or:function(t,e,i)
{this._positionDelta=cc.v2(0,0),this._startPosition=cc.v2(0,0),this._previousPositi
on=cc.v2(0,0),void 0!
==e&&cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:functi
on(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void
0!==e.x&&(i=e.y,e=e.x),this._positionDelta.x=e,this._positionDelta.y=i,!
0)},clone:function(){var t=new cc.MoveBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._positionDelta),t},
startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var
e=this._positionDelta.x*t,i=this._positionDelta.y*t,n=this._startPosition;if(cc.mac
ro.ENABLE_STACKABLE_ACTIONS){var
r=this.target.x,s=this.target.y,a=this._previousPosition;n.x=n.x+r-a.x,n.y=n.y+s-
a.y,e+=n.x,i+=n.y,a.x=e,a.y=i,this.target.setPosition(e,i)}else
this.target.setPosition(n.x+e,n.y+i)}},reverse:function(){var t=new
cc.MoveBy(this._duration,cc.v2(-this._positionDelta.x,-
this._positionDelta.y));return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.moveBy=function(t,e,i)
{return new
cc.MoveBy(t,e,i)},cc.MoveTo=cc.Class({name:"cc.MoveTo",extends:cc.MoveBy,ctor:funct
ion(t,e,i){this._endPosition=cc.v2(0,0),void
0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!
cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)&&(void 0!
==e.x&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!
0)},clone:function(){var t=new cc.MoveTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition),t},st
artWithTarget:function(t)
{cc.MoveBy.prototype.startWithTarget.call(this,t),this._positionDelta.x=this._endPo
sition.x-t.x,this._positionDelta.y=this._endPosition.y-
t.y}}),cc.moveTo=function(t,e,i){return new
cc.MoveTo(t,e,i)},cc.SkewTo=cc.Class({name:"cc.SkewTo",extends:cc.ActionInterval,ct
or:function(t,e,i)
{this._skewX=0,this._skewY=0,this._startSkewX=0,this._startSkewY=0,this._endSkewX=0
,this._endSkewY=0,this._deltaX=0,this._deltaY=0,void 0!
==i&&cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:functi
on(t,e,i){var n=!1;return
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endSkewX=e,this._
endSkewY=i,n=!0),n},clone:function(){var t=new cc.SkewTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endSkewX,this._end
SkewY),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startSkewX=t.skewX
%180,this._deltaX=this._endSkewX-this._startSkewX,this._deltaX>180&&(this._deltaX-
=360),this._deltaX<-180&&(this._deltaX+=360),this._startSkewY=t.skewY
%360,this._deltaY=this._endSkewY-this._startSkewY,this._deltaY>180&&(this._deltaY-
=360),this._deltaY<-180&&(this._deltaY+=360)},update:function(t)
{t=this._computeEaseTime(t),this.target.skewX=this._startSkewX+this._deltaX*t,this.
target.skewY=this._startSkewY+this._deltaY*t}}),cc.skewTo=function(t,e,i){return
new
cc.SkewTo(t,e,i)},cc.SkewBy=cc.Class({name:"cc.SkewBy",extends:cc.SkewTo,ctor:funct
ion(t,e,i){void 0!
==i&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){var n=!1;return
cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)&&(this._skewX=e,this._skewY=i
,n=!0),n},clone:function(){var t=new cc.SkewBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._skewX,this._skewY)
,t},startWithTarget:function(t)
{cc.SkewTo.prototype.startWithTarget.call(this,t),this._deltaX=this._skewX,this._de
ltaY=this._skewY,this._endSkewX=this._startSkewX+this._deltaX,this._endSkewY=this._
startSkewY+this._deltaY},reverse:function(){var t=new cc.SkewBy(this._duration,-
this._skewX,-this._skewY);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.skewBy=function(t,e,i)
{return new
cc.SkewBy(t,e,i)},cc.JumpBy=cc.Class({name:"cc.JumpBy",extends:cc.ActionInterval,ct
or:function(t,e,i,n,r)
{this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),this._delta=cc.v2
(0,0),this._height=0,this._jumps=0,void 0!
==n&&cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)},initWithDuration:fu
nction(t,e,i,n,r){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void
0===r&&(r=n,n=i,i=e.y,e=e.x),this._delta.x=e,this._delta.y=i,this._height=n,this._j
umps=r,!0)},clone:function(){var t=new cc.JumpBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._delta,this._height
,this._jumps),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var e=t*this._jumps
%1,i=4*this._height*e*(1-e);i+=this._delta.y*t;var
n=this._delta.x*t,r=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var
s=this.target.x,a=this.target.y,o=this._previousPosition;r.x=r.x+s-o.x,r.y=r.y+a-
o.y,n+=r.x,i+=r.y,o.x=n,o.y=i,this.target.setPosition(n,i)}else
this.target.setPosition(r.x+n,r.y+i)}},reverse:function(){var t=new
cc.JumpBy(this._duration,cc.v2(-this._delta.x,-
this._delta.y),this._height,this._jumps);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.jumpBy=function(t,e,i,n,r
){return new
cc.JumpBy(t,e,i,n,r)},cc.JumpTo=cc.Class({name:"cc.JumpTo",extends:cc.JumpBy,ctor:f
unction(t,e,i,n,r){this._endPosition=cc.v2(0,0),void 0!
==n&&this.initWithDuration(t,e,i,n,r)},initWithDuration:function(t,e,i,n,r)
{return!!cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)&&(void
0===r&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!
0)},startWithTarget:function(t)
{cc.JumpBy.prototype.startWithTarget.call(this,t),this._delta.x=this._endPosition.x
-this._startPosition.x,this._delta.y=this._endPosition.y-
this._startPosition.y},clone:function(){var t=new cc.JumpTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition,this._
height,this._jumps),t}}),cc.jumpTo=function(t,e,i,n,r){return new
cc.JumpTo(t,e,i,n,r)},cc.BezierBy=cc.Class({name:"cc.BezierBy",extends:cc.ActionInt
erval,ctor:function(t,e)
{this._config=[],this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),e
&&cc.BezierBy.prototype.initWithDuration.call(this,t,e)},initWithDuration:function(
t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._config=e,!
0)},clone:function(){var t=new cc.BezierBy;this._cloneDecoration(t);for(var
e=[],i=0;i<this._config.length;i++){var
n=this._config[i];e.push(cc.v2(n.x,n.y))}return
t.initWithDuration(this._duration,e),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var
e=this._config,i=e[0].x,r=e[1].x,s=e[2].x,a=e[0].y,o=e[1].y,l=e[2].y,h=n(0,i,r,s,t)
,c=n(0,a,o,l,t),u=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var
_=this.target.x,f=this.target.y,d=this._previousPosition;u.x=u.x+_-d.x,u.y=u.y+f-
d.y,h+=u.x,c+=u.y,d.x=h,d.y=c,this.target.setPosition(h,c)}else
this.target.setPosition(u.x+h,u.y+c)}},reverse:function(){var
t=this._config,e=t[0].x,i=t[0].y,n=t[1].x,r=t[1].y,s=t[2].x,a=t[2].y,o=[cc.v2(n-
s,r-a),cc.v2(e-s,i-a),cc.v2(-s,-a)],l=new cc.BezierBy(this._duration,o);return
this._cloneDecoration(l),this._reverseEaseList(l),l}}),cc.bezierBy=function(t,e)
{return new
cc.BezierBy(t,e)},cc.BezierTo=cc.Class({name:"cc.BezierTo",extends:cc.BezierBy,ctor
:function(t,e)
{this._toConfig=[],e&&this.initWithDuration(t,e)},initWithDuration:function(t,e)
{return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toConfig=e,!
0)},clone:function(){var t=new cc.BezierTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toConfig),t},start
WithTarget:function(t){cc.BezierBy.prototype.startWithTarget.call(this,t);var
e=this._startPosition,i=this._toConfig,n=this._config;n[0]=i[0].sub(e),n[1]=i[1].su
b(e),n[2]=i[2].sub(e)}}),cc.bezierTo=function(t,e){return new
cc.BezierTo(t,e)},cc.ScaleTo=cc.Class({name:"cc.ScaleTo",extends:cc.ActionInterval,
ctor:function(t,e,i)
{this._scaleX=1,this._scaleY=1,this._startScaleX=1,this._startScaleY=1,this._endSca
leX=0,this._endScaleY=0,this._deltaX=0,this._deltaY=0,void 0!
==e&&cc.ScaleTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:funct
ion(t,e,i){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endScaleX=e,this.
_endScaleY=null!=i?i:e,!0)},clone:function(){var t=new cc.ScaleTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._en
dScaleY),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startScaleX=t.scale
X,this._startScaleY=t.scaleY,this._deltaX=this._endScaleX-
this._startScaleX,this._deltaY=this._endScaleY-
this._startScaleY},update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.scaleX=this._startScaleX+this
._deltaX*t,this.target.scaleY=this._startScaleY+this._deltaY*t)}}),cc.scaleTo=funct
ion(t,e,i){return new
cc.ScaleTo(t,e,i)},cc.ScaleBy=cc.Class({name:"cc.ScaleBy",extends:cc.ScaleTo,startW
ithTarget:function(t)
{cc.ScaleTo.prototype.startWithTarget.call(this,t),this._deltaX=this._startScaleX*t
his._endScaleX-this._startScaleX,this._deltaY=this._startScaleY*this._endScaleY-
this._startScaleY},reverse:function(){var t=new
cc.ScaleBy(this._duration,1/this._endScaleX,1/this._endScaleY);return
this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new
cc.ScaleBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._en
dScaleY),t}}),cc.scaleBy=function(t,e,i){return new
cc.ScaleBy(t,e,i)},cc.Blink=cc.Class({name:"cc.Blink",extends:cc.ActionInterval,cto
r:function(t,e){this._times=0,this._originalState=!1,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._times=e,!
0)},clone:function(){var t=new cc.Blink;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._times),t},update:f
unction(t){if(t=this._computeEaseTime(t),this.target&&!this.isDone()){var
e=1/this._times,i=t%e;this.target.opacity=i>e/2?255:0}},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._originalState=t.opa
city},stop:function()
{this.target.opacity=this._originalState,cc.ActionInterval.prototype.stop.call(this
)},reverse:function(){var t=new cc.Blink(this._duration,this._times);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.blink=function(t,e)
{return new
cc.Blink(t,e)},cc.FadeTo=cc.Class({name:"cc.FadeTo",extends:cc.ActionInterval,ctor:
function(t,e){this._toOpacity=0,this._fromOpacity=0,void 0!
==e&&cc.FadeTo.prototype.initWithDuration.call(this,t,e)},initWithDuration:function
(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toOpacity=e,!
0)},clone:function(){var t=new cc.FadeTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},upda
te:function(t){t=this._computeEaseTime(t);var e=void 0!==this._fromOpacity?
this._fromOpacity:255;this.target.opacity=e+(this._toOpacity-
e)*t},startWithTarget:function
(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._fromOpacity=t.opaci
ty}}),cc.fadeTo=function(t,e){return new
cc.FadeTo(t,e)},cc.FadeIn=cc.Class({name:"cc.FadeIn",extends:cc.FadeTo,ctor:functio
n(t)
{null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,255)},reverse:func
tion(){var t=new cc.FadeOut;return
t.initWithDuration(this._duration,0),this._cloneDecoration(t),this._reverseEaseList
(t),t},clone:function(){var t=new cc.FadeIn;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},star
tWithTarget:function(t)
{this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity),cc.FadeTo.
prototype.startWithTarget.call(this,t)}}),cc.fadeIn=function(t){return new
cc.FadeIn(t)},cc.FadeOut=cc.Class({name:"cc.FadeOut",extends:cc.FadeTo,ctor:functio
n(t)
{null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,0)},reverse:functi
on(){var t=new cc.FadeIn;return
t._reverseAction=this,t.initWithDuration(this._duration,255),this._cloneDecoration(
t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeOut;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t}}),cc
.fadeOut=function(t){return new
cc.FadeOut(t)},cc.TintTo=cc.Class({name:"cc.TintTo",extends:cc.ActionInterval,ctor:
function(t,e,i,n){this._to=cc.color(0,0,0),this._from=cc.color(0,0,0),e instanceof
cc.Color&&(n=e.b,i=e.g,e=e.r),void 0!
==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._to=cc.color(e,i,n
),!0)},clone:function(){var t=new cc.TintTo;this._cloneDecoration(t);var
e=this._to;return
t.initWithDuration(this._duration,e.r,e.g,e.b),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._from=this.target.co
lor},update:function(t){t=this._computeEaseTime(t);var
e=this._from,i=this._to;e&&(this.target.color=cc.color(e.r+(i.r-e.r)*t,e.g+(i.g-
e.g)*t,e.b+(i.b-e.b)*t))}}),cc.tintTo=function(t,e,i,n){return new
cc.TintTo(t,e,i,n)},cc.TintBy=cc.Class({name:"cc.TintBy",extends:cc.ActionInterval,
ctor:function(t,e,i,n)
{this._deltaR=0,this._deltaG=0,this._deltaB=0,this._fromR=0,this._fromG=0,this._fro
mB=0,void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n)
{return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaR=e,this._de
ltaG=i,this._deltaB=n,!0)},clone:function(){var t=new cc.TintBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaR,this._delta
G,this._deltaB),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.color;this._fromR=e.r,this._fromG=e.g,this._fromB=e.b},update:function(t)
{t=this._computeEaseTime(t),this.target.color=cc.color(this._fromR+this._deltaR*t,t
his._fromG+this._deltaG*t,this._fromB+this._deltaB*t)},reverse:function(){var t=new
cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.tintBy=function(t,e,i,n)
{return new
cc.TintBy(t,e,i,n)},cc.DelayTime=cc.Class({name:"cc.DelayTime",extends:cc.ActionInt
erval,update:function(t){},reverse:function(){var t=new
cc.DelayTime(this._duration);return
this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new
cc.DelayTime;return
this._cloneDecoration(t),t.initWithDuration(this._duration),t}}),cc.delayTime=funct
ion(t){return new
cc.DelayTime(t)},cc.ReverseTime=cc.Class({name:"cc.ReverseTime",extends:cc.ActionIn
terval,ctor:function(t)
{this._other=null,t&&this.initWithAction(t)},initWithAction:function(t){return t?
t===this._other?(cc.errorID(1029),!1):!!
cc.ActionInterval.prototype.initWithDuration.call(this,t._duration)&&(this._other=t
,!0):(cc.errorID(1028),!1)},clone:function(){var t=new cc.ReverseTime;return
this._cloneDecoration(t),t.initWithAction(this._other.clone()),t},startWithTarget:f
unction(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._other.startWithTarg
et(t)},update:function(t)
{t=this._computeEaseTime(t),this._other&&this._other.update(1-
t)},reverse:function(){return this._other.clone()},stop:function()
{this._other.stop(),cc.Action.prototype.stop.call(this)}}),cc.reverseTime=function(
t){return new
cc.ReverseTime(t)},cc.TargetedAction=cc.Class({name:"cc.TargetedAction",extends:cc.
ActionInterval,ctor:function(t,e)
{this._action=null,this._forcedTarget=null,e&&this.initWithTarget(t,e)},initWithTar
get:function(t,e){return!!
this.initWithDuration(e._duration)&&(this._forcedTarget=t,this._action=e,!
0)},clone:function(){var t=new cc.TargetedAction;return
this._cloneDecoration(t),t.initWithTarget(this._forcedTarget,this._action.clone()),
t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._action.startWithTar
get(this._forcedTarget)},stop:function(){this._action.stop()},update:function(t)
{t=this._computeEaseTime(t),this._action.update(t)},getForcedTarget:function()
{return this._forcedTarget},setForcedTarget:function(t){this._forcedTarget!
==t&&(this._forcedTarget=t)}}),cc.targetedAction=function(t,e){return new
cc.TargetedAction(t,e)}}),{}],6:[(function(t,e,i){"use
strict";t("../core/platform/CCClass");var n=t("../core/platform/js"),r=function()
{this.actions=[],this.target=null,this.actionIndex=0,this.currentAction=null,this.p
aused=!1,this.lock=!1};cc.ActionManager=function(){this._hashTargets=n.createMap(!
0),this._arrayTargets=[],this._currentTarget=null,cc.director._scheduler&&cc.direct
or._scheduler.enableForTarget(this)},cc.ActionManager.prototype={constructor:cc.Act
ionManager,_elementPool:[],_searchElementByTarget:function(t,e){for(var
i=0;i<t.length;i++)if(e===t[i].target)return t[i];return
null},_getElement:function(t,e){var i=this._elementPool.pop();return i||(i=new
r),i.target=t,i.paused=!!e,i},_putElement:function(t)
{t.actions.length=0,t.actionIndex=0,t.currentAction=null,t.paused=!
1,t.target=null,t.lock=!1,this._elementPool.push(t)},addAction:function(t,e,i)
{if(t&&e){var n=this._hashTargets[e._id];n?n.actions||(n.actions=[]):
(n=this._getElement(e,i),this._hashTargets[e._id]=n,this._arrayTargets.push(n)),n.a
ctions.push(t),t.startWithTarget(e)}else
cc.errorID(1e3)},removeAllActions:function(){for(var
t=this._arrayTargets,e=0;e<t.length;e++){var
i=t[e];i&&this._putElement(i)}this._arrayTargets.length=0,this._hashTargets=n.creat
eMap(!0)},removeAllActionsFromTarget:function(t,e){if(null!=t){var
i=this._hashTargets[t._id];i&&(i.actions.length=0,this._deleteHashElement(i))}},rem
oveAction:function(t){if(null!=t){var
e=t.getOriginalTarget(),i=this._hashTargets[e._id];if(i){for(var
n=0;n<i.actions.length;n++)if(i.actions[n]===t)
{i.actions.splice(n,1),i.actionIndex>=n&&i.actionIndex--;break}}else
cc.logID(1001)}},removeActionByTag:function(t,e)
{t===cc.Action.TAG_INVALID&&cc.logID(1002),cc.assertID(e,1003);var
i=this._hashTargets[e._id];if(i)for(var n=i.actions.length,r=0;r<n;++r){var
s=i.actions[r];if(s&&s.getTag()===t&&s.getOriginalTarget()===e)
{this._removeActionAtIndex(r,i);break}}},getActionByTag:function(t,e)
{t===cc.Action.TAG_INVALID&&cc.logID(1004);var i=this._hashTargets[e._id];if(i)
{if(null!=i.actions)for(var n=0;n<i.actions.length;++n){var
r=i.actions[n];if(r&&r.getTag()===t)return r}cc.logID(1005,t)}return
null},getNumberOfRunningActionsInTarget:function(t){var
e=this._hashTargets[t._id];return e&&e.actions?
e.actions.length:0},pauseTarget:function(t){var
e=this._hashTargets[t._id];e&&(e.paused=!0)},resumeTarget:function(t){var
e=this._hashTargets[t._id];e&&(e.paused=!1)},pauseAllRunningActions:function()
{for(var t=[],e=this._arrayTargets,i=0;i<e.length;i++){var n=e[i];n&&!
n.paused&&(n.paused=!0,t.push(n.target))}return t},resumeTargets:function(t)
{if(t)for(var e=0;e<t.length;e+
+)t[e]&&this.resumeTarget(t[e])},pauseTargets:function(t){if(t)for(var
e=0;e<t.length;e++)t[e]&&this.pauseTarget(t[e])},purgeSharedManager:function()
{cc.director.getScheduler().unscheduleUpdate(this)},_removeActionAtIndex:function(t
,e)
{e.actions[t];e.actions.splice(t,1),e.actionIndex>=t&&e.actionIndex--,0===e.actions
.length&&this._deleteHashElement(e)},_deleteHashElement:function(t){var e=!
1;if(t&&!t.lock&&this._hashTargets[t.target._id]){delete
this._hashTargets[t.target._id];for(var i=this._arrayTargets,n=0,r=i.length;n<r;n+
+)if(i[n]===t){i.splice(n,1);break}this._putElement(t),e=!0}return
e},update:function(t){for(var e,i=this._arrayTargets,n=0;n<i.length;n++)
{if(this._currentTarget=i[n],!(e=this._currentTarget).paused&&e.actions)
{for(e.lock=!0,e.actionIndex=0;e.actionIndex<e.actions.length;e.actionIndex+
+)if(e.currentAction=e.actions[e.actionIndex],e.currentAction)
{if(e.currentAction.step(t*(e.currentAction._speedMethod?
e.currentAction._speed:1)),e.currentAction&&e.currentAction.isDone())
{e.currentAction.stop();var
r=e.currentAction;e.currentAction=null,this.removeAction(r)}e.currentAction=null}e.
lock=!1}0===e.actions.length&&this._deleteHashElement(e)&&n--}}}}),
{"../core/platform/CCClass":200,"../core/platform/js":220}],7:[(function(t,e,i)
{"use
strict";t("./CCActionManager"),t("./CCAction"),t("./CCActionInterval"),t("./CCActio
nInstant"),t("./CCActionEase"),t("./CCActionCatmullRom"),t("./tween")}),
{"./CCAction":1,"./CCActionCatmullRom":2,"./CCActionEase":3,"./CCActionInstant":4,"
./CCActionInterval":5,"./CCActionManager":6,"./tween":8}],8:[(function(t,e,i){"use
strict";var
n=cc.Class({name:"cc.TweenAction",extends:cc.ActionInterval,ctor:function(t,e,i)
{this._opts=i=i||
Object.create(null),this._props=Object.create(null),i.progress=i.progress||
this.progress,i.easing&&"string"==typeof
i.easing&&(i.easing=cc.easing[i.easing]);var n=this._opts.relative;for(var r in e)
{var s=e[r],a=void 0,o=void 0;if(s.value&&(s.easing||
s.progress)&&(a="string"==typeof s.easing?
cc.easing[s.easing]:s.easing,o=s.progress,s=s.value),"number"==typeof s||s.lerp&&(!
n||s.add||s.mul)&&s.clone){var
l=Object.create(null);l.value=s,l.easing=a,l.progress=o,this._props[r]=l}else
cc.warn("Can not animate "+r+" property, because it do not have [lerp, (add|mul),
clone] function.")}this._originProps=e,this.initWithDuration(t)},clone:function()
{var t=new n(this._duration,this._originProps,this._opts);return
this._cloneDecoration(t),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=!!
this._opts.relative,i=this._props;for(var n in i){var
r=t[n],s=i[n];"number"==typeof r?(s.start=r,s.current=r,s.end=e?r+s.value:s.value):
(s.start=r.clone(),s.current=r.clone(),s.end=e?(r.add||
r.mul).call(r,s.value):s.value)}},update:function(t){var
e=this._opts,i=t;e.easing&&(i=e.easing(t));var n=this.target;if(n){var
r=this._props,s=this._opts.progress;for(var a in r){var o=r[a],l=o.easing?
o.easing(t):i,h=o.current=(o.progress||s)
(o.start,o.end,o.current,l);n[a]=h}}},progress:function(t,e,i,n)
{return"number"==typeof t?i=t+(e-
t)*n:t.lerp(e,n,i),i}}),r=cc.Class({name:"cc.SetAction",extends:cc.ActionInstant,ct
or:function(t){this._props={},void 0!==t&&this.init(t)},init:function(t){for(var e
in t)this._props[e]=t[e];return!0},update:function(){var
t=this._props,e=this.target;for(var i in t)e[i]=t[i]},clone:function(){var t=new
r;return t.init(this._props),t}});function s(t)
{this._actions=[],this._finalAction=null,this._target=t}s.prototype.then=function(t
){return t instanceof cc.Action?
this._actions.push(t.clone()):this._actions.push(t._union()),this},s.prototype.targ
et=function(t){return this._target=t,this},s.prototype.start=function(){return
this._target?
(this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),
this._finalAction=this._union(),cc.director.getActionManager().addAction(this._fina
lAction,this._target,!1),this):(cc.warn("Please set target to tween
first"),this)},s.prototype.stop=function(){return
this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),t
his},s.prototype.clone=function(t){var e=this._union();return
cc.tween(t).then(e.clone())},s.prototype.union=function(){var
t=this._union();return
this._actions.length=0,this._actions.push(t),this},s.prototype._union=function()
{var t=this._actions;return t=1===t.length?t[0]:cc.sequence(t)};var a=[];function
o(t){return function(){a.length=0;for(var e=arguments.length,i=0;i<e;i++){var
n=a[i]=arguments[i];n instanceof s&&(a[i]=n._union())}return
t.apply(this,a)}}for(var l={to:function(t,e,i){return(i=i||
Object.create(null)).relative=!1,new n(t,e,i)},by:function(t,e,i){return(i=i||
Object.create(null)).relative=!0,new n(t,e,i)},set:function(t){return new
r(t)},delay:cc.delayTime,call:cc.callFunc,hide:cc.hide,show:cc.show,removeSelf:cc.r
emoveSelf,sequence:o(cc.sequence),parallel:o(cc.spawn)},h={repeat:cc.repeat,repeatF
orever:cc.repeatForever,reverseTime:cc.reverseTime},c=Object.keys(l),u=function(t)
{var e=c[t];s.prototype[e]=function(){var t=l[e].apply(l,arguments);return
this._actions.push(t),this}},_=0;_<c.length;_++)u(_);c=Object.keys(h);var
f=function(t){var e=c[t];s.prototype[e]=function(){var
t=this._actions,i=arguments[arguments.length-1],n=arguments.length-1;i instanceof
cc.Tween?i=i._union():i instanceof cc.Action||(i=t[t.length-1],t.length-
=1,n+=1);for(var r=[i],s=0;s<n;s++)r.push(arguments[s]);return
i=h[e].apply(this,r),t.push(i),this}};for(_=0;_<c.length;_+
+)f(_);cc.tween=function(t){return new s(t)},cc.Tween=s}),{}],9:[(function(t,e,i)
{"use strict";var n=cc.js,r=t("./playable"),s=t("./animation-
curves"),a=s.EventAnimCurve,o=s.EventInfo,l=t("./types").WrapModeMask,h=t("../core/
utils/binary-search").binarySearchEpsilon;function c(t,e)
{r.call(this),this.target=t,this.animation=e,this._anims=new
n.array.MutableForwardIterator([])}n.extend(c,r);var u=c.prototype;function _(t,e)
{var
i=e.clip;e.duration=i.duration,e.speed=i.speed,e.wrapMode=i.wrapMode,e.frameRate=i.
sample,(e.wrapMode&l.Loop)===l.Loop?e.repeatCount=1/0:e.repeatCount=1;var
n=e.curves=i.createCurves(e,t),r=i.events;if(r)for(var s=void
0,c=0,u=r.length;c<u;c++){s||((s=new a).target=t,n.push(s));var
_=r[c],f=_.frame/e.duration,d=void 0,m=h(s.ratios,f);m>=0?d=s.events[m]:(d=new
o,s.ratios.push(f),s.events.push(d)),d.add(_.func,_.params)}}u.playState=function(t
,e){t.clip&&(t.curveLoaded||
_(this.target,t),t.animator=this,t.play(),"number"==typeof
e&&t.setTime(e),this.play())},u.stopStatesExcept=function(t){var
e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n!
==t&&this.stopState(n)}},u.addAnimation=function(t){-
1===this._anims.array.indexOf(t)&&this._anims.push(t),t._setEventTarget(this.animat
ion)},u.removeAnimation=function(t){var e=this._anims.array.indexOf(t);e>=0?
(this._anims.fastRemoveAt(e),0===this._anims.array.length&&this.stop()):cc.errorID(
3908),t.animator=null},u.sample=function(){var
t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)
{e[t.i].sample()}},u.stopState=function(t){t&&t.stop()},u.pauseState=function(t)
{t&&t.pause()},u.resumeState=function(t)
{t&&t.resume(),this.isPaused&&this.resume()},u.setStateTime=function(t,e){if(void
0!==e)t&&(t.setTime(e),t.sample());else{e=t;for(var
i=this._anims.array,n=0;n<i.length;++n){var
r=i[n];r.setTime(e),r.sample()}}},u.onStop=function(){var
t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)
{e[t.i].stop()}},u.onPause=function(){for(var t=this._anims.array,e=0;e<t.length;+
+e){var i=t[e];i.pause(),i.animator=null}},u.onResume=function(){for(var
t=this._anims.array,e=0;e<t.length;++e){var
i=t[e];i.animator=this,i.resume()}},u._reloadClip=function(t)
{_(this.target,t)},e.exports=c}),{"../core/utils/binary-search":287,"./animation-
curves":11,"./playable":18,"./types":19}],10:[(function(t,e,i){"use strict";var
n=t("./types").WrapMode,r=t("./animation-
curves"),s=r.DynamicAnimCurve,a=r.quickFindIndex,o=t("./motion-path-
helper").sampleMotionPaths,l=t("../core/utils/binary-
search").binarySearchEpsilon,h=cc.Class({name:"cc.AnimationClip",extends:cc.Asset,p
roperties:{_duration:{default:0,type:"Float"},duration:{get:function(){return
this._duration}},sample:{default:60},speed:{default:1},wrapMode:
{default:n.Normal},curveData:{default:{},visible:!1},events:{default:[],visible:!
1}},statics:{createWithSpriteFrames:function(t,e){if(!Array.isArray(t))return
cc.errorID(3905),null;var i=new h;i.sample=e||
i.sample,i._duration=t.length/i.sample;for(var
n=[],r=1/i.sample,s=0,a=t.length;s<a;s++)n[s]={frame:s*r,value:t[s]};return
i.curveData={comps:{"cc.Sprite":{spriteFrame:n}}},i}},onLoad:function()
{this._duration=Number.parseFloat(this.duration),this.speed=Number.parseFloat(this.
speed),this.wrapMode=Number.parseInt(this.wrapMode),this.frameRate=Number.parseFloa
t(this.sample)},createPropCurve:function(t,e,i){var n=[],r=t instanceof
cc.Node&&"position"===e,h=new s;h.target=t,h.prop=e;for(var c=0,u=i.length;c<u;c++)
{var _=i[c],f=_.frame/this.duration;h.ratios.push(f),r&&n.push(_.motionPath);var
d=_.value;h.values.push(d);var m=_.curve;if(m){if("string"==typeof m)
{h.types.push(m);continue}if(Array.isArray(m)){m[0]===m[1]&&m[2]===m[3]?
h.types.push(s.Linear):h.types.push(s.Bezier(m));continue}}h.types.push(s.Linear)}r
&&o(n,h,this.duration,this.sample,t);for(var p=h.ratios,v=void 0,y=void 0,g=!
0,x=1,b=p.length;x<b;x++)if(v=p[x]-p[x-1],1===x)y=v;else if(Math.abs(v-y)>1e-6){g=!
1;break}h._findFrameIndex=g?a:l;var A=h.values[0];return h._lerp||void 0===A||
("number"==typeof A?h._lerp=s.prototype._lerpNumber:A instanceof cc.Quat?
h._lerp=s.prototype._lerpQuat:A instanceof cc.Vec2||A instanceof cc.Vec3?
h._lerp=s.prototype._lerpVector:A.lerp&&(h._lerp=s.prototype._lerpObject)),h},creat
eTargetCurves:function(t,e,i){var n=e.props,r=e.comps;if(n)for(var s in n){var
a=n[s],o=this.createPropCurve(t,s,a);i.push(o)}if(r)for(var l in r){var
h=t.getComponent(l);if(h){var c=r[l];for(var u in c){var
_=c[u],f=this.createPropCurve(h,u,_);i.push(f)}}}},createCurves:function(t,e){var
i=this.curveData,n=i.paths,r=[];for(var s in this.createTargetCurves(e,i,r),n){var
a=cc.find(s,e);if(a){var o=n[s];this.createTargetCurves(a,o,r)}}return
r}});cc.AnimationClip=e.exports=h}),{"../core/utils/binary-
search":287,"./animation-curves":11,"./motion-path-helper":17,"./types":19}],11:
[(function(t,e,i){"use strict";var
n=t("./bezier").bezierByTime,r=t("../core/utils/binary-
search").binarySearchEpsilon,s=t("./types").WrapModeMask,a=t("./types").WrappedInfo
;function o(t,e){if("string"==typeof e){var i=cc.easing[e];i?
t=i(t):cc.errorID(3906,e)}else Array.isArray(e)&&(t=n(e,t));return t}var
l=cc.Class({name:"cc.AnimCurve",sample:function(t,e,i){},onTimeChangedManually:void
0});function h(t,e){var i=t.length-1;if(0===i)return 0;var n=t[0];if(e<n)return
0;var r=t[i];if(e>r)return i;var s=(e=(e-n)/(r-n))/(1/i),a=0|s;return s-a<1e-6?
a:a+1-s<1e-6?a+1:~(a+1)}var
c=cc.Class({name:"cc.DynamicAnimCurve",extends:l,properties:
{target:null,prop:"",values:[],ratios:[],types:[]},_findFrameIndex:r,_lerp:void
0,_lerpNumber:function(t,e,i){return t+(e-t)*i},_lerpObject:function(t,e,i){return
t.lerp(e,i)},_lerpQuat:(function(){var t=cc.quat();return function(e,i,n){return
e.lerp(i,n,t)}})(),_lerpVector:(function(){var t=cc.v3();return function(e,i,n)
{return e.lerp(i,n,t)}})(),sample:function(t,e,i){var
n=this.values,r=this.ratios,s=r.length;if(0!==s){var
a,l=this._findFrameIndex(r,e);if(l<0)if((l=~l)<=0)a=n[0];else if(l>=s)a=n[s-
1];else{var h=n[l-1];if(this._lerp){var
c=r[l-1],u=r[l],_=this.types[l-1],f=(e-c)/(u-c);_&&(f=o(f,_));var
d=n[l];a=this._lerp(h,d,f)}else a=h}else
a=n[l];this.target[this.prop]=a}}});c.Linear=null,c.Bezier=function(t){return
t};var u=function(){this.events=[]};u.prototype.add=function(t,e)
{this.events.push({func:t||"",params:e||[]})};var
_=cc.Class({name:"cc.EventAnimCurve",extends:l,properties:{target:null,ratios:
[],events:[],_wrappedInfo:{default:function(){return new
a}},_lastWrappedInfo:null,_ignoreIndex:NaN},_wrapIterations:function(t){return t-
(0|t)==0&&(t-=1),0|t},sample:function(t,e,i){var
n=this.ratios.length,o=i.getWrappedInfo(i.time,this._wrappedInfo),l=o.direction,h=r
(this.ratios,o.ratio);if(h<0&&(h=~h-1,l<0&&(h+=1)),this._ignoreIndex!
==h&&(this._ignoreIndex=NaN),o.frameIn
dex=h,!this._lastWrappedInfo)return
this._fireEvent(h),void(this._lastWrappedInfo=new a(o));var
c=i.wrapMode,u=this._wrapIterations(o.iterations),_=this._lastWrappedInfo,f=this._w
rapIterations(_.iterations),d=_.frameIndex,m=_.direction,p=-1!==f&&u!
==f;if(d===h&&p&&1===n)this._fireEvent(0);else if(d!==h||p){l=m;do{if(d!==h){if(-
1===l&&0===d&&h>0?((c&s.PingPong)===s.PingPong?l*=-1:d=n,f++):1===l&&d===n-1&&h<n-
1&&((c&s.PingPong)===s.PingPong?l*=-1:d=-1,f+
+),d===h)break;if(f>u)break}d+=l,cc.director.getAnimationManager().pushDelayEvent(t
his,"_fireEvent",[d])}while(d!==h&&d>-
1&&d<n)}this._lastWrappedInfo.set(o)},_fireEvent:function(t){if(!(t<0||
t>=this.events.length||this._ignoreIndex===t)){var
e=this.events[t].events;if(this.target.isValid)for(var
i=this.target._components,n=0;n<e.length;n++)for(var
r=e[n],s=r.func,a=0;a<i.length;a++){var
o=i[a],l=o[s];l&&l.apply(o,r.params)}}},onTimeChangedManually:function(t,e)
{this._lastWrappedInfo=null,this._ignoreIndex=NaN;var
i=e.getWrappedInfo(t,this._wrappedInfo),n=i.direction,s=r(this.ratios,i.ratio);s<0&
&(s=~s-
1,n<0&&(s+=1),this._ignoreIndex=s)}});e.exports={AnimCurve:l,DynamicAnimCurve:c,Eve
ntAnimCurve:_,EventInfo:u,computeRatioByType:o,quickFindIndex:h}}),
{"../core/utils/binary-search":287,"./bezier":14,"./types":19}],12:
[(function(t,e,i){"use strict";var n=cc.js,r=cc.Class({ctor:function()
{this._anims=new
n.array.MutableForwardIterator([]),this._delayEvents=[],cc.director._scheduler&&cc.
director._scheduler.enableForTarget(this)},update:function(t){var
e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n._isPlaying&&!
n._isPaused&&n.update(t)}for(var r=this._delayEvents,s=0,a=r.length;s<a;s++){var
o=r[s];o.target[o.func].apply(o.target,o.args)}r.length=0},destruct:function()
{},addAnimation:function(t){-
1===this._anims.array.indexOf(t)&&this._anims.push(t)},removeAnimation:function(t)
{var e=this._anims.array.indexOf(t);e>=0?
this._anims.fastRemoveAt(e):cc.errorID(3907)},pushDelayEvent:function(t,e,i)
{this._delayEvents.push({target:t,func:e,args:i})}});cc.AnimationManager=e.exports=
r}),{}],13:[(function(t,e,i){"use strict";var
n=cc.js,r=t("./playable"),s=t("./types"),a=s.WrappedInfo,o=s.WrapMode,l=s.WrapModeM
ask;function h(t,e){r.call(this),this._currentFramePlayed=!
1,this._delay=0,this._delayTime=0,this._wrappedInfo=new
a,this._lastWrappedInfo=null,this._process=u,this._clip=t,this._name=e||
t&&t.name,this.animator=null,this.curves=[],this.delay=0,this.repeatCount=1,this.du
ration=1,this.speed=1,this.wrapMode=o.Normal,this.time=0,this._target=null,this._la
stframeEventOn=!1,this.emit=function(){for(var t=new
Array(arguments.length),e=0,i=t.length;e<i;e+
+)t[e]=arguments[e];cc.director.getAnimationManager().pushDelayEvent(this,"_emit",t
)}}n.extend(h,r);var c=h.prototype;function u(){var
t,e=this.sample();this._lastframeEventOn&&(t=this._lastWrappedInfo?
this._lastWrappedInfo:this._lastWrappedInfo=new a(e),this.repeatCount>1&&(0|
e.iterations)>(0|
t.iterations)&&this.emit("lastframe",this),t.set(e));e.stopped&&(this.stop(),this.e
mit("finished",this))}function _(){var t=this.time,e=this.duration;t>e?0===(t
%=e)&&(t=e):t<0&&0!==(t%=e)&&(t+=e);for(var
i=t/e,n=this.curves,r=0,s=n.length;r<s;r++)
{n[r].sample(t,i,this)}this._lastframeEventOn&&(void
0===this._lastIterations&&(this._lastIterations=i),
(this.time>0&&this._lastIterations>i||
this.time<0&&this._lastIterations<i)&&this.emit("lastframe",this),this._lastIterati
ons=i)}c._emit=function(t,e)
{this._target&&this._target.isValid&&this._target.emit(t,t,e)},c.on=function(t,e,i)
{return this._target&&this._target.isValid?
("lastframe"===t&&(this._lastframeEventOn=!
0),this._target.on(t,e,i)):null},c.once=function(t,e,i)
{if(this._target&&this._target.isValid){"lastframe"===t&&(this._lastframeEventOn=!
0);var n=this;return this._target.once(t,(function(t)
{e.call(i,t),n._lastframeEventOn=!1}))}return null},c.off=function(t,e,i)
{this._target&&this._target.isValid&&("lastframe"===t&&(this._target.hasEventListen
er(t)||(this._lastframeEventOn=!
1)),this._target.off(t,e,i))},c._setEventTarget=function(t)
{this._target=t},c.onPlay=function()
{this.setTime(0),this._delayTime=this._delay,cc.director.getAnimationManager().addA
nimation(this),this.animator&&this.animator.addAnimation(this),this.emit("play",thi
s)},c.onStop=function(){this.isPaused||
cc.director.getAnimationManager().removeAnimation(this),this.animator&&this.animato
r.removeAnimation(this),this.emit("stop",this)},c.onResume=function()
{cc.director.getAnimationManager().addAnimation(this),this.emit("resume",this)},c.o
nPause=function()
{cc.director.getAnimationManager().removeAnimation(this),this.emit("pause",this)},c
.setTime=function(t){this._currentFramePlayed=!1,this.time=t||0;for(var
e=this.curves,i=0,n=e.length;i<n;i++){var
r=e[i];r.onTimeChangedManually&&r.onTimeChangedManually(t,this)}},c.update=function
(t){this._delayTime>0&&(this._delayTime-=t,this._delayTime>0)||
(this._currentFramePlayed?this.time+=t*this.speed:this._currentFramePlayed=!
0,this._process())},c._needRevers=function(t){var e=this.wrapMode,i=!1;
(e&l.PingPong)===l.PingPong&&(t-(0|t)==0&&t>0&&(t-=1),1&t&&(i=!
i));return(e&l.Reverse)===l.Reverse&&(i=!i),i},c.getWrappedInfo=function(t,e){e=e||
new a;var i=!1,n=this.duration,r=this.repeatCount,s=t>0?t/n:-t/n;if(s>=r){s=r,i=!
0;var o=r-(0|r);0===o&&(o=1),t=o*n*(t>0?1:-1)}if(t>n){var h=t%n;t=0===h?n:h}else
t<0&&0!==(t%=n)&&(t+=n);var c=!
1,u=this._wrapMode&l.ShouldWrap;u&&(c=this._needRevers(s));var _=c?-1:1;return
this.speed<0&&(_*=-1),u&&c&&(t=n-
t),e.ratio=t/n,e.time=t,e.direction=_,e.stopped=i,e.iterations=s,e},c.sample=functi
on(){for(var
t=this.getWrappedInfo(this.time,this._wrappedInfo),e=this.curves,i=0,n=e.length;i<n
;i++){e[i].sample(t.time,t.ratio,this)}return t},n.get(c,"clip",(function(){return
this._clip})),n.get(c,"name",(function(){return
this._name})),n.obsolete(c,"AnimationState.length","duration"),n.getset(c,"curveLoa
ded",(function(){return this.curves.length>0}),(function()
{this.curves.length=0})),n.getset(c,"wrapMode",(function(){return this._wrapMode}),
(function(t){this._wrapMode=t,this.time=0,t&l.Loop?
this.repeatCount=1/0:this.repeatCount=1})),n.getset(c,"repeatCount",(function()
{return this._repeatCount}),(function(t){this._repeatCount=t;var
e=this._wrapMode&l.ShouldWrap,i=(this.wrapMode&l.Reverse)===l.Reverse;this._process
=t!==1/0||e||i?u:_})),n.getset(c,"delay",(function(){return this._delay}),
(function(t){this._delayTime=this._delay=t})),cc.AnimationState=e.exports=h}),
{"./playable":18,"./types":19}],14:[(function(t,e,i){"use strict";function
n(t,e,i,n,r){var s=1-r;return t*s*s*s+3*e*s*s*r+3*i*s*r*r+n*r*r*r}var
r=Math.cos,s=Math.acos,a=Math.max,o=2*Math.PI,l=Math.sqrt;function h(t){return
t<0?-Math.pow(-t,1/3):Math.pow(t,1/3)}function c(t,e){var i,n,c,u,_=e-0,f=e-
t[0],d=3*_,m=3*f,p=3*(e-t[2]),v=1/(-_+m-p+(e-1)),y=(d-6*f+p)*v,g=y*(1/3),x=(-
d+m)*v,b=1/3*(3*x-y*y),A=b*(1/3),C=(2*y*y*y-
9*y*x+27*(_*v))/27,S=C/2,T=S*S+A*A*A;if(T<0){var
w=1/3*-b,E=l(w*w*w),M=-C/(2*E),D=s(M<-1?-1:M>1?1:M),B=2*h(E);return n=B*r(D*(1/3))-
g,c=B*r((D+o)*(1/3))-g,u=B*r((D+2*o)*(1/3))-g,0<=n&&n<=1?0<=c&&c<=1?0<=u&&u<=1?
a(n,c,u):a(n,c):0<=u&&u<=1?a(n,u):n:0<=c&&c<=1?0<=u&&u<=1?
a(c,u):c:u}if(0===T)return c=-(i=S<0?h(-S):-h(S))-g,0<=(n=2*i-g)&&n<=1?0<=c&&c<=1?
a(n,c):n:c;var P=l(T);return n=(i=h(-S+P))-h(S+P)-g}function u(t,e){var
i=c(t,e),n=1-i;return
0*n*n*n+3*t[1]*i*n*n+3*t[3]*i*i*n+1*i*i*i}e.exports={bezier:n,bezierByTime:u}}),
{}],15:[(function(t,e,i){"use strict";var n={constant:function(){return
0},linear:function(t){return t},quadIn:function(t){return t*t},quadOut:function(t)
{return t*(2-t)},quadInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-
1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--
t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-
=2)*t*t+2)},quartIn:function(t){return t*t*t*t},quartOut:function(t){return 1-
--t*t*t*t},quartInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-
2)},quintIn:function(t){return t*t*t*t*t},quintOut:function(t){return--
t*t*t*t*t+1},quintInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-
=2)*t*t*t*t+2)},sineIn:function(t){return 1-
Math.cos(t*Math.PI/2)},sineOut:function(t){return
Math.sin(t*Math.PI/2)},sineInOut:function(t){return.5*(1-
Math.cos(Math.PI*t))},expoIn:function(t){return 0===t?0:Math.pow(1024,t-
1)},expoOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},expoInOut:function(t)
{return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-
1)))},circIn:function(t){return 1-Math.sqrt(1-t*t)},circOut:function(t){return
Math.sqrt(1- --t*t)},circInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-
1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?
0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-
=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return
0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-
10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return
0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?
i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-
=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return
t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)
+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-
=2)*t*((e+1)*t+e)+2)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?
7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-
=2.625/2.75)*t+.984375},smooth:function(t){return t<=0?0:t>=1?1:t*t*(3-
2*t)},fade:function(t){return t<=0?0:t>=1?1:t*t*t*(t*(6*t-15)+10)}};function r(t,e)
{return function(i){return i<.5?e(2*i)/2:t(2*i-
1)/2+.5}}n.quadOutIn=r(n.quadIn,n.quadOut),n.cubicOutIn=r(n.cubicIn,n.cubicOut),n.q
uartOutIn=r(n.quartIn,n.quartOut),n.quintOutIn=r(n.quintIn,n.quintOut),n.sineOutIn=
r(n.sineIn,n.sineOut),n.expoOutIn=r(n.expoIn,n.expoOut),n.circOutIn=r(n.cir
cIn,n.circOut),n.backOutIn=r(n.backIn,n.backOut),n.bounceIn=function(t){return 1-
n.bounceOut(1-t)},n.bounceInOut=function(t){return
t<.5?.5*n.bounceIn(2*t):.5*n.bounceOut(2*t-
1)+.5},n.bounceOutIn=r(n.bounceIn,n.bounceOut),cc.easing=e.exports=n}),{}],16:
[(function(t,e,i){"use
strict";t("./bezier"),t("./easing"),t("./types"),t("./motion-path-
helper"),t("./animation-curves"),t("./animation-clip"),t("./animation-
manager"),t("./animation-state"),t("./animation-animator")}),{"./animation-
animator":9,"./animation-clip":10,"./animation-curves":11,"./animation-
manager":12,"./animation-state":13,"./bezier":14,"./easing":15,"./motion-path-
helper":17,"./types":19}],17:[(function(t,e,i){"use strict";var n=t("./animation-
curves").DynamicAnimCurve,r=t("./animation-
curves").computeRatioByType,s=t("./bezier").bezier,a=t("../core/utils/binary-
search").binarySearchEpsilon,o=cc.v2;function l(t){this.points=t||
[],this.beziers=[],this.ratios=[],this.progresses=[],this.length=0,this.computeBezi
ers()}function h()
{this.start=o(),this.end=o(),this.startCtrlPoint=o(),this.endCtrlPoint=o()}function
c(t){if(!Array.isArray(t))return!1;for(var e=0,i=t.length;e<i;e++){var n=t[e];if(!
Array.isArray(n)||6!==n.length)return!1}return!0}function u(t,e,i,s,h){function
u(t){return t instanceof cc.Vec2?{in:t,pos:t,out:t}:Array.isArray(t)&&6===t.length?
{in:o(t[2],t[3]),pos:o(t[0],t[1]),out:o(t[4],t[5])}:
{in:cc.Vec2.ZERO,pos:cc.Vec2.ZERO,out:cc.Vec2.ZERO}}var
_=e.values=e.values.map((function(t){return Array.isArray(t)&&(t=2===t.length?
cc.v2(t[0],t[1]):cc.v3(t[0],t[1],t[2])),t}));if(0!==t.length&&0!==_.length){for(var
f=!1,d=0;d<t.length;d++){var m=t[d];if(m&&!c(m)&&(cc.errorID(3904,h?
h.name:"","position",d),m=null),m&&m.length>0){f=!0;break}}if(f&&1!==_.length)
{for(var
p=e.types,v=e.ratios,y=e.values=[],g=e.types=[],x=e.ratios=[],b=0,A=n.Linear,C=0,S=
t.length;C<S-1;C++){var T,w=t[C],E=v[C],M=v[C+1]-
E,D=_[C],B=_[C+1],P=p[C],I=[],R=b/M,O=1/(M*i*s);if(w&&w.length>0){var
L=[];L.push(u(D));for(var F=0,V=w.length;F<V;F++){var
N=u(w[F]);L.push(N)}L.push(u(B));var k=new l(L);k.computeBeziers();for(var
G=k.progresses;1-R>1e-6;){var z,U,j,W;if((T=r(T=R,P))<0)W=(0-
T)*(U=k.beziers[0]).getLength(),j=U.start.sub(U.endCtrlPoint).normalize(),z=U.start
.add(j.mul(W));else if(T>1)W=(T-1)*(U=k.beziers[k.beziers.length-
1]).getLength(),j=U.end.sub(U.startCtrlPoint).normalize(),z=U.end.add(j.mul(W));els
e{var H=a(G,T);H<0&&(H=~H),T-=H>0?G[H-
1]:0,T/=k.ratios[H],z=k.beziers[H].getPointAt(T)}I.push(z),R+=O}}else for(;1-R>1e-
6;)T=r(T=R,P),I.push(D.lerp(B,T)),R+=O;A="constant"===P?
P:n.Linear;for(F=0,V=I.length;F<V;F++){var X=E+b+O*F*M;q(I[F],A,X)}b=Math.abs(R-
1)>1e-6?(R-1)*M:0}v[v.length-1]!==x[x.length-1]&&q(_[_.length-1],A,v[v.length-
1])}}function q(t,e,i)
{y.push(t),g.push(e),x.push(i)}}l.prototype.computeBeziers=function(){var
t;this.beziers.length=0,this.ratios.length=0,this.progresses.length=0,this.length=0
;for(var e=1;e<this.points.length;e++){var i=this.points[e-1],n=this.points[e];
(t=new
h).start=i.pos,t.startCtrlPoint=i.out,t.end=n.pos,t.endCtrlPoint=n.in,this.beziers.
push(t),this.length+=t.getLength()}var r=0;for(e=0;e<this.beziers.length;e+
+)t=this.beziers[e],this.ratios[e]=t.getLength()/this.length,this.progresses[e]=r+=
this.ratios[e];return this.beziers},h.prototype.getPointAt=function(t){var
e=this.getUtoTmapping(t);return this.getPoint(e)},h.prototype.getPoint=function(t)
{var
e=s(this.start.x,this.startCtrlPoint.x,this.endCtrlPoint.x,this.end.x,t),i=s(this.s
tart.y,this.startCtrlPoint.y,this.endCtrlPoint.y,this.end.y,t);return new
o(e,i)},h.prototype.getLength=function(){var t=this.getLengths();return t[t.length-
1]},h.prototype.getLengths=function(t){if(t||(t=this.__arcLengthDivisions?
this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===
t+1)return this.cacheArcLengths;var
e,i,n=[],r=this.getPoint(0),s=o(),a=0;for(n.push(0),i=1;i<=t;i+
+)e=this.getPoint(i/t),s.x=r.x-e.x,s.y=r.y-e.y,a+=s.mag(),n.push(a),r=e;return
this.cacheArcLengths=n,n},h.prototype.getUtoTmapping=function(t,e){var
i,n=this.getLengths(),r=0,s=n.length;i=e||t*n[s-1];for(var a,o=0,l=s-
1;o<=l;)if((a=n[r=Math.floor(o+(l-o)/2)]-i)<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-
1}if(n[r=l]===i)return r/(s-1);var h=n[r];return(r+(i-h)/(n[r+1]-h))/(s-
1)},e.exports={sampleMotionPaths:u,Curve:l,Bezier:h}}),{"../core/utils/binary-
search":287,"./animation-curves":11,"./bezier":14}],18:[(function(t,e,i){"use
strict";var n=cc.js,r=t("../core/CCDebug");function s(){this._isPlaying=!
1,this._isPaused=!1,this._stepOnce=!1}var a=s.prototype;n.get(a,"isPlaying",
(function(){return this._isPlaying}),!0),n.get(a,"isPaused",(function(){return
this._isPaused}),!0);var o=function()
{};a.onPlay=o,a.onPause=o,a.onResume=o,a.onStop=o,a.onError=o,a.play=function()
{this._isPlaying?this._isPaused?(this._isPaused=!
1,this.onResume()):this.onError(r.getError(3912)):(this._isPlaying=!
0,this.onPlay())},a.stop=function(){this._isPlaying&&(this._isPlaying=!
1,this.onStop(),this._isPaused=!1)},a.pause=function(){this._isPlaying&&!
this._isPaused&&(this._isPaused=!0,this.onPause())},a.resume=function()
{this._isPlaying&&this._isPaused&&(this._isPaused=!
1,this.onResume())},a.step=function(){this.pause(),this._stepOnce=!
0,this._isPlaying||this.play()},e.exports=s}),{"../core/CCDebug":49}],19:
[(function(t,e,i){"use strict";var
n={Loop:2,ShouldWrap:4,PingPong:22,Reverse:36},r=cc.Enum({Default:0,Normal:1,Revers
e:n.Reverse,Loop:n.Loop,LoopReverse:n.Loop|
n.Reverse,PingPong:n.PingPong,PingPongReverse:n.PingPong|n.Reverse});function s(t)
{t?this.set(t):(this.ratio=0,this.time=0,this.direction=1,this.stopped=!
0,this.iterations=0,this.frameIndex=void
0)}cc.WrapMode=r,s.prototype.set=function(t)
{this.ratio=t.ratio,this.time=t.time,this.direction=t.direction,this.stopped=t.stop
ped,this.iterations=t.iterations,this.frameIndex=t.frameIndex},e.exports={WrapModeM
ask:n,WrapMode:r,WrappedInfo:s}}),{}],20:[(function(t,e,i){"use strict";var
n=t("../core/event/event-
target"),r=t("../core/platform/CCSys"),s=t("../core/assets/CCAudioClip").LoadMode,a
=!1,o=[],l=function t(e)
{n.call(this),this._src=e,this._element=null,this.id=0,this._volume=1,this._loop=!
1,this._nextTime=0,this._state=t.State.INITIALZING,this._onended=function()
{this._state=t.State.STOPPED,this.emit("ended")}.bind(this)};cc.js.extend(l,n),l.St
ate={ERROR:-1,INITIALZING:0,PLAYING:1,PAUSED:2,STOPPED:3},(function(t)
{t._bindEnded=function(t){t=t||this._onended;var e=this._element;this._src&&e
instanceof HTMLAudioElement?
e.addEventListener("ended",t):e.onended=t},t._unbindEnded=function(){var
t=this._element;t instanceof HTMLAudioElement?
t.removeEventListener("ended",this._onended):t&&(t.onended=null)},t._onLoaded=funct
ion(){var t=this._src._nativeAsset;t instanceof HTMLAudioElement?(this._element||
(this._element=document.createElement("audio")),this._element.src=t.src):this._elem
ent=new h(t,this),this.setVolume(this._volume),this.setLoop(this._loop),0!
==this._nextTime&&this.setCurrentTime(this._nextTime),this._state===l.State.PLAYING
?this.play():this._state=l.State.INITIALZING},t.play=function()
{this._state=l.State.PLAYING,this._element&&(this._bindEnded(),this._element.play()
,this._src&&this._src.loadMode===s.DOM_AUDIO&&this._element.paused&&o.push({instanc
e:this,offset:0,audio:this._element}),a||(a=!
0,cc.game.canvas.addEventListener("touchstart",(function(){for(var t=void
0;t=o.pop();)t.audio.play(t.offset)}))))},t.destroy=function()
{this._element=null},t.pause=function()
{this._element&&this._state===l.State.PLAYING&&(this._unbindEnded(),this._element.p
ause(),this._state=l.State.PAUSED)},t.resume=function()
{this._element&&this._state===l.State.PAUSED&&(this._bindEnded(),this._element.play
(),this._state=l.State.PLAYING)},t.stop=function(){if(this._element)
{this._element.pause();try{this._element.currentTime=0}catch(t){}for(var
t=0;t<o.length;t++)if(o[t].instance===this)
{o.splice(t,1);break}this._unbindEnded(),this.emit("stop"),this._state=l.State.STOP
PED}},t.setLoop=function(t)
{this._loop=t,this._element&&(this._element.loop=t)},t.getLoop=function(){return
this._loop},t.setVolume=function(t)
{this._volume=t,this._element&&(this._element.volume=t)},t.getVolume=function()
{return this._volume},t.setCurrentTime=function(t){if(this._element)
{this._nextTime=0,this._unbindEnded(),this._bindEnded(function()
{this._bindEnded()}.bind(this));try{this._element.currentTime=t}catch(i){var
e=this._element;if(e.addEventListener){e.addEventListener("loadedmetadata",
(function i(){e.removeEventListener("loadedmetadata",i),e.currentTime=t}))}}}else
this._nextTime=t},t.getCurrentTime=function(){return this._element?
this._element.currentTime:0},t.getDuration=function(){return this._element?
this._element.duration:0},t.getState=function(){var t=this._element;return
t&&(l.State.PLAYING===this._state&&t.paused?
this._state=l.State.STOPPED:l.State.STOPPED!==this._state||t.paused||
(this._state=l.State.PLAYING)),this._state},t.__defineGetter__("src",(function()
{return this._src})),t.__defineSetter__("src",(function(t)
{if(this._unbindEnded(),t)if(this._src=t,t.loaded)this._onLoaded();else{var
e=this;t.once("load",(function()
{t===e._src&&e._onLoaded()})),cc.loader.load({url:t.nativeUrl,skips:["Loader"]},
(function(e,i){e?cc.error(e):t.loaded||(t._nativeAsset=i)}))}else
this._src=null,this._element instanceof HTMLAudioElement?
this._element.src="":this._element=null,this._state=l.State.INITIALZING;return
t})),t.__defineGetter__("paused",(function(){return!this._element||
this._element.paused}))})(l.prototype);var h=function(t,e)
{this._audio=e,this._context=r.__audioSupport.context,this._buffer=t,this._gainObj=
this._context.createGain(),this._volume=1,this._gainObj.gain.setTargetAtTime?
this._gainObj.gain.setTargetAtTime(this._volume,this._context.currentTime,.01):this
._gainObj.gain.value=1,this._gainObj.connect(this._context.destination),this._loop=
!1,this._startTime=-
1,this._currentSource=null,this.playedLength=0,this._currextTimer=null,this._endCal
lback=function(){this.onended&&this.onended(this)}.bind(this)};(function(t
){t.play=function(t){this._currentSource&&!
this.paused&&(this._currentSource.onended=null,this._currentSource.stop(0),this.pla
yedLength=0);var
e=this._context.createBufferSource();e.buffer=this._buffer,e.connect(this._gainObj)
,e.loop=this._loop,this._startTime=this._context.currentTime,(t=t||
this.playedLength)&&(this._startTime-=t);var i=this._buffer.duration,n=t,r=void
0;if(this._loop?e.start?e.start(0,n):e.notoGrainOn?
e.noteGrainOn(0,n):e.noteOn(0,n):(r=i-t,e.start?e.start(0,n,r):e.notoGrainOn?
e.noteGrainOn(0,n,r):e.noteOn(0,n,r)),this._currentSource=e,e.onended=this._endCall
back,(!
e.context.state||"suspended"===e.context.state)&&0===this._context.currentTime){var
s=this;clearTimeout(this._currextTimer),this._currextTimer=setTimeout((function()
{0===s._context.currentTime&&o.push({instance:s._audio,offset:t,audio:s})}),10)}},t
.pause=function(){if(clearTimeout(this._currextTimer),!this.paused)
{this.playedLength=this._context.currentTime-this._startTime,this.playedLength
%=this._buffer.duration;var
t=this._currentSource;this._currentSource=null,this._startTime=-
1,t&&t.stop(0)}},t.__defineGetter__("paused",(function(){return(!
this._currentSource||!this._currentSource.loop)&&(-1===this._startTime||
this._context.currentTime-
this._startTime>this._buffer.duration)})),t.__defineGetter__("loop",(function()
{return this._loop})),t.__defineSetter__("loop",(function(t){return
this._currentSource&&(this._currentSource.loop=t),this._loop=t})),t.__defineGetter_
_("volume",(function(){return this._volume})),t.__defineSetter__("volume",
(function(t){return this._volume=t,this._gainObj.gain.setTargetAtTime?
this._gainObj.gain.setTargetAtTime(this._volume,this._context.currentTime,.01):this
._volume.gain.value=t,r.os===r.OS_IOS&&!
this.paused&&this._currentSource&&(this._currentSource.onended=null,this.pause(),th
is.play()),t})),t.__defineGetter__("currentTime",(function(){return this.paused?
this.playedLength:(this.playedLength=this._context.currentTime-
this._startTime,this.playedLength
%=this._buffer.duration,this.playedLength)})),t.__defineSetter__("currentTime",
(function(t){return this.paused?this.playedLength=t:
(this.pause(),this.playedLength=t,this.play()),t})),t.__defineGetter__("duration",
(function(){return this._buffer.duration}))})(h.prototype),e.exports=cc.Audio=l}),
{"../core/assets/CCAudioClip":57,"../core/event/event-
target":132,"../core/platform/CCSys":209}],21:[(function(t,e,i){"use strict";var
n=t("./CCAudio"),r=t("../core/assets/CCAudioClip"),s=cc.js,a=0,o=s.createMap(!
0),l={},h=[],c=function(t){t._finishCallback=null,h.length<32?
(t.off("ended"),t.off("stop"),t.src=null,h.push(t)):t.destroy()},u=function(t){var
e=a++,i=l[t];if(i||(i=l[t]=[]),d._maxAudioInstance<=i.length){var
r=i.shift();_(r).stop()}var s=h.pop()||new n,u=function(){if(_(this.id)){delete
o[this.id];var t=i.indexOf(this.id);cc.js.array.fastRemoveAt(i,t)}c(this)};return
s.on("ended",(function()
{this._finishCallback&&this._finishCallback(),u.call(this)}),s),s.on("stop",u,s),s.
id=e,o[e]=s,i.push(e),s},_=function(t){return o[t]},f=function(t){return void
0===t?t=1:"string"==typeof
t&&(t=Number.parseFloat(t)),t},d={AudioState:n.State,_maxWebAudioSize:2097152,_maxA
udioInstance:24,_id2audio:o,play:function(t,e,i){var n,s=t;if("string"==typeof
t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"
),n=u(s=t),r._loadByUrl(s,(function(t,e){e&&(n.src=e)}));else{if(!
t)return;s=t.nativeUrl,(n=u(s)).src=t}return n.setLoop(e||!
1),i=f(i),n.setVolume(i),n.play(),n.id},setLoop:function(t,e){var
i=_(t);i&&i.setLoop&&i.setLoop(e)},isLoop:function(t){var e=_(t);return!(!e||!
e.getLoop)&&e.getLoop()},setVolume:function(t,e){var
i=_(t);i&&i.setVolume(e)},getVolume:function(t){var e=_(t);return e?
e.getVolume():1},setCurrentTime:function(t,e){var i=_(t);return!!
i&&(i.setCurrentTime(e),!0)},getCurrentTime:function(t){var e=_(t);return e?
e.getCurrentTime():0},getDuration:function(t){var e=_(t);return e?
e.getDuration():0},getState:function(t){var e=_(t);return e?
e.getState():this.AudioState.ERROR},setFinishCallback:function(t,e){var
i=_(t);i&&(i._finishCallback=e)},pause:function(t){var e=_(t);return!!
e&&(e.pause(),!0)},_pauseIDCache:[],pauseAll:function(){for(var t in o){var
e=o[t];e.getState()===n.State.PLAYING&&(this._pauseIDCache.push(t),e.pause())}},res
ume:function(t){var e=_(t);e&&e.resume()},resumeAll:function(){for(var
t=0;t<this._pauseIDCache.length;++t){var
e=this._pauseIDCache[t],i=_(e);i&&i.resume()}this._pauseIDCache.length=0},stop:func
tion(t){var e=_(t);return!!e&&(e.stop(),!0)},stopAll:function(){for(var t in o){var
e=o[t];e&&e.stop()}},setMaxAudioInstance:function(t)
{this._maxAudioInstance=t},getMaxAudioInstance:function(){return
this._maxAudioInstance},uncache:function(t){var e=t;if("string"==typeof
t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"
),e=t;else{if(!t)return;e=t.nativeUrl}var i=l[e];if(i)for(;i.length>0;){var
n=i.pop(),r=o[n];r&&(r.stop(),delete o[n])}},uncacheAll:function()
{this.stopAll();var t=void 0;for(var e in o)
(t=o[e])&&t.destroy();for(;t=h.pop();)t.destroy();o=s.createMap(!
0),l={}},getProfile:function(t){},preload:function(t,e)
{cc.loader.load(t,e&&function(t){t||e()})},setMaxWebAudioSize:function(t)
{this._maxWebAudioSize=1024*t},_breakCache:null,_break:function(){for(var t in
this._breakCache=[],o){var
e=o[t];e.getState()===n.State.PLAYING&&(this._breakCache.push(t),e.pause())}},_rest
ore:function(){if(this._breakCache){for(;this._breakCache.length>0;){var
t=this._breakCache.pop(),e=_(t);e&&e.resume&&e.resume()}this._breakCache=null}},_mu
sic:{id:-1,loop:!1,volume:1},_effect:{volume:1,pauseCache:
[]},playMusic:function(t,e){var i=this._music;return
this.stop(i.id),i.id=this.play(t,e,i.volume),i.loop=e,i.id},stopMusic:function()
{this.stop(this._music.id)},pauseMusic:function(){return
this.pause(this._music.id),this._music.id},resumeMusic:function(){return
this.resume(this._music.id),this._music.id},getMusicVolume:function(){return
this._music.volume},setMusicVolume:function(t){t=f(t);var e=this._music;return
e.volume=t,this.setVolume(e.id,e.volume),e.volume},isMusicPlaying:function(){return
this.getState(this._music.id)===this.AudioState.PLAYING},playEffect:function(t,e)
{return this.play(t,e||!1,this._effect.volume)},setEffectsVolume:function(t)
{t=f(t);var e=this._music.id;for(var i in this._effect.volume=t,o){var
n=o[i];n&&n.id!==e&&d.setVolume(i,t)}},getEffectsVolume:function(){return
this._effect.volume},pauseEffect:function(t){return
this.pause(t)},pauseAllEffects:function(){var
t=this._music.id,e=this._effect;for(var i in e.pauseCache.length=0,o){var
n=o[i];if(n&&n.id!
==t)n.getState()===this.AudioState.PLAYING&&(e.pauseCache.push(i),n.pause())}},resu
meEffect:function(t){this.resume(t)},resumeAllEffects:function(){for(var
t=this._effect.pauseCache,e=0;e<t.length;++e){var
i=t[e],n=o[i];n&&n.resume()}},stopEffect:function(t){return
this.stop(t)},stopAllEffects:function(){var t=this._music.id;for(var e in o){var
i=o[e];if(i&&i.id!
==t)i.getState()===d.AudioState.PLAYING&&i.stop()}}};e.exports=cc.audioEngine=d}),
{"../core/assets/CCAudioClip":57,"./CCAudio":20}],22:[(function(t,e,i){"use
strict";var
n={name:"Jacob__Codec"};n.Base64=t("./base64"),n.GZip=t("./gzip"),n.unzip=function(
){return n.GZip.gunzip.apply(n.GZip,arguments)},n.unzipBase64=function(){var
t=n.Base64.decode.apply(n.Base64,arguments);try{return
n.GZip.gunzip.call(n.GZip,t)}catch(e){return
t.slice(7)}},n.unzipBase64AsArray=function(t,e){e=e||1;var
i,n,r,s=this.unzipBase64(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-
1;n>=0;--n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a},n.unzipAsArray=function(t,e)
{e=e||1;var i,n,r,s=this.unzip(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-
1;n>=0;--n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a},cc.codec=e.exports=n}),
{"./base64":23,"./gzip":24}],23:[(function(t,e,i){"use strict";var
n=t("../core/utils/misc").BASE64_VALUES,r={name:"Jacob__Codec__Base64",decode:funct
ion(t){var e,i,r,s,a,o,l=[],h=0;for(t=t.replace(/[^A-Za-z0-
9\+\/\=]/g,"");h<t.length;)e=n[t.charCodeAt(h++)]<<2|(s=n[t.charCodeAt(h+
+)])>>4,i=(15&s)<<4|(a=n[t.charCodeAt(h++)])>>2,r=(3&a)<<6|(o=n[t.charCodeAt(h+
+)]),l.push(String.fromCharCode(e)),64!==a&&l.push(String.fromCharCode(i)),64!
==o&&l.push(String.fromCharCode(r));return
l=l.join("")},decodeAsArray:function(t,e){var
i,n,r,s=this.decode(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-1;n>=0;--
n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a}};e.exports=r}),
{"../core/utils/misc":295}],24:[(function(t,e,i){"use strict";var n=function(t)
{this.data=t,this.debug=!1,this.gpflags=void
0,this.files=0,this.unzipped=[],this.buf32k=new
Array(32768),this.bIdx=0,this.modeZIP=!
1,this.bytepos=0,this.bb=1,this.bits=0,this.nameBuf=[],this.fileout=void
0,this.literalTree=new Array(n.LITERALS),this.distanceTree=new
Array(32),this.treepos=0,this.Places=null,this.len=0,this.fpos=new
Array(17),this.fpos[0]=0,this.flens=void 0,this.fmax=void 0};n.gunzip=function(t)
{return t.constructor===Array||(t.constructor,String),new n(t).gunzip()[0]
[0]},n.HufNode=function(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-
1},n.LITERALS=288,n.NAMEMAX=256,n.bitReverse=[0,128,64,192,32,160,96,224,16,144,80,
208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,6
8,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,1
56,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10
,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230
,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126
,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,10
5,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181
,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,
163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,
59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,24
7,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],n.cplens=[3,4,5,6,7,8,
9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],n.cp
lext=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],n.cpdist=[1,
2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6
145,8193,12289,16385,24577],n.cpdext=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,1
0,10,11,11,12,12,13,13],n.border=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],n
.prototype.gunzip=function(){return
this.outputArr=[],this.nextFile(),this.unzipped},n.prototype.readByte=function()
{return this.bits+=8,this.bytepos<this.data.length?
this.data.charCodeAt(this.bytepos++):-1},n.prototype.byteAlign=function()
{this.bb=1},n.prototype.readBit=function(){var t;return this.bits+
+,t=1&this.bb,this.bb>>=1,0===this.bb&&(this.bb=this.readByte(),t=1&this.bb,this.bb
=this.bb>>1|128),t},n.prototype.readBits=function(t){for(var e=0,i=t;i--;)e=e<<1|
this.readBit();return t&&(e=n.bitReverse[e]>>8-
t),e},n.prototype.flushBuffer=function()
{this.bIdx=0},n.prototype.addBuffer=function(t){this.buf32k[this.bIdx+
+]=t,this.outputArr.push(String.fromCharCode(t)),32768===this.bIdx&&(this.bIdx=0)},
n.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-
1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]+
+;this.fpos[this.len]++}},n.prototype.Rec=function(){var
t,e=this.Places[this.treepos];if(17===this.len)return-1;if(this.treepos++,this.len+
+,(t=this.IsPat())>=0)e.b0=t;else if(e.b0=32768,this.Rec())return-
1;if((t=this.IsPat())>=0)e.b1=t,e.jump=null;else
if(e.b1=32768,e.jump=this.Places[this.treepos],e.jumppos=this.treepos,this.Rec())re
turn-1;return this.len--,0},n.prototype.CreateTree=function(t,e,i,n){var
r;for(this.Places=t,this.treepos=0,this.flens=i,this.fmax=e,r=0;r<17;r+
+)this.fpos[r]=0;return this.len=0,this.Rec()?-
1:0},n.prototype.DecodeValue=function(t){for(var
e,i,n=0,r=t[n];;)if(this.readBit()){if(!(32768&r.b1))return
r.b1;for(r=r.jump,e=t.length,i=0;i<e;i++)if(t[i]===r){n=i;break}}else{if(!
(32768&r.b0))return r.b0;r=t[++n]}return-1},n.prototype.DeflateLoop=function(){var
t,e,i;do{var
r,s;if(t=this.readBit(),0===(e=this.readBits(2)))for(this.byteAlign(),r=this.readBy
te(),r|=this.readByte()<<8,s=this.readByte(),65535&(r^~(s|
=this.readByte()<<8))&&document.write("BlockLen checksum
mismatch\n");r--;)a=this.readByte(),this.addBuffer(a);else
if(1===e)for(;;)if((o=n.bitReverse[this.readBits(7)]>>1)>23?(o=o<<1|
this.readBit())>199?o=(o-=128)<<1|this.readBit():(o-
=48)>143&&(o+=136):o+=256,o<256)this.addBuffer(o);else{if(256===o)break;for(o-
=257,m=this.readBits(n.cplext[o])
+n.cplens[o],o=n.bitReverse[this.readBits(5)]>>3,n.cpdext[o]>8?
(p=this.readBits(8),p|=this.readBits(n.cpdext[o]-
8)<<8):p=this.readBits(n.cpdext[o]),p+=n.cpdist[o],o=0;o<m;o++){var
a=this.buf32k[this.bIdx-p&32767];this.addBuffer(a)}}else if(2===e){var
o,l,h,c,u,_=new
Array(320);for(h=257+this.readBits(5),c=1+this.readBits(5),u=4+this.readBits(4),o=0
;o<19;o++)_[o]=0;for(o=0;o<u;o+
+)_[n.border[o]]=this.readBits(3);for(m=this.distanceTree.length,i=0;i<m;i+
+)this.distanceTree[i]=new
n.HufNode;if(this.CreateTree(this.distanceTree,19,_,0))return
this.flushBuffer(),1;l=h+c,i=0;for(;i<l;)if(0,
(o=this.DecodeValue(this.distanceTree))<16)_[i++]=o;else if(16===o){var f;if(i+
(o=3+this.readBits(2))>l)return this.flushBuffer(),1;for(f=i?_[i-1]:0;o--;)_[i+
+]=f}else{if(i+(o=17===o?3+this.readBits(3):11+this.readBits(7))>l)return
this.flushBuffer(),1;for(;o--;)_[i++]=0}for(m=this.literalTree.length,i=0;i<m;i+
+)this.literalTree[i]=new
n.HufNode;if(this.CreateTree(this.literalTree,h,_,0))return
this.flushBuffer(),1;for(m=this.literalTree.length,i=0;i<m;i+
+)this.distanceTree[i]=new n.HufNode;var d=new Array;for(i=h;i<_.length;i++)d[i-
h]=_[i];if(this.CreateTree(this.distanceTree,c,d,0))return
this.flushBuffer(),1;for(;;)if((o=this.DecodeValue(this.literalTree))>=256){var
m,p;if(0===(o-=256))break;for(o--,m=this.readBits(n.cplext[o])
+n.cplens[o],o=this.DecodeValue(this.distanceTree),n.cpdext[o]>8?
(p=this.readBits(8),p|=this.readBits(n.cpdext[o]-
8)<<8):p=this.readBits(n.cpdext[o]),p+=n.cpdist[o];m--;){a=this.buf32k[this.bIdx-
p&32767];this.addBuffer(a)}}else this.addBuffer(o)}}while(!t);return
this.flushBuffer(),this.byteAlign(),0},n.prototype.unzipFile=function(t){var
e;for(this.gunzip(),e=0;e<this.unzipped.length;e++)if(this.unzipped[e]
[1]===t)return this.unzipped[e][0]},n.prototype.nextFile=function()
{this.outputArr=[],this.modeZIP=!1;var
t=[];if(t[0]=this.readByte(),t[1]=this.readByte(),120===t[0]&&218===t[1]&&(this.Def
lateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),"geonext.gxt"],this.f
iles+
+),31===t[0]&&139===t[1]&&(this.skipdir(),this.unzipped[this.files]=[this.outputArr
.join(""),"file"],this.files++),80===t[0]&&75===t[1]&&(this.modeZIP=!
0,t[2]=this.readByte(),t[3]=this.readByte(),3===t[2]&&4===t[3]))
{t[0]=this.readByte(),t[1]=this.readByte(),this.gpflags=this.readByte(),this.gpflag
s|=this.readByte()<<8;var e=this.readByte();e|
=this.readByte()<<8,this.readByte(),this.readByte(),this.readByte(),this.readByte()
;this.readByte();this.readByte()<<8,this.readByte()<<16,this.readByte()<<24;this.re
adByte();this.readByte()<<8,this.readByte()<<16,this.readByte()<<24;var
i=this.readByte();i|=this.readByte()<<8;var r=this.readByte();for(r|
=this.readByte()<<8,a=0,this.nameBuf=[];i--;){var
s=this.readByte();"/"===s|":"===s?a=0:a<n.NAMEMAX-1&&(this.nameBuf[a+
+]=String.fromCharCode(s))}this.fileout||(this.fileout=this.nameBuf);for(var
a=0;a<r;)s=this.readByte(),a+
+;8===e&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),thi
s.nameBuf.join("")],this.files++),this.skipdir()}},n.prototype.skipdir=function()
{var
t,e,i=[];if(8&this.gpflags&&(i[0]=this.readByte(),i[1]=this.readByte(),i[2]=this.re
adByte(),i[3]=this.readByte(),this.readByte(),this.readByte()<<8,this.readByte()<<1
6,this.readByte()<<24,this.readByte(),this.readByte()<<8,this.readByte()<<16,this.r
eadByte()<<24),this.modeZIP&&this.nextFile(),i[0]=this.readByte(),8!==i[0])return
0;if(this.gpflags=this.readByte(),this.readByte(),this.readByte(),this.readByte(),t
his.readByte(),this.readByte(),this.readByte(),4&this.gpflags)for(i[0]=this.readByt
e(),i[2]=this.readByte(),this.len=i[0]+256*i[1],t=0;t<this.len;t+
+)this.readByte();if(8&this.gpflags)for(t=0,this.nameBuf=[];e=this.readByte();)"7"!
==e&&":"!==e||(t=0),t<n.NAMEMAX-1&&(this.nameBuf[t+
+]=e);if(16&this.gpflags)for(;e=this.readByte(););2&this.gpflags&&(this.readByte(),
this.readByte()),this.DeflateLoop(),this.readByte(),this.readByte(),this.readByte()
,this.readByte(),this.modeZIP&&this.nextFile()},e.exports=n}),{}],25:
[(function(t,e,i){"use strict";(function(){function t(t){throw t}var e=void 0,i=!
0,n=this;function r(t,i){var r,s=t.split("."),a=n;!(s[0]in
a)&&a.execScript&&a.execScript("var
"+s[0]);for(;s.length&&(r=s.shift());)s.length||i===e?a=a[r]?
a[r]:a[r]={}:a[r]=i}var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof
Uint16Array&&"undefined"!=typeof Uint32Array;function a(t){if("string"==typeof t)
{var e,i,n=t.split("");for(e=0,i=n.length;e<i;e+
+)n[e]=(255&n[e].charCodeAt(0))>>>0;t=n}for(var r,s=1,a=0,o=t.length,l=0;0<o;){o-
=r=1024<o?1024:o;do{a+=s+=t[l++]}while(--r);s%=65521,a%=65521}return(a<<16|
s)>>>0}function o(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e
instanceof(s?Uint8Array:Array)?e:new(s?Uint8Array:Array)
(32768),2*this.buffer.length<=this.index&&t(Error("invalid
index")),this.buffer.length<=this.index&&this.f()}o.prototype.f=function(){var
t,e=this.buffer,i=e.length,n=new(s?Uint8Array:Array)(i<<1);if(s)n.set(e);else
for(t=0;t<i;++t)n[t]=e[t];return this.buffer=n},o.prototype.d=function(t,e,i){var
n,r=this.buffer,s=this.index,a=this.i,o=r[s];if(i&&1<e&&(t=8<e?(f[255&t]<<24|
f[t>>>8&255]<<16|f[t>>>16&255]<<8|f[t>>>24&255])>>32-e:f[t]>>8-e),8>e+a)o=o<<e|
t,a+=e;else for(n=0;n<e;++n)o=o<<1|t>>e-n-1&1,8==++a&&(a=0,r[s+
+]=f[o],o=0,s===r.length&&(r=this.f()));r[s]=o,this.buffer=r,this.i=a,this.index=s}
,o.prototype.finish=function(){var t,e=this.buffer,i=this.index;return
0<this.i&&(e[i]<<=8-this.i,e[i]=f[e[i]],i++),s?t=e.subarray(0,i):
(e.length=i,t=e),t};var l,h=new(s?Uint8Array:Array)(256);for(l=0;256>l;++l){for(var
c=_=l,u=7,_=_>>>1;_;_>>>=1)c<<=1,c|=1&_,--u;h[l]=(c<<u&255)>>>0}var f=h;function
d(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function m(t){var
e,i,n,r,a,o,l,h,c,u=t.length,_=0,f=Number.POSITIVE_INFINITY;for(h=0;h<u;+
+h)t[h]>_&&(_=t[h]),t[h]<f&&(f=t[h]);for(e=1<<_,i=new(s?Uint32Array:Array)
(e),n=1,r=0,a=2;n<=_;){for(h=0;h<u;++h)if(t[h]===n){for(o=0,l=r,c=0;c<n;++c)o=o<<1|
1&l,l>>=1;for(c=o;c<e;c+=a)i[c]=n<<16|h;++r}++n,r<<=1,a<<=1}return[i,_,f]}function
p(t,e)
{this.h=y,this.w=0,this.input=t,this.b=0,e&&(e.lazy&&(this.w=e.lazy),"number"==type
of
e.compressionType&&(this.h=e.compressionType),e.outputBuffer&&(this.a=s&&e.outputBu
ffer instanceof Array?new
Uint8Array(e.outputBuffer):e.outputBuffer),"number"==typeof
e.outputIndex&&(this.b=e.outputIndex)),this.a||(this.a=new(s?Uint8Array:Array)
(32768))}s&&new
Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,265
7392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,
2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,41075807
53,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,41953
02755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3
524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,117226610
1,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,145462
1731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,148
3230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,
112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,21376567
63,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,18123
70925,453092731,2181625025,4111451223,1706088902,3
14042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,130353596
0,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,11310
14506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,13
42533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015
,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442
989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,194380
3523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,209
7651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,
1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,3979177
63,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068
828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,
829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,31380784
67,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,30503
60625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,394
3577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3
855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,217671854
1,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,240580
1727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,280
8555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,
2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,6158181
50,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,7119
28724,3020668471,3272380065,1510334235,755167117]),d.prototype.getParent=function(t
){return 2*((t-2)/4|0)},d.prototype.push=function(t,e){var
i,n,r,s=this.buffer;for(i=this.length,s[this.length++]=e,s[this.length+
+]=t;0<i&&(n=this.getParent(i),s[i]>s[n]);)r=s[i],s[i]=s[n],s[n]=r,r=s[i+1],s[i+1]=
s[n+1],s[n+1]=r,i=n;return this.length},d.prototype.pop=function(){var
t,e,i,n,r,s=this.buffer;for(e=s[0],t=s[1],this.length-
=2,s[0]=s[this.length],s[1]=s[this.length+1],r=0;!
((n=2*r+2)>=this.length)&&(n+2<this.length&&s[n+2]>s[n]&&(n+=2),s[n]>s[r]);)i=s[r],
s[r]=s[n],s[n]=i,i=s[r+1],s[r+1]=s[n+1],s[n+1]=i,r=n;return{index:t,value:e,length:
this.length}};var v,y=2,g={NONE:0,r:1,j:y,N:3},x=[];for(v=0;288>v;v++)switch(i)
{case 143>=v:x.push([v+48,8]);break;case 255>=v:x.push([v-144+400,9]);break;case
279>=v:x.push([v-256+0,7]);break;case 287>=v:x.push([v-
280+192,8]);break;default:t("invalid literal: "+v)}function b(t,e)
{this.length=t,this.G=e}function A(){var e=C;switch(i){case 3===e:return[257,e-
3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case
6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-
8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case
12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-
15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case
26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-
31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case
58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-
67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case
130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case
194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case
257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:t("invalid
length: "+e)}}p.prototype.n=function(){var n,r,a,l,h=this.input;switch(this.h){case
0:for(a=0,l=h.length;a<l;){var c,u,_,f=r=s?
h.subarray(a,a+65535):h.slice(a,a+65535),d=(a+=r.length)===l,m=e,p=e,v=this.a,g=thi
s.b;if(s){for(v=new Uint8Array(this.a.buffer);v.length<=g+f.length+5;)v=new
Uint8Array(v.length<<1);v.set(this.a)}if(c=d?1:0,v[g++]=0|
c,_=65536+~(u=f.length)&65535,v[g++]=255&u,v[g++]=u>>>8&255,v[g++]=255&_,v[g+
+]=_>>>8&255,s)v.set(f,g),g+=f.length,v=v.subarray(0,g);else{for(m=0,p=f.length;m<p
;++m)v[g++]=f[m];v.length=g}this.b=g,this.a=v}break;case 1:var b=new o(new
Uint8Array(this.a.buffer),this.b);b.d(1,1,i),b.d(1,2,i);var
A,C,S,T=E(this,h);for(A=0,C=T.length;A<C;A+
+)if(S=T[A],o.prototype.d.apply(b,x[S]),256<S)b.d(T[++A],T[++A],i),b.d(T[+
+A],5),b.d(T[++A],T[++A],i);else
if(256===S)break;this.a=b.finish(),this.b=this.a.length;break;case y:var
w,B,P,I,R,O,L,F,V,N,k,G,z,U,j,W=new o(new
Uint8Array(this.a),this.b),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=Arr
ay(19);for(w=y,W.d(1,1,i),W.d(w,2,i),B=E(this,h),L=D(O=M(this.L,15)),V=D(F=M(this.K
,7)),P=286;257<P&&0===O[P-1];P--);for(I=30;1<I&&0===F[I-1];I--);var q,Y,J,Z,K,Q,
$=P,tt=I,et=new(s?Uint32Array:Array)($+tt),it=new(s?Uint32Array:Array)
(316),nt=new(s?Uint8Array:Array)(19);for(q=Y=0;q<$;q++)et[Y++]=O[q];for(q=0;q<tt;q+
+)et[Y++]=F[q];if(!s)for(q=0,Z=nt.length;q<Z;+
+q)nt[q]=0;for(q=K=0,Z=et.length;q<Z;q+=Y){for(Y=1;q+Y<Z&&et[q+Y]===et[q];+
+Y);if(J=Y,0===et[q])if(3>J)for(;0<J--;)it[K++]=0,nt[0]++;else for(;0<J;)(Q=138>J?
J:138)>J-3&&Q<J&&(Q=J-3),10>=Q?(it[K++]=17,it[K++]=Q-3,nt[17]++):(it[K++]=18,it[K+
+]=Q-11,nt[18]++),J-=Q;else if(it[K++]=et[q],nt[et[q]]++,3>--J)for(;0<J--;)it[K+
+]=et[q],nt[et[q]]++;else for(;0<J;)(Q=6>J?J:6)>J-3&&Q<J&&(Q=J-3),it[K++]=16,it[K+
+]=Q-3,nt[16]++,J-=Q}for(n=s?it.subarray(0,K):it.slice(0,K),N=M(nt,7),U=0;19>U;U+
+)X[U]=N[H[U]];for(R=19;4<R&&0===X[R-1];R--);for(k=D(N),W.d(P-257,5,i),W.d(I-
1,5,i),W.d(R-4,4,i),U=0;U<R;U++)W.d(X[U],3,i);for(U=0,j=n.length;U<j;U+
+)if(G=n[U],W.d(k[G],N[G],i),16<=G){switch(U++,G){case 16:z=2;break;case
17:z=3;break;case 18:z=7;break;default:t("invalid code: "+G)}W.d(n[U],z,i)}var
rt,st,at,ot,lt,ht,ct,ut,_t=[L,O],ft=[V,F];for(lt=_t[0],ht=_t[1],ct=ft[0],ut=ft[1],r
t=0,st=B.length;rt<st;++rt)if(at=B[rt],W.d(lt[at],ht[at],i),256<at)W.d(B[++rt],B[+
+rt],i),ot=B[++rt],W.d(ct[ot],ut[ot],i),W.d(B[++rt],B[++rt],i);else
if(256===at)break;this.a=W.finish(),this.b=this.a.length;break;default:t("invalid
compression type")}return this.a};var C,S,T=[];for(C=3;258>=C;C+
+)S=A(),T[C]=S[2]<<24|S[1]<<16|S[0];var w=s?new Uint32Array(T):T;function E(n,r)
{function a(e,n){var r,s,a,o,l=e.G,h=[],c=0;switch(r=w[e.length],h[c+
+]=65535&r,h[c++]=r>>16&255,h[c++]=r>>24,i){case 1===l:s=[0,l-1,0];break;case
2===l:s=[1,l-2,0];break;case 3===l:s=[2,l-3,0];break;case 4===l:s=[3,l-
4,0];break;case 6>=l:s=[4,l-5,1];break;case 8>=l:s=[5,l-7,1];break;case
12>=l:s=[6,l-9,2];break;case 16>=l:s=[7,l-13,2];break;case 24>=l:s=[8,l-
17,3];break;case 32>=l:s=[9,l-25,3];break;case 48>=l:s=[10,l-33,4];break;case
64>=l:s=[11,l-49,4];break;case 96>=l:s=[12,l-65,5];break;case 128>=l:s=[13,l-
97,5];break;case 192>=l:s=[14,l-129,6];break;case 256>=l:s=[15,l-193,6];break;case
384>=l:s=[16,l-257,7];break;case 512>=l:s=[17,l-385,7];break;case 768>=l:s=[18,l-
513,8];break;case 1024>=l:s=[19,l-769,8];break;case 1536>=l:s=[20,l-
1025,9];break;case 2048>=l:s=[21,l-1537,9];break;case 3072>=l:s=[22,l-
2049,10];break;case 4096>=l:s=[23,l-3073,10];break;case 6144>=l:s=[24,l-
4097,11];break;case 8192>=l:s=[25,l-6145,11];break;case 12288>=l:s=[26,l-
8193,12];break;case 16384>=l:s=[27,l-12289,12];break;case 24576>=l:s=[28,l-
16385,13];break;case 32768>=l:s=[29,l-24577,13];break;default:t("invalid
distance")}for(r=s,h[c++]=r[0],h[c++]=r[1],h[c++]=r[2],a=0,o=h.length;a<o;++a)v[y+
+]=h[a];x[h[0]]++,A[h[3]]++,g=e.length+n-1,d=null}var o,l,h,c,u,_,f,d,m,p={},v=s?
new Uint16Array(2*r.length):[],y=0,g=0,x=new(s?Uint32Array:Array)(286),A=new(s?
Uint32Array:Array)(30),C=n.w;if(!s){for(h=0;285>=h;)x[h++]=0;for(h=0;29>=h;)A[h+
+]=0}for(x[256]=1,o=0,l=r.length;o<l;++o){for(h=u=0,c=3;h<c&&o+h!==l;++h)u=u<<8|
r[o+h];if(p[u]===e&&(p[u]=[]),_=p[u],!(0<g--)){for(;0<_.length&&32768<o-
_[0];)_.shift();if(o+3>=l){for(d&&a(d,-1),h=0,c=l-o;h<c;++h)m=r[o+h],v[y++]=m,+
+x[m];break}if(0<_.length){var
S=e,T=e,E=0,M=e,D=e,B=e,P=r.length,I=(D=0,_.length);t:for(;D<I;D++){if(S=_[I-D-
1],M=3,3<E){for(B=E;3<B;B--)if(r[S+B-1]!==r[o+B-1])continue
t;M=E}for(;258>M&&o+M<P&&r[S+M]===r[o+M];)++M;if(M>E&&(T=S,E=M),258===M)break}f=new
b(E,o-T),d?d.length<f.length?(m=r[o-1],v[y++]=m,++x[m],a(f,0)):a(d,-1):f.length<C?
d=f:a(f,0)}else d?a(d,-1):(m=r[o],v[y++]=m,++x[m])}_.push(o)}return v[y+
+]=256,x[256]++,n.L=x,n.K=A,s?v.subarray(0,y):v}function M(t,e){function i(t){var
e=C[t][S[t]];e===y?(i(t+1),i(t+1)):--b[e],++S[t]}var n,r,a,o,l,h=t.length,c=new
d(572),u=new(s?Uint8Array:Array)(h);if(!s)for(o=0;o<h;o++)u[o]=0;for(o=0;o<h;+
+o)0<t[o]&&c.push(o,t[o]);if(n=Array(c.length/2),r=new(s?Uint32Array:Array)
(c.length/2),1===n.length)return u[c.pop().index]=1,u;for(o=0,l=c.length/2;o<l;+
+o)n[o]=c.pop(),r[o]=n[o].value;var _,f,m,p,v,y=r.length,g=new(s?Uint16Array:Array)
(e),x=new(s?Uint8Array:Array)(e),b=new(s?Uint8Array:Array)
(y),A=Array(e),C=Array(e),S=Array(e),T=(1<<e)-y,w=1<<e-1;for(g[e-1]=y,f=0;f<e;+
+f)T<w?x[f]=0:(x[f]=1,T-=w),T<<=1,g[e-2-f]=(g[e-1-f]/2|
0)+y;for(g[0]=x[0],A[0]=Array(g[0]),C[0]=Array(g[0]),f=1;f<e;++f)g[f]>2*g[f-
1]+x[f]&&(g[f]=2*g[f-1]+x[f]),A[f]=Array(g[f]),C[f]=Array(g[f]);for(_=0;_<y;+
+_)b[_]=e;for(m=0;m<g[e-1];++m)A[e-1][m]=r[m],C[e-1][m]=m;for(_=0;_<e;+
+_)S[_]=0;for(1===x[e-1]&&(--b[0],++S[e-1]),f=e-2;0<=f;--f)
{for(p=_=0,v=S[f+1],m=0;m<g[f];m++)(p=A[f+1][v]+A[f+1][v+1])>r[_]?(A[f][m]=p,C[f]
[m]=y,v+=2):(A[f][m]=r[_],C[f][m]=_,+
+_);S[f]=0,1===x[f]&&i(f)}for(a=b,o=0,l=n.length;o<l;++o)u[n[o].index]=a[o];return
u}function D(e){var i,n,r,a,o=new(s?Uint16Array:Array)
(e.length),l=[],h=[],c=0;for(i=0,n=e.length;i<n;i++)l[e[i]]=1+(0|
l[e[i]]);for(i=1,n=16;i<=n;i++)h[i]=c,(c+=0|
l[i])>1<<i&&t("overcommitted"),c<<=1;for(65536>c&&t("undercommitted"),i=0,n=e.lengt
h;i<n;i++)for(c=h[e[i]],h[e[i]]+=1,r=o[i]=0,a=e[i];r<a;r++)o[i]=o[i]<<1|
1&c,c>>>=1;return o}function B(t,e){this.input=t,this.a=new(s?Uint8Array:Array)
(32768),this.h=P.j;var i,n={};for(i in!e&&(e={})||"number"!=typeof
e.compressionType||
(this.h=e.compressionType),e)n[i]=e[i];n.outputBuffer=this.a,this.z=new
p(this.input,n)}var P=g;function I(e,i)
{switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=s?new
Uint8Array(e):e,this.s=!1,this.m=O,this.B=!1,!i&&(i={})||
(i.index&&(this.c=i.index),i.bufferSize&&(this.l=i.bufferSize),i.bufferType&&(this.
m=i.bufferType),i.resize&&(this.B=i.resize)),this.m){case
R:this.b=32768,this.a=new(s?Uint8Array:Array)(32768+this.l+258);break;case
O:this.b=0,this.a=new(s?Uint8Array:Array)
(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid
inflate mode"))}}B.prototype.n=function(){var
e,i,n,r,o,l,h,c=0;switch(h=this.a,e=ct){case ct:i=Math.LOG2E*Math.log(32768)-
8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,h[c++]=n,e)
{case ct:switch(this.h){case P.NONE:o=0;break;case P.r:o=1;break;case
P.j:o=2;break;default:t(Error("unsupported compression
type"))}break;default:t(Error("invalid compression method"))}return r=o<<6|0,h[c+
+]=r|31-(256*n+r)%31,l=a(this.input),this.z.b=c,c=(h=this.z.n()).length,s&&((h=new
Uint8Array(h.buffer)).length<=c+4&&(this.a=new
Uint8Array(h.length+4),this.a.set(h),h=this.a),h=h.subarray(0,c+4)),h[c+
+]=l>>24&255,h[c++]=l>>16&255,h[c++]=l>>8&255,h[c+
+]=255&l,h},r("Zlib.Deflate",B),r("Zlib.Deflate.compress",(function(t,e){return new
B(t,e).n()})),r("Zlib.Deflate.CompressionType",P),r("Zlib.Deflate.CompressionType.N
ONE",P.NONE),r("Zlib.Deflate.CompressionType.FIXED",P.r),r("Zlib.Deflate.Compressio
nType.DYNAMIC",P.j);var R=0,O=1,L={D:R,C:O};I.prototype.p=function(){for(;!this.s;)
{var n=tt(this,3);switch(1&n&&(this.s=i),n>>>=1){case 0:var
r=this.input,a=this.c,o=this.a,l=this.b,h=e,c=e,u=e,_=o.length,f=e;switch(this.e=th
is.g=0,(h=r[a++])===e&&t(Error("invalid uncompressed block header: LEN (first
byte)")),c=h,(h=r[a++])===e&&t(Error("invalid uncompressed block header: LEN
(second byte)")),c|=h<<8,(h=r[a++])===e&&t(Error("invalid uncompressed block
header: NLEN (first byte)")),u=h,(h=r[a++])===e&&t(Error("invalid uncompressed
block header: NLEN (second byte)")),c===~(u|=h<<8)&&t(Error("invalid uncompressed
block header: length verify")),a+c>r.length&&t(Error("input buffer is
broken")),this.m){case R:for(;l+c>o.length;){if(c-=f=_-
l,s)o.set(r.subarray(a,a+f),l),l+=f,a+=f;else for(;f--;)o[l++]=r[a+
+];this.b=l,o=this.f(),l=this.b}break;case
O:for(;l+c>o.length;)o=this.f({v:2});break;default:t(Error("invalid inflate
mode"))}if(s)o.set(r.subarray(a,a+c),l),l+=c,a+=c;else for(;c--;)o[l++]=r[a+
+];this.c=a,this.b=l,this.a=o;break;case 1:this.o(K,$);break;case
2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var
F,V,N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=s?new
Uint16Array(N):N,G=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,1
15,131,163,195,227,258,258,258],z=s?new
Uint16Array(G):G,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],
j=s?new
Uint8Array(U):U,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,
1537,2049,3073,4097,6145,8193,12289,16385,24577],H=s?new
Uint16Array(W):W,X=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,1
3,13],q=s?new Uint8Array(X):X,Y=new(s?Uint8Array:Array)
(288);for(F=0,V=Y.length;F<V;++F)Y[F]=143>=F?8:255>=F?9:279>=F?7:8;var
J,Z,K=m(Y),Q=new(s?Uint8Array:Array)(30);for(J=0,Z=Q.length;J<Z;++J)Q[J]=5;var
$=m(Q);function tt(i,n){for(var r,s=i.g,a=i.e,o=i.input,l=i.c;a<n;)(r=o[l+
+])===e&&t(Error("input buffer is broken")),s|=r<<a,a+=8;return r=s&(1<<n)-
1,i.g=s>>>n,i.e=a-n,i.c=l,r}function et(i,n){for(var
r,s,a,o=i.g,l=i.e,h=i.input,c=i.c,u=n[0],_=n[1];l<_;)(r=h[c++])===e&&t(Error("input
buffer is broken")),o|=r<<l,l+=8;return a=(s=u[o&(1<<_)-1])>>>16,i.g=o>>a,i.e=l-
a,i.c=c,65535&s}function it(t){function e(t,e,i){var
n,r,s,a;for(a=0;a<t;)switch(n=et(this,e)){case 16:for(s=3+tt(this,2);s--;)i[a+
+]=r;break;case 17:for(s=3+tt(this,3);s--;)i[a++]=0;r=0;break;case
18:for(s=11+tt(this,7);s--;)i[a++]=0;r=0;break;default:r=i[a++]=n}return i}var
i,n,r,a,o=tt(t,5)+257,l=tt(t,5)+1,h=tt(t,4)+4,c=new(s?Uint8Array:Array)
(k.length);for(a=0;a<h;++a)c[k[a]]=tt(t,3);i=m(c),n=new(s?Uint8Array:Array)
(o),r=new(s?Uint8Array:Array)
(l),t.o(m(e.call(t,o,i,n)),m(e.call(t,l,i,r)))}function nt(e,i){var
n,r;switch(this.input=e,this.c=0,!i&&(i={})||
(i.index&&(this.c=i.index),i.verify&&(this.M=i.verify)),n=e[this.c++],r=e[this.c+
+],15&n){case ct:this.method=ct;break;default:t(Error("unsupported compression
method"))}0!=((n<<8)+r)%31&&t(Error("invalid fcheck flag:"+((n<<8)+r)
%31)),32&r&&t(Error("fdict flag is not supported")),this.A=new I(e,
{index:this.c,bufferSize:i.bufferSize,bufferType:i.bufferType,resize:i.resize})}I.p
rototype.o=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,s,a,o,l=i.length-
258;256!==(r=et(this,t));)if(256>r)n>=l&&(this.b=n,i=this.f(),n=this.b),i[n+
+]=r;else for(o=z[s=r-
257],0<j[s]&&(o+=tt(this,j[s])),r=et(this,e),a=H[r],0<q[r]&&(a+=tt(this,q[r])),n>=l
&&(this.b=n,i=this.f(),n=this.b);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-
=8,this.c--;this.b=n},I.prototype.I=function(t,e){var
i=this.a,n=this.b;this.u=t;for(var r,s,a,o,l=i.length;256!
==(r=et(this,t));)if(256>r)n>=l&&(l=(i=this.f()).length),i[n++]=r;else for(o=z[s=r-
257],0<j[s]&&(o+=tt(this,j[s])),r=et(this,e),a=H[r],0<q[r]&&(a+=tt(this,q[r])),n+o>
l&&(l=(i=this.f()).length);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-
=8,this.c--;this.b=n},I.prototype.f=function(){var t,e,i=new(s?Uint8Array:Array)
(this.b-32768),n=this.b-32768,r=this.a;if(s)i.set(r.subarray(32768,i.length));else
for(t=0,e=i.length;t<e;+
+t)i[t]=r[t+32768];if(this.k.push(i),this.q+=i.length,s)r.set(r.subarray(n,n+32768)
);else for(t=0;32768>t;++t)r[t]=r[n+t];return
this.b=32768,r},I.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|
0,a=this.input,o=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof
t.F&&(r+=t.F)),2>r?i=(n=(a.length-this.c)/this.u[2]/2*258|0)<o.length?
o.length+n:o.length<<1:i=o.length*r,s?(e=new
Uint8Array(i)).set(o):e=o,this.a=e},I.prototype.t=function(){var
t,e,i,n,r,a=0,o=this.a,l=this.k,h=new(s?Uint8Array:Array)(this.q+(this.b-
32768));if(0===l.length)return s?
this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(e=0,i=l.length;e<i;+
+e)for(n=0,r=(t=l[e]).length;n<r;++n)h[a++]=t[n];for(e=32768,i=this.b;e<i;++e)h[a+
+]=o[e];return this.k=[],this.buffer=h},I.prototype.H=function(){var
t,e=this.b;return s?this.B?(t=new
Uint8Array(e)).set(this.a.subarray(0,e)):t=this.a.subarray(0,e):
(this.a.length>e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=functio
n(){var e,i=this.input;return e=this.A.p(),this.c=this.A.c,this.M&&((i[this.c+
+]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==a(e)&&t(Error("invalid
adler-32
checksum"))),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",L),L.ADAPTIVE=L.C,
L.BLOCK=L.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p);s&&new
Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);s&&new
Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,
163,195,227,258,258,258]);s&&new
Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]);s&&new
Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2
049,3073,4097,6145,8193,12289,16385,24577]);s&&new
Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);v
ar rt,st,at=new(s?Uint8Array:Array)(288);for(rt=0,st=at.length;rt<st;+
+rt)at[rt]=143>=rt?8:255>=rt?9:279>=rt?7:8;m(at);var ot,lt,ht=new(s?
Uint8Array:Array)(30);for(ot=0,lt=ht.length;ot<lt;++ot)ht[ot]=5;m(ht);var
ct=8}).call(window);var
n=window.Zlib;n.Deflate=n.Deflate,n.Deflate.compress=n.Deflate.compress,n.Inflate=n
.Inflate,n.Inflate.BufferType=n.Inflate.BufferType,n.Inflate.prototype.decompress=n
.Inflate.prototype.decompress,e.exports=n}),{}],26:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n,r,s,a,o,l,h,c,u,_,f,d,m,p,v,y,g,x,b,A,C,S,T,w=(function(){function t(t,e){for(var
i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!
0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return
function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}})
(),E=P(t("../../renderer/enums")),M=P(t("../../renderer/scene/light")),D=t("../valu
e-types"),B=t("../vmath");function P(t){return t&&t.__esModule?t:
{default:t}}function I(t,e,i,n){i&&Object.defineProperty(t,e,
{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.in
itializer?i.initializer.call(n):void 0})}function R(t,e){if(!(t instanceof e))throw
new TypeError("Cannot call a class as a function")}function O(t,e){if(!t)throw new
ReferenceError("this hasn't been initialised - super() hasn't been called");return!
e||"object"!=typeof e&&"function"!=typeof e?t:e}function L(t,e){if("function"!
=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a
function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:
{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}function F(t,e,i,n,r){var s={};return
Object.keys(n).forEach((function(t){s[t]=n[t]})),s.enumerable=!!
s.enumerable,s.configurable=!!s.configurable,("value"in s||
s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce((function(i,n){return
n(t,e,i)||i}),s),r&&void 0!==s.initializer&&(s.value=s.initializer?
s.initializer.call(r):void 0,s.initializer=void 0),void
0===s.initializer&&(Object.defineProperty(t,e,s),s=null),s}var
V=t("../renderer/index"),N=t("../platform/CCEnum"),k=t("../components/CCComponent")
,G=t("../platform/CCClassDecorator"),z=G.ccclass,U=G.menu,j=G.inspector,W=G.propert
y,H=G.executeInEditMode,X=N({DIRECTIONAL:0,POINT:1,SPOT:2}),q=N({NONE:0,HARD:2}),Y=
(n=z("cc.Light"),r=U("i18n:MAIN_MENU.component.renderers/Light"),s=j("packages://in
spector/inspectors/comps/light.js"),a=W({type:X}),o=W({type:q}),n(l=r(l=H(l=s((T=S=
(function(t){function e(){R(this,e);var t=O(this,(e.__proto__||
Object.getPrototypeOf(e)).call(this));return

I(t,"_type",c,t),I(t,"_color",u,t),I(t,"_intensity",_,t),I(t,"_range",f,t),I(t,"_sp
otAngle",d,t),I(t,"_spotExp",m,t),I(t,"_shadowType",p,t),I(t,"_shadowResolution",v,
t),I(t,"_shadowDarkness",y,t),I(t,"_shadowMinDepth",g,t),I(t,"_shadowMaxDepth",x,t)
,I(t,"_shadowDepthScale",b,t),I(t,"_shadowFrustumSize",A,t),I(t,"_shadowBias",C,t),
t._light=new M.default,t}return L(e,k),w(e,[{key:"type",get:function(){return
this._type},set:function(t){this._type=t;var
e=E.default.LIGHT_DIRECTIONAL;this._type===X.POINT?
e=E.default.LIGHT_POINT:this._type===X.SPOT&&(e=E.default.LIGHT_SPOT),this._light.s
etType(e)}},{key:"color",get:function(){return this._color},set:function(t)
{this._color=t,this._light.setColor(t.r/255,t.g/255,t.b/255)}},
{key:"intensity",get:function(){return this._intensity},set:function(t)
{this._intensity=t,this._light.setIntensity(t)}},{key:"range",get:function(){return
this._range},set:function(t){this._range=t,this._light.setRange(t)}},
{key:"spotAngle",get:function(){return this._spotAngle},set:function(t)
{this._spotAngle=t,this._light.setSpotAngle((0,B.toRadian)(t))}},
{key:"spotExp",get:function(){return this._spotExp},set:function(t)
{this._spotExp=t,this._light.setSpotExp(t)}},{key:"shadowType",get:function()
{return this._shadowType},set:function(t){this._shadowType=t;var
e=E.default.SHADOW_NONE;t===q.HARD?
e=E.default.SHADOW_HARD:t===q.SOFT&&(e=E.default.SHADOW_SOFT),this._light.setShadow
Type(e)}},{key:"shadowResolution",get:function(){return
this._shadowResolution},set:function(t)
{this._shadowResolution=t,this._light.setShadowResolution(t)}},
{key:"shadowDarkness",get:function(){return this._shadowDarkness},set:function(t)
{this._shadowDarkness=t,this._light.setShadowDarkness(t)}},
{key:"shadowMinDepth",get:function(){return this._shadowMinDepth},set:function(t)
{this._shadowMinDepth=t,this._light.setShadowMinDepth(t)}},
{key:"shadowMaxDepth",get:function(){return this._shadowMaxDepth},set:function(t)
{this._shadowMaxDepth=t,this._light.setShadowMaxDepth(t)}},
{key:"shadowDepthScale",get:function(){return
this._shadowDepthScale},set:function(t)
{this._shadowDepthScale=t,this._light.setShadowDepthScale(t)}},
{key:"shadowFrustumSize",get:function(){return
this._shadowFrustumSize},set:function(t)
{this._shadowFrustumSize=t,this._light.setShadowFrustumSize(t)}}]),w(e,
[{key:"onLoad",value:function()
{this._light.setNode(this.node),this.type=this._type,this.color=this._color,this.in
tensity=this._intensity,this.range=this._range,this.spotAngle=this._spotAngle,this.
spotExp=this._spotExp,this.shadowType=this._shadowType,this.shadowResolution=this._
shadowResolution,this.shadowDarkness=this._shadowDarkness,this.shadowMaxDepth=this.
_shadowMaxDepth,this.shadowDepthScale=this._shadowDepthScale,this.shadowFrustumSize
=this._shadowFrustumSize,this.shadowBias=this._shadowBias}},
{key:"onEnable",value:function(){V.scene.addLight(this._light)}},
{key:"onDisable",value:function(){V.scene.removeLight(this._light)}}]),e})
(),S.Type=X,S.ShadowType=q,c=F((h=T).prototype,"_type",[W],{enumerable:!
0,initializer:function(){return X.DIRECTIONAL}}),u=F(h.prototype,"_color",[W],
{enumerable:!0,initializer:function(){return
D.Color.WHITE}}),_=F(h.prototype,"_intensity",[W],{enumerable:!
0,initializer:function(){return 1}}),f=F(h.prototype,"_range",[W],{enumerable:!
0,initializer:function(){return 1}}),d=F(h.prototype,"_spotAngle",[W],{enumerable:!
0,initializer:function(){return 60}}),m=F(h.prototype,"_spotExp",[W],{enumerable:!
0,initializer:function(){return 1}}),p=F(h.prototype,"_shadowType",[W],
{enumerable:!0,initializer:function(){return
q.NONE}}),v=F(h.prototype,"_shadowResolution",[W],{enumerable:!
0,initializer:function(){return 1024}}),y=F(h.prototype,"_shadowDarkness",[W],
{enumerable:!0,initializer:function()
{return.5}}),g=F(h.prototype,"_shadowMinDepth",[W],{enumerable:!
0,initializer:function(){return 1}}),x=F(h.prototype,"_shadowMaxDepth",[W],
{enumerable:!0,initializer:function(){return
4096}}),b=F(h.prototype,"_shadowDepthScale",[W],{enumerable:!
0,initializer:function(){return 250}}),A=F(h.prototype,"_shadowFrustumSize",[W],
{enumerable:!0,initializer:function(){return 1024}}),C=F(h.prototype,"_shadowBias",
[W],{enumerable:!0,initializer:function(){return 5e-4}}),F(h.prototype,"type",
[a],Object.getOwnPropertyDescriptor(h.prototype,"type"),h.prototype),F(h.prototype,
"color",
[W],Object.getOwnPropertyDescriptor(h.prototype,"color"),h.prototype),F(h.prototype
,"intensity",
[W],Object.getOwnPropertyDescriptor(h.prototype,"intensity"),h.prototype),F(h.proto
type,"range",
[W],Object.getOwnPropertyDescriptor(h.prototype,"range"),h.prototype),F(h.prototype
,"spotAngle",
[W],Object.getOwnPropertyDescriptor(h.prototype,"spotAngle"),h.prototype),F(h.proto
type,"spotExp",
[W],Object.getOwnPropertyDescriptor(h.prototype,"spotExp"),h.prototype),F(h.prototy
pe,"shadowType",
[o],Object.getOwnPropertyDescriptor(h.prototype,"shadowType"),h.prototype),F(h.prot
otype,"shadowResolution",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowResolution"),h.prototype),F(
h.prototype,"shadowDarkness",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowDarkness"),h.prototype),F(h.
prototype,"shadowMinDepth",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowMinDepth"),h.prototype),F(h.
prototype,"shadowMaxDepth",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowMaxDepth"),h.prototype),F(h.
prototype,"shadowDepthScale",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowDepthScale"),h.prototype),F(
h.prototype,"shadowFrustumSize",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowFrustumSize"),h.prototype),l
=h))||l)||l)||l)||l);i.default=Y,cc.Light=Y,e.exports=i.default}),
{"../../renderer/enums":343,"../../renderer/scene/light":371,"../components/CCCompo
nent":95,"../platform/CCClassDecorator":201,"../platform/CCEnum":202,"../renderer/i
ndex":243,"../value-types":304,"../vmath":316}],27:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.Model",extends:cc.Asset,ctor:function()
{this._rootNode=null},properties:{_nodes:{default:[]},_precomputeJointMatrix:!
1,nodes:{get:function(){return this._nodes}},rootNode:{get:function(){return
this._rootNode}},precomputeJointMatrix:{get:function(){return
this._precomputeJointMatrix}}},onLoad:function(){var
t=this._nodes;this._rootNode=t[0];for(var e=0;e<t.length;e++){var
i=t[e];i.position=cc.v3.apply(this,i.position),i.scale=cc.v3.apply(this,i.scale),i.
quat=cc.quat.apply(this,i.quat),i.uniqueBindPose&&(i.uniqueBindPose=cc.mat4.apply(t
his,i.uniqueBindPose));var n=i.bindpose;if(n)for(var r in
n)n[r]=cc.mat4.apply(this,n[r]);var s=i.children;if(s)for(var a=0;a<s.length;a+
+)s[a]=t[s[a]]}}});cc.Model=e.exports=n}),{}],28:[(function(t,e,i){"use strict";var
n=cc.vmath.quat,r=cc.quat(),s=cc.v3();cc.Rotate3DTo=cc.Class({name:"cc.Rotate3DTo",
extends:cc.ActionInterval,ctor:function(t,e,i,n)
{this._startQuat=cc.quat(),this._dstQuat=cc.quat(),void 0!
==e&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n)
{if(cc.ActionInterval.prototype.initWithDuration.call(this,t)){var
r=this._dstQuat;return e instanceof cc.Quat?r.set(e):(e instanceof cc.Vec3?
(i=e.y,n=e.z,e=e.x):(i=i||0,n=n||0),cc.vmath.quat.fromEuler(r,e,i,n)),!0}return!
1},clone:function(){var t=new cc.Rotate3DTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._dstQuat),t},startW
ithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startQuat.set(t.qua
t)},reverse:function(){cc.logID(1016)},update:function(t)
{t=this._computeEaseTime(t),this.target&&(n.slerp(r,this._startQuat,this._dstQuat,t
),this.target.setRotation(r))}}),cc.rotate3DTo=function(t,e,i,n){return new
cc.Rotate3DTo(t,e,i,n)},cc.Rotate3DBy=cc.Class({name:"cc.Rotate3DBy",extends:cc.Act
ionInterval,ctor:function(t,e,i,n)
{this._angle=cc.v3(),this._quat=cc.quat(),this._lastDt=0,void 0!
==e&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(e instanceof cc.Vec3?
(i=e.y,n=e.z,e=e.x):(i=i||0,n=n||0),cc.vmath.vec3.set(this._angle,e,i,n),!
0)},clone:function(){var t=new cc.Rotate3DBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._angle),t},startWit
hTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._quat.set(t.quat),th
is._lastDt=0},update:(function(){var t=Math.PI/180;return function(e)
{if(e=this._computeEaseTime(e),this.target){var i=this._angle,r=this._quat,s=e-
this._lastDt,a=i.x,o=i.y,l=i.z;a&&n.rotateX(r,r,a*t*s),o&&n.rotateY(r,r,o*t*s),l&&n
.rotateZ(r,r,l*t*s),this.target.setRotation(r),this._lastDt=e}}})
(),reverse:function(){var t=this._angle;s.x=-t.x,s.y=-t.y,s.z=-t.z;var e=new
cc.Rotate3DBy(this._duration,s);return
this._cloneDecoration(e),this._reverseEaseList(e),e}}),cc.rotate3DBy=function(t,e,i
,n){return new cc.Rotate3DBy(t,e,i,n)}}),{}],29:[(function(t,e,i){"use
strict";t("./polyfill-
3d"),t("./primitive"),t("./CCModel"),t("./skeleton/CCSkeleton"),t("./skeleton/CCSke
letonAnimationClip"),t("./actions"),t("./skeleton/CCSkeletonAnimation"),t("./skelet
on/CCSkinnedMeshRenderer"),t("./skeleton/skinned-mesh-
renderer"),t("./CCLightComponent")}),
{"./CCLightComponent":26,"./CCModel":27,"./actions":28,"./polyfill-
3d":30,"./primitive":35,"./skeleton/CCSkeleton":44,"./skeleton/CCSkeletonAnimation"
:45,"./skeleton/CCSkeletonAnimationClip":46,"./skeleton/CCSkinnedMeshRenderer":47,"
./skeleton/skinned-mesh-renderer":48}],30:[(function(t,e,i){"use strict";var
n=t("../vmath"),r=t("../CCNode"),s=r.EventType,a=r._LocalDirtyFlag,o=t("../renderer
/render-flow"),l=Math.PI/180,h=1,c=2;function u(){if(this._localMatDirty){var
t=this._matrix;if(n.mat4.fromRTS(t,this._quat,this._position,this._scale),this._ske
wX||this._skewY){var
e=t.m00,i=t.m01,r=t.m04,s=t.m05,a=Math.tan(this._skewX*l),o=Math.tan(this._skewY*l)
;a===1/0&&(a=99999999),o===1/0&&(o=99999999),t.m00=e+r*o,t.m01=i+s*o,t.m04=r+e*a,t.
m05=s+i*a}this._localMatDirty=0,this._worldMatDirty=!0}}function _()
{if(this._localMatDirty&&this._updateLocalMatrix(),this._parent){var
t=this._parent._worldMatrix;n.mat4.mul(this._worldMatrix,t,this._matrix)}else
n.mat4.copy(this._worldMatrix,this._matrix);this._worldMatDirty=!1}function
f(t,e,i){var n=void 0;void 0===e?(n=t.x,e=t.y,i=t.z||0):(n=t,i=i||0);var
r=this._position;r.x===n&&r.y===e&&r.z===i||
(r.x=n,r.y=e,r.z=i,this.setLocalDirty(a.POSITION),this._renderFlag|
=o.FLAG_WORLD_TRANSFORM,this._eventMask&h&&this.emit(s.POSITION_CHANGED))}var
d=cc.Node.prototype,m=d._updateLocalMatrix,p=d._calculWorldMatrix,v=d._upgrade_1x_t
o_2x,y=d._mulMat;d.setPosition=f,d.setScale=function(t,e,i){t&&"number"!=typeof t?
(e=t.y,i=t.z||1,t=t.x):void 0!==t&&void 0===e?(e=t,i=t):void
0===i&&(i=1),this._scale.x===t&&this._scale.y===e&&this._scale.z===i||
(this._scale.x=t,this._scale.y=e,this._scale.z=i,this.setLocalDirty(a.SCALE),this._
renderFlag|
=o.FLAG_TRANSFORM,this._eventMask&c&&this.emit(s.SCALE_CHANGED))},d._upgrade_1x_to_
2x=function()
{this._is3DNode&&this._update3DFunction(),v.call(this)},d._update3DFunction=functio
n(){this._is3DNode?
(this._updateLocalMatrix=u,this._calculWorldMatrix=_,this._mulMat=n.mat4.mul):
(this._updateLocalMatrix=m,this._calculWorldMatrix=p,this._mulMat=y),this._renderCo
mponent&&this._renderComponent._on3DNodeChanged&&this._renderComponent._on3DNodeCha
nged(),this._renderFlag|
=o.FLAG_TRANSFORM,this._localMatDirty=a.ALL},cc.js.getset(d,"position",d.getPositio
n,f,!1,!0),cc.js.getset(d,"is3DNode",(function(){return this._is3DNode}),
(function(t){this._is3DNode!
==t&&(this._is3DNode=t,this._update3DFunction())})),cc.js.getset(d,"scaleZ",
(function(){return this._scale.z}),(function(t){this._scale.z!
==t&&(this._scale.z=t,this.setLocalDirty(a.SCALE),this._renderFlag|
=o.FLAG_TRANSFORM,this._eventMask&c&&this.emit(s.SCALE_CHANGED))})),cc.js.getset(d,
"z",(function(){return this._position.z}),(function(t){var e=this._position;t!
==e.z&&(e.z=t,this.setLocalDirty(a.POSITION),this._renderFlag|
=o.FLAG_WORLD_TRANSFORM,this._eventMask&h&&this.emit(s.POSITION_CHANGED))})),cc.js.
getset(d,"eulerAngles",(function(){return this._quat.toEuler(cc.v3())}),
(function(t)
{this._quat.fromEuler(t),this.setLocalDirty(a.ROTATION),this._renderFlag|
=o.FLAG_TRANSFORM})),cc.js.getset(d,"quat",(function(){return
this._quat}),d.setRotation)}),{"../CCNode":52,"../renderer/render-
flow":244,"../vmath":316}],31:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:1,v=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},y=void
0!==v.widthSegments?v.widthSegments:1,g=void 0!==v.heightSegments?
v.heightSegments:1,x=void 0!==v.lengthSegments?v.lengthSegments:1,b=void 0!
==v.invWinding&&v.invWinding,A=.5*t,C=.5*e,S=.5*i,T=[n.vec3.set(h,-A,-
C,S),n.vec3.set(c,A,-C,S),n.vec3.set(u,A,C,S),n.vec3.set(_,-A,C,S),n.vec3.set(f,A,-
C,-S),n.vec3.set(d,-A,-C,-S),n.vec3.set(m,-A,C,-S),n.vec3.set(p,A,C,-
S)],w=[[2,3,1],[4,5,7],[7,6,2],[1,0,4],[1,4,2],[5,0,6]],E=[[0,0,1],[0,0,-1],
[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],M=[],D=[],B=[],P=[],I=n.vec3.create(-A,-C,-
S),R=n.vec3.create(A,C,S),O=Math.sqrt(A*A+C*C+S*S);function L(t,e,i){var r=void
0,h=void 0,c=void 0,u=void 0,_=M.length/3,f=w[t],d=E[t];for(u=0;u<=i;u+
+)for(c=0;c<=e;c+
+)if(r=c/e,h=u/i,n.vec3.lerp(s,T[f[0]],T[f[1]],r),n.vec3.lerp(a,T[f[0]],T[f[2]],h),
n.vec3.sub(o,a,T[f[0]]),n.vec3.add(l,s,o),M.push(l.x,l.y,l.z),D.push(d[0],d[1],d[2]
),B.push(r,h),c<e&&u<i){var m=e+1,p=c+u*m,v=c+(u+1)*m,y=c+1+(u+1)*m,g=c+1+u*m;b?
(P.push(_+p,_+v,_+g),P.push(_+g,_+v,_+y)):
(P.push(_+p,_+g,_+v),P.push(_+v,_+g,_+y))}}return
L(0,y,g),L(4,x,g),L(1,y,g),L(5,x,g),L(3,y,x),L(2,y,x),new
r.default(M,D,B,P,I,R,O)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0),o=n.vec3.create(0,0,0),l=n.vec3.creat
e(0,0,0),h=n.vec3.create(0,0,0),c=n.vec3.create(0,0,0),u=n.vec3.create(0,0,0),_=n.v
ec3.create(0,0,0),f=n.vec3.create(0,0,0),d=n.vec3.create(0,0,0),m=n.vec3.create(0,0
,0),p=n.vec3.create(0,0,0);e.exports=i.default}),{"../../vmath":316,"./vertex-
data":42}],32:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0}),i.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.5,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:2,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=i-t-
e,h=o.sides||32,c=o.heightSegments||
32,u=e/i,_=l/i,f=t/i,d=Math.floor(c*u),m=Math.floor(c*f),p=Math.floor(c*_),v=l+e-
i/2,y=e-i/2,g=e-i/2,x=o.arc||
2*Math.PI,b=[],A=[],C=[],S=[],T=Math.max(t,e),w=n.vec3.create(-T,-i/2,-
T),E=n.vec3.create(T,i/2,T),M=i/2,D=0,B=[];return (function(){for(var t=0;t<=d;+
+t)for(var i=t*Math.PI/d/2,n=Math.sin(i),r=-Math.cos(i),s=0;s<=h;++s){var
a=2*s*Math.PI/h-
Math.PI/2,o=Math.sin(a),l=Math.cos(a),u=o*n,_=r,f=l*n,m=s/h,p=t/c;if(b.push(u*e,_*e
+g,f*e),A.push(u,_,f),C.push(m,p),t<d&&s<h){var
v=h+1,y=v*t+s,x=v*(t+1)+s,T=v*(t+1)+s+1,w=v*t+s+1;S.push(y,w,x),S.push(w,T,x)}+
+D}})(),(function(){for(var i=(t-e)/l,r=0;r<=p;r++){for(var o=[],c=r/p,f=c*(t-e)
+e,d=0;d<=h;++d){var m=d/h,v=c*_+u,g=m*x-
x/4,T=Math.sin(g),w=Math.cos(g);b.push(f*T),b.push(c*l+y),b.push(f*w),n.vec3.normal
ize(s,n.vec3.set(a,T,-
i,w)),A.push(s.x),A.push(s.y),A.push(s.z),C.push(m,v),o.push(D),+
+D}B.push(o)}for(var E=0;E<p;++E)for(var M=0;M<h;++M){var P=B[E][M],I=B[E+1]
[M],R=B[E+1][M+1],O=B[E]
[M+1];S.push(P),S.push(O),S.push(I),S.push(O),S.push(R),S.push(I)}})(),(function()
{for(var e=0;e<=m;++e)for(var i=e*Math.PI/m/2+Math.PI/2,n=Math.sin(i),r=-
Math.cos(i),s=0;s<=h;++s){var a=2*s*Math.PI/h-
Math.PI/2,o=Math.sin(a),l=Math.cos(a),u=o*n,_=r,d=l*n,y=s/h,g=e/c+(1-
f);if(b.push(u*t,_*t+v,d*t),A.push(u,_,d),C.push(y,g),e<m&&s<h){var
x=h+1,T=x*e+s+B[p][h]+1,w=x*(e+1)+s+B[p][h]+1,E=x*(e+1)+s+1+B[p][h]
+1,M=x*e+s+1+B[p][h]+1;S.push(T,M,w),S.push(M,E,w)}}})(),new
r.default(b,A,C,S,w,E,M)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0);e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],33:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{};return(0,n.default)(0,t,e,i)};var n=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./cylinder"));e.exports=i.default}),{"./cylinder":34}],34:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.5,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:2,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:
{},l=.5*i,h=o.radialSegments||32,c=o.heightSegments||1,u=void 0===o.capped||
o.capped,_=o.arc||2*Math.PI,f=0;u||(t>0&&f++,e>0&&f++);var
d=(h+1)*(c+1);u&&(d+=(h+1)*f+h*f);var m=h*c*2*3;u&&(m+=h*f*3);var p=new
Array(m),v=new Array(3*d),y=new Array(3*d),g=new
Array(2*d),x=Math.max(t,e),b=n.vec3.create(-x,-l,-
x),A=n.vec3.create(x,l,x),C=Math.sqrt(x*x+l*l),S=0,T=0;return (function(){for(var
r=[],o=t-e,u=o*o/i*Math.sign(o),f=0;f<=c;f++){for(var d=[],m=f/c,x=m*o+e,b=0;b<=h;+
+b){var A=b/h,C=A*_,w=Math.sin(C),E=Math.cos(C);v[3*S]=x*w,v[3*S+1]=m*i-
l,v[3*S+2]=x*E,n.vec3.normalize(s,n.vec3.set(a,w,-
u,E)),y[3*S]=s.x,y[3*S+1]=s.y,y[3*S+2]=s.z,g[2*S]=2*(1-A)%1,g[2*S+1]=m,d.push(S),+
+S}r.push(d)}for(var M=0;M<c;++M)for(var D=0;D<h;++D){var B=r[M][D],P=r[M+1]
[D],I=r[M+1][D+1],R=r[M][D+1];p[T]=B,p[++T]=R,p[++T]=P,p[++T]=R,p[++T]=I,p[++T]=P,+
+T}})(),u&&(e>0&&w(!1),t>0&&w(!0)),new r.default(v,y,g,p,b,A,C);function w(i){var
n,r,s=i?t:e,a=i?1:-1;n=S;for(var o=1;o<=h;+
+o)v[3*S]=0,v[3*S+1]=l*a,v[3*S+2]=0,y[3*S]=0,y[3*S+1]=a,y[3*S+2]=0,g[2*S]=.5,g[2*S+
1]=.5,++S;r=S;for(var c=0;c<=h;++c){var
u=c/h*_,f=Math.cos(u),d=Math.sin(u);v[3*S]=s*d,v[3*S+1]=l*a,v[3*S+2]=s*f,y[3*S]=0,y
[3*S+1]=a,y[3*S+2]=0,g[2*S]=.5-.5*d*a,g[2*S+1]=.5+.5*f,++S}for(var m=0;m<h;++m){var
x=n+m,b=r+m;i?(p[T]=b+1,p[++T]=x,p[++T]=b,++T):(p[T]=x,p[++T]=b+1,p[++T]=b,+
+T)}}};var n=t("../../vmath"),r=(function(t){return t&&t.__esModule?t:{default:t}})
(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0);e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],35:[(function(t,e,i){"use strict";var
n=f(t("./utils")),r=f(t("./box")),s=f(t("./cone")),a=f(t("./cylinder")),o=f(t("./pl
ane")),l=f(t("./quad")),h=f(t("./sphere")),c=f(t("./torus")),u=f(t("./capsule")),_=
t("./polyhedron");function f(t){return t&&t.__esModule?t:
{default:t}}cc.primitive=Object.assign({box:r.default,cone:s.default,cylinder:a.def
ault,plane:o.default,quad:l.default,sphere:h.default,torus:c.default,capsule:u.defa
ult,polyhedron:_.polyhedron,PolyhedronType:_.PolyhedronType},n.default)}),
{"./box":31,"./capsule":32,"./cone":33,"./cylinder":34,"./plane":36,"./polyhedron":
37,"./quad":38,"./sphere":39,"./torus":40,"./utils":41}],36:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},_=void
0!==i.widthSegments?i.widthSegments:10,f=void 0!==i.lengthSegments?
i.lengthSegments:10,d=.5*t,m=.5*e,p=[],v=[],y=[],g=[],x=n.vec3.create(-d,0,-
m),b=n.vec3.create(d,0,m),A=Math.sqrt(t*t+e*e);n.vec3.set(h,-
d,0,m),n.vec3.set(c,d,0,m),n.vec3.set(u,-d,0,-m);for(var C=0;C<=f;C++)for(var
S=0;S<=_;S++){var
T=S/_,w=C/f;if(n.vec3.lerp(s,h,c,T),n.vec3.lerp(a,h,u,w),n.vec3.sub(o,a,h),n.vec3.a
dd(l,s,o),p.push(l.x,l.y,l.z),v.push(0,1,0),y.push(T,w),S<_&&C<f){var
E=_+1,M=S+C*E,D=S+(C+1)*E,B=S+1+
(C+1)*E,P=S+1+C*E;g.push(M,P,D),g.push(P,B,D)}}return new
r.default(p,v,y,g,x,b,A)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0),o=n.vec3.create(0,0,0),l=n.vec3.creat
e(0,0,0),h=n.vec3.create(0,0,0),c=n.vec3.create(0,0,0),u=n.vec3.create(0,0,0);e.exp
orts=i.default}),{"../../vmath":316,"./vertex-data":42}],37:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.polyhedron=i.PolyhedronType=void 0;var
n=t("./utils"),r=t("../../vmath"),s=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./vertex-
data"));i.PolyhedronType=cc.Enum({Tetrahedron:0,Octahedron:1,Dodecahedron:2,Icosahe
dron:3,Rhombicuboctahedron:4,TriangularPrism:5,PentagonalPrism:6,HexagonalPrism:7,S
quarePyramid:8,PentagonalPyramid:9,TriangularDipyramid:10,PentagonalDipyramid:11,El
ongatedSquareDipyramid:12,ElongatedPentagonalDipyramid:13,ElongatedPentagonalCupola
:14});var a=[];a[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],
[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],
[0,2,3],[0,3,1],[1,3,2]]},a[1]={vertex:[[0,0,1.414214],[1.414214,0,0],
[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],
[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},a[2]={vertex:
[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],
[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],
[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],
[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],
[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],
[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],
[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],
[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],
[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],
[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},a[3]={vertex:[[0,0,1.175571],
[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],
[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],
[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],
[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],
[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],
[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},a[4]={vertex:
[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],
[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],
[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],
[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],
[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],
[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],
[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],
[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],
[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],
[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],
[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],
[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],
[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],
[16,19,23,22],[18,22,23,21]]},a[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],
[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],
[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],
[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},a[6]={vertex:[[0,0,1.159953],
[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],
[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-
1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],
[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],
[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},a[7]={vertex:
[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],
[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],
[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],
[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],
[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:
[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],
[2,4,8,11,10,6]]},a[8]={vertex:[[-.729665,.670121,.319155],
[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],
[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],
[4,1,0,3]]},a[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],
[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],
[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],
[0,3,5,4,1]]},a[10]={vertex:[[-.610389,.243975,.531213],
[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],
[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],
[2,4,1]]},a[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],
[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],
[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],
[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},a[12]={vertex:
[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],
[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],
[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],
[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],
[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],
[4,9,6,1]]},a[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],
[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],
[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],
[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],
[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],
[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],
[2,4,1,0],[4,10,7,1]]},a[14]={vertex:[[-.93465,.300459,-.271185],
[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],
[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],
[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],
[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],
[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],
[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],
[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],
[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],
[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],
[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],
[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],
[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],
[22,17,11,5,4,8,14,19,23,24]]};i.polyhedron=function(t){var
e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{};t=t&&(t<0||t>=a.length)?0:t||0;for(var o=i.sizeX||e,l=i.sizeY||e,h=i.sizeZ||
e,c=a[t],u=c.face.length,_=[],f=[],d=[],m=[],p=r.vec3.create(1/0,1/0,1/0),v=r.vec3.
create(-1/0,-1/0,-1/0),y=0;y<c.vertex.length;y++){var g=c.vertex[y]
[0]*o,x=c.vertex[y][1]*l,b=c.vertex[y]
[2]*h;p.x=Math.min(p.x,g),p.y=Math.min(p.y,x),p.z=Math.min(p.z,b),v.x=Math.max(v.x,
g),v.y=Math.max(v.y,x),v.z=Math.max(v.z,b),_.push(g,x,b),m.push(0,0)}for(var
A=0;A<u;A++)for(var C=0;C<c.face[A].length-2;C++)f.push(c.face[A][0],c.face[A]
[C+2],c.face[A][C+1]);(0,n.calcNormals)(_,f,d);var S=Math.sqrt(Math.pow(v.x-
p.x,2),Math.pow(v.y-p.y,2),Math.pow(v.z-p.z,2));return new
s.default(_,d,m,f,p,v,S)}}),{"../../vmath":316,"./utils":41,"./vertex-
data":42}],38:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0}),i.default=function(){return new r.default(s,l,a,o,h,c,u)};var
n=t("../../vmath"),r=(function(t){return t&&t.__esModule?t:{default:t}})
(t("./vertex-data"));var
s=[-.5,-.5,0,-.5,.5,0,.5,.5,0,.5,-.5,0],a=[0,0,1,0,0,1,0,0,1,0,0,1],o=[0,0,0,1,1,1,
1,0],l=[0,3,1,3,2,1],h=n.vec3.create(-.5,-.5,0),c=n.vec3.create(.5,.5,0),u=Math.sqr
t(.5);e.exports=i.default}),{"../../vmath":316,"./vertex-data":42}],39:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void
0!==e.segments?e.segments:32,s=[],a=[],o=[],l=[],h=n.vec3.create(-t,-t,-
t),c=n.vec3.create(t,t,t),u=t,_=0;_<=i;++_)for(var f=_*Math.PI/i,d=Math.sin(f),m=-
Math.cos(f),p=0;p<=i;++p){var v=2*p*Math.PI/i-
Math.PI/2,y=Math.sin(v)*d,g=m,x=Math.cos(v)*d,b=p/i,A=_/i;if(s.push(y*t,g*t,x*t),a.
push(y,g,x),o.push(b,A),_<i&&p<i){var
C=i+1,S=C*_+p,T=C*(_+1)+p,w=C*(_+1)+p+1,E=C*_+p+1;l.push(S,E,T),l.push(E,w,T)}}retu
rn new r.default(s,l,a,o,h,c,u)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],40:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function()
{for(var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.4,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{},s=i.radialSegments||32,a=i.tubularSegments||32,o=i.arc||
2*Math.PI,l=[],h=[],c=[],u=[],_=n.vec3.create(-t-e,-e,-t-
e),f=n.vec3.create(t+e,e,t+e),d=t+e,m=0;m<=s;m++)for(var
p=0;p<=a;p++){var
v=p/a,y=m/s,g=v*o,x=y*Math.PI*2,b=(t+e*Math.cos(x))*Math.sin(g),A=e*Math.sin(x),C=(
t+e*Math.cos(x))*Math.cos(g),S=Math.sin(g)*Math.cos(x),T=Math.sin(x),w=Math.cos(g)*
Math.cos(x);if(l.push(b,A,C),h.push(S,T,w),c.push(v,y),p<a&&m<s){var
E=a+1,M=E*m+p,D=E*(m+1)+p,B=E*(m+1)+p+1,P=E*m+p+1;u.push(M,P,D),u.push(P,B,D)}}retu
rn new r.default(l,h,c,u,_,f,d)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],41:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.wireframe=function(t)
{for(var e=[[0,1],[1,2],[2,0]],i=[],n={},r=0;r<t.length;r+=3)for(var s=0;s<3;++s)
{var a=t[r+e[s][0]],o=t[r+e[s][1]],l=a>o?o<<16|a:a<<16|o;void
0===n[l]&&(n[l]=0,i.push(a,o))}return i},i.invWinding=function(t){for(var
e=[],i=0;i<t.length;i+=3)e.push(t[i],t[i+2],t[i+1]);return
e},i.toWavefrontOBJ=function(t){for(var e=arguments.length>1&&void 0!
==arguments[1]?
arguments[1]:1,i=t.positions,n=t.uvs,r=t.normals,s=t.indices,a=function(t){return
s[t]+1+"/"+(s[t]+1)+"/"+(s[t]+1)},o="",l=0;l<i.length;l+=3)o+="v "+i[l]*e+"
"+i[l+1]*e+" "+i[l+2]*e+"\n";for(var h=0;h<n.length;h+=2)o+="vt "+n[h]+"
"+n[h+1]+"\n";for(var c=0;c<r.length;c+=3)o+="vn "+r[c]+" "+r[c+1]+"
"+r[c+2]+"\n";for(var u=0;u<s.length;u+=3)o+="f "+a(u)+" "+a(u+1)+"
"+a(u+2)+"\n";return o},i.normals=function(t,e){for(var i=arguments.length>2&&void
0!==arguments[2]?arguments[2]:1,n=new Array(2*t.length),r=0;r<t.length/3;++r){var
s=3*r,a=6*r;n[a+0]=t[s+0],n[a+1]=t[s+1],n[a+2]=t[s+2],n[a+3]=t[s+0]+e[s+0]*i,n[a+4]
=t[s+1]+e[s+1]*i,n[a+5]=t[s+2]+e[s+2]*i}return n},i.calcNormals=function(t,e,i)
{for(var s=0,a=(i=i||new Array(t.length)).length;s<a;s++)i[s]=0;for(var o=void
0,l=void 0,h=void
0,c=cc.v3(),u=cc.v3(),_=cc.v3(),f=cc.v3(),d=cc.v3(),m=0,p=e.length;m<p;m+=3)o=3*e[m
+0],l=3*e[m+1],h=3*e[m+2],r(c,t,o),r(u,t,l),r(_,t,h),n.vec3.sub(f,_,u),n.vec3.sub(d
,c,u),n.vec3.cross(f,f,d),i[o]+=f.x,i[o+1]+=f.y,i[o+2]+=f.z,i[l]
+=f.x,i[l+1]+=f.y,i[l+2]+=f.z,i[h]+=f.x,i[h+1]+=f.y,i[h+2]+=f.z;for(var
v=cc.v3(),y=0,g=i.length;y<g;y+=3)v.x=i[y],v.y=i[y+1],v.z=i[y+2],v.normalizeSelf(),
i[y]=v.x,i[y+1]=v.y,i[y+2]=v.z;return i};var n=t("../../vmath");function r(t,e,i)
{t.x=e[i],t.y=e[i+1],t.z=e[i+2]}}),{"../../vmath":316}],42:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(t,e,i,n,r,s,a)
{this.positions=t,this.normals=e,this.uvs=i,this.indices=n,this.minPos=r,this.maxPo
s=s,this.boundingRadius=a},e.exports=i.default}),{}],43:[(function(t,e,i){"use
strict";var n=t("../../../animation/animation-
curves"),r=n.DynamicAnimCurve,s=n.quickFindIndex,a=cc.Class({name:"cc.JointMatrixCu
rve",extends:r,_findFrameIndex:s,sample:function(t,e){var
i=this.ratios,n=this._findFrameIndex(i,e);n<-1&&(n=~n-1);for(var
r=this.pairs,s=0;s<r.length;s++){var
a=r[s];a.target._jointMatrix=a.values[n]}}});e.exports=a}),
{"../../../animation/animation-curves":11}],44:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Skeleton",extends:cc.Asset,ctor:function()
{this._bindposes=[],this._uniqueBindPoses=[],this._jointPaths=[]},properties:
{_model:cc.Model,_jointIndices:[],_skinIndex:-1,jointPaths:{get:function(){return
this._jointPaths}},bindposes:{get:function(){return
this._bindposes}},uniqueBindPoses:{get:function(){return
this._uniqueBindPoses}},model:{get:function(){return
this._model}}},onLoad:function(){for(var
t=this._model.nodes,e=this._jointIndices,i=this._jointPaths,n=this._bindposes,r=thi
s._uniqueBindPoses,s=0;s<e.length;s++){var a=t[e[s]];i[s]=a.path,a.uniqueBindPose?
n[s]=r[s]=a.uniqueBindPose:n[s]=a.bindpose[this._skinIndex]}}});cc.Skeleton=e.expor
ts=n}),{}],45:[(function(t,e,i){"use strict";var
n=t("../../components/CCAnimation"),r=t("../CCModel"),s=t("./CCSkeletonAnimationCli
p"),a=cc.Class({name:"cc.SkeletonAnimation",extends:n,editor:!1,properties:{_model:
{default:null,type:r},_defaultClip:{override:!0,default:null,type:s},_clips:
{override:!0,default:[],type:[s],visible:!0},defaultClip:{override:!
0,get:function(){return this._defaultClip},set:function(t)
{this._defaultClip=t},type:s},model:{get:function(){return
this._model},set:function(t)
{this._model=t,this._updateClipModel()},type:r}},__preload:function()
{this._updateClipModel()},_updateClipModel:function()
{this._defaultClip&&(this._defaultClip._model=this._model);for(var
t=this._clips,e=0;e<t.length;e++)t[e]._model=this._model},addClip:function(t,e)
{return t._model=this._model,n.prototype.addClip.call(this,t,e)},searchClips:!
1});cc.SkeletonAnimation=e.exports=a}),
{"../../components/CCAnimation":90,"../CCModel":27,"./CCSkeletonAnimationClip":46,"
fire-path":void 0}],46:[(function(t,e,i){"use strict";var n=(function(t){return
t&&t.__esModule?t:{default:t}})(t("../../vmath/mat4"));var
r=t("../../../animation/animation-clip"),s=t("./CCJointMatrixCurve");function a(t)
{var e=new Float32Array(16);return
e[0]=t.m00,e[1]=t.m01,e[2]=t.m02,e[3]=t.m03,e[4]=t.m04,e[5]=t.m05,e[6]=t.m06,e[7]=t
.m07,e[8]=t.m08,e[9]=t.m09,e[10]=t.m10,e[11]=t.m11,e[12]=t.m12,e[13]=t.m13,e[14]=t.
m14,e[15]=t.m15,e}var
o=cc.Class({name:"cc.SkeletonAnimationClip",extends:r,properties:{_nativeAsset:
{override:!0,get:function(){return this._buffer},set:function(t){var
e=ArrayBuffer.isView(t)?t.buffer:t;this._buffer=new Float32Array(e||
t,0,e.byteLength/4)}},description:{default:null,type:Object},curveData:{visible:!
1,override:!0,get:function(){return this._curveData||{}},set:function()
{}}},_init:function(){return this._curveData?this._curveData:
(this._curveData={},this._generateCommonCurve(),this._model.precomputeJointMatrix&&
this._generateJointMatrixCurve(),this._curveData)},_generateCommonCurve:function()
{var t=this._buffer,e=this.description,i=0;function n(){return t[i+
+]}this._curveData.paths||(this._curveData.paths={});var
r=this._curveData.paths;for(var s in e){var a=e[s],o={};for(var l in
r[s]={props:o},a){var h=[],c=a[l].frameCount;i=a[l].offset;for(var u=0;u<c;u++){var
_=n(),f=void 0;"position"===l||"scale"===l?
f=cc.v3(n(),n(),n()):"quat"===l&&(f=cc.quat(n(),n(),n(),n())),h.push({frame:_,value
:f})}o[l]=h}}},_generateJointMatrixCurve:function(){var
t=this._model.rootNode,e=this._curveData.paths,i={ratios:[],jointMatrixMap:
{}},r=i.jointMatrixMap;function s(i,o,l){var h=void 0;if(i!==t){var
c=e[i.path].props;for(var u in c)for(var _=c[u],f=0;f<_.length;f++){var
d=_[f];if(Math.abs(d.frame-o)<1e-4){i[u].set(d.value);break}if(d.frame>o){var
m=_[f-1],p=(o-m.frame)/(d.frame-
m.frame);m.value.lerp(d.value,p,i[u]);break}}h=n.default.create(),n.default.fromRTS
(h,i.quat,i.position,i.scale),l&&n.default.mul(h,l,h),c._jointMatrix||
(c._jointMatrix=[]);var v=void
0;i.uniqueBindPose&&(v=n.default.create(),n.default.mul(v,h,i.uniqueBindPose)),r[i.
path]||(r[i.path]=[]),v?r[i.path].push(a(v)):r[i.path].push(h)}var
y=i.children;for(var g in y){s(y[g],o,h)}}for(var
o=0,l=this.duration,h=1/this.sample;o<l;)i.ratios.push(o/l),s(t,o),o+=h;this._curve
Data=i},_createJointMatrixCurve:function(t,e){var i=new
s;i.ratios=this.curveData.ratios,i.pairs=[];var
n=this.curveData.jointMatrixMap;for(var r in n){var
a=cc.find(r,e);a&&i.pairs.push({target:a,values:n[r]})}return[i]},createCurves:func
tion(t,e){return this._model?(this._init(),this._model.precomputeJointMatrix?
this._createJointMatrixCurve(t,e):r.prototype.createCurves.call(this,t,e)):
(cc.warn("Skeleton Animation Clip ["+this.name+"] Can not find model"),
[])}});cc.SkeletonAnimationClip=e.exports=o}),{"../../../animation/animation-
clip":10,"../../vmath/mat4":320,"./CCJointMatrixCurve":43}],47:[(function(t,e,i)
{"use strict";var
n=t("./CCSkeleton"),r=t("../../mesh/CCMeshRenderer"),s=t("../../renderer/render-
flow"),a=cc.vmath.mat4,o=a.create(),l=new
cc.Node,h=cc.Class({name:"cc.SkinnedMeshRenderer",extends:r,editor:!
1,ctor:function()
{this._jointsData=null,this._jointsTexture=null,this._joints=[]},properties:
{_skeleton:n,_rootBone:cc.Node,skeleton:{get:function(){return
this._skeleton},set:function(t)
{this._skeleton=t,this._init(),this._activateMaterial(!0)},type:n},rootBone:
{get:function(){return this._rootBone},set:function(t)
{this._rootBone=t,this._init()},type:cc.Node}},_activateMaterial:function(t)
{this._jointsData?this._super(t):this.disableRender()},__preload:function()
{this._init()},_init:function()
{this._model=this._skeleton&&this._skeleton.model,this._initJoints(),this._initJoin
tsTexture()},_calcWorldMatrixToRoot:function(t){var e=t._worldMatrixToRoot;if(!e)
{t._worldMatrixToRoot=e=cc.mat4(),t.getLocalMatrix(e);var i=t.parent;i!
==this.rootBone&&(i._worldMatrixToRoot||
this._calcWorldMatrixToRoot(i),a.mul(e,i._worldMatrixToRoot,e))}},_initJoints:funct
ion(){var t=this._joints;if(t.length=0,this.skeleton&&this.rootBone){for(var
e=this._useJointMatrix(),i=this.skeleton.jointPaths,n=this.rootBone,r=0;r<i.length;
r++){var l=cc.find(i[r],n);l||cc.warn("Can not find joint in root bone [%s] with
path
[%s]",n.name,i[r]),e&&(l._renderFlag&=~s.FLAG_CHILDREN,this._calcWorldMatrixToRoot(
l)),t.push(l)}if(e)for(var h=this.skeleton.uniqueBindPoses,c=0;c<i.length;c++){var
u=t[c];h[c]?
(a.mul(o,u._worldMatrixToRoot,h[c]),u._jointMatrix=a.array([],o)):u._jointMatrix=u.
_worldMatrixToRoot}}},_initJointsTexture:function(){if(this._skeleton){var
t=this._joints.length,e=this._customProperties,i=!!
cc.sys.glExtension("OES_texture_float");if(i){var n=void 0;n=t>256?64:t>64?32:t>16?
16:8,this._jointsData=new Float32Array(n*n*4);var r=this._jointsTexture||new
cc.Texture2D;r.initWithData(this._jointsData,cc.Texture2D.PixelFormat.RGBA32F,n,n),
this._jointsTexture=r,e.setProperty("_jointsTexture",r.getImpl()),e.setProperty("_j
ointsTextureSize",this._jointsTexture.width)}else this._jointsData=new
Float32Array(16*t),e.define("_JOINT_MATRICES_SIZE",t),e.setProperty("_jointMatrices
",this._jointsData);e.define("_USE_SKINNING",!
0),e.define("_USE_JOINTS_TEXTRUE",i)}},_setJointsDataWithArray:function(t,e)
{this._jointsData.set(e,16*t)},_setJointsDataWithMatrix:function(t,e){var

i=this._jointsData;i[16*t+0]=e.m00,i[16*t+1]=e.m01,i[16*t+2]=e.m02,i[16*t+3]=e.m03,
i[16*t+4]=e.m04,i[16*t+5]=e.m05,i[16*t+6]=e.m06,i[16*t+7]=e.m07,i[16*t+8]=e.m08,i[1
6*t+9]=e.m09,i[16*t+10]=e.m10,i[16*t+11]=e.m11,i[16*t+12]=e.m12,i[16*t+13]=e.m13,i[
16*t+14]=e.m14,i[16*t+15]=e.m15},_commitJointsData:function()
{this._jointsTexture&&this._jointsTexture.update({image:this._jointsData})},_useJoi
ntMatrix:function(){return
this._model&&this._model.precomputeJointMatrix},getRenderNode:function(){return
this._useJointMatrix()?this.rootBone:l},calcJointMatrix:function()
{if(this.skeleton&&this.rootBone){var
t=this._joints,e=this.skeleton.bindposes,i=this.skeleton.uniqueBindPoses;if(this._u
seJointMatrix())for(var n=0;n<t.length;++n){var r=t[n]._jointMatrix;i[n]?
this._setJointsDataWithArray(n,r):
(a.multiply(o,r,e[n]),this._setJointsDataWithMatrix(n,o))}else for(var
s=0;s<t.length;++s){var
l=t[s];l._updateWorldMatrix(),a.multiply(o,l._worldMatrix,e[s]),this._setJointsData
WithMatrix(s,o)}this._commitJointsData()}}});cc.SkinnedMeshRenderer=e.exports=h}),
{"../../mesh/CCMeshRenderer":167,"../../renderer/render-
flow":244,"./CCSkeleton":44}],48:[(function(t,e,i){"use strict";var
n=t("./CCSkinnedMeshRenderer"),r=t("../../mesh/mesh-
renderer"),s=cc.js.addon({fillBuffers:function(t,e)
{t.calcJointMatrix(),r.fillBuffers(t,e)}},r);e.exports=n._assembler=s}),
{"../../mesh/mesh-renderer":170,"./CCSkinnedMeshRenderer":47}],49:[(function(t,e,i)
{"use strict";t("../../DebugInfos");var n="https://github.com/cocos-
creator/engine/blob/master/EngineErrorMap.md",r=void
0;cc.log=cc.warn=cc.error=cc.assert=console.log;function s(t){return function(){var
e=arguments[0],i=t+" "+e+", please go to "+n+"#"+e+" to see
details.";if(1===arguments.length)return i;if(2===arguments.length)return i+"
Arguments: "+arguments[1];var r=cc.js.shiftArguments.apply(null,arguments);return
i+" Arguments: "+r.join(", ")}}cc._throw=function(t){var e=t.stack;e?
cc.error(e):cc.error(t)};var a=s("Log");cc.logID=function()
{cc.log(a.apply(null,arguments))};var o=s("Warning");cc.warnID=function()
{cc.warn(o.apply(null,arguments))};var l=s("Error");cc.errorID=function()
{cc.error(l.apply(null,arguments))};var h=s("Assert");cc.assertID=function(t){t||
cc.assert(!1,h.apply(null,cc.js.shiftArguments.apply(null,arguments)))};var
c=cc.Enum({NONE:0,INFO:1,WARN:2,ERROR:3,INFO_FOR_WEB_PAGE:4,WARN_FOR_WEB_PAGE:5,ERR
OR_FOR_WEB_PAGE:6});e.exports=cc.debug={DebugMode:c,_resetDebugSetting:function(t)
{if(cc.log=cc.warn=cc.error=cc.assert=function(){},t!==c.NONE){if(t>c.ERROR){var
e=function(t){if(cc.game.canvas){if(!r){var
e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("w
idth","200"),e.setAttribute("height",cc.game.canvas.height);var
i=e.style;i.zIndex="99999",i.position="absolute",i.top=i.left="0",
(r=document.createElement("textarea")).setAttribute("rows","20"),r.setAttribute("co
ls","30"),r.setAttribute("disabled","true");var
n=r.style;n.backgroundColor="transparent",n.borderBottom="1px solid
#cccccc",n.borderTopWidth=n.borderLeftWidth=n.borderRightWidth="0px",n.borderTopSty
le=n.borderLeftStyle=n.borderRightStyle="none",n.padding="0px",n.margin=0,e.appendC
hild(r),cc.game.canvas.parentNode.appendChild(e)}r.value=r.value+t+"\r\n",r.scrollT
op=r.scrollHeight}};cc.error=function(){e("ERROR :
"+cc.js.formatStr.apply(null,arguments))},cc.assert=function(t,i){!
t&&i&&(i=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments)),e("
ASSERT: "+i))},t!==c.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN :
"+cc.js.formatStr.apply(null,arguments))}),t===c.INFO_FOR_WEB_PAGE&&(cc.log=functio
n(){e(cc.js.formatStr.apply(null,arguments))})}else
console&&console.log.apply&&(console.error||
(console.error=console.log),console.warn||
(console.warn=console.log),console.error.bind?
cc.error=console.error.bind(console):cc.error=function(){return
console.error.apply(console,arguments)},cc.assert=function(t,e){if(!t)throw
e&&(e=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))),new
Error(e)});t!==c.ERROR&&(console.warn.bind?
cc.warn=console.warn.bind(console):cc.warn=function(){return
console.warn.apply(console,arguments)}),t===c.INFO&&(console.log.bind?
cc.log=console.log.bind(console):cc.log=function(){return
console.log.apply(console,arguments)})}},getError:s("ERROR"),isDisplayStats:functio
n(){return!!cc.profiler&&cc.profiler.isShowingStats()},setDisplayStats:function(t)
{cc.profiler&&(t?
cc.profiler.showStats():cc.profiler.hideStats(),cc.game.config.showFPS=!!t)}}}),
{"../../DebugInfos":void 0}],50:[(function(t,e,i){"use strict";var
n=t("./event/event-target"),r=t("./load-pipeline/auto-release-
utils"),s=t("./component-scheduler"),a=t("./node-
activator"),o=t("./platform/CCObject"),l=t("./CCGame"),h=t("./renderer"),c=t("./eve
nt-manager"),u=t("./CCScheduler");cc.Director=function()
{n.call(this),this.invalid=!1,this._paused=!1,this._purgeDirectorInNextLoop=!
1,this._winSizeInPoints=null,this._loadingScene="",this._scene=null,this._totalFram
es=0,this._lastUpdate=0,this._deltaTime=0,this._scheduler=null,this._compScheduler=
null,this._nodeActivator=null,this._actionManager=null;var
t=this;l.on(l.EVENT_SHOW,(function()
{t._lastUpdate=performance.now()})),l.once(l.EVENT_ENGINE_INITED,this.init,this)},c
c.Director.prototype={constructor:cc.Director,init:function(){return
this._totalFrames=0,this._lastUpdate=performance.now(),this._paused=!
1,this._purgeDirectorInNextLoop=!
1,this._winSizeInPoints=cc.size(0,0),this._scheduler=new u,cc.ActionManager?
(this._actionManager=new
cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,u.PRIORITY_SYST
EM,!1)):this._actionManager=null,this.sharedInit(),!0},sharedInit:function()
{this._compScheduler=new s,this._nodeActivator=new a,c&&c.setEnabled(!
0),cc.AnimationManager?(this._animationManager=new
cc.AnimationManager,this._scheduler.scheduleUpdate(this._animationManager,u.PRIORIT
Y_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?
(this._collisionManager=new
cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,u.PRIORIT
Y_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?
(this._physicsManager=new
cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,u.PRIORITY_SY
STEM,!
1)):this._physicsManager=null,cc._widgetManager&&cc._widgetManager.init(this),cc.lo
ader.init(this)},calculateDeltaTime:function(t){t||
(t=performance.now()),this._deltaTime=(t-
this._lastUpdate)/1e3,this._lastUpdate=t},convertToGL:function(t){var
e=l.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-
e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,a=i._devicePixelRatio*(t.x-
r),o=i._devicePixelRatio*(s+n.height-t.y);return i._isRotated?
cc.v2(i._viewportRect.width-o,a):cc.v2(a,o)},convertToUI:function(t){var
e=l.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-
e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,a=cc.v2(0,0);return
i._isRotated?(a.x=r+t.y/i._devicePixelRatio,a.y=s+n.height-(i._viewportRect.width-
t.x)/i._devicePixelRatio):(a.x=r+t.x*i._devicePixelRatio,a.y=s+n.height-
t.y*i._devicePixelRatio),a},end:function(){this._purgeDirectorInNextLoop=!
0},getWinSize:function(){return cc.size(cc.winSize)},getWinSizeInPixels:function()
{return cc.size(cc.winSize)},pause:function(){this._paused||(this._paused=!
0)},purgeCachedData:function(){cc.loader.releaseAll()},purgeDirector:function()
{this._scheduler.unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActi
vator.reset(),c&&c.setEnabled(!
1),cc.renderer.clear(),cc.isValid(this._scene)&&this._scene.destroy(),this._scene=n
ull,this.stopAnimation(),cc.loader.releaseAll()},reset:function()
{this.purgeDirector(),c&&c.setEnabled(!
0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Sched
uler.PRIORITY_SYSTEM,!
1),this._animationManager&&this._scheduler.scheduleUpdate(this._animationManager,cc
.Scheduler.PRIORITY_SYSTEM,!
1),this._collisionManager&&this._scheduler.scheduleUpdate(this._collisionManager,cc
.Scheduler.PRIORITY_SYSTEM,!
1),this._physicsManager&&this._scheduler.scheduleUpdate(this._physicsManager,cc.Sch
eduler.PRIORITY_SYSTEM,!1),this.startAnimation()},runSceneImmediate:function(t,e,i)
{cc.assertID(t instanceof cc.Scene,1216),t._load();for(var
n=Object.keys(l._persistRootNodes).map((function(t){return
l._persistRootNodes[t]})),s=0;s<n.length;s++){var
a=n[s],h=t.getChildByUuid(a.uuid);if(h){var
c=h.getSiblingIndex();h._destroyImmediate(),t.insertChild(a,c)}else a.parent=t}var
u=this._scene,_=u&&u.autoReleaseAssets&&u.dependAssets;r.autoRelease(_,t.dependAsse
ts,n),cc.isValid(u)&&u.destroy(),this._scene=null,o._deferredDestroy(),e&&e(),this.
emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,t),this._scene=t,t._activate(),this.star
tAnimation(),i&&i(null,t),this.emit(cc.Director.EVENT_AFTER_SCENE_LAUNCH,t)},runSce
ne:function(t,e,i){cc.assertID(t,1205),cc.assertID(t instanceof
cc.Scene,1216),t._load(),this.once(cc.Director.EVENT_AFTER_UPDATE,(function()
{this.runSceneImmediate(t,e,i)}),this)},_getSceneUuid:function(t){var
e=l._sceneInfos;if("string"==typeof t){t.endsWith(".fire")||
(t+=".fire"),"/"===t[0]||t.startsWith("db://")||(t="/"+t);for(var i=0;i<e.length;i+
+){var n=e[i];if(n.url.endsWith(t))return n}}else if("number"==typeof t)
{if(0<=t&&t<e.length)return e[t];cc.errorID(1206,t)}else cc.errorID(1207,t);return
null},loadScene:function(t,e,i){if(this._loadingScene)return
cc.errorID(1208,t,this._loadingScene),!1;var n=this._getSceneUuid(t);if(n){var
r=n.uuid;return
this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING,t),this._loadingScene=t,this._load
SceneByUuid(r,e,i),!0}return cc.errorID(1209,t),!1},preloadScene:function(t,e,i)
{void 0===i&&(i=e,e=null);var
n=this._getSceneUuid(t);if(n)this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING,t),cc
.loader.load({uuid:n.uuid,type:"uuid"},e,(function(e,n)
{e&&cc.errorID(1210,t,e.message),i&&i(e,n)}));else{var r='Can not preload the scene
"'+t+'" because it is not
in the build settings.';i(new Error(r)),cc.error("preloadScene:
"+r)}},_loadSceneByUuid:function(t,e,i,n){console.time("LoadScene
"+t),cc.AssetLibrary.loadAsset(t,(function(n,r){console.timeEnd("LoadScene "+t);var
s=cc.director;if(s._loadingScene="",n)n="Failed to load scene:
"+n,cc.error(n);else{if(r instanceof cc.SceneAsset){var a=r.scene;return
a._id=r._uuid,a._name=r._name,void s.runSceneImmediate(a,i,e)}n="The asset "+t+" is
not a scene",cc.error(n)}e&&e(n)}))},resume:function()
{this._paused&&(this._lastUpdate=performance.now(),this._lastUpdate||
cc.logID(1200),this._paused=!1,this._deltaTime=0)},setDepthTest:function(t)
{cc.Camera.main&&(cc.Camera.main.depth=!!t)},setClearColor:function(t)
{cc.Camera.main&&(cc.Camera.main.backgroundColor=t)},getRunningScene:function()
{return this._scene},getScene:function(){return
this._scene},getAnimationInterval:function(){return
1e3/l.getFrameRate()},setAnimationInterval:function(t)
{l.setFrameRate(Math.round(1e3/t))},getDeltaTime:function(){return
this._deltaTime},getTotalFrames:function(){return
this._totalFrames},isPaused:function(){return this._paused},getScheduler:function()
{return this._scheduler},setScheduler:function(t){this._scheduler!
==t&&(this._scheduler=t)},getActionManager:function(){return
this._actionManager},setActionManager:function(t){this._actionManager!
==t&&(this._actionManager&&this._scheduler.unscheduleUpdate(this._actionManager),th
is._actionManager=t,this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler
.PRIORITY_SYSTEM,!1))},getAnimationManager:function(){return
this._animationManager},getCollisionManager:function(){return
this._collisionManager},getPhysicsManager:function(){return
this._physicsManager},startAnimation:function(){this.invalid=!
1,this._lastUpdate=performance.now()},stopAnimation:function(){this.invalid=!
0},mainLoop:function(t){this._purgeDirectorInNextLoop?
(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):this.invalid||
(this.calculateDeltaTime(t),this._paused||
(this.emit(cc.Director.EVENT_BEFORE_UPDATE),this._compScheduler.startPhase(),this._
compScheduler.updatePhase(this._deltaTime),this._scheduler.update(this._deltaTime),
this._compScheduler.lateUpdatePhase(this._deltaTime),this.emit(cc.Director.EVENT_AF
TER_UPDATE),o._deferredDestroy()),this.emit(cc.Director.EVENT_BEFORE_DRAW),h.render
(this._scene),this.emit(cc.Director.EVENT_AFTER_DRAW),c.frameUpdateListeners(),this
._totalFrames++)},__fastOn:function(t,e,i)
{this.add(t,e,i)},__fastOff:function(t,e,i)
{this.remove(t,e,i)}},cc.js.addon(cc.Director.prototype,n.prototype),cc.Director.EV
ENT_PROJECTION_CHANGED="director_projection_changed",cc.Director.EVENT_BEFORE_SCENE
_LOADING="director_before_scene_loading",cc.Director.EVENT_BEFORE_SCENE_LAUNCH="dir
ector_before_scene_launch",cc.Director.EVENT_AFTER_SCENE_LAUNCH="director_after_sce
ne_launch",cc.Director.EVENT_BEFORE_UPDATE="director_before_update",cc.Director.EVE
NT_AFTER_UPDATE="director_after_update",cc.Director.EVENT_BEFORE_VISIT="director_be
fore_draw",cc.Director.EVENT_AFTER_VISIT="director_before_draw",cc.Director.EVENT_B
EFORE_DRAW="director_before_draw",cc.Director.EVENT_AFTER_DRAW="director_after_draw
",cc.Director.PROJECTION_2D=0,cc.Director.PROJECTION_3D=1,cc.Director.PROJECTION_CU
STOM=3,cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_2D,cc.director=new
cc.Director,e.exports=cc.director}),{"./CCGame":51,"./CCScheduler":55,"./component-
scheduler":89,"./event-manager":130,"./event/event-target":132,"./load-
pipeline/auto-release-utils":150,"./node-
activator":171,"./platform/CCObject":206,"./renderer":243}],51:[(function(t,e,i)
{"use strict";var n=t("./event/event-target");t("../audio/CCAudioEngine");var
r=t("./CCDebug"),s=t("./renderer/index.js"),a=t("./platform/CCInputManager"),o=t(".
./core/renderer/utils/dynamic-
atlas/manager"),l={EVENT_HIDE:"game_on_hide",EVENT_SHOW:"game_on_show",EVENT_RESTAR
T:"game_on_restart",EVENT_GAME_INITED:"game_inited",EVENT_ENGINE_INITED:"engine_ini
ted",EVENT_RENDERER_INITED:"engine_inited",RENDER_TYPE_CANVAS:0,RENDER_TYPE_WEBGL:1
,RENDER_TYPE_OPENGL:2,_persistRootNodes:{},_paused:!0,_configLoaded:!1,_isCloning:!
1,_prepared:!1,_rendererInitialized:!
1,_renderContext:null,_intervalId:null,_lastTime:null,_frameTime:null,_sceneInfos:
[],frame:null,container:null,canvas:null,renderType:-
1,config:null,onStart:null,setFrameRate:function(t)
{this.config.frameRate=t,this._intervalId&&window.cancelAnimFrame(this._intervalId)
,this._intervalId=0,this._paused=!
0,this._setAnimFrame(),this._runMainLoop()},getFrameRate:function(){return
this.config.frameRate},step:function(){cc.director.mainLoop()},pause:function()
{this._paused||(this._paused=!
0,cc.audioEngine&&cc.audioEngine._break(),cc.director.stopAnimation(),this._interva
lId&&window.cancelAnimFrame(this._intervalId),this._intervalId=0)},resume:function(
){this._paused&&(this._paused=!
1,cc.audioEngine&&cc.audioEngine._restore(),cc.director.startAnimation(),this._runM
ainLoop())},isPaused:function(){return this._paused},restart:function()
{cc.director.once(cc.Director.EVENT_AFTER_DRAW,(function(){for(var t in
l._persistRootNodes)l.removePersistRootNode(l._persistRootNodes[t]);cc.director.get
Scene().destroy(),cc.Object._deferredDestroy(),cc.director.purgeDirector(),cc.audio
Engine&&cc.audioEngine.uncacheAll(),cc.director.reset(),l.onStart(),l.emit(l.EVENT_
RESTART)}))},end:function(){close()},_initEngine:function()
{this._rendererInitialized||
(this._initRenderer(),this._initEvents(),this.emit(this.EVENT_ENGINE_INITED))},_pre
pareFinished:function(t){var e=this;this._prepared=!
0,this._initEngine(),cc.AssetLibrary._loadBuiltins((function(){console.log("Cocos
Creator
v"+cc.ENGINE_VERSION),e._setAnimFrame(),e._runMainLoop(),e.emit(e.EVENT_GAME_INITED
),t&&t()}))},eventTargetOn:n.prototype.on,eventTargetOnce:n.prototype.once,on:funct
ion(t,e,i){this._prepared&&t===this.EVENT_ENGINE_INITED||!
this._paused&&t===this.EVENT_GAME_INITED?
e.call(i):this.eventTargetOn(t,e,i)},once:function(t,e,i)
{this._prepared&&t===this.EVENT_ENGINE_INITED||!
this._paused&&t===this.EVENT_GAME_INITED?
e.call(i):this.eventTargetOnce(t,e,i)},prepare:function(t)
{if(this._prepared)t&&t();else{var e=this.config.jsList;if(e&&e.length>0){var
i=this;cc.loader.load(e,(function(e){if(e)throw new
Error(JSON.stringify(e));i._prepareFinished(t)}))}else
this._prepareFinished(t)}},run:function(t,e)
{this._initConfig(t),this.onStart=e,this.prepare(l.onStart&&l.onStart.bind(l))},add
PersistRootNode:function(t){if(cc.Node.isNode(t)&&t.uuid){var e=t.uuid;if(!
this._persistRootNodes[e]){var i=cc.director._scene;if(cc.isValid(i))if(t.parent)
{if(!(t.parent instanceof cc.Scene))return void cc.warnID(3801);if(t.parent!
==i)return void cc.warnID(3802)}else
t.parent=i;this._persistRootNodes[e]=t,t._persistNode=!0}}else
cc.warnID(3800)},removePersistRootNode:function(t){var
e=t.uuid||"";t===this._persistRootNodes[e]&&(delete
this._persistRootNodes[e],t._persistNode=!1)},isPersistRootNode:function(t){return
t._persistNode},_setAnimFrame:function(){this._lastTime=performance.now();var
t=l.config.frameRate;this._frameTime=1e3/t,60!==t&&30!==t?
(window.requestAnimFrame=this._stTime,window.cancelAnimFrame=this._ctTime):
(window.requestAnimFrame=window.requestAnimationFrame||
window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
window.oRequestAnimationFrame||window.msRequestAnimationFrame||
this._stTime,window.cancelAnimFrame=window.cancelAnimationFrame||
window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||
window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||
window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||
window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||
window.oCancelAnimationFrame||this._ctTime)},_stTime:function(t){var
e=performance.now(),i=Math.max(0,l._frameTime-(e-
l._lastTime)),n=window.setTimeout((function(){t()}),i);return
l._lastTime=e+i,n},_ctTime:function(t)
{window.clearTimeout(t)},_runMainLoop:function(){var
t,e=this,i=e.config,n=cc.director,s=!
0,a=i.frameRate;r.setDisplayStats(i.showFPS),t=function(i){if(!e._paused)
{if(e._intervalId=window.requestAnimFrame(t),30===a&&(s=!
s))return;n.mainLoop(i)}},e._intervalId=window.requestAnimFrame(t),e._paused=!
1},_initConfig:function(t){"number"!=typeof
t.debugMode&&(t.debugMode=0),t.exposeClassName=!!t.exposeClassName,"number"!=typeof
t.frameRate&&(t.frameRate=60);var e=t.renderMode;("number"!=typeof e||e>2||
e<0)&&(t.renderMode=0),"boolean"!=typeof
t.registerSystemEvent&&(t.registerSystemEvent=!0),t.showFPS=!!
t.showFPS,this._sceneInfos=t.scenes||[],this.collisionMatrix=t.collisionMatrix||
[],this.groupList=t.groupList||
[],r._resetDebugSetting(t.debugMode),this.config=t,this._configLoaded=!
0},_determineRenderType:function(){var t=this.config,e=parseInt(t.renderMode)||
0;this.renderType=this.RENDER_TYPE_CANVAS;var i=!1;if(0===e?
cc.sys.capabilities.opengl?(this.renderType=this.RENDER_TYPE_WEBGL,i=!
0):cc.sys.capabilities.canvas&&(this.renderType=this.RENDER_TYPE_CANVAS,i=!
0):1===e&&cc.sys.capabilities.canvas?(this.renderType=this.RENDER_TYPE_CANVAS,i=!
0):2===e&&cc.sys.capabilities.opengl&&(this.renderType=this.RENDER_TYPE_WEBGL,i=!
0),!i)throw new Error(r.getError(3820,e))},_initRenderer:function(){if(!
this._rendererInitialized){var t=this.config.id,e=void 0,i=void 0,n=void 0,r=void
0,a=t instanceof HTMLElement?t:document.querySelector(t)||
document.querySelector("#"+t);if("CANVAS"===a.tagName?
(e=a.width,i=a.height,this.canvas=n=a,this.container=r=document.createElement("DIV"
),n.parentNode&&n.parentNode.insertBefore(r,n)):("DIV"!
==a.tagName&&cc.warnID(3819),e=a.clientWidth,i=a.clientHeight,this.canvas=n=documen
t.createElement("CANVAS"),this.container=r=document.createElement("DIV"),a.appendCh
ild(r)),r.setAttribute("id","Cocos2dGameContainer"),r.appendChild(n),this.frame=r.p
arentNode===document.body?document.documentElement:r.parentNode,(function(t,e){("
"+t.className+" ").indexOf(" "+e+" ")>-1||(t.className&&(t.className+="
"),t.className+=e)})(n,"gameCanvas"),n.setAttribute("width",e||
480),n.setAttribute("height",i||
320),n.setAttribute("tabindex",99),this._determineRenderType(),this.renderType===th
is.RENDER_TYPE_WEBGL){var l={stencil:!
0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVA
S};0,s.initWebGL(n,l),this._renderContext=s.device._gl,!
cc.macro.CLEANUP_IMAGE_CACHE&&o&&(o.enabled=!0)}this._renderContext||
(this.renderType=this.RENDER_TYPE_CANVAS,s.initCanvas(n),this._renderContext=s.devi
ce._ctx),this.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!
1},this._rendererInitialized=!0}},_initEvents:function(){var
t,e=window;this.config.registerSystemEvent&&a.registerSystemEvent(this.canvas),void
0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!
==document.msHidden?t="msHidden":void 0!
==document.webkitHidden&&(t="webkitHidden");var i=!1;function n(){i||(i=!
0,l.emit(l.EVENT_HIDE))}function r(t,e,n,r,s){i&&(i=!
1,l.emit(l.EVENT_SHOW,t,e,n,r,s))}if(t)for(var
s=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilityc
hange","qbrowserVisibilityChange"],o=0;o<s.length;o+
+)document.addEventListener(s[o],(function(e){var i=document[t];(i=i||e.hidden)?
n():r()}));else
e.addEventListener("blur",n),e.addEventListener("focus",r);navigator.userAgent.inde
xOf("MicroMessenger")>-1&&(e.onfocus=r),"onpageshow"in window&&"onpagehide"in
window&&(e.addEventListener("pagehide",n),e.addEventListener("pageshow",r),document
.addEventListener("pagehide",n),document.addEventListener("pageshow",r)),this.on(l.
EVENT_HIDE,(function(){l.pause()})),this.on(l.EVENT_SHOW,(function()
{l.resume()}))}};n.call(l),cc.js.addon(l,n.prototype),cc.game=e.exports=l}),
{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-
atlas/manager":246,"./CCDebug":49,"./event/event-
target":132,"./platform/BKInputManager":198,"./platform/CCInputManager":204,"./rend
erer/index.js":243}],52:[(function(t,e,i){"use strict";var
n=t("./vmath"),r=t("./utils/base-node"),s=t("./utils/prefab-
helper"),a=t("./utils/math-pools"),o=t("./utils/affine-transform"),l=t("./event-
manager"),h=t("./platform/CCMacro"),c=t("./platform/js"),u=(t("./event/event"),t(".
/event/event-target")),_=t("./renderer/render-
flow"),f=cc.Object.Flags.Destroying,d=Math.PI/180,m=!!cc.ActionManager,p=function()
{},v=cc.v2(),y=cc.v2(),g=n.mat4.create(),x=n.vec3.create(),b=n.quat.create(),A=new
Array(16);A.length=0;var
C=cc.Enum({DEBUG:31}),S=cc.Enum({POSITION:1,SCALE:2,ROTATION:4,SKEW:8,RT:7,ALL:6553
5}),T=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend"
,TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENT
ER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_WHEEL:"mousewheel
",POSITION_CHANGED:"position-changed",ROTATION_CHANGED:"rotation-
changed",SCALE_CHANGED:"scale-changed",SIZE_CHANGED:"size-
changed",ANCHOR_CHANGED:"anchor-changed",COLOR_CHANGED:"color-
changed",CHILD_ADDED:"child-added",CHILD_REMOVED:"child-
removed",CHILD_REORDER:"child-reorder",GROUP_CHANGED:"group-
changed"}),w=[T.TOUCH_START,T.TOUCH_MOVE,T.TOUCH_END,T.TOUCH_CANCEL],E=[T.MOUSE_DOW
N,T.MOUSE_ENTER,T.MOUSE_MOVE,T.MOUSE_LEAVE,T.MOUSE_UP,T.MOUSE_WHEEL],M=null,D=funct
ion(t,e){var i=t.getLocation(),n=this.owner;return!!
n._hitTest(i,this)&&(e.type=T.TOUCH_START,e.touch=t,e.bubbles=!
0,n.dispatchEvent(e),!0)},B=function(t,e){var
i=this.owner;e.type=T.TOUCH_MOVE,e.touch=t,e.bubbles=!
0,i.dispatchEvent(e)},P=function(t,e){var
i=t.getLocation(),n=this.owner;n._hitTest(i,this)?
e.type=T.TOUCH_END:e.type=T.TOUCH_CANCEL,e.touch=t,e.bubbles=!
0,n.dispatchEvent(e)},I=function(t,e){t.getLocation();var
i=this.owner;e.type=T.TOUCH_CANCEL,e.touch=t,e.bubbles=!
0,i.dispatchEvent(e)},R=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_DOWN,t.bubbles=!
0,i.dispatchEvent(t))},O=function(t){var
e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||
(M&&M._mouseListener&&(t.type=T.MOUSE_LEAVE,M.dispatchEvent(t),M._mouseListener._pr
eviousIn=!
1),M=this.owner,t.type=T.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!
0),t.type=T.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!
this._previousIn)return;t.type=T.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!
1,M=null}t.stopPropagation()},L=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_UP,t.bubbles=!
0,i.dispatchEvent(t),t.stopPropagation())},F=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_WHEEL,t.bubbles=
!0,i.dispatchEvent(t),t.stopPropagation())};function V(t){var
e=cc.Mask;if(e)for(var i=0,n=t;n&&cc.Node.isNode(n);n=n._parent,+
+i)if(n.getComponent(e))return{index:i,node:n};return null}function N(t,e){if(!
(t._objFlags&f)){var i=0;if(t._bubblingListeners)for(;i<e.length;+
+i)if(t._bubblingListeners.hasEventListener(e[i]))return!
0;if(t._capturingListeners)for(;i<e.length;+
+i)if(t._capturingListeners.hasEventListener(e[i]))return!0;return!1}return!
0}function k(t,e){var
i,n;for(e.target=t,A.length=0,t._getCapturingTargets(e.type,A),e.eventPhase=1,n=A.l
ength-1;n>=0;--
n)if((i=A[n])._capturingListeners&&(e.currentTarget=i,i._capturingListeners.emit(e.
type,e,A),e._propagationStopped))return
void(A.length=0);if(A.length=0,e.eventPhase=2,e.currentTarget=t,t._capturingListene
rs&&t._capturingListeners.emit(e.type,e),!
e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.emit(e.t
ype,e),!
e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,A),e.eventPhase=3
,n=0;n<A.length;+
+n)if((i=A[n])._bubblingListeners&&(e.currentTarget=i,i._bubblingListeners.emit(e.t
ype,e),e._propagationStopped))return void(A.length=0);A.length=0}function G(t){var
e=t.groupIndex;return 0===e&&t.parent&&(e=G(t.parent)),e}function z(t){var
e=G(t);t._cullingMask=1<<e;for(var i=0;i<t._children.length;i+
+)z(t._children[i])}var U={name:"cc.Node",extends:r,properties:
{_opacity:255,_color:cc.Color.WHITE,_contentSize:cc.Size,_anchorPoint:cc.v2(.5,.5),
_position:cc.Vec3,_scale:cc.Vec3,_quat:cc.Quat,_skewX:0,_skewY:0,_zIndex:
{default:void 0,type:cc.Integer},_localZOrder:{default:0,serializable:!
1},_is3DNode:!1,groupIndex:{default:0,type:cc.Integer},group:{get:function(){return
cc.game.groupList[this.groupIndex]||""},set:function(t)
{this.groupIndex=cc.game.groupList.indexOf(t),z(this),this.emit(T.GROUP_CHANGED,thi
s)}},x:{get:function(){return this._position.x},set:function(t){var
e=this._position;t!==e.x&&(e.x=t,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))}},y:
{get:function(){return this._position.y},set:function(t){var e=this._position;t!
==e.y&&(e.y=t,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))}},rotatio
n:{get:function(){return-this.angle},set:function(t){this.angle=-t}},angle:
{get:function(){return this._eulerAngles.z},set:function(t)
{n.vec3.set(this._eulerAngles,0,0,t),this._fromEuler(),this.setLocalDirty(S.ROTATIO
N),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED)}},rotationX:
{get:function(){return this._eulerAngles.x},set:function(t){this._eulerAngles.x!
==t&&(this._eulerAngles.x=t,this._eulerAngles.x===this._eulerAngles.y?
n.quat.fromEuler(this._quat,0,0,-
t):n.quat.fromEuler(this._quat,t,this._eulerAngles.y,0),this.setLocalDirty(S.ROTATI
ON),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},rotationY:
{get:function(){return this._eulerAngles.y},set:function(t){this._eulerAngles.y!
==t&&(this._eulerAngles.y=t,this._eulerAngles.x===this._eulerAngles.y?
n.quat.fromEuler(this._quat,0,0,-
t):n.quat.fromEuler(this._quat,this._eulerAngles.x,t,0),this.setLocalDirty(S.ROTATI
ON),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},scale:
{get:function(){return this._scale.x},set:function(t){this.setScale(t)}},scaleX:
{get:function(){return this._scale.x},set:function(t){this._scale.x!
==t&&(this._scale.x=t,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))}},scaleY:
{get:function(){return this._scale.y},set:function(t){this._scale.y!
==t&&(this._scale.y=t,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))}},skewX:
{get:function(){return this._skewX},set:function(t)
{this._skewX=t,this.setLocalDirty(S.SKEW),this._renderFlag|
=_.FLAG_TRANSFORM}},skewY:{get:function(){return this._skewY},set:function(t)
{this._skewY=t,this.setLocalDirty(S.SKEW),this._renderFlag|
=_.FLAG_TRANSFORM}},opacity:{get:function(){return this._opacity},set:function(t)
{t=cc.misc.clampf(t,0,255),this._opacity!==t&&(this._opacity=t,this._renderFlag|
=_.FLAG_OPACITY)},range:[0,255]},color:{get:function(){return
this._color.clone()},set:function(t){this._color.equals(t)||
(this._color.set(t),32&this._eventMask&&this.emit(T.COLOR_CHANGED,t))}},anchorX:
{get:function(){return this._anchorPoint.x},set:function(t){var
e=this._anchorPoint;e.x!
==t&&(e.x=t,16&this._eventMask&&this.emit(T.ANCHOR_CHANGED))}},anchorY:
{get:function(){return this._anchorPoint.y},set:function(t){var
e=this._anchorPoint;e.y!
==t&&(e.y=t,16&this._eventMask&&this.emit(T.ANCHOR_CHANGED))}},width:
{get:function(){return this._contentSize.width},set:function(t){t!
==this._contentSize.width&&(this._contentSize.width=t,8&this._eventMask&&this.emit(
T.SIZE_CHANGED))}},height:{get:function(){return
this._contentSize.height},set:function(t){t!
==this._contentSize.height&&(this._contentSize.height=t,8&this._eventMask&&this.emi
t(T.SIZE_CHANGED))}},zIndex:{get:function(){return
this._localZOrder>>16},set:function(t){t>h.MAX_ZINDEX?
(cc.warnID(1636),t=h.MAX_ZINDEX):t<h.MIN_ZINDEX&&(cc.warnID(1637),t=h.MIN_ZINDEX),t
his.zIndex!==t&&(this._localZOrder=65535&this._localZOrder|
t<<16,this._parent&&this._onSiblingIndexChanged())}}},ctor:function()
{this._reorderChildDirty=!1,this._widget=null,this._renderComponent=nul
l,this._capturingListeners=null,this._bubblingListeners=null,this._touchListener=nu
ll,this._mouseListener=null,this._scale.x=1,this._scale.y=1,this._scale.z=1,this._m
atrix=a.mat4.get(),this._worldMatrix=a.mat4.get(),this._localMatDirty=S.ALL,this._w
orldMatDirty=!
0,this._eventMask=0,this._cullingMask=1,this._childArrivalOrder=1,this._eulerAngles
=cc.v3()},statics:{EventType:T,_LocalDirtyFlag:S,isNode:function(t){return t
instanceof j&&(t.constructor===j||!(t instanceof
cc.Scene))},BuiltinGroupIndex:C},_onSiblingIndexChanged:function(){for(var
t=this._parent,e=t._children,i=0,n=e.length;i<n;i+
+)e[i]._updateOrderOfArrival();t._delaySort()},_onPreDestroy:function()
{this._onPreDestroyBase();m&&cc.director.getActionManager().removeAllActionsFromTar
get(this),M===this&&(M=null),(this._touchListener||
this._mouseListener)&&(l.removeListeners(this),this._touchListener&&(this._touchLis
tener.owner=null,this._touchListener.mask=null,this._touchListener=null),this._mous
eListener&&(this._mouseListener.owner=null,this._mouseListener.mask=null,this._mous
eListener=null)),a.mat4.put(this._matrix),a.mat4.put(this._worldMatrix),this._matri
x=this._worldMatrix=null,this._reorderChildDirty&&cc.director.__fastOff(cc.Director
.EVENT_AFTER_UPDATE,this.sortAllChildren,this)},_onPostActivated:function(t){var
e=m?cc.director.getActionManager():null;if(t)if(this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,e&&e.resumeTarget(this),l.resumeTarget(this),this._touchLis
tener){var
i=this._touchListener.mask=V(this);this._mouseListener&&(this._mouseListener.mask=i
)}else this._mouseListener&&(this._mouseListener.mask=V(this));else
e&&e.pauseTarget(this),l.pauseTarget(this)},_onHierarchyChanged:function(t)
{this._updateOrderOfArrival(),z(this),this._parent&&this._parent._delaySort(),this.
_renderFlag|
=_.FLAG_WORLD_TRANSFORM,this._onHierarchyChangedBase(t),cc._widgetManager&&(cc._wid
getManager._nodesOrderDirty=!0)},_toEuler:function()
{if(this.is3DNode)this._quat.toEuler(this._eulerAngles);else{var
t=Math.asin(this._quat.z)/d*2;n.vec3.set(this._eulerAngles,0,0,t)}},_fromEuler:func
tion(){this.is3DNode?
this._quat.fromEuler(this._eulerAngles):n.quat.fromEuler(this._quat,0,0,this._euler
Angles.z)},_upgrade_1x_to_2x:function(){void 0!
==this._scaleX&&(this._scale.x=this._scaleX,this._scaleX=void 0),void 0!
==this._scaleY&&(this._scale.y=this._scaleY,this._scaleY=void 0),void 0!
==this._zIndex&&(this._localZOrder=this._zIndex<<16,this._zIndex=void 0);var
t=this._quat;(this._rotationX||
this._rotationY)&&0===t.x&&0===t.y&&0===t.z&&1===t.w&&(this._rotationX===this._rota
tionY?t.fromEuler(t,0,0,-
this._rotationX):t.fromEuler(t,this._rotationX,this._rotationY,0),this._rotationX=t
his._rotationY=void
0),this._toEuler(),this._color.a<255&&255===this._opacity&&(this._opacity=this._col
or.a,this._color.a=255)},_onBatchCreated:function()
{this._upgrade_1x_to_2x(),this._updateOrderOfArrival(),this._cullingMask=1<<G(this)
;var
t=this._prefab;t&&t.sync&&t.root===this&&s.syncWithPrefab(this),this._activeInHiera
rchy||
(m&&cc.director.getActionManager().pauseTarget(this),l.pauseTarget(this));for(var
e=this._children,i=0,n=e.length;i<n;i+
+)e[i]._onBatchCreated();e.length>0&&(this._renderFlag|
=_.FLAG_CHILDREN)},_onBatchRestored:function()
{if(this._upgrade_1x_to_2x(),this._cullingMask=1<<G(this),!this._activeInHierarchy)
{var
t=cc.director.getActionManager();t&&t.pauseTarget(this),l.pauseTarget(this)}for(var
e=this._children,i=0,n=e.length;i<n;i+
+)e[i]._onBatchRestored();e.length>0&&(this._renderFlag|
=_.FLAG_CHILDREN)},_checknSetupSysEvent:function(t){var e=!1,i=!1;return-1!
==w.indexOf(t)?(this._touchListener||
(this._touchListener=cc.EventListener.create({event:cc.EventListener.TOUCH_ONE_BY_O
NE,swallowTouches:!
0,owner:this,mask:V(this),onTouchBegan:D,onTouchMoved:B,onTouchEnded:P,onTouchCance
lled:I}),l.addListener(this._touchListener,this),e=!0),i=!0):-1!
==E.indexOf(t)&&(this._mouseListener||
(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previou
sIn:!
1,owner:this,mask:V(this),onMouseDown:R,onMouseMove:O,onMouseUp:L,onMouseScroll:F})
,l.addListener(this._mouseListener,this),e=!0),i=!0),e&&!
this._activeInHierarchy&&cc.director.getScheduler().schedule((function()
{this._activeInHierarchy||l.pauseTarget(this)}),this,0,0,0,!
1),i},on:function(t,e,i,n){if(this._checknSetupSysEvent(t))return
this._onDispatch(t,e,i,n);switch(t){case T.POSITION_CHANGED:this._eventMask|
=1;break;case T.SCALE_CHANGED:this._eventMask|=2;break;case
T.ROTATION_CHANGED:this._eventMask|=4;break;case T.SIZE_CHANGED:this._eventMask|
=8;break;case T.ANCHOR_CHANGED:this._eventMask|=16;break;case
T.COLOR_CHANGED:this._eventMask|=32}return this._bubblingListeners||
(this._bubblingListeners=new
u),this._bubblingListeners.on(t,e,i)},once:function(t,e,i,n){var
r=this._checknSetupSysEvent(t),s="__ONCE_FLAG:"+t,a=null;if(!(a=r&&n?
this._capturingListeners=this._capturingListeners||new
u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(s,e,i))
{var o=this;this.on(t,(function n(r,l,h,c,u)
{o.off(t,n,i),a.remove(s,e,i),e.call(this,r,l,h,c,u)}),i),a.add(s,e,i)}},_onDispatc
h:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var
r=null;return(r=n?this._capturingListeners=this._capturingListeners||new
u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(t,e,i)||
(r.add(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e}cc.errorID(6800)}
,off:function(t,e,i,n){var r=-1!==w.indexOf(t),s=!r&&-1!==E.indexOf(t);if(r||
s)this._offDispatch(t,e,i,n),r?this._touchListener&&!
N(this,w)&&(l.removeListener(this._touchListener),this._touchListener=null):s&&this
._mouseListener&&!
N(this,E)&&(l.removeListener(this._mouseListener),this._mouseListener=null);else
if(this._bubblingListeners){if(this._bubblingListeners.off(t,e,i),!
this._bubblingListeners.hasEventListener(t))switch(t){case
T.POSITION_CHANGED:this._eventMask&=-2;break;case
T.SCALE_CHANGED:this._eventMask&=-3;break;case
T.ROTATION_CHANGED:this._eventMask&=-5;break;case T.SIZE_CHANGED:this._eventMask&=-
9;break;case T.ANCHOR_CHANGED:this._eventMask&=-17;break;case
T.COLOR_CHANGED:this._eventMask&=-33}}},_offDispatch:function(t,e,i,n)
{if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=n?
this._capturingListeners:this._bubblingListeners;r&&(r.remove(t,e,i),i&&i.__eventTa
rgets&&c.array.fastRemove(i.__eventTargets,this))}else
this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListe
ners&&this._bubblingListeners.removeAll(t)},targetOff:function(t){var
e=this._bubblingListeners;e&&(e.targetOff(t),1&this._eventMask&&!
e.hasEventListener(T.POSITION_CHANGED)&&(this._eventMask&=-2),2&this._eventMask&&!
e.hasEventListener(T.SCALE_CHANGED)&&(this._eventMask&=-3),4&this._eventMask&&!
e.hasEventListener(T.ROTATION_CHANGED)&&(this._eventMask&=-5),8&this._eventMask&&!
e.hasEventListener(T.SIZE_CHANGED)&&(this._eventMask&=-9),16&this._eventMask&&!
e.hasEventListener(T.ANCHOR_CHANGED)&&(this._eventMask&=-17),32&this._eventMask&&!
e.hasEventListener(T.COLOR_CHANGED)&&(this._eventMask&=-
33)),this._capturingListeners&&this._capturingListeners.targetOff(t),this._touchLis
tener&&!
N(this,w)&&(l.removeListener(this._touchListener),this._touchListener=null),this._m
ouseListener&&!
N(this,E)&&(l.removeListener(this._mouseListener),this._mouseListener=null)},hasEve
ntListener:function(t){var e=!1;return
this._bubblingListeners&&(e=this._bubblingListeners.hasEventListener(t)),!
e&&this._capturingListeners&&(e=this._capturingListeners.hasEventListener(t)),e},em
it:function(t,e,i,n,r,s)
{this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,s)},dispatchEvent:
function(t){k(this,t),A.length=0},pauseSystemEvents:function(t)
{l.pauseTarget(this,t)},resumeSystemEvents:function(t)
{l.resumeTarget(this,t)},_hitTest:function(t,e){var
i=this._contentSize.width,r=this._contentSize.height,s=v,a=y,o=cc.Camera.findCamera
(this);if(o?
o.getCameraToWorldPoint(t,s):s.set(t),this._updateWorldMatrix(),n.mat4.invert(g,thi
s._worldMatrix),n.vec2.transformMat4(a,s,g),a.x+=this._anchorPoint.x*i,a.y+=this._a
nchorPoint.y*r,a.x>=0&&a.y>=0&&a.x<=i&&a.y<=r){if(e&&e.mask){for(var
l=e.mask,h=this,c=0;h&&c<l.index;++c,h=h.parent);if(h===l.node){var
u=h.getComponent(cc.Mask);return!u||!u.enabledInHierarchy||u._hitTest(s)}return
e.mask=null,!0}return!0}return!1},_getCapturingTargets:function(t,e){for(var
i=this.parent;i;)i._capturingListeners&&i._capturingListeners.hasEventListener(t)&&
e.push(i),i=i.parent},_getBubblingTargets:function(t,e){for(var
i=this.parent;i;)i._bubblingListeners&&i._bubblingListeners.hasEventListener(t)&&e.
push(i),i=i.parent},runAction:m?function(t){if(this.active)return
cc.assertID(t,1618),cc.director.getActionManager().addAction(t,this,!
1),t}:p,pauseAllActions:m?function()
{cc.director.getActionManager().pauseTarget(this)}:p,resumeAllActions:m?function()
{cc.director.getActionManager().resumeTarget(this)}:p,stopAllActions:m?function()
{cc.director.getActionManager().removeAllActionsFromTarget(this)}:p,stopAction:m?
function(t){cc.director.getActionManager().removeAction(t)}:p,stopActionByTag:m?
function(t){t!==cc.Action.TAG_INVALID?
cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:p,getActio
nByTag:m?function(t){return t===cc.Action.TAG_INVALID?
(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:functi
on(){return null},getNumberOfRunningActions:m?function(){return
cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function()
{return 0},getPosition:function(t){return(t=t||
cc.v3()).set(this._position)},setPosition:function(t,e){var i;void 0===e?
(i=t.x,e=t.y):i=t;var n=this._position;n.x===i&&n.y===e||
(n.x=i,n.y=e,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))},getScale
:function(t){return void 0!==t?t.set(this._scale):
(cc.warnID(1400,"cc.Node.getScale","cc.Node.scale or
cc.Node.getScale(cc.Vec3)"),this._scale.x)},setScale:function(t,e){t&&"number"!
=typeof
t?(e=t.y,t=t.x):void 0===e&&(e=t),this._scale.x===t&&this._scale.y===e||
(this._scale.x=t,this._scale.y=e,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))},getRotation:funct
ion(t){return t instanceof cc.Quat?t.set(this._quat):
(cc.warnID(1400,"cc.Node.getRotation","cc.Node.angle or
cc.Node.getRotation(cc.Quat)"),-this.angle)},setRotation:function(t,e,i,n)
{if("number"==typeof t&&void
0===e)cc.warnID(1400,"cc.Node.setRotation(Number)","cc.Node.angle or
cc.Node.setRotation(quat)"),this.angle=-t;else{var r=t;void
0===e&&(r=t.x,e=t.y,i=t.z,n=t.w);var
s=this._quat;s.x===r&&s.y===e&&s.z===i&&s.w===n||
(s.x=r,s.y=e,s.z=i,s.w=n,this.setLocalDirty(S.ROTATION),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},getContentSiz
e:function(){return
cc.size(this._contentSize.width,this._contentSize.height)},setContentSize:function(
t,e){var i=this._contentSize;if(void 0===e)
{if(t.width===i.width&&t.height===i.height)return;0,i.width=t.width,i.height=t.heig
ht}else{if(t===i.width&&e===i.height)return;0,i.width=t,i.height=e}8&this._eventMas
k&&this.emit(T.SIZE_CHANGED)},getAnchorPoint:function(){return
cc.v2(this._anchorPoint)},setAnchorPoint:function(t,e){var
i=this._anchorPoint;if(void 0===e)
{if(t.x===i.x&&t.y===i.y)return;i.x=t.x,i.y=t.y}else{if(t===i.x&&e===i.y)return;i.x
=t,i.y=e}this.setLocalDirty(S.POSITION),16&this._eventMask&&this.emit(T.ANCHOR_CHAN
GED)},_invTransformPoint:function(t,e){return this._parent?
this._parent._invTransformPoint(t,e):n.vec3.copy(t,e),n.vec3.sub(t,t,this._position
),n.quat.conjugate(b,this._quat),n.vec3.transformQuat(t,t,b),n.vec3.inverseSafe(x,t
his._scale),n.vec3.mul(t,t,x),t},getWorldPosition:function(t)
{n.vec3.copy(t,this._position);for(var
e=this._parent;e;)n.vec3.mul(t,t,e._scale),n.vec3.transformQuat(t,t,e._quat),n.vec3
.add(t,t,e._position),e=e._parent;return t},setWorldPosition:function(t)
{this._parent?
this._parent._invTransformPoint(this._position,t):n.vec3.copy(this._position,t),thi
s.setLocalDirty(S.POSITION),1&this._eventMask&&this.emit(T.POSITION_CHANGED)},getWo
rldRotation:function(t){n.quat.copy(t,this._quat);for(var
e=this._parent;e;)n.quat.mul(t,e._quat,t),e=e._parent;return
t},setWorldRotation:function(t){this._parent?
(this._parent.getWorldRotation(this._quat),n.quat.conjugate(this._quat,this._quat),
n.quat.mul(this._quat,this._quat,t)):n.quat.copy(this._quat,n.quat),this._toEuler()
,this.setLocalDirty(S.ROTATION)},getWorldScale:function(t)
{n.vec3.copy(t,this._scale);for(var
e=this._parent;e;)n.vec3.mul(t,t,e._scale),e=e._parent;return
t},setWorldScale:function(t){this._parent?
(this._parent.getWorldScale(this._scale),n.vec3.div(this._scale,t,this._scale)):n.v
ec3.copy(this._scale,t),this.setLocalDirty(S.SCALE)},getWorldRT:function(t){var
e=x,i=b;n.vec3.copy(e,this._position),n.quat.copy(i,this._quat);for(var
r=this._parent;r;)n.vec3.mul(e,e,r._scale),n.vec3.transformQuat(e,e,r._quat),n.vec3
.add(e,e,r._position),n.quat.mul(i,r._quat,i),r=r._parent;return
n.mat4.fromRT(t,i,e),t},lookAt:function(t,e)
{this.getWorldPosition(x),n.vec3.sub(x,x,t),n.vec3.normalize(x,x),n.quat.fromViewUp
(b,x,e),this.setWorldRotation(b)},_updateLocalMatrix:function(){var
t=this._localMatDirty;if(t){var e=this._matrix;if(t&(S.RT|S.SKEW)){var i=-
this._eulerAngles.z,n=this._skewX||
this._skewY,r=this._scale.x,s=this._scale.y;if(i||n){var a=1,o=0,l=0,h=1;if(i){var
c=i*d;l=Math.sin(c),a=h=Math.cos(c),o=-
l}if(e.m00=a*=r,e.m01=o*=r,e.m04=l*=s,e.m05=h*=s,n){var
u=e.m00,_=e.m01,f=e.m04,m=e.m05,p=Math.tan(this._skewX*d),v=Math.tan(this._skewY*d)
;p===1/0&&(p=99999999),v===1/0&&(v=99999999),e.m00=u+f*v,e.m01=_+m*v,e.m04=f+u*p,e.
m05=m+_*p}}else
e.m00=r,e.m01=0,e.m04=0,e.m05=s}e.m12=this._position.x,e.m13=this._position.y,this.
_localMatDirty=0,this._worldMatDirty=!0}},_calculWorldMatrix:function()
{this._localMatDirty&&this._updateLocalMatrix();var t=this._parent;t?
this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):n.mat4.copy(this._world
Matrix,this._matrix),this._worldMatDirty=!1},_mulMat:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m04,a=e.m05,o=e.m12,l=e.m13,h=i.m00,c=i.m01,u=i.m04,_=i.m05,f=i
.m12,d=i.m13;0!==r||0!==s?
(t.m00=h*n+c*s,t.m01=h*r+c*a,t.m04=u*n+_*s,t.m05=u*r+_*a,t.m12=n*f+s*d+o,t.m13=r*f+
a*d+l):
(t.m00=h*n,t.m01=c*a,t.m04=u*n,t.m05=_*a,t.m12=n*f+o,t.m13=a*d+l)},_updateWorldMatr
ix:function()
{if(this._parent&&this._parent._updateWorldMatrix(),this._worldMatDirty)
{this._calculWorldMatrix();for(var t=this._children,e=0,i=t.length;e<i;e+
+)t[e]._worldMatDirty=!0}},setLocalDirty:function(t)
{this._localMatDirty=this._localMatDirty|t,this._worldMatDirty=!
0},setWorldDirty:function(){this._worldMatDirty=!0},getLocalMatrix:function(t)
{return
this._updateLocalMatrix(),n.mat4.copy(t,this._matrix)},getWorldMatrix:function(t)
{return
this._updateWorldMatrix(),n.mat4.copy(t,this._worldMatrix)},convertToNodeSpace:func
tion(t){this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix);var e=new
cc.Vec2;return
n.vec2.transformMat4(e,t,g),e.x+=this._anchorPoint.x*this._contentSize.width,e.y+=t
his._anchorPoint.y*this._contentSize.height,e},convertToWorldSpace:function(t)
{this._updateWorldMatrix();var e=new cc.Vec2(t.x-
this._anchorPoint.x*this._contentSize.width,t.y-
this._anchorPoint.y*this._contentSize.height);return
n.vec2.transformMat4(e,e,this._worldMatrix)},convertToNodeSpaceAR:function(t)
{this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix);var e=new
cc.Vec2;return n.vec2.transformMat4(e,t,g)},convertToWorldSpaceAR:function(t)
{this._updateWorldMatrix();var e=new cc.Vec2;return
n.vec2.transformMat4(e,t,this._worldMatrix)},getNodeToParentTransform:function(t)
{t||(t=o.identity()),this._updateLocalMatrix();var e=this._contentSize;return x.x=-
this._anchorPoint.x*e.width,x.y=-
this._anchorPoint.y*e.height,n.mat4.copy(g,this._matrix),n.mat4.translate(g,g,x),o.
fromMat4(t,g)},getNodeToParentTransformAR:function(t){return t||
(t=o.identity()),this._updateLocalMatrix(),o.fromMat4(t,this._matrix)},getNodeToWor
ldTransform:function(t){t||(t=o.identity()),this._updateWorldMatrix();var
e=this._contentSize;return x.x=-this._anchorPoint.x*e.width,x.y=-
this._anchorPoint.y*e.height,n.mat4.copy(g,this._worldMatrix),n.mat4.translate(g,g,
x),o.fromMat4(t,g)},getNodeToWorldTransformAR:function(t){return t||
(t=o.identity()),this._updateWorldMatrix(),o.fromMat4(t,this._worldMatrix)},getPare
ntToNodeTransform:function(t){return t||
(t=o.identity()),this._updateLocalMatrix(),n.mat4.invert(g,this._matrix),o.fromMat4
(t,g)},getWorldToNodeTransform:function(t){return t||
(t=o.identity()),this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix),o.fro
mMat4(t,g)},convertTouchToNodeSpace:function(t){return
this.convertToNodeSpace(t.getLocation())},convertTouchToNodeSpaceAR:function(t)
{return this.convertToNodeSpaceAR(t.getLocation())},getBoundingBox:function()
{this._updateLocalMatrix();var
t=this._contentSize.width,e=this._contentSize.height,i=cc.rect(-
this._anchorPoint.x*t,-this._anchorPoint.y*e,t,e);return
i.transformMat4(i,this._matrix)},getBoundingBoxToWorld:function(){return
this._parent?
(this._parent._updateWorldMatrix(),this._getBoundingBoxTo(this._parent._worldMatrix
)):this.getBoundingBox()},_getBoundingBoxTo:function(t)
{this._updateLocalMatrix();var
e=this._contentSize.width,i=this._contentSize.height,r=cc.rect(-
this._anchorPoint.x*e,-
this._anchorPoint.y*i,e,i);t=n.mat4.mul(this._worldMatrix,t,this._matrix);if(r.tran
sformMat4(r,t),!this._children)return r;for(var s=this._children,a=0;a<s.length;a+
+){var o=s[a];if(o&&o.active){var l=o._getBoundingBoxTo(t);l&&r.union(r,l)}}return
r},_updateOrderOfArrival:function(){var t=this._parent?+
+this._parent._childArrivalOrder:0;if(this._localZOrder=4294901760&this._localZOrde
r|t,65535===t){var e=this._parent._children;e.forEach((function(t,e)
{t._localZOrder=4294901760&t._localZOrder|
e+1})),this._parent._childArrivalOrder=e.length}},addChild:function(t,e,i)
{cc.assertID(t,1606),cc.assertID(null===t._parent,1605),t.parent=this,void 0!
==e&&(t.zIndex=e),void 0!==i&&(t.name=i)},cleanup:function()
{m&&cc.director.getActionManager().removeAllActionsFromTarget(this),l.removeListene
rs(this);var t,e,i=this._children.length;for(t=0;t<i;++t)
(e=this._children[t])&&e.cleanup()},sortAllChildren:function()
{if(this._reorderChildDirty){l._setDirtyForNode(this),this._reorderChildDirty=!
1;var t=this._children;if(t.length>1){var e,i,n,r=t.length;for(e=1;e<r;e++)
{for(n=t[e],i=e-
1;i>=0&&n._localZOrder<t[i]._localZOrder;)t[i+1]=t[i],i--;t[i+1]=n}this.emit(T.CHIL
D_REORDER,this)}cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllCh
ildren,this)}},_delaySort:function(){this._reorderChildDirty||
(this._reorderChildDirty=!
0,cc.director.__fastOn(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this))},
_restoreProperties:!1,onRestore:!1};var
j=cc.Class(U),W=j.prototype;c.getset(W,"position",W.getPosition,W.setPosition,!1,!
0),cc.Node=e.exports=j}),{"./event-manager":130,"./event/event":133,"./event/event-
target":132,"./platform/CCMacro":205,"./platform/js":220,"./renderer/render-
flow":244,"./utils/affine-transform":285,"./utils/base-node":286,"./utils/math-
pools":294,"./utils/prefab-helper":297,"./vmath":316}],53:[(function(t,e,i){"use
strict";var n=t("./CCNode"),r=t("./renderer/render-
flow"),s=(cc.Object.Flags.HideInHierarchy,n._LocalDirtyFlag),a=cc.Class({name:"cc.P
rivateNode",extends:n,properties:{x:{get:function(){return
this._originPos.x},set:function(t){var e=this._originPos;t!
==e.x&&(e.x=t,this._posDirty(!0))},override:!0},y:{get:function(){return
this._originPos.y},set:function(t){var e=this._originPos;t!
==e.y&&(e.y=t,this._posDirty(!0))},override:!0},zIndex:{get:function(){return
cc.macro.MIN_ZINDEX},set:function(){cc.warnID(1638)},override:!0},showInEditor:
{default:!1,editorOnly:!0,override:!0}},ctor:function(t)
{this._localZOrder=cc.macro.MIN_ZINDEX<<16,this._originPos=cc.v2()},_posDirty:funct
ion(t){this.setLocalDirty(s.POSITION),this._renderFlag|=r.FLAG_TRANSFORM,!
0===t&&1&this._eventMask&&this.emit(n.EventType.POSITION_CHAN
GED)},_updateLocalMatrix:function(){if(this._localMatDirty){var
t=this.parent;t&&(this._position.x=this._originPos.x-
(t._anchorPoint.x-.5)*t._contentSize.width,this._position.y=this._originPos.y-
(t._anchorPoint.y-.5)*t._contentSize.height),this._super()}},getPosition:function()
{return new cc.Vec2(this._originPos)},setPosition:function(t,e){void
0===e&&(e=(t=t.x).y);var i=this._originPos;i.x===t&&i.y===e||
(i.x=t,i.y=e,this._posDirty(!0))},setParent:function(t){var
e=this._parent;this._super(t),e!
==t&&(e&&e.off(n.EventType.ANCHOR_CHANGED,this._posDirty,this),t&&t.on(n.EventType.
ANCHOR_CHANGED,this._posDirty,this))},_updateOrderOfArrival:function()
{}});cc.js.getset(a.prototype,"parent",a.prototype.getParent,a.prototype.setParent)
,cc.js.getset(a.prototype,"position",a.prototype.getPosition,a.prototype.setPositio
n),cc.PrivateNode=e.exports=a}),{"./CCNode":52,"./renderer/render-flow":244}],54:
[(function(t,e,i){"use
strict";cc.Scene=cc.Class({name:"cc.Scene",extends:t("./CCNode"),properties:
{_is3DNode:{default:!0,override:!0},autoReleaseAssets:{default:void
0,type:cc.Boolean}},ctor:function()
{this._anchorPoint.x=0,this._anchorPoint.y=0,this._activeInHierarchy=!
1,this._inited=!cc.game._isCloning,this.dependAssets=null},destroy:function()
{if(cc.Object.prototype.destroy.call(this))for(var t=this._children,e=0;e<t.length;
++e)t[e].active=!1;this._active=!1,this._activeInHierarchy=!
1},_onHierarchyChanged:function(){},_instantiate:null,_load:function()
{this._inited||(this._onBatchCreated(),this._inited=!0)},_activate:function(t){t=!
1!==t,cc.director._nodeActivator.activateNode(this,t)}}),e.exports=cc.Scene}),
{"./CCNode":52}],55:[(function(t,e,i){"use strict";var
n=t("./platform/js"),r=new(t("./platform/id-generater"))
("Scheduler"),s=function(t,e,i,n)
{this.target=t,this.priority=e,this.paused=i,this.markedForDeletion=n},a=[];s.get=f
unction(t,e,i,n){var r=a.pop();return r?
(r.target=t,r.priority=e,r.paused=i,r.markedForDeletion=n):r=new
s(t,e,i,n),r},s.put=function(t){a.length<20&&(t.target=null,a.push(t))};var
o=function(t,e,i,n)
{this.list=t,this.entry=e,this.target=i,this.callback=n},l=[];o.get=function(t,e,i,
n){var r=l.pop();return r?(r.list=t,r.entry=e,r.target=i,r.callback=n):r=new
o(t,e,i,n),r},o.put=function(t)
{l.length<20&&(t.list=t.entry=t.target=t.callback=null,l.push(t))};var
h=function(t,e,i,n,r,s){var
a=this;a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged
=r,a.paused=s},c=[];function u(){this._lock=!1,this._scheduler=null,this._elapsed=-
1,this._runForever=!1,this._useDelay=!
1,this._timesExecuted=0,this._repeat=0,this._delay=0,this._interval=0,this._target=
null,this._callback=null}h.get=function(t,e,i,n,r,s){var a=c.pop();return a?
(a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged=r,a.p
aused=s):a=new h(t,e,i,n,r,s),a},h.put=function(t)
{c.length<20&&(t.timers=t.target=t.currentTimer=null,c.push(t))};var
_=u.prototype;_.initWithCallback=function(t,e,i,n,r,s){return this._lock=!
1,this._scheduler=t,this._target=i,this._callback=e,this._elapsed=-
1,this._interval=n,this._delay=s,this._useDelay=this._delay>0,this._repeat=r,this._
runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},_.getInterval=function()
{return this._interval},_.setInterval=function(t)
{this._interval=t},_.update=function(t){-1===this._elapsed?
(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=t,this._runForever&&!
this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):
(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-
=this._delay,this._timesExecuted+=1,this._useDelay=!
1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecut
ed+=1),this._callback&&!
this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},_.getCallback=
function(){return this._callback},_.trigger=function()
{this._target&&this._callback&&(this._lock=!
0,this._callback.call(this._target,this._elapsed),this._lock=!
1)},_.cancel=function()
{this._scheduler.unschedule(this._callback,this._target)};var f=[];u.get=function()
{return f.pop()||new u},u.put=function(t){f.length<20&&!
t._lock&&(t._scheduler=t._target=t._callback=null,f.push(t))},cc.Scheduler=function
()
{this._timeScale=1,this._updatesNegList=[],this._updates0List=[],this._updatesPosLi
st=[],this._hashForUpdates=n.createMap(!0),this._hashForTimers=n.createMap(!
0),this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!
1,this._arrayForTimers=[]},cc.Scheduler.prototype={constructor:cc.Scheduler,_remove
HashElement:function(t){delete this._hashForTimers[t.target._id];for(var
e=this._arrayForTimers,i=0,n=e.length;i<n;i++)if(e[i]===t)
{e.splice(i,1);break}h.put(t)},_removeUpdateFromHash:function(t){var
e=t.target._id,i=this._hashForUpdates[e];if(i){for(var
n=i.list,r=i.entry,a=0,l=n.length;a<l;a++)if(n[a]===r){n.splice(a,1);break}delete
this._hashForUpdates[e],s.put(r),o.put(i)}},_priorityIn:function(t,e,i){for(var
n=0;n<t.length;n++)if(i<t[n].priority)return void
t.splice(n,0,e);t.push(e)},_appendIn:function(t,e)
{t.push(e)},enableForTarget:function(t){t._id||(t.__instanceId?
cc.warnID(1513):t._id=r.getNewId())},setTimeScale:function(t)
{this._timeScale=t},getTimeScale:function(){return
this._timeScale},update:function(t){var e,i,n,r;for(this._updateHashLocked=!0,1!
==this._timeScale&&(t*=this._timeScale),e=0,n=(i=this._updatesNegList).length;e<n;e
++)(r=i[e]).paused||r.markedForDeletion||
r.target.update(t);for(e=0,n=(i=this._updates0List).length;e<n;e++)
(r=i[e]).paused||r.markedForDeletion||
r.target.update(t);for(e=0,n=(i=this._updatesPosList).length;e<n;e++)
(r=i[e]).paused||r.markedForDeletion||r.target.update(t);var
s,a=this._arrayForTimers;for(e=0;e<a.length;e++)
{if(s=a[e],this._currentTarget=s,this._currentTargetSalvaged=!1,!
s.paused)for(s.timerIndex=0;s.timerIndex<s.timers.length;+
+s.timerIndex)s.currentTimer=s.timers[s.timerIndex],s.currentTimerSalvaged=!
1,s.currentTimer.update(t),s.currentTimer=null;this._currentTargetSalvaged&&0===thi
s._currentTarget.timers.length&&(this._removeHashElement(this._currentTarget),--
e)}for(e=0,i=this._updatesNegList;e<i.length;)(r=i[e]).markedForDeletion?
this._removeUpdateFromHash(r):e++;for(e=0,i=this._updates0List;e<i.length;)
(r=i[e]).markedForDeletion?this._removeUpdateFromHash(r):e+
+;for(e=0,i=this._updatesPosList;e<i.length;)(r=i[e]).markedForDeletion?
this._removeUpdateFromHash(r):e++;this._updateHashLocked=!
1,this._currentTarget=null},schedule:function(t,e,i,n,r,s){if("function"!=typeof t)
{var a=t;t=e,e=a}4!==arguments.length&&5!==arguments.length||(s=!!
n,n=cc.macro.REPEAT_FOREVER,r=0),cc.assertID(e,1502);var o=e._id;o||
(e.__instanceId?(cc.warnID(1513),o=e._id=e.__instanceId):cc.errorID(1510));var
l,c,_=this._hashForTimers[o];if(_?_.paused!==s&&cc.warnID(1511):
(_=h.get(null,e,0,null,null,s),this._arrayForTimers.push(_),this._hashForTimers[o]=
_),null==_.timers)_.timers=[];else for(c=0;c<_.timers.length;+
+c)if((l=_.timers[c])&&t===l._callback)return
cc.logID(1507,l.getInterval(),i),void(l._interval=i);
(l=u.get()).initWithCallback(this,t,e,i,n,r),_.timers.push(l),this._currentTarget==
=_&&this._currentTargetSalvaged&&(this._currentTargetSalvaged=!
1)},scheduleUpdate:function(t,e,i){var n=t._id;n||(t.__instanceId?
(cc.warnID(1513),n=t._id=t.__instanceId):cc.errorID(1510));var
r=this._hashForUpdates[n];if(r&&r.entry){if(r.entry.priority===e)return
r.entry.markedForDeletion=!
1,void(r.entry.paused=i);if(this._updateHashLocked)return
cc.logID(1506),r.entry.markedForDeletion=!
1,void(r.entry.paused=i);this.unscheduleUpdate(t)}var a,l=s.get(t,e,i,!1);0===e?
(a=this._updates0List,this._appendIn(a,l)):(a=e<0?
this._updatesNegList:this._updatesPosList,this._priorityIn(a,l,e)),this._hashForUpd
ates[n]=o.get(a,l,t,null)},unschedule:function(t,e){if(e&&t){var i=e._id;i||
(e.__instanceId?(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var
n=this._hashForTimers[i];if(n)for(var r=n.timers,s=0,a=r.length;s<a;s++){var
o=r[s];if(t===o._callback)return o!==n.currentTimer||n.currentTimerSalvaged||
(n.currentTimerSalvaged=!
0),r.splice(s,1),u.put(o),n.timerIndex>=s&&n.timerIndex--,void(0===r.length&&(this.
_currentTarget===n?this._currentTargetSalvaged=!
0:this._removeHashElement(n)))}}},unscheduleUpdate:function(t){if(t){var
e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForUpdates[e];i&&(this._updateHashLocked?i.entry.markedForDeletion=!
0:this._removeUpdateFromHash(i.entry))}},unscheduleAllForTarget:function(t){if(t)
{var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!
i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,s=n.length;r<s;r+
+)u.put(n[r]);n.length=0,this._currentTarget===i?this._currentTargetSalvaged=!
0:this._removeHashElement(i)}this.unscheduleUpdate(t)}},unscheduleAll:function()
{this.unscheduleAllWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},unscheduleAllWith
MinPriority:function(t){var e,i,n,r=this._arrayForTimers;for(e=r.length-
1;e>=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var
s=0;if(t<0)for(e=0;e<this._updatesNegList.length;)s=this._updatesNegList.length,
(n=this._updatesNegList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==this
._updatesNegList.length&&e+
+;if(t<=0)for(e=0;e<this._updates0List.length;)s=this._updates0List.length,
(n=this._updates0List[e])&&this.unscheduleUpdate(n.target),s==this._updates0List.le
ngth&&e++;for(e=0;e<this._updatesPosList.length;)s=this._updatesPosList.length,
(n=this._updatesPosList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==this
._updatesPosList.length&&e++},isScheduled:function(t,e)
{cc.assertID(t,1508),cc.assertID(e,1509);var i=e._id;i||(e.__instanceId?
(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var
n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var
r=n.timers,s=0;s<r.length;++s){if(t===r[s]._callback)return!0}return!
1},pauseAllTargets:function(){return

this.pauseAllTargetsWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},pauseAllTargetsW
ithMinPriority:function(t){var
e,i,n,r,s=[],a=this._arrayForTimers;for(i=0,n=a.length;i<n;i++)
(e=a[i])&&(e.paused=!
0,s.push(e.target));if(t<0)for(i=0;i<this._updatesNegList.length;i++)
(r=this._updatesNegList[i])&&r.priority>=t&&(r.paused=!
0,s.push(r.target));if(t<=0)for(i=0;i<this._updates0List.length;i++)
(r=this._updates0List[i])&&(r.paused=!
0,s.push(r.target));for(i=0;i<this._updatesPosList.length;i++)
(r=this._updatesPosList[i])&&r.priority>=t&&(r.paused=!0,s.push(r.target));return
s},resumeTargets:function(t){if(t)for(var e=0;e<t.length;e+
+)this.resumeTarget(t[e])},pauseTarget:function(t){cc.assertID(t,1503);var
e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];i&&(i.paused=!0);var
n=this._hashForUpdates[e];n&&(n.entry.paused=!0)},resumeTarget:function(t)
{cc.assertID(t,1504);var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];i&&(i.paused=!1);var
n=this._hashForUpdates[e];n&&(n.entry.paused=!1)},isTargetPaused:function(t)
{cc.assertID(t,1505);var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];if(i)return i.paused;var
n=this._hashForUpdates[e];return!!
n&&n.entry.paused}},cc.Scheduler.PRIORITY_SYSTEM=1<<31,cc.Scheduler.PRIORITY_NON_SY
STEM=cc.Scheduler.PRIORITY_SYSTEM+1,e.exports=cc.Scheduler}),{"./platform/id-
generater":216,"./platform/js":220}],56:[(function(t,e,i){"use strict";var
n=t("./CCRawAsset");cc.Asset=cc.Class({name:"cc.Asset",extends:n,ctor:function()
{this.loaded=!0},properties:{nativeUrl:{get:function(){if(this._native){var
t=this._native;if(47===t.charCodeAt(0))return t.slice(1);if(cc.AssetLibrary){var
e=cc.AssetLibrary.getLibUrlNoExt(this._uuid,!0);return 46===t.charCodeAt(0)?
e+t:e+"/"+t}cc.errorID(6400)}return""},visible:!1},_native:"",_nativeAsset:
{get:function(){return this._$nativeAsset},set:function(t)
{this._$nativeAsset=t}}},statics:{deserialize:!1,preventDeferredLoadDependents:!
1,preventPreloadNativeObject:!1},toString:function(){return
this.nativeUrl},serialize:!1,createNode:null,_setRawAsset:function(t,e)
{this._native=!1!==e?t||void 0:"/"+t}}),e.exports=cc.Asset}),
{"./CCRawAsset":65}],57:[(function(t,e,i){"use strict";var
n=t("./CCAsset"),r=t("../event/event-
target"),s=cc.Enum({WEB_AUDIO:0,DOM_AUDIO:1}),a=cc.Class({name:"cc.AudioClip",exten
ds:n,mixins:[r],ctor:function(){this.loaded=!1,this._audio=null},properties:
{loadMode:{default:s.WEB_AUDIO,type:s},_nativeAsset:{get:function(){return
this._audio},set:function(t){t instanceof cc.AudioClip?
this._audio=t._nativeAsset:this._audio=t,this._audio&&(this.loaded=!
0,this.emit("load"))},override:!0}},statics:{LoadMode:s,_loadByUrl:function(t,e)
{var i=cc.loader.getItem(t)||cc.loader.getItem(t+"?useDom=1");i&&i.complete?
i._owner instanceof a?e(null,i._owner):e(null,i.content):cc.loader.load(t,
(function(n,r){if(n)return e(n);i=cc.loader.getItem(t)||cc.loader.getItem(t+"?
useDom=1"),e(null,i.content)}))}},destroy:function()
{cc.audioEngine.uncache(this),this._super()}});cc.AudioClip=a,e.exports=a}),
{"../event/event-target":132,"./CCAsset":56}],58:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.BitmapFont",extends:cc.Font,properties:{fntDataStr:
{default:""},spriteFrame:{default:null,type:cc.SpriteFrame},fontSize:{default:-
1},_fntConfig:null}});cc.BitmapFont=n,e.exports=n}),{}],59:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.BufferAsset",extends:cc.Asset,ctor:function()
{this._buffer=null},properties:{_nativeAsset:{get:function(){return
this._buffer},set:function(t){this._buffer=t.buffer||t},override:!
0},buffer:function(){return this._buffer}}});cc.BufferAsset=e.exports=n}),{}],60:
[(function(t,e,i){"use strict";var
n=t("./CCAsset"),r=cc.Class({name:"cc.EffectAsset",extends:n,properties:
{properties:Object,techniques:[],shaders:[]},onLoad:function(){for(var
t=cc.renderer._forward._programLib,e=0;e<this.shaders.length;e+
+)t.define(this.shaders[e])}});e.exports=cc.EffectAsset=r}),{"./CCAsset":56}],61:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Font",extends:cc.Asset});cc.Font=e.exports=n}),{}],62:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.JsonAsset",extends:cc.Asset,properties:
{json:null}});e.exports=cc.JsonAsset=n}),{}],63:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelAtlas",extends:cc.BitmapFont});cc.LabelAtlas=n,e.exports=
n}),{}],64:[(function(t,e,i){"use strict";var
n=cc.Enum({AUTO:0,SINGLE_INSTANCE:1,MULTI_INSTANCE:2}),r=cc.Class({name:"cc.Prefab"
,extends:cc.Asset,ctor:function()
{this._createFunction=null,this._instantiatedTimes=0},properties:
{data:null,optimizationPolicy:n.AUTO,asyncLoadAssets:!1,readonly:{default:!
1,editorOnly:!0}},statics:
{OptimizationPolicy:n,OptimizationPolicyThreshold:3},createNode:!
1,compileCreateFunction:function(){var e=t("../platform/instantiate-
jit");this._createFunction=e.compile(this.data)},_doInstantiate:function(t){return
this.data._prefab?this.data._prefab._synced=!
0:cc.warnID(3700),this._createFunction||
this.compileCreateFunction(),this._createFunction(t)},_instantiate:function(){var
t;return this.optimizationPolicy!
==n.SINGLE_INSTANCE&&(this.optimizationPolicy===n.MULTI_INSTANCE||
this._instantiatedTimes+1>=r.OptimizationPolicyThreshold)?
(t=this._doInstantiate(),this.data._instantiate(t)):(this.data._prefab._synced=!
0,t=this.data._instantiate()),+
+this._instantiatedTimes,t}});cc.Prefab=e.exports=r,cc.js.obsolete(cc,"cc._Prefab",
"Prefab")}),{"../platform/instantiate-jit":218}],65:[(function(t,e,i){"use
strict";var
n=t("../platform/CCObject"),r=t("../platform/js");cc.RawAsset=cc.Class({name:"cc.Ra
wAsset",extends:n,ctor:function(){Object.defineProperty(this,"_uuid",
{value:"",writable:!0})}}),r.value(cc.RawAsset,"isRawAssetType",(function(t){return
r.isChildClassOf(t,cc.RawAsset)&&!
r.isChildClassOf(t,cc.Asset)})),r.value(cc.RawAsset,"wasRawAssetType",(function(t)
{return t===cc.Texture2D||t===cc.AudioClip||t===cc.ParticleAsset||
t===cc.Asset})),e.exports=cc.RawAsset}),
{"../platform/CCObject":206,"../platform/js":220}],66:[(function(t,e,i){"use
strict";var n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../renderer/gfx"));var
r=t("../renderer"),s=t("./CCTexture2D"),a=cc.Class({name:"cc.RenderTexture",extends
:s,ctor:function(){this._framebuffer=null},initWithSize:function(t,e,i)
{this.width=Math.floor(t||cc.visibleRect.width),this.height=Math.floor(e||
cc.visibleRect.height),this._resetUnderlyingMipmaps();var s={colors:
[this._texture]};this._depthStencilBuffer&&this._depthStencilBuffer.destroy();var
a=void 0;i&&(a=new
n.default.RenderBuffer(r.device,i,t,e),i===n.default.RB_FMT_D24S8?
s.depthStencil=a:i===n.default.RB_FMT_S8?
s.stencil=a:i===n.default.RB_FMT_D16&&(s.depth=a)),this._depthStencilBuffer=a,this.
_framebuffer&&this._framebuffer.destroy(),this._framebuffer=new
n.default.FrameBuffer(r.device,t,e,s),this.loaded=!
0,this.emit("load")},updateSize:function(t,e){this.width=Math.floor(t||
cc.visibleRect.width),this.height=Math.floor(e||
cc.visibleRect.height),this._resetUnderlyingMipmaps();var
i=this._depthStencilBuffer;i&&i.update(this.width,this.height),this._framebuffer._w
idth=t,this._framebuffer._height=e},drawTextureAt:function(t,e,i)
{t._image&&this._texture.updateSubImage({x:e,y:i,image:t._image,width:t.width,heigh
t:t.height,level:0,flipY:!
1,premultiplyAlpha:t._premultiplyAlpha})},readPixels:function(t,e,i,n,s){if(!
this._framebuffer||!this._texture)return t;e=e||0,i=i||0;var a=n||this.width,o=s||
this.height;t=t||new Uint8Array(a*o*4);var
l=r._forward._device._gl,h=l.getParameter(l.FRAMEBUFFER_BINDING);return
l.bindFramebuffer(l.FRAMEBUFFER,this._framebuffer._glID),l.readPixels(e,i,a,o,l.RGB
A,l.UNSIGNED_BYTE,t),l.bindFramebuffer(l.FRAMEBUFFER,h),t},destroy:function()
{this._super(),this._framebuffer&&this._framebuffer.destroy()}});cc.RenderTexture=e
.exports=a}),{"../../renderer/gfx":348,"../renderer":243,"./CCTexture2D":73}],67:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.SceneAsset",extends:cc.Asset,properties:
{scene:null,asyncLoadAssets:void 0}});cc.SceneAsset=n,e.exports=n}),{}],68:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Script",extends:cc.Asset});cc._Script=n;var
r=cc.Class({name:"cc.JavaScript",extends:n});cc._JavaScript=r;var
s=cc.Class({name:"cc.CoffeeScript",extends:n});cc._CoffeeScript=s;var
a=cc.Class({name:"cc.TypeScript",extends:n});cc._TypeScript=a}),{}],69:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.SpriteAtlas",extends:cc.Asset,properties:{_spriteFrames:
{default:{}}},getTexture:function(){var
t=Object.keys(this._spriteFrames);if(t.length>0){var
e=this._spriteFrames[t[0]];return e?e.getTexture():null}return
null},getSpriteFrame:function(t){var e=this._spriteFrames[t];return e?(e.name||
(e.name=t),e):null},getSpriteFrames:function(){var
t=[],e=this._spriteFrames;for(var i in e)t.push(this.getSpriteFrame(i));return
t}});cc.SpriteAtlas=n,e.exports=n}),{}],70:[(function(t,e,i){"use strict";var
n=t("../event/event-target"),r=t("../utils/texture-util"),s=[{u:0,v:0},{u:0,v:0},
{u:0,v:0},
{u:0,v:0}],a=cc.Class({name:"cc.SpriteFrame",extends:t("../assets/CCAsset"),mixins:
[n],properties:{_textureSetter:{set:function(t){t&&(this._texture!
==t&&this._refreshTexture(t),this._textureFilename=t.url)}},insetTop:
{get:function(){return this._capInsets[1]},set:function(t)
{this._capInsets[1]=t,this._texture&&this._calculateSlicedUV()}},insetBottom:
{get:function(){return this._capInsets[3]},set:function(t)
{this._capInsets[3]=t,this._texture&&this._calculateSlicedUV()}},insetLeft:
{get:function(){return this._capInsets[0]},set:function(t)
{this._capInsets[0]=t,this._texture&&this._calculateSlicedUV()}},insetRight:
{get:function(){return this._capInsets[2]},set:function(t)
{this._capInsets[2]=t,this._texture&&this._calculateSlicedUV()}}},ctor:function()
{n.call(this);var

t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3],s=arguments[4];this._re
ct=null,this.uv=[],this._texture=null,this._original=null,this._offset=null,this._o
riginalSize=null,this._rotated=!
1,this.vertices=null,this._capInsets=[0,0,0,0],this.uvSliced=[],this._textureFilena
me="",void 0!==t&&this.setTexture(t,e,i,r,s)},textureLoaded:function(){return
this._texture&&this._texture.loaded},isRotated:function(){return
this._rotated},setRotated:function(t)
{this._rotated=t,this._texture&&this._calculateUV()},getRect:function(){return
cc.rect(this._rect)},setRect:function(t)
{this._rect=t,this._texture&&this._calculateUV()},getOriginalSize:function(){return
cc.size(this._originalSize)},setOriginalSize:function(t){this._originalSize?
(this._originalSize.width=t.width,this._originalSize.height=t.height):this._origina
lSize=cc.size(t)},getTexture:function(){return
this._texture},_textureLoadedCallback:function(){var t=this._texture;if(t){var
e=t.width,i=t.height;this._rotated&&cc.game.renderType===cc.game.RENDER_TYPE_CANVAS
&&(this._rotated=!
1,e=this._texture.width,i=this._texture.height,this._rect=cc.rect(0,0,e,i)),this._r
ect?this._checkRect(this._texture):this._rect=cc.rect(0,0,e,i),this._originalSize||
this.setOriginalSize(cc.size(e,i)),this._offset||
this.setOffset(cc.v2(0,0)),this._calculateUV(),this.emit("load")}},_refreshTexture:
function(t){this._texture=t,t.loaded?
this._textureLoadedCallback():t.once("load",this._textureLoadedCallback,this)},getO
ffset:function(){return cc.v2(this._offset)},setOffset:function(t)
{this._offset=cc.v2(t)},clone:function(){return new a(this._texture||
this._textureFilename,this._rect,this._rotated,this._offset,this._originalSize)},se
tTexture:function(t,e,i,n,r){this._rect=e||null,n?
this.setOffset(n):this._offset=null,r?
this.setOriginalSize(r):this._originalSize=null,this._rotated=i||!1;var
s=t;return"string"==typeof s&&s&&(this._textureFilename=s,this._loadTexture()),s
instanceof cc.Texture2D&&this._texture!==s&&this._refreshTexture(s),!
0},_loadTexture:function(){if(this._textureFilename){var
t=r.loadImage(this._textureFilename);this._refreshTexture(t)}},ensureLoadTexture:fu
nction(){this._texture?this._texture.loaded||
(this._refreshTexture(this._texture),r.postLoadTexture(this._texture)):this._textur
eFilename&&this._loadTexture()},clearTexture:function()
{this._texture=null},_checkRect:function(t){var
e=this._rect,i=e.x,n=e.y;this._rotated?(i+=e.height,n+=e.width):
(i+=e.width,n+=e.height),i>t.width&&cc.errorID(3300,t.url+"/"+this.name,i,t.width),
n>t.height&&cc.errorID(3400,t.url+"/"+this.name,n,t.height)},_calculateSlicedUV:fun
ction(){var
t=this._rect,e=this._texture.width,i=this._texture.height,n=this._capInsets[0],r=th
is._capInsets[2],a=t.width-n-
r,o=this._capInsets[1],l=this._capInsets[3],h=t.height-o-
l,c=this.uvSliced;if(c.length=0,this._rotated)
{s[0].u=t.x/e,s[1].u=(t.x+l)/e,s[2].u=(t.x+l+h)/e,s[3].u=(t.x+t.height)/e,s[3].v=t.
y/i,s[2].v=(t.y+n)/i,s[1].v=(t.y+n+a)/i,s[0].v=(t.y+t.width)/i;for(var u=0;u<4;+
+u)for(var _=s[u],f=0;f<4;++f){var d=s[3-
f];c.push({u:_.u,v:d.v})}}else{s[0].u=t.x/e,s[1].u=(t.x+n)/e,s[2].u=(t.x+n+a)/e,s[3
].u=(t.x+t.width)/e,s[3].v=t.y/i,s[2].v=(t.y+o)/i,s[1].v=(t.y+o+h)/i,s[0].v=(t.y+t.
height)/i;for(var m=0;m<4;++m)for(var p=s[m],v=0;v<4;++v){var
y=s[v];c.push({u:y.u,v:p.v})}}},_setDynamicAtlasFrame:function(t)
{t&&(this._original={_texture:this._texture,_x:this._rect.x,_y:this._rect.y},this._
texture=t.texture,this._rect.x=t.x,this._rect.y=t.y,this._calculateUV())},_resetDyn
amicAtlasFrame:function()
{this._original&&(this._rect.x=this._original._x,this._rect.y=this._original._y,thi
s._texture=this._original._texture,this._original=null,this._calculateUV())},_calcu
lateUV:function(){var
t=this._rect,e=this._texture,i=this.uv,n=e.width,r=e.height;if(this._rotated){var
s=0===n?0:t.x/n,a=0===n?0:(t.x+t.height)/n,o=0===r?0:(t.y+t.width)/r,l=0===r?
0:t.y/r;i[0]=s,i[1]=l,i[2]=s,i[3]=o,i[4]=a,i[5]=l,i[6]=a,i[7]=o}else{var h=0===n?
0:t.x/n,c=0===n?0:(t.x+t.width)/n,u=0===r?0:(t.y+t.height)/r,_=0===r?
0:t.y/r;i[0]=h,i[1]=u,i[2]=c,i[3]=u,i[4]=h,i[5]=_,i[6]=c,i[7]=_}var
f=this.vertices;if(f){f.nu.length=0,f.nv.length=0;for(var d=0;d<f.u.length;d+
+)f.nu[d]=f.u[d]/n,f.nv[d]=f.v[d]/r}this._calculateSlicedUV()},_serialize:!
1,_deserialize:function(t,e){var i=t.rect;i&&(this._rect=new
cc.Rect(i[0],i[1],i[2],i[3])),t.offset&&this.setOffset(new
cc.Vec2(t.offset[0],t.offset[1])),t.originalSize&&this.setOriginalSize(new
cc.Size(t.originalSize[0],t.originalSize[1])),this._rotated=1===t.rotated,this._nam
e=t.name;var
n=t.capInsets;n&&(this._capInsets[0]=n[0],this._capInsets[1]=n[1],this._capInsets[2
]=n[2],this._capInsets[3]=n[3]),this.vertices=t.vertices,this.vertices&&(this.verti
ces.nu=[],this.vertices.nv=[]);var
r=t.texture;r&&e.result.push(this,"_textureSetter",r)}}),o=a.prototype;o.copyWithZo
ne=o.clone,o.copy=o.clone,o.initWithTexture=o.setTexture,cc.SpriteFrame=a,e.exports
=a}),{"../assets/CCAsset":56,"../event/event-target":132,"../utils/texture-
util":302}],71:[(function(t,e,i){"use strict";var
n=t("./CCFont"),r=cc.Class({name:"cc.TTFFont",extends:n,properties:
{_fontFamily:null,_nativeAsset:{type:cc.String,get:function(){return
this._fontFamily},set:function(t){this._fontFamily=t||"Arial"},override:!
0}}});cc.TTFFont=e.exports=r}),{"./CCFont":61}],72:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.TextAsset",extends:cc.Asset,properties:
{text:""},toString:function(){return this.text}});e.exports=cc.TextAsset=n}),
{}],73:[(function(t,e,i){"use strict";var n=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../../renderer/gfx"));var r=t("../event/event-
target"),s=t("../renderer");t("../platform/CCClass");var a=new(t("../platform/id-
generater"))
("Tex"),o=cc.Enum({RGB565:n.default.TEXTURE_FMT_R5_G6_B5,RGB5A1:n.default.TEXTURE_F
MT_R5_G5_B5_A1,RGBA4444:n.default.TEXTURE_FMT_R4_G4_B4_A4,RGB888:n.default.TEXTURE_
FMT_RGB8,RGBA8888:n.default.TEXTURE_FMT_RGBA8,RGBA32F:n.default.TEXTURE_FMT_RGBA32F
,A8:n.default.TEXTURE_FMT_A8,I8:n.default.TEXTURE_FMT_L8,AI8:n.default.TEXTURE_FMT_
L8_A8,RGB_PVRTC_2BPPV1:n.default.TEXTURE_FMT_RGB_PVRTC_2BPPV1,RGBA_PVRTC_2BPPV1:n.d
efault.TEXTURE_FMT_RGBA_PVRTC_2BPPV1,RGB_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGB_PVR
TC_4BPPV1,RGBA_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGBA_PVRTC_4BPPV1,RGB_ETC1:n.defa
ult.TEXTURE_FMT_RGB_ETC1,RGBA_ETC1:1024,RGB_ETC2:n.default.TEXTURE_FMT_RGB_ETC2,RGB
A_ETC2:n.default.TEXTURE_FMT_RGBA_ETC2}),l=cc.Enum({REPEAT:10497,CLAMP_TO_EDGE:3307
1,MIRRORED_REPEAT:33648}),h=cc.Enum({LINEAR:9729,NEAREST:9728}),c={9728:0,9729:1},u
=[],_={width:void 0,height:void 0,minFilter:void 0,magFilter:void 0,wrapS:void
0,wrapT:void 0,format:void 0,mipmap:void 0,images:void 0,image:void 0,flipY:void
0,premultiplyAlpha:void 0};function f(){for(var t in _)_[t]=void 0;return
u.length=0,_.images=u,_.flipY=!1,_}var
d=cc.Class({name:"cc.Texture2D",extends:t("../assets/CCAsset"),mixins:
[r],properties:{_nativeAsset:{get:function(){return this._image},set:function(t)
{t._compressed&&t._data?
this.initWithData(t._data,this._format,t.width,t.height):this.initWithElement(t)},o
verride:!0},_hasMipmap:!1,_format:o.RGBA8888,_premultiplyAlpha:!1,_flipY:!
1,_minFilter:h.LINEAR,_magFilter:h.LINEAR,_mipFilter:h.LINEAR,_wrapS:l.CLAMP_TO_EDG
E,_wrapT:l.CLAMP_TO_EDGE},statics:
{PixelFormat:o,WrapMode:l,Filter:h,_FilterIndex:c,extnames:
[".png",".jpg",".jpeg",".bmp",".webp",".pvr",".pkm"]},ctor:function()
{this._id=a.getNewId(),this.url="",this.loaded=!
1,this.width=0,this.height=0,this._hashDirty=!
0,this._hash=0,this._texture=null},getImpl:function(){return
this._texture},getId:function(){return this._id},toString:function(){return
this.url||""},update:function(t){if(t){var e=!1;void 0!
==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!
==t.minFilter&&(this._minFilter=t.minFilter,t.minFilter=c[t.minFilter]),void 0!
==t.magFilter&&(this._magFilter=t.magFilter,t.magFilter=c[t.magFilter]),void 0!
==t.mipFilter&&(this._mipFilter=t.mipFilter,t.mipFilter=c[t.mipFilter]),void 0!
==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!
==t.format&&(this._format=t.format),void 0!==t.flipY&&(this._flipY=t.flipY,e=!
0),void 0!==t.premultiplyAlpha&&(this._premultiplyAlpha=t.premultiplyAlpha,e=!
0),void 0!
==t.mipmap&&(this._hasMipmap=t.mipmap),e&&this._image&&(t.image=this._image),t.imag
es&&t.images.length>0?this._image=t.images[0]:void 0!
==t.image&&(this._image=t.image,t.images||
(u.length=0,t.images=u),t.images.push(t.image)),t.images&&t.images.length>0&&this._
texture.update(t),this._hashDirty=!0}},initWithElement:function(t)
{if(t)if(this._image=t,t.complete||t instanceof
HTMLCanvasElement)this.handleLoadedTexture();else{var
e=this;t.addEventListener("load",(function()
{e.handleLoadedTexture()})),t.addEventListener("error",(function(t)
{cc.warnID(3119,t.message)}))}},initWithData:function(t,e,i,n){var r=f();return
r.image=t,r.images=[r.image],r.hasMipmap=this._hasMipmap,r.premultiplyAlpha=this._p
remultiplyAlpha,r.flipY=this._flipY,r.minFilter=c[this._minFilter],r.magFilter=c[th
is._magFilter],r.wrapS=this._wrapS,r.wrapT=this._wrapT,r.format=e,e===o.RGBA_ETC1&&
(r.format=o.RGB_ETC1),r.width=i,r.height=n,this._texture?
this._texture.update(r):this._texture=new
s.Texture2D(s.device,r),this.width=i,this.height=n,this.loaded=!
0,this.emit("load"),!0},getHtmlElementObj:function(){return
this._image},destroy:function()
{this._image=null,this._texture&&this._texture.destroy(),this._super()},getPixelFor
mat:function(){return this._format},hasPremultipliedAlpha:function(){return
this._premultiplyAlpha||!1},hasMipmap:function(){return this._hasMipmap||!
1},handleLoadedTexture:function()
{if(this._image&&this._image.width&&this._image.height)
{this.width=this._image.width,this.height=this._image.height;var
t=f();t.image=this._image,t.images=[t.image],t.width=this.width,t.height=this.heigh
t,t.hasMipmap=this._hasMipmap,t.format=this._format,this._format===o.RGBA_ETC1&&(t.
format=o.RGB_ETC1),t.premultiplyAlpha=this._premultiplyAlpha,t.flipY=this._flipY,t.
minFilter=c[this._minFilter],
t.magFilter=c[this._magFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,this._textur
e?this._texture.update(t):this._texture=new s.Texture2D(s.device,t),this.loaded=!
0,this.emit("load"),cc.macro.CLEANUP_IMAGE_CACHE&&this._image instanceof
HTMLImageElement&&this._clearImage()}},description:function(){return"<cc.Texture2D
| Name = "+this.url+" | Dimensions = "+this.width+" x
"+this.height+">"},releaseTexture:function()
{this._image=null,this._texture&&this._texture.destroy()},setWrapMode:function(t,e)
{if(this._wrapS!==t||this._wrapT!==e){var
i=f();i.wrapS=t,i.wrapT=e,this.update(i)}},setFilters:function(t,e)
{if(this._minFilter!==t||this._magFilter!==e){var
i=f();i.minFilter=t,i.magFilter=e,this.update(i)}},setFlipY:function(t)
{if(this._flipY!==t){var
e=f();e.flipY=t,this.update(e)}},setPremultiplyAlpha:function(t)
{if(this._premultiplyAlpha!==t){var
e=f();e.premultiplyAlpha=t,this.update(e)}},setMipmap:function(t)
{if(this._hasMipmap!==t){var e=f();e.mipmap=t,this.update(e)}},_getOpts:function()
{var t=f();return
t.width=this.width,t.height=this.height,t.mipmap=this._genMipmap,t.format=this._for
mat,t.premultiplyAlpha=this._premultiplyAlpha,t.anisotropy=this._anisotropy,t.flipY
=this._flipY,t.minFilter=c[this._minFilter],t.magFilter=c[this._magFilter],t.mipFil
ter=c[this._mipFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,t},_resetUnderlyingM
ipmaps:function(t){var e=this._getOpts();e.images=t||[null],this._texture?
this._texture.update(e):this._texture=new s.Texture2D(s.device,e)},_serialize:!
1,_deserialize:function(t,e){var i=cc.renderer.device,n=t.split(","),r=n[0];if(r)
{for(var
s=r.split("_"),a=999,l="",h=this._format,c=cc.macro.SUPPORT_TEXTURE_FORMATS,u=0;u<s
.length;u++){var _=s[u].split("@"),f=_[0];f=f.charCodeAt(0)-48,f=d.extnames[f]||
_;var m=c.indexOf(f);if(-1!==m&&m<a){var p=_[1]?
parseInt(_[1]):this._format;if(".pvr"===f&&!
i.ext("WEBGL_compressed_texture_pvrtc"))continue;if(!(p!==o.RGB_ETC1&&p!
==o.RGBA_ETC1||
i.ext("WEBGL_compressed_texture_etc1")))continue;if((p===o.RGB_ETC2||
p===o.RGBA_ETC2)&&!
i.ext("WEBGL_compressed_texture_etc"))continue;a=m,l=f,h=p}}l&&(this._setRawAsset(l
),this._format=h);var v=e.customEnv,y=v&&v.uuid;if(y){this._uuid=y;var
g=this.nativeUrl;this.url=g}}6===n.length&&(this._minFilter=parseInt(n[1]),this._ma
gFilter=parseInt(n[2]),this._wrapS=parseInt(n[3]),this._wrapT=parseInt(n[4]),this._
premultiplyAlpha=49===n[5].charCodeAt(0))},_getHash:function(){if(!
this._hashDirty)return this._hash;var t=this._hasMipmap?
1:0,e=this._premultiplyAlpha?1:0,i=this._flipY?1:0,n=this._minFilter===h.LINEAR?
1:2,r=this._magFilter===h.LINEAR?1:2,s=this._wrapS===l.REPEAT?
1:this._wrapS===l.CLAMP_TO_EDGE?2:3,a=this._wrapT===l.REPEAT?
1:this._wrapT===l.CLAMP_TO_EDGE?2:3,o=this._format;this._image;return
this._hash=Number(""+n+r+o+s+a+t+e+i),this._hashDirty=!
1,this._hash},_isCompressed:function(){return
this._texture&&this._texture._compressed},_clearImage:function()
{cc.loader.removeItem(this._image.id||
this._image.src),this._image.src=""}});cc.Texture2D=e.exports=d}),
{"../../renderer/gfx":348,"../assets/CCAsset":56,"../event/event-
target":132,"../platform/CCClass":200,"../platform/id-
generater":216,"../renderer":243}],74:[(function(t,e,i){"use
strict";t("./CCRawAsset"),t("./CCAsset"),t("./CCFont"),t("./CCPrefab"),t("./CCAudio
Clip"),t("./CCScripts"),t("./CCSceneAsset"),t("./CCSpriteFrame"),t("./CCTexture2D")
,t("./CCRenderTexture"),t("./CCTTFFont"),t("./CCSpriteAtlas"),t("./CCBitmapFont"),t
("./CCLabelAtlas"),t("./CCTextAsset"),t("./CCJsonAsset"),t("./CCBufferAsset"),t("./
CCEffectAsset"),t("./material/CCMaterial")}),
{"./CCAsset":56,"./CCAudioClip":57,"./CCBitmapFont":58,"./CCBufferAsset":59,"./CCEf
fectAsset":60,"./CCFont":61,"./CCJsonAsset":62,"./CCLabelAtlas":63,"./CCPrefab":64,
"./CCRawAsset":65,"./CCRenderTexture":66,"./CCSceneAsset":67,"./CCScripts":68,"./CC
SpriteAtlas":69,"./CCSpriteFrame":70,"./CCTTFFont":71,"./CCTextAsset":72,"./CCTextu
re2D":73,"./material/CCMaterial":75}],75:[(function(t,e,i){"use strict";var
n=a(t("../../../renderer/core/effect")),r=a(t("./murmurhash2_gc")),s=a(t("./utils")
);function a(t){return t&&t.__esModule?t:{default:t}}var
o=t("../CCAsset"),l=t("../CCTexture2D"),h=l.PixelFormat,c=t("../CCEffectAsset"),u=c
c.Class({name:"cc.Material",extends:o,ctor:function(){this._dirty=!
0,this._effect=null,this._owner=null},properties:{_effectAsset:
{type:c,default:null},_defines:{default:{},type:Object},_props:{default:
{},type:Object},effectName:void 0,effectAsset:{get:function(){return
this._effectAsset},set:function(t){this._effectAsset=t,t?
this._effect=n.default.parseEffect(t):cc.error("Can not set an empty effect
asset.")}},effect:{get:function(){return this._effect}},owner:{get:function()
{return this._owner}}},statics:{getBuiltinMaterial:function(t){return
cc.AssetLibrary.getBuiltin("material","builtin-"+t)},getInstantiatedBuiltinMaterial
:function(t,e){var i=this.getBuiltinMaterial(t);return
u.getInstantiatedMaterial(i,e)},getInstantiatedMaterial:function(t,e)
{if(t._owner===e)return t;var i=new u;return i.copy(t),i._name=t._name+"
(Instance)",i._uuid=t._uuid,i._owner=e,i._objFlags|
=cc.Object.Flags.DontSave,i}},copy:function(t){for(var e in
this.effectAsset=t.effectAsset,t._defines)this.define(e,t._defines[e]);for(var i in
t._props)this.setProperty(i,t._props[i])},setProperty:function(t,e,i)
{(this._props[t]!==e||i)&&(this._props[t]=e,this._dirty=!0,this._effect&&(e
instanceof l?
(this._effect.setProperty(t,e.getImpl()),e.getPixelFormat()===h.RGBA_ETC1&&this.def
ine("_USE_ETC1_"+t.toUpperCase(),!
0)):this._effect.setProperty(t,e)))},getProperty:function(t){return
this._props[t]},define:function(t,e,i){(this._defines[t]!==e||
i)&&(this._defines[t]=e,this._dirty=!
0,this._effect&&this._effect.define(t,e))},getDefine:function(t){return
this._defines[t]},setDirty:function(t){this._dirty=t},updateHash:function(t)
{this._dirty=!1,this._hash=t},getHash:function(){if(!this._dirty)return
this._hash;this._dirty=!1;var t=this._effect,e="";return
t&&(e+=s.default.serializeDefines(t._defines),e+=s.default.serializeTechniques(t._t
echniques),e+=s.default.serializeUniforms(t._properties)),this._hash=(0,r.default)
(e,666)},onLoad:function(){if(this.effectAsset=this._effectAsset,this._effect)
{for(var t in this._defines)this.define(t,this._defines[t],!0);for(var e in
this._props)this.setProperty(e,this._props[e],!0)}}});e.exports=cc.Material=u}),
{"../../../renderer/core/effect":337,"../CCAsset":56,"../CCEffectAsset":60,"../CCTe
xture2D":73,"./murmurhash2_gc":77,"./utils":78}],76:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),r=t("../../../renderer/types"),s=o(t("./murmurhash2_gc")),a=o(t("./utils"));func
tion o(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var h=(function()
{function t(){l(this,t),this._properties={},this._defines={},this._dirty=!1}return
n(t,[{key:"setProperty",value:function(t,e){var i=this._properties[t];if(i)
{if(i.value===e)return}else(i=Object.create(null)).name=t,i.type=r.ctor2enums[e.con
structor],this._properties[t]=i;this._dirty=!0,i.value=e}},
{key:"getProperty",value:function(t){var e=this._properties[t];return e?
e.value:null}},{key:"define",value:function(t,e){this._defines[t]!
==e&&(this._dirty=!0,this._defines[t]=e)}},{key:"getDefine",value:function(t)
{return this._defines[t]}},{key:"extractProperties",value:function(){var
t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return
Object.assign(t,this._properties),t}},{key:"extractDefines",value:function(){var
t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return
Object.assign(t,this._defines),t}},{key:"getHash",value:function(){if(!
this._dirty)return this._hash;this._dirty=!1;var t="";return
t+=a.default.serializeDefines(this._defines),t+=a.default.serializeUniforms(this._p
roperties),this._hash=(0,s.default)(t,666)}}]),t})
();i.default=h,e.exports=i.default}),
{"../../../renderer/types":374,"./murmurhash2_gc":77,"./utils":78}],77:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(t,e){var
i,n=t.length,r=e^n,s=0;for(;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|
(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(+
+s))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+
((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+
((1540483477*(i>>>16)&65535)<<16)),n-=4,++s;switch(n){case
3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case
1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+
((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+
((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},e.exports=i.default}),{}],78:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../../renderer/enums"));function r(t){var
e=t._programName+t._cullMode;return
t._blend&&(e+=t._blendEq+t._blendAlphaEq+t._blendSrc+t._blendDst+t._blendSrcAlpha+t
._blendDstAlpha+t._blendColor),t._depthTest&&(e+=t._depthWrite+t._depthFunc),t._ste
ncilTest&&(e+=t._stencilFuncFront+t._stencilRefFront+t._stencilMaskFront+t._stencil
FailOpFront+t._stencilZFailOpFront+t._stencilZPassOpFront+t._stencilWriteMaskFront+
t._stencilFuncBack+t._stencilRefBack+t._stencilMaskBack+t._stencilFailOpBack+t._ste
ncilZFailOpBack+t._stencilZPassOpBack+t._stencilWriteMaskBack),e}i.default={seriali
zeDefines:function(t){var e="";for(var i in t)e+=i+t[i];return
e},serializeTechniques:function(t){for(var e="",i=0;i<t.length;i++){var
n=t[i];e+=n.stageIDs;for(var s=0;s<n.passes.length;s++)e+=r(n.passes[s])}return
e},serializeUniforms:function(t){var e="";for(var i in t){var
r=t[i],s=r.value;if(s)switch(r.type){case n.default.PARAM_INT:case
n.default.PARAM_FLOAT:e+=s+";";break;case n.default.PARAM_INT2:case
n.default.PARAM_FLOAT2:e+=s.x+","+s.y+";";break;case n.default.PARAM_INT4:case
n.default.PARAM_FLOAT4:e+=s.x+","+s.y+","+s.z+","+s.w+";";break;case
n.default.PARAM_COLOR4:e+=s.r+","+s.g+","+s.b+","+s.a+";";break;case
n.default.PARAM_MAT2:e+=s.m00+","+s.m01+","+s.m02+","+s.m03+";";break;case
n.default.PARAM_TEXTURE_2D:case
n.default.PARAM_TEXTURE_CUBE:e+=s._id+";";break;case n.default.PARAM_INT3:case
n.default.PARAM_FLOAT3:case n.default.PARAM_COLOR3:case n.default.PARAM_MAT3:case
n.default.PARAM_MAT4:e+=JSON.stringify(s)+";"}}return e}},e.exports=i.default}),
{"../../../renderer/enums":343}],79:[(function(t,e,i){"use
strict";t("../CCNode").EventType;var
n=56,r=7,s=cc.Enum({ONCE:0,ON_WINDOW_RESIZE:1,ALWAYS:2});function a(t){return t
instanceof cc.Scene?cc.visibleRect:t._contentSize}function o(t,e,i,n){for(var
r=t._parent._scale.x,s=t._parent._scale.y,a=0,o=0,l=t._parent;;){var
h=l._position;if(a+=h.x,o+=h.y,!(l=l._parent))return
i.x=i.y=0,void(n.x=n.y=1);if(l===e)break;var
c=l._scale.x,u=l._scale.y;a*=c,o*=u,r*=c,s*=u}n.x=0!==r?1/r:1,n.y=0!==s?1/s:1,i.x=-
a,i.y=-o}var l=cc.Vec2.ZERO,h=cc.Vec2.ONE;function c(t,e){var i,s,c,u=e._target;u?
o(t,i=u,s=l,c=h):i=t._parent;var _=a(i),f=i._anchorPoint,d=i instanceof
cc.Scene,m=t._position.x,p=t._position.y,v=t._anchorPoint;if(e._alignFlags&n){var
y,g,x=_.width;d?(y=cc.visibleRect.left.x,g=cc.visibleRect.right.x):g=(y=-f.x*x)
+x,y+=e._isAbsLeft?e._left:e._left*x,g-=e._isAbsRight?
e._right:e._right*x,u&&(y+=s.x,y*=c.x,g+=s.x,g*=c.x);var
b,A=v.x,C=t._scale.x;if(C<0&&(A=1-A,C=-C),e.isStretchWidth)b=g-y,0!
==C&&(t.width=b/C),m=y+A*b;else if(b=t.width*C,e.isAlignHorizontalCenter){var
S=e._isAbsHorizontalCenter?e._horizontalCenter:e._horizontalCenter*x,T=(.5-
f.x)*_.width;u&&(S*=c.x,T+=s.x,T*=c.x),m=T+(A-.5)*b+S}else m=e.isAlignLeft?y+A*b:g+
(A-1)*b}if(e._alignFlags&r){var w,E,M=_.height;d?
(E=cc.visibleRect.bottom.y,w=cc.visibleRect.top.y):w=(E=-f.y*M)
+M,E+=e._isAbsBottom?e._bottom:e._bottom*M,w-=e._isAbsTop?
e._top:e._top*M,u&&(E+=s.y,E*=c.y,w+=s.y,w*=c.y);var
D,B=v.y,P=t._scale.y;if(P<0&&(B=1-B,P=-P),e.isStretchHeight)D=w-E,0!
==P&&(t.height=D/P),p=E+B*D;else if(D=t.height*P,e.isAlignVerticalCenter){var
I=e._isAbsVerticalCenter?e._verticalCenter:e._verticalCenter*M,R=(.5-
f.y)*_.height;u&&(I*=c.y,R+=s.y,R*=c.y),p=R+(B-.5)*D+I}else p=e.isAlignBottom?
E+B*D:w+(B-1)*D}t.setPosition(m,p)}function u(t){var
e=t._widget;e&&(c(t,e),e.alignMode!==s.ALWAYS?e.enabled=!1:f.push(e));for(var
i=t._children,n=0;n<i.length;n++){var r=i[n];r._active&&u(r)}}function _(){var
t=cc.director.getScene();if(t){if(d.isAligning=!
0,d._nodesOrderDirty)f.length=0,u(t),d._nodesOrderDirty=!1;else{var
e,i=d._activeWidgetsIterator;for(i.i=0;i.i<f.length;+
+i.i)c((e=f[i.i]).node,e)}d.isAligning=!1}}var f=[];var
d=cc._widgetManager=e.exports={_AlignFlags:
{TOP:1,MID:2,BOT:4,LEFT:8,CENTER:16,RIGHT:32},isAligning:!1,_nodesOrderDirty:!
1,_activeWidgetsIterator:new cc.js.array.MutableForwardIterator(f),init:function(t)
{t.on(cc.Director.EVENT_AFTER_UPDATE,_),cc.sys.isMobile?
window.addEventListener("resize",this.onResized.bind(this)):cc.view.on("canvas-
resize",this.onResized,this)},add:function(t)
{t.node._widget=t,this._nodesOrderDirty=!0},remove:function(t)
{t.node._widget=null,this._activeWidgetsIterator.remove(t)},onResized:function()
{var
t=cc.director.getScene();t&&this.refreshWidgetOnResized(t)},refreshWidgetOnResized:
function(t){var
e=cc.Node.isNode(t)&&t.getComponent(cc.Widget);e&&e.alignMode===s.ON_WINDOW_RESIZE&
&(e.enabled=!0);for(var i=t._children,n=0;n<i.length;n++){var
r=i[n];this.refreshWidgetOnResized(r)}},updateAlignment:function t(e){var
i=e._parent;cc.Node.isNode(i)&&t(i);var n=e._widget||
e.getComponent(cc.Widget);n&&i&&c(e,n)},AlignMode:s}}),{"../CCNode":52}],80:
[(function(t,e,i){"use strict";var n=s(t("../geom-
utils")),r=s(t("../../renderer/scene/camera"));s(t("../../renderer/core/view"));fun
ction s(t){return t&&t.__esModule?t:{default:t}}var a=t("../utils/affine-
transform"),o=t("../renderer/index"),l=t("../renderer/render-
flow"),h=t("../CCGame"),c=cc.vmath.mat4,u=cc.vmath.vec2,_=cc.vmath.vec3,f=c.create(
),d=c.create(),m=_.create(),p=_.create(),v=_.create(),y=[],g=null;function x()
{if(g){var
t=g.getNode(),e=cc.game.canvas;t.z=e.height/1.1566,t.x=e.width/2,t.y=e.height/2}}va
r
b=cc.Enum({COLOR:1,DEPTH:2,STENCIL:4}),A=cc.Enum({OPAQUE:1,TRANSPARENT:2}),C=cc.Cla
ss({name:"cc.Camera",extends:cc.Component,ctor:function(){if(h.renderType!
==h.RENDER_TYPE_CANVAS){var t=new r.default;t.setStages(["opaque"]),t.dirty=!
0,this._inited=!1,this._camera=t}else this._inited=!0},editor:!1,properties:
{_cullingMask:4294967295,_clearFlags:b.DEPTH|
b.STENCIL,_backgroundColor:cc.color(0,0,0,255),_depth:0,_zoomRatio:1,_targetTexture
:null,_fov:60,_orthoSize:10,_nearClip:.1,_farClip:4096,_ortho:!
0,_rect:cc.rect(0,0,1,1),_renderStages:1,zoomRatio:{get:function(){return
this._zoomRatio},set:function(t){this._zoomRatio=t}},fov:{get:function(){return
this._fov},set:function(t){this._fov=t}},orthoSize:{get:function(){return
this._orthoSize},set:function(t){this._orthoSize=t}},nearClip:{get:function()
{return this._nearClip},set:function(t)
{this._nearClip=t,this._updateClippingpPlanes()}},farClip:{get:function(){return
this._farClip},set:function(t)
{this._farClip=t,this._updateClippingpPlanes()}},ortho:{get:function(){return
this._ortho},set:function(t){this._ortho=t,this._updateProjection()}},rect:
{get:function(){return this._rect},set:function(t)
{this._rect=t,this._updateRect()}},cullingMask:{get:function(){return
this._cullingMask},set:function(t)
{this._cullingMask=t,this._updateCameraMask()}},clearFlags:{get:function(){return
this._clearFlags},set:function(t)
{this._clearFlags=t,this._camera&&this._camera.setClearFlags(t)}},backgroundColor:
{get:function(){return this._backgroundColor},set:function(t)
{this._backgroundColor=t,this._updateBackgroundColor()}},depth:{get:function()
{return this._depth},set:function(t)
{this._depth=t,this._camera&&(this._camera._priority=t)}},targetTexture:
{get:function(){return this._targetTexture},set:function(t)
{this._targetTexture=t,this._updateTargetTexture()}},renderStages:{get:function()
{return this._renderStages},set:function(t)
{this._renderStages=t,this._updateStages()}},_is3D:{get:function(){return
this.node._is3DNode}}},statics:
{main:null,cameras:y,ClearFlags:b,findCamera:function(t){for(var
e=0,i=y.length;e<i;e++){var n=y[e];if(n.containsNode(t))return n}return
null},_setupDebugCamera:function(){if(!g&&h.renderType!==h.RENDER_TYPE_CANVAS){var
t=new
r.default;g=t,t.setStages(["opaque"]),t.setFov(60*Math.PI/180),t.setNear(.1),t.setF
ar(4096),t.dirty=!
0,t._cullingMask=1<<cc.Node.BuiltinGroupIndex.DEBUG,t._priority=cc.macro.MAX_ZINDEX
,t.setClearFlags(0),t.setColor(0,0,0,0);var e=new
cc.Node;t.setNode(e),x(),cc.view.on("design-resolution-
changed",x),o.scene.addCamera(t)}}},_updateCameraMask:function(){if(this._camera)
{var
t=this._cullingMask&~(1<<cc.Node.BuiltinGroupIndex.DEBUG);this._camera._cullingMask
=t}},_updateBackgroundColor:function(){if(this._camera){var
t=this._backgroundColor;this._camera.setColor(t.r/255,t.g/255,t.b/255,t.a/255)}},_u
pdateTargetTexture:function(){if(this._camera){var
t=this._targetTexture;this._camera._framebuffer=t?
t._framebuffer:null}},_updateClippingpPlanes:function()
{this._camera&&(this._camera.setNear(this._nearClip),this._camera.setFar(this._farC
lip))},_updateProjection:function(){if(this._camera){var t=this._ortho?
1:0;this._camera.setType(t)}},_updateRect:function()
{this._camera&&this._camera.setRect(this._rect)},_updateStages:function(){var
t=this._renderStages,e=this._camera._stages;e.length=0,t&A.OPAQUE&&e.push("opaque")
,t&A.TRANSPARENT&&e.push("transparent")},_init:function(){if(!this._inited)
{this._inited=!0;var
t=this._camera;t&&(t.setNode(this.node),t.setClearFlags(this._clearFlags),t._priori
ty=this._depth,this._updateBackgroundColor(),this._updateCameraMask(),this._updateT
argetTexture(),this._updateClippingpPlanes(),this._updateProjection(),this._updateS
tages())}},onLoad:function(){this._init()},onEnable:function(){h.renderType!
==h.RENDER_TYPE_CANVAS&&(cc.director.on(cc.Director.EVENT_BEFORE_DRAW,this.beforeDr
aw,this),o.scene.addCamera(this._camera)),y.push(this)},onDisable:function()
{h.renderType!
==h.RENDER_TYPE_CANVAS&&(cc.director.off(cc.Director.EVENT_BEFORE_DRAW,this.beforeD
raw,this),o.scene.removeCamera(this._camera)),cc.js.array.remove(y,this)},getNodeTo
CameraTransform:function(t){var e=a.identity();return
t.getWorldMatrix(d),this.containsNode(t)&&(this.getWorldToCameraMatrix(f),c.mul(d,d
,f)),a.fromMat4(e,d),e},getCameraToWorldPoint:function(t,e){return e=e||
cc.v2(),this.getCameraToWorldMatrix(f),u.transformMat4(e,t,f),e},getWorldToCameraPo
int:function(t,e){return e=e||
cc.v2(),this.getWorldToCameraMatrix(f),u.transformMat4(e,t,f),e},getCameraToWorldMa
trix:function(t){return
this.getWorldToCameraMatrix(t),c.invert(t,t),t},getWorldToCameraMatrix:function(t)
{this.node.getWorldRT(f);var
e=this.zoomRatio;f.m00*=e,f.m01*=e,f.m04*=e,f.m05*=e;var
i=f.m12,n=f.m13,r=cc.visibleRect.center;return f.m12=r.x-
(f.m00*i+f.m04*n),f.m13=r.y-(f.m01*i+f.m05*n),t!
==f&&c.copy(t,f),t},getRay:function(t){return n.default?
(_.set(v,t.x,t.y,1),this._camera.screenToWorld(p,v,cc.visibleRect.width,cc.visibleR
ect.height),this.ortho?(_.set(v,t.x,t.y,-
1),this._camera.screenToWorld(m,v,cc.visibleRect.width,cc.visibleRect.height)):this
.node.getWorldPosition(m),n.default.Ray.fromPoints(n.default.Ray.create(),m,p)):t},
containsNode:function(t){return t._cullingMask&this.cullingMask},render:function(t)
{if(!(t=t||cc.director.getScene()))return
null;this.node.getWorldMatrix(f),this.beforeDraw(),l.visit(t),o._forward.renderCame
ra(this._camera,o.scene)},_layout:function(){var
t=cc.game.canvas.height/cc.view._scaleY,e=this._targetTexture;e&&(t=e.height);var

i=this._fov*cc.macro.RAD;this.node.z=t/(2*Math.tan(i/2)),i=2*Math.atan(Math.tan(i/2
)/this.zoomRatio),this._camera.setFov(i),this._camera.setOrthoHeight(t/2/this.zoomR
atio)},beforeDraw:function(){this._camera&&(this.node._is3DNode?
(this._camera.setFov(this._fov*cc.macro.RAD),this._camera.setOrthoHeight(this._orth
oSize)):this._layout(),this._camera.dirty=!0)}});e.exports=cc.Camera=C}),
{"../../renderer/core/view":342,"../../renderer/scene/camera":370,"../CCGame":51,".
./geom-utils":137,"../renderer/index":243,"../renderer/render-
flow":244,"../utils/affine-transform":285}],81:[(function(t,e,i){"use
strict";cc.Collider.Box=cc.Class({properties:
{_offset:cc.v2(0,0),_size:cc.size(100,100),offset:{tooltip:!1,get:function(){return
this._offset},set:function(t){this._offset=t},type:cc.Vec2},size:{tooltip:!
1,get:function(){return this._size},set:function(t){this._size.width=t.width<0?
0:t.width,this._size.height=t.height<0?0:t.height},type:cc.Size}},resetInEditor:!
1});var n=cc.Class({name:"cc.BoxCollider",extends:cc.Collider,mixins:
[cc.Collider.Box],editor:!1});cc.BoxCollider=e.exports=n}),{}],82:[(function(t,e,i)
{"use strict";cc.Collider.Circle=cc.Class({properties:
{_offset:cc.v2(0,0),_radius:50,offset:{get:function(){return
this._offset},set:function(t){this._offset=t},type:cc.Vec2},radius:{tooltip:!
1,get:function(){return this._radius},set:function(t){this._radius=t<0?
0:t}}},resetInEditor:!1});var
n=cc.Class({name:"cc.CircleCollider",extends:cc.Collider,mixins:
[cc.Collider.Circle],editor:!1});cc.CircleCollider=e.exports=n}),{}],83:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Collider",extends:cc.Component,properties:{editing:{default:!
1,serializable:!1,tooltip:!1},tag:{tooltip:!1,default:0,range:
[0,1e7],type:cc.Integer}},onDisable:function()
{cc.director.getCollisionManager().removeCollider(this)},onEnable:function()
{cc.director.getCollisionManager().addCollider(this)}});cc.Collider=e.exports=n}),
{}],84:[(function(t,e,i){"use strict";var
n=t("./CCContact"),r=n.CollisionType,s=t("../CCNode").EventType,a=cc.vmath,o=cc.v2(
);function l(t,e,i,n,r,s){var
a=t.x,o=t.y,l=t.width,h=t.height,c=e.m00,u=e.m01,_=e.m04,f=e.m05,d=c*a+_*o+e.m12,m=
u*a+f*o+e.m13,p=c*l,v=u*l,y=_*h,g=f*h;n.x=d,n.y=m,r.x=p+d,r.y=v+m,i.x=y+d,i.y=g+m,s
.x=p+y+d,s.y=v+g+m}var h=cc.Class({mixins:[cc.EventTarget],properties:{enabled:!
1,enabledDrawBoundingBox:!1},ctor:function()
{this._contacts=[],this._colliders=[],this._debugDrawer=null,this._enabledDebugDraw
=!
1,cc.director._scheduler&&cc.director._scheduler.enableForTarget(this)},update:func
tion(t){if(this.enabled){var e=void 0,i=void
0,n=this._colliders;for(e=0,i=n.length;e<i;e++)this.updateCollider(n[e]);var
s=this._contacts,a=[];for(e=0,i=s.length;e<i;e++){var o=s[e].updateState();o!
==r.None&&a.push([o,s[e]])}for(e=0,i=a.length;e<i;e++){var
l=a[e];this._doCollide(l[0],l[1])}this.drawColliders()}},_doCollide:function(t,e)
{var i=void 0;switch(t){case r.CollisionEnter:i="onCollisionEnter";break;case
r.CollisionStay:i="onCollisionStay";break;case
r.CollisionExit:i="onCollisionExit"}var
n=e.collider1,s=e.collider2,a=n.node._components,o=s.node._components,l=void
0,h=void 0,c=void 0;for(l=0,h=a.length;l<h;l++)(c=a[l])[i]&&c[i]
(s,n);for(l=0,h=o.length;l<h;l++)(c=o[l])[i]&&c[i]
(n,s)},shouldCollide:function(t,e){var
i=t.node,n=e.node,r=cc.game.collisionMatrix;return i!==n&&r[i.groupIndex]
[n.groupIndex]},initCollider:function(t){if(!t.world){var
e=t.world={};e.aabb=cc.rect(),e.preAabb=cc.rect(),e.matrix=a.mat4.create(),e.radius
=0,t instanceof cc.BoxCollider?
(e.position=null,e.points=[cc.v2(),cc.v2(),cc.v2(),cc.v2()]):t instanceof
cc.PolygonCollider?(e.position=null,e.points=t.points.map((function(t){return
cc.v2(t.x,t.y)}))):t instanceof
cc.CircleCollider&&(e.position=cc.v2(),e.points=null)}},updateCollider:function(t)
{var e=t.offset,i=t.world,n=i.aabb,r=i.matrix;t.node.getWorldMatrix(r);var
s=i.preAabb;if(s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,t instanceof
cc.BoxCollider){var h=t.size;n.x=e.x-h.width/2,n.y=e.y-
h.height/2,n.width=h.width,n.height=h.height;var
c=i.points,u=c[0],_=c[1],f=c[2],d=c[3];l(n,r,u,_,f,d);var
m=Math.min(u.x,_.x,f.x,d.x),p=Math.min(u.y,_.y,f.y,d.y),v=Math.max(u.x,_.x,f.x,d.x)
,y=Math.max(u.y,_.y,f.y,d.y);n.x=m,n.y=p,n.width=v-m,n.height=y-p}else if(t
instanceof cc.CircleCollider)
{a.vec2.transformMat4(o,t.offset,r),i.position.x=o.x,i.position.y=o.y;var
g=r.m12,x=r.m13;r.m12=r.m13=0,o.x=t.radius,o.y=0,a.vec2.transformMat4(o,o,r);var
b=Math.sqrt(o.x*o.x+o.y*o.y);i.radius=b,n.x=i.position.x-b,n.y=i.position.y-
b,n.width=2*b,n.height=2*b,r.m12=g,r.m13=x}else if(t instanceof cc.PolygonCollider)
{var A=t.points,C=i.points;C.length=A.length;for(var S=1e6,T=1e6,w=-1e6,E=-
1e6,M=0,D=A.length;M<D;M++){C[M]||
(C[M]=cc.v2()),o.x=A[M].x+e.x,o.y=A[M].y+e.y,a.vec2.transformMat4(o,o,r);var
B=o.x,P=o.y;C[M].x=B,C[M].y=P,B>w&&(w=B),B<S&&(S=B),P>E&&(E=P),P<T&&(T=P)}n.x=S,n.y
=T,n.width=w-S,n.height=E-T}},addCollider:function(t){var e=this._colliders;if(-
1===e.indexOf(t)){for(var i=0,r=e.length;i<r;i++){var
a=e[i];if(this.shouldCollide(t,a)){var o=new
n(t,a);this._contacts.push(o)}}e.push(t),this.initCollider(t)}t.node.on(s.GROUP_CHA
NGED,this.onNodeGroupChanged,this)},removeCollider:function(t){var
e=this._colliders,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(var
n=this._contacts,a=n.length-1;a>=0;a--){var o=n[a];o.collider1!==t&&o.collider2!
==t||
(o.touching&&this._doCollide(r.CollisionExit,o),n.splice(a,1))}t.node.off(s.GROUP_C
HANGED,this.onNodeGroupChanged,this)}else
cc.errorID(6600)},onNodeGroupChanged:function(t){for(var
e=t.getComponents(cc.Collider),i=0,n=e.length;i<n;i+
+)this.removeCollider(e[i]),this.addCollider(e[i])},drawColliders:function()
{if(this._enabledDebugDraw){this._checkDebugDrawValid();var
t=this._debugDrawer;t.clear();for(var e=this._colliders,i=0,n=e.length;i<n;i++){var
r=e[i];if(t.strokeColor=cc.Color.WHITE,r instanceof cc.BoxCollider||r instanceof
cc.PolygonCollider){var s=r.world.points;if(s.length>0)
{t.moveTo(s[0].x,s[0].y);for(var a=1;a<s.length;a+
+)t.lineTo(s[a].x,s[a].y);t.close(),t.stroke()}}else r instanceof
cc.CircleCollider&&(t.circle(r.world.position.x,r.world.position.y,r.world.radius),
t.stroke());if(this.enabledDrawBoundingBox){var
o=r.world.aabb;t.strokeColor=cc.Color.BLUE,t.moveTo(o.xMin,o.yMin),t.lineTo(o.xMin,
o.yMax),t.lineTo(o.xMax,o.yMax),t.lineTo(o.xMax,o.yMin),t.close(),t.stroke()}}}},_c
heckDebugDrawValid:function(){if(!this._debugDrawer||!this._debugDrawer.isValid)
{var t=new
cc.Node("COLLISION_MANAGER_DEBUG_DRAW");t.zIndex=cc.macro.MAX_ZINDEX,cc.game.addPer
sistRootNode(t),this._debugDrawer=t.addComponent(cc.Graphics)}}});cc.js.getset(h.pr
ototype,"enabledDebugDraw",(function(){return this._enabledDebugDraw}),(function(t)
{t&&!this._enabledDebugDraw?
(this._checkDebugDrawValid(),this._debugDrawer.node.active=!0):!
t&&this._enabledDebugDraw&&(this._debugDrawer.clear(!
0),this._debugDrawer.node.active=!
1),this._enabledDebugDraw=t})),cc.CollisionManager=e.exports=h}),
{"../CCNode":52,"./CCContact":85}],85:[(function(t,e,i){"use strict";var
n=t("./CCIntersection"),r=cc.Enum({None:0,CollisionEnter:1,CollisionStay:2,Collisio
nExit:3});function s(t,e){this.collider1=t,this.collider2=e,this.touching=!1;var
i=t instanceof cc.BoxCollider||t instanceof cc.PolygonCollider,r=e instanceof
cc.BoxCollider||e instanceof cc.PolygonCollider,s=t instanceof
cc.CircleCollider,a=e instanceof cc.CircleCollider;i&&r?
this.testFunc=n.polygonPolygon:s&&a?this.testFunc=n.circleCircle:i&&a?
this.testFunc=n.polygonCircle:s&&r?
(this.testFunc=n.polygonCircle,this.collider1=e,this.collider2=t):cc.errorID(6601,c
c.js.getClassName(t),cc.js.getClassName(e))}s.prototype.test=function(){var
t=this.collider1.world,e=this.collider2.world;return!!
t.aabb.intersects(e.aabb)&&(this.testFunc===n.polygonPolygon?
this.testFunc(t.points,e.points):this.testFunc===n.circleCircle?
this.testFunc(t,e):this.testFunc===n.polygonCircle&&this.testFunc(t.points,e))},s.p
rototype.updateState=function(){var t=this.test(),e=r.None;return t&&!
this.touching?(this.touching=!0,e=r.CollisionEnter):t&&this.touching?
e=r.CollisionStay:!t&&this.touching&&(this.touching=!
1,e=r.CollisionExit),e},s.CollisionType=r,e.exports=s}),
{"./CCIntersection":86}],86:[(function(t,e,i){"use strict";var n={};function
r(t,e,i,n){var r=(n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x),s=(e.x-t.x)*(t.y-i.y)-
(e.y-t.y)*(t.x-i.x),a=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0!==a){var
o=r/a,l=s/a;if(0<=o&&o<=1&&0<=l&&l<=1)return!0}return!1}function s(t,e,i){for(var
n=i.length,s=0;s<n;++s){if(r(t,e,i[s],i[(s+1)%n]))return!0}return!1}function a(t,e)
{for(var i=!1,n=t.x,r=t.y,s=e.length,a=0,o=s-1;a<s;o=a++){var
l=e[a].x,h=e[a].y,c=e[o].x,u=e[o].y;h>r!=u>r&&n<(c-l)*(r-h)/(u-h)+l&&(i=!i)}return
i}function o(t,e,i,n){var r,s=i.x-e.x,a=i.y-e.y,o=s*s+a*a,l=((t.x-e.x)*s+(t.y-
e.y)*a)/o;return r=n?o?l<0?e:l>1?
i:cc.v2(e.x+l*s,e.y+l*a):e:cc.v2(e.x+l*s,e.y+l*a),s=t.x-r.x,a=t.y-
r.y,Math.sqrt(s*s+a*a)}n.lineLine=r,n.lineRect=function(t,e,i){var n=new
cc.Vec2(i.x,i.y),s=new cc.Vec2(i.x,i.yMax),a=new cc.Vec2(i.xMax,i.yMax),o=new
cc.Vec2(i.xMax,i.y);return!!(r(t,e,n,s)||r(t,e,s,a)||r(t,e,a,o)||
r(t,e,o,n))},n.linePolygon=s,n.rectRect=function(t,e){var
i=t.x,n=t.y,r=t.x+t.width,s=t.y+t.height,a=e.x,o=e.y,l=e.x+e.width,h=e.y+e.height;r
eturn i<=l&&r>=a&&n<=h&&s>=o},n.rectPolygon=function(t,e){var i,n,r=new
cc.Vec2(t.x,t.y),o=new cc.Vec2(t.x,t.yMax),l=new cc.Vec2(t.xMax,t.yMax),h=new
cc.Vec2(t.xMax,t.y);if(s(r,o,e))return!0;if(s(o,l,e))return!0;if(s(l,h,e))return!
0;if(s(h,r,e))return!0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;return!!
(a(r,e)||a(o,e)||a(l,e)||a(h,e))},n.polygonPolygon=function(t,e){var
i,n;for(i=0,n=t.length;i<n;++i)if(s(t[i],t[(i+1)%n],e))return!
0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;for(i=0,n=t.length;i<n;+
+i)if(a(t[i],e))return!0;return!1},n.circleCircle=function(t,e){return
t.position.sub(e.position).mag()<t.radius+e.radius},n.polygonCircle=function(t,e)
{var i=e.position;if(a(i,t))return!0;for(var
n=0,r=t.length;n<r;n++)if(o(i,0===n?t[t.length-1]:t[n-1],t[n],!0)<e.radius)return!
0;return!1},n.pointInPolygon=a,n.pointLineDistance=o,cc.Intersection=e.exports=n}),
{}],87:[(function(t,e,i){"use strict";cc.Collider.Polygon=cc.Class({properties:
{threshold:{default:1,serializable:!1,visible:!1},_offset:cc.v2(0,0),offset:
{get:function(){return this._offset},set:function(t)
{this._offset=t},type:cc.Vec2},points:{tooltip:!1,default:function(){return[cc.v2(-
50,-50),cc.v2(50,-50),cc.v2(50,50),cc.v2(-50,50)]},type:
[cc.Vec2]}},resetPointsByContour:!1});var
n=cc.Class({name:"cc.PolygonCollider",extends:cc.Collider,mixins:
[cc.Collider.Polygon],editor:!1});cc.PolygonCollider=e.exports=n}),{}],88:
[(function(t,e,i){"use
strict";t("./CCCollisionManager"),t("./CCCollider"),t("./CCBoxCollider"),t("./CCCir
cleCollider"),t("./CCPolygonCollider")}),
{"./CCBoxCollider":81,"./CCCircleCollider":82,"./CCCollider":83,"./CCCollisionManag
er":84,"./CCPolygonCollider":87}],89:[(function(t,e,i){"use
strict";t("./platform/CCClass");var
n=t("./platform/CCObject").Flags,r=t("./platform/js").array,s=n.IsStartCalled,a=n.I
sOnEnableCalled,o=(n.IsEditorOnEnableCalled,"c.start();c._objFlags|
="+s),l="c.update(dt)",h="c.lateUpdate(dt)";function c(t,e){for(var
i=e.constructor._executionOrder,n=e._id,r=0,s=t.length-1,a=s>>>1;r<=s;a=r+s>>>1)
{var o=t[a],l=o.constructor._executionOrder;if(l>i)s=a-1;else if(l<i)r=a+1;else{var
h=o._id;if(h>n)s=a-1;else{if(!(h<n))return a;r=a+1}}}return~r}function u(t,e)
{for(var i=t.array,n=t.i+1;n<i.length;){var
r=i[n];r._enabled&&r.node._activeInHierarchy?++n:
(t.removeAt(n),e&&(r._objFlags&=~e))}}var _=cc.Class({__ctor__:function(t){var
e=r.MutableForwardIterator;this._zero=new e([]),this._neg=new e([]),this._pos=new
e([]),this._invoke=t},statics:
{stableRemoveInactive:u},add:null,remove:null,invoke:null});function f(t,e){return
t.constructor._executionOrder-e.constructor._executionOrder}var
d=cc.Class({extends:_,add:function(t){var e=t.constructor._executionOrder;(0===e?
this._zero:e<0?this._neg:this._pos).array.push(t)},remove:function(t){var
e=t.constructor._executionOrder;(0===e?this._zero:e<0?
this._neg:this._pos).fastRemove(t)},cancelInactive:function(t)
{u(this._zero,t),u(this._neg,t),u(this._pos,t)},invoke:function(){var
t=this._neg;t.array.length>0&&(t.array.sort(f),this._invoke(t),t.array.length=0),th
is._invoke(this._zero),this._zero.array.length=0;var
e=this._pos;e.array.length>0&&(e.array.sort(f),this._invoke(e),e.array.length=0)}})
,m=cc.Class({extends:_,add:function(t){var
e=t.constructor._executionOrder;if(0===e)this._zero.array.push(t);else{var i=e<0?
this._neg.array:this._pos.array,n=c(i,t);n<0&&i.splice(~n,0,t)}},remove:function(t)
{var e=t.constructor._executionOrder;if(0===e)this._zero.fastRemove(t);else{var
i=e<0?this._neg:this._pos,n=c(i.array,t);n>=0&&i.removeAt(n)}},invoke:function(t)
{this._neg.array.length>0&&this._invoke(this._neg,t),this._invoke(this._zero,t),thi
s._pos.array.length>0&&this._invoke(this._pos,t)}});function p(t,e)
{if("function"==typeof t)return e?function(e,i){var
n=e.array;for(e.i=0;e.i<n.length;++e.i){var r=n[e.i];t(r,i)}}:function(e){var
i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];t(n)}};var i="var
a=it.array;for(it.i=0;it.i<a.length;++it.i){var c=a[it.i];"+t+"}";return e?
Function("it","dt",i):Function("it",i)}function v(){this.startInvoker=new
d(p(o)),this.updateInvoker=new m(p(l,!0)),this.lateUpdateInvoker=new m(p(h,!
0)),this.scheduleInNextFrame=[],this._updating=!1}var
y=cc.Class({ctor:v,unscheduleAll:v,statics:
{LifeCycleInvoker:_,OneOffInvoker:d,createInvokeImpl:p,invokeOnEnable:function(t)
{var e=cc.director._compScheduler,i=t.array;for(t.i=0;t.i<i.length;++t.i){var
n=i[t.i];if(n._enabled)n.onEnable(),!n.node._activeInHierarchy||
e._onEnabled(n)}}},_onEnabled:function(t)
{cc.director.getScheduler().resumeTarget(t),t._objFlags|=a,this._updating?
this.scheduleInNextFrame.push(t):this._scheduleImmediate(t)},_onDisabled:function(t
){cc.director.getScheduler().pauseTarget(t),t._objFlags&=~a;var
e=this.scheduleInNextFrame.indexOf(t);e>=0?
r.fastRemoveAt(this.scheduleInNextFrame,e):(!t.start||t._objFlags&s||
this.startInvoker.remove(t),t.update&&this.updateInvoker.remove(t),t.lateUpdate&&th
is.lateUpdateInvoker.remove(t))},enableComp:function(t,e){if(!(t._objFlags&a))
{if(t.onEnable){if(e)return void e.add(t);if(t.onEnable(),!
t.node._activeInHierarchy)return}this._onEnabled(t)}},disableComp:function(t)
{t._objFlags&a&&(t.onDisable&&t.onDisable(),this._onDisabled(t))},_scheduleImmediat
e:function(t){!t.start||t._objFlags&s||
this.startInvoker.add(t),t.update&&this.updateInvoker.add(t),t.lateUpdate&&this.lat
eUpdateInvoker.add(t)},_deferredSchedule:function(){for(var
t=this.scheduleInNextFrame,e=0,i=t.length;e<i;e++){var
n=t[e];this._scheduleImmediate(n)}t.length=0},startPhase:function()
{this._updating=!
0,this.scheduleInNextFrame.length>0&&this._deferredSchedule(),this.startInvoker.inv
oke()},updatePhase:function(t)
{this.updateInvoker.invoke(t)},lateUpdatePhase:function(t)
{this.lateUpdateInvoker.invoke(t),this._updating=!1}});e.exports=y}),
{"./platform/CCClass":200,"./platform/CCObject":206,"./platform/js":220,"./utils/mi
sc":295}],90:[(function(t,e,i){"use strict";var n=t("../../animation/animation-
animator"),r=t("../../animation/animation-clip"),s=t("../event/event-
target"),a=t("../platform/js");function o(t,e){return t===e||
t&&e&&(t.name===e.name||t._uuid===e._uuid)}var
l=cc.Enum({PLAY:"play",STOP:"stop",PAUSE:"pause",RESUME:"resume",LASTFRAME:"lastfra
me",FINISHED:"finished"}),h=cc.Class({name:"cc.Animation",extends:t("./CCComponent"
),mixins:[s],editor:!1,statics:{EventType:l},ctor:function()
{cc.EventTarget.call(this),this._animator=null,this._nameToState=a.createMap(!
0),this._didInit=!1,this._currentClip=null},properties:{_defaultClip:
{default:null,type:r},defaultClip:{type:r,get:function(){return
this._defaultClip},set:function(t){},tooltip:!1},currentClip:{get:function(){return
this._currentClip},set:function(t){this._currentClip=t},type:r,visible:!1},_clips:
{default:[],type:[r],tooltip:!1,visible:!0},playOnLoad:{default:!1,tooltip:!
1}},start:function(){if(this.playOnLoad&&this._defaultClip&&!
(this._animator&&this._animator.isPlaying)){var
t=this.getAnimationState(this._defaultClip.name);this._animator.playState(t)}},onEn
able:function(){this._animator&&this._animator.resume()},onDisable:function()
{this._animator&&this._animator.pause()},onDestroy:function()
{this.stop()},getClips:function(){return this._clips},play:function(t,e){var
i=this.playAdditive(t,e);return
this._animator.stopStatesExcept(i),i},playAdditive:function(t,e){this._init();var
i=this.getAnimationState(t||this._defaultClip&&this._defaultClip.name);if(i)
{this.enabled=!0;var n=this._animator;n.isPlaying&&i.isPlaying?i.isPaused?
n.resumeState(i):
(n.stopState(i),n.playState(i,e)):n.playState(i,e),this.enabledInHierarchy||
n.pause(),this.currentClip=i.clip}return i},stop:function(t){if(this._didInit)if(t)
{var e=this._nameToState[t];e&&this._animator.stopState(e)}else
this._animator.stop()},pause:function(t){if(this._didInit)if(t){var
e=this._nameToState[t];e&&this._animator.pauseState(e)}else this.enabled=!
1},resume:function(t){if(this._didInit)if(t){var
e=this._nameToState[t];e&&this._animator.resumeState(e)}else this.enabled=!
0},setCurrentTime:function(t,e){if(this._init(),e){var
i=this._nameToState[e];i&&this._animator.setStateTime(i,t)}else
this._animator.setStateTime(t)},getAnimationState:function(t){this._init();var
e=this._nameToState[t];return e&&!e.curveLoaded&&this._animator._reloadClip(e),e||
null},addClip:function(t,e){if(t)
{this._init(),cc.js.array.contains(this._clips,t)||this._clips.push(t),e=e||
t.name;var i=this._nameToState[e];if(i){if(i.clip===t)return i;var
n=this._clips.indexOf(i.clip);-1!==n&&this._clips.splice(n,1)}var r=new
cc.AnimationState(t,e);return
this._nameToState[e]=r,r}cc.warnID(3900)},removeClip:function(t,e){if(t)
{this._init();var i=void 0;for(var n in this._nameToState)
{if((i=this._nameToState[n]).clip===t)break}if(t===this._defaultClip){if(!e)return
void cc.warnID(3902);this._defaultClip=null}if(i&&i.isPlaying){if(!e)return void
cc.warnID(3903);this.stop(i.name)}this._clips=this._clips.filter((function(e)
{return e!==t})),i&&delete this._nameToState[i.name]}else
cc.warnID(3901)},sample:function(t){if(this._init(),t){var
e=this._nameToState[t];e&&e.sample()}else
this._animator.sample()},on:function(t,e,i,n){this._init();var
r=this._EventTargetOn(t,e,i,n);if("lastframe"===t)for(var
s=this._animator._anims.array,a=0;a<s.length;++a){s[a]._lastframeEventOn=!0}return
r},off:function(t,e,i,n){if(this._init(),"lastframe"===t){var
r=this._nameToState;for(var s in r){r[s]._lastframeEventOn=!
1}}this._EventTargetOff(t,e,i,n)},_init:function(){this._didInit||(this._didInit=!
0,this._animator=new
n(this.node,this),this._createStates())},_createStates:function()
{this._nameToState=a.createMap(!0);for(var t=null,e=!1,i=0;i<this._clips.length;+
+i){var n=this._clips[i];n&&(t=new
cc.AnimationState(n),this._nameToState[t.name]=t,o(this._defaultClip,n)&&(e=t))}thi
s._defaultClip&&!e&&(t=new
cc.AnimationState(this._defaultClip),this._nameToState[t.name]=t)}});h.prototype._E
ventTargetOn=s.prototype.on,h.prototype._EventTargetOff=s.prototype.off,cc.Animatio
n=e.exports=h}),{"../../animation/animation-animator":9,"../../animation/animation-
clip":10,"../event/event-target":132,"../platform/js":220,"./CCComponent":95}],91:
[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=t("../assets/CCAudioClip"),a=cc.Class({
name:"cc.AudioSource",extends:r,editor:!1,ctor:function(){this.audio=new
cc.Audio},properties:{_clip:{default:null,type:s},_volume:1,_mute:!1,_loop:!
1,_pausedFlag:{default:!1,serializable:!1},isPlaying:{get:function(){return
this.audio.getState()===cc.Audio.State.PLAYING},visible:!1},clip:{get:function()
{return this._clip},set:function(t){if("string"!=typeof t)t!
==this._clip&&(this._clip=t,this.audio.stop(),this.preload&&(this.audio.src=this._c
lip));else{cc.warnID(8401,"cc.AudioSource","cc.Audi
oClip","AudioClip","cc.AudioClip","audio");var e=this;s._loadByUrl(t,(function(t,i)
{i&&(e.clip=i)}))}},type:s,tooltip:!1,animatable:!1},volume:{get:function(){return
this._volume},set:function(t){return t=n.clamp01(t),this._volume=t,this._mute||
this.audio.setVolume(t),t},tooltip:!1},mute:{get:function(){return
this._mute},set:function(t){return this._mute=t,this.audio.setVolume(t?
0:this._volume),t},animatable:!1,tooltip:!1},loop:{get:function(){return
this._loop},set:function(t){return
this._loop=t,this.audio.setLoop(t),t},animatable:!1,tooltip:!1},playOnLoad:
{default:!1,tooltip:!1,animatable:!1},preload:{default:!1,animatable:!
1}},_ensureDataLoaded:function(){this.audio.src!
==this._clip&&(this.audio.src=this._clip)},_pausedCallback:function()
{this.audio.getState()===cc.Audio.State.PLAYING&&(this.audio.pause(),this._pausedFl
ag=!0)},_restoreCallback:function()
{this._pausedFlag&&this.audio.resume(),this._pausedFlag=!1},onLoad:function()
{this.audio.setVolume(this._mute?
0:this._volume),this.audio.setLoop(this._loop)},onEnable:function()
{this.preload&&(this.audio.src=this._clip),this.playOnLoad&&this.play(),cc.game.on(
cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.on(cc.game.EVENT_SHOW,this._r
estoreCallback,this)},onDisable:function()
{this.stop(),cc.game.off(cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.off(
cc.game.EVENT_SHOW,this._restoreCallback,this)},onDestroy:function()
{this.stop(),this.audio.destroy(),cc.audioEngine.uncache(this._clip)},play:function
(){if(this._clip){var
t=this.audio;this._clip.loaded&&t.stop(),this._ensureDataLoaded(),t.setCurrentTime(
0),t.play()}},stop:function(){this.audio.stop()},pause:function()
{this.audio.pause()},resume:function()
{this._ensureDataLoaded(),this.audio.resume()},rewind:function()
{this.audio.setCurrentTime(0)},getCurrentTime:function(){return
this.audio.getCurrentTime()},setCurrentTime:function(t){return
this.audio.setCurrentTime(t),t},getDuration:function(){return
this.audio.getDuration()}});cc.AudioSource=e.exports=a}),
{"../assets/CCAudioClip":57,"../utils/misc":295,"./CCComponent":95}],92:
[(function(t,e,i){"use strict";var
n=["touchstart","touchmove","touchend","mousedown","mousemove","mouseup","mouseente
r","mouseleave","mousewheel"];function r(t){t.stopPropagation()}var
s=cc.Class({name:"cc.BlockInputEvents",extends:t("./CCComponent"),editor:
{menu:"i18n:MAIN_MENU.component.ui/Block Input
Events",inspector:"packages://inspector/inspectors/comps/block-input-
events.js",help:"i18n:COMPONENT.help_url.block_input_events"},onEnable:function()
{for(var t=0;t<n.length;t++)this.node.on(n[t],r,this)},onDisable:function(){for(var
t=0;t<n.length;t++)this.node.off(n[t],r,this)}});cc.BlockInputEvents=e.exports=s}),
{"./CCComponent":95}],93:[(function(t,e,i){"use strict";var
n=t("./CCComponent"),r=t("../utils/gray-sprite-
state"),s=cc.Enum({NONE:0,COLOR:1,SPRITE:2,SCALE:3}),a=cc.Enum({NORMAL:0,HOVER:1,PR
ESSED:2,DISABLED:3}),o=cc.Class({name:"cc.Button",extends:n,mixins:
[r],ctor:function(){this._pressed=!1,this._hovered=!
1,this._fromColor=null,this._toColor=null,this._time=0,this._transitionFinished=!
0,this._fromScale=cc.Vec2.ZERO,this._toScale=cc.Vec2.ZERO,this._originalScale=null,
this._graySpriteMaterial=null,this._spriteMaterial=null,this._sprite=null},editor:!
1,properties:{interactable:{default:!0,tooltip:!1,notify:function()
{this._updateState(),this.interactable||this._resetState()},animatable:!
1},_resizeToTarget:{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}},enableAutoGrayEffect:{default:!1,tooltip:!
1,notify:function(){this._updateDisabledState()}},transition:
{default:s.NONE,tooltip:!1,type:s,animatable:!1,notify:function(t)
{this._updateTransition(t)},formerlySerializedAs:"transition"},normalColor:
{default:cc.color(214,214,214),displayName:"Normal",tooltip:!1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.NORMAL&&(this._getTarget().o
pacity=this.normalColor.a),this._updateState()}},pressedColor:
{default:cc.color(211,211,211),displayName:"Pressed",tooltip:!1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.PRESSED&&(this._getTarget().
opacity=this.pressedColor.a),this._updateState()},formerlySerializedAs:"pressedColo
r"},hoverColor:{default:cc.Color.WHITE,displayName:"Hover",tooltip:!
1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.HOVER&&(this._getTarget().op
acity=this.hoverColor.a),this._updateState()},formerlySerializedAs:"hoverColor"},di
sabledColor:{default:cc.color(124,124,124),displayName:"Disabled",tooltip:!
1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.DISABLED&&(this._getTarget()
.opacity=this.disabledColor.a),this._updateState()}},duration:{default:.1,range:
[0,10],tooltip:!1},zoomScale:{default:1.2,tooltip:!1},normalSprite:
{default:null,type:cc.SpriteFrame,displayName:"Normal",tooltip:!1,notify:function()
{this._updateState()}},pressedSprite:
{default:null,type:cc.SpriteFrame,displayName:"Pressed",tooltip:!
1,formerlySerializedAs:"pressedSprite",notify:function()
{this._updateState()}},hoverSprite:
{default:null,type:cc.SpriteFrame,displayName:"Hover",tooltip:!
1,formerlySerializedAs:"hoverSprite",notify:function()
{this._updateState()}},disabledSprite:
{default:null,type:cc.SpriteFrame,displayName:"Disabled",tooltip:!
1,notify:function(){this._updateState()}},target:
{default:null,type:cc.Node,tooltip:!1,notify:function(t)
{this._applyTarget(),t&&this.target!
==t&&this._unregisterTargetEvent(t)}},clickEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{Transition:s},__preload:function()
{this._applyTarget(),this._updateState()},_resetState:function(){this._pressed=!
1,this._hovered=!1;var
t=this._getTarget(),e=this.transition,i=this._originalScale;e===s.COLOR&&this.inter
actable?
this._setTargetColor(this.normalColor):e===s.SCALE&&i&&t.setScale(i.x,i.y),this._tr
ansitionFinished=!0},onEnable:function()
{this.normalSprite&&this.normalSprite.ensureLoadTexture(),this.hoverSprite&&this.ho
verSprite.ensureLoadTexture(),this.pressedSprite&&this.pressedSprite.ensureLoadText
ure(),this.disabledSprite&&this.disabledSprite.ensureLoadTexture(),this._registerNo
deEvent()},onDisable:function()
{this._resetState(),this._unregisterNodeEvent()},_getTarget:function(){return
this.target?this.target:this.node},_onTargetSpriteFrameChanged:function(t)
{this.transition===s.SPRITE&&this._setCurrentStateSprite(t.spriteFrame)},_onTargetC
olorChanged:function(t)
{this.transition===s.COLOR&&this._setCurrentStateColor(t)},_onTargetScaleChanged:fu
nction(){var t=this._getTarget();this._originalScale&&(this.transition!==s.SCALE||
this._transitionFinished)&&(this._originalScale.x=t.scaleX,this._originalScale.y=t.
scaleY)},_setTargetColor:function(t){var
e=this._getTarget();e.color=t,e.opacity=t.a},_getStateColor:function(t){switch(t)
{case a.NORMAL:return this.normalColor;case a.HOVER:return this.hoverColor;case
a.PRESSED:return this.pressedColor;case a.DISABLED:return
this.disabledColor}},_getStateSprite:function(t){switch(t){case a.NORMAL:return
this.normalSprite;case a.HOVER:return this.hoverSprite;case a.PRESSED:return
this.pressedSprite;case a.DISABLED:return
this.disabledSprite}},_setCurrentStateColor:function(t)
{switch(this._getButtonState()){case a.NORMAL:this.normalColor=t;break;case
a.HOVER:this.hoverColor=t;break;case a.PRESSED:this.pressedColor=t;break;case
a.DISABLED:this.disabledColor=t}},_setCurrentStateSprite:function(t)
{switch(this._getButtonState()){case a.NORMAL:this.normalSprite=t;break;case
a.HOVER:this.hoverSprite=t;break;case a.PRESSED:this.pressedSprite=t;break;case
a.DISABLED:this.disabledSprite=t}},update:function(t){var e=this._getTarget();if(!
this._transitionFinished&&(this.transition===s.COLOR||this.transition===s.SCALE))
{this.time+=t;var
i=1;if(this.duration>0&&(i=this.time/this.duration),i>=1&&(i=1),this.transition===s
.COLOR){var n=this._fromColor.lerp(this._toColor,i);this._setTargetColor(n)}else
this.transition===s.SCALE&&this._originalScale&&(e.scale=this._fromScale.lerp(this.
_toScale,i));1===i&&(this._transitionFinished=!0)}},_registerNodeEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.on(cc.Node.EventType.
TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this
._onTouchCancel,this),this.node.on(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveI
n,this),this.node.on(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_unr
egisterNodeEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.off(cc.Node.EventTy
pe.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL,
this._onTouchCancel,this),this.node.off(cc.Node.EventType.MOUSE_ENTER,this._onMouse
MoveIn,this),this.node.off(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)
},_registerTargetEvent:function(t)
{t.on(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_unregister
TargetEvent:function(t)
{t.off(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_getTarget
Sprite:function(t){var e=null;return
t&&(e=t.getComponent(cc.Sprite)),e},_applyTarget:function(){var
t=this._getTarget();this._sprite=this._getTargetSprite(t),this._originalScale||
(this._originalScale=cc.Vec2.ZERO),this._originalScale.x=t.scaleX,this._originalSca
le.y=t.scaleY,this._registerTargetEvent(t)},_onTouchBegan:function(t)
{this.interactable&&this.enabledInHierarchy&&(this._pressed=!
0,this._updateState(),t.stopPropagation())},_onTouchMove:function(t)
{if(this.interactable&&this.enabledInHierarchy&&this._pressed){var
e=t.touch,i=this.node._hitTest(e.getLocation()),n=this._getTarget(),r=this._origina
lScale;if(this.transition===s.SCALE&&r)i?
(this._fromScale.x=r.x,this._fromScale.y=r.y,this._toScale.x=r.x*this.zoomScale,thi
s._toScale.y=r.y*this.zoomScale,this._transitionFinished=!1):
(this.time=0,this._transitionFinished=!0,n.setScale(r.
x,r.y));else{var o=void 0;o=i?
a.PRESSED:a.NORMAL,this._applyTransition(o)}t.stopPropagation()}},_onTouchEnded:fun
ction(t)
{this.interactable&&this.enabledInHierarchy&&(this._pressed&&(cc.Component.EventHan
dler.emitEvents(this.clickEvents,t),this.node.emit("click",this)),this._pressed=!
1,this._updateState(),t.stopPropagation())},_onTouchCancel:function()
{this.interactable&&this.enabledInHierarchy&&(this._pressed=!
1,this._updateState())},_onMouseMoveIn:function(){!
this._pressed&&this.interactable&&this.enabledInHierarchy&&(this.transition!
==s.SPRITE||this.hoverSprite)&&(this._hovered||(this._hovered=!
0,this._updateState()))},_onMouseMoveOut:function(){this._hovered&&(this._hovered=!
1,this._updateState())},_updateState:function(){var
t=this._getButtonState();this._applyTransition(t),this._updateDisabledState()},_get
ButtonState:function(){return this.interactable?this._pressed?
a.PRESSED:this._hovered?
a.HOVER:a.NORMAL:a.DISABLED},_updateColorTransitionImmediately:function(t){var
e=this._getStateColor(t);this._setTargetColor(e)},_updateColorTransition:function(t
){if(t===a.DISABLED)this._updateColorTransitionImmediately(t);else{var
e=this._getTarget(),i=this._getStateColor(t);this._fromColor=e.color.clone(),this._
toColor=i,this.time=0,this._transitionFinished=!
1}},_updateSpriteTransition:function(t){var
e=this._getStateSprite(t);this._sprite&&e&&(this._sprite.spriteFrame=e)},_updateSca
leTransition:function(t){t===a.PRESSED?
this._zoomUp():this._zoomBack()},_zoomUp:function()
{this._originalScale&&(this._fromScale.x=this._originalScale.x,this._fromScale.y=th
is._originalScale.y,this._toScale.x=this._originalScale.x*this.zoomScale,this._toSc
ale.y=this._originalScale.y*this.zoomScale,this.time=0,this._transitionFinished=!
1)},_zoomBack:function(){if(this._originalScale){var
t=this._getTarget();this._fromScale.x=t.scaleX,this._fromScale.y=t.scaleY,this._toS
cale.x=this._originalScale.x,this._toScale.y=this._originalScale.y,this.time=0,this
._transitionFinished=!1}},_updateTransition:function(t){t===s.COLOR?
this._updateColorTransitionImmediately(a.NORMAL):t===s.SPRITE&&this._updateSpriteTr
ansition(a.NORMAL),this._updateState()},_applyTransition:function(t){var
e=this.transition;e===s.COLOR?this._updateColorTransition(t):e===s.SPRITE?
this._updateSpriteTransition(t):e===s.SCALE&&this._updateScaleTransition(t)},_resiz
eNodeToTargetNode:!1,_updateDisabledState:function(){if(this._sprite){var t=!
1;this.enableAutoGrayEffect&&(this.transition===s.SPRITE&&this.disabledSprite||
this.interactable||(t=!
0)),this._switchGrayMaterial(t,this._sprite)}}});cc.Button=e.exports=o}),
{"../utils/gray-sprite-state":291,"./CCComponent":95}],94:[(function(t,e,i){"use
strict";var
n=t("../camera/CCCamera"),r=t("./CCComponent"),s=cc.Class({name:"cc.Canvas",extends
:r,editor:!1,resetInEditor:!1,statics:{instance:null},properties:
{_designResolution:cc.size(960,640),designResolution:{get:function(){return
cc.size(this._designResolution)},set:function(t)
{this._designResolution.width=t.width,this._designResolution.height=t.height,this.a
pplySettings(),this.alignWithScreen()},tooltip:!1},_fitWidth:!1,_fitHeight:!
0,fitHeight:{get:function(){return this._fitHeight},set:function(t)
{this._fitHeight!
==t&&(this._fitHeight=t,this.applySettings(),this.alignWithScreen())},tooltip:!
1},fitWidth:{get:function(){return this._fitWidth},set:function(t){this._fitWidth!
==t&&(this._fitWidth=t,this.applySettings(),this.alignWithScreen())},tooltip:!
1}},ctor:function()
{this._thisOnResized=this.alignWithScreen.bind(this)},__preload:function()
{if(s.instance)return
cc.errorID(6700,this.node.name,s.instance.node.name);s.instance=this,cc.sys.isMobil
e?window.addEventListener("resize",this._thisOnResized):cc.view.on("canvas-
resize",this._thisOnResized),this.applySettings(),this.alignWithScreen();var
t=cc.find("Main Camera",this.node);t||((t=new cc.Node("Main
Camera")).parent=this.node,t.setSiblingIndex(0));var e=t.getComponent(n);if(!e)
{e=t.addComponent(n);var i=n.ClearFlags;e.clearFlags=i.COLOR|i.DEPTH|
i.STENCIL,e.depth=-1}n.main=e},onDestroy:function(){cc.sys.isMobile?
window.removeEventListener("resize",this._thisOnResized):cc.view.off("canvas-
resize",this._thisOnResized),s.instance===this&&(s.instance=null)},alignWithScreen:
function(){var t,e,i=e=cc.visibleRect;t=cc.view.getDesignResolutionSize();var
n=0,r=0;!this.fitHeight&&!this.fitWidth&&(n=.5*(t.width-i.width),r=.5*(t.height-
i.height)),this.node.setPosition(.5*i.width+n,.5*i.height+r),this.node.width=e.widt
h,this.node.height=e.height},applySettings:function(){var
t,e=cc.ResolutionPolicy;t=this.fitHeight&&this.fitWidth?e.SHOW_ALL:this.fitHeight||
this.fitWidth?this.fitWidth?e.FIXED_WIDTH:e.FIXED_HEIGHT:e.NO_BORDER;var param=new
URLSearchParams(window.location.search),isExactFit=!1;if(param){var
infoParam=param.get("RP");infoParam&&"exactfit"==infoParam.toLowerCase()&&(isExactF
it=!0)}isExactFit&&(t=e.EXACT_FIT);var
i=this._designResolution;cc.view.setDesignResolutionSize(i.width,i.height,t)}});cc.
Canvas=e.exports=s}),{"../camera/CCCamera":80,"./CCComponent":95}],95:
[(function(t,e,i){"use strict";var
n=t("../platform/CCObject"),r=t("../platform/js"),s=new(t("../platform/id-
generater"))
("Comp"),a=(n.Flags.IsOnEnableCalled,n.Flags.IsOnLoadCalled),o=cc.Class({name:"cc.C
omponent",extends:n,ctor:function()
{this._id=s.getNewId(),this.__eventTargets=[]},properties:{node:
{default:null,visible:!1},name:{get:function(){if(this._name)return this._name;var
t=cc.js.getClassName(this),e=t.lastIndexOf(".");return
e>=0&&(t=t.slice(e+1)),this.node.name+"<"+t+">"},set:function(t)
{this._name=t},visible:!1},uuid:{get:function(){return this._id},visible:!
1},__scriptAsset:!1,_enabled:!0,enabled:{get:function(){return
this._enabled},set:function(t){if(this._enabled!
==t&&(this._enabled=t,this.node._activeInHierarchy)){var
e=cc.director._compScheduler;t?e.enableComp(this):e.disableComp(this)}},visible:!
1,animatable:!0},enabledInHierarchy:{get:function(){return
this._enabled&&this.node._activeInHierarchy},visible:!1},_isOnLoadCalled:
{get:function(){return
this._objFlags&a}}},update:null,lateUpdate:null,__preload:null,onLoad:null,start:nu
ll,onEnable:null,onDisable:null,onDestroy:null,onFocusInEditor:null,onLostFocusInEd
itor:null,resetInEditor:null,addComponent:function(t){return
this.node.addComponent(t)},getComponent:function(t){return
this.node.getComponent(t)},getComponents:function(t){return
this.node.getComponents(t)},getComponentInChildren:function(t){return
this.node.getComponentInChildren(t)},getComponentsInChildren:function(t){return
this.node.getComponentsInChildren(t)},_getLocalBounds:null,onRestore:null,destroy:f
unction()
{this._super()&&this._enabled&&this.node._activeInHierarchy&&cc.director._compSched
uler.disableComp(this)},_onPreDestroy:function()
{this.unscheduleAllCallbacks();for(var t=this.__eventTargets,e=0,i=t.length;e<i;+
+e){var
n=t[e];n&&n.targetOff(this)}t.length=0,cc.director._nodeActivator.destroyComp(this)
,this.node._removeComponent(this)},_instantiate:function(t){return t||
(t=cc.instantiate._clone(this,this)),t.node=null,t},schedule:function(t,e,i,n)
{cc.assertID(t,1619),cc.assertID(e>=0,1620),e=e||0,i=isNaN(i)?
cc.macro.REPEAT_FOREVER:i,n=n||0;var
r=cc.director.getScheduler(),s=r.isTargetPaused(this);r.schedule(t,this,e,i,n,s)},s
cheduleOnce:function(t,e){this.schedule(t,0,0,e)},unschedule:function(t)
{t&&cc.director.getScheduler().unschedule(t,this)},unscheduleAllCallbacks:function(
)
{cc.director.getScheduler().unscheduleAllForTarget(this)}});o._requireComponent=nul
l,o._executionOrder=0,r.value(o,"_registerEditorProps",(function(t,e){var
i=e.requireComponent;i&&(t._requireComponent=i);var
n=e.executionOrder;n&&"number"==typeof
n&&(t._executionOrder=n)})),o.prototype.__scriptUuid="",cc.Component=e.exports=o}),
{"../platform/CCObject":206,"../platform/id-
generater":216,"../platform/js":220}],96:[(function(t,e,i){"use
strict";cc.Component.EventHandler=cc.Class({name:"cc.ClickEvent",properties:
{target:{default:null,type:cc.Node},component:"",_componentId:"",_componentName:
{get:function(){return
this._genCompIdIfNeeded(),this._compId2Name(this._componentId)},set:function(t)
{this._componentId=this._compName2Id(t)}},handler:{default:""},customEventData:
{default:""}},statics:{emitEvents:function(t){var e=void
0;if(arguments.length>0)for(var i=0,n=(e=new Array(arguments.length-
1)).length;i<n;i++)e[i]=arguments[i+1];for(var r=0,s=t.length;r<s;r++){var a=t[r];a
instanceof cc.Component.EventHandler&&a.emit(e)}}},emit:function(t){var
e=this.target;if(cc.isValid(e)){this._genCompIdIfNeeded();var
i=cc.js._getClassById(this._componentId),n=e.getComponent(i);if(cc.isValid(n)){var
r=n[this.handler];"function"==typeof r&&(null!=this.customEventData&&""!
==this.customEventData&&(t=t.slice()).push(this.customEventData),r.apply(n,t))}}},_
compName2Id:function(t){var e=cc.js.getClassByName(t);return
cc.js._getClassId(e)},_compId2Name:function(t){var e=cc.js._getClassById(t);return
cc.js.getClassName(e)},_genCompIdIfNeeded:function(){this._componentId||
(this._componentName=this.component,this.component="")}})}),{}],97:
[(function(t,e,i){"use strict";var
n=t("../platform/CCMacro"),r=t("./CCRenderComponent"),s=t("../assets/material/CCMat
erial"),a=t("../renderer/utils/label/label-frame"),o=t("../renderer/render-
flow"),l=(o.FLAG_COLOR,o.FLAG_OPACITY,n.TextAlignment),h=n.VerticalTextAlignment,c=
cc.Enum({NONE:0,CLAMP:1,SHRINK:2,RESIZE_HEIGHT:3}),u=cc.Enum({NONE:0,BITMAP:1,CHAR:
2}),_=cc.Class({name:"cc.Label",extends:r,ctor:function()
{this._actualFontSize=0,this._assemblerData=null,this._frame=null,this._ttfTexture=
null,this._letterTexture=null},editor:!1,properties:{_useOriginalSize:!0,_string:
{default:"",formerlySerializedAs:"_N$string"},string:{get:function(){return
this._string},set:function(t){var
e=this._string;this._string=t.toString(),this.string!
==e&&this._updateRenderData(),this._checkStringEmpty()},multiline:!0,tooltip:!
1},horizontalAlign:{default:l.LEFT,type:l,tooltip:!1,notify:function(t)
{this.horizontalAlign!==t&&this._updateRenderData()},animatable:!1},verticalA
lign:{default:h.TOP,type:h,tooltip:!1,notify:function(t){this.verticalAlign!
==t&&this._updateRenderData()},animatable:!1},actualFontSize:{displayName:"Actual
Font Size",animatable:!1,readonly:!0,get:function(){return
this._actualFontSize},tooltip:!1},_fontSize:40,fontSize:{get:function(){return
this._fontSize},set:function(t){this._fontSize!
==t&&(this._fontSize=t,this._updateRenderData())},range:[0,512],tooltip:!
1},fontFamily:{default:"Arial",tooltip:!1,notify:function(t){this.fontFamily!
==t&&this._updateRenderData()},animatable:!1},_lineHeight:40,lineHeight:
{get:function(){return this._lineHeight},set:function(t){this._lineHeight!
==t&&(this._lineHeight=t,this._updateRenderData())},tooltip:!1},overflow:
{default:c.NONE,type:c,tooltip:!1,notify:function(t){this.overflow!
==t&&this._updateRenderData()},animatable:!1},_enableWrapText:!0,enableWrapText:
{get:function(){return this._enableWrapText},set:function(t){this._enableWrapText!
==t&&(this._enableWrapText=t,this._updateRenderData())},animatable:!1,tooltip:!
1},_N$file:null,font:{get:function(){return this._N$file},set:function(t)
{this.font!==t&&(t||(this._isSystemFontUsed=!
0),this._N$file=t,t&&this._isSystemFontUsed&&(this._isSystemFontUsed=!
1),"string"==typeof
t&&cc.warnID(4e3),this._renderData&&(this.destroyRenderData(this._renderData),this.
_renderData=null),this._fontAtlas=null,this._updateAssembler(),this._applyFontTextu
re(!0),this._updateRenderData())},type:cc.Font,tooltip:!1,animatable:!
1},_isSystemFontUsed:!0,useSystemFont:{get:function(){return
this._isSystemFontUsed},set:function(t){this._isSystemFontUsed!
==t&&(this.destroyRenderData(this._renderData),this._renderData=null,this._isSystem
FontUsed=!!t,t?
(this.font=null,this._updateAssembler(),this._updateRenderData(),this._checkStringE
mpty()):this._userDefinedFont||this.disableRender())},animatable:!1,tooltip:!
1},_bmFontOriginalSize:{displayName:"BMFont Original Size",get:function(){return
this._N$file instanceof cc.BitmapFont?this._N$file.fontSize:-1},visible:!
0,animatable:!1},_spacingX:0,spacingX:{get:function(){return
this._spacingX},set:function(t)
{this._spacingX=t,this._updateRenderData()},tooltip:!1},_batchAsBitmap:!
1,cacheMode:{default:u.NONE,type:u,tooltip:!1,notify:function(t){this.cacheMode!
==t&&(t!==u.BITMAP||this.font instanceof cc.BitmapFont||
this._frame._resetDynamicAtlasFrame(),t===u.CHAR&&(this._ttfTexture=null),this._upd
ateRenderData(!0))},animatable:!1},_isBold:{default:!1,serializable:!1},_isItalic:
{default:!1,serializable:!1},_isUnderline:{default:!1,serializable:!1}},statics:
{HorizontalAlign:l,VerticalAlign:h,Overflow:c,CacheMode:u},onLoad:function()
{this._batchAsBitmap&&this.cacheMode===u.NONE&&(this.cacheMode=u.BITMAP,this._batch
AsBitmap=!1)},onEnable:function(){this._super(),this.font||this._isSystemFontUsed||
(this.useSystemFont=!0),this.useSystemFont&&!
this.fontFamily&&(this.fontFamily="Arial"),this.node.on(cc.Node.EventType.SIZE_CHAN
GED,this._updateRenderData,this),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this
._updateRenderData,this),this.node.on(cc.Node.EventType.COLOR_CHANGED,this._updateC
olor,this),this._checkStringEmpty(),this._updateRenderData(!
0)},onDisable:function()
{this._super(),this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateRenderData,
this),this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this._updateRenderData,this),t
his.node.off(cc.Node.EventType.COLOR_CHANGED,this._updateColor,this)},onDestroy:fun
ction()
{this._assembler&&this._assembler._resetAssemblerData&&this._assembler._resetAssemb
lerData(this._assemblerData),this._assemblerData=null,this._letterTexture=null,this
._ttfTexture&&(this._ttfTexture.destroy(),this._ttfTexture=null),this._super()},_ca
nRender:function(){var t=this._super(),e=this.font;if(e instanceof cc.BitmapFont)
{var i=e.spriteFrame;i&&i.textureLoaded()||(t=!1)}return
t},_checkStringEmpty:function(){this.markForRender(!!
this.string)},_on3DNodeChanged:function()
{this._updateAssembler(),this._applyFontTexture(!0)},_updateAssembler:function()
{var t=_._assembler.getAssembler(this);this._assembler!
==t&&(this._assembler=t,this._renderData=null,this._frame=null),this._renderData||
(this._renderData=this._assembler.createData(this),this.markForUpdateRenderData(!
0))},_applyFontTexture:function(t){var e=this.font;if(e instanceof cc.BitmapFont)
{var i=e.spriteFrame;this._frame=i;var n=this,r=function()
{n._frame._texture=i._texture,n._activateMaterial(t),t&&n._assembler&&n._assembler.
updateRenderData(n)};i&&i.textureLoaded()?r():
(this.disableRender(),i&&(i.once("load",r,this),i.ensureLoadTexture()))}else
this._frame||(this._frame=new a),this.cacheMode===u.CHAR&&cc.sys.browserType!
==cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB?
(this._letterTexture=this._assembler._getAssemblerData(),this._frame._refreshTextur
e(this._letterTexture)):this._ttfTexture||(this._ttfTexture=new
cc.Texture2D,this._assemblerData=this._assembler._getAssemblerData(),this._ttfTextu
re.initWithElement(this._assemblerData.canvas)),this.cacheMode!
==u.CHAR&&this._frame._refreshTexture(this._ttfTexture),this._activateMaterial(t),t
&&this._assembler&&this._assembler.updateRenderData(this)},_updateColor:function()
{this.font instanceof cc.BitmapFont||
(this._updateRenderData(),this.node._renderFlag&=~o.FLAG_COLOR)},_activateMaterial:
function(t){if(t)
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS)this._frame._texture.url=this.u
uid+"_texture";else{var e=this.sharedMaterials[0];e?
e=s.getInstantiatedMaterial(e,this):
(e=s.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),e.setProperty("texture",this._frame._texture),this.setMaterial(0,e)}this.markFor
UpdateRenderData(!0),this.markForRender(!0)}},_updateRenderData:function(t){var
e=this._renderData;e&&(e.vertDirty=!0,e.uvDirty=!0,this.markForUpdateRenderData(!
0)),t&&(this._updateAssembler(),this._applyFontTexture(t))},_enableBold:function(t)
{this._isBold=!!t},_enableItalics:function(t){this._isItalic=!!
t},_enableUnderline:function(t){this._isUnderline=!!t}});cc.Label=e.exports=_}),
{"../assets/material/CCMaterial":75,"../platform/CCMacro":205,"../renderer/render-
flow":244,"../renderer/utils/label/label-frame":248,"./CCRenderComponent":106}],98:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelOutline",extends:t("./CCComponent"),editor:!1,properties:
{_color:cc.Color.WHITE,_width:1,color:{tooltip:!1,get:function(){return
this._color},set:function(t){this._color=t,this._updateRenderData()}},width:
{tooltip:!1,get:function(){return this._width},set:function(t)
{this._width=t,this._updateRenderData()},range:[0,512]}},onEnable:function()
{this._updateRenderData()},onDisable:function()
{this._updateRenderData()},_updateRenderData:function(){var
t=this.node.getComponent(cc.Label);t&&t._updateRenderData()}});cc.LabelOutline=e.ex
ports=n}),{"./CCComponent":95}],99:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelShadow",extends:t("./CCComponent"),editor:!1,properties:
{_color:cc.Color.WHITE,_offset:cc.v2(2,2),_blur:2,color:{tooltip:!1,get:function()
{return this._color},set:function(t)
{this._color=t,this._updateRenderData()}},offset:{tooltip:!1,get:function(){return
this._offset},set:function(t){this._offset=t,this._updateRenderData()}},blur:
{tooltip:!1,get:function(){return this._blur},set:function(t)
{this._blur=t,this._updateRenderData()},range:[0,1024]}},onEnable:function()
{this._updateRenderData()},onDisable:function()
{this._updateRenderData()},_updateRenderData:function(){var
t=this.node.getComponent(cc.Label);t&&t._updateRenderData()}});cc.LabelShadow=e.exp
orts=n}),{"./CCComponent":95}],100:[(function(t,e,i){"use strict";var
n=t("../CCNode").EventType,r=cc.Enum({NONE:0,HORIZONTAL:1,VERTICAL:2,GRID:3}),s=cc.
Enum({NONE:0,CONTAINER:1,CHILDREN:2}),a=cc.Enum({HORIZONTAL:0,VERTICAL:1}),o=cc.Enu
m({BOTTOM_TO_TOP:0,TOP_TO_BOTTOM:1}),l=cc.Enum({LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1}),h
=cc.Class({name:"cc.Layout",extends:t("./CCComponent"),editor:!1,properties:
{_layoutSize:cc.size(300,200),_layoutDirty:{default:!0,serializable:!
1},_resize:s.NONE,_N$layoutType:r.NONE,type:{type:r,get:function(){return
this._N$layoutType},set:function(t)
{this._N$layoutType=t,this._doLayoutDirty()},tooltip:!1,animatable:!1},resizeMode:
{type:s,tooltip:!1,animatable:!1,get:function(){return
this._resize},set:function(t){this.type===r.NONE&&t===s.CHILDREN||
(this._resize=t,this._doLayoutDirty())}},cellSize:{default:cc.size(40,40),tooltip:!
1,type:cc.Size,notify:function(){this._doLayoutDirty()}},startAxis:
{default:a.HORIZONTAL,tooltip:!1,type:a,notify:function()
{this._doLayoutDirty()},animatable:!1},_N$padding:{default:0},paddingLeft:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingRight:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingTop:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingBottom:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},spacingX:
{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},spacingY:
{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},verticalDirection:
{default:o.TOP_TO_BOTTOM,type:o,notify:function(){this._doLayoutDirty()},tooltip:!
1,animatable:!1},horizontalDirection:
{default:l.LEFT_TO_RIGHT,type:l,notify:function(){this._doLayoutDirty()},tooltip:!
1,animatable:!1},affectedByScale:{default:!1,notify:function()
{this._doLayoutDirty()},animatable:!1,tooltip:!1}},statics:
{Type:r,VerticalDirection:o,HorizontalDirection:l,ResizeMode:s,AxisDirection:a},_mi
gratePaddingData:function()
{this.paddingLeft=this._N$padding,this.paddingRight=this._N$padding,this.paddingTop
=this._N$padding,this.paddingBottom=this._N$padding,this._N$padding=0},onEnable:fun
ction()
{this._addEventListeners(),this.node.getContentSize().equals(cc.size(0,0))&&this.no
de.setContentSize(this._layoutSize),0!
==this._N$padding&&this._migratePaddingData(),this._doLayoutDirty()},onDisable:func
tion(){this._removeEventListeners()},_doLayoutDirty:function(){this._layoutDirty=!
0},_doScaleDirty:function(){this._layoutDirty=this._layoutDirty||
this.affectedByScale},_addEventListeners:f
unction()
{cc.director.on(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.on
(n.SIZE_CHANGED,this._resized,this),this.node.on(n.ANCHOR_CHANGED,this._doLayoutDir
ty,this),this.node.on(n.CHILD_ADDED,this._childAdded,this),this.node.on(n.CHILD_REM
OVED,this._childRemoved,this),this.node.on(n.CHILD_REORDER,this._doLayoutDirty,this
),this._addChildrenEventListeners()},_removeEventListeners:function()
{cc.director.off(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.o
ff(n.SIZE_CHANGED,this._resized,this),this.node.off(n.ANCHOR_CHANGED,this._doLayout
Dirty,this),this.node.off(n.CHILD_ADDED,this._childAdded,this),this.node.off(n.CHIL
D_REMOVED,this._childRemoved,this),this.node.off(n.CHILD_REORDER,this._doLayoutDirt
y,this),this._removeChildrenEventListeners()},_addChildrenEventListeners:function()
{for(var t=this.node.children,e=0;e<t.length;++e){var
i=t[e];i.on(n.SCALE_CHANGED,this._doScaleDirty,this),i.on(n.SIZE_CHANGED,this._doLa
youtDirty,this),i.on(n.POSITION_CHANGED,this._doLayoutDirty,this),i.on(n.ANCHOR_CHA
NGED,this._doLayoutDirty,this),i.on("active-in-hierarchy-
changed",this._doLayoutDirty,this)}},_removeChildrenEventListeners:function()
{for(var t=this.node.children,e=0;e<t.length;++e){var
i=t[e];i.off(n.SCALE_CHANGED,this._doScaleDirty,this),i.off(n.SIZE_CHANGED,this._do
LayoutDirty,this),i.off(n.POSITION_CHANGED,this._doLayoutDirty,this),i.off(n.ANCHOR
_CHANGED,this._doLayoutDirty,this),i.off("active-in-hierarchy-
changed",this._doLayoutDirty,this)}},_childAdded:function(t)
{t.on(n.SCALE_CHANGED,this._doScaleDirty,this),t.on(n.SIZE_CHANGED,this._doLayoutDi
rty,this),t.on(n.POSITION_CHANGED,this._doLayoutDirty,this),t.on(n.ANCHOR_CHANGED,t
his._doLayoutDirty,this),t.on("active-in-hierarchy-
changed",this._doLayoutDirty,this),this._doLayoutDirty()},_childRemoved:function(t)
{t.off(n.SCALE_CHANGED,this._doScaleDirty,this),t.off(n.SIZE_CHANGED,this._doLayout
Dirty,this),t.off(n.POSITION_CHANGED,this._doLayoutDirty,this),t.off(n.ANCHOR_CHANG
ED,this._doLayoutDirty,this),t.off("active-in-hierarchy-
changed",this._doLayoutDirty,this),this._doLayoutDirty()},_resized:function()
{this._layoutSize=this.node.getContentSize(),this._doLayoutDirty()},_doLayoutHorizo
ntally:function(t,e,i,n){var
a=this.node.getAnchorPoint(),h=this.node.children,c=1,u=this.paddingLeft,_=-
a.x*t;this.horizontalDirection===l.RIGHT_TO_LEFT&&(c=-1,_=(1-
a.x)*t,u=this.paddingRight);for(var f=_+c*u-
c*this.spacingX,d=0,m=0,p=0,v=0,y=0,g=0,x=0,b=0;b<h.length;++b)
{(C=h[b]).activeInHierarchy&&x++}var A=this.cellSize.width;this.type!
==r.GRID&&this.resizeMode===s.CHILDREN&&(A=(t-(this.paddingLeft+this.paddingRight)-
(x-1)*this.spacingX)/x);for(b=0;b<h.length;++b){var
C=h[b],S=this._getUsedScaleValue(C.scaleX),T=this._getUsedScaleValue(C.scaleY);if(C
.activeInHierarchy)
{this._resize===s.CHILDREN&&(C.width=A/S,this.type===r.GRID&&(C.height=this.cellSiz
e.height/T));var
w=C.anchorX,E=C.width*S,M=C.height*T;p>m&&(m=p),M>=m&&(p=m,m=M,g=C.getAnchorPoint()
.y),this.horizontalDirection===l.RIGHT_TO_LEFT&&(w=1-
C.anchorX),f=f+c*w*E+c*this.spacingX;var D=c*(1-w)*E;if(e){var B=f+D+c*(c>0?
this.paddingRight:this.paddingLeft),P=this.horizontalDirection===l.LEFT_TO_RIGHT&&B
>(1-a.x)*t,I=this.horizontalDirection===l.RIGHT_TO_LEFT&&B<-a.x*t;(P||I)&&(M>=m?
(0===p&&(p=m),d+=p,p=m):(d+=m,p=M,m=0),f=_+c*(u+w*E),v++)}var
R=i(C,d,v);t>=E+this.paddingLeft+this.paddingRight&&n&&C.setPosition(cc.v2(f,R));va
r O,L=1,F=0===m?M:m;this.verticalDirection===o.TOP_TO_BOTTOM?(y=y||
this.node._contentSize.height,(O=R+(L=-1)*(F*g+this.paddingBottom))<y&&(y=O)):
(y=y||-this.node._contentSize.height,
(O=R+L*(F*g+this.paddingTop))>y&&(y=O)),f+=D}}return
y},_getVerticalBaseHeight:function(t){var e=0,i=0;if(this.resizeMode===s.CONTAINER)
{for(var n=0;n<t.length;++n){var r=t[n];r.activeInHierarchy&&(i+
+,e+=r.height*this._getUsedScaleValue(r.scaleY))}e+=(i-
1)*this.spacingY+this.paddingBottom+this.paddingTop}else
e=this.node.getContentSize().height;return e},_doLayoutVertically:function(t,e,i,n)
{var a=this.node.getAnchorPoint(),h=this.node.children,c=1,u=this.paddingBottom,_=-
a.y*t;this.verticalDirection===o.TOP_TO_BOTTOM&&(c=-1,_=(1-
a.y)*t,u=this.paddingTop);for(var f=_+c*u-
c*this.spacingY,d=0,m=0,p=0,v=0,y=0,g=0,x=0,b=0;b<h.length;++b)
{(C=h[b]).activeInHierarchy&&x++}var A=this.cellSize.height;this.type!
==r.GRID&&this.resizeMode===s.CHILDREN&&(A=(t-(this.paddingTop+this.paddingBottom)-
(x-1)*this.spacingY)/x);for(b=0;b<h.length;++b){var
C=h[b],S=this._getUsedScaleValue(C.scaleX),T=this._getUsedScaleValue(C.scaleY);if(C
.activeInHierarchy)
{this.resizeMode===s.CHILDREN&&(C.height=A/T,this.type===r.GRID&&(C.width=this.cell
Size.width/S));var
w=C.anchorY,E=C.width*S,M=C.height*T;p>m&&(m=p),E>=m&&(p=m,m=E,g=C.getAnchorPoint()
.x),this.verticalDirection===o.TOP_TO_BOTTOM&&(w=1-
C.anchorY),f=f+c*w*M+c*this.spacingY;var D=c*(1-w)*M;if(e){var B=f+D+c*(c>0?
this.paddingTop:this.paddingBottom),P=this.verticalDirection===o.BOTTOM_TO_TOP&&B>(
1-a.y)*t,I=this.verticalDirection===o.TOP_TO_BOTTOM&&B<-a.y*t;(P||I)&&(E>=m?
(0===p&&(p=m),d+=p,p=m):(d+=m,p=E,m=0),f=_+c*(u+w*M),v++)}var R=i(C,d,v);t>=M+
(this.paddingTop+this.paddingBottom)&&n&&C.setPosition(cc.v2(R,f));var
O,L=1,F=0===m?E:m;this.horizontalDirection===l.RIGHT_TO_LEFT?(L=-1,y=y||
this.node._contentSize.width,(O=R+L*(F*g+this.paddingLeft))<y&&(y=O)):(y=y||-
this.node._contentSize.width,(O=R+L*(F*g+this.paddingRight))>y&&(y=O)),f+=D}}return
y},_doLayoutBasic:function(){for(var t=this.node.children,e=null,i=0;i<t.length;+
+i){var n=t[i];n.activeInHierarchy&&(e?
e.union(e,n.getBoundingBoxToWorld()):e=n.getBoundingBoxToWorld())}if(e){var
r=this.node.parent.convertToNodeSpaceAR(cc.v2(e.x,e.y));r=cc.v2(r.x-
this.paddingLeft,r.y-this.paddingBottom);var
s=this.node.parent.convertToNodeSpaceAR(cc.v2(e.x+e.width,e.y+e.height));s=cc.v2(s.
x+this.paddingRight,s.y+this.paddingTop);var a=cc.size(parseFloat((s.x-
r.x).toFixed(2)),parseFloat((s.y-r.y).toFixed(2))),o=this.node.getPosition();if(0!
==a.width){var l=(o.x-r.x)/a.width;this.node.anchorX=parseFloat(l.toFixed(2))}if(0!
==a.height){var h=(o.y-
r.y)/a.height;this.node.anchorY=parseFloat(h.toFixed(2))}this.node.setContentSize(a
)}},_doLayoutGridAxisHorizontal:function(t,e){var i=e.width,n=1,r=-
t.y*e.height,a=this.paddingBottom;this.verticalDirection===o.TOP_TO_BOTTOM&&(n=-
1,r=(1-t.y)*e.height,a=this.paddingTop);var l=function(t,e,i){return
r+n*(e+t.anchorY*t.height*this._getUsedScaleValue(t.scaleY)
+a+i*this.spacingY)}.bind(this),h=0;if(this.resizeMode===s.CONTAINER){var
c=this._doLayoutHorizontally(i,!0,l,!1);(h=r-c)<0&&(h*=-1),r=-
t.y*h,this.verticalDirection===o.TOP_TO_BOTTOM&&(n=-1,r=(1-
t.y)*h)}this._doLayoutHorizontally(i,!0,l,!
0),this.resizeMode===s.CONTAINER&&this.node.setContentSize(i,h)},_doLayoutGridAxisV
ertical:function(t,e){var i=e.height,n=1,r=-
t.x*e.width,a=this.paddingLeft;this.horizontalDirection===l.RIGHT_TO_LEFT&&(n=-
1,r=(1-t.x)*e.width,a=this.paddingRight);var o=function(t,e,i){return
r+n*(e+t.anchorX*t.width*this._getUsedScaleValue(t.scaleX)
+a+i*this.spacingX)}.bind(this),h=0;if(this.resizeMode===s.CONTAINER){var
c=this._doLayoutVertically(i,!0,o,!1);(h=r-c)<0&&(h*=-1),r=-
t.x*h,this.horizontalDirection===l.RIGHT_TO_LEFT&&(n=-1,r=(1-
t.x)*h)}this._doLayoutVertically(i,!0,o,!
0),this.resizeMode===s.CONTAINER&&this.node.setContentSize(h,i)},_doLayoutGrid:func
tion(){var
t=this.node.getAnchorPoint(),e=this.node.getContentSize();this.startAxis===a.HORIZO
NTAL?
this._doLayoutGridAxisHorizontal(t,e):this.startAxis===a.VERTICAL&&this._doLayoutGr
idAxisVertical(t,e)},_getHorizontalBaseWidth:function(t){var
e=0,i=0;if(this.resizeMode===s.CONTAINER){for(var n=0;n<t.length;++n){var
r=t[n];r.activeInHierarchy&&(i+
+,e+=r.width*this._getUsedScaleValue(r.scaleX))}e+=(i-
1)*this.spacingX+this.paddingLeft+this.paddingRight}else
e=this.node.getContentSize().width;return e},_doLayout:function()
{if(this.type===r.HORIZONTAL){var
t=this._getHorizontalBaseWidth(this.node.children);this._doLayoutHorizontally(t,!1,
(function(t){return t.y}),!0),this.node.width=t}else if(this.type===r.VERTICAL){var
e=this._getVerticalBaseHeight(this.node.children);this._doLayoutVertically(e,!1,
(function(t){return t.x}),!0),this.node.height=e}else this.type===r.NONE?
this.resizeMode===s.CONTAINER&&this._doLayoutBasic():this.type===r.GRID&&this._doLa
youtGrid()},_getUsedScaleValue:function(t){return this.affectedByScale?
Math.abs(t):1},updateLayout:function()
{this._layoutDirty&&this.node.children.length>0&&(this._doLayout(),this._layoutDirt
y=!1)}});Object.defineProperty(h.prototype,"padding",{get:function(){return
cc.warnID(4100),this.paddingLeft},set:function(t)
{this._N$padding=t,this._migratePaddingData(),this._doLayoutDirty()}}),cc.Layout=e.
exports=h}),{"../CCNode":52,"./CCComponent":95}],101:[(function(t,e,i){"use
strict";var n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../renderer/gfx")),r=t("../vmath");var
s=t("../utils/misc"),a=t("../assets/material/CCMaterial"),o=t("./CCRenderComponent"
),l=t("../renderer/render-
flow"),h=t("../graphics/graphics"),c=(t("../CCNode"),cc.v2()),u=r.mat4.create(),_=[
];function f(t,e,i){_.length=0;for(var n=2*Math.PI/i,r=0;r<i;+
+r)_.push(cc.v2(e.x*Math.cos(n*r)+t.x,e.y*Math.sin(n*r)+t.y));return _}var
d=cc.Enum({RECT:0,ELLIPSE:1,IMAGE_STENCIL:2}),m=cc.Class({name:"cc.Mask",extends:o,
editor:!1,ctor:function()
{this._graphics=null,this._enableMaterial=null,this._exitMaterial=null,this._clearM
aterial=null},properties:{_spriteFrame:
{default:null,type:cc.SpriteFrame},_type:d.RECT,type:{get:function(){return
this._type},set:function(t){this._type=t,this._type!
==d.IMAGE_STENCIL&&(this.spriteFrame=null,this.alphaThreshold=0,this._updateGraphic
s()),this._renderData&&(this.destroyRenderData(this._renderData),this._renderData=n
ull),this._activateMaterial()},type:d,tooltip:!1},spriteFrame:
{type:cc.SpriteFrame,tooltip:!1,get:function(){return
this._spriteFrame},set:function(t){var e=this._spriteFrame;e!
==t&&(this._spriteFrame=t,this._applySpriteFrame(e))}},alphaThreshold:
{default:0,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notif
y:function(){if(cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS){var
t=this.sharedMaterials[0];t&&t.setProperty("alphaThreshold",this.alphaThreshold)}el
se cc.warnID(4201)}},inverted:{default:!1,type:cc.Boolean,tooltip:!
1,notify:function(){cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS||
cc.warnID(4202)}},_segments:64,segements:{get:function(){return
this._segments},set:function(t)
{this._segments=s.clampf(t,3,1e4),this._updateGraphics()},type:cc.Integer,tooltip:!
1},_resizeToTarget:{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}}},statics:{Type:d},onLoad:function()
{this._createGraphics()},onRestore:function(){this._createGraphics(),this._type!
==d.IMAGE_STENCIL?
this._updateGraphics():this._applySpriteFrame()},onEnable:function()
{this._super(),this._type===d.IMAGE_STENCIL?
this._spriteFrame&&this._spriteFrame.textureLoaded()||(this.markForRender(!
1),this._spriteFrame&&(this.markForUpdateRenderData(!
1),this._spriteFrame.once("load",this._onTextureLoaded,this),this._spriteFrame.ensu
reLoadTexture())):this._updateGraphics(),this.node.on(cc.Node.EventType.POSITION_CH
ANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.ROTATION_CHANGED,th
is._updateGraphics,this),this.node.on(cc.Node.EventType.SCALE_CHANGED,this._updateG
raphics,this),this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this
),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this._updateGraphics,this),this.nod
e._renderFlag|=l.FLAG_POST_RENDER,this._activateMaterial()},onDisable:function()
{this._super(),this.node.off(cc.Node.EventType.POSITION_CHANGED,this._updateGraphic
s,this),this.node.off(cc.Node.EventType.ROTATION_CHANGED,this._updateGraphics,this)
,this.node.off(cc.Node.EventType.SCALE_CHANGED,this._updateGraphics,this),this.node
.off(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this),this.node.off(cc.Nod
e.EventType.ANCHOR_CHANGED,this._updateGraphics,this),this.node._renderFlag&=~l.FLA
G_POST_RENDER},onDestroy:function()
{this._super(),this._removeGraphics()},_resizeNodeToTargetNode:!
1,_onTextureLoaded:function(){this._renderData&&(this._renderData.uvDirty=!
0,this._renderData.vertDirty=!0,this.markForUpdateRenderData(!
0)),this.enabledInHierarchy&&this._activateMaterial()},_applySpriteFrame:function(t
){t&&t.off&&t.off("load",this._onTextureLoaded,this);var e=this._spriteFrame;e?
e.textureLoaded()?this._onTextureLoaded(null):
(e.once("load",this._onTextureLoaded,this),e.ensureLoadTexture()):this.disableRende
r()},_activateMaterial:function(){if(this._type!==d.IMAGE_STENCIL||
this.spriteFrame&&this.spriteFrame.textureLoaded()){if(cc.game.renderType!
==cc.game.RENDER_TYPE_CANVAS){var t=this.sharedMaterials[0];if(t||
(t=a.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_ALPHA_TEST",!
0),this._type===d.IMAGE_STENCIL){var
e=this.spriteFrame.getTexture();t.define("_USE_MODEL",!1),t.define("USE_TEXTURE",!
0),t.setProperty("texture",e),t.setProperty("alphaThreshold",this.alphaThreshold)}e
lse t.define("_USE_MODEL",!0),t.define("USE_TEXTURE",!1);if(this._enableMaterial||
(this._enableMaterial=a.getInstantiatedBuiltinMaterial("sprite",this)),!
this._exitMaterial)
{this._exitMaterial=a.getInstantiatedBuiltinMaterial("sprite",this);for(var
i=this._exitMaterial.effect.getDefaultTechnique().passes,r=0;r<i.length;r+
+)i[r].setStencilEnabled(n.default.STENCIL_DISABLE)}this._clearMaterial||
(this._clearMaterial=a.getInstantiatedBuiltinMaterial("clear-
stencil",this)),this.setMaterial(0,t)}this.markForRender(!0)}else
this.markForRender(!1)},_createGraphics:function(){this._graphics||
(this._graphics=new
h,this._graphics.node=this.node,this._graphics.lineWidth=0,this._graphics.strokeCol
or=cc.color(0,0,0,0))},_updateGraphics:function(){var
t=this.node,e=this._graphics;e.clear(!1);var
i=t._contentSize.width,n=t._contentSize.height,r=-i*t._anchorPoint.x,s=-
n*t._anchorPoint.y;if(this._type===d.RECT)e.rect(r,s,i,n);else
if(this._type===d.ELLIPSE){for(var a=f(cc.v2(r+i/2,s+n/2),
{x:i/2,y:n/2},this._segments),o=0;o<a.length;++o){var l=a[o];0===o?
e.moveTo(l.x,l.y):e.lineTo(l.x,l.y)}e.close()}cc.game.renderType===cc.game.RENDER_T
YPE_CANVAS?e.stroke():e.fill()},_removeGraphics:function()
{this._graphics&&(this._graphics.destroy(),this._graphics=null),this._clearGraphics
&&(this._clearGraphics.destroy(),this._clearGraphics=null)},_hitTest:function(t)
{var
e=this.node,i=e.getContentSize(),n=i.width,s=i.height,a=c;e._updateWorldMatrix(),r.
mat4.invert(u,e._worldMatrix),r.vec2.transformMat4(a,t,u),a.x+=e._anchorPoint.x*n,a
.y+=e._anchorPoint.y*s;var o=!1;if(this.type===d.RECT||
this.type===d.IMAGE_STENCIL)o=a.x>=0&&a.y>=0&&a.x<=n&&a.y<=s;else
if(this.type===d.ELLIPSE){var
l=n/2,h=s/2,_=a.x-.5*n,f=a.y-.5*s;o=_*_/(l*l)+f*f/(h*h)<1}return
this.inverted&&(o=!o),o},markForUpdateRenderData:function(t)
{t&&this.enabledInHierarchy?this.node._renderFlag|=l.FLAG_UPDATE_RENDER_DATA:t||
(this.node._renderFlag&=~l.FLAG_UPDATE_RENDER_DATA)},markForRender:function(t)
{t&&this.enabledInHierarchy?this.node._renderFlag|=l.FLAG_RENDER|
l.FLAG_UPDATE_RENDER_DATA|l.FLAG_POST_RENDER:t||
(this.node._renderFlag&=~(l.FLAG_RENDER|
l.FLAG_POST_RENDER))},disableRender:function()
{this.node._renderFlag&=~(l.FLAG_RENDER|l.FLAG_UPDATE_RENDER_DATA|
l.FLAG_POST_RENDER)}});cc.Mask=e.exports=m}),
{"../../renderer/gfx":348,"../CCNode":52,"../assets/material/CCMaterial":75,"../gra
phics/graphics":141,"../renderer/render-
flow":244,"../utils/misc":295,"../vmath":316,"./CCRenderComponent":106}],102:
[(function(t,e,i){"use strict";var
n=t("../components/CCRenderComponent"),r=t("../assets/material/CCMaterial"),s=t("..
/utils/texture-util"),a=t("../../core/utils/blend-
func"),o=cc.Class({name:"cc.MotionStreak",extends:n,mixins:[a],editor:!
1,ctor:function(){this._points=[]},properties:{preview:{default:!1,editorOnly:!
0,notify:!1,animatable:!1},_fadeTime:1,fadeTime:{get:function(){return
this._fadeTime},set:function(t){this._fadeTime=t,this.reset()},animatable:!
1,tooltip:!1},_minSeg:1,minSeg:{get:function(){return this._minSeg},set:function(t)
{this._minSeg=t},animatable:!1,tooltip:!1},_stroke:64,stroke:{get:function(){return
this._stroke},set:function(t){this._stroke=t},animatable:!1,tooltip:!1},_texture:
{default:null,type:cc.Texture2D},texture:{get:function(){return
this._texture},set:function(t){this._texture!==t&&(this._texture=t,t&&t.loaded?
this._activateMaterial():
(this.disableRender(),this._ensureLoadTexture()))},type:cc.Texture2D,animatable:!
1,tooltip:!1},_color:cc.Color.WHITE,color:{get:function(){return
this._color},set:function(t){this._color=t},type:cc.Color,tooltip:!1},_fastMode:!
1,fastMode:{get:function(){return this._fastMode},set:function(t)
{this._fastMode=t},animatable:!1,tooltip:!1}},onEnable:function()
{this._super(),this._texture&&this._texture.loaded?this._activateMaterial():
(this.disableRender(),this._ensureLoadTexture()),this.reset()},_ensureLoadTexture:f
unction(){if(this._texture&&!this._texture.loaded){var
t=this;s.postLoadTexture(this._texture,(function()
{t._activateMaterial()}))}},_activateMaterial:function()
{if(this._texture&&this._texture.loaded){var t=this.sharedMaterials[0];t?
t=r.getInstantiatedMaterial(t,this):
(t=r.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),t.setProperty("texture",this._texture),this.setMaterial(0,t),this.markForRender(
!0)}else this.disableRender()},onFocusInEditor:!1,onLostFocusInEditor:!
1,reset:function(){this._points.length=0;var
t=this._renderData;t&&(t.dataLength=0,t.vertexCount=0,t.indiceCount=0)}});cc.Motion
Streak=e.exports=o}),{"../../core/utils/blend-
func":288,"../assets/material/CCMaterial":75,"../components/CCRenderComponent":106,
"../utils/texture-util":302}],103:[(function(t,e,i){"use strict";var
n=cc.Enum({Unified:0,Free:1}),r=cc.Enum({Horizontal:0,Vertical:1}),s=cc.Enum({PAGE_
TURNING:0}),a=cc.Class({name:"cc.PageView",extends:cc.ScrollView,editor:!
1,ctor:function()
{this._curPageIdx=0,this._lastPageIdx=0,this._pages=[],this._scrollCenterOffsetX=[]
,this._scrollCenterOffsetY=[]},properties:{sizeMode:
{default:n.Unified,type:n,tooltip:!1,notify:function()
{this._syncSizeMode()}},direction:{default:r.Horizontal,type:r,tooltip:!
1,notify:function(){this._syncScrollDirection()}},scrollThreshold:
{default:.5,type:cc.Float,slide:!0,range:[0,1,.01],tooltip:!
1},autoPageTurningThreshold:{default:100,type:cc.Float,tooltip:!
1},pageTurningEventTiming:{default:.1,type:cc.Float,range:[0,1,.01],tooltip:!
1},indicator:{default:null,type:cc.PageViewIndicator,tooltip:!1,notify:function()
{this.indicator&&this.indicator.setPageView(this)}},pageTurningSpeed:
{default:.3,type:cc.Float,tooltip:!1},pageEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{SizeMode:n,Direction:r,EventType:s},__preload:function()
{this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this)},onEnab
le:function(){this._super(),this.node.on("scroll-ended-with-
threshold",this._dispatchPageTurningEvent,this)},onDisable:function()
{this._super(),this.node.off("scroll-ended-with-
threshold",this._dispatchPageTurningEvent,this)},onLoad:function()
{this._initPages(),this.indicator&&this.indicator.setPageView(this)},onDestroy:func
tion()
{this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this)},getCu
rrentPageIndex:function(){return this._curPageIdx},setCurrentPageIndex:function(t)
{this.scrollToPage(t,!0)},getPages:function(){return
this._pages},addPage:function(t){t&&-
1===this._pages.indexOf(t)&&this.content&&(this.content.addChild(t),this._pages.pus
h(t),this._updatePageView())},insertPage:function(t,e){e<0||!t||-1!
==this._pages.indexOf(t)||!this.content||(e>=this._pages.length?this.addPage(t):
(this._pages.splice(e,0,t),this.content.addChild(t),this._updatePageView()))},remov
ePage:function(t){if(t&&this.content){var e=this._pages.indexOf(t);-1!==e?
this.removePageAtIndex(e):cc.warnID(4300,t.name)}},removePageAtIndex:function(t)
{var e=this._pages;if(!(t<0||t>=e.length)){var
i=e[t];i&&(this.content.removeChild(i),e.splice(t,1),this._updatePageView())}},remo
veAllPages:function(){if(this.content){for(var
t=this._pages,e=0,i=t.length;e<i;e+
+)this.content.removeChild(t[e]);this._pages.length=0,this._updatePageView()}},scro
llToPage:function(t,e){t<0||t>=this._pages.length||(e=void 0!==e?
e:.3,this._curPageIdx=t,this.scrollToOffset(this._moveOffsetValue(t),e,!
0),this.indicator&&this.indicator._changedState())},getScrollEndedEventTiming:funct
ion(){return this.pageTurningEventTiming},_syncScrollDirection:function()
{this.horizontal=this.direction===r.Horizontal,this.vertical=this.direction===r.Ver
tical},_syncSizeMode:function(){if(this.content){var
t=this.content.getComponent(cc.Layout);if(t)
{if(0===this._pages.length)t.padding=0;else{var e=this._pages[this._pages.length-
1];this.sizeMode===n.Free&&(this.direction===r.Horizontal?
(t.paddingLeft=(this._view.width-
this._pages[0].width)/2,t.paddingRight=(this._view.width-
e.width)/2):this.direction===r.Vertical&&(t.paddingTop=(this._view.height-
this._pages[0].height)/2,t.paddingBottom=(this._view.height-
e.height)/2))}t.updateLayout()}}},_updatePageView:function(){var
t=this.content.getComponent(cc.Layout);t&&t.enabled&&t.updateLayout();var
e=this._pages.length;this._curPageIdx>=e&&(this._curPageIdx=0===e?0:e-
1,this._lastPageIdx=this._curPageIdx);for(var i=0;i<e;+
+i)this._pages[i].setSiblingIndex(i),this.direction===r.Horizontal?
this._scrollCenterOffsetX[i]=Math.abs(this.content.x+this._pages[i].x):this._scroll
CenterOffsetY[i]=Math.abs(this.content.y+this._pages[i].y);this.indicator&&this.ind
icator._refresh()},_updateAllPagesSize:function()
{if(this.sizeMode===n.Unified)for(var
t=this._pages,e=this._view.getContentSize(),i=0,r=t.length;i<r;i+
+)t[i].setContentSize(e)},_initPages:function(){if(this.content){for(var
t=this.content.children,e=0;e<t.length;++e){var i=t[e];this._pages.indexOf(i)>=0||
this._pages.push(i)}this._syncScrollDirection(),this._syncSizeMode(),this._updatePa
geView()}},_dispatchPageTurningEvent:function(){this._lastPageIdx!
==this._curPageIdx&&(this._lastPageIdx=this._curPageIdx,cc.Component.EventHandler.e
mitEvents(this.pageEvents,this,s.PAGE_TURNING),this.node.emit("page-
turning",this))},_isScrollable:function(t,e,i){if(this.sizeMode===n.Free){var
s,a;if(this.direction===r.Horizontal)return
s=this._scrollCenterOffsetX[e],a=this._scrollCenterOffsetX[i],Math.abs(t.x)>=Math.a
bs(s-a)*this.scrollThreshold;if(this.direction===r.Vertical)return
s=this._scrollCenterOffsetY[e],a=this._scrollCenterOffsetY[i],Math.abs(t.y)>=Math.a
bs(s-a)*this.scrollThreshold}else{if(this.direction===r.Horizontal)return
Math.abs(t.x)>=this._view.width*this.scrollThreshold;if(this.direction===r.Vertical
)return
Math.abs(t.y)>=this._view.height*this.scrollThreshold}},_isQuicklyScrollable:functi
on(t){if(this.direction===r.Horizontal)
{if(Math.abs(t.x)>this.autoPageTurningThreshold)return!0}else
if(this.direction===r.Vertical&&Math.abs(t.y)>this.autoPageTurningThreshold)return!
0;return!1},_moveOffsetValue:function(t){var e=cc.v2(0,0);return
this.sizeMode===n.Free?this.direction===r.Horizontal?
e.x=this._scrollCenterOffsetX[t]:this.direction===r.Vertical&&(e.y=this._scrollCent
erOffsetY[t]):this.direction===r.Horizontal?
e.x=t*this._view.width:this.direction===r.Vertical&&(e.y=t*this._view.height),e},_g
etDragDirection:function(t){return this.direction===r.Horizontal?0===t.x?0:t.x>0?
1:-1:this.direction===r.Vertical?0===t.y?0:t.y<0?1:-1:void
0},_handleReleaseLogic:function(t)
{this._autoScrollToPage(),this._scrolling&&(this._scrolling=!
1,this._autoScrolling||this._dispatchEvent("scroll-
ended"))},_autoScrollToPage:function(){var
t=this._startBounceBackIfNeeded(),e=this._touchBeganPosition.sub(this._touchEndPosi
tion);if(t){var i=this._getDragDirection(e);if(0===i)return;this._curPageIdx=i>0?
this._pages.length-1:0,this.indicator&&this.indicator._changedState()}else{var
n=this._curPageIdx,r=n+this._getDragDirection(e),s=this.pageTurningSpeed*Math.abs(n
-r);if(r<this._pages.length){if(this._isScrollable(e,n,r))return void
this.scrollToPage(r,s);var
a=this._calculateTouchMoveVelocity();if(this._isQuicklyScrollable(a))return void
this.scrollToPage(r,s)}this.scrollToPage(n,s)}},_onTouchBegan:function(t,e)
{this._touchBeganPosition=t.touch.getLocation(),this._super(t,e)},_onTouchMoved:fun
ction(t,e){this._super(t,e)},_onTouchEnded:function(t,e)
{this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onTouchCancelled:f
unction(t,e)
{this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onMouseWheel:funct
ion(){}});cc.PageView=e.exports=a}),{}],104:[(function(t,e,i){"use strict";var
n=cc.Enum({HORIZONTAL:0,VERTICAL:1}),r=cc.Class({name:"cc.PageViewIndicator",extend
s:t("./CCComponent"),editor:!1,properties:{_layout:null,_pageView:null,_indicators:
[],spriteFrame:{default:null,type:cc.SpriteFrame,tooltip:!1},direction:
{default:n.HORIZONTAL,type:n,tooltip:!1},cellSize:{default:cc.size(20,20),tooltip:!
1},spacing:{default:0,tooltip:!1}},statics:{Direction:n},onLoad:function()
{this._updateLayout()},setPageView:function(t)
{this._pageView=t,this._refresh()},_updateLayout:function()
{this._layout=this.getComponent(cc.Layout),this._layout||
(this._layout=this.addComponent(cc.Layout)),this.direction===n.HORIZONTAL?
(this._layout.type=cc.Layout.Type.HORIZONTAL,this._layout.spacingX=this.spacing):th
is.direction===n.VERTICAL&&(this._layout.type=cc.Layout.Type.VERTICAL,this._layout.
spacingY=this.spacing),this._layout.resizeMode=cc.Layout.ResizeMode.CONTAINER},_cre
ateIndicator:function(){var t=new cc.Node;return
t.addComponent(cc.Sprite).spriteFrame=this.spriteFrame,t.parent=this.node,t.width=t
his.cellSize.width,t.height=this.cellSize.height,t},_changedState:function(){var
t=this._indicators;if(0!==t.length){var e=this._pageView._curPageIdx;if(!
(e>=t.length)){for(var i=0;i<t.length;++i)
{t[i].opacity=127.5}t[e].opacity=255}}},_refresh:function(){if(this._pageView){var
t=this._indicators,e=this._pageView.getPages();if(e.length!==t.length){var
i=0;if(e.length>t.length)for(i=0;i<e.length;++i)t[i]||
(t[i]=this._createIndicator());else for(i=t.length-e.length;i>0;--i){var n=t[i-
1];this.node.removeChild(n),t.splice(i-
1,1)}this._layout&&this._layout.enabledInHierarchy&&this._layout.updateLayout(),thi
s._changedState()}}}});cc.PageViewIndicator=e.exports=r}),
{"./CCComponent":95}],105:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=cc.Enum({HORIZONTAL:0,VERTICAL:1,FILLED
:2}),a=cc.Class({name:"cc.ProgressBar",extends:r,editor:!
1,_initBarSprite:function(){if(this.barSprite){var t=this.barSprite.node;if(!
t)return;var
e=this.node.getContentSize(),i=this.node.getAnchorPoint(),n=t.getContentSize();t.pa
rent===this.node&&this.node.setContentSize(n),this.barSprite.fillType===cc.Sprite.F
illType.RADIAL&&(this.mode=s.FILLED);var
r=t.getContentSize();if(this.mode===s.HORIZONTAL?
this.totalLength=r.width:this.mode===s.VERTICAL?
this.totalLength=r.height:this.totalLength=this.barSprite.fillRange,t.parent===this
.node){var a=-e.width*i.x;t.setPosition(cc.v2(a,0))}}},_updateBarStatus:function()
{if(this.barSprite){var t=this.barSprite.node;if(!t)return;var
e,i,r,a=t.getAnchorPoint(),o=t.getContentSize(),l=t.getPosition(),h=cc.v2(0,.5),c=n
.clamp01(this.progress),u=this.totalLength*c;switch(this.mode){case
s.HORIZONTAL:this.reverse&&(h=cc.v2(1,.5)),e=cc.size(u,o.height),i=this.totalLength
,r=o.height;break;case s.VERTICAL:h=this.reverse?
cc.v2(.5,1):cc.v2(.5,0),e=cc.size(o.width,u),i=o.width,r=this.totalLength}if(this.m
ode===s.FILLED)this.barSprite.type!==cc.Sprite.Type.FILLED?cc.warn("ProgressBar
FILLED mode only works when barSprite's Type is FILLED!"):(this.reverse&&(u*=-
1),this.barSprite.fillRange=u);else if(this.barSprite.type!==cc.Sprite.Type.FILLED)
{var _=h.x-a.x,f=h.y-
a.y,d=cc.v2(i*_,r*f);t.setPosition(l.x+d.x,l.y+d.y),t.setAnchorPoint(h),t.setConten
tSize(e)}else cc.warn("ProgressBar non-FILLED mode only works when barSprite's Type
is non-FILLED!")}},properties:{barSprite:{default:null,type:cc.Sprite,tooltip:!
1,notify:function(){this._initBarSprite()},animatable:!1},mode:
{default:s.HORIZONTAL,type:s,tooltip:!1,notify:function(){if(this.barSprite){var
t=this.barSprite.node;if(!t)return;var
e=t.getContentSize();this.mode===s.HORIZONTAL?
this.totalLength=e.width:this.mode===s.VERTICAL?
this.totalLength=e.height:this.mode===s.FILLED&&(this.totalLength=this.barSprite.fi
llRange)}},animatable:!1},_N$totalLength:1,totalLength:{range:
[0,Number.MAX_VALUE],tooltip:!1,get:function(){return
this._N$totalLength},set:function(t)
{this.mode===s.FILLED&&(t=n.clamp01(t)),this._N$totalLength=t,this._updateBarStatus
()}},progress:{default:1,type:"Float",range:[0,1,.1],slide:!0,tooltip:!
1,notify:function(){this._updateBarStatus()}},reverse:{default:!1,tooltip:!
1,notify:function(){this.barSprite&&(this.barSprite.fillStart=1-
this.barSprite.fillStart),this._updateBarStatus()},animatable:!1}},statics:
{Mode:s}});cc.ProgressBar=e.exports=a}),
{"../utils/misc":295,"./CCComponent":95}],106:[(function(t,e,i){"use
strict";r(t("../../renderer/gfx"));var n=r(t("../../renderer/render-data/render-
data"));function r(t){return t&&t.__esModule?t:{default:t}}var
s=t("./CCComponent"),a=t("../renderer/render-
flow"),o=(t("../platform/CCMacro").BlendFactor,t("../assets/material/CCMaterial")),
l=cc.Class({name:"RenderComponent",extends:s,editor:!1,properties:{_materials:
{default:[],type:o},sharedMaterials:{get:function(){return
this._materials},set:function(t){this._materials=t,this._activateMaterial(!
0)},type:[o],displayName:"Materials"}},ctor:function()
{this._renderData=null,this.__allocedDatas=[],this._vertexFormat=null,this._toPostH
andle=!
1,this._assembler=this.constructor._assembler,this._postAssembler=this.constructor.
_postAssembler},onEnable:function()
{this.node._renderComponent&&(this.node._renderComponent.enabled=!
1),this.node._renderComponent=this,this.node._renderFlag|=a.FLAG_RENDER|
a.FLAG_UPDATE_RENDER_DATA},onDisable:function()
{this.node._renderComponent=null,this.disableRender()},onDestroy:function(){for(var
t=0,e=this.__allocedDatas.length;t<e;t+
+)n.default.free(this.__allocedDatas[t]);this.__allocedDatas.length=0,this._materia
ls.length=0,this._ren
derData=null;var i=this._uniforms;for(var r in
i)_uniformPool.remove(_uniformPool._data.indexOf(i[r]));this._uniforms=null,this._d
efines=null},_canRender:function(){return
this._enabled&&this.node._activeInHierarchy},markForUpdateRenderData:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_UPDATE_RENDER_DATA:t||
(this.node._renderFlag&=~a.FLAG_UPDATE_RENDER_DATA)},markForRender:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_RENDER:t||
(this.node._renderFlag&=~a.FLAG_RENDER)},markForCustomIARender:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_CUSTOM_IA_RENDER:t||
(this.node._renderFlag&=~a.FLAG_CUSTOM_IA_RENDER)},disableRender:function()
{this.node._renderFlag&=~(a.FLAG_RENDER|a.FLAG_CUSTOM_IA_RENDER|
a.FLAG_UPDATE_RENDER_DATA)},requestRenderData:function(){var
t=n.default.alloc();return
this.__allocedDatas.push(t),t},destroyRenderData:function(t){var
e=this.__allocedDatas.indexOf(t);-1!
==e&&(this.__allocedDatas.splice(e,1),n.default.free(t))},getMaterial:function(t)
{if(t<0||t>=this._materials.length)return null;var e=this._materials[t];if(!
e)return null;var i=o.getInstantiatedMaterial(e,this);return i!
==e&&this.setMaterial(t,i),this._materials[t]},setMaterial:function(t,e)
{this._materials[t]=e,e&&this.markForUpdateRenderData(!
0)},_activateMaterial:function(t)
{}});l._assembler=null,l._postAssembler=null,cc.RenderComponent=e.exports=l}),
{"../../renderer/gfx":348,"../../renderer/render-data/render-
data":368,"../assets/material/CCMaterial":75,"../platform/CCMacro":205,"../renderer
/render-flow":244,"./CCComponent":95}],107:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/CCMacro"),s=t("../utils/text-
utils"),a=new(t("../utils/html-text-
parser")),o=r.TextAlignment,l=r.VerticalTextAlignment;var h=new n.Pool(function(t)
{return!!cc.isValid(t)&&!t.getComponent(cc.LabelOutline)},20);h.get=function(t,e)
{var i=this._get();i||(i=new cc.PrivateNode("RICHTEXT_CHILD"));var
n=i.getComponent(cc.Label);return n||
(n=i.addComponent(cc.Label)),i.setPosition(0,0),i.setAnchorPoint(.5,.5),i.setConten
tSize(128,128),i.skewX=0,"string"!=typeof t&&(t=""+t),e.font instanceof cc.Font?
n.font=e.font:n.fontFamily=e.fontFamily,n.string=t,n.horizontalAlign=o.LEFT,n.verti
calAlign=l.TOP,n.fontSize=e.fontSize||40,n.overflow=0,n.enableWrapText=!
0,n.lineHeight=40,n._enableBold(!1),n._enableItalics(!1),n._enableUnderline(!
1),i};var c=cc.Class({name:"cc.RichText",extends:cc.Component,ctor:function()
{this._textArray=null,this._labelSegments=[],this._labelSegmentsCache=[],this._line
sWidth=[],this._updateRichTextStatus=this._updateRichText},editor:!1,properties:
{string:{default:"<color=#00ff00>Rich</c><color=#0fffff>Text</color>",multiline:!
0,tooltip:!1,notify:function(){this._updateRichTextStatus()}},horizontalAlign:
{default:o.LEFT,type:o,tooltip:!1,animatable:!1,notify:function(t)
{this.horizontalAlign!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},fontSize:{default:40,tooltip:!
1,notify:function(t){this.fontSize!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},_fontFamily:"Arial",fontFamily:{tooltip:!
1,get:function(){return this._fontFamily},set:function(t){this._fontFamily!
==t&&(this._fontFamily=t,this._layoutDirty=!
0,this._updateRichTextStatus())},animatable:!1},font:
{default:null,type:cc.TTFFont,tooltip:!1,notify:function(t){this.font!
==t&&(this._layoutDirty=!0,this.font?(this.useSystemFont=!
1,this._onTTFLoaded()):this.useSystemFont=!
0,this._updateRichTextStatus())}},_isSystemFontUsed:!0,useSystemFont:
{get:function(){return this._isSystemFontUsed},set:function(t){(t||
this.font)&&this._isSystemFontUsed!
==t&&(this._isSystemFontUsed=t,this._layoutDirty=!
0,this._updateRichTextStatus())},animatable:!1,tooltip:!1},maxWidth:
{default:0,tooltip:!1,notify:function(t){this.maxWidth!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},lineHeight:{default:40,tooltip:!
1,notify:function(t){this.lineHeight!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},imageAtlas:
{default:null,type:cc.SpriteAtlas,tooltip:!1,notify:function(t){this.imageAtlas!
==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},handleTouchEvent:
{default:!0,tooltip:!1,notify:function(t){this.handleTouchEvent!
==t&&this.enabledInHierarchy&&(this.handleTouchEvent?
this._addEventListeners():this._removeEventListeners())}}},statics:
{HorizontalAlign:o,VerticalAlign:l},onEnable:function()
{this.handleTouchEvent&&this._addEventListeners(),this._updateRichText(),this._acti
vateChildren(!0)},onDisable:function()
{this.handleTouchEvent&&this._removeEventListeners(),this._activateChildren(!
1)},start:function(){this._onTTFLoaded()},_onColorChanged:function(t)
{this.node.children.forEach((function(e)
{e.color=t}))},_addEventListeners:function()
{this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.
Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_removeEventListeners:func
tion()
{this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(c
c.Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_updateLabelSegmentTextA
ttributes:function(){this._labelSegments.forEach(function(t)
{this._applyTextAttribute(t)}.bind(this))},_createFontLabel:function(t){return
h.get(t,this)},_onTTFLoaded:function(){if(this.font instanceof
cc.TTFFont)if(this.font._nativeAsset)this._layoutDirty=!
0,this._updateRichText();else{var t=this;cc.loader.load(this.font.nativeUrl,
(function(e,i){t._layoutDirty=!0,t._updateRichText()}))}else this._layoutDirty=!
0,this._updateRichText()},_measureText:function(t,e){var i=this,n=function(e){var
n=void 0;return 0===i._labelSegmentsCache.length?
(n=i._createFontLabel(e),i._labelSegmentsCache.push(n)):
(n=i._labelSegmentsCache[0]).getComponent(cc.Label).string=e,n._styleIndex=t,i._app
lyTextAttribute(n),n.getContentSize().width};return e?
n(e):n},_onTouchEnded:function(t){for(var
e=this,i=this.node.getComponents(cc.Component),n=function(n){var
r=e._labelSegments[n],s=r._clickHandler,a=r._clickParam;s&&e._containsTouchLocation
(r,t.touch.getLocation())&&(i.forEach((function(e){e.enabledInHierarchy&&e[s]&&e[s]
(t,a)})),t.stopPropagation())},r=0;r<this._labelSegments.length;+
+r)n(r)},_containsTouchLocation:function(t,e){return
t.getBoundingBoxToWorld().contains(e)},_resetState:function(){for(var
t=this.node.children,e=t.length-1;e>=0;e--){var i=t[e];"RICHTEXT_CHILD"!
==i.name&&"RICHTEXT_Image_CHILD"!==i.name||(i.parent===this.node?
i.parent=null:t.splice(e,1),"RICHTEXT_CHILD"===i.name&&h.put(i))}this._labelSegment
s.length=0,this._labelSegmentsCache.length=0,this._linesWidth.length=0,this._lineOf
fsetX=0,this._lineCount=1,this._labelWidth=0,this._labelHeight=0,this._layoutDirty=
!0},onRestore:!1,_activateChildren:function(t){for(var e=this.node.children.length-
1;e>=0;e--){var i=this.node.children[e];"RICHTEXT_CHILD"!
==i.name&&"RICHTEXT_Image_CHILD"!==i.name||
(i.active=t)}},_addLabelSegment:function(t,e){var i=void 0;return
0===this._labelSegmentsCache.length?i=this._createFontLabel(t):
(i=this._labelSegmentsCache.pop()).getComponent(cc.Label).string=t,i._styleIndex=e,
i._lineCount=this._lineCount,i.active=this.node.active,i.setAnchorPoint(0,0),this._
applyTextAttribute(i),this.node.addChild(i),this._labelSegments.push(i),i},_updateR
ichTextWithMaxWidth:function(t,e,i){var
n=e;if(this._lineOffsetX>0&&n+this._lineOffsetX>this.maxWidth)for(var
r=0;this._lineOffsetX<=this.maxWidth;){var
a=this._getFirstWordLen(t,r,t.length),o=t.substr(r,a),l=this._measureText(i,o);if(!
(this._lineOffsetX+l<=this.maxWidth)){if(r>0){var
h=t.substr(0,r);this._addLabelSegment(h,i),t=t.substr(r,t.length),n=this._measureTe
xt(i,t)}this._updateLineInfo();break}this._lineOffsetX+=l,r+=a}if(n>this.maxWidth)f
or(var c=s.fragmentText(t,n,this.maxWidth,this._measureText(i)),u=0;u<c.length;++u)
{var
_=c[u],f=this._addLabelSegment(_,i).getContentSize();this._lineOffsetX+=f.width,c.l
ength>1&&u<c.length-1&&this._updateLineInfo()}else
this._lineOffsetX+=n,this._addLabelSegment(t,i)},_isLastComponentCR:function(t)
{return t.length-1===t.lastIndexOf("\n")},_updateLineInfo:function()
{this._linesWidth.push(this._lineOffsetX),this._lineOffsetX=0,this._lineCount+
+},_needsUpdateTextLayout:function(t){if(this._layoutDirty||!this._textArray||!
t)return!0;if(this._textArray.length!==t.length)return!0;for(var
e=0;e<this._textArray.length;++e){var i=this._textArray[e],n=t[e];if(i.text!
==n.text)return!0;if(i.style){if(n.style){if(!!n.style.outline!=!!
i.style.outline)return!0;if(i.style.size!==n.style.size||i.style.italic!
==n.style.italic||i.style.isImage!==n.style.isImage)return!
0;if(i.style.isImage===n.style.isImage&&i.style.src!==n.style.src)return!0}else
if(i.style.size||i.style.italic||i.style.isImage||i.style.outline)return!0}else
if(n.style&&(n.style.size||n.style.italic||n.style.isImage||
n.style.outline))return!0}return!1},_addRichTextImageElement:function(t){var
e=t.style.src,i=this.imageAtlas.getSpriteFrame(e);if(i){var n=new
cc.PrivateNode("RICHTEXT_Image_CHILD"),r=n.addComponent(cc.Sprite);n.setAnchorPoint
(0,0),r.type=cc.Sprite.Type.SLICED,r.sizeMode=cc.Sprite.SizeMode.CUSTOM,this.node.a
ddChild(n),this._labelSegments.push(n);var
s=i.getRect(),a=1,o=s.width,l=s.height,h=t.style.imageWidth,c=t.style.imageHeight;c
>0&&c<this.lineHeight?(o*=a=c/l,l*=a):
(o*=a=this.lineHeight/l,l*=a),h>0&&(o=h),this.maxWidth>0?
(this._lineOffsetX+o>this.maxWidth&&this._updateLineInfo(),this._lineOffsetX+=o):
(this._lineOffsetX+=o,this._lineOffsetX>this._labelWidth&&(this._labelWidth=this._l
ineOffsetX)),r.spriteFrame=i,n.setContentSize(o,l),n._lineCount=this._lineCount,t.s
tyle.event?
(t.style.event.click&&(n._clickHandler=t.style.event.click),t.style.event.param?
n._clickParam=t.style.event.param:n._clickParam=""):n._clickHandler=null}else
cc.warnID(4400)},_updateRichText:function(){if(this.enabled){var
t=a.parse(this.string);if(!this._needsUpdateTextLayout(t))return
this._textArray=t,void
this._updateLabelSegmentTextAttributes();this._textArray=t,this._resetState();for(v
ar
e=!1,i=void 0,n=0;n<this._textArray.length;++n){var
r=this._textArray[n],o=r.text;if(""===o){if(r.style&&r.style.newline)
{this._updateLineInfo();continue}if(r.style&&r.style.isImage&&this.imageAtlas)
{this._addRichTextImageElement(r);continue}}for(var l=o.split("\n"),h=0;h<l.length;
++h){var c=l[h];if(""!==c)if(e=!1,this.maxWidth>0){var
u=this._measureText(n,c);this._updateRichTextWithMaxWidth(c,u,n),l.length>1&&h<l.le
ngth-1&&this._updateLineInfo()}else
i=this._addLabelSegment(c,n).getContentSize(),this._lineOffsetX+=i.width,this._line
OffsetX>this._labelWidth&&(this._labelWidth=this._lineOffsetX),l.length>1&&h<l.leng
th-1&&this._updateLineInfo();else{if(this._isLastComponentCR(o)&&h===l.length-
1)continue;this._updateLineInfo(),e=!0}}}e||
this._linesWidth.push(this._lineOffsetX),this.maxWidth>0&&(this._labelWidth=this.ma
xWidth),this._labelHeight=(this._lineCount+s.BASELINE_RATIO)*this.lineHeight,this.n
ode.setContentSize(this._labelWidth,this._labelHeight),this._updateRichTextPosition
(),this._layoutDirty=!1}},_getFirstWordLen:function(t,e,i){var
n=t.charAt(e);if(s.isUnicodeCJK(n)||s.isUnicodeSpace(n))return 1;for(var
r=1,a=e+1;a<i&&(n=t.charAt(a),!s.isUnicodeSpace(n)&&!s.isUnicodeCJK(n));++a)r+
+;return r},_updateRichTextPosition:function(){for(var
t=0,e=1,i=this._lineCount,n=0;n<this._labelSegments.length;++n){var
r=this._labelSegments[n],s=r._lineCount;s>e&&(t=0,e=s);var
a=0;switch(this.horizontalAlign){case o.LEFT:a=-this._labelWidth/2;break;case
o.CENTER:a=-this._linesWidth[s-1]/2;break;case o.RIGHT:a=this._labelWidth/2-
this._linesWidth[s-1]}r.x=t+a;var l=r.getContentSize();r.y=this.lineHeight*(i-s)-
this._labelHeight/2,s===e&&(t+=l.width)}},_convertLiteralColorValue:function(t){var
e=t.toUpperCase();return cc.Color[e]?
cc.Color[e]:cc.color().fromHEX(t)},_applyTextAttribute:function(t){var
e=t.getComponent(cc.Label);if(e){var
i=t._styleIndex;this._isSystemFontUsed&&(e.fontFamily=this._fontFamily),e.useSystem
Font=this._isSystemFontUsed,e.lineHeight=this.lineHeight,e.horizontalAlign=o.LEFT,e
.verticalAlign=l.CENTER;var
n=null;if(this._textArray[i]&&(n=this._textArray[i].style),n&&n.color?
t.color=this._convertLiteralColorValue(n.color):t.color=this.node.color,e._enableBo
ld(n&&n.bold),e._enableItalics(n&&n.italic),n&&n.italic&&(t.skewX=12),e._enableUnde
rline(n&&n.underline),n&&n.outline){var r=t.getComponent(cc.LabelOutline);r||
(r=t.addComponent(cc.LabelOutline)),r.color=this._convertLiteralColorValue(n.outlin
e.color),r.width=n.outline.width}n&&n.size?
e.fontSize=n.size:e.fontSize=this.fontSize,e._updateRenderData(!0),n&&n.event?
(n.event.click&&(t._clickHandler=n.event.click),n.event.param?
t._clickParam=n.event.param:t._clickParam=""):t._clickHandler=null}},onDestroy:func
tion(){for(var t=0;t<this._labelSegments.length;+
+t)this._labelSegments[t].removeFromParent(),h.put(this._labelSegments[t])}});cc.Ri
chText=e.exports=c}),
{"../platform/CCMacro":205,"../platform/js":220,"../utils/html-text-
parser":292,"../utils/text-utils":301}],108:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=(t("./CCComponent"),cc.Enum({HORIZONTAL:0,VERTICAL:1})),s=cc
.Class({name:"cc.Scrollbar",extends:t("./CCComponent"),editor:!1,properties:
{_scrollView:null,_touching:!1,_autoHideRemainingTime:{default:0,serializable:!
1},_opacity:255,handle:{default:null,type:cc.Sprite,tooltip:!1,notify:function()
{this._onScroll(cc.v2(0,0))},animatable:!1},direction:
{default:r.HORIZONTAL,type:r,tooltip:!1,notify:function()
{this._onScroll(cc.v2(0,0))},animatable:!1},enableAutoHide:{default:!0,animatable:!
1,tooltip:!1},autoHideTime:{default:1,animatable:!1,tooltip:!1}},statics:
{Direction:r},setTargetScrollView:function(t)
{this._scrollView=t},_convertToScrollViewSpace:function(t){var
e=t.convertToWorldSpace(cc.v2(0,0));return
this._scrollView.node.convertToNodeSpace(e)},_setOpacity:function(t)
{this.handle&&(this.node.opacity=t,this.handle.node.opacity=t)},_onScroll:function(
t){if(this._scrollView){var e=this._scrollView.content;if(e){var
i=e.getContentSize(),n=this._scrollView.node.getContentSize(),s=this.node.getConten
tSize();if(this._conditionalDisableScrollBar(i,n))return;this.enableAutoHide&&(this
._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity));var
a=0,o=0,l=0,h=0,c=0;this.direction===r.HORIZONTAL?
(a=i.width,o=n.width,c=s.width,l=t.x,h=-
this._convertToScrollViewSpace(e).x):this.direction===r.VERTICAL&&(a=i.height,o=n.h
eight,c=s.height,l=t.y,h=-this._convertToScrollViewSpace(e).y);var
u=this._calculateLength(a,o,c,l),_=this._calculatePosition(a,o,c,h,l,u);this._updat
eLength(u),this._updateHanlderPosition(_)}}},_updateHanlderPosition:function(t)
{if(this.handle){var
e=this._fixupHandlerPosition();this.handle.node.setPosition(t.x+e.x,t.y+e.y)}},_fix
upHandlerPosition:function(){var
t=this.node.getContentSize(),e=this.node.getAnchorPoint(),i=this.handle.node.getCon
tentSize(),n=this.handle.node.parent,s=this.node.convertToWorldSpaceAR(cc.v2(-
t.width*e.x,-t.height*e.y)),a=n.convertToNodeSpaceAR(s);return
this.direction===r.HORIZONTAL?a=cc.v2(a.x,a.y+(t.height-
i.height)/2):this.direction===r.VERTICAL&&(a=cc.v2(a.x+(t.width-
i.width)/2,a.y)),this.handle.node.setPosition(a),a},_onTouchBegan:function()
{this.enableAutoHide&&(this._touching=!
0)},_conditionalDisableScrollBar:function(t,e){return
t.width<=e.width&&this.direction===r.HORIZONTAL||
t.height<=e.height&&this.direction===r.VERTICAL},_onTouchEnded:function()
{if(this.enableAutoHide&&(this._touching=!1,!(this.autoHideTime<=0)))
{if(this._scrollView){var t=this._scrollView.content;if(t){var
e=t.getContentSize(),i=this._scrollView.node.getContentSize();if(this._conditionalD
isableScrollBar(e,i))return}}this._autoHideRemainingTime=this.autoHideTime}},_calcu
lateLength:function(t,e,i,n){var r=t;return n&&(r+=20*(n>0?n:-
n)),i*(e/r)},_calculatePosition:function(t,e,i,s,a,o){var l=t-
e;a&&(l+=Math.abs(a));var h=0;l&&(h=s/l,h=n.clamp01(h));var c=(i-o)*h;return
this.direction===r.VERTICAL?cc.v2(0,c):cc.v2(c,0)},_updateLength:function(t)
{if(this.handle){var
e=this.handle.node,i=e.getContentSize();e.setAnchorPoint(cc.v2(0,0)),this.direction
===r.HORIZONTAL?
e.setContentSize(t,i.height):e.setContentSize(i.width,t)}},_processAutoHide:functio
n(t){if(this.enableAutoHide&&!(this._autoHideRemainingTime<=0)&&!
this._touching&&(this._autoHideRemainingTime-
=t,this._autoHideRemainingTime<=this.autoHideTime))
{this._autoHideRemainingTime=Math.max(0,this._autoHideRemainingTime);var
e=this._opacity*(this._autoHideRemainingTime/this.autoHideTime);this._setOpacity(e)
}},start:function(){this.enableAutoHide&&this._setOpacity(0)},hide:function()
{this._autoHideRemainingTime=0,this._setOpacity(0)},show:function()
{this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity)},upd
ate:function(t){this._processAutoHide(t)}});cc.Scrollbar=e.exports=s}),
{"../utils/misc":295,"./CCComponent":95}],109:[(function(t,e,i){"use strict";var
n=t("../CCNode").EventType,r=function(t){return(t-=1)*t*t*t*t+1},s=function()
{return(new
Date).getMilliseconds()},a=cc.Enum({SCROLL_TO_TOP:0,SCROLL_TO_BOTTOM:1,SCROLL_TO_LE
FT:2,SCROLL_TO_RIGHT:3,SCROLLING:4,BOUNCE_TOP:5,BOUNCE_BOTTOM:6,BOUNCE_LEFT:7,BOUNC
E_RIGHT:8,SCROLL_ENDED:9,TOUCH_UP:10,AUTOSCROLL_ENDED_WITH_THRESHOLD:11,SCROLL_BEGA
N:12}),o={"scroll-to-top":a.SCROLL_TO_TOP,"scroll-to-
bottom":a.SCROLL_TO_BOTTOM,"scroll-to-left":a.SCROLL_TO_LEFT,"scroll-to-
right":a.SCROLL_TO_RIGHT,scrolling:a.SCROLLING,"bounce-
bottom":a.BOUNCE_BOTTOM,"bounce-left":a.BOUNCE_LEFT,"bounce-
right":a.BOUNCE_RIGHT,"bounce-top":a.BOUNCE_TOP,"scroll-
ended":a.SCROLL_ENDED,"touch-up":a.TOUCH_UP,"scroll-ended-with-
threshold":a.AUTOSCROLL_ENDED_WITH_THRESHOLD,"scroll-
began":a.SCROLL_BEGAN},l=cc.Class({name:"cc.ScrollView",extends:t("./CCViewGroup"),
editor:!1,ctor:function()
{this._topBoundary=0,this._bottomBoundary=0,this._leftBoundary=0,this._rightBoundar
y=0,this._touchMoveDisplacements=[],this._touchMoveTimeDeltas=[],this._touchMovePre
viousTimestamp=0,this._touchMoved=!1,this._autoScrolling=!
1,this._autoScrollAttenuate=!
1,this._autoScrollStartPosition=cc.v2(0,0),this._autoScrollTargetDelta=cc.v2(0,0),t
his._autoScrollTotalTime=0,this._autoScrollAccumulatedTime=0,this._autoScrollCurren
tlyOutOfBoundary=!1,this._autoScrollBraking=!
1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._outOfBoundaryAmount=cc.v2(0
,0),this._outOfBoundaryAmountDirty=!0,this._stopMouseWheel=!
1,this._mouseWheelEventElapsedTime=0,this._isScrollEndedWithThresholdEventFired=!
1,this._scrollEventEmitMask=0,this._isBouncing=!1,this._scrolling=!1},properties:
{content:{default:void 0,type:cc.Node,tooltip:!
1,formerlySerializedAs:"content",notify:function(t)
{this._calculateBoundary()}},horizontal:{default:!0,animatable:!1,tooltip:!
1},vertical:{default:!0,animatable:!1,tooltip:!1},inertia:{default:!0,tooltip:!
1},brake:{default:.5,type:"Float",range:[0,1,.1],tooltip:!1},elastic:{default:!
0,animatable:!1,tooltip:!1},bounceDuration:{default:1,range:[0,10],tooltip:!
1},horizontalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!
1,notify:function()
{this.horizontalScrollBar&&(this.horizontalScrollBar.setTargetScrollView(this),this
._updateScrollBar(0))},animatable:!1},verticalScrollBar:{default:void
0,type:cc.Scrollbar,tooltip:!1,notify:function()
{this.verticalScrollBar&&(this.verticalScrollBar.setTargetScrollView(this),this._up
dateScrollBar(0))},animatable:!1},scrollEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1},cancelInnerEvents:{default:!
0,animatable:!1,tooltip:!1},_view:{get:function(){if(this.content)return
this.content.parent}}},statics:{EventType:a},scrollToBottom:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i,!
0)},scrollToTop:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!
1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!
0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToTopLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToTopRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,1),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToBottomLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToBottomRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToOffset:function(t,e,i){var
n=this.getMaxScrollOffset(),r=cc.v2(0,0);0===n.x?r.x=0:r.x=t.x/n.x,0===n.y?
r.y=1:r.y=(n.y-t.y)/n.y,this.scrollTo(r,e,i)},getScrollOffset:function(){var
t=this._getContentTopBoundary()-this._topBoundary,e=this._getContentLeftBoundary()-
this._leftBoundary;return cc.v2(e,t)},getMaxScrollOffset:function(){var
t=this._view.getContentSize(),e=this.content.getContentSize(),i=e.width-
t.width,n=e.height-t.height;return i=i>=0?i:0,n=n>=0?
n:0,cc.v2(i,n)},scrollToPercentHorizontal:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(t,0),applyToHorizontal:!
0,applyToVertical:!1});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},scrollTo:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(t),applyToHorizontal:!
0,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},scrollToPercentVertical:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(0,t),applyToHorizontal:!
1,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},stopAutoScroll:function(){this._autoScrolling=!
1,this._autoScrollAccumulatedTime=this._autoScrollTotalTime},setContentPosition:fun
ction(t){t.fuzzyEquals(this.getContentPosition(),1e-4)||
(this.content.setPosition(t),this._outOfBoundaryAmountDirty=!
0)},getContentPosition:function(){return
this.content.getPosition()},isScrolling:function(){return
this._scrolling},isAutoScrolling:function(){return
this._autoScrolling},_registerEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!
0),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!
0),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!
0),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!
0),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!
0)},_unregisterEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!
0),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!
0),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!
0),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!
0),this.node.off(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!
0)},_onMouseWheel:function(t,e){if(this.enabledInHierarchy&&!
this._hasNestedViewGroup(t,e)){var i=cc.v2(0,0),n=-.1;0,this.vertical?
i=cc.v2(0,t.getScrollY()*n):this.horizontal&&(i=cc.v2(t.getScrollY()*n,0)),this._mo
useWheelEventElapsedTime=0,this._processDeltaMove(i),this._stopMouseWheel||
(this._handlePressLogic(),this.schedule(this._checkMouseWheel,1/60),this._stopMouse
Wheel=!0),this._stopPropagationIfTargetIsMe(t)}},_checkMouseWheel:function(t){if(!
this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-4))return
this._processInertiaScroll(),this.unschedule(this._checkMouseWheel),void(this._stop
MouseWheel=!
1);this._mouseWheelEventElapsedTime+=t,this._mouseWheelEventElapsedTime>.1&&(this._
onScrollBarTouchEnded(),this.unschedule(this._checkMouseWheel),this._stopMouseWheel
=!1)},_calculateMovePercentDelta:function(t){var
e=t.anchor,i=t.applyToHorizontal,n=t.applyToVertical;this._calculateBoundary(),e=e.
clampf(cc.v2(0,0),cc.v2(1,1));var
r=this._view.getContentSize(),s=this.content.getContentSize(),a=this._getContentBot
tomBoundary()-this._bottomBoundary;a=-a;var o=this._getContentLeftBoundary()-
this._leftBoundary;o=-o;var l=cc.v2(0,0),h=0;return i&&(h=s.width-r.width,l.x=o-
h*e.x),n&&(h=s.height-r.height,l.y=a-h*e.y),l},_moveContentToTopLeft:function(t)
{var e=this.content.getContentSize(),i=this._getContentBottomBoundary()-
this._bottomBoundary;i=-i;var n=cc.v2(0,0),r=0,s=this._getContentLeftBoundary()-
this._leftBoundary;s=-s,e.height<t.height?(r=e.height-t.height,n.y=i-
r,this.verticalScrollBar&&this.verticalScrollBar.hide()):this.verticalScrollBar&&th
is.verticalScrollBar.show(),e.width<t.width?(r=e.width-
t.width,n.x=s,this.horizontalScrollBar&&this.horizontalScrollBar.hide()):this.horiz
ontalScrollBar&&this.horizontalScrollBar.show(),this._moveContent(n),this._adjustCo
ntentOutOfBoundary()},_calculateBoundary:function(){if(this.content){var
t=this.content.getComponent(cc.Layout);t&&t.enabledInHierarchy&&t.updateLayout();va
r
e=this._view.getContentSize(),i=e.width*this._view.anchorX,n=e.height*this._view.an
chorY;this._leftBoundary=-i,this._bottomBoundary=-
n,this._rightBoundary=this._leftBoundary+e.width,this._topBoundary=this._bottomBoun
dary+e.height,this._moveContentToTopLeft(e)}},_hasNestedViewGroup:function(t,e)
{if(t.eventPhase===cc.Event.CAPTURING_PHASE){if(e)for(var i=0;i<e.length;++i){var
n=e[i];if(this.node===n)return!!
t.target.getComponent(cc.ViewGroup);if(n.getComponent(cc.ViewGroup))return!
0}return!1}},_stopPropagationIfTargetIsMe:function(t)
{t.eventPhase===cc.Event.AT_TARGET&&t.target===this.node&&t.stopPropagation()},_onT
ouchBegan:function(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e))
{var i=t.touch;this.content&&this._handlePressLogic(i),this._touchMoved=!
1,this._stopPropagationIfTargetIsMe(t)}},_onTouchMoved:function(t,e)
{if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){var
i=t.touch;if(this.content&&this._handleMoveLogic(i),this.cancelInnerEvents)
{if(i.getLocation().sub(i.getStartLocation()).mag()>7&&!this._touchMoved&&t.target!
==this.node){var n=new
cc.Event.EventTouch(t.getTouches(),t.bubbles);n.type=cc.Node.EventType.TOUCH_CANCEL
,n.touch=t.touch,n.simulate=!0,t.target.dispatchEvent(n),this._touchMoved=!
0}this._stopPropagationIfTargetIsMe(t)}}},_onTouchEnded:function(t,e)
{if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e))
{this._dispatchEvent("touch-up");var
i=t.touch;this.content&&this._handleReleaseLogic(i),this._touchMoved?
t.stopPropagation():this._stopPropagationIfTargetIsMe(t)}},_onTouchCancelled:functi
on(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){if(!t.simulate)
{var
i=t.touch;this.content&&this._handleReleaseLogic(i)}this._stopPropagationIfTargetIs
Me(t)}},_processDeltaMove:function(t)
{this._scrollChildren(t),this._gatherTouchMove(t)},_handleMoveLogic:function(t){var
e=t.getDelta();this._processDeltaMove(e)},_scrollChildren:function(t){var
e=t=this._clampDelta(t),i=void
0;this.elastic&&(i=this._getHowMuchOutOfBoundary(),e.x*=0===i.x?1:.5,e.y*=0===i.y?
1:.5),this.elastic||(i=this._getHowMuchOutOfBoundary(e),e=e.add(i));var n=-
1;if(e.y>0)this.content.y-
this.content.anchorY*this.content.height+e.y>this._bottomBoundary&&(n="scroll-to-
bottom");else if(e.y<0){this.content.y-
this.content.anchorY*this.content.height+this.content.height+e.y<=this._topBoundary
&&(n="scroll-to-top")}if(e.x<0)this.content.x-
this.content.anchorX*this.content.width+this.content.width+e.x<=this._rightBoundary
&&(n="scroll-to-right");else if(e.x>0){this.content.x-
this.content.anchorX*this.content.width+e.x>=this._leftBoundary&&(n="scroll-to-
left")}this._moveContent(e,!1),0===e.x&&0===e.y||(this._scrolling||
(this._scrolling=!0,this._dispatchEvent("scroll-
began")),this._dispatchEvent("scrolling")),-1!
==n&&this._dispatchEvent(n)},_handlePressLogic:function()
{this._autoScrolling&&this._dispatchEvent("scroll-ended"),this._autoScrolling=!
1,this._isBouncing=!
1,this._touchMovePreviousTimestamp=s(),this._touchMoveDisplacements.length=0,this._
touchMoveTimeDeltas.length=0,this._onScrollBarTouchBegan()},_clampDelta:function(t)
{var e=this.content.getContentSize(),i=this._view.getContentSize();return
e.width<i.width&&(t.x=0),e.height<i.height&&(t.y=0),t},_gatherTouchMove:function(t)
{for(t=this._clampDelta(t);this._touchMoveDisplacements.length>=5;)this._touchMoveD
isplacements.shift(),this._touchMoveTimeDeltas.shift();this._touchMoveDisplacements
.push(t);var e=s();this._touchMoveTimeDeltas.push((e-
this._touchMovePreviousTimestamp)/1e3),this._touchMovePreviousTimestamp=e},_startBo
unceBackIfNeeded:function(){if(!this.elastic)return!1;var
t=this._getHowMuchOutOfBoundary();if((t=this._clampDelta(t)).fuzzyEquals(cc.v2(0,0)
,1e-4))return!1;var e=Math.max(this.bounceDuration,0);return
this._startAutoScroll(t,e,!0),this._isBouncing||
(t.y>0&&this._dispatchEvent("bounce-top"),t.y<0&&this._dispatchEvent("bounce-
bottom"),t.x>0&&this._dispatchEvent("bounce-
right"),t.x<0&&this._dispatchEvent("bounce-left"),this._isBouncing=!0),!
0},_processInertiaScroll:function(){if(!
this._startBounceBackIfNeeded()&&this.inertia){var
t=this._calculateTouchMoveVelocity();!t.fuzzyEquals(cc.v2(0,0),1e-
4)&&this.brake<1&&this._startInertiaScroll(t)}this._onScrollBarTouchEnded()},_handl
eReleaseLogic:function(t){var
e=t.getDelta();this._gatherTouchMove(e),this._processInertiaScroll(),this._scrollin
g&&(this._scrolling=!1,this._autoScrolling||this._dispatchEvent("scroll-
ended"))},_isOutOfBoundary:function(){return!
this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-
4)},_isNecessaryAutoScrollBrake:function(){if(this._autoScrollBraking)return!
0;if(this._isOutOfBoundary()){if(!this._autoScrollCurrentlyOutOfBoundary)return
this._autoScrollCurrentlyOutOfBoundary=!0,this._autoScrollBraking=!
0,this._autoScrollBrakingStartPosition=this.getContentPosition(),!0}else
this._autoScrollCurrentlyOutOfBoundary=!1;return!
1},getScrollEndedEventTiming:function(){return 1e-
4},_processAutoScrolling:function(t){var
e=this._isNecessaryAutoScrollBrake(),i=e?.05:1;this._autoScrollAccumulatedTime+=t*(
1/i);var
n=Math.min(1,this._autoScrollAccumulatedTime/this._autoScrollTotalTime);this._autoS
crollAttenuate&&(n=r(n));var
s=this._autoScrollStartPosition.add(this._autoScrollTargetDelta.mul(n)),a=Math.abs(
n-1)<=1e-4;if(Math.abs(n-1)<=this.getScrollEndedEventTiming()&&!
this._isScrollEndedWithThresholdEventFired&&(this._dispatchEvent("scroll-ended-
with-threshold"),this._isScrollEndedWithThresholdEventFired=!0),this.elastic){var
o=s.sub(this._autoScrollBrakingStartPosition);e&&(o=o.mul(i)),s=this._autoScrollBra
kingStartPosition.add(o)}else{var
l=s.sub(this.getContentPosition()),h=this._getHowMuchOutOfBoundary(l);h.fuzzyEquals
(cc.v2(0,0),1e-4)||(s=s.add(h),a=!0)}a&&(this._autoScrolling=!1);var
c=s.sub(this.getContentPosition());this._moveContent(this._clampDelta(c),a),this._d
ispatchEvent("scrolling"),this._autoScrolling||(this._isBouncing=!
1,this._scrolling=!1,this._dispatchEvent("scroll-
ended"))},_startInertiaScroll:function(t){var
e=t.mul(.7);this._startAttenuatingAutoScroll(e,t)},_calculateAttenuatedFactor:funct
ion(t){return this.brake<=0?1-this.brake:(1-this.brake)*(1/(1+14e-6*t+t*t*8e-
9))},_startAttenuatingAutoScroll:function(t,e){var
i=this._calculateAutoScrollTimeByInitalSpeed(e.mag()),n=t.normalize(),r=this.conten
t.getContentSize(),s=this._view.getContentSize(),a=r.width-s.width,o=r.height-
s.height,l=this._calculateAttenuatedFactor(a),h=this._calculateAttenuatedFactor(o);
n=cc.v2(n.x*a*(1-this.brake)*l,n.y*o*h*(1-this.brake));var
c=t.mag(),u=n.mag()/c;n=n.add(t),this.brake>0&&u>7&&(u=Math.sqrt(u),n=t.mul(u).add(
t)),this.brake>0&&u>3&&(i*=u=3),0===this.brake&&u>1&&(i*=u),this._startAutoScroll(n
,i,!0)},_calculateAutoScrollTimeByInitalSpeed:function(t){return
Math.sqrt(Math.sqrt(t/5))},_startAutoScroll:function(t,e,i){var
n=this._flattenVectorByDirection(t);this._autoScrolling=!
0,this._autoScrollTargetDelta=n,this._autoScrollAttenuate=i,this._autoScrollStartPo
sition=this.getContentPosition(),this._autoScrollTotalTime=e,this._autoScrollAccumu
latedTime=0,this._autoScrollBraking=!1,this._isScrollEndedWithThresholdEventFired=!
1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._getHowMuchOutOfBoundary().f
uzzyEquals(cc.v2(0,0),1e-4)||(this._autoScrollCurrentlyOutOfBoundary=!
0)},_calculateTouchMoveVelocity:function(){var
t=0;if((t=this._touchMoveTimeDeltas.reduce((function(t,e){return t+e}),t))<=0||
t>=.5)return cc.v2(0,0);var e=cc.v2(0,0);return
e=this._touchMoveDisplacements.reduce((function(t,e){return
t.add(e)}),e),cc.v2(e.x*(1-this.brake)/t,e.y*(1-
this.brake)/t)},_flattenVectorByDirection:function(t){var e=t;return
e.x=this.horizontal?e.x:0,e.y=this.vertical?e.y:0,e},_moveContent:function(t,e){var
i=this._flattenVectorByDirection(t),n=this.getContentPosition().add(i);this.setCont
entPosition(n);var
r=this._getHowMuchOutOfBoundary();this._updateScrollBar(r),this.elastic&&e&&this._s
tartBounceBackIfNeeded()},_getContentLeftBoundary:function(){return
this.getContentPosition().x-
this.content.getAnchorPoint().x*this.content.getContentSize().width},_getContentRig
htBoundary:function(){var t=this.content.getContentSize();return
this._getContentLeftBoundary()+t.width},_getContentTopBoundary:function(){var
t=this.content.getContentSize();return this._getContentBottomBoundary()
+t.height},_getContentBottomBoundary:function(){return this.getContentPosition().y-
this.content.getAnchorPoint().y*this.content.getContentSize().height},_getHowMuchOu
tOfBoundary:function(t){if((t=t||cc.v2(0,0)).fuzzyEquals(cc.v2(0,0),1e-4)&&!
this._outOfBoundaryAmountDirty)return this._outOfBoundaryAmount;var
e=cc.v2(0,0);return this._getContentLeftBoundary()+t.x>this._leftBoundary?
e.x=this._leftBoundary-(this._getContentLeftBoundary()
+t.x):this._getContentRightBoundary()
+t.x<this._rightBoundary&&(e.x=this._rightBoundary-(this._getContentRightBoundary()
+t.x)),this._getContentTopBoundary()+t.y<this._topBoundary?e.y=this._topBoundary-
(this._getContentTopBoundary()+t.y):this._getContentBottomBoundary()
+t.y>this._bottomBoundary&&(e.y=this._bottomBoundary-
(this._getContentBottomBoundary()+t.y)),t.fuzzyEquals(cc.v2(0,0),1e-
4)&&(this._outOfBoundaryAmount=e,this._outOfBoundaryAmountDirty=!
1),e=this._clampDelta(e)},_updateScrollBar:function(t)
{this.horizontalScrollBar&&this.horizontalScrollBar._onScroll(t),this.verticalScrol
lBar&&this.verticalScrollBar._onScroll(t)},_onScrollBarTouchBegan:function()
{this.horizontalScrollBar&&this.horizontalScrollBar._onTouchBegan(),this.verticalSc
rollBar&&this.verticalScrollBar._onTouchBegan()},_onScrollBarTouchEnded:function()
{this.horizontalScrollBar&&this.horizontalScrollBar._onTouchEnded(),this.verticalSc
rollBar&&this.verticalScrollBar._onTouchEnded()},_dispatchEvent:function(t)
{if("scroll-ended"===t)this._scrollEventEmitMask=0;else if("scroll-to-
top"===t||"scroll-to-bottom"===t||"scroll-to-left"===t||"scroll-to-right"===t){var
e=1<<o[t];if(this._scrollEventEmitMask&e)return;this._scrollEventEmitMask|
=e}cc.Component.EventHandler.emitEvents(this.scrollEvents,this,o[t]),this.node.emit
(t,this)},_adjustContentOutOfBoundary:function()
{if(this._outOfBoundaryAmountDirty=!0,this._isOutOfBoundary()){var
t=this._getHowMuchOutOfBoundary(cc.v2(0,0)),e=this.getContentPosition().add(t);this
.content&&(this.content.setPosition(e),this._updateScrollBar(0))}},start:function()
{this._calculateBoundary(),this.content&&cc.director.once(cc.Director.EVENT_BEFORE_
DRAW,this._adjustContentOutOfBoundary,this)},_hideScrollbar:function()
{this.horizontalScrollBar&&this.horizontalScrollBar.hide(),this.verticalScrollBar&&
this.verticalScrollBar.hide()},_showScrollbar:function()
{this.horizontalScrollBar&&this.horizontalScrollBar.show(),this.verticalScrollBar&&
this.verticalScrollBar.show()},onDisable:function()
{this._unregisterEvent(),this.content&&(this.content.off(n.SIZE_CHANGED,this._calcu
lateBoundary,this),this.content.off(n.SCALE_CHANGED,this._calculateBoundary,this),t
his._view&&(this._view.off(n.POSITION_CHANGED,this._calculateBoundary,this),this._v
iew.off(n.SCALE_CHANGED,this._calculateBoundary,this),this._view.off(n.SIZE_CHANGED
,this._calculateBoundary,this))),this._hideScrollbar(),this.stopAutoScroll()},onEna
ble:function()
{this._registerEvent(),this.content&&(this.content.on(n.SIZE_CHANGED,this._calculat
eBoundary,this),this.content.on(n.SCALE_CHANGED,this._calculateBoundary,this),this.
_view&&(this._view.on(n.POSITION_CHANGED,this._calculateBoundary,this),this._view.o
n(n.SCALE_CHANGED,this._calculateBoundary,this),this._view.on(n.SIZE_CHANGED,this._
calculateBoundary,this))),this._showScrollbar()},update:function(t)
{this._autoScrolling&&this._processAutoScrolling(t)}});cc.ScrollView=e.exports=l}),
{"../CCNode":52,"./CCViewGroup":116}],110:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=cc.Enum({Horizontal:0,Vertical:1}),a=cc
.Class({name:"cc.Slider",extends:r,editor:!1,ctor:function()
{this._offset=cc.v2(),this._touchHandle=!1,this._dragging=!1},properties:{handle:
{default:null,type:cc.Button,tooltip:!1,notify:function(){0}},direction:
{default:s.Horizontal,type:s,tooltip:!1},progress:{default:.5,type:cc.Float,range:
[0,1,.1],slide:!0,tooltip:!1,notify:function()
{this._updateHandlePosition()}},slideEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{Direction:s},__preload:function()
{this._updateHandlePosition()},onEnable:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.on(cc.Node.EventType
.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,thi
s._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.on(cc
.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.on(cc.No
de.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.on(cc.Node.EventT
ype.TOUCH_END,this._onTouchEnded,this))},onDisable:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.off(cc.Node.EventT
ype.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL
,this._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.o
ff(cc.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.off(cc.Node
.EventType.TOUCH_END,this._onTouchEnded,this))},_onHandleDragStart:function(t)
{this._dragging=!0,this._touchHandle=!
0,this._offset=this.handle.node.convertToNodeSpaceAR(t.touch.getLocation()),t.stopP
ropagation()},_onTouchBegan:function(t){this.handle&&(this._dragging=!
0,this._touchHandle||
this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchMoved:function(t)
{this._dragging&&(this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchEn
ded:function(t){this._dragging=!1,this._touchHandle=!
1,this._offset=cc.v2(),t.stopPropagation()},_onTouchCancelled:function(t)
{this._dragging=!1,t.stopPropagation()},_handleSliderLogic:function(t)
{this._updateProgress(t),this._emitSlideEvent()},_emitSlideEvent:function()
{cc.Component.EventHandler.emitEvents(this.slideEvents,this),this.node.emit("slide"
,this)},_updateProgress:function(t){if(this.handle){var
e=this.node.convertToNodeSpace(t.getLocation());this.direction===s.Horizontal?
this.progress=n.clamp01((e.x-
this._offset.x)/this.node.width):this.progress=n.clamp01((e.y-
this._offset.y)/this.node.height)}},_updateHandlePosition:function()
{if(this.handle){var t;t=this.direction===s.Horizontal?cc.v2(-
this.node.width*this.node.anchorX+this.progress*this.node.width,0):cc.v2(0,-
this.node.height*this.node.anchorY+this.progress*this.node.height);
var
e=this.node.convertToWorldSpaceAR(t);this.handle.node.position=this.handle.node.par
ent.convertToNodeSpaceAR(e)}}});cc.Slider=e.exports=a}),
{"../utils/misc":295,"./CCComponent":95}],111:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("../CCNode").EventType,s=t("./CCRenderComponent"),a=t("../
renderer/render-flow"),o=t("../utils/blend-
func"),l=t("../assets/material/CCMaterial"),h=cc.Enum({SIMPLE:0,SLICED:1,TILED:2,FI
LLED:3,MESH:4}),c=cc.Enum({HORIZONTAL:0,VERTICAL:1,RADIAL:2}),u=cc.Enum({CUSTOM:0,T
RIMMED:1,RAW:2}),_=cc.Enum({NORMAL:0,GRAY:1}),f=cc.Class({name:"cc.Sprite",extends:
s,mixins:[o],editor:!1,properties:{_spriteFrame:
{default:null,type:cc.SpriteFrame},_type:h.SIMPLE,_sizeMode:u.TRIMMED,_fillType:0,_
fillCenter:cc.v2(0,0),_fillStart:0,_fillRange:0,_isTrimmedMode:!0,_atlas:
{default:null,type:cc.SpriteAtlas,tooltip:!1,editorOnly:!0,visible:!0,animatable:!
1},spriteFrame:{get:function(){return this._spriteFrame},set:function(t,e){var
i=this._spriteFrame;i!==t&&(this._spriteFrame=t,this.markForUpdateRenderData(!
1),this._applySpriteFrame(i))},type:cc.SpriteFrame},type:{get:function(){return
this._type},set:function(t){this._type!
==t&&(this.destroyRenderData(this._renderData),this._renderData=null,this._type=t,t
his._updateAssembler())},type:h,animatable:!1,tooltip:!1},fillType:{get:function()
{return this._fillType},set:function(t){t!==this._fillType&&(t===c.RADIAL||
this._fillType===c.RADIAL?
(this.destroyRenderData(this._renderData),this._renderData=null):this._renderData&&
this.markForUpdateRenderData(!
0),this._fillType=t,this._updateAssembler())},type:c,tooltip:!1},fillCenter:
{get:function(){return this._fillCenter},set:function(t)
{this._fillCenter.x=t.x,this._fillCenter.y=t.y,this._type===h.FILLED&&this._renderD
ata&&this.markForUpdateRenderData(!0)},tooltip:!1},fillStart:{get:function(){return
this._fillStart},set:function(t){this._fillStart=n.clampf(t,-
1,1),this._type===h.FILLED&&this._renderData&&this.markForUpdateRenderData(!
0)},tooltip:!1},fillRange:{get:function(){return this._fillRange},set:function(t)
{this._fillRange=n.clampf(t,-
1,1),this._type===h.FILLED&&this._renderData&&this.markForUpdateRenderData(!
0)},tooltip:!1},trim:{get:function(){return this._isTrimmedMode},set:function(t)
{this._isTrimmedMode!==t&&(this._isTrimmedMode=t,this._type!==h.SIMPLE&&this._type!
==h.MESH||!this._renderData||this.markForUpdateRenderData(!0))},animatable:!
1,tooltip:!1},sizeMode:{get:function(){return this._sizeMode},set:function(t)
{this._sizeMode=t,t!==u.CUSTOM&&this._applySpriteSize()},animatable:!
1,type:u,tooltip:!1}},statics:
{FillType:c,Type:h,SizeMode:u,State:_},setVisible:function(t)
{this.enabled=t},setState:function(){},getState:function(){},onEnable:function()
{this._super(),this._spriteFrame&&this._spriteFrame.textureLoaded()||
(this.disableRender(),this._spriteFrame&&(this._spriteFrame.once("load",this._onTex
tureLoaded,this),this._spriteFrame.ensureLoadTexture())),this._updateAssembler(),th
is._activateMaterial(),this.node.on(r.SIZE_CHANGED,this._onNodeSizeDirty,this),this
.node.on(r.ANCHOR_CHANGED,this._onNodeSizeDirty,this)},onDisable:function()
{this._super(),this.node.off(r.SIZE_CHANGED,this._onNodeSizeDirty,this),this.node.o
ff(r.ANCHOR_CHANGED,this._onNodeSizeDirty,this)},_onNodeSizeDirty:function()
{this._renderData&&this.markForUpdateRenderData(!0)},_on3DNodeChanged:function()
{this._updateAssembler()},_updateAssembler:function(){var
t=f._assembler.getAssembler(this);this._assembler!
==t&&(this._assembler=t,this._renderData=null),this._renderData||
(this._renderData=this._assembler.createData(this),this.markForUpdateRenderData(!
0))},_activateMaterial:function()
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS)return
this.markForUpdateRenderData(!0),void this.markForRender(!0);var
t=this._spriteFrame;if(t&&t.textureLoaded()){var e=this.sharedMaterials[0];e?
e=l.getInstantiatedMaterial(e,this):
(e=l.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!0);var
i=t.getTexture();e.setProperty("texture",i),this.setMaterial(0,e),this.markForRende
r(!0)}else this.disableRender()},_applyAtlas:!1,_canRender:function()
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS){if(!this._enabled)return!
1}else if(!this._enabled||!this.sharedMaterials[0]||!
this.node._activeInHierarchy)return!1;var t=this._spriteFrame;return!(!t||!
t.textureLoaded())},markForUpdateRenderData:function(t){if(t&&this._canRender())
{this.node._renderFlag|=a.FLAG_UPDATE_RENDER_DATA;var
e=this._renderData;e&&(e.uvDirty=!0,e.vertDirty=!0)}else t||
(this.node._renderFlag&=~a.FLAG_UPDATE_RENDER_DATA)},_applySpriteSize:function()
{if(this._spriteFrame){if(u.RAW===this._sizeMode){var
t=this._spriteFrame.getOriginalSize();this.node.setContentSize(t)}else
if(u.TRIMMED===this._sizeMode){var
e=this._spriteFrame.getRect();this.node.setContentSize(e.width,e.height)}this._acti
vateMaterial()}},_onTextureLoaded:function()
{this.isValid&&this._applySpriteSize()},_applySpriteFrame:function(t)
{t&&t.off&&t.off("load",this._onTextureLoaded,this);var
e=this._spriteFrame,i=this.sharedMaterials[0];e&&(i&&i._texture)===(e&&e._texture)|
|this.markForRender(!1),e&&(t&&e._texture===t._texture?
this._applySpriteSize():e.textureLoaded()?this._onTextureLoaded(null):
(e.once("load",this._onTextureLoaded,this),e.ensureLoadTexture()))},_resized:!
1});cc.Sprite=e.exports=f}),
{"../CCNode":52,"../assets/material/CCMaterial":75,"../renderer/render-
flow":244,"../utils/blend-
func":288,"../utils/misc":295,"./CCRenderComponent":106}],112:[(function(t,e,i)
{"use strict";var
n=cc.Enum({NONE:0,CHECKBOX:1,TEXT_ATLAS:2,SLIDER_BAR:3,LIST_VIEW:4,PAGE_VIEW:5}),r=
cc.Enum({VERTICAL:0,HORIZONTAL:1}),s=cc.Enum({TOP:0,CENTER:1,BOTTOM:2}),a=cc.Enum({
LEFT:0,CENTER:1,RIGHT:2}),o=cc.Class({name:"cc.StudioComponent",extends:cc.Componen
t,editor:!1,properties:!1,statics:
{ComponentType:n,ListDirection:r,VerticalAlign:s,HorizontalAlign:a}}),l=t("../utils
/prefab-
helper");o.PlaceHolder=cc.Class({name:"cc.StudioComponent.PlaceHolder",extends:cc.C
omponent,properties:{_baseUrl:"",nestedPrefab:cc.Prefab},onLoad:function()
{this.nestedPrefab&&this._replaceWithNestedPrefab()},_replaceWithNestedPrefab:funct
ion(){var
t=this.node,e=t._prefab;e.root=t,e.asset=this.nestedPrefab,l.syncWithPrefab(t)}}),c
c.StudioComponent=e.exports=o;var
h=cc.Class({name:"cc.StudioWidget",extends:cc.Widget,editor:!
1,_validateTargetInDEV:function(){}});cc.StudioWidget=e.exports=h}),
{"../utils/prefab-helper":297}],113:[(function(t,e,i){"use strict";var
n=t("../utils/gray-sprite-
state"),r=cc.Class({name:"cc.Toggle",extends:t("./CCButton"),mixins:[n],editor:!
1,properties:{_N$isChecked:!0,isChecked:{get:function(){return
this._N$isChecked},set:function(t){if(t!==this._N$isChecked){var
e=this.toggleGroup||this._toggleContainer;e&&e.enabled&&this._N$isChecked&&!
e.allowSwitchOff||
(this._N$isChecked=t,this._updateCheckMark(),e&&e.enabled&&e.updateToggles(this),th
is._emitToggleEvents())}},tooltip:!1},toggleGroup:{default:null,tooltip:!
1,type:t("./CCToggleGroup")},checkMark:{default:null,type:cc.Sprite,tooltip:!
1},checkEvents:{default:[],type:cc.Component.EventHandler},_resizeToTarget:
{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}}},onEnable:function()
{this._super(),this._registerToggleEvent(),this.toggleGroup&&this.toggleGroup.enabl
edInHierarchy&&this.toggleGroup.addToggle(this)},onDisable:function()
{this._super(),this._unregisterToggleEvent(),this.toggleGroup&&this.toggleGroup.ena
bledInHierarchy&&this.toggleGroup.removeToggle(this)},_hideCheckMark:function()
{this._N$isChecked=!1,this._updateCheckMark()},toggle:function(t){this.isChecked=!
this.isChecked},check:function(){this.isChecked=!0},uncheck:function()
{this.isChecked=!1},_updateCheckMark:function()
{this.checkMark&&(this.checkMark.node.active=!!
this.isChecked)},_updateDisabledState:function()
{if(this._super(),this.enableAutoGrayEffect&&this.checkMark){var t=!
this.interactable;this._switchGrayMaterial(t,this.checkMark)}},_registerToggleEvent
:function()
{this.node.on("click",this.toggle,this)},_unregisterToggleEvent:function()
{this.node.off("click",this.toggle,this)},_emitToggleEvents:function()
{this.node.emit("toggle",this),this.checkEvents&&cc.Component.EventHandler.emitEven
ts(this.checkEvents,this)}});cc.Toggle=e.exports=r,t("../platform/js").get(r.protot
ype,"_toggleContainer",(function(){var t=this.node.parent;return cc.Node.isNode(t)?
t.getComponent(cc.ToggleContainer):null}))}),{"../platform/js":220,"../utils/gray-
sprite-state":291,"./CCButton":93,"./CCToggleGroup":115}],114:[(function(t,e,i)
{"use strict";var
n=cc.Class({name:"cc.ToggleContainer",extends:cc.Component,editor:!1,properties:
{allowSwitchOff:{tooltip:!1,default:!1},checkEvents:{default:
[],type:cc.Component.EventHandler}},updateToggles:function(t)
{this.enabledInHierarchy&&t.isChecked&&(this.toggleItems.forEach((function(e){e!
==t&&e.isChecked&&e.enabled&&e._hideCheckMark()})),this.checkEvents&&cc.Component.E
ventHandler.emitEvents(this.checkEvents,t))},_allowOnlyOneToggleChecked:function()
{var t=!1;return this.toggleItems.forEach((function(e){t?
e._hideCheckMark():e.isChecked&&(t=!
0)})),t},_makeAtLeastOneToggleChecked:function(){if(!
this._allowOnlyOneToggleChecked()&&!this.allowSwitchOff){var
t=this.toggleItems;t.length>0&&t[0].check()}},onEnable:function()
{this.node.on("child-
added",this._allowOnlyOneToggleChecked,this),this.node.on("child-
removed",this._makeAtLeastOneToggleChecked,this)},onDisable:function()
{this.node.off("child-
added",this._allowOnlyOneToggleChecked,this),this.node.off("child-
removed",this._makeAtLeastOneToggleChecked,this)},start:function()
{this._makeAtLeastOneToggleChecked()}});t("../platform/js").get(n.prototype,"toggle
Items",(function(){return
this.node.getComponentsInChildren(cc.Toggle)})),cc.ToggleContainer=e.exports=n}),
{"../platform/js":220}],115:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.ToggleGroup",extends:cc.Component,ctor:function()
{this._toggleItems=[]},editor:!1,properties:{allowSwitchOff:{tooltip:!1,default:!
1},toggleItems:{get:function(){return
this._toggleItems}}},updateToggles:function(t)
{this.enabledInHierarchy&&this._toggleItems.forEach((function(e){t.isChecked&&e!
==t&&e.isChecked&&e.enabled&&e._hideCheckMark()}))},addToggle:function(t){-
1===this._toggleItems.indexOf(t)&&this._toggleItems.push(t),this._allowOnlyOneToggl
eChecked()},removeToggle:function(t){var e=this._toggleItems.indexOf(t);e>-
1&&this._toggleItems.splice(e,1),this._makeAtLeastOneToggleChecked()},_allowOnlyOne
ToggleChecked:function(){var t=!1;return this._toggleItems.forEach((function(e)
{t&&e.enabled&&e._hideCheckMark(),e.isChecked&&e.enabled&&(t=!
0)})),t},_makeAtLeastOneToggleChecked:function()
{this._allowOnlyOneToggleChecked()||this.allowSwitchOff||
this._toggleItems.length>0&&(this._toggleItems[0].isChecked=!0)},start:function()
{this._makeAtLeastOneToggleChecked()}}),r=!
1;t("../platform/js").get(cc,"ToggleGroup",(function(){return r||
(cc.logID(1405,"cc.ToggleGroup","cc.ToggleContainer"),r=!0),n})),e.exports=n}),
{"../platform/js":220}],116:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.ViewGroup",extends:t("./CCComponent")});cc.ViewGroup=e.exports
=n}),{"./CCComponent":95}],117:[(function(t,e,i){"use strict";var n=t("../base-
ui/CCWidgetManager"),r=n.AlignMode,s=n._AlignFlags,a=s.TOP,o=s.MID,l=s.BOT,h=s.LEFT
,c=s.CENTER,u=s.RIGHT,_=a|l,f=h|
u,d=cc.Class({name:"cc.Widget",extends:t("./CCComponent"),editor:!1,properties:
{target:{get:function(){return this._target},set:function(t)
{this._target=t},type:cc.Node,tooltip:!1},isAlignTop:{get:function()
{return(this._alignFlags&a)>0},set:function(t){this._setAlign(a,t)},animatable:!
1,tooltip:!1},isAlignVerticalCenter:{get:function()
{return(this._alignFlags&o)>0},set:function(t){t?(this.isAlignTop=!
1,this.isAlignBottom=!1,this._alignFlags|=o):this._alignFlags&=~o},animatable:!
1,tooltip:!1},isAlignBottom:{get:function()
{return(this._alignFlags&l)>0},set:function(t){this._setAlign(l,t)},animatable:!
1,tooltip:!1},isAlignLeft:{get:function()
{return(this._alignFlags&h)>0},set:function(t){this._setAlign(h,t)},animatable:!
1,tooltip:!1},isAlignHorizontalCenter:{get:function()
{return(this._alignFlags&c)>0},set:function(t){t?(this.isAlignLeft=!
1,this.isAlignRight=!1,this._alignFlags|=c):this._alignFlags&=~c},animatable:!
1,tooltip:!1},isAlignRight:{get:function()
{return(this._alignFlags&u)>0},set:function(t){this._setAlign(u,t)},animatable:!
1,tooltip:!1},isStretchWidth:{get:function()
{return(this._alignFlags&f)===f},visible:!1},isStretchHeight:{get:function()
{return(this._alignFlags&_)===_},visible:!1},top:{get:function(){return
this._top},set:function(t){this._top=t},tooltip:!1},bottom:{get:function(){return
this._bottom},set:function(t){this._bottom=t},tooltip:!1},left:{get:function()
{return this._left},set:function(t){this._left=t},tooltip:!1},right:{get:function()
{return this._right},set:function(t){this._right=t},tooltip:!1},horizontalCenter:
{get:function(){return this._horizontalCenter},set:function(t)
{this._horizontalCenter=t},tooltip:!1},verticalCenter:{get:function(){return
this._verticalCenter},set:function(t){this._verticalCenter=t},tooltip:!
1},isAbsoluteHorizontalCenter:{get:function(){return
this._isAbsHorizontalCenter},set:function(t)
{this._isAbsHorizontalCenter=t},animatable:!1},isAbsoluteVerticalCenter:
{get:function(){return this._isAbsVerticalCenter},set:function(t)
{this._isAbsVerticalCenter=t},animatable:!1},isAbsoluteTop:{get:function(){return
this._isAbsTop},set:function(t){this._isAbsTop=t},animatable:!1},isAbsoluteBottom:
{get:function(){return this._isAbsBottom},set:function(t)
{this._isAbsBottom=t},animatable:!1},isAbsoluteLeft:{get:function(){return
this._isAbsLeft},set:function(t){this._isAbsLeft=t},animatable:!1},isAbsoluteRight:
{get:function(){return this._isAbsRight},set:function(t)
{this._isAbsRight=t},animatable:!1},alignMode:
{default:r.ON_WINDOW_RESIZE,type:r,tooltip:!1},_wasAlignOnce:{default:void
0,formerlySerializedAs:"isAlignOnce"},_target:null,_alignFlags:0,_left:0,_right:0,_
top:0,_bottom:0,_verticalCenter:0,_horizontalCenter:0,_isAbsLeft:!0,_isAbsRight:!
0,_isAbsTop:!0,_isAbsBottom:!0,_isAbsHorizontalCenter:!0,_isAbsVerticalCenter:!
0,_originalWidth:0,_originalHeight:0},statics:{AlignMode:r},onLoad:function(){void
0!==this._wasAlignOnce&&(this.alignMode=this._wasAlignOnce?
r.ONCE:r.ALWAYS,this._wasAlignOnce=void 0)},onEnable:function()
{n.add(this)},onDisable:function(){n.remove(this)},_validateTargetInDEV:!
1,_setAlign:function(t,e){if(e!==(this._alignFlags&t)>0){var i=(t&f)>0;e?
(this._alignFlags|=t,i?(this.isAlignHorizontalCenter=!
1,this.isStretchWidth&&(this._originalWidth=this.node.width)):
(this.isAlignVerticalCenter=!
1,this.isStretchHeight&&(this._originalHeight=this.node.height))):(i?
this.isStretchWidth&&(this.node.width=this._originalWidth):this.isStretchHeight&&(t
his.node.height=this._originalHeight),this._alignFlags&=~t)}},updateAlignment:funct
ion()
{n.updateAlignment(this.node)}});Object.defineProperty(d.prototype,"isAlignOnce",
{get:function(){return this.alignMode===r.ONCE},set:function(t){this.alignMode=t?
r.ONCE:r.ALWAYS}}),cc.Widget=e.exports=d}),{"../base-
ui/CCWidgetManager":79,"./CCComponent":95}],118:[(function(t,e,i){"use strict";var
n=t("./CCComponent"),r=void 0;r=cc.sys.platform===cc.sys.BAIDU_GAME?
cc.Class({name:"cc.SwanSubContextView",extends:n,editor:!1,properties:{_fps:60,fps:
{get:function(){return this._fps},set:function(t){this._fps!
==t&&(this._fps=t,this._updateInterval=1/t,this._updateSubContextFrameRate())},tool
tip:!1}},ctor:function(){this._sprite=null,this._tex=new
cc.Texture2D,this._context=null,this._previousUpdateTime=performance.now(),this._up
dateInterval=0},onLoad:function(){if(swan.getOpenDataContext)
{this._updateInterval=1e3/this._fps,this._context=swan.getOpenDataContext();var
t=this._context.canvas;t&&(t.width=this.node.width,t.height=this.node.height),this.
_tex.setPremultiplyAlpha(!
0),this._tex.initWithElement(t),this._sprite=this.node.getComponent(cc.Sprite),this
._sprite||
(this._sprite=this.node.addComponent(cc.Sprite),this._sprite.srcBlendFactor=cc.macr
o.BlendFactor.ONE),this._sprite.spriteFrame=new cc.SpriteFrame(this._tex)}else
this.enabled=!1},onEnable:function()
{this._runSubContextMainLoop(),this._registerNodeEvent(),this._updateSubContextFram
eRate(),this.updateSubContextViewport()},onDisable:function()
{this._unregisterNodeEvent(),this._stopSubContextMainLoop()},update:function(){var
t=performance.now(),e=t-this._previousUpdateTime;!this._tex||!this._context||
e<this._updateInterval||
(this._previousUpdateTime=t,this._tex.initWithElement(this._context.canvas),this._s
prite._activateMaterial())},updateSubContextViewport:function(){if(this._context)
{var
t=this.node.getBoundingBoxToWorld(),e=cc.view._scaleX,i=cc.view._scaleY;this._conte
xt.postMessage({fromEngine:!
0,event:"viewport",x:t.x*e+cc.view._viewportRect.x,y:t.y*i+cc.view._viewportRect.y,
width:t.width*e,height:t.height*i})}},_registerNodeEvent:function()
{this.node.on("position-
changed",this.updateSubContextViewport,this),this.node.on("scale-
changed",this.updateSubContextViewport,this),this.node.on("size-
changed",this.updateSubContextViewport,this)},_unregisterNodeEvent:function()
{this.node.off("position-
changed",this.updateSubContextViewport,this),this.node.off("scale-
changed",this.updateSubContextViewport,this),this.node.off("size-
changed",this.updateSubContextViewport,this)},_runSubContextMainLoop:function()
{this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!
0})},_stopSubContextMainLoop:function()
{this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!
1})},_updateSubContextFrameRate:function()
{this._context&&this._context.postMessage({fromEngine:!
0,event:"frameRate",value:this._fps})}}):cc.Class({name:"cc.SwanSubContextView",ext
ends:n}),cc.SwanSubContextView=e.exports=r}),{"./CCComponent":95}],119:
[(function(t,e,i){"use strict";var n=t("./CCComponent"),r=void
0;r=cc.Class({name:"cc.WXSubContextView",extends:n}),cc.WXSubContextView=e.exports=
r}),{"./CCComponent":95}],120:[(function(t,e,i){"use strict";var
n=t("../../platform/CCMacro"),r=t("./EditBoxImplBase"),s=t("../CCLabel"),a=t("./typ
es"),o=a.InputMode,l=a.InputFlag,h=a.KeyboardReturnType;function c(t){return
t.replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()}))}function u(t){return
t.charAt(0).toUpperCase()+t.slice(1)}var
_=cc.Class({name:"cc.EditBox",extends:cc.Component,editor:!1,properties:
{_useOriginalSize:!0,_string:"",string:{tooltip:!1,get:function(){return
this._string},set:function(t)
{this.maxLength>=0&&t.length>=this.maxLength&&(t=t.slice(0,this.maxLength)),this._s
tring=t,this._updateString(t)}},textLabel:{tooltip:!
1,default:null,type:s,notify:function(t){this.textLabel&&this.textLabel!
==t&&(this._updateTextLabel(),this._updateLabels())}},placeholderLabel:{tooltip:!
1,default:null,type:s,notify:function(t)
{this.placeholderLabel&&this.placeholderLabel!
==t&&(this._updatePlaceholderLabel(),this._updateLabels())}},background:{tooltip:!
1,default:null,type:cc.Sprite,notify:function(t){this.background&&this.background!
==t&&this._updateBackgroundSprite()}},_N$backgroundImage:{default:void
0,type:cc.SpriteFrame},backgroundImage:{get:function(){return this.background?
this.background.spriteFrame:null},set:function(t)
{this.background&&(this.background.spriteFrame=t)}},returnType:
{default:h.DEFAULT,tooltip:!
1,displayName:"KeyboardReturnType",type:h},_N$returnType:{default:void
0,type:cc.Float},inputFlag:{tooltip:!1,default:l.DEFAULT,type:l,notify:function()
{this._updateString(this._string)}},inputMode:{tooltip:!
1,default:o.ANY,type:o,notify:function(t){this.inputMode!
==t&&(this._updateTextLabel(),this._updatePlaceholderLabel())}},fontSize:
{get:function(){return this.textLabel?this.textLabel.fontSize:null},set:function(t)
{this.textLabel&&(this.textLabel.fontSize=t)}},_N$fontSize:{default:void
0,type:cc.Float},lineHeight:{get:function(){return this.textLabel?
this.textLabel.lineHeight:null},set:function(t)
{this.textLabel&&(this.textLabel.lineHeight=t)}},_N$lineHeight:{default:void
0,type:cc.Float},fontColor:{get:function(){return this.textLabel?
this.textLabel.node.color:null},set:function(t)
{this.textLabel&&(this.textLabel.node.color=t,this.textLabel.node.opacity=t.a)}},_N
$fontColor:{default:void 0,type:cc.Color},placeholder:{tooltip:!1,get:function()
{return this.placeholderLabel?this.placeholderLabel.string:""},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.string=t)}},_N$placeholder:
{default:void 0,type:cc.String},placeholderFontSize:{get:function(){return
this.placeholderLabel?this.placeholderLabel.fontSize:null},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.fontSize=t)}},_N$placeholderFontSize
:{default:void 0,type:cc.Float},placeholderFontColor:{get:function(){return
this.placeholderLabel?this.placeholderLabel.node.color:null},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.node.color=t,this.placeholderLabel.n
ode.opacity=t.a)}},_N$placeholderFontColor:{default:void
0,type:cc.Color},maxLength:{tooltip:!1,default:20},_N$maxLength:{default:void
0,type:cc.Float},stayOnTop:{default:!1,notify:function(){cc.warn("editBox.stayOnTop
is removed since v2.1.")}},_tabIndex:0,tabIndex:{tooltip:!1,get:function(){return
this._tabIndex},set:function(t)
{this._tabIndex=t,this._impl&&this._impl.setTabIndex(t)}},editingDidBegan:{default:
[],type:cc.Component.EventHandler},textChanged:{default:
[],type:cc.Component.EventHandler},editingDidEnded:{default:
[],type:cc.Component.EventHandler},editingReturn:{default:
[],type:cc.Component.EventHandler}},statics:
{_ImplClass:r,KeyboardReturnType:h,InputFlag:l,InputMode:o},_init:function()
{this._upgradeComp(),this._isLabelVisible=!
0,this.node.on(cc.Node.EventType.SIZE_CHANGED,this._syncSize,this),(this._impl=new
_._ImplClass).init(this),this._updateString(this._string),this._syncSize()},_update
BackgroundSprite:function(){var t=this.background;if(!t){var
e=this.node.getChildByName("BACKGROUND_SPRITE");e||(e=new
cc.Node("BACKGROUND_SPRITE")),(t=e.getComponent(cc.Sprite))||
(t=e.addComponent(cc.Sprite)),e.parent=this.node,this.background=t}t.type=cc.Sprite
.Type.SLICED,void 0!
==this._N$backgroundImage&&(t.spriteFrame=this._N$backgroundImage,this._N$backgroun
dImage=void 0)},_updateTextLabel:function(){var t=this.textLabel;if(!t){var
e=this.node.getChildByName("TEXT_LABEL");e||(e=new cc.Node("TEXT_LABEL")),
(t=e.getComponent(s))||
(t=e.addComponent(s)),e.parent=this.node,this.textLabel=t}t.node.setAnchorPoint(0,1
),t.overflow=s.Overflow.CLAMP,this.inputMode===o.ANY?
(t.verticalAlign=n.VerticalTextAlignment.TOP,t.enableWrapText=!0):
(t.verticalAlign=n.VerticalTextAlignment.CENTER,t.enableWrapText=!
1),t.string=this._updateLabelStringStyle(this._string),void 0!
==this._N$fontColor&&(t.node.color=this._N$fontColor,t.node.opacity=this._N$fontCol
or.a,this._N$fontColor=void 0),void 0!
==this._N$fontSize&&(t.fontSize=this._N$fontSize,this._N$fontSize=void 0),void 0!
==this._N$lineHeight&&(t.lineHeight=this._N$lineHeight,this._N$lineHeight=void
0)},_updatePlaceholderLabel:function(){var t=this.placeholderLabel;if(!t){var
e=this.node.getChildByName("PLACEHOLDER_LABEL");e||(e=new
cc.Node("PLACEHOLDER_LABEL")),(t=e.getComponent(s))||
(t=e.addComponent(s)),e.parent=this.node,this.placeholderLabel=t}t.node.setAnchorPo
int(0,1),t.overflow=s.Overflow.CLAMP,this.inputMode===o.ANY?
(t.verticalAlign=n.VerticalTextAlignment.TOP,t.enableWrapText=!0):
(t.verticalAlign=n.VerticalTextAlignment.CENTER,t.enableWrapText=!
1),t.string=this.placeholder,void 0!
==this._N$placeholderFontColor&&(t.node.color=this._N$placeholderFontColor,t.node.o
pacity=this._N$placeholderFontColor.a,this._N$placeholderFontColor=void 0),void 0!
==this._N$placeholderFontSize&&(t.fontSize=this._N$placeholderFontSize,this._N$plac
eholderFontSize=void 0)},_upgradeComp:function(){void 0!
==this._N$returnType&&(this.returnType=this._N$returnType,this._N$returnType=void
0),void 0!
==this._N$maxLength&&(this.maxLength=this._N$maxLength,this._N$maxLength=void
0),void 0!==this._N$backgroundImage&&this._updateBackgroundSprite(),void
0===this._N$fontColor&&void 0===this._N$fontSize&&void 0===this._N$lineHeight||
this._updateTextLabel(),void 0===this._N$placeholderFontColor&&void
0===this._N$placeholderFontSize||this._updatePlaceholderLabel(),void 0!
==this._N$placeholder&&(this.placeholder=this._N$placeholder,this._N$placeholder=vo
id 0)},_syncSize:function(){if(this._impl){var
t=this.node.getContentSize();this._impl.setSize(t.width,t.height)}},_showLabels:fun
ction(){this._isLabelVisible=!0,this._updateLabels()},_hideLabels:function()
{this._isLabelVisible=!1,this.textLabel&&(this.textLabel.node.active=!
1),this.placeholderLabel&&(this.placeholderLabel.node.active=!
1)},_updateLabels:function(){if(this._isLabelVisible){var
t=this._string;this.textLabel&&(this.textLabel.node.active=""!
==t),this.placeholderLabel&&(this.placeholderLabel.node.active=""===t)}},_updateStr
ing:function(t){var e=this.textLabel;if(e){var
i=t;i&&(i=this._updateLabelStringStyle(i)),e.string=i,this._updateLabels()}},_updat
eLabelStringStyle:function(t,e){var i=this.inputFlag;if(e||i!
==l.PASSWORD)i===l.INITIAL_CAPS_ALL_CHARACTERS?
t=t.toUpperCase():i===l.INITIAL_CAPS_WORD?
t=c(t):i===l.INITIAL_CAPS_SENTENCE&&(t=u(t));else{for(var n="",r=t.length,s=0;s<r;+
+s)n+="\u25cf";t=n}return t},editBoxEditingDidBegan:function()
{cc.Component.EventHandler.emitEvents(this.editingDidBegan,this),this.node.emit("ed
iting-did-began",this)},editBoxEditingDidEnded:function()
{cc.Component.EventHandler.emitEvents(this.editingDidEnded,this),this.node.emit("ed
iting-did-ended",this)},editBoxTextChanged:function(t)
{t=this._updateLabelStringStyle(t,!
0),this.string=t,cc.Component.EventHandler.emitEvents(this.textChanged,t,this),this
.node.emit("text-changed",this)},editBoxEditingReturn:function()
{cc.Component.EventHandler.emitEvents(this.editingReturn,this),this.node.emit("edit
ing-return",this)},onEnable:function()
{this._registerEvent(),this._impl&&this._impl.enable()},onDisable:function()
{this._unregisterEvent(),this._impl&&this._impl.disable()},onDestroy:function()
{this._impl&&this._impl.clear()},__preload:function()
{this._init()},_registerEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_unregisterEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_onTouchBegan:function(t)
{t.stopPropagation()},_onTouchCancel:function(t)
{t.stopPropagation()},_onTouchEnded:function(t)
{this._impl&&this._impl.beginEditing(),t.stopPropagation()},setFocus:function()
{cc.warnID(1400,"setFocus()","focus()"),this._impl&&this._impl.setFocus(!
0)},focus:function(){this._impl&&this._impl.setFocus(!0)},blur:function()
{this._impl&&this._impl.setFocus(!1)},isFocused:function(){return!!
this._impl&&this._impl.isFocused()},update:function()
{this._impl&&this._impl.update()}});cc.EditBox=e.exports=_,cc.sys.isBrowser&&t("./W
ebEditBoxImpl")}),
{"../../platform/CCMacro":205,"../CCLabel":97,"./EditBoxImplBase":121,"./WebEditBox
Impl":122,"./types":123}],121:[(function(t,e,i){"use strict";var
n=cc.Class({ctor:function(){this._delegate=null},init:function(t)
{},enable:function(){},disable:function(){},clear:function(){},update:function()
{},setTabIndex:function(t){},setSize:function(t,e){},setFocus:function(t)
{},isFocused:function(){},beginEditing:function(){},endEditing:function()
{}});e.exports=n}),{}],122:[(function(t,e,i){"use strict";var
n=t("../../platform/utils"),r=t("../../platform/CCMacro"),s=t("./types"),a=t("../CC
Label"),o=cc.EditBox,l=cc.js,h=s.InputMode,c=s.InputFlag,u=s.KeyboardReturnType,_=c
c.vmath,f={zoomInvalid:!1};cc.sys.OS_ANDROID!==cc.sys.os||cc.sys.browserType!
==cc.sys.BROWSER_TYPE_SOUGOU&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_360||
(f.zoomInvalid=!0);var d=0,m=cc.v3(),p=null,v=!1,y=!1;function g()
{this._domId="EditBoxId_"+ +
+d,this._placeholderStyleSheet=null,this._elem=null,this._isTextArea=!
1,this._editing=!
1,this._worldMat=_.mat4.create(),this._cameraMat=_.mat4.create(),this._m00=0,this._
m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0,this._h=0,this._inp
utMode=null,this._inputFlag=null,this._returnType=null,this._eventListeners={},this
._textLabelFont=null,this._textLabelFontSize=null,this._textLabelFontColor=null,thi
s._textLabelAlign=null,this._placeholderLabelFont=null,this._placeholderLabelFontSi
ze=null,this._placeholderLabelFontColor=null,this._placeholderLabelAlign=null,this.
_placeholderLineHeight=null}l.extend(g,o._ImplClass),o._ImplClass=g,Object.assign(g
.prototype,{init:function(t){t&&(this._delegate=t,t.inputMode===h.ANY?
this._createTextArea():this._createInput(),this.setTabIndex(t.tabIndex),this._disab
leDom(),this._initStyleSheet(),this._registerEventListeners(),this._addDomToGameCon
tainer(),v=cc.view.isAutoFullScreenEnabled(),y=cc.view._resizeWithBrowserSize)},ena
ble:function()
{this._enableDom(),this._delegate._unregisterEvent()},disable:function()
{this._disableDom()},clear:function()
{this._removeEventListeners(),this._removeDomFromGameContainer()},update:function()
{this._updateMatrix()},setTabIndex:function(t)
{this._elem.tabIndex=t},setSize:function(t,e){var
i=this._elem;i.style.width=t+"px",i.style.height=e+"px"},setFocus:function(t){t?
this._elem.focus():this._elem.blur()},isFocused:function(){return
this._editing},beginEditing:function(){this._editing=!
0,p=this,this._showDom(),this._delegate.editBoxEditingDidBegan()},endEditing:functi
on(){this._editing=!
1,p=null,this._hideDom(),this._delegate.editBoxEditingDidEnded()},_createInput:func
tion(){this._isTextArea=!
1,this._elem=document.createElement("input")},_createTextArea:function()
{this._isTextArea=!
0,this._elem=document.createElement("textarea")},_addDomToGameContainer:function()
{cc.game.container.appendChild(this._elem),document.head.appendChild(this._placehol
derStyleSheet)},_removeDomFromGameContainer:function()
{n.contains(cc.game.container,this._elem)&&cc.game.container.removeChild(this._elem
),n.contains(documen
t.head,this._placeholderStyleSheet)&&document.head.removeChild(this._placeholderSty
leSheet),delete this._elem,delete
this._placeholderStyleSheet},_enableDom:function()
{this._elem.style.display=""},_disableDom:function()
{this._elem.style.display="none"},_showDom:function()
{this._updateMaxLength(),this._updateInputType(),this._updateStyleSheet(),this._ele
m.style.opacity=1,this._delegate._hideLabels(),cc.sys.isMobile&&this._showDomOnMobi
le()},_hideDom:function()
{this._elem.style.opacity=0,this._delegate._showLabels(),cc.sys.isMobile&&this._hid
eDomOnMobile()},_showDomOnMobile:function()
{cc.sys.os===cc.sys.OS_ANDROID&&(v&&(cc.view.enableAutoFullScreen(!
1),cc.screen.exitFullScreen()),y&&cc.view.resizeWithBrowserSize(!
1),this._adjustWindowScroll())},_hideDomOnMobile:function()
{cc.sys.os===cc.sys.OS_ANDROID&&(v&&cc.view.enableAutoFullScreen(!
0),y&&cc.view.resizeWithBrowserSize(!
0),this._scrollBackWindow())},_adjustWindowScroll:function(){var
t=this;setTimeout((function()
{window.scrollY<100&&t._elem.scrollIntoView({block:"start",inline:"nearest",behavio
r:"smooth"})}),800)},_scrollBackWindow:function(){setTimeout((function()
{window.scrollTo(0,0)}),800)},_updateMatrix:function(){var
t=this._delegate.node;t.getWorldMatrix(this._worldMat);var
e=this._worldMat;if(this._m00!==e.m00||this._m01!==e.m01||this._m04!==e.m04||
this._m05!==e.m05||this._m12!==e.m12||this._m13!==e.m13||this._w!
==t._contentSize.width||this._h!==t._contentSize.height)
{this._m00=e.m00,this._m01=e.m01,this._m04=e.m04,this._m05=e.m05,this._m12=e.m12,th
is._m13=e.m13,this._w=t._contentSize.width,this._h=t._contentSize.height;var
i=cc.view._scaleX,n=cc.view._scaleY,r=cc.view._viewportRect,s=cc.view._devicePixelR
atio;m.x=-t._anchorPoint.x*this._w,m.y=-
t._anchorPoint.y*this._h,_.mat4.translate(e,e,m);var a=void
0;cc.Camera.findCamera(t).getWorldToCameraMatrix(this._cameraMat),a=this._cameraMat
,_.mat4.mul(a,a,e),i/=s,n/=s;var
o=cc.game.container,l=a.m00*i,h=a.m01,c=a.m04,u=a.m05*n,d=o&&o.style.paddingLeft&&p
arseInt(o.style.paddingLeft);d+=r.x/s;var
p=o&&o.style.paddingBottom&&parseInt(o.style.paddingBottom);p+=r.y/s;var
v=a.m12*i+d,y=a.m13*n+p;f.zoomInvalid&&(this.setSize(t.width*l,t.height*u),l=1,u=1)
;var g=this._elem,x="matrix("+l+","+-h+","+-c+","+u+","+v+","+-
y+")";g.style.transform=x,g.style["-webkit-transform"]=x,g.style["transform-
origin"]="0px 100% 0px",g.style["-webkit-transform-origin"]="0px 100%
0px"}},_updateInputType:function(){var
t=this._delegate,e=t.inputMode,i=t.inputFlag,n=t.returnType,r=this._elem;if(this._i
nputMode!==e||this._inputFlag!==i||this._returnType!==n)
{if(this._inputMode=e,this._inputFlag=i,this._returnType=n,this._isTextArea){var
s="none";return i===c.INITIAL_CAPS_ALL_CHARACTERS?
s="uppercase":i===c.INITIAL_CAPS_WORD&&(s="capitalize"),void(r.style.textTransform=
s)}if(i!==c.PASSWORD){var a=r.type;e===h.EMAIL_ADDR?a="email":e===h.NUMERIC||
e===h.DECIMAL?a="number":e===h.PHONE_NUMBER?(a="number",r.pattern="[0-
9]*"):e===h.URL?a="url":(a="text",n===u.SEARCH&&(a="search")),r.type=a;var
o="none";i===c.INITIAL_CAPS_ALL_CHARACTERS?
o="uppercase":i===c.INITIAL_CAPS_WORD&&(o="capitalize"),r.style.textTransform=o}els
e r.type="password"}},_updateMaxLength:function(){var
t=this._delegate.maxLength;t<0&&(t=65535),this._elem.maxLength=t},_initStyleSheet:f
unction(){var
t=this._elem;t.style.opacity=0,t.style.border=0,t.style.background="transparent",t.
style.width="100%",t.style.height="100%",t.style.active=0,t.style.outline="medium",
t.style.padding="0",t.style.textTransform="uppercase",t.style.position="absolute",t
.style.bottom="0px",t.style.left="2px",t.className="cocosEditBox",t.id=this._domId,
this._isTextArea?(t.style.resize="none",t.style.overflow_y="scroll"):
(t.type="text",t.style["-moz-
appearance"]="textfield"),this._placeholderStyleSheet=document.createElement("style
")},_updateStyleSheet:function(){var
t=this._delegate,e=this._elem;e.value=t.string,e.placeholder=t.placeholder,this._up
dateTextLabel(t.textLabel),this._updatePlaceholderLabel(t.placeholderLabel)},_updat
eTextLabel:function(t){if(t){var e=t.font;if(e=!e||e instanceof cc.BitmapFont?
t.fontFamily:e._fontFamily,this._textLabelFont!==e||this._textLabelFontSize!
==t.fontSize||this._textLabelFontColor!==t.fontColor||this._textLabelAlign!
==t.horizontalAlign)
{this._textLabelFont=e,this._textLabelFontSize=t.fontSize,this._textLabelFontColor=
t.fontColor,this._textLabelAlign=t.horizontalAlign;var
i=this._elem;switch(i.style.fontSize=t.fontSize+"px",i.style.color=t.node.color.toC
SS("rgba"),i.style.fontFamily=e,t.horizontalAlign){case
a.HorizontalAlign.LEFT:i.style.textAlign="left";break;case
a.HorizontalAlign.CENTER:i.style.textAlign="center";break;case
a.HorizontalAlign.RIGHT:i.style.textAlign="right"}}}},_updatePlaceholderLabel:funct
ion(t){if(t){var e=t.font;if(e=!e||e instanceof cc.BitmapFont?
t.fontFamily:t.font._fontFamily,this._placeholderLabelFont!==e||
this._placeholderLabelFontSize!==t.fontSize||this._placeholderLabelFontColor!
==t.fontColor||this._placeholderLabelAlign!==t.horizontalAlign||
this._placeholderLineHeight!==t.lineHeight)
{this._placeholderLabelFont=e,this._placeholderLabelFontSize=t.fontSize,this._place
holderLabelFontColor=t.fontColor,this._placeholderLabelAlign=t.horizontalAlign,this
._placeholderLineHeight=t.lineHeight;var
i=this._placeholderStyleSheet,n=t.fontSize,r=t.node.color.toCSS("rgba"),s=t.lineHei
ght,o=void 0;switch(t.horizontalAlign){case
a.HorizontalAlign.LEFT:o="left";break;case
a.HorizontalAlign.CENTER:o="center";break;case
a.HorizontalAlign.RIGHT:o="right"}i.innerHTML="\n #"+this._domId+"::-
webkit-input-placeholder {\n text-transform: initial;\n
font-family: "+e+";\n font-size: "+n+"px;\n color:
"+r+";\n line-height: "+s+"px;\n text-align: "+o+";\n
}\n #"+this._domId+"::-moz-placeholder {\n text-
transform: initial;\n font-family: "+e+";\n font-
size: "+n+"px;\n color: "+r+";\n line-height:
"+s+"px;\n text-align: "+o+";\n }\n
#"+this._domId+":-ms-input-placeholder {\n text-transform:
initial;\n font-family: "+e+";\n font-size:
"+n+"px;\n color: "+r+";\n line-height: "+s+"px;\n
text-align: "+o+";\n }\n "}}},_registerEventListeners:function()
{var t=this,e=this._elem,i=!1,n=this._eventListeners;n.compositionStart=function()
{i=!0},n.compositionEnd=function(){i=!
1,t._delegate.editBoxTextChanged(e.value)},n.onInput=function(){i||
t._delegate.editBoxTextChanged(e.value)},n.onFocus=function()
{t.beginEditing()},n.onClick=function(e){t._editing?
cc.sys.isMobile&&t._adjustWindowScroll():p&&p!
==t&&p._elem.blur()},n.onKeypress=function(i)
{i.keyCode===r.KEY.enter&&(i.stopPropagation(),t._delegate.editBoxEditingReturn(),t
._isTextArea||e.blur())},n.onBlur=function()
{t.endEditing()},e.addEventListener("compositionstart",n.compositionStart),e.addEve
ntListener("compositionend",n.compositionEnd),e.addEventListener("input",n.onInput)
,e.addEventListener("focus",n.onFocus),e.addEventListener("keypress",n.onKeypress),
e.addEventListener("blur",n.onBlur),e.addEventListener("touchstart",n.onClick)},_re
moveEventListeners:function(){var
t=this._elem,e=this._eventListeners;t.removeEventListener("compositionstart",e.comp
ositionStart),t.removeEventListener("compositionend",e.compositionEnd),t.removeEven
tListener("input",e.onInput),t.removeEventListener("focus",e.onFocus),t.removeEvent
Listener("keypress",e.onKeypress),t.removeEventListener("blur",e.onBlur),t.removeEv
entListener("touchstart",e.onClick),e.compositionStart=null,e.compositionEnd=null,e
.onInput=null,e.onFocus=null,e.onKeypress=null,e.onBlur=null,e.onClick=null}})}),
{"../../platform/CCMacro":205,"../../platform/utils":224,"../CCLabel":97,"./types":
123}],123:[(function(t,e,i){"use strict";var
n=cc.Enum({DEFAULT:0,DONE:1,SEND:2,SEARCH:3,GO:4,NEXT:5}),r=cc.Enum({ANY:0,EMAIL_AD
DR:1,NUMERIC:2,PHONE_NUMBER:3,URL:4,DECIMAL:5,SINGLE_LINE:6}),s=cc.Enum({PASSWORD:0
,SENSITIVE:1,INITIAL_CAPS_WORD:2,INITIAL_CAPS_SENTENCE:3,INITIAL_CAPS_ALL_CHARACTER
S:4,DEFAULT:5});e.exports={KeyboardReturnType:n,InputMode:r,InputFlag:s}}),{}],124:
[(function(t,e,i){"use
strict";t("./CCComponent"),t("./CCComponentEventHandler"),t("./missing-script");var
n=[t("./CCSprite"),t("./CCWidget"),t("./CCCanvas"),t("./CCAudioSource"),t("./CCAnim
ation"),t("./CCButton"),t("./CCLabel"),t("./CCProgressBar"),t("./CCMask"),t("./CCSc
rollBar"),t("./CCScrollView"),t("./CCPageViewIndicator"),t("./CCPageView"),t("./CCS
lider"),t("./CCLayout"),t("./editbox/CCEditBox"),t("./CCLabelOutline"),t("./CCLabel
Shadow"),t("./CCRichText"),t("./CCToggleContainer"),t("./CCToggleGroup"),t("./CCTog
gle"),t("./CCBlockInputEvents"),t("./CCMotionStreak"),t("./WXSubContextView"),t("./
SwanSubContextView")];e.exports=n}),
{"./CCAnimation":90,"./CCAudioSource":91,"./CCBlockInputEvents":92,"./CCButton":93,
"./CCCanvas":94,"./CCComponent":95,"./CCComponentEventHandler":96,"./CCLabel":97,".
/CCLabelOutline":98,"./CCLabelShadow":99,"./CCLayout":100,"./CCMask":101,"./CCMotio
nStreak":102,"./CCPageView":103,"./CCPageViewIndicator":104,"./CCProgressBar":105,"
./CCRichText":107,"./CCScrollBar":108,"./CCScrollView":109,"./CCSlider":110,"./CCSp
rite":111,"./CCToggle":113,"./CCToggleContainer":114,"./CCToggleGroup":115,"./CCWid
get":117,"./SwanSubContextView":118,"./WXSubContextView":119,"./editbox/CCEditBox":
120,"./missing-script":125}],125:[(function(t,e,i){"use strict";var
n=cc.js,r=t("../utils/misc").BUILTIN_CLASSID_RE,s=cc.Class({name:"cc.MissingClass",
properties:{_$erialized:{default:null,visible:!1,editorOnly:!
0}}}),a=cc.Class({name:"cc.MissingScript",extends:cc.Component,editor:
{inspector:"packages://inspector/inspectors/comps/missing-script.js"},properties:
{compiled:{default:!1,serializable:!1},_$erialized:{default:null,visible:!
1,editorOnly:!0}},ctor:!1,statics:{safeFindClass:function(t,e
){var i=n._getClassById(t);return i||(t?
(cc.deserialize.reportMissingClass(t),a.getMissingWrapper(t,e)):null)},getMissingWr
apper:function(t,e){return e.node&&(/^[0-9a-zA-Z+/]{23}$/.test(t)||r.test(t))?
a:s}},onLoad:function()
{cc.warnID(4600,this.node.name)}});cc._MissingScript=e.exports=a}),
{"../utils/misc":295}],126:[(function(t,e,i){"use strict";var
n=cc.js;t("../event/event");var r=function(t,e)
{cc.Event.call(this,cc.Event.MOUSE,e),this._eventType=t,this._button=0,this._x=0,th
is._y=0,this._prevX=0,this._prevY=0,this._scrollX=0,this._scrollY=0};n.extend(r,cc.
Event);var s=r.prototype;s.setScrollData=function(t,e)
{this._scrollX=t,this._scrollY=e},s.getScrollX=function(){return
this._scrollX},s.getScrollY=function(){return
this._scrollY},s.setLocation=function(t,e)
{this._x=t,this._y=e},s.getLocation=function(){return
cc.v2(this._x,this._y)},s.getLocationInView=function(){return
cc.v2(this._x,cc.view._designResolutionSize.height-
this._y)},s._setPrevCursor=function(t,e)
{this._prevX=t,this._prevY=e},s.getPreviousLocation=function(){return
cc.v2(this._prevX,this._prevY)},s.getDelta=function(){return cc.v2(this._x-
this._prevX,this._y-this._prevY)},s.getDeltaX=function(){return this._x-
this._prevX},s.getDeltaY=function(){return this._y-
this._prevY},s.setButton=function(t){this._button=t},s.getButton=function(){return
this._button},s.getLocationX=function(){return this._x},s.getLocationY=function()
{return
this._y},r.NONE=0,r.DOWN=1,r.UP=2,r.MOVE=3,r.SCROLL=4,r.BUTTON_LEFT=0,r.BUTTON_RIGH
T=2,r.BUTTON_MIDDLE=1,r.BUTTON_4=3,r.BUTTON_5=4,r.BUTTON_6=5,r.BUTTON_7=6,r.BUTTON_
8=7;var a=function(t,e)
{cc.Event.call(this,cc.Event.TOUCH,e),this._eventCode=0,this._touches=t||
[],this.touch=null,this.currentTouch=null};n.extend(a,cc.Event),
(s=a.prototype).getEventCode=function(){return
this._eventCode},s.getTouches=function(){return
this._touches},s._setEventCode=function(t)
{this._eventCode=t},s._setTouches=function(t)
{this._touches=t},s.setLocation=function(t,e)
{this.touch&&this.touch.setTouchInfo(this.touch.getID(),t,e)},s.getLocation=functio
n(){return this.touch?
this.touch.getLocation():cc.v2()},s.getLocationInView=function(){return this.touch?
this.touch.getLocationInView():cc.v2()},s.getPreviousLocation=function(){return
this.touch?this.touch.getPreviousLocation():cc.v2()},s.getStartLocation=function()
{return this.touch?this.touch.getStartLocation():cc.v2()},s.getID=function(){return
this.touch?this.touch.getID():null},s.getDelta=function(){return this.touch?
this.touch.getDelta():cc.v2()},s.getDeltaX=function(){return this.touch?
this.touch.getDelta().x:0},s.getDeltaY=function(){return this.touch?
this.touch.getDelta().y:0},s.getLocationX=function(){return this.touch?
this.touch.getLocationX():0},s.getLocationY=function(){return this.touch?
this.touch.getLocationY():0},a.MAX_TOUCHES=5,a.BEGAN=0,a.MOVED=1,a.ENDED=2,a.CANCEL
ED=3;var o=function(t,e)
{cc.Event.call(this,cc.Event.ACCELERATION,e),this.acc=t};n.extend(o,cc.Event);var
l=function(t,e,i)
{cc.Event.call(this,cc.Event.KEYBOARD,i),this.keyCode=t,this.isPressed=e};n.extend(
l,cc.Event),cc.Event.EventMouse=r,cc.Event.EventTouch=a,cc.Event.EventAcceleration=
o,cc.Event.EventKeyboard=l,e.exports=cc.Event}),{"../event/event":133}],127:
[(function(t,e,i){"use strict";var
n=t("../platform/js");cc.EventListener=function(t,e,i)
{this._onEvent=i,this._type=t||0,this._listenerID=e||"",this._registered=!
1,this._fixedPriority=0,this._node=null,this._target=null,this._paused=!
0,this._isEnabled=!
0},cc.EventListener.prototype={constructor:cc.EventListener,_setPaused:function(t)
{this._paused=t},_isPaused:function(){return
this._paused},_setRegistered:function(t)
{this._registered=t},_isRegistered:function(){return
this._registered},_getType:function(){return this._type},_getListenerID:function()
{return this._listenerID},_setFixedPriority:function(t)
{this._fixedPriority=t},_getFixedPriority:function(){return
this._fixedPriority},_setSceneGraphPriority:function(t)
{this._target=t,this._node=t},_getSceneGraphPriority:function(){return
this._node},checkAvailable:function(){return null!==this._onEvent},clone:function()
{return null},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return
this._isEnabled},retain:function(){},release:function()
{}},cc.EventListener.UNKNOWN=0,cc.EventListener.TOUCH_ONE_BY_ONE=1,cc.EventListener
.TOUCH_ALL_AT_ONCE=2,cc.EventListener.KEYBOARD=3,cc.EventListener.MOUSE=4,cc.EventL
istener.ACCELERATION=6,cc.EventListener.CUSTOM=8;var
r=cc.EventListener.ListenerID={MOUSE:"__cc_mouse",TOUCH_ONE_BY_ONE:"__cc_touch_one_
by_one",TOUCH_ALL_AT_ONCE:"__cc_touch_all_at_once",KEYBOARD:"__cc_keyboard",ACCELER
ATION:"__cc_acceleration"},s=function(t,e)
{this._onCustomEvent=e,cc.EventListener.call(this,cc.EventListener.CUSTOM,t,this._c
allback)};n.extend(s,cc.EventListener),n.mixin(s.prototype,
{_onCustomEvent:null,_callback:function(t){null!
==this._onCustomEvent&&this._onCustomEvent(t)},checkAvailable:function(){return
cc.EventListener.prototype.checkAvailable.call(this)&&null!
==this._onCustomEvent},clone:function(){return new
s(this._listenerID,this._onCustomEvent)}});var a=function()
{cc.EventListener.call(this,cc.EventListener.MOUSE,r.MOUSE,this._callback)};n.exten
d(a,cc.EventListener),n.mixin(a.prototype,
{onMouseDown:null,onMouseUp:null,onMouseMove:null,onMouseScroll:null,_callback:func
tion(t){var e=cc.Event.EventMouse;switch(t._eventType){case
e.DOWN:this.onMouseDown&&this.onMouseDown(t);break;case
e.UP:this.onMouseUp&&this.onMouseUp(t);break;case
e.MOVE:this.onMouseMove&&this.onMouseMove(t);break;case
e.SCROLL:this.onMouseScroll&&this.onMouseScroll(t)}},clone:function(){var t=new
a;return
t.onMouseDown=this.onMouseDown,t.onMouseUp=this.onMouseUp,t.onMouseMove=this.onMous
eMove,t.onMouseScroll=this.onMouseScroll,t},checkAvailable:function(){return!
0}});var o=function()
{cc.EventListener.call(this,cc.EventListener.TOUCH_ONE_BY_ONE,r.TOUCH_ONE_BY_ONE,nu
ll),this._claimedTouches=[]};n.extend(o,cc.EventListener),n.mixin(o.prototype,
{constructor:o,_claimedTouches:null,swallowTouches:!
1,onTouchBegan:null,onTouchMoved:null,onTouchEnded:null,onTouchCancelled:null,setSw
allowTouches:function(t){this.swallowTouches=t},isSwallowTouches:function(){return
this.swallowTouches},clone:function(){var t=new o;return
t.onTouchBegan=this.onTouchBegan,t.onTouchMoved=this.onTouchMoved,t.onTouchEnded=th
is.onTouchEnded,t.onTouchCancelled=this.onTouchCancelled,t.swallowTouches=this.swal
lowTouches,t},checkAvailable:function(){return!!this.onTouchBegan||
(cc.logID(1801),!1)}});var l=function()
{cc.EventListener.call(this,cc.EventListener.TOUCH_ALL_AT_ONCE,r.TOUCH_ALL_AT_ONCE,
null)};n.extend(l,cc.EventListener),n.mixin(l.prototype,
{constructor:l,onTouchesBegan:null,onTouchesMoved:null,onTouchesEnded:null,onTouche
sCancelled:null,clone:function(){var t=new l;return
t.onTouchesBegan=this.onTouchesBegan,t.onTouchesMoved=this.onTouchesMoved,t.onTouch
esEnded=this.onTouchesEnded,t.onTouchesCancelled=this.onTouchesCancelled,t},checkAv
ailable:function(){return null!==this.onTouchesBegan||null!==this.onTouchesMoved||
null!==this.onTouchesEnded||null!==this.onTouchesCancelled||(cc.logID(1802),!
1)}});var h=function(t)
{this._onAccelerationEvent=t,cc.EventListener.call(this,cc.EventListener.ACCELERATI
ON,r.ACCELERATION,this._callback)};n.extend(h,cc.EventListener),n.mixin(h.prototype
,{constructor:h,_onAccelerationEvent:null,_callback:function(t)
{this._onAccelerationEvent(t.acc,t)},checkAvailable:function(){return
cc.assertID(this._onAccelerationEvent,1803),!0},clone:function(){return new
h(this._onAccelerationEvent)}});var c=function()
{cc.EventListener.call(this,cc.EventListener.KEYBOARD,r.KEYBOARD,this._callback)};n
.extend(c,cc.EventListener),n.mixin(c.prototype,
{constructor:c,onKeyPressed:null,onKeyReleased:null,_callback:function(t)
{t.isPressed?
this.onKeyPressed&&this.onKeyPressed(t.keyCode,t):this.onKeyReleased&&this.onKeyRel
eased(t.keyCode,t)},clone:function(){var t=new c;return
t.onKeyPressed=this.onKeyPressed,t.onKeyReleased=this.onKeyReleased,t},checkAvailab
le:function(){return null!==this.onKeyPressed||null!==this.onKeyReleased||
(cc.logID(1800),!1)}}),cc.EventListener.create=function(t)
{cc.assertID(t&&t.event,1900);var e=t.event;delete t.event;var i=null;for(var n in
e===cc.EventListener.TOUCH_ONE_BY_ONE?i=new
o:e===cc.EventListener.TOUCH_ALL_AT_ONCE?i=new l:e===cc.EventListener.MOUSE?i=new
a:e===cc.EventListener.CUSTOM?(i=new s(t.eventName,t.callback),delete
t.eventName,delete t.callback):e===cc.EventListener.KEYBOARD?i=new
c:e===cc.EventListener.ACCELERATION&&(i=new h(t.callback),delete
t.callback),t)i[n]=t[n];return i},e.exports=cc.EventListener}),
{"../platform/js":220}],128:[(function(t,e,i){"use strict";var
n=t("../platform/js");t("./CCEventListener");var
r=cc.EventListener.ListenerID,s=function()
{this._fixedListeners=[],this._sceneGraphListeners=[],this.gt0Index=0};s.prototype=
{constructor:s,size:function(){return
this._fixedListeners.length+this._sceneGraphListeners.length},empty:function()
{return
0===this._fixedListeners.length&&0===this._sceneGraphListeners.length},push:functio
n(t){0===t._getFixedPriority()?
this._sceneGraphListeners.push(t):this._fixedListeners.push(t)},clearSceneGraphList
eners:function(){this._sceneGraphListeners.length=0},clearFixedListeners:function()
{this._fixedListeners.length=0},clear:function()
{this._sceneGraphListeners.length=0,this._fixedListeners.length=0},getFixedPriority
Listeners:function(){return
this._fixedListeners},getSceneGraphPriorityListeners:function(){return
this._sceneGraphListeners}};var a=function(t){var e=cc.Event,i=t.type;return
i===e.ACCELERATION?r.ACCELERATION:i===e.KEYBOARD?r.KEYBOARD:i.startsWith(e.MOUSE)?
r.MOUSE:
(i.startsWith(e.TOUCH)&&cc.logID(2e3),"")},o={DIRTY_NONE:0,DIRTY_FIXED_PRIORITY:1,D
IRTY_SCENE_GRAPH_PRIORITY:2,DIRTY_ALL:3,_listenersMap:{},_priorityDirtyFlagMap:
{},_nodeListenersMap:{},_nodePriorityMap:n.createMap(!0),_globalZOrderNodeMap:
[],_toAddedListeners:[],_toRemovedListeners:[],_dirtyNodes:
[],_inDispatch:0,_isEnabled:!1,_nodePriorityIndex:0,_internalCus
tomListenerIDs:[],_setDirtyForNode:function(t){if(void 0!
==this._nodeListenersMap[t._id]&&this._dirtyNodes.push(t),t.getChildren)for(var
e=t.getChildren(),i=0,n=e?e.length:0;i<n;i+
+)this._setDirtyForNode(e[i])},pauseTarget:function(t,e){if(t instanceof
cc._BaseNode){var
i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i+
+)r[i]._setPaused(!0);if(!0===e){var s=t.getChildren();for(i=0,n=s?
s.length:0;i<n;i++)this.pauseTarget(s[i],!0)}}else
cc.warnID(3506)},resumeTarget:function(t,e){if(t instanceof cc._BaseNode){var
i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i+
+)r[i]._setPaused(!1);if(this._setDirtyForNode(t),!0===e&&t.getChildren){var
s=t.getChildren();for(i=0,n=s?s.length:0;i<n;i++)this.resumeTarget(s[i],!0)}}else
cc.warnID(3506)},_addListener:function(t){0===this._inDispatch?
this._forceAddEventListener(t):this._toAddedListeners.push(t)},_forceAddEventListen
er:function(t){var e=t._getListenerID(),i=this._listenersMap[e];if(i||(i=new
s,this._listenersMap[e]=i),i.push(t),0===t._getFixedPriority())
{this._setDirty(e,this.DIRTY_SCENE_GRAPH_PRIORITY);var
n=t._getSceneGraphPriority();null===n&&cc.logID(3507),this._associateNodeAndEventLi
stener(n,t),n.activeInHierarchy&&this.resumeTarget(n)}else
this._setDirty(e,this.DIRTY_FIXED_PRIORITY)},_getListeners:function(t){return
this._listenersMap[t]},_updateDirtyFlagForSceneGraph:function(){if(0!
==this._dirtyNodes.length){for(var
t,e,i=this._dirtyNodes,n=this._nodeListenersMap,r=0,s=i.length;r<s;r+
+)if(t=n[i[r]._id])for(var a=0,o=t.length;a<o;a++)
(e=t[a])&&this._setDirty(e._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY);this._
dirtyNodes.length=0}},_removeAllListenersInVector:function(t){if(t)for(var
e,i=0;i<t.length;)(e=t[i])._setRegistered(!1),null!
=e._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(e._getSceneGraph
Priority(),e),e._setSceneGraphPriority(null)),0===this._inDispatch?
cc.js.array.remove(t,e):++i},_removeListenersForListenerID:function(t){var
e,i=this._listenersMap[t];if(i){var
n=i.getFixedPriorityListeners(),r=i.getSceneGraphPriorityListeners();this._removeAl
lListenersInVector(r),this._removeAllListenersInVector(n),delete
this._priorityDirtyFlagMap[t],this._inDispatch||(i.clear(),delete
this._listenersMap[t])}var s,a=this._toAddedListeners;for(e=0;e<a.length;)
(s=a[e])&&s._getListenerID()===t?cc.js.array.remove(a,s):+
+e},_sortEventListeners:function(t){var
e=this.DIRTY_NONE,i=this._priorityDirtyFlagMap;if(i[t]&&(e=i[t]),e!
==this.DIRTY_NONE&&(i[t]=this.DIRTY_NONE,e&this.DIRTY_FIXED_PRIORITY&&this._sortLis
tenersOfFixedPriority(t),e&this.DIRTY_SCENE_GRAPH_PRIORITY)){var
n=cc.director.getScene();n&&this._sortListenersOfSceneGraphPriority(t,n)}},_sortLis
tenersOfSceneGraphPriority:function(t,e){var i=this._getListeners(t);if(i){var
r=i.getSceneGraphPriorityListeners();r&&0!
==r.length&&(this._nodePriorityIndex=0,this._nodePriorityMap=n.createMap(!
0),this._visitTarget(e,!
0),i.getSceneGraphPriorityListeners().sort(this._sortEventListenersOfSceneGraphPrio
rityDes))}},_sortEventListenersOfSceneGraphPriorityDes:function(t,e){var
i=o._nodePriorityMap,n=t._getSceneGraphPriority(),r=e._getSceneGraphPriority();retu
rn e&&r&&i[r._id]?t&&n&&i[n._id]?i[r._id]-i[n._id]:1:-
1},_sortListenersOfFixedPriority:function(t){var e=this._listenersMap[t];if(e){var
i=e.getFixedPriorityListeners();if(i&&0!==i.length)
{i.sort(this._sortListenersOfFixedPriorityAsc);for(var n=0,r=i.length;n<r&&!
(i[n]._getFixedPriority()>=0);)+
+n;e.gt0Index=n}}},_sortListenersOfFixedPriorityAsc:function(t,e){return
t._getFixedPriority()-e._getFixedPriority()},_onUpdateListeners:function(t){var
e,i,n,r=t.getFixedPriorityListeners(),s=t.getSceneGraphPriorityListeners(),a=this._
toRemovedListeners;if(s)for(e=0;e<s.length;)(i=s[e])._isRegistered()?++e:
(cc.js.array.remove(s,i),-1!
==(n=a.indexOf(i))&&a.splice(n,1));if(r)for(e=0;e<r.length;)
(i=r[e])._isRegistered()?++e:(cc.js.array.remove(r,i),-1!
==(n=a.indexOf(i))&&a.splice(n,1));s&&0===s.length&&t.clearSceneGraphListeners(),r&
&0===r.length&&t.clearFixedListeners()},frameUpdateListeners:function(){var
t=this._listenersMap,e=this._priorityDirtyFlagMap;for(var i in
t)t[i].empty()&&(delete e[i],delete t[i]);var n=this._toAddedListeners;if(0!
==n.length){for(var r=0,s=n.length;r<s;r+
+)this._forceAddEventListener(n[r]);n.length=0}0!
==this._toRemovedListeners.length&&this._cleanToRemovedListeners()},_updateTouchLis
teners:function(t){var e=this._inDispatch;if(cc.assertID(e>0,3508),!(e>1)){var i;
(i=this._listenersMap[r.TOUCH_ONE_BY_ONE])&&this._onUpdateListeners(i),
(i=this._listenersMap[r.TOUCH_ALL_AT_ONCE])&&this._onUpdateListeners(i),cc.assertID
(1===e,3509);var n=this._toAddedListeners;if(0!==n.length){for(var
s=0,a=n.length;s<a;s+
+)this._forceAddEventListener(n[s]);this._toAddedListeners.length=0}0!
==this._toRemovedListeners.length&&this._cleanToRemovedListeners()}},_cleanToRemove
dListeners:function(){for(var t=this._toRemovedListeners,e=0;e<t.length;e++){var
i=t[e],n=this._listenersMap[i._getListenerID()];if(n){var
r,s=n.getFixedPriorityListeners(),a=n.getSceneGraphPriorityListeners();a&&-1!
==(r=a.indexOf(i))&&a.splice(r,1),s&&-1!
==(r=s.indexOf(i))&&s.splice(r,1)}}t.length=0},_onTouchEventCallback:function(t,e)
{if(!t._isRegistered())return!1;var
i=e.event,n=i.currentTouch;i.currentTarget=t._node;var r,s=!
1,a=i.getEventCode(),l=cc.Event.EventTouch;return a===l.BEGAN?
t.onTouchBegan&&(s=t.onTouchBegan(n,i))&&t._registered&&t._claimedTouches.push(n):t
._claimedTouches.length>0&&-1!==(r=t._claimedTouches.indexOf(n))&&(s=!
0,a===l.MOVED&&t.onTouchMoved?t.onTouchMoved(n,i):a===l.ENDED?
(t.onTouchEnded&&t.onTouchEnded(n,i),t._registered&&t._claimedTouches.splice(r,1)):
a===l.CANCELLED&&(t.onTouchCancelled&&t.onTouchCancelled(n,i),t._registered&&t._cla
imedTouches.splice(r,1))),i.isStopped()?(o._updateTouchListeners(i),!0):!(!s||!
t.swallowTouches)&&(e.needsMutableSet&&e.touches.splice(n,1),!
0)},_dispatchTouchEvent:function(t)
{this._sortEventListeners(r.TOUCH_ONE_BY_ONE),this._sortEventListeners(r.TOUCH_ALL_
AT_ONCE);var
e=this._getListeners(r.TOUCH_ONE_BY_ONE),i=this._getListeners(r.TOUCH_ALL_AT_ONCE);
if(null!==e||null!==i){var
n=t.getTouches(),s=cc.js.array.copy(n),a={event:t,needsMutableSet:e&&i,touches:s,se
lTouch:null};if(e)for(var o=0;o<n.length;o+
+)t.currentTouch=n[o],t._propagationStopped=t._propagationImmediateStopped=!
1,this._dispatchEventToListeners(e,this._onTouchEventCallback,a);i&&s.length>0&&(th
is._dispatchEventToListeners(i,this._onTouchesEventCallback,
{event:t,touches:s}),t.isStopped())||
this._updateTouchListeners(t)}},_onTouchesEventCallback:function(t,e){if(!
t._registered)return!1;var
i=cc.Event.EventTouch,n=e.event,r=e.touches,s=n.getEventCode();return
n.currentTarget=t._node,s===i.BEGAN&&t.onTouchesBegan?
t.onTouchesBegan(r,n):s===i.MOVED&&t.onTouchesMoved?
t.onTouchesMoved(r,n):s===i.ENDED&&t.onTouchesEnded?
t.onTouchesEnded(r,n):s===i.CANCELLED&&t.onTouchesCancelled&&t.onTouchesCancelled(r
,n),!!n.isStopped()&&(o._updateTouchListeners(n),!
0)},_associateNodeAndEventListener:function(t,e){var
i=this._nodeListenersMap[t._id];i||
(i=[],this._nodeListenersMap[t._id]=i),i.push(e)},_dissociateNodeAndEventListener:f
unction(t,e){var
i=this._nodeListenersMap[t._id];i&&(cc.js.array.remove(i,e),0===i.length&&delete
this._nodeListenersMap[t._id])},_dispatchEventToListeners:function(t,e,i){var
n,r,s=!
1,a=t.getFixedPriorityListeners(),o=t.getSceneGraphPriorityListeners(),l=0;if(a&&0!
==a.length)for(;l<t.gt0Index;++l)if((r=a[l]).isEnabled()&&!
r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}if(o&&!s)for(n=0;n<o.length;n+
+)if((r=o[n]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){s=!
0;break}if(a&&!s)for(;l<a.length;++l)if((r=a[l]).isEnabled()&&!
r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}},_setDirty:function(t,e){var
i=this._priorityDirtyFlagMap;null==i[t]?i[t]=e:i[t]=e|
i[t]},_visitTarget:function(t,e){t._reorderChildDirty&&t.sortAllChildren();var
i,n=t.getChildren(),r=0,s=n.length,a=this._globalZOrderNodeMap,o=this._nodeListener
sMap;if(s>0)for(void 0!==o[t._id]&&(a||(a=[]),a.push(t._id));r<s;r++)
(i=n[r])&&this._visitTarget(i,!1);else void 0!==o[t._id]&&(a||
(a=[]),a.push(t._id));if(e){for(var l=this._nodePriorityMap,h=0;h<a.length;h+
+)l[a[h]]=+
+this._nodePriorityIndex;this._globalZOrderNodeMap.length=0}},_sortNumberAsc:functi
on(t,e){return t-e},hasEventListener:function(t){return!!
this._getListeners(t)},addListener:function(t,e)
{if(cc.assertID(t&&e,3503),cc.js.isNumber(e)||e instanceof cc._BaseNode){if(t
instanceof cc.EventListener){if(t._isRegistered())return void cc.logID(3505)}else
cc.assertID(!
cc.js.isNumber(e),3504),t=cc.EventListener.create(t);if(t.checkAvailable())
{if(cc.js.isNumber(e)){if(0===e)return void
cc.logID(3500);t._setSceneGraphPriority(null),t._setFixedPriority(e),t._setRegister
ed(!0),t._setPaused(!1),this._addListener(t)}else
t._setSceneGraphPriority(e),t._setFixedPriority(0),t._setRegistered(!
0),this._addListener(t);return t}}else
cc.warnID(3506)},addCustomListener:function(t,e){var i=new
cc.EventListener.create({event:cc.EventListener.CUSTOM,eventName:t,callback:e});ret
urn this.addListener(i,1),i},removeListener:function(t){if(null!=t){var
e,i=this._listenersMap;for(var n in i){var
r=i[n],s=r.getFixedPriorityListeners(),a=r.getSceneGraphPriorityListeners();if((e=t
his._removeListenerInVector(a,t))?
this._setDirty(t._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY):
(e=this._removeListenerInVector(s,t))&&this._setDirty(t._getListenerID(),this.DIRTY
_FIXED_PRIORITY),r.empty()&&(delete
this._priorityDirtyFlagMap[t._getListenerID()],delete i[n]),e)break}if(!e)for(var
o=this._toAddedListeners,l=0,h=o.length;l<h;l++){var c=o[l];if(c===t)
{cc.js.array.remove(o,c),c._setRegistered(!
1);break}}}},_removeListenerInCallback:function(t,e){if(null==t)return!1;for(var
i=0,n=t.length;i<n;i++){var r=t[i];if(r._onCustomEvent===e||r._onEvent===e)return
r._setRegistered(!1),null!
=r._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(r._getSceneGraph
Priority(),r),r._setSceneGraphPriority(null)),0===this._inDispatc
h?cc.js.array.remove(t,r):this._toRemovedListeners.push(r),!0}return!
1},_removeListenerInVector:function(t,e){if(null==t)return!1;for(var
i=0,n=t.length;i<n;i++){var r=t[i];if(r===e)return r._setRegistered(!1),null!
=r._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(r._getSceneGraph
Priority(),r),r._setSceneGraphPriority(null)),0===this._inDispatch?
cc.js.array.remove(t,r):this._toRemovedListeners.push(r),!0}return!
1},removeListeners:function(t,e){var i=this;if(cc.js.isNumber(t)||t instanceof
cc._BaseNode)if(void 0!==t._id){delete
i._nodePriorityMap[t._id],cc.js.array.remove(i._dirtyNodes,t);var
n,s=i._nodeListenersMap[t._id];if(s){var
a=cc.js.array.copy(s);for(n=0;n<a.length;n++)i.removeListener(a[n]);delete
i._nodeListenersMap[t._id]}var o=i._toAddedListeners;for(n=0;n<o.length;){var
l=o[n];l._getSceneGraphPriority()===t?
(l._setSceneGraphPriority(null),l._setRegistered(!1),o.splice(n,1)):++n}if(!0===e)
{var h,c=t.getChildren();for(n=0,h=c.length;n<h;n++)i.removeListeners(c[n],!
0)}}else t===cc.EventListener.TOUCH_ONE_BY_ONE?
i._removeListenersForListenerID(r.TOUCH_ONE_BY_ONE):t===cc.EventListener.TOUCH_ALL_
AT_ONCE?
i._removeListenersForListenerID(r.TOUCH_ALL_AT_ONCE):t===cc.EventListener.MOUSE?
i._removeListenersForListenerID(r.MOUSE):t===cc.EventListener.ACCELERATION?
i._removeListenersForListenerID(r.ACCELERATION):t===cc.EventListener.KEYBOARD?
i._removeListenersForListenerID(r.KEYBOARD):cc.logID(3501);else
cc.warnID(3506)},removeCustomListeners:function(t)
{this._removeListenersForListenerID(t)},removeAllListeners:function(){var
t=this._listenersMap,e=this._internalCustomListenerIDs;for(var i in t)-
1===e.indexOf(i)&&this._removeListenersForListenerID(i)},setPriority:function(t,e)
{if(null!=t){var i=this._listenersMap;for(var n in i){var
r=i[n].getFixedPriorityListeners();if(r)if(-1!==r.indexOf(t))return null!
=t._getSceneGraphPriority()&&cc.logID(3502),void(t._getFixedPriority()!
==e&&(t._setFixedPriority(e),this._setDirty(t._getListenerID(),this.DIRTY_FIXED_PRI
ORITY)))}}},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return
this._isEnabled},dispatchEvent:function(t)
{if(this._isEnabled)if(this._updateDirtyFlagForSceneGraph(),this._inDispatch+
+,t&&t.getType){if(t.getType().startsWith(cc.Event.TOUCH))return
this._dispatchTouchEvent(t),void this._inDispatch--;var
e=a(t);this._sortEventListeners(e);var i=this._listenersMap[e];null!
=i&&(this._dispatchEventToListeners(i,this._onListenerCallback,t),this._onUpdateLis
teners(i)),this._inDispatch--}else
cc.errorID(3511)},_onListenerCallback:function(t,e){return
e.currentTarget=t._target,t._onEvent(e),e.isStopped()},dispatchCustomEvent:function
(t,e){var i=new
cc.Event.EventCustom(t);i.setUserData(e),this.dispatchEvent(i)}};n.get(cc,"eventMan
ager",(function(){return cc.warnID(1405,"cc.eventManager","cc.EventTarget or
cc.systemEvent"),o})),e.exports=o}),
{"../platform/js":220,"./CCEventListener":127}],129:[(function(t,e,i){"use
strict";cc.Touch=function(t,e,i)
{this._lastModified=0,this.setTouchInfo(i,t,e)},cc.Touch.prototype={constructor:cc.
Touch,getLocation:function(){return
cc.v2(this._point.x,this._point.y)},getLocationX:function(){return
this._point.x},getLocationY:function(){return
this._point.y},getPreviousLocation:function(){return
cc.v2(this._prevPoint.x,this._prevPoint.y)},getStartLocation:function(){return
cc.v2(this._startPoint.x,this._startPoint.y)},getDelta:function(){return
this._point.sub(this._prevPoint)},getLocationInView:function(){return
cc.v2(this._point.x,cc.view._designResolutionSize.height-
this._point.y)},getPreviousLocationInView:function(){return
cc.v2(this._prevPoint.x,cc.view._designResolutionSize.height-
this._prevPoint.y)},getStartLocationInView:function(){return
cc.v2(this._startPoint.x,cc.view._designResolutionSize.height-
this._startPoint.y)},getID:function(){return this._id},setTouchInfo:function(t,e,i)
{this._prevPoint=this._point,this._point=cc.v2(e||0,i||
0),this._id=t,this._startPointCaptured||
(this._startPoint=cc.v2(this._point),cc.view._convertPointWithScale(this._startPoin
t),this._startPointCaptured=!0)},_setPoint:function(t,e){void 0===e?
(this._point.x=t.x,this._point.y=t.y):
(this._point.x=t,this._point.y=e)},_setPrevPoint:function(t,e){this._prevPoint=void
0===e?cc.v2(t.x,t.y):cc.v2(t||0,e||0)}}}),{}],130:[(function(t,e,i){"use
strict";t("./CCEvent"),t("./CCTouch"),t("./CCEventListener");var
n=t("./CCEventManager");e.exports=n}),
{"./CCEvent":126,"./CCEventListener":127,"./CCEventManager":128,"./CCTouch":129}],1
31:[(function(t,e,i){"use strict";var n=cc.js,r=t("../platform/callbacks-
invoker").CallbacksHandler;function s()
{r.call(this)}n.extend(s,r),s.prototype.invoke=function(t,e){var
i=t.type,n=this._callbackTable[i];if(n){var r=!n.isInvoking;n.isInvoking=!0;for(var
s=n.callbacks,a=n.targets,o=0,l=s.length;o<l;++o){var h=s[o];if(h){var c=a[o]||
t.currentTarget;if(h.call(c,t,e),t._propagationImmediateStopped)break}}r&&(n.isInvo
king=!1,n.containCanceled&&n.purgeCanceled())}},e.exports=s}),
{"../platform/callbacks-invoker":213}],132:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/callbacks-
invoker"),s=n.array.fastRemove;function a(){r.call(this)}n.extend(a,r);var
o=a.prototype;o.on=function(t,e,i){if(e)return this.hasEventListener(t,e,i)||
(this.add(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e;cc.errorID(680
0)},o.off=function(t,e,i){e?
(this.remove(t,e,i),i&&i.__eventTargets&&s(i.__eventTargets,this)):this.removeAll(t
)},o.targetOff=o.removeAll,o.once=function(t,e,i){var n="__ONCE_FLAG:"+t;if(!
this.hasEventListener(n,e,i)){var r=this;this.on(t,(function s(a,o,l,h,c)
{r.off(t,s,i),r.remove(n,e,i),e.call(this,a,o,l,h,c)}),i),this.add(n,e,i)}},o.emit=
r.prototype.invoke,o.dispatchEvent=function(t)
{this.invoke(t.type,t)},cc.EventTarget=e.exports=a}),{"../platform/callbacks-
invoker":213,"../platform/js":220}],133:[(function(t,e,i){"use strict";var
n=t("../platform/js");cc.Event=function(t,e){this.type=t,this.bubbles=!!
e,this.target=null,this.currentTarget=null,this.eventPhase=0,this._propagationStopp
ed=!1,this._propagationImmediateStopped=!
1},cc.Event.prototype={constructor:cc.Event,unuse:function()
{this.type=cc.Event.NO_TYPE,this.target=null,this.currentTarget=null,this.eventPhas
e=cc.Event.NONE,this._propagationStopped=!1,this._propagationImmediateStopped=!
1},reuse:function(t,e){this.type=t,this.bubbles=e||!1},stopPropagation:function()
{this._propagationStopped=!0},stopPropagationImmediate:function()
{this._propagationImmediateStopped=!0},isStopped:function(){return
this._propagationStopped||
this._propagationImmediateStopped},getCurrentTarget:function(){return
this.currentTarget},getType:function(){return
this.type}},cc.Event.NO_TYPE="no_type",cc.Event.TOUCH="touch",cc.Event.MOUSE="mouse
",cc.Event.KEYBOARD="keyboard",cc.Event.ACCELERATION="acceleration",cc.Event.NONE=0
,cc.Event.CAPTURING_PHASE=1,cc.Event.AT_TARGET=2,cc.Event.BUBBLING_PHASE=3;var
r=function(t,e)
{cc.Event.call(this,t,e),this.detail=null};n.extend(r,cc.Event),r.prototype.reset=r
,r.prototype.setUserData=function(t)
{this.detail=t},r.prototype.getUserData=function(){return
this.detail},r.prototype.getEventName=cc.Event.prototype.getType;var s=new
n.Pool(10);r.put=function(t){s.put(t)},r.get=function(t,e){var i=s._get();return i?
i.reset(t,e):i=new r(t,e),i},cc.Event.EventCustom=r,e.exports=cc.Event}),
{"../platform/js":220}],134:[(function(t,e,i){"use strict";t("./event"),t("./event-
listeners"),t("./event-target"),t("./system-event")}),{"./event":133,"./event-
listeners":131,"./event-target":132,"./system-event":135}],135:[(function(t,e,i)
{"use strict";var n=t("../event/event-target"),r=t("../event-
manager"),s=t("../platform/CCInputManager"),a=cc.Enum({KEY_DOWN:"keydown",KEY_UP:"k
eyup",DEVICEMOTION:"devicemotion"}),o=null,l=null,h=cc.Class({name:"SystemEvent",ex
tends:n,statics:{EventType:a},setAccelerometerEnabled:function(t)
{s.setAccelerometerEnabled(t)},setAccelerometerInterval:function(t)
{s.setAccelerometerInterval(t)},on:function(t,e,i){this._super(t,e,i),t!
==a.KEY_DOWN&&t!==a.KEY_UP||(o||
(o=cc.EventListener.create({event:cc.EventListener.KEYBOARD,onKeyPressed:function(t
,e){e.type=a.KEY_DOWN,cc.systemEvent.dispatchEvent(e)},onKeyReleased:function(t,e)
{e.type=a.KEY_UP,cc.systemEvent.dispatchEvent(e)}})),r.hasEventListener(cc.EventLis
tener.ListenerID.KEYBOARD)||r.addListener(o,1)),t===a.DEVICEMOTION&&(l||
(l=cc.EventListener.create({event:cc.EventListener.ACCELERATION,callback:function(t
,e)
{e.type=a.DEVICEMOTION,cc.systemEvent.dispatchEvent(e)}})),r.hasEventListener(cc.Ev
entListener.ListenerID.ACCELERATION)||r.addListener(l,1))},off:function(t,e,i)
{if(this._super(t,e,i),o&&(t===a.KEY_DOWN||t===a.KEY_UP)){var
n=this.hasEventListener(a.KEY_DOWN),s=this.hasEventListener(a.KEY_UP);n||s||
r.removeListener(o)}l&&t===a.DEVICEMOTION&&r.removeListener(l)}});cc.SystemEvent=e.
exports=h,cc.systemEvent=new cc.SystemEvent}),{"../event-
manager":130,"../event/event-target":132,"../platform/CCInputManager":204}],136:
[(function(t,e,i){"use strict";var
n=cc.vmath.vec3,r=cc.vmath.mat3,s=n.create(),a=n.create(),o=r.create(),l=function(t
,e,i)
{o.m00=Math.abs(i.m00),o.m01=Math.abs(i.m01),o.m02=Math.abs(i.m02),o.m03=Math.abs(i
.m04),o.m04=Math.abs(i.m05),o.m05=Math.abs(i.m06),o.m06=Math.abs(i.m08),o.m07=Math.
abs(i.m09),o.m08=Math.abs(i.m10),n.transformMat3(t,e,o)};function h(t,e,i,r,s,a)
{this.center=n.create(t,e,i),this.halfExtents=n.create(r,s,a)}var
c=h.prototype;c.getBoundary=function(t,e)
{n.sub(t,this.center,this.halfExtents),n.add(e,this.center,this.halfExtents)},c.tra
nsform=function(t,e,i,r,s){s||
(s=this),n.transformMat4(s.center,this.center,t),l(s.halfExtents,this.halfExtents,t
)},h.create=function(t,e,i,n,r,s){return new h(t,e,i,n,r,s)},h.clone=function(t)
{return new
h(t.center.x,t.center.y,t.center.z,t.halfExtents.x,t.halfExtents.y,t.halfExtents.z)
},h.copy=function(t,e){return
n.copy(t.center,e.center),n.copy(t.halfExtents,e.halfExtents),t},h.fromPoints=funct
ion(t,e,i){return

n.scale(t.center,n.add(s,e,i),.5),n.scale(t.halfExtents,n.sub(a,i,e),.5),t},h.set=f
unction(t,e,i,r,s,a,o){return
n.set(t.center,e,i,r),n.set(t.halfExtents,s,a,o),t},e.exports=h}),{}],137:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),cc.geomUtils={Triangle:t("./triangle"),Aabb:t("./aabb"),Ray:t("./ray"),intersec
t:t("./intersect")},i.default=cc.geomUtils,e.exports=i.default}),
{"./aabb":136,"./intersect":138,"./ray":139,"./triangle":140}],138:
[(function(t,e,i){"use strict";var
n=s(t("../../renderer/gfx")),r=s(t("../../renderer/memop/recycle-pool"));function
s(t){return t&&t.__esModule?t:{default:t}}var
a=t("./aabb"),o=t("./ray"),l=t("./triangle"),h=cc.vmath.mat4,c=cc.vmath.vec3,u={};u
.rayAabb=(function(){var t=c.create(),e=c.create();return function(i,n){var
r=i.o,s=i.d,a=1/s.x,o=1/s.y,l=1/s.z;c.sub(t,n.center,n.halfExtents),c.add(e,n.cente
r,n.halfExtents);var h=(t.x-r.x)*a,u=(e.x-r.x)*a,_=(t.y-r.y)*o,f=(e.y-
r.y)*o,d=(t.z-r.z)*l,m=(e.z-
r.z)*l,p=Math.max(Math.max(Math.min(h,u),Math.min(_,f)),Math.min(d,m)),v=Math.min(M
ath.min(Math.max(h,u),Math.max(_,f)),Math.max(d,m));return v<0||p>v?0:p}})
(),u.rayTriangle=(function(){var
t=c.create(0,0,0),e=c.create(0,0,0),i=c.create(0,0,0),n=c.create(0,0,0),r=c.create(
0,0,0);return function(s,a){c.sub(t,a.b,a.a),c.sub(e,a.c,a.a),c.cross(i,s.d,e);var
o=c.dot(t,i);if(o<=0)return 0;c.sub(n,s.o,a.a);var l=c.dot(n,i);if(l<0||l>o)return
0;c.cross(r,n,t);var h=c.dot(s.d,r);if(h<0||l+h>o)return 0;var
u=c.dot(e,r)/o;return u<0?0:u}})(),u.rayMesh=(function(){var
t=l.create(),e=1/0,i={5120:"getInt8",5121:"getUint8",5122:"getInt16",5123:"getUint1
6",5124:"getInt32",5125:"getUint32",5126:"getFloat32"},r=(function(){var t=new
ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)
[0]})();function s(t,e,i,n,s){c.set(t,e[i](s,r),e[i](s+=n,r),e[i](s+=n,r))}return
function(r,a){e=1/0;for(var o=a._subMeshes,l=0;l<o.length;l+
+)if(o[l]._primitiveType===n.default.PT_TRIANGLES)for(var h=a._vbs[l]||
a._vbs[0],c=h.data,_=new
DataView(c.buffer,c.byteOffset,c.byteLength),f=a._ibs[l].data,d=h.buffer._format.el
ement(n.default.ATTR_POSITION),m=d.offset,p=d.stride,v=i[d.type],y=0;y<f.length;y+=
3){s(t.a,_,v,4,f[y]*p+m),s(t.b,_,v,4,f[y+1]*p+m),s(t.c,_,v,4,f[y+2]*p+m);var
g=u.rayTriangle(r,t);g>0&&g<e&&(e=g)}return e}})(),u.raycast=(function(){function
t(e,i){for(var n=e.children,r=n.length-1;r>=0;r--){t(n[r],i)}i(e)}function e(t,e)
{return t.distance-e.distance}function i(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.m03*n+i.m07*r+i.m11*s;return a=a?
1/a:1,t.x=(i.m00*n+i.m04*r+i.m08*s)*a,t.y=(i.m01*n+i.m05*r+i.m09*s)*a,t.z=(i.m02*n+
i.m06*r+i.m10*s)*a,t}var n=new r.default(function()
{return{distance:0,node:null}},1),s=[],l=a.create(),_=c.create(),f=c.create(),d=o.c
reate(),m=h.create(),p=h.create(),v=c.create();function y(t){return
t>0&&t<1/0}return function(r,o,g,x){return n.reset(),s.length=0,t(r=r||
cc.director.getScene(),(function(t){if(!x||x(t))
{h.invert(p,t.getWorldMatrix(m)),c.transformMat4(d.o,o.o,p),c.normalize(d.d,i(d.d,o
.d,p));var e=1/0,r=t._renderComponent;if(r&&r._boundingBox?
e=u.rayAabb(d,r._boundingBox):t.width&&t.height&&(c.set(_,-t.width*t.anchorX,-
t.height*t.anchorY,t.z),c.set(f,t.width*(1-t.anchorX),t.height*(1-
t.anchorY),t.z),a.fromPoints(l,_,f),e=u.rayAabb(d,l)),y(e)&&(g&&(e=g(d,t,e)),y(e)))
{c.set(v,e,0,0),i(v,v,m);var
b=n.add();b.node=t,b.distance=cc.vmath.vec3.mag(v),s.push(b)}}})),s.sort(e),s}})
(),e.exports=u}),{"../../renderer/gfx":348,"../../renderer/memop/recycle-
pool":363,"./aabb":136,"./ray":139,"./triangle":140}],139:[(function(t,e,i){"use
strict";var n=cc.vmath.vec3;function r(t,e,i,r,s,a)
{this.o=n.create(t,e,i),this.d=n.create(r,s,a)}r.create=function(t,e,i,n,s,a)
{return new r(t,e,i,n,s,a)},r.clone=function(t){return new
r(t.o.x,t.o.y,t.o.z,t.d.x,t.d.y,t.d.z)},r.copy=function(t,e){return
t.o.x=e.o.x,t.o.y=e.o.y,t.o.z=e.o.z,t.d.x=e.d.x,t.d.y=e.d.y,t.d.z=e.d.z,t},r.set=fu
nction(t,e,i,n,r,s,a){return
t.o.x=e,t.o.y=i,t.o.z=n,t.d.x=r,t.d.y=s,t.d.z=a,t},r.fromPoints=function(t,e,i)
{return n.copy(t.o,e),n.normalize(t.d,n.sub(t.d,i,e)),t},e.exports=r}),{}],140:
[(function(t,e,i){"use strict";var n=cc.vmath.vec3;function r(t,e,i,r,s,a,o,l,h)
{this.a=n.create(t,e,i),this.b=n.create(r,s,a),this.c=n.create(o,l,h)}r.create=func
tion(t,e,i,n,s,a,o,l,h){return new r(t,e,i,n,s,a,o,l,h)},r.clone=function(t){return
new r(t.a.x,t.a.y,t.a.z,t.b.x,t.b.y,t.b.z,t.c.x,t.c.y,t.c.z)},r.copy=function(t,e)
{return
n.copy(t.a,e.a),n.copy(t.b,e.b),n.copy(t.c,e.c),t},r.fromPoints=function(t,e,i,r)
{return
n.copy(t.a,e),n.copy(t.b,i),n.copy(t.c,r),t},r.set=function(t,e,i,n,r,s,a,o,l,h)
{return
t.a.x=e,t.a.y=i,t.a.z=n,t.b.x=r,t.b.y=s,t.b.z=a,t.c.x=o,t.c.y=l,t.c.z=h,t},e.export
s=r}),{}],141:[(function(t,e,i){"use strict";var
n=t("../components/CCRenderComponent"),r=t("../assets/material/CCMaterial"),s=t("./
types"),a=s.LineCap,o=s.LineJoin,l=cc.Class({name:"cc.Graphics",extends:n,editor:!
1,ctor:function(){this._impl=l._assembler.createImpl(this)},properties:
{_lineWidth:1,_strokeColor:cc.Color.BLACK,_lineJoin:o.MITER,_lineCap:a.BUTT,_fillCo
lor:cc.Color.WHITE,_miterLimit:10,lineWidth:{get:function(){return
this._lineWidth},set:function(t)
{this._lineWidth=t,this._impl.lineWidth=t}},lineJoin:{get:function(){return
this._lineJoin},set:function(t)
{this._lineJoin=t,this._impl.lineJoin=t},type:o},lineCap:{get:function(){return
this._lineCap},set:function(t)
{this._lineCap=t,this._impl.lineCap=t},type:a},strokeColor:{get:function(){return
this._strokeColor},set:function(t)
{this._impl.strokeColor=this._strokeColor=cc.color(t)}},fillColor:{get:function()
{return this._fillColor},set:function(t)
{this._impl.fillColor=this._fillColor=cc.color(t)}},miterLimit:{get:function()
{return this._miterLimit},set:function(t)
{this._miterLimit=t,this._impl.miterLimit=t}}},statics:
{LineJoin:o,LineCap:a},onRestore:function(){this._impl||
(this._impl=l._assembler.createImpl())},onEnable:function()
{this._super(),this._activateMaterial()},onDestroy:function()
{this._super(),this._impl.clear(this,!
0),this._impl=null},_activateMaterial:function(){if(cc.game.renderType!
==cc.game.RENDER_TYPE_CANVAS)
{if(this.node._renderFlag&=~cc.RenderFlow.FLAG_RENDER,this.node._renderFlag|
=cc.RenderFlow.FLAG_CUSTOM_IA_RENDER,!this.sharedMaterials[0]){var
t=r.getInstantiatedBuiltinMaterial("sprite",this);t.define("_USE_MODEL",!
0),this.setMaterial(0,t)}}else this.disableRender()},moveTo:function(t,e)
{this._impl.moveTo(t,e)},lineTo:function(t,e)
{this._impl.lineTo(t,e)},bezierCurveTo:function(t,e,i,n,r,s)
{this._impl.bezierCurveTo(t,e,i,n,r,s)},quadraticCurveTo:function(t,e,i,n)
{this._impl.quadraticCurveTo(t,e,i,n)},arc:function(t,e,i,n,r,s)
{this._impl.arc(t,e,i,n,r,s)},ellipse:function(t,e,i,n)
{this._impl.ellipse(t,e,i,n)},circle:function(t,e,i)
{this._impl.circle(t,e,i)},rect:function(t,e,i,n)
{this._impl.rect(t,e,i,n)},roundRect:function(t,e,i,n,r)
{this._impl.roundRect(t,e,i,n,r)},fillRect:function(t,e,i,n)
{this.rect(t,e,i,n),this.fill()},clear:function(t)
{this._impl.clear(this,t)},close:function(){this._impl.close()},stroke:function()
{l._assembler.stroke(this)},fill:function()
{l._assembler.fill(this)}});cc.Graphics=e.exports=l}),
{"../assets/material/CCMaterial":75,"../components/CCRenderComponent":106,"./types"
:144}],142:[(function(t,e,i){"use strict";var
n=t("./types").PointFlags,r=Math.PI,s=Math.min,a=Math.max,o=Math.cos,l=Math.sin,h=M
ath.abs,c=Math.sign,u=.5522847493;e.exports={arc:function(t,e,i,n,c,u,_){var
f,d,m,p=0,v=0,y=0,g=0,x=0,b=0,A=0,C=0,S=0,T=0,w=0,E=0,M=0;if(v=u-c,_=_||!
1)if(h(v)>=2*r)v=2*r;else for(;v<0;)v+=2*r;else if(h(v)>=2*r)v=2*-r;else
for(;v>0;)v-=2*r;for(m=0|a(1,s(h(v)/(.5*r)+.5,5)),y=h(4/3*(1-o(f=v/m/2))/l(f)),_||
(y=-y),d=0;d<=m;d++)b=e+(g=o(p=c+v*(d/m)))*n,A=i+(x=l(p))*n,C=-x*n*y,S=g*n*y,0===d?
t.moveTo(b,A):t.bezierCurveTo(T+E,w+M,b-C,A-
S,b,A),T=b,w=A,E=C,M=S},ellipse:function(t,e,i,n,r){t.moveTo(e-
n,i),t.bezierCurveTo(e-n,i+r*u,e-
n*u,i+r,e,i+r),t.bezierCurveTo(e+n*u,i+r,e+n,i+r*u,e+n,i),t.bezierCurveTo(e+n,i-
r*u,e+n*u,i-r,e,i-r),t.bezierCurveTo(e-n*u,i-r,e-n,i-r*u,e-
n,i),t.close()},roundRect:function(t,e,i,n,r,a){if(a<.1)t.rect(e,i,n,r);else{var
o=s(a,.5*h(n))*c(n),l=s(a,.5*h(r))*c(r);t.moveTo(e,i+l),t.lineTo(e,i+r-
l),t.bezierCurveTo(e,i+r-l*(1-u),e+o*(1-u),i+r,e+o,i+r),t.lineTo(e+n-
o,i+r),t.bezierCurveTo(e+n-o*(1-u),i+r,e+n,i+r-l*(1-u),e+n,i+r-
l),t.lineTo(e+n,i+l),t.bezierCurveTo(e+n,i+l*(1-u),e+n-o*(1-u),i,e+n-
o,i),t.lineTo(e+o,i),t.bezierCurveTo(e+o*(1-u),i,e,i+l*(1-
u),e,i+l),t.close()}},tesselateBezier:function t(e,i,r,s,a,o,l,c,u,_,f){var
d,m,p,v,y,g,x,b,A,C,S,T,w,E,M,D;_>10||(y=.5*(o+c),g=.5*(l+u),x=.5*((d=.5*(i+s))+
(p=.5*(s+o))),b=.5*((m=.5*(r+a))+(v=.5*(a+l))),((M=h((s-c)*(E=u-r)-(a-u)*(w=c-i)))+
(D=h((o-c)*E-(l-u)*w)))*(M+D)<e._tessTol*(w*w+E*E)?e._addPoint(c,u,0===f?f|
n.PT_BEVEL:f):(t(e,i,r,d,m,x,b,S=.5*(x+(A=.5*(p+y))),T=.5*(b+
(C=.5*(v+g))),_+1,0),t(e,S,T,A,C,y,g,c,u,_+1,f)))}}}),{"./types":144}],143:
[(function(t,e,i){"use strict";t("./graphics")}),{"./graphics":141}],144:
[(function(t,e,i){"use strict";var
n=cc.Enum({BUTT:0,ROUND:1,SQUARE:2}),r=cc.Enum({BEVEL:0,ROUND:1,MITER:2}),s=cc.Enum
({PT_CORNER:1,PT_LEFT:2,PT_BEVEL:4,PT_INNERBEVEL:8});e.exports={LineCap:n,LineJoin:
r,PointFlags:s}}),{}],145:[(function(t,e,i){"use
strict";t("./platform"),t("./assets"),t("./CCNode"),t("./CCPrivateNode"),t("./CCSce
ne"),t("./components"),t("./graphics"),t("./collider"),t("./collider/CCIntersection
"),t("./physics"),t("./camera/CCCamera"),t("./geom-
utils"),t("./mesh"),t("./3d"),t("./3d/polyfill-3d"),t("./base-
ui/CCWidgetManager")}),{"./3d":29,"./3d/polyfill-
3d":30,"./CCNode":52,"./CCPrivateNode":53,"./CCScene":54,"./assets":74,"./base-
ui/CCWidgetManager":79,"./camera/CCCamera":80,"./collider":88,"./collider/CCInterse
ction":86,"./components":124,"./geom-
utils":137,"./graphics":143,"./mesh":168,"./physics":183,"./platform":217}],146:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js"),s=t("./pipeline"),a=t("./loading-items"),o=t("./asset-
loader"),l=t("./downloader"),h=t("./loader"),c=t("./asset-
table"),u=t("../platform/utils").callInNextTick,_=t("./auto-release-
utils"),f=Object.create(null);f.assets=new c,f.internal=new c;var d={url:null,raw:!
1};function m(t){var e,i,r;if("object"===(void 0===t?"undefined":n(t)))
{if(i=t,t.url)return i;e=t.uuid}else i={},e=t;return
r=i.type?"uuid"===i.type:cc.AssetLibrary._uuidInSettings(e),cc.AssetLibrary._getAss
etInfoInRuntime(e,d),i.url=r?d.url:e,d.url&&"uuid"===i.type&&d.raw?
(i.type=null,i.isRawAsset=!0):r||(i.isRawAsset=!0),i}var p=[],v=[];function y(){var
t=new o,e=new l,i=new h;s.call(this,
[t,e,i]),this.assetLoader=t,this.md5Pipe=null,this.downloader=e,this.loader=i,this.
onProgress=null,this._autoReleaseSetting=r.createMap(!0)}r.extend(y,s);var
g=y.prototype;g.init=function(t){},g.getXMLHttpRequest=function(){return
window.XMLHttpRequest?new window.XMLHttpRequest:new
ActiveXObject("MSXML2.XMLHTTP")},g.addDownloadHandlers=function(t)
{this.downloader.addHandlers(t)},g.addLoadHandlers=function(t)
{this.loader.addHandlers(t)},g.load=function(t,e,i){void
0===i&&(i=e,e=this.onProgress||null);var n,r=this,s=!1;t instanceof Array||(t?(s=!
0,t=[t]):t=[]),p.length=0;for(var o=0;o<t.length;++o){var
l=t[o];if(l&&l.id&&(cc.warnID(4920,l.id),l.uuid||l.url||(l.url=l.id)),
(n=m(l)).url||n.uuid){var h=this._cache[n.url];p.push(h||n)}}var c=a.create(this,e,
(function(t,e){u((function(){if(i){if(s){var
a=n.url;i.call(r,t,e.getContent(a))}else
i.call(r,t,e);i=null}e.destroy()}))}));a.initQueueDeps(c),c.append(p),p.length=0},g
.flowInDeps=function(t,e,i){v.length=0;for(var n=0;n<e.length;++n){var
r=m(e[n]);if(r.url||r.uuid){var s=this._cache[r.url];s?v.push(s):v.push(r)}}var
o=a.create(this,t?function(t,e,i)
{this._ownerQueue&&this._ownerQueue.onProgress&&this._ownerQueue._childOnProgress(i
)}:null,(function(e,n){i(e,n),t&&t.deps&&(t.deps.length=0),n.destroy()}));if(t){var
l=a.getQueue(t);o._ownerQueue=l._ownerQueue||l}var h=o.append(v,t);return
v.length=0,h},g._assetTables=f,g._getResUuid=function(t,e,i,n){var
r=f[i=i||"assets"];if(!t||!r)return null;var s=t.indexOf("?");-1!
==s&&(t=t.substr(0,s));var a=r.getUuid(t,e);if(!a){var
o=cc.path.extname(t);o&&(t=t.slice(0,-o.length),(a=r.getUuid(t,e))&&!
n&&cc.warnID(4901,t,o))}return a},g._getReferenceKey=function(t){var
e;return"object"===(void 0===t?"undefined":n(t))?e=t._uuid||null:"string"==typeof
t&&(e=this._getResUuid(t,null,null,!0)||t),e?
(cc.AssetLibrary._getAssetInfoInRuntime(e,d),this._cache[d.url]?d.url:e):
(cc.warnID(4800,t),e)},g._urlNotFound=function(t,e,i){u((function()
{t=cc.url.normalize(t);var n=(e?r.getClassName(e):"Asset")+' in "resources/'+t+'"
does not exist.';i&&i(new Error(n),[])}))},g._parseLoadResArgs=function(t,e,i)
{if(void 0===i){var n=t instanceof Array||r.isChildClassOf(t,cc.RawAsset);e?
(i=e,n&&(e=this.onProgress||null)):void 0!==e||n||(i=t,e=this.onProgress||
null,t=null),void 0===e||n||
(e=t,t=null)}return{type:t,onProgress:e,onComplete:i}},g.loadRes=function(t,e,i,n,r
){5!==arguments.length&&(r=n,n=i,i="assets");var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;var
a=this,o=a._getResUuid(t,e,i);o?this.load({type:"uuid",uuid:o},n,(function(t,e)
{e&&a.setAutoReleaseRecursively(o,!
1),r&&r(t,e)})):a._urlNotFound(t,e,r)},g._loadResUuids=function(t,e,i,n)
{if(t.length>0){var r=this,s=t.map((function(t)
{return{type:"uuid",uuid:t}}));this.load(s,e,(function(t,e){if(i){for(var
a=[],o=n&&[],l=0;l<s.length;++l){var
h=s[l].uuid,c=this._getReferenceKey(h),u=e.getContent(c);u&&(r.setAutoReleaseRecurs
ively(h,!1),a.push(u),o&&o.push(n[l]))}n?i(t,a,o):i(t,a)}}))}else i&&u((function()
{n?i(null,[],[]):i(null,[])}))},g.loadResArray=function(t,e,i,n,r){5!
==arguments.length&&(r=n,n=i,i="assets");var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;for(var
a=[],o=e instanceof Array,l=0;l<t.length;l++){var h=t[l],c=o?
e[l]:e,u=this._getResUuid(h,c,i);if(!u)return void
this._urlNotFound(h,c,r);a.push(u)}this._loadResUuids(a,n,r)},g.loadResDir=function
(t,e,i,n,r){if(5!==arguments.length&&(r=n,n=i,i="assets"),f[i]){var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;var
a=[],o=f[i].getUuidArray(t,e,a);this._loadResUuids(o,n,r,a)}},g.getRes=function(t,e
){var i=this._cache[t];if(!i){var n=this._getResUuid(t,e,null,!0);if(!n)return
null;var r=this._getReferenceKey(n);i=this._cache[r]}return
i&&i.alias&&(i=i.alias),i&&i.complete?i.content:null},g.getResCount=function()
{return Object.keys(this._cache).length},g.getDependsRecursively=function(t){if(t)
{var e=this._getReferenceKey(t),i=_.getDependsRecursively(e);return
i.push(e),i}return[]},g.release=function(t){if(Array.isArray(t))for(var
e=0;e<t.length;e++){var i=t[e];this.release(i)}else if(t){var
n=this._getReferenceKey(t),r=this.getItem(n);if(r)
{this.removeItem(n);if((t=r.content)instanceof cc.Asset){var
s=t.nativeUrl;s&&this.release(s),t.destroy()}0}}},g.releaseAsset=function(t){var
e=t._uuid;e&&this.release(e)},g.releaseRes=function(t,e,i){var
n=this._getResUuid(t,e,i);n?
this.release(n):cc.errorID(4914,t)},g.releaseResDir=function(t,e,i)
{if(f[i=i||"assets"])for(var n=f[i].getUuidArray(t,e),r=0;r<n.length;r++){var
s=n[r];this.release(s)}},g.releaseAll=function(){for(var t in
this._cache)this.release(t)},g.removeItem=function(t){var
e=s.prototype.removeItem.call(this,t);return delete
this._autoReleaseSetting[t],e},g.setAutoRelease=function(t,e){var
i=this._getReferenceKey(t);i&&(this._autoReleaseSetting[i]=!!
e)},g.setAutoReleaseRecursively=function(t,e){e=!!e;var
i=this._getReferenceKey(t);if(i){this._autoReleaseSetting[i]=e;for(var
n=_.getDependsRecursively(i),r=0;r<n.length;r++){var
s=n[r];this._autoReleaseSetting[s]=e}}else 0},g.isAutoRelease=function(t){var
e=this._getReferenceKey(t);return!!e&&!!this._autoReleaseSetting[e]},cc.loader=new
y,e.exports=cc.loader}),{"../platform/js":220,"../platform/utils":224,"./asset-
loader":147,"./asset-table":148,"./auto-release-
utils":150,"./downloader":152,"./loader":155,"./loading-
items":156,"./pipeline":159,"./released-asset-checker":160}],147:[(function(t,e,i)
{"use strict";t("../utils/CCPath");var
n=t("../CCDebug"),r=t("./pipeline"),s=t("./loading-
items"),a="AssetLoader",o=function(t){this.id=a,this.async=!
0,this.pipeline=null};o.ID=a;var l=[];o.prototype.handle=function(t,e){var
i=t.uuid;if(!i)return t.content||null;cc.AssetLibrary.queryAssetInfo(i,
(function(r,a,o){if(r)e(r);else if(t.url=t.rawUrl=a,t.isRawAsset=o,o){var
h=cc.path.extname(a).toLowerCase();if(!h)return void e(new
Error(n.getError(4931,i,a)));h=h.substr(1);var
c=s.getQueue(t);l[0]={queueId:t.queueId,id:a,url:a,type:h,error:null,alias:t,comple
te:!0},c.append(l),t.type=h,e(null,t.content)}else
t.type="uuid",e(null,t.content)}))},r.AssetLoader=e.exports=o}),
{"../CCDebug":49,"../utils/CCPath":284,"./loading-
items":156,"./pipeline":159}],148:[(function(t,e,i){"use strict";var
n=t("../utils/misc").pushToMap,r=t("../platform/js");function s(t,e)
{this.uuid=t,this.type=e}function a(){this._pathToUuid=r.createMap(!0)}function
o(t,e){if(t.length>e.length){var i=t.charCodeAt(e.length);return 46===i||
47===i}return!0}var l=a.prototype;l.getUuid=function(t,e){t=cc.url.normalize(t);var
i=this._pathToUuid[t];if(i)if(Array.isArray(i)){if(!e)return i[0].uuid;for(var
n=0;n<i.length;n++){var s=i[n];if(r.isChildClassOf(s.type,e))return
s.uuid}}else{if(!e||r.isChildClassOf(i.type,e))return
i.uuid}return""},l.getUuidArray=function(t,e,i){"/"===(t=cc.url.normalize(t))
[t.length-1]&&(t=t.slice(0,-1));var
n=this._pathToUuid,s=[],a=r.isChildClassOf;for(var l in
n)if(l.startsWith(t)&&o(l,t)||!t){var h=n[l];if(Array.isArray(h))for(var
c=0;c<h.length;c++){var u=h[c];(!e||
a(u.type,e))&&(s.push(u.uuid),i&&i.push(l))}else(!e||
a(h.type,e))&&(s.push(h.uuid),i&&i.push(l))}return s},l.add=function(t,e,i,r)
{t=t.substring(0,t.length-cc.path.extname(t).length);var a=new
s(e,i);n(this._pathToUuid,t,a,r)},l._getInfo_DEBUG=!1,l.reset=function()
{this._pathToUuid=r.createMap(!0)},e.exports=a}),
{"../platform/js":220,"../utils/misc":295}],149:[(function(t,e,i){"use strict";var
n=t("../platform/CCSys"),r=t("../CCDebug"),s=n.__audioSupport,a=s.format,o=s.contex
t;function l(t,e){var
i=document.createElement("audio");if(i.src=t.url,cc.sys.platform===cc.sys.BAIDU_GAM
E)e(null,i);else{var n=function()
{clearTimeout(r),i.removeEventListener("canplaythrough",a,!
1),i.removeEventListener("error",o,!
1),s.USE_LOADER_EVENT&&i.removeEventListener(s.USE_LOADER_EVENT,a,!
1)},r=setTimeout((function(){0===i.readyState?o():a()}),8e3),a=function()
{n(),e(null,i)},o=function(){n();var i="load audio failure -
"+t.url;cc.log(i),e(i)};i.addEventListener("canplaythrough",a,!
1),i.addEventListener("error",o,!
1),s.USE_LOADER_EVENT&&i.addEventListener(s.USE_LOADER_EVENT,a,!1)}}function h(t,e)
{o||e(new Error(r.getError(4926)));var
i=cc.loader.getXMLHttpRequest();i.open("GET",t.url,!
0),i.responseType="arraybuffer",i.onload=function(){o.decodeAudioData(i.response,
(function(t){e(null,t)}),(function(){e("decode error -
"+t.id,null)}))},i.onerror=function(){e("request error -
"+t.id,null)},i.send()}e.exports=function(t,e){if(0===a.length)return new
Error(r.getError(4927));var i;i=s.WEB_AUDIO?t._owner instanceof cc.AudioClip?
t._owner.loadMode===cc.AudioClip.LoadMode.WEB_AUDIO?
h:l:t.urlParam&&t.urlParam.useDom?l:h:l,i(t,e)}}),
{"../CCDebug":49,"../platform/CCSys":209}],150:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js");function s(t,e){var i=cc.loader.getItem(t);if(i){var
n=i.dependKeys;if(n)for(var r=0;r<n.length;r++){var a=n[r];e[a]||(e[a]=!
0,s(a,e))}}}function
a(t,e){if(t._uuid){var i=cc.loader._getReferenceKey(t);e[i]||(e[i]=!
0,s(i,e))}}function o(t,e){for(var
i=Object.getOwnPropertyNames(t),r=0;r<i.length;r++){var
s=t[i[r]];if("object"===(void
0===s?"undefined":n(s))&&s)if(Array.isArray(s))for(var o=0;o<s.length;o++){var
l=s[o];l instanceof cc.RawAsset&&a(l,e)}else if(s.constructor&&s.constructor!
==Object)s instanceof cc.RawAsset&&a(s,e);else for(var
h=Object.getOwnPropertyNames(s),c=0;c<h.length;c++){var u=s[h[c]];u instanceof
cc.RawAsset&&a(u,e)}}}function l(t,e){for(var i=0;i<t._components.length;i+
+)o(t._components[i],e);for(var n=0;n<t._children.length;n+
+)l(t._children[n],e)}e.exports={autoRelease:function(t,e,i){var
n=cc.loader._autoReleaseSetting,s=r.createMap();if(e)for(var a=0;a<e.length;a+
+)s[e[a]]=!0;for(var o=0;o<i.length;o++)l(i[o],s);if(t)for(var h=0;h<t.length;h++)
{var c=t[h];!1===n[c]||s[c]||cc.loader.release(c)}for(var
u=Object.keys(n),_=0;_<u.length;_++){var f=u[_];!0!==n[f]||s[f]||
cc.loader.release(f)}},getDependsRecursively:function(t){var e={};return
s(t,e),Object.keys(e)}}}),{"../platform/js":220}],151:[(function(t,e,i){"use
strict";e.exports=function(t,e){var i=t.url,n=cc.loader.getXMLHttpRequest(),r="Load
binary data failed: "+i;n.open("GET",i,!
0),n.responseType="arraybuffer",n.onload=function(){var t=n.response;if(t){var
i=new Uint8Array(t);e(null,i)}else e({status:n.status,errorMessage:r+"(no
response)"})},n.onerror=function()
{e({status:n.status,errorMessage:r+"(error)"})},n.ontimeout=function()
{e({status:n.status,errorMessage:r+"(time out)"})},n.send(null)}}),{}],152:
[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../CCDebug");t("../utils/CCPath");var
s,a=t("./pipeline"),o=t("./pack-downloader"),l=t("./binary-
downloader"),h=t("./text-downloader"),c=t("./utils").urlAppendTimestamp;function
u(){return null}function _(t,e,i){var
n=t.url,s=document,a=document.createElement("script");function o()
{a.parentNode.removeChild(a),a.removeEventListener("load",o,!
1),a.removeEventListener("error",l,!1),e(null,n)}function l()
{a.parentNode.removeChild(a),a.removeEventListener("load",o,!
1),a.removeEventListener("error",l,!1),e(new Error(r.getError(4928,n)))}"file:"!
==window.location.protocol&&(a.crossOrigin="anonymous"),a.async=i,a.src=c(n),a.addE
ventListener("load",o,!1),a.addEventListener("error",l,!
1),s.body.appendChild(a)}function f(t,e,i,n){void 0===i&&(i=!0);var
s=c(t.url);if(n=n||new Image,i&&"file:"!==window.location.protocol?
n.crossOrigin="anonymous":n.crossOrigin=null,n.complete&&n.naturalWidth>0&&n.src===
s)return n;var a=function i()
{n.removeEventListener("load",i),n.removeEventListener("error",o),n.id=t.id,e(null,
n)},o=function i()
{n.removeEventListener("load",a),n.removeEventListener("error",i),"https:"!
==window.location.protocol&&n.crossOrigin&&"anonymous"===n.crossOrigin.toLowerCase(
)?f(t,e,!1,n):e(new
Error(r.getError(4930,s)))};n.addEventListener("load",a),n.addEventListener("error"
,o),n.src=s}var
d={js:_,png:f,jpg:f,bmp:f,jpeg:f,gif:f,ico:f,tiff:f,webp:function(t,e,i,n){return
cc.sys.capabilities.webp?f(t,e,i,n):new
Error(r.getError(4929,t.url))},image:f,pvr:l,pkm:l,mp3:s=t("./audio-
downloader"),ogg:s,wav:s,m4a:s,txt:h,xml:h,vsh:h,fsh:h,atlas:h,tmx:h,tsx:h,json:h,E
xportJson:h,plist:h,fnt:h,font:u,eot:u,ttf:u,woff:u,svg:u,ttc:u,uuid:function(t,e)
{var i=o.load(t,e);return void 0===i?this.extMap.json(t,e):i||void
0},binary:l,bin:l,dbbin:l,default:h},m="Downloader",p=function(t)
{this.id=m,this.async=!
0,this.pipeline=null,this._curConcurrent=0,this._loadQueue=[],this._subpackages={},
this.extMap=n.mixin(t,d)};p.ID=m,p.PackDownloader=o,p.prototype.addHandlers=functio
n(t){n.mixin(this.extMap,t)},p.prototype._handleLoadQueue=function()
{for(;this._curConcurrent<cc.macro.DOWNLOAD_MAX_CONCURRENT;){var
t=this._loadQueue.shift();if(!t)break;var e=this.handle(t.item,t.callback);void 0!
==e&&(e instanceof Error?
t.callback(e):t.callback(null,e))}},p.prototype.handle=function(t,e){var
i=this,n=this.extMap[t.type]||this.extMap.default,r=void
0;if(this._curConcurrent<cc.macro.DOWNLOAD_MAX_CONCURRENT){if(this._curConcurrent+
+,void 0!==(r=n.call(this,t,(function(t,n)
{i._curConcurrent=Math.max(0,i._curConcurrent-
1),i._handleLoadQueue(),e&&e(t,n)}))))return
this._curConcurrent=Math.max(0,this._curConcurrent-
1),this._handleLoadQueue(),r}else if(t.ignoreMaxConcurrency){if(void 0!
==(r=n.call(this,t,e)))return r}else
this._loadQueue.push({item:t,callback:e})},p.prototype.loadSubpackage=function(t,e)
{var i=this._subpackages[t];i?i.loaded?e&&e():_({url:i.path+"index.js"},
(function(t){t||(i.loaded=!0),e&&e(t)})):e&&e(new Error("Can't find subpackage
"+t))},a.Downloader=e.exports=p}),
{"../CCDebug":49,"../platform/js":220,"../utils/CCPath":284,"./audio-
downloader":149,"./binary-downloader":151,"./pack-
downloader":158,"./pipeline":159,"./text-downloader":162,"./utils":164}],153:
[(function(t,e,i){"use strict";var n=t("../utils/text-utils"),r=null,s="BES bswy:-
>@123\u4e01\u3041\u1101",a={},o=-1,l=[],h=6e4,c=(function(){var t=void 0;return
function(){if(void 0===t)if(window.FontFace){var
e=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),i=/OS
X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.nav
igator.vendor);t=e?parseInt(e[1],10)>42:!i}else t=!1;return t}})();function u()
{for(var t=!0,e=Date.now(),i=l.length-1;i>=0;i--){var
a=l[i],c=a.fontFamilyName;if(e-
a.startTime>h)cc.warnID(4933,c),a.callback(null,c),l.splice(i,1);else{var
u=a.refWidth;r.font="40px "+c,u!==n.safeMeasureText(r,s)?
(l.splice(i,1),a.callback(null,c)):t=!1}}t&&(clearInterval(o),o=-1)}function
_(t,e,i){var n=new Promise(function(i,n){(function r(){Date.now()-t>=h?
n():document.fonts.load("40px "+e).then((function(t){t.length>=1?
i():setTimeout(r,100)}),(function(){n()}))})()}),r=null,s=new Promise(function(t,e)
{r=setTimeout(e,h)});Promise.race([s,n]).then((function()
{r&&(clearTimeout(r),r=null),i(null,e)}),(function()
{cc.warnID(4933,e),i(null,e)}))}var f={loadFont:function(t,e){var
i=t.url,h=f._getFontFamily(i);if(a[h])return h;if(!r){var
d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}va
r m="40px "+h;r.font=m;var
p=n.safeMeasureText(r,s),v=document.createElement("style");v.type="text/css";var
y="";isNaN(h-0)?y+="@font-face { font-family:"+h+"; src:":y+="@font-face { font-
family:'"+h+"';
src:",y+="url('"+i+"');",v.textContent=y+"}",document.body.appendChild(v);var
g=document.createElement("div"),x=g.style;if(x.fontFamily=h,g.innerHTML=".",x.posit
ion="absolute",x.left="-100px",x.top="-
100px",document.body.appendChild(g),c())_(Date.now(),h,e);else{var
b={fontFamilyName:h,refWidth:p,callback:e,startTime:Date.now()};l.push(b),-
1===o&&(o=setInterval(u,100))}a[h]=v},_getFontFamily:function(t){var
e=t.lastIndexOf(".ttf");if(-1===e)return t;var i,n=t.lastIndexOf("/");return-1!
==(i=-1===n?t.substring(0,e)+"_LABEL":t.substring(n+1,e)+"_LABEL").indexOf("
")&&(i='"'+i+'"'),i}};e.exports=f}),{"../utils/text-utils":301}],154:
[(function(t,e,i){"use strict";t("./downloader"),t("./loader"),t("./loading-
items"),t("./pipeline"),t("./CCLoader")}),
{"./CCLoader":146,"./downloader":152,"./loader":155,"./loading-
items":156,"./pipeline":159}],155:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/CCSAXParser").plistParser,s=t("./pipeline"),
a=t("../assets/CCTexture2D"),o=t("./uuid-loader"),l=t("./font-loader");function
h(t){if("string"!=typeof t.content)return new Error("JSON Loader: Input item
doesn't contain string content");try{return JSON.parse(t.content)}catch(e){return
new Error("JSON Loader: Parse json ["+t.id+"] failed : "+e)}}function c(t)
{if(t._owner instanceof cc.Asset)return null;var e=t.content;if(cc.sys.platform!
==cc.sys.FB_PLAYABLE_ADS&&!(e instanceof Image))return new Error("Image Loader:
Input item doesn't contain Image content");var i=t.rawUrl,n=t.texture||new a;return
n._uuid=t.uuid,n.url=i,n._setRawAsset(i,!1),n._nativeAsset=e,n}function u(t,e)
{if(t._owner instanceof cc.Asset)return null;var i=new cc.AudioClip;return
i._setRawAsset(t.rawUrl,!1),i._nativeAsset=t.content,i}function _(t){return t.load?
t.load(t.content):null}var f=13,d=55727696,m=0,p=6,v=7,y=12;var
g=16,x=6,b=8,A=10,C=12,S=14,T=0,w=1,E=3;function M(t,e){return t[e]<<8|t[e+1]}var
D={png:c,jpg:c,bmp:c,jpeg:c,gif:c,ico:c,tiff:c,webp:c,image:c,pvr:function(t){var
e=t.content instanceof ArrayBuffer?t.content:t.content.buffer,i=new
Int32Array(e,0,f);if(i[m]!=d)return new Error("Invalid magic number in PVR
header");var n=i[v],r=i[p],s=i[y]+52;return{_data:new Uint8Array(e,s),_compressed:!
0,width:n,height:r}},pkm:function(t){var e=t.content instanceof ArrayBuffer?
t.content:t.content.buffer,i=new Uint8Array(e),n=M(i,x);if(n!==T&&n!==w&&n!
==E)return new Error("Invalid magic number in ETC header");var
r=M(i,C),s=M(i,S);return M(i,b),M(i,A),{_data:new Uint8Array(e,g),_compressed:!
0,width:r,height:s}},mp3:u,ogg:u,wav:u,m4a:u,json:h,ExportJson:h,plist:function(t)
{if("string"!=typeof t.content)return new Error("Plist Loader: Input item doesn't
contain string content");var e=r.parse(t.content);return e||new Error("Plist
Loader: Parse ["+t.id+"]
failed")},uuid:o,prefab:o,fire:o,scene:o,binary:_,dbbin:_,bin:_,font:l.loadFont,eot
:l.loadFont,ttf:l.loadFont,woff:l.loadFont,svg:l.loadFont,ttc:l.loadFont,default:fu
nction(){return null}},B=function(t){this.id="Loader",this.async=!
0,this.pipeline=null,this.extMap=n.mixin(t,D)};B.ID="Loader",B.prototype.addHandler
s=function(t){this.extMap=n.mixin(this.extMap,t)},B.prototype.handle=function(t,e)
{return(this.extMap[t.type]||
this.extMap.default).call(this,t,e)},s.Loader=e.exports=B}),
{"../assets/CCTexture2D":73,"../platform/CCSAXParser":207,"../platform/js":220,"./f
ont-loader":153,"./pipeline":159,"./uuid-loader":165}],156:[(function(t,e,i){"use
strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?
function(t){return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/callbacks-invoker");t("../utils/CCPath");var
s=t("../platform/js"),a=0|998*Math.random(),o=s.createMap(!
0),l=[],h={WORKING:1,COMPLETE:2,ERROR:3},c=s.createMap(!0);function u(t)
{return"string"==typeof(t.url||t)}function _(t){if(t){var
e=t.split("?");if(e&&e[0]&&e[1]){var i={};return
e[1].split("&").forEach((function(t){var
e=t.split("=");i[e[0]]=e[1]})),i}}}function f(t,e){var i="object"===(void
0===t?"undefined":n(t))?t.url:t,r={queueId:e,id:i,url:i,rawUrl:void
0,urlParam:_(i),type:"",error:null,content:null,complete:!1,states:
{},deps:null};if("object"===(void
0===t?"undefined":n(t))&&(s.mixin(r,t),t.skips))for(var a=0;a<t.skips.length;a++)
{var o=t.skips[a];r.states[o]=h.COMPLETE}return r.rawUrl=r.url,i&&!
r.type&&(r.type=cc.path.extname(i).toLowerCase().substr(1)),r}var d=[];function
m(t,e,i){if(!t||!e)return!1;var n=!1;if(d.push(e.id),e.deps){var
r,s,a=e.deps;for(r=0;r<a.length;r++){if((s=a[r]).id===t.id){n=!0;break}if(!
(d.indexOf(s.id)>=0)&&(s.deps&&m(t,s,!0))){n=!0;break}}}return i||
(d.length=0),n}var p=function(t,e,i,n){r.call(this),this._id=+
+a,o[this._id]=this,this._pipeline=t,this._errorUrls=s.createMap(!
0),this._appending=!
1,this._ownerQueue=null,this.onProgress=i,this.onComplete=n,this.map=s.createMap(!
0),this.completed={},this.totalCount=0,this.completedCount=0,this._pipeline?
this.active=!0:this.active=!1,e&&(e.length>0?
this.append(e):this.allComplete())};p.ItemState=new
cc.Enum(h),p.create=function(t,e,i,n){void 0===i?"function"==typeof
e&&(n=e,e=i=null):void 0===n&&("function"==typeof e?(n=i,i=e,e=null):
(n=i,i=null));var r=l.pop();return r?
(r._pipeline=t,r.onProgress=i,r.onComplete=n,o[r._id]=r,r._pipeline&&(r.active=!
0),e&&r.append(e)):r=new p(t,e,i,n),r},p.getQueue=function(t){return t.queueId?
o[t.queueId]:null},p.itemComplete=function(t){var
e=o[t.queueId];e&&e.itemComplete(t.id)},p.initQueueDeps=function(t){var
e=c[t._id];e?(e.completed.length=0,e.deps.length=0):e=c[t._id]={completed:[],deps:
[]}},p.registerQueueDep=function(t,e){var i=t.queueId||t;if(!i)return!1;var
n=c[i];if(n)-1===n.deps.indexOf(e)&&n.deps.push(e);else if(t.id)for(var r in c){var
s=c[r];-1!==s.deps.indexOf(t.id)&&-
1===s.deps.indexOf(e)&&s.deps.push(e)}},p.finishDep=function(t){for(var e in c){var
i=c[e];-1!==i.deps.indexOf(t)&&-
1===i.completed.indexOf(t)&&i.completed.push(t)}};var
v=p.prototype;s.mixin(v,r.prototype),v.append=function(t,e){if(!
this.active)return[];e&&!e.deps&&(e.deps=[]),this._appending=!0;var
i,n,r,s=[];for(i=0;i<t.length;++i)if(!(n=t[i]).queueId||this.map[n.id]){if(u(n))
{var a=(r=f(n,this._id)).id;this.map[a]||(this.map[a]=r,this.totalCount+
+,e&&e.deps.push(r),p.registerQueueDep(e||
this._id,a),s.push(r))}}else{if(this.map[n.id]=n,e&&e.deps.push(n),n.complete||
m(e,n)){this.totalCount++,this.itemComplete(n.id);continue}var
l=this,h=o[n.queueId];h&&(this.totalCount++,p.registerQueueDep(e||
this._id,n.id),h.addListener(n.id,(function(t){l.itemComplete(t.id)})))}return
this._appending=!1,this.completedCount===this.totalCount?
this.allComplete():this._pipeline.flowIn(s),s},v._childOnProgress=function(t)
{if(this.onProgress){var e=c[this._id];this.onProgress(e?
e.completed.length:this.completedCount,e?
e.deps.length:this.totalCount,t)}},v.allComplete=function(){var
t=s.isEmptyObject(this._errorUrls)?
null:this._errorUrls;this.onComplete&&this.onComplete(t,this)},v.isCompleted=functi
on(){return this.completedCount>=this.totalCount},v.isItemCompleted=function(t)
{return!!this.completed[t]},v.exists=function(t){return!!
this.map[t]},v.getContent=function(t){var e=this.map[t],i=null;return
e&&(e.content?i=e.content:e.alias&&(i=e.alias.content)),i},v.getError=function(t)
{var e=this.map[t],i=null;return e&&(e.error?
i=e.error:e.alias&&(i=e.alias.error)),i},v.addListener=r.prototype.add,v.hasListene
r=r.prototype.has,v.removeListener=r.prototype.remove,v.removeAllListeners=r.protot
ype.removeAll,v.removeItem=function(t){var
e=this.map[t];e&&this.completed[e.alias||t]&&(delete this.completed[t],delete
this.map[t],e.alias&&(delete this.completed[e.alias.id],delete
this.map[e.alias.id]),this.completedCount--,this.totalCount--)},v.itemComplete=func
tion(t){var e=this.map[t];if(e){var i=t in this._errorUrls;if(e.error instanceof
Error||s.isString(e.error)?this._errorUrls[t]=e.error:e.error?
s.mixin(this._errorUrls,e.error):!e.error&&i&&delete
this._errorUrls[t],this.completed[t]=e,this.completedCount+
+,p.finishDep(e.id),this.onProgress){var n=c[this._id];this.onProgress(n?
n.completed.length:this.completedCount,n?
n.deps.length:this.totalCount,e)}this.invoke(t,e),this.removeAll(t),!
this._appending&&this.completedCount>=this.totalCount&&this.allComplete()}},v.destr
oy=function(){this.active=!1,this._appending=!
1,this._pipeline=null,this._ownerQueue=null,s.clear(this._errorUrls),this.onProgres
s=null,this.onComplete=null,this.map=s.createMap(!
0),this.completed={},this.totalCount=0,this.completedCount=0,r.call(this),c[this._i
d]&&(c[this._id].completed.length=0,c[this._id].deps.length=0),delete
o[this._id],delete c[this._id],-
1===l.indexOf(this)&&l.length<10&&l.push(this)},cc.LoadingItems=e.exports=p}),
{"../platform/callbacks-
invoker":213,"../platform/js":220,"../utils/CCPath":284}],157:[(function(t,e,i)
{"use strict";var n=t("./pipeline"),r="MD5Pipe",s=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-
9a-fA-F-]{8,})/,a=function(t,e,i){this.id=r,this.async=!
1,this.pipeline=null,this.md5AssetsMap=t,this.md5NativeAssetsMap=e,this.libraryBase
=i};a.ID=r,a.prototype.handle=function(t){return
t.url=this.transformURL(t.url),null},a.prototype.transformURL=function(t){var e=!
t.startsWith(this.libraryBase)?this.md5NativeAssetsMap:this.md5AssetsMap;return
t=t.replace(s,(function(t,i){var n=e[i];return n?
t+"."+n:t}))},n.MD5Pipe=e.exports=a}),{"./pipeline":159}],158:[(function(t,e,i)
{"use strict";var
n=t("./unpackers"),r=t("../utils/misc").pushToMap,s={Invalid:0,Removed:1,Downloadin
g:2,Loaded:3};function a(){this.unpacker=null,this.state=s.Invalid}var
o={},l={},h={};function c(t,e){return new Error("Can not retrieve "+t+" from packer
"+e)}e.exports={initPacks:function(t){for(var e in l=t,o={},t)for(var
i=t[e],n=0;n<i.length;n++){var
s=i[n],a=1===i.length;r(o,s,e,a)}},_loadNewPack:function(t,e,i){var
n=this,r=cc.AssetLibrary.getLibUrlNoExt(e)
+".json";cc.loader.load({url:r,ignoreMaxConcurrency:!0},(function(r,s){if(r)return
cc.errorID(4916,t),i(r);var a=n._doLoadNewPack(t,e,s);a?
i(null,a):i(c(t,e))}))},_doPreload:function(t,e){var i=h[t];i||((i=h[t]=new
a).state=s.Downloading),i.state!==s.Loaded&&(i.unpacker=new
n.JsonUnpacker,i.unpacker.load(l[t],e),i.state=s.Loaded)},_doLoadNewPack:function(t
,e,i){var r=h[e];return r.state!==s.Loaded&&("string"==typeof
i&&(i=JSON.parse(i)),Array.isArray(i)?r.unpacker=new
n.JsonUnpacker:i.type===n.TextureUnpacker.ID&&(r.unpacker=new
n.TextureUnpacker),r.unpacker.load(l[e],i),r.state=s.Loaded),r.unpacker.retrieve(t)
},_selectLoadedPack:function(t){for(var e=s.Invalid,i="",n=0;n<t.length;n++){var
r=t[n],a=h[r];if(a){var o=a.state;if(o===s.Loaded)return r;o>e&&(e=o,i=r)}}return
e!==s.Invalid?i:t[0]},load:function(t,e){var i=t.uuid,n=o[i];if(n)
{Array.isArray(n)&&(n=this._selectLoadedPack(n));var
r=h[n];if(r&&r.state===s.Loaded){var l=r.unpacker.retrieve(i);return l||
c(i,n)}return r||(console.log("Create unpacker %s for %s",n,i),(r=h[n]=new
a).state=s.Downloading),this._loadNewPack(i,n,e),null}}}}),
{"../utils/misc":295,"./unpackers":163}],159:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("./loading-items"),s=r.ItemState;function a(t,e){var
i=t.id,n=e.states[i],r=t.next,o=t.pipeline;if(!e.error&&n!==s.WORKING&&n!
==s.ERROR)if(n===s.COMPLETE)r?a(r,e):o.flowOut(e);else{e.states[i]=s.WORKING;var
l=t.handle(e,(function(t,n){t?(e.error=t,e.states[i]=s.ERROR,o.flowOut(e)):
(n&&(e.content=n),e.states[i]=s.COMPLETE,r?a(r,e):o.flowOut(e))}));l instanceof
Error?(e.error=l,e.states[i]=s.ERROR,o.flowOut(e)):void 0!==l&&(null!
==l&&(e.content=l),e.states[i]=s.COMPLETE,r?a(r,e):o.flowOut(e))}}var o=function(t)
{this._pipes=t,this._cache=n.createMap(!0);for(var e=0;e<t.length;++e){var
i=t[e];i.handle&&i.id&&(i.pipeline=this,i.next=e<t.length-1?
t[e+1]:null)}};o.ItemState=s;var l=o.prototype;l.insertPipe=function(t,e){if(!
t.handle||!t.id||e>this._pipes.length)cc.warnID(4921);else
if(this._pipes.indexOf(t)>0)cc.warnID(4922);else{t.pipeline=this;var
i=null;e<this._pipes.length&&(i=this._pipes[e]);var n=null;e>0&&(n=this._pipes[e-
1]),n&&(n.next=t),t.next=i,this._pipes.splice(e,0,t)}},l.insertPipeAfter=function(t
,e){var i=this._pipes.indexOf(t);i<0||
this.insertPipe(e,i+1)},l.appendPipe=function(t)
{t.handle&&t.id&&(t.pipeline=this,t.next=null,this._pipes.length>0&&(this._pipes[th
is._pipes.length-1].next=t),this._pipes.push(t))},l.flowIn=function(t){var
e,i,n=this._pipes[0];if(n){for(e=0;e<t.length;e+
+)i=t[e],this._cache[i.id]=i;for(e=0;e<t.length;e++)a(n,i=t[e])}else
for(e=0;e<t.length;e++)this.flowOut(t[e])},l.flowInDeps=function(t,e,i){return
r.create(this,(function(t,e)
{i(t,e),e.destroy()})).append(e,t)},l.flowOut=function(t){t.error?delete
this._cache[t.id]:this._cache[t.id]||(this._cache[t.id]=t),t.complete=!
0,r.itemComplete(t)},l.copyItemStates=function(t,e){if(e instanceof Array)for(var
i=0;i<e.length;++i)e[i].states=t.states;else
e.states=t.states},l.getItem=function(t){var e=this._cache[t];return e?
(e.alias&&(e=e.alias),e):e},l.removeItem=function(t){var e=this._cache[t];return
e&&e.complete&&delete this._cache[t],e},l.clear=function(){for(var t in
this._cache){var e=this._cache[t];delete this._cache[t],e.complete||(e.error=new
Error("Canceled manually"),this.flowOut(e))}},cc.Pipeline=e.exports=o}),
{"../platform/js":220,"./loading-items":156}],160:[(function(t,e,i){"use strict"}),
{"../platform/js":220}],161:[(function(t,e,i){"use strict";var
n=t("./pipeline"),r="SubPackPipe",s=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]
{8,})/;function a(t){var e=t.match(s);return e?e[1]:""}var
o=Object.create(null),l=function(t){for(var e in this.id=r,this.async=!
1,this.pipeline=null,t){var
i=t[e];i.uuids&&i.uuids.forEach((function(t)
{o[t]=i.path}))}};l.ID=r,l.prototype.handle=function(t){return
t.url=this.transformURL(t.url),null},l.prototype.transformURL=function(t){var
e=a(t);if(e){var i=o[e];if(i)return t.replace("res/raw-assets/",i+"raw-
assets/")}return t},n.SubPackPipe=e.exports=l}),{"./pipeline":159}],162:
[(function(t,e,i){"use strict";var
n=t("./utils").urlAppendTimestamp;e.exports=function(t,e){var i=t.url;i=n(i);var
r=cc.loader.getXMLHttpRequest(),s="Load text file failed: "+i;r.open("GET",i,!
0),r.overrideMimeType&&r.overrideMimeType("text/plain; charset=utf-
8"),r.onload=function(){4===r.readyState?200===r.status||0===r.status?
e(null,r.responseText):e({status:r.status,errorMessage:s+"(wrong
status)"}):e({status:r.status,errorMessage:s+"(wrong
readyState)"})},r.onerror=function()
{e({status:r.status,errorMessage:s+"(error)"})},r.ontimeout=function()
{e({status:r.status,errorMessage:s+"(time out)"})},r.send(null)}}),
{"./utils":164}],163:[(function(t,e,i){"use strict";var
n=t("../assets/CCTexture2D"),r=t("../platform/js");function s()
{this.jsons={}}function a(){this.contents={}}s.prototype.load=function(t,e)
{e.length!==t.length&&cc.errorID(4915);for(var i=0;i<t.length;i++){var
n=t[i],r=e[i];this.jsons[n]=r}},s.prototype.retrieve=function(t){return
this.jsons[t]||null},a.ID=r._getClassId(n),a.prototype.load=function(t,e){var
i=e.data.split("|");i.length!==t.length&&cc.errorID(4915);for(var n=0;n<t.length;n+
+)this.contents[t[n]]=i[n]},a.prototype.retrieve=function(t){var
e=this.contents[t];return e?
{__type__:a.ID,content:e}:null},e.exports={JsonUnpacker:s,TextureUnpacker:a}}),
{"../assets/CCTexture2D":73,"../platform/js":220}],164:[(function(t,e,i){"use
strict";var n=/\?/;e.exports={urlAppendTimestamp:function(t){return
cc.game.config.noCache&&"string"==typeof t&&(n.test(t)?t+="&_t="+(new Date-0):t+="?
_t="+(new Date-0)),t}}}),{}],165:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js"),s=t("../CCDebug");t("../platform/deserialize");var
a=t("./loading-items");function o(t){return t&&(t[0]&&"cc.Scene"===t[0].__type__||
t[1]&&"cc.Scene"===t[1].__type__||t[0]&&"cc.Prefab"===t[0].__type__)}function
l(t,e,i,n){var
r,s,a,o=i.uuidList,l=i.uuidObjList,h=i.uuidPropList,c=i._stillUseUrl,u=t.dependKeys
=[];if(n)for(r=[],s=0;s<o.length;s++){a=o[s];var
_=l[s],f=h[s],d=cc.AssetLibrary._getAssetInfoInRuntime(a);if(d.raw){var
m=d.url;_[f]=m,u.push(m)}else r.push({type:"uuid",uuid:a,deferredLoadRaw:!
0,_owner:_,_ownerProp:f,_stillUseUrl:c[s]})}else{for(r=new
Array(o.length),s=0;s<o.length;s+
+)a=o[s],r[s]={type:"uuid",uuid:a,_owner:l[s],_ownerProp:h[s],_stillUseUrl:c[s]};e.
_native&&!
e.constructor.preventPreloadNativeObject&&r.push({url:e.nativeUrl,_owner:e,_ownerPr
op:"_nativeAsset"})}return r}function h(t,e,i,n,r){e.content=i;var
s=e.dependKeys;t.flowInDeps(e,n,(function(t,e){var o,l=e.map;for(var h in l)
(o=l[h]).uuid&&o.content&&(o.content._uuid=o.uuid);for(var c=0;c<n.length;c++){var
u=function(t){var
e=t.content;this._stillUseUrl&&(e=e&&cc.RawAsset.wasRawAssetType(e.constructor)?
e.nativeUrl:t.rawUrl),this._owner[this._ownerProp]=e,t.uuid!
==i._uuid&&s.indexOf(t.id)<0&&s.push(t.id)},_=n[c],f=_.uuid,d=_.url;_._owner,_._own
erProp;if(o=l[d]){var m=_;if(o.complete||o.content)
{if(o.error)cc._throw(o.error);else u.call(m,o)}else{var
p=a.getQueue(o),v=p._callbackTable[f];v?v.unshift(u,m):p.addListener(f,u,m)}}}!
t&&i.onLoad&&i.onLoad(),r(t,i)}))}function c(t,e,i){var n=e.deferredLoadRaw;return
n?t instanceof cc.Asset&&t.constructor.preventDeferredLoadDependents&&(n=!1):i&&(t
instanceof cc.SceneAsset||t instanceof cc.Prefab)&&(n=t.asyncLoadAssets),n}function
u(t,e){var i,a;if("string"==typeof t.content)try{i=JSON.parse(t.content)}catch(e)
{return new Error(s.getError(4923,t.id,e.stack))}else{if("object"!
==n(t.content))return new Error(s.getError(4924));i=t.content}var u=o(i);a=u?
cc._MissingScript.safeFindClass:function(t){var e=r._getClassById(t);return e||
(cc.warnID(4903,t),Object)};var
_,f=cc.deserialize.Details.pool.get();try{_=cc.deserialize(i,f,
{classFinder:a,target:t.existingAsset,customEnv:t})}catch(e)
{cc.deserialize.Details.pool.put(f);var d=e.stack;return new
Error(s.getError(4925,t.id,d))}_._uuid=t.uuid;var
m=l(t,_,f,c(_,t,u));if(cc.deserialize.Details.pool.put(f),0===m.length)return
_.onLoad&&_.onLoad(),e(null,_);h(this.pipeline,t,_,m,e)}e.exports=u,u.isSceneObj=o}
),{"../CCDebug":49,"../platform/deserialize":215,"../platform/js":220,"./loading-
items":156}],166:[(function(t,e,i){"use strict";var
n=a(t("../../renderer/core/input-
assembler")),r=a(t("../../renderer/gfx")),s=t("./mesh-data");function a(t){return
t&&t.__esModule?t:{default:t}}var o=t("../renderer"),l=t("../event/event-
target");function h(t,e,i){t[e]=i._val}function c(t,e,i)
{t[e]=i.x,t[e+1]=i.y}function u(t,e,i){t[e]=i.x,t[e+1]=i.y,t[e+2]=i.z}var
_=cc.Class({name:"cc.Mesh",extends:cc.Asset,mixins:[l],properties:{_nativeAsset:
{override:!0,get:function(){return this._buffer},set:function(t)
{this._buffer=ArrayBuffer.isView(t)?t.buffer:t}},_vertexBundles:
{default:null,type:s.VertexBundle},_primitives:
{default:null,Primitive:s.Primitive},_minPos:cc.v3(),_maxPos:cc.v3(),subMeshes:
{get:function(){return this._subMeshes},set:function(t)
{this._subMeshes=t}}},ctor:function()
{this._subMeshes=[],this._ibs=[],this._vbs=[]},onLoad:function()
{this._subMeshes.length=0;for(var t=this._primitives,e=0;e<t.length;e++){var
i=t[e],s=i.data,a=new Uint16Array(this._buffer,s.offset,s.length/2),l=new
r.default.IndexBuffer(o.device,i.indexUnit,r.default.USAGE_STATIC,a,a.length),h=thi
s._vertexBundles[i.vertexBundleIndices[0]],c=h.data,u=new
r.default.VertexFormat(h.formats),_=new
Uint8Array(this._buffer,c.offset,c.length),f=new
r.default.VertexBuffer(o.device,u,r.default.USAGE_STATIC,_,h.verticesCount);this._s
ubMeshes.push(new
n.default(f,l)),this._ibs.push({buffer:l,data:a}),this._vbs.push({buffer:f,data:_})
}},init:function(t,e,i){this.clear();var n=new Uint8Array(t._bytes*e),s=new
r.default.VertexBuffer(o.device,t,i?
r.default.USAGE_DYNAMIC:r.default.USAGE_STATIC,n,e);this._vbs[0]={buffer:s,data:n,d
irty:!0},this.emit("init-format")},setVertices:function(t,e,i){i=i||0;var
n=this._vbs[i],s=n.buffer._format._attr2el[t];if(!s)return cc.warn("Cannot find
"+t+" attribute in vertex defines.");var a="number"==typeof
e[0],o=s.num,l=Float32Array,_=4;t===r.default.ATTR_COLOR&&(a?
(l=Float32Array,_=1):l=Uint32Array);var f=n[l.name];if(!f){var
d=n.data;f=n[l.name]=new l(d.buffer,d.byteOffset,d.byteLength/_)}var
m=s.stride/_,p=s.offset/_;if(a)for(var v=0,y=e.length/o;v<y;v++)for(var
g=v*o,x=v*m+p,b=0;b<o;b++)f[x+b]=e[g+b];else{var A=void
0;A=t===r.default.ATTR_COLOR?h:2===o?c:u;for(var C=0,S=e.length;C<S;C++)
{A(f,C*m+p,e[C])}}n.dirty=!0},setIndices:function(t,e,i){e=e||0;var s=new
Uint16Array(t),a=i?
r.default.USAGE_DYNAMIC:r.default.USAGE_STATIC,l=this._ibs[e];if(l)l.buffer._usage=
a,l.data=s,l.dirty=!0;else{var h=new
r.default.IndexBuffer(o.device,r.default.INDEX_FMT_UINT16,a,s,s.length);this._ibs[e
]={buffer:h,data:s,dirty:!1};var c=this._vbs[0];this._subMeshes[e]=new
n.default(c.buffer,h)}},setPrimitiveType:function(t,e){e=e||0,this._subMeshes[e]?
this._subMeshes[e]._primitiveType=t:cc.warn("Do not have sub mesh at index
"+e)},clear:function(){this._subMeshes.length=0;for(var
t=this._ibs,e=0;e<t.length;e++)t[e].buffer.destroy();t.length=0;for(var
i=this._vbs,n=0;n<i.length;n+
+)i[n].buffer.destroy();i.length=0},setBoundingBox:function(t,e)
{this._minPos=t,this._maxPos=e},destroy:function()
{this.clear()},_uploadData:function(){for(var t=this._vbs,e=0;e<t.length;e++){var
i=t[e];if(i.dirty){var
n=i.buffer,r=i.data;n._numVertices=r.byteLength/n._format._bytes,n._bytes=r.byteLen
gth,n.update(0,r),i.dirty=!1}}for(var s=this._ibs,a=0;a<s.length;a++){var
o=s[a];if(o.dirty){var
l=o.buffer,h=o.data;l._numIndices=h.length,l._bytes=h.byteLength,l.update(0,h),o.di
rty=!1}}}});cc.Mesh=e.exports=_}),{"../../renderer/core/input-
assembler":338,"../../renderer/gfx":348,"../event/event-
target":132,"../renderer":243,"./mesh-data":169}],167:[(function(t,e,i){"use
strict";var n=a(t("../geom-
utils")),r=a(t("../../renderer/gfx")),s=a(t("../assets/material/custom-
properties"));function a(t){return t&&t.__esModule?t:{default:t}}var
o=t("../components/CCRenderComponent"),l=t("./CCMesh"),h=t("../renderer/render-
flow"),c=t("../assets/material/CCMaterial"),u=cc.Enum({OFF:0,ON:1}),_=cc.Class({nam
e:"cc.MeshRenderer",extends:o,editor:!1,properties:{_mesh:
{default:null,type:l},_receiveShadows:!1,_shadowCastingMode:u.OFF,mesh:
{get:function(){return this._mesh},set:function(t){this._mesh!
==t&&(this._setMesh(t),t?(this.markForRender(!0),this._activateMaterial(!
0),this.markForUpdateRenderData(!0),this.node._renderFlag|
=h.FLAG_TRANSFORM):this.markForRender(!1))},type:l},textures:{default:
[],type:cc.Texture2D,visible:!1},receiveShadows:{get:function(){return
this._receiveShadows},set:function(t)
{this._receiveShadows=t,this._updateReceiveShadow()}},shadowCastingMode:
{get:function(){return this._shadowCastingMode},set:function(t)
{this._shadowCastingMode=t,this._updateCastShadow()},type:u}},statics:
{ShadowCastingMode:u},ctor:function()
{this._renderDatas=[],this._boundingBox=null,this._customProperties=new
s.default},onEnable:function()
{this._super(),this._setMesh(this._mesh),this._activateMaterial()},onDestroy:functi
on(){this._setMesh(null)},getRenderNode:function(){return
this.node},_setMesh:function(t){this._mesh&&this._mesh.off("init-
format",this._updateMeshAttribute,this),t&&t.on("init-
format",this._updateMeshAttribute,this),this._mesh=t},_getDefaultMaterial:function(
){return c.getBuiltinMaterial("unlit")},_activateMaterial:function(t){var
e=this._mesh;if(e&&0!==e.subMeshes.length)
{n.default&&(this._boundingBox=n.default.Aabb.fromPoints(n.default.Aabb.create(),e.
_minPos,e._maxPos));var
i=this.textures;if(i&&i.length>0)for(var r=0;r<i.length;r++){var
s=this.sharedMaterials[r];s||
((s=cc.Material.getInstantiatedMaterial(this._getDefaultMaterial(),this)).setProper
ty("diffuseTexture",i[r]),this.setMaterial(r,s))}var a=this.sharedMaterials;if(!
a[0]){var
o=this._getDefaultMaterial();a[0]=o}this._updateMeshAttribute(),this._updateReceive
Shadow(),this._updateCastShadow(),this.markForUpdateRenderData(!
0),this.markForRender(!0)}else
this.disableRender()},_updateReceiveShadow:function()
{this._customProperties.define("_USE_SHADOW_MAP",this._receiveShadows)},_updateCast
Shadow:function()
{this._customProperties.define("_SHADOW_CASTING",this._shadowCastingMode===u.ON)},_
updateMeshAttribute:function(){var t=this._mesh&&this._mesh.subMeshes;if(t){var
e=t[0]._vertexBuffer._format._attr2el;this._customProperties.define("_USE_ATTRIBUTE
_COLOR",!!
e[r.default.ATTR_COLOR]),this._customProperties.define("_USE_ATTRIBUTE_UV0",!!
e[r.default.ATTR_UV0]),this._customProperties.define("_USE_ATTRIBUTE_NORMAL",!!
e[r.default.ATTR_NORMAL])}}});cc.MeshRenderer=e.exports=_}),
{"../../renderer/gfx":348,"../assets/material/CCMaterial":75,"../assets/material/cu
stom-properties":76,"../components/CCRenderComponent":106,"../geom-
utils":137,"../renderer/render-flow":244,"./CCMesh":166}],168:[(function(t,e,i)
{"use strict";t("./CCMesh"),t("./CCMeshRenderer"),t("./mesh-renderer")}),
{"./CCMesh":166,"./CCMeshRenderer":167,"./mesh-renderer":170}],169:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.Primitive=i.VertexBundle=i.VertexFormat=i.BufferRange=void 0;var
n=(function(t){return t&&t.__esModule?t:{default:t}})(t("../../renderer/gfx"));var
r=i.BufferRange=cc.Class({name:"cc.BufferRange",properties:
{offset:0,length:0}}),s=i.VertexFormat=cc.Class({name:"cc.mesh.VertexFormat",proper
ties:{name:"",type:-1,num:-1,normalize:!
1}});i.VertexBundle=cc.Class({name:"cc.mesh.VertexBundle",properties:{data:
{default:null,type:r},formats:{default:
[],type:s},verticesCount:0}}),i.Primitive=cc.Class({name:"cc.mesh.Primitive",proper
ties:{vertexBundleIndices:{default:[],type:Number},data:
{default:null,type:r},indexUnit:n.default.INDEX_FMT_UINT16,topology:n.default.PT_TR
IANGLES}})}),{"../../renderer/gfx":348}],170:[(function(t,e,i){"use strict";var
n=a(t("../../renderer/gfx")),r=a(t("../../renderer/core/input-
assembler")),s=a(t("../../renderer/render-data/ia-render-data"));function a(t)
{return t&&t.__esModule?t:{default:t}}var
o=t("../assets/material/CCMaterial"),l=t("./CCMeshRenderer"),h=cc.Color.BLACK,c={up
dateRenderData:function(t){var e=t._renderDatas;if(e.length=0,t.mesh)for(var
i=t.mesh._subMeshes,n=0;n<i.length;n++){var r=new
s.default;r.material=t.sharedMaterials[n]||
t.sharedMaterials[0],r.ia=i[n],e.push(r)}},createWireFrameData:function(t,e,i,a)
{var l=new s.default,c=new
o;c.copy(o.getBuiltinMaterial("unlit")),c.setProperty("diffuseColor",h),c.define("U
SE_DIFFUSE_TEXTURE",!1),l.material=c;for(var u=[],_=0;_<e.length;_+=3){var
f=e[_+0],d=e[_+1],m=e[_+2];u.push(f,d,d,m,m,f)}var p=new Uint16Array(u),v=new
n.default.IndexBuffer(a._device,n.default.INDEX_FMT_UINT16,n.default.USAGE_STATIC,p
,p.length);return l.ia=new
r.default(t._vertexBuffer,v,n.default.PT_LINES),l},fillBuffers:function(t,e)
{e._flush();var
i=t._renderDatas,n=t.mesh._subMeshes;if(cc.macro.SHOW_MESH_WIREFRAME)
{if(i.length===n.length)for(var r=t.mesh._ibs,s=0;s<n.length;s++){var
a=i[s];i.push(this.createWireFrameData(a.ia,r[s].data,a.material,e))}}else
i.length=n.length;var
o=e.material,l=e.node;e.node=t.getRenderNode(),e.customProperties=t._customProperti
es;var h=e.customProperties;t.mesh._uploadData();for(var c=0;c<i.length;c++){var
u=i[c],_=u.material;e.material=_,e._flushIA(u)}e.customProperties=h,e.node=l,e.mate
rial=o}};e.exports=l._assembler=c}),{"../../renderer/core/input-
assembler":338,"../../renderer/gfx":348,"../../renderer/render-data/ia-render-
data":367,"../assets/material/CCMaterial":75,"./CCMeshRenderer":167}],171:
[(function(t,e,i){"use strict";var n=t("./component-
scheduler"),r=t("./platform/CCObject").Flags,s=t("./platform/js"),a=r.IsPreloadStar
ted,o=r.IsOnLoadStarted,l=r.IsOnLoadCalled,h=r.Deactivating,c="c.onLoad();c._objFla
gs|="+l,u=cc.Class({extends:n.LifeCycleInvoker,add:function(t)
{this._zero.array.push(t)},remove:function(t)
{this._zero.fastRemove(t)},cancelInactive:function(t)
{n.LifeCycleInvoker.stableRemoveInactive(this._zero,t)},invoke:function()
{this._invoke(this._zero),this._zero.array.length=0}}),_=n.createInvokeImpl("c.__pr
eload();"),f=n.createInvokeImpl(c),d=new s.Pool(4);function m(t,e,i){e?
t._removeComponent(e):s.array.removeAt(t._components,i)}function p()
{this._activatingStack=[]}d.get=function(){var t=this._get()||{preload:new
u(_),onLoad:new n.OneOffInvoker(f),onEnable:new
n.OneOffInvoker(n.invokeOnEnable)};t.preload._zero.i=-1;var e=t.onLoad;return
e._zero.i=-1,e._neg.i=-1,e._pos.i=-1,(e=t.onEnable)._zero.i=-1,e._neg.i=-
1,e._pos.i=-1,t};var
v=cc.Class({ctor:p,reset:p,_activateNodeRecursively:function(t,e,i,n)
{if(t._objFlags&h)cc.errorID(3816,t.name);else{t._activeInHierarchy=!0;for(var
r=t._components.length,s=0;s<r;++s){var a=t._components[s];a instanceof
cc.Component?this.activateComp(a,e,i,n):(m(t,a,s),--s,--r)}for(var
o=0,l=t._children.length;o<l;++o){var
c=t._children[o];c._active&&this._activateNodeRecursively(c,e,i,n)}t._onPostActivat
ed(!0)}},_deactivateNodeRecursively:function(t){t._objFlags|
=h,t._activeInHierarchy=!1;for(var e=t._components.length,i=0;i<e;++i){var
n=t._components[i];if(n._enabled&&(cc.director._compScheduler.disableComp(n),t._act
iveInHierarchy))return void(t._objFlags&=~h)}for(var r=0,s=t._children.length;r<s;+
+r){var
a=t._children[r];if(a._activeInHierarchy&&(this._deactivateNodeRecursively(a),t._ac
tiveInHierarchy))return void(t._objFlags&=~h)}t._onPostActivated(!
1),t._objFlags&=~h},activateNode:function(t,e){if(e){var
i=d.get();this._activatingStack.push(i),this._activateNodeRecursively(t,i.preload,i
.onLoad,i.onEnable),i.preload.invoke(),i.onLoad.invoke(),i.onEnable.invoke(),this._
activatingStack.pop(),d.put(i)}else{this._deactivateNodeRecursively(t);for(var
n=this._activatingStack,r=0;r<n.length;r++){var
s=n[r];s.preload.cancelInactive(a),s.onLoad.cancelInactive(o),s.onEnable.cancelInac
tive()}}t.emit("active-in-hierarchy-changed",t)},activateComp:function(t,e,i,n)
{if(cc.isValid(t,!0)&&(t._objFlags&a||(t._objFlags|=a,t.__preload&&(e?
e.add(t):t.__preload())),t._objFlags&o||(t._objFlags|=o,t.onLoad?i?i.add(t):
(t.onLoad(),t._objFlags|=l):t._objFlags|=l),t._enabled)){if(!
t.node._activeInHierarchy)return;cc.director._compScheduler.enableComp(t,n)}},destr
oyComp:function(t)
{cc.director._compScheduler.disableComp(t),t.onDestroy&&t._objFlags&l&&t.onDestroy(
)},resetComp:!1});e.exports=v}),{"./component-
scheduler":89,"./platform/CCObject":206,"./platform/js":220,"./utils/misc":295}],17
2:[(function(t,e,i){"use strict";var
n=t("./CCPhysicsTypes").PTM_RATIO,r=t("./CCPhysicsTypes").ContactType,s=[],a=[cc.v2
(),cc.v2()],o=new b2.WorldManifold,l={points:[],separations:
[],normal:cc.v2()};function h()
{this.localPoint=cc.v2(),this.normalImpulse=0,this.tangentImpulse=0}var c=[new
h,new h],u=(new b2.Manifold,{type:0,localPoint:cc.v2(),localNormal:cc.v2(),points:
[]}),_={normalImpulses:[],tangentImpulses:[]};function f()
{}f.prototype.init=function(t)
{this.colliderA=t.GetFixtureA().collider,this.colliderB=t.GetFixtureB().collider,th
is.disabled=!1,this.disabledOnce=!1,this._impulse=null,this._inverted=!
1,this._b2contact=t,t._contact=this},f.prototype.reset=function()
{this.setTangentSpeed(0),this.resetFriction(),this.resetRestitution(),this.collider
A=null,this.colliderB=null,this.disabled=!
1,this._impulse=null,this._b2contact._contact=null,this._b2contact=null},f.prototyp
e.getWorldManifold=function(){var
t=l.points,e=l.separations,i=l.normal;this._b2contact.GetWorldManifold(o);var
r=o.points,s=o.separations,h=this._b2contact.GetManifold().pointCount;t.length=e.le
ngth=h;for(var c=0;c<h;c++){var
u=a[c];u.x=r[c].x*n,u.y=r[c].y*n,t[c]=u,e[c]=s[c]*n}return
i.x=o.normal.x,i.y=o.normal.y,this._inverted&&(i.x*=-1,i.y*=-
1),l},f.prototype.getManifold=function(){for(var
t=u.points,e=u.localNormal,i=u.localPoint,r=this._b2contact.GetManifold(),s=r.point
s,a=t.length=r.pointCount,o=0;o<a;o++){var
l=c[o],h=s[o];l.localPoint.x=h.localPoint.x*n,l.localPoint.Y=h.localPoint.Y*n,l.nor
malImpulse=h.normalImpulse*n,l.tangentImpulse=h.tangentImpulse,t[o]=l}return
i.x=r.localPoint.x*n,i.y=r.localPoint.y*n,e.x=r.localNormal.x,e.y=r.localNormal.y,u
.type=r.type,this._inverted&&(e.x*=-1,e.y*=-1),u},f.prototype.getImpulse=function()
{var t=this._impulse;if(!t)return null;for(var
e=_.normalImpulses,i=_.tangentImpulses,r=t.count,s=0;s<r;s+
+)e[s]=t.normalImpulses[s]*n,i[s]=t.tangentImpulses[s];return
i.length=e.length=r,_},f.prototype.emit=function(t){var e;switch(t){case
r.BEGIN_CONTACT:e="onBeginContact";break;case
r.END_CONTACT:e="onEndContact";break;case r.PRE_SOLVE:e="onPreSolve";break;case
r.POST_SOLVE:e="onPostSolve"}var
i,n,s,a,o=this.colliderA,l=this.colliderB,h=o.body,c=l.body;if(h.enabledContactList
ener)for(i=h.node._components,this._inverted=!1,n=0,s=i.length;n<s;n++)(a=i[n])
[e]&&a[e]
(this,o,l);if(c.enabledContactListener)for(i=c.node._components,this._inverted=!
0,n=0,s=i.length;n<s;n++)(a=i[n])[e]&&a[e](this,l,o);(this.disabled||
this.disabledOnce)&&(this.setEnabled(!1),this.disabledOnce=!1)},f.get=function(t)
{var e;return(e=0===s.length?new
cc.PhysicsContact:s.pop()).init(t),e},f.put=function(t){var
e=t._contact;e&&(s.push(e),e.reset())};var d=f.prototype;d.setEnabled=function(t)
{this._b2contact.SetEnabled(t)},d.isTouching=function(){return
this._b2contact.IsTouching()},d.setTangentSpeed=function(t)
{this._b2contact.SetTangentSpeed(t/n)},d.getTangentSpeed=function(){return
this._b2contact.GetTangentSpeed()*n},d.setFriction=function(t)
{this._b2contact.SetFriction(t)},d.getFriction=function(){return
this._b2contact.GetFriction()},d.resetFriction=function(){return
this._b2contact.ResetFriction()},d.setRestitution=function(t)
{this._b2contact.SetRestitution(t)},d.getRestitution=function(){return
this._b2contact.GetRestitution()},d.resetRestitution=function(){return
this._b2contact.ResetRestitution()},f.ContactType=r,cc.PhysicsContact=e.exports=f})
,{"./CCPhysicsTypes":174}],173:[(function(t,e,i){"use strict";var
n=t("./CCPhysicsTypes"),r=n.ContactType,s=n.BodyType,a=n.RayCastType,o=n.DrawBits,l
=n.PTM_RATIO,h=(n.ANGLE_TO_PHYSICS_ANGLE,n.PHYSICS_ANGLE_TO_ANGLE),c=t("./utils").c
onvertToNodeRotation,u=t("./platform/CCPhysicsDebugDraw"),_=new b2.AABB,f=new
b2.Vec2,d=new b2.Vec2,m=cc.v2(),p=cc.Class({mixins:[cc.EventTarget],statics:
{DrawBits:o,PTM_RATIO:l,VELOCITY_ITERATIONS:10,POSITION_ITERATIONS:10,FIXED_TIME_ST
EP:1/60,MAX_ACCUMULATOR:.2},ctor:function()
{this._debugDrawFlags=0,this._debugDrawer=null,this._world=null,this._bodies=[],thi
s._joints=[],this._contactMap={},this._contactID=0,this._delayEvents=[],this._accum
ulator=0,cc.director._scheduler&&cc.director._scheduler.enableForTarget(this),this.
enabledAccumulator=!1},pushDelayEvent:function(t,e,i){this._steping?
this._delayEvents.push({target:t,func:e,args:i}):t[e].apply(t,i)},update:function(t
){var e=this._world;if(e&&this.enabled){this.emit("before-step"),this._steping=!
0;var i=p.VELOCITY_ITERATIONS,n=p.POSITION_ITERATIONS;if(this.enabledAccumulator)
{this._accumulator+=t;var
r=p.FIXED_TIME_STEP,s=p.MAX_ACCUMULATOR;for(this._accumulator>s&&(this._accumulator
=s);this._accumulator>r;)e.Step(r,i,n),this._accumulator-=r}else{var
a=1/cc.game.config.frameRate;e.Step(a,i,n)}this.debugDrawFlags&&(this._checkDebugDr
awValid(),this._debugDrawer.clear(),e.DrawDebugData()),this._steping=!1;for(var
o=this._delayEvents,l=0,h=o.length;l<h;l++){var
c=o[l];c.target[c.func].apply(c.target,c.args)}o.length=0,this._syncNode()}},testPo
int:function(t){var e=f.x=t.x/l,i=f.y=t.y/l,n=.2/l;_.lowerBound.x=e-
n,_.lowerBound.y=i-n,_.upperBound.x=e+n,_.upperBound.y=i+n;var
r=this._aabbQueryCallback;r.init(f),this._world.QueryAABB(r,_);var
s=r.getFixture();return s?s.collider:null},testAABB:function(t)
{_.lowerBound.x=t.xMin/l,_.lowerBound.y=t.yMin/l,_.upperBound.x=t.xMax/l,_.upperBou
nd.y=t.yMax/l;var e=this._aabbQueryCallback;return
e.init(),this._world.QueryAABB(e,_),e.getFixtures().map((function(t){return
t.collider}))},rayCast:function(t,e,i){if(t.equals(e))return[];i=i||
a.Closest,f.x=t.x/l,f.y=t.y/l,d.x=e.x/l,d.y=e.y/l;var
n=this._raycastQueryCallback;n.init(i),this._world.RayCast(n,f,d);var
r=n.getFixtures();if(r.length>0){for(var
s=n.getPoints(),o=n.getNormals(),h=n.getFractions(),c=[],u=0,_=r.length;u<_;u++)
{var m=r[u],p=m.collider;if(i===a.AllClosest){var v=c.find((function(t){return
t.collider===p}));if(v)
{h[u]<v.fraction&&(v.fixtureIndex=p._getFixtureIndex(m),v.point.x=s[u].x*l,v.point.
y=s[u].y*l,v.normal.x=o[u].x,v.normal.y=o[u].y,v.fraction=h[u]);continue}}c.push({c
ollider:p,fixtureIndex:p._getFixtureIndex(m),point:cc.v2(s[u].x*l,s[u].y*l),normal:
cc.v2(o[u]),fraction:h[u]})}return c}return[]},syncPosition:function(){for(var
t=this._bodies,e=0;e<t.length;e++)t[e].syncPosition()},syncRotation:function()
{for(var t=this._bodies,e=0;e<t.length;e+
+)t[e].syncRotation()},_registerContactFixture:function(t)
{this._contactListener.registerContactFixture(t)},_unregisterContactFixture:functio
n(t){this._contactListener.unregisterContactFixture(t)},_addBody:function(t,e){var
i=this._world,n=t.node;i&&n&&(t._b2Body=i.CreateBody(e),t._b2Body.body=t,this._bodi
es.push(t))},_removeBody:function(t){var
e=this._world;e&&(t._b2Body.body=null,e.DestroyBody(t._b2Body),t._b2Body=null,cc.js
.array.remove(this._bodies,t))},_addJoint:function(t,e){var
i=this._world.CreateJoint(e);i&&(i._joint=t,t._joint=i,this._joints.push(t))},_remo
veJoint:function(t)
{t._isValid()&&this._world.DestroyJoint(t._joint),t._joint&&(t._joint._joint=null),
cc.js.array.remove(this._joints,t)},_initCallback:function(){if(this._world){if(!
this._contactListener){var t=new
cc.PhysicsContactListener;t.setBeginContact(this._onBeginContact),t.setEndContact(t
his._onEndContact),t.setPreSolve(this._onPreSolve),t.setPostSolve(this._onPostSolve
),this._world.SetContactListener(t),this._contactListener=t,this._aabbQueryCallback
=new cc.PhysicsAABBQueryCallback,this._raycastQueryCallback=new
cc.PhysicsRayCastCallback}}else cc.warn("Please init PhysicsManager
first")},_init:function(){this.enabled=!
0,this.debugDrawFlags=o.e_shapeBit},_getWorld:function(){return
this._world},_syncNode:function(){for(var t=this._bodies,e=0,i=t.length;e<i;e++)
{var n=t[e],r=n.node,a=n._b2Body,o=a.GetPosition();m.x=o.x*l,m.y=o.y*l;var
u=a.GetAngle()*h;null!
==r.parent.parent&&(m=r.parent.convertToNodeSpaceAR(m),u=c(r.parent,u));var
_=r._eventMask;r._eventMask=0,r.position=m,r.angle=-
u,r._eventMask=_,n.type===s.Animated&&n.resetVelocity()}},_onBeginContact:function(
t){cc.PhysicsContact.get(t).emit(r.BEGIN_CONTACT)},_onEndContact:function(t){var
e=t._contact;e&&(e.emit(r.END_CONTACT),cc.PhysicsContact.put(t))},_onPreSolve:funct
ion(t){var e=t._contact;e&&e.emit(r.PRE_SOLVE)},_onPostSolve:function(t,e){var
i=t._contact;i&&(i._impulse=e,i.emit(r.POST_SOLVE),i._impulse=null)},_checkDebugDra
wValid:function(){if(!this._debugDrawer||!this._debugDrawer.isValid){var t=new
cc.Node("PHYSICS_MANAGER_DEBUG_DRAW");t.zIndex=cc.macro.MAX_ZINDEX,cc.game.addPersi
stRootNode(t),this._debugDrawer=t.addComponent(cc.Graphics);var e=new
u(this._debugDrawer);e.SetFlags(this.debugDrawFlags),this._world.SetDebugDraw(e)}}}
);cc.js.getset(p.prototype,"enabled",(function(){return this._enabled}),
(function(t){if(t&&!this._world){var e=new b2.World(new b2.Vec2(0,-
10));e.SetAllowSleeping(!
0),this._world=e,this._initCallback()}this._enabled=t})),cc.js.getset(p.prototype,"
debugDrawFlags",(function(){return this._debugDrawFlags}),(function(t){t&&!
this._debugDrawFlags?
this._debugDrawer&&this._debugDrawer.node&&(this._debugDrawer.node.active=!0):!
t&&this._debugDrawFlags&&this._debugDrawer&&this._debugDrawer.node&&(this._debugDra
wer.node.active=!
1),t&&(this._checkDebugDrawValid(),this._world.m_debugDraw.SetFlags(t)),this._debug
DrawFlags=t,t&&(this._checkDebugDrawValid(),this._world.m_debugDraw.SetFlags(t))}))
,cc.js.getset(p.prototype,"gravity",(function(){if(this._world){var
t=this._world.GetGravity();return cc.v2(t.x*l,t.y*l)}return cc.v2()}),(function(t)
{this._world&&this._world.SetGravity(new
b2.Vec2(t.x/l,t.y/l))})),cc.PhysicsManager=e.exports=p}),
{"./CCPhysicsTypes":174,"./platform/CCPhysicsDebugDraw":195,"./utils":197}],174:
[(function(t,e,i){"use strict";var
n=cc.Enum({Static:0,Kinematic:1,Dynamic:2,Animated:3});cc.RigidBodyType=n;var
r=cc.Enum({Closest:0,Any:1,AllClosest:2,All:3});cc.RayCastType=r,e.exports={BodyTyp
e:n,ContactType:{BEGIN_CONTACT:"begin-contact",END_CONTACT:"end-
contact",PRE_SOLVE:"pre-solve",POST_SOLVE:"post-
solve"},RayCastType:r,DrawBits:b2.DrawFlags,PTM_RATIO:32,ANGLE_TO_PHYSICS_ANGLE:-
Math.PI/180,PHYSICS_ANGLE_TO_ANGLE:-180/Math.PI}}),{}],175:[(function(t,e,i){"use
strict";function n(t,e){var i=e.length;return e[t<0?i- -t%i:t%i]}function r(t,e,i)
{for(var r=[];e<t;)e+=i.length;for(;t<=e;++t)r.push(n(t,i));return r}function
s(t,e,i){if(a(t,i)){if(h(n(t,i),n(t-1,i),n(e,i))&&c(n(t,i),n(t+1,i),n(e,i)))return!
1}else if(c(n(t,i),n(t+1,i),n(e,i))||h(n(t,i),n(t-1,i),n(e,i)))return!1;if(a(e,i))
{if(h(n(e,i),n(e-1,i),n(t,i))&&c(n(e,i),n(e+1,i),n(t,i)))return!1}else
if(c(n(e,i),n(e+1,i),n(t,i))||h(n(e,i),n(e-1,i),n(t,i)))return!1;for(var
r=0;r<i.length;++r)if((r+1)%i.length!=t&&r!=t&&(r+1)%i.length!=e&&r!=e){var
s=cc.v2();if(p(n(t,i),n(e,i),n(r,i),n(r+1,i),s))return!1}return!0}function a(t,e)
{return o(t,e)}function o(t,e,i){if(void 0===i){var r=t,s=e;t=n(r-
1,s),e=n(r,s),i=n(r+1,s)}return y(t,e,i)<0}function l(t,e,i){return
y(t,e,i)>0}function h(t,e,i){return y(t,e,i)>=0}function c(t,e,i){return
y(t,e,i)<=0}function u(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function _(t)
{f(t)||t.reverse()}function f(t){return t.length<3||d(t)>0}function d(t){var
e,i=0;for(e=0;e<t.length;e++){var n=(e+1)%t.length;i+=t[e].x*t[n].y,i-
=t[e].y*t[n].x}return i/=2}function m(t,e,i,n){var r=cc.v2(),s=e.y-t.y,a=t.x-
e.x,o=s*t.x+a*t.y,l=n.y-i.y,h=i.x-n.x,c=l*i.x+h*i.y,u=s*h-l*a;return v(u,0)||
(r.x=(h*o-a*c)/u,r.y=(s*c-l*o)/u),r}function p(t,e,i,n,r){if(t==i||t==n||e==i||
e==n)return!1;var
s=t.x,a=t.y,o=e.x,l=e.y,h=i.x,c=i.y,u=n.x,_=n.y;if(Math.max(s,o)<Math.min(h,u)||
Math.max(h,u)<Math.min(s,o))return!1;if(Math.max(a,l)<Math.min(c,_)||
Math.max(c,_)<Math.min(a,l))return!1;var f=(u-h)*(a-c)-(_-c)*(s-h),d=(o-s)*(a-c)-
(l-a)*(s-h),m=(_-c)*(o-s)-(u-h)*(l-a);return!(Math.abs(m)<1e-
6)&&(d/=m,0<(f/=m)&&f<1&&0<d&&d<1&&(r.x=s+f*(o-s),r.y=a+f*(l-a),!0))}function
v(t,e){return Math.abs(t-e)<=1e-6}function y(t,e,i){return t.x*(e.y-i.y)+e.x*(i.y-
t.y)+i.x*(t.y-e.y)}e.exports={ConvexPartition:function t(e){_(e);for(var
i,f,d,p,v,y,g=[],x=cc.v2(),b=cc.v2(),A=0,C=0,S=0;S<e.length;++S)if(a(S,e))
{f=d=1e8;for(var T=0;T<e.length;++T)l(n(S-1,e),n(S,e),n(T,e))&&c(n(S-
1,e),n(S,e),n(T-1,e))&&(p=m(n(S-1,e),n(S,e),n(T,e),n(T-
1,e)),o(n(S+1,e),n(S,e),p)&&(i=u(n(S,e),p))<f&&(f=i,x=p,A=T)),l(n(S+1,e),n(S,e),n(T
+1,e))&&c(n(S+1,e),n(S,e),n(T,e))&&(p=m(n(S+1,e),n(S,e),n(T,e),n(T+1,e)),l(n(S-
1,e),n(S,e),p)&&(i=u(n(S,e),p))<d&&(d=i,C=T,b=p));if(A==(C+1)%e.length){var
w=x.add(b).div(2);(v=r(S,C,e)).push(w),(y=r(A,S,e)).push(w)}else{for(var
E=0,M=A;C<A;)C+=e.length;for(T=A;T<=C;++T)if(s(S,T,e)){var D=1/(u(n(S,e),n(T,e))
+1);a(T,e)?c(n(T-1,e),n(T,e),n(S,e))&&h(n(T+1,e),n(T,e),n(S,e))?
D+=3:D+=2:D+=1,D>E&&(M=T,E=D)}v=r(S,M,e),y=r(M,S,e)}return
g=(g=g.concat(t(v))).concat(t(y))}g.push(e);for(S=g.length-
1;S>=0;S--)0==g[S].length&&g.splice(S,0);return
g},ForceCounterClockWise:_,IsCounterClockWise:f}}),{}],176:[(function(t,e,i){"use
strict";var
n=t("../CCNode").EventType,r=t("./CCPhysicsTypes").PTM_RATIO,s=t("./CCPhysicsTypes"
).ANGLE_TO_PHYSICS_ANGLE,a=t("./CCPhysicsTypes").PHYSICS_ANGLE_TO_ANGLE,o=t("./util
s").getWorldRotation,l=t("./CCPhysicsTypes").BodyType,h=new
b2.Vec2,c=new
b2.Vec2,u=cc.Vec2.ZERO,_=cc.Class({name:"cc.RigidBody",extends:cc.Component,editor:
!1,properties:{_type:l.Dynamic,_allowSleep:!
0,_gravityScale:1,_linearDamping:0,_angularDamping:0,_linearVelocity:cc.v2(0,0),_an
gularVelocity:0,_fixedRotation:!1,enabled:{get:function(){return
this._enabled},set:function(){cc.warnID(8200)},visible:!1,override:!
0},enabledContactListener:{default:!1,tooltip:!1},bullet:{default:!1,tooltip:!
1},type:{type:l,tooltip:!1,get:function(){return this._type},set:function(t)
{this._type=t,this._b2Body&&(t===l.Animated?
this._b2Body.SetType(l.Kinematic):this._b2Body.SetType(t))}},allowSleep:{tooltip:!
1,get:function(){return this._b2Body?
this._b2Body.IsSleepingAllowed():this._allowSleep},set:function(t)
{this._allowSleep=t,this._b2Body&&this._b2Body.SetSleepingAllowed(t)}},gravityScale
:{tooltip:!1,get:function(){return this._gravityScale},set:function(t)
{this._gravityScale=t,this._b2Body&&this._b2Body.SetGravityScale(t)}},linearDamping
:{tooltip:!1,get:function(){return this._linearDamping},set:function(t)
{this._linearDamping=t,this._b2Body&&this._b2Body.SetLinearDamping(this._linearDamp
ing)}},angularDamping:{tooltip:!1,get:function(){return
this._angularDamping},set:function(t)
{this._angularDamping=t,this._b2Body&&this._b2Body.SetAngularDamping(t)}},linearVel
ocity:{tooltip:!1,type:cc.Vec2,get:function(){var
t=this._linearVelocity;if(this._b2Body){var
e=this._b2Body.GetLinearVelocity();t.x=e.x*r,t.y=e.y*r}return t},set:function(t)
{this._linearVelocity=t;var e=this._b2Body;if(e){var
i=e.m_linearVelocity;i.Set(t.x/r,t.y/r),e.SetLinearVelocity(i)}}},angularVelocity:
{tooltip:!1,get:function(){return this._b2Body?
this._b2Body.GetAngularVelocity()*a:this._angularVelocity},set:function(t)
{this._angularVelocity=t,this._b2Body&&this._b2Body.SetAngularVelocity(t*s)}},fixed
Rotation:{tooltip:!1,get:function(){return this._fixedRotation},set:function(t)
{this._fixedRotation=t,this._b2Body&&this._b2Body.SetFixedRotation(t)}},awake:
{visible:!1,tooltip:!1,get:function(){return!!
this._b2Body&&this._b2Body.IsAwake()},set:function(t)
{this._b2Body&&this._b2Body.SetAwake(t)}},awakeOnLoad:{default:!0,tooltip:!
1,animatable:!1},active:{visible:!1,get:function(){return!!
this._b2Body&&this._b2Body.IsActive()},set:function(t)
{this._b2Body&&this._b2Body.SetActive(t)}}},getLocalPoint:function(t,e){if(e=e||
cc.v2(),this._b2Body){h.Set(t.x/r,t.y/r);var
i=this._b2Body.GetLocalPoint(h,e);e.x=i.x*r,e.y=i.y*r}return
e},getWorldPoint:function(t,e){if(e=e||cc.v2(),this._b2Body){h.Set(t.x/r,t.y/r);var
i=this._b2Body.GetWorldPoint(h,e);e.x=i.x*r,e.y=i.y*r}return
e},getWorldVector:function(t,e){if(e=e||cc.v2(),this._b2Body)
{h.Set(t.x/r,t.y/r);var
i=this._b2Body.GetWorldVector(h,e);e.x=i.x*r,e.y=i.y*r}return
e},getLocalVector:function(t,e){if(e=e||cc.v2(),this._b2Body)
{h.Set(t.x/r,t.y/r);var
i=this._b2Body.GetLocalVector(h,e);e.x=i.x*r,e.y=i.y*r}return
e},getWorldPosition:function(t){if(t=t||cc.v2(),this._b2Body){var
e=this._b2Body.GetPosition();t.x=e.x*r,t.y=e.y*r}return
t},getWorldRotation:function(){return this._b2Body?
this._b2Body.GetAngle()*a:0},getLocalCenter:function(t){if(t=t||
cc.v2(),this._b2Body){var
e=this._b2Body.GetLocalCenter();t.x=e.x*r,t.y=e.y*r}return
t},getWorldCenter:function(t){if(t=t||cc.v2(),this._b2Body){var
e=this._b2Body.GetWorldCenter();t.x=e.x*r,t.y=e.y*r}return
t},getLinearVelocityFromWorldPoint:function(t,e){if(e=e||cc.v2(),this._b2Body)
{h.Set(t.x/r,t.y/r);var
i=this._b2Body.GetLinearVelocityFromWorldPoint(h,e);e.x=i.x*r,e.y=i.y*r}return
e},getMass:function(){return this._b2Body?
this._b2Body.GetMass():0},getInertia:function(){return this._b2Body?
this._b2Body.GetInertia()*r*r:0},getJointList:function(){if(!
this._b2Body)return[];var t=[],e=this._b2Body.GetJointList();if(!
e)return[];t.push(e.joint._joint);for(var
i=e.prev;i;)t.push(i.joint._joint),i=i.prev;for(var
n=e.next;n;)t.push(n.joint._joint),n=n.next;return t},applyForce:function(t,e,i)
{this._b2Body&&(h.Set(t.x/r,t.y/r),c.Set(e.x/r,e.y/r),this._b2Body.ApplyForce(h,c,i
))},applyForceToCenter:function(t,e)
{this._b2Body&&(h.Set(t.x/r,t.y/r),this._b2Body.ApplyForceToCenter(h,e))},applyTorq
ue:function(t,e)
{this._b2Body&&this._b2Body.ApplyTorque(t/r,e)},applyLinearImpulse:function(t,e,i)
{this._b2Body&&(h.Set(t.x/r,t.y/r),c.Set(e.x/r,e.y/r),this._b2Body.ApplyLinearImpul
se(h,c,i))},applyAngularImpulse:function(t,e)
{this._b2Body&&this._b2Body.ApplyAngularImpulse(t/r/r,e)},syncPosition:function(t)
{var e=this._b2Body;if(e){var
i,n=this.node.convertToWorldSpaceAR(u);if((i=this.type===l.Animated?
e.GetLinearVelocity():e.GetPosition()).x=n.x/r,i.y=n.y/r,this.type===l.Animated&&t)
{var s=e.GetPosition(),a=cc.game.config.frameRate;i.x=(i.x-s.x)*a,i.y=(i.y-
s.y)*a,e.SetAwake(!0),e.SetLinearVelocity(i)}else
e.SetTransformVec(i,e.GetAngle())}},syncRotation:function(t){var
e=this._b2Body;if(e){var i=s*o(this.node);if(this.type===l.Animated&&t){var
n=e.GetAngle(),r=cc.game.config.frameRate;e.SetAwake(!0),e.SetAngularVelocity((i-
n)*r)}else e.SetTransformVec(e.GetPosition(),i)}},resetVelocity:function(){var
t=this._b2Body;if(t){var
e=t.m_linearVelocity;e.Set(0,0),t.SetLinearVelocity(e),t.SetAngularVelocity(0)}},on
Enable:function(){this._init()},onDisable:function()
{this._destroy()},_registerNodeEvents:function(){var
t=this.node;t.on(n.POSITION_CHANGED,this._onNodePositionChanged,this),t.on(n.ROTATI
ON_CHANGED,this._onNodeRotationChanged,this),t.on(n.SCALE_CHANGED,this._onNodeScale
Changed,this)},_unregisterNodeEvents:function(){var
t=this.node;t.off(n.POSITION_CHANGED,this._onNodePositionChanged,this),t.off(n.ROTA
TION_CHANGED,this._onNodeRotationChanged,this),t.off(n.SCALE_CHANGED,this._onNodeSc
aleChanged,this)},_onNodePositionChanged:function(){this.syncPosition(!
0)},_onNodeRotationChanged:function(t){this.syncRotation(!
0)},_onNodeScaleChanged:function(t){if(this._b2Body)for(var
e=this.getComponents(cc.PhysicsCollider),i=0;i<e.length;i+
+)e[i].apply()},_init:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__init",
[])},_destroy:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__destroy",
[])},__init:function(){if(!this._inited){this._registerNodeEvents();var t=new
b2.BodyDef;this.type===l.Animated?
t.type=l.Kinematic:t.type=this.type,t.allowSleep=this.allowSleep,t.gravityScale=thi
s.gravityScale,t.linearDamping=this.linearDamping,t.angularDamping=this.angularDamp
ing;var e=this.linearVelocity;t.linearVelocity=new
b2.Vec2(e.x/r,e.y/r),t.angularVelocity=this.angularVelocity*s,t.fixedRotation=this.
fixedRotation,t.bullet=this.bullet;var
i=this.node,n=i.convertToWorldSpaceAR(u);t.position=new
b2.Vec2(n.x/r,n.y/r),t.angle=-
Math.PI/180*o(i),t.awake=this.awakeOnLoad,cc.director.getPhysicsManager()._addBody(
this,t),this._inited=!0}},__destroy:function()
{this._inited&&(cc.director.getPhysicsManager()._removeBody(this),this._unregisterN
odeEvents(),this._inited=!1)},_getBody:function(){return
this._b2Body}});cc.RigidBody=e.exports=_}),
{"../CCNode":52,"./CCPhysicsTypes":174,"./utils":197}],177:[(function(t,e,i){"use
strict";var n=t("../../../external/box2d/box2d");for(var r in window.b2={},n)if(-
1===r.indexOf("b2_")){var
s=r.replace("b2","");b2[s]=n[r]}b2.maxPolygonVertices=8}),
{"../../../external/box2d/box2d":408}],178:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.PhysicsBoxCollider",extends
:cc.PhysicsCollider,mixins:[cc.Collider.Box],editor:{menu:!
1,requireComponent:cc.RigidBody},_createShape:function(t){var
e=Math.abs(t.x),i=Math.abs(t.y),r=this.size.width/2/n*e,s=this.size.height/2/n*i,a=
this.offset.x/n*e,o=this.offset.y/n*i,l=new b2.PolygonShape;return
l.SetAsBox(r,s,new b2.Vec2(a,o),0),l}});cc.PhysicsBoxCollider=e.exports=r}),
{"../CCPhysicsTypes":174}],179:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.PhysicsChainCollider",exten
ds:cc.PhysicsCollider,editor:{menu:!1,inspector:!
1,requireComponent:cc.RigidBody},properties:{loop:!1,points:{default:function()
{return[cc.v2(-50,0),cc.v2(50,0)]},type:[cc.Vec2]},threshold:
{default:1,serializable:!1,visible:!1}},_createShape:function(t){for(var e=new
b2.ChainShape,i=this.points,r=[],s=0;s<i.length;s++){var a=i[s];r.push(new
b2.Vec2(a.x/n*t.x,a.y/n*t.y))}return this.loop?
e.CreateLoop(r,r.length):e.CreateChain(r,r.length),e},resetInEditor:!
1,resetPointsByContour:!1});cc.PhysicsChainCollider=e.exports=r}),
{"../CCPhysicsTypes":174}],180:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.PhysicsCircleCollider",exte
nds:cc.PhysicsCollider,mixins:[cc.Collider.Circle],editor:{menu:!
1,requireComponent:cc.RigidBody},_createShape:function(t){var
e=Math.abs(t.x),i=Math.abs(t.y),r=this.offset.x/n*e,s=this.offset.y/n*i,a=new
b2.CircleShape;return a.m_radius=this.radius/n*e,a.m_p=new
b2.Vec2(r,s),a}});cc.PhysicsCircleCollider=e.exports=r}),
{"../CCPhysicsTypes":174}],181:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../utils").getWorldScale,s=cc.Class({name:"
cc.PhysicsCollider",extends:cc.Collider,ctor:function()
{this._fixtures=[],this._shapes=[],this._inited=!
1,this._rect=cc.rect()},properties:{_density:1,_sensor:!
1,_friction:.2,_restitution:0,density:{tooltip:!1,get:function(){return
this._density},set:function(t){this._density=t}},sensor:{tooltip:!1,get:function()
{return this._sensor},set:function(t){this._sensor=t}},friction:{tooltip:!
1,get:function(){return this._friction},set:function(t)
{this._friction=t}},restitution:{tooltip:!1,get:function(){return
this._restitution},set:function(t){this._restitution=t}},body:
{default:null,type:cc.RigidBody,visible:!1}},onDisable:function()
{this._destroy()},onEnable:function(){this._init()},start:function()
{this._init()},_getFixtureIndex:function(t){return
this._fixtures.indexOf(t)},_init:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__init",
[])},_destroy:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__destroy",
[])},__init:function(){if(!this._inited){var
t=this.body||this.getComponent(cc.RigidBody);if(t){var e=t._getBody();if(e){var
i=t.node,n=r(i);this._scale=n;var s=0===n.x&&0===n.y?[]:this._createShape(n);s
instanceof Array||(s=[s]);for(var
a=1<<i.groupIndex,o=0,l=cc.game.collisionMatrix[i.groupIndex],h=0;h<l.length;h+
+)l[h]&&(o|=1<<h);for(var
c={categoryBits:a,maskBits:o,groupIndex:0},u=cc.director.getPhysicsManager(),_=0;_<
s.length;_++){var f=s[_],d=new
b2.FixtureDef;d.density=this.density,d.isSensor=this.sensor,d.friction=this.frictio
n,d.restitution=this.restitution,d.shape=f,d.filter=c;var
m=e.CreateFixture(d);m.collider=this,t.enabledContactListener&&u._registerContactFi
xture(m),this._shapes.push(f),this._fixtures.push(m)}this.body=t,this._inited=!
0}}}},__destroy:function(){if(this._inited){for(var
t=this._fixtures,e=this.body._getBody(),i=cc.director.getPhysicsManager(),n=t.lengt
h-1;n>=0;n--){var
r=t[n];r.collider=null,i._unregisterContactFixture(r),e&&e.DestroyFixture(r)}this.b
ody=null,this._fixtures.length=0,this._shapes.length=0,this._inited=!
1}},_createShape:function(){},apply:function()
{this._destroy(),this._init()},getAABB:function(){for(var t=1e7,e=1e7,i=-1e7,r=-
1e7,s=this._fixtures,a=0;a<s.length;a++)for(var
o=s[a],l=o.GetShape().GetChildCount(),h=0;h<l;h++){var
c=o.GetAABB(h);c.lowerBound.x<t&&(t=c.lowerBound.x),c.lowerBound.y<e&&(e=c.lowerBou
nd.y),c.upperBound.x>i&&(i=c.upperBound.x),c.upperBound.y>r&&(r=c.upperBound.y)}t*=
n,e*=n,i*=n,r*=n;var u=this._rect;return u.x=t,u.y=e,u.width=i-t,u.height=r-
e,u}});cc.PhysicsCollider=e.exports=s}),
{"../CCPhysicsTypes":174,"../utils":197}],182:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPolygonSeparator"),s=cc.Class({name:"c
c.PhysicsPolygonCollider",extends:cc.PhysicsCollider,mixins:
[cc.Collider.Polygon],editor:{menu:!1,inspector:!
1,requireComponent:cc.RigidBody},_createShape:function(t){var
e=[],i=this.points;i.length>0&&i[0].equals(i[i.length-1])&&(i.length-=1);for(var
s=r.ConvexPartition(i),a=this.offset,o=0;o<s.length;o++){for(var
l=s[o],h=null,c=[],u=null,_=0,f=l.length;_<f;_++){h||(h=new b2.PolygonShape);var
d=l[_],m=(d.x+a.x)/n*t.x,p=(d.y+a.y)/n*t.y,v=new b2.Vec2(m,p);c.push(v),u||
(u=v),c.length===b2.maxPolygonVertices&&(h.Set(c,c.length),e.push(h),h=null,_<f-
1&&(c=[u,c[c.length-1]]))}h&&(h.Set(c,c.length),e.push(h))}return
e}});cc.PhysicsPolygonCollider=e.exports=s}),
{"../CCPhysicsTypes":174,"../CCPolygonSeparator":175}],183:[(function(t,e,i){"use
strict";t("./box2d-
adapter"),t("./CCPhysicsManager"),t("./CCRigidBody"),t("./CCPhysicsContact"),t("./c
ollider/CCPhysicsCollider"),t("./collider/CCPhysicsChainCollider"),t("./collider/CC
PhysicsCircleCollider"),t("./collider/CCPhysicsBoxCollider"),t("./collider/CCPhysic
sPolygonCollider"),t("./joint/CCJoint"),t("./joint/CCDistanceJoint"),t("./joint/CCR
evoluteJoint"),t("./joint/CCMouseJoint"),t("./joint/CCMotorJoint"),t("./joint/CCPri
smaticJoint"),t("./joint/CCWeldJoint"),t("./joint/CCWheelJoint"),t("./joint/CCRopeJ
oint"),t("./platform/CCPhysicsContactListner"),t("./platform/CCPhysicsAABBQueryCall
back"),t("./platform/CCPhysicsRayCastCallback")}),
{"./CCPhysicsContact":172,"./CCPhysicsManager":173,"./CCRigidBody":176,"./box2d-
adapter":177,"./collider/CCPhysicsBoxCollider":178,"./collider/CCPhysicsChainCollid
er":179,"./collider/CCPhysicsCircleCollider":180,"./collider/CCPhysicsCollider":181
,"./collider/CCPhysicsPolygonCollider":182,"./joint/CCDistanceJoint":184,"./joint/C
CJoint":185,"./joint/CCMotorJoint":186,"./joint/CCMouseJoint":187,"./joint/CCPrisma
ticJoint":188,"./joint/CCRevoluteJoint":189,"./joint/CCRopeJoint":190,"./joint/CCWe
ldJoint":191,"./joint/CCWheelJoint":192,"./platform/CCPhysicsAABBQueryCallback":193
,"./platform/CCPhysicsContactListner":194,"./platform/CCPhysicsRayCastCallback":196
}],184:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.DistanceJoint",extends:cc.J
oint,editor:!1,properties:{_distance:1,_frequency:0,_dampingRatio:0,distance:
{tooltip:!1,get:function(){return this._distance},set:function(t)
{this._distance=t,this._joint&&this._joint.SetLength(t)}},frequency:{tooltip:!
1,get:function(){return this._frequency},set:function(t)
{this._frequency=t,this._joint&&this._joint.SetFrequency(t)}},dampingRatio:
{tooltip:!1,get:function(){return this._dampingRatio},set:function(t)
{this._dampingRatio=t,this._joint&&this._joint.SetDampingRatio(t)}}},_createJointDe
f:function(){var t=new b2.DistanceJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.length=this.distance/n
,t.dampingRatio=this.dampingRatio,t.frequencyHz=this.frequency,t}});cc.DistanceJoin
t=e.exports=r}),{"../CCPhysicsTypes":174}],185:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.Joint",extends:cc.Component
,editor:{requireComponent:cc.RigidBody},properties:{anchor:
{default:cc.v2(0,0),tooltip:!1},connectedAnchor:{default:cc.v2(0,0),tooltip:!
1},connectedBody:{default:null,type:cc.RigidBody,tooltip:!1},collideConnected:
{default:!1,tooltip:!1}},onDisable:function(){this._destroy()},onEnable:function()
{this._init()},start:function(){this._init()},apply:function()
{this._destroy(),this._init()},getWorldAnchor:function(){if(this._joint){var
t=this._joint.GetAnchorA();return cc.v2(t.x*n,t.y*n)}return
cc.Vec2.ZERO},getWorldConnectedAnchor:function(){if(this._joint){var
t=this._joint.GetAnchorB();return cc.v2(t.x*n,t.y*n)}return
cc.Vec2.ZERO},getReactionForce:function(t){var e=cc.v2();return this._joint?
this._joint.GetReactionForce(t,e):e},getReactionTorque:function(t){return
this._joint?this._joint.GetReactionTorque(t):0},_init:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__init",
[])},_destroy:function()
{cc.director.getPhysicsManager().pushDelayEvent(this,"__destroy",
[])},__init:function(){if(!
this._inited&&(this.body=this.getComponent(cc.RigidBody),this._isValid())){var
t=this._createJointDef();if(!
t)return;t.bodyA=this.body._getBody(),t.bodyB=this.connectedBody._getBody(),t.colli
deConnected=this.collideConnected,cc.director.getPhysicsManager()._addJoint(this,t)
,this._inited=!0}},__destroy:function()
{this._inited&&(cc.director.getPhysicsManager()._removeJoint(this),this._joint=null
,this._inited=!1)},_createJointDef:function(){return null},_isValid:function()
{return
this.body&&this.body._getBody()&&this.connectedBody&&this.connectedBody._getBody()}
});cc.Joint=e.exports=r}),{"../CCPhysicsTypes":174}],186:[(function(t,e,i){"use
strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,
s=cc.Class({name:"cc.MotorJoint",extends:cc.Joint,editor:!1,properties:
{_linearOffset:cc.v2(0,0),_angularOffset:0,_maxForce:1,_maxTorque:1,_correctionFact
or:.3,anchor:{tooltip:!1,default:cc.v2(0,0),override:!0,visible:!
1},connectedAnchor:{tooltip:!1,default:cc.v2(0,0),override:!0,visible:!
1},linearOffset:{tooltip:!1,get:function(){return
this._linearOffset},set:function(t)
{this._linearOffset=t,this._joint&&this._joint.SetLinearOffset(new
b2.Vec2(t.x/n,t.y/n))}},angularOffset:{tooltip:!1,get:function(){return
this._angularOffset},set:function(t)
{this._angularOffset=t,this._joint&&this._joint.SetAngularOffset(t)}},maxForce:
{tooltip:!1,get:function(){return this._maxForce},set:function(t)
{this._maxForce=t,this._joint&&this._joint.SetMaxForce(t)}},maxTorque:{tooltip:!
1,get:function(){return this._maxTorque},set:function(t)
{this._maxTorque=t,this._joint&&this._joint.SetMaxTorque(t)}},correctionFactor:
{tooltip:!1,get:function(){return this._correctionFactor},set:function(t)
{this._correctionFactor=t,this._joint&&this._joint.SetCorrectionFactor(t)}}},_creat
eJointDef:function(){var t=new b2.MotorJointDef;return t.linearOffset=new
b2.Vec2(this.linearOffset.x/n,this.linearOffset.y/n),t.angularOffset=this.angularOf
fset*r,t.maxForce=this.maxForce,t.maxTorque=this.maxTorque,t.correctionFactor=this.
correctionFactor,t}});cc.MotorJoint=e.exports=s}),{"../CCPhysicsTypes":174}],187:
[(function(t,e,i){"use strict";var n=t("../CCPhysicsTypes").PTM_RATIO,r=new
b2.Vec2,s=cc.Class({name:"cc.MouseJoint",extends:cc.Joint,editor:!1,properties:
{_target:1,_frequency:5,_dampingRatio:.7,_maxForce:0,connectedBody:
{default:null,type:cc.RigidBody,visible:!1,override:!0},collideConnected:{default:!
0,visible:!1,override:!0},anchor:{tooltip:!1,default:cc.v2(0,0),override:!
0,visible:!1},connectedAnchor:{tooltip:!1,default:cc.v2(0,0),override:!0,visible:!
1},mouseRegion:{tooltip:!1,default:null,type:cc.Node},target:{tooltip:!1,visible:!
1,get:function(){return this._target},set:function(t)
{this._target=t,this._joint&&(r.x=t.x/n,r.y=t.y/n,this._joint.SetTarget(r))}},frequ
ency:{tooltip:!1,get:function(){return this._frequency},set:function(t)
{this._frequency=t,this._joint&&this._joint.SetFrequency(t)}},dampingRatio:
{tooltip:!1,get:function(){return this._dampingRatio},set:function(t)
{this._dampingRatio=t,this._joint&&this._joint.SetDampingRatio(t)}},maxForce:
{tooltip:!1,visible:!1,get:function(){return this._maxForce},set:function(t)
{this._maxForce=t,this._joint&&this._joint.SetMaxForce(t)}}},onLoad:function(){var
t=this.mouseRegion||
this.node;t.on(cc.Node.EventType.TOUCH_START,this.onTouchBegan,this),t.on(cc.Node.E
ventType.TOUCH_MOVE,this.onTouchMove,this),t.on(cc.Node.EventType.TOUCH_END,this.on
TouchEnd,this),t.on(cc.Node.EventType.TOUCH_CANCEL,this.onTouchEnd,this)},onEnable:
function(){},start:function(){},onTouchBegan:function(t){var
e=cc.director.getPhysicsManager(),i=this._pressPoint=t.touch.getLocation();cc.Camer
a&&cc.Camera.main&&(i=cc.Camera.main.getCameraToWorldPoint(i));var
n=e.testPoint(i);n&&((this.connectedBody=n.body).awake=!
0,this.maxForce=1e3*this.connectedBody.getMass(),this.target=i,this._init())},onTou
chMove:function(t){this._pressPoint=t.touch.getLocation()},onTouchEnd:function(t)
{this._destroy(),this._pressPoint=null},_createJointDef:function(){var t=new
b2.MouseJointDef;return

r.x=this.target.x/n,r.y=this.target.y/n,t.target=r,t.maxForce=this.maxForce,t.dampi
ngRatio=this.dampingRatio,t.frequencyHz=this.frequency,t},update:function()
{if(this._pressPoint&&this._isValid()){var
t=cc.Camera.findCamera(this.node);this.target=t?
t.getCameraToWorldPoint(this._pressPoint):this._pressPoint}}});cc.MouseJoint=e.expo
rts=s}),{"../CCPhysicsTypes":174}],188:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,
s=cc.Class({name:"cc.PrismaticJoint",extends:cc.Joint,editor:!1,properties:
{localAxisA:{default:cc.v2(1,0),tooltip:!1},referenceAngle:{default:0,tooltip:!
1},enableLimit:{default:!1,tooltip:!1},enableMotor:{default:!1,tooltip:!
1},lowerLimit:{default:0,tooltip:!1},upperLimit:{default:0,tooltip:!
1},_maxMotorForce:0,_motorSpeed:0,maxMotorForce:{tooltip:!1,get:function(){return
this._maxMotorForce},set:function(t)
{this._maxMotorForce=t,this._joint&&this._joint.SetMaxMotorForce(t)}},motorSpeed:
{tooltip:!1,get:function(){return this._motorSpeed},set:function(t)
{this._motorSpeed=t,this._joint&&this._joint.SetMotorSpeed(t)}}},_createJointDef:fu
nction(){var t=new b2.PrismaticJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.localAxisA=new
b2.Vec2(this.localAxisA.x,this.localAxisA.y),t.referenceAngle=this.referenceAngle*r
,t.enableLimit=this.enableLimit,t.lowerTranslation=this.lowerLimit/n,t.upperTransla
tion=this.upperLimit/n,t.enableMotor=this.enableMotor,t.maxMotorForce=this.maxMotor
Force,t.motorSpeed=this.motorSpeed,t}});cc.PrismaticJoint=e.exports=s}),
{"../CCPhysicsTypes":174}],189:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,
s=t("../CCPhysicsTypes").PHYSICS_ANGLE_TO_ANGLE,a=cc.Class({name:"cc.RevoluteJoint"
,extends:cc.Joint,editor:!1,properties:
{_maxMotorTorque:0,_motorSpeed:0,_enableLimit:!1,_enableMotor:!1,referenceAngle:
{default:0,tooltip:!1},lowerAngle:{default:0,tooltip:!1},upperAngle:
{default:0,tooltip:!1},maxMotorTorque:{tooltip:!1,get:function(){return
this._maxMotorTorque},set:function(t)
{this._maxMotorTorque=t,this._joint&&this._joint.SetMaxMotorTorque(t)}},motorSpeed:
{tooltip:!1,get:function(){return this._motorSpeed},set:function(t)
{this._motorSpeed=t,this._joint&&this._joint.SetMotorSpeed(t*r)}},enableLimit:
{tooltip:!1,get:function(){return this._enableLimit},set:function(t)
{this._enableLimit=t,this._joint&&this._joint.EnableLimit(t)}},enableMotor:
{tooltip:!1,get:function(){return this._enableMotor},set:function(t)
{this._enableMotor=t,this._joint&&this._joint.EnableMotor(t)}}},getJointAngle:funct
ion(){return this._joint?this._joint.GetJointAngle()*s:0},setLimits:function(t,e)
{if(this._joint)return this._joint.SetLimits(t*r,e*r)},_createJointDef:function()
{var t=new b2.RevoluteJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.lowerAngle=this.upperA
ngle*r,t.upperAngle=this.lowerAngle*r,t.maxMotorTorque=this.maxMotorTorque,t.motorS
peed=this.motorSpeed*r,t.enableLimit=this.enableLimit,t.enableMotor=this.enableMoto
r,t.referenceAngle=this.referenceAngle*r,t}});cc.RevoluteJoint=e.exports=a}),
{"../CCPhysicsTypes":174}],190:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.Class({name:"cc.RopeJoint",extends:cc.Joint
,editor:!1,properties:{_maxLength:1,maxLength:{tooltip:!1,get:function(){return
this._maxLength},set:function(t)
{this._maxLength=t,this._joint&&this._joint.SetMaxLength(t)}}},_createJointDef:func
tion(){var t=new b2.RopeJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.maxLength=this.maxLeng
th/n,t}});cc.RopeJoint=e.exports=r}),{"../CCPhysicsTypes":174}],191:
[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,
s=cc.Class({name:"cc.WeldJoint",extends:cc.Joint,editor:!1,properties:
{referenceAngle:{default:0,tooltip:!1},_frequency:0,_dampingRatio:0,frequency:
{tooltip:!1,get:function(){return this._frequency},set:function(t)
{this._frequency=t,this._joint&&this._joint.SetFrequency(t)}},dampingRatio:
{tooltip:!1,get:function(){return this._dampingRatio},set:function(t)
{this._dampingRatio=t,this._joint&&this._joint.SetDampingRatio(t)}}},_createJointDe
f:function(){var t=new b2.WeldJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.referenceAngle=this.re
ferenceAngle*r,t.frequencyHz=this.frequency,t.dampingRatio=this.dampingRatio,t}});c
c.WeldJoint=e.exports=s}),{"../CCPhysicsTypes":174}],192:[(function(t,e,i){"use
strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=t("../CCPhysicsTypes").ANGLE_TO_PHYSICS_ANGLE,
s=cc.Class({name:"cc.WheelJoint",extends:cc.Joint,editor:!1,properties:
{_maxMotorTorque:0,_motorSpeed:0,_enableMotor:!
1,_frequency:2,_dampingRatio:.7,localAxisA:{default:cc.v2(1,0),tooltip:!
1},maxMotorTorque:{tooltip:!1,get:function(){return
this._maxMotorTorque},set:function(t)
{this._maxMotorTorque=t,this._joint&&this._joint.SetMaxMotorTorque(t)}},motorSpeed:
{tooltip:!1,get:function(){return this._motorSpeed},set:function(t)
{this._motorSpeed=t,this._joint&&this._joint.SetMotorSpeed(t*r)}},enableMotor:
{tooltip:!1,get:function(){return this._enableMotor},set:function(t)
{this._enableMotor=t,this._joint&&this._joint.EnableMotor(t)}},frequency:{tooltip:!
1,get:function(){return this._frequency},set:function(t)
{this._frequency=t,this._joint&&this._joint.SetFrequency(t)}},dampingRatio:
{tooltip:!1,get:function(){return this._dampingRatio},set:function(t)
{this._dampingRatio=t,this._joint&&this._joint.SetDampingRatio(t)}}},_createJointDe
f:function(){var t=new b2.WheelJointDef;return t.localAnchorA=new
b2.Vec2(this.anchor.x/n,this.anchor.y/n),t.localAnchorB=new
b2.Vec2(this.connectedAnchor.x/n,this.connectedAnchor.y/n),t.localAxisA=new
b2.Vec2(this.localAxisA.x,this.localAxisA.y),t.maxMotorTorque=this.maxMotorTorque,t
.motorSpeed=this.motorSpeed*r,t.enableMotor=this.enableMotor,t.dampingRatio=this.da
mpingRatio,t.frequencyHz=this.frequency,t}});cc.WheelJoint=e.exports=s}),
{"../CCPhysicsTypes":174}],193:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").BodyType;function r(){this._point=new
b2.Vec2,this._isPoint=!1,this._fixtures=[]}r.prototype.init=function(t){t?
(this._isPoint=!0,this._point.x=t.x,this._point.y=t.y):this._isPoint=!
1,this._fixtures.length=0},r.prototype.ReportFixture=function(t)
{if(t.GetBody().GetType()===n.Dynamic)if(this._isPoint)
{if(t.TestPoint(this._point))return this._fixtures.push(t),!1}else
this._fixtures.push(t);return!0},r.prototype.getFixture=function(){return
this._fixtures[0]},r.prototype.getFixtures=function(){return
this._fixtures},cc.PhysicsAABBQueryCallback=e.exports=r}),
{"../CCPhysicsTypes":174}],194:[(function(t,e,i){"use strict";function n()
{this._contactFixtures=[]}n.prototype.setBeginContact=function(t)
{this._BeginContact=t},n.prototype.setEndContact=function(t)
{this._EndContact=t},n.prototype.setPreSolve=function(t)
{this._PreSolve=t},n.prototype.setPostSolve=function(t)
{this._PostSolve=t},n.prototype.BeginContact=function(t){if(this._BeginContact){var
e=t.GetFixtureA(),i=t.GetFixtureB(),n=this._contactFixtures;t._shouldReport=!1,-
1===n.indexOf(e)&&-1===n.indexOf(i)||(t._shouldReport=!
0,this._BeginContact(t))}},n.prototype.EndContact=function(t)
{this._EndContact&&t._shouldReport&&(t._shouldReport=!
1,this._EndContact(t))},n.prototype.PreSolve=function(t,e)
{this._PreSolve&&t._shouldReport&&this._PreSolve(t,e)},n.prototype.PostSolve=functi
on(t,e)
{this._PostSolve&&t._shouldReport&&this._PostSolve(t,e)},n.prototype.registerContac
tFixture=function(t)
{this._contactFixtures.push(t)},n.prototype.unregisterContactFixture=function(t)
{cc.js.array.remove(this._contactFixtures,t)},cc.PhysicsContactListener=e.exports=n
}),{}],195:[(function(t,e,i){"use strict";var
n=t("../CCPhysicsTypes").PTM_RATIO,r=cc.v2(),s=cc.Color.GREEN,a=cc.Color.RED;functi
on o(t){b2.Draw.call(this),this._drawer=t,this._xf=this._dxf=new
b2.Transform}cc.js.extend(o,b2.Draw),cc.js.mixin(o.prototype,
{_DrawPolygon:function(t,e){for(var i=this._drawer,s=0;s<e;s++)
{b2.Transform.MulXV(this._xf,t[s],r);var a=r.x*n,o=r.y*n;0===s?
i.moveTo(a,o):i.lineTo(a,o)}i.close()},DrawPolygon:function(t,e,i)
{this._applyStrokeColor(i),this._DrawPolygon(t,e),this._drawer.stroke()},DrawSolidP
olygon:function(t,e,i)
{this._applyFillColor(i),this._DrawPolygon(t,e),this._drawer.fill(),this._drawer.st
roke()},_DrawCircle:function(t,e){var i=this._xf.p;this._drawer.circle((t.x+i.x)*n,
(t.y+i.y)*n,e*n)},DrawCircle:function(t,e,i)
{this._applyStrokeColor(i),this._DrawCircle(t,e),this._drawer.stroke()},DrawSolidCi
rcle:function(t,e,i,n)
{this._applyFillColor(n),this._DrawCircle(t,e),this._drawer.fill()},DrawSegment:fun
ction(t,e,i){var s=this._drawer;if(t.x===e.x&&t.y===e.y)return
this._applyFillColor(i),this._DrawCircle(t,2/n),void
s.fill();this._applyStrokeColor(i),b2.Transform.MulXV(this._xf,t,r),s.moveTo(r.x*n,
r.y*n),b2.Transform.MulXV(this._xf,e,r),s.lineTo(r.x*n,r.y*n),s.stroke()},DrawTrans
form:function(t){var
e=this._drawer;e.strokeColor=a,r.x=r.y=0,b2.Transform.MulXV(t,r,r),e.moveTo(r.x*n,r
.y*n),r.x=1,r.y=0,b2.Transform.MulXV(t,r,r),e.lineTo(r.x*n,r.y*n),e.stroke(),e.stro
keColor=s,r.x=r.y=0,b2.Transform.MulXV(t,r,r),e.moveTo(r.x*n,r.y*n),r.x=0,r.y=1,b2.
Transform.MulXV(t,r,r),e.lineTo(r.x*n,r.y*n),e.stroke()},DrawPoint:function(t,e,i)
{},_applyStrokeColor:function(t){var
e=this._drawer.strokeColor;e.r=255*t.r,e.g=255*t.g,e.b=255*t.b,e.a=150,this._drawer
.strokeColor=e},_applyFillColor:function(t){var
e=this._drawer.fillColor;e.r=255*t.r,e.g=255*t.g,e.b=255*t.b,e.a=150,this._drawer.f
illColor=e},PushTransform:function(t){this._xf=t},PopTransform:function()
{this._xf=this._dxf}}),e.exports=o}),{"../CCPhysi
csTypes":174}],196:[(function(t,e,i){"use strict";function n()
{this._type=0,this._fixtures=[],this._points=[],this._normals=[],this._fractions=[]
}n.prototype.init=function(t)
{this._type=t,this._fixtures.length=0,this._points.length=0,this._normals.length=0,
this._fractions.length=0},n.prototype.ReportFixture=function(t,e,i,n){return
0===this._type?
(this._fixtures[0]=t,this._points[0]=e,this._normals[0]=i,this._fractions[0]=n,n):
(this._fixtures.push(t),this._points.push(cc.v2(e)),this._normals.push(cc.v2(i)),th
is._fractions.push(n),1===this._type?0:this._type>=2?
1:n)},n.prototype.getFixtures=function(){return
this._fixtures},n.prototype.getPoints=function(){return
this._points},n.prototype.getNormals=function(){return
this._normals},n.prototype.getFractions=function(){return
this._fractions},cc.PhysicsRayCastCallback=e.exports=n}),{}],197:[(function(t,e,i)
{"use strict";e.exports={getWorldRotation:function(t){for(var
e=t.angle,i=t.parent;i.parent;)e+=i.angle,i=i.parent;return-
e},getWorldScale:function(t){for(var
e=t.scaleX,i=t.scaleY,n=t.parent;n.parent;)e*=n.scaleX,i*=n.scaleY,n=n.parent;retur
n cc.v2(e,i)},convertToNodeRotation:function(t,e){e-=-t.angle;for(var
i=t.parent;i.parent;)e-=-i.angle,i=i.parent;return e}}}),{}],198:[(function(t,e,i)
{"use strict"}),{"../event-
manager":130,"../platform/js":220,"./CCMacro":205,"./CCSys":209}],199:
[(function(t,e,i){"use strict";t("../assets/CCAsset");var
n=t("./utils").callInNextTick,r=t("../load-pipeline/CCLoader"),s=t("../load-
pipeline/asset-table"),a=t("../load-pipeline/pack-downloader"),o=t("../load-
pipeline/auto-release-utils"),l=t("../utils/decode-uuid"),h=t("../load-
pipeline/md5-pipe"),c=t("../load-pipeline/subpackage-
pipe"),u=t("./js"),_="",f="",d=u.createMap(!0);function m(t){return
t&&(t.constructor===cc.SceneAsset||t instanceof cc.Scene)}function p(t,e)
{this.url=t,this.type=e}var v={loadAsset:function(t,e,i){if("string"!=typeof
t)return n(e,new Error("[AssetLibrary] uuid must be string"),null);var
s={uuid:t,type:"uuid"};i&&i.existingAsset&&(s.existingAsset=i.existingAsset),r.load
(s,(function(i,n){if(i||!n)i=new Error("[AssetLibrary] loading JSON or dependencies
failed: "+(i?i.message:"Unknown error"));else{if(n.constructor===cc.SceneAsset){var
s=cc.loader._getReferenceKey(t);n.scene.dependAssets=o.getDependsRecursively(s)}if(
m(n)){var
a=cc.loader._getReferenceKey(t);r.removeItem(a)}}e&&e(i,n)}))},getLibUrlNoExt:funct
ion(t,e){return t=l(t),(e?f+"assets/":_)
+t.slice(0,2)+"/"+t},_queryAssetInfoInEditor:function(t,e)
{0},_getAssetInfoInRuntime:function(t,e){e=e||{url:null,raw:!1};var i=d[t];return
i&&!u.isChildClassOf(i.type,cc.Asset)?(e.url=f+i.url,e.raw=!0):
(e.url=this.getLibUrlNoExt(t)+".json",e.raw=!1),e},_uuidInSettings:function(t)
{return t in d},queryAssetInfo:function(t,e){var
i=this._getAssetInfoInRuntime(t);e(null,i.url,i.raw)},parseUuidInEditor:function(t)
{},loadJson:function(t,e){var i=""+((new Date).getTime()
+Math.random()),n={uuid:i,type:"uuid",content:t,skips:
[r.assetLoader.id,r.downloader.id]};r.load(n,(function(t,n){if(t)t=new
Error("[AssetLibrary] loading JSON or dependencies failed:
"+t.message);else{if(n.constructor===cc.SceneAsset){var
s=cc.loader._getReferenceKey(i);n.scene.dependAssets=o.getDependsRecursively(s)}if(
m(n)){var
a=cc.loader._getReferenceKey(i);r.removeItem(a)}}n._uuid="",e&&e(t,n)}))},getAssetB
yUuid:function(t){return v._uuidToAsset[t]||null},init:function(t){var
e=t.libraryPath;if(e=e.replace(/\\/g,"/"),_=cc.path.stripSep(e)
+"/",f=t.rawAssetsBase,t.subpackages){var i=new
c(t.subpackages);cc.loader.insertPipeAfter(cc.loader.assetLoader,i),cc.loader.subPa
ckPipe=i}var n=t.md5AssetsMap;if(n&&n.import){var o=0,m=0,v=u.createMap(!
0),y=n.import;for(o=0;o<y.length;o+=2)v[m=l(y[o])]=y[o+1];var g=u.createMap(!
0);for(y=n["raw-assets"],o=0;o<y.length;o+=2)g[m=l(y[o])]=y[o+1];var x=new
h(v,g,_);cc.loader.insertPipeAfter(cc.loader.assetLoader,x),cc.loader.md5Pipe=x}var
b=r._assetTables;for(var A in b)b[A].reset();var C=t.rawAssets;if(C)for(var S in C)
{var T=C[S];for(var m in T){var w=T[m],E=w[0],M=w[1],D=cc.js._getClassById(M);if(D)
{d[m]=new p(S+"/"+E,D);var B=cc.path.extname(E);B&&(E=E.slice(0,-B.length));var
P=1===w[2];b[S]||(b[S]=new s),b[S].add(E,m,D,!P)}else cc.error("Cannot
get",M)}}t.packedAssets&&a.initPacks(t.packedAssets),cc.url._init(t.mountPaths&&t.m
ountPaths.assets||f+"assets")},_uuidToAsset:{}},y={effect:{},material:{}};function
g(t,e,i){var n=t+"s",r=y[t]={},s="internal";cc.loader.loadResDir(n,e,s,(function()
{}),(function(t,e){if(t)cc.error(t);else for(var n=0;n<e.length;n+
+)r[""+e[n].name]=e[n];i()}))}v._loadBuiltins=function(t)
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS)return
t&&t();g("effect",cc.EffectAsset,(function()
{g("material",cc.Material,t)}))},v.getBuiltin=function(t,e){return y[t]
[e]},v.getBuiltins=function(t){return t?y[t]:y},e.exports=cc.AssetLibrary=v}),
{"../assets/CCAsset":56,"../load-pipeline/CCLoader":146,"../load-pipeline/asset-
table":148,"../load-pipeline/auto-release-utils":150,"../load-pipeline/md5-
pipe":157,"../load-pipeline/pack-downloader":158,"../load-pipeline/subpackage-
pipe":161,"../utils/decode-uuid":289,"./js":220,"./utils":224}],200:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof
t},r=t("./js"),s=t("./CCEnum"),a=t("./utils"),o=(a.isPlainEmptyObj_DEV,a.cloneable_
DEV,t("./attribute")),l=o.DELIMETER,h=o.getTypeChecker,c=t("./preprocess-
class");t("./requiring-frame");var
u=["name","extends","mixins","ctor","__ctor__","properties","statics","editor","__E
S6__"];function _(t,e){t.indexOf(e)<0&&t.push(e)}var f={datas:null,push:function(t)
{if(this.datas)this.datas.push(t);else{this.datas=[t];var
e=this;setTimeout((function(){e.init()}),0)}},init:function(){var
t=this.datas;if(t){for(var e=0;e<t.length;++e){var
i=t[e],n=i.cls,s=i.props;"function"==typeof s&&(s=s());var a=r.getClassName(n);s?
P(n,a,s,n.$super,i.mixins):cc.errorID(3633,a)}this.datas=null}}};function d(t,e)
{_(t.__props__,e)}var m=[];function p(t,e,i,n,r){var
s=n.default;o.setClassAttr(t,i,"default",s),d(t,i);var a=L(t,n,e,i,!1);if(a)
{for(var l=m,h=0;h<a.length;h++){var
c=a[h];o.attr(t,i,c),c._onAfterProp&&l.push(c._onAfterProp)}for(var
u=0;u<l.length;u++)l[u](t,i);m.length=0,a.length=0}}function v(t,e,i,n,s){var
a=n.get,l=n.set,h=t.prototype,c=Object.getOwnPropertyDescriptor(h,i),u=!c;if(a)
{0;for(var _=L(t,n,e,i,!0),f=0;f<_.length;f+
+)o.attr(t,i,_[f]);_.length=0,o.setClassAttr(t,i,"serializable",!1),s||
r.get(h,i,a,u,u)}l&&(s||r.set(h,i,l,u,u))}function y(t){return"function"==typeof t?
t():t}function g(t,e,i){for(var n in e)t.hasOwnProperty(n)||i&&!i(n)||
Object.defineProperty(t,n,r.getPropertyDescriptor(e,n))}function x(t,e,i,n){var
s,a,l=n.__ctor__,h=n.ctor,c=n.__ES6__;c?(s=[h],a=h):(s=l?
[l]:M(e,i,n),a=E(s,e,t,n),r.value(a,"extend",(function(t){return
t.extends=this,I(t)}),!0)),r.value(a,"__ctors__",s.length>0?s:null,!0);var
u=a.prototype;if(e&&(c||(r.extend(a,e),u=a.prototype),a.$super=e),i){for(var
_=i.length-1;_>=0;_--){var f=i[_];g(u,f.prototype),g(a,f,(function(t){return
f.hasOwnProperty(t)&&!
0})),I._isCCClass(f)&&g(o.getClassAttrs(a).constructor.prototype,o.getClassAttrs(f)
.constructor.prototype)}u.constructor=a}return c||
(u.__initProps__=w),r.setClassName(t,a),a}function b(t,e,i,n){var
s=cc.Component,a=cc._RF.peek();if(a&&r.isChildClassOf(e,s))
{if(r.isChildClassOf(a.cls,s))return cc.errorID(3615),null;0,t=t||a.script}var
o=x(t,e,i,n);if(a)if(r.isChildClassOf(e,s)){var
l=a.uuid;l&&r._setClassId(l,o),a.cls=o}else r.isChildClassOf(a.cls,s)||
(a.cls=o);return o}function A(t){for(var e=r.getClassName(t),i=t.constructor,n="new
"+e+"(",s=0;s<i.__props__.length;s++){var
a=t[i.__props__[s]];0,n+=a,s<i.__props__.length-1&&(n+=",")}return n+")"}function
C(t){return
JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}functio
n S(t,e){for(var i=[],r="",s=0;s<e.length;s++){var a=e[s],o=a+l+"default";if(o in
t){var h,c;h=T.test(a)?"this."+a+"=":"this["+C(a)+"]=";var
u=t[o];if("object"===(void 0===u?"undefined":n(u))&&u)c=u instanceof cc.ValueType?
A(u):Array.isArray(u)?"[]":"{}";else if("function"==typeof u){var
_=i.length;i.push(u),c="F["+_+"]()"}else c="string"==typeof u?
C(u):u;r+=h=h+c+";\n"}}return 0===i.length?Function(r):Function("F","return
(function(){\n"+r+"})")(i)}var T=/^[A-Za-z_$][0-9A-Za-z_$]*$/;function w(t){var
e=o.getClassAttrs(t),i=t.__props__;null===i&&(f.init(),i=t.__props__);var
n=S(e,i);t.prototype.__initProps__=n,n.call(this)}var E=function(t,e,i,n){var
r="return function CCClass()
{\n";e&&B(e,n,i)&&(r+="this._super=null;\n"),r+="this.__initProps__(CCClass);\n";va
r s=t.length;if(s>0){0;var
a="].apply(this,arguments);\n";if(1===s)r+="CCClass.__ctors__[0"+a;else{r+="var
cs=CCClass.__ctors__;\n";for(var o=0;o<s;o++)r+="cs["+o+a}0}return
r+="}",Function(r)()};function M(t,e,i){function n(t){return I._isCCClass(t)?
t.__ctors__||[]:[t]}for(var r=[],s=[t].concat(e),a=0;a<s.length;a++){var
o=s[a];if(o)for(var l=n(o),h=0;h<l.length;h++)_(r,l[h])}var c=i.ctor;return
c&&r.push(c),r}var D=/xyz/.test((function()
{xyz}))?/\b\._super\b/:/.*/;/xyz/.test((function(){xyz}));function B(t,e,i){var n=!
1;for(var s in e)if(!(u.indexOf(s)>=0)){var a=e[s];if("function"==typeof a){var
o=r.getPropertyDescriptor(t.prototype,s);if(o){var l=o.value;if("function"==typeof
l){D.test(a)&&(n=!0,e[s]=(function(t,e){return function(){var
i=this._super;this._super=t;var n=e.apply(this,arguments);return this._super=i,n}})
(l,a));continue}}0}}return n}function P(t,e,i,n,r,s)
{if(t.__props__=[],n&&n.__props__&&(t.__props__=n.__props__.slice()),r)for(var
a=0;a<r.length;++a){var
h=r[a];h.__props__&&(t.__props__=t.__props__.concat(h.__props__.filter((function(e)
{return t.__props__.indexOf(e)<0}))))}if(i)for(var u in
c.preprocessAttrs(i,e,t,s),i){var _=i[u];"default"in _?p(t,e,u,_):v(t,e,u,_,s)}var
f=o.getClassAttrs(t);t.__values__=t.__props__.filter((function(t){return!1!
==f[t+l+"serializable"]}))}function I(t){var e=(t=t||
{}).name,i=t.extends,n=t.mixins,s=b(e,i,n,t);e||
(e=cc.js.getClassName(s)),s._sealed=!0,i&&(i._sealed=!1);var
a=t.properties;"function"==typeof a||i&&null===i.__props__||n&&n.some((function(t)
{return null===t.__props__}))?
(f.push({cls:s,props:a,mixins:n}),s.__props__=s.__values__=null):P(s,e,a,i,t.mixins
,t.__ES6__);var o,l=t.statics;if(l)for(o in l)s[o]=l[o];for(var h in t)if(!
(u.indexOf(h)>=0)){var
_=t[h];c.validateMethodWithProps(_,h,e,s,i)&&r.value(s.prototype,h,_,!0,!0)}var
d=t.editor;return
d&&r.isChildClassOf(i,cc.Component)&&cc.Component._registerEditorProps(s,d),s}I._is
CCClass=function(t){return
t&&t.hasOwnProperty("__ctors__")},I._fastDefine=function(t,e,i)
{r.setClassName(t,e);for(var
n=e.__props__=e.__values__=Object.keys(i),s=o.getClassAttrsProto(e),a=0;a<n.length;
a++){var h=n[a];s[h+l+"visible"]=!
1,s[h+l+"default"]=i[h]}},I.Attr=o,I.attr=o.attr,I.getInheritanceChain=function(t)
{for(var e=[];t=r.getSuper(t);)t!==Object&&e.push(t);return e};var
R={Integer:"Number",Float:"Number",Boolean:"Boolean",String:"String"},O=[];function
L(t,e,i,r,a){var c=null,u="";function _(){return
u=r+l,c=o.getClassAttrsProto(t)}O.length=0;var f=O,d=e.type;if(d){var
m=R[d];if(m)f.push({type:d,_onAfterProp:h(m,"cc."+d)});else if("Object"===d)0;else
if(d===o.ScriptUuid){var
p=o.ObjectType(cc.ScriptAsset);p.type="Script",f.push(p)}else"object"===(void
0===d?"undefined":n(d))?
s.isEnum(d)&&f.push({type:"Enum",enumList:s.getList(d)}):"function"==typeof
d&&(e.url?
f.push({type:"Object",ctor:d,_onAfterProp:h("String","cc.String")}):f.push(e._short
?{type:"Object",ctor:d}:o.ObjectType(d)))}function v(t,i){if(t in e){var r=e[t];
(void 0===r?"undefined":n(r))===i&&((c||_())[u+t]=r)}}e.editorOnly&&((c||_())
[u+"editorOnly"]=!0),e.url&&((c||_())[u+"saveUrlAsAsset"]=!0),!
1===e.serializable&&((c||_())[u+"serializable"]=!
1),v("formerlySerializedAs","string");var y=e.range;return
y&&Array.isArray(y)&&y.length>=2&&((c||_())
[u+"min"]=y[0],c[u+"max"]=y[1],y.length>2&&(c[u+"step"]=y[2])),v("min","number"),v(
"max","number"),v("step","number"),f}cc.Class=I,e.exports={isArray:function(t)
{return
t=y(t),Array.isArray(t)},fastDefine:I._fastDefine,getNewValueTypeCode:A,IDENTIFIER_
RE:T,escapeForJS:C,getDefault:y}}),
{"./CCEnum":202,"./attribute":212,"./js":220,"./preprocess-class":221,"./requiring-
frame":222,"./utils":224}],201:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t};t("./CCClass");var r=t("./preprocess-
class"),s=t("./js"),a="__ccclassCache__";function o(t){return t}function l(t,e)
{return t[e]||(t[e]={})}function h(t){return function(e){return"function"==typeof
e?t(e):function(i){return t(i,e)}}}function c(t,e,i){return function(t){return
function(i){return e(i,t)}}}var u=c.bind(null,!1);function _(t){return
c.bind(null,!1)}var f=_(),d=_();function m(t,e){return l(t,a)}function p(t){var
e;try{e=t()}catch(e){return t}return"object"!==(void 0===e?"undefined":n(e))||
null===e?e:t}function v(t){var e;try{e=new t}catch(t){return{}}return e}function
y(t,e,i,n,a,o){var l;n&&(l=(l=r.getFullFormOfProperty(n))||n);var
h=e[i],c=s.mixin(h||{},l||{});if(a&&(a.get||a.set))
{a.get&&(c.get=a.get),a.set&&(c.set=a.set)}else{0;var u=void
0;if(a)a.initializer&&(u=p(a.initializer),!0);else{var _=o.default||
(o.default=v(t));_.hasOwnProperty(i)&&(u=_[i],!0)}0,c.default=u}e[i]=c}var
g=h((function(t,e){var i=s.getSuper(t);i===Object&&(i=null);var
n={name:e,extends:i,ctor:t,__ES6__:!0},r=t[a];if(r){var
o=r.proto;o&&s.mixin(n,o),t[a]=void 0}return cc.Class(n)}));function x(t,e,i)
{return t((function(t,n){var r=m(t);if(r){var s=void 0!==i?
i:n;l(l(r,"proto"),"editor")[e]=s}}),e)}function b(t){return t(o)}var
A=b(h),C=x(u,"requireComponent"),S=b(f),T=x(d,"executionOrder"),w=b(h),E=b(h),M=b(f
),D=b(f),B=b(f);cc._decorator=e.exports={ccclass:g,property:function(t,e,i){var
n=null;function r(t,e,i){var r=m(t.constructor);if(r){var
s=l(l(r,"proto"),"properties");y(t.constructor,s,e,n,i,r)}}if(void 0===e)return
n=t,r;r(t,e,i)},executeInEditMode:A,requireComponent:C,menu:S,executionOrder:T,disa
llowMultiple:w,playOnFocus:E,inspector:M,icon:D,help:B,mixins:function(){for(var
t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var
i=m(e);i&&(l(i,"proto").mixins=t)}}}}),{"./CCClass":200,"./js":220,"./preprocess-
class":221,"./utils":224}],202:[(function(t,e,i){"use strict";var
n=t("./js");function r(t){if("__enums__"in t)return t;n.value(t,"__enums__",null,!
0);for(var e=-1,i=Object.keys(t),r=0;r<i.length;r++){var s=i[r],a=t[s];if(-
1===a)a=++e,t[s]=a;else if("number"==typeof a)e=a;else if("string"==typeof
a&&Number.isInteger(parseFloat(s)))continue;var o=""+a;s!==o&&n.value(t,o,s)}return
t}r.isEnum=function(t){return
t&&t.hasOwnProperty("__enums__")},r.getList=function(t){if(t.__enums__)return
t.__enums__;var e=t.__enums__=[];for(var i in t){var
n=t[i];Number.isInteger(n)&&e.push({name:i,value:n})}return e.sort((function(t,e)
{return t.value-e.value})),e},e.exports=cc.Enum=r}),{"./js":220}],203:
[(function(t,e,i){"use strict";var n=t("../event-
manager"),r=t("./CCInputManager"),s=void 0;cc.Acceleration=function(t,e,i,n)
{this.x=t||0,this.y=e||0,this.z=i||0,this.timestamp=n||
0},r.setAccelerometerEnabled=function(t){var e=this;if(e._accelEnabled!==t)
{e._accelEnabled=t;var
i=cc.director.getScheduler();i.enableForTarget(e),e._accelEnabled?
(e._registerAccelerometerEvent(),e._accelCurTime=0,i.scheduleUpdate(e)):
(e._unregisterAccelerometerEvent(),e._accelCurTime=0,i.unscheduleUpdate(e))}},r.set
AccelerometerInterval=function(t){this._accelInterval!
==t&&(this._accelInterval=t)},r._registerKeyboardEvent=function()
{cc.game.canvas.addEventListener("keydown",(function(t){n.dispatchEvent(new
cc.Event.EventKeyboard(t.keyCode,!0)),t.stopPropagation(),t.preventDefault()}),!
1),cc.game.canvas.addEventListener("keyup",(function(t){n.dispatchEvent(new
cc.Event.EventKeyboard(t.keyCode,!1)),t.stopPropagation(),t.preventDefault()}),!
1)},r._registerAccelerometerEvent=function(){var
t=window,e=this;e._acceleration=new
cc.Acceleration,e._accelDeviceEvent=t.DeviceMotionEvent||
t.DeviceOrientationEvent,cc.sys.browserType===cc.sys.BROWSER_TYPE_MOBILE_QQ&&(e._ac
celDeviceEvent=window.DeviceOrientationEvent);var
i=e._accelDeviceEvent===t.DeviceMotionEvent?"devicemotion":"deviceorientation",n=na
vigator.userAgent;
(/Android/.test(n)||/Adr/.test(n)&&cc.sys.browserType===cc.BROWSER_TYPE_UC)&&(e._mi
nus=-1),s=e.didAccelerate.bind(e),t.addEventListener(i,s,!
1)},r._unregisterAccelerometerEvent=function(){var
t=window,e=this._accelDeviceEvent===t.DeviceMotionEvent?"devicemotion":"deviceorien
tation";s&&t.removeEventListener(e,s,!1)},r.didAccelerate=function(t){var
e=this,i=window;if(e._accelEnabled){var n=e._acceleration,r=void 0,s=void 0,a=void
0;if(e._accelDeviceEvent===window.DeviceMotionEvent){var
o=t.accelerationIncludingGravity;r=e._accelMinus*o.x*.1,s=e._accelMinus*o.y*.1,a=.1
*o.z}else r=t.gamma/90*.981,s=-
t.beta/90*.981,a=t.alpha/90*.981;if(cc.view._isRotated){var l=r;r=-
s,s=l}n.x=r,n.y=s,n.z=a,n.timestamp=t.timeStamp||Date.now();var
h=n.x;90===i.orientation?(n.x=-n.y,n.y=h):-90===i.orientation?(n.x=n.y,n.y=-
h):180===i.orientation&&(n.x=-n.x,n.y=-
n.y),cc.sys.os===cc.sys.OS_ANDROID&&cc.sys.browserType!
==cc.sys.BROWSER_TYPE_MOBILE_QQ&&(n.x=-n.x,n.y=-n.y)}}}),{"../event-
manager":130,"./CCInputManager":204}],204:[(function(t,e,i){"use strict";var
n=t("./CCMacro"),r=t("./CCSys"),s=t("../event-
manager"),a=n.TOUCH_TIMEOUT,o=cc.v2(),l={_mousePressed:!1,_isRegisterEvent:!
1,_preTouchPoint:cc.v2(0,0),_prevMousePoint:cc.v2(0,0),_preTouchPool:
[],_preTouchPoolPointer:0,_touches:[],_touchesIntegerDict:
{},_indexBitsUsed:0,_maxTouches:8,_accelEnabled:!
1,_accelInterval:.2,_accelMinus:1,_accelCurTime:0,_acceleration:null,_accelDeviceEv
ent:null,_getUnUsedIndex:function(){for(var
t=this._indexBitsUsed,e=cc.sys.now(),i=0;i<this._maxTouches;i++){if(!(1&t))return
this._indexBitsUsed|=1<<i,i;var n=this._touches[i];if(e-n._lastModified>a)return
this._removeUsedIndexBit(i),delete
this._touchesIntegerDict[n.getID()],i;t>>=1}return-
1},_removeUsedIndexBit:function(t){if(!(t<0||t>=this._maxTouches)){var
e=1<<t;e=~e,this._indexBitsUsed&=e}},_glView:null,handleTouchesBegin:function(t)
{for(var e=void 0,i=void 0,n=void
0,a=[],o=this._touchesIntegerDict,l=r.now(),h=0,c=t.length;h<c;h+
+)if(null==o[n=(e=t[h]).getID()]){var u=this._getUnUsedIndex();if(-1===u)
{cc.logID(2300,u);continue}(i=this._touches[u]=new
cc.Touch(e._point.x,e._point.y,e.getID()))._lastModified=l,i._setPrevPoint(e._prevP
oint),o[n]=u,a.push(i)}if(a.length>0){this._glView._convertTouchesWithScale(a);var
_=new
cc.Event.EventTouch(a);_._eventCode=cc.Event.EventTouch.BEGAN,s.dispatchEvent(_)}},
handleTouchesMove:function(t){for(var e=void 0,i=void 0,n=void
0,a=[],o=this._touches,l=r.now(),h=0,c=t.length;h<c;h++)n=(e=t[h]).getID(),null!
=(i=this._touchesIntegerDict[n])&&o[i]&&(o[i]._setPoint(e._point),o[i]._setPrevPoin
t(e._prevPoint),o[i]._lastModified=l,a.push(o[i]));if(a.length>0)
{this._glView._convertTouchesWithScale(a);var u=new
cc.Event.EventTouch(a);u._eventCode=cc.Event.EventTouch.MOVED,s.dispatchEvent(u)}},
handleTouchesEnd:function(t){var
e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0)
{this._glView._convertTouchesWithScale(e);var i=new
cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.ENDED,s.dispatchEvent(i)}th
is._preTouchPool.length=0},handleTouchesCancel:function(t){var
e=this.getSetOfTouchesEndOrCancel(t);if(e.length>0)
{this._glView._convertTouchesWithScale(e);var i=new
cc.Event.EventTouch(e);i._eventCode=cc.Event.EventTouch.CANCELLED,s.dispatchEvent(i
)}this._preTouchPool.length=0},getSetOfTouchesEndOrCancel:function(t){for(var
e=void 0,i=void 0,n=void
0,r=[],s=this._touches,a=this._touchesIntegerDict,o=0,l=t.length;o<l;o++)null!
=(i=a[n=(e=t[o]).getID()])&&s
[i]&&(s[i]._setPoint(e._point),s[i]._setPrevPoint(e._prevPoint),r.push(s[i]),this._
removeUsedIndexBit(i),delete a[n]);return r},getHTMLElementPosition:function(t){var
e=document.documentElement,i=window.pageXOffset-e.clientLeft,n=window.pageYOffset-
e.clientTop;if(t.getBoundingClientRect){var
r=t.getBoundingClientRect();return{left:r.left+i,top:r.top+n,width:r.width,height:r
.height}}return t instanceof HTMLCanvasElement?
{left:i,top:n,width:t.width,height:t.height}:
{left:i,top:n,width:parseInt(t.style.width),height:parseInt(t.style.height)}},getPr
eTouch:function(t){for(var e=null,i=this._preTouchPool,n=t.getID(),r=i.length-
1;r>=0;r--)if(i[r].getID()===n){e=i[r];break}return e||
(e=t),e},setPreTouch:function(t){for(var e=!
1,i=this._preTouchPool,n=t.getID(),r=i.length-1;r>=0;r--)if(i[r].getID()===n)
{i[r]=t,e=!0;break}e||(i.length<=50?i.push(t):
(i[this._preTouchPoolPointer]=t,this._preTouchPoolPointer=(this._preTouchPoolPointe
r+1)%50))},getTouchByXY:function(t,e,i){var
n=this._preTouchPoint,r=this._glView.convertToLocationInView(t,e,i),s=new
cc.Touch(r.x,r.y,0);return
s._setPrevPoint(n.x,n.y),n.x=r.x,n.y=r.y,s},getMouseEvent:function(t,e,i){var
n=this._prevMousePoint,r=new cc.Event.EventMouse(i);return
r._setPrevCursor(n.x,n.y),n.x=t.x,n.y=t.y,this._glView._convertMouseToLocationInVie
w(n,e),r.setLocation(n.x,n.y),r},getPointByEvent:function(t,e){return null!
=t.pageX?{x:t.pageX,y:t.pageY}:(e.left-=document.body.scrollLeft,e.top-
=document.body.scrollTop,
{x:t.clientX,y:t.clientY})},getTouchesByEvent:function(t,e){for(var
i=[],n=this._glView,s=void 0,a=void 0,l=void
0,h=this._preTouchPoint,c=t.changedTouches.length,u=0;u<c;u+
+)if(s=t.changedTouches[u]){var _=void 0;_=r.BROWSER_TYPE_FIREFOX===r.browserType?
n.convertToLocationInView(s.pageX,s.pageY,e,o):n.convertToLocationInView(s.clientX,
s.clientY,e,o),null!=s.identifier?(a=new
cc.Touch(_.x,_.y,s.identifier),l=this.getPreTouch(a).getLocation(),a._setPrevPoint(
l.x,l.y),this.setPreTouch(a)):(a=new
cc.Touch(_.x,_.y))._setPrevPoint(h.x,h.y),h.x=_.x,h.y=_.y,i.push(a)}return
i},registerSystemEvent:function(t){if(!this._isRegisterEvent)
{this._glView=cc.view;var e=this,i=r.isMobile,n="mouse"in
r.capabilities,a="touches"in r.capabilities;if(n){i||
(window.addEventListener("mousedown",(function(){e._mousePressed=!0}),!
1),window.addEventListener("mouseup",(function(i){if(e._mousePressed)
{e._mousePressed=!1;var n=e.getHTMLElementPosition(t),r=e.getPointByEvent(i,n);if(!
cc.rect(n.left,n.top,n.width,n.height).contains(r))
{e.handleTouchesEnd([e.getTouchByXY(r.x,r.y,n)]);var
a=e.getMouseEvent(r,n,cc.Event.EventMouse.UP);a.setButton(i.button),s.dispatchEvent
(a)}}}),!1));for(var o=cc.Event.EventMouse,l=[!
i&&["mousedown",o.DOWN,function(i,n,r,s){e._mousePressed=!
0,e.handleTouchesBegin([e.getTouchByXY(r.x,r.y,s)]),t.focus()}],!
i&&["mouseup",o.UP,function(t,i,n,r){e._mousePressed=!
1,e.handleTouchesEnd([e.getTouchByXY(n.x,n.y,r)])}],!
i&&["mousemove",o.MOVE,function(t,i,n,r)
{e.handleTouchesMove([e.getTouchByXY(n.x,n.y,r)]),e._mousePressed||
i.setButton(null)}],["mousewheel",o.SCROLL,function(t,e)
{e.setScrollData(0,t.wheelDelta)}],["DOMMouseScroll",o.SCROLL,function(t,e)
{e.setScrollData(0,-120*t.detail)}]],h=0;h<l.length;++h){var c=l[h];c&&(function()
{var i=c[0],n=c[1],r=c[2];t.addEventListener(i,(function(i){var
a=e.getHTMLElementPosition(t),o=e.getPointByEvent(i,a),l=e.getMouseEvent(o,a,n);l.s
etButton(i.button),r(i,l,o,a),s.dispatchEvent(l),i.stopPropagation(),i.preventDefau
lt()}),!1)})()}}if(window.navigator.msPointerEnabled){var
u={MSPointerDown:e.handleTouchesBegin,MSPointerMove:e.handleTouchesMove,MSPointerUp
:e.handleTouchesEnd,MSPointerCancel:e.handleTouchesCancel},_=function(i){var
n=u[i];t.addEventListener(i,(function(i){var r=e.getHTMLElementPosition(t);r.left-
=document.documentElement.scrollLeft,r.top-
=document.documentElement.scrollTop,n.call(e,
[e.getTouchByXY(i.clientX,i.clientY,r)]),i.stopPropagation()}),!1)};for(var f in
u)_(f)}if(a){var d={touchstart:function(i)
{e.handleTouchesBegin(i),t.focus()},touchmove:function(t)
{e.handleTouchesMove(t)},touchend:function(t)
{e.handleTouchesEnd(t)},touchcancel:function(t){e.handleTouchesCancel(t)}},m=void
0;for(var f in cc.sys.browserType===cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB?
(d={onTouchStart:d.touchstart,onTouchMove:d.touchmove,onTouchEnd:d.touchend,onTouch
Cancel:d.touchcancel},m=function(i){var n=d[i];wx[i]((function(i)
{if(i.changedTouches){var r=e.getHTMLElementPosition(t),s=document.body;r.left-
=s.scrollLeft||0,r.top-=s.scrollTop||
0,n(e.getTouchesByEvent(i,r))}}))}):m=function(i){var n=d[i];t.addEventListener(i,
(function(i){if(i.changedTouches){var
r=e.getHTMLElementPosition(t),s=document.body;r.left-=s.scrollLeft||0,r.top-
=s.scrollTop||
0,n(e.getTouchesByEvent(i,r)),i.stopPropagation(),i.preventDefault()}}),!
1)},d)m(f)}cc.sys.browserType!
==cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB&&this._registerKeyboardEvent(),this._isRegist
erEvent=!0}},_registerKeyboardEvent:function()
{},_registerAccelerometerEvent:function(){},update:function(t)
{this._accelCurTime>this._accelInterval&&(this._accelCurTime-
=this._accelInterval,s.dispatchEvent(new
cc.Event.EventAcceleration(this._acceleration))),this._accelCurTime+=t}};e.exports=
_cc.inputManager=l}),{"../event-manager":130,"./CCMacro":205,"./CCSys":209}],205:
[(function(t,e,i){"use
strict";t("./js");cc.macro={RAD:Math.PI/180,DEG:180/Math.PI,REPEAT_FOREVER:Number.M
AX_VALUE-1,FLT_EPSILON:1.192092896e-7,MIN_ZINDEX:-
Math.pow(2,15),MAX_ZINDEX:Math.pow(2,15)-
1,ONE:1,ZERO:0,SRC_ALPHA:770,SRC_ALPHA_SATURATE:776,SRC_COLOR:768,DST_ALPHA:772,DST
_COLOR:774,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,ONE_MINUS_DST_ALPHA:773,
ONE_MINUS_DST_COLOR:775,ONE_MINUS_CONSTANT_ALPHA:32772,ONE_MINUS_CONSTANT_COLOR:327
70,ORIENTATION_PORTRAIT:1,ORIENTATION_LANDSCAPE:2,ORIENTATION_AUTO:3,DENSITYDPI_DEV
ICE:"device-dpi",DENSITYDPI_HIGH:"high-dpi",DENSITYDPI_MEDIUM:"medium-
dpi",DENSITYDPI_LOW:"low-dpi",FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX:!
0,DIRECTOR_STATS_POSITION:cc.v2(0,0),ENABLE_STACKABLE_ACTIONS:!
0,TOUCH_TIMEOUT:5e3,BATCH_VERTEX_COUNT:2e4,ENABLE_TILEDMAP_CULLING:!
0,DOWNLOAD_MAX_CONCURRENT:64,ENABLE_TRANSPARENT_CANVAS:!1,ENABLE_WEBGL_ANTIALIAS:!
1,ENABLE_CULLING:!1,CLEANUP_IMAGE_CACHE:!1,SHOW_MESH_WIREFRAME:!
1};cc.macro.SUPPORT_TEXTURE_FORMATS=[".pkm",".pvr",".webp",".jpg",".jpeg",".bmp",".
png"],cc.macro.KEY={none:0,back:6,menu:18,backspace:8,tab:9,enter:13,shift:16,ctrl:
17,alt:18,pause:19,capslock:20,escape:27,space:32,pageup:33,pagedown:34,end:35,home
:36,left:37,up:38,right:39,down:40,select:41,insert:45,Delete:46,0:48,1:49,2:50,3:5
1,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k
:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,num0
:96,num1:97,num2:98,num3:99,num4:100,num5:101,num6:102,num7:103,num8:104,num9:105,"
*":106,"+":107,"-":109,numdel:110,"/":111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117
,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,";":186,se
micolon:186,equal:187,"=":187,",":188,comma:188,dash:189,".":190,period:190,forward
slash:191,grave:192,"[":219,openbracket:219,backslash:220,"]":221,closebracket:221,
quote:222,dpadLeft:1e3,dpadRight:1001,dpadUp:1003,dpadDown:1004,dpadCenter:1005},cc
.macro.ImageFormat=cc.Enum({JPG:0,PNG:1,TIFF:2,WEBP:3,PVR:4,ETC:5,S3TC:6,ATITC:7,TG
A:8,RAWDATA:9,UNKNOWN:10}),cc.macro.BlendFactor=cc.Enum({ONE:1,ZERO:0,SRC_ALPHA:770
,SRC_COLOR:768,DST_ALPHA:772,DST_COLOR:774,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_CO
LOR:769,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775}),cc.macro.TextAlignment=cc
.Enum({LEFT:0,CENTER:1,RIGHT:2}),cc.macro.VerticalTextAlignment=cc.Enum({TOP:0,CENT
ER:1,BOTTOM:2}),e.exports=cc.macro}),{"./js":220}],206:[(function(t,e,i){"use
strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?
function(t){return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("./js"),s=t("./CCClass"),a=1;function o()
{this._name="",this._objFlags=0}s.fastDefine("cc.Object",o,
{_name:"",_objFlags:0}),r.value(o,"Flags",
{Destroyed:a,DontSave:8,EditorOnly:16,Dirty:32,DontDestroy:64,PersistentMask:-
4192741,Destroying:128,Deactivating:256,LockedInEditor:512,HideInHierarchy:1024,IsP
reloadStarted:8192,IsOnLoadStarted:32768,IsOnLoadCalled:16384,IsOnEnableCalled:2048
,IsStartCalled:65536,IsEditorOnEnableCalled:4096,IsPositionLocked:1<<21,IsRotationL
ocked:1<<17,IsScaleLocked:1<<18,IsAnchorLocked:1<<19,IsSizeLocked:1<<20});var
l=[];function h(){for(var t=l.length,e=0;e<t;++e){var i=l[e];i._objFlags&a||
i._destroyImmediate()}t===l.length?
l.length=0:l.splice(0,t)}r.value(o,"_deferredDestroy",h);var
c=o.prototype;r.getset(c,"name",(function(){return this._name}),(function(t)
{this._name=t}),!0),r.get(c,"isValid",(function(){return!(this._objFlags&a)}),!
0);function u(t,e){var i,r=t instanceof cc._BaseNode||t instanceof
cc.Component,a=r?"_id":null,o={};for(i in t)if(t.hasOwnProperty(i))
{if(i===a)continue;switch(n(t[i]))
{case"string":o[i]="";break;case"object":case"function":o[i]=null}}if(cc.Class._isC
CClass(e))for(var l=cc.Class.Attr.getClassAttrs(e),h=e.__props__,c=0;c<h.length;c+
+){var u=(i=h[c])+cc.Class.Attr.DELIMETER+"default";if(u in l)
{if(r&&"_id"===i)continue;switch(n(l[u]))
{case"string":o[i]="";break;case"object":case"function":o[i]=null;break;case"undefi
ned":o[i]=void 0}}}var _="";for(i in o){var
f;f=s.IDENTIFIER_RE.test(i)?"o."+i+"=":"o["+s.escapeForJS(i)+"]=";var
d=o[i];""===d&&(d='""'),_+=f+d+";\n"}return Function("o",_)}c.destroy=function()
{return this._objFlags&a?(cc.warnID(5e3),!1):!(4&this._objFlags)&&(this._objFlags|
=4,l.push(this),!0)},c._destruct=function(){var
t=this.constructor,e=t.__destruct__;e||(e=u(this,t),r.value(t,"__destruct__",e,!
0)),e(this)},c._onPreDestroy=null,c._destroyImmediate=function(){this._objFlags&a?
cc.errorID(5e3):
(this._onPreDestroy&&this._onPreDestroy(),this._destruct(),this._objFlags|
=a)},c._deserialize=null,cc.isValid=function(t,e){return"object"===(void
0===t?"undefined":n(t))?!(!t||t._objFlags&(e?4|a:a)):void 0!
==t},cc.Object=e.exports=o}),{"./CCClass":200,"./js":220}],207:[(function(t,e,i)
{"use strict";var n=t("../platform/js");cc.SAXParser=function(){window.DOMParser?
(this._isSupportDOMParser=!0,this._parser=new DOMParser):
(this._isSupportDOMParser=!
1,this._parser=null)},cc.SAXParser.prototype={constructor:cc.SAXParser,parse:functi
on(t){return this._parseXML(t)},_parseXML:function(t){var e;return
this._isSupportDOMParser?e=this._parser.parseFromString(t,"text/xml"):((e=new
ActiveXObject("Microsoft.XMLDOM")).async="false",e.loadXML(t)),e}},cc.PlistParser=f
unction()
{cc.SAXParser.call(this)},n.extend(cc.PlistParser,cc.SAXParser),n.mixin(cc.PlistPar
ser.prototype,{parse:function(t){var
e=this._parseXML(t),i=e.documentElement;if("plist"!==i.tagName)return
cc.warnID(5100),{};for(var n=null,r=0,s=i.childNodes.length;r<s&&1!
==(n=i.childNodes[r]).nodeType;r++);return
e=null,this._parseNode(n)},_parseNode:function(t){var
e=null,i=t.tagName;if("dict"===i)e=this._parseDict(t);else
if("array"===i)e=this._parseArray(t);else
if("string"===i)if(1===t.childNodes.length)e=t.firstChild.nodeValue;else{e="";for(v
ar n=0;n<t.childNodes.length;n++)e+=t.childNodes[n].nodeValue}else"false"===i?e=!
1:"true"===i?e=!0:"real"===i?
e=parseFloat(t.firstChild.nodeValue):"integer"===i&&(e=parseInt(t.firstChild.nodeVa
lue,10));return e},_parseArray:function(t){for(var
e=[],i=0,n=t.childNodes.length;i<n;i++){var
r=t.childNodes[i];1===r.nodeType&&e.push(this._parseNode(r))}return
e},_parseDict:function(t){for(var e={},i=null,n=0,r=t.childNodes.length;n<r;n++)
{var s=t.childNodes[n];1===s.nodeType&&("key"===s.tagName?
i=s.firstChild.nodeValue:e[i]=this._parseNode(s))}return e}}),cc.saxParser=new
cc.SAXParser,cc.plistParser=new
cc.PlistParser,e.exports={saxParser:cc.saxParser,plistParser:cc.plistParser}}),
{"../platform/js":220}],208:[(function(t,e,i){"use
strict";cc.screen={_supportsFullScreen:!
1,_preOnFullScreenChange:null,_preOnFullScreenError:null,_preOnTouch:null,_touchEve
nt:"",_fn:null,_fnMap:
[["requestFullscreen","exitFullscreen","fullscreenchange","fullscreenEnabled","full
screenElement","fullscreenerror"],
["requestFullScreen","exitFullScreen","fullScreenchange","fullScreenEnabled","fullS
creenElement","fullscreenerror"],
["webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange","webki
tIsFullScreen","webkitCurrentFullScreenElement","webkitfullscreenerror"],
["mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozFullScreen"
,"mozFullScreenElement","mozfullscreenerror"],
["msRequestFullscreen","msExitFullscreen","MSFullscreenChange","msFullscreenEnabled
","msFullscreenElement","msfullscreenerror"]],init:function(){this._fn={};var
t,e,i,n,r=this._fnMap;for(t=0,e=r.length;t<e;t++)if((i=r[t])&&void 0!
==document[i[1]]){for(t=0,n=i.length;t<n;t++)this._fn[r[0]
[t]]=i[t];break}this._supportsFullScreen=void 0!
==this._fn.requestFullscreen,this._touchEvent="ontouchend"in
window?"touchend":"mousedown"},fullScreen:function(){return!!
this._supportsFullScreen&&!!(document[this._fn.fullscreenElement]||
document[this._fn.webkitFullscreenElement]||
document[this._fn.mozFullScreenElement])},requestFullScreen:function(t,e)
{if(t&&"video"===t.tagName.toLowerCase())
{if(cc.sys.os===cc.sys.OS_IOS&&cc.sys.isBrowser&&t.readyState>0)return
void(t.webkitEnterFullscreen&&t.webkitEnterFullscreen());t.setAttribute("x5-video-
player-fullscreen","true")}if(this._supportsFullScreen){if(t=t||
document.documentElement,e){var
i=this._fn.fullscreenchange;this._preOnFullScreenChange&&document.removeEventListen
er(i,this._preOnFullScreenChange),this._preOnFullScreenChange=e,document.addEventLi
stener(i,e,!1)}t[this._fn.requestFullscreen]()}},exitFullScreen:function(t)
{if(t&&"video"===t.tagName.toLowerCase())
{if(cc.sys.os===cc.sys.OS_IOS&&cc.sys.isBrowser)return
void(t.webkitExitFullscreen&&t.webkitExitFullscreen());t.setAttribute("x5-video-
player-fullscreen","false")}return!this._supportsFullScreen||
document[this._fn.exitFullscreen]()},autoFullScreen:function(t,e){t=t||
document.body,this._ensureFullScreen(t,e),this.requestFullScreen(t,e)},disableAutoF
ullScreen:function(t){var e=cc.game.canvas||
t,i=this._touchEvent;this._preOnTouch&&(e.removeEventListener(i,this._preOnTouch),t
his._preOnTouch=null)},_ensureFullScreen:function(t,e){var
i=this,n=cc.game.canvas||t,r=this._fn.fullscreenerror,s=this._touchEvent;function
a()
{i._preOnFullScreenError=null,i._preOnTouch&&n.removeEventListener(s,i._preOnTouch)
,i._preOnTouch=function()
{i._preOnTouch=null,i.requestFullScreen(t,e)},n.addEventListener(s,i._preOnTouch,
{once:!
0})}this._preOnFullScreenError&&t.removeEventListener(r,this._preOnFullScreenError)
,this._preOnFullScreenError=a,t.addEventListener(r,a,{once:!
0})}},cc.screen.init()}),{}],209:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=void
0,s="baidugame"===(r=window._CCSettings?_CCSettings.platform:void 0)||"baidugame-
subcontext"===r;var a=cc&&cc.sys?cc.sys:(function(){cc.sys={};var
t=cc.sys;if(t.LANGUAGE_ENGLISH="en",t.LANGUAGE_CHINESE="zh",t.LANGUAGE_FRENCH="fr",
t.LANGUAGE_ITALIAN="it",t.LANGUAGE_GERMAN="de",t.LANGUAGE_SPANISH="es",t.LANGUAGE_D
UTCH="du",t.LANGUAGE_RUSSIAN="ru",t.LANGUAGE_KOREAN="ko",t.LANGUAGE_JAPANESE="ja",t
.LANGUAGE_HUNGARIAN="hu",t.LANGUAGE_PORTUGUESE="pt",t.LANGUAGE_ARABIC="ar",t.LANGUA
GE_NORWEGIAN="no",t.LANGUAGE_POLISH="pl",t.LANGUAGE_TURKISH="tr",t.LANGUAGE_UKRAINI
AN="uk",t.LANGUAGE_ROMANIAN="ro",t.LANGUAGE_BULGARIAN="bg",t.LANGUAGE_UNKNOWN="unkn
own",t.OS_IOS="iOS",t.OS_ANDROID="Android",t.OS_WINDOWS="Windows",t.OS_MARMALADE="M
armalade",t.OS_LINUX="Linux",t.OS_BADA="Bada",t.OS_BLACKBERRY="Blackberry",t.OS_OSX
="OS X",t.OS_WP8="WP8",t.OS_WINRT="WINRT",t.OS_UNKNOWN="Unknown",t.UNKNOWN=-
1,t.WIN32=0,t.LINUX=1,t.MACOS=2,t.ANDROID=3,t.IPHONE=4,t.IPAD=5,t.BLACKBERRY=6,t.NA
CL=7,t.EMSCRIPTEN=8,t.TIZEN=9,t.WINRT=10,t.WP8=11,t.MOBILE_BROWSER=100,t.DESKTOP_BR
OWSER=101,t.EDITOR_PAGE=102,t.EDITOR_CORE=103,t.WECHAT_GAME=104,t.QQ_PLAY=105,t.FB_
PLAYABLE_ADS=106,t.BAIDU_GAME=107,t.VIVO_GAME=108,t.OPPO_GAME=109,t.HUAWEI_GAME=110
,t.BROWSER_TYPE_WECHAT="wechat",t.BROWSER_TYPE_WECHAT_GAME="wechatgame",t.BROWSER_T
YPE_WECHAT_GAME_SUB="wechatgamesub",t.BROWSER_TYPE_BAIDU_GAME="baidugame",t.BROWSER
_TYPE_BAIDU_GAME_SUB="baidugamesub",t.BROWSER_TYPE_QQ_PLAY="qqplay",t.BROWSER_TYPE_
ANDROID="androidbrowser",t.BROWSER_TYPE_IE="ie",t.BROWSER_TYPE_QQ="qqbrowser",t.BRO
WSER_TYPE_MOBILE_QQ="mqqbrowser",t.BROWSER_TYPE_UC="ucbrowser",t.BROWSER_TYPE_UCBS=
"ucbs",t.BROWSER_TYPE_360="360browser",t.BROWSER_TYPE_BAIDU_APP="baiduboxapp",t.BRO
WSER_TYPE_BAIDU="baidubrowser",t.BROWSER_TYPE_MAXTHON="maxthon",t.BROWSER_TYPE_OPER
A="opera",t.BROWSER_TYPE_OUPENG="oupeng",t.BROWSER_TYPE_MIUI="miuibrowser",t.BROWSE
R_TYPE_FIREFOX="firefox",t.BROWSER_TYPE_SAFARI="safari",t.BROWSER_TYPE_CHROME="chro
me",t.BROWSER_TYPE_LIEBAO="liebao",t.BROWSER_TYPE_QZONE="qzone",t.BROWSER_TYPE_SOUG
OU="sogou",t.BROWSER_TYPE_UNKNOWN="unknown",t.isNative=!
1,t.isBrowser="object"===("undefined"==typeof
window?"undefined":n(window))&&"object"===("undefined"==typeof
document?"undefined":n(document))&&!s,t.glExtension=function(t){return!!
cc.renderer.device.ext(t)},s){var
e=__device.getSystemInfo();t.platform=e.platform,t.browserType=e.browserType,t.isMo
bile=e.isMobile,t.language=e.language,t.languageCode=e.language.toLowerCase(),t.os=
e.os,t.osVersion=e.osVersion,t.osMainVersion=e.osMainVersion,t.browserVersion=e.bro
wserVersion,t.windowPixelResolution=e.windowPixelResolution,t.localStorage=e.localS
torage,t.capabilities=e.capabilities,t.__audioSupport=e.audioSupport}else{var
i=window,r=i.navigator,a=document,o=a.documentElement,l=r.userAgent.toLowerCase();t
.isMobile=/mobile|android|iphone|ipad/.test(l),"undefined"!=typeof FbPlayableAd?
t.platform=t.FB_PLAYABLE_ADS:t.platform=t.isMobile?
t.MOBILE_BROWSER:t.DESKTOP_BROWSER;var h=r.language;h=h||
r.browserLanguage,t.languageCode=h.toLowerCase(),h=h?h.split("-")
[0]:t.LANGUAGE_ENGLISH,t.language=h;var c=!1,u=!1,_="",f=0,d=/android (\d+
(?:\.\d+)*)/i.exec(l)||/android (\d+(?:\.\d+)*)/i.exec(r.platform);d&&(c=!
0,_=d[1]||"",f=parseInt(_)||0),(d=/(iPad|iPhone|iPod).*OS ((\d+_?)
{2,3})/i.exec(l))?(u=!0,_=d[2]||"",f=parseInt(_)||0):/(iPhone|iPad|
iPod)/.exec(r.platform)&&(u=!0,_="",f=0);var m=t.OS_UNKNOWN;-1!
==r.appVersion.indexOf("Win")?m=t.OS_WINDOWS:u?m=t.OS_IOS:-1!
==r.appVersion.indexOf("Mac")?m=t.OS_OSX:-1!==r.appVersion.indexOf("X11")&&-
1===r.appVersion.indexOf("Linux")?m=t.OS_UNIX:c?m=t.OS_ANDROID:-
1===r.appVersion.indexOf("Linux")&&-1===l.indexOf("ubuntu")||
(m=t.OS_LINUX),t.os=m,t.osVersion=_,t.osMainVersion=f,t.browserType=t.BROWSER_TYPE_
UNKNOWN,(function(){var e=/mqqbrowser|micromessenger|qq|sogou|qzone|liebao|maxthon|
ucbs|360 aphone|360browser|baiduboxapp|baidubrowser|maxthon|mxbrowser|
miuibrowser/i.exec(l);e||(e=/qqbrowser|ucbrowser/i.exec(l)),e||(e=/chrome|safari|
firefox|trident|opera|opr\/|oupeng/i.exec(l));var i=e?
e[0].toLowerCase():t.BROWSER_TYPE_UNKNOWN;"micromessenger"===i?
i=t.BROWSER_TYPE_WECHAT:"safari"===i&&c?
i=t.BROWSER_TYPE_ANDROID:"qq"===i&&l.match(/android.*applewebkit/i)?
i=t.BROWSER_TYPE_ANDROID:"trident"===i?i=t.BROWSER_TYPE_IE:"360 aphone"===i?
i=t.BROWSER_TYPE_360:"mxbrowser"===i?
i=t.BROWSER_TYPE_MAXTHON:"opr/"===i&&(i=t.BROWSER_TYPE_OPERA),t.browserType=i})
(),t.browserVersion="",(function(){var e=l.match(/(mqqbrowser|micromessenger|qq|
sogou|qzone|liebao|maxthon|uc|ucbs|360 aphone|360|baiduboxapp|baidu|maxthon|
mxbrowser|miui(?:.hybrid)?)(mobile)?(browser)?\/?([\d.]+)/i);e||(e=l.match(/
(qqbrowser|chrome|safari|firefox|trident|opera|opr\/|oupeng)(mobile)?(browser)?\/?
([\d.]+)/i)),t.browserVersion=e?e[4]:""})();var p=window.innerWidth||
document.documentElement.clientWidth,v=window.innerHeight||
document.documentElement.clientHeight,y=window.devicePixelRatio||
1;t.windowPixelResolution={width:y*p,height:y*v},t._checkWebGLRenderMod
e=function(){if(cc.game.renderType!==cc.game.RENDER_TYPE_WEBGL)throw new
Error("This feature supports WebGL render mode only.")};var
g=document.createElement("canvas");try{var
x=t.localStorage=i.localStorage;x.setItem("storage",""),x.removeItem("storage"),x=n
ull}catch(e){var b=function()
{cc.warnID(5200)};t.localStorage={getItem:b,setItem:b,removeItem:b,clear:b}}var
A=g.toDataURL("image/webp").startsWith("data:image/webp"),C=!!
g.getContext("2d"),S=!1;t.browserType===t.BROWSER_TYPE_WECHAT_GAME?S=!
0:i.WebGLRenderingContext&&(S=!0);var
T,w=t.capabilities={canvas:C,opengl:S,webp:A};(void 0!==o.ontouchstart||void 0!
==a.ontouchstart||r.msPointerEnabled)&&(w.touches=!0),void 0!
==o.onmouseup&&(w.mouse=!0),void 0!==o.onkeyup&&(w.keyboard=!0),
(i.DeviceMotionEvent||i.DeviceOrientationEvent)&&(w.accelerometer=!0),(function()
{t.browserVersion;var e=t.browserType!==t.BROWSER_TYPE_WECHAT_GAME&&!!
(window.AudioContext||window.webkitAudioContext||
window.mozAudioContext);T={ONLY_ONE:!1,WEB_AUDIO:e,DELAY_CREATE_CTX:!
1},t.os===t.OS_IOS&&(T.USE_LOADER_EVENT="loadedmetadata"),t.browserType===t.BROWSER
_TYPE_FIREFOX&&(T.DELAY_CREATE_CTX=!
0,T.USE_LOADER_EVENT="canplay"),t.os===t.OS_ANDROID&&t.browserType===t.BROWSER_TYPE
_UC&&(T.ONE_SOURCE=!0)})();try{T.WEB_AUDIO&&(T.context=new(window.AudioContext||
window.webkitAudioContext||
window.mozAudioContext),T.DELAY_CREATE_CTX&&setTimeout((function()
{T.context=new(window.AudioContext||window.webkitAudioContext||
window.mozAudioContext)}),0))}catch(t){T.WEB_AUDIO=!1,cc.logID(5201)}var E=[];
(function(){var
t=document.createElement("audio");t.canPlayType&&(t.canPlayType('audio/ogg;
codecs="vorbis"')&&E.push(".ogg"),t.canPlayType("audio/mpeg")&&E.push(".mp3"),t.can
PlayType('audio/wav;
codecs="1"')&&E.push(".wav"),t.canPlayType("audio/mp4")&&E.push(".mp4"),t.canPlayTy
pe("audio/x-m4a")&&E.push(".m4a"))})(),T.format=E,t.__audioSupport=T}return
t.NetworkType={NONE:0,LAN:1,WWAN:2},t.getNetworkType=function(){return
t.NetworkType.LAN},t.getBatteryLevel=function(){return
1},t.garbageCollect=function(){},t.restartVM=function()
{},t.getSafeAreaRect=function(){var t=cc.view.getVisibleSize();return
cc.rect(0,0,t.width,t.height)},t.isObjectValid=function(t){return!!
t},t.dump=function(){var t="";t+="isMobile : "+this.isMobile+"\r\n",t+="language :
"+this.language+"\r\n",t+="browserType :
"+this.browserType+"\r\n",t+="browserVersion :
"+this.browserVersion+"\r\n",t+="capabilities : "+JSON.stringify(this.capabilities)
+"\r\n",t+="os : "+this.os+"\r\n",t+="osVersion :
"+this.osVersion+"\r\n",t+="platform : "+this.platform+"\r\n",t+="Using "+
(cc.game.renderType===cc.game.RENDER_TYPE_WEBGL?"WEBGL":"CANVAS")+"
renderer.\r\n",cc.log(t)},t.openURL=function(t){window.open(t)},t.now=function()
{return Date.now?Date.now():+new Date},t})();e.exports=a}),{}],210:
[(function(t,e,i){"use strict";var n=t("../event/event-
target"),r=t("../platform/js"),s=t("../renderer");t("../platform/CCClass");var
a=cc.sys.platform===cc.sys.BAIDU_GAME,o={init:function(){a||
(this.html=document.getElementsByTagName("html")[0])},availWidth:function(t){return
t&&t!==this.html?t.clientWidth:window.innerWidth},availHeight:function(t){return
t&&t!==this.html?t.clientHeight:window.innerHeight},meta:{width:"device-
width"},adaptationType:cc.sys.browserType};switch(cc.sys.os===cc.sys.OS_IOS&&(o.ada
ptationType=cc.sys.BROWSER_TYPE_SAFARI),a&&(cc.sys.browserType===cc.sys.BROWSER_TYP
E_BAIDU_GAME_SUB?
o.adaptationType=cc.sys.BROWSER_TYPE_BAIDU_GAME_SUB:o.adaptationType=cc.sys.BROWSER
_TYPE_BAIDU_GAME),o.adaptationType){case
cc.sys.BROWSER_TYPE_SAFARI:o.meta["minimal-ui"]="true";case
cc.sys.BROWSER_TYPE_SOUGOU:case cc.sys.BROWSER_TYPE_UC:o.availWidth=function(t)
{return t.clientWidth},o.availHeight=function(t){return t.clientHeight};break;case
cc.sys.BROWSER_TYPE_WECHAT_GAME:o.availWidth=function(){return
window.innerWidth},o.availHeight=function(){return window.innerHeight};break;case
cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB:var l=window.sharedCanvas||
wx.getSharedCanvas();o.availWidth=function(){return
l.width},o.availHeight=function(){return l.height}}var h=null,c=function()
{n.call(this);var
t=this,e=cc.ContainerStrategy,i=cc.ContentStrategy;o.init(this),t._frameSize=cc.siz
e(0,0),t._designResolutionSize=cc.size(0,0),t._originalDesignResolutionSize=cc.size
(0,0),t._scaleX=1,t._scaleY=1,t._viewportRect=cc.rect(0,0,0,0),t._visibleRect=cc.re
ct(0,0,0,0),t._autoFullScreen=!
1,t._devicePixelRatio=1,t._maxPixelRatio=2,t._retinaEnabled=!
1,t._resizeCallback=null,t._resizing=!1,t._resizeWithBrowserSize=!
1,t._orientationChanging=!0,t._isRotated=!
1,t._orientation=cc.macro.ORIENTATION_AUTO,t._isAdjustViewport=!
0,t._antiAliasEnabled=!1,t._resolutionPolicy=null,t._rpExactFit=new
cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.EXACT_FIT),t._rpShowAll=new
cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.SHOW_ALL),t._rpNoBorder=new
cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.NO_BORDER),t._rpFixedHeight=new
cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.FIXED_HEIGHT),t._rpFixedWidth=new
cc.ResolutionPolicy(e.EQUAL_TO_FRAME,i.FIXED_WIDTH),cc.game.once(cc.game.EVENT_ENGI
NE_INITED,this.init,this)};cc.js.extend(c,n),cc.js.mixin(c.prototype,
{init:function(){this._initFrameSize(),this.enableAntiAlias(!0);var
t=cc.game.canvas.width,e=cc.game.canvas.height;this._designResolutionSize.width=t,t
his._designResolutionSize.height=e,this._originalDesignResolutionSize.width=t,this.
_originalDesignResolutionSize.height=e,this._viewportRect.width=t,this._viewportRec
t.height=e,this._visibleRect.width=t,this._visibleRect.height=e,cc.winSize.width=th
is._visibleRect.width,cc.winSize.height=this._visibleRect.height,cc.visibleRect&&cc
.visibleRect.init(this._visibleRect)},_resizeEvent:function(t){var
e,i=(e=this.setDesignResolutionSize?
this:cc.view)._frameSize.width,n=e._frameSize.height,r=e._isRotated;if(cc.sys.isMob
ile){var
s=cc.game.container.style,a=s.margin;s.margin="0",s.display="none",e._initFrameSize
(),s.margin=a,s.display="block"}else e._initFrameSize();if(!0===t||e._isRotated!
==r||e._frameSize.width!==i||e._frameSize.height!==n){var
o=e._originalDesignResolutionSize.width,l=e._originalDesignResolutionSize.height;e.
_resizing=!0,o>0&&e.setDesignResolutionSize(o,l,e._resolutionPolicy),e._resizing=!
1,e.emit("canvas-
resize"),e._resizeCallback&&e._resizeCallback.call()}},_orientationChange:function(
){cc.view._orientationChanging=!
0,cc.view._resizeEvent()},resizeWithBrowserSize:function(t){t?
this._resizeWithBrowserSize||(this._resizeWithBrowserSize=!
0,window.addEventListener("resize",this._resizeEvent),window.addEventListener("orie
ntationchange",this._orientationChange)):this._resizeWithBrowserSize&&(this._resize
WithBrowserSize=!
1,window.removeEventListener("resize",this._resizeEvent),window.removeEventListener
("orientationchange",this._orientationChange))},setResizeCallback:function(t)
{"function"!=typeof t&&null!=t||
(this._resizeCallback=t)},setOrientation:function(t)
{if((t&=cc.macro.ORIENTATION_AUTO)&&this._orientation!==t){this._orientation=t;var
e=this._originalDesignResolutionSize.width,i=this._originalDesignResolutionSize.hei
ght;this.setDesignResolutionSize(e,i,this._resolutionPolicy)}},_initFrameSize:funct
ion(){var
t=this._frameSize,e=o.availWidth(cc.game.frame),i=o.availHeight(cc.game.frame),n=e>
=i;!cc.sys.isMobile||n&&this._orientation&cc.macro.ORIENTATION_LANDSCAPE||!
n&&this._orientation&cc.macro.ORIENTATION_PORTRAIT?
(t.width=e,t.height=i,cc.game.container.style["-webkit-
transform"]="rotate(0deg)",cc.game.container.style.transform="rotate(0deg)",this._i
sRotated=!1):(t.width=i,t.height=e,cc.game.container.style["-webkit-
transform"]="rotate(90deg)",cc.game.container.style.transform="rotate(90deg)",cc.ga
me.container.style["-webkit-transform-origin"]="0px 0px
0px",cc.game.container.style.transformOrigin="0px 0px 0px",this._isRotated=!
0),this._orientationChanging&&setTimeout((function(){cc.view._orientationChanging=!
1}),1e3)},_adjustSizeKeepCanvasSize:function(){var
t=this._originalDesignResolutionSize.width,e=this._originalDesignResolutionSize.hei
ght;t>0&&this.setDesignResolutionSize(t,e,this._resolutionPolicy)},_setViewportMeta
:function(t,e){var
i=document.getElementById("cocosMetaElement");i&&e&&document.head.removeChild(i);va
r n,r,s,a=document.getElementsByName("viewport"),o=a?a[0]:null;for(r in n=o?
o.content:"",(i=i||
document.createElement("meta")).id="cocosMetaElement",i.name="viewport",i.content="
",t)-1==n.indexOf(r)?n+=","+r+"="+t[r]:e&&(s=new RegExp(r+"s*=s*[^,]
+"),n.replace(s,r+"="+t[r]));/^,/.test(n)&&(n=n.substr(1)),i.content=n,o&&(o.conten
t=n),document.head.appendChild(i)},_adjustViewportMeta:function()
{this._isAdjustViewport&&!a&&(this._setViewportMeta(o.meta,!
1),this._isAdjustViewport=!1)},adjustViewportMeta:function(t)
{this._isAdjustViewport=t},enableRetina:function(t){this._retinaEnabled=!!
t},isRetinaEnabled:function(){return
this._retinaEnabled},enableAntiAlias:function(t){if(this._antiAliasEnabled!
==t)if(this._antiAliasEnabled=t,cc.game.renderType===cc.game.RENDER_TYPE_WEBGL){var
e=cc.loader._cache;for(var i in e){var n=e[i],r=n&&n.content instanceof
cc.Texture2D?n.content:null;if(r){var s=cc.Texture2D.Filter;t?
r.setFilters(s.LINEAR,s.LINEAR):r.setFilters(s.NEAREST,s.NEAREST)}}}else
if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS){var
a=cc.game.canvas.getContext("2d");a.imageSmoothingEnabled=t,a.mozImageSmoothingEnab
led=t}},isAntiAliasEnabled:function(){return
this._antiAliasEnabled},enableAutoFullScreen:function(t){t&&t!
==this._autoFullScreen&&cc.sys.isMobile&&cc.sys.browserType!
==cc.sys.BROWSER_TYPE_WECHAT?(this._autoFullScreen=!
0,cc.screen.autoFullScreen(cc.game.frame)):(this._autoFullScreen=!
1,cc.screen.disableAutoFullScreen(cc.game.frame))},isAutoFullScreenEnabled:function
(){return this._autoFullScreen},setCanvasSize:function(t,e){var
i=cc.game.canvas,n=cc.game.container;i.width=t*this._devicePixelRatio,i.height=e*th
is._devicePixelRatio,i.style.width=t+"px",i.style.height=e+"px",n.style.width=t+"px
",n.style.height=e+"px",this._resizeEvent()},getCanvasSize:function(){return
cc.size(cc.game.canvas.width,cc.game.canvas.height)},getFrameSize:function()
{return
cc.size(this._frameSize.width,this._frameSize.height)},setFrameSize:function(t,e)
{this._frameSize.width=t,this._frameSize.height=e,cc.game.frame.style.width=t+"px",
cc.game.frame.style.height=e+"px",this._resizeEvent(!0)},getVisibleSize:function()
{return
cc.size(this._visibleRect.width,this._visibleRect.height)},getVisibleSizeInPixel:fu
nction(){return
cc.size(this._visibleRect.width*this._scaleX,this._visibleRect.height*this._scaleY)
},getVisibleOrigin:function(){return
cc.v2(this._visibleRect.x,this._visibleRect.y)},getVisibleOriginInPixel:function()
{return
cc.v2(this._visibleRect.x*this._scaleX,this._visibleRect.y*this._scaleY)},getResolu
tionPolicy:function(){return
this._resolutionPolicy},setResolutionPolicy:function(t){var e=this;if(t instanceof
cc.ResolutionPolicy)e._resolutionPolicy=t;else{var
i=cc.ResolutionPolicy;t===i.EXACT_FIT&&(e._resolutionPolicy=e._rpExactFit),t===i.SH
OW_ALL&&(e._resolutionPolicy=e._rpShowAll),t===i.NO_BORDER&&(e._resolutionPolicy=e.
_rpNoBorder),t===i.FIXED_HEIGHT&&(e._resolutionPolicy=e._rpFixedHeight),t===i.FIXED
_WIDTH&&(e._resolutionPolicy=e._rpFixedWidth)}},setDesignResolutionSize:function(t,
e,i){if(t>0||e>0){this.setResolutionPolicy(i);var
n=this._resolutionPolicy;if(n&&n.preApply(this),cc.sys.isMobile&&this._adjustViewpo
rtMeta(),this._orientationChanging=!0,this._resizing||this._initFrameSize(),n)
{this._originalDesignResolutionSize.width=this._designResolutionSize.width=t,this._
originalDesignResolutionSize.height=this._designResolutionSize.height=e;var
r=n.apply(this,this._designResolutionSize);if(r.scale&&2===r.scale.length&&(this._s
caleX=r.scale[0],this._scaleY=r.scale[1]),r.viewport){var
a=this._viewportRect,o=this._visibleRect,l=r.viewport;a.x=l.x,a.y=l.y,a.width=l.wid
th,a.height=l.height,o.x=0,o.y=0,o.width=l.width/this._scaleX,o.height=l.height/thi
s._scaleY}n.postApply(this),cc.winSize.width=this._visibleRect.width,cc.winSize.hei
ght=this._visibleRect.height,cc.visibleRect&&cc.visibleRect.init(this._visibleRect)
,s.updateCameraViewport(),this.emit("design-resolution-changed")}else
cc.logID(2201)}else cc.logID(2200)},getDesignResolutionSize:function(){return
cc.size(this._designResolutionSize.width,this._designResolutionSize.height)},setRea
lPixelResolution:function(t,e,i){a||(this._setViewportMeta({width:t},!
0),document.documentElement.style.width=t+"px",document.body.style.width=t+"px",doc
ument.body.style.left="0px",document.body.style.top="0px"),this.setDesignResolution
Size(t,e,i)},setViewportInPoints:function(t,e,i,n){var
r=this._scaleX,s=this._scaleY;cc.game._renderContext.viewport(t*r+this._viewportRec
t.x,e*s+this._viewportRect.y,i*r,n*s)},setScissorInPoints:function(t,e,i,n){var
r=this._scaleX,s=this._scaleY,a=Math.ceil(t*r+this._viewportRect.x),o=Math.ceil(e*s
+this._viewportRect.y),l=Math.ceil(i*r),c=Math.ceil(n*s),u=cc.game._renderContext;i
f(!h){var
_=u.getParameter(u.SCISSOR_BOX);h=cc.rect(_[0],_[1],_[2],_[3])}h.x===a&&h.y===o&&h.
width===l&&h.height===c||
(h.x=a,h.y=o,h.width=l,h.height=c,u.scissor(a,o,l,c))},isScissorEnabled:function()
{return
cc.game._renderContext.isEnabled(gl.SCISSOR_TEST)},getScissorRect:function(){if(!h)
{var t=gl.getParameter(gl.SCISSOR_BOX);h=cc.rect(t[0],t[1],t[2],t[3])}var
e=1/this._scaleX,i=1/this._scaleY;return cc.rect((h.x-this._viewportRect.x)*e,(h.y-
this._viewportRect.y)*i,h.width*e,h.height*i)},getViewportRect:function(){return
this._viewportRect},getScaleX:function(){return this._scaleX},getScaleY:function()
{return this._scaleY},getDevicePixelRatio:function(){return
this._devicePixelRatio},convertToLocationInView:function(t,e,i,n){var r=n||
cc.v2(),s=this._devicePixelRatio*(t-
i.left),a=this._devicePixelRatio*(i.top+i.height-e);return this._isRotated?
(r.x=cc.game.canvas.width-a,r.y=s):
(r.x=s,r.y=a),r},_convertMouseToLocationInView:function(t,e){var
i=this._viewportRect;t.x=(this._devicePixelRatio*(t.x-e.left)-
i.x)/this._scaleX,t.y=(this._devicePixelRatio*(e.top+e.height-t.y)-
i.y)/this._scaleY},_convertPointWithScale:function(t){var
e=this._viewportRect;t.x=(t.x-e.x)/this._scaleX,t.y=(t.y-
e.y)/this._scaleY},_convertTouchesWithScale:function(t){for(var
e,i,n,r=this._viewportRect,s=this._scaleX,a=this._scaleY,o=0;o<t.length;o+
+)i=(e=t[o])._point,n=e._prevPoint,i.x=(i.x-r.x)/s,i.y=(i.y-r.y)/a,n.x=(n.x-
r.x)/s,n.y=(n.y-
r.y)/a}}),cc.ContainerStrategy=cc.Class({name:"ContainerStrategy",preApply:function
(t){},apply:function(t,e){},postApply:function(t){},_setupContainer:function(t,e,i)
{var n=cc.game.canvas,r=cc.game.container;a||
(cc.sys.os===cc.sys.OS_ANDROID&&(document.body.style.width=(t._isRotated?i:e)
+"px",document.body.style.height=(t._isRotated?e:i)
+"px"),r.style.width=n.style.width=e+"px",r.style.height=n.style.height=i+"px");var
s=t._devicePixelRatio=1;t.isRetinaEnabled()&&(s=t._devicePixelRatio=Math.min(t._max
PixelRatio,window.devicePixelRatio||
1)),n.width=e*s,n.height=i*s},_fixContainer:function()
{document.body.insertBefore(cc.game.container,document.body.firstChild);var
t=document.body.style;t.width=window.innerWidth+"px",t.height=window.innerHeight+"p
x",t.overflow="hidden";var
e=cc.game.container.style;e.position="fixed",e.left=e.top="0px",document.body.scrol
lTop=0}}),cc.ContentStrategy=cc.Class({name:"ContentStrategy",ctor:function()
{this._result={scale:[1,1],viewport:null}},_buildResult:function(t,e,i,n,r,s)
{Math.abs(t-i)<2&&(i=t),Math.abs(e-n)<2&&(n=e);var a=cc.rect((t-i)/2,(e-
n)/2,i,n);return
cc.game.renderType,cc.game.RENDER_TYPE_CANVAS,this._result.scale=[r,s],this._result
.viewport=a,this._result},preApply:function(t){},apply:function(t,e){return{scale:
[1,1]}},postApply:function(t){}}),(function(){var
t=cc.Class({name:"EqualToFrame",extends:cc.ContainerStrategy,apply:function(t){var
e=t._frameSize.height,i=cc.game.container.style;this._setupContainer(t,t._frameSize
.width,t._frameSize.height),t._isRotated?i.margin="0 0 0
"+e+"px":i.margin="0px",i.padding="0px"}}),e=cc.Class({name:"ProportionalToFrame",e
xtends:cc.ContainerStrategy,apply:function(t,e){var
i,n,r=t._frameSize.width,s=t._frameSize.height,a=cc.game.container.style,o=e.width,
l=e.height,h=r/o,c=s/l;h<c?(i=r,n=l*h):(i=o*c,n=s);var u=Math.round((r-
i)/2),_=Math.round((s-n)/2);i=r-2*u,n=s-
2*_,this._setupContainer(t,i,n),t._isRotated?a.margin="0 0 0
"+s+"px":a.margin="0px",a.paddingLeft=u+"px",a.paddingRight=u+"px",a.paddingTop=_+"
px",a.paddingBottom=_+"px"}}),i=(cc.Class({name:"EqualToWindow",extends:t,preApply:
function(t)
{this._super(t),cc.game.frame=document.documentElement},apply:function(t)
{this._super(t),this._fixContainer()}}),cc.Class({name:"ProportionalToWindow",exten
ds:e,preApply:function(t)
{this._super(t),cc.game.frame=document.documentElement},apply:function(t,e)
{this._super(t,e),this._fixContainer()}}),cc.Class({name:"OriginalContainer",extend
s:cc.ContainerStrategy,apply:function(t)
{this._setupContainer(t,cc.game.canvas.width,cc.game.canvas.height)}}));cc.Containe
rStrategy.EQUAL_TO_FRAME=new t,cc.ContainerStrategy.PROPORTION_TO_FRAME=new
e,cc.ContainerStrategy.ORIGINAL_CONTAINER=new i;var
n=cc.Class({name:"ExactFit",extends:cc.ContentStrategy,apply:function(t,e){var
i=cc.game.canvas.width,n=cc.game.canvas.height,r=i/e.width,s=n/e.height;return
this._buildResult(i,n,i,n,r,s)}}),r=cc.Class({name:"ShowAll",extends:cc.ContentStra
tegy,apply:function(t,e){var
i,n,r=cc.game.canvas.width,s=cc.game.canvas.height,a=e.width,o=e.height,l=r/a,h=s/o
,c=0;return l<h?(i=r,n=o*(c=l)):
(i=a*(c=h),n=s),this._buildResult(r,s,i,n,c,c)}}),s=cc.Class({name:"NoBorder",exten
ds:cc.ContentStrategy,apply:function(t,e){var
i,n,r,s=cc.game.canvas.width,a=cc.game.canvas.height,o=e.width,l=e.height,h=s/o,c=a
/l;return h<c?(n=o*(i=c),r=a):
(n=s,r=l*(i=h)),this._buildResult(s,a,n,r,i,i)}}),a=cc.Class({name:"FixedHeight",ex
tends:cc.ContentStrategy,apply:function(t,e){var
i=cc.game.canvas.width,n=cc.game.canvas.height,r=n/e.height,s=i,a=n;return
this._buildResult(i,n,s,a,r,r)}}),o=cc.Class({name:"FixedWidth",extends:cc.ContentS
trategy,apply:function(t,e){var
i=cc.game.canvas.width,n=cc.game.canvas.height,r=i/e.width,s=i,a=n;return
this._buildResult(i,n,s,a,r,r)}});cc.ContentStrategy.EXACT_FIT=new
n,cc.ContentStrategy.SHOW_ALL=new r,cc.ContentStrategy.NO_BORDER=new
s,cc.ContentStrategy.FIXED_HEIGHT=new a,cc.ContentStrategy.FIXED_WIDTH=new o})
(),cc.ResolutionPolicy=cc.Class({name:"cc.ResolutionPolicy",ctor:function(t,e)
{this._containerStrategy=null,this._contentStrategy=null,this.setContainerStrategy(
t),this.setContentStrategy(e)},preApply:function(t)
{this._containerStrategy.preApply(t),this._contentStrategy.preApply(t)},apply:funct
ion(t,e){return
this._containerStrategy.apply(t,e),this._contentStrategy.apply(t,e)},postApply:func
tion(t)
{this._containerStrategy.postApply(t),this._contentStrategy.postApply(t)},setContai
nerStrategy:function(t){t instanceof
cc.ContainerStrategy&&(this._containerStrategy=t)},setContentStrategy:function(t){t
instanceof
cc.ContentStrategy&&(this._contentStrategy=t)}}),r.get(cc.ResolutionPolicy.prototyp
e,"canvasSize",(function(){return
cc.v2(cc.game.canvas.width,cc.game.canvas.height)})),cc.ResolutionPolicy.EXACT_FIT=
0,cc.ResolutionPolicy.NO_BORDER=1,cc.ResolutionPolicy.SHOW_ALL=2,cc.ResolutionPolic
y.FIXED_HEIGHT=3,cc.ResolutionPolicy.FIXED_WIDTH=4,cc.ResolutionPolicy.UNKNOWN=5,cc
.view=new c,cc.winSize=cc.v2(),e.exports=cc.view}),{"../event/event-
target":132,"../platform/CCClass":200,"../platform/js":220,"../renderer":243}],211:
[(function(t,e,i){"use
strict";cc.visibleRect={topLeft:cc.v2(0,0),topRight:cc.v2(0,0),top:cc.v2(0,0),botto
mLeft:cc.v2(0,0),bottomRight:cc.v2(0,0),bottom:cc.v2(0,0),center:cc.v2(0,0),left:cc
.v2(0,0),right:cc.v2(0,0),width:0,height:0,init:function(t){var
e=this.width=t.width,i=this.height=t.height,n=t.x,r=t.y,s=r+i,a=n+e;this.topLeft.x=
n,this.topLeft.y=s,this.topRight.x=a,this.topRight.y=s,this.top.x=n+e/2,this.top.y=
s,this.bottomLeft.x=n,this.bottomLeft.y=r,this.bottomRight.x=a,this.bottomRight.y=r
,this.bottom.x=n+e/2,this.bottom.y=r,this.center.x=n+e/2,this.center.y=r+
i/2,this.left.x=n,this.left.y=r+i/2,this.right.x=a,this.right.y=r+i/2}}}),{}],212:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof
t},r=t("./js"),s=(t("./utils").isPlainEmptyObj_DEV,"$_$");function a(t,e,i){var
n;n=function(){},i&&r.extend(n,i.constructor);var s=new n;return
r.value(t,"__attrs__",s),s}function o(t){for(var
e,i=cc.Class.getInheritanceChain(t),n=i.length-1;n>=0;n--){var
r=i[n];r.hasOwnProperty("__attrs__")&&r.__attrs__||a(r,0,
(e=i[n+1])&&e.__attrs__)}return a(t,0,(e=i[0])&&e.__attrs__),t.__attrs__}function
l(t,e,i){var r,o,l;if("function"==typeof
t)o=(r=h(t)).constructor.prototype;else{var c=t;if(!
(r=c.__attrs__))r=a(c,0,h(t=c.constructor));o=r}if(void 0===i){var u=e+s,_={};for(l
in r)l.startsWith(u)&&(_[l.slice(u.length)]=r[l]);return _}if("object"===(void
0===i?"undefined":n(i)))for(l in i)95!==l.charCodeAt(0)&&(o[e+s+l]=i[l]);else
0}function h(t){return t.hasOwnProperty("__attrs__")&&t.__attrs__||o(t)}function
c(t){return h(t).constructor.prototype}function u(t,e)
{0}cc.Integer="Integer",cc.Float="Float",cc.Boolean="Boolean",cc.String="String",e.
exports={attr:l,getClassAttrs:h,getClassAttrsProto:c,setClassAttr:function(t,e,i,n)
{c(t)[e+s+i]=n},DELIMETER:s,getTypeChecker:u,ObjectType:function(t)
{return{type:"Object",ctor:t,_onAfterProp:!1}},ScriptUuid:{}}}),
{"./CCClass":200,"./js":220,"./utils":224}],213:[(function(t,e,i){"use strict";var
n=t("./js"),r=n.array.fastRemoveAt;function s()
{this.callbacks=[],this.targets=[],this.isInvoking=!1,this.containCanceled=!1}var
a=s.prototype;a.removeBy=function(t,e){for(var
i=this.callbacks,n=this.targets,s=0;s<t.length;++s)t[s]===e&&(r(i,s),r(n,s),--
s)},a.cancel=function(t)
{this.callbacks[t]=this.targets[t]=null,this.containCanceled=!
0},a.cancelAll=function(){for(var t=this.callbacks,e=this.targets,i=0;i<t.length;i+
+)t[i]=e[i]=null;this.containCanceled=!0},a.purgeCanceled=function()
{this.removeBy(this.callbacks,null),this.containCanceled=!1};var o=new
n.Pool(function(t){t.callbacks.length=0,t.targets.length=0,t.isInvoking=!
1,t.containCanceled=!1},16);function l(){this._callbackTable=n.createMap(!
0)}o.get=function(){return this._get()||new s},(a=l.prototype).add=function(t,e,i)
{var n=this._callbackTable[t];n||
(n=this._callbackTable[t]=o.get()),n.callbacks.push(e),n.targets.push(i||
null)},a.hasEventListener=function(t,e,i){var n=this._callbackTable[t];if(!
n)return!1;var r=n.callbacks;if(!e){if(n.isInvoking){for(var s=0;s<r.length;s+
+)if(r[s])return!0;return!1}return r.length>0}i=i||null;for(var
a=n.targets,o=0;o<r.length;++o)if(r[o]===e&&a[o]===i)return!0;return!
1},a.removeAll=function(t){if("string"==typeof t){var
e=this._callbackTable[t];e&&(e.isInvoking?e.cancelAll():(o.put(e),delete
this._callbackTable[t]))}else if(t)for(var i in this._callbackTable){var
n=this._callbackTable[i];if(n.isInvoking)for(var r=n.targets,s=0;s<r.length;+
+s)r[s]===t&&n.cancel(s);else n.removeBy(n.targets,t)}},a.remove=function(t,e,i)
{var n=this._callbackTable[t];if(n){i=i||null;for(var
s=n.callbacks,a=n.targets,o=0;o<s.length;++o)if(s[o]===e&&a[o]===i){n.isInvoking?
n.cancel(o):(r(s,o),r(a,o));break}}};var h=function()
{l.call(this)};n.extend(h,l),h.prototype.invoke=function(t,e,i,n,r,s){var
a=this._callbackTable[t];if(a){var o=!a.isInvoking;a.isInvoking=!0;for(var
l=a.callbacks,h=a.targets,c=0,u=l.length;c<u;++c){var _=l[c];if(_){var f=h[c];f?
_.call(f,e,i,n,r,s):_(e,i,n,r,s)}}o&&(a.isInvoking=!
1,a.containCanceled&&a.purgeCanceled())}},h.CallbacksHandler=l,e.exports=h}),
{"./js":220}],214:[(function(t,e,i){"use strict";function n(t,e){for(var
i=0;i<e.length;i++){var r=e[i];Array.isArray(r)?
n(t,r):t.push(r)}}e.exports={flattenCodeArray:function(t){var e=[];return
n(e,t),e.join("")}}}),{}],215:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("./js"),s=t("./attribute"),a=t("./CCClass"),o=t("../utils/misc"),l=function(
)
{this.uuidList=[],this.uuidObjList=[],this.uuidPropList=[],this._stillUseUrl=r.crea
teMap(!0)};l.prototype.reset=function()
{this.uuidList.length=0,this.uuidObjList.length=0,this.uuidPropList.length=0,r.clea
r(this._stillUseUrl)},l.prototype.push=function(t,e,i,n)
{n&&(this._stillUseUrl[this.uuidList.length]=!
0),this.uuidList.push(i),this.uuidObjList.push(t),this.uuidPropList.push(e)},
(l.pool=new r.Pool(function(t){t.reset()},10)).get=function(){return this._get()||
new l};var h=(function(){function t(t,e,i,n,r)
{this.result=t,this.customEnv=n,this.deserializedList=[],this.deserializedData=null
,this._classFinder=i,this._idList=[],this._idObjList=[],this._idPropList=[]}functio
n e(t){var
e,i,n,r=t.deserializedList,s=t._idPropList,a=t._idList,o=t._idObjList;t._classFinde
r&&t._classFinder.onDereferenced;for(e=0;e<a.length;e++)i=s[e],n=a[e],o[e]
[i]=r[n]}var i=t.prototype;function l(t,e,i,n,s,a){if(e instanceof cc.ValueType)
{s||t.push("if(prop){");var
o=r.getClassName(e);t.push("s._deserializeTypedObject(o"+i+",prop,"+o+");"),s||
t.push("}else o"+i+"=null;")}else t.push("if(prop)
{"),t.push("s._deserializeObjField(o,prop,"+n+",null,"+!!a+");"),t.push("}else
o"+i+"=null;")}i.deserialize=function(t){if(Array.isArray(t)){var
i=t,n=i.length;this.deserializedList.length=n;for(var r=0;r<n;r++)
{if(i[r])this.deserializedList[r]=this._deserializeObject(i[r],!
1)}this.deserializedData=n>0?this.deserializedList[0]:[]}else
this.deserializedList.length=1,this.deserializedData=t?this._deserializeObject(t,!
1):null,this.deserializedList[0]=this.deserializedData;return
e(this),this.deserializedData},i._deserializeObject=function(t,e,i,s,a){var
o,l=null,h=null,u=t.__type__;if(u){if(!(h=this._classFinder(u,t,s,a)))return
this._classFinder===r._getClassById&&cc.deserialize.reportMissingClass(u),null;if((
l=new h)._deserialize)return
l._deserialize(t.content,this),l;cc.Class._isCCClass(h)?
c(this,l,t,h,i):this._deserializeTypedObject(l,t,h)}else if(Array.isArray(t)){l=new
Array(t.length);for(var _=0;_<t.length;_++)"object"===(void
0===(o=t[_])?"undefined":n(o))&&o?
this._deserializeObjField(l,o,""+_,null,e):l[_]=o}else
l={},this._deserializePrimitiveObject(l,t);return
l},i._deserializeObjField=function(t,e,i,n,r){var s=e.__id__;if(void 0===s){var
a=e.__uuid__;a?this.result.push(t,i,a,r):t[i]=this._deserializeObject(e,r)}else{var
o=this.deserializedList[s];o?t[i]=o:
(this._idList.push(s),this._idObjList.push(t),this._idPropList.push(i))}},i._deseri
alizePrimitiveObject=function(t,e){for(var i in e)if(e.hasOwnProperty(i)){var
r=e[i];"object"!==(void 0===r?"undefined":n(r))?"__type__"!==i&&(t[i]=r):r?
this._deserializeObjField(t,r,i):t[i]=null}},i._deserializeTypedObject=function(t,e
,i){if(i===cc.Vec2)return t.x=e.x||0,void(t.y=e.y||0);if(i===cc.Vec3)return
t.x=e.x||0,t.y=e.y||0,void(t.z=e.z||0);if(i!==cc.Color){if(i===cc.Size)return
t.width=e.width||0,void(t.height=e.height||0);for(var
r=s.DELIMETER+"default",o=s.getClassAttrs(i),l=i.__props__||
Object.keys(t),h=0;h<l.length;h++){var c=l[h],u=e[c];void 0!
==u&&e.hasOwnProperty(c)||(u=a.getDefault(o[c+r])),"object"!==(void
0===u?"undefined":n(u))?t[c]=u:u?
this._deserializeObjField(t,u,c):t[c]=null}}else{t.r=e.r||0,t.g=e.g||0,t.b=e.b||
0;var _=e.a;t.a=void 0===_?255:_}};var h=function(t,e){for(var
i=s.DELIMETER+"type",h=(s.DELIMETER,s.DELIMETER+"default"),c=s.DELIMETER+"saveUrlAs
Asset",u=s.DELIMETER+"formerlySerializedAs",_=s.getClassAttrs(e),f=e.__values__,d=[
"var prop;"],m=o.BUILTIN_CLASSID_RE.test(r._getClassId(e)),p=0;p<f.length;p++){var
v,y,g=f[p];0,a.IDENTIFIER_RE.test(g)?(y='"'+g+'"',v="."+g):v="["+
(y=a.escapeForJS(g))+"]";var x=v;if(_[g+u]){var
b=_[g+u];x=a.IDENTIFIER_RE.test(b)?"."+b:"["+a.escapeForJS(b)
+"]"}d.push("prop=d"+x+";"),d.push('if(typeof prop!=="undefined"){');var
A=_[g+c],C=a.getDefault(_[g+h]);if(m){var S,T=_[g+i];if(void
0===C&&T)S=T===cc.String||T===cc.Integer||T===cc.Float||T===cc.Boolean;else{var
w=void 0===C?"undefined":n(C);S="string"===w&&!A||"number"===w||"boolean"===w}S?
d.push("o"+v+"=prop;"):l(d,C,v,y,!0,A)}else d.push('if(typeof prop!=="object")
{o'+v+"=prop;}else{"),l(d,C,v,y,!1,A),d.push("}");d.push("}")}
(cc.js.isChildClassOf(e,cc._BaseNode)||
cc.js.isChildClassOf(e,cc.Component))&&d.push("d._id&&(o._id=d._id);");return"_$eri
alized"===f[f.length-
1]&&(d.push("o._$erialized=JSON.parse(JSON.stringify(d));"),d.push("s._deserializeP
rimitiveObject(o._$erialized,d);")),Function("s","o","d","k","t",d.join(""))};funct
ion c(t,e,i,n,s){var a;n.hasOwnProperty("__deserialize__")?a=n.__deserialize__:
(a=h(t,n),r.value(n,"__deserialize__",a,!0)),a(t,e,i,n,s)}return t.pool=new
r.Pool(function(t)
{t.result=null,t.customEnv=null,t.deserializedList.length=0,t.deserializedData=null
,t._classFinder=null,t._idList.length=0,t._idObjList.length=0,t._idPropList.length=
0},1),t.pool.get=function(e,i,n,r,s){var a=this._get();return a?
(a.result=e,a.customEnv=r,a._classFinder=n,a):new t(e,i,n,r,s)},t})
();cc.deserialize=function(t,e,i){var n=(i=i||{}).classFinder||
r._getClassById,s=i.createAssetRefs||
cc.sys.platform===cc.sys.EDITOR_CORE,a=i.customEnv,o=i.ignoreEditorOnly;"string"==t
ypeof t&&(t=JSON.parse(t));var c=!e;e=e||l.pool.get();var u=h.pool.get(e,!
1,n,a,o);cc.game._isCloning=!0;var _=u.deserialize(t);return cc.game._isCloning=!
1,h.pool.put(u),s&&e.assignAssetsBy(Editor.serialize.asAsset),c&&l.pool.put(e),_},c
c.deserialize.Details=l,cc.deserialize.reportMissingClass=function(t)
{cc.warnID(5302,t)}}),
{"../utils/misc":295,"./CCClass":200,"./attribute":212,"./js":220}],216:
[(function(t,e,i){"use strict";var n=".";function r(t){this.id=0|
998*Math.random(),this.prefix=t?t+n:""}r.prototype.getNewId=function(){return
this.prefix+ ++this.id},r.global=new r("global"),e.exports=r}),{}],217:
[(function(t,e,i){"use

strict";t("./js"),t("./CCClass"),t("./CCClassDecorator"),t("./CCEnum"),t("./CCObjec
t"),t("./callbacks-
invoker"),t("./url"),t("./deserialize"),t("./instantiate"),t("./instantiate-
jit"),t("./requiring-
frame"),t("./CCSys"),t("./CCMacro"),t("./CCAssetLibrary"),t("./CCVisibleRect")}),
{"./CCAssetLibrary":199,"./CCClass":200,"./CCClassDecorator":201,"./CCEnum":202,"./
CCMacro":205,"./CCObject":206,"./CCSys":209,"./CCVisibleRect":211,"./callbacks-
invoker":213,"./deserialize":215,"./instantiate":219,"./instantiate-
jit":218,"./js":220,"./requiring-frame":222,"./url":223}],218:[(function(t,e,i)
{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?
function(t){return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("./CCObject"),s=r.Flags.Destroyed,a=r.Flags.PersistentMask,o=t("./attribute"
),l=t("./js"),h=t("./CCClass"),c=t("./compiler"),u=o.DELIMETER+"default",_=h.IDENTI
FIER_RE,f=h.escapeForJS,d="var
",m="o",p="t",v={"cc.Node":"cc.Node","cc.Sprite":"cc.Sprite","cc.Label":"cc.Label",
"cc.Button":"cc.Button","cc.Widget":"cc.Widget","cc.Animation":"cc.Animation","cc.C
lickEvent":!1,"cc.PrefabInfo":!1};function y(t,e)
{this.varName=t,this.expression=e}function g(t,e){return e instanceof y?new
y(e.varName,t+e.expression):t+e}function x(t,e,i){Array.isArray(i)?
(i[0]=g(e,i[0]),t.push(i)):t.push(g(e,i)+";")}function b(t)
{this._exps=[],this._targetExp=t}function A(t,e){if("function"==typeof
t)try{t=t()}catch(t){return!1}if(t===e)return!0;if(t&&e){if(t instanceof
cc.ValueType&&t.equals(e))return!0;if(Array.isArray(t)&&Array.isArray(e)||
t.constructor===Object&&e.constructor===Object)try{return
Array.isArray(t)&&Array.isArray(e)&&0===t.length&&0===e.length}catch(t){}}return!
1}function C(t){return _.test(t)?"."+t:"["+f(t)+"]"}function S(t,e){var
i;this.parent=e,this.objsToClear_iN$t=[],this.codeArray=[],this.objs=[],this.funcs=
[],this.funcModuleCache=l.createMap(),l.mixin(this.funcModuleCache,v),this.globalVa
riables=[],this.globalVariableId=0,this.localVariableId=0,this.codeArray.push(d+m+"
,"+p+";","if(R){",m+"=R;","}else{",m+"=R=new "+this.getFuncModule(t.constructor,!
0)+"();","}"),l.value(t,"_iN$t",{globalVar:"R"},!
0),this.objsToClear_iN$t.push(t),this.enumerateObject(this.codeArray,t),this.global
Variables.length>0&&(i=d+this.globalVariables.join(",")+";");var
n=c.flattenCodeArray(["return (function(R){",i||[],this.codeArray,"return
o;","})"]);this.result=Function("O","F",n)(this.objs,this.funcs);for(var
r=0,s=this.objsToClear_iN$t.length;r<s;+
+r)this.objsToClear_iN$t[r]._iN$t=null;this.objsToClear_iN$t.length=0}y.prototype.t
oString=function(){return
d+this.varName+"="+this.expression+";"},b.prototype.append=function(t,e)
{this._exps.push([t,e])},b.prototype.writeCode=function(t){var
e;if(this._exps.length>1)t.push(p+"="+this._targetExp+";"),e=p;else{if(1!
==this._exps.length)return;e=this._targetExp}for(var i=0;i<this._exps.length;i++)
{var n=this._exps[i];x(t,e+C(n[0])+"=",n[1])}},b.pool=new l.Pool(function(t)
{t._exps.length=0,t._targetExp=null},1),b.pool.get=function(t){var e=this._get()||
new b;return e._targetExp=t,e};var T=S.prototype;T.getFuncModule=function(t,e){var
i=l.getClassName(t);if(i){var n=this.funcModuleCache[i];if(n)return n;if(void
0===n){var r=-1!==i.indexOf(".");if(r)try{if(r=t===Function("return "+i)())return
this.funcModuleCache[i]=i,i}catch(t){}}}var
s=this.funcs.indexOf(t);s<0&&(s=this.funcs.length,this.funcs.push(t));var
a="F["+s+"]";return
e&&(a="("+a+")"),this.funcModuleCache[i]=a,a},T.getObjRef=function(t){var
e=this.objs.indexOf(t);return
e<0&&(e=this.objs.length,this.objs.push(t)),"O["+e+"]"},T.setValueType=function(t,e
,i,n){var r=b.pool.get(n),s=e.constructor.__props__;s||(s=Object.keys(e));for(var
a=0;a<s.length;a++){var o=s[a],l=i[o];if(e[o]!==l){var
h=this.enumerateField(i,o,l);r.append(o,h)}}r.writeCode(t),b.pool.put(r)},T.enumera
teCCClass=function(t,e,i){for(var
r=i.__values__,s=o.getClassAttrs(i),a=0;a<r.length;a++){var
l=r[a],c=e[l],_=s[l+u];if(!A(_,c))if("object"===(void 0===c?"undefined":n(c))&&c
instanceof cc.ValueType&&(_=h.getDefault(_))&&_.constructor===c.constructor){var
f=m+C(l);this.setValueType(t,_,c,f)}else
this.setObjProp(t,e,l,c)}},T.instantiateArray=function(t)
{if(0===t.length)return"[]";var e="a"+ ++this.localVariableId,i=[new y(e,"new
Array("+t.length+")")];l.value(t,"_iN$t",{globalVar:"",source:i},!
0),this.objsToClear_iN$t.push(t);for(var n=0;n<t.length;++n)
{x(i,e+"["+n+"]=",this.enumerateField(t,n,t[n]))}return
i},T.enumerateField=function(t,e,i){if("object"===(void 0===i?"undefined":n(i))&&i)
{var s=i._iN$t;if(s){var o=s.globalVar;if(!o){o=s.globalVar="v"+ +
+this.globalVariableId,this.globalVariables.push(o);var
l=s.source[0];s.source[0]=g(o+"=",l)}return o}return Array.isArray(i)?
this.instantiateArray(i):this.instantiateObj(i)}return"function"==typeof i?
this.getFuncModule(i):"string"==typeof i?f(i):("_objFlags"===e&&t instanceof
r&&(i&=a),i)},T.setObjProp=function(t,e,i,n){x(t,m+C(i)
+"=",this.enumerateField(e,i,n))},T.enumerateObject=function(t,e){var
i=e.constructor;if(cc.Class._isCCClass(i))this.enumerateCCClass(t,e,i);else for(var
r in e)if(e.hasOwnProperty(r)&&(95!==r.charCodeAt(0)||95!
==r.charCodeAt(1)||"__type__"===r)){var s=e[r];"object"===(void
0===s?"undefined":n(s))&&s&&s===e._iN$t||
this.setObjProp(t,e,r,s)}},T.instantiateObj=function(t){if(t instanceof
cc.ValueType)return h.getNewValueTypeCode(t);if(t instanceof cc.Asset)return
this.getObjRef(t);if(t._objFlags&s)return null;var
e,i=t.constructor;if(cc.Class._isCCClass(i)){if(this.parent)if(this.parent
instanceof cc.Component){if(t instanceof cc._BaseNode||t instanceof
cc.Component)return this.getObjRef(t)}else if(this.parent instanceof
cc._BaseNode)if(t instanceof cc._BaseNode){if(!t.isChildOf(this.parent))return
this.getObjRef(t)}else if(t instanceof cc.Component&&!
t.node.isChildOf(this.parent))return this.getObjRef(t);e=new y(m,"new
"+this.getFuncModule(i,!0)+"()")}else if(i===Object)e=new
y(m,"{}");else{if(i)return this.getObjRef(t);e=new y(m,"Object.create(null)")}var
n=[e];return l.value(t,"_iN$t",{globalVar:"",source:n},!
0),this.objsToClear_iN$t.push(t),this.enumerateObject(n,t),["(function()
{",n,"return o;})();"]},e.exports={compile:function(t){return new S(t,t instanceof
cc._BaseNode&&t).result},equalsToDefault:A}}),
{"./CCClass":200,"./CCObject":206,"./attribute":212,"./compiler":214,"./js":220}],2
19:[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("./CCObject"),s=t("../value-types/value-
type"),a=r.Flags.Destroyed,o=r.Flags.PersistentMask,l=t("./utils").isDomNode,h=t(".
/js");function c(t,e){if(!e){if("object"!==(void 0===t?"undefined":n(t))||
Array.isArray(t))return null;if(!t)return null;if(!cc.isValid(t))return null;0}var
i;if(t instanceof r){if(t._instantiate)return cc.game._isCloning=!
0,i=t._instantiate(),cc.game._isCloning=!1,i;if(t instanceof cc.Asset)return
null}return cc.game._isCloning=!0,i=_(t),cc.game._isCloning=!1,i}var u=[];function
_(t,e){if(Array.isArray(t))return null;if(l&&l(t))return null;var
i;if(t._iN$t)i=t._iN$t;else if(t.constructor){i=new(0,t.constructor)}else
i=Object.create(null);d(t,i,e);for(var n=0,r=u.length;n<r;+
+n)u[n]._iN$t=null;return u.length=0,i}function f(t,e,i,r){for(var
a=t.__values__,o=0;o<a.length;o++){var l=a[o],h=e[l];if("object"===(void
0===h?"undefined":n(h))&&h){var c=i[l];c instanceof
s&&c.constructor===h.constructor?c.set(h):i[l]=h._iN$t||m(h,r)}else
i[l]=h}}function d(t,e,i){h.value(t,"_iN$t",e,!0),u.push(t);var
s=t.constructor;if(cc.Class._isCCClass(s))f(s,t,e,i);else for(var a in
t)if(t.hasOwnProperty(a)&&(95!==a.charCodeAt(0)||95!
==a.charCodeAt(1)||"__type__"===a)){var l=t[a];if("object"===(void
0===l?"undefined":n(l))&&l){if(l===e)continue;e[a]=l._iN$t||m(l,i)}else e[a]=l}t
instanceof r&&(e._objFlags&=o)}function m(t,e){if(t instanceof s)return
t.clone();if(t instanceof cc.Asset)return t;var i;if(Array.isArray(t)){var
r=t.length;i=new Array(r),h.value(t,"_iN$t",i,!0);for(var o=0;o<r;++o){var
l=t[o];"object"===(void 0===l?"undefined":n(l))&&l?i[o]=l._iN$t||
m(l,e):i[o]=l}return u.push(t),i}if(t._objFlags&a)return null;var
c=t.constructor;if(cc.Class._isCCClass(c)){if(e)if(e instanceof cc.Component){if(t
instanceof cc._BaseNode||t instanceof cc.Component)return t}else if(e instanceof
cc._BaseNode)if(t instanceof cc._BaseNode){if(!t.isChildOf(e))return t}else if(t
instanceof cc.Component&&!t.node.isChildOf(e))return t;i=new c}else
if(c===Object)i={};else{if(c)return t;i=Object.create(null)}return
d(t,i,e),i}c._clone=_,cc.instantiate=c,e.exports=c}),{"../value-types/value-
type":309,"./CCObject":206,"./js":220,"./utils":224}],220:[(function(t,e,i){"use
strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?
function(t){return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=new(t("./id-generater"))("TmpCId.");function s(t,e){for(;t;){var
i=Object.getOwnPropertyDescriptor(t,e);if(i)return
i;t=Object.getPrototypeOf(t)}return null}function a(t,e,i){var
n=s(e,t);Object.defineProperty(i,t,n)}var o={isNumber:function(t)
{return"number"==typeof t||t instanceof Number},isString:function(t)
{return"string"==typeof t||t instanceof String},addon:function(t){t=t||{};for(var
e=1,i=arguments.length;e<i;e++){var r=arguments[e];if(r){if("object"!==(void
0===r?"undefined":n(r))){cc.errorID(5402,r);continue}for(var s in r)s in t||
a(s,r,t)}}return t},mixin:function(t){t=t||{};for(var e=1,i=arguments.length;e<i;e+
+){var r=arguments[e];if(r){if("object"!==(void 0===r?"undefined":n(r)))
{cc.errorID(5403,r);continue}for(var s in r)a(s,r,t)}}return
t},extend:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return
t.prototype=Object.create(e.prototype,{constructor:{value:t,writable:!
0,configurable:!0}}),t},getSuper:function(t){var
e=t.prototype,i=e&&Object.getPrototypeOf(e);return
i&&i.constructor},isChildClassOf:function(t,e){if(t&&e){if("function"!=typeof
t)return!1;if("function"!=typeof e)return!1;if(t===e)return!0;for(;;){if(!
(t=o.getSuper(t)))return!1;if(t===e)return!0}}return!1},clear:function(t){for(var
e=Object.keys(t),i=0;i<e.length;i++)delete t[e[i]]},isEmptyObject:function(t)
{for(var e in t)return!1;return!0},getPropertyDescriptor:s},l={value:void
0,enumerable:!1,writable:!1,configurable:!0};o.value=function(t,e,i,n,r)
{l.value=i,l.writable=n,l.enumerable=r,Object.defineProperty(t,e,l),l.value=void
0};var h={get:null,set:null,enumerable:!1};o.getset=function(t,e,i,n,r,s)
{"function"!=typeof n&&(r=n,n=void
0),h.get=i,h.set=n,h.enumerable=r,h.configurable=s,Object.defineProperty(t,e,h),h.g
et=null,h.set=null};var c={get:null,enumerable:!1,configurable:!
1};o.get=function(t,e,i,n,r)
{c.get=i,c.enumerable=n,c.configurable=r,Object.defineProperty(t,e,c),c.get=null};v
ar u={set:null,enumerable:!1,configurable:!1};o.set=function(t,e,i,n,r)
{u.set=i,u.enumerable=n,u.configurable=r,Object.defineProperty(t,e,u),u.set=null},o
.getClassName=function(t){if("function"==typeof t){var
e=t.prototype;if(e&&e.hasOwnProperty("__classname__")&&e.__classname__)return
e.__classname__;var i="";if(t.name&&(i=t.name),t.toString){var n,r=t.toString();
(n="["===r.charAt(0)?r.match(/\
[\w+\s*(\w+)\]/):r.match(/function\s*(\w+)/))&&2===n.length&&(i=n[1])}return"Object
"!==i?i:""}return t&&t.constructor?o.getClassName(t.constructor):""},(function()
{var t={},e={};function i(t,e,i){return o.getset(o,e,(function(){return
Object.assign({},i)}),(function(t){o.clear(i),Object.assign(i,t)})),function(e,n)
{if(n.prototype.hasOwnProperty(t)&&delete
i[n.prototype[t]],o.value(n.prototype,t,e),e){var r=i[e];if(r&&r!==n){var s="A
Class already exists with the same "+t+' : "'+e+'".';0,cc.error(s)}else
i[e]=n}}}o._setClassId=i("__cid__","_registeredClassIds",t);var
n=i("__classname__","_registeredClassNames",e);o.setClassName=function(t,e)
{if(n(t,e),!e.prototype.hasOwnProperty("__cid__")){var i=t||
r.getNewId();i&&o._setClassId(i,e)}},o.unregisterClass=function(){for(var
i=0;i<arguments.length;i++){var n=arguments[i].prototype,r=n.__cid__;r&&delete
t[r];var s=n.__classname__;s&&delete e[s]}},o._getClassById=function(e){return
t[e]},o.getClassByName=function(t){return e[t]},o._getClassId=function(t,e)
{if(e=void 0===e||e,"function"==typeof
t&&t.prototype.hasOwnProperty("__cid__"))return
t.prototype.__cid__;if(t&&t.constructor){var
i=t.constructor.prototype;if(i&&i.hasOwnProperty("__cid__"))return
t.__cid__}return""}})(),o.obsolete=function(t,e,i,n){var r=/([^.]+)$/,s=r.exec(e)
[0],a=r.exec(i)[0];function l(){return this[a]}n?o.getset(t,s,l,(function(t)
{this[a]=t})):o.get(t,s,l)},o.obsoletes=function(t,e,i,n){for(var r in i){var
s=i[r];o.obsolete(t,e+"."+r,s,n)}};var _=/(%d)|(%s)/,f=/%s/;function d(t,e)
{t.splice(e,1)}function m(t,e){var i=t.indexOf(e);return i>=0&&(d(t,i),!
0)}o.formatStr=function(){var t=arguments.length;if(0===t)return"";var
e=arguments[0];if(1===t)return""+e;if("string"==typeof e&&_.test(e))for(var
i=1;i<t;++i){var n=arguments[i],r="number"==typeof n?_:f;r.test(e)?
e=e.replace(r,n):e+=" "+n}else for(var s=1;s<t;++s)e+=" "+arguments[s];return
e},o.shiftArguments=function(){for(var t=arguments.length-1,e=new Array(t),i=0;i<t;
++i)e[i]=arguments[i+1];return e},o.createMap=function(t){var
e=Object.create(null);if(t){e["."]=!0,e["/"]=!0,delete e["."],delete e["/"]}return
e};var p=Array.prototype.indexOf;function v(t,e){void
0===e&&(e=t,t=null),this.get=null,this.count=0,this._pool=new
Array(e),this._cleanup=t}o.array={remove:m,fastRemove:function(t,e){var
i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],--
t.length)},removeAt:d,fastRemoveAt:function(t,e){var i=t.length;e<0||e>=i||
(t[e]=t[i-1],t.length=i-1)},contains:function(t,e){return
t.indexOf(e)>=0},verifyType:function(t,e){if(t&&t.length>0)for(var
i=0;i<t.length;i++)if(!(t[i]instanceof e))return cc.logID(1300),!1;return!
0},removeArray:function(t,e){for(var i=0,n=e.length;i<n;i+
+)m(t,e[i])},appendObjectsAt:function(t,e,i){return t.splice.apply(t,
[i,0].concat(e)),t},copy:function(t){var e,i=t.length,n=new
Array(i);for(e=0;e<i;e+=1)n[e]=t[e];return
n},indexOf:p,MutableForwardIterator:t("../utils/mutable-forward-
iterator")},v.prototype._get=function(){if(this.count>0){--this.count;var
t=this._pool[this.count];return this._pool[this.count]=null,t}return
null},v.prototype.put=function(t){var e=this._pool;if(this.count<e.length)
{if(this._cleanup&&!1===this._cleanup(t))return;e[this.count]=t,+
+this.count}},v.prototype.resize=function(t)
{t>=0&&(this._pool.length=t,this.count>t&&(this.count=t))},o.Pool=v,cc.js=o,e.expor
ts=o}),{"../utils/mutable-forward-iterator":296,"./id-generater":216}],221:
[(function(t,e,i){"use strict";var n=t("./js"),r={url:{canUsedInGet:!0},default:
{},serializable:{},editorOnly:{},formerlySerializedAs:{}};function s(t,e,i,n){if(!
t.get&&!t.set)if(t.hasOwnProperty("default")){var s="_N$"+e;t.get=function(){return
this[s]},t.set=function(t){var e=this[s];this[s]=t,i.call(this,e)};var a={};for(var
o in n[s]=a,r){var l=r[o];t.hasOwnProperty(o)&&(a[o]=t[o],l.canUsedInGet||delete
t[o])}}else 0}function a(t,e,i,n)
{Array.isArray(n)&&n.length>0&&(n=n[0]),t.type=n}function o(t,e,i,n)
{if(Array.isArray(e)){if(!(e.length>0))return
cc.errorID(5508,i,n);if(cc.RawAsset.isRawAssetType(e[0]))return t.url=e[0],void
delete t.type;t.type=e=e[0]}}i.getFullFormOfProperty=function(t,e,i){if(!
(t&&t.constructor===Object)){if(Array.isArray(t)&&t.length>0){var
r=t[0];return{default:[],type:t,_short:!0}}if("function"==typeof t){r=t;return
cc.RawAsset.isRawAssetType(r)||cc.RawAsset.wasRawAssetType(r)?
{default:"",url:r,_short:!0}:{default:n.isChildClassOf(r,cc.ValueType)?new
r:null,type:r,_short:!0}}return{default:t,_short:!0}}return
null},i.preprocessAttrs=function(t,e,n,r){for(var l in t){var
h=t[l],c=i.getFullFormOfProperty(h,l,e);if(c&&(h=t[l]=c),h){var
u=h.notify;u&&s(h,l,u,t),"type"in h&&o(h,h.type,e,l),"url"in
h&&a(h,0,0,h.url),"type"in
h&&h.type}}},i.validateMethodWithProps=function(t,e,i,n,r){return"function"==typeof
t||null===t}}),{"./CCClass":200,"./js":220}],222:[(function(t,e,i){"use strict";var
n=[];cc._RF={push:function(t,e,i){void
0===i&&(i=e,e=""),n.push({uuid:e,script:i,module:t,exports:t.exports,beh:null})},po
p:function(){var t=n.pop(),e=t.module,i=e.exports;if(i===t.exports){for(var r in
i)return;e.exports=i=t.cls}},peek:function(){return n[n.length-1]}}}),{}],223:
[(function(t,e,i){"use strict";cc.url={_rawAssets:"",normalize:function(t){return
t&&(46===t.charCodeAt(0)&&47===t.charCodeAt(1)?
t=t.slice(2):47===t.charCodeAt(0)&&(t=t.slice(1))),t},raw:function(t)
{if((t=this.normalize(t)).startsWith("resources/")){var
e=cc.loader._getResUuid(t.slice(10),cc.Asset,null,!0);if(e)return
cc.AssetLibrary.getLibUrlNoExt(e,!0)+cc.path.extname(t)}else
cc.errorID(7002,t);return this._rawAssets+t},_init:function(t)
{this._rawAssets=cc.path.stripSep(t)+"/"}},e.exports=cc.url}),{}],224:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t};t("./js");e.exports={contains:function(t,e)
{if("function"==typeof t.contains)return t.contains(e);if("function"==typeof
t.compareDocumentPosition)return!!(16&t.compareDocumentPosition(e));var
i=e.parentNode;if(i)do{if(i===t)return!0;i=i.parentNode}while(null!==i);return!
1},isDomNode:"object"===("undefined"==typeof
window?"undefined":n(window))&&("function"==typeof Node?function(t){return t
instanceof Node}:function(t){return t&&"object"===(void
0===t?"undefined":n(t))&&"number"==typeof t.nodeType&&"string"==typeof
t.nodeName}),callInNextTick:function(t,e,i){t&&setTimeout((function()
{t(e,i)}),0)}}}),{"./js":220}],225:[(function(t,e,i){"use
strict";t("./platform/js"),t("./value-
types"),t("./utils"),t("./platform/CCInputManager"),t("./platform/CCInputExtension"
),t("./event"),t("./platform/CCSys"),t("./platform/CCMacro"),t("./load-
pipeline"),t("./CCDirector"),t("./renderer"),t("./platform/CCView"),t("./platform/C
CScreen"),t("./CCScheduler"),t("./event-manager")}),
{"./CCDirector":50,"./CCScheduler":55,"./event":134,"./event-manager":130,"./load-
pipeline":154,"./platform/CCInputExtension":203,"./platform/CCInputManager":204,"./
platform/CCMacro":205,"./platform/CCScreen":208,"./platform/CCSys":209,"./platform/
CCView":210,"./platform/js":220,"./renderer":243,"./utils":293,"./value-
types":304}],226:[(function(t,e,i){"use strict";var n=function(t){var
e;try{e=t.getContext("2d")}catch(t){return void
console.error(t)}this._canvas=t,this._ctx=e,this._caps={},this._stats={drawcalls:0}
,this._vx=this._vy=this._vw=this._vh=0,this._sx=this._sy=this._sw=this._sh=0};n.pro
totype._restoreTexture=function(t){},n.prototype.setViewport=function(t,e,i,n)
{this._vx===t&&this._vy===e&&this._vw===i&&this._vh===n||
(this._vx=t,this._vy=e,this._vw=i,this._vh=n)},n.prototype.setScissor=function(t,e,
i,n){this._sx===t&&this._sy===e&&this._sw===i&&this._sh===n||
(this._sx=t,this._sy=e,this._sw=i,this._sh=n)},n.prototype.clear=function(t){var
e=this._ctx;e.clearRect(this._vx,this._vy,this._vw,this._vh),!t||
0===t[0]&&0===t[1]&&0===t[2]||
(e.fillStyle="rgb("+t[0]+","+t[1]+","+t[2]+")",e.globalAlpha=t[3],e.fillRect(this._
vx,this._vy,this._vw,this._vh))},e.exports=n}),{}],227:[(function(t,e,i){"use
strict";var n=function(t,e)
{this._device=t,this._width=4,this._height=4,this._image=null,e&&(void 0!
==e.width&&(this._width=e.width),void 0!
==e.height&&(this._height=e.height),this.updateImage(e))};n.prototype.update=functi
on(t){this.updateImage(t)},n.prototype.updateImage=function(t)
{if(t.images&&t.images[0]){var e=t.images[0];e&&e!
==this._image&&(this._image=e)}},n.prototype.destroy=function()
{this._image=null},e.exports=n}),{}],228:[(function(t,e,i){"use
strict";var n=function(){};n.prototype={constructor:n,_reset:function()
{},render:function(){}},e.exports=n}),{}],229:[(function(t,e,i){"use
strict";e.exports={ForwardRenderer:t("./forward-
renderer"),RenderComponentHandle:t("./render-component-
handle"),_renderers:t("./renderers")}}),{"./forward-renderer":228,"./render-
component-handle":230,"./renderers":233}],230:[(function(t,e,i){"use
strict";t("./renderers");var n=t("./renderers/utils"),r=function(t,e)
{this._device=t,this._camera=e,this.parentOpacity=1,this.parentOpacityDirty=0,this.
worldMatDirty=0,this.walking=!1};r.prototype={constructor:r,reset:function(){var
t=this._device._ctx,e=this._device._canvas,i=cc.Camera.main?
cc.Camera.main.backgroundColor:cc.color(),r="rgba("+i.r+", "+i.g+", "+i.b+",
"+i.a/255+")";t.fillStyle=r,t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.h
eight),t.fillRect(0,0,e.width,e.height),this._device._stats.drawcalls=0,n.context.r
eset()},terminate:function(){},_commitComp:function(t,e){var
i=this._device._ctx,n=this._camera;i.setTransform(n.a,n.b,n.c,n.d,n.tx,n.ty),i.scal
e(1,-1),e.draw(i,t)}},e.exports=r}),
{"./renderers":233,"./renderers/utils":242}],231:[(function(t,e,i){"use strict";var
n=t("../../../../graphics/helper"),r=t("../../../../graphics/types"),s=t("../../../
../platform/js"),a=(r.PointFlags,r.LineJoin),o=r.LineCap;function l()
{this.cmds=[],this.style={strokeStyle:"black",fillStyle:"white",lineCap:"butt",line
Join:"miter",miterLimit:10}}var h=l.prototype;s.mixin(h,{moveTo:function(t,e)
{this.cmds.push(["moveTo",[t,e]])},lineTo:function(t,e){this.cmds.push(["lineTo",
[t,e]])},bezierCurveTo:function(t,e,i,n,r,s){this.cmds.push(["bezierCurveTo",
[t,e,i,n,r,s]])},quadraticCurveTo:function(t,e,i,n)
{this.cmds.push(["quadraticCurveTo",[t,e,i,n]])},arc:function(t,e,i,r,s,a)
{n.arc(this,t,e,i,r,s,a)},ellipse:function(t,e,i,r)
{n.ellipse(this,t,e,i,r)},circle:function(t,e,i)
{n.ellipse(this,t,e,i,i)},rect:function(t,e,i,n)
{this.moveTo(t,e),this.lineTo(t,e+n),this.lineTo(t+i,e+n),this.lineTo(t+i,e),this.c
lose()},roundRect:function(t,e,i,r,s)
{n.roundRect(this,t,e,i,r,s)},clear:function(t,e)
{this.cmds.length=0},close:function(){this.cmds.push(["closePath",
[]])},stroke:function(){this.cmds.push(["stroke",[]])},fill:function()
{this.cmds.push(["fill",[]])}}),s.set(h,"strokeColor",(function(t){var
e="rgba("+(0|t.r)+","+(0|t.g)+","+(0|t.b)
+","+t.a/255+")";this.cmds.push(["strokeStyle",e]),this.style.strokeStyle=e})),s.se
t(h,"fillColor",(function(t){var e="rgba("+(0|t.r)+","+(0|t.g)+","+(0|t.b)
+","+t.a/255+")";this.cmds.push(["fillStyle",e]),this.style.fillStyle=e})),s.set(h,
"lineWidth",(function(t)
{this.cmds.push(["lineWidth",t]),this.style.lineWidth=t})),s.set(h,"lineCap",
(function(t){var e="butt";t===o.BUTT?e="butt":t===o.ROUND?
e="round":t===o.SQUARE&&(e="square"),this.cmds.push(["lineCap",e]),this.style.lineC
ap=e})),s.set(h,"lineJoin",(function(t){var e="bevel";t===a.BEVEL?
e="bevel":t===a.ROUND?
e="round":t===a.MITER&&(e="miter"),this.cmds.push(["lineJoin",e]),this.style.lineJo
in=e})),s.set(h,"miterLimit",(function(t)
{this.cmds.push(["miterLimit",t]),this.style.miterLimit=t})),e.exports=l}),
{"../../../../graphics/helper":142,"../../../../graphics/types":144,"../../../../pl
atform/js":220}],232:[(function(t,e,i){"use strict";var
n=t("./impl");e.exports={createImpl:function(){return new n},draw:function(t,e){var
i=e.node,n=i._worldMatrix,r=n.m00,s=n.m01,a=n.m04,o=n.m05,l=n.m12,h=n.m13;t.transfo
rm(r,s,a,o,l,h),t.save(),t.globalAlpha=i.opacity/255;var
c=e._impl.style;t.strokeStyle=c.strokeStyle,t.fillStyle=c.fillStyle,t.lineWidth=c.l
ineWidth,t.lineJoin=c.lineJoin,t.miterLimit=c.miterLimit;for(var u=!
0,_=e._impl.cmds,f=0,d=_.length;f<d;f++){var m=_[f],p=m[0],v=m[1];"moveTo"===p&&u?
(t.beginPath(),u=!1):"fill"!==p&&"stroke"!==p&&"fillRect"!==p||(u=!
0),"function"==typeof t[p]?t[p].apply(t,v):t[p]=v}return
t.restore(),1},stroke:function(t){t._impl.stroke()},fill:function(t)
{t._impl.fill()}}}),{"./impl":231}],233:[(function(t,e,i){"use strict";var
n=t("../../../platform/js"),r=t("../../../components/CCSprite"),s=t("../../../compo
nents/CCLabel"),a=t("../../../components/CCMask"),o=t("../../../graphics/graphics")
,l=t("./sprite"),h=t("./label"),c=t("./graphics"),u=t("./mask"),_={},f={};function
d(t,e,i){var
r=n.getClassName(t);_[r]=e,i&&(f[r]=i),t._assembler=e,t._postAssembler=i}d(r,l),d(s
,h),a&&d(a,u.beforeHandler,u.afterHandler),o&&d(o,c),e.exports={map:_,postMap:f,add
Renderer:d}}),
{"../../../components/CCLabel":97,"../../../components/CCMask":101,"../../../compon
ents/CCSprite":111,"../../../graphics/graphics":141,"../../../platform/js":220,"./g
raphics":232,"./label":235,"./mask":237,"./sprite":238}],234:[(function(t,e,i){"use
strict";var
n=t("../../../utils/label/bmfont"),r=t("../../../../platform/js"),s=t("../utils");e
.exports=r.addon({createData:function(t){return
t.requestRenderData()},appendQuad:function(t,e,i,n,r,s,a){var
o=t.dataLength;t.dataLength+=2;var
l=t._data,h=(e.width,e.height,i.width),c=i.height,u=void 0,_=void 0,f=void 0,d=void
0;n?(u=i.x,f=i.x+c,_=i.y,d=i.y+h,l[o].u=u,l[o].v=d,l[o+1].u=u,l[o+1].v=_):
(u=i.x,f=i.x+h,_=i.y,d=i.y+c,l[o].u=u,l[o].v=_,l[o+1].u=f,l[o+1].v=d),l[o].x=r,l[o]
.y=s-c*a,l[o+1].x=r+h*a,l[o+1].y=s},draw:function(t,e){var
i=e.node,n=i._worldMatrix,r=n.m00,a=n.m01,o=n.m04,l=n.m05,h=n.m12,c=n.m13;t.transfo
rm(r,a,o,l,h,c),t.scale(1,-1),s.context.setGlobalAlpha(t,i.opacity/255);for(var
u=e._frame._texture,_=e._renderData._data,f=s.getColorizedImage(u,i._color),d=0,m=_
.length;d<m;d+=2){var p=_[d].x,v=_[d].y,y=_[d+1].x-p,g=_[d+1].y-v;v=-v-g;var
x=_[d].u,b=_[d].v,A=_[d+1].u-x,C=_[d+1].v-b;t.drawImage(f,x,b,A,C,p,v,y,g)}return
1}},n)}),
{"../../../../platform/js":220,"../../../utils/label/bmfont":247,"../utils":242}],2
35:[(function(t,e,i){"use strict";var
n=t("../../../../components/CCLabel"),r=t("./ttf"),s=t("./bmfont"),a={pool:
[],get:function(){var t=this.pool.pop();if(!t){var
e=document.createElement("canvas");t={canvas:e,context:e.getContext("2d")}}return
t},put:function(t){this.pool.length>=32||
this.pool.push(t)}};n._canvasPool=a,e.exports={getAssembler:function(t){var
e=r;return t.font instanceof cc.BitmapFont&&(e=s),e},createData:function(t){return
t._assembler.createData(t)},draw:function(t,e){if(!e._texture)return 0;var
i=e._assembler;return i?(i.updateRenderData(e),i.draw(t,e)):0}}}),
{"../../../../components/CCLabel":97,"./bmfont":234,"./ttf":236}],236:
[(function(t,e,i){"use strict";var
n=t("../../../utils/label/ttf"),r=t("../../../../platform/js"),s=t("../utils");e.ex
ports=r.addon({createData:function(t){var e=t.requestRenderData();return
e.dataLength=2,e},_updateVerts:function(t){var
e=t._renderData,i=t.node,n=i.width,r=i.height,s=i.anchorX*n,a=i.anchorY*r,o=e._data
;o[0].x=-s,o[0].y=-a,o[1].x=n-s,o[1].y=r-a},_updateTexture:function(t)
{n._updateTexture(t);var
e=t._frame._texture;s.dropColorizedImage(e,t.node.color)},draw:function(t,e){var
i=e.node,n=i._worldMatrix,r=n.m00,a=n.m01,o=n.m04,l=n.m05,h=n.m12,c=n.m13;t.transfo
rm(r,a,o,l,h,c),t.scale(1,-1),s.context.setGlobalAlpha(t,i.opacity/255);var
u=e._frame._texture,_=e._renderData._data,f=u.getHtmlElementObj(),d=_[0].x,m=_[0].y
,p=_[1].x-d,v=_[1].y-m;return m=-m-v,t.drawImage(f,d,m,p,v),1}},n)}),
{"../../../../platform/js":220,"../../../utils/label/ttf":250,"../utils":242}],237:
[(function(t,e,i){"use strict";t("../../../components/CCMask");var
n=t("./graphics"),r={updateRenderData:function(t){},draw:function(t,e)
{t.save(),n.draw(t,e._graphics),t.clip()}};e.exports={beforeHandler:r,afterHandler:
{updateRenderData:function(t){},draw:function(t,e){t.restore()}}}}),
{"../../../components/CCMask":101,"./graphics":232}],238:[(function(t,e,i){"use
strict";var
n=t("../../../../components/CCSprite"),r=n.Type,s=n.FillType,a=t("./simple"),o=t(".
/sliced"),l=t("./tiled");e.exports={getAssembler:function(t){switch(t.type){case
r.SIMPLE:return a;case r.SLICED:return o;case r.TILED:return l;case r.FILLED:return
t._fillType,s.RADIAL,null}},createData:function(t){return
t._assembler.createData(t)}}}),
{"../../../../components/CCSprite":111,"../../../webgl/assemblers/sprite/index.js":
277,"./simple":239,"./sliced":240,"./tiled":241}],239:[(function(t,e,i){"use
strict";var n=t("../utils"),r={createData:function(t){var
e=t.requestRenderData();return e.dataLength=2,e},updateRenderData:function(t)
{t._material||t._activateMaterial();var
e=t._renderData;e.uvDirty&&this.updateUVs(t),e.vertDirty&&this.updateVerts(t)},upda
teUVs:function(t){var
e=t.spriteFrame,i=t._renderData,n=i._data,r=e._rect;e._texture;if(e._rotated){var
s=r.x,a=r.height,o=r.y,l=r.width;n[0].u=s,n[0].v=l,n[1].u=a,n[1].v=o}else{var
h=r.x,c=r.width,u=r.y,_=r.height;n[0].u=h,n[0].v=u,n[1].u=c,n[1].v=_}i.uvDirty=!
1},updateVerts:function(t){var
e=t._renderData,i=t.node,n=e._data,r=i.width,s=i.height,a=i.anchorX*r,o=i.anchorY*s
,l=void 0,h=void 0,c=void 0,u=void 0;if(t.trim)l=-a,h=-o,c=r,u=s;else{var
_=t.spriteFrame,f=_._originalSize.width,d=_._originalSize.height,m=_._rect.width,p=
_._rect.height,v=_._offset,y=r/f,g=s/d,x=v.x+(f-m)/2,b=(v.x,v.y+(d-p)/2);v.y;l=x*y-
a,h=b*g-o,c=r,u=s}n[0].x=l,n[0].y=h,n[1].x=c,n[1].y=u,e.vertDirty=!
1},draw:function(t,e){var
i=e.node,r=i._worldMatrix,s=r.m00,a=r.m01,o=r.m04,l=r.m05,h=r.m12,c=r.m13;t.transfo
rm(s,a,o,l,h,c),t.scale(1,-1),n.context.setGlobalAlpha(t,i.opacity/255);var
u=e._spriteFrame._texture,_=e._renderData._data,f=n.getColorizedImage(u,i._color),d
=_[0].x,m=_[0].y,p=_[1].x,v=_[1].y;m=-m-v;var
y=_[0].u,g=_[0].v,x=_[1].u,b=_[1].v;return
t.drawImage(f,y,g,x,b,d,m,p,v),1}};e.exports=r}),{"../utils":242}],240:
[(function(t,e,i){"use strict";var n=t("../utils"),r={createData:function(t){var
e=t.requestRenderData();return
e.dataLength=4,e},updateRenderData:t("./simple").updateRenderData,updateUVs:functio
n(t){var
e=t.spriteFrame,i=t._renderData,n=e._rect,r=(e._texture,e.insetLeft),s=e.insetRight
,a=n.width-r-s,o=e.insetTop,l=e.insetBottom,h=n.height-o-l,c=i._data;e._rotated?
(c[0].u=n.x,c[1].u=l+n.x,c[2].u=l+h+n.x,c[3].u=n.x+n.height,c[3].v=n.y,c[2].v=r+n.y
,c[1].v=r+a+n.y,c[0].v=n.y+n.width):(c[0].u=n.
x,c[1].u=r+n.x,c[2].u=r+a+n.x,c[3].u=n.x+n.width,c[3].v=n.y,c[2].v=o+n.y,c[1].v=o+h
+n.y,c[0].v=n.y+n.height),i.uvDirty=!1},updateVerts:function(t){var
e=t._renderData,i=e._data,n=t.node,r=n.width,s=n.height,a=n.anchorX*r,o=n.anchorY*s
,l=t.spriteFrame,h=(l._rect,l.insetLeft),c=l.insetRight,u=l.insetTop,_=l.insetBotto
m,f=r-h-c,d=s-u-_,m=r/(h+c),p=s/(u+_);m=isNaN(m)||m>1?1:m,p=isNaN(p)||p>1?
1:p,f=f<0?0:f,d=d<0?0:d,i[0].x=-a,i[0].y=-o,i[1].x=h*m-a,i[1].y=_*p-
o,i[2].x=i[1].x+f,i[2].y=i[1].y+d,i[3].x=r-a,i[3].y=s-o,e.vertDirty=!
1},draw:function(t,e){var
i=e.node,r=i._worldMatrix,s=r.m00,a=r.m01,o=r.m04,l=r.m05,h=r.m12,c=r.m13;t.transfo
rm(s,a,o,l,h,c),t.scale(1,-1),n.context.setGlobalAlpha(t,i.opacity/255);for(var
u=e._spriteFrame._texture,_=e._renderData._data,f=n.getColorizedImage(u,i._color),d
=0,m=void 0,p=void 0,v=void 0,y=void 0,g=void 0,x=void 0,b=void 0,A=void 0,C=void
0,S=void 0,T=void 0,w=void 0,E=0;E<3;++E){y=_[E],v=_[E+1];for(var M=0;M<3;+
+M)m=_[M],p=_[M+1],g=m.x,x=y.y,b=p.x-g,x=-x-(A=v.y-x),C=m.u,S=v.v,T=p.u-C,w=y.v-
S,T>0&&w>0&&b>0&&A>0&&(t.drawImage(f,C,S,T,w,g,x,b,A),d++)}return
d}};e.exports=r}),{"../utils":242,"./simple":239}],241:[(function(t,e,i){"use
strict";var n=t("../utils"),r={createData:function(t){return
t.requestRenderData()},updateRenderData:function(t){t._material||
t._activateMaterial()},draw:function(t,e){var
i=e.node,r=i._worldMatrix,s=r.m00,a=r.m01,o=r.m04,l=r.m05,h=r.m12,c=r.m13;t.transfo
rm(s,a,o,l,h,c),t.scale(1,-1),n.context.setGlobalAlpha(t,i.opacity/255);var
u=e.spriteFrame,_=u._rect,f=u._texture,d=_.x,m=_.y,p=u._rotated?
_.height:_.width,v=u._rotated?
_.width:_.height,y=n.getFrameCache(f,i._color,d,m,p,v),g=i.width,x=i.height,b=-
i.anchorX*g,A=-i.anchorY*x;return A=-A-
x,t.translate(b,A),t.fillStyle=t.createPattern(y,"repeat"),t.fillRect(0,0,g,x),1}};
e.exports=r}),{"../utils":242}],242:[(function(t,e,i){"use strict";function
n(t,e,i,n,r,s,a){var o=e._image,l=t.getContext("2d");return
t.width=s,t.height=a,l.globalCompositeOperation="source-
over",l.fillStyle="rgb("+i.r+","+i.g+","+i.b+")",l.fillRect(0,0,s,a),l.globalCompos
iteOperation="multiply",l.drawImage(o,n,r,s,a,0,0,s,a),l.globalCompositeOperation="
destination-atop",l.drawImage(o,n,r,s,a,0,0,s,a),t}var r={canvasMap:{},canvasUsed:
{},canvasPool:[],checking:!1,check:function(){var t=!1;for(var e in
this.canvasUsed)if(t=!0,this.canvasUsed[e])this.canvasUsed[e]=!1;else{var
i=this.canvasMap[e];i.width=0,i.height=0,this.canvasPool.length<32&&this.canvasPool
.push(i),delete this.canvasMap[e],delete this.canvasUsed[e]}t||
(cc.director.off(cc.Director.EVENT_AFTER_DRAW,this.check,this),this.checking=!
1)},startCheck:function()
{cc.director.on(cc.Director.EVENT_AFTER_DRAW,this.check,this),this.checking=!
0},getCanvas:function(t){return this.canvasUsed[t]=!
0,this.canvasMap[t]},cacheCanvas:function(t,e)
{this.canvasMap[e]=t,this.canvasUsed[e]=!0,this.checking||
this.startCheck()},dropImage:function(t){this.canvasMap[t]&&delete
this.canvasMap[t]}};e.exports={getColorizedImage:function(t,e){if(!t)return
null;if(0===t.width||0===t.height)return t._image;var
i=16777215&e._val;if(16777215===i)return t._image;var
s=t.url+i,a=r.getCanvas(s);return a||(n(a=r.canvasPool.pop()||
document.createElement("canvas"),t,e,0,0,t.width,t.height),r.cacheCanvas(a,s)),a},g
etFrameCache:function(t,e,i,s,a,o){if(!t||!t.url||i<0||s<0||a<=0||o<=0)return
null;var l=t.url,h=!1,c=16777215&e._val;if(16777215!==c&&(l+=c,h=!0),(0!==i||0!
==s&&a!==t.width&&o!==t.height)&&(l+="_"+i+"_"+s+"_"+a+"_"+o,h=!0),!h)return
t._image;var u=r.getCanvas(l);return u||(n(u=r.canvasPool.pop()||
document.createElement("canvas"),t,e,i,s,a,o),r.cacheCanvas(u,l)),u},dropColorizedI
mage:function(t,e){var i=t.url+(16777215&e._val);r.dropImage(i)}};var s=-
1,a={setGlobalAlpha:function(t,e){s!==e&&(s=e,t.globalAlpha=s)},reset:function()
{s=-1}};e.exports.context=a}),{}],243:[(function(t,e,i){"use strict";var
n=c(t("../../renderer/renderers/forward-
renderer")),r=c(t("../../renderer/config")),s=c(t("../../renderer/gfx")),a=c(t("../
../renderer/scene/scene")),o=c(t("../../renderer/core/input-
assembler")),l=c(t("../../renderer/render-data/ia-render-
data")),h=c(t("../../renderer/core/pass"));function c(t){return t&&t.__esModule?t:
{default:t}}var u=t("./render-flow");function _(t){return{defaultTexture:new
s.default.Texture2D(t,{images:
[],width:128,height:128,wrapS:s.default.WRAP_REPEAT,wrapT:s.default.WRAP_REPEAT,for
mat:s.default.TEXTURE_FMT_RGB8,mipmap:!1}),programTemplates:{},programChunks:
{}}}cc.renderer=e.exports={Texture2D:null,InputAssembler:o.default,IARenderData:l.d
efault,Pass:h.default,renderEngine:null,canvas:null,device:null,scene:null,drawCall
s:0,_handle:null,_cameraNode:null,_camera:null,_forward:null,initWebGL:function(e,i
){t("./webgl/assemblers");var o=t("./webgl/model-
batcher");this.Texture2D=s.default.Texture2D,this.canvas=e,this.device=new
s.default.Device(e,i),this.scene=new a.default,this._handle=new
o(this.device,this.scene),u.init(this._handle);var
l=_(this.device);this._forward=new
n.default(this.device,l),r.default.addStage("shadowcast"),r.default.addStage("opaqu
e"),r.default.addStage("transparent")},initCanvas:function(e){var
i=t("./canvas"),n=t("./canvas/Texture2D"),r=t("./canvas/Device");this.Device=r,this
.Texture2D=n,this.canvas=e,this.device=new
r(e),this._camera={a:1,b:0,c:0,d:1,tx:0,ty:0},this._handle=new
i.RenderComponentHandle(this.device,this._camera),u.init(this._handle),this._forwar
d=new i.ForwardRenderer},updateCameraViewport:function()
{cc.director&&cc.director.getScene().setScale(1,1,1);if(cc.game.renderType===cc.gam
e.RENDER_TYPE_CANVAS){var
t=cc.view.getViewportRect();this.device.setViewport(t.x,t.y,t.width,t.height),this.
_camera.a=cc.view.getScaleX(),this._camera.d=cc.view.getScaleY(),this._camera.tx=t.
x,this._camera.ty=t.y+t.height}},render:function(t)
{this.device._stats.drawcalls=0,t&&(u.visit(t),this._forward.render(this.scene),thi
s.drawCalls=this.device._stats.drawcalls)},clear:function()
{this._handle.reset(),this._forward._reset()}}}),
{"../../renderer/config":335,"../../renderer/core/input-
assembler":338,"../../renderer/core/pass":339,"../../renderer/gfx":348,"../../rende
rer/render-data/ia-render-data":367,"../../renderer/renderers/forward-
renderer":369,"../../renderer/scene/scene":373,"./canvas":229,"./canvas/Device":226
,"./canvas/Texture2D":227,"./render-
flow":244,"./webgl/assemblers":255,"./webgl/model-batcher":280}],244:
[(function(t,e,i){"use strict";var n=0,r=1,s=2,a=r|
s,o=4,l=8,h=16,c=32,u=64,_=128,f=256,d=512,m=void 0;function p()
{this._func=A,this._next=null}var v=p.prototype;v._doNothing=function()
{},v._localTransform=function(t)
{t._updateLocalMatrix(),t._renderFlag&=~r,this._next._func(t)},v._worldTransform=fu
nction(t){m.worldMatDirty++;var
e=t._matrix,i=t._position;e.m12=i.x,e.m13=i.y,t._mulMat(t._worldMatrix,t._parent._w
orldMatrix,e),t._renderFlag&=~s,this._next._func(t),m.worldMatDirty--},v._opacity=f
unction(t){m.parentOpacityDirty++;var
e=t._renderComponent;e&&e._updateColor&&e._updateColor(),t._renderFlag&=~l,this._ne
xt._func(t),m.parentOpacityDirty--},v._updateRenderData=function(t){var
e=t._renderComponent;e._assembler.updateRenderData(e),t._renderFlag&=~o,this._next.
_func(t)},v._render=function(t){var
e=t._renderComponent;m._commitComp(e,e._assembler,t._cullingMask),this._next._func(
t)},v._customIARender=function(t){var
e=t._renderComponent;m._commitIA(e,e._assembler,t._cullingMask),this._next._func(t)
},v._children=function(t){for(var
e=m,i=e.parentOpacity,n=e.parentOpacity*=t._opacity/255,r=(e.worldMatDirty?s:0)|
(e.parentOpacityDirty?l:0),a=t._children,o=0,h=a.length;o<h;o++){var
c=a[o];if(c._renderFlag|=r,c._activeInHierarchy&&0!==c._opacity){var
u=c._color._val;c._color._fastSetA(c._opacity*n),g[c._renderFlag]._func(c),c._color
._val=u}}e.parentOpacity=i,this._next._func(t)},v._postUpdateRenderData=function(t)
{var
e=t._renderComponent;e._postAssembler&&e._postAssembler.updateRenderData(e),t._rend
erFlag&=~_,this._next._func(t)},v._postRender=function(t){var
e=t._renderComponent;m._commitComp(e,e._postAssembler,t._cullingMask),this._next._f
unc(t)};var y=new p;y._func=y._doNothing,y._next=y;var g={};function x(t,e){var
i=new p;switch(i._next=e||y,t){case n:i._func=i._doNothing;break;case
r:i._func=i._localTransform;break;case s:i._func=i._worldTransform;break;case
l:i._func=i._opacity;break;case o:i._func=i._updateRenderData;break;case
h:i._func=i._render;break;case c:i._func=i._customIARender;break;case
u:i._func=i._children;break;case _:i._func=i._postUpdateRenderData;break;case
f:i._func=i._postRender}return i}function b(t){for(var
e=null,i=d;i>0;)i&t&&(e=x(i,e)),i>>=1;return e}function A(t){var e=t._renderFlag;
(g[e]=b(e))._func(t)}p.flows=g,p.createFlow=x,p.visit=function(t)
{m.reset(),m.walking=!0,1<<t.groupIndex,t._renderFlag&s?(m.worldMatDirty+
+,t._calculWorldMatrix(),t._renderFlag&=~s,g[t._renderFlag]._func(t),m.worldMatDirt
y--):g[t._renderFlag]._func(t),m.terminate(),m.walking=!1},p.init=function(t)
{m=t,g[0]=y;for(var e=1;e<d;e++)g[e]=new
p},p.FLAG_DONOTHING=n,p.FLAG_LOCAL_TRANSFORM=r,p.FLAG_WORLD_TRANSFORM=s,p.FLAG_TRAN
SFORM=a,p.FLAG_OPACITY=l,p.FLAG_UPDATE_RENDER_DATA=o,p.FLAG_RENDER=h,p.FLAG_CUSTOM_
IA_RENDER=c,p.FLAG_CHILDREN=u,p.FLAG_POST_UPDATE_RENDER_DATA=_,p.FLAG_POST_RENDER=f
,p.FLAG_FINAL=d,e.exports=cc.RenderFlow=p}),{}],245:[(function(t,e,i){"use
strict";var n=t("../../../assets/CCRenderTexture"),r=2;function s(t,e){var i=new
n;i.initWithSize(t,e),i.update(),this._texture=i,this._x=r,this._y=r,this._nexty=r,
this._width=t,this._height=e,this._innerTextureInfos={},this._innerSpriteFrames=[]}
s.DEFAULT_HASH=(new n)._getHash(),cc.js.mixin(s.prototype,
{insertSpriteFrame:function(t){var
e=t._rect,i=t._texture,n=this._innerTextureInfos[i._id],s=e.x,a=e.y;if(n)s+=n.x,a+=
n.y;else{var
o=i.width,l=i.height;if(this._x+o+r>this._width&&(this._x=r,this._y=this._nexty),th
is._y+l>this._nexty&&(this._nexty=this._y+l+r),this._nexty>this._height)return
null;this._texture.drawTextureAt(i,this._x-
1,this._y),this._texture.drawTextureAt(i,this._x+1,this._y),this._
texture.drawTextureAt(i,this._x,this._y-
1),this._texture.drawTextureAt(i,this._x,this._y+1),this._texture.drawTextureAt(i,t
his._x,this._y),this._innerTextureInfos[i._id]={x:this._x,y:this._y,texture:i},s+=t
his._x,a+=this._y,this._x+=o+r,this._dirty=!0}var
h={x:s,y:a,texture:this._texture};return
this._innerSpriteFrames.push(t),h},update:function()
{this._dirty&&(this._texture.update(),this._dirty=!1)},reset:function()
{this._x=r,this._y=r,this._nexty=r;for(var
t=this._innerSpriteFrames,e=0,i=t.length;e<i;e++){var
n=t[e];n.isValid&&n._resetDynamicAtlasFrame()}this._innerSpriteFrames.length=0,this
._innerTextureInfos={}},destroy:function()
{this.reset(),this._texture.destroy()}}),e.exports=s}),
{"../../../assets/CCRenderTexture":66}],246:[(function(t,e,i){"use strict";var
n=t("./atlas"),r=[],s=-1,a=5,o=2048,l=512;function h(){var t=r[++s];return t||
(t=new n(o,o),r.push(t)),t}function c(){_.reset()}var u=!1,_={get enabled(){return
u},set enabled(t){u!==t&&(t?
(this.reset(),cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,c)):cc.director.
off(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,c),u=t)},get maxAtlasCount(){return
a},set maxAtlasCount(t){a=t},get textureSize(){return o},set textureSize(t)
{o=t},get maxFrameSize(){return l},set maxFrameSize(t)
{l=t},insertSpriteFrame:function(t){if(!u||s===a||!t||t._original)return null;var
e=t._texture;if(e instanceof cc.RenderTexture||e._isCompressed())return null;var
i=e.width,o=e.height;if(i>l||o>l||i<=8||o<=8||e._getHash()!==n.DEFAULT_HASH)return
null;var c=r[s];c||(c=h());var _=c.insertSpriteFrame(t);return _||s===a?_:
(c=h()).insertSpriteFrame(t)},reset:function(){for(var t=0,e=r.length;t<e;t+
+)r[t].destroy();r.length=0,s=-1},showDebug:!1,update:function()
{if(this.enabled)for(var t=0;t<=s;t+
+)r[t].update()}};e.exports=cc.dynamicAtlasManager=_}),{"./atlas":245}],247:
[(function(t,e,i){"use strict";var
n=t("../../../platform/CCMacro"),r=t("../../../components/CCLabel").Overflow,s=t(".
./../../utils/text-utils"),a=function()
{this._u=0,this._v=0,this._width=0,this._height=0,this._offsetX=0,this._offsetY=0,t
his._textureID=0,this._validDefinition=!
1,this._xAdvance=0};cc.FontAtlas=function(t)
{this._letterDefinitions={}},cc.FontAtlas.prototype={constructor:cc.FontAtlas,addLe
tterDefinitions:function(t,e)
{this._letterDefinitions[t]=e},cloneLetterDefinition:function(){var t={};for(var e
in this._letterDefinitions){var i=new
a;cc.js.mixin(i,this._letterDefinitions[e]),t[e]=i}return
t},assignLetterDefinitions:function(t){for(var e in this._letterDefinitions){var
i=t[e],n=this._letterDefinitions[e];cc.js.mixin(n,i)}},scaleFontLetterDefinition:fu
nction(t){for(var e in this._letterDefinitions){var
i=this._letterDefinitions[e];i._width*=t,i._height*=t,i._offsetX*=t,i._offsetY*=t,i
._xAdvance*=t}},getLetterDefinitionForChar:function(t){return
this._letterDefinitions.hasOwnProperty(t.charCodeAt(0))?
this._letterDefinitions[t.charCodeAt(0)]:null}};var o=function()
{this._char="",this._valid=!
0,this._positionX=0,this._positionY=0,this._lineIndex=0},l=cc.rect(),h=null,c=[],u=
[],_=[],f=[],d=cc.size(),m=null,p=null,v=0,y=0,g=0,x=0,b=0,A=1,C=null,S="",T=0,w=0,
E=cc.size(),M=0,D=0,B=0,P=0,I=0,R=!
1,O=0,L=0,F=0;e.exports={updateRenderData:function(t){t._renderData.vertDirty&&h!
==t&&(h=t,this._updateProperties(),this._updateContent(),h._actualFontSize=T,h.node
.setContentSize(E),h._renderData.vertDirty=h._renderData.uvDirty=!
1,h=null,this._resetProperties())},_updateFontScale:function()
{A=T/w},_updateProperties:function(){var
t=h.font;if(C=t.spriteFrame,p=t._fntConfig,!(m=h._fontAtlas)){m=new
cc.FontAtlas(p);var e=p.fontDefDictionary;for(var i in e){var n=new
a,s=e[i].rect;n._offsetX=e[i].xOffset,n._offsetY=e[i].yOffset,n._width=s.width,n._h
eight=s.height,n._u=s.x,n._v=s.y,n._textureID=0,n._validDefinition=!
0,n._xAdvance=e[i].xAdvance,m.addLetterDefinitions(i,n)}h._fontAtlas=m}S=h.string.t
oString(),T=h.fontSize,w=p.fontSize,E.width=h.node._contentSize.width,E.height=h.no
de._contentSize.height,M=h.horizontalAlign,D=h.verticalAlign,B=h.spacingX,I=h.overf
low,P=h._lineHeight,R=I!==r.NONE&&(I===r.RESIZE_HEIGHT||
h.enableWrapText),this._setupBMFontOverflowMetrics()},_resetProperties:function()
{m=null,p=null,C=null},_updateContent:function()
{this._updateFontScale(),this._computeHorizontalKerningForText(),this._alignText()}
,_computeHorizontalKerningForText:function(){for(var
t=S,e=t.length,i=p.kerningDict,n=c,r=-1,s=0;s<e;++s){var
a=t.charCodeAt(s),o=i[r<<16|65535&a]||0;n[s]=s<e-1?
o:0,r=a}},_multilineTextWrap:function(t){var
e=S.length,i=0,n=0,r=0,a=0,o=0,l=0,h=0,u=null,f=cc.v2(0,0);this._updateFontScale();
for(var d=m._letterDefinitions,g=0;g<e;){var C=S.charAt(g);if("\n"!==C){for(var
T=t(S,g,e),w=l,M=h,D=o,I=n,V=!1,N=0;N<T;++N){var k=g+N;if("\r"!
==(C=S.charAt(k)))if(u=m.getLetterDefinitionForChar(C)){var
G=I+u._offsetX*A;if(R&&F>0&&n>0&&G+u._width*A>F&&!s.isUnicodeSpace(C))
{_.push(o),o=0,i++,n=0,r-=P*A+0,V=!0;break}f.x=G,f.y=r-
u._offsetY*A,this._recordLetterInfo(d,f,C,k,i),k+1<c.length&&k<e-
1&&(I+=c[k+1]),I+=u._xAdvance*A+B,D=f.x+u._width*A,w<f.y&&(w=f.y),M>f.y-
u._height*A&&(M=f.y-u._height*A)}else
this._recordPlaceholderInfo(k,C),console.log("Can't find letter definition in
texture atlas "+p.atlasName+" for letter:"+C);else
this._recordPlaceholderInfo(k,C)}V||
(n=I,o=D,l<w&&(l=w),h>M&&(h=M),a<o&&(a=o),g+=T)}else _.push(o),o=0,i++,n=0,r-
=P*A+0,this._recordPlaceholderInfo(g,C),g++}return
_.push(o),y=(v=i+1)*P*A,v>1&&(y+=0*(v-
1)),E.width=O,E.height=L,O<=0&&(E.width=parseFloat(a.toFixed(2))),L<=0&&(E.height=p
arseFloat(y.toFixed(2))),x=E.height,b=0,l>0&&(x=E.height+l),h<-y&&(b=y+h),!
0},_getFirstCharLen:function(){return 1},_getFirstWordLen:function(t,e,i){var
n=t.charAt(e);if(s.isUnicodeCJK(n)||"\n"===n||s.isUnicodeSpace(n))return 1;var
r=1,a=m.getLetterDefinitionForChar(n);if(!a)return r;for(var
o=a._xAdvance*A+B,l=e+1;l<i&&(n=t.charAt(l),a=m.getLetterDefinitionForChar(n));++l)
{if(o+a._offsetX*A+a._width*A>F&&!s.isUnicodeSpace(n)&&F>0)return
r;if(o+=a._xAdvance*A+B,"\n"===n||s.isUnicodeSpace(n)||s.isUnicodeCJK(n))break;r+
+}return r},_multilineTextWrapByWord:function(){return
this._multilineTextWrap(this._getFirstWordLen)},_multilineTextWrapByChar:function()
{return
this._multilineTextWrap(this._getFirstCharLen)},_recordPlaceholderInfo:function(t,e
){if(t>=u.length){var i=new o;u.push(i)}u[t]._char=e,u[t]._valid=!
1},_recordLetterInfo:function(t,e,i,n,r){if(n>=u.length){var s=new
o;u.push(s)}i=i.charCodeAt(0),u[n]._lineIndex=r,u[n]._char=i,u[n]._valid=t[i]._vali
dDefinition,u[n]._positionX=e.x,u[n]._positionY=e.y},_alignText:function()
{y=0,_.length=0,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),I===
r.SHRINK&&T>0&&this._isVerticalClamp()&&this._shrinkLabelToContentSize(this._isVert
icalClamp),this._updateQuads()||
I===r.SHRINK&&this._shrinkLabelToContentSize(this._isHorizontalClamp)},_scaleFontSi
zeDown:function(t){var e=!0;t||(t=.1,e=!
1),T=t,e&&this._updateContent()},_shrinkLabelToContentSize:function(t){for(var
e=T,i=P,n=m,r=0,s=n.cloneLetterDefinition(),a=!0;t();){var o=e-++r;if(a=!
1,o<=0)break;var
l=o/e;n.assignLetterDefinitions(s),n.scaleFontLetterDefinition(l),P=i*l,this._multi
lineTextWrapByWord(),this._computeAlignmentOffset()}P=i,n.assignLetterDefinitions(s
),a||e-r>=0&&this._scaleFontSizeDown(e-r)},_isVerticalClamp:function(){return
y>E.height},_isHorizontalClamp:function(){for(var t=m._letterDefinitions,e=!
1,i=0,n=S.length;i<n;++i){var r=u[i];if(r._valid){var
s=t[r._char],a=r._positionX+s._width*A,o=r._lineIndex;if(O>0)if(R)
{if(_[o]>E.width&&(a>E.width||a<0)){e=!0;break}}else if(a>E.width){e=!
0;break}}}return e},_isHorizontalClamped:function(t,e){var i=_[e],n=t>E.width||
t<0;return R?i>E.width&&n:n},_updateQuads:function(){var
t=m._letterDefinitions,e=C._texture,i=h.node,n=h._renderData;n.dataLength=n.vertexC
ount=n.indiceCount=0;for(var
s=E,a=i._anchorPoint.x*s.width,o=i._anchorPoint.y*s.height,c=!0,_=0,d=S.length;_<d;
++_){var p=u[_];if(p._valid){var
v=t[p._char];l.height=v._height,l.width=v._width,l.x=v._u,l.y=v._v;var
y=p._positionY+g;if(L>0){if(y>x){var T=y-x;l.y+=T,l.height-=T,y-=T}y-
v._height*A<b&&(l.height=y<b?0:y-b)}var
w=p._lineIndex,M=p._positionX+v._width/2*A+f[w];if(O>0&&this._isHorizontalClamped(M
,w))if(I===r.CLAMP)l.width=0;else if(I===r.SHRINK){if(E.width>v._width){c=!
1;break}l.width=0}if(l.height>0&&l.width>0){var
D=C.isRotated(),B=C._originalSize,P=C._rect,R=C._offset,F=R.x+(B.width-
P.width)/2,V=R.y-(B.height-P.height)/2;if(D){var N=l.x;l.x=P.x+P.height-l.y-
l.height-V,l.y=N+P.y-F,l.y<0&&(l.height=l.height+V)}else l.x+=P.x-F,l.y+=P.y+V;var
k=p._positionX+f[p._lineIndex];this.appendQuad(n,e,l,D,k-a,y-o,A)}}}return
c},appendQuad:function(t,e,i,n,r,s,a){},_computeAlignmentOffset:function()
{switch(f.length=0,M){case n.TextAlignment.LEFT:for(var t=0;t<v;+
+t)f.push(0);break;case n.TextAlignment.CENTER:for(var e=0,i=_.length;e<i;e+
+)f.push((E.width-_[e])/2);break;case n.TextAlignment.RIGHT:for(var
r=0,s=_.length;r<s;r++)f.push(E.width-_[r])}switch(D){case
n.VerticalTextAlignment.TOP:g=E.height;break;case
n.VerticalTextAlignment.CENTER:g=(E.height+y)/2;break;case
n.VerticalTextAlignment.BOTTOM:g=y}},_setupBMFontOverflowMetrics:function(){var
t=E.width,e=E.height;I===r.RESIZE_HEIGHT&&(e=0),I===r.NONE&&(t=0,e=0),O=t,L=e,d.wid
th=t,d.height=e,F=t}}}),
{"../../../components/CCLabel":97,"../../../platform/CCMacro":205,"../../../utils/t
ext-utils":301}],248:[(function(t,e,i){"use strict";function n()
{this._rect=null,this.uv=[],this._texture=null,this._original=null}n.prototype={con
structor:n,getRect:function(){return cc.rect(this._rect)},setRect:function(t)
{this._rect=t,this._texture&&this._calculateUV()},_setDynamicAtlasFrame:function(t)
{t&&(this._original={_texture:this._texture,_x:this._rect.x,_y:this._rect.y},this._
texture=t.texture,this._rect.x=t.x,this._rect.y=t.y,this._calculateUV())},_resetDyn
amicAtlasFrame:function()
{this._original&&(this._rect.x=this._original._x,this._rect.y=this._original._y,thi
s._texture=this._original._texture,this._original=null,this._calculateUV())},_refre
shTexture:function(t){
this._texture=t,this._rect=cc.rect(0,0,t.width,t.height),this._calculateUV()},_calc
ulateUV:function(){var
t=this._rect,e=this._texture,i=this.uv,n=e.width,r=e.height,s=0===n?
0:t.x/n,a=0===n?0:(t.x+t.width)/n,o=0===r?0:(t.y+t.height)/r,l=0===r?
0:t.y/r;i[0]=s,i[1]=o,i[2]=a,i[3]=o,i[4]=s,i[5]=l,i[6]=a,i[7]=l}},e.exports=n}),
{}],249:[(function(t,e,i){"use strict";var
n=t("../../../platform/CCMacro"),r=t("../../../components/CCLabel"),s=t("../../../c
omponents/CCLabelOutline"),a=t("../../../utils/text-
utils"),o=t("../../../components/CCComponent"),l=t("../../../assets/CCRenderTexture
"),h=cc.js.isChildClassOf(s,o),c=r.Overflow,u=cc.Color.WHITE,_=2,f=function()
{this.char="",this.valid=!
0,this.x=0,this.y=0,this.line=0,this.hash=""},d=function()
{this.u=0,this.v=0,this.w=0,this.h=0,this.texture=null,this.offsetX=0,this.offsetY=
0,this.valid=!1,this.xAdvance=0};function m(t,e)
{this._texture=null,this._labelInfo=e,this._char=t,this._hash=null,this._data=null,
this._canvas=null,this._context=null,this._width=0,this._height=0,this._hash=t.char
CodeAt(0)+e.hash}function p(t,e){var i=new
l;i.initWithSize(t,e),i.update(),this._texture=i,this._x=_,this._y=_,this._nexty=_,
this._width=t,this._height=e,this._letterDefinitions={},cc.director.on(cc.Director.
EVENT_BEFORE_SCENE_LAUNCH,this.beforeSceneLoad,this)}m.prototype={constructor:m,upd
ateRenderData:function()
{this._updateProperties(),this._updateTexture()},_updateProperties:function()
{this._texture=new
cc.Texture2D,this._data=r._canvasPool.get(),this._canvas=this._data.canvas,this._co
ntext=this._data.context,this._context.font=this._labelInfo.fontDesc;var
t=a.safeMeasureText(this._context,this._char);this._width=parseFloat(t.toFixed(2)),
this._height=this._labelInfo.fontSize,this._canvas.width!
==this._width&&(this._canvas.width=this._width),this._canvas.height!
==this._height&&(this._canvas.height=this._height),this._texture.initWithElement(th
is._canvas)},_updateTexture:function(){var
t=this._context,e=this._labelInfo,i=this._canvas.width,n=this._canvas.height;t.text
Align="center",t.textBaseline="middle",t.clearRect(0,0,i,n),t.fillStyle="rgba(255,
255, 255, 0.005)",t.fillRect(0,0,i,n),t.font=e.fontDesc;var
r=i/2,s=n/2,a=e.color;if(t.lineJoin="round",t.fillStyle="rgba("+a.r+", "+a.g+",
"+a.b+", 1)",e.isOutlined){var o=e.out||u;t.strokeStyle="rgba("+o.r+", "+o.g+",
"+o.b+",
"+o.a/255+")",t.lineWidth=2*e.margin,t.strokeText(this._char,r,s)}t.fillText(this._
char,r,s),this._texture.handleLoadedTexture()},destroy:function()
{this._texture.destroy(),this._texture=null,r._canvasPool.put(this._data)}},cc.js.m
ixin(p.prototype,{insertLetterTexture:function(t){var
e=t._texture,i=e.width,n=e.height;if(this._x+i+_>this._width&&(this._x=_,this._y=th
is._nexty),this._y+n>this._nexty&&(this._nexty=this._y+n+_),this._nexty>this._heigh
t)return null;this._texture.drawTextureAt(e,this._x,this._y),this._dirty=!0;var
r=new d;return r.u=this._x,r.v=this._y,r.texture=this._texture,r.valid=!
0,r.w=t._width,r.h=t._height,r.xAdvance=t._width,this._x+=i+_,this._letterDefinitio
ns[t._hash]=r,r},update:function()
{this._dirty&&(this._texture.update(),this._dirty=!1)},reset:function()
{this._x=_,this._y=_,this._nexty=_;for(var
t=this._letterDefinitions,e=0,i=t.length;e<i;e++){var
n=t[e];n.isValid&&n.destroy()}this._letterDefinitions={}},destroy:function()
{this.reset(),this._texture.destroy()},beforeSceneLoad:function()
{this.destroy();var t=new
l;t.initWithSize(this._width,this._height),t.update(),this._texture=t},getLetter:fu
nction(t){return this._letterDefinitions[t]},addLetterDefinitions:function(t,e)
{this._letterDefinitions[t]=e},cloneLetterDefinition:function(){var t={};for(var e
in this._letterDefinitions){var i=new
d;cc.js.mixin(i,this._letterDefinitions[e]),t[e]=i}return
t},assignLetterDefinitions:function(t){for(var e in this._letterDefinitions){var
i=t[e],n=this._letterDefinitions[e];cc.js.mixin(n,i)}},scaleFontLetterDefinition:fu
nction(t){for(var e in this._letterDefinitions){var
i=this._letterDefinitions[e];i.w*=t,i.h*=t,i.offsetX*=t,i.offsetY*=t,i.xAdvance*=t}
},getLetterDefinitionForChar:function(t,e){var
i=t.charCodeAt(0)+e.hash,n=this._letterDefinitions[i];if(!n){var r=new
m(t,e);r.updateRenderData(),n=this.insertLetterTexture(r),r.destroy()}return
n}});var
v=cc.rect(),y=null,g=[],x=[],b=[],A=[],C=cc.size(),S=null,T=0,w=0,E=0,M=0,D=0,B=1,P
="",I=0,R=0,O=cc.size(),L=0,F=0,V=0,N=0,k=0,G=!1,z=0,U=0,j=0,W="",H=!
1,X={fontSize:0,lineHeight:0,hash:"",fontFamily:"",fontDesc:"Arial",hAlign:0,vAlign
:0,color:u,isOutlined:!1,out:u,margin:0};e.exports={_getAssemblerData:function()
{return S||(S=new p(2048,2048)),S._texture},updateRenderData:function(t)
{t._renderData.vertDirty&&y!
==t&&(y=t,this._updateFontFamily(t),X.fontFamily=W,this._updateProperties(),X.fontD
esc=this._getFontDesc(),this._updateContent(),y._actualFontSize=I,y.node.setContent
Size(O),y._renderData.vertDirty=y._renderData.uvDirty=!
1,y=null,this._resetProperties())},_updateFontScale:function()
{B=I/R},_updateProperties:function()
{P=y.string.toString(),I=y.fontSize,R=I,O.width=y.node._contentSize.width,O.height=
y.node._contentSize.height,L=y.horizontalAlign,F=y.verticalAlign,V=y.spacingX,k=y.o
verflow,N=y._lineHeight,H=y._isBold,G=k!==c.NONE&&(k===c.RESIZE_HEIGHT||
y.enableWrapText);var t=h&&y.getComponent(s);t&&t.enabled?(X.isOutlined=!
0,X.margin=t.width,X.out=t.color,X.out.a=t.color.a*y.node.color.a/255):
(X.isOutlined=!
1,X.margin=0),X.lineHeight=N,X.fontSize=I,X.fontFamily=W,X.color=y.node.color,X.has
h=this._computeHash(X),this._setupBMFontOverflowMetrics()},_updateFontFamily:functi
on(t){t.useSystemFont?W=t.fontFamily:t.font?t.font._nativeAsset?
W=t.font._nativeAsset:(W=cc.loader.getRes(t.font.nativeUrl))||
cc.loader.load(t.font.nativeUrl,(function(e,i)
{W=i||"Arial",t.font._nativeAsset=i,t._updateRenderData(!
0)})):W="Arial"},_computeHash:function(t){var
e=t.color.toHEX("#rrggbb"),i="";return
t.isOutlined&&(i=t.out.toHEX("#rrggbb")),""+t.fontSize+t.fontFamily+e+i},_getFontDe
sc:function(){var t=I.toString()+"px ";return t+=W,H&&(t="bold
"+t),t},_resetProperties:function(){},_updateContent:function()
{this._updateFontScale(),this._alignText()},_computeHorizontalKerningForText:functi
on(){for(var t=P,e=t.length,i=null.kerningDict,n=g,r=-1,s=0;s<e;++s){var
a=t.charCodeAt(s),o=i[r<<16|65535&a]||0;n[s]=s<e-1?
o:0,r=a}},_multilineTextWrap:function(t){var
e=P.length,i=0,n=0,r=0,s=0,o=0,l=0,h=0,c=null,u=cc.v2(0,0);this._updateFontScale();
for(var _=0;_<e;){var f=P.charAt(_);if("\n"!==f){for(var
d=t(P,_,e),m=l,p=h,v=o,y=n,x=!1,A=0;A<d;++A){var C=_+A;if("\r"!
==(f=P.charAt(C)))if(c=S.getLetterDefinitionForChar(f,X)){var
E=y+c.offsetX*B;if(G&&j>0&&n>0&&E+c.w*B>j&&!a.isUnicodeSpace(f)){b.push(o),o=0,i+
+,n=0,r-=N*B+0,x=!0;break}u.x=E,u.y=r-
c.offsetY*B,this._recordLetterInfo(u,f,C,i),C+1<g.length&&C<e-
1&&(y+=g[C+1]),y+=c.xAdvance*B+V,v=u.x+c.w*B,m<u.y&&(m=u.y),p>u.y-c.h*B&&(p=u.y-
c.h*B)}else this._recordPlaceholderInfo(C,f);else
this._recordPlaceholderInfo(C,f)}x||
(n=y,o=v,l<m&&(l=m),h>p&&(h=p),s<o&&(s=o),_+=d)}else b.push(o),o=0,i++,n=0,r-
=N*B+0,this._recordPlaceholderInfo(_,f),_++}return
b.push(o),w=(T=i+1)*N*B,T>1&&(w+=0*(T-
1)),O.width=z,O.height=U,z<=0&&(O.width=parseFloat(s.toFixed(2))),U<=0&&(O.height=p
arseFloat(w.toFixed(2))),M=O.height,D=0,l>0&&(M=O.height+l),h<-w&&(D=w+h),!
0},_getFirstCharLen:function(){return 1},_getFirstWordLen:function(t,e,i){var
n=t.charAt(e);if(a.isUnicodeCJK(n)||"\n"===n||a.isUnicodeSpace(n))return 1;var
r=1,s=S.getLetterDefinitionForChar(n,X);if(!s)return r;for(var
o=s.xAdvance*B+V,l=e+1;l<i&&(n=t.charAt(l),s=S.getLetterDefinitionForChar(n,X));+
+l){if(o+s.offsetX*B+s.w*B>j&&!a.isUnicodeSpace(n)&&j>0)return
r;if(o+=s.xAdvance*B+V,"\n"===n||a.isUnicodeSpace(n)||a.isUnicodeCJK(n))break;r+
+}return r},_multilineTextWrapByWord:function(){return
this._multilineTextWrap(this._getFirstWordLen)},_multilineTextWrapByChar:function()
{return
this._multilineTextWrap(this._getFirstCharLen)},_recordPlaceholderInfo:function(t,e
){if(t>=x.length){var i=new
f;x.push(i)}x[t].char=e,x[t].hash=e.charCodeAt(0)+X.hash,x[t].valid=!
1},_recordLetterInfo:function(t,e,i,n){if(i>=x.length){var r=new f;x.push(r)}var
s=e.charCodeAt(0)+X.hash;x[i].line=n,x[i].char=e,x[i].hash=s,x[i].valid=S.getLetter
(s).valid,x[i].x=t.x,x[i].y=t.y},_alignText:function()
{w=0,b.length=0,this._multilineTextWrapByWord(),this._computeAlignmentOffset(),this
._updateQuads()},_scaleFontSizeDown:function(t){var e=!0;t||(t=.1,e=!
1),I=t,e&&this._updateContent()},_isVerticalClamp:function(){return
w>O.height},_isHorizontalClamp:function(){for(var t=!1,e=0,i=P.length;e<i;++e){var
n=x[e];if(n.valid){var r=S.getLetter(n.hash),s=n.x+r.w*B,a=n.line;if(z>0)if(G)
{if(b[a]>O.width&&(s>O.width||s<0)){t=!0;break}}else if(s>O.width){t=!
0;break}}}return t},_isHorizontalClamped:function(t,e){var i=b[e],n=t>O.width||
t<0;return G?i>O.width&&n:n},_updateQuads:function(){var
t=S._texture,e=y.node,i=y._renderData;i.dataLength=i.vertexCount=i.indiceCount=0;fo
r(var n=O,r=e._anchorPoint.x*n.width,s=e._anchorPoint.y*n.height,a=!
0,o=0,l=P.length;o<l;++o){var h=x[o];if(h.valid){var
u=S.getLetter(h.hash);v.height=u.h,v.width=u.w,v.x=u.u,v.y=u.v;var _=h.y+E;if(U>0)
{if(_>M){var f=_-M;v.y+=f,v.height-=f,_-=f}_-u.h*B<D&&(v.height=_<D?0:_-D)}var
d=h.line,m=h.x+u.w/2*B+A[d];if(z>0&&this._isHorizontalClamped(m,d))if(k===c.CLAMP)v
.width=0;else if(k===c.SHRINK){if(O.width>u.w){a=!
1;break}v.width=0}if(v.height>0&&v.width>0){var
p=h.x+A[h.line];this.appendQuad(i,t,v,!1,p-r,_-s,B)}}}return
a},appendQuad:function(t,e,i,n,r,s,a){},_computeAlignmentOffset:function()
{switch(A.length=0,L){case n.TextAlignment.LEFT:for(var t=0;t<T;+
+t)A.push(0);break;case n.TextAlignment.CENTER:for(var e=0,i=b.length;e<i;e+
+)A.push((O.width-b[e])/2);break;case n.TextAlignment.RIGHT:for(var
r=0,s=b.length;r<s;r++)A.push(O.width-b[r])}switch(F){case
n.VerticalTextAlignment.TOP:E=O.height;break;case
n.VerticalTextAlignment.CENTER:E=(O.height+w)/2-(N-I)/2;break;case
n.VerticalTextAlignment.BOTTOM:E=(O.height+w)/2-(N-
I)}},_setupBMFontOverflowMetrics:function(){var

t=O.width,e=O.height;k===c.RESIZE_HEIGHT&&(e=0),k===c.NONE&&(t=0,e=0),z=t,U=e,C.wid
th=t,C.height=e,j=t}}}),
{"../../../assets/CCRenderTexture":66,"../../../components/CCComponent":95,"../../.
./components/CCLabel":97,"../../../components/CCLabelOutline":98,"../../../platform
/CCMacro":205,"../../../utils/text-utils":301}],250:[(function(t,e,i){"use
strict";var n=t("../../../platform/CCMacro"),r=t("../../../utils/text-
utils"),s=(t("../../../components/CCComponent"),t("../../../components/CCLabel")),a
=t("../../../components/CCLabelOutline"),o=t("../../../components/CCLabelShadow"),l
=s.Overflow,h=t("../utils").packToDynamicAtlas,c=(1/255).toFixed(3),u=null,_=null,f
=null,d="",m="",p=0,v=0,y=[],g=cc.Size.ZERO,x=0,b=0,A=0,C=null,S="",T=l.NONE,w=!
1,E=null,M=cc.Color.WHITE,D=null,B=cc.Color.BLACK,P=cc.rect(),I=cc.Size.ZERO,R=cc.S
ize.ZERO,O=!1,L=!1,F=!1,V=0,N=cc.Vec2.ZERO,k=0,G=void
0;e.exports={_getAssemblerData:function()
{return(G=s._canvasPool.get()).canvas.width=G.canvas.height=1,G},_resetAssemblerDat
a:function(t){t&&s._canvasPool.put(t)},updateRenderData:function(t)
{t._renderData.vertDirty&&(this._updateFontFamily(t),this._updateProperties(t),this
._calculateLabelFont(),this._calculateSplitedStrings(),this._updateLabelDimensions(
),this._calculateTextBaseline(),this._updateTexture(t),this._calDynamicAtlas(t),t._
actualFontSize=p,t.node.setContentSize(R),this._updateVerts(t),t._renderData.vertDi
rty=t._renderData.uvDirty=!1,u=null,_=null,f=null)},_updateVerts:function()
{},_updateFontFamily:function(t){t.useSystemFont?S=t.fontFamily:t.font?
t.font._nativeAsset?S=t.font._nativeAsset:(S=cc.loader.getRes(t.font.nativeUrl))||
cc.loader.load(t.font.nativeUrl,(function(e,i)
{S=i||"Arial",t.font._nativeAsset=i,t._updateRenderData(!
0)})):S="Arial"},_updatePaddingRect:function(){var
t=0,e=0,i=0,n=0,r=0;if(I.width=I.height=0,E&&(t=e=i=n=r=E.width,I.width=I.height=2*
r),D){var s=D.blur+r;i=Math.max(i,-
D._offset.x+s),n=Math.max(n,D._offset.x+s),t=Math.max(t,D._offset.y+s),e=Math.max(e
,-D._offset.y+s)}if(L){var
a=v*Math.tan(.20943951);n+=a,I.width+=a}P.x=i,P.y=t,P.width=i+n,P.height=t+e},_upda
teProperties:function(t){var
e=t._assemblerData;u=e.context,_=e.canvas,f=t._frame._original?
t._frame._original._texture:t._frame._texture,m=t.string.toString(),p=t._fontSize,V
=(v=p)/8,T=t.overflow,g.width=t.node.width,g.height=t.node.height,R=t.node.getConte
ntSize(),x=t._lineHeight,b=t.horizontalAlign,A=t.verticalAlign,C=t.node.color,O=t._
isBold,L=t._isItalic,F=t._isUnderline,w=T!==l.NONE&&(T===l.RESIZE_HEIGHT||
t.enableWrapText),(E=(E=a&&t.getComponent(a))&&E.enabled&&E.width>0?
E:null)&&(M.set(E.color),M.a=M.a*t.node.color.a/255),
(D=(D=o&&t.getComponent(o))&&D.enabled?
D:null)&&(B.set(D.color),B.a=B.a*t.node.color.a/255),this._updatePaddingRect()},_ca
lculateFillTextStartPosition:function(){var t=0;b===n.TextAlignment.RIGHT?
t=g.width-P.width:b===n.TextAlignment.CENTER&&(t=(g.width-P.width)/2);var
e=0,i=this._getLineHeight()*(y.length-1);return e=A===n.VerticalTextAlignment.TOP?
p:A===n.VerticalTextAlignment.CENTER?.5*(g.height-i)+p*r.MIDDLE_RATIO-
P.height/2:g.height-i-p*r.BASELINE_RATIO-
P.height,cc.v2(t+P.x,e+P.y)},_setupOutline:function(){u.strokeStyle="rgba("+M.r+",
"+M.g+", "+M.b+", "+M.a/255+")",u.lineWidth=2*E.width},_setupShadow:function()
{u.shadowColor="rgba("+B.r+", "+B.g+", "+B.b+",
"+B.a/255+")",u.shadowBlur=D.blur,u.shadowOffsetX=D.offset.x,u.shadowOffsetY=-
D.offset.y},_drawUnderline:function(t)
{E&&(this._setupOutline(),u.strokeRect(N.x,N.y,t,V)),u.lineWidth=V,u.fillStyle="rgb
a("+C.r+", "+C.g+", "+C.b+",
"+C.a/255+")",u.fillRect(N.x,N.y,t,V)},_updateTexture:function()
{u.clearRect(0,0,_.width,_.height);var t=E?M:C;u.fillStyle="rgba("+t.r+", "+t.g+",
"+t.b+", "+c+")",u.fillRect(0,0,_.width,_.height),u.font=d;var
e=this._calculateFillTextStartPosition(),i=this._getLineHeight();u.lineJoin="round"
,u.fillStyle="rgba("+C.r+", "+C.g+", "+C.b+", 1)";var
r=y.length>1,s=this._measureText(u),a=0,o=0;D&&this._setupShadow(),E&&this._setupOu
tline();for(var l=0;l<y.length;+
+l)a=e.x,o=e.y+l*i,D&&r&&(E&&u.strokeText(y[l],a,o),u.fillText(y[l],a,o)),F&&(k=s(y
[l]),b===n.TextAlignment.RIGHT?N.x=e.x-k:b===n.TextAlignment.CENTER?N.x=e.x-
k/2:N.x=e.x,N.y=o,this._drawUnderline(k));D&&r&&(u.shadowColor="transparent");for(v
ar h=0;h<y.length;+
+h)a=e.x,o=e.y+h*i,E&&u.strokeText(y[h],a,o),u.fillText(y[h],a,o);D&&(u.shadowColor
="transparent"),f.handleLoadedTexture()},_calDynamicAtlas:function(t)
{if(t.cacheMode===s.CacheMode.BITMAP){var e=t._frame;e._original||
e.setRect(cc.rect(0,0,_.width,_.height)),h(t,e)}},_updateLabelDimensions:function()
{var t=m.split("\n");if(T===l.RESIZE_HEIGHT){var
e=(y.length+r.BASELINE_RATIO)*this._getLineHeight();g.height=e+P.height,R.height=e+
I.height}else if(T===l.NONE){y=t;for(var i=0,n=0,s=0;s<t.length;++s){var
a=r.safeMeasureText(u,t[s]);i=i>a?
i:a}n=(y.length+r.BASELINE_RATIO)*this._getLineHeight();var
o=parseFloat(i.toFixed(2)),h=parseFloat(n.toFixed(2));g.width=o+P.width,g.height=h+
P.height,R.width=o+I.width,R.height=h+I.height}g.width=Math.min(g.width,2048),g.hei
ght=Math.min(g.height,2048),_.width!==g.width&&(_.width=g.width),_.height!
==g.height&&(_.height=g.height)},_calculateTextBaseline:function(){this._node;var
t=void
0;t=b===n.TextAlignment.RIGHT?"right":b===n.TextAlignment.CENTER?"center":"left",u.
textAlign=t,u.textBaseline="alphabetic"},_calculateSplitedStrings:function(){var
t=m.split("\n");if(w){y=[];for(var e=R.width,i=0;i<t.length;++i){var
n=r.safeMeasureText(u,t[i]),s=r.fragmentText(t[i],n,e,this._measureText(u));y=y.con
cat(s)}}else y=t},_getFontDesc:function(){var t=p.toString()+"px ";return
t+=S,O&&(t="bold "+t),L&&(t="italic "+t),t},_getLineHeight:function(){var
t=x;return 0|(t=0===t?p:t*p/v)},_calculateParagraphLength:function(t,e){for(var
i=[],n=0;n<t.length;++n){var s=r.safeMeasureText(e,t[n]);i.push(s)}return
i},_measureText:function(t){return function(e){return
r.safeMeasureText(t,e)}},_calculateLabelFont:function()
{if(d=this._getFontDesc(),u.font=d,T===l.SHRINK){var
t=m.split("\n"),e=this._calculateParagraphLength(t,u),i=0,n=0,s=0;if(w){var
a=R.width,o=R.height;if(a<0||o<0)return
d=this._getFontDesc(),void(u.font=d);n=o+1,s=a+1;for(var h=p+1,c="",_=!0,f=0|
h;n>o||s>a;){if(_?h=f/2|0:f=h=f-1,h<=0)
{cc.logID(4003);break}for(p=h,d=this._getFontDesc(),u.font=d,n=0,i=0;i<t.length;+
+i){var
y=0,x=r.safeMeasureText(u,t[i]);for(c=r.fragmentText(t[i],x,a,this._measureText(u))
;y<c.length;)s=r.safeMeasureText(u,c[y]),n+=this._getLineHeight(),++y}_&&(n>o?f=0|
h:(_=!1,n=o+1))}}else{for(n=t.length*this._getLineHeight(),i=0;i<t.length;+
+i)s<e[i]&&(s=e[i]);var b=(g.width-P.width)/s,A=g.height/n;p=v*Math.min(1,b,A)|
0,d=this._getFontDesc(),u.font=d}}}}}),
{"../../../components/CCComponent":95,"../../../components/CCLabel":97,"../../../co
mponents/CCLabelOutline":98,"../../../components/CCLabelShadow":99,"../../../platfo
rm/CCMacro":205,"../../../utils/text-utils":301,"../utils":251}],251:
[(function(t,e,i){"use strict";var n=t("./dynamic-
atlas/manager");e.exports={packToDynamicAtlas:function(t,e){if(e){if(!
e._original&&n){var
i=n.insertSpriteFrame(e);i&&e._setDynamicAtlasFrame(i)}t.sharedMaterials[0].getProp
erty("texture")!==e._texture&&t._activateMaterial()}}}}),{"./dynamic-
atlas/manager":246}],252:[(function(t,e,i){"use strict";function n(t,e,i){i=i||
2;var n,s,o,l,h,c,_,f=e&&e.length,d=f?e[0]*i:t.length,m=r(t,0,d,i,!0),p=[];if(!
m)return p;if(f&&(m=u(t,e,m,i)),t.length>80*i){n=o=t[0],s=l=t[1];for(var
v=i;v<d;v+=i)h=t[v],c=t[v+1],h<n&&(n=h),c<s&&(s=c),h>o&&(o=h),c>l&&(l=c);_=Math.max
(o-n,l-s)}return a(m,p,i,n,s,_),p}function r(t,e,i,n,r){var
s,a;if(r===P(t,e,i,n)>0)for(s=e;s<i;s+=n)a=M(s,t[s],t[s+1],a);else for(s=i-
n;s>=e;s-=n)a=M(s,t[s],t[s+1],a);return a&&A(a,a.next)&&(D(a),a=a.next),a}function
s(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!A(n,n.next)&&0!
==b(n.prev,n,n.next))n=n.next;else{if(D(n),(n=e=n.prev)===n.next)return null;i=!
0}}while(i||n!==e);return e}function a(t,e,i,n,r,u,_){if(t){!
_&&u&&m(t,n,r,u);for(var f,d,p=t;t.prev!==t.next;)if(f=t.prev,d=t.next,u?
l(t,n,r,u):o(t))e.push(f.i/i),e.push(t.i/i),e.push(d.i/i),D(t),t=d.next,p=d.next;el
se if((t=d)===p){_?1===_?
a(t=h(t,e,i),e,i,n,r,u,2):2===_&&c(t,e,i,n,r,u):a(s(t),e,i,n,r,u,1);break}}}functio
n o(t){var e=t.prev,i=t,n=t.next;if(b(e,i,n)>=0)return!1;for(var r=t.next.next;r!
==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&b(r.prev,r,r.next)>=0)return!
1;r=r.next}return!0}function l(t,e,i,n){var
r=t.prev,s=t,a=t.next;if(b(r,s,a)>=0)return!1;for(var o=r.x<s.x?r.x<a.x?
r.x:a.x:s.x<a.x?s.x:a.x,l=r.y<s.y?r.y<a.y?r.y:a.y:s.y<a.y?s.y:a.y,h=r.x>s.x?
r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,c=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?
s.y:a.y,u=v(o,l,e,i,n),_=v(h,c,e,i,n),f=t.nextZ;f&&f.z<=_;){if(f!==t.prev&&f!
==t.next&&g(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!
1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=u;){if(f!==t.prev&&f!
==t.next&&g(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!
1;f=f.prevZ}return!0}function h(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!
A(r,s)&&C(r,n,n.next,s)&&T(r,s)&&T(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i)
,D(n),D(n.next),n=t=s),n=n.next}while(n!==t);return n}function c(t,e,i,n,r,o){var
l=t;do{for(var h=l.next.next;h!==l.prev;){if(l.i!==h.i&&x(l,h)){var c=E(l,h);return
l=s(l,l.next),c=s(c,c.next),a(l,e,i,n,r,o),void
a(c,e,i,n,r,o)}h=h.next}l=l.next}while(l!==t)}function u(t,e,i,n){var
a,o,l,h=[];for(a=0,o=e.length;a<o;a++)(l=r(t,e[a]*n,a<o-1?e[a+1]*n:t.length,n,!
1))===l.next&&(l.steiner=!0),h.push(y(l));for(h.sort(_),a=0;a<h.length;a+
+)f(h[a],i),i=s(i,i.next);return i}function _(t,e){return t.x-e.x}function f(t,e)
{if(e=d(t,e)){var i=E(e,t);s(i,i.next)}}function d(t,e){var i,n=e,r=t.x,s=t.y,a=-
1/0;do{if(s<=n.y&&s>=n.next.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-
n.y);if(o<=r&&o>a){if(a=o,o===r){if(s===n.y)return n;if(s===n.next.y)return
n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return
null;if(r===a)return i.prev;var l,h=i,c=i.x,u=i.y,_=1/0;for(n=i.next;n!
==h;)r>=n.x&&n.x>=c&&g(s<u?r:a,s,c,u,s<u?a:r,s,n.x,n.y)&&((l=
Math.abs(s-n.y)/(r-n.x))<_||l===_&&n.x>i.x)&&T(n,t)&&(i=n,_=l),n=n.next;return
i}function m(t,e,i,n){var
r=t;do{null===r.z&&(r.z=v(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}wh
ile(r!==t);r.prevZ.nextZ=null,r.prevZ=null,p(r)}function p(t){var
e,i,n,r,s,a,o,l,h=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,o=0,e=0;e<h&&(o+
+,n=n.nextZ);e++);for(l=h;o>0||l>0&&n;)0===o?(r=n,n=n.nextZ,l--):0!==l&&n?i.z<=n.z?
(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--):(r=i,i=i.nextZ,o--),s?
s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(a>1);return t}function
v(t,e,i,n,r)
{return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)/r)|
t<<8))|t<<4))|t<<2))|t<<1))|
(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)/r)|e<<8))|
e<<4))|e<<2))|e<<1))<<1}function y(t){var
e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function
g(t,e,i,n,r,s,a,o){return(r-a)*(e-o)-(t-a)*(s-o)>=0&&(t-a)*(n-o)-(i-a)*(e-
o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!
==e.i&&!S(t,e)&&T(t,e)&&T(e,t)&&w(t,e)}function b(t,e,i){return(e.y-t.y)*(i.x-e.x)-
(e.x-t.x)*(i.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function C(t,e,i,n)
{return!!(A(t,e)&&A(i,n)||A(t,n)&&A(i,e))||b(t,e,i)>0!=b(t,e,n)>0&&b(i,n,t)>0!
=b(i,n,e)>0}function S(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!
==e.i&&i.next.i!==e.i&&C(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!
1}function T(t,e){return b(t.prev,t,t.next)<0?
b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function w(t,e)
{var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&r<(i.next.x-
i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}function
E(t,e){var i=new B(t.i,t.x,t.y),n=new B(e.i,e.x,e.y),r=t.next,s=e.prev;return
t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function
M(t,e,i,n){var r=new B(t,e,i);return n?
(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function D(t)
{t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t
.nextZ.prevZ=t.prevZ)}function B(t,e,i)
{this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=nu
ll,this.nextZ=null,this.steiner=!1}function P(t,e,i,n){for(var r=0,s=e,a=i-
n;s<i;s+=n)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return
r}e.exports=n,n.deviation=function(t,e,i,n){var r=e&&e.length,s=r?
e[0]*i:t.length,a=Math.abs(P(t,0,s,i));if(r)for(var o=0,l=e.length;o<l;o++){var
h=e[o]*i,c=o<l-1?e[o+1]*i:t.length;a-=Math.abs(P(t,h,c,i))}var
u=0;for(o=0;o<n.length;o+=3){var _=n[o]*i,f=n[o+1]*i,d=n[o+2]*i;u+=Math.abs((t[_]-
t[d])*(t[f+1]-t[_+1])-(t[_]-t[f])*(t[d+1]-t[_+1]))}return 0===a&&0===u?
0:Math.abs((u-a)/a)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:
[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s+
+)for(var a=0;a<e;a++)i.vertices.push(t[r][s][a]);r>0&&(n+=t[r-
1].length,i.holes.push(n))}return i}}),{}],253:[(function(t,e,i){"use strict";var
n=s(t("../../../../../renderer/core/input-
assembler")),r=s(t("../../../../../renderer/render-data/ia-render-data"));function
s(t){return t&&t.__esModule?t:{default:t}}var
a=t("../../../../graphics/helper"),o=t("../../../../graphics/types").PointFlags,l=t
("../../mesh-buffer"),h=t("../../vertex-
format").vfmtPosColor,c=t("../../../index"),u=cc.Class({name:"cc.GraphicsPoint",ext
ends:cc.Vec2,ctor:function(t,e){this.reset()},reset:function()
{this.dx=0,this.dy=0,this.dmx=0,this.dmy=0,this.flags=0,this.len=0}});function _()
{this.reset()}function f(t)
{this._tessTol=.25,this._distTol=.01,this._updatePathOffset=!
1,this._paths=null,this._pathLength=0,this._pathOffset=0,this._points=null,this._po
intsOffset=0,this._commandx=0,this._commandy=0,this._paths=[],this._points=[],this.
_renderDatas=[],this._dataOffset=0}cc.js.mixin(_.prototype,{reset:function()
{this.closed=!1,this.nbevel=0,this.complex=!0,this.points?
this.points.length=0:this.points=[]}}),cc.js.mixin(f.prototype,
{moveTo:function(t,e)
{this._updatePathOffset&&(this._pathOffset=this._pathLength,this._updatePathOffset=
!
1),this._addPath(),this._addPoint(t,e,o.PT_CORNER),this._commandx=t,this._commandy=
e},lineTo:function(t,e)
{this._addPoint(t,e,o.PT_CORNER),this._commandx=t,this._commandy=e},bezierCurveTo:f
unction(t,e,i,n,r,s){var l=this._curPath,h=l.points[l.points.length-1];h.x!==t||
h.y!==e||i!==r||n!==s?
(a.tesselateBezier(this,h.x,h.y,t,e,i,n,r,s,0,o.PT_CORNER),this._commandx=r,this._c
ommandy=s):this.lineTo(r,s)},quadraticCurveTo:function(t,e,i,n){var
r=this._commandx,s=this._commandy;this.bezierCurveTo(r+2/3*(t-r),s+2/3*(e-
s),i+2/3*(t-i),n+2/3*(e-n),i,n)},arc:function(t,e,i,n,r,s)
{a.arc(this,t,e,i,n,r,s)},ellipse:function(t,e,i,n)
{a.ellipse(this,t,e,i,n),this._curPath.complex=!1},circle:function(t,e,i)
{a.ellipse(this,t,e,i,i),this._curPath.complex=!1},rect:function(t,e,i,n)
{this.moveTo(t,e),this.lineTo(t,e+n),this.lineTo(t+i,e+n),this.lineTo(t+i,e),this.c
lose(),this._curPath.complex=!1},roundRect:function(t,e,i,n,r)
{a.roundRect(this,t,e,i,n,r),this._curPath.complex=!1},clear:function(t,e)
{this._pathLength=0,this._pathOffset=0,this._pointsOffset=0,this._dataOffset=0,this
._curPath=null;var i=this._renderDatas;if(e)
{this._paths.length=0,this._points.length=0;for(var n=0,r=i.length;n<r;n++){var
s=i[n];s.meshbuffer.destroy(),s.meshbuffer=null}i.length=0}else for(var
a=0,o=i.length;a<o;a++){i[a].meshbuffer.reset()}},close:function()
{this._curPath.closed=!0},_addPath:function(){var
t=this._pathLength,e=this._paths[t];return e?e.reset():(e=new
_,this._paths.push(e)),this._pathLength+
+,this._curPath=e,e},_addPoint:function(t,e,i){var n=this._curPath;if(n){var
r,s=this._points,a=n.points;(r=s[this._pointsOffset++])?(r.x=t,r.y=e):(r=new
u(t,e),s.push(r)),r.flags=i,a.push(r)}},requestRenderData:function(){var t=new
r.default,e=new l(c._handle,h);t.meshbuffer=e,this._renderDatas.push(t);var i=new
n.default;return
i._vertexBuffer=e._vb,i._indexBuffer=e._ib,i._start=0,t.ia=i,t},getRenderDatas:func
tion(){return
0===this._renderDatas.length&&this.requestRenderData(),this._renderDatas}}),e.expor
ts=f}),{"../../../../../renderer/core/input-
assembler":338,"../../../../../renderer/render-data/ia-render-
data":367,"../../../../graphics/helper":142,"../../../../graphics/types":144,"../..
/../index":243,"../../mesh-buffer":279,"../../vertex-format":283}],254:
[(function(t,e,i){"use strict";var
n=t("../../../../graphics/graphics"),r=t("../../../../graphics/types").PointFlags,s
=n.LineJoin,a=n.LineCap,o=t("./earcut"),l=t("./impl"),h=Math.PI,c=Math.min,u=Math.m
ax,_=Math.ceil,f=Math.acos,d=Math.cos,m=Math.sin,p=Math.atan2,v=(Math.abs,null),y=n
ull,g=0;function x(t,e,i){var n=2*f(t/(t+i));return u(2,_(e/n))}function b(t,e,i)
{return t<e?e:t>i?i:t}var A={createImpl:function(t){return new
l(t)},updateRenderData:function(t){for(var
e=t._impl.getRenderDatas(),i=0,n=e.length;i<n;i+
+)e[i].material=t.sharedMaterials[0]},fillBuffers:function(t,e){e._flush();var
i=e.node;e.node=t.node,this.renderIA(t,e),e.node=i},renderIA:function(t,e){for(var
i=t._impl.getRenderDatas(),n=0,r=i.length;n<r;n++){var
s=i[n],a=s.meshbuffer;s.ia._count=a.indiceStart,e._flushIA(s),a.uploadData()}},genR
enderData:function(t,e){var
i=y.getRenderDatas(),n=i[y._dataOffset],r=n.meshbuffer,s=r.vertexStart+e;return(s>6
5535||3*s>131070)&&(++y._dataOffset,s=e,y._dataOffset<i.length?n=i[y._dataOffset]:
(n=y.requestRenderData(t),i[y._dataOffset]=n),n.material=t.sharedMaterials[0],r=n.m
eshbuffer),s>r.vertexOffset&&r.requestStatic(e,3*e),n},stroke:function(t)
{g=t._strokeColor._val,this._flattenPaths(t._impl),this._expandStroke(t),t._impl._u
pdatePathOffset=!0},fill:function(t)
{g=t._fillColor._val,this._expandFill(t),t._impl._updatePathOffset=!
0},_expandStroke:function(t){var
e=.5*t.lineWidth,i=t.lineCap,n=t.lineJoin,o=t.miterLimit;y=t._impl;var
l=x(e,h,y._tessTol);this._calculateJoins(y,e,n,o);for(var
c=y._paths,u=0,_=y._pathOffset,f=y._pathLength;_<f;_++){var
d=c[_],m=d.points.length;n===s.ROUND?
u+=2*(m+d.nbevel*(l+2)+1):u+=2*(m+5*d.nbevel+1),d.closed||(i===a.ROUND?
u+=2*(2*l+2):u+=12)}for(var
p=(v=this.genRenderData(t,u)).meshbuffer,g=p._vData,b=p._iData,A=y._pathOffset,C=y.
_pathLength;A<C;A++){var S,T=c[A],w=T.points,E=w.length,M=p.vertexStart,D=void
0,B=void 0,P=void 0,I=void 0;if((S=T.closed)?(D=w[E-1],B=w[0],P=0,I=E):
(D=w[0],B=w[1],P=1,I=E-1),!S){var R=B.sub(D);R.normalizeSelf();var
O=R.x,L=R.y;i===a.BUTT?this._buttCap(D,O,L,e,0):i===a.SQUARE?
this._buttCap(D,O,L,e,e):i===a.ROUND&&this._roundCapStart(D,O,L,e,l)}for(var
F=P;F<I;++F)n===s.ROUND?this._roundJoin(D,B,e,e,l):0!=(B.flags&(r.PT_BEVEL|
r.PT_INNERBEVEL))?this._bevelJoin(D,B,e,e):
(this._vset(B.x+B.dmx*e,B.y+B.dmy*e),this._vset(B.x-B.dmx*e,B.y-
B.dmy*e)),D=B,B=w[F+1];if(S){var
V=3*M;this._vset(g[V],g[V+1]),this._vset(g[V+3],g[V+4])}else{var
N=B.sub(D);N.normalizeSelf();var k=N.x,G=N.y;i===a.BUTT?
this._buttCap(B,k,G,e,0):i===a.BUTT||i===a.SQUARE?
this._buttCap(B,k,G,e,e):i===a.ROUND&&this._roundCapEnd(B,k,G,e,l)}for(var
z=p.indiceStart,U=M+2,j=p.vertexStart;U<j;U++)b[z++]=U-2,b[z++]=U-1,b[z+
+]=U;p.indiceStart=z}v=null,y=null},_expandFill:function(t){for(var
e=(y=t._impl)._paths,i=0,n=y._pathOffset,r=y._pathLength;n<r;n++)
{i+=e[n].points.length}for(var
s=(v=this.genRenderData(t,i)).meshbuffer,a=s._vData,l=s._iData,h=y._pathOffset,c=y.
_pathLength;h<c;h++){var u=e[h],_=u.points,f=_.length;if(0!==f){for(var
d=s.vertexStart,m=0;m<f;++m)this._vset(_[m].x,_[m].y);var
p=s.indiceStart;if(u.complex){for(var g=[],x=d,b=s.vertexStart;x<b;x++){var
A=3*x;g.push(a[A]),g.push(a[A+1])}var C=o(g,null,2);if(!C||
0===C.length)continue;for(var S=0,T=C.length;S<T;S++)l[p++]=C[S]+d}else for(var
w=d,E=d+2,M=s.vertexStart;E<M;E++)l[p++]=w,l[p++]=E-1,l[p+
+]=E;s.indiceStart=p}}v=null,y=null},_calculateJoins:function(t,e,i,n){var
a=0;e>0&&(a=1/e);for(var o=t._paths,l=t._pathOffset,h=t._pathLength;l<h;l++){var
_=o[l],f=_.points,d=f.length,m=f[d-1],p=f[0];_.nbevel=0;for(var v=0;v<d;v++){var
y,g,x=m.dy,b=-m.dx,A=p.dy,C=-p.dx;if(p.dmx=.5*(x+A),p.dmy=.5*(b+C),
(y=p.dmx*p.dmx+p.dmy*p.dmy)>1e-6){var
S=1/y;S>600&&(S=600),p.dmx*=S,p.dmy*=S}p.dx*m.dy-m.dx*p.dy>0&&(0,p.flags|
=r.PT_LEFT),y*(g=u(11,c(m.len,p.len)*a))*g<1&&(p.flags|
=r.PT_INNERBEVEL),p.flags&r.PT_CORNER&&(y*n*n<1||i===s.BEVEL||
i===s.ROUND)&&(p.flags|=r.PT_BEVEL),0!=(p.flags&(r.PT_BEVEL|
r.PT_INNERBEVEL))&&_.nbevel++,m=p,p=f[v+1]}}},_flattenPaths:function(t){for(var
e=t._paths,i=t._pathOffset,n=t._pathLength;i<n;i++){var
r=e[i],s=r.points,a=s[s.length-1],o=s[0];a.equals(o)&&(r.closed=!
0,s.pop(),a=s[s.length-1]);for(var l=0,h=s.length;l<h;l++){var
c=o.sub(a);a.len=c.mag(),(c.x||
c.y)&&c.normalizeSelf(),a.dx=c.x,a.dy=c.y,a=o,o=s[l+1]}}},_chooseBevel:function(t,e
,i,n){var r=i.x,s=i.y,a=void 0,o=void 0,l=void 0,h=void 0;return 0!==t?
(a=r+e.dy*n,o=s-e.dx*n,l=r+i.dy*n,h=s-i.dx*n):(a=l=r+i.dmx*n,o=h=s+i.dmy*n),
[a,o,l,h]},_buttCap:function(t,e,i,n,r){var s=t.x-e*r,a=t.y-i*r,o=i,l=-
e;this._vset(s+o*n,a+l*n),this._vset(s-o*n,a-
l*n)},_roundCapStart:function(t,e,i,n,r){for(var s=t.x,a=t.y,o=i,l=-e,c=0;c<r;c++)
{var u=c/(r-1)*h,_=d(u)*n,f=m(u)*n;this._vset(s-o*_-e*f,a-l*_-
i*f),this._vset(s,a)}this._vset(s+o*n,a+l*n),this._vset(s-o*n,a-
l*n)},_roundCapEnd:function(t,e,i,n,r){var s=t.x,a=t.y,o=i,l=-
e;this._vset(s+o*n,a+l*n),this._vset(s-o*n,a-l*n);for(var c=0;c<r;c++){var u=c/(r-
1)*h,_=d(u)*n,f=m(u)*n;this._vset(s,a),this._vset(s-o*_+e*f,a-
l*_+i*f)}},_roundJoin:function(t,e,i,n,s){var a=t.dy,o=-t.dx,l=e.dy,c=-
e.dx,u=e.x,f=e.y;if(0!=(e.flags&r.PT_LEFT)){var
v=this._chooseBevel(e.flags&r.PT_INNERBEVEL,t,e,i),y=v[0],g=v[1],x=v[2],A=v[3],C=p(
-o,-a),S=p(-c,-l);S>C&&(S-=2*h),this._vset(y,g),this._vset(u-a*n,e.y-o*n);for(var
T=b(_((C-S)/h)*s,2,s),w=0;w<T;w++){var E=C+w/(T-1)*(S-
C),M=u+d(E)*n,D=f+m(E)*n;this._vset(u,f),this._vset(M,D)}this._vset(x,A),this._vset
(u-l*n,f-c*n)}else{var B=this._chooseBevel(e.flags&r.PT_INNERBEVEL,t,e,-
n),P=B[0],I=B[1],R=B[2],O=B[3],L=p(o,a),F=p(c,l);F<L&&(F+=2*h),this._vset(u+a*n,f+o
*n),this._vset(P,I);for(var V=b(_((F-L)/h)*s,2,s),N=0;N<V;N++){var k=L+N/(V-1)*(F-
L),G=u+d(k)*i,z=f+m(k)*i;this._vset(G,z),this._vset(u,f)}this._vset(u+l*n,f+c*n),th
is._vset(R,O)}},_bevelJoin:function(t,e,i,n){var s=void 0,a=void 0,o=void 0,l=void
0,h=void 0,c=void 0,u=void 0,_=void 0,f=t.dy,d=-t.dx,m=e.dy,p=-
e.dx;if(e.flags&r.PT_LEFT){var
v=this._chooseBevel(e.flags&r.PT_INNERBEVEL,t,e,i);h=v[0],c=v[1],u=v[2],_=v[3],this
._vset(h,c),this._vset(e.x-f*n,e.y-d*n),this._vset(u,_),this._vset(e.x-m*n,e.y-
p*n)}else{var y=this._chooseBevel(e.flags&r.PT_INNERBEVEL,t,e,-
n);s=y[0],a=y[1],o=y[2],l=y[3],this._vset(e.x+f*i,e.y+d*i),this._vset(s,a),this._vs
et(e.x+m*i,e.y+p*i),this._vset(o,l)}},_vset:function(t,e){var
i=v.meshbuffer,n=3*i.vertexStart,r=i._vData,s=i._uintVData;r[n]=t,r[n+1]=e,s[n+2]=g
,i.vertexStart++,i._dirty=!0}};n._assembler=A,e.exports=A}),
{"../../../../graphics/graphics":141,"../../../../graphics/types":144,"./earcut":25
2,"./impl":253}],255:[(function(t,e,i){"use strict";t("./sprite"),t("./mask-
assembler"),t("./graphics"),t("./label"),t("./motion-streak")}),
{"./graphics":254,"./label":262,"./mask-assembler":263,"./motion-
streak":264,"./sprite":277}],256:[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../../../../utils/label/bmfont"),s=t("../../
utils").fillMeshVertices;e.exports=n.addon({createData:function(t){return
t.requestRenderData()},fillBuffers:function(t,e){var
i=t.node;s(i,e._meshBuffer,t._renderData,i._color._val)},appendQuad:function(t,e,i,
n,r,s,a){var
o=t.dataLength;t.dataLength+=4,t.vertexCount=t.dataLength,t.indiceCount=t.dataLengt
h/2*3;var l=t._data,h=e.width,c=e.height,u=i.width,_=i.height,f=void 0,d=void
0,m=void 0,p=void 0;n?
(f=i.x/h,m=(i.x+_)/h,d=(i.y+u)/c,p=i.y/c,l[o].u=f,l[o].v=p,l[o+1].u=f,l[o+1].v=d,l[
o+2].u=m,l[o+2].v=p,l[o+3].u=m,l[o+3].v=d):
(f=i.x/h,m=(i.x+u)/h,d=(i.y+_)/c,p=i.y/c,l[o].u=f,l[o].v=d,l[o+1].u=m,l[o+1].v=d,l[
o+2].u=f,l[o+2].v=p,l[o+3].u=m,l[o+3].v=p),l[o].x=r,l[o].y=s-
_*a,l[o+1].x=r+u*a,l[o+1].y=s-
_*a,l[o+2].x=r,l[o+2].y=s,l[o+3].x=r+u*a,l[o+3].y=s}},r)}),
{"../../../../../platform/js":220,"../../../../utils/label/bmfont":247,"../../utils
":278}],257:[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("./bmfont"),s=t("../../../../utils/label/lett
er-
font"),a=t("../../utils").fillMeshVertices,o=cc.color(255,255,255,255);e.exports=n.
addon({createData:function(t){return
t.requestRenderData()},fillBuffers:function(t,e){var
i=t.node;o._fastSetA(i.color.a),a(i,e._meshBuffer,t._renderData,o._val)},appendQuad
:r.appendQuad},s)}),
{"../../../../../platform/js":220,"../../../../utils/label/letter-
font":249,"../../utils":278,"./bmfont":256}],258:[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../../../../utils/label/ttf"),s=t("../../../
../../components/CCLabelShadow"),a=t("../../utils").fillMeshVertices,o=cc.color(255
,255,255,255);e.exports=n.addon({createData:function(t){var
e=t.requestRenderData();return
e.dataLength=4,e.vertexCount=4,e.indiceCount=6,e},fillBuffers:function(t,e){var
i=t.node;o._fastSetA(i.color.a),a(i,e._meshBuffer,t._renderData,o._val)},_updateVer
ts:function(t){var
e=t._renderData,i=t._frame.uv,n=t.node,r=t._ttfTexture.width,a=t._ttfTexture.height
,o=n.anchorX*n.width,l=n.anchorY*n.height,h=s&&t.getComponent(s);if(h&&h._enabled)
{var c=(r-n.width)/2,u=(a-n.height)/2,_=h.offset;-_.x>c?o+=r-n.width:c>_.x&&(o+=c-
_.x),-_.y>u?l+=a-n.height:u>_.y&&(l+=u-_.y)}var f=e._data;f[0].x=-o,f[0].y=-
l,f[1].x=r-o,f[1].y=-l,f[2].x=-o,f[2].y=a-l,f[3].x=r-o,f[3].y=a-
l,f[0].u=i[0],f[0].v=i[1],f[1].u=i[2],f[1].v=i[3],f[2].u=i[4],f[2].v=i[5],f[3].u=i[
6],f[3].v=i[7]}},r)}),
{"../../../../../components/CCLabelShadow":99,"../../../../../platform/js":220,"../
../../../utils/label/ttf":250,"../../utils":278}],259:[(function(t,e,i){"use
strict";var
n=t("../../../../../platform/js"),r=t("../2d/bmfont"),s=t("../../utils").fillMeshVe
rtices3D;e.exports=n.addon({fillBuffers:function(t,e){var
i=t.node;s(i,e._meshBuffer3D,t._renderData,i._color._val)}},r)}),
{"../../../../../platform/js":220,"../../utils":278,"../2d/bmfont":256}],260:
[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/letter"),s=t("../../utils").fillMeshVe
rtices3D,a=cc.color(255,255,255,255);e.exports=n.addon({fillBuffers:function(t,e)
{var
i=t.node;a._fastSetA(i.color.a),s(t.node,e._meshBuffer3D,t._renderData,a._val)}},r)
}),{"../../../../../platform/js":220,"../../utils":278,"../2d/letter":257}],261:
[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/ttf"),s=t("../../utils").fillMeshVerti
ces3D,a=cc.color(255,255,255,255);e.exports=n.addon({fillBuffers:function(t,e){var
i=t.node;a._fastSetA(i.color.a),s(t.node,e._meshBuffer3D,t._renderData,a._val)}},r)
}),{"../../../../../platform/js":220,"../../utils":278,"../2d/ttf":258}],262:
[(function(t,e,i){"use strict";var
n=t("../../../../components/CCLabel"),r=t("./2d/ttf"),s=t("./2d/bmfont"),a=t("./2d/
letter"),o=t("./3d/ttf"),l=t("./3d/bmfont"),h=t("./3d/letter"),c={pool:
[],get:function(){var t=this.pool.pop();if(!t){var
e=document.createElement("canvas");t={canvas:e,context:e.getContext("2d")}}return
t},put:function(t){this.pool.length>=32||
this.pool.push(t)}},u={getAssembler:function(t){var e=t.node.is3DNode,i=e?
o:r;return t.font instanceof cc.BitmapFont?i=e?
l:s:t.cacheMode===n.CacheMode.CHAR&&(cc.sys.browserType===cc.sys.BROWSER_TYPE_WECHA
T_GAME_SUB?cc.warn("sorry, subdomain does not support CHAR mode currently!"):i=e?
h:a),i},updateRenderData:function(t){return
t.__allocedDatas}};n._assembler=u,n._canvasPool=c,e.exports=u}),
{"../../../../components/CCLabel":97,"./2d/bmfont":256,"./2d/letter":257,"./2d/ttf"
:258,"./3d/bmfont":259,"./3d/letter":260,"./3d/ttf":261}],263:[(function(t,e,i)
{"use strict";var n=t("../../../components/CCMask"),r=t("../../render-
flow"),s=t("./sprite/2d/simple"),a=t("./graphics"),o=t("../../../../renderer/gfx"),
l=t("../vertex-format").vfmtPos,h=8,c=[];function u(){return 1<<c.length-1}function
_(){for(var t=0,e=0;e<c.length;++e)t+=1<<e;return t}function f(t,e,i,n,r,s){for(var
a=t.effect.getDefaultTechnique().passes,l=o.STENCIL_OP_KEEP,h=o.STENCIL_OP_KEEP,c=0
;c<a.length;++c){var
u=a[c];u.setStencilFront(o.STENCIL_ENABLE,e,n,r,i,l,h,s),u.setStencilBack(o.STENCIL
_ENABLE,e,n,r,i,l,h,s)}}function d(t)
{c.length+1>h&&cc.errorID(9e3,h),c.push(t)}function m(t,e)
{0===c.length&&cc.errorID(9001),c.pop(),0===c.length?
e._flushMaterial(t._exitMaterial):y(e)}function p(t,e){var
i=o.DS_FUNC_NEVER,n=u(),r=n,s=n,a=t.inverted?
o.STENCIL_OP_REPLACE:o.STENCIL_OP_ZERO;f(t._clearMaterial,i,a,n,r,s);var
h=e.getBuffer("mesh",l),c=h.request(4,6),_=c.indiceOffset,d=c.byteOffset>>2,m=c.ver
texOffset,p=h._vData,v=h._iData;p[d++]=-1,p[d++]=-1,p[d++]=-1,p[d++]=1,p[d+
+]=1,p[d++]=1,p[d++]=1,p[d++]=-1,v[_++]=m,v[_++]=m+3,v[_++]=m+1,v[_++]=m+1,v[_+
+]=m+3,v[_+
+]=m+2,e.node=e._dummyNode,e.material=t._clearMaterial,e._flush()}function v(t,e)
{var i=o.DS_FUNC_NEVER,r=u(),l=r,h=r,c=t.inverted?
o.STENCIL_OP_ZERO:o.STENCIL_OP_REPLACE;f(t.sharedMaterials[0],i,c,r,l,h),e.node=t.n
ode,e.material=t.sharedMaterials[0],t._type===n.Type.IMAGE_STENCIL?
(s.fillBuffers(t,e),e._flush()):a.fillBuffers(t._graphics,e)}function y(t){var
e=o.DS_FUNC_EQUAL,i=o.STENCIL_OP_KEEP,n=_(),r=n,s=u(),a=c[c.length-
1];f(a._enableMaterial,e,i,n,r,s),t._flushMaterial(a._enableMaterial)}var
g={updateRenderData:function(t){t._renderData||(t._type===n.Type.IMAGE_STENCIL?
t._renderData=s.createData(t):t._renderData=t.requestRenderData());var
e=t._renderData;if(t._type===n.Type.IMAGE_STENCIL)if(t.spriteFrame){var
i=t.node._contentSize,r=t.node._anchorPoint;e.updateSizeNPivot(i.width,i.height,r.x
,r.y),e.dataLength=4,s.updateRenderData(t),e.material=t.sharedMaterials[0]}else
t.setMaterial(0,null);else
t._graphics.setMaterial(0,t.sharedMaterials[0]),a.updateRenderData(t._graphics)},fi
llBuffers:function(t,e){(t._type!==n.Type.IMAGE_STENCIL||
t.spriteFrame)&&(d(t),p(t,e),v(t,e),y(e)),t.node._renderFlag|
=r.FLAG_UPDATE_RENDER_DATA}},x={fillBuffers:function(t,e){(t._type!
==n.Type.IMAGE_STENCIL||t.spriteFrame)&&m(t,e),t.node._renderFlag|
=r.FLAG_UPDATE_RENDER_DATA}};n._assembler=g,n._postAssem
bler=x,e.exports={front:g,end:x}}),
{"../../../../renderer/gfx":348,"../../../components/CCMask":101,"../../render-
flow":244,"../vertex-format":283,"./graphics":254,"./sprite/2d/simple":268}],264:
[(function(t,e,i){"use strict";var
n=t("../../../components/CCMotionStreak"),r=t("../../render-flow");function s(t,e)
{this.point=t||cc.v2(),this.dir=e||
cc.v2(),this.distance=0,this.time=0}s.prototype.setPoint=function(t,e)
{this.point.x=t,this.point.y=e},s.prototype.setDir=function(t,e)
{this.dir.x=t,this.dir.y=e};cc.v2(),cc.v2();var a=cc.v2(),o=cc.v2();function l(t,e)
{return t.x=-e.y,t.y=e.x,t}var h={updateRenderData:function(t){var
e=cc.director.getDeltaTime();this.update(t,e);var
i=t._renderData,n=t.node._contentSize,r=t.node._anchorPoint;i.updateSizeNPivot(n.wi
dth,n.height,r.x,r.y),i.material=t.sharedMaterials[0]},update:function(t,e){var
i=t._renderData;i||(i=t._renderData=t.requestRenderData());var
n=t._stroke/2,r=t.node._worldMatrix,h=(r.m00,r.m01,r.m04,r.m05,r.m12),c=r.m13,u=t._
points,_=void 0;if(u.length>1){var f=u[0].point.x-h,d=u[0].point.y-
c;f*f+d*d<t.minSeg&&(_=u[0])}if(_||(_=new
s,u.splice(0,0,_)),_.setPoint(h,c),_.time=t._fadeTime+e,i.dataLength=0,!
(u.length<2)){var
m=i._data,p=t._color,v=p.r,y=p.g,g=p.b,x=p.a,b=u[1];b.distance=_.point.sub(b.point,
o).mag(),o.normalizeSelf(),b.setDir(o.x,o.y),_.setDir(o.x,o.y);for(var
A=t._fadeTime,C=!1,S=u.length-1;S>=0;S--){var T=u[S],w=T.point,E=T.dir;if(T.time-
=e,T.time<0)u.splice(S,1);else{var M=T.time/A,D=u[S-1];if(!C){if(!D)
{u.splice(S,1);continue}w.x=D.point.x-E.x*M,w.y=D.point.y-E.y*M}C=!
0,l(a,E),i.dataLength+=2;var B=(M*x<<24>>>0)+(g<<16)+(y<<8)+v,P=m.length-
1;m[P].x=w.x-a.x*n,m[P].y=w.y-a.y*n,m[P].u=0,m[P].v=M,m[P].color=B,m[--
P].x=w.x+a.x*n,m[P].y=w.y+a.y*n,m[P].u=1,m[P].v=M,m[P].color=B}}i.vertexCount=i.dat
aLength,i.indiceCount=i.vertexCount<=2?0:3*(i.vertexCount-
2)}},fillBuffers:function(t,e){t.node;for(var
i=t._renderData,n=i._data,s=e._meshBuffer,a=i.vertexCount,o=s.request(a,i.indiceCou
nt),l=o.indiceOffset,h=o.byteOffset>>2,c=o.vertexOffset,u=s._vData,_=s._uintVData,f
=s._iData,d=void 0,m=0,p=i.vertexCount;m<p;m++)d=n[m],u[h++]=d.x,u[h++]=d.y,u[h+
+]=d.u,u[h++]=d.v,_[h++]=d.color;for(var v=0,y=i.vertexCount;v<y;v+=2){var
g=c+v;f[l++]=g,f[l++]=g+2,f[l++]=g+1,f[l++]=g+1,f[l++]=g+2,f[l+
+]=g+3}t.node._renderFlag|=r.FLAG_UPDATE_RENDER_DATA}};e.exports=n._assembler=h}),
{"../../../components/CCMotionStreak":102,"../../render-flow":244}],265:
[(function(t,e,i){"use strict";var
n=t("../../../../../components/CCSprite").FillType,r=t("../../../../utils/utils").p
ackToDynamicAtlas,s=t("../../utils").fillVerticesWithoutCalc;e.exports={updateRende
rData:function(t){r(t,t._spriteFrame);var e=t._renderData;if(e&&t.spriteFrame){var
i=e.uvDirty,n=e.vertDirty;if(!i&&!n)return t.__allocedDatas;var
s=t._fillStart,a=t._fillRange;a<0&&(s+=a,a=-a),a=s+a,s=(s=s>1?1:s)<0?0:s,a=(a=a>1?
1:a)<0?0:a;var o=s+(a=(a-=s)<0?0:a);o=o>1?
1:o,i&&this.updateUVs(t,s,o),n&&(this.updateVerts(t,s,o),this.updateWorldVerts(t))}
},updateUVs:function(t,e,i){var
r=t._spriteFrame,s=t._renderData,a=s._data,o=r._texture.width,l=r._texture.height,h
=r._rect,c=void 0,u=void 0,_=void 0,f=void 0,d=void 0,m=void 0,p=void 0,v=void
0,y=void 0,g=void 0;switch(r._rotated?
(c=h.x/o,u=(h.y+h.width)/l,_=d=c,p=y=(h.x+h.height)/o,m=g=u,f=v=h.y/l):
(c=h.x/o,u=(h.y+h.height)/l,_=p=c,d=y=(h.x+h.width)/o,f=m=u,v=g=h.y/l),t._fillType)
{case n.HORIZONTAL:a[0].u=_+(d-_)*e,a[0].v=f+(m-f)*e,a[1].u=_+(d-_)*i,a[1].v=f+(m-
f)*i,a[2].u=p+(y-p)*e,a[2].v=v+(g-v)*e,a[3].u=p+(y-p)*i,a[3].v=v+(g-v)*i;break;case
n.VERTICAL:a[0].u=_+(p-_)*e,a[0].v=f+(v-f)*e,a[1].u=d+(y-d)*e,a[1].v=m+(g-
m)*e,a[2].u=_+(p-_)*i,a[2].v=f+(v-f)*i,a[3].u=d+(y-d)*i,a[3].v=m+(g-
m)*i;break;default:cc.errorID(2626)}s.uvDirty=!1},updateVerts:function(t,e,i){var
r=t._renderData,s=r._data,a=t.node,o=a.width,l=a.height,h=a.anchorX*o,c=a.anchorY*l
,u=-h,_=-c,f=o-h,d=l-c,m=void 0;switch(t._fillType){case n.HORIZONTAL:m=u+(f-
u)*i,u=u+(f-u)*e,f=m;break;case n.VERTICAL:m=_+(d-_)*i,_=_+(d-
_)*e,d=m;break;default:cc.errorID(2626)}s[4].x=u,s[4].y=_,s[5].x=f,s[5].y=_,s[6].x=
u,s[6].y=d,s[7].x=f,s[7].y=d,r.vertDirty=!1},createData:function(t){var
e=t.requestRenderData();e.dataLength=8,e.vertexCount=4,e.indiceCount=6;for(var
i=e._data,n=0;n<i.length;n++)i[n].z=0;return e},updateWorldVerts:function(t)
{for(var
e=t.node,i=t._renderData._data,n=e._worldMatrix,r=n.m00,s=n.m01,a=n.m04,o=n.m05,l=n
.m12,h=n.m13,c=0;c<4;c++){var
u=i[c+4],_=i[c];_.x=u.x*r+u.y*a+l,_.y=u.x*s+u.y*o+h}},fillBuffers:function(t,e)
{e.worldMatDirty&&this.updateWorldVerts(t);var
i=e._meshBuffer,n=t.node,r=s(n,i,t._renderData,n._color._val),a=i._iData,o=r.indice
Offset,l=r.vertexOffset;a[o++]=l,a[o++]=l+1,a[o++]=l+2,a[o++]=l+1,a[o++]=l+3,a[o+
+]=l+2}}}),
{"../../../../../components/CCSprite":111,"../../../../utils/utils":251,"../../util
s":278}],266:[(function(t,e,i){"use strict";var
n=t("../../utils").fillVerticesWithoutCalc,r=t("../../../../utils/utils").packToDyn
amicAtlas;e.exports={createData:function(t){return
t.requestRenderData()},updateRenderData:function(t){r(t,t._spriteFrame);var
e=t._renderData,i=t.spriteFrame;if(e&&i){var n=i.vertices;if(n)e.vertexCount!
==n.x.length&&(e.vertexCount=n.x.length,e.indiceCount=n.triangles.length,e.dataLeng
th=2*e.vertexCount,e.uvDirty=e.vertDirty=!
0),e.uvDirty&&this.updateUVs(t),e.vertDirty&&(this.updateVerts(t),this.updateWorldV
erts(t))}},updateUVs:function(t){for(var
e=t.spriteFrame.vertices,i=e.nu,n=e.nv,r=t._renderData,s=r._data,a=0,o=i.length;a<o
;a++){var l=s[a];l.u=i[a],l.v=n[a]}r.uvDirty=!1},updateVerts:function(t){var
e=t.node,i=Math.abs(e.width),n=Math.abs(e.height),r=e.anchorX*i,s=e.anchorY*n,a=t.s
priteFrame,o=a.vertices,l=o.x,h=o.y,c=a._originalSize.width,u=a._originalSize.heigh
t,_=a._rect.width,f=a._rect.height,d=a._offset.x+(c-_)/2,m=a._offset.y+(u-f)/2,p=i/
(t.trim?_:c),v=n/(t.trim?f:u),y=t._renderData,g=y._data;if(t.trim)for(var
x=0,b=l.length;x<b;x++){var A=g[x+b];A.x=(l[x]-d)*p-r,A.y=(u-h[x]-m)*v-s}else
for(var C=0,S=l.length;C<S;C++){var T=g[C+S];T.x=l[C]*p-r,T.y=(u-h[C])*v-
s}y.vertDirty=!1},updateWorldVerts:function(t){for(var
e=t.node,i=t._renderData,n=i._data,r=e._worldMatrix,s=r.m00,a=r.m01,o=r.m04,l=r.m05
,h=r.m12,c=r.m13,u=0,_=i.vertexCount;u<_;u++){var
f=n[u+_],d=n[u];d.x=f.x*s+f.y*o+h,d.y=f.x*a+f.y*l+c}},fillBuffers:function(t,e){var
i=t.spriteFrame.vertices;if(i){e.worldMatDirty&&this.updateWorldVerts(t);for(var
r=e._meshBuffer,s=t.node,a=n(s,r,t._renderData,s._color._val),o=r._iData,l=a.indice
Offset,h=a.vertexOffset,c=i.triangles,u=0,_=c.length;u<_;u++)o[l++]=h+c[u]}}}}),
{"../../../../utils/utils":251,"../../utils":278}],267:[(function(t,e,i){"use
strict";var
n=t("../../utils").fillVertices,r=t("../../../../utils/utils").packToDynamicAtlas,s
=2*Math.PI,a=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],o=[0,0,0,0],l=[0,0,0,0,0
,0,0,0],h=[cc.v2(0,0),cc.v2(0,0),cc.v2(0,0),cc.v2(0,0)],c=[cc.v2(0,0),cc.v2(0,0),cc
.v2(0,0),cc.v2(0,0)],u=cc.v2(0,0),_=[];function f(t,e,i,n,r,s,a){var
o=Math.sin(s),l=Math.cos(s),h=void 0,c=void 0;if(0!==Math.cos(s)){if(h=o/l,(t-
r.x)*l>0){var u=r.y+h*(t-r.x);a[0].x=t,a[0].y=u}if((e-r.x)*l>0){var _=r.y+h*(e-
r.x);a[2].x=e,a[2].y=_}}if(0!==Math.sin(s)){if(c=l/o,(n-r.y)*o>0){var f=r.x+c*(n-
r.y);a[3].x=f,a[3].y=n}if((i-r.y)*o>0){var d=r.x+c*(i-
r.y);a[1].x=d,a[1].y=i}}}function d(t){var
e=t.node,i=e.width,n=e.height,r=e.anchorX*i,s=e.anchorY*n,l=-r,h=-s,c=i-r,f=n-
s,d=o;d[0]=l,d[1]=h,d[2]=c,d[3]=f;var
m=t._fillCenter,p=u.x=Math.min(Math.max(0,m.x),1)*(c-l)
+l,v=u.y=Math.min(Math.max(0,m.y),1)*(f-h)
+h;a[0].x=a[3].x=l,a[1].x=a[2].x=c,a[0].y=a[1].y=h,a[2].y=a[3].y=f,_.length=0,p!
==d[0]&&(_[0]=[3,0]),p!==d[2]&&(_[2]=[1,2]),v!==d[1]&&(_[1]=[0,1]),v!
==d[3]&&(_[3]=[2,3])}function m(t){var
e=t._texture.width,i=t._texture.height,n=t._rect,r=void 0,s=void 0,a=void 0,o=void
0,h=l;t._rotated?
(r=n.x/e,s=(n.x+n.height)/e,a=n.y/i,o=(n.y+n.width)/i,h[0]=h[2]=r,h[4]=h[6]=s,h[3]=
h[7]=o,h[1]=h[5]=a):
(r=n.x/e,s=(n.x+n.width)/e,a=n.y/i,o=(n.y+n.height)/i,h[0]=h[4]=r,h[2]=h[6]=s,h[1]=
h[3]=o,h[5]=h[7]=a)}function p(t,e){var i,n;if(i=e.x-t.x,n=e.y-t.y,0!==i||0!==n)
{if(0===i)return n>0?.5*Math.PI:1.5*Math.PI;var r=Math.atan(n/i);return
i<0&&(r+=Math.PI),r}}function v(t,e,i,n,r){var
s=o,a=s[0],l=s[1],h=s[2],c=s[3];t[e].x=i.x,t[e].y=i.y,t[e+1].x=n.x,t[e+1].y=n.y,t[e
+2].x=r.x,t[e+2].y=r.y;y((i.x-a)/(h-a),(i.y-l)/(c-l),t,e),y((n.x-a)/(h-a),(n.y-l)/
(c-l),t,e+1),y((r.x-a)/(h-a),(r.y-l)/(c-l),t,e+2)}function y(t,e,i,n){var
r=l,s=r[0]+(r[2]-r[0])*t,a=r[4]+(r[6]-r[4])*t,o=r[1]+(r[3]-r[1])*t,h=r[5]+(r[7]-
r[5])*t,c=i[n];c.u=s+(a-s)*e,c.v=o+(h-o)*e}e.exports={createData:function(t){return
t.requestRenderData()},updateRenderData:function(t){var
e=t._renderData,i=t.spriteFrame;if(e&&i&&(e.vertDirty||e.uvDirty)){var
n=e._data;r(t,i);var l=t._fillStart,y=t._fillRange;for(y<0&&(l+=y,y=-y);l>=1;)l-
=1;for(;l<0;)l+=1;var g=(l*=s)+
(y*=s);d(t),m(i),f(o[0],o[2],o[1],o[3],u,l,h),f(o[0],o[2],o[1],o[3],u,l+y,c);for(va
r x=0,b=0;b<4;++b){var
A=_[b];if(A)if(y>=s)e.dataLength=x+3,v(n,x,u,a[A[0]],a[A[1]]),x+=3;else{var
C=p(u,a[A[0]]),S=p(u,a[A[1]]);S<C&&(S+=s),C-=s,S-=s;for(var T=0;T<3;++T)C>=g||
(C>=l?(e.dataLength=x+3,v(n,x,u,a[A[0]],S>=g?c[b]:a[A[1]]),x+=3):S<=l||(S<=g?
(e.dataLength=x+3,v(n,x,u,h[b],a[A[1]]),x+=3):
(e.dataLength=x+3,v(n,x,u,h[b],c[b]),x+=3))),C+=s,S+=s}}e.indiceCount=e.vertexCount
=x,e.vertDirty=e.uvDirty=!1}},fillBuffers:function(t,e){for(var
i=t.node,r=i._color._val,s=e._meshBuffer,a=t._renderData,o=n(i,s,a,r),l=o.indiceOff
set,h=o.vertexOffset,c=s._iData,u=0;u<a.dataLength;u++)c[l+u]=h+u}}}),
{"../../../../utils/utils":251,"../../utils":278}],268:[(function(t,e,i){"use
strict";var
n=t("../../../../utils/utils").packToDynamicAtlas;e.exports={updateRenderData:funct
ion(t){n(t,t._spriteFrame);var
e=t._renderData;e&&t.spriteFrame&&e.vertDirty&&this.updateVerts(t)},fillBuffers:fun
ction(t,e){var
i=t._renderData._data,n=t.node,r=n._color._val,s=n._worldMatrix,a=s.m00,o=s.m01,l=s
.m04,h=s.m05,c=s.m12,u=s.m13,_=e._meshBuffer,f=_.request(4,6),d=f.indiceOffset,m=f.
byteOffset>>2,p=f.vertexOffset,v=_._vData,y=_._
uintVData,g=_._iData,x=t._spriteFrame.uv;v[m+2]=x[0],v[m+3]=x[1],v[m+7]=x[2],v[m+8]
=x[3],v[m+12]=x[4],v[m+13]=x[5],v[m+17]=x[6],v[m+18]=x[7];var
b=i[0],A=i[3],C=b.x,S=A.x,T=b.y,w=A.y,E=a*C,M=a*S,D=o*C,B=o*S,P=l*T,I=l*w,R=h*T,O=h
*w;v[m]=E+P+c,v[m+1]=D+R+u,v[m+5]=M+P+c,v[m+6]=B+R+u,v[m+10]=E+I+c,v[m+11]=D+O+u,v[
m+15]=M+I+c,v[m+16]=B+O+u,y[m+4]=r,y[m+9]=r,y[m+14]=r,y[m+19]=r,g[d++]=p,g[d+
+]=p+1,g[d++]=p+2,g[d++]=p+1,g[d++]=p+3,g[d++]=p+2},createData:function(t){var
e=t.requestRenderData();return
e.dataLength=4,e.vertexCount=4,e.indiceCount=6,e},updateVerts:function(t){var
e=t._renderData,i=t.node,n=e._data,r=i.width,s=i.height,a=i.anchorX*r,o=i.anchorY*s
,l=void 0,h=void 0,c=void 0,u=void 0;if(t.trim)l=-a,h=-o,c=r-a,u=s-o;else{var
_=t.spriteFrame,f=_._originalSize.width,d=_._originalSize.height,m=_._rect.width,p=
_._rect.height,v=_._offset,y=r/f,g=s/d,x=v.x+(f-m)/2,b=v.x-(f-m)/2;l=x*y-a,h=(v.y+
(d-p)/2)*g-o,c=r+b*y-a,u=s+(v.y-(d-p)/2)*g-
o}n[0].x=l,n[0].y=h,n[3].x=c,n[3].y=u,e.vertDirty=!1}}}),
{"../../../../utils/utils":251}],269:[(function(t,e,i){"use strict";var
n=t("../../../../utils/utils").packToDynamicAtlas;e.exports={createData:function(t)
{var e=t.requestRenderData();return
e.dataLength=20,e.vertexCount=16,e.indiceCount=54,e},updateRenderData:function(t)
{n(t,t._spriteFrame);var
e=t._renderData;e&&t.spriteFrame&&(e.vertDirty&&(this.updateVerts(t),this.updateWor
ldVerts(t)))},updateVerts:function(t){var
e=t._renderData,i=e._data,n=t.node,r=n.width,s=n.height,a=n.anchorX*r,o=n.anchorY*s
,l=t.spriteFrame,h=l.insetLeft,c=l.insetRight,u=l.insetTop,_=l.insetBottom,f=r-h-
c,d=s-u-_,m=r/(h+c),p=s/(u+_);m=isNaN(m)||m>1?1:m,p=isNaN(p)||p>1?1:p,f=f<0?
0:f,d=d<0?0:d,i[0].x=-a,i[0].y=-o,i[1].x=h*m-a,i[1].y=_*p-
o,i[2].x=i[1].x+f,i[2].y=i[1].y+d,i[3].x=r-a,i[3].y=s-o,e.vertDirty=!
1},fillBuffers:function(t,e){e.worldMatDirty&&this.updateWorldVerts(t);for(var
i=t._renderData,n=t.node._color._val,r=i._data,s=e._meshBuffer,a=i.vertexCount,o=t.
spriteFrame.uvSliced,l=s.request(a,i.indiceCount),h=l.indiceOffset,c=l.byteOffset>>
2,u=l.vertexOffset,_=s._vData,f=s._uintVData,d=s._iData,m=4;m<20;++m){var
p=r[m],v=o[m-4];_[c++]=p.x,_[c++]=p.y,_[c++]=v.u,_[c++]=v.v,f[c++]=n}for(var
y=0;y<3;++y)for(var g=0;g<3;++g){var x=u+4*y+g;d[h++]=x,d[h++]=x+1,d[h++]=x+4,d[h+
+]=x+1,d[h++]=x+5,d[h++]=x+4}},updateWorldVerts:function(t){for(var
e=t.node,i=t._renderData._data,n=e._worldMatrix,r=n.m00,s=n.m01,a=n.m04,o=n.m05,l=n
.m12,h=n.m13,c=0;c<4;++c)for(var u=i[c],_=0;_<4;++_){var
f=i[_],d=i[4+4*c+_];d.x=f.x*r+u.y*a+l,d.y=f.x*s+u.y*o+h}}}}),
{"../../../../utils/utils":251}],270:[(function(t,e,i){"use strict";var
n=t("../../../../utils/utils").packToDynamicAtlas;e.exports={vertexOffset:5,uvOffse
t:2,colorOffset:4,createData:function(t){return
t.requestRenderData()},updateRenderData:function(t){n(t,t._spriteFrame);var
e=t._renderData,i=t.spriteFrame;if(i&&e&&(e.uvDirty||e.vertDirty)){var
r=t.node,s=Math.abs(r.width),a=Math.abs(r.height),o=r.anchorX*s,l=r.anchorY*a,h=i._
rect,c=h.width,u=h.height,_=s/c,f=a/u,d=Math.ceil(f),m=Math.ceil(_),p=e._data;e.dat
aLength=Math.max(8,d+1,m+1);for(var v=0;v<=m;++v)p[v].x=Math.min(c*v,s)-o;for(var
y=0;y<=d;++y)p[y].y=Math.min(u*y,a)-
l;e.vertexCount=d*m*4,e.indiceCount=d*m*6,e.uvDirty=!1,e.vertDirty=!
1}},fillVertices:function(t,e,i,n,r,s){for(var
a=i.m00,o=i.m01,l=i.m04,h=i.m05,c=i.m12,u=i.m13,_=void 0,f=void 0,d=void 0,m=void
0,p=0,v=n;p<v;++p){d=s[p].y,m=s[p+1].y;for(var y=0,g=r;y<g;+
+y)_=s[y].x,f=s[y+1].x,t[e]=_*a+d*l+c,t[e+1]=_*o+d*h+u,t[e+5]=f*a+d*l+c,t[e+6]=f*o+
d*h+u,t[e+10]=_*a+m*l+c,t[e+11]=_*o+m*h+u,t[e+15]=f*a+m*l+c,t[e+16]=f*o+m*h+u,e+=20
}},fillBuffers:function(t,e){var
i=t.node,n=i.is3DNode,r=i._color._val,s=t._renderData,a=s._data,o=n?
e._meshBuffer3D:e._meshBuffer,l=o.request(s.vertexCount,s.indiceCount),h=l.indiceOf
fset,c=l.byteOffset>>2,u=l.vertexOffset,_=o._vData,f=o._uintVData,d=o._iData,m=t.sp
riteFrame._rotated,p=t.spriteFrame.uv,v=t.spriteFrame._rect,y=Math.abs(i.width),g=M
ath.abs(i.height),x=y/v.width,b=g/v.height,A=Math.ceil(b),C=Math.ceil(x),S=i._world
Matrix;this.fillVertices(_,c,S,A,C,a);for(var
T=this.vertexOffset,w=this.uvOffset,E=this.colorOffset,M=T,D=2*T,B=3*T,P=4*T,I=void
0,R=void 0,O=0,L=A;O<L;++O){R=Math.min(1,b-O);for(var F=0,V=C;F<V;++F)
{I=Math.min(1,x-F);var N=c+w,k=N+1;m?(_[N]=p[0],_[k]=p[1],_[N+M]=p[0],_[k+M]=p[1]+
(p[7]-p[1])*I,_[N+D]=p[0]+(p[6]-p[0])*R,_[k+D]=p[1],_[N+B]=_[N+D],_[k+B]=_[k+M]):
(_[N]=p[0],_[k]=p[1],_[N+M]=p[0]+(p[6]-p[0])*I,_[k+M]=p[1],_[N+D]=p[0],_[k+D]=p[1]+
(p[7]-
p[1])*R,_[N+B]=_[N+M],_[k+B]=_[k+D]),f[c+E]=r,f[c+E+M]=r,f[c+E+D]=r,f[c+E+B]=r,c+=P
}}for(var G=s.indiceCount,z=0;z<G;z+=6)d[h++]=u,d[h++]=u+1,d[h++]=u+2,d[h+
+]=u+1,d[h++]=u+3,d[h++]=u+2,u+=4}}}),{"../../../../utils/utils":251}],271:
[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/bar-
filled"),s=t("../../utils").fillVerticesWithoutCalc3D,a=cc.vmath.vec3;e.exports=n.a
ddon({updateWorldVerts:function(t){for(var
e=t.node,i=t._renderData._data,n=e._worldMatrix,r=0;r<4;r++){var
s=i[r+4],o=i[r];a.transformMat4(o,s,n)}},fillBuffers:function(t,e)
{e.worldMatDirty&&this.updateWorldVerts(t);var
i=e._meshBuffer3D,n=t.node,r=s(n,i,t._renderData,n._color._val),a=i._iData,o=r.indi
ceOffset,l=r.vertexOffset;a[o++]=l,a[o++]=l+1,a[o++]=l+2,a[o++]=l+1,a[o++]=l+3,a[o+
+]=l+2}},r)}),{"../../../../../platform/js":220,"../../utils":278,"../2d/bar-
filled":265}],272:[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/mesh"),s=t("../../utils").fillVertices
WithoutCalc3D,a=cc.vmath.vec3,o=a.create();e.exports=n.addon({updateWorldVerts:func
tion(t){for(var
e=t.node,i=t._renderData,n=i._data,r=e._worldMatrix,s=0,l=i.vertexCount;s<l;s++)
{var
h=n[s+l],c=n[s];a.set(o,h.x,h.y,0),a.transformMat4(c,o,r)}},fillBuffers:function(t,
e){var i=t.spriteFrame.vertices;if(i)
{e.worldMatDirty&&this.updateWorldVerts(t);for(var
n=e._meshBuffer3D,r=t.node,a=s(r,n,t._renderData,r._color._val),o=n._iData,l=a.indi
ceOffset,h=a.vertexOffset,c=i.triangles,u=0,_=c.length;u<_;u++)o[l+
+]=h+c[u]}}},r)}),
{"../../../../../platform/js":220,"../../utils":278,"../2d/mesh":266}],273:
[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/radial-
filled"),s=t("../../utils").fillVertices3D;e.exports=n.addon({fillBuffers:function(
t,e){for(var
i=t.node,n=i._color._val,r=e._meshBuffer3D,a=t._renderData,o=s(i,r,a,n),l=o.indiceO
ffset,h=o.vertexOffset,c=r._iData,u=0;u<a.dataLength;u++)c[l+u]=h+u}},r)}),
{"../../../../../platform/js":220,"../../utils":278,"../2d/radial-
filled":267}],274:[(function(t,e,i){"use strict";var
n=t("../../../../../platform/js"),r=t("../2d/simple"),s=cc.vmath.vec3;e.exports=n.a
ddon({fillBuffers:(function(){for(var t=[],e=0;e<4;e++)t.push(s.create());return
function(e,i){var
n=e._renderData._data,r=e.node,a=r._color._val,o=r._worldMatrix,l=i._meshBuffer3D,h
=l.request(4,6),c=h.byteOffset>>2,u=h.indiceOffset,_=h.vertexOffset,f=l._vData,d=l.
_uintVData,m=l._iData,p=n[0],v=n[3];s.set(t[0],p.x,p.y,0),s.set(t[1],v.x,p.y,0),s.s
et(t[2],p.x,v.y,0),s.set(t[3],v.x,v.y,0);for(var y=e._spriteFrame.uv,g=0;g<4;g++)
{var x=t[g];s.transformMat4(x,x,o),f[c++]=x.x,f[c++]=x.y,f[c++]=x.z;var b=2*g;f[c+
+]=y[0+b],f[c++]=y[1+b],d[c++]=a}m[u++]=_,m[u++]=_+1,m[u++]=_+2,m[u++]=_+1,m[u+
+]=_+3,m[u++]=_+2}})()},r)}),
{"../../../../../platform/js":220,"../2d/simple":268}],275:[(function(t,e,i){"use
strict";var
n=t("../../../../../platform/js"),r=t("../2d/sliced"),s=cc.vmath.vec3,a=s.create();
e.exports=n.addon({fillBuffers:function(t,e)
{e.worldMatDirty&&this.updateWorldVerts(t);for(var
i=t._renderData,n=t.node._color._val,r=i._data,s=e._meshBuffer3D,a=i.vertexCount,o=
t.spriteFrame.uvSliced,l=s.request(a,i.indiceCount),h=l.byteOffset>>2,c=l.indiceOff
set,u=l.vertexOffset,_=s._vData,f=s._uintVData,d=s._iData,m=4;m<20;++m){var
p=r[m],v=o[m-4];_[h++]=p.x,_[h++]=p.y,_[h++]=p.z,_[h++]=v.u,_[h++]=v.v,f[h+
+]=n}for(var y=0;y<3;++y)for(var g=0;g<3;++g){var x=u+4*y+g;d[c++]=x,d[c+
+]=x+1,d[c++]=x+4,d[c++]=x+1,d[c++]=x+5,d[c++]=x+4}},updateWorldVerts:function(t)
{for(var e=t.node,i=t._renderData._data,n=e._worldMatrix,r=0;r<4;++r)for(var
o=i[r],l=0;l<4;++l){var
h=i[l],c=i[4+4*r+l];s.set(a,h.x,o.y,0),s.transformMat4(c,a,n)}}},r)}),
{"../../../../../platform/js":220,"../2d/sliced":269}],276:[(function(t,e,i){"use
strict";var
n=t("../../../../../platform/js"),r=t("../2d/tiled"),s=cc.vmath.vec3;e.exports=n.ad
don({vertexOffset:6,uvOffset:3,colorOffset:5,fillVertices:(function(){for(var
t=[],e=0;e<4;e++)t.push(s.create());return function(e,i,n,r,a,o){for(var l=void
0,h=void 0,c=void 0,u=void 0,_=0,f=r;_<f;++_){c=o[_].y,u=o[_+1].y;for(var
d=0,m=a;d<m;++d)
{l=o[d].x,h=o[d+1].x,s.set(t[0],l,c,0),s.set(t[1],h,c,0),s.set(t[2],l,u,0),s.set(t[
3],h,u,0);for(var p=0;p<4;p++){var v=t[p];s.transformMat4(v,v,n);var
y=6*p;e[i+y]=v.x,e[i+y+1]=v.y,e[i+y+2]=v.z}i+=24}}}})()},r)}),
{"../../../../../platform/js":220,"../2d/tiled":270}],277:[(function(t,e,i){"use
strict";var
n=t("../../../../components/CCSprite"),r=n.Type,s=n.FillType,a=t("./2d/simple"),o=t
("./2d/sliced"),l=t("./2d/tiled"),h=t("./2d/radial-filled"),c=t("./2d/bar-
filled"),u=t("./2d/mesh"),_=t("./3d/simple"),f=t("./3d/sliced"),d=t("./3d/tiled"),m
=t("./3d/radial-filled"),p=t("./3d/bar-
filled"),v=t("./3d/mesh"),y={getAssembler:function(t){var e=t.node.is3DNode,i=e?
_:a;switch(t.type){case r.SLICED:i=e?f:o;break;case r.TILED:i=e?d:l;break;case
r.FILLED:i=t._fillType===s.RADIAL?e?m:h:e?p:c;break;case r.MESH:i=e?v:u}return
i},updateRenderData:function(t){return
t.__allocedDatas}};n._assembler=y,e.exports=y}),
{"../../../../components/CCSprite":111,"./2d/bar-
filled":265,"./2d/mesh":266,"./2d/radial-
filled":267,"./2d/simple":268,"./2d/sliced":269,"./2d/tiled":270,"./3d/bar-
filled":271,"./3d/mesh":272,"./3d/radial-
filled":273,"./3d/simple":274,"./3d/sliced":275,"./3d/tiled":276}],278:
[(function(t,e,i){"use strict";var
n=cc.vmath.vec3,r=n.create();e.exports={fillVertices:function(t,e,i,n){for(var
r=i.vertexCount,s=e.request(r,i.indiceCount),a=s.byteOffset>>2,o=e._vData,l=e._uint
VData,h=t._worldMatrix,c=h.m00,u=h.m
01,_=h.m04,f=h.m05,d=h.m12,m=h.m13,p=i._data,v=0;v<r;v++){var y=p[v];o[a+
+]=y.x*c+y.y*_+d,o[a++]=y.x*u+y.y*f+m,o[a++]=y.u,o[a++]=y.v,l[a++]=n}return
s},fillMeshVertices:function(t,e,i,n){for(var
r=i.vertexCount,s=e.request(r,i.indiceCount),a=s.indiceOffset,o=s.byteOffset>>2,l=s
.vertexOffset,h=e._vData,c=e._uintVData,u=e._iData,_=t._worldMatrix,f=_.m00,d=_.m01
,m=_.m04,p=_.m05,v=_.m12,y=_.m13,g=i._data,x=0;x<r;x++){var b=g[x];h[o+
+]=b.x*f+b.y*m+v,h[o++]=b.x*d+b.y*p+y,h[o++]=b.u,h[o++]=b.v,c[o++]=n}for(var
A=0,C=r/4;A<C;A++){var S=l+4*A;u[a++]=S,u[a++]=S+1,u[a++]=S+2,u[a++]=S+1,u[a+
+]=S+3,u[a++]=S+2}return s},fillVertices3D:function(t,e,i,s){for(var
a=i.vertexCount,o=e.request(a,i.indiceCount),l=o.byteOffset>>2,h=e._vData,c=e._uint
VData,u=t._worldMatrix,_=i._data,f=0;f<a;f++){var
d=_[f];n.set(r,d.x,d.y,0),n.transformMat4(r,r,u),h[l++]=r.x,h[l++]=r.y,h[l+
+]=r.z,h[l++]=d.u,h[l++]=d.v,c[l++]=s}return
o},fillMeshVertices3D:function(t,e,i,s){for(var
a=i.vertexCount,o=e.request(a,i.indiceCount),l=o.indiceOffset,h=o.vertexOffset,c=o.
byteOffset>>2,u=e._vData,_=e._uintVData,f=e._iData,d=t._worldMatrix,m=i._data,p=0;p
<a;p++){var v=m[p];n.set(r,v.x,v.y,0),n.transformMat4(r,r,d),u[c++]=r.x,u[c+
+]=r.y,u[c++]=r.z,u[c++]=v.u,u[c++]=v.v,_[c++]=s}for(var y=0,g=a/4;y<g;y++){var
x=h+4*y;f[l++]=x,f[l++]=x+1,f[l++]=x+2,f[l++]=x+1,f[l++]=x+3,f[l++]=x+2}return
o},fillVerticesWithoutCalc:function(t,e,i,n){for(var
r=i.vertexCount,s=e.request(r,i.indiceCount),a=s.byteOffset>>2,o=e._vData,l=e._uint
VData,h=i._data,c=0;c<r;c++){var u=h[c];o[a++]=u.x,o[a++]=u.y,o[a++]=u.u,o[a+
+]=u.v,l[a++]=n}return s},fillVerticesWithoutCalc3D:function(t,e,i,n){for(var
r=i.vertexCount,s=e.request(r,i.indiceCount).byteOffset>>2,a=e._vData,o=e._uintVDat
a,l=i._data,h=0;h<r;h++){var c=l[h];a[s++]=c.x,a[s++]=c.y,a[s++]=c.z,a[s+
+]=c.u,a[s++]=c.v,o[s++]=n}}}}),{}],279:[(function(t,e,i){"use strict";var
n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../../renderer/gfx"));var
r=cc.Class({name:"cc.MeshBuffer",ctor:function(t,e)
{this.byteStart=0,this.byteOffset=0,this.indiceStart=0,this.indiceOffset=0,this.ver
texStart=0,this.vertexOffset=0,this._vertexFormat=e,this._vertexBytes=this._vertexF
ormat._bytes,this._arrOffset=0,this._vbArr=[],this._vb=new
n.default.VertexBuffer(t._device,e,n.default.USAGE_DYNAMIC,new
ArrayBuffer,0),this._vbArr[0]=this._vb,this._ibArr=[],this._ib=new
n.default.IndexBuffer(t._device,n.default.INDEX_FMT_UINT16,n.default.USAGE_STATIC,n
ew
ArrayBuffer,0),this._ibArr[0]=this._ib,this._vData=null,this._uintVData=null,this._
iData=null,this._batcher=t,this._initVDataCount=256*e._bytes,this._initIDataCount=1
536,this._offsetInfo={byteOffset:0,vertexOffset:0,indiceOffset:0},this._reallocBuff
er()},uploadData:function(){if(0!==this.byteOffset&&this._dirty){var t=new
Float32Array(this._vData.buffer,0,this.byteOffset>>2),e=new
Uint16Array(this._iData.buffer,0,this.indiceOffset);this._vb.update(0,t),this._ib.u
pdate(0,e),this._dirty=!1}},switchBuffer:function(){var t=+
+this._arrOffset;this.byteStart=0,this.byteOffset=0,this.vertexStart=0,this.vertexO
ffset=0,this.indiceStart=0,this.indiceOffset=0,t<this._vbArr.length?
(this._vb=this._vbArr[t],this._ib=this._ibArr[t]):(this._vb=new
n.default.VertexBuffer(this._batcher._device,this._vertexFormat,n.default.USAGE_DYN
AMIC,new
ArrayBuffer,0),this._vbArr[t]=this._vb,this._vb._bytes=this._vData.byteLength,this.
_ib=new
n.default.IndexBuffer(this._batcher._device,n.default.INDEX_FMT_UINT16,n.default.US
AGE_STATIC,new
ArrayBuffer,0),this._ibArr[t]=this._ib,this._ib._bytes=this._iData.byteLength)},che
ckAndSwitchBuffer:function(t)
{this.vertexOffset+t>65535&&(this.uploadData(),this._batcher._flush(),this.switchBu
ffer())},requestStatic:function(t,e){this.checkAndSwitchBuffer(t);var
i=this.byteOffset+t*this._vertexBytes,n=this.indiceOffset+e,r=this._vData.byteLengt
h,s=this._iData.length;if(i>r||n>s){for(;r<i||
s<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,s=thi
s._initIDataCount;this._reallocBuffer()}var
a=this._offsetInfo;a.vertexOffset=this.vertexOffset,this.vertexOffset+=t,a.indiceOf
fset=this.indiceOffset,this.indiceOffset+=e,a.byteOffset=this.byteOffset,this.byteO
ffset=i,this._dirty=!0},request:function(t,e){return this._batcher._buffer!
==this&&(this._batcher._flush(),this._batcher._buffer=this),this.requestStatic(t,e)
,this._offsetInfo},_reallocBuffer:function(){this._reallocVData(!
0),this._reallocIData(!0)},_reallocVData:function(t){var e=void
0;this._vData&&(e=new Uint8Array(this._vData.buffer)),this._vData=new
Float32Array(this._initVDataCount),this._uintVData=new
Uint32Array(this._vData.buffer);var i=new
Uint8Array(this._uintVData.buffer);if(e&&t)for(var n=0,r=e.length;n<r;n+
+)i[n]=e[n];this._vb._bytes=this._vData.byteLength},_reallocIData:function(t){var
e=this._iData;if(this._iData=new Uint16Array(this._initIDataCount),e&&t)for(var
i=this._iData,n=0,r=e.length;n<r;n+
+)i[n]=e[n];this._ib._bytes=this._iData.byteLength},reset:function()
{this._arrOffset=0,this._vb=this._vbArr[0],this._ib=this._ibArr[0],this.byteStart=0
,this.byteOffset=0,this.indiceStart=0,this.indiceOffset=0,this.vertexStart=0,this.v
ertexOffset=0,this._dirty=!1},destroy:function(){for(var
t=0;t<this._vbArr.length;t++){this._vbArr[t].destroy()}this._vbArr=null;for(var
e=0;e<this._ibArr.length;e++)
{this._ibArr[e].destroy()}this._ibArr=null,this._ib=null,this._vb=null}});cc.MeshBu
ffer=e.exports=r}),{"../../../renderer/gfx":348}],280:[(function(t,e,i){"use
strict";var n=a(t("../../../renderer/core/input-
assembler")),r=a(t("../../../renderer/memop/recycle-
pool")),s=a(t("../../../renderer/scene/model"));function a(t){return
t&&t.__esModule?t:{default:t}}var o=t("./vertex-
format"),l=o.vfmtPosUvColor,h=o.vfmt3D,c=t("./quad-buffer"),u=t("./mesh-
buffer"),_=t("./spine-
buffer"),f=t("../../assets/material/CCMaterial"),d=new(t("../../platform/id-
generater"))("VertextFormat"),m={},p=new f,v=new n.default;v._count=0;var
y=function(t,e){this._renderScene=e,this._device=t,this.walking=!
1,this.material=p,this.cullingMask=1,this._iaPool=new r.default(function(){return
new n.default},16),this._modelPool=new r.default(function(){return new
s.default},16),this._quadBuffer=this.getBuffer("quad",l),this._meshBuffer=this.getB
uffer("mesh",l),this._quadBuffer3D=this.getBuffer("quad",h),this._meshBuffer3D=this
.getBuffer("mesh",h),this._buffer=this._quadBuffer,this._batchedModels=[],this._dum
myNode=new
cc.Node,this._sortKey=0,this.node=this._dummyNode,this.parentOpacity=1,this.parentO
pacityDirty=0,this.worldMatDirty=0,this.customProperties=null};y.prototype={constru
ctor:y,reset:function(){this._iaPool.reset();for(var
t=this._renderScene,e=this._batchedModels,i=0;i<e.length;+
+i)e[i].setInputAssembler(null),e[i].setEffect(null),t.removeModel(e[i]);for(var n
in
this._modelPool.reset(),e.length=0,this._sortKey=0,m)m[n].reset();this._buffer=this
._quadBuffer,this.node=this._dummyNode,this.material=p,this.cullingMask=1,this.pare
ntOpacity=1,this.parentOpacityDirty=0,this.worldMatDirty=0,this.customProperties=nu
ll},_flushMaterial:function(t){this.material=t;var e=t.effect;if(e){var
i=this._modelPool.add();this._batchedModels.push(i),i.sortKey=this._sortKey+
+,i._cullingMask=this.cullingMask,i.setNode(this.node),i.setEffect(e,null),i.setInp
utAssembler(v),this._renderScene.addModel(i)}},_flush:function(){var
t=this.material,e=this._buffer,i=e.indiceStart,n=e.indiceOffset-
i;if(this.walking&&t&&!(n<=0)){var r=t.effect;if(r){var
s=this._iaPool.add();s._vertexBuffer=e._vb,s._indexBuffer=e._ib,s._start=i,s._count
=n;var a=this._modelPool.add();this._batchedModels.push(a),a.sortKey=this._sortKey+
+,a._cullingMask=this.cullingMask,a.setNode(this.node),a.setEffect(r,this.customPro
perties),a.setInputAssembler(s),this._renderScene.addModel(a),e.byteStart=e.byteOff
set,e.indiceStart=e.indiceOffset,e.vertexStart=e.vertexOffset}}},_flushIA:function(
t){var e=t.material;if(t.ia&&e){this.material=e;var i=e.effect;if(i){var
n=this._modelPool.add();this._batchedModels.push(n),n.sortKey=this._sortKey+
+,n._cullingMask=this.cullingMask,n.setNode(this.node),n.setEffect(i,this.customPro
perties),n.setInputAssembler(t.ia),this._renderScene.addModel(n)}}},_commitComp:fun
ction(t,e,i){var n=t.sharedMaterials[0];(n&&n.getHash()!==this.material.getHash()||
this.cullingMask!==i)&&(this._flush(),this.node=n.getDefine("_USE_MODEL")?
t.node:this._dummyNode,this.material=n,this.cullingMask=i),e.fillBuffers(t,this)},_
commitIA:function(t,e,i)
{this._flush(),this.cullingMask=i,this.material=t.sharedMaterials[0]||
p,this.node=this.material.getDefine("_USE_MODEL")?
t.node:this._dummyNode,e.renderIA(t,this)},terminate:function(){for(var t in
cc.dynamicAtlasManager&&cc.dynamicAtlasManager.enabled&&cc.dynamicAtlasManager.upda
te(),this._flush(),m)m[t].uploadData()},getBuffer:function(t,e){e.name||
(e.name=d.getNewId());var i=t+e.name,n=m[i];if(!n){if("mesh"===t)n=new
u(this,e);else if("quad"===t)n=new c(this,e);else{if("spine"!==t)return
cc.error("Not support buffer type ["+t+"]"),null;n=new _(this,e)}m[i]=n}return
n}},e.exports=y}),{"../../../renderer/core/input-
assembler":338,"../../../renderer/memop/recycle-
pool":363,"../../../renderer/scene/model":372,"../../assets/material/CCMaterial":75
,"../../platform/id-generater":216,"./mesh-buffer":279,"./quad-
buffer":281,"./spine-buffer":282,"./vertex-format":283}],281:[(function(t,e,i){"use
strict";var n=t("./mesh-
buffer"),r=cc.Class({name:"cc.QuadBuffer",extends:n,_fillQuadBuffer:function()
{for(var t=this._initIDataCount/6,e=this._iData,i=0,n=0;i<t;i++){var r=4*i;e[n+
+]=r,e[n++]=r+1,e[n++]=r+2,e[n++]=r+1,e[n++]=r+3,e[n++]=r+2}var s=new
Uint16Array(this._iData.buffer,0,6*t);this._ib.update(0,s)},uploadData:function()
{if(0!==this.byteOffset&&this._dirty){var t=new
Float32Array(this._vData.buffer,0,this.byteOffset>>2);this._vb.update(0,t),this._di
rty=!1}},switchBuffer:function(){if(this._super(),this.indiceOffset>0){var t=new
Uint16Array(this._iData.buffer,0,this.indiceOffset);this._ib.update(0,t)}},_realloc
Buffer:function(){this._reallocVData(!0),this._reallocIDa
ta(),this._fillQuadBuffer()}});cc.QuadBuffer=e.exports=r}),{"./mesh-
buffer":279}],282:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.SpineBuffer",extends:t("./mesh-
buffer"),requestStatic:function(t,e){this.checkAndSwitchBuffer(t);var
i=this.byteOffset+t*this._vertexBytes,n=this.indiceOffset+e,r=this._vData.byteLengt
h,s=this._iData.length;if(i>r||n>s){for(;r<i||
s<n;)this._initVDataCount*=2,this._initIDataCount*=2,r=4*this._initVDataCount,s=thi
s._initIDataCount;this._reallocBuffer()}var
a=this._offsetInfo;a.vertexOffset=this.vertexOffset,a.indiceOffset=this.indiceOffse
t,a.byteOffset=this.byteOffset},adjust:function(t,e)
{this.vertexOffset+=t,this.indiceOffset+=e,this.byteOffset=this.byteOffset+t*this._
vertexBytes,this._dirty=!0}});cc.SpineBuffer=e.exports=n}),{"./mesh-
buffer":279}],283:[(function(t,e,i){"use strict";var n=(function(t){return
t&&t.__esModule?t:{default:t}})(t("../../../renderer/gfx"));var r=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:3},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},
{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!
0}]);r.name="vfmt3D",n.default.VertexFormat.XYZ_UV_Color=r;var s=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:2},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},
{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!
0}]);s.name="vfmtPosUvColor",n.default.VertexFormat.XY_UV_Color=s;var a=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:2},{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2},
{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!0},
{name:n.default.ATTR_COLOR0,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!
0}]);a.name="vfmtPosUvTwoColor",n.default.VertexFormat.XY_UV_Two_Color=a;var o=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:2},
{name:n.default.ATTR_UV0,type:n.default.ATTR_TYPE_FLOAT32,num:2}]);o.name="vfmtPosU
v",n.default.VertexFormat.XY_UV=o;var l=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:2},
{name:n.default.ATTR_COLOR,type:n.default.ATTR_TYPE_UINT8,num:4,normalize:!
0}]);l.name="vfmtPosColor",n.default.VertexFormat.XY_Color=l;var h=new
n.default.VertexFormat([{name:n.default.ATTR_POSITION,type:n.default.ATTR_TYPE_FLOA
T32,num:2}]);h.name="vfmtPos",n.default.VertexFormat.XY=h,e.exports={vfmt3D:r,vfmtP
osUvColor:s,vfmtPosUvTwoColor:a,vfmtPosUv:o,vfmtPosColor:l,vfmtPos:h}}),
{"../../../renderer/gfx":348}],284:[(function(t,e,i){"use
strict";t("../platform/CCSys");var n=/(\.[^\.\/\?\\]*)(\?.*)?$/,r=/((.*)
(\/|\\|\\\\))?(.*?\..*$)?/,s=/[^\.\/]+\/\.\.\//;cc.path={join:function(){for(var
t=arguments.length,e="",i=0;i<t;i++)e=(e+(""===e?"":"/")+arguments[i]).replace(/
(\/|\\\\)$/,"");return e},extname:function(t){var e=n.exec(t);return e?
e[1]:""},mainFileName:function(t){if(t){var e=t.lastIndexOf(".");if(-1!==e)return
t.substring(0,e)}return t},basename:function(t,e){var
i=t.indexOf("?");i>0&&(t=t.substring(0,i));var n=/(\/|\\)([^\/\\]+)
$/g.exec(t.replace(/(\/|\\)$/,""));if(!n)return null;var r=n[2];return
e&&t.substring(t.length-e.length).toLowerCase()===e.toLowerCase()?
r.substring(0,r.length-e.length):r},dirname:function(t){var e=r.exec(t);return e?
e[2]:""},changeExtname:function(t,e){e=e||"";var i=t.indexOf("?"),n="";return
i>0&&(n=t.substring(i),t=t.substring(0,i)),(i=t.lastIndexOf("."))<0?
t+e+n:t.substring(0,i)+e+n},changeBasename:function(t,e,i)
{if(0===e.indexOf("."))return this.changeExtname(t,e);var
n=t.indexOf("?"),r="",s=i?this.extname(t):"";return
n>0&&(r=t.substring(n),t=t.substring(0,n)),n=(n=t.lastIndexOf("/"))<=0?
0:n+1,t.substring(0,n)+e+s+r},_normalize:function(t){var
e=t=String(t);do{e=t,t=t.replace(s,"")}while(e.length!==t.length);return
t},sep:cc.sys.os===cc.sys.OS_WINDOWS?"\\":"/",stripSep:function(t){return
t.replace(/[\/\\]$/,"")}},e.exports=cc.path}),{"../platform/CCSys":209}],285:
[(function(t,e,i){"use strict";var n=function(t,e,i,n,r,s)
{this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s};n.create=function(t,e,i,n
,r,s){return{a:t,b:e,c:i,d:n,tx:r,ty:s}},n.identity=function()
{return{a:1,b:0,c:0,d:1,tx:0,ty:0}},n.clone=function(t)
{return{a:t.a,b:t.b,c:t.c,d:t.d,tx:t.tx,ty:t.ty}},n.concat=function(t,e,i){var
n=e.a,r=e.b,s=e.c,a=e.d,o=e.tx,l=e.ty;return
t.a=n*i.a+r*i.c,t.b=n*i.b+r*i.d,t.c=s*i.a+a*i.c,t.d=s*i.b+a*i.d,t.tx=o*i.a+l*i.c+i.
tx,t.ty=o*i.b+l*i.d+i.ty,t},n.invert=function(t,e){var i=e.a,n=e.b,r=e.c,s=e.d,a=1/
(i*s-n*r),o=e.tx,l=e.ty;return t.a=a*s,t.b=-a*n,t.c=-a*r,t.d=a*i,t.tx=a*(r*l-
s*o),t.ty=a*(n*o-i*l),t},n.fromMat4=function(t,e){return
t.a=e.m00,t.b=e.m01,t.c=e.m04,t.d=e.m05,t.tx=e.m12,t.ty=e.m13,t},n.transformVec2=fu
nction(t,e,i,n){var r,s;return void 0===n?(n=i,r=e.x,s=e.y):
(r=e,s=i),t.x=n.a*r+n.c*s+n.tx,t.y=n.b*r+n.d*s+n.ty,t},n.transformSize=function(t,e
,i){return
t.width=i.a*e.width+i.c*e.height,t.height=i.b*e.width+i.d*e.height,t},n.transformRe
ct=function(t,e,i){var
n=e.x,r=e.y,s=n+e.width,a=r+e.height,o=i.a*n+i.c*r+i.tx,l=i.b*n+i.d*r+i.ty,h=i.a*s+
i.c*r+i.tx,c=i.b*s+i.d*r+i.ty,u=i.a*n+i.c*a+i.tx,_=i.b*n+i.d*a+i.ty,f=i.a*s+i.c*a+i
.tx,d=i.b*s+i.d*a+i.ty,m=Math.min(o,h,u,f),p=Math.max(o,h,u,f),v=Math.min(l,c,_,d),
y=Math.max(l,c,_,d);return t.x=m,t.y=v,t.width=p-m,t.height=y-
v,t},n.transformObb=function(t,e,i,n,r,s){var
a=r.x,o=r.y,l=r.width,h=r.height,c=s.a*a+s.c*o+s.tx,u=s.b*a+s.d*o+s.ty,_=s.a*l,f=s.
b*l,d=s.c*h,m=s.d*h;e.x=c,e.y=u,i.x=_+c,i.y=f+u,t.x=d+c,t.y=m+u,n.x=_+d+c,n.y=f+m+u
},cc.AffineTransform=e.exports=n}),{}],286:[(function(t,e,i){"use strict";var
n=t("../platform/CCObject").Flags,r=t("./misc"),s=t("../platform/js"),a=t("../platf
orm/id-generater"),o=t("../event-manager"),l=t("../renderer/render-
flow"),h=n.Destroying,c=n.DontDestroy,u=n.Deactivating,_=new a("Node");function
f(t){return t?"string"==typeof t?s.getClassByName(t):t:
(cc.errorID(3804),null)}function d(t,e){if(e._sealed)for(var
i=0;i<t._components.length;++i){var n=t._components[i];if(n.constructor===e)return
n}else for(var r=0;r<t._components.length;++r){var s=t._components[r];if(s
instanceof e)return s}return null}function m(t,e,i){if(e._sealed)for(var
n=0;n<t._components.length;++n){var
r=t._components[n];r.constructor===e&&i.push(r)}else for(var
s=0;s<t._components.length;++s){var a=t._components[s];a instanceof
e&&i.push(a)}}function p(t,e){for(var i=0;i<t.length;++i){var
n=t[i],r=d(n,e);if(r)return r;if(n._children.length>0&&(r=p(n._children,e)))return
r}return null}function v(t,e,i){for(var n=0;n<t.length;++n){var
r=t[n];m(r,e,i),r._children.length>0&&v(r._children,e,i)}}var
y=cc.Class({name:"cc._BaseNode",extends:cc.Object,properties:
{_parent:null,_children:[],_active:!0,_level:0,_components:
[],_prefab:null,_persistNode:{get:function()
{return(this._objFlags&c)>0},set:function(t){t?this._objFlags|
=c:this._objFlags&=~c}},name:{get:function(){return this._name},set:function(t)
{this._name=t}},uuid:{get:function(){return this._id}},children:{get:function()
{return this._children}},childrenCount:{get:function(){return
this._children.length}},active:{get:function(){return this._active},set:function(t)
{if(t=!!t,this._active!==t){this._active=t;var
e=this._parent;if(e)e._activeInHierarchy&&cc.director._nodeActivator.activateNode(t
his,t)}}},activeInHierarchy:{get:function(){return
this._activeInHierarchy}}},ctor:function(t){this._name=void 0!==t?t:"New
Node",this._activeInHierarchy=!
1,this._id=_.getNewId(),cc.director._scheduler&&cc.director._scheduler.enableForTar
get(this),this.__eventTargets=[],this._renderFlag=l.FLAG_TRANSFORM},getParent:funct
ion(){return this._parent},setParent:function(t){if(this._parent!==t){0;var
e=this._parent;if(this._parent=t||
null,this._onSetParent(t),t&&(this._level=t._level+1,o._setDirtyForNode(this),t._ch
ildren.push(this),t.emit&&t.emit("child-added",this),t._renderFlag|
=l.FLAG_CHILDREN),e){if(!(e._objFlags&h)){var
i=e._children.indexOf(this);0,e._children.splice(i,1),e.emit&&e.emit("child-
removed",this),this._onHierarchyChanged(e),0===e._children.length&&(e._renderFlag&=
~l.FLAG_CHILDREN)}}else t&&this._onHierarchyChanged(null)}},attr:function(t)
{s.mixin(this,t)},getChildByUuid:function(t){if(!t)return cc.log("Invalid
uuid"),null;for(var e=this._children,i=0,n=e.length;i<n;i++)if(e[i]._id===t)return
e[i];return null},getChildByName:function(t){if(!t)return cc.log("Invalid
name"),null;for(var e=this._children,i=0,n=e.length;i<n;i+
+)if(e[i]._name===t)return e[i];return null},addChild:function(t)
{cc.assertID(t,1606),cc.assertID(null===t._parent,1605),t.setParent(this)},insertCh
ild:function(t,e){t.parent=this,t.setSiblingIndex(e)},getSiblingIndex:function()
{return this._parent?
this._parent._children.indexOf(this):0},setSiblingIndex:function(t)
{if(this._parent)if(this._parent._objFlags&u)cc.errorID(3821);else{var
e=this._parent._children;t=-1!==t?t:e.length-1;var i=e.indexOf(this);t!
==i&&(e.splice(i,1),t<e.length?
e.splice(t,0,this):e.push(this),this._onSiblingIndexChanged&&this._onSiblingIndexCh
anged(t))}},walk:function(t,e){var
i,n,r,s,a=cc._BaseNode,o=1,l=a._stacks[a._stackId];l||
(l=[],a._stacks.push(l)),a._stackId++,l.length=0,l[0]=this;var h=null;for(s=!
1;o;)if(n=l[--o])if(!s&&t?t(n):s&&e&&e(n),l[o]=null,s){if(s=!1,i)if(i[+
+r])l[o]=i[r],o++;else if(h&&(l[o]=h,o++,s=!0,h._parent?
(r=(i=h._parent._children).indexOf(h),h=h._parent):(h=null,i=null),r<0))break}else
n._children.length>0?(h=n,i=n._children,r=0,l[o]=i[r],o++):(l[o]=n,o++,s=!
0);l.length=0,a._stackId--},cleanup:function(){},removeFromParent:function(t)
{this._parent&&(void 0===t&&(t=!
0),this._parent.removeChild(this,t))},removeChild:function(t,e)
{this._children.indexOf(t)>-1&&((e||void
0===e)&&t.cleanup(),t.parent=null)},removeAllChildren:function(t){var
e=this._children;void 0===t&&(t=!0);for(var i=e.length-1;i>=0;i--){var

n=e[i];n&&(t&&n.cleanup(),n.parent=null)}this._children.length=0},isChildOf:functio
n(t){var e=this;do{if(e===t)return!0;e=e._parent}while(e);return!
1},getComponent:function(t){var e=f(t);return e?
d(this,e):null},getComponents:function(t){var e=f(t),i=[];return
e&&m(this,e,i),i},getComponentInChildren:function(t){var e=f(t);return e?
p(this._children,e):null},getComponentsInChildren:function(t){var
e=f(t),i=[];return e&&(m(this,e,i),v(this._children,e,i)),i},_checkMultipleComp:!
1,addComponent:function(t){var e;if("string"==typeof t){if(!
(e=s.getClassByName(t)))return
cc.errorID(3807,t),cc._RFpeek()&&cc.errorID(3808,t),null}else{if(!t)return
cc.errorID(3804),null;e=t}if("function"!=typeof e)return cc.errorID(3809),null;if(!
s.isChildClassOf(e,cc.Component))return cc.errorID(3810),null;var
i=e._requireComponent;if(i&&!this.getComponent(i)&&!this.addComponent(i))return
null;var n=new e;return
n.node=this,this._components.push(n),this._activeInHierarchy&&cc.director._nodeActi
vator.activateComp(n),n},_addComponentAt:!1,removeComponent:function(t){t?(t
instanceof cc.Component||
(t=this.getComponent(t)),t&&t.destroy()):cc.errorID(3813)},_getDependComponent:!
1,_removeComponent:function(t){if(t){if(!(this._objFlags&h)){var
e=this._components.indexOf(t);-1!==e?this._components.splice(e,1):t.node!
==this&&cc.errorID(3815)}}else cc.errorID(3814)},destroy:function()
{cc.Object.prototype.destroy.call(this)&&(this.active=!
1)},destroyAllChildren:function(){for(var t=this._children,e=0;e<t.length;+
+e)t[e].destroy()},_onSetParent:function(t){},_onPostActivated:function()
{},_onBatchRestored:function(){},_onBatchCreated:function()
{},_onHierarchyChanged:function(t){var e=this._parent;!this._persistNode||e
instanceof cc.Scene||cc.game.removePersistRootNode(this);var i=this._active&&!(!
e||!e._activeInHierarchy);this._activeInHierarchy!
==i&&cc.director._nodeActivator.activateNode(this,i)},_instantiate:function(t){t||
(t=cc.instantiate._clone(this,this));var
e=this._prefab;e&&this===e.root&&e.sync;return
t._parent=null,t._onBatchRestored(),t},_registerIfAttached:!
1,_onPreDestroy:function(){var t,e;this._objFlags|=h;var
i=this._parent,n=i&&i._objFlags&h;var r=this._children;for(t=0,e=r.length;t<e;+
+t)r[t]._destroyImmediate();for(t=0,e=this._components.length;t<e;++t)
{this._components[t]._destroyImmediate()}var
s=this.__eventTargets;for(t=0,e=s.length;t<e;++t){var
a=s[t];a&&a.targetOff(this)}if(s.length=0,this._persistNode&&cc.game.removePersistR
ootNode(this),!n&&i){var
o=i._children.indexOf(this);i._children.splice(o,1),i.emit&&i.emit("child-
removed",this)}return n},onRestore:!
1});y.idGenerater=_,y._stacks=[[]],y._stackId=0,y.prototype._onPreDestroyBase=y.pro
totype._onPreDestroy,y.prototype._onHierarchyChangedBase=y.prototype._onHierarchyCh
anged;r.propertyDefine(y,["parent","name","children","childrenCount"],
{}),cc._BaseNode=e.exports=y}),{"../event-
manager":130,"../platform/CCObject":206,"../platform/id-
generater":216,"../platform/js":220,"../renderer/render-
flow":244,"./misc":295}],287:[(function(t,e,i){"use strict";var n=1e-
6;e.exports={binarySearchEpsilon:function(t,e){for(var i=0,r=t.length-
1,s=r>>>1;i<=r;s=i+r>>>1){var a=t[s];if(a>e+n)r=s-1;else{if(!(a<e-n))return
s;i=s+1}}return~i}}}),{}],288:[(function(t,e,i){"use strict";var
n=t("../components/CCRenderComponent"),r=t("../platform/CCMacro").BlendFactor,s=t("
../../renderer/gfx"),a=cc.Class({properties:
{_srcBlendFactor:r.SRC_ALPHA,_dstBlendFactor:r.ONE_MINUS_SRC_ALPHA,srcBlendFactor:
{get:function(){return this._srcBlendFactor},set:function(t){this._srcBlendFactor!
==t&&(this._srcBlendFactor=t,this._updateBlendFunc())},animatable:!
1,type:r,tooltip:!1,visible:!0},dstBlendFactor:{get:function(){return
this._dstBlendFactor},set:function(t){this._dstBlendFactor!
==t&&(this._dstBlendFactor=t,this._updateBlendFunc())},animatable:!
1,type:r,tooltip:!1,visible:!0}},setMaterial:function(t,e)
{n.prototype.setMaterial.call(this,t,e),e&&this._updateMaterialBlendFunc(e)},_updat
eBlendFunc:function(){for(var t=this._materials,e=0;e<t.length;e++){var
i=t[e];this._updateMaterialBlendFunc(i)}},_updateMaterialBlendFunc:function(t)
{for(var e=t._effect.getDefaultTechnique().passes,i=0;i<e.length;i++)
{e[i].setBlend(!
0,s.BLEND_FUNC_ADD,this._srcBlendFactor,this._dstBlendFactor,s.BLEND_FUNC_ADD,this.
_srcBlendFactor,this._dstBlendFactor)}t.setDirty(!0)}});e.exports=a}),
{"../../renderer/gfx":348,"../components/CCRenderComponent":106,"../platform/CCMacr
o":205}],289:[(function(t,e,i){"use strict";var
n=t("./misc").BASE64_VALUES,r="0123456789abcdef".split(""),s=["","","",""],a=s.conc
at(s,"-",s,"-",s,"-",s,"-",s,s,s),o=a.map((function(t,e){return"-"===t?
NaN:e})).filter(isFinite);e.exports=function(t){if(22!==t.length)return
t;a[0]=t[0],a[1]=t[1];for(var e=2,i=2;e<22;e+=2){var
s=n[t.charCodeAt(e)],l=n[t.charCodeAt(e+1)];a[o[i++]]=r[s>>2],a[o[i++]]=r[(3&s)<<2|
l>>4],a[o[i++]]=r[15&l]}return a.join("")}}),{"./misc":295}],290:[(function(t,e,i)
{"use strict";cc.find=e.exports=function(t,e){if(null==t)return
cc.errorID(5600),null;if(e)0;else{var i=cc.director.getScene();if(!i)return
null;e=i}for(var n=e,r="/"!==t[0]?0:1,s=t.split("/"),a=r;a<s.length;a++){var
o=s[a],l=n._children;n=null;for(var h=0,c=l.length;h<c;++h){var
u=l[h];if(u.name===o){n=u;break}}if(!n)return null}return n}}),{}],291:
[(function(t,e,i){"use strict";var n=t("../assets/material/CCMaterial");function
r()
{this._graySpriteMaterial=null,this._spriteMaterial=null}r.prototype._switchGrayMat
erial=function(t,e){var i=void 0;t?((i=this._graySpriteMaterial)||
(i=n.getBuiltinMaterial("gray-
sprite")),i=this._graySpriteMaterial=n.getInstantiatedMaterial(i,e)):
((i=this._spriteMaterial)||(i=n.getBuiltinMaterial("sprite",e)),
(i=this._spriteMaterial=n.getInstantiatedMaterial(i,e)).define("USE_TEXTURE",!
0)),e.setMaterial(0,i)},e.exports=r}),{"../assets/material/CCMaterial":75}],292:
[(function(t,e,i){"use strict";var
n=/^(click)(\s)*=|(param)(\s)*=/,r=/(\s)*src(\s)*=|(\s)*height(\s)*=|
(\s)*width(\s)*=|(\s)*click(\s)*=|(\s)*param(\s)*=/,s=function()
{this._parsedObject={},this._specialSymbolArray=[],this._specialSymbolArray.push([/
&lt;/g,"<"]),this._specialSymbolArray.push([/&gt;/g,">"]),this._specialSymbolArray.
push([/&amp;/g,"&"]),this._specialSymbolArray.push([/&quot;/g,'"']),this._specialSy
mbolArray.push([/&apos;/g,"'"])};s.prototype={constructor:s,parse:function(t)
{this._resultObjectArray=[],this._stack=[];for(var e=0,i=t.length;e<i;){var
n=t.indexOf("<",e);if(n<0)this._stack.pop(),this._processResult(t.substring(e)),e=i
;else{this._processResult(t.substring(e,n));var r=t.indexOf(">",e);-1===r?
r=n:"/"===t.charAt(n+1)?
this._stack.pop():this._addToStack(t.substring(n+1,r)),e=r+1}}return
this._resultObjectArray},_attributeToObject:function(t){var
e,i,n,s,a={},o=(t=t.trim()).match(/^(color|size)(\s)*=/);if(o)
{if(e=o[0],""===(t=t.substring(e.length).trim()))return a;switch(i=t.indexOf("
"),e[0]){case"c":a.color=i>-1?
t.substring(0,i).trim():t;break;case"s":a.size=parseInt(t)}return i>-
1&&(s=t.substring(i+1).trim(),n=this._processEventHandler(s),a.event=n),a}if((o=t.m
atch(/^(br(\s)*\/)/))&&o[0].length>0&&(e=o[0].trim()).startsWith("br")&&"/"===e[e.l
ength-1])return a.isNewLine=!0,this._resultObjectArray.push({text:"",style:
{newline:!0}}),a;if((o=t.match(/^(img(\s)*src(\s)*=[^>]
+\/)/))&&o[0].length>0&&(e=o[0].trim()).startsWith("img")&&"/"===e[e.length-1]){var
l;o=t.match(r);for(var h=!
1;o;)e=(t=t.substring(t.indexOf(o[0]))).substr(0,o[0].length),u=(i=(l=t.substring(e
.length).trim()).indexOf(" "))>-1?l.substr(0,i):l,e=(e=e.replace(/[^a-zA-
Z]/g,"").trim()).toLocaleLowerCase(),t=l.substring(i).trim(),"src"===e?(a.isImage=!
0,u.endsWith("/")&&(u=u.substring(0,u.length-1)),0===u.indexOf("'")?(h=!
0,u=u.substring(1,u.length-1)):0===u.indexOf('"')&&(h=!0,u=u.substring(1,u.length-
1)),a.src=u):"height"===e?a.imageHeight=parseInt(u):"width"===e?
a.imageWidth=parseInt(u):"click"===e&&(a.event=this._processEventHandler(e+"="+u)),
a.event&&"param"===e&&(a.event.param=u.replace(/^\"|\"$/g,"")),o=t.match(r);return
h&&a.isImage&&this._resultObjectArray.push({text:"",style:a}),
{}}if(o=t.match(/^(outline(\s)*[^>]*)/)){var
c={color:"#ffffff",width:1};if(t=o[0].substring("outline".length).trim()){var u,_=/
(\s)*color(\s)*=|(\s)*width(\s)*=|(\s)*click(\s)*=|
(\s)*param(\s)*=/;for(o=t.match(_);o;)e=(t=t.substring(t.indexOf(o[0]))).substr(0,o
[0].length),u=(i=(l=t.substring(e.length).trim()).indexOf(" "))>-1?
l.substr(0,i):l,e=(e=e.replace(/[^a-zA-
Z]/g,"").trim()).toLocaleLowerCase(),t=l.substring(i).trim(),"click"===e?
a.event=this._processEventHandler(e+"="+u):"color"===e?
c.color=u:"width"===e&&(c.width=parseInt(u)),a.event&&"param"===e&&(a.event.param=u
.replace(/^\"|\"$/g,"")),o=t.match(_)}a.outline=c}if((o=t.match(/^(on|u|b|i)
(\s)*/))&&o[0].length>0){switch(e=o[0],t=t.substring(e.length).trim(),e[0])
{case"u":a.underline=!0;break;case"i":a.italic=!0;break;case"b":a.bold=!
0}if(""===t)return a;n=this._processEventHandler(t),a.event=n}return
a},_processEventHandler:function(t){for(var e=0,i={},r=t.match(n),s=!1;r;){var
a=r[0],o="";if(s=!1,'"'===(t=t.substring(a.length).trim()).charAt(0))
(e=t.indexOf('"',1))>-1&&(o=t.substring(1,e).trim(),s=!0),e++;else
if("'"===t.charAt(0))(e=t.indexOf("'",1))>-1&&(o=t.substring(1,e).trim(),s=!0),e+
+;else{var l=t.match(/(\S)+/);e=(o=l?
l[0]:"").length}s&&(i[a=a.substring(0,a.length-
1).trim()]=o),r=(t=t.substring(e).trim()).match(n)}return
i},_addToStack:function(t){var
e=this._attributeToObject(t);if(0===this._stack.length)this._stack.push(e);else{if(
e.isNewLine||e.isImage)return;var i=this._stack[this._stack.length-1];for(var n in
i)e[n]||(e[n]=i[n]);this._stack.push(e)}},_processResult:function(t){""!
==t&&(t=this._escapeSpecialSymbol(t),this._stack.length>0?
this._resultObjectArray.push({text:t,style:this._stack[this._stack.length-
1]}):this._resultObjectArray.push({text:t}))},_escapeSpecialSymbol:function(t)
{for(var e=0;e<this._specialSymbolArray.length;++e){var
i=this._specialSymbolArray[e][0],n=this._specialSymbolArray[e]
[1];t=t.replace(i,n)}return
t}},e.exports=s}),{}],293:[(function(t,e,i){"use
strict";t("./CCPath"),t("./profiler/CCProfiler"),t("./find"),t("./mutable-forward-
iterator")}),{"./CCPath":284,"./find":290,"./mutable-forward-
iterator":296,"./profiler/CCProfiler":298}],294:[(function(t,e,i){"use strict";var
n=t("../vmath"),r=t("../platform/js"),s=new r.Pool(128);s.get=function(){var
t=this._get();return t?n.mat4.identity(t):t=n.mat4.create(),t};var a=new
r.Pool(64);a.get=function(){var t=this._get();return t?
(t.x=t.y=t.z=0,t.w=1):t=n.quat.create(),t},e.exports={mat4:s,quat:a}}),
{"../platform/js":220,"../vmath":316}],295:[(function(t,e,i){"use strict";for(var
n=t("../platform/js"),r={propertyDefine:function(t,e,i){function r(t,e,i,r){var
s=Object.getOwnPropertyDescriptor(t,e);if(s)s.get&&(t[i]=s.get),s.set&&r&&(t[r]=s.s
et);else{var a=t[i];n.getset(t,e,a,t[r])}}for(var s,a=t.prototype,o=0;o<e.length;o+
+){var l=(s=e[o])[0].toUpperCase()+s.slice(1);r(a,s,"get"+l,"set"+l)}for(s in i)
{var h=i[s];r(a,s,h[0],h[1])}},NextPOT:function(t){return t-=1,t|=t>>1,t|=t>>2,t|
=t>>4,t|=t>>8,(t|=t>>16)+1},BUILTIN_CLASSID_RE:/^(?:cc|dragonBones|sp|ccsg)\..
+/},s=new Array(123),a=0;a<123;++a)s[a]=64;for(var o=0;o<64;+
+o)s["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charCodeAt
(o)]=o;r.BASE64_VALUES=s,r.pushToMap=function(t,e,i,n){var r=t[e];r?
Array.isArray(r)?n?(r.push(r[0]),r[0]=i):r.push(i):t[e]=n?[i,r]:
[r,i]:t[e]=i},r.clampf=function(t,e,i){if(e>i){var n=e;e=i,i=n}return t<e?e:t<i?
t:i},r.clamp01=function(t){return t<0?0:t<1?t:1},r.lerp=function(t,e,i){return t+
(e-t)*i},r.degreesToRadians=function(t){return
t*cc.macro.RAD},r.radiansToDegrees=function(t){return
t*cc.macro.DEG},cc.misc=e.exports=r}),{"../platform/js":220}],296:[(function(t,e,i)
{"use strict";function n(t){this.i=0,this.array=t}var
r=n.prototype;r.remove=function(t){var
e=this.array.indexOf(t);e>=0&&this.removeAt(e)},r.removeAt=function(t)
{this.array.splice(t,1),t<=this.i&&--this.i},r.fastRemove=function(t){var
e=this.array.indexOf(t);e>=0&&this.fastRemoveAt(e)},r.fastRemoveAt=function(t){var
e=this.array;e[t]=e[e.length-1],--e.length,t<=this.i&&--this.i},r.push=function(t)
{this.array.push(t)},e.exports=n}),{}],297:[(function(t,e,i){"use strict";var
n=t("../vmath");cc._PrefabInfo=cc.Class({name:"cc.PrefabInfo",properties:
{root:null,asset:null,fileId:"",sync:!1,_synced:{default:!1,serializable:!
1}}}),e.exports={syncWithPrefab:function(t){var e=t._prefab;if(e._synced=!0,!
e.asset)return cc.errorID(3701,t.name),void(t._prefab=null);var
i=t._objFlags,r=t._parent,s=t._id,a=t._name,o=t._active,l=t._position.x,h=t._positi
on.y,c=t._quat,u=t._localZOrder,_=t._globalZOrder;cc.game._isCloning=!
0,e.asset._doInstantiate(t),cc.game._isCloning=!
1,t._objFlags=i,t._parent=r,t._id=s,t._prefab=e,t._name=a,t._active=o,t._position.x
=l,t._position.y=h,n.quat.copy(t._quat,c),t._localZOrder=u,t._globalZOrder=_}}}),
{"../vmath":316}],298:[(function(t,e,i){"use strict";var
n=t("../../platform/CCMacro"),r=t("./perf-counter"),s=!
1,a=15,o=null,l=null,h=null,c=null;function u(){if(!o){var
t=document.createElement("canvas");t.style.width=t.width=256,t.style.height=t.heigh
t=256;var e=t.getContext("2d");e.font=a+"px
Arial",e.textBaseline="top",e.textAlign="left",e.fillStyle="#fff";var i=2,n=2,r=a;
(o=new cc.LabelAtlas)._fntConfig={atlasName:"profiler-
arial",commonHeight:r,fontSize:a,kerningDict:{},fontDefDictionary:
{}},o._name="profiler-arial",o.fontSize=a;for(var
s=o._fntConfig.fontDefDictionary,l=32;l<=126;l++){var
h=String.fromCharCode(l),c=e.measureText(h).width;i+c>=256&&(i=2,n+=r+2),e.fillText
(h,i,n),s[l]={xAdvance:c,xOffset:0,yOffset:0,rect:
{x:i,y:n,width:c,height:r}},i+=c+2}var u=new cc.Texture2D;u.initWithElement(t);var
_=new cc.SpriteFrame;_.setTexture(u),o.spriteFrame=_}}function _(){if(!l){l={frame:
{desc:"Frame time (ms)",min:0,max:50,average:500},fps:{desc:"Framerate
(FPS)",below:30,average:500},draws:{desc:"Draw call"},logic:{desc:"Game Logic
(ms)",min:0,max:50,average:500,color:"#080"},render:{desc:"Renderer
(ms)",min:0,max:50,average:500,color:"#f90"},mode:
{desc:cc.game.renderType===cc.game.RENDER_TYPE_WEBGL?"WebGL":"Canvas",min:1}};var
t=performance.now();for(var e in l)l[e]._counter=new r(e,l[e],t)}}function f(){if(!
h||!h.isValid){(h=new cc.Node("PROFILER-
NODE")).x=h.y=10,h.groupIndex=cc.Node.BuiltinGroupIndex.DEBUG,cc.Camera._setupDebug
Camera(),h.zIndex=n.MAX_ZINDEX,cc.game.addPersistRootNode(h);var t=new
cc.Node("LEFT-PANEL");t.anchorX=t.anchorY=0,t.parent=h;var
e=t.addComponent(cc.Label);e.font=o,e.fontSize=a,e.lineHeight=a;var i=new
cc.Node("RIGHT-PANEL");i.anchorX=1,i.anchorY=0,i.x=200,i.parent=h;var
r=i.addComponent(cc.Label);r.horizontalAlign=cc.Label.HorizontalAlign.RIGHT,r.font=
o,r.fontSize=a,r.lineHeight=a,c={left:e,right:r}}}function d(){f();var
t=cc.director._lastUpdate;l.frame._counter.start(t),l.logic._counter.start(t)}funct
ion m(){var t=performance.now();cc.director.isPaused()?
l.frame._counter.start(t):l.logic._counter.end(t),l.render._counter.start(t)}functi
on p(){var
t=performance.now();l.render._counter.end(t),l.draws._counter.value=cc.renderer.dra
wCalls,l.frame._counter.end(t),l.fps._counter.frame(t);var e="",i="";for(var n in
l){var r=l[n];r._counter.sample(t),e+=r.desc+"\n",i+=r._counter.human()
+"\n"}c.left.string=e,c.right.string=i}cc.profiler=e.exports={isShowingStats:functi
on(){return s},hideStats:function(){s&&(h&&(h.active=!
1),cc.director.off(cc.Director.EVENT_BEFORE_UPDATE,d),cc.director.off(cc.Director.E
VENT_AFTER_UPDATE,m),cc.director.off(cc.Director.EVENT_AFTER_DRAW,p),s=!
1)},showStats:function(){s||(u(),_(),h&&(h.active=!
0),cc.director.on(cc.Director.EVENT_BEFORE_UPDATE,d),cc.director.on(cc.Director.EVE
NT_AFTER_UPDATE,m),cc.director.on(cc.Director.EVENT_AFTER_DRAW,p),s=!0)}}}),
{"../../platform/CCMacro":205,"./perf-counter":300}],299:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.Counter",ctor:function(t,e,i)
{this._id=t,this._opts=e||
{},this._value=0,this._total=0,this._averageValue=0,this._accumValue=0,this._accumS
amples=0,this._accumStart=i},properties:{value:{get:function(){return
this._value},set:function(t){this._value=t}}},_average:function(t,e)
{if(this._opts.average){this._accumValue+=t,++this._accumSamples;var i=e;i-
this._accumStart>=this._opts.average&&(this._averageValue=this._accumValue/this._ac
cumSamples,this._accumValue=0,this._accumStart=i,this._accumSamples=0)}},sample:fun
ction(t){this._average(this._value,t)},human:function(){var t=this._opts.average?
this._averageValue:this._value;return Math.round(100*t)/100},alarm:function()
{return this._opts.below&&this._value<this._opts.below||
this._opts.over&&this._value>this._opts.over}});e.exports=n}),{}],300:
[(function(t,e,i){"use strict";var
n=t("./counter"),r=cc.Class({name:"cc.PerfCounter",extends:n,ctor:function(t,e,i)
{this._time=i},start:function(t){this._time=t},end:function(t){this._value=t-
this._time,this._average(this._value)},tick:function()
{this.end(),this.start()},frame:function(t){var e=t,i=e-this._time;this._total+
+,i>(this._opts.average||
1e3)&&(this._value=1e3*this._total/i,this._total=0,this._time=e,this._average(this.
_value))}});e.exports=r}),{"./counter":299}],301:[(function(t,e,i){"use strict";var
n=.26;var r={BASELINE_RATIO:n,MIDDLE_RATIO:(n+1)/2-n,label_wordRex:/([a-zA-Z0-
9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430-\u044f\
u0410-\u042f\u0401\u0451]+|\S)/,label_symbolRex:/^[!,.:;'}\]%\?
>\u3001\u2018\u201c\u300b\uff1f\u3002\uff0c\uff01]/,label_lastWordRex:/([a-zA-Z0-
9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec
\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\
u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e
\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\
xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u01
79\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]+|\S)
$/,label_lastEnglish:/[a-zA-Z0-
9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec
\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\
u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e
\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\
xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u01
79\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]+
$/,label_firstEnglish:/^[a-zA-Z0-
9\xc4\xd6\xdc\xe4\xf6\xfc\xdf\xe9\xe8\xe7\xe0\xf9\xea\xe2\xee\xf4\xfb\u0430\xed\xec
\xcd\xcc\xef\xc1\xc0\xe1\xe0\xc9\xc8\xd2\xd3\xf2\xf3\u0150\u0151\xd9\xda\u0170\xfa\
u0171\xf1\xd1\xe6\xc6\u0153\u0152\xc3\xc2\xe3\xd4\xf5\u011b\u0161\u010d\u0159\u017e
\xfd\xe1\xed\xe9\xf3\xfa\u016f\u0165\u010f\u0148\u011a\u0160\u010c\u0158\u017d\xc1\
xcd\xc9\xd3\xda\u0164\u017c\u017a\u015b\xf3\u0144\u0142\u0119\u0107\u0105\u017b\u01
79\u015a\xd3\u0143\u0141\u0118\u0106\u0104-\u044f\u0410-\u042f\u0401\u0451]/,label_
firstEmoji:/^[\uD83C\uDF00-\uDFFF\uDC00-\uDE4F]/,label_lastEmoji:/
([\uDF00-\uDFFF\uDC00-\uDE4F]+|\S)$/,label_wrapinspection:!
0,__CHINESE_REG:/^[\u4E00-\u9FFF\u3400-\u4DFF]+$/,__JAPANESE_REG:/[\u3000-\u303F]|
[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|
[\u2190-\u2195]|\u203B/g,__KOREAN_REG:/^[\u1100-\u11FF]|[\u3130-\u318F]|
[\uA960-\uA97F]|[\uAC00-\uD7AF]|[\uD7B0-\uD7FF]+$/,isUnicodeCJK:function(t){return
this.__CHINESE_REG.test(t)||this.__JAPANESE_REG.test(t)||
this.__KOREAN_REG.test(t)},isUnicodeSpace:function(t)
{return(t=t.charCodeAt(0))>=9&&t<=13||32===t||133===t||160===t||5760===t||
t>=8192&&t<=8202||8232===t||8233===t||8239===t||8287===t||
12288===t},safeMeasureText:function(t,e){var i=t.measureText(e);return i&&i.width||
0},fragmentText:function(t,e,i,n){var r=[];if(0===t.length||i<0)return
r.push(""),r;for(var s=t;e>i&&s.length>1;){for(var
a=s.length*(i/e)|0,o=s.substr(a),l=e-n(o),h=o,c=0,u=0;l>i&&u++<10;)a*=i/l,a|
=0,l=e-n(o=s.substr(a));for(u=0;l<=i&&u++<10;){if(o){var
_=this.label_wordRex.exec(o);c=_?_[0].length:1,h=o}a+=c,l=e-
n(o=s.substr(a))}0===(a-=c)&&(a=1,h=h.substr(1));var
f,d=s.substr(0,a);this.label_wrapinspection&&this.label_symbolRex.test(h||
o)&&(0===(a-=(f=this.label_lastWordRex.exec(d))?
f[0].length:0)&&(a=1),h=s.substr(a),d=s.substr(0,a)),this.label_firstEmoji.test(h)&
&(f=this.label_lastEmoji.exec(d))&&d!==f[0]&&(a-
=f[0].length,h=s.substr(a),d=s.substr(0,a)),this.label_firstEnglish.test(h)&&(f=thi
s.label_lastEnglish.exec(d))&&d!==f[0]&&(a-
=f[0].length,h=s.substr(a),d=s.substr(0,a)),0===r.length?r.push(d):
(d=d.trim()).length>0&&r.push(d),e=n(s=h||o)}return 0===r.length?r.push(s):
(s=s.trim()).length>0&&r.push(s),r}};e.exports=r}),{}],302:[(function(t,e,i){"use
strict";var n=t("../assets/CCTexture2D"),r={loadImage:function(t,e,i)
{cc.assertID(t,3103);var r=cc.loader.getRes(t);return r?r.loaded?
(e&&e.call(i,r),r):(r.once("load",(function(){e&&e.call(i,r)}),i),r):((r=new
n).url=t,cc.loader.load({url:t,texture:r},(function(t,n){if(t)return
e&&e.call(i,t||new Error("Unknown
error"));n.handleLoadedTexture(),e&&e.call(i,null,n)})),r)},cacheImage:function(t,e
){if(t&&e){var i=new n;i.initWithElement(e);var
r={id:t,url:t,error:null,content:i,complete:!1};return
cc.loader.flowOut(r),i}},postLoadTexture:function(t,e){t.loaded?e&&e():t.url?
cc.loader.load({url:t.url,skips:["Loader"]},(function(i,n){n&&(t.loaded||
(t._nativeAsset=n)),e&&e(i)})):e&&e()}};cc.textureUtil=e.exports=r}),
{"../assets/CCTexture2D":73}],303:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("./value-type"),s=t("../platform/js"),a=(function(){function e(t,e,i,r)
{"object"===(void 0===t?"undefined":n(t))&&(e=t.g,i=t.b,r=t.a,t=t.r),t=t||0,e=e||
0,i=i||0,r="number"==typeof r?r:255,this._val=(r<<24>>>0)+(i<<16)+
(e<<8)+t}s.extend(e,r),t("../platform/CCClass").fastDefine("cc.Color",e,
{r:0,g:0,b:0,a:255});var i={WHITE:[255,255,255,255],BLACK:[0,0,0,255],TRANSPARENT:
[0,0,0,0],GRAY:[127.5,127.5,127.5],RED:[255,0,0],GREEN:[0,255,0],BLUE:
[0,0,255],YELLOW:[255,235,4],ORANGE:[255,127,0],CYAN:[0,255,255],MAGENTA:
[255,0,255]};for(var a in i)s.get(e,a,(function(t){return function(){return new
e(t[0],t[1],t[2],t[3])}})(i[a]));var o=e.prototype;return o.clone=function(){var
t=new e;return t._val=this._val,t},o.equals=function(t){return
t&&this._val===t._val},o.lerp=function(t,i,n){n=n||new e;var
r=this.r,s=this.g,a=this.b,o=this.a;return n.r=r+(t.r-r)*i,n.g=s+(t.g-s)*i,n.b=a+
(t.b-a)*i,n.a=o+(t.a-o)*i,n},o.toString=function(){return"rgba("+this.r.toFixed()
+", "+this.g.toFixed()+", "+this.b.toFixed()+", "+this.a.toFixed()
+")"},o.getR=function(){return 255&this._val},o.setR=function(t){return
t=~~cc.misc.clampf(t,0,255),this._val=(4294967040&this._val|
t)>>>0,this},o.getG=function(){return(65280&this._val)>>8},o.setG=function(t)
{return t=~~cc.misc.clampf(t,0,255),this._val=(4294902015&this._val|
t<<8)>>>0,this},o.getB=function()
{return(16711680&this._val)>>16},o.setB=function(t){return
t=~~cc.misc.clampf(t,0,255),this._val=(4278255615&this._val|
t<<16)>>>0,this},o.getA=function()
{return(4278190080&this._val)>>>24},o.setA=function(t){return
t=~~cc.misc.clampf(t,0,255),this._val=(16777215&this._val|
t<<24)>>>0,this},o._fastSetA=function(t){this._val=(16777215&this._val|
t<<24)>>>0},s.getset(o,"r",o.getR,o.setR,!0),s.getset(o,"g",o.getG,o.setG,!
0),s.getset(o,"b",o.getB,o.setB,!0),s.getset(o,"a",o.getA,o.setA,!
0),o.toCSS=function(t){return"rgba"===t?"rgba("+(0|this.r)+","+(0|this.g)+","+(0|
this.b)+","+(this.a/255).toFixed(2)+")":"rgb"===t?"rgb("+(0|this.r)+","+(0|this.g)
+","+(0|this.b)+")":"#"+this.toHEX(t)},o.fromHEX=function(t){t=0===t.indexOf("#")?
t.substring(1):t;var e=parseInt(t.substr(0,2),16)||0,i=parseInt(t.substr(2,2),16)||
0,n=parseInt(t.substr(4,2),16)||0,r=parseInt(t.substr(6,2),16)||255;return
this._val=(r<<24>>>0)+(n<<16)+(i<<8)+e,this},o.toHEX=function(t){var
e=[(this.r<16?"0":"")+(0|this.r).toString(16),(this.g<16?"0":"")+(0|
this.g).toString(16),(this.b<16?"0":"")+(0|this.b).toString(16)],i=-
1;if("#rgb"===t)for(i=0;i<e.length;++i)e[i].length>1&&(e[i]=e[i][0]);else
if("#rrggbb"===t)for(i=0;i<e.length;+
+i)1===e[i].length&&(e[i]="0"+e[i]);else"#rrggbbaa"===t&&e.push((this.a<16?"0":"")
+(0|this.a).toString(16));return e.join("")},o.toRGBValue=function(){return
16777215&this._val},o.fromHSV=function(t,e,i){var n,r,s;if(0===e)n=r=s=i;else
if(0===i)n=r=s=0;else{1===t&&(t=0),t*=6,e=e,i=i;var a=Math.floor(t),o=t-a,l=i*(1-
e),h=i*(1-e*o),c=i*(1-e*(1-o));switch(a){case 0:n=i,r=c,s=l;break;case
1:n=h,r=i,s=l;break;case 2:n=l,r=i,s=c;break;case 3:n=l,r=h,s=i;break;case
4:n=c,r=l,s=i;break;case 5:n=i,r=l,s=h}}return
n*=255,r*=255,s*=255,this._val=(this.a<<24>>>0)+(s<<16)+
(r<<8)+n,this},o.toHSV=function(){var
t=this.r/255,e=this.g/255,i=this.b/255,n={h:0,s:0,v:0},r=Math.max(t,e,i),s=Math.min
(t,e,i),a=0;return n.v=r,n.s=r?(r-s)/r:0,n.s?(a=r-s,n.h=t===r?(e-i)/a:e===r?2+(i-
t)/a:4+(t-e)/a,n.h/=6,n.h<0&&(n.h+=1)):n.h=0,n},o.set=function(t){t._val?
this._val=t._val:(this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a)},e})
();cc.Color=a,cc.color=function(t,e,i,r){return"string"==typeof t?(new
cc.Color).fromHEX(t):"object"===(void 0===t?"undefined":n(t))?new
cc.Color(t.r,t.g,t.b,t.a):new cc.Color(t,e,i,r)},e.exports=cc.Color}),
{"../platform/CCClass":200,"../platform/js":220,"./value-type":309}],304:
[(function(t,e,i){"use strict";t("./value-
type"),cc.vmath=t("../vmath").default,e.exports={Vec2:t("./vec2"),Vec3:t("./vec3"),
Vec4:t("./vec4"),Quat:t("./quat"),Mat4:t("./mat4"),Size:t("./size"),Rect:t("./rect"
),Color:t("./color")}}),
{"../vmath":316,"./color":303,"./mat4":305,"./quat":306,"./rect":307,"./size":308,"
./value-type":309,"./vec2":310,"./vec3":311,"./vec4":312}],305:[(function(t,e,i)
{"use strict";var n=t("../vmath"),r=t("./value-
type"),s=t("../platform/js"),a=t("../platform/CCClass");function
o(t,e,i,n,r,s,a,o,l,h,c,u,_,f,d,m){var
p=this;p.m00=t,p.m01=e,p.m02=i,p.m03=n,p.m04=r,p.m05=s,p.m06=a,p.m07=o,p.m08=l,p.m0
9=h,p.m10=c,p.m11=u,p.m12=_,p.m13=f,p.m14=d,p.m15=m}s.extend(o,r),a.fastDefine("cc.
Mat4",o,
{m00:1,m01:0,m02:0,m03:0,m04:0,m05:1,m06:0,m07:0,m08:0,m09:0,m10:1,m11:0,m12:0,m13:
0,m14:0,m15:1}),s.mixin(o.prototype,{clone:function(){var t=this;return new
o(t.m00,t.m01,t.m02,t.m03,t.m04,t.m05,t.m06,t.m07,t.m08,t.m09,t.m10,t.m11,t.m12,t.m
13,t.m14,t.m15)},set:function(t){var e=this;return
e.m00=t.m00,e.m01=t.m01,e.m02=t.m02,e.m03=t.m03,e.m04=t.m04,e.m05=t.m05,e.m06=t.m06
,e.m07=t.m07,e.m08=t.m08,e.m09=t.m09,e.m10=t.m10,e.m11=t.m11,e.m12=t.m12,e.m13=t.m1
3,e.m14=t.m14,e.m15=t.m15,this},equals:function(t){return
n.mat4.exactEquals(this,t)},fuzzyEquals:function(t){return
n.mat4.equals(this,t)},toString:function(){var t=this;return"[\n"+t.m00+",
"+t.m01+", "+t.m02+", "+t.m03+",\n"+t.m04+", "+t.m05+", "+t.m06+",
"+t.m07+",\n"+t.m08+", "+t.m09+", "+t.m10+", "+t.m11+",\n"+t.m12+", "+t.m13+",
"+t.m14+", "+t.m15+"\n]"},identity:function(){return
n.mat4.identity(this)},transpose:function(t){return t=t||new
cc.Mat4,n.mat4.transpose(t,this)},invert:function(t){return t=t||new
cc.Mat4,n.mat4.invert(t,this)},adjoint:function(t){return t=t||new
cc.Mat4,n.mat4.adjoint(t,this)},determinant:function(){return
n.mat4.determinant(this)},add:function(t,e){return e=e||new
cc.Mat4,n.mat4.add(e,this,t)},sub:function(t,e){return e=e||new
cc.Mat4,n.mat4.subtract(e,this,t)},mul:function(t,e){return e=e||new
cc.Mat4,n.mat4.multiply(e,this,t)},mulScalar:function(t,e){return e=e||new
cc.Mat4,n.mat4.mulScalar(e,this,t)},translate:function(t,e){return e=e||new
cc.Mat4,n.mat4.translate(e,this,t)},scale:function(t,e){return e=e||new
cc.Mat4,n.mat4.scale(e,this,t)},rotate:function(t,e,i){return i=i||new
cc.Mat4,n.mat4.rotate(i,this,t,e)},getTranslation:function(t){return t=t||new
cc.Vec3,n.mat4.getTranslation(t,this)},getScale:function(t){return t=t||new
cc.Vec3,n.mat4.getScaling(t,this)},getRotation:function(t){return t=t||new
cc.Quat,n.mat4.getRotation(t,this)},fromRTS:function(t,e,i){return
n.mat4.fromRTS(this,t,e,i)},fromQuat:function(t){return
n.mat4.fromQuat(this,t)}}),cc.mat4=function(t,e,i,n,r,s,a,l,h,c,u,_,f,d,m,p){return
new o(t,e,i,n,r,s,a,l,h,c,u,_,f,d,m,p)},e.exports=cc.Mat4=o}),
{"../platform/CCClass":200,"../platform/js":220,"../vmath":316,"./value-
type":309}],306:[(function(t,e,i){"use strict";var n="function"==typeof
Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t)
{return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("./value-
type"),s=t("../platform/js"),a=t("../platform/CCClass"),o=t("../vmath/quat");functi
on l(t,e,i,r){t&&"object"===(void
0===t?"undefined":n(t))&&(i=t.z,e=t.y,r=t.w,t=t.x),this.x=t||0,this.y=e||
0,this.z=i||0,this.w=r||1}s.extend(l,r),a.fastDefine("cc.Quat",l,
{x:0,y:0,z:0,w:1});var h=l.prototype;h.clone=function(){return new
l(this.x,this.y,this.z,this.w)},h.set=function(t){return
this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},h.equals=function(t){return
t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},h.toEuler=function(t)
{return o.toEuler(t,this),t},h.fromEuler=function(t){return
o.fromEuler(this,t.x,t.y,t.z),this},h.lerp=function(t,e,i){return i=i||new
cc.Quat,o.slerp(i,this,t,e),i},h.mul=function(t,e){return e=e||new
cc.Quat,o.mul(e,this,t),e},cc.quat=function(t,e,i,n){return new
l(t,e,i,n)},e.exports=cc.Quat=l}),
{"../platform/CCClass":200,"../platform/js":220,"../vmath/quat":321,"./value-
type":309}],307:[(function(t,e,i){"use strict";var n="function"==typeof
Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t)
{return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("./value-
type"),s=t("../platform/js");function
a(t,e,i,r){t&&"object"===(void
0===t?"undefined":n(t))&&(e=t.y,i=t.width,r=t.height,t=t.x),this.x=t||0,this.y=e||
0,this.width=i||0,this.height=r||
0}s.extend(a,r),t("../platform/CCClass").fastDefine("cc.Rect",a,
{x:0,y:0,width:0,height:0}),a.fromMinMax=function(t,e){var
i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return new a(i,n,Math.max(t.x,e.x)-
i,Math.max(t.y,e.y)-n)};var o=a.prototype;o.clone=function(){return new
a(this.x,this.y,this.width,this.height)},o.equals=function(t){return
t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},o.lerp
=function(t,e,i){i=i||new a;var n=this.x,r=this.y,s=this.width,o=this.height;return
i.x=n+(t.x-n)*e,i.y=r+(t.y-r)*e,i.width=s+(t.width-s)*e,i.height=o+(t.height-
o)*e,i},o.set=function(t)
{this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},o.intersects=functi
on(t){var
e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,r=t.y+t.height;return!
(e<t.x||n<this.x||i<t.y||r<this.y)},o.intersection=function(t,e){var
i=this.x,n=this.y,r=this.x+this.width,s=this.y+this.height,a=e.x,o=e.y,l=e.x+e.widt
h,h=e.y+e.height;return t.x=Math.max(i,a),t.y=Math.max(n,o),t.width=Math.min(r,l)-
t.x,t.height=Math.min(s,h)-t.y,t},o.contains=function(t){return
this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},o.contai
nsRect=function(t){return
this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t
.height},o.union=function(t,e){var
i=this.x,n=this.y,r=this.width,s=this.height,a=e.x,o=e.y,l=e.width,h=e.height;retur
n t.x=Math.min(i,a),t.y=Math.min(n,o),t.width=Math.max(i+r,a+l)-
t.x,t.height=Math.max(n+s,o+h)-t.y,t},o.transformMat4=function(t,e){var
i=this.x,n=this.y,r=i+this.width,s=n+this.height,a=e.m00*i+e.m04*n+e.m12,o=e.m01*i+
e.m05*n+e.m13,l=e.m00*r+e.m04*n+e.m12,h=e.m01*r+e.m05*n+e.m13,c=e.m00*i+e.m04*s+e.m
12,u=e.m01*i+e.m05*s+e.m13,_=e.m00*r+e.m04*s+e.m12,f=e.m01*r+e.m05*s+e.m13,d=Math.m
in(a,l,c,_),m=Math.max(a,l,c,_),p=Math.min(o,h,u,f),v=Math.max(o,h,u,f);return
t.x=d,t.y=p,t.width=m-d,t.height=v-p,t},o.toString=function()
{return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.width.toFixed(2)+",
"+this.height.toFixed(2)+")"},s.getset(o,"xMin",(function(){return this.x}),
(function(t){this.width+=this.x-t,this.x=t})),s.getset(o,"yMin",(function(){return
this.y}),(function(t){this.height+=this.y-t,this.y=t})),s.getset(o,"xMax",
(function(){return this.x+this.width}),(function(t){this.width=t-
this.x})),s.getset(o,"yMax",(function(){return this.y+this.height}),(function(t)
{this.height=t-this.y})),s.getset(o,"center",(function(){return new
cc.Vec2(this.x+.5*this.width,this.y+.5*this.height)}),(function(t)
{this.x=t.x-.5*this.width,this.y=t.y-.5*this.height})),s.getset(o,"origin",
(function(){return new cc.Vec2(this.x,this.y)}),(function(t)
{this.x=t.x,this.y=t.y})),s.getset(o,"size",(function(){return new
cc.Size(this.width,this.height)}),(function(t)
{this.width=t.width,this.height=t.height})),cc.Rect=a,cc.rect=function(t,e,i,n)
{return new a(t,e,i,n)},e.exports=cc.Rect}),
{"../platform/CCClass":200,"../platform/js":220,"./value-type":309}],308:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("./value-
type"),s=t("../platform/js");function a(t,e){t&&"object"===(void
0===t?"undefined":n(t))&&(e=t.height,t=t.width),this.width=t||0,this.height=e||
0}s.extend(a,r),t("../platform/CCClass").fastDefine("cc.Size",a,
{width:0,height:0}),s.get(a,"ZERO",(function(){return new a(0,0)}));var
o=a.prototype;o.clone=function(){return new
a(this.width,this.height)},o.equals=function(t){return
t&&this.width===t.width&&this.height===t.height},o.lerp=function(t,e,i){i=i||new
a;var n=this.width,r=this.height;return i.width=n+(t.width-n)*e,i.height=r+
(t.height-r)*e,i},o.set=function(t)
{this.width=t.width,this.height=t.height},o.toString=function()
{return"("+this.width.toFixed(2)+",
"+this.height.toFixed(2)+")"},cc.size=function(t,e){return new
a(t,e)},cc.Size=e.exports=a}),
{"../platform/CCClass":200,"../platform/js":220,"./value-type":309}],309:
[(function(t,e,i){"use strict";var n=t("../platform/js");function r()
{}n.setClassName("cc.ValueType",r);var s=r.prototype;s.toString=function()
{return""+{}},cc.ValueType=e.exports=r}),{"../platform/js":220}],310:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("../vmath"),s=t("./value-
type"),a=t("../platform/js"),o=t("../platform/CCClass"),l=t("../utils/misc");functi
on h(t,e){t&&"object"===(void 0===t?"undefined":n(t))&&(e=t.y,t=t.x),this.x=t||
0,this.y=e||0}a.extend(h,s),o.fastDefine("cc.Vec2",h,{x:0,y:0});var
c=h.prototype;a.value(c,"z",0,!0),c.clone=function(){return new
h(this.x,this.y)},c.set=function(t){return
this.x=t.x,this.y=t.y,this},c.equals=function(t){return
t&&this.x===t.x&&this.y===t.y},c.fuzzyEquals=function(t,e){return this.x-
e<=t.x&&t.x<=this.x+e&&this.y-e<=t.y&&t.y<=this.y+e},c.toString=function()
{return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+")"},c.lerp=function(t,e,i)
{i=i||new h;var n=this.x,r=this.y;return i.x=n+(t.x-n)*e,i.y=r+(t.y-
r)*e,i},c.clampf=function(t,e){return
this.x=l.clampf(this.x,t.x,e.x),this.y=l.clampf(this.y,t.y,e.y),this},c.addSelf=fun
ction(t){return this.x+=t.x,this.y+=t.y,this},c.add=function(t,e){return(e=e||new
h).x=this.x+t.x,e.y=this.y+t.y,e},c.subSelf=function(t){return this.x-=t.x,this.y-
=t.y,this},c.sub=function(t,e){return(e=e||new h).x=this.x-t.x,e.y=this.y-
t.y,e},c.mulSelf=function(t){return this.x*=t,this.y*=t,this},c.mul=function(t,e)
{return(e=e||new h).x=this.x*t,e.y=this.y*t,e},c.scaleSelf=function(t){return
this.x*=t.x,this.y*=t.y,this},c.scale=function(t,e){return(e=e||new
h).x=this.x*t.x,e.y=this.y*t.y,e},c.divSelf=function(t){return
this.x/=t,this.y/=t,this},c.div=function(t,e){return(e=e||new
h).x=this.x/t,e.y=this.y/t,e},c.negSelf=function(){return this.x=-this.x,this.y=-
this.y,this},c.neg=function(t){return(t=t||new h).x=-this.x,t.y=-
this.y,t},c.dot=function(t){return this.x*t.x+this.y*t.y},c.cross=function(t)
{return this.x*t.y-this.y*t.x},c.mag=function(){return
Math.sqrt(this.x*this.x+this.y*this.y)},c.magSqr=function(){return
this.x*this.x+this.y*this.y},c.normalizeSelf=function(){var
t=this.x*this.x+this.y*this.y;if(1===t)return this;if(0===t)return this;var
e=1/Math.sqrt(t);return this.x*=e,this.y*=e,this},c.normalize=function(t)
{return(t=t||new h).x=this.x,t.y=this.y,t.normalizeSelf(),t},c.angle=function(t)
{var e=this.magSqr(),i=t.magSqr();if(0===e||0===i)return console.warn("Can't get
angle between zero vector"),0;var n=this.dot(t)/Math.sqrt(e*i);return
n=l.clampf(n,-1,1),Math.acos(n)},c.signAngle=function(t){var e=this.angle(t);return
this.cross(t)<0?-e:e},c.rotate=function(t,e){return(e=e||new
h).x=this.x,e.y=this.y,e.rotateSelf(t)},c.rotateSelf=function(t){var
e=Math.sin(t),i=Math.cos(t),n=this.x;return this.x=i*n-
e*this.y,this.y=e*n+i*this.y,this},c.project=function(t){return
t.mul(this.dot(t)/t.dot(t))},c.transformMat4=function(t,e){e=e||new
h,r.vec2.transformMat4(e,this,t)},a.get(h,"ONE",(function(){return new
h(1,1)})),a.get(h,"ZERO",(function(){return new h(0,0)})),a.get(h,"UP",(function()
{return new h(0,1)})),a.get(h,"RIGHT",(function(){return new
h(1,0)})),cc.Vec2=h,cc.v2=function(t,e){return new
h(t,e)},cc.p=cc.v2,e.exports=cc.Vec2}),
{"../platform/CCClass":200,"../platform/js":220,"../utils/misc":295,"../vmath":316,
"./value-type":309}],311:[(function(t,e,i){"use strict";var n="function"==typeof
Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t)
{return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=t("../vmath"),s=t("./value-
type"),a=t("../platform/js"),o=t("../platform/CCClass"),l=t("../utils/misc"),h=t(".
/vec2").prototype;function c(t,e,i){t&&"object"===(void
0===t?"undefined":n(t))&&(i=t.z,e=t.y,t=t.x),this.x=t||0,this.y=e||0,this.z=i||
0}a.extend(c,s),o.fastDefine("cc.Vec3",c,{x:0,y:0,z:0});var
u=c.prototype;u.clone=function(){return new
c(this.x,this.y,this.z)},u.set=function(t){return
this.x=t.x,this.y=t.y,this.z=t.z,this},u.equals=function(t){return
t&&this.x===t.x&&this.y===t.y&&this.z===t.z},u.fuzzyEquals=function(t,e){return
this.x-e<=t.x&&t.x<=this.x+e&&this.y-e<=t.y&&t.y<=this.y+e&&this.z-
e<=t.z&&t.z<=this.z+e},u.toString=function(){return"("+this.x.toFixed(2)+",
"+this.y.toFixed(2)+", "+this.z.toFixed(2)+")"},u.lerp=function(t,e,i){return i=i||
new c,r.vec3.lerp(i,this,t,e),i},u.clampf=function(t,e){return
this.x=l.clampf(this.x,t.x,e.x),this.y=l.clampf(this.y,t.y,e.y),this.z=l.clampf(thi
s.z,t.z,e.z),this},u.addSelf=function(t){return
this.x+=t.x,this.y+=t.y,this.z+=t.z,this},u.add=function(t,e){return(e=e||new
c).x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e},u.subSelf=function(t){return
this.x-=t.x,this.y-=t.y,this.z-=t.z,this},u.sub=function(t,e){return(e=e||new
c).x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e},u.mulSelf=function(t){return
this.x*=t,this.y*=t,this.z*=t,this},u.mul=function(t,e){return(e=e||new
c).x=this.x*t,e.y=this.y*t,e.z=this.z*t,e},u.scaleSelf=function(t){return
this.x*=t.x,this.y*=t.y,this.z*=t.z,this},u.scale=function(t,e){return(e=e||new
c).x=this.x*t.x,e.y=this.y*t.y,e.z=this.z*t.z,e},u.divSelf=function(t){return
this.x/=t,this.y/=t,this.z/=t,this},u.div=function(t,e){return(e=e||new
c).x=this.x/t,e.y=this.y/t,e.z=this.z/t,e},u.negSelf=function(){return this.x=-
this.x,this.y=-this.y,this.z=-this.z,this},u.neg=function(t){return(t=t||new c).x=-
this.x,t.y=-this.y,t.z=-this.z,t},u.dot=function(t){return
this.x*t.x+this.y*t.y+this.z*t.z},u.cross=function(t,e){return e=e||new
c,r.vec3.cross(e,this,t),e},u.mag=function(){return
Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},u.magSqr=function(){return
this.x*this.x+this.y*this.y+this.z*this.z},u.normalizeSelf=function(){return
r.vec3.normalize(this,this),this},u.normalize=function(t){return t=t||new
c,r.vec3.normalize(t,this),t},u.transformMat4=function(t,e){e=e||new
c,r.vec3.transformMat4(e,this,t)},u.angle=h.angle,u.project=h.project,u.signAngle=f
unction(t)
{cc.warnID(1408,"vec3.signAngle","v2.1","cc.v2(selfVector).signAngle(vector)");var
e=new cc.Vec2(this.x,this.y),i=new cc.Vec2(t.x,t.y);return
e.signAngle(i)},u.rotate=function(t,e){return
cc.warnID(1408,"vec3.rotate","v2.1","cc.v2(selfVector).rotate(radians,
out)"),h.rotate.call(this,t,e)},u.rotateSelf=function(t){return
cc.warnID(1408,"vec3.rotateSelf","v2.1","cc.v2(selfVector).rotateSelf(radians)"),h.
rotateSelf.call(this,t)},a.get(c,"ONE",(function(){return new
c(1,1,1)})),a.get(c,"ZERO",(function(){return new c(0,0,0)})),a.get(c,"UP",
(function(){return new c(0,1,0)})),a.get(c,"RIGHT",(function(){return new
c(1,0,0)})),a.get(c,"FRONT",(function(){return new
c(0,0,1)})),cc.v3=function(t,e,i){return new c(t,e,i)},e.exports=cc.Vec3=c}),
{"../platform/CCClass":200,"../platform/js":220,"../utils/misc":295,"../vmath":316,
"./value-type":309,"./vec2":310}],312:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),s=h(t("./value-
type")),a=h(t("../platform/CCClass")),o=t("../vmath"),l=t("../utils/misc");function
h(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!
t)throw new ReferenceError("this hasn't been initialised - super() hasn't been
called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _(t,e)
{if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must
either be null or a function, not "+typeof
e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!
1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}var f=(function(t){function e(t,i,r,s)
{c(this,e);var a=u(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return
t&&"object"===(void 0===t?"undefined":n(t))&&(s=t.w,r=t.z,i=t.y,t=t.x),a.x=t||
0,a.y=i||0,a.z=r||0,a.w=s||0,a}return _(e,s.default),r(e,
[{key:"clone",value:function(){return new e(this.x,this.y,this.z,this.w)}},
{key:"set",value:function(t){return
this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}},{key:"equals",value:function(t)
{return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w}},
{key:"fuzzyEquals",value:function(t,e){return this.x-e<=t.x&&t.x<=this.x+e&&this.y-
e<=t.y&&t.y<=this.y+e&&this.z-e<=t.z&&t.z<=this.z+e&&this.w-
e<=t.w&&t.w<=this.w+e}},{key:"toString",value:function()
{return"("+this.x.toFixed(2)+", "+this.y.toFixed(2)+", "+this.z.toFixed(2)+",
"+this.w.toFixed(2)+")"}},{key:"lerp",value:function(t,i,n){return n=n||new
e,o.vec4.lerp(n,this,t,i),n}},{key:"clampf",value:function(t,e){return
this.x=(0,l.clampf)(this.x,t.x,e.x),this.y=(0,l.clampf)
(this.y,t.y,e.y),this.z=(0,l.clampf)(this.z,t.z,e.z),this.w=(0,l.clampf)
(this.w,t.w,e.w),this}},{key:"addSelf",value:function(t){return
this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}},
{key:"add",value:function(t,i){return(i=i||new
e).x=this.x+t.x,i.y=this.y+t.y,i.z=this.z+t.z,i.w=this.w+t.w,i}},
{key:"subSelf",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-
=t.w,this}},{key:"sub",value:function(t,i){return(i=i||new e).x=this.x-
t.x,i.y=this.y-t.y,i.z=this.z-t.z,i.w=this.w-t.w,i}},
{key:"mulSelf",value:function(t){return
this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}},{key:"mul",value:function(t,i)
{return(i=i||new e).x=this.x*t,i.y=this.y*t,i.z=this.z*t,i.w=this.w*t,i}},
{key:"scaleSelf",value:function(t){return
this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}},
{key:"scale",value:function(t,i){return(i=i||new
e).x=this.x*t.x,i.y=this.y*t.y,i.z=this.z*t.z,i.w=this.w*t.w,i}},
{key:"divSelf",value:function(t){return
this.x/=t,this.y/=t,this.z/=t,this.w/=t,this}},{key:"div",value:function(t,i)
{return(i=i||new e).x=this.x/t,i.y=this.y/t,i.z=this.z/t,i.w=this.w/t,i}},
{key:"negSelf",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-
this.z,this.w=-this.w,this}},{key:"neg",value:function(t){return(t=t||new e).x=-
this.x,t.y=-this.y,t.z=-this.z,t.w=-this.w,t}},{key:"dot",value:function(t){return
this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}},{key:"cross",value:function(t,i)
{return i=i||new e,o.vec4.cross(i,this,t),i}},{key:"mag",value:function(){var
t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)}},
{key:"magSqr",value:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return
t*t+e*e+i*i+n*n}},{key:"normalizeSelf",value:function(){return
o.vec4.normalize(this,this),this}},{key:"normalize",value:function(t){return t=t||
new e,o.vec4.normalize(t,this),t}},{key:"transformMat4",value:function(t,i){return
i=i||new e,o.vec4.transformMat4(i,this,t),i}}]),e})
();a.default.fastDefine("cc.Vec4",f,{x:0,y:0,z:0,w:0}),cc.v4=function(t,e,i,n)
{return new f(t,e,i,n)},e.exports=cc.Vec4=f}),
{"../platform/CCClass":200,"../utils/misc":295,"../vmath":316,"./value-
type":309}],313:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sign=function(t)
{return(t>0)-(t<0)},i.abs=function(t){var e=t>>n-1;return(t^e)-
e},i.min=function(t,e){return e^(t^e)&-(t<e)},i.max=function(t,e){return t^(t^e)&-
(t<e)},i.isPow2=function(t){return!(t&t-1||!t)},i.log2=function(t){var e=void
0,i=void 0;return e=(t>65535)<<4,e|=i=((t>>>=e)>255)<<3,e|=i=((t>>>=i)>15)<<2,(e|
=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1},i.log10=function(t){return t>=1e9?9:t>=1e8?
8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?
1:0},i.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+
(t>>>2&858993459))+
(t>>>4)&252645135)>>>24},i.countTrailingZeros=r,i.nextPow2=function(t){return
t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|
=t>>>16)},i.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|
=t>>>16)-(t>>>1)},i.parity=function(t){return
t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1},i.reverse=function(t){return
s[255&t]<<24|s[t>>>8&255]<<16|s[t>>>16&255]<<8|
s[t>>>24&255]},i.interleave2=function(t,e)
{return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|
t<<4))|t<<2))|t<<1))|
(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|
e<<2))|e<<1))<<1},i.deinterleave2=function(t,e)
{return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|
t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},i.interleave3=function(t,e,i){return
t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|
t<<4))|t<<2),(t|
=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|
e<<8))|e<<4))|e<<2))<<1)|
(i=1227133513&((i=3272356035&((i=251719695&((i=4278190335&((i&=1023)|i<<16))|
i<<8))|i<<4))|i<<2))<<2},i.deinterleave3=function(t,e)
{return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|
t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},i.nextCombination=function(t){var e=t|t-
1;return e+1|(~e&-~e)-1>>>r(t)+1};var
n=i.INT_BITS=32;i.INT_MAX=2147483647,i.INT_MIN=-1<<n-1;function r(t){var
e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-
=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var s=new Array(256);(function(t)
{for(var e=0;e<256;++e){var i=e,n=e,r=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=1&i,--
r;t[e]=n<<r&255}})(s)}),{}],314:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:1;s(this,t),this.r=e,this.g=i,this.b=n}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}},
{key:"clone",value:function(e){return new t(e.r,e.g,e.b)}},
{key:"copy",value:function(t,e){return t.r=e.r,t.g=e.g,t.b=e.b,t}},
{key:"set",value:function(t,e,i,n){return t.r=e,t.g=i,t.b=n,t}},
{key:"fromHex",value:function(t,e){var
i=(e>>16)/255,n=(e>>8&255)/255,r=(255&e)/255;return t.r=i,t.g=n,t.b=r,t}},
{key:"add",value:function(t,e,i){return t.r=e.r+i.r,t.g=e.g+i.g,t.b=e.b+i.b,t}},
{key:"subtract",value:function(t,e,i){return t.r=e.r-i.r,t.g=e.g-i.g,t.b=e.b-
i.b,t}},{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiply",value:function(t,e,i){return
t.r=e.r*i.r,t.g=e.g*i.g,t.b=e.b*i.b,t}},{key:"mul",value:function(e,i,n){return
t.multiply(e,i,n)}},{key:"divide",value:function(t,e,i){return
t.r=e.r/i.r,t.g=e.g/i.g,t.b=e.b/i.b,t}},{key:"div",value:function(e,i,n){return
t.divide(e,i,n)}},{key:"scale",value:function(t,e,i){return
t.r=e.r*i,t.g=e.g*i,t.b=e.b*i,t}},{key:"lerp",value:function(t,e,i,n){var
r=e.r,s=e.g,a=e.b;return t.r=r+n*(i.r-r),t.g=s+n*(i.g-s),t.b=a+n*(i.b-a),t}},
{key:"str",value:function(t){return"color3("+t.r+", "+t.g+", "+t.b+")"}},
{key:"array",value:function(t,e){var i=e instanceof cc.Color?1/255:1;return
t[0]=e.r*i,t[1]=e.g*i,t[2]=e.b*i,t}},{key:"exactEquals",value:function(t,e){return
t.r===e.r&&t.g===e.g&&t.b===e.b}},{key:"equals",value:function(t,e){var
i=t.r,n=t.g,s=t.b,a=e.r,o=e.g,l=e.b;return Math.abs(i-
a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-
o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(s-
l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))}},{key:"hex",value:function(t)
{return 255*t.r<<16|255*t.g<<8|255*t.b}}]),t})();i.default=a,e.exports=i.default}),
{"./utils":322}],315:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1;s(this,t),this.r=e,this.g=i,this.b=n,this.a=r}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1)}},
{key:"clone",value:function(e){return new t(e.r,e.g,e.b,e.a)}},
{key:"copy",value:function(t,e){return t.r=e.r,t.g=e.g,t.b=e.b,t.a=e.a,t}},
{key:"set",value:function(t,e,i,n,r){return t.r=e,t.g=i,t.b=n,t.a=r,t}},
{key:"fromHex",value:function(t,e){var
i=(e>>24)/255,n=(e>>16&255)/255,r=(e>>8&255)/255,s=(255&e)/255;return
t.r=i,t.g=n,t.b=r,t.a=s,t}},{key:"add",value:function(t,e,i){return
t.r=e.r+i.r,t.g=e.g+i.g,t.b=e.b+i.b,t.a=e.a+i.a,t}},
{key:"subtract",value:function(t,e,i){return t.r=e.r-i.r,t.g=e.g-i.g,t.b=e.b-
i.b,t.a=e.a-i.a,t}},{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiply",value:function(t,e,i){return
t.r=e.r*i.r,t.g=e.g*i.g,t.b=e.b*i.b,t.a=e.a*i.a,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"divide",value:function(t,e,i){return
t.r=e.r/i.r,t.g=e.g/i.g,t.b=e.b/i.b,t.a=e.a/i.a,t}},
{key:"div",value:function(e,i,n){return t.divide(e,i,n)}},
{key:"scale",value:function(t,e,i){return
t.r=e.r*i,t.g=e.g*i,t.b=e.b*i,t.a=e.a*i,t}},{key:"lerp",value:function(t,e,i,n){var
r=e.r,s=e.g,a=e.b,o=e.a;return t.r=r+n*(i.r-r),t.g=s+n*(i.g-s),t.b=a+n*(i.b-
a),t.a=o+n*(i.a-o),t}},{key:"str",value:function(t){return"color4("+t.r+", "+t.g+",
"+t.b+", "+t.a+")"}},{key:"array",value:function(t,e){var i=e instanceof cc.Color||
e.a>1?1/255:1;return t[0]=e.r*i,t[1]=e.g*i,t[2]=e.b*i,t[3]=e.a*i,t}},
{key:"exactEquals",value:function(t,e){return
t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}},{key:"equals",value:function(t,e){var
i=t.r,n=t.g,s=t.b,a=t.a,o=e.r,l=e.g,h=e.b,c=e.a;return Math.abs(i-
o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-
l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-
h)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(a-
c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}},{key:"hex",value:function(t)
{return(255*t.r<<24|255*t.g<<16|255*t.b<<8|255*t.a)>>>0}}]),t})
();i.default=a,e.exports=i.default}),{"./utils":322}],316:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.color4=i.color3=i.mat4=i.mat3=i.mat23=i.mat2=i.quat=i.vec4=i.vec3=i.vec2=i.bi
ts=void 0;var n=t("./utils");Object.keys(n).forEach((function(t){"default"!
==t&&"__esModule"!==t&&Object.defineProperty(i,t,{enumerable:!0,get:function()
{return n[t]}})}));var r=(function(t){if(t&&t.__esModule)return t;var e={};if(null!
=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return
e.default=t,e})
(t("./bits")),s=m(t("./vec2")),a=m(t("./vec3")),o=m(t("./vec4")),l=m(t("./quat")),h
=m(t("./mat2")),c=m(t("./mat23")),u=m(t("./mat3")),_=m(t("./mat4")),f=m(t("./color3
")),d=m(t("./color4"));function m(t){return t&&t.__esModule?t:
{default:t}}i.bits=r;i.vec2=s.default,i.vec3=a.default,i.vec4=o.default,i.quat=l.de
fault,i.mat2=h.default,i.mat23=c.default,i.mat3=u.default,i.mat4=_.default,i.color3
=f.default,i.color4=d.default,i.default={vec2:s.default,vec3:a.default,vec4:o.defau
lt,quat:l.default,mat2:h.default,mat23:c.default,mat3:u.default,mat4:_.default,colo
r3:f.default,color4:d.default}}),
{"./bits":313,"./color3":314,"./color4":315,"./mat2":317,"./mat23":318,"./mat3":319
,"./mat4":320,"./quat":321,"./utils":322,"./vec2":323,"./vec3":324,"./vec4":325}],3
17:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0});var n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1;s(this,t),this.m00=e,this.m01=i,this.m02=n,this.m03=r}return
n(t,null,[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1)}},
{key:"clone",value:function(e){return new t(e.m00,e.m01,e.m02,e.m03)}},
{key:"copy",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m03,t}},
{key:"identity",value:function(t){return t.m00=1,t.m01=0,t.m02=0,t.m03=1,t}},
{key:"set",value:function(t,e,i,n,r){return t.m00=e,t.m01=i,t.m02=n,t.m03=r,t}},
{key:"transpose",value:function(t,e){if(t===e){var i=e.m01;t.m01=e.m02,t.m02=i}else
t.m00=e.m00,t.m01=e.m02,t.m02=e.m01,t.m03=e.m03;return t}},
{key:"invert",value:function(t,e){var i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=i*s-
r*n;return a?(a=1/a,t.m00=s*a,t.m01=-n*a,t.m02=-r*a,t.m03=i*a,t):null}},
{key:"adjoint",value:function(t,e){var i=e.m00;return t.m00=e.m03,t.m01=-
e.m01,t.m02=-e.m02,t.m03=i,t}},{key:"determinant",value:function(t){return
t.m00*t.m03-t.m02*t.m01}},{key:"multiply",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=i.m00,l=i.m01,h=i.m02,c=i.m03;return
t.m00=n*o+s*l,t.m01=r*o+a*l,t.m02=n*h+s*c,t.m03=r*h+a*c,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"rotate",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=Math.sin(i),l=Math.cos(i);return
t.m00=n*l+s*o,t.m01=r*l+a*o,t.m02=n*-o+s*l,t.m03=r*-o+a*l,t}},
{key:"scale",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=i.x,l=i.y;return
t.m00=n*o,t.m01=r*o,t.m02=s*l,t.m03=a*l,t}},{key:"fromRotation",value:function(t,e)
{var i=Math.sin(e),n=Math.cos(e);return t.m00=n,t.m01=i,t.m02=-i,t.m03=n,t}},
{key:"fromScaling",value:function(t,e){return
t.m00=e.x,t.m01=0,t.m02=0,t.m03=e.y,t}},{key:"str",value:function(t)
{return"mat2("+t.m00+", "+t.m01+", "+t.m02+", "+t.m03+")"}},
{key:"array",value:function(t,e){return
t[0]=e.m00,t[1]=e.m01,t[2]=e.m02,t[3]=e.m03,t}},{key:"frob",value:function(t)
{return
Math.sqrt(Math.pow(t.m00,2)+Math.pow(t.m01,2)+Math.pow(t.m02,2)+Math.pow(t.m03,2))}
},{key:"LDU",value:function(t,e,i,n)
{t.m02=n.m02/n.m00,i.m00=n.m00,i.m01=n.m01,i.m03=n.m03-t.m02*i.m01}},
{key:"add",value:function(t,e,i){return
t.m00=e.m00+i.m00,t.m01=e.m01+i.m01,t.m02=e.m02+i.m02,t.m03=e.m03+i.m03,t}},
{key:"subtract",value:function(t,e,i){return t.m00=e.m00-i.m00,t.m01=e.m01-
i.m01,t.m02=e.m02-i.m02,t.m03=e.m03-i.m03,t}},{key:"sub",value:function(e,i,n)
{return t.subtract(e,i,n)}},{key:"exactEquals",value:function(t,e){return
t.m00===e.m00&&t.m01===e.m01&&t.m02===e.m02&&t.m03===e.m03}},
{key:"equals",value:function(t,e){var
i=t.m00,n=t.m01,s=t.m02,a=t.m03,o=e.m00,l=e.m01,h=e.m02,c=e.m03;return Math.abs(i-
o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-
l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-
h)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(a-
c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}},
{key:"multiplyScalar",value:function(t,e,i){return
t.m00=e.m00*i,t.m01=e.m01*i,t.m02=e.m02*i,t.m03=e.m03*i,t}},
{key:"multiplyScalarAndAdd",value:function(t,e,i,n){return
t.m00=e.m00+i.m00*n,t.m01=e.m01+i.m01*n,t.m02=e.m02+i.m02*n,t.m03=e.m03+i.m03*n,t}}
]),t})();i.default=a,e.exports=i.default}),{"./utils":322}],318:[(function(t,e,i)
{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function()
{function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?
arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?
arguments[5]:0;s(this,t),this.m00=e,this.m01=i,this.m02=n,this.m03=r,this.m04=a,thi
s.m05=o}return n(t,null,[{key:"create",value:function(){return new
t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,arguments.length>1&&void
0!==arguments[1]?arguments[1]:0,arguments.length>2&&void
0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1,arguments.length>4&&void 0!==arguments[4]?
arguments[4]:0,arguments.length>5&&void 0!==arguments[5]?arguments[5]:0)}},
{key:"clone",value:function(e){return new t(e.m00,e.m01,e.m02,e.m03,e.m04,e.m05)}},
{key:"copy",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m03,t.m04=e.m04,t.m05=e.m05,t}},
{key:"identity",value:function(t){return
t.m00=1,t.m01=0,t.m02=0,t.m03=1,t.m04=0,t.m05=0,t}},
{key:"set",value:function(t,e,i,n,r,s,a){return
t.m00=e,t.m01=i,t.m02=n,t.m03=r,t.m04=s,t.m05=a,t}},
{key:"invert",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=i*s-n*r;return l?
(l=1/l,t.m00=s*l,t.m01=-n*l,t.m02=-r*l,t.m03=i*l,t.m04=(r*o-s*a)*l,t.m05=(n*a-
i*o)*l,t):null}},{key:"determinant",value:function(t){return t.m00*t.m03-
t.m01*t.m02}},{key:"multiply",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=i.m00,c=i.m01,u=i.m02,_=i.m03,f=i
.m04,d=i.m05;return
t.m00=n*h+s*c,t.m01=r*h+a*c,t.m02=n*u+s*_,t.m03=r*u+a*_,t.m04=n*f+s*d+o,t.m05=r*f+a
*d+l,t}},{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"rotate",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=Math.sin(i),c=Math.cos(i);return
t.m00=n*c+s*h,t.m01=r*c+a*h,t.m02=n*-h+s*c,t.m03=r*-h+a*c,t.m04=o,t.m05=l,t}},
{key:"scale",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=i.x,c=i.y;return
t.m00=n*h,t.m01=r*h,t.m02=s*c,t.m03=a*c,t.m04=o,t.m05=l,t}},
{key:"translate",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=i.x,c=i.y;return
t.m00=n,t.m01=r,t.m02=s,t.m03=a,t.m04=n*h+s*c+o,t.m05=r*h+a*c+l,t}},
{key:"fromRotation",value:function(t,e){var i=Math.sin(e),n=Math.cos(e);return
t.m00=n,t.m01=i,t.m02=-i,t.m03=n,t.m04=0,t.m05=0,t}},
{key:"fromScaling",value:function(t,e){return
t.m00=e.m00,t.m01=0,t.m02=0,t.m03=e.m01,t.m04=0,t.m05=0,t}},
{key:"fromTranslation",value:function(t,e){return
t.m00=1,t.m01=0,t.m02=0,t.m03=1,t.m04=e.x,t.m05=e.y,t}},
{key:"fromRTS",value:function(t,e,i,n){var r=Math.sin(e),s=Math.cos(e);return
t.m00=s*n.x,t.m01=r*n.x,t.m02=-r*n.y,t.m03=s*n.y,t.m04=i.x,t.m05=i.y,t}},
{key:"str",value:function(t){return"mat23("+t.m00+", "+t.m01+", "+t.m02+",
"+t.m03+", "+t.m04+", "+t.m05+")"}},{key:"array",value:function(t,e){return
t[0]=e.m00,t[1]=e.m01,t[2]=e.m02,t[3]=e.m03,t[4]=e.m04,t[5]=e.m05,t}},
{key:"array4x4",value:function(t,e){return
t[0]=e.m00,t[1]=e.m01,t[2]=0,t[3]=0,t[4]=e.m02,t[5]=e.m03,t[6]=0,t[7]=0,t[8]=0,t[9]
=0,t[10]=1,t[11]=0,t[12]=e.m04,t[13]=e.m05,t[14]=0,t[15]=1,t}},
{key:"frob",value:function(t){return
Math.sqrt(Math.pow(t.m00,2)+Math.pow(t.m01,2)+Math.pow(t.m02,2)+Math.pow(t.m03,2)+M
ath.pow(t.m04,2)+Math.pow(t.m05,2)+1)}},{key:"add",value:function(t,e,i){return
t.m00=e.m00+i.m00,t.m01=e.m01+i.m01,t.m02=e.m02+i.m02,t.m03=e.m03+i.m03,t.m04=e.m04
+i.m04,t.m05=e.m05+i.m05,t}},{key:"subtract",value:function(t,e,i){return
t.m00=e.m00-i.m00,t.m01=e.m01-i.m01,t.m02=e.m02-i.m02,t.m03=e.m03-
i.m03,t.m04=e.m04-i.m04,t.m05=e.m05-i.m05,t}},{key:"sub",value:function(e,i,n)
{return t.subtract(e,i,n)}},{key:"multiplyScalar",value:function(t,e,i){return
t.m00=e.m00*i,t.m01=e.m01*i,t.m02=e.m02*i,t.m03=e.m03*i,t.m04=e.m04*i,t.m05=e.m05*i
,t}},{key:"multiplyScalarAndAdd",value:function(t,e,i,n){return
t.m00=e.m00+i.m00*n,t.m01=e.m01+i.m01*n,t.m02=e.m02+i.m02*n,t.m03=e.m03+i.m03*n,t.m
04=e.m04+i.m04*n,t.m05=e.m05+i.m05*n,t}},{key:"exactEquals",value:function(t,e)
{return
t.m00===e.m00&&t.m01===e.m01&&t.m02===e.m02&&t.m03===e.m03&&t.m04===e.m04&&t.m05===
e.m05}},{key:"equals",value:function(t,e){var
i=t.m00,n=t.m01,s=t.m02,a=t.m03,o=t.m04,l=t.m05,h=e.m00,c=e.m01,u=e.m02,_=e.m03,f=e
.m04,d=e.m05;return Math.abs(i-
h)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(n-
c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(s-
u)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-
_)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-
f)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(l-
d)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(d))}}]),t})
();i.default=a,e.exports=i.default}),{"./utils":322}],319:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils"),s=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vec3"));function a(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var o=(function()
{function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?
arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?
arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?
arguments[6]:0,h=arguments.length>7&&void 0!==arguments[7]?
arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?
arguments[8]:1;a(this,t),this.m00=e,this.m01=i,this.m02=n,this.m03=r,this.m04=s,thi
s.m05=o,this.m06=l,this.m07=h,this.m08=c}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?
arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?
arguments[4]:1,arguments.length>5&&void 0!==arguments[5]?
arguments[5]:0,arguments.length>6&&void 0!==arguments[6]?
arguments[6]:0,arguments.length>7&&void 0!==arguments[7]?
arguments[7]:0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:1)}},
{key:"clone",value:function(e){return new
t(e.m00,e.m01,e.m02,e.m03,e.m04,e.m05,e.m06,e.m07,e.m08)}},
{key:"copy",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m03,t.m04=e.m04,t.m05=e.m05,t.m06=e.m06
,t.m07=e.m07,t.m08=e.m08,t}},{key:"set",value:function(t,e,i,n,r,s,a,o,l,h){return
t.m00=e,t.m01=i,t.m02=n,t.m03=r,t.m04=s,t.m05=a,t.m06=o,t.m07=l,t.m08=h,t}},
{key:"identity",value:function(t){return
t.m00=1,t.m01=0,t.m02=0,t.m03=0,t.m04=1,t.m05=0,t.m06=0,t.m07=0,t.m08=1,t}},
{key:"transpose",value:function(t,e){if(t===e){var
i=e.m01,n=e.m02,r=e.m05;t.m01=e.m03,t.m02=e.m06,t.m03=i,t.m05=e.m07,t.m06=n,t.m07=r
}else
t.m00=e.m00,t.m01=e.m03,t.m02=e.m06,t.m03=e.m01,t.m04=e.m04,t.m05=e.m07,t.m06=e.m02
,t.m07=e.m05,t.m08=e.m08;return t}},{key:"invert",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=e.m06,h=e.m07,c=e.m08,u=c*a-
o*h,_=-c*s+o*l,f=h*s-a*l,d=i*u+n*_+r*f;return d?(d=1/d,t.m00=u*d,t.m01=(-
c*n+r*h)*d,t.m02=(o*n-r*a)*d,t.m03=_*d,t.m04=(c*i-r*l)*d,t.m05=(-
o*i+r*s)*d,t.m06=f*d,t.m07=(-h*i+n*l)*d,t.m08=(a*i-n*s)*d,t):null}},
{key:"adjoint",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=e.m06,h=e.m07,c=e.m08;return
t.m00=a*c-o*h,t.m01=r*h-n*c,t.m02=n*o-r*a,t.m03=o*l-s*c,t.m04=i*c-r*l,t.m05=r*s-
i*o,t.m06=s*h-a*l,t.m07=n*l-i*h,t.m08=i*a-n*s,t}},
{key:"determinant",value:function(t){var
e=t.m00,i=t.m01,n=t.m02,r=t.m03,s=t.m04,a=t.m05,o=t.m06,l=t.m07,h=t.m08;return
e*(h*s-a*l)+i*(-h*r+a*o)+n*(l*r-s*o)}},{key:"multiply",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=e.m06,c=e.m07,u=e.m08,_=i.m00,f=i
.m01,d=i.m02,m=i.m03,p=i.m04,v=i.m05,y=i.m06,g=i.m07,x=i.m08;return
t.m00=_*n+f*a+d*h,t.m01=_*r+f*o+d*c,t.m02=_*s+f*l+d*u,t.m03=m*n+p*a+v*h,t.m04=m*r+p
*o+v*c,t.m05=m*s+p*l+v*u,t.m06=y*n+g*a+x*h,t.m07=y*r+g*o+x*c,t.m08=y*s+g*l+x*u,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"translate",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=e.m06,c=e.m07,u=e.m08,_=i.x,f=i.y
;return
t.m00=n,t.m01=r,t.m02=s,t.m03=a,t.m04=o,t.m05=l,t.m06=_*n+f*a+h,t.m07=_*r+f*o+c,t.m
08=_*s+f*l+u,t}},{key:"rotate",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=e.m06,c=e.m07,u=e.m08,_=Math.sin(
i),f=Math.cos(i);return t.m00=f*n+_*a,t.m01=f*r+_*o,t.m02=f*s+_*l,t.m03=f*a-
_*n,t.m04=f*o-_*r,t.m05=f*l-_*s,t.m06=h,t.m07=c,t.m08=u,t}},
{key:"scale",value:function(t,e,i){var n=i.x,r=i.y;return
t.m00=n*e.m00,t.m01=n*e.m01,t.m02=n*e.m02,t.m03=r*e.m03,t.m04=r*e.m04,t.m05=r*e.m05
,t.m06=e.m06,t.m07=e.m07,t.m08=e.m08,t}},{key:"fromMat4",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m04,t.m04=e.m05,t.m05=e.m06,t.m06=e.m08
,t.m07=e.m09,t.m08=e.m10,t}},{key:"fromTranslation",value:function(t,e){return
t.m00=1,t.m01=0,t.m02=0,t.m03=0,t.m04=1,t.m05=0,t.m06=e.x,t.m07=e.y,t.m08=1,t}},
{key:"fromRotation",value:function(t,e){var i=Math.sin(e),n=Math.cos(e);return
t.m00=n,t.m01=i,t.m02=0,t.m03=-i,t.m04=n,t.m05=0,t.m06=0,t.m07=0,t.m08=1,t}},
{key:"fromScaling",value:function(t,e){return
t.m00=e.x,t.m01=0,t.m02=0,t.m03=0,t.m04=e.y,t.m05=0,t.m06=0,t.m07=0,t.m08=1,t}},
{key:"fromMat2d",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=0,t.m03=e.m02,t.m04=e.m03,t.m05=0,t.m06=e.m04,t.m07=e
.m05,t.m08=1,t}},{key:"fromQuat",value:function(t,e){var
i=e.x,n=e.y,r=e.z,s=e.w,a=i+i,o=n+n,l=r+r,h=i*a,c=n*a,u=n*o,_=r*a,f=r*o,d=r*l,m=s*a
,p=s*o,v=s*l;return t.m00=1-u-d,t.m03=c-v,t.m06=_+p,t.m01=c+v,t.m04=1-h-d,t.m07=f-
m,t.m02=_-p,t.m05=f+m,t.m08=1-h-u,t}},{key:"fromViewUp",value:function(e,i,n)
{return (function(){var
e=s.default.create(0,1,0),i=s.default.create(0,0,0),n=s.default.create(0,0,0);retur
n function(a,o,l){return s.default.sqrMag(o)<r.EPSILON*r.EPSILON?(t.identity(a),a):
(l=l||
e,s.default.normalize(i,s.default.cross(i,l,o)),s.default.sqrMag(i)<r.EPSILON*r.EPS
ILON?(t.identity(a),a):
(s.default.cross(n,o,i),t.set(a,i.x,i.y,i.z,n.x,n.y,n.z,o.x,o.y,o.z),a))}})()
(e,i,n)}},{key:"normalFromMat4",value:function(t,e){var

i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=e.m06,h=e.m07,c=e.m08,u=e.m09,_=e
.m10,f=e.m11,d=e.m12,m=e.m13,p=e.m14,v=e.m15,y=i*o-n*a,g=i*l-r*a,x=i*h-s*a,b=n*l-
r*o,A=n*h-s*o,C=r*h-s*l,S=c*m-u*d,T=c*p-_*d,w=c*v-f*d,E=u*p-_*m,M=u*v-f*m,D=_*v-
f*p,B=y*D-g*M+x*E+b*w-A*T+C*S;return B?(B=1/B,t.m00=(o*D-l*M+h*E)*B,t.m01=(l*w-a*D-
h*T)*B,t.m02=(a*M-o*w+h*S)*B,t.m03=(r*M-n*D-s*E)*B,t.m04=(i*D-
r*w+s*T)*B,t.m05=(n*w-i*M-s*S)*B,t.m06=(m*C-p*A+v*b)*B,t.m07=(p*x-d*C-
v*g)*B,t.m08=(d*A-m*x+v*y)*B,t):null}},{key:"str",value:function(t)
{return"mat3("+t.m00+", "+t.m01+", "+t.m02+", "+t.m03+", "+t.m04+", "+t.m05+",
"+t.m06+", "+t.m07+", "+t.m08+")"}},{key:"array",value:function(t,e){return
t[0]=e.m00,t[1]=e.m01,t[2]=e.m02,t[3]=e.m03,t[4]=e.m04,t[5]=e.m05,t[6]=e.m06,t[7]=e
.m07,t[8]=e.m08,t}},{key:"frob",value:function(t){return
Math.sqrt(Math.pow(t.m00,2)+Math.pow(t.m01,2)+Math.pow(t.m02,2)+Math.pow(t.m03,2)+M
ath.pow(t.m04,2)+Math.pow(t.m05,2)+Math.pow(t.m06,2)+Math.pow(t.m07,2)+Math.pow(t.m
08,2))}},{key:"add",value:function(t,e,i){return
t.m00=e.m00+i.m00,t.m01=e.m01+i.m01,t.m02=e.m02+i.m02,t.m03=e.m03+i.m03,t.m04=e.m04
+i.m04,t.m05=e.m05+i.m05,t.m06=e.m06+i.m06,t.m07=e.m07+i.m07,t.m08=e.m08+i.m08,t}},
{key:"subtract",value:function(t,e,i){return t.m00=e.m00-i.m00,t.m01=e.m01-
i.m01,t.m02=e.m02-i.m02,t.m03=e.m03-i.m03,t.m04=e.m04-i.m04,t.m05=e.m05-
i.m05,t.m06=e.m06-i.m06,t.m07=e.m07-i.m07,t.m08=e.m08-i.m08,t}},
{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiplyScalar",value:function(t,e,i){return
t.m00=e.m00*i,t.m01=e.m01*i,t.m02=e.m02*i,t.m03=e.m03*i,t.m04=e.m04*i,t.m05=e.m05*i
,t.m06=e.m06*i,t.m07=e.m07*i,t.m08=e.m08*i,t}},
{key:"multiplyScalarAndAdd",value:function(t,e,i,n){return
t.m00=e.m00+i.m00*n,t.m01=e.m01+i.m01*n,t.m02=e.m02+i.m02*n,t.m03=e.m03+i.m03*n,t.m
04=e.m04+i.m04*n,t.m05=e.m05+i.m05*n,t.m06=e.m06+i.m06*n,t.m07=e.m07+i.m07*n,t.m08=
e.m08+i.m08*n,t}},{key:"exactEquals",value:function(t,e){return
t.m00===e.m00&&t.m01===e.m01&&t.m02===e.m02&&t.m03===e.m03&&t.m04===e.m04&&t.m05===
e.m05&&t.m06===e.m06&&t.m07===e.m07&&t.m08===e.m08}},
{key:"equals",value:function(t,e){var
i=t.m00,n=t.m01,s=t.m02,a=t.m03,o=t.m04,l=t.m05,h=t.m06,c=t.m07,u=t.m08,_=e.m00,f=e
.m01,d=e.m02,m=e.m03,p=e.m04,v=e.m05,y=e.m06,g=e.m07,x=e.m08;return Math.abs(i-
_)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(n-
f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(s-
d)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-
m)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-
p)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(l-
v)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(h-
y)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(c-
g)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(u-
x)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(x))}}]),t})
();i.default=o,e.exports=i.default}),{"./utils":322,"./vec3":324}],320:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?
arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?
arguments[5]:1,l=arguments.length>6&&void 0!==arguments[6]?
arguments[6]:0,h=arguments.length>7&&void 0!==arguments[7]?
arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?
arguments[8]:0,u=arguments.length>9&&void 0!==arguments[9]?
arguments[9]:0,_=arguments.length>10&&void 0!==arguments[10]?
arguments[10]:1,f=arguments.length>11&&void 0!==arguments[11]?
arguments[11]:0,d=arguments.length>12&&void 0!==arguments[12]?
arguments[12]:0,m=arguments.length>13&&void 0!==arguments[13]?
arguments[13]:0,p=arguments.length>14&&void 0!==arguments[14]?
arguments[14]:0,v=arguments.length>15&&void 0!==arguments[15]?
arguments[15]:1;s(this,t),this.m00=e,this.m01=i,this.m02=n,this.m03=r,this.m04=a,th
is.m05=o,this.m06=l,this.m07=h,this.m08=c,this.m09=u,this.m10=_,this.m11=f,this.m12
=d,this.m13=m,this.m14=p,this.m15=v}return n(t,null,[{key:"create",value:function()
{return new t(arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?
arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?
arguments[4]:0,arguments.length>5&&void 0!==arguments[5]?
arguments[5]:1,arguments.length>6&&void 0!==arguments[6]?
arguments[6]:0,arguments.length>7&&void 0!==arguments[7]?
arguments[7]:0,arguments.length>8&&void 0!==arguments[8]?
arguments[8]:0,arguments.length>9&&void 0!==arguments[9]?
arguments[9]:0,arguments.length>10&&void 0!==arguments[10]?
arguments[10]:1,arguments.length>11&&void 0!==arguments[11]?
arguments[11]:0,arguments.length>12&&void 0!==arguments[12]?
arguments[12]:0,arguments.length>13&&void 0!==arguments[13]?
arguments[13]:0,arguments.length>14&&void 0!==arguments[14]?
arguments[14]:0,arguments.length>15&&void 0!==arguments[15]?arguments[15]:1)}},
{key:"clone",value:function(e){return new
t(e.m00,e.m01,e.m02,e.m03,e.m04,e.m05,e.m06,e.m07,e.m08,e.m09,e.m10,e.m11,e.m12,e.m
13,e.m14,e.m15)}},{key:"copy",value:function(t,e){return
t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m03,t.m04=e.m04,t.m05=e.m05,t.m06=e.m06
,t.m07=e.m07,t.m08=e.m08,t.m09=e.m09,t.m10=e.m10,t.m11=e.m11,t.m12=e.m12,t.m13=e.m1
3,t.m14=e.m14,t.m15=e.m15,t}},
{key:"set",value:function(t,e,i,n,r,s,a,o,l,h,c,u,_,f,d,m,p){return
t.m00=e,t.m01=i,t.m02=n,t.m03=r,t.m04=s,t.m05=a,t.m06=o,t.m07=l,t.m08=h,t.m09=c,t.m
10=u,t.m11=_,t.m12=f,t.m13=d,t.m14=m,t.m15=p,t}},{key:"identity",value:function(t)
{return
t.m00=1,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=1,t.m06=0,t.m07=0,t.m08=0,t.m09=0,t.m
10=1,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t.m15=1,t}},
{key:"transpose",value:function(t,e){if(t===e){var
i=e.m01,n=e.m02,r=e.m03,s=e.m06,a=e.m07,o=e.m11;t.m01=e.m04,t.m02=e.m08,t.m03=e.m12
,t.m04=i,t.m06=e.m09,t.m07=e.m13,t.m08=n,t.m09=s,t.m11=e.m14,t.m12=r,t.m13=a,t.m14=
o}else
t.m00=e.m00,t.m01=e.m04,t.m02=e.m08,t.m03=e.m12,t.m04=e.m01,t.m05=e.m05,t.m06=e.m09
,t.m07=e.m13,t.m08=e.m02,t.m09=e.m06,t.m10=e.m10,t.m11=e.m14,t.m12=e.m03,t.m13=e.m0
7,t.m14=e.m11,t.m15=e.m15;return t}},{key:"invert",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=e.m06,h=e.m07,c=e.m08,u=e.m09,_=e
.m10,f=e.m11,d=e.m12,m=e.m13,p=e.m14,v=e.m15,y=i*o-n*a,g=i*l-r*a,x=i*h-s*a,b=n*l-
r*o,A=n*h-s*o,C=r*h-s*l,S=c*m-u*d,T=c*p-_*d,w=c*v-f*d,E=u*p-_*m,M=u*v-f*m,D=_*v-
f*p,B=y*D-g*M+x*E+b*w-A*T+C*S;return B?(B=1/B,t.m00=(o*D-l*M+h*E)*B,t.m01=(r*M-n*D-
s*E)*B,t.m02=(m*C-p*A+v*b)*B,t.m03=(_*A-u*C-f*b)*B,t.m04=(l*w-a*D-
h*T)*B,t.m05=(i*D-r*w+s*T)*B,t.m06=(p*x-d*C-v*g)*B,t.m07=(c*C-
_*x+f*g)*B,t.m08=(a*M-o*w+h*S)*B,t.m09=(n*w-i*M-s*S)*B,t.m10=(d*A-
m*x+v*y)*B,t.m11=(u*x-c*A-f*y)*B,t.m12=(o*T-a*E-l*S)*B,t.m13=(i*E-
n*T+r*S)*B,t.m14=(m*g-d*b-p*y)*B,t.m15=(c*b-u*g+_*y)*B,t):null}},
{key:"adjoint",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m03,a=e.m04,o=e.m05,l=e.m06,h=e.m07,c=e.m08,u=e.m09,_=e
.m10,f=e.m11,d=e.m12,m=e.m13,p=e.m14,v=e.m15;return t.m00=o*(_*v-f*p)-u*(l*v-h*p)
+m*(l*f-h*_),t.m01=-(n*(_*v-f*p)-u*(r*v-s*p)+m*(r*f-s*_)),t.m02=n*(l*v-h*p)-o*(r*v-
s*p)+m*(r*h-s*l),t.m03=-(n*(l*f-h*_)-o*(r*f-s*_)+u*(r*h-s*l)),t.m04=-(a*(_*v-f*p)-
c*(l*v-h*p)+d*(l*f-h*_)),t.m05=i*(_*v-f*p)-c*(r*v-s*p)+d*(r*f-s*_),t.m06=-(i*(l*v-
h*p)-a*(r*v-s*p)+d*(r*h-s*l)),t.m07=i*(l*f-h*_)-a*(r*f-s*_)+c*(r*h-
s*l),t.m08=a*(u*v-f*m)-c*(o*v-h*m)+d*(o*f-h*u),t.m09=-(i*(u*v-f*m)-c*(n*v-s*m)
+d*(n*f-s*u)),t.m10=i*(o*v-h*m)-a*(n*v-s*m)+d*(n*h-s*o),t.m11=-(i*(o*f-h*u)-a*(n*f-
s*u)+c*(n*h-s*o)),t.m12=-(a*(u*p-_*m)-c*(o*p-l*m)+d*(o*_-l*u)),t.m13=i*(u*p-_*m)-
c*(n*p-r*m)+d*(n*_-r*u),t.m14=-(i*(o*p-l*m)-a*(n*p-r*m)+d*(n*l-r*o)),t.m15=i*(o*_-
l*u)-a*(n*_-r*u)+c*(n*l-r*o),t}},{key:"determinant",value:function(t){var
e=t.m00,i=t.m01,n=t.m02,r=t.m03,s=t.m04,a=t.m05,o=t.m06,l=t.m07,h=t.m08,c=t.m09,u=t
.m10,_=t.m11,f=t.m12,d=t.m13,m=t.m14,p=t.m15;return(e*a-i*s)*(u*p-_*m)-(e*o-
n*s)*(c*p-_*d)+(e*l-r*s)*(c*m-u*d)+(i*o-n*a)*(h*p-_*f)-(i*l-r*a)*(h*m-u*f)+(n*l-
r*o)*(h*d-c*f)}},{key:"multiply",value:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m02,a=e.m03,o=e.m04,l=e.m05,h=e.m06,c=e.m07,u=e.m08,_=e.m09,f=e
.m10,d=e.m11,m=e.m12,p=e.m13,v=e.m14,y=e.m15,g=i.m00,x=i.m01,b=i.m02,A=i.m03;return
t.m00=g*n+x*o+b*u+A*m,t.m01=g*r+x*l+b*_+A*p,t.m02=g*s+x*h+b*f+A*v,t.m03=g*a+x*c+b*d
+A*y,g=i.m04,x=i.m05,b=i.m06,A=i.m07,t.m04=g*n+x*o+b*u+A*m,t.m05=g*r+x*l+b*_+A*p,t.
m06=g*s+x*h+b*f+A*v,t.m07=g*a+x*c+b*d+A*y,g=i.m08,x=i.m09,b=i.m10,A=i.m11,t.m08=g*n
+x*o+b*u+A*m,t.m09=g*r+x*l+b*_+A*p,t.m10=g*s+x*h+b*f+A*v,t.m11=g*a+x*c+b*d+A*y,g=i.
m12,x=i.m13,b=i.m14,A=i.m15,t.m12=g*n+x*o+b*u+A*m,t.m13=g*r+x*l+b*_+A*p,t.m14=g*s+x
*h+b*f+A*v,t.m15=g*a+x*c+b*d+A*y,t}},{key:"mul",value:function(e,i,n){return
t.multiply(e,i,n)}},{key:"translate",value:function(t,e,i){var
n=i.x,r=i.y,s=i.z,a=void 0,o=void 0,l=void 0,h=void 0,c=void 0,u=void 0,_=void
0,f=void 0,d=void 0,m=void 0,p=void 0,v=void 0;return e===t?
(t.m12=e.m00*n+e.m04*r+e.m08*s+e.m12,t.m13=e.m01*n+e.m05*r+e.m09*s+e.m13,t.m14=e.m0
2*n+e.m06*r+e.m10*s+e.m14,t.m15=e.m03*n+e.m07*r+e.m11*s+e.m15):
(a=e.m00,o=e.m01,l=e.m02,h=e.m03,c=e.m04,u=e.m05,_=e.m06,f=e.m07,d=e.m08,m=e.m09,p=
e.m10,v=e.m11,t.m00=a,t.m01=o,t.m02=l,t.m03=h,t.m04=c,t.m05=u,t.m06=_,t.m07=f,t.m08
=d,t.m09=m,t.m10=p,t.m11=v,t.m12=a*n+c*r+d*s+e.m12,t.m13=o*n+u*r+m*s+e.m13,t.m14=l*
n+_*r+p*s+e.m14,t.m15=h*n+f*r+v*s+e.m15),t}},{key:"scale",value:function(t,e,i){var
n=i.x,r=i.y,s=i.z;return
t.m00=e.m00*n,t.m01=e.m01*n,t.m02=e.m02*n,t.m03=e.m03*n,t.m04=e.m04*r,t.m05=e.m05*r
,t.m06=e.m06*r,t.m07=e.m07*r,t.m08=e.m08*s,t.m09=e.m09*s,t.m10=e.m10*s,t.m11=e.m11*
s,t.m12=e.m12,t.m13=e.m13,t.m14=e.m14,t.m15=e.m15,t}},
{key:"rotate",value:function(t,e,i,n){var
s,a,o,l,h,c,u,_,f,d,m,p,v,y,g,x,b,A,C,S,T,w,E,M,D=n.x,B=n.y,P=n.z,I=Math.sqrt(D*D+B
*B+P*P);return Math.abs(I)<r.EPSILON?null:(D*=I=1/I,B*=I,P*=I,s=Math.sin(i),o=1-
(a=Math.cos(i)),l=e.m00,h=e.m01,c=e.m02,u=e.m03,_=e.m04,f=e.m05,d=e.m06,m=e.m07,p=e
.m08,v=e.m09,y=e.m10,g=e.m11,x=D*D*o+a,b=B*D*o+P*s,A=P*D*o-B*s,C=D*B*o-
P*s,S=B*B*o+a,T=P*B*o+D*s,w=D*P*o+B*s,E=B*P*o-
D*s,M=P*P*o+a,t.m00=l*x+_*b+p*A,t.m01=h*x+f*b+v*A,t.m02=c*x+d*b+y*A,t.m03=u*x+m*b+g
*A,t.m04=l*C+_*S+p*T,t.m05=h*C+f*S+v*T,t.m06=c*C+d*S+y*T,t.m07=u*C+m*S+g*T,t.m08=l*
w+_*E+p*M,t.m09=h*w+f*E+v*M,t.m10=c*w+d*E+y*M,t.m11=u*w+m*E+g*M,e!
==t&&(t.m12=e.m12,t.m13=e.m13,t.m14=e.m14,t.m15=e.m15),t)}},
{key:"rotateX",value:function(t,e,i){var
n=Math.sin(i),r=Math.cos(i),s=e.m04,a=e.m05,o=e.m06,l=e.m07,h=e.m08,c=e.m09,u=e.m10
,_=e.m11;return e!
==t&&(t.m00=e.m00,t.m01=e.m01,t.m02=e.m02,t.m03=e.m03,t.m12=e.m12,t.m13=e.m13,t.m14
=e.m14,t.m15=e.m15),t.m04=s*r+h*n,t.m05=a*r+c*n,t.m06=o*r+u*n,t.m07=l*r+_*n,t.m08=h
*r-s*n,t.m09=c*r-a*n,t.m10=u*r-o*n,t.m11=_*r-l*n,t}},
{key:"rotateY",value:function(t,e,i){var
n=Math.sin(i),r=Math.cos(i),s=e.m00,a=e.m01,o=e.m02,l=e.m03,h=e.m08,c=e.m09,u=e.m10
,_=e.m11;return e!
==t&&(t.m04=e.m04,t.m05=e.m05,t.m06=e.m06,t.m07=e.m07,t.m12=e.m12,t.m13=e.m13,t.m14
=e.m14,t.m15=e.m15),t.m00=s*r-h*n,t.m01=a*r-c*n,t.m02=o*r-u*n,t.m03=l*r-
_*n,t.m08=s*n+h*r,t.m09=a*n+c*r,t.m10=o*n+u*r,t.m11=l*n+_*r,t}},
{key:"rotateZ",value:function(t,e,i){var
n=Math.sin(i),r=Math.cos(i),s=e.m00,a=e.m01,o=e.m02,l=e.m03,h=e.m04,c=e.m05,u=e.m06
,_=e.m07;return e!
==t&&(t.m08=e.m08,t.m09=e.m09,t.m10=e.m10,t.m11=e.m11,t.m12=e.m12,t.m13=e.m13,t.m14
=e.m14,t.m15=e.m15),t.m00=s*r+h*n,t.m01=a*r+c*n,t.m02=o*r+u*n,t.m03=l*r+_*n,t.m04=h
*r-s*n,t.m05=c*r-a*n,t.m06=u*r-o*n,t.m07=_*r-l*n,t}},
{key:"fromTranslation",value:function(t,e){return
t.m00=1,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=1,t.m06=0,t.m07=0,t.m08=0,t.m09=0,t.m
10=1,t.m11=0,t.m12=e.x,t.m13=e.y,t.m14=e.z,t.m15=1,t}},
{key:"fromScaling",value:function(t,e){return
t.m00=e.x,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=e.y,t.m06=0,t.m07=0,t.m08=0,t.m09=0
,t.m10=e.z,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t.m15=1,t}},
{key:"fromRotation",value:function(t,e,i){var
n,s,a,o=i.x,l=i.y,h=i.z,c=Math.sqrt(o*o+l*l+h*h);return Math.abs(c)<r.EPSILON?null:
(o*=c=1/c,l*=c,h*=c,n=Math.sin(e),a=1-
(s=Math.cos(e)),t.m00=o*o*a+s,t.m01=l*o*a+h*n,t.m02=h*o*a-l*n,t.m03=0,t.m04=o*l*a-
h*n,t.m05=l*l*a+s,t.m06=h*l*a+o*n,t.m07=0,t.m08=o*h*a+l*n,t.m09=l*h*a-
o*n,t.m10=h*h*a+s,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t.m15=1,t)}},
{key:"fromXRotation",value:function(t,e){var i=Math.sin(e),n=Math.cos(e);return
t.m00=1,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=n,t.m06=i,t.m07=0,t.m08=0,t.m09=-
i,t.m10=n,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t.m15=1,t}},
{key:"fromYRotation",value:function(t,e){var i=Math.sin(e),n=Math.cos(e);return
t.m00=n,t.m01=0,t.m02=-
i,t.m03=0,t.m04=0,t.m05=1,t.m06=0,t.m07=0,t.m08=i,t.m09=0,t.m10=n,t.m11=0,t.m12=0,t
.m13=0,t.m14=0,t.m15=1,t}},{key:"fromZRotation",value:function(t,e){var
i=Math.sin(e),n=Math.cos(e);return t.m00=n,t.m01=i,t.m02=0,t.m03=0,t.m04=-
i,t.m05=n,t.m06=0,t.m07=0,t.m08=0,t.m09=0,t.m10=1,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t
.m15=1,t}},{key:"fromRT",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=e.w,o=n+n,l=r+r,h=s+s,c=n*o,u=n*l,_=n*h,f=r*l,d=r*h,m=s*h,p=a*o
,v=a*l,y=a*h;return t.m00=1-(f+m),t.m01=u+y,t.m02=_-v,t.m03=0,t.m04=u-y,t.m05=1-
(c+m),t.m06=d+p,t.m07=0,t.m08=_+v,t.m09=d-p,t.m10=1-
(c+f),t.m11=0,t.m12=i.x,t.m13=i.y,t.m14=i.z,t.m15=1,t}},
{key:"getTranslation",value:function(t,e){return t.x=e.m12,t.y=e.m13,t.z=e.m14,t}},
{key:"getScaling",value:function(t,e){var
i=e.m00,n=e.m01,r=e.m02,s=e.m04,a=e.m05,o=e.m06,l=e.m08,h=e.m09,c=e.m10;return
t.x=Math.sqrt(i*i+n*n+r*r),t.y=Math.sqrt(s*s+a*a+o*o),t.z=Math.sqrt(l*l+h*h+c*c),t}
},{key:"getRotation",value:function(t,e){var i=e.m00+e.m05+e.m10,n=0;return i>0?
(n=2*Math.sqrt(i+1),t.w=.25*n,t.x=(e.m06-e.m09)/n,t.y=(e.m08-e.m02)/n,t.z=(e.m01-
e.m04)/n):e.m00>e.m05&e.m00>e.m10?(n=2*Math.sqrt(1+e.m00-e.m05-e.m10),t.w=(e.m06-
e.m09)/n,t.x=.25*n,t.y=(e.m01+e.m04)/n,t.z=(e.m08+e.m02)/n):e.m05>e.m10?
(n=2*Math.sqrt(1+e.m05-e.m00-e.m10),t.w=(e.m08-
e.m02)/n,t.x=(e.m01+e.m04)/n,t.y=.25*n,t.z=(e.m06+e.m09)/n):(n=2*Math.sqrt(1+e.m10-
e.m00-e.m05),t.w=(e.m01-
e.m04)/n,t.x=(e.m08+e.m02)/n,t.y=(e.m06+e.m09)/n,t.z=.25*n),t}},
{key:"fromRTS",value:function(t,e,i,n){var
r=e.x,s=e.y,a=e.z,o=e.w,l=r+r,h=s+s,c=a+a,u=r*l,_=r*h,f=r*c,d=s*h,m=s*c,p=a*c,v=o*l
,y=o*h,g=o*c,x=n.x,b=n.y,A=n.z;return t.m00=(1-(d+p))*x,t.m01=(_+g)*x,t.m02=(f-
y)*x,t.m03=0,t.m04=(_-g)*b,t.m05=(1-
(u+p))*b,t.m06=(m+v)*b,t.m07=0,t.m08=(f+y)*A,t.m09=(m-v)*A,t.m10=(1-
(u+d))*A,t.m11=0,t.m12=i.x,t.m13=i.y,t.m14=i.z,t.m15=1,t}},
{key:"fromRTSOrigin",value:function(t,e,i,n,r){var
s=e.x,a=e.y,o=e.z,l=e.w,h=s+s,c=a+a,u=o+o,_=s*h,f=s*c,d=s*u,m=a*c,p=a*u,v=o*u,y=l*h
,g=l*c,x=l*u,b=n.x,A=n.y,C=n.z,S=r.x,T=r.y,w=r.z;return t.m00=(1-
(m+v))*b,t.m01=(f+x)*b,t.m02=(d-g)*b,t.m03=0,t.m04=(f-x)*A,t.m05=(1-
(_+v))*A,t.m06=(p+y)*A,t.m07=0,t.m08=(d+g)*C,t.m09=(p-y)*C,t.m10=(1-
(_+m))*C,t.m11=0,t.m12=i.x+S-(t.m00*S+t.m04*T+t.m08*w),t.m13=i.y+T-
(t.m01*S+t.m05*T+t.m09*w),t.m14=i.z+w-(t.m02*S+t.m06*T+t.m10*w),t.m15=1,t}},
{key:"fromQuat",value:function(t,e){var
i=e.x,n=e.y,r=e.z,s=e.w,a=i+i,o=n+n,l=r+r,h=i*a,c=n*a,u=n*o,_=r*a,f=r*o,d=r*l,m=s*a
,p=s*o,v=s*l;return t.m00=1-u-d,t.m01=c+v,t.m02=_-p,t.m03=0,t.m04=c-v,t.m05=1-h-
d,t.m06=f+m,t.m07=0,t.m08=_+p,t.m09=f-m,t.m10=1-h-
u,t.m11=0,t.m12=0,t.m13=0,t.m14=0,t.m15=1,t}},
{key:"frustum",value:function(t,e,i,n,r,s,a){var o=1/(i-e),l=1/(r-n),h=1/(s-
a);return
t.m00=2*s*o,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=2*s*l,t.m06=0,t.m07=0,t.m08=(i+e)
*o,t.m09=(r+n)*l,t.m10=(a+s)*h,t.m11=-1,t.m12=0,t.m13=0,t.m14=a*s*2*h,t.m15=0,t}},
{key:"perspective",value:function(t,e,i,n,r){var s=1/Math.tan(e/2),a=1/(n-r);return
t.m00=s/i,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=s,t.m06=0,t.m07=0,t.m08=0,t.m09=0,t
.m10=(r+n)*a,t.m11=-1,t.m12=0,t.m13=0,t.m14=2*r*n*a,t.m15=0,t}},
{key:"perspectiveFromFieldOfView",value:function(t,e,i,n){var
r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.ta
n(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+o),h=2/
(r+s);return
t.m00=l,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=h,t.m06=0,t.m07=0,t.m08=-(a-
o)*l*.5,t.m09=(r-s)*h*.5,t.m10=n/(i-n),t.m11=-1,t.m12=0,t.m13=0,t.m14=n*i/(i-
n),t.m15=0,t}},{key:"ortho",value:function(t,e,i,n,r,s,a){var o=1/(e-i),l=1/(n-
r),h=1/(s-a);return t.m00=-2*o,t.m01=0,t.m02=0,t.m03=0,t.m04=0,t.m05=-
2*l,t.m06=0,t.m07=0,t.m08=0,t.m09=0,t.m10=2*h,t.m11=0,t.m12=(e+i)*o,t.m13=(r+n)*l,t
.m14=(a+s)*h,t.m15=1,t}},{key:"lookAt",value:function(t,e,i,n){var r,s,a,o=void
0,l=void 0,h=void 0,c=void 0,u=void 0,_=void 0,f=void
0,d=e.x,m=e.y,p=e.z,v=n.x,y=n.y,g=n.z;return c=d-i.x,u=m-i.y,_=p-
i.z,o=y*(_*=f=1/Math.sqrt(c*c+u*u+_*_))-g*(u*=f),l=g*(c*=f)-v*_,h=v*u-
y*c,r=u*(h*=f=1/Math.sqrt(o*o+l*l+h*h))-_*(l*=f),s=_*(o*=f)-c*h,a=c*l-
u*o,t.m00=o,t.m01=r,t.m02=c,t.m03=0,t.m04=l,t.m05=s,t.m06=u,t.m07=0,t.m08=h,t.m09=a
,t.m10=_,t.m11=0,t.m12=-(o*d+l*m+h*p),t.m13=-(r*d+s*m+a*p),t.m14=-
(c*d+u*m+_*p),t.m15=1,t}},{key:"str",value:function(t){return"mat4("+t.m00+",
"+t.m01+", "+t.m02+", "+t.m03+", "+t.m04+", "+t.m05+", "+t.m06+", "+t.m07+",
"+t.m08+", "+t.m09+", "+t.m10+", "+t.m11+", "+t.m12+", "+t.m13+", "+t.m14+",
"+t.m15+")"}},{key:"array",value:function(t,e){return
t[0]=e.m00,t[1]=e.m01,t[2]=e.m02,t[3]=e.m03,t[4]=e.m04,t[5]=e.m05,t[6]=e.m06,t[7]=e
.m07,t[8]=e.m08,t[9]=e.m09,t[10]=e.m10,t[11]=e.m11,t[12]=e.m12,t[13]=e.m13,t[14]=e.
m14,t[15]=e.m15,t}},{key:"frob",value:function(t){return
Math.sqrt(Math.pow(t.m00,2)+Math.pow(t.m01,2)+Math.pow(t.m02,2)+Math.pow(t.m03,2)+M
ath.pow(t.m04,2)+Math.pow(t.m05,2)+Math.pow(t.m06,2)+Math.pow(t.m07,2)+Math.pow(t.m
08,2)+Math.pow(t.m09,2)+Math.pow(t.m10,2)+Math.pow(t.m11,2)+Math.pow(t.m12,2)+Math.
pow(t.m13,2)+Math.pow(t.m14,2)+Math.pow(t.m15,2))}},
{key:"add",value:function(t,e,i){return
t.m00=e.m00+i.m00,t.m01=e.m01+i.m01,t.m02=e.m02+i.m02,t.m03=e.m03+i.m03,t.m04=e.m04
+i.m04,t.m05=e.m05+i.m05,t.m06=e.m06+i.m06,t.m07=e.m07+i.m07,t.m08=e.m08+i.m08,t.m0
9=e.m09+i.m09,t.m10=e.m10+i.m10,t.m11=e.m11+i.m11,t.m12=e.m12+i.m12,t.m13=e.m13+i.m
13,t.m14=e.m14+i.m14,t.m15=e.m15+i.m15,t}},{key:"subtract",value:function(t,e,i)
{return t.m00=e.m00-i.m00,t.m01=e.m01-i.m01,t.m02=e.m02-i.m02,t.m03=e.m03-
i.m03,t.m04=e.m04-i.m04,t.m05=e.m05-i.m05,t.m06=e.m06-i.m06,t.m07=e.m07-
i.m07,t.m08=e.m08-i.m08,t.m09=e.m09-i.m09,t.m10=e.m10-i.m10,t.m11=e.m11-
i.m11,t.m12=e.m12-i.m12,t.m13=e.m13-i.m13,t.m14=e.m14-i.m14,t.m15=e.m15-i.m15,t}},
{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiplyScalar",value:function(t,e,i){return
t.m00=e.m00*i,t.m01=e.m01*i,t.m02=e.m02*i,t.m03=e.m03*i,t.m04=e.m04*i,t.m05=e.m05*i
,t.m06=e.m06*i,t.m07=e.m07*i,t.m08=e.m08*i,t.m09=e.m09*i,t.m10=e.m10*i,t.m11=e.m11*
i,t.m12=e.m12*i,t.m13=e.m13*i,t.m14=e.m14*i,t.m15=e.m15*i,t}},
{key:"multiplyScalarAndAdd",value:function(t,e,i,n){return
t.m00=e.m00+i.m00*n,t.m01=e.m01+i.m01*n,t.m02=e.m02+i.m02*n,t.m03=e.m03+i.m03*n,t.m
04=e.m04+i.m04*n,t.m05=e.m05+i.m05*n,t.m06=e.m06+i.m06*n,t.m07=e.m07+i.m07*n,t.m08=
e.m08+i.m08*n,t.m09=e.m09+i.m09*n,t.m10=e.m10+i.m10*n,t.m11=e.m11+i.m11*n,t.m12=e.m
12+i.m12*n,t.m13=e.m13+i.m13*n,t.m14=e.m14+i.m14*n,t.m15=e.m15+i.m15*n,t}},
{key:"exactEquals",value:function(t,e){return
t.m00===e.m00&&t.m01===e.m01&&t.m02===e.m02&&t.m03===e.m03&&t.m04===e.m04&&t.m05===
e.m05&&t.m06===e.m06&&t.m07===e.m07&&t.m08===e.m08&&t.m09===e.m09&&t.m10===e.m10&&t
.m11===e.m11&&t.m12===e.m12&&t.m13===e.m13&&t.m14===e.m14&&t.m15===e.m15}},
{key:"equals",value:function(t,e){var
i=t.m00,n=t.m01,s=t.m02,a=t.m03,o=t.m04,l=t.m05,h=t.m06,c=t.m07,u=t.m08,_=t.m09,f=t
.m10,d=t.m11,m=t.m12,p=t.m13,v=t.m14,y=t.m15,g=e.m00,x=e.m01,b=e.m02,A=e.m03,C=e.m0
4,S=e.m05,T=e.m06,w=
e.m07,E=e.m08,M=e.m09,D=e.m10,B=e.m11,P=e.m12,I=e.m13,R=e.m14,O=e.m15;return
Math.abs(i-g)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(n-
x)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(s-
b)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-
A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-
C)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(l-
S)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(h-
T)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(c-
w)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(u-
E)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(_-
M)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(M))&&Math.abs(f-
D)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(D))&&Math.abs(d-
B)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(m-
P)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-
I)<=r.EPSILON*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(v-
R)<=r.EPSILON*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-
O)<=r.EPSILON*Math.max(1,Math.abs(y),Math.abs(O))}}]),t})
();i.default=a,e.exports=i.default}),{"./utils":322}],321:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),r=l(t("./vec3")),s=l(t("./vec4")),a=l(t("./mat3")),o=t("./utils");function l(t)
{return t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw
new TypeError("Cannot call a class as a function")}var
c=.5*Math.PI/180,u=(function(){function t(){var e=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1;h(this,t),this.x=e,this.y=i,this.z=n,this.w=r}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1)}},
{key:"clone",value:function(e){return new t(e.x,e.y,e.z,e.w)}},
{key:"copy",value:function(t,e){return s.default.copy(t,e)}},
{key:"set",value:function(t,e,i,n,r){return t.x=e,t.y=i,t.z=n,t.w=r,t}},
{key:"identity",value:function(t){return t.x=0,t.y=0,t.z=0,t.w=1,t}},
{key:"rotationTo",value:function(e,i,n){return (function(){var
e=r.default.create(0,0,0),i=r.default.create(1,0,0),n=r.default.create(0,1,0);retur
n function(s,a,o){var l=r.default.dot(a,o);return l<-.999999?
(r.default.cross(e,i,a),r.default.magnitude(e)<1e-
6&&r.default.cross(e,n,a),r.default.normalize(e,e),t.fromAxisAngle(s,e,Math.PI),s):
l>.999999?(s.x=0,s.y=0,s.z=0,s.w=1,s):
(r.default.cross(e,a,o),s.x=e.x,s.y=e.y,s.z=e.z,s.w=1+l,t.normalize(s,s))}})()
(e,i,n)}},{key:"getAxisAngle",value:function(t,e){var
i=2*Math.acos(e.w),n=Math.sin(i/2);return 0!=n?(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n):
(t.x=1,t.y=0,t.z=0),i}},{key:"multiply",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=e.w,o=i.x,l=i.y,h=i.z,c=i.w;return t.x=n*c+a*o+r*h-
s*l,t.y=r*c+a*l+s*o-n*h,t.z=s*c+a*h+n*l-r*o,t.w=a*c-n*o-r*l-s*h,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"scale",value:function(t,e,i){return
t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=e.w*i,t}},{key:"rotateX",value:function(t,e,i)
{i*=.5;var n=e.x,r=e.y,s=e.z,a=e.w,o=Math.sin(i),l=Math.cos(i);return
t.x=n*l+a*o,t.y=r*l+s*o,t.z=s*l-r*o,t.w=a*l-n*o,t}},
{key:"rotateY",value:function(t,e,i){i*=.5;var
n=e.x,r=e.y,s=e.z,a=e.w,o=Math.sin(i),l=Math.cos(i);return t.x=n*l-
s*o,t.y=r*l+a*o,t.z=s*l+n*o,t.w=a*l-r*o,t}},{key:"rotateZ",value:function(t,e,i)
{i*=.5;var n=e.x,r=e.y,s=e.z,a=e.w,o=Math.sin(i),l=Math.cos(i);return
t.x=n*l+r*o,t.y=r*l-n*o,t.z=s*l+a*o,t.w=a*l-s*o,t}},
{key:"rotateAround",value:function(e,i,n,s){return (function(){var
e=r.default.create(0,0,0),i=t.create();return function(n,s,a,o){return
t.invert(i,s),r.default.transformQuat(e,a,i),t.fromAxisAngle(i,e,o),t.mul(n,s,i),n}
})()(e,i,n,s)}},{key:"rotateAroundLocal",value:function(e,i,n,r){return (function()
{var e=t.create();return function(i,n,r,s){return
t.fromAxisAngle(e,r,s),t.mul(i,n,e),i}})()(e,i,n,r)}},
{key:"calculateW",value:function(t,e){var i=e.x,n=e.y,r=e.z;return
t.x=i,t.y=n,t.z=r,t.w=Math.sqrt(Math.abs(1-i*i-n*n-r*r)),t}},
{key:"dot",value:function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w}},
{key:"lerp",value:function(t,e,i,n){var r=e.x,s=e.y,a=e.z,o=e.w;return
t.x=r+n*(i.x-r),t.y=s+n*(i.y-s),t.z=a+n*(i.z-a),t.w=o+n*(i.w-o),t}},
{key:"slerp",value:function(t,e,i,n){var
r=e.x,s=e.y,a=e.z,o=e.w,l=i.x,h=i.y,c=i.z,u=i.w,_=void 0,f=void 0,d=void 0,m=void
0,p=void 0;return(f=r*l+s*h+a*c+o*u)<0&&(f=-f,l=-l,h=-h,c=-c,u=-u),1-f>1e-6?
(_=Math.acos(f),d=Math.sin(_),m=Math.sin((1-n)*_)/d,p=Math.sin(n*_)/d):(m=1-
n,p=n),t.x=m*r+p*l,t.y=m*s+p*h,t.z=m*a+p*c,t.w=m*o+p*u,t}},
{key:"sqlerp",value:function(e,i,n,r,s,a){return (function(){var
e=t.create(),i=t.create();return function(n,r,s,a,o,l){return
t.slerp(e,r,o,l),t.slerp(i,s,a,l),t.slerp(n,e,i,2*l*(1-l)),n}})()(e,i,n,r,s,a)}},
{key:"invert",value:function(t,e){var
i=e.x,n=e.y,r=e.z,s=e.w,a=i*i+n*n+r*r+s*s,o=a?1/a:0;return t.x=-i*o,t.y=-n*o,t.z=-
r*o,t.w=s*o,t}},{key:"conjugate",value:function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-
e.z,t.w=e.w,t}},{key:"magnitude",value:function(t){var
e=t.x,i=t.y,n=t.z,r=t.w;return Math.sqrt(e*e+i*i+n*n+r*r)}},
{key:"mag",value:function(e){return t.magnitude(e)}},
{key:"squaredMagnitude",value:function(t){var e=t.x,i=t.y,n=t.z,r=t.w;return
e*e+i*i+n*n+r*r}},{key:"sqrMag",value:function(e){return t.squaredMagnitude(e)}},
{key:"normalize",value:function(t,e){var
i=e.x,n=e.y,r=e.z,s=e.w,a=i*i+n*n+r*r+s*s;return
a>0&&(a=1/Math.sqrt(a),t.x=i*a,t.y=n*a,t.z=r*a,t.w=s*a),t}},
{key:"fromAxes",value:function(e,i,n,r){return (function(){var
e=a.default.create();return function(i,n,r,s){return
a.default.set(e,n.x,n.y,n.z,r.x,r.y,r.z,s.x,s.y,s.z),t.normalize(i,t.fromMat3(i,e))
}})()(e,i,n,r)}},{key:"fromViewUp",value:function(e,i,n){return (function(){var
e=a.default.create();return function(i,n,r){return a.default.fromViewUp(e,n,r),e?
t.normalize(i,t.fromMat3(i,e)):null}})()(e,i,n)}},
{key:"fromAxisAngle",value:function(t,e,i){i*=.5;var n=Math.sin(i);return
t.x=n*e.x,t.y=n*e.y,t.z=n*e.z,t.w=Math.cos(i),t}},
{key:"fromMat3",value:function(t,e){var
i=e.m00,n=e.m03,r=e.m06,s=e.m01,a=e.m04,o=e.m07,l=e.m02,h=e.m05,c=e.m08,u=i+a+c;if(
u>0){var _=.5/Math.sqrt(u+1);t.w=.25/_,t.x=(h-o)*_,t.y=(r-l)*_,t.z=(s-n)*_}else
if(i>a&&i>c){var f=2*Math.sqrt(1+i-a-c);t.w=(h-
o)/f,t.x=.25*f,t.y=(n+s)/f,t.z=(r+l)/f}else if(a>c){var d=2*Math.sqrt(1+a-i-
c);t.w=(r-l)/d,t.x=(n+s)/d,t.y=.25*d,t.z=(o+h)/d}else{var m=2*Math.sqrt(1+c-i-
a);t.w=(s-n)/m,t.x=(r+l)/m,t.y=(o+h)/m,t.z=.25*m}return t}},
{key:"fromEuler",value:function(t,e,i,n){e*=c,i*=c,n*=c;var
r=Math.sin(e),s=Math.cos(e),a=Math.sin(i),o=Math.cos(i),l=Math.sin(n),h=Math.cos(n)
;return t.x=r*o*h+s*a*l,t.y=s*a*h+r*o*l,t.z=s*o*l-r*a*h,t.w=s*o*h-r*a*l,t}},
{key:"toEuler",value:function(t,e){var i=e.x,n=e.y,r=e.z,s=e.w,a=void 0,l=void
0,h=void 0,c=i*n+r*s;if(c>.499&&(a=2*Math.atan2(i,s),l=Math.PI/2,h=0),c<-.499&&(a=-
2*Math.atan2(i,s),l=-Math.PI/2,h=0),isNaN(a)){var
u=i*i,_=n*n,f=r*r;a=Math.atan2(2*n*s-2*i*r,1-2*_-
2*f),l=Math.asin(2*c),h=Math.atan2(2*i*s-2*n*r,1-2*u-2*f)}return t.y=(0,o.toDegree)
(a),t.z=(0,o.toDegree)(l),t.x=(0,o.toDegree)(h),t}},{key:"str",value:function(t)
{return"quat("+t.x+", "+t.y+", "+t.z+", "+t.w+")"}},
{key:"array",value:function(t,e){return t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w,t}},
{key:"exactEquals",value:function(t,e){return s.default.exactEquals(t,e)}},
{key:"equals",value:function(t,e){return s.default.equals(t,e)}}]),t})
();i.default=u,e.exports=i.default}),
{"./mat3":319,"./utils":322,"./vec3":324,"./vec4":325}],322:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.equals=function(t,e)
{return Math.abs(t-
e)<=s*Math.max(1,Math.abs(t),Math.abs(e))},i.approx=function(t,e,i){return i=i||
s,Math.abs(t-e)<=i},i.clamp=function(t,e,i){return t<e?e:t>i?
i:t},i.clamp01=function(t){return t<0?0:t>1?1:t},i.lerp=function(t,e,i){return t+
(e-t)*i},i.toRadian=function(t){return t*n},i.toDegree=function(t){return
t*r},i.randomRange=a,i.randomRangeInt=function(t,e){return
Math.floor(a(t,e))},i.pseudoRandom=o,i.pseudoRandomRange=l,i.pseudoRandomRangeInt=f
unction(t,e,i){return Math.floor(l(t,e,i))},i.nextPow2=function(t){return--t,t|
=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},i.repeat=h,i.pingPong=function(t,e)
{return t=h(t,2*e),t=e-Math.abs(t-e)},i.inverseLerp=function(t,e,i){return(i-t)/(e-
t)};var n=Math.PI/180,r=180/Math.PI,s=i.EPSILON=1e-6;i.random=Math.random;function
a(t,e){return Math.random()*(e-t)+t}function o(t)
{return(t=(9301*t+49297)%233280)/233280}function l(t,e,i){return o(t)*(i-e)
+e}function h(t,e){return t-Math.floor(t/e)*e}}),{}],323:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0;s(this,t),this.x=e,this.y=i}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0)}},{key:"zero",value:function(t){return t.x=0,t.y=0,t}},
{key:"clone",value:function(e){return
new t(e.x,e.y)}},{key:"copy",value:function(t,e){return t.x=e.x,t.y=e.y,t}},
{key:"set",value:function(t,e,i){return t.x=e,t.y=i,t}},
{key:"add",value:function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t}},
{key:"subtract",value:function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t}},
{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiply",value:function(t,e,i){return t.x=e.x*i.x,t.y=e.y*i.y,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"divide",value:function(t,e,i){return t.x=e.x/i.x,t.y=e.y/i.y,t}},
{key:"div",value:function(e,i,n){return t.divide(e,i,n)}},
{key:"ceil",value:function(t,e){return t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t}},
{key:"floor",value:function(t,e){return
t.x=Math.floor(e.x),t.y=Math.floor(e.y),t}},{key:"min",value:function(t,e,i){return
t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t}},{key:"max",value:function(t,e,i)
{return t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t}},
{key:"round",value:function(t,e){return
t.x=Math.round(e.x),t.y=Math.round(e.y),t}},{key:"scale",value:function(t,e,i)
{return t.x=e.x*i,t.y=e.y*i,t}},{key:"scaleAndAdd",value:function(t,e,i,n){return
t.x=e.x+i.x*n,t.y=e.y+i.y*n,t}},{key:"distance",value:function(t,e){var i=e.x-
t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}},{key:"dist",value:function(e,i){return
t.distance(e,i)}},{key:"squaredDistance",value:function(t,e){var i=e.x-t.x,n=e.y-
t.y;return i*i+n*n}},{key:"sqrDist",value:function(e,i){return
t.squaredDistance(e,i)}},{key:"magnitude",value:function(t){var e=t.x,i=t.y;return
Math.sqrt(e*e+i*i)}},{key:"mag",value:function(e){return t.magnitude(e)}},
{key:"squaredMagnitude",value:function(t){var e=t.x,i=t.y;return e*e+i*i}},
{key:"sqrMag",value:function(e){return t.squaredMagnitude(e)}},
{key:"negate",value:function(t,e){return t.x=-e.x,t.y=-e.y,t}},
{key:"inverse",value:function(t,e){return t.x=1/e.x,t.y=1/e.y,t}},
{key:"inverseSafe",value:function(t,e){var i=e.x,n=e.y;return
Math.abs(i)<r.EPSILON?t.x=0:t.x=1/i,Math.abs(n)<r.EPSILON?t.y=0:t.y=1/e.y,t}},
{key:"normalize",value:function(t,e){var i=e.x,n=e.y,r=i*i+n*n;return
r>0&&(r=1/Math.sqrt(r),t.x=e.x*r,t.y=e.y*r),t}},{key:"dot",value:function(t,e)
{return t.x*e.x+t.y*e.y}},{key:"cross",value:function(t,e,i){var n=e.x*i.y-
e.y*i.x;return t.x=t.y=0,t.z=n,t}},{key:"lerp",value:function(t,e,i,n){var
r=e.x,s=e.y;return t.x=r+n*(i.x-r),t.y=s+n*(i.y-s),t}},
{key:"random",value:function(t,e){e=e||1;var i=2*(0,r.random)()*Math.PI;return
t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},{key:"transformMat2",value:function(t,e,i)
{var n=e.x,r=e.y;return t.x=i.m00*n+i.m02*r,t.y=i.m01*n+i.m03*r,t}},
{key:"transformMat23",value:function(t,e,i){var n=e.x,r=e.y;return
t.x=i.m00*n+i.m02*r+i.m04,t.y=i.m01*n+i.m03*r+i.m05,t}},
{key:"transformMat3",value:function(t,e,i){var n=e.x,r=e.y;return
t.x=i.m00*n+i.m03*r+i.m06,t.y=i.m01*n+i.m04*r+i.m07,t}},
{key:"transformMat4",value:function(t,e,i){var n=e.x,r=e.y;return
t.x=i.m00*n+i.m04*r+i.m12,t.y=i.m01*n+i.m05*r+i.m13,t}},
{key:"forEach",value:function(e,i,n,r,s,a){return t._forEach(e,i,n,r,s,a)}},
{key:"str",value:function(t){return"vec2("+t.x+", "+t.y+")"}},
{key:"array",value:function(t,e){return t[0]=e.x,t[1]=e.y,t}},
{key:"exactEquals",value:function(t,e){return t.x===e.x&&t.y===e.y}},
{key:"equals",value:function(t,e){var i=t.x,n=t.y,s=e.x,a=e.y;return Math.abs(i-
s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-
a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))}},
{key:"angle",value:function(e,i){return t._angle(e,i)}}]),t})
();a._forEach=(function(){var t=a.create(0,0);return function(e,i,n,r,s,a){var
o=void 0,l=void 0;for(i||(i=2),n||(n=0),l=r?
Math.min(r*i+n,e.length):e.length,o=n;o<l;o+=i)t.x=e[o],t.y=e[o+1],s(t,t,a),e[o]=t.
x,e[o+1]=t.y;return e}})(),a._angle=(function(){var
t=a.create(0,0),e=a.create(0,0);return function(i,n)
{a.normalize(t,i),a.normalize(e,n);var r=a.dot(t,e);return r>1?0:r<-1?
Math.PI:Math.acos(r)}})(),i.default=a,e.exports=i.default}),{"./utils":322}],324:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0;s(this,t),this.x=e,this.y=i,this.z=n}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)}},
{key:"zero",value:function(t){return t.x=0,t.y=0,t.z=0,t}},
{key:"clone",value:function(e){return new t(e.x,e.y,e.z)}},
{key:"copy",value:function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t}},
{key:"set",value:function(t,e,i,n){return t.x=e,t.y=i,t.z=n,t}},
{key:"add",value:function(t,e,i){return t.x=e.x+i.x,t.y=e.y+i.y,t.z=e.z+i.z,t}},
{key:"subtract",value:function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t.z=e.z-
i.z,t}},{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiply",value:function(t,e,i){return
t.x=e.x*i.x,t.y=e.y*i.y,t.z=e.z*i.z,t}},{key:"mul",value:function(e,i,n){return
t.multiply(e,i,n)}},{key:"divide",value:function(t,e,i){return
t.x=e.x/i.x,t.y=e.y/i.y,t.z=e.z/i.z,t}},{key:"div",value:function(e,i,n){return
t.divide(e,i,n)}},{key:"ceil",value:function(t,e){return
t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t.z=Math.ceil(e.z),t}},
{key:"floor",value:function(t,e){return
t.x=Math.floor(e.x),t.y=Math.floor(e.y),t.z=Math.floor(e.z),t}},
{key:"min",value:function(t,e,i){return
t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t.z=Math.min(e.z,i.z),t}},
{key:"max",value:function(t,e,i){return
t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t.z=Math.max(e.z,i.z),t}},
{key:"round",value:function(t,e){return
t.x=Math.round(e.x),t.y=Math.round(e.y),t.z=Math.round(e.z),t}},
{key:"scale",value:function(t,e,i){return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t}},
{key:"scaleAndAdd",value:function(t,e,i,n){return
t.x=e.x+i.x*n,t.y=e.y+i.y*n,t.z=e.z+i.z*n,t}},{key:"distance",value:function(t,e)
{var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z;return Math.sqrt(i*i+n*n+r*r)}},
{key:"dist",value:function(e,i){return t.distance(e,i)}},
{key:"squaredDistance",value:function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z;return
i*i+n*n+r*r}},{key:"sqrDist",value:function(e,i){return t.squaredDistance(e,i)}},
{key:"magnitude",value:function(t){var e=t.x,i=t.y,n=t.z;return
Math.sqrt(e*e+i*i+n*n)}},{key:"mag",value:function(e){return t.magnitude(e)}},
{key:"squaredMagnitude",value:function(t){var e=t.x,i=t.y,n=t.z;return
e*e+i*i+n*n}},{key:"sqrMag",value:function(e){return t.squaredMagnitude(e)}},
{key:"negate",value:function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t}},
{key:"inverse",value:function(t,e){return t.x=1/e.x,t.y=1/e.y,t.z=1/e.z,t}},
{key:"inverseSafe",value:function(t,e){var i=e.x,n=e.y,s=e.z;return
Math.abs(i)<r.EPSILON?t.x=0:t.x=1/i,Math.abs(n)<r.EPSILON?
t.y=0:t.y=1/n,Math.abs(s)<r.EPSILON?t.z=0:t.z=1/s,t}},
{key:"normalize",value:function(t,e){var i=e.x,n=e.y,r=e.z,s=i*i+n*n+r*r;return
s>0&&(s=1/Math.sqrt(s),t.x=i*s,t.y=n*s,t.z=r*s),t}},{key:"dot",value:function(t,e)
{return t.x*e.x+t.y*e.y+t.z*e.z}},{key:"cross",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.x,o=i.y,l=i.z;return t.x=r*l-s*o,t.y=s*a-n*l,t.z=n*o-r*a,t}},
{key:"lerp",value:function(t,e,i,n){var r=e.x,s=e.y,a=e.z;return t.x=r+n*(i.x-
r),t.y=s+n*(i.y-s),t.z=a+n*(i.z-a),t}},{key:"hermite",value:function(t,e,i,n,r,s)
{var a=s*s,o=a*(2*s-3)+1,l=a*(s-2)+s,h=a*(s-1),c=a*(3-2*s);return
t.x=e.x*o+i.x*l+n.x*h+r.x*c,t.y=e.y*o+i.y*l+n.y*h+r.y*c,t.z=e.z*o+i.z*l+n.z*h+r.z*c
,t}},{key:"bezier",value:function(t,e,i,n,r,s){var a=1-
s,o=a*a,l=s*s,h=o*a,c=3*s*o,u=3*l*a,_=l*s;return
t.x=e.x*h+i.x*c+n.x*u+r.x*_,t.y=e.y*h+i.y*c+n.y*u+r.y*_,t.z=e.z*h+i.z*c+n.z*u+r.z*_
,t}},{key:"random",value:function(t,e){e=e||1;var i=2*(0,r.random)
()*Math.PI,n=Math.acos(2*(0,r.random)()-1);return
t.x=Math.sin(n)*Math.cos(i)*e,t.y=Math.sin(n)*Math.sin(i)*e,t.z=Math.cos(n)*e,t}},
{key:"transformMat4",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.m03*n+i.m07*r+i.m11*s+i.m15;return a=a?
1/a:1,t.x=(i.m00*n+i.m04*r+i.m08*s+i.m12)*a,t.y=(i.m01*n+i.m05*r+i.m09*s+i.m13)*a,t
.z=(i.m02*n+i.m06*r+i.m10*s+i.m14)*a,t}},
{key:"transformMat4Normal",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.m03*n+i.m07*r+i.m11*s;return a=a?
1/a:1,t.x=(i.m00*n+i.m04*r+i.m08*s)*a,t.y=(i.m01*n+i.m05*r+i.m09*s)*a,t.z=(i.m02*n+
i.m06*r+i.m10*s)*a,t}},{key:"transformMat3",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z;return
t.x=n*i.m00+r*i.m03+s*i.m06,t.y=n*i.m01+r*i.m04+s*i.m07,t.z=n*i.m02+r*i.m05+s*i.m08
,t}},{key:"transformQuat",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.x,o=i.y,l=i.z,h=i.w,c=h*n+o*s-l*r,u=h*r+l*n-a*s,_=h*s+a*r-
o*n,f=-a*n-o*r-l*s;return t.x=c*h+f*-a+u*-l-_*-o,t.y=u*h+f*-o+_*-a-c*-l,t.z=_*h+f*-
l+c*-o-u*-a,t}},{key:"rotateX",value:function(t,e,i,n){var r=e.x-i.x,s=e.y-
i.y,a=e.z-i.z,o=r,l=s*Math.cos(n)-a*Math.sin(n),h=s*Math.sin(n)
+a*Math.cos(n);return t.x=o+i.x,t.y=l+i.y,t.z=h+i.z,t}},
{key:"rotateY",value:function(t,e,i,n){var r=e.x-i.x,s=e.y-i.y,a=e.z-
i.z,o=a*Math.sin(n)+r*Math.cos(n),l=s,h=a*Math.cos(n)-r*Math.sin(n);return
t.x=o+i.x,t.y=l+i.y,t.z=h+i.z,t}},{key:"rotateZ",value:function(t,e,i,n){var r=e.x-
i.x,s=e.y-i.y,a=e.z-i.z,o=r*Math.cos(n)-s*Math.sin(n),l=r*Math.sin(n)
+s*Math.cos(n),h=a;return t.x=o+i.x,t.y=l+i.y,t.z=h+i.z,t}},
{key:"str",value:function(t){return"vec3("+t.x+", "+t.y+", "+t.z+")"}},
{key:"array",value:function(t,e){return t[0]=e.x,t[1]=e.y,t[2]=e.z,t}},
{key:"exactEquals",value:function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z}},
{key:"equals",value:function(t,e){var
i=t.x,n=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return Math.abs(i-
a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(n-
o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(s-
l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))}},
{key:"forEach",value:function(e,i,n,r,s,a){return t._forEach(e,i,n,r,s,a)}},
{key:"angle",value:function(e,i){return t._angle(e,i)}},
{key:"projectOnPlane",value:function(e,i,n){return t.sub(e,i,t.project(e,i,n))}},
{key:"project",value:function(e,i,n){var r=t.squaredMagnitude(n);return r<1e-6?
t.set(e,0,0,0):t.scale(e,n,t.dot(i,n)/r)}}]),t})();a._forEach=(function(){var
t=a.create(0,0,0);return function(e,i,n,r,s,a){var o=void 0,l=void 0;for(i||
(i=3),n||(n=0),l=r?
Math.min(r*i+n,e.length):e.length,o=n;o<l;o+=i)t.x=e[o],t.y=e[o+1],t.z=e[o+2],s(t,t
,a),e[o]=t.x,e[o+1]=t.y,e[o+2]=t.z;return e}})(),a._angle=(function(){var
t=a.create(0,0,0),e=a.create(0,0,0);return function(i,n)
{a.copy(t,i),a.copy(e,n),a.normalize(t,t),a.normalize(e,e);var r=a.dot(t,e);return
r>1?0:r<-1?Math.PI:Math.acos(r)}})(),i.default=a,e.exports=i.default}),
{"./utils":322}],325:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./utils");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:1;s(this,t),this.x=e,this.y=i,this.z=n,this.w=r}return n(t,null,
[{key:"create",value:function(){return new t(arguments.length>0&&void 0!
==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?
arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:1)}},
{key:"zero",value:function(t){return t.x=0,t.y=0,t.z=0,t.w=0,t}},
{key:"clone",value:function(e){return new t(e.x,e.y,e.z,e.w)}},
{key:"copy",value:function(t,e){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}},
{key:"set",value:function(t,e,i,n,r){return t.x=e,t.y=i,t.z=n,t.w=r,t}},
{key:"add",value:function(t,e,i){return
t.x=e.x+i.x,t.y=e.y+i.y,t.z=e.z+i.z,t.w=e.w+i.w,t}},
{key:"subtract",value:function(t,e,i){return t.x=e.x-i.x,t.y=e.y-i.y,t.z=e.z-
i.z,t.w=e.w-i.w,t}},{key:"sub",value:function(e,i,n){return t.subtract(e,i,n)}},
{key:"multiply",value:function(t,e,i){return
t.x=e.x*i.x,t.y=e.y*i.y,t.z=e.z*i.z,t.w=e.w*i.w,t}},
{key:"mul",value:function(e,i,n){return t.multiply(e,i,n)}},
{key:"divide",value:function(t,e,i){return
t.x=e.x/i.x,t.y=e.y/i.y,t.z=e.z/i.z,t.w=e.w/i.w,t}},
{key:"div",value:function(e,i,n){return t.divide(e,i,n)}},
{key:"ceil",value:function(t,e){return
t.x=Math.ceil(e.x),t.y=Math.ceil(e.y),t.z=Math.ceil(e.z),t.w=Math.ceil(e.w),t}},
{key:"floor",value:function(t,e){return
t.x=Math.floor(e.x),t.y=Math.floor(e.y),t.z=Math.floor(e.z),t.w=Math.floor(e.w),t}}
,{key:"min",value:function(t,e,i){return
t.x=Math.min(e.x,i.x),t.y=Math.min(e.y,i.y),t.z=Math.min(e.z,i.z),t.w=Math.min(e.w,
i.w),t}},{key:"max",value:function(t,e,i){return
t.x=Math.max(e.x,i.x),t.y=Math.max(e.y,i.y),t.z=Math.max(e.z,i.z),t.w=Math.max(e.w,
i.w),t}},{key:"round",value:function(t,e){return
t.x=Math.round(e.x),t.y=Math.round(e.y),t.z=Math.round(e.z),t.w=Math.round(e.w),t}}
,{key:"scale",value:function(t,e,i){return
t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=e.w*i,t}},
{key:"scaleAndAdd",value:function(t,e,i,n){return
t.x=e.x+i.x*n,t.y=e.y+i.y*n,t.z=e.z+i.z*n,t.w=e.w+i.w*n,t}},
{key:"distance",value:function(t,e){var i=e.x-t.x,n=e.y-t.y,r=e.z-t.z,s=e.w-
t.w;return Math.sqrt(i*i+n*n+r*r+s*s)}},{key:"dist",value:function(e,i){return
t.distance(e,i)}},{key:"squaredDistance",value:function(t,e){var i=e.x-t.x,n=e.y-
t.y,r=e.z-t.z,s=e.w-t.w;return i*i+n*n+r*r+s*s}},{key:"sqrDist",value:function(e,i)
{return t.squaredDistance(e,i)}},{key:"magnitude",value:function(t){var
e=t.x,i=t.y,n=t.z,r=t.w;return Math.sqrt(e*e+i*i+n*n+r*r)}},
{key:"mag",value:function(e){return t.magnitude(e)}},
{key:"squaredMagnitude",value:function(t){var e=t.x,i=t.y,n=t.z,r=t.w;return
e*e+i*i+n*n+r*r}},{key:"sqrMag",value:function(e){return t.squaredMagnitude(e)}},
{key:"negate",value:function(t,e){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t}},
{key:"inverse",value:function(t,e){return
t.x=1/e.x,t.y=1/e.y,t.z=1/e.z,t.w=1/e.w,t}},{key:"inverseSafe",value:function(t,e)
{var i=e.x,n=e.y,s=e.z,a=e.w;return Math.abs(i)<r.EPSILON?
t.x=0:t.x=1/i,Math.abs(n)<r.EPSILON?t.y=0:t.y=1/n,Math.abs(s)<r.EPSILON?
t.z=0:t.z=1/s,Math.abs(a)<r.EPSILON?t.w=0:t.w=1/a,t}},
{key:"normalize",value:function(t,e){var
i=e.x,n=e.y,r=e.z,s=e.w,a=i*i+n*n+r*r+s*s;return
a>0&&(a=1/Math.sqrt(a),t.x=i*a,t.y=n*a,t.z=r*a,t.w=s*a),t}},
{key:"dot",value:function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w}},
{key:"lerp",value:function(t,e,i,n){var r=e.x,s=e.y,a=e.z,o=e.w;return
t.x=r+n*(i.x-r),t.y=s+n*(i.y-s),t.z=a+n*(i.z-a),t.w=o+n*(i.w-o),t}},
{key:"random",value:function(t,e){e=e||1;var i=2*(0,r.random)
()*Math.PI,n=Math.acos(2*(0,r.random)()-1);return
t.x=Math.sin(n)*Math.cos(i)*e,t.y=Math.sin(n)*Math.sin(i)*e,t.z=Math.cos(n)*e,t.w=0
,t}},{key:"transformMat4",value:function(t,e,i){var n=e.x,r=e.y,s=e.z,a=e.w;return
t.x=i.m00*n+i.m04*r+i.m08*s+i.m12*a,t.y=i.m01*n+i.m05*r+i.m09*s+i.m13*a,t.z=i.m02*n
+i.m06*r+i.m10*s+i.m14*a,t.w=i.m03*n+i.m07*r+i.m11*s+i.m15*a,t}},
{key:"transformQuat",value:function(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.x,o=i.y,l=i.z,h=i.w,c=h*n+o*s-l*r,u=h*r+l*n-a*s,_=h*s+a*r-
o*n,f=-a*n-o*r-l*s;return t.x=c*h+f*-a+u*-l-_*-o,t.y=u*h+f*-o+_*-a-c*-l,t.z=_*h+f*-
l+c*-o-u*-a,t.w=e.w,t}},{key:"str",value:function(t){return"vec4("+t.x+", "+t.y+",
"+t.z+", "+t.w+")"}},{key:"array",value:function(t,e){return
t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w,t}},{key:"exactEquals",value:function(t,e)
{return t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w}},
{key:"equals",value:function(t,e){var
i=t.x,n=t.y,s=t.z,a=t.w,o=e.x,l=e.y,h=e.z,c=e.w;return Math.abs(i-
o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-
l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-
h)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(a-
c)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}},
{key:"forEach",value:function(e,i,n,r,s,a){return t._forEach(e,i,n,r,s,a)}}]),t})
();a._forEach=(function(){var t=a.create(0,0,0,0);return function(e,i,n,r,s,a){var
o=void 0,l=void 0;for(i||(i=4),n||(n=0),l=r?
Math.min(r*i+n,e.length):e.length,o=n;o<l;o+=i)t.x=e[o],t.y=e[o+1],t.z=e[o+2],t.w=e
[o+3],s(t,t,a),e[o]=t.x,e[o+1]=t.y,e[o+2]=t.z,e[o+3]=t.w;return e}})
(),i.default=a,e.exports=i.default}),{"./utils":322}],326:[(function(t,e,i){"use
strict";cc.js}),{}],327:[(function(t,e,i){"use
strict";t("./core/CCGame"),t("./actions")}),
{"./actions":7,"./core/CCGame":51}],328:[(function(t,e,i){"use strict";var
n=t("../compression/zlib.min"),r=t("../core/CCDebug"),s=function(t){var
e,i,n,s,a,o,l,h,c,u,_,f,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[
],this.transparency={},this.animation=null,this.text={},a=null;;)
{switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;+
+t)e.push(String.fromCharCode(this.data[this.pos++]));return
e}.call(this).join(""))
{case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=th
is.data[this.pos++],this.colorType=this.data[this.pos+
+],this.compressionMethod=this.data[this.pos+
+],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos+
+];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readU
Int32()||1/0,frames:
[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":a&&this.animation.f
rames.push(a),this.pos+=4,a={width:this.readUInt32(),height:this.readUInt32(),xOffs
et:this.readUInt32(),yOffset:this.readUInt32()},s=this.readUInt16(),n=this.readUInt
16()||100,a.delay=1e3*s/n,a.disposeOp=this.data[this.pos+
+],a.blendOp=this.data[this.pos+
+],a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-
=4),t=(null!=a?a.data:void 0)||this.imgData,_=0;0<=e?_<e:_>e;0<=e?++_:--
_)t.push(this.data[this.pos+
+]);break;case"tRNS":switch(this.transparency={},this.colorType){case
3:if(this.transparency.indexed=this.read(e),(c=255-
this.transparency.indexed.length)>0)for(f=0;0<=c?f<c:f>c;0<=c?++f:--
f)this.transparency.indexed.push(255);break;case
0:this.transparency.grayscale=this.read(e)[0];break;case
2:this.transparency.rgb=this.read(e)}break;case"tEXt":o=(u=this.read(e)).indexOf(0)
,l=String.fromCharCode.apply(String,u.slice(0,o)),this.text[l]=String.fromCharCode.
apply(String,u.slice(o+1));break;case"IEND":return
a&&this.animation.frames.push(a),this.colors=function(){switch(this.colorType){case
0:case 3:case 4:return 1;case 2:case 6:return
3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,i=this.colors+
(this.hasAlphaChannel?
1:0),this.pixelBitlength=this.bits*i,this.colorSpace=function(){switch(this.colors)
{case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(Uint8Array!
=Array&&(this.imgData=new
Uint8Array(this.imgData)));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.le
ngth)throw new
Error(r.getError(6017))}};s.prototype={constructor:s,read:function(t){var
e,i;for(i=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)i.push(this.data[this.pos++]);return
i},readUInt32:function(){return this.data[this.pos++]<<24|this.data[this.pos+
+]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},readUInt16:function(){return
this.data[this.pos++]<<8|this.data[this.pos++]},decodePixels:function(t){var
e,i,s,a,o,l,h,c,u,_,f,d,m,p,v,y,g,x,b,A,C,S,T;if(null==t&&(t=this.imgData),0===t.le
ngth)return new Uint8Array(0);for(t=new n.Inflate(t,{index:0,verify:!
1}).decompress(),y=(d=this.pixelBitlength/8)*this.width,m=new
Uint8Array(y*this.height),l=t.length,v=0,p=0,i=0;p<l;){switch(t[p++]){case
0:for(a=b=0;b<y;a=b+=1)m[i++]=t[p++];break;case 1:for(a=A=0;A<y;a=A+=1)e=t[p+
+],o=a<d?0:m[i-d],m[i++]=(e+o)%256;break;case 2:for(a=C=0;C<y;a=C+=1)e=t[p++],s=(a-
a%d)/d,g=v&&m[(v-1)*y+s*d+a%d],m[i++]=(g+e)%256;break;case
3:for(a=S=0;S<y;a=S+=1)e=t[p++],s=(a-a%d)/d,o=a<d?0:m[i-d],g=v&&m[(v-1)*y+s*d+a
%d],m[i++]=(e+Math.floor((o+g)/2))%256;break;case 4:for(a=T=0;T<y;a=T+=1)e=t[p+
+],s=(a-a%d)/d,o=a<d?0:m[i-d],0===v?g=x=0:(g=m[(v-1)*y+s*d+a%d],x=s&&m[(v-1)*y+(s-
1)*d+a%d]),h=o+g-x,c=Math.abs(h-o),_=Math.abs(h-g),f=Math.abs(h-x),u=c<=_&&c<=f?
o:_<=f?g:x,m[i++]=(e+u)%256;break;default:throw new Error(r.getError(6018,t[p-
1]))}v++}return m},copyToImageData:function(t,e){var
i,n,r,s,a,o,l,h,c,u,_;if(n=this.colors,c=null,i=this.hasAlphaChannel,this.palette.l
ength&&(c=null!=(_=this._decodedPalette)?
_:this._decodedPalette=this.decodePalette(),n=4,i=!0),h=(r=t.data||t).length,a=c||
e,s=o=0,1===n)for(;s<h;)l=c?4*e[s/4]:o,u=a[l++],r[s++]=u,r[s++]=u,r[s++]=u,r[s+
+]=i?a[l++]:255,o=l;else for(;s<h;)l=c?4*e[s/4]:o,r[s++]=a[l++],r[s++]=a[l++],r[s+
+]=a[l++],r[s++]=i?a[l++]:255,o=l},decodePalette:function(){var
t,e,i,n,r,s,a,o,l;for(i=this.palette,s=this.transparency.indexed||[],r=new
Uint8Array((s.length||0)+i.length),n=0,t=0,e=a=0,o=i.length;a<o;e=a+=3)r[n+
+]=i[e],r[n++]=i[e+1],r[n++]=i[e+2],r[n++]=null!=(l=s[t++])?l:255;return
r},render:function(t){var e,i;return
t.width=this.width,t.height=this.height,i=(e=t.getContext("2d")).createImageData(th
is.width,this.height),this.copyToImageData(i,this.decodePixels()),e.putImageData(i,
0,0)}},e.exports=s}),{"../compression/zlib.min":25,"../core/CCDebug":49}],329:
[(function(t,e,i){"use strict";var
n=t("../core/assets/CCAsset"),r=t("../core/assets/CCSpriteFrame"),s=cc.Class({name:
"cc.ParticleAsset",extends:n,properties:{spriteFrame:
{default:null,type:r}}});cc.ParticleAsset=e.exports=s}),
{"../core/assets/CCAsset":56,"../core/assets/CCSpriteFrame":70}],330:
[(function(t,e,i){"use strict";var
n=t("../core/platform/CCMacro"),r=t("./CCParticleAsset"),s=t("../core/components/CC
RenderComponent"),a=t("../compression/ZipUtils"),o=t("./CCPNGReader"),l=t("./CCTIFF
Reader"),h=t("../core/utils/texture-util"),c=t("../core/renderer/render-
flow"),u=t("./particle-
simulator"),_=t("../core/assets/material/CCMaterial"),f=t("../core/utils/blend-
func");function d(t){return
t.length>8&&137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]&&13===t[4]&&10===t[5]&&26==
=t[6]&&10===t[7]?n.ImageFormat.PNG:t.length>2&&(73===t[0]&&73===t[1]||
77===t[0]&&77===t[1]||255===t[0]&&216===t[1])?
n.ImageFormat.TIFF:n.ImageFormat.UNKNOWN}var
m=cc.Enum({GRAVITY:0,RADIUS:1}),p=cc.Enum({FREE:0,RELATIVE:1,GROUPED:2}),v={preview
:{default:!0,editorOnly:!0,notify:!1,animatable:!1,tooltip:!1},_custom:!1,custom:
{get:function(){return this._custom},set:function(t){this._custom!
==t&&(this._custom=t,this._applyFile())},animatable:!1,tooltip:!1},_file:
{default:null,type:r},file:{get:function(){return this._file},set:function(t,e)
{this._file!==t&&(this._file=t,t?this._applyFile():this.custom=!0)},animatable:!
1,type:r,tooltip:!1},_spriteFrame:{default:null,type:cc.SpriteFrame},spriteFrame:
{get:function(){return this._spriteFrame},set:function(t,e){var
i=this._renderSpriteFrame;i!==t&&(this._renderSpriteFrame=t,t&&!t._uuid||
(this._spriteFrame=t),(i&&i.getTexture())!
==(t&&t.getTexture())&&(this._texture=null,this._applySpriteFrame(i)))},type:cc.Spr
iteFrame,tooltip:!1},_texture:{default:null,type:cc.Texture2D,editorOnly:!
0},texture:{get:function(){return this._texture},set:function(t)
{t&&cc.warnID(6017)},type:cc.Texture2D,tooltip:!1,readonly:!0,visible:!
1,animatable:!1},particleCount:{visible:!1,get:function(){return
this._simulator.particles.length},readonly:!0},_stopped:!0,stopped:{get:function()
{return this._stopped},animatable:!1,visible:!1},playOnLoad:!0,autoRemoveOnFinish:
{default:!1,animatable:!1,tooltip:!1},active:{get:function(){return
this._simulator.active},visible:!1},totalParticles:150,duration:-
1,emissionRate:10,life:1,lifeVar:0,_startColor:null,startColor:
{type:cc.Color,get:function(){return this._startColor},set:function(t)
{this._startColor.r=t.r,this._startColor.g=t.g,this._startColor.b=t.b,this._startCo
lor.a=t.a}},_startColorVar:null,startColorVar:{type:cc.Color,get:function(){return
this._startColorVar},set:function(t)
{this._startColorVar.r=t.r,this._startColorVar.g=t.g,this._startColorVar.b=t.b,this
._startColorVar.a=t.a}},_endColor:null,endColor:{type:cc.Color,get:function()
{return this._endColor},set:function(t)
{this._endColor.r=t.r,this._endColor.g=t.g,this._endColor.b=t.b,this._endColor.a=t.
a}},_endColorVar:null,endColorVar:{type:cc.Color,get:function(){return
this._endColorVar},set:function(t)
{this._endColorVar.r=t.r,this._endColorVar.g=t.g,this._endColorVar.b=t.b,this._endC
olorVar.a=t.a}},angle:90,angleVar:20,startSize:50,startSizeVar:0,endSize:0,endSizeV
ar:0,startSpin:0,startSpinVar:0,endSpin:0,endSpinVar:0,sourcePos:cc.Vec2.ZERO,posVa
r:cc.Vec2.ZERO,_positionType:
{default:p.FREE,formerlySerializedAs:"positionType"},positionType:
{type:p,get:function(){return this._positionType},set:function(t)
{this.sharedMaterials[0]&&this.sharedMaterials[0].define("_USE_MODEL",t!
==p.FREE),this._positionType=t}},emitterMode:
{default:m.GRAVITY,type:m},gravity:cc.Vec2.ZERO,speed:180,speedVar:50,tangentialAcc
el:80,tangentialAccelVar:0,radialAccel:0,radialAccelVar:0,rotationIsDir:!
1,startRadius:0,startRadiusVar:0,endRadius:0,endRadiusVar:0,rotatePerS:0,rotatePerS
Var:0},y=cc.Class({name:"cc.ParticleSystem",extends:s,mixins:[f],editor:!
1,ctor:function(){this._previewTimer=null,this._focused=!1,this._simulator=new
u(this),this._startColor=cc.color(255,255,255,255),this._startColorVar=cc.color(0,0
,0,0),this._endColor=cc.color(255,255,255,0),this._endColorVar=cc.color(0,0,0,0),th
is._renderSpriteFrame=null},properties:v,statics:{DURATION_INFINITY:-
1,START_SIZE_EQUAL_TO_END_SIZE:-1,START_RADIUS_EQUAL_TO_END_RADIUS:-
1,EmitterMode:m,PositionType:p,_PNGReader:o,_TIFFReader:l},onFocusInEditor:!
1,onLostFocusInEditor:!1,_convertTextureToSpriteFrame:!1,__preload:function()
{if(this._custom&&this.spriteFrame&&!
this._renderSpriteFrame)this._applySpriteFrame(this.spriteFrame);else
if(this._file){if(this._custom)!this._texture&&this._applyFile();else
this._applyFile()}this.playOnLoad&&this.resetSystem()},onEnable:function()
{this._super(),this.node._renderFlag&=~c.FLAG_RENDER,this._activateMaterial()},onDe
stroy:function(){this.autoRemoveOnFinish&&(this.autoRemoveOnFinish=!
1),this._buffer&&(this._buffer.destroy(),this._buffer=null),this._ia=null,this._sim
ulator._uvFilled=0,this._super()},lateUpdate:function(t){!
this._simulator.finished&&this.sharedMaterials[0]&&this._simulator.step(t)},addPart
icle:function(){},stopSystem:function(){this._stopped=!
0,this._simulator.stop()},resetSystem:function(){this._stopped=!
1,this._simulator.reset(),this._activateMaterial()},isFull:function(){return
this.particleCount>=this.totalParticles},setTextureWithRect:function(t,e){t
instanceof cc.Texture2D&&(this.spriteFrame=new
cc.SpriteFrame(t,e))},_applyFile:function(){var t=this._file;if(t){var
e=this;cc.loader.load(t.nativeUrl,(function(i,n){!i&&n?
e.isValid&&(e._plistFile=t.nativeUrl,e._custom||
e._initWithDictionary(n),e._spriteFrame?!
e._renderSpriteFrame&&e._spriteFrame&&e._applySpriteFrame(e.spriteFrame):t.spriteFr
ame?
e.spriteFrame=t.spriteFrame:e._custom&&e._initTextureWithDictionary(n)):cc.errorID(
6029)}))}},_initTextureWithDictionary:function(t){var
e=cc.path.changeBasename(this._plistFile,t.textureFileName||"");if(t.textureFileNam
e)h.loadImage(e,(function(e,i){e?(t.textureFileName=void
0,this._initTextureWithDictionary(t)):this.spriteFrame=new
cc.SpriteFrame(i)}),this);else if(t.textureImageData){var i=t.textureImageData;if(!
(i&&i.length>0))return!1;var r=cc.loader.getRes(e);if(!r){var
s=a.unzipBase64AsArray(i,1);if(!s)return cc.logID(6030),!1;var c=d(s);if(c!
==n.ImageFormat.TIFF&&c!==n.ImageFormat.PNG)return cc.logID(6031),!1;var
u=document.createElement("canvas");if(c===n.ImageFormat.PNG)new o(s).render(u);else
l.parseTIFF(s,u);r=h.cacheImage(e,u)}r||cc.logID(6032),this.spriteFrame=new
cc.SpriteFrame(r)}return!0},_initWithDictionary:function(t)
{this.totalParticles=parseInt(t.maxParticles||
0),this.life=parseFloat(t.particleLifespan||
0),this.lifeVar=parseFloat(t.particleLifespanVariance||0);var
e=t.emissionRate;this.emissionRate=e||
Math.min(this.totalParticles/this.life,Number.MAX_VALUE),this.duration=parseFloat(t
.duration||0),this.srcBlendFactor=parseInt(t.blendFuncSource||
n.SRC_ALPHA),this.dstBlendFactor=parseInt(t.blendFuncDestination||
n.ONE_MINUS_SRC_ALPHA);var i=this._startColor;i.r=255*parseFloat(t.startColorRed||
0),i.g=255*parseFloat(t.startColorGreen||0),i.b=255*parseFloat(t.startColorBlue||
0),i.a=255*parseFloat(t.startColorAlpha||0);var
r=this._startColorVar;r.r=255*parseFloat(t.startColorVarianceRed||
0),r.g=255*parseFloat(t.startColorVarianceGreen||
0),r.b=255*parseFloat(t.startColorVarianceBlue||
0),r.a=255*parseFloat(t.startColorVarianceAlpha||0);var
s=this._endColor;s.r=255*parseFloat(t.finishColorRed||
0),s.g=255*parseFloat(t.finishColorGreen||0),s.b=255*parseFloat(t.finishColorBlue||
0),s.a=255*parseFloat(t.finishColorAlpha||0);var
a=this._endColorVar;if(a.r=255*parseFloat(t.finishColorVarianceRed||
0),a.g=255*parseFloat(t.finishColorVarianceGreen||
0),a.b=255*parseFloat(t.finishColorVarianceBlue||
0),a.a=255*parseFloat(t.finishColorVarianceAlpha||
0),this.startSize=parseFloat(t.startParticleSize||
0),this.startSizeVar=parseFloat(t.startParticleSizeVariance||
0),this.endSize=parseFloat(t.finishParticleSize||
0),this.endSizeVar=parseFloat(t.finishParticleSizeVariance||
0),this.positionType=parseFloat(t.positionType||
p.RELATIVE),this.sourcePos.x=0,this.sourcePos.y=0,this.posVar.x=parseFloat(t.source
PositionVariancex||0),this.posVar.y=parseFloat(t.sourcePositionVariancey||
0),this.angle=parseFloat(t.angle||0),this.angleVar=parseFloat(t.angleVariance||
0),this.startSpin=parseFloat(t.rotationStart||0),this.startSpinVar=pars
eFloat(t.rotationStartVariance||0),this.endSpin=parseFloat(t.rotationEnd||
0),this.endSpinVar=parseFloat(t.rotationEndVariance||
0),this.emitterMode=parseInt(t.emitterType||
m.GRAVITY),this.emitterMode===m.GRAVITY){this.gravity.x=parseFloat(t.gravityx||
0),this.gravity.y=parseFloat(t.gravityy||0),this.speed=parseFloat(t.speed||
0),this.speedVar=parseFloat(t.speedVariance||
0),this.radialAccel=parseFloat(t.radialAcceleration||
0),this.radialAccelVar=parseFloat(t.radialAccelVariance||
0),this.tangentialAccel=parseFloat(t.tangentialAcceleration||
0),this.tangentialAccelVar=parseFloat(t.tangentialAccelVariance||0);var
o=t.rotationIsDir||"";null!==o?
(o=o.toString().toLowerCase(),this.rotationIsDir="true"===o||"1"===o):this.rotation
IsDir=!1}else{if(this.emitterMode!==m.RADIUS)return cc.warnID(6009),!
1;this.startRadius=parseFloat(t.maxRadius||
0),this.startRadiusVar=parseFloat(t.maxRadiusVariance||
0),this.endRadius=parseFloat(t.minRadius||
0),this.endRadiusVar=parseFloat(t.minRadiusVariance||
0),this.rotatePerS=parseFloat(t.rotatePerSecond||
0),this.rotatePerSVar=parseFloat(t.rotatePerSecondVariance||0)}return
this._initTextureWithDictionary(t),!0},_onTextureLoaded:function()
{this._texture=this._renderSpriteFrame.getTexture(),this._simulator.updateUVs(!
0),this._activateMaterial()},_applySpriteFrame:function(t)
{t&&t.off&&t.off("load",this._onTextureLoaded,this);var
e=this._renderSpriteFrame=this._renderSpriteFrame||
this._spriteFrame;e&&(e.textureLoaded()?this._onTextureLoaded(null):
(e.once("load",this._onTextureLoaded,this),e.ensureLoadTexture()))},_activateMateri
al:function(){if(!this._texture||!this._texture.loaded)return
this.markForCustomIARender(!
1),void(this._renderSpriteFrame&&this._applySpriteFrame());this._ia||
y._assembler.createIA(this);var t=this.sharedMaterials[0];t?
t=_.getInstantiatedMaterial(t,this):
((t=_.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),t.define("_USE_MODEL",this._positionType!
==p.FREE)),t.setProperty("texture",this._texture),this.setMaterial(0,t),this.markFo
rCustomIARender(!0)},_finishedSimulation:function()
{this.resetSystem(),this.stopSystem(),this.disableRender(),this.autoRemoveOnFinish&
&this._stopped&&this.node.destroy()}});cc.ParticleSystem=e.exports=y}),
{"../compression/ZipUtils":22,"../core/assets/material/CCMaterial":75,"../core/comp
onents/CCRenderComponent":106,"../core/platform/CCMacro":205,"../core/renderer/rend
er-flow":244,"../core/utils/blend-func":288,"../core/utils/texture-
util":302,"./CCPNGReader":328,"./CCParticleAsset":329,"./CCTIFFReader":331,"./parti
cle-simulator":333,"fire-url":void 0}],331:[(function(t,e,i){"use strict";var
n=t("../core/CCDebug"),r={_littleEndian:!1,_tiffData:null,_fileDirectories:
[],getUint8:function(t){return this._tiffData[t]},getUint16:function(t){return
this._littleEndian?this._tiffData[t+1]<<8|this._tiffData[t]:this._tiffData[t]<<8|
this._tiffData[t+1]},getUint32:function(t){var e=this._tiffData;return
this._littleEndian?e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]:e[t]<<24|e[t+1]<<16|
e[t+2]<<8|e[t+3]},checkLittleEndian:function(){var
t=this.getUint16(0);if(18761===t)this.littleEndian=!0;else{if(19789!==t)throw
console.log(t),TypeError(n.getError(6019));this.littleEndian=!1}return
this.littleEndian},hasTowel:function(){if(42!==this.getUint16(2))throw
RangeError(n.getError(6020));return!0},getFieldTypeName:function(t){var
e=this.fieldTypeNames;return t in e?e[t]:null},getFieldTagName:function(t){var
e=this.fieldTagNames;return t in e?e[t]:
(cc.logID(6021,t),"Tag"+t)},getFieldTypeLength:function(t){return-1!
==["BYTE","ASCII","SBYTE","UNDEFINED"].indexOf(t)?1:-1!
==["SHORT","SSHORT"].indexOf(t)?2:-1!==["LONG","SLONG","FLOAT"].indexOf(t)?4:-1!
==["RATIONAL","SRATIONAL","DOUBLE"].indexOf(t)?
8:null},getFieldValues:function(t,e,i,n){var
r=[],s=this.getFieldTypeLength(e);if(s*i<=4)!1===this.littleEndian?r.push(n>>>8*(4-
s)):r.push(n);else for(var a=0;a<i;a++){var o=s*a;s>=8?-1!
==["RATIONAL","SRATIONAL"].indexOf(e)?
(r.push(this.getUint32(n+o)),r.push(this.getUint32(n+o+4))):cc.logID(8e3):r.push(th
is.getBytes(s,n+o))}return"ASCII"===e&&r.forEach((function(t,e,i)
{i[e]=String.fromCharCode(t)})),r},getBytes:function(t,e)
{if(t<=0)cc.logID(8001);else{if(t<=1)return this.getUint8(e);if(t<=2)return
this.getUint16(e);if(t<=3)return this.getUint32(e)>>>8;if(t<=4)return
this.getUint32(e);cc.logID(8002)}},getBits:function(t,e,i){i=i||0;var
n,r,s=e+Math.floor(i/8),a=i+t,o=32-t;return a<=0?cc.logID(6023):a<=8?
(n=24+i,r=this.getUint8(s)):a<=16?(n=16+i,r=this.getUint16(s)):a<=32?
(n=i,r=this.getUint32(s)):cc.logID(6022),
{bits:r<<n>>>o,byteOffset:s+Math.floor(a/8),bitOffset:a
%8}},parseFileDirectory:function(t){for(var
e=this.getUint16(t),i=[],n=t+2,r=0;r<e;n+=12,r++){var
s=this.getUint16(n),a=this.getUint16(n+2),o=this.getUint32(n+4),l=this.getUint32(n+
8),h=this.getFieldTagName(s),c=this.getFieldTypeName(a),u=this.getFieldValues(h,c,o
,l);i[h]={type:c,values:u}}this._fileDirectories.push(i);var _=this.getUint32(n);0!
==_&&this.parseFileDirectory(_)},clampColorSample:function(t,e){var i=Math.pow(2,8-
e);return Math.floor(t*i+(i-1))},parseTIFF:function(t,e){if(e=e||
document.createElement("canvas"),this._tiffData=t,this.canvas=e,this.checkLittleEnd
ian(),this.hasTowel()){var
i=this.getUint32(4);this._fileDirectories.length=0,this.parseFileDirectory(i);var
r=this._fileDirectories[0],s=r.ImageWidth.values[0],a=r.ImageLength.values[0];this.
canvas.width=s,this.canvas.height=a;var o=[],l=r.Compression?
r.Compression.values[0]:1,h=r.SamplesPerPixel.values[0],c=[],u=0,_=!
1;if(r.BitsPerSample.values.forEach((function(t,e,i)
{c[e]={bitsPerSample:t,hasBytesPerSample:!1,bytesPerSample:void 0},t
%8==0&&(c[e].hasBytesPerSample=!0,c[e].bytesPerSample=t/8),u+=t}),this),u%8==0){_=!
0;var f=u/8}var d=r.StripOffsets.values,m=d.length;if(r.StripByteCounts)var
p=r.StripByteCounts.values;else{if(cc.logID(8003),1!==m)throw
Error(n.getError(6024));p=[Math.ceil(s*a*u/8)]}for(var v=0;v<m;v++){var
y=d[v];o[v]=[];for(var g=p[v],x=0,b=0,A=1,C=!0,S=[],T=0,w=0,E=0;x<g;x+=A)switch(l)
{case 1:var M=0;for(S=[];M<h;M++){if(!c[M].hasBytesPerSample){var
D=this.getBits(c[M].bitsPerSample,y+x,b);throw S.push(D.bits),x=D.byteOffset-
y,b=D.bitOffset,RangeError(n.getError(6025))}var
B=c[M].bytesPerSample*M;S.push(this.getBytes(c[M].bytesPerSample,y+x+B))}if(o[v].pu
sh(S),!_)throw A=0,RangeError(n.getError(6026));A=f;break;case 2:case 3:case 4:case
5:case 6:case 7:break;case 32773:if(C){C=!1;var
P=1,I=1,R=this.getInt8(y+x);R>=0&&R<=127?P=R+1:R>=-127&&R<=-1?I=1-R:C=!0}else{var
O=this.getUint8(y+x);for(M=0;M<I;M++){if(!c[w].hasBytesPerSample)throw
RangeError(n.getError(6025));E=E<<8*T|O,+
+T===c[w].bytesPerSample&&(S.push(E),E=T=0,w+
+),w===h&&(o[v].push(S),S=[],w=0)}0===--P&&(C=!0)}A=1}}if(e.getContext){var
L=this.canvas.getContext("2d");L.fillStyle="rgba(255, 255, 255, 0)";var
F=r.RowsPerStrip?r.RowsPerStrip.values[0]:a,V=o.length,N=a%F,k=0===N?
F:N,G=F,z=0,U=r.PhotometricInterpretation.values[0],j=[],W=0;if(r.ExtraSamples&&(W=
(j=r.ExtraSamples.values).length),r.ColorMap)var
H=r.ColorMap.values,X=Math.pow(2,c[0].bitsPerSample);for(v=0;v<V;v++)
{v+1===V&&(G=k);for(var q=o[v].length,Y=z*v,J=0,Z=0;Z<q;J++)for(var K=0;K<s;K++,Z+
+){var Q=o[v][Z],$=0,tt=0,et=0,it=1;if(W>0)for(var nt=0;nt<W;nt++)if(1===j[nt]||
2===j[nt]){it=Q[3+nt]/256;break}switch(U){case 0:if(c[0].hasBytesPerSample)var
rt=Math.pow(16,2*c[0].bytesPerSample);Q.forEach((function(t,e,i){i[e]=rt-t}));case
1:$=tt=et=this.clampColorSample(Q[0],c[0].bitsPerSample);break;case
2:$=this.clampColorSample(Q[0],c[0].bitsPerSample),tt=this.clampColorSample(Q[1],c[
1].bitsPerSample),et=this.clampColorSample(Q[2],c[2].bitsPerSample);break;case
3:if(void 0===H)throw Error(n.getError(6027));var st=Q[0];
$=this.clampColorSample(H[st],16),tt=this.clampColorSample(H[X+st],16),et=this.clam
pColorSample(H[2*X+st],16);break;default:throw
RangeError(n.getError(6028,U))}L.fillStyle="rgba("+$+", "+tt+", "+et+",
"+it+")",L.fillRect(K,Y+J,1,1)}z=G}}return this.canvas}},fieldTagNames:
{315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",2
59:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder
",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseU
nit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",2
71:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType
",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"
ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripB
yteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolutio
n",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"Conse
cutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"Dot
Range",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageN
umber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"S
ampleFormat",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325
:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferF
unction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficien
ts",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPositi
on",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateT
imeOriginal",34665:"Exif
IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",4096
0:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500
:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC
Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop"},fie
ldTypeNames:
{1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHO
RT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE"}};e.exports=r}),
{"../core/CCDebug":49}],332:[(function(t,e,i){"use
strict";t("./CCParticleAsset"),t("./CCParticleSystem"),t("./particle-
simulator"),t("./particle-system-assembler")}),
{"./CCParticleAsset":329,"./CCParticleSystem":330,"./particle-
simulator":333,"./particle-system-assembler":334}],333:[(function(t,e,i){"use
strict";var n=t("../core/utils/affine-
transform"),r=t("../core/platform/js"),s=t("../core/utils/misc"),a=cc.v2(0,0),o=n.c
reate(),l=cc.v2(),h=cc.v2(),c=cc.v2(),u=cc.v2(),_=function()
{this.pos=cc.v2(0,0),this.startPos=cc.v2(0,0),this.color=cc.color(0,0,0,255),this.d
eltaColor={r:0,g:0,b:0,a:255},this.size=0,this.deltaSize=0,this.rotation=0,this.del
taRotation=0,this.timeToLive=0,this.drawPos=cc.v2(0,0),this.dir=cc.v2(0,0),this.rad
ialAccel=0,this.tangentialAccel=0,this.angle=0,this.degreesPerSecond=0,this.radius=
0,this.deltaRadius=0},f=new r.Pool(function(t)
{t.pos.set(a),t.startPos.set(a),t.color._val=4278190080,t.deltaColor.r=t.deltaColor
.g=t.deltaColor.b=0,t.deltaColor.a=255,t.size=0,t.deltaSize=0,t.rotation=0,t.deltaR
otation=0,t.timeToLive=0,t.drawPos.set(a),t.dir.set(a),t.radialAccel=0,t.tangential
Accel=0,t.angle=0,t.degreesPerSecond=0,t.radius=0,t.deltaRadius=0},1024);f.get=func
tion(){return this._get()||new _};var d=function(t)
{this.sys=t,this.particles=[],this.active=!1,this.finished=!
1,this.elapsed=0,this.emitCounter=0,this._uvFilled=0};function m(t){for(var
e=0,i=t;i;)e+=i.angle,i=i.parent;return e}d.prototype.stop=function(){this.active=!
1,this.elapsed=this.sys.duration,this.emitCounter=0},d.prototype.reset=function()
{this.active=!0,this.elapsed=0,this.emitCounter=0,this.finished=!1;for(var
t=this.particles,e=0;e<t.length;+
+e)f.put(t[e]);t.length=0},d.prototype.emitParticle=function(t){var
e=this.sys,i=s.clampf,n=f.get();this.particles.push(n),n.timeToLive=e.life+e.lifeVa
r*(Math.random()-.5)*2;var
r=n.timeToLive=Math.max(0,n.timeToLive);n.pos.x=e.sourcePos.x+e.posVar.x*(Math.rand
om()-.5)*2,n.pos.y=e.sourcePos.y+e.posVar.y*(Math.random()-.5)*2;var
a,o,l,h,c=e._startColor,u=e._startColorVar,_=e._endColor,d=e._endColorVar;n.color.r
=a=i(c.r+u.r*(Math.random()-.5)*2,0,255),n.color.g=o=i(c.g+u.g*(Math.random()-.5)*2
,0,255),n.color.b=l=i(c.b+u.b*(Math.random()-.5)*2,0,255),n.color.a=h=i(c.a+u.a*(Ma
th.random()-.5)*2,0,255),n.deltaColor.r=(i(_.r+d.r*(Math.random()-.5)*2,0,255)-
a)/r,n.deltaColor.g=(i(_.g+d.g*(Math.random()-.5)*2,0,255)-
o)/r,n.deltaColor.b=(i(_.b+d.b*(Math.random()-.5)*2,0,255)-
l)/r,n.deltaColor.a=(i(_.a+d.a*(Math.random()-.5)*2,0,255)-h)/r;var
p=e.startSize+e.startSizeVar*(Math.random()-.5)*2;if(p=Math.max(0,p),n.size=p,e.end
Size===cc.ParticleSystem.START_SIZE_EQUAL_TO_END_SIZE)n.deltaSize=0;else{var
v=e.endSize+e.endSizeVar*(Math.random()-.5)*2;v=Math.max(0,v),n.deltaSize=(v-
p)/r}var
y=e.startSpin+e.startSpinVar*(Math.random()-.5)*2,g=e.endSpin+e.endSpinVar*(Math.ra
ndom()-.5)*2;n.rotation=y,n.deltaRotation=(g-
y)/r,n.startPos.x=t.x,n.startPos.y=t.y;var
x=m(e.node),b=e.positionType===cc.ParticleSystem.PositionType.FREE?
e.angle+x:e.angle,A=s.degreesToRadians(b+e.angleVar*(Math.random()-.5)*2);if(e.emit
terMode===cc.ParticleSystem.EmitterMode.GRAVITY){var
C=e.speed+e.speedVar*(Math.random()-.5)*2;n.dir.x=Math.cos(A),n.dir.y=Math.sin(A),n
.dir.mulSelf(C),n.radialAccel=e.radialAccel+e.radialAccelVar*(Math.random()-.5)*2,n
.tangentialAccel=e.tangentialAccel+e.tangentialAccelVar*(Math.random()-.5)*2,e.rota
tionIsDir&&(n.rotation=-s.radiansToDegrees(Math.atan2(n.dir.y,n.dir.x)))}else{var
S=e.startRadius+e.startRadiusVar*(Math.random()-.5)*2,T=e.endRadius+e.endRadiusVar*
(Math.random()-.5)*2;n.radius=S,n.deltaRadius=e.endRadius===cc.ParticleSystem.START
_RADIUS_EQUAL_TO_END_RADIUS?0:(T-
S)/r,n.angle=A,n.degreesPerSecond=s.degreesToRadians(e.rotatePerS+e.rotatePerSVar*(
Math.random()-.5)*2)}},d.prototype.updateUVs=function(t){var
e=this.particles.length;if(this.sys._buffer&&this.sys._renderSpriteFrame){for(var
i=4*this.sys._vertexFormat._bytes/4,n=this.sys._buffer._vData,r=this.sys._renderSpr
iteFrame.uv,s=t?0:this._uvFilled;s<e;s++){var
a=s*i;n[a+2]=r[0],n[a+3]=r[1],n[a+7]=r[2],n[a+8]=r[3],n[a+12]=r[4],n[a+13]=r[5],n[a
+17]=r[6],n[a+18]=r[7]}this._uvFilled=e}},d.prototype.updateParticleBuffer=function
(t,e,i,n){var r=i._vData,a=i._uintVData,o=e.x,l=e.y,h=t.size/2;if(t.rotation){var
c=-h,u=-h,_=h,f=h,d=-
s.degreesToRadians(t.rotation),m=Math.cos(d),p=Math.sin(d);r[n]=c*m-
u*p+o,r[n+1]=c*p+u*m+l,r[n+5]=_*m-u*p+o,r[n+6]=_*p+u*m+l,r[n+10]=c*m-
f*p+o,r[n+11]=c*p+f*m+l,r[n+15]=_*m-f*p+o,r[n+16]=_*p+f*m+l}else r[n]=o-h,r[n+1]=l-
h,r[n+5]=o+h,r[n+6]=l-h,r[n+10]=o-
h,r[n+11]=l+h,r[n+15]=o+h,r[n+16]=l+h;a[n+4]=t.color._val,a[n+9]=t.color._val,a[n+1
4]=t.color._val,a[n+19]=t.color._val},d.prototype.step=function(t){var
e=this.sys,i=e.node,r=this.particles,_=4*e._vertexFormat._bytes/4;if(i._updateWorld
Matrix(),o=n.identity(),e.positionType===cc.ParticleSystem.PositionType.FREE)o.tx=i
._worldMatrix.m12,o.ty=i._worldMatrix.m13,n.transformVec2(l,a,o);else
if(e.positionType===cc.ParticleSystem.PositionType.RELATIVE){var
d=s.degreesToRadians(-i.angle),m=Math.cos(d),p=Math.sin(d);o=n.create(m,-
p,p,m,0,0),l.x=i._position.x,l.y=i._position.y}n.invert(o,o);var
v=o;if(this.active&&e.emissionRate){var
y=1/e.emissionRate;for(r.length<e.totalParticles&&(this.emitCounter+=t);r.length<e.
totalParticles&&this.emitCounter>y;)this.emitParticle(l),this.emitCounter-
=y;this.elapsed+=t,-1!==e.duration&&e.duration<this.elapsed&&e.stopSystem()}var
g=e._buffer,x=r.length;g.reset(),g.request(4*x,6*x),x>this._uvFilled&&this.updateUV
s();for(var b=0;b<r.length;){h.x=h.y=c.x=c.y=u.x=u.y=0;var A=r[b];if(A.timeToLive-
=t,A.timeToLive>0){if(e.emitterMode===cc.ParticleSystem.EmitterMode.GRAVITY){var
C=u,S=h,T=c;(A.pos.x||
A.pos.y)&&(S.set(A.pos),S.normalizeSelf()),T.set(S),S.mulSelf(A.radialAccel);var
w=T.x;T.x=-
T.y,T.y=w,T.mulSelf(A.tangentialAccel),C.set(S),C.addSelf(T),C.addSelf(e.gravity),C
.mulSelf(t),A.dir.addSelf(C),C.set(A.dir),C.mulSelf(t),A.pos.addSelf(C)}else
A.angle+=A.degreesPerSecond*t,A.radius+=A.deltaRadius*t,A.pos.x=-
Math.cos(A.angle)*A.radius,A.pos.y=-
Math.sin(A.angle)*A.radius;A.color.r+=A.deltaColor.r*t,A.color.g+=A.deltaColor.g*t,
A.color.b+=A.deltaColor.b*t,A.color.a+=A.deltaColor.a*t,A.size+=A.deltaSize*t,A.siz
e<0&&(A.size=0),A.rotation+=A.deltaRotation*t;var
E=h,M=c;if(e.positionType===cc.ParticleSystem.PositionType.FREE)M.subSelf(A.startPo
s),E.set(A.pos),E.subSelf(M);else
if(e.positionType===cc.ParticleSystem.PositionType.RELATIVE){var
D=u;n.transformVec2(M,l,v),n.transformVec2(D,A.startPos,v),M.subSelf(D),E.set(A.pos
),E.subSelf(M)}else E.set(A.pos);var B=_*b;this.updateParticleBuffer(A,E,g,B),+
+b}else{var P=r[b];b!==r.length-1&&(r[b]=r[r.length-
1]),f.put(P),r.length--}}r.length>0?
(g.uploadData(),e._ia._count=6*r.length):this.active||(this.finished=!
0,e._finishedSimulation())},e.exports=d}),
{"../core/platform/js":220,"../core/utils/affine-
transform":285,"../core/utils/misc":295}],334:[(function(t,e,i){"use strict";var
n=s(t("../renderer/render-data/ia-render-data")),r=s(t("../renderer/core/input-
assembler"));function s(t){return t&&t.__esModule?t:{default:t}}var
a=t("./CCParticleSystem"),o=t("../core/renderer/"),l=t("../core/renderer/webgl/vert
ex-format").vfmtPosUvColor,h=t("../core/renderer/webgl/quad-
buffer"),c={createIA:function(t){o.device;t._vertexFormat=l,t._buffer=new
h(o._handle,l),t._ia=new
r.default,t._ia._vertexBuffer=t._buffer._vb,t._ia._indexBuffer=t._buffer._ib,t._ia.
_start=0,t._ia._count=0},updateRenderData:function(t){t._renderData||
(t._renderData=new
n.default),t._renderData.ia=t._ia,t._renderData.material=t.sharedMaterials[0]},rend
erIA:function(t,e){e._flushIA(t._renderData)}};a._assembler=c,e.exports=c}),
{"../core/renderer/":243,"../core/renderer/webgl/quad-
buffer":281,"../core/renderer/webgl/vertex-format":283,"../renderer/core/input-
assembler":338,"../renderer/render-data/ia-render-
data":367,"./CCParticleSystem":330}],335:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=0,r={};i.default={addStage:function(t){if(void 0===r[t]){var
e=1<<n;r[t]=e,n+=1}},stageID:function(t){var e=r[t];return void 0===e?-
1:e},stageIDs:function(t){for(var e=0,i=0;i<t.length;++i){var n=r[t[i]];void 0!
==n&&(e|=n)}return e}},e.exports=i.default}),{}],336:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n,r,s=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),a=t("../memop"),o=_(t("../enums")),l=t("../../core/vmath"),h=_(t("./program-
lib")),c=_(t("./view")),u=_(t("../gfx"));function _(t){return t&&t.__esModule?t:
{default:t}}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a
class as a function")}function d(t,e,i){return e in t?Object.defineProperty(t,e,
{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var
m=l.mat3.create(),p=l.mat4.create(),v=new a.RecyclePool(function()
{return{stage:null,items:null}},8),y=new a.RecyclePool(function(){return new
Float32Array(2)},8),g=new a.RecyclePool(function(){return new
Float32Array(3)},8),x=new a.RecyclePool(function(){return new
Float32Array(4)},8),b=new a.RecyclePool(function(){return new
Float32Array(9)},8),A=new a.RecyclePool(function(){return new
Float32Array(16)},8),C=new a.RecyclePool(function(){return new
Float32Array(64)},8),S=new a.RecyclePool(function(){return new
Int32Array(2)},8),T=new a.RecyclePool(function(){return new Int32Array(3)},8),w=new
a.RecyclePool(function(){return new Int32Array(4)},8),E=new
a.RecyclePool(function(){return new
Int32Array(64)},8),M=(d(n={},o.default.PARAM_INT,(function(t){return
t})),d(n,o.default.PARAM_INT2,(function(t){return
l.vec2.array(S.add(),t)})),d(n,o.default.PARAM_INT3,(function(t){return
l.vec3.array(T.add(),t)})),d(n,o.default.PARAM_INT4,(function(t){return
l.vec4.array(w.add(),t)})),d(n,o.default.PARAM_FLOAT,(function(t){return
t})),d(n,o.default.PARAM_FLOAT2,(function(t){return
l.vec2.array(y.add(),t)})),d(n,o.default.PARAM_FLOAT3,(function(t){return
l.vec3.array(g.add(),t)})),d(n,o.default.PARAM_FLOAT4,(function(t){return
l.vec4.array(x.add(),t)})),d(n,o.default.PARAM_COLOR3,(function(t){return
l.color3.array(g.add(),t)})),d(n,o.default.PARAM_COLOR4,(function(t){return
l.color4.array(x.add(),t)})),d(n,o.default.PARAM_MAT2,(function(t){return
l.mat2.array(x.add(),t)})),d(n,o.default.PARAM_MAT3,(function(t){return
l.mat3.array(b.add(),t)})),d(n,o.default.PARAM_MAT4,(function(t){return
l.mat4.array(A.add(),t)})),n),D=(d(r={},o.default.PARAM_INT,{func:function(t)
{for(var e=E.add(),i=0;i<t.length;++i)e[i]=t[i];return
e},size:1}),d(r,o.default.PARAM_INT2,{func:function(t){for(var
e=E.add(),i=0;i<t.length;++i)e[2*i]=t[i].x,e[2*i+1]=t[i].y;return
e},size:2}),d(r,o.default.PARAM_INT3,{func:void
0,size:3}),d(r,o.default.PARAM_INT4,{func:function(t){for(var
e=E.add(),i=0;i<t.length;++i){var
n=t[i];e[4*i]=n.x,e[4*i+1]=n.y,e[4*i+2]=n.z,e[4*i+3]=n.w}return
e},size:4}),d(r,o.default.PARAM_FLOAT,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i)e[i]=t[i];return
e},size:1}),d(r,o.default.PARAM_FLOAT2,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i)e[2*i]=t[i].x,e[2*i+1]=t[i].y;return
e},size:2}),d(r,o.default.PARAM_FLOAT3,{func:void
0,size:3}),d(r,o.default.PARAM_FLOAT4,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i){var
n=t[i];e[4*i]=n.x,e[4*i+1]=n.y,e[4*i+2]=n.z,e[4*i+3]=n.w}return
e},size:4}),d(r,o.default.PARAM_COLOR3,{func:void
0,size:3}),d(r,o.default.PARAM_COLOR4,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i){var
n=t[i];e[4*i]=n.r,e[4*i+1]=n.g,e[4*i+2]=n.b,e[4*i+3]=n.a}return
e},size:4}),d(r,o.default.PARAM_MAT2,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i){var
n=t[i];e[4*i]=n.m00,e[4*i+1]=n.m01,e[4*i+2]=n.m02,e[4*i+3]=n.m03}return
e},size:4}),d(r,o.default.PARAM_MAT3,{func:void
0,size:9}),d(r,o.default.PARAM_MAT4,{func:function(t){for(var
e=C.add(),i=0;i<t.length;++i){var
n=t[i];e[16*i]=n.m00,e[16*i+1]=n.m01,e[16*i+2]=n.m02,e[16*i+3]=n.m03,e[16*i+4]=n.m0
4,e[16*i+5]=n.m05,e[16*i+6]=n.m06,e[16*i+7]=n.m07,e[16*i+8]=n.m08,e[16*i+9]=n.m09,e
[16*i+10]=n.m10,e[16*i+11]=n.m11,e[16*i+12]=n.m12,e[16*i+13]=n.m13,e[16*i+14]=n.m14
,e[16*i+15]=n.m15}return e},size:16}),r),B=(function(){function t(e,i){var
n;f(this,t),this._device=e,this._programLib=new
h.default(e,i.programTemplates,i.programChunks),this._opts=i,this._type2defaultValu
e=(d(n={},o.default.PARAM_INT,0),d(n,o.default.PARAM_INT2,l.vec2.create(0,0)),d(n,o
.default.PARAM_INT3,l.vec3.create(0,0,0)),d(n,o.default.PARAM_INT4,l.vec4.create(0,
0,0,0)),d(n,o.default.PARAM_FLOAT,0),d(n,o.default.PARAM_FLOAT2,l.vec2.create(0,0))
,d(n,o.default.PARAM_FLOAT3,l.vec3.create(0,0,0)),d(n,o.default.PARAM_FLOAT4,l.vec4
.create(0,0,0,0)),d(n,o.default.PARAM_COLOR3,l.color3.create(0,0,0)),d(n,o.default.
PARAM_COLOR4,l.color4.create(0,0,0,1)),d(n,o.default.PARAM_MAT2,l.mat2.create()),d(
n,o.default.PARAM_MAT3,l.mat3.create()),d(n,o.default.PARAM_MAT4,l.mat4.create()),d
(n,o.default.PARAM_TEXTURE_2D,i.defaultTexture),d(n,o.default.PARAM_TEXTURE_CUBE,i.
defaultTextureCube),n),this._stage2fn={},this._usedTextureUnits=0,this._viewPools=n
ew a.RecyclePool(function(){return new c.default},8),this._drawItemsPools=new
a.RecyclePool(function()
{return{model:null,node:null,ia:null,effect:null,defines:null,uniforms:null}},100),
this._stageItemsPools=new a.RecyclePool(function(){return new
a.RecyclePool(function()
{return{model:null,node:null,ia:null,effect:null,defines:null,technique:null,sortKe
y:-1,uniforms:null}},100)},16)}return s(t,
[{key:"_resetTextuerUnit",value:function(){this._usedTextureUnits=0}},
{key:"_allocTextureUnit",value:function(){var
t=this._device,e=this._usedTextureUnits;return
e>=t._caps.maxTextureUnits&&console.warn("Trying to use "+e+" texture units while
this GPU supports only "+t._caps.maxTextureUnits),this._usedTextureUnits+=1,e}},
{key:"_registerStage",value:function(t,e){this._stage2fn[t]=e}},
{key:"_reset",value:function()
{this._viewPools.reset(),this._stageItemsPools.reset()}},
{key:"_requestView",value:function(){return this._viewPools.add()}},
{key:"_render",value:function(t,e){var
i=this._device;i.setFrameBuffer(t._framebuffer),i.setViewport(t._rect.x,t._rect.y,t
._rect.w,t._rect.h);var
n={};t._clearFlags&o.default.CLEAR_COLOR&&(n.color=[t._color.r,t._color.g,t._color.
b,t._color.a]),t._clearFlags&o.default.CLEAR_DEPTH&&(n.depth=t._depth),t._clearFlag
s&o.default.CLEAR_STENCIL&&(n.stencil=t._stencil),i.clear(n),this._drawItemsPools.r
eset();for(var r=0;r<e._models.length;++r){var s=e._models.data[r];if(0!
=(s._cullingMask&t._cullingMask)){var
a=this._drawItemsPools.add();s.extractDrawItem(a)}}v.reset();for(var
l=0;l<t._stages.length;++l){var
h=t._stages[l],c=this._stageItemsPools.add();c.reset();for(var
u=0;u<this._drawItemsPools.length;++u){var
_=this._drawItemsPools.data[u],f=_.effect.getTechnique(h);if(f){var
d=c.add();d.model=_.model,d.node=_.node,d.ia=_.ia,d.effect=_.effect,d.defines=_.def
ines,d.technique=f,d.sortKey=-1,d.uniforms=_.uniforms}}var
m=v.add();m.stage=h,m.items=c}for(var p=0;p<v.length;++p){var y=v.data[p];
(0,this._stage2fn[y.stage])(t,y.items)}}},{key:"_setProperty",value:function(t){var
e=this._device,i=t.value;if(void 0===i&&(i=t.val),void
0===i&&(i=this._type2defaultValue[t.type]),void 0!
==i)if(t.type===o.default.PARAM_TEXTURE_2D||
t.type===o.default.PARAM_TEXTURE_CUBE)if(void 0!==t.size){if(t.size!
==i.length)return void console.error("The length of texture array ("+i.length+") is
not corrent(expect "+t.size+").");for(var n=E.add(),r=0;r<i.length;+
+r)n[r]=this._allocTextureUnit();e.setTextureArray(t.name,i,n)}else
e.setTexture(t.name,i,this._allocTextureUnit());else{var s=void 0;if(i instanceof
Float32Array||i instanceof Int32Array)return void
e.setUniformDirectly(t.name,i);if(void 0!==t.size){var a=D[t.type];if(void
0===a.func)return void console.error("Uniform array of color3/int3/float3/mat3 can
not be supportted!");if(t.size*a.size>64)return void console.error("Uniform array
is too long!");s=a.func(i)}else{s=(0,M[t.type])(i)}e.setUniform(t.name,s)}else
console.warn("Failed to set technique property "+t.name+", value not found.")}},
{key:"_draw",value:function(t){var
e=this._device,i=this._programLib,n=t.node,r=t.ia,s=t.uniforms,a=t.technique,o=t.de
fines,h=t.effect;y.reset(),g.reset(),x.reset(),b.reset(),A.reset(),C.reset(),S.rese
t(),T.reset(),w.reset(),E.reset(),n.getWorldMatrix(p),e.setUniform("cc_matWorld",l.
mat4.array(A.add(),p));var
c=l.mat3.invert(m,l.mat3.fromMat4(m,p));c&&(l.mat3.transpose(m,c),e.setUniform("cc_
matWorldIT",l.mat3.array(b.add(),m)));for(var _=0;_<s.length;_++){var
f=s[_];for(var d in f)this._setProperty(f[d])}for(var v=0;v<a._passes.length;++v)
{var
M=a._passes[v],D=r.count;r._vertexBuffer&&e.setVertexBuffer(0,r._vertexBuffer),r._i
ndexBuffer&&e.setIndexBuffer(r._indexBuffer),e.setPrimitiveType(r._primitiveType);v
ar
B=i.getProgram(M._programName,o,h._name);e.setProgram(B),e.setCullMode(M._cullMode)
,M._blend&&(e.enableBlend(),e.setBlendFuncSep(M._blendSrc,M._blendDst,M._blendSrcAl
pha,M._blendDstAlpha),e.setBlendEqSep(M._blendEq,M._blendAlphaEq),e.setBlendColor32
(M._blendColor)),M._depthTest&&(e.enableDepthTest(),e.setDepthFunc(M._depthFunc)),M
._depthWrite&&e.enableDepthWrite(),e.setStencilTest(M._stencilTest),M._stencilTest=
==u.default.STENCIL_ENABLE&&(e.setStencilFuncFront(M._stencilFuncFront,M._stencilRe
fFront,M._stencilMaskFront),e.setStencilOpFront(M._stencilFailOpFront,M._stencilZFa
ilOpFront,M._stencilZPassOpFront,M._stencilWriteMaskFront),e.setStencilFuncBack(M._
stencilFuncBack,M._stencilRefBack,M._stencilMaskBack),e.setStencilOpBack(M._stencil
FailOpBack,M._stencilZFailOpBack,M._stencilZPassOpBack,M._stencilWriteMaskBack)),e.
draw(r._start,D),this._resetTextuerUnit()}}}]),t})
();i.default=B,e.exports=i.default}),
{"../../core/vmath":316,"../enums":343,"../gfx":348,"../memop":360,"./program-
lib":340,"./view":342}],337:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=("function"==typeof
Symbol&&Symbol.iterator,l(t("../config"))),s=l(t("../core/pass")),a=l(t("../core/te
chnique")),o=t("../types");function l(t){return t&&t.__esModule?t:
{default:t}}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a
class as a function")}var c=function(t){return o.enums2ctor[t]||
o.enums2ctor.default},u=(function(){function t(e,i){var n=arguments.length>2&&void
0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:
[];h(this,t),this._name=e,this._techniques=i,this._properties=n,this._defines=r,thi
s._dependencies=s}return n(t,[{key:"clear",value:function()
{this._techniques.length=0,this._properties={},this._defines={}}},
{key:"getDefaultTechnique",value:function(){return this._techniques[0]}},
{key:"getTechnique",value:function(t){var e=r.default.stageID(t);if(-1===e)return
null;for(var i=0;i<this._techniques.length;++i){var
n=this._techniques[i];if(n.stageIDs&e)return n}return null}},
{key:"getProperty",value:function(t){return this._properties[t]?
this._properties[t].value:(cc.warn(this._name+" : Failed to get property "+t+",
property not found."),null)}},{key:"setProperty",value:function(t,e)
{this._properties[t]?this._properties[t].value=e:cc.warn(this._name+" : Failed to
set property "+t+", property not found.")}},{key:"getDefine",value:function(t){var
e=this._defines[t];return void 0===e&&cc.warn(this._name+" : Failed to get define
"+t+", define not found."),e}},{key:"define",value:function(t,e){void 0!
==this._defines[t]?this._defines[t]=e:cc.warn(this._name+" : Failed
to set define "+t+", define not found.")}},
{key:"extractProperties",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:{};return Object.assign(t,this._properties),t}},
{key:"extractDefines",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:{};return Object.assign(t,this._defines),t}},
{key:"extractDependencies",value:function(){for(var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:{},e=0;e<this._dependencies.length;++e){var
i=this._dependencies[e];t[i.define]=i.extension}return t}}]),t})(),_=function(t)
{return t.map((function(t){return Object.assign({},t)}))},f=function(t){return
o.ctor2default[c(t)]},d=function(t){var
e=[],i=cc.renderer._forward._programLib;return t.techniques.forEach((function(t)
{t.passes.forEach((function(t)
{e.push(i.getTemplate(t.program))}))})),e},m=(function(){function t(t,e,i)
{return{type:e,displayName:t,instanceType:c(e),value:f(e)(i)}}return function(e,i)
{var n={};i.forEach((function(e){e.uniforms.forEach((function(e)
{e.property&&(n[e.name]=t(e.displayName,e.type,e.value))}))}));var r=function(r)
{var s=e.properties[r],a=void 0;if(void 0!==s.tech&&void 0!==s.pass){var
o=e.techniques[s.tech].passes[s.pass].program;a=i.find((function(t){return
t.name===o})).uniforms.find((function(t){return t.name===r}))}else for(var
l=0;l<i.length&&!(a=i[l].uniforms.find((function(t){return t.name===r})));l++);if(!
a)return cc.warn(e.name+" : illegal property:
"+r),"continue";n[r]=t(s.displayName||a.displayName,s.type||a.type,s.value||
a.value)};for(var s in e.properties)r(s);return n}})();u.parseEffect=function(t)
{for(var e=t.techniques.length,i=new Array(e),n=0;n<e;++n){for(var
r=t.techniques[n],o=r.passes.length,l=new Array(o),h=0;h<o;++h){var
c=r.passes[h];l[h]=new
s.default(c.program),l[h].setDepth(c.depthTest,c.depthWrite,c.depthFunc),l[h].setCu
llMode(c.cullMode),l[h].setBlend(c.blend,c.blendEq,c.blendSrc,c.blendDst,c.blendAlp
haEq,c.blendSrcAlpha,c.blendDstAlpha,c.blendColor),l[h].setStencilFront(c.stencilTe
st,c.stencilFuncFront,c.stencilRefFront,c.stencilMaskFront,c.stencilFailOpFront,c.s
tencilZFailOpFront,c.stencilZPassOpFront,c.stencilWriteMaskFront),l[h].setStencilBa
ck(c.stencilTest,c.stencilFuncBack,c.stencilRefBack,c.stencilMaskBack,c.stencilFail
OpBack,c.stencilZFailOpBack,c.stencilZPassOpBack,c.stencilWriteMaskBack)}i[n]=new
a.default(r.stages,l,r.layer)}var p=d(t),v=m(t,p),y={},g={};p.forEach((function(t)
{t.uniforms.forEach((function(t){var
e=t.name,i=y[e]=Object.assign({},t);i.value=f(t.type)
(t.value),v[e]&&(i.type=v[e].type,i.value=v[e].value)})),t.defines.forEach((functio
n(t){g[t.name]=f(t.type)()}))}));var x=p.reduce((function(t,e){return
t.concat(e.extensions)}),[]);return x=_(x),new
u(t.name,i,y,g,x)},i.default=u,cc.Effect=u,e.exports=i.default}),
{"../config":335,"../core/pass":339,"../core/technique":341,"../types":374}],338:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=void 0;var n=(function(){function t(t,e){for(var i=0;i<e.length;i++)
{var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in
n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../gfx"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=(function(){function t(e,i)
{var n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:r.default.PT_TRIANGLES;s(this,t),this._vertexBuffer=e,this._indexBuffe
r=i,this._primitiveType=n,this._start=0,this._count=-1}return n(t,
[{key:"count",get:function(){return-1!==this._count?this._count:this._indexBuffer?
this._indexBuffer.count:this._vertexBuffer.count}}]),t})
();i.default=a,e.exports=i.default}),{"../gfx":348}],339:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../gfx"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=(function(){function t(e)
{s(this,t),this._programName=e,this._cullMode=r.default.CULL_BACK,this._blend=!
1,this._blendEq=r.default.BLEND_FUNC_ADD,this._blendAlphaEq=r.default.BLEND_FUNC_AD
D,this._blendSrc=r.default.BLEND_SRC_ALPHA,this._blendDst=r.default.BLEND_ONE_MINUS
_SRC_ALPHA,this._blendSrcAlpha=r.default.BLEND_SRC_ALPHA,this._blendDstAlpha=r.defa
ult.BLEND_ONE_MINUS_SRC_ALPHA,this._blendColor=4294967295,this._depthTest=!
1,this._depthWrite=!
1,this._depthFunc=r.default.DS_FUNC_LESS,this._stencilTest=r.default.STENCIL_INHERI
T,this._stencilFuncFront=r.default.DS_FUNC_ALWAYS,this._stencilRefFront=0,this._ste
ncilMaskFront=255,this._stencilFailOpFront=r.default.STENCIL_OP_KEEP,this._stencilZ
FailOpFront=r.default.STENCIL_OP_KEEP,this._stencilZPassOpFront=r.default.STENCIL_O
P_KEEP,this._stencilWriteMaskFront=255,this._stencilFuncBack=r.default.DS_FUNC_ALWA
YS,this._stencilRefBack=0,this._stencilMaskBack=255,this._stencilFailOpBack=r.defau
lt.STENCIL_OP_KEEP,this._stencilZFailOpBack=r.default.STENCIL_OP_KEEP,this._stencil
ZPassOpBack=r.default.STENCIL_OP_KEEP,this._stencilWriteMaskBack=255}return n(t,
[{key:"setCullMode",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:r.default.CULL_BACK;this._cullMode=t}},
{key:"setBlend",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:r.default.BLEND_FUNC_ADD,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:r.default.BLEND_SRC_ALPHA,n=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:r.default.BLEND_ONE_MINUS_SRC_ALPHA,s=arguments.length>4&&void 0!
==arguments[4]?arguments[4]:r.default.BLEND_FUNC_ADD,a=arguments.length>5&&void 0!
==arguments[5]?arguments[5]:r.default.BLEND_SRC_ALPHA,o=arguments.length>6&&void 0!
==arguments[6]?
arguments[6]:r.default.BLEND_ONE_MINUS_SRC_ALPHA,l=arguments.length>7&&void 0!
==arguments[7]?
arguments[7]:4294967295;this._blend=t,this._blendEq=e,this._blendSrc=i,this._blendD
st=n,this._blendAlphaEq=s,this._blendSrcAlpha=a,this._blendDstAlpha=o,this._blendCo
lor=l}},{key:"setDepth",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!
==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:r.default.DS_FUNC_LESS;this._depthTest=t,this._depthWrite=e,this._dept
hFunc=i}},{key:"setStencilFront",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:r.default.STENCIL_INHERIT,e=arguments.length>1&&void 0!
==arguments[1]?arguments[1]:r.default.DS_FUNC_ALWAYS,i=arguments.length>2&&void 0!
==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:255,s=arguments.length>4&&void 0!==arguments[4]?
arguments[4]:r.default.STENCIL_OP_KEEP,a=arguments.length>5&&void 0!==arguments[5]?
arguments[5]:r.default.STENCIL_OP_KEEP,o=arguments.length>6&&void 0!==arguments[6]?
arguments[6]:r.default.STENCIL_OP_KEEP,l=arguments.length>7&&void 0!==arguments[7]?
arguments[7]:255;this._stencilTest=t,this._stencilFuncFront=e,this._stencilRefFront
=i,this._stencilMaskFront=n,this._stencilFailOpFront=s,this._stencilZFailOpFront=a,
this._stencilZPassOpFront=o,this._stencilWriteMaskFront=l}},
{key:"setStencilEnabled",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:r.default.STENCIL_INHERIT;this._stencilTest=t}},
{key:"setStencilBack",value:function(){var t=arguments.length>0&&void 0!
==arguments[0]?arguments[0]:r.default.STENCIL_INHERIT,e=arguments.length>1&&void 0!
==arguments[1]?arguments[1]:r.default.DS_FUNC_ALWAYS,i=arguments.length>2&&void 0!
==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?
arguments[3]:255,s=arguments.length>4&&void 0!==arguments[4]?
arguments[4]:r.default.STENCIL_OP_KEEP,a=arguments.length>5&&void 0!==arguments[5]?
arguments[5]:r.default.STENCIL_OP_KEEP,o=arguments.length>6&&void 0!==arguments[6]?
arguments[6]:r.default.STENCIL_OP_KEEP,l=arguments.length>7&&void 0!==arguments[7]?
arguments[7]:255;this._stencilTest=t,this._stencilFuncBack=e,this._stencilRefBack=i
,this._stencilMaskBack=n,this._stencilFailOpBack=s,this._stencilZFailOpBack=a,this.
_stencilZPassOpBack=o,this._stencilWriteMaskBack=l}}]),t})
();i.default=a,e.exports=i.default}),{"../gfx":348}],340:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../gfx"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=0;function o(t){for(var
e=[],i={},n=t.length-1;n>=0;n--){var r=t[n];for(var s in r)if(void 0===i[s]){var
a=r[s];"number"!=typeof a&&(a=a?1:0),i[s]=a,e.push("#define "+s+" "+a)}}return
e.join("\n")+"\n"}function l(t,e){for(var i={},n=t,r=e.length-1;r>=0;r--){var
s=e[r];for(var a in s)void 0===i[a]&&Number.isInteger(s[a])&&(i[a]=s[a])}for(var o
in i){var l=new RegExp(o,"g");n=n.replace(l,i[o])}return n}function h(t){return
t.replace(/#pragma for (\w+) in range\(\s*(\d+)\s*,\s*(\d+)\s*\)([\s\S]+?)#pragma
endFor/g,(function(t,e,i,n,r){var s="",a=parseInt(i),o=parseInt(n);(a.isNaN||
o.isNaN)&&console.error("Unroll For Loops Error: begin and end of range must be an
int num.");for(var l=a;l<o;++l)s+=r.replace(new RegExp("{"+e+"}","g"),l);return
s}))}var c=(function(){function t(e){var i=arguments.length>1&&void
0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:{};s(this,t),this._device=e,this._templates={};for(var r=0;r<i.length;
+
+r)this.define(i[r]);this._chunks={},Object.assign(this._chunks,n),this._cache={}}r
eturn n(t,[{key:"define",value:function(t){var
e=t.name,i=t.vert,n=t.frag,r=t.defines;t.extensions;if(this._templates[e])console.w
arn("Failed to define shader "+e+": already exists.");else{for(var s=+
+a,o=0,l=0;l<r.length;++l){var h=r[l],c=1;if("number"===h.type){var u=h.range||
[];h.min=u[0]||0,h.max=u[1]||4,c=Math.ceil(Math.log2(h.max-
h.min)),h._map=function(t){return t-this.min<<this._offset}.bind(h)}else
h._map=function(t){return t?
1<<this._offset:0}.bind(h);o+=c,h._offset=o}this._templates[e]={id:s,name:e,vert:i,
frag:n,defines:r,attributes:t.attributes,uniforms:t.uniforms,extensions:t.extension
s}}}},{key:"getTemplate",value:function(t){return this._templates[t]}},
{key:"hasProgram",value:function(t){return void 0!==this._templates[t]}},
{key:"getKey",value:function(t,e){for(var
i=this._templates[t],n=0,r=0;r<i.defines.length;++r){var
s=i.defines[r],a=this._getValueFromDefineList(s.name,e);void 0!==a&&(n|
=s._map(a))}return i.id+":"+n}},{key:"getProgram",value:function(t,e,i){var
n=this.getKey(t,e),s=this._cache[n];if(s)return s;var
a=this._templates[t],c=o(e),u=l(a.vert,e);u=c+h(u);var _=l(a.frag,e);_=c+h(_);var
f=(s=new r.default.Program(this._device,{vert:u,frag:_})).link();if(f){var
d=u.split("\n"),m=_.split("\n"),p=Object.keys(e).length;f.forEach((function(t){var
e=t.line-1,n=t.line-p,r=("vs"===t.type?d:m)[e],s=t.info||"Failed to compile
"+t.type+" "+t.fileID+" (ln "+n+"): \n "+t.message+": \n "+r;cc.error(i+" :
"+s)}))}return this._cache[n]=s,s}},
{key:"_getValueFromDefineList",value:function(t,e){for(var i=void 0,n=e.length-
1;n>=0;n--)if(void 0!==(i=e[n][t]))return i}}]),t})
();i.default=c,e.exports=i.default}),{"../gfx":348}],341:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../config"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=0,o=(function(){function
t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:0;s(this,t),this._id=a+
+,this._stageIDs=r.default.stageIDs(e),this._passes=i,this._layer=n}return n(t,
[{key:"setStages",value:function(t){this._stageIDs=r.default.stageIDs(t)}},
{key:"passes",get:function(){return this._passes}},{key:"stageIDs",get:function()
{return this._stageIDs}}]),t})();i.default=o,e.exports=i.default}),
{"../config":335}],342:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("../../core/vmath"),s=(function(t){return
t&&t.__esModule?t:{default:t}})(t("../enums"));function a(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var
o=r.mat4.create(),l=0,h=(function(){function t(){a(this,t),this._id=l+
+,this._priority=0,this._rect={x:0,y:0,w:1,h:1},this._color=r.color4.create(.3,.3,.
3,1),this._depth=1,this._stencil=0,this._clearFlags=s.default.CLEAR_COLOR|
s.default.CLEAR_DEPTH,this._clearModel=null,this._matView=r.mat4.create(),this._mat
Proj=r.mat4.create(),this._matViewProj=r.mat4.create(),this._matInvViewProj=r.mat4.
create(),this._stages=[],this._cullingByID=!
1,this._framebuffer=null,this._shadowLight=null,this._cullingMask=4294967295}return
n(t,[{key:"getForward",value:function(t){return r.vec3.set(t,-this._matView.m02,-
this._matView.m06,-this._matView.m10)}},{key:"getPosition",value:function(t){return
r.mat4.invert(o,this._matView),r.mat4.getTranslation(t,o)}}]),t})
();i.default=h,e.exports=i.default}),{"../../core/vmath":316,"../enums":343}],343:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default={PROJ_PERSPECTIVE:0,PROJ_ORTHO:1,LIGHT_DIRECTIONAL:0,LIGHT_POINT:1,LI
GHT_SPOT:2,SHADOW_NONE:0,SHADOW_HARD:1,SHADOW_SOFT:2,PARAM_INT:0,PARAM_INT2:1,PARAM
_INT3:2,PARAM_INT4:3,PARAM_FLOAT:4,PARAM_FLOAT2:5,PARAM_FLOAT3:6,PARAM_FLOAT4:7,PAR
AM_COLOR3:8,PARAM_COLOR4:9,PARAM_MAT2:10,PARAM_MAT3:11,PARAM_MAT4:12,PARAM_TEXTURE_
2D:13,PARAM_TEXTURE_CUBE:14,CLEAR_COLOR:1,CLEAR_DEPTH:2,CLEAR_STENCIL:4,CLEAR_SKYBO
X:8,BUFFER_VIEW_INT8:0,BUFFER_VIEW_UINT8:1,BUFFER_VIEW_INT16:2,BUFFER_VIEW_UINT16:3
,BUFFER_VIEW_INT32:4,BUFFER_VIEW_UINT32:5,BUFFER_VIEW_FLOAT32:6},e.exports=i.defaul
t}),{}],344:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0}),i.default=void 0;var n,r,s=(function(){function t(t,e){for(var
i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!
0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return
function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}})
(),a=c(t("./state")),o=t("./enums"),l=c(t("./texture-2d")),h=c(t("./texture-
cube"));function c(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}function
_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!
0,configurable:!0,writable:!0}):t[e]=i,t}var f=(_(n={},5124,(function(t,e,i)
{t.uniform1i(e,i)})),_(n,5126,(function(t,e,i){t.uniform1f(e,i)})),_(n,35664,
(function(t,e,i){t.uniform2fv(e,i)})),_(n,35665,(function(t,e,i)
{t.uniform3fv(e,i)})),_(n,35666,(function(t,e,i){t.uniform4fv(e,i)})),_(n,35667,
(function(t,e,i){t.uniform2iv(e,i)})),_(n,35668,(function(t,e,i)
{t.uniform3iv(e,i)})),_(n,35669,(function(t,e,i){t.uniform4iv(e,i)})),_(n,35670,
(function(t,e,i){t.uniform1i(e,i)})),_(n,35671,(function(t,e,i)
{t.uniform2iv(e,i)})),_(n,35672,(function(t,e,i){t.uniform3iv(e,i)})),_(n,35673,
(function(t,e,i){t.uniform4iv(e,i)})),_(n,35674,(function(t,e,i)
{t.uniformMatrix2fv(e,!1,i)})),_(n,35675,(function(t,e,i){t.uniformMatrix3fv(e,!
1,i)})),_(n,35676,(function(t,e,i){t.uniformMatrix4fv(e,!1,i)})),_(n,35678,
(function(t,e,i){t.uniform1i(e,i)})),_(n,35680,(function(t,e,i)
{t.uniform1i(e,i)})),n),d=(_(r={},5124,(function(t,e,i)
{t.uniform1iv(e,i)})),_(r,5126,(function(t,e,i){t.uniform1fv(e,i)})),_(r,35664,
(function(t,e,i){t.uniform2fv(e,i)})),_(r,35665,(function(t,e,i)
{t.uniform3fv(e,i)})),_(r,35666,(function(t,e,i){t.uniform4fv(e,i)})),_(r,35667,
(function(t,e,i){t.uniform2iv(e,i)})),_(r,35668,(function(t,e,i)
{t.uniform3iv(e,i)})),_(r,35669,(function(t,e,i){t.uniform4iv(e,i)})),_(r,35670,
(function(t,e,i){t.uniform1iv(e,i)})),_(r,35671,(function(t,e,i)
{t.uniform2iv(e,i)})),_(r,35672,(function(t,e,i){t.uniform3iv(e,i)})),_(r,35673,
(function(t,e,i){t.uniform4iv(e,i)})),_(r,35674,(function(t,e,i)
{t.uniformMatrix2fv(e,!1,i)})),_(r,35675,(function(t,e,i){t.uniformMatrix3fv(e,!
1,i)})),_(r,35676,(function(t,e,i){t.uniformMatrix4fv(e,!1,i)})),_(r,35678,
(function(t,e,i){t.uniform1iv(e,i)})),_(r,35680,(function(t,e,i)
{t.uniform1iv(e,i)})),r);function m(t,e,i){if(e.blend!==i.blend)return i.blend?
(t.enable(t.BLEND),i.blendSrc!==o.enums.BLEND_CONSTANT_COLOR&&i.blendSrc!
==o.enums.BLEND_ONE_MINUS_CONSTANT_COLOR&&i.blendDst!
==o.enums.BLEND_CONSTANT_COLOR&&i.blendDst!
==o.enums.BLEND_ONE_MINUS_CONSTANT_COLOR||t.blendColor((i.blendColor>>24)/255,
(i.blendColor>>16&255)/255,(i.blendColor>>8&255)/255,
(255&i.blendColor)/255),void(i.blendSep?
(t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),t.blend
EquationSeparate(i.blendEq,i.blendAlphaEq)):
(t.blendFunc(i.blendSrc,i.blendDst),t.blendEquation(i.blendEq)))):void
t.disable(t.BLEND);!1!==i.blend&&(e.blendColor!
==i.blendColor&&t.blendColor((i.blendColor>>24)/255,(i.blendColor>>16&255)/255,
(i.blendColor>>8&255)/255,(255&i.blendColor)/255),e.blendSep===i.blendSep?
i.blendSep?
(e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst&&e.blendSrcAlpha===i.blendSrcAlph
a&&e.blendDstAlpha===i.blendDstAlpha||
t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),e.blendE
q===i.blendEq&&e.blendAlphaEq===i.blendAlphaEq||
t.blendEquationSeparate(i.blendEq,i.blendAlphaEq)):
(e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst||
t.blendFunc(i.blendSrc,i.blendDst),e.blendEq!
==i.blendEq&&t.blendEquation(i.blendEq)):i.blendSep?
(t.blendFuncSeparate(i.blendSrc,i.blendDst,i.blendSrcAlpha,i.blendDstAlpha),t.blend
EquationSeparate(i.blendEq,i.blendAlphaEq)):
(t.blendFunc(i.blendSrc,i.blendDst),t.blendEquation(i.blendEq)))}function p(t,e,i)
{if(e.depthTest!==i.depthTest)return i.depthTest?
(t.enable(t.DEPTH_TEST),t.depthFunc(i.depthFunc),void
t.depthMask(i.depthWrite)):void t.disable(t.DEPTH_TEST);e.depthWrite!
==i.depthWrite&&t.depthMask(i.depthWrite),!1!==i.depthTest?e.depthFunc!
==i.depthFunc&&t.depthFunc(i.depthFunc):i.depthWrite&&(i.depthTest=!
0,i.depthFunc=o.enums.DS_FUNC_ALWAYS,t.enable(t.DEPTH_TEST),t.depthFunc(i.depthFunc
))}function v(t,e,i){if(i.stencilTest!==o.enums.STENCIL_INHERIT)return
i.stencilTest!==e.stencilTest?i.stencilTest===o.enums.STENCIL_DISABLE?void
t.disable(t.STENCIL_TEST):(t.enable(t.STENCIL_TEST),void(i.stencilSep?
(t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFr
ont),t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),t.stencilOpSeparate(t.F
RONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront),t.stencilFun
cSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),t.stencilMas
kSeparate(t.BACK,i.stencilWriteMaskBack),t.stencilOpSeparate(t.BACK,i.stencilFailOp
Back,i.stencilZFailOpBack,i.stencilZPassOpBack)):
(t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMa
sk(i.stencilWriteMaskFront),t.stencilOp(i.stencilFailOpFront,i.stencilZF
ailOpFront,i.stencilZPassOpFront)))):void(i.stencilTest!
==o.enums.STENCIL_DISABLE&&(e.stencilSep===i.stencilSep?i.stencilSep?
(e.stencilFuncFront===i.stencilFuncFront&&e.stencilRefFront===i.stencilRefFront&&e.
stencilMaskFront===i.stencilMaskFront||
t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFro
nt),e.stencilWriteMaskFront!
==i.stencilWriteMaskFront&&t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),e
.stencilFailOpFront===i.stencilFailOpFront&&e.stencilZFailOpFront===i.stencilZFailO
pFront&&e.stencilZPassOpFront===i.stencilZPassOpFront||
t.stencilOpSeparate(t.FRONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPa
ssOpFront),e.stencilFuncBack===i.stencilFuncBack&&e.stencilRefBack===i.stencilRefBa
ck&&e.stencilMaskBack===i.stencilMaskBack||
t.stencilFuncSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),
e.stencilWriteMaskBack!
==i.stencilWriteMaskBack&&t.stencilMaskSeparate(t.BACK,i.stencilWriteMaskBack),e.st
encilFailOpBack===i.stencilFailOpBack&&e.stencilZFailOpBack===i.stencilZFailOpBack&
&e.stencilZPassOpBack===i.stencilZPassOpBack||
t.stencilOpSeparate(t.BACK,i.stencilFailOpBack,i.stencilZFailOpBack,i.stencilZPassO
pBack)):
(e.stencilFuncFront===i.stencilFuncFront&&e.stencilRefFront===i.stencilRefFront&&e.
stencilMaskFront===i.stencilMaskFront||
t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),e.stencilWri
teMaskFront!
==i.stencilWriteMaskFront&&t.stencilMask(i.stencilWriteMaskFront),e.stencilFailOpFr
ont===i.stencilFailOpFront&&e.stencilZFailOpFront===i.stencilZFailOpFront&&e.stenci
lZPassOpFront===i.stencilZPassOpFront||
t.stencilOp(i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront)):i.st
encilSep?
(t.stencilFuncSeparate(t.FRONT,i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFr
ont),t.stencilMaskSeparate(t.FRONT,i.stencilWriteMaskFront),t.stencilOpSeparate(t.F
RONT,i.stencilFailOpFront,i.stencilZFailOpFront,i.stencilZPassOpFront),t.stencilFun
cSeparate(t.BACK,i.stencilFuncBack,i.stencilRefBack,i.stencilMaskBack),t.stencilMas
kSeparate(t.BACK,i.stencilWriteMaskBack),t.stencilOpSeparate(t.BACK,i.stencilFailOp
Back,i.stencilZFailOpBack,i.stencilZPassOpBack)):
(t.stencilFunc(i.stencilFuncFront,i.stencilRefFront,i.stencilMaskFront),t.stencilMa
sk(i.stencilWriteMaskFront),t.stencilOp(i.stencilFailOpFront,i.stencilZFailOpFront,
i.stencilZPassOpFront))))}function y(t,e,i){e.cullMode!==i.cullMode&&(i.cullMode!
==o.enums.CULL_NONE?
(t.enable(t.CULL_FACE),t.cullFace(i.cullMode)):t.disable(t.CULL_FACE))}function
g(t,e,i,n){var r=!1;if(-1!==n.maxStream){if(i.maxStream!==n.maxStream)r=!0;else
if(i.program!==n.program)r=!0;else for(var s=0;s<n.maxStream+1;+
+s)if(i.vertexBuffers[s]!==n.vertexBuffers[s]||i.vertexBufferOffsets[s]!
==n.vertexBufferOffsets[s]){r=!0;break}if(r){for(var
a=0;a<t._caps.maxVertexAttribs;++a)t._newAttributes[a]=0;for(var
o=0;o<n.maxStream+1;++o){var
l=n.vertexBuffers[o],h=n.vertexBufferOffsets[o];if(l&&-1!==l._glID)
{e.bindBuffer(e.ARRAY_BUFFER,l._glID);for(var c=0;c<n.program._attributes.length;+
+c){var u=n.program._attributes[c],_=l._format.element(u.name);_?
(0===t._enabledAttributes[u.location]&&(e.enableVertexAttribArray(u.location),t._en
abledAttributes[u.location]=1),t._newAttributes[u.location]=1,e.vertexAttribPointer
(u.location,_.num,_.type,_.normalize,_.stride,_.offset+h*_.stride)):console.warn("C
an not find vertex attribute: "+u.name)}}}for(var f=0;f<t._caps.maxVertexAttribs;+
+f)t._enabledAttributes[f]!
==t._newAttributes[f]&&(e.disableVertexAttribArray(f),t._enabledAttributes[f]=0)}}}
function x(t,e,i){for(var n=0;n<i.maxTextureSlot+1;++n)if(e.textureUnits[n]!
==i.textureUnits[n]){var r=i.textureUnits[n];r&&-1!
==r._glID&&(t.activeTexture(t.TEXTURE0+n),t.bindTexture(r._target,r._glID))}}functi
on b(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i
instanceof l.default?
t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_2D,i._glID,0):i instanceof
h.default?
t.framebufferTexture2D(t.FRAMEBUFFER,e,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i._glID,0):t
.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,i._glID)}var A=(function()
{function t(e,i){u(this,t);var n=void 0;void 0===(i=i||{}).alpha&&(i.alpha=!1),void
0===i.stencil&&(i.stencil=!0),void 0===i.depth&&(i.depth=!0),void
0===i.antialias&&(i.antialias=!1),void
0===i.preserveDrawingBuffer&&(i.preserveDrawingBuffer=!
1);try{n=e.getContext("webgl",i)}catch(t){return void console.error(t)}n||
console.error("This device does not support
webgl"),this._gl=n,this._extensions={},this._caps={},this._stats={texture:0,vb:0,ib
:0,drawcalls:0},this._initExtensions(["EXT_texture_filter_anisotropic","EXT_shader_
texture_lod","OES_standard_derivatives","OES_texture_float","OES_texture_float_line
ar","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_obje
ct","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc","WEBGL_compressed
_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WE
BGL_depth_texture","WEBGL_draw_buffers"]),this._initCaps(),this._initStates(),a.def
ault.initDefault(this),this._current=new a.default(this),this._next=new
a.default(this),this._uniforms={},this._vx=this._vy=this._vw=this._vh=0,this._sx=th
is._sy=this._sw=this._sh=0,this._framebuffer=null,this._enabledAttributes=new
Array(this._caps.maxVertexAttribs),this._newAttributes=new
Array(this._caps.maxVertexAttribs);for(var r=0;r<this._caps.maxVertexAttribs;+
+r)this._enabledAttributes[r]=0,this._newAttributes[r]=0}return s(t,
[{key:"_initExtensions",value:function(t){for(var e=this._gl,i=0;i<t.length;+
+i)for(var n=t[i],r=["","WEBKIT_","MOZ_"],s=0;s<r.length;s++)try{var
a=e.getExtension(r[s]+n);if(a){this._extensions[n]=a;break}}catch(t)
{console.error(t)}}},{key:"_initCaps",value:function(){var
t=this._gl,e=this.ext("WEBGL_draw_buffers");this._caps.maxVertexStreams=4,this._cap
s.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._caps.max
FragUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this._caps.maxTextureUn
its=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this._caps.maxVertexAttribs=t.getPara
meter(t.MAX_VERTEX_ATTRIBS),this._caps.maxDrawBuffers=e?
t.getParameter(e.MAX_DRAW_BUFFERS_WEBGL):1,this._caps.maxColorAttachments=e?
t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL):1}},
{key:"_initStates",value:function(){var
t=this._gl;t.disable(t.BLEND),t.blendFunc(t.ONE,t.ZERO),t.blendEquation(t.FUNC_ADD)
,t.blendColor(1,1,1,1),t.colorMask(!0,!0,!0,!
0),t.enable(t.CULL_FACE),t.cullFace(t.BACK),t.disable(t.DEPTH_TEST),t.depthFunc(t.L
ESS),t.depthMask(!
1),t.disable(t.POLYGON_OFFSET_FILL),t.depthRange(0,1),t.disable(t.STENCIL_TEST),t.s
tencilFunc(t.ALWAYS,0,255),t.stencilMask(255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.c
learDepth(1),t.clearColor(0,0,0,0),t.clearStencil(0),t.disable(t.SCISSOR_TEST)}},
{key:"_restoreTexture",value:function(t){var
e=this._gl,i=this._current.textureUnits[t];i&&-1!==i._glID?
e.bindTexture(i._target,i._glID):e.bindTexture(e.TEXTURE_2D,null)}},
{key:"_restoreIndexBuffer",value:function(){var
t=this._gl,e=this._current.indexBuffer;e&&-1!==e._glID?
t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e._glID):t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,nu
ll)}},{key:"ext",value:function(t){return this._extensions[t]}},
{key:"allowFloatTexture",value:function(){return null!
=this.ext("OES_texture_float")}},{key:"setFrameBuffer",value:function(t)
{if(this._framebuffer!==t){this._framebuffer=t;var e=this._gl;if(null!==t)
{e.bindFramebuffer(e.FRAMEBUFFER,t._glID);for(var i=t._colors.length,n=0;n<i;++n)
{var r=t._colors[n];b(e,e.COLOR_ATTACHMENT0+n,r)}for(var
s=i;s<this._caps.maxColorAttachments;+
+s)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,e.TEXTURE_2D,null,0);
t._depth&&b(e,e.DEPTH_ATTACHMENT,t._depth),t._stencil&&b(e,e.STENCIL_ATTACHMENT,t._
stencil),t._depthStencil&&b(e,e.DEPTH_STENCIL_ATTACHMENT,t._depthStencil)}else
e.bindFramebuffer(e.FRAMEBUFFER,null)}}},{key:"setViewport",value:function(t,e,i,n)
{this._vx===t&&this._vy===e&&this._vw===i&&this._vh===n||
(this._gl.viewport(t,e,i,n),this._vx=t,this._vy=e,this._vw=i,this._vh=n)}},
{key:"setScissor",value:function(t,e,i,n)
{this._sx===t&&this._sy===e&&this._sw===i&&this._sh===n||
(this._gl.scissor(t,e,i,n),this._sx=t,this._sy=e,this._sw=i,this._sh=n)}},
{key:"clear",value:function(t){if(void 0!==t.color||void 0!==t.depth||void 0!
==t.stencil){var e=this._gl,i=0;void 0!==t.color&&(i|
=e.COLOR_BUFFER_BIT,e.clearColor(t.color[0],t.color[1],t.color[2],t.color[3])),void
0!==t.depth&&(i|
=e.DEPTH_BUFFER_BIT,e.clearDepth(t.depth),e.enable(e.DEPTH_TEST),e.depthMask(!
0),e.depthFunc(e.ALWAYS)),void 0!==t.stencil&&(i|
=e.STENCIL_BUFFER_BIT,e.clearStencil(t.stencil)),e.clear(i),void 0!==t.depth&&(!
1===this._current.depthTest?e.disable(e.DEPTH_TEST):(!
1===this._current.depthWrite&&e.depthMask(!1),this._current.depthFunc!
==o.enums.DS_FUNC_ALWAYS&&e.depthFunc(this._current.depthFunc)))}}},
{key:"enableBlend",value:function(){this._next.blend=!0}},
{key:"enableDepthTest",value:function(){this._next.depthTest=!0}},
{key:"enableDepthWrite",value:function(){this._next.depthWrite=!0}},
{key:"setStencilTest",value:function(t){this._next.stencilTest=t}},
{key:"setStencilFunc",value:function(t,e,i){this._next.stencilSep=!
1,this._next.stencilFuncFront=this._next.stencilFuncBack=t,this._next.stencilRefFro
nt=this._next.stencilRefBack=e,this._next.stencilMaskFront=this._next.stencilMaskBa
ck=i}},{key:"setStencilFuncFront",value:function(t,e,i){this._next.stencilSep=!
0,this._next.stencilFuncFront=t,this._next.stencilRefFront=e,this._next.stencilMask
Front=i}},{key:"setStencilFuncBack",value:function(t,e,i){this._next.stencilSep=!
0,this._next.stencilFuncBack=t,this._next.stencilRefBack=e,this._next.stencilMaskBa
ck=i}},{key:"setStencilOp",value:function(t,e,i,n)
{this._next.stencilFailOpFront=this._next.stencilFailOpBack=t,this._next.stencilZFa
ilOpFront=this._next.stencilZFailOpBack=e,this._next.stencilZPassOpFront=this._next
.stencilZPassOpBack=i,this._next.stencilWriteMaskFront=this._next.stencilWriteMaskB
ack=n}},{key:"setStencilOpFront",value:f
unction(t,e,i,n){this._next.stencilSep=!
0,this._next.stencilFailOpFront=t,this._next.stencilZFailOpFront=e,this._next.stenc
ilZPassOpFront=i,this._next.stencilWriteMaskFront=n}},
{key:"setStencilOpBack",value:function(t,e,i,n){this._next.stencilSep=!
0,this._next.stencilFailOpBack=t,this._next.stencilZFailOpBack=e,this._next.stencil
ZPassOpBack=i,this._next.stencilWriteMaskBack=n}},
{key:"setDepthFunc",value:function(t){this._next.depthFunc=t}},
{key:"setBlendColor32",value:function(t){this._next.blendColor=t}},
{key:"setBlendColor",value:function(t,e,i,n){this._next.blendColor=(255*t<<24|
255*e<<16|255*i<<8|255*n)>>>0}},{key:"setBlendFunc",value:function(t,e)
{this._next.blendSep=!1,this._next.blendSrc=t,this._next.blendDst=e}},
{key:"setBlendFuncSep",value:function(t,e,i,n){this._next.blendSep=!
0,this._next.blendSrc=t,this._next.blendDst=e,this._next.blendSrcAlpha=i,this._next
.blendDstAlpha=n}},{key:"setBlendEq",value:function(t){this._next.blendSep=!
1,this._next.blendEq=t}},{key:"setBlendEqSep",value:function(t,e)
{this._next.blendSep=!0,this._next.blendEq=t,this._next.blendAlphaEq=e}},
{key:"setCullMode",value:function(t){this._next.cullMode=t}},
{key:"setVertexBuffer",value:function(t,e){var i=arguments.length>2&&void 0!
==arguments[2]?
arguments[2]:0;this._next.vertexBuffers[t]=e,this._next.vertexBufferOffsets[t]=i,th
is._next.maxStream<t&&(this._next.maxStream=t)}},
{key:"setIndexBuffer",value:function(t){this._next.indexBuffer=t}},
{key:"setProgram",value:function(t){this._next.program=t}},
{key:"setTexture",value:function(t,e,i){i>=this._caps.maxTextureUnits?
console.warn("Can not set texture "+t+" at stage "+i+", max texture exceed:
"+this._caps.maxTextureUnits):
(this._next.textureUnits[i]=e,this.setUniform(t,i),this._next.maxTextureSlot<i&&(th
is._next.maxTextureSlot=i))}},{key:"setTextureArray",value:function(t,e,i){var
n=e.length;if(n>=this._caps.maxTextureUnits)console.warn("Can not set "+n+"
textures for "+t+", max texture exceed: "+this._caps.maxTextureUnits);else{for(var
r=0;r<n;++r){var s=i[r];this._next.textureUnits[s]=e[r]}this.setUniform(t,i)}}},
{key:"setUniform",value:function(t,e){var i=this._uniforms[t],n=!1,r=!1,s=!1,a=!
1;do{if(!i)break;if(s=Array.isArray(e)||e instanceof Float32Array,a=e instanceof
Int32Array,r=s||a,i.isArray!==r)break;if(i.isArray&&i.value.length!
==e.length)break;n=!0}while(0);if(n){var o=i.value,l=!1;if(i.isArray)for(var
h=0,c=o.length;h<c;h++)o[h]!==e[h]&&(l=!0,o[h]=e[h]);else o!==e&&(l=!
0,i.value=e);l&&(i.dirty=!0)}else{var u=e;s?u=new Float32Array(e):a&&(u=new
Int32Array(e)),i={dirty:!0,value:u,isArray:r}}this._uniforms[t]=i}},
{key:"setUniformDirectly",value:function(t,e){var i=this._uniforms[t];i||
(this._uniforms[t]=i={}),i.dirty=!0,i.value=e}},
{key:"setPrimitiveType",value:function(t){this._next.primitiveType=t}},
{key:"draw",value:function(t,e){var
i=this._gl,n=this._current,r=this._next;m(i,n,r),p(i,n,r),v(i,n,r),y(i,n,r),g(this,
i,n,r),n.indexBuffer!
==r.indexBuffer&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.indexBuffer&&-1!
==r.indexBuffer._glID?r.indexBuffer._glID:null);var s=!1;n.program!
==r.program&&(r.program._linked?i.useProgram(r.program._glID):console.warn("Failed
to use program: has not linked yet."),s=!0),x(i,n,r);for(var
a=0;a<r.program._uniforms.length;++a){var
o=r.program._uniforms[a],l=this._uniforms[o.name];if(l&&(s||l.dirty)){l.dirty=!
1;var h=void 0===o.size?f[o.type]:d[o.type];h?
h(i,o.location,l.value):console.warn("Can not find commit function for uniform
"+o.name)}}e&&(r.indexBuffer?
i.drawElements(this._next.primitiveType,e,r.indexBuffer._format,t*r.indexBuffer._by
tesPerIndex):i.drawArrays(this._next.primitiveType,t,e)),this._stats.drawcalls+=1,n
.set(r),r.reset()}}]),t})();i.default=A,e.exports=i.default}),
{"./enums":345,"./state":352,"./texture-2d":353,"./texture-cube":354}],345:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.attrTypeBytes=function(t){if(t===s.ATTR_TYPE_INT8)return
1;if(t===s.ATTR_TYPE_UINT8)return 1;if(t===s.ATTR_TYPE_INT16)return
2;if(t===s.ATTR_TYPE_UINT16)return 2;if(t===s.ATTR_TYPE_INT32)return
4;if(t===s.ATTR_TYPE_UINT32)return 4;if(t===s.ATTR_TYPE_FLOAT32)return 4;return
console.warn("Unknown ATTR_TYPE: "+t),0},i.glFilter=function(t,e){var
i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=n[e][i+1];if(void
0===r)return console.warn("Unknown FILTER: "+e),-1===i?
t.LINEAR:t.LINEAR_MIPMAP_LINEAR;return r},i.glTextureFmt=function(t){var
e=r[t];if(void 0===e)return console.warn("Unknown TEXTURE_FMT:
"+t),r[s.TEXTURE_FMT_RGBA8];return e};var n=[[9728,9984,9986],
[9729,9985,9987]],r=[{format:6407,internalFormat:33776,pixelType:null},
{format:6408,internalFormat:33777,pixelType:null},
{format:6408,internalFormat:33778,pixelType:null},
{format:6408,internalFormat:33779,pixelType:null},
{format:6407,internalFormat:36196,pixelType:null},
{format:6407,internalFormat:35841,pixelType:null},
{format:6408,internalFormat:35843,pixelType:null},
{format:6407,internalFormat:35840,pixelType:null},
{format:6408,internalFormat:35842,pixelType:null},
{format:6406,internalFormat:6406,pixelType:5121},
{format:6409,internalFormat:6409,pixelType:5121},
{format:6410,internalFormat:6410,pixelType:5121},
{format:6407,internalFormat:6407,pixelType:33635},
{format:6408,internalFormat:6408,pixelType:32820},
{format:6408,internalFormat:6408,pixelType:32819},
{format:6407,internalFormat:6407,pixelType:5121},
{format:6408,internalFormat:6408,pixelType:5121},
{format:6407,internalFormat:6407,pixelType:36193},
{format:6408,internalFormat:6408,pixelType:36193},
{format:6407,internalFormat:6407,pixelType:5126},
{format:6408,internalFormat:6408,pixelType:5126},
{format:null,internalFormat:null,pixelType:null},
{format:null,internalFormat:null,pixelType:null},
{format:null,internalFormat:null,pixelType:null},
{format:null,internalFormat:null,pixelType:null},
{format:6402,internalFormat:6402,pixelType:5123},
{format:6402,internalFormat:6402,pixelType:5125},
{format:6402,internalFormat:6402,pixelType:5125},
{format:6407,internalFormat:37492,pixelType:null},
{format:6408,internalFormat:37496,pixelType:null}],s=i.enums={USAGE_STATIC:35044,US
AGE_DYNAMIC:35048,USAGE_STREAM:35040,INDEX_FMT_UINT8:5121,INDEX_FMT_UINT16:5123,IND
EX_FMT_UINT32:5125,ATTR_POSITION:"a_position",ATTR_NORMAL:"a_normal",ATTR_TANGENT:"
a_tangent",ATTR_BITANGENT:"a_bitangent",ATTR_WEIGHTS:"a_weights",ATTR_JOINTS:"a_joi
nts",ATTR_COLOR:"a_color",ATTR_COLOR0:"a_color0",ATTR_COLOR1:"a_color1",ATTR_UV:"a_
uv",ATTR_UV0:"a_uv0",ATTR_UV1:"a_uv1",ATTR_UV2:"a_uv2",ATTR_UV3:"a_uv3",ATTR_UV4:"a
_uv4",ATTR_UV5:"a_uv5",ATTR_UV6:"a_uv6",ATTR_UV7:"a_uv7",ATTR_TYPE_INT8:5120,ATTR_T
YPE_UINT8:5121,ATTR_TYPE_INT16:5122,ATTR_TYPE_UINT16:5123,ATTR_TYPE_INT32:5124,ATTR
_TYPE_UINT32:5125,ATTR_TYPE_FLOAT32:5126,FILTER_NEAREST:0,FILTER_LINEAR:1,WRAP_REPE
AT:10497,WRAP_CLAMP:33071,WRAP_MIRROR:33648,TEXTURE_FMT_RGB_DXT1:0,TEXTURE_FMT_RGBA
_DXT1:1,TEXTURE_FMT_RGBA_DXT3:2,TEXTURE_FMT_RGBA_DXT5:3,TEXTURE_FMT_RGB_ETC1:4,TEXT
URE_FMT_RGB_PVRTC_2BPPV1:5,TEXTURE_FMT_RGBA_PVRTC_2BPPV1:6,TEXTURE_FMT_RGB_PVRTC_4B
PPV1:7,TEXTURE_FMT_RGBA_PVRTC_4BPPV1:8,TEXTURE_FMT_A8:9,TEXTURE_FMT_L8:10,TEXTURE_F
MT_L8_A8:11,TEXTURE_FMT_R5_G6_B5:12,TEXTURE_FMT_R5_G5_B5_A1:13,TEXTURE_FMT_R4_G4_B4
_A4:14,TEXTURE_FMT_RGB8:15,TEXTURE_FMT_RGBA8:16,TEXTURE_FMT_RGB16F:17,TEXTURE_FMT_R
GBA16F:18,TEXTURE_FMT_RGB32F:19,TEXTURE_FMT_RGBA32F:20,TEXTURE_FMT_R32F:21,TEXTURE_
FMT_111110F:22,TEXTURE_FMT_SRGB:23,TEXTURE_FMT_SRGBA:24,TEXTURE_FMT_D16:25,TEXTURE_
FMT_D32:26,TEXTURE_FMT_D24S8:27,TEXTURE_FMT_RGB_ETC2:28,TEXTURE_FMT_RGBA_ETC2:29,DS
_FUNC_NEVER:512,DS_FUNC_LESS:513,DS_FUNC_EQUAL:514,DS_FUNC_LEQUAL:515,DS_FUNC_GREAT
ER:516,DS_FUNC_NOTEQUAL:517,DS_FUNC_GEQUAL:518,DS_FUNC_ALWAYS:519,RB_FMT_RGBA4:3285
4,RB_FMT_RGB5_A1:32855,RB_FMT_RGB565:36194,RB_FMT_D16:33189,RB_FMT_S8:36168,RB_FMT_
D24S8:34041,BLEND_FUNC_ADD:32774,BLEND_FUNC_SUBTRACT:32778,BLEND_FUNC_REVERSE_SUBTR
ACT:32779,BLEND_ZERO:0,BLEND_ONE:1,BLEND_SRC_COLOR:768,BLEND_ONE_MINUS_SRC_COLOR:76
9,BLEND_DST_COLOR:774,BLEND_ONE_MINUS_DST_COLOR:775,BLEND_SRC_ALPHA:770,BLEND_ONE_M
INUS_SRC_ALPHA:771,BLEND_DST_ALPHA:772,BLEND_ONE_MINUS_DST_ALPHA:773,BLEND_CONSTANT
_COLOR:32769,BLEND_ONE_MINUS_CONSTANT_COLOR:32770,BLEND_CONSTANT_ALPHA:32771,BLEND_
ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_SRC_ALPHA_SATURATE:776,STENCIL_DISABLE:0,STENC
IL_ENABLE:1,STENCIL_INHERIT:2,STENCIL_OP_KEEP:7680,STENCIL_OP_ZERO:0,STENCIL_OP_REP
LACE:7681,STENCIL_OP_INCR:7682,STENCIL_OP_INCR_WRAP:34055,STENCIL_OP_DECR:7683,STEN
CIL_OP_DECR_WRAP:34056,STENCIL_OP_INVERT:5386,CULL_NONE:0,CULL_FRONT:1028,CULL_BACK
:1029,CULL_FRONT_AND_BACK:1032,PT_POINTS:0,PT_LINES:1,PT_LINE_LOOP:2,PT_LINE_STRIP:
3,PT_TRIANGLES:4,PT_TRIANGLE_STRIP:5,PT_TRIANGLE_FAN:6}}),{}],346:[(function(t,e,i)
{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function()
{function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var s=(function(){function
t(e,i,n,s)
{r(this,t),this._device=e,this._width=i,this._height=n,this._colors=s.colors||
[],this._depth=s.depth||null,this._stencil=s.stencil||
null,this._depthStencil=s.depthStencil||
null,this._glID=e._gl.createFramebuffer()}return n(t,
[{key:"destroy",value:function(){null!==this._glID?
(this._device._gl.deleteFramebuffer(this._glID),this._glID=null):console.error("The
frame-buffer already destroyed")}}]),t})();i.default=s,e.exports=i.default}),
{}],347:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0});var n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./enums");function
s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a
function")}var a=(function(){function t(e,i,n,a,o)
{s(this,t),this._device=e,this._format=i,this._usage=n,this._numIndices=o,this._byt
esPerIndex=0,i===r.enums.INDEX_FMT_UINT8?
this._bytesPerIndex=1:i===r.enums.INDEX_FMT_UINT16?
this._bytesPerIndex=2:i===r.enums.INDEX_FMT_UINT32&&(this._bytesPerIndex=4),this._b
ytes=this._bytesPerIndex*o,this._glID=e._gl.createBuffer(),this.update(0,a),e._stat
s.ib+=this._bytes}return n(t,[{key:"destroy",value:function(){-1!==this._glID?
(this._device._gl.deleteBuffer(this._glID),this._device._stats.ib-
=this.bytes,this._glID=-1):console.error("The buffer already destroyed")}},
{key:"update",value:function(t,e){if(-1!
==this._glID)if(e&&e.byteLength+t>this._bytes)console.error("Failed to update data,
bytes exceed.");else{var
i=this._device._gl,n=this._usage;i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._glID),e?
t?
i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,t,e):i.bufferData(i.ELEMENT_ARRAY_BUFFER,e,n
):this._bytes?
i.bufferData(i.ELEMENT_ARRAY_BUFFER,this._bytes,n):console.warn("bufferData should
not submit 0 bytes data"),this._device._restoreIndexBuffer()}else
console.error("The buffer is destroyed")}},{key:"count",get:function(){return
this._numIndices}}]),t})();i.default=a,e.exports=i.default}),{"./enums":345}],348:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=t("./enums"),r=d(t("./vertex-format")),s=d(t("./index-buffer")),a=d(t("./vertex-
buffer")),o=d(t("./program")),l=d(t("./texture")),h=d(t("./texture-
2d")),c=d(t("./texture-cube")),u=d(t("./render-buffer")),_=d(t("./frame-
buffer")),f=d(t("./device"));function d(t){return t&&t.__esModule?t:{default:t}}var
m={VertexFormat:r.default,IndexBuffer:s.default,VertexBuffer:a.default,Program:o.de
fault,Texture:l.default,Texture2D:h.default,TextureCube:c.default,RenderBuffer:u.de
fault,FrameBuffer:_.default,Device:f.default,attrTypeBytes:n.attrTypeBytes,glFilter
:n.glFilter,glTextureFmt:n.glTextureFmt};Object.assign(m,n.enums),i.default=m,cc.gf
x=m,e.exports=i.default}),{"./device":344,"./enums":345,"./frame-
buffer":346,"./index-buffer":347,"./program":350,"./render-
buffer":351,"./texture":355,"./texture-2d":353,"./texture-cube":354,"./vertex-
buffer":356,"./vertex-format":357}],349:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isPow2=function(t)
{return!(t&t-1||!t)}}),{}],350:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var s=0;function a(t,e,i)
{i.split("\n").forEach((function(i){if(!(i.length<5)){var n=/^ERROR:\s+(\d+):
(\d+):\s*(.*)$/.exec(i);n?t.push({type:e,fileID:0|n[1],line:0|
n[2],message:n[3].trim()}):i.length>0&&t.push({type:e,fileID:-
1,line:0,message:i})}}))}var o=(function(){function t(e,i)
{r(this,t),this._device=e,this._attributes=[],this._uniforms=[],this._samplers=[],t
his._errors=[],this._linked=!
1,this._vertSource=i.vert,this._fragSource=i.frag,this._glID=null,this._id=s+
+}return n(t,[{key:"link",value:function(){if(!this._linked){var
t=this._device._gl,e=l(t,t.VERTEX_SHADER,this._vertSource),i=l(t,t.FRAGMENT_SHADER,
this._fragSource),n=t.createProgram();t.attachShader(n,e),t.attachShader(n,i),t.lin
kProgram(n);var r=!1,s=this._errors;if(t.getShaderParameter(e,t.COMPILE_STATUS)||
(a(s,"vs",t.getShaderInfoLog(e)),r=!0),t.getShaderParameter(i,t.COMPILE_STATUS)||
(a(s,"fs",t.getShaderInfoLog(i)),r=!0),t.deleteShader(e),t.deleteShader(i),r)return
s;if(!t.getProgramParameter(n,t.LINK_STATUS))return s.push({info:"Failed to link
shader program: "+t.getProgramInfoLog(n)}),s;this._glID=n;for(var
o=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES),h=0;h<o;++h){var
c=t.getActiveAttrib(n,h),u=t.getAttribLocation(n,c.name);this._attributes.push({nam
e:c.name,location:u,type:c.type})}for(var
_=t.getProgramParameter(n,t.ACTIVE_UNIFORMS),f=0;f<_;++f){var
d=t.getActiveUniform(n,f),m=d.name,p=t.getUniformLocation(n,m),v="[0]"===m.substr(m
.length-3);v&&(m=m.substr(0,m.length-3));var
y={name:m,location:p,type:d.type,size:v?d.size:void
0};this._uniforms.push(y)}this._linked=!0}}},{key:"destroy",value:function()
{this._device._gl.deleteProgram(this._glID),this._linked=!
1,this._glID=null,this._attributes=[],this._uniforms=[],this._samplers=[]}},
{key:"id",get:function(){return this._id}}]),t})();function l(t,e,i){var
n=t.createShader(e);return
t.shaderSource(n,i),t.compileShader(n),n}i.default=o,e.exports=i.default}),{}],351:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var s=(function(){function
t(e,i,n,s)
{r(this,t),this._device=e,this._format=i,this._glID=e._gl.createRenderbuffer(),this
.update(n,s)}return n(t,[{key:"update",value:function(t,e)
{this._width=t,this._height=e;var
i=this._device._gl;i.bindRenderbuffer(i.RENDERBUFFER,this._glID),i.renderbufferStor
age(i.RENDERBUFFER,this._format,t,e),i.bindRenderbuffer(i.RENDERBUFFER,null)}},
{key:"destroy",value:function(){if(null!==this._glID){var
t=this._device._gl;t.bindRenderbuffer(t.RENDERBUFFER,null),t.deleteRenderbuffer(thi
s._glID),this._glID=null}else console.error("The render-buffer already
destroyed")}}]),t})();i.default=s,e.exports=i.default}),{}],352:[(function(t,e,i)
{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./enums");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a={blend:!1,blendSep:!
1,blendColor:4294967295,blendEq:r.enums.BLEND_FUNC_ADD,blendAlphaEq:r.enums.BLEND_F
UNC_ADD,blendSrc:r.enums.BLEND_ONE,blendDst:r.enums.BLEND_ZERO,blendSrcAlpha:r.enum
s.BLEND_ONE,blendDstAlpha:r.enums.BLEND_ZERO,depthTest:!1,depthWrite:!
1,depthFunc:r.enums.DS_FUNC_LESS,stencilTest:!1,stencilSep:!
1,stencilFuncFront:r.enums.DS_FUNC_ALWAYS,stencilRefFront:0,stencilMaskFront:255,st
encilFailOpFront:r.enums.STENCIL_OP_KEEP,stencilZFailOpFront:r.enums.STENCIL_OP_KEE
P,stencilZPassOpFront:r.enums.STENCIL_OP_KEEP,stencilWriteMaskFront:255,stencilFunc
Back:r.enums.DS_FUNC_ALWAYS,stencilRefBack:0,stencilMaskBack:255,stencilFailOpBack:
r.enums.STENCIL_OP_KEEP,stencilZFailOpBack:r.enums.STENCIL_OP_KEEP,stencilZPassOpBa
ck:r.enums.STENCIL_OP_KEEP,stencilWriteMaskBack:255,cullMode:r.enums.CULL_BACK,prim
itiveType:r.enums.PT_TRIANGLES,maxStream:-1,vertexBuffers:[],vertexBufferOffsets:
[],indexBuffer:null,maxTextureSlot:-1,textureUnits:[],program:null},o=(function()
{function t(e){s(this,t),this.vertexBuffers=new
Array(e._caps.maxVertexStreams),this.vertexBufferOffsets=new
Array(e._caps.maxVertexStreams),this.textureUnits=new
Array(e._caps.maxTextureUnits),this.set(a)}return n(t,
[{key:"reset",value:function(){this.set(a)}},{key:"set",value:function(t)
{this.blend=t.blend,this.blendSep=t.blendSep,this.blendColor=t.blendColor,this.blen
dEq=t.blendEq,this.blendAlphaEq=t.blendAlphaEq,this.blendSrc=t.blendSrc,this.blendD
st=t.blendDst,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha
,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.depthFunc=t.depthFunc
,this.stencilTest=t.stencilTest,this.stencilSep=t.stencilSep,this.stencilFuncFront=
t.stencilFuncFront,this.stencilRefFront=t.stencilRefFront,this.stencilMaskFront=t.s
tencilMaskFront,this.stencilFailOpFront=t.stencilFailOpFront,this.stencilZFailOpFro
nt=t.stencilZFailOpFront,this.stencilZPassOpFront=t.stencilZPassOpFront,this.stenci
lWriteMaskFront=t.stencilWriteMaskFront,this.stencilFuncBack=t.stencilFuncBack,this
.stencilRefBack=t.stencilRefBack,this.stencilMaskBack=t.stencilMaskBack,this.stenci
lFailOpBack=t.stencilFailOpBack,this.stencilZFailOpBack=t.stencilZFailOpBack,this.s
tencilZPassOpBack=t.stencilZPassOpBack,this.stencilWriteMaskBack=t.stencilWriteMask
Back,this.cullMode=t.cullMode,this.primitiveType=t.primitiveType,this.maxStream=t.m
axStream;for(var e=0;e<t.vertexBuffers.length;+
+e)this.vertexBuffers[e]=t.vertexBuffers[e];for(var
i=0;i<t.vertexBufferOffsets.length;+
+i)this.vertexBufferOffsets[i]=t.vertexBufferOffsets[i];this.indexBuffer=t.indexBuf
fer,this.maxTextureSlot=t.maxTextureSlot;for(var n=0;n<t.textureUnits.length;+
+n)this.textureUnits[n]=t.textureUnits[n];this.program=t.program}}],
[{key:"initDefault",value:function(t){a.vertexBuffers=new
Array(t._caps.maxVertexStreams),a.vertexBufferOffsets=new
Array(t._caps.maxVertexStreams),a.textureUnits=new
Array(t._caps.maxTextureUnits)}}]),t})();i.default=o,e.exports=i.default}),
{"./enums":345}],353:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./texture")),s=t("./enums"),a=t("./misc");function o(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}function
l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super()
hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?
t:e}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super
expression must either be null or a function, not "+typeof
e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!
1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}Object.getPrototypeOf(Object.getPrototype
Of(new Uint8Array)).constructor;var c=(function(t){function e(t,i){o(this,e);var
n=l(this,(e.__proto__||
Object.getPrototypeOf(e)).call(this,t)),r=n._device._gl;return
n._target=r.TEXTURE_2D,n._glID=r.createTexture(),i.images=i.images||
[null],n.update(i),n}return h(e,r.default),n(e,[{key:"update",value:function(t){var
e=this._device._gl,i=this._hasMipmap;if(t){void 0!
==t.width&&(this._width=t.width),void 0!==t.height&&(this._height=t.height),void 0!
==t.anisotropy&&(this._anisotropy=t.anisotropy),void 0!
==t.minFilter&&(this._minFilter=t.minFilter),void 0!
==t.magFilter&&(this._magFilter=t.magFilter),void 0!
==t.mipFilter&&(this._mipFilter=t.mipFilter),void 0!
==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!
==t.format&&(this._format=t.format,this._compressed=this._format>=s.enums.TEXTURE_F
MT_RGB_DXT1&&this._format<=s.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||
this._format>=s.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=s.enums.TEXTURE_FMT_RGBA_
ETC2),void 0!==t.mipmap&&(this._hasMipmap=t.mipmap,i=t.mipmap);var
n=e.getParameter(e.MAX_TEXTURE_SIZE),r=t.width&&t.height?
Math.max(t.width,t.height):0;if(n<r&&console.warn("The current texture size "+r+"
exceeds the maximum size ["+n+"] supported on the device."),void 0!
==t.images)if(t.images.length>1)i=!1,(t.width>t.height?
t.width:t.height)>>t.images.length-1!=1&&console.error("texture-2d mipmap is
invalid, should have a 1x1 mipmap.")}(0,a.isPow2)(this._width)&&(0,a.isPow2)
(this._height)||(i=!
1),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),void 0!
==t.images&&t.images.length>0&&(this._setMipmap(t.images,t.flipY,t.premultiplyAlpha
),t.images.length>1&&(this._hasMipmap=!
0)),i&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_2D),this
._hasMipmap=!0),this._setTexInfo(),this._device._restoreTexture(0)}},
{key:"updateSubImage",value:function(t){var e=this._device._gl,i=(0,s.glTextureFmt)
(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),t
his._setSubImage(i,t),this._device._restoreTexture(0)}},
{key:"updateImage",value:function(t){var e=this._device._gl,i=(0,s.glTextureFmt)
(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._glID),t
his._setImage(i,t),this._device._restoreTexture(0)}},
{key:"_setSubImage",value:function(t,e){var
i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,s=e.image;!s||
ArrayBuffer.isView(s)||s instanceof ArrayBuffer?(void 0===n?
i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void
0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this._compressed?
i.compressedTexSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,e.width,e.height,t.format,s)
:i.texSubImage2D(i.TEXTURE_2D,e.level,e.x,e.y,e.width,e.height,t.format,t.pixelType
,s)):(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!
0):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?
i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),i.texSubImage2D(i.TEXTURE_2D,e
.level,e.x,e.y,t.format,t.pixelType,s))}},{key:"_setImage",value:function(t,e){var
i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,s=e.image;!s||
ArrayBuffer.isView(s)||s instanceof ArrayBuffer?(void 0===n?
i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void
0===r?i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this._compressed?
i.compressedTexImage2D(i.TEXTURE_2D,e.level,t.internalFormat,e.width,e.height,0,s):
i.texImage2D(i.TEXTURE_2D,e.level,t.internalFormat,e.width,e.height,0,t.format,t.pi
xelType,s)):(void 0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!
0):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?
i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),i.texImage2D(i.TEXTURE_2D,e.le
vel,t.internalFormat,t.format,t.pixelType,s))}},
{key:"_setMipmap",value:function(t,e,i){for(var n=(0,s.glTextureFmt)
(this._format),r={width:this._width,height:this._height,flipY:e,premultiplyAlpha:i,
level:0,image:null},a=0;a<t.length;+
+a)r.level=a,r.width=this._width>>a,r.height=this._height>>a,r.image=t[a],this._set
Image(n,r)}},{key:"_setTexInfo",value:function(){var
t=this._device._gl,e=(0,a.isPow2)(this._width)&&(0,a.isPow2)(this._height);e||
this._wrapS===s.enums.WRAP_CLAMP&&this._wrapT===s.enums.WRAP_CLAMP||
(console.warn("WebGL1 doesn't support all wrap modes with NPOT
textures"),this._wrapS=s.enums.WRAP_CLAMP,this._wrapT=s.enums.WRAP_CLAMP);var
i=this._hasMipmap?this._mipFilter:-1;e||-1===i||(console.warn("NPOT textures do not
support mipmap filter"),i=-1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,
(0,s.glFilter)
(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,
(0,s.glFilter)(t,this._magFilter,-
1)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this._wrapS),t.texParameteri(t.TE
XTURE_2D,t.TEXTURE_WRAP_T,this._wrapT);var
n=this._device.ext("EXT_texture_filter_anisotropic");n&&t.texParameteri(t.TEXTURE_2
D,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisotropy)}}]),e})
();i.default=c,e.exports=i.default}),
{"./enums":345,"./misc":349,"./texture":355}],354:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./texture")),s=t("./enums"),a=t("./misc");function o(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}function
l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super()
hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?
t:e}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super
expression must either be null or a function, not "+typeof
e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!
1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}var c=(function(t){function e(t,i)
{o(this,e);var n=l(this,(e.__proto__||
Object.getPrototypeOf(e)).call(this,t)),r=n._device._gl;return
n._target=r.TEXTURE_CUBE_MAP,n._glID=r.createTexture(),n.update(i),n}return
h(e,r.default),n(e,[{key:"update",value:function(t){var
e=this._device._gl,i=this._hasMipmap;t&&(void 0!
==t.width&&(this._width=t.width),void 0!==t.height&&(this._height=t.height),void 0!
==t.anisotropy&&(this._anisotropy=t.anisotropy),void 0!
==t.minFilter&&(this._minFilter=t.minFilter),void 0!
==t.magFilter&&(this._magFilter=t.magFilter),void 0!
==t.mipFilter&&(this._mipFilter=t.mipFilter),void 0!
==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!
==t.format&&(this._format=t.format,this._compressed=this._format>=s.enums.TEXTURE_F
MT_RGB_DXT1&&this._format<=s.enums.TEXTURE_FMT_RGBA_PVRTC_4BPPV1||
this._format>=s.enums.TEXTURE_FMT_RGB_ETC2&&this._format<=s.enums.TEXTURE_FMT_RGBA_
ETC2),void 0!==t.mipmap&&(this._hasMipmap=t.mipmap,i=t.mipmap),void 0!
==t.images&&t.images.length>1&&(i=!1,t.width!==t.height&&console.warn("texture-cube
width and height should be identical."),t.width>>t.images.length-1!
=1&&console.error("texture-cube mipmap is invalid. please set mipmap as 1x1, 2x2,
4x4 ... nxn"))),(0,a.isPow2)(this._width)&&(0,a.isPow2)(this._height)||(i=!
1),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._glID),void 0!
==t.images&&t.images.length>0&&(this._setMipmap(t.images,t.flipY,t.premultiplyAlpha
),t.images.length>1&&(this._hasMipmap=!
0)),i&&(e.hint(e.GENERATE_MIPMAP_HINT,e.NICEST),e.generateMipmap(e.TEXTURE_CUBE_MAP
),this._hasMipmap=!0),this._setTexInfo(),this._device._restoreTexture(0)}},
{key:"updateSubImage",value:function(t){var e=this._device._gl,i=(0,s.glTextureFmt)
(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._g
lID),this._setSubImage(i,t),this._device._restoreTexture(0)}},
{key:"updateImage",value:function(t){var e=this._device._gl,i=(0,s.glTextureFmt)
(this._format);e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_CUBE_MAP,this._g
lID),this._setImage(i,t),this._device._restoreTexture(0)}},
{key:"_setSubImage",value:function(t,e){var
i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,s=e.faceIndex,a=e.image;void
0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!
1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?
i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),!a||ArrayBuffer.isView(a)||a
instanceof ArrayBuffer?this._compressed?
i.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,e.x,e.y,e.width,e
.height,t.format,a):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,e.x,e.y
,e.width,e.height,t.format,t.pixelType,a):i.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITI
VE_X+s,e.level,e.x,e.y,t.format,t.pixelType,a)}},
{key:"_setImage",value:function(t,e){var
i=this._device._gl,n=e.flipY,r=e.premultiplyAlpha,s=e.faceIndex,a=e.image;void
0===n?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!
1):i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,n),void 0===r?
i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!
1):i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),!a||ArrayBuffer.isView(a)||a
instanceof ArrayBuffer?this._compressed?
i.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalFormat,e.w
idth,e.height,0,a):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalF
ormat,e.width,e.height,0,t.for
mat,t.pixelType,a):i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+s,e.level,t.internalF
ormat,t.format,t.pixelType,a)}},{key:"_setMipmap",value:function(t,e,i){for(var
n=(0,s.glTextureFmt)
(this._format),r={width:this._width,height:this._height,faceIndex:0,flipY:e,premult
iplyAlpha:i,level:0,image:null},a=0;a<t.length;++a){var
o=t[a];r.level=a,r.width=this._width>>a,r.height=this._height>>a;for(var l=0;l<6;+
+l)r.faceIndex=l,r.image=o[l],this._setImage(n,r)}}},
{key:"_setTexInfo",value:function(){var t=this._device._gl,e=(0,a.isPow2)
(this._width)&&(0,a.isPow2)(this._height);e||
this._wrapS===s.enums.WRAP_CLAMP&&this._wrapT===s.enums.WRAP_CLAMP||
(console.warn("WebGL1 doesn't support all wrap modes with NPOT
textures"),this._wrapS=s.enums.WRAP_CLAMP,this._wrapT=s.enums.WRAP_CLAMP);var
i=this._hasMipmap?this._mipFilter:-1;e||-1===i||(console.warn("NPOT textures do not
support mipmap filter"),i=-
1),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,(0,s.glFilter)
(t,this._minFilter,i)),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,
(0,s.glFilter)(t,this._magFilter,-
1)),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,this._wrapS),t.texParameter
i(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,this._wrapT);var
n=this._device.ext("EXT_texture_filter_anisotropic");n&&t.texParameteri(t.TEXTURE_C
UBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this._anisotropy)}}]),e})
();i.default=c,e.exports=i.default}),
{"./enums":345,"./misc":349,"./texture":355}],355:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./enums");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=0,o=(function(){function t(e)
{s(this,t),this._device=e,this._width=4,this._height=4,this._hasMipmap=!
1,this._compressed=!
1,this._anisotropy=1,this._minFilter=r.enums.FILTER_LINEAR,this._magFilter=r.enums.
FILTER_LINEAR,this._mipFilter=r.enums.FILTER_LINEAR,this._wrapS=r.enums.WRAP_REPEAT
,this._wrapT=r.enums.WRAP_REPEAT,this._format=r.enums.TEXTURE_FMT_RGBA8,this._targe
t=-1,this._id=a++}return n(t,[{key:"destroy",value:function(){null!==this._glID?
(this._device._gl.deleteTexture(this._glID),this._device._stats.tex-
=this.bytes,this._glID=null):console.error("The texture already destroyed")}}]),t})
();i.default=o,e.exports=i.default}),{"./enums":345}],356:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();t("./enums");function r(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var s=(function()
{function t(e,i,n,s,a)
{r(this,t),this._device=e,this._format=i,this._usage=n,this._numVertices=a,this._by
tes=this._format._bytes*a,this._glID=e._gl.createBuffer(),this.update(0,s),e._stats
.vb+=this._bytes}return n(t,[{key:"destroy",value:function(){-1!==this._glID?
(this._device._gl.deleteBuffer(this._glID),this._device._stats.vb-
=this.bytes,this._glID=-1):console.error("The buffer already destroyed")}},
{key:"update",value:function(t,e){if(-1!
==this._glID)if(e&&e.byteLength+t>this._bytes)console.error("Failed to update data,
bytes exceed.");else{var
i=this._device._gl,n=this._usage;i.bindBuffer(i.ARRAY_BUFFER,this._glID),e?t?
i.bufferSubData(i.ARRAY_BUFFER,t,e):i.bufferData(i.ARRAY_BUFFER,e,n):this._bytes?
i.bufferData(i.ARRAY_BUFFER,this._bytes,n):console.warn("bufferData should not
submit 0 bytes data"),i.bindBuffer(i.ARRAY_BUFFER,null)}else console.error("The
buffer is destroyed")}},{key:"count",get:function(){return
this._numVertices}}]),t})();i.default=s,e.exports=i.default}),{"./enums":345}],357:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=void 0;var n=(function(){function t(t,e){for(var i=0;i<e.length;i++)
{var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in
n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("./enums");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(e)
{s(this,t),this._attr2el={},this._elements=[],this._bytes=0;for(var
i=0,n=e.length;i<n;++i){var
a=e[i],o={name:a.name,offset:this._bytes,stride:0,stream:-
1,type:a.type,num:a.num,normalize:void 0!
==a.normalize&&a.normalize,bytes:a.num*(0,r.attrTypeBytes)
(a.type)};this._attr2el[o.name]=o,this._elements.push(o),this._bytes+=o.bytes}for(v
ar l=0,h=this._elements.length;l<h;++l)
{this._elements[l].stride=this._bytes}}return n(t,[{key:"element",value:function(t)
{return this._attr2el[t]}}]),t})();i.default=a,e.exports=i.default}),
{"./enums":345}],358:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var s=(function(){function t(e,i)
{r(this,t),this._cursor=0,this._data=new Array(i);for(var n=0;n<i;+
+n)this._data[n]=e()}return n(t,[{key:"request",value:function(){var
t=this._data[this._cursor];return
this._cursor=(this._cursor+1)%this._data.length,t}}]),t})
();i.default=s,e.exports=i.default}),{}],359:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./timsort"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=(function(){function t(e)
{s(this,t),this._count=0,this._data=new Array(e)}return n(t,
[{key:"_resize",value:function(t){if(t>this._data.length)for(var
e=this._data.length;e<t;++e)this._data[e]=void 0}},{key:"reset",value:function()
{for(var t=0;t<this._count;++t)this._data[t]=void 0;this._count=0}},
{key:"push",value:function(t)
{this._count>=this._data.length&&this._resize(2*this._data.length),this._data[this.
_count]=t,++this._count}},{key:"pop",value:function(){--
this._count,this._count<0&&(this._count=0);var t=this._data[this._count];return
this._data[this._count]=void 0,t}},{key:"fastRemove",value:function(t){if(!
(t>=this._count||t<0)){var e=this._count-
1;this._data[t]=this._data[e],this._data[e]=void 0,this._count-=1}}},
{key:"indexOf",value:function(t){return this._data.indexOf(t)}},
{key:"sort",value:function(t){return(0,r.default)(this._data,0,this._count,t)}},
{key:"length",get:function(){return this._count}},{key:"data",get:function(){return
this._data}}]),t})();i.default=a,e.exports=i.default}),{"./timsort":364}],360:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=t("./circular-pool");Object.defineProperty(i,"CircularPool",{enumerable:!
0,get:function(){return h(n).default}});var r=t("./fixed-
array");Object.defineProperty(i,"FixedArray",{enumerable:!0,get:function(){return
h(r).default}});var s=t("./linked-array");Object.defineProperty(i,"LinkedArray",
{enumerable:!0,get:function(){return h(s).default}});var
a=t("./pool");Object.defineProperty(i,"Pool",{enumerable:!0,get:function(){return
h(a).default}});var o=t("./recycle-pool");Object.defineProperty(i,"RecyclePool",
{enumerable:!0,get:function(){return h(o).default}});var l=t("./typed-array-
pool");function h(t){return t&&t.__esModule?t:
{default:t}}Object.defineProperty(i,"TypedArrayPool",{enumerable:!0,get:function()
{return h(l).default}})}),{"./circular-pool":358,"./fixed-array":359,"./linked-
array":361,"./pool":362,"./recycle-pool":363,"./typed-array-pool":365}],361:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=void 0;var n=(function(){function t(t,e){for(var i=0;i<e.length;i++)
{var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in
n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./pool"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=(function(){function t(e,i)
{s(this,t),this._fn=e,this._count=0,this._head=null,this._tail=null,this._pool=new
r.default(e,i)}return n(t,[{key:"add",value:function(){var
t=this._pool.alloc();return this._tail?
(this._tail._next=t,t._prev=this._tail):this._head=t,this._tail=t,this._count+=1,t}
},{key:"remove",value:function(t){t._prev?
t._prev._next=t._next:this._head=t._next,t._next?
t._next._prev=t._prev:this._tail=t._prev,t._next=null,t._prev=null,this._pool.free(
t),this._count-=1}},{key:"forEach",value:function(t,e){var i=this._head;if(i)
{e&&(t=t.bind(e));for(var n=0,r=i;i;)r=i._next,t(i,n,this),i=r,++n}}},
{key:"head",get:function(){return this._head}},{key:"tail",get:function(){return
this._tail}},{key:"length",get:function(){return this._count}}]),t})
();i.default=a,e.exports=i.default}),{"./pool":362}],362:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});var n=(function(){function
t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!
1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return
function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
s=(function(){function t(e,i){r(this,t),this._fn=e,this._idx=i-1,this._frees=new
Array(i);for(var n=0;n<i;++n)this._frees[n]=e()}return n(t,
[{key:"_expand",value:function(t){var e=this._frees;this._frees=new
Array(t);for(var i=t-e.length,n=0;n<i;++n)this._frees[n]=this._fn();for(var
r=i,s=0;r<t;++r,++s)this._frees[r]=e[s];this._idx+=i}},
{key:"alloc",value:function()
{this._idx<0&&this._expand(Math.round(1.2*this._frees.length)+1);var
t=this._frees[this._idx];return this._frees[this._idx]=null,--this._idx,t}},
{key:"free",value:function(t){++this._idx,this._frees[this._idx]=t}}]),t})
();i.default=s,e.exports=i.default}),{}],363:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./timsort"));function s(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var a=(function(){function t(e,i)
{s(this,t),this._fn=e,this._count=0,this._data=new Array(i);for(var n=0;n<i;+
+n)this._data[n]=e()}return n(t,[{key:"reset",value:function(){this._count=0}},
{key:"resize",value:function(t){if(t>this._data.length)for(var
e=this._data.length;e<t;++e)this._data[e]=this._fn()}},{key:"add",value:function()
{return
this._count>=this._data.length&&this.resize(2*this._data.length),this._data[this._c
ount++]}},{key:"remove",value:function(t){if(!(t>=this._count)){var e=this._count-
1,i=this._data[t];this._data[t]=this._data[e],this._data[e]=i,this._count-=1}}},
{key:"sort",value:function(t){return(0,r.default)(this._data,0,this._count,t)}},
{key:"length",get:function(){return this._count}},{key:"data",get:function(){return
this._data}}]),t})();i.default=a,e.exports=i.default}),{"./timsort":364}],364:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})();function r(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}i.default=function(t,e,i,n){if(!
Array.isArray(t))throw new TypeError("Can only sort arrays");void 0===e&&(e=0),void
0===i&&(i=t.length),void 0===n&&(n=c);var r=i-e;if(!(r<2)){var
a=0;if(r<s)d(t,e,i,e+(a=_(t,e,i,n)),n);else{var o=new
v(t,n),l=u(r);do{if((a=_(t,e,i,n))<l){var
h=r;h>l&&(h=l),d(t,e,e+h,e+a,n),a=h}o.pushRun(e,a),o.mergeRuns(),r-=a,e+=a}while(0!
==r);o.forceMergeRuns()}}};var
s=32,a=7,o=256,l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function h(t){return t<1e5?
t<100?t<10?0:1:t<1e4?t<1e3?2:3:4:t<1e7?t<1e6?5:6:t<1e9?t<1e8?7:8:9}function c(t,e)
{if(t===e)return 0;if(~~t===t&&~~e===e){if(0===t||0===e)return t<e?-1:1;if(t<0||
e<0){if(e>=0)return-1;if(t>=0)return 1;t=-t,e=-e}var i=h(t),n=h(e),r=0;return i<n?
(t*=l[n-i-1],e/=10,r=-1):i>n&&(e*=l[i-n-1],t/=10,r=1),t===e?r:t<e?-1:1}var
s=String(t),a=String(e);return s===a?0:s<a?-1:1}function u(t){for(var e=0;t>=s;)e|
=1&t,t>>=1;return t+e}function _(t,e,i,n){var r=e+1;if(r===i)return 1;if(n(t[r+
+],t[e])<0){for(;r<i&&n(t[r],t[r-1])<0;)r++;f(t,e,r)}else for(;r<i&&n(t[r],t[r-
1])>=0;)r++;return r-e}function f(t,e,i){for(i--;e<i;){var n=t[e];t[e+
+]=t[i],t[i--]=n}}function d(t,e,i,n,r){for(n===e&&n++;n<i;n++){for(var
s=t[n],a=e,o=n;a<o;){var l=a+o>>>1;r(s,t[l])<0?o=l:a=l+1}var h=n-a;switch(h){case
3:t[a+3]=t[a+2];case 2:t[a+2]=t[a+1];case
1:t[a+1]=t[a];break;default:for(;h>0;)t[a+h]=t[a+h-1],h--}t[a]=s}}function
m(t,e,i,n,r,s){var a=0,o=0,l=1;if(s(t,e[i+r])>0){for(o=n-
r;l<o&&s(t,e[i+r+l])>0;)a=l,(l=1+
(l<<1))<=0&&(l=o);l>o&&(l=o),a+=r,l+=r}else{for(o=r+1;l<o&&s(t,e[i+r-l])<=0;)a=l,
(l=1+(l<<1))<=0&&(l=o);l>o&&(l=o);var h=a;a=r-l,l=r-h}for(a++;a<l;){var c=a+(l-
a>>>1);s(t,e[i+c])>0?a=c+1:l=c}return l}function p(t,e,i,n,r,s){var
a=0,o=0,l=1;if(s(t,e[i+r])<0){for(o=r+1;l<o&&s(t,e[i+r-l])<0;)a=l,(l=1+
(l<<1))<=0&&(l=o);l>o&&(l=o);var h=a;a=r-l,l=r-h}else{for(o=n-
r;l<o&&s(t,e[i+r+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=o);l>o&&(l=o),a+=r,l+=r}for(a+
+;a<l;){var c=a+(l-a>>>1);s(t,e[i+c])<0?l=c:a=c+1}return l}var v=(function()
{function t(e,i)
{r(this,t),this.array=e,this.compare=i,this.minGallop=a,this.length=e.length,this.t
mpStorageLength=o,this.length<2*o&&(this.tmpStorageLength=this.length>>>1),this.tmp
=new Array(this.tmpStorageLength),this.stackLength=this.length<120?
5:this.length<1542?10:this.length<119151?19:40,this.runStart=new
Array(this.stackLength),this.runLength=new
Array(this.stackLength),this.stackSize=0}return n(t,
[{key:"pushRun",value:function(t,e)
{this.runStart[this.stackSize]=t,this.runLength[this.stackSize]=e,this.stackSize+=1
}},{key:"mergeRuns",value:function(){for(;this.stackSize>1;){var t=this.stackSize-
2;if(t>=1&&this.runLength[t-1]<=this.runLength[t]+this.runLength[t+1]||
t>=2&&this.runLength[t-2]<=this.runLength[t]+this.runLength[t-1])this.runLength[t-
1]<this.runLength[t+1]&&t--;else
if(this.runLength[t]>this.runLength[t+1])break;this.mergeAt(t)}}},
{key:"forceMergeRuns",value:function(){for(;this.stackSize>1;){var
t=this.stackSize-2;t>0&&this.runLength[t-
1]<this.runLength[t+1]&&t--,this.mergeAt(t)}}},{key:"mergeAt",value:function(t){var
e=this.compare,i=this.array,n=this.runStart[t],r=this.runLength[t],s=this.runStart[
t+1],a=this.runLength[t+1];this.runLength[t]=r+a,t===this.stackSize-
3&&(this.runStart[t+1]=this.runStart[t+2],this.runLength[t+1]=this.runLength[t+2]),
this.stackSize--;var o=p(i[s],i,n,r,0,e);n+=o,0!==(r-=o)&&0!==(a=m(i[n+r-
1],i,s,a,a-1,e))&&(r<=a?this.mergeLow(n,r,s,a):this.mergeHigh(n,r,s,a))}},
{key:"mergeLow",value:function(t,e,i,n){var
r=this.compare,s=this.array,o=this.tmp,l=0;for(l=0;l<e;l++)o[l]=s[t+l];var
h=0,c=i,u=t;if(s[u++]=s[c++],0!=--n)if(1!==e){for(var _=this.minGallop;;){var
f=0,d=0,v=!1;do{if(r(s[c],o[h])<0){if(s[u++]=s[c++],d++,f=0,0==--n){v=!
0;break}}else if(s[u++]=o[h++],f++,d=0,1==--e){v=!0;break}}while((f|
d)<_);if(v)break;do{if(0!==(f=p(s[c],o,h,e,0,r))){for(l=0;l<f;l+
+)s[u+l]=o[h+l];if(u+=f,h+=f,(e-=f)<=1){v=!0;break}}if(s[u++]=s[c++],0==--n){v=!
0;break}if(0!==(d=m(o[h],s,c,n,0,r))){for(l=0;l<d;l+
+)s[u+l]=s[c+l];if(u+=d,c+=d,0===(n-=d)){v=!0;break}}if(s[u++]=o[h++],1==--e){v=!
0;break}_--}while(f>=a||
d>=a);if(v)break;_<0&&(_=0),_+=2}if(this.minGallop=_,_<1&&(this.minGallop=1),1===e)
{for(l=0;l<n;l++)s[u+l]=s[c+l];s[u+n]=o[h]}else{if(0===e)throw new Error("mergeLow
preconditions were not respected");for(l=0;l<e;l+
+)s[u+l]=o[h+l]}}else{for(l=0;l<n;l++)s[u+l]=s[c+l];s[u+n]=o[h]}else for(l=0;l<e;l+
+)s[u+l]=o[h+l]}},{key:"mergeHigh",value:function(t,e,i,n){var
r=this.compare,s=this.array,o=this.tmp,l=0;for(l=0;l<n;l++)o[l]=s[i+l];var h=t+e-
1,c=n-1,u=i+n-1,_=0,f=0;if(s[u--]=s[h--],0!=--e)if(1!==n){for(var
d=this.minGallop;;){var v=0,y=0,g=!1;do{if(r(o[c],s[h])<0){if(s[u--]=s[h--],v+
+,y=0,0==--e){g=!0;break}}else if(s[u--]=o[c--],y++,v=0,1==--n){g=!
0;break}}while((v|y)<d);if(g)break;do{if(0!==(v=e-p(o[c],s,t,e,e-1,r))){for(e-
=v,f=(u-=v)+1,_=(h-=v)+1,l=v-1;l>=0;l--)s[f+l]=s[_+l];if(0===e){g=!
0;break}}if(s[u--]=o[c--],1==--n){g=!0;break}if(0!==(y=n-m(s[h],o,0,n,n-1,r)))
{for(n-=y,f=(u-=y)+1,_=(c-=y)+1,l=0;l<y;l++)s[f+l]=o[_+l];if(n<=1){g=!
0;break}}if(s[u--]=s[h--],0==--e){g=!0;break}d--}while(v>=a||
y>=a);if(g)break;d<0&&(d=0),d+=2}if(this.minGallop=d,d<1&&(this.minGallop=1),1===n)
{for(f=(u-=e)+1,_=(h-=e)+1,l=e-
1;l>=0;l--)s[f+l]=s[_+l];s[u]=o[c]}else{if(0===n)throw new Error("mergeHigh
preconditions were not respected");for(_=u-(n-1),l=0;l<n;l+
+)s[_+l]=o[l]}}else{for(f=(u-=e)+1,_=(h-=e)+1,l=e-
1;l>=0;l--)s[f+l]=s[_+l];s[u]=o[c]}else for(_=u-(n-1),l=0;l<n;l+
+)s[_+l]=o[l]}}]),t})();e.exports=i.default}),{}],365:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0});for(var
n=Array(8),r=0;r<8;++r)n[r]=[];function s(t){for(var
e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function a(t){var e=void 0,i=void
0;return e=(t>65535)<<4,e|=i=((t>>>=e)>255)<<3,e|=i=((t>>>=i)>15)<<2,(e|
=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}function o(t){var e=s(t),i=n[a(e)>>2];return
i.length>0?i.pop():new ArrayBuffer(e)}function l(t)
{n[a(t.byteLength)>>2].push(t)}i.default={alloc_int8:function(t){var e=new
Int8Array(o(t),0,t);return e.length!==t?e.subarray(0,t):e},alloc_uint8:function(t)
{var e=new Uint8Array(o(t),0,t);return e.length!==t?
e.subarray(0,t):e},alloc_int16:function(t){var e=new Int16Array(o(2*t),0,t);return
e.length!==t?e.subarray(0,t):e},alloc_uint16:function(t){var e=new
Uint16Array(o(2*t),0,t);return e.length!==t?
e.subarray(0,t):e},alloc_int32:function(t){var e=new Int32Array(o(4*t),0,t);return
e.length!==t?e.subarray(0,t):e},alloc_uint32:function(t){var e=new
Uint32Array(o(4*t),0,t);return e.length!==t?
e.subarray(0,t):e},alloc_float32:function(t){var e=new
Float32Array(o(4*t),0,t);return e.length!==t?
e.subarray(0,t):e},alloc_float64:function(t){var e=new
Float64Array(o(8*t),0,t);return e.length!==t?
e.subarray(0,t):e},alloc_dataview:function(t){var e=new DataView(o(t),0,t);return
e.length!==t?e.subarray(0,t):e},free:function(t){l(t.buffer)},reset:function()
{for(var t=Array(8),e=0;e<8;++e)t[e]=[]}},e.exports=i.default}),{}],366:
[(function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a
function")}Object.defineProperty(i,"__esModule",{value:!0});i.default=function t()
{n(this,t),this.material=null,this.vertexCount=0,this.indiceCount=0},e.exports=i.de
fault}),{}],367:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var
i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!
0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return
function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./base-render-data"));function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}function
a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super()
hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?
t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super
expression must either be null or a function, not "+typeof
e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!
1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}var l=(function(t){function e()
{s(this,e);var t=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return
t.ia=null,t}return o(e,r.default),n(e,[{key:"type",get:function(){return
e.type}}]),e})
();i.default=l,l.type="IARenderData",cc.IARenderData=l,e.exports=i.default}),
{"./base-render-data":366}],368:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n,r=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),s=t("../memop"),a=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./base-render-data"));function o(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}function
l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super()
hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?
t:e}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super
expression must either be null or a function, not "+typeof
e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!
1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}var c=new s.Pool(function()
{return{x:0,y:0,z:0,u:0,v:0,color:0}},128),u=(function(t){function e()
{o(this,e);var t=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return
t._data=[],t._indices=[],t._pivotX=0,t._pivotY=0,t._width=0,t._height=0,t.uvDirty=!
0,t.vertDirty=!0,t}return h(e,a.default),r(e,
[{key:"updateSizeNPivot",value:function(t,e,i,n)
{t===this._width&&e===this._height&&i===this._pivotX&&n===this._pivotY||
(this._width=t,this._height=e,this._pivotX=i,this._pivotY=n,this.vertDirty=!0)}},
{key:"type",get:function(){return e.type}},{key:"dataLength",get:function(){return
this._data.length},set:function(t){var e=this._data;if(e.length!==t){for(var
i=t;i<e.length;i++)c.free(e[i]);for(var n=e.length;n<t;n+
+)e[n]=c.alloc();e.length=t}}}],[{key:"alloc",value:function(){return n.alloc()}},
{key:"free",value:function(t){if(t instanceof e){for(var i=t.length-
1;i>0;i--)c.free(t._data[i]);t._data.length=0,t._indices.length=0,t.material=null,t
.uvDirty=!0,t.vertDirty=!0,t.vertexCount=0,t.indiceCount=0,n.free(t)}}}]),e})
();i.default=u,u.type="RenderData",n=new s.Pool(function(){return new
u},32),e.exports=i.default}),{"../memop":360,"./base-render-data":366}],369:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=void 0;var n=(function(){function t(t,e){for(var i=0;i<e.length;i++)
{var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in
n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("../../core/vmath"),s=l(t("../core/base-
renderer")),a=l(t("../enums")),o=t("../memop");function l(t){return
t&&t.__esModule?t:{default:t}}function h(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new
ReferenceError("this hasn't been initialised - super() hasn't been called");return!
e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!
=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a
function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:
{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}var _=new Float32Array(16),f=new
Float32Array(16),d=new Float32Array(16),m=new Float32Array(3),p=new
Float32Array(16),v=r.vec3.create(0,0,0),y=r.vec3.create(0,0,0),g=r.vec3.create(0,0,
0),x=new o.RecyclePool(function(){return new Float32Array(16)},8),b=(function(t)
{function e(t,i){h(this,e);var n=c(this,(e.__proto__||
Object.getPrototypeOf(e)).call(this,t,i));return
n._directionalLights=[],n._pointLights=[],n._spotLights=[],n._shadowLights=[],n._sc
eneAmbient=new
Float32Array([0,0,0]),n._numLights=0,n._defines={},n._registerStage("shadowcast",n.
_shadowStage.bind(n)),n._registerStage("opaque",n._opaqueStage.bind(n)),n._register
Stage("transparent",n._transparentStage.bind(n)),n}return u(e,s.default),n(e,
[{key:"reset",value:function(){this._reset()}},{key:"render",value:function(t)
{this._reset(),this._updateLights(t);for(var
e=this._device._gl.canvas,i=0;i<t._cameras.length;++i){var
n=this._requestView(),r=e.width,s=e.height;t._cameras.data[i].extractView(n,r,s)}th
is._viewPools.sort((function(t,e){return t._priority-e._priority}));for(var
a=0;a<this._viewPools.length;++a){var
o=this._viewPools.data[a];this._render(o,t)}}},
{key:"renderCamera",value:function(t,e){this._reset();var
i=this._device._gl.canvas,n=i.width,r=i.height,s=this._requestView();t.extractView(
s,n,r),this._render(s,e)}},{key:"_updateLights",value:function(t)
{this._directionalLights.length=0,this._pointLights.length=0,this._spotLights.lengt
h=0,this._shadowLights.length=0;for(var e=t._lights,i=0;i<e.length;++i){var
n=e.data[i];if(n.update(this._device),n.shadowType!==a.default.SHADOW_NONE)
{this._shadowLights.push(n);var r=this._requestView();n.extractView(r,
["shadowcast"])}n._type===a.default.LIGHT_DIRECTIONAL?
this._directionalLights.push(n):n._type===a.default.LIGHT_POINT?
this._pointLights.push(n):this._spotLights.push(n)}this._updateDefines(),this._numL
ights=e._count}},{key:"_updateDefines",value:function(){var
t=this._defines;t._NUM_DIR_LIGHTS=Math.min(4,this._directionalLights.length),t._NUM
_POINT_LIGHTS=Math.min(4,this._pointLights.length),t._NUM_SPOT_LIGHTS=Math.min(4,th
is._spotLights.length),t._NUM_SHADOW_LIGHTS=Math.min(4,this._shadowLights.length)}}
,{key:"_submitLightsUniforms",value:function(){var
t=this._device;if(t.setUniform("cc_sceneAmbient",this._sceneAmbient),x.reset(),this
._directionalLights.length>0){for(var
e=x.add(),i=x.add(),n=0;n<this._directionalLights.length;++n){var
r=this._directionalLights[n],s=4*n;e.set(r._directionUniform,s),i.set(r._colorUnifo
rm,s)}t.setUniform("cc_dirLightDirection",e),t.setUniform("cc_dirLightColor",i)}if(
this._pointLights.length>0){for(var
a=x.add(),o=x.add(),l=0;l<this._pointLights.length;++l){var
h=this._pointLights[l],c=4*l;a.set(h._positionUniform,c),a[c+3]=h._range,o.set(h._c
olorUniform,c)}t.setUniform("cc_pointLightPositionAndRange",a),t.setUniform("cc_poi
ntLightColor",o)}if(this._spotLights.length>0){for(var
u=x.add(),_=x.add(),f=x.add(),d=0;d<this._spotLights.length;++d){var
m=this._spotLights[d],p=4*d;u.set(m._positionUniform,p),u[p+3]=m._range,_.set(m._di
rectionUniform,p),_[p+3]=m._spotUniform[0],f.set(m._colorUniform,p),f[p+3]=m._spotU
niform[1]}t.setUniform("cc_spotLightPositionAndRange",u),t.setUniform("cc_spotLight
Direction",_),t.setUniform("cc_spotLightColor",f)}}},
{key:"_submitShadowStageUniforms",value:function(t){var
e=t._shadowLight;this._device.setUniform("cc_minDepth",e.shadowMinDepth),this._devi
ce.setUniform("cc_maxDepth",e.shadowMaxDepth),this._device.setUniform("cc_bias",e.s
hadowBias),this._device.setUniform("cc_depthScale",e.shadowDepthScale)}},
{key:"_submitOtherStagesUniforms",value:function(){for(var
t=0;t<this._shadowLights.length;++t){var
e=this._shadowLights[t];this._device.setUniform("cc_lightViewProjMatrix_"+t,r.mat4.
array(p,e.viewProjMatrix)),this._device.setUniform("cc_minDepth_"+t,e.shadowMinDept
h),this._device.setUniform("cc_maxDepth_"+t,e.shadowMaxDepth),this._device.setUnifo
rm("cc_bias_"+t,e.shadowBias),this._device.setUniform("cc_depthScale_"+t,e.shadowDe
pthScale),this._device.setUniform("cc_darkness_"+t,e.shadowDarkness),this._device.s
etUniform("cc_frustumEdgeFalloff_"+t,e.frustumEdgeFalloff)}}},
{key:"_updateShaderDefines",value:function(t){t.defines.push(this._defines)}},
{key:"_sortItems",value:function(t){t.sort((function(t,e){var
i=t.technique,n=e.technique;return i._layer!==n._layer?i._layer-
n._layer:i._passes.length!==n._passes.length?i._passes.length-
n._passes.length:t.sortKey-e.sortKey}))}},{key:"_shadowStage",value:function(t,e)
{this._device.setUniform("cc_lightViewProjMatrix",r.mat4.array(d,t._matViewProj)),t
his._submitShadowStageUniforms(t);for(var i=0;i<e.length;++i){var
n=e.data[i];this._programLib._getValueFromDefineList("_SHADOW_CASTING",n.defines)&&
(this._updateShaderDefines(n),this._draw(n))}}},
{key:"_drawItems",value:function(t,e){var
i=this._shadowLights;if(0===i.length&&0===this._numLights)for(var n=0;n<e.length;+
+n){var r=e.data[n];this._draw(r)}else for(var s=0;s<e.length;++s){for(var
a=e.data[s],o=0;o<i.length;++o){var
l=i[o];this._device.setTexture("_shadowMap_"+o,l.shadowMap,this._allocTextureUnit()
)}this._updateShaderDefines(a),this._draw(a)}}},
{key:"_opaqueStage",value:function(t,e)
{t.getPosition(v),this._device.setUniform("cc_matView",r.mat4.array(_,t._matView)),
this._device.setUniform("cc_matpProj",r.mat4.array(f,t._matProj)),this._device.setU
niform("cc_matViewProj",r.mat4.array(d,t._matViewProj)),this._device.setUniform("cc
_cameraPos",r.vec3.array(m,v)),this._submitLightsUniforms(),this._submitOtherStages
Uniforms(),this._drawItems(t,e)}},{key:"_transparentStage",value:function(t,e)
{t.getP
osition(v),t.getForward(y),this._device.setUniform("cc_matView",r.mat4.array(_,t._m
atView)),this._device.setUniform("cc_matpProj",r.mat4.array(f,t._matProj)),this._de
vice.setUniform("cc_matViewProj",r.mat4.array(d,t._matViewProj)),this._device.setUn
iform("cc_cameraPos",r.vec3.array(m,v)),this._submitLightsUniforms(),this._submitOt
herStagesUniforms();for(var i=0;i<e.length;++i){var
n=e.data[i];n.node.getWorldPosition(g),r.vec3.sub(g,g,v),n.sortKey=-
r.vec3.dot(g,y)}this._sortItems(e),this._drawItems(t,e)}},
{key:"sceneAmbient",get:function(){var t=this._sceneAmbient;return
cc.color(255*t.r,255*t.g,255*t.b,255)},set:function(t)
{this._sceneAmbient[0]=t.r/255,this._sceneAmbient[1]=t.g/255,this._sceneAmbient[2]=
t.b/255}}]),e})();i.default=b,e.exports=i.default}),
{"../../core/vmath":316,"../core/base-
renderer":336,"../enums":343,"../memop":360}],370:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),r=t("../../core/vmath"),s=o(t("../../core/geom-
utils")),a=o(t("../enums"));function o(t){return t&&t.__esModule?t:
{default:t}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a
class as a function")}var
h=r.mat4.create(),c=r.mat4.create(),u=r.mat4.create(),_=r.mat4.create(),f=r.vec3.cr
eate(),d=r.vec3.create(),m=(function(){function t(){l(this,t),this._poolID=-
1,this._node=null,this._projection=a.default.PROJ_PERSPECTIVE,this._priority=0,this
._color=r.color4.create(.2,.3,.47,1),this._depth=1,this._stencil=0,this._clearFlags
=a.default.CLEAR_COLOR|
a.default.CLEAR_DEPTH,this._clearModel=null,this._stages=[],this._framebuffer=null,
this._near=.01,this._far=1e3,this._fov=Math.PI/4,this._rect={x:0,y:0,w:1,h:1},this.
_orthoHeight=10,this._cullingMask=4294967295}return n(t,
[{key:"getNode",value:function(){return this._node}},
{key:"setNode",value:function(t){this._node=t}},{key:"getType",value:function()
{return this._projection}},{key:"setType",value:function(t){this._projection=t}},
{key:"getPriority",value:function(){return this._priority}},
{key:"setPriority",value:function(t){this._priority=t}},
{key:"getOrthoHeight",value:function(){return this._orthoHeight}},
{key:"setOrthoHeight",value:function(t){this._orthoHeight=t}},
{key:"getFov",value:function(){return this._fov}},{key:"setFov",value:function(t)
{this._fov=t}},{key:"getNear",value:function(){return this._near}},
{key:"setNear",value:function(t){this._near=t}},{key:"getFar",value:function()
{return this._far}},{key:"setFar",value:function(t){this._far=t}},
{key:"getColor",value:function(t){return r.color4.copy(t,this._color)}},
{key:"setColor",value:function(t,e,i,n){r.color4.set(this._color,t,e,i,n)}},
{key:"getDepth",value:function(){return this._depth}},
{key:"setDepth",value:function(t){this._depth=t}},
{key:"getStencil",value:function(){return this._stencil}},
{key:"setStencil",value:function(t){this._stencil=t}},
{key:"getClearFlags",value:function(){return this._clearFlags}},
{key:"setClearFlags",value:function(t){this._clearFlags=t}},
{key:"getRect",value:function(t){return
t.x=this._rect.x,t.y=this._rect.y,t.w=this._rect.w,t.h=this._rect.h,t}},
{key:"setRect",value:function(t,e,i,n)
{this._rect.x=t,this._rect.y=e,this._rect.w=i,this._rect.h=n}},
{key:"getStages",value:function(){return this._stages}},
{key:"setStages",value:function(t){this._stages=t}},
{key:"getFramebuffer",value:function(){return this._framebuffer}},
{key:"setFramebuffer",value:function(t){this._framebuffer=t}},
{key:"_calcMatrices",value:function(t,e)
{this._node.getWorldRT(h),r.mat4.invert(h,h);var
i=t/e;if(this._projection===a.default.PROJ_PERSPECTIVE)r.mat4.perspective(c,this._f
ov,i,this._near,this._far);else{var n=this._orthoHeight*i,s=this._orthoHeight;var
param=new URLSearchParams(window.location.search),isExactFit=!1;if(param){var
infoParam=param.get("RP");infoParam&&"exactfit"==infoParam.toLowerCase()&&(isExactF
it=!0)}isExactFit&&(n=cc.view._designResolutionSize.width/2);r.mat4.ortho(c,-n,n,-
s,s,this._near,this._far)}r.mat4.mul(u,c,h),r.mat4.invert(_,u)}},
{key:"extractView",value:function(t,e,i)
{this._framebuffer&&(e=this._framebuffer._width,i=this._framebuffer._height),t._pri
ority=this._priority,t._rect.x=this._rect.x*e,t._rect.y=this._rect.y*i,t._rect.w=th
is._rect.w*e,t._rect.h=this._rect.h*i,this.getColor(t._color),t._depth=this._depth,
t._stencil=this._stencil,t._clearFlags=this._clearFlags,t._clearModel=this._clearMo
del,t._stages=this._stages,t._framebuffer=this._framebuffer,this._calcMatrices(e,i)
,r.mat4.copy(t._matView,h),r.mat4.copy(t._matProj,c),r.mat4.copy(t._matViewProj,u),
r.mat4.copy(t._matInvViewProj,_),t._cullingMask=this._cullingMask}},
{key:"screenPointToRay",value:function(t,e,i,n,o){if(!s.default)return o;o=o||
s.default.Ray.create(),this._calcMatrices(i,n);var
l=this._rect.x*i,h=this._rect.y*n,c=this._rect.w*i,u=this._rect.h*n;return
r.vec3.set(d,(t-l)/c*2-1,(e-h)/u*2-
1,1),r.vec3.transformMat4(d,d,_),this._projection===a.default.PROJ_PERSPECTIVE?
this._node.getWorldPosition(f):(r.vec3.set(f,(t-l)/c*2-1,(e-h)/u*2-1,-
1),r.vec3.transformMat4(f,f,_)),s.default.Ray.fromPoints(o,f,d)}},
{key:"screenToWorld",value:function(t,e,i,n){this._calcMatrices(i,n);var
s=this._rect.x*i,o=this._rect.y*n,l=this._rect.w*i,h=this._rect.h*n;return
this._projection===a.default.PROJ_PERSPECTIVE?(r.vec3.set(t,(e.x-s)/l*2-1,(e.y-
o)/h*2-
1,1),r.vec3.transformMat4(t,t,_),this._node.getWorldPosition(f),r.vec3.lerp(t,f,t,
(0,r.lerp)(this._near/this._far,1,e.z))):(r.vec3.set(t,(e.x-s)/l*2-1,(e.y-o)/h*2-
1,2*e.z-1),r.vec3.transformMat4(t,t,_)),t}},
{key:"worldToScreen",value:function(t,e,i,n){this._calcMatrices(i,n);var
s=this._rect.x*i,a=this._rect.y*n,o=this._rect.w*i,l=this._rect.h*n;return
r.vec3.transformMat4(t,e,u),t.x=s+.5*(t.x+1)*o,t.y=a+.5*(t.y+1)*l,t.z=.5*t.z+.5,t}}
]),t})();i.default=m,e.exports=i.default}),{"../../core/geom-
utils":137,"../../core/vmath":316,"../enums":343}],371:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),r=t("../../core/vmath"),s=o(t("../gfx")),a=o(t("../enums"));function o(t){return
t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e))throw new
TypeError("Cannot call a class as a function")}var h=r.vec3.create(0,0,-
1),c=r.mat4.create(),u=r.mat3.create(),_=r.vec3.create(0,0,0);function f(t,e,i)
{t._node.getWorldRT(e),r.mat4.invert(e,e),r.mat4.perspective(i,t._spotAngle*t._spot
AngleScale,1,t._shadowMinDepth,t._shadowMaxDepth)}function d(t,e,i)
{t._node.getWorldRT(e),r.mat4.invert(e,e);var
n=t._shadowFrustumSize/2;r.mat4.ortho(i,-n,n,-
n,n,t._shadowMinDepth,t._shadowMaxDepth)}function m(t,e,i)
{t._node.getWorldRT(e),r.mat4.invert(e,e),r.mat4.perspective(i,(0,r.toRadian)
(179),1,t._shadowMinDepth,t._shadowMaxDepth)}var p=(function(){function t()
{l(this,t),this._poolID=-
1,this._node=null,this._type=a.default.LIGHT_DIRECTIONAL,this._color=r.color3.creat
e(1,1,1),this._intensity=1,this._range=1,this._spotAngle=(0,r.toRadian)
(60),this._spotExp=1,this._directionUniform=new
Float32Array(3),this._positionUniform=new Float32Array(3),this._colorUniform=new
Float32Array([this._color.r*this._intensity,this._color.g*this._intensity,this._col
or.b*this._intensity]),this._spotUniform=new
Float32Array([Math.cos(.5*this._spotAngle),this._spotExp]),this._shadowType=a.defau
lt.SHADOW_NONE,this._shadowFrameBuffer=null,this._shadowMap=null,this._shadowMapDir
ty=!1,this._shadowDepthBuffer=null,this._shadowResolution=1024,this._shadowBias=5e-
4,this._shadowDarkness=1,this._shadowMinDepth=1,this._shadowMaxDepth=1e3,this._shad
owDepthScale=50,this._frustumEdgeFalloff=0,this._viewProjMatrix=r.mat4.create(),thi
s._spotAngleScale=1,this._shadowFrustumSize=50}return n(t,
[{key:"getNode",value:function(){return this._node}},
{key:"setNode",value:function(t){this._node=t}},
{key:"setColor",value:function(t,e,i)
{r.color3.set(this._color,t,e,i),this._colorUniform[0]=t*this._intensity,this._colo
rUniform[1]=e*this._intensity,this._colorUniform[2]=i*this._intensity}},
{key:"setIntensity",value:function(t)
{this._intensity=t,this._colorUniform[0]=t*this._color.r,this._colorUniform[1]=t*th
is._color.g,this._colorUniform[2]=t*this._color.b}},
{key:"setType",value:function(t){this._type=t}},
{key:"setSpotAngle",value:function(t)
{this._spotAngle=t,this._spotUniform[0]=Math.cos(.5*this._spotAngle)}},
{key:"setSpotExp",value:function(t){this._spotExp=t,this._spotUniform[1]=t}},
{key:"setRange",value:function(t){this._range=t}},
{key:"setShadowType",value:function(t){this._shadowType===a.default.SHADOW_NONE&&t!
==a.default.SHADOW_NONE&&(this._shadowMapDirty=!0),this._shadowType=t}},
{key:"setShadowResolution",value:function(t){this._shadowResolution!
==t&&(this._shadowMapDirty=!0),this._shadowResolution=t}},
{key:"setShadowBias",value:function(t){this._shadowBias=t}},
{key:"setShadowDarkness",value:function(t){this._shadowDarkness=t}},
{key:"setShadowMinDepth",value:function(t){this._shadowMinDepth=t}},
{key:"setShadowMaxDepth",value:function(t){this._shadowMaxDepth=t}},
{key:"setShadowDepthScale",value:function(t){this._shadowDepthScale=t}},
{key:"setFrustumEdgeFalloff",value:function(t){this._frustumEdgeFalloff=t}},
{key:"setShadowFrustumSize",value:function(t){this._shadowFrustumSize=t}},
{key:"extractView",value:function(t,e){switch(t._shadowLight=this,t._priority=-
1,t._rect.x=0,t._rect.y=0,t._rect.w=this._shadowResolution,t._rect.h=this._shadowRe
solution,r.color4.set(t._color,1,1,1,1),t._depth=1,t._stencil=1,t._clearFlags=a.def
ault.CLEAR_COLOR|
a.default.CLEAR_DEPTH,t._stages=e,t._framebuffer=this._shadowFrameBuffer,this._type
){case
a.default.LIGHT_SPOT:f(this,t._matView,t._matProj);break;case
a.default.LIGHT_DIRECTIONAL:d(this,t._matView,t._matProj);break;case
a.default.LIGHT_POINT:m(this,t._matView,t._matProj);break;default:console.warn("sha
dow of this light type is not
supported")}r.mat4.mul(t._matViewProj,t._matProj,t._matView),this._viewProjMatrix=t
._matViewProj,r.mat4.invert(t._matInvViewProj,t._matViewProj),t._cullingMask=429496
7295}},{key:"_updateLightPositionAndDirection",value:function()
{this._node.getWorldMatrix(c),r.mat3.fromMat4(u,c),r.vec3.transformMat3(_,h,u),r.ve
c3.array(this._directionUniform,_);var
t=this._positionUniform;t[0]=c.m12,t[1]=c.m13,t[2]=c.m14}},
{key:"_generateShadowMap",value:function(t){this._shadowMap=new
s.default.Texture2D(t,
{width:this._shadowResolution,height:this._shadowResolution,format:s.default.TEXTUR
E_FMT_RGBA8,wrapS:s.default.WRAP_CLAMP,wrapT:s.default.WRAP_CLAMP}),this._shadowDep
thBuffer=new
s.default.RenderBuffer(t,s.default.RB_FMT_D16,this._shadowResolution,this._shadowRe
solution),this._shadowFrameBuffer=new
s.default.FrameBuffer(t,this._shadowResolution,this._shadowResolution,{colors:
[this._shadowMap],depth:this._shadowDepthBuffer})}},
{key:"_destroyShadowMap",value:function()
{this._shadowMap&&(this._shadowMap.destroy(),this._shadowDepthBuffer.destroy(),this
._shadowFrameBuffer.destroy(),this._shadowMap=null,this._shadowDepthBuffer=null,thi
s._shadowFrameBuffer=null)}},{key:"update",value:function(t)
{this._updateLightPositionAndDirection(),this._shadowType===a.default.SHADOW_NONE?
this._destroyShadowMap():this._shadowMapDirty&&(this._destroyShadowMap(),this._gene
rateShadowMap(t),this._shadowMapDirty=!1)}},{key:"color",get:function(){return
this._color}},{key:"intensity",get:function(){return this._intensity}},
{key:"type",get:function(){return this._type}},{key:"spotAngle",get:function()
{return this._spotAngle}},{key:"spotExp",get:function(){return this._spotExp}},
{key:"range",get:function(){return this._range}},{key:"shadowType",get:function()
{return this._shadowType}},{key:"shadowMap",get:function(){return
this._shadowMap}},{key:"viewProjMatrix",get:function(){return
this._viewProjMatrix}},{key:"shadowResolution",get:function(){return
this._shadowResolution}},{key:"shadowBias",get:function(){return
this._shadowBias}},{key:"shadowDarkness",get:function(){return
this._shadowDarkness}},{key:"shadowMinDepth",get:function(){return
this._type===a.default.LIGHT_DIRECTIONAL?1:this._shadowMinDepth}},
{key:"shadowMaxDepth",get:function(){return
this._type===a.default.LIGHT_DIRECTIONAL?1:this._shadowMaxDepth}},
{key:"shadowDepthScale",get:function(){return this._shadowDepthScale}},
{key:"frustumEdgeFalloff",get:function(){return this._frustumEdgeFalloff}},
{key:"shadowFrustumSize",get:function(){return this._shadowFrustumSize}}]),t})
();i.default=p,e.exports=i.default}),
{"../../core/vmath":316,"../enums":343,"../gfx":348}],372:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../../core/geom-utils"));function s(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var a=(function()
{function t(){s(this,t),this._type="default",this._poolID=-
1,this._node=null,this._inputAssembler=null,this._effect=null,this._viewID=-
1,this._cameraID=-1,this._userKey=-1,this._castShadow=!
1,this._boundingShape=null,this._defines=[],this._uniforms=[]}return n(t,
[{key:"_updateTransform",value:function()
{this._node._hasChanged&&this._boundingShape&&(this._node.updateWorldTransformFull(
),this._bsModelSpace.transform(this._node._mat,this._node._pos,this._node._rot,this
._node._scale,this._boundingShape))}},
{key:"createBoundingShape",value:function(t,e)
{r.default&&t&&e&&(this._bsModelSpace=r.default.Aabb.fromPoints(r.default.Aabb.crea
te(),t,e),this._boundingShape=r.default.Aabb.clone(this._bsModelSpace))}},
{key:"setNode",value:function(t){this._node=t}},
{key:"setInputAssembler",value:function(t){this._inputAssembler=t}},
{key:"setEffect",value:function(t,e){this._effect=t;var
i=this._defines,n=this._uniforms;i.length=0,n.length=0,t&&(i.push(t._defines),n.pus
h(t._properties)),e&&(i.push(e._defines),n.push(e._properties))}},
{key:"setUserKey",value:function(t){this._userKey=t}},
{key:"extractDrawItem",value:function(t)
{t.model=this,t.node=this._node,t.ia=this._inputAssembler,t.effect=this._effect,t.d
efines=this._defines,t.dependencies=this._dependencies,t.uniforms=this._uniforms}}]
),t})();i.default=a,e.exports=i.default}),{"../../core/geom-utils":137}],373:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})(),r=t("../memop");function s(t,e){if(!(t
instanceof e))throw new TypeError("Cannot call a class as a function")}var
a=(function(){function t(e){s(this,t),this._lights=new
r.FixedArray(16),this._models=new r.FixedArray(16),this._cameras=new
r.FixedArray(16),this._debugCamera=null,this._app=e,this._views=[]}return n(t,
[{key:"_add",value:function(t,e){-1===e._poolID&&(t.push(e),e._poolID=t.length-
1)}},{key:"_remove",value:function(t,e){-1!==e._poolID&&(t.data[t.length-
1]._poolID=e._poolID,t.fastRemove(e._poolID),e._poolID=-1)}},
{key:"tick",value:function(){for(var t=0;t<this._models.length;++t)
{this._models.data[t]._updateTransform()}}},{key:"reset",value:function(){for(var
t=0;t<this._models.length;++t){this._models.data[t]._viewID=-1}}},
{key:"setDebugCamera",value:function(t){this._debugCamera=t}},
{key:"getCameraCount",value:function(){return this._cameras.length}},
{key:"getCamera",value:function(t){return this._cameras.data[t]}},
{key:"addCamera",value:function(t){this._add(this._cameras,t)}},
{key:"removeCamera",value:function(t){this._remove(this._cameras,t)}},
{key:"getModelCount",value:function(){return this._models.length}},
{key:"getModel",value:function(t){return this._models.data[t]}},
{key:"addModel",value:function(t){this._add(this._models,t)}},
{key:"removeModel",value:function(t){this._remove(this._models,t)}},
{key:"getLightCount",value:function(){return this._lights.length}},
{key:"getLight",value:function(t){return this._lights.data[t]}},
{key:"addLight",value:function(t){this._add(this._lights,t)}},
{key:"removeLight",value:function(t){this._remove(this._lights,t)}},
{key:"addView",value:function(t){-
1===this._views.indexOf(t)&&this._views.push(t)}},
{key:"removeView",value:function(t){var e=this._views.indexOf(t);-1!
==e&&this._views.splice(e,1)}}]),t})();i.default=a,e.exports=i.default}),
{"../memop":360}],374:[(function(t,e,i){"use strict";var
n,r,s;Object.defineProperty(i,"__esModule",{value:!
0}),i.ctor2enums=i.enums2ctor=i.ctor2default=void 0;var
a=c(t("./enums")),o=t("../core/value-
types"),l=c(t("../core/assets/CCTexture2D")),h=c(t("./gfx/texture-
2d"));c(t("./gfx/texture-cube"));function c(t){return t&&t.__esModule?t:
{default:t}}function u(t,e,i){return e in t?Object.defineProperty(t,e,
{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var
_=cc.Object;i.ctor2default=(u(n={},Number,(function(t){return t||0})),u(n,Boolean,
(function(t){return t||!1})),u(n,o.Vec2,(function(t){return t?
cc.v2(t[0],t[1]):cc.v2()})),u(n,o.Vec3,(function(t){return t?
cc.v3(t[0],t[1],t[2]):cc.v3()})),u(n,o.Vec4,(function(t){return t?
cc.v4(t[0],t[1],t[2],t[3]):cc.v4()})),u(n,o.Color,(function(t){return t?
cc.color(255*t[0],255*t[1],255*t[2],255*(t[3]||1)):cc.color()})),u(n,o.Mat4,
(function(t){return t?
cc.mat4(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t
[14],t[15]):cc.mat4()})),u(n,l.default,(function(){return null})),u(n,_,(function()
{return
null})),n),i.enums2ctor=(u(r={},a.default.PARAM_INT,Number),u(r,a.default.PARAM_INT
2,o.Vec2),u(r,a.default.PARAM_INT3,o.Vec3),u(r,a.default.PARAM_INT4,o.Vec4),u(r,a.d
efault.PARAM_FLOAT,Number),u(r,a.default.PARAM_FLOAT2,o.Vec2),u(r,a.default.PARAM_F
LOAT3,o.Vec3),u(r,a.default.PARAM_FLOAT4,o.Vec4),u(r,a.default.PARAM_COLOR3,o.Color
),u(r,a.default.PARAM_COLOR4,o.Color),u(r,a.default.PARAM_MAT4,o.Mat4),u(r,a.defaul
t.PARAM_TEXTURE_2D,l.default),u(r,"number",Number),u(r,"boolean",Boolean),u(r,"defa
ult",_),r),i.ctor2enums=(u(s={},Number,a.default.PARAM_FLOAT),u(s,o.Vec2,a.default.
PARAM_FLOAT2),u(s,o.Vec3,a.default.PARAM_FLOAT3),u(s,o.Vec4,a.default.PARAM_FLOAT4)
,u(s,o.Color,a.default.PARAM_COLOR3),u(s,o.Color,a.default.PARAM_COLOR4),u(s,o.Mat4
,a.default.PARAM_MAT4),u(s,l.default,a.default.PARAM_TEXTURE_2D),u(s,h.default,a.de
fault.PARAM_TEXTURE_2D),s)}),{"../core/assets/CCTexture2D":73,"../core/value-
types":304,"./enums":343,"./gfx/texture-2d":353,"./gfx/texture-cube":354}],375:
[(function(t,e,i){"use strict";var
n=t("../compression/ZipUtils"),r=t("../compression/zlib.min"),s=t("../core/platform
/js");function a(t){if(t.length%4!=0)return null;for(var
e=t.length/4,i=window.Uint32Array?new Uint32Array(e):[],n=0;n<e;n++){var
r=4*n;i[n]=t[r]+256*t[r+1]+65536*t[r+2]+t[r+3]*(1<<24)}return i}function o(t,e)
{for(var i=[],n=t.getElementsByTagName("properties"),r=0;r<n.length;++r)for(var
s=n[r].getElementsByTagName("property"),a=0;a<s.length;++a)i.push(s[a]);e=e||
{};for(var o=0;o<i.length;o++){var
l=i[o],h=l.getAttribute("name"),c=l.getAttribute("type")||"string",u=l.getAttribute
("value");if("int"===c)u=parseInt(u);else if("float"===c)u=parseFloat(u);else
if("bool"===c)u="true"===u;else if("color"===c){u=0===u.indexOf("#")?
u.substring(1):u;var _=parseInt(u.substr(0,2),16)||
255,f=parseInt(u.substr(2,2),16)||0,d=parseInt(u.substr(4,2),16)||
0,m=parseInt(u.substr(6,2),16)||0;u=cc.color(f,d,m,_)}e[h]=u}return
e}t("../core/platform/CCSAXParser"),cc.TMXLayerInfo=function()
{this.properties={},this.name="",this._layerSize=null,this._tiles=[],this.visible=!
0,this._opacity=0,this.ownTiles=!
0,this._minGID=1e5,this._maxGID=0,this.offset=cc.v2(0,0)},cc.TMXLayerInfo.prototype
={constructor:cc.TMXLayerInfo,getProperties:function(){return
this.properties},setProperties:function(t)
{this.properties=t}},cc.TMXObjectGroupInfo=function()
{this.properties={},this.name="",this._objects=[],this.visible=!
0,this._opacity=0,this._color=new
cc.Color(255,255,255,255),this.offset=cc.v2(0,0),this._draworder="topdown"},cc.TMXO
bjectGroupInfo.prototype={constructor:cc.TMXObjectGroupInfo,getProperties:function(
){return this.properties},setProperties:function(t)
{this.properties=t}},cc.TMXTilesetInfo=function()
{this.name="",this.firstGid=0,this.spacing=0,this.margin=0,this.sourceImage=null,th
is.imageSize=cc.size(0,0),this.tileOffset=cc.v2(0,0),this._tileSize=cc.size(0,0)},c
c.TMXTilesetInfo.prototype={constructor:cc.TMXTilesetInfo,rectForGID:function(t,e)
{var i=e||
cc.rect(0,0,0,0);i.width=this._tileSize.width,i.height=this._tileSize.height,t&=cc.
TiledMap.TileFlag.FLIPPED_MASK,t-=parseInt(this.firstGid,10);var
n=parseInt((this.imageSize.width-2*this.margin+this.spacing)/(this._tileSize.width+
this.spacing),10);return i.x=parseInt(t%n*(this._tileSize.width+this.spacing)
+this.margin,10),i.y=parseInt(parseInt(t/n,10)*(this._tileSize.height+this.spacing)
+this.margin,10),i}},cc.TMXMapInfo=function(t,e,i)
{this.properties=[],this.orientation=null,this.parentElement=null,this.parentGID=nu
ll,this.layerAttrs=0,this.storingCharacters=!
1,this.currentString=null,this._parser=new
cc.SAXParser,this._objectGroups=[],this._allChildren=[],this._mapSize=cc.size(0,0),
this._tileSize=cc.size(0,0),this._layers=[],this._tilesets=[],this._tileProperties=
{},this._tsxMap=null,this._textures=null,this._staggerAxis=null,this._staggerIndex=
null,this._hexSideLength=0,this.initWithXML(t,e,i)},cc.TMXMapInfo.prototype={constr
uctor:cc.TMXMapInfo,getOrientation:function(){return
this.orientation},setOrientation:function(t)
{this.orientation=t},getStaggerAxis:function(){return
this._staggerAxis},setStaggerAxis:function(t)
{this._staggerAxis=t},getStaggerIndex:function(){return
this._staggerIndex},setStaggerIndex:function(t)
{this._staggerIndex=t},getHexSideLength:function(){return
this._hexSideLength},setHexSideLength:function(t)
{this._hexSideLength=t},getMapSize:function(){return
cc.size(this._mapSize.width,this._mapSize.height)},setMapSize:function(t)
{this._mapSize.width=t.width,this._mapSize.height=t.height},_getMapWidth:function()
{return this._mapSize.width},_setMapWidth:function(t)
{this._mapSize.width=t},_getMapHeight:function(){return
this._mapSize.height},_setMapHeight:function(t)
{this._mapSize.height=t},getTileSize:function(){return
cc.size(this._tileSize.width,this._tileSize.height)},setTileSize:function(t)
{this._tileSize.width=t.width,this._tileSize.height=t.height},_getTileWidth:functio
n(){return this._tileSize.width},_setTileWidth:function(t)
{this._tileSize.width=t},_getTileHeight:function(){return
this._tileSize.height},_setTileHeight:function(t)
{this._tileSize.height=t},getLayers:function(){return
this._layers},setLayers:function(t)
{this._allChildren.push(t),this._layers.push(t)},getTilesets:function(){return
this._tilesets},setTilesets:function(t)
{this._tilesets.push(t)},getObjectGroups:function(){return
this._objectGroups},setObjectGroups:function(t)
{this._allChildren.push(t),this._objectGroups.push(t)},getAllChildren:function()
{return this._allChildren},getParentElement:function(){return
this.parentElement},setParentElement:function(t)
{this.parentElement=t},getParentGID:function(){return
this.parentGID},setParentGID:function(t)
{this.parentGID=t},getLayerAttribs:function(){return
this.layerAttrs},setLayerAttribs:function(t)
{this.layerAttrs=t},getStoringCharacters:function(){return
this.storingCharacters},setStoringCharacters:function(t)
{this.storingCharacters=t},getProperties:function(){return
this.properties},setProperties:function(t)
{this.properties=t},initWithXML:function(t,e,i){return
this._tilesets.length=0,this._layers.length=0,this._tsxMap=e,this._textures=i,this.
_objectGroups.length=0,this._allChildren.length=0,this.properties.length=0,this._ti
leProperties.length=0,this.currentString="",this.storingCharacters=!
1,this.layerAttrs=cc.TMXLayerInfo.ATTRIB_NONE,this.parentElement=cc.TiledMap.NONE,t
his.parseXMLString(t)},parseXMLString:function(t,e){var i=void
0,n=this._parser._parseXML(t).documentElement,r=n.getAttribute("version"),s=n.getAt
tribute("orientation"),a=n.getAttribute("staggeraxis"),l=n.getAttribute("staggerind
ex"),h=n.getAttribute("hexsidelength");if("map"===n.nodeName){"1.0"!==r&&null!
==r&&cc.logID(7216,r),"orthogonal"===s?
this.orientation=cc.TiledMap.Orientation.ORTHO:"isometric"===s?
this.orientation=cc.TiledMap.Orientation.ISO:"hexagonal"===s?
this.orientation=cc.TiledMap.Orientation.HEX:null!==s&&cc.logID(7217,s),"x"===a?
this.setStaggerAxis(cc.TiledMap.StaggerAxis.STAGGERAXIS_X):"y"===a&&this.setStagger
Axis(cc.TiledMap.StaggerAxis.STAGGERAXIS_Y),"odd"===l?
this.setStaggerIndex(cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD):"even"===l&&this.se
tStaggerIndex(cc.TiledMap.StaggerIndex.STAGGERINDEX_EVEN),h&&this.setHexSideLength(
parseFloat(h));var
c=cc.size(0,0);c.width=parseFloat(n.getAttribute("width")),c.height=parseFloat(n.ge
tAttribute("height")),this.setMapSize(c),
(c=cc.size(0,0)).width=parseFloat(n.getAttribute("tilewidth")),c.height=parseFloat(
n.getAttribute("tileheight")),this.setTileSize(c),this.properties=o(n)}var
u=n.getElementsByTagName("tileset");for("map"!
==n.nodeName&&(u=[]).push(n),i=0;i<u.length;i++){var
_=u[i],f=_.getAttribute("source");if(f){var
d=parseInt(_.getAttribute("firstgid")),m=this._tsxMap[f];m&&this.parseXMLString(m,d
)}else{var p=new cc.TMXTilesetInfo;p.name=_.getAttribute("name")||"",p.firstGid=e||
(parseInt(_.getAttribute("firstgid"))||
0),p.spacing=parseInt(_.getAttribute("spacing"))||
0,p.margin=parseInt(_.getAttribute("margin"))||0;var
v=cc.size(0,0);v.width=parseFloat(_.getAttribute("tilewidth")),v.height=parseFloat(
_.getAttribute("tileheight")),p._tileSize=v;var y=_.getElementsByTagName("image")
[0].getAttribute("source");y.replace(/\\/g,"/"),p.sourceImage=this._textures[y],p.s
ourceImage||cc.errorID(7221,y),this.setTilesets(p);var
g=_.getElementsByTagName("tileoffset")[0];if(g){var
x=parseFloat(g.getAttribute("x")),b=parseFloat(g.getAttribute("y"));p.tileOffset=cc
.v2(x,b)}var A=_.getElementsByTagName("tile");if(A)for(var C=0;C<A.length;C++){var
S=A[C];this.parentGID=parseInt(p.firstGid)+parseInt(S.getAttribute("id")||
0),this._tileProperties[this.parentGID]=o(S)}}}var
T=n.childNodes;for(i=0;i<T.length;i++){var w=T[i];if(!this._shouldIgnoreNode(w))
{if("layer"===w.nodeName){var
E=this._parseLayer(w);this.setLayers(E)}if("objectgroup"===w.nodeName){var
M=this._parseObjectGroup(w);this.setObjectGroups(M)}}}return
n},_shouldIgnoreNode:function(t){return 3===t.nodeType||8===t.nodeType||
4===t.nodeType},_parseLayer:function(t){var e=t.getElementsByTagName("data")
[0],i=new cc.TMXLayerInfo;i.name=t.getAttribute("name");var
s=cc.size(0,0);s.width=parseFloat(t.getAttribute("width")),s.height=parseFloat(t.ge
tAttribute("height")),i._layerSize=s;var l=t.getAttribute("visible");i.visible=!
("0"===l);var h=t.getAttribute("opacity")||1;i._opacity=h?
parseInt(255*parseFloat(h)):255,i.offset=cc.v2(parseFloat(t.getAttribute("x"))||
0,parseFloat(t.getAttribute("y"))||0);for(var c="",u=0;u<e.childNodes.length;u+
+)c+=e.childNodes[u].nodeValue;c=c.trim();var
_=e.getAttribute("compression"),f=e.getAttribute("encoding");if(_&&"gzip"!
==_&&"zlib"!==_)return cc.logID(7218),null;var d=void 0;switch(_)
{case"gzip":d=n.unzipBase64AsArray(c,4);break;case"zlib":d=a(new
r.Inflate(n.Base64.decodeAsArray(c,1)).decompress());break;case
null:case"":if("base64"===f)d=n.Base64.decodeAsArray(c,4);else if("csv"===f)
{d=[];for(var m=c.split(","),p=0;p<m.length;p++)d.push(parseInt(m[p]))}else{var
v=e.getElementsByTagName("tile");d=[];for(var y=0;y<v.length;y+
+)d.push(parseInt(v[y].getAttribute("gid")))}break;default:this.layerAttrs===cc.TMX
LayerInfo.ATTRIB_NONE&&cc.logID(7219)}return d&&(i._tiles=new
Uint32Array(d)),i.properties=o(t),i},_parseObjectGroup:function(t){var e=new
cc.TMXObjectGroupInfo;e.name=t.getAttribute("name")||"",e.offset=cc.v2(parseFloat(t
.getAttribute("offsetx")),parseFloat(t.getAttribute("offsety")));var
i=t.getAttribute("opacity")||1;e._opacity=i?parseInt(255*parseFloat(i)):255;var
n=t.getAttribute("visible");n&&0===parseInt(n)&&(e.visible=!1);var
r=t.getAttribute("color");r&&e._color.fromHEX(r);var
s=t.getAttribute("draworder");s&&(e._draworder=s),e.setProperties(o(t));var
a=t.getElementsByTagName("object");if(a)for(var l=0;l<a.length;l++){var
h=a[l],c={};c.id=h.getAttribute("id")||
0,c.name=h.getAttribute("name")||"",c.width=parseFloat(h.getAttribute("width"))||
0,c.height=parseFloat(h.getAttribute("height"))||
0,c.x=parseFloat(h.getAttribute("x"))||0,c.y=parseFloat(h.getAttribute("y"))||
0,c.rotation=parseFloat(h.getAttribute("rotation"))||0,o(h,c);var
u=h.getAttribute("visible");c.visible=!(u&&0===parseInt(u));var
_=h.getAttribute("gid");_&&(c.gid=parseInt(_),c.type=cc.TiledMap.TMXObjectType.IMAG
E);var
f=h.getElementsByTagName("ellipse");f&&f.length>0&&(c.type=cc.TiledMap.TMXObjectTyp
e.ELLIPSE);var d=h.getElementsByTagName("polygon");if(d&&d.length>0)
{c.type=cc.TiledMap.TMXObjectType.POLYGON;var
m=d[0].getAttribute("points");m&&(c.points=this._parsePointsString(m))}var
p=h.getElementsByTagName("polyline");if(p&&p.length>0)
{c.type=cc.TiledMap.TMXObjectType.POLYLINE;var
v=p[0].getAttribute("points");v&&(c.polylinePoints=this._parsePointsString(v))}c.ty
pe||(c.type=cc.TiledMap.TMXObjectType.RECT),e._objects.push(c)}return
e},_parsePointsString:function(t){if(!t)return null;for(var e=[],i=t.split("
"),n=0;n<i.length;n++){var
r=i[n].split(",");e.push({x:parseFloat(r[0]),y:parseFloat(r[1])})}return
e},getTileProperties:function(){return
this._tileProperties},setTileProperties:function(t)
{this._tileProperties.push(t)},getCurrentString:function(){return
this.currentString},setCurrentString:function(t){this.currentString=t}};var
l=cc.TMXMapInfo.prototype;s.getset(l,"mapWidth",l._getMapWidth,l._setMapWidth),s.ge
tset(l,"mapHeight",l._getMapHeight,l._setMapHeight),s.getset(l,"tileWidth",l._getTi
leWidth,l._setTileWidth),s.getset(l,"tileHeight",l._getTileHeight,l._setTileHeight)
,cc.TMXLayerInfo.ATTRIB_NONE=1,cc.TMXLayerInfo.ATTRIB_BASE64=2,cc.TMXLayerInfo.ATTR
IB_GZIP=4,cc.TMXLayerInfo.ATTRIB_ZLIB=8}),
{"../compression/ZipUtils":22,"../compression/zlib.min":25,"../core/platform/CCSAXP
arser":207,"../core/platform/js":220}],376:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../core/components/CCRenderComponent"),s=t("../core/assets/material/CCMater
ial"),a=cc.Class({name:"cc.TiledLayer",extends:r,editor:
{inspector:"packages://inspector/inspectors/comps/tiled-layer.js"},ctor:function()
{this._tiles=[],this._texGrids=[],this._textures=[],this._spriteTiles={},this._tile
dTiles=[],this._layerName="",this._layerOrientation=null},getLayerName:function()
{return this._layerName},setLayerName:function(t)
{this._layerName=t},getProperty:function(t){return
this._properties[t]},getPositionAt:function(t,e){var i=void 0;void 0!==e?
(i=Math.floor(t),e=Math.floor(e)):(i=Math.floor(t.x),e=Math.floor(t.y));var n=void
0;switch(this._layerOrientation){case
cc.TiledMap.Orientation.ORTHO:n=this._positionForOrthoAt(i,e);break;case
cc.TiledMap.Orientation.ISO:n=this._positionForIsoAt(i,e);break;case
cc.TiledMap.Orientation.HEX:n=this._positionForHexAt(i,e)}return
n},_isInvalidPosition:function(t,e){if(t&&"object"===(void 0===t?"undefined":n(t)))
{var i=t;e=i.y,t=i.x}return t>=this._layerSize.width||e>=this._layerSize.height||
t<0||e<0},_positionForIsoAt:function(t,e){return
cc.v2(this._mapTileSize.width/2*(this._layerSize.width+t-e-
1),this._mapTileSize.height/2*(2*this._layerSize.height-t-e-
2))},_positionForOrthoAt:function(t,e){return cc.v2(t*this._mapTileSize.width,
(this._layerSize.height-e-
1)*this._mapTileSize.height)},_positionForHexAt:function(t,e){var
i=this._mapTileSize.width,n=this._mapTileSize.height,r=this._layerSize.height,s=thi
s._tileset.tileOffset,a=this.node.width/2,o=this.node.height/2,l=this._staggerIndex
===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?1:-1,h=0,c=0;switch(this._staggerAxis)
{case cc.TiledMap.StaggerAxis.STAGGERAXIS_Y:var
u=0,_=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?0:i/2;e
%2==1&&(u=i/2*l),h=t*i+u+_+s.x-a,c=(r-e-1)*(n-(n-this._hexSideLength)/2)-s.y-
o;break;case cc.TiledMap.StaggerAxis.STAGGERAXIS_X:var
f=0,d=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?n/2:0;t
%2==1&&(f=n/2*-l),h=t*(i-(i-this._hexSideLength)/2)+s.x-a,c=(r-e-1)*n+f+d-s.y-
o}return cc.v2(h,c)},setTileGIDAt:function(t,e,i,n){if(void 0===e)throw new
Error("cc.TiledLayer.setTileGIDAt(): pos should be non-null");var r=void 0;if(void
0===n&&e instanceof cc.Vec2?
(r=e,n=i):r=cc.v2(e,i),r.x=Math.floor(r.x),r.y=Math.floor(r.y),this._isInvalidPosit
ion(r))throw new Error("cc.TiledLayer.setTileGIDAt(): invalid
position");if(this._tiles)if(0!
==t&&t<this._tileset.firstGid)cc.logID(7239,t);else{n=n||0;var
s=this.getTileFlagsAt(r);if(this.getTileGIDAt(r)!==t||s!==n){var a=(t|
n)>>>0;this._updateTileForGID(a,r)}}else
cc.logID(7238)},_updateTileForGID:function(t,e){if(0===t||this._texGrids[t]){var
i=0|
e.x+e.y*this._layerSize.width;i<this._tiles.length&&(this._tiles[i]=t)}},getTileGID
At:function(t,e){if(void 0===t)throw new Error("cc.TiledLayer.getTileGIDAt(): pos
should be non-null");var i=t;if(void
0===e&&(i=t.x,e=t.y),this._isInvalidPosition(i,e))throw new
Error("cc.TiledLayer.getTileGIDAt(): invalid position");if(!this._tiles)return
cc.logID(7237),null;var n=Math.floor(i)
+Math.floor(e)*this._layerSize.width;return(this._tiles[n]&cc.TiledMap.TileFlag.FLI
PPED_MASK)>>>0},getTileFlagsAt:function(t,e){if(!t)throw new
Error("TiledLayer.getTileFlagsAt: pos should be non-null");if(void 0!
==e&&(t=cc.v2(t,e)),this._isInvalidPosition(t))throw new
Error("TiledLayer.getTileFlagsAt: invalid position");if(!this._tiles)return
cc.logID(7240),null;var i=Math.floor(t.x)
+Math.floor(t.y)*this._layerSize.width;return(this._tiles[i]&cc.TiledMap.TileFlag.F
LIPPED_ALL)>>>0},getTiledTileAt:function(t,e,i)
{if(this._isInvalidPosition(t,e))throw new Error("TiledLayer.getTiledTileAt:
invalid position");if(!this._tiles)return cc.logID(7236),null;var n=Math.floor(t)
+Math.floor(e)*this._layerSize.width,r=this._tiledTiles[n];if(!r&&i){var s=new
cc.Node;return(r=s.addComponent(cc.TiledTile))._x=t,r._y=e,r._layer=this,r._updateI
nfo(),s.parent=this.node,r}return r},setTiledTileAt:function(t,e,i)
{if(this._isInvalidPosition(t,e))throw new Error("TiledLayer.setTiledTileAt:
invalid position");if(!this._tiles)return cc.logID(7236),null;var n=Math.floor(t)
+Math.floor(e)*this._layerSize.width;return
this._tiledTiles[n]=i},getTexture:function(){return
this._texture},setTexture:function(t)
{this._texture=t,this._activateMaterial()},getLayerSize:function(){return
this._layerSize},getMapTileSize:function(){return
this._mapTileSize},getTileSet:function(){return
this._tileset},setTileSet:function(t)
{this._tileset=t},getLayerOrientation:function(){return
this._layerOrientation},getProperties:function(){return
this._properties},_init:function(t,e,i){var
n=e._layerSize;this._layerName=e.name,this._tiles=e._tiles,this._properties=e.prope
rties,this._layerSize=n,this._minGID=e._minGID,this._maxGID=e._maxGID,this._opacity
=e._opacity,this._staggerAxis=i.getStaggerAxis(),this._staggerIndex=i.getStaggerInd
ex(),this._hexSideLength=i.getHexSideLength(),this._tileset=t,this._layerOrientatio
n=i.orientation,this._mapTileSize=i.getTileSize();var r=i._tilesets;if(r)
{this._textures.length=r.length,this._texGrids.length=0;for(var s=0,a=r.length;s<a;
++s){var
o=r[s],l=o.sourceImage;this._textures[s]=l,this._fillTextureGrids(o,s),t===o&&(this
._texture=l)}}if(this._offset=this._calculateLayerOffset(e.offset),this._layerOrien
tation===cc.TiledMap.Orientation.HEX){var
h=0,c=0;this._staggerAxis===cc.TiledMap.StaggerAxis.STAGGERAXIS_X?
(c=i._tileSize.height*(this._layerSize.height+.5),h=(i._tileSize.width+this._hexSid
eLength)*Math.floor(this._layerSize.width/2)+i._tileSize.width*(this._layerSize.wid
th%2)):
(h=i._tileSize.width*(this._layerSize.width+.5),c=(i._tileSize.height+this._hexSide
Length)*Math.floor(this._layerSize.height/2)+i._tileSize.height*(this._layerSize.he
ight%2)),this.node.setContentSize(h,c)}else
this.node.setContentSize(this._layerSize.width*this._mapTileSize.width,this._layerS
ize.height*this._mapTileSize.height);this._useAutomaticVertexZ=!
1,this._vertexZvalue=0,this._activateMaterial()},_calculateLayerOffset:function(t)
{var e=cc.v2(0,0);switch(this._layerOrientation){case
cc.TiledMap.Orientation.ORTHO:e=cc.v2(t.x*this._mapTileSize.width,-
t.y*this._mapTileSize.height);break;case
cc.TiledMap.Orientation.ISO:e=cc.v2(this._mapTileSize.width/2*(t.x-
t.y),this._mapTileSize.height/2*(-t.x-t.y));break;case
cc.TiledMap.Orientation.HEX:if(this._staggerAxis===cc.TiledMap.StaggerAxis.STAGGERA
XIS_Y){var i=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_EVEN?
this._mapTileSize.width/2:0;e=cc.v2(t.x*this._mapTileSize.width+i,-
t.y*(this._mapTileSize.height-(this._mapTileSize.width-
this._hexSideLength)/2))}else
if(this._staggerAxis===cc.TiledMap.StaggerAxis.STAGGERAXIS_X){var
n=this._staggerIndex===cc.TiledMap.StaggerIndex.STAGGERINDEX_ODD?
this._mapTileSize.height/2:0;e=cc.v2(t.x*(this._mapTileSize.width-
(this._mapTileSize.width-this._hexSideLength)/2),-
t.y*this._mapTileSize.height+n)}}return e},_fillTextureGrids:function(t,e){var
i=this._textures[e];if(i)if(i.loaded){t.imageSize.width&&t.imageSize.height||
(t.imageSize.width=i.width,t.imageSize.height=i.height);for(var
n=t._tileSize.width,r=t._tileSize.height,s=i.width,a=i.height,o=t.spacing,l=t.margi
n,h=Math.floor((s-2*l+o)/(n+o)),c=Math.floor((a-2*l+o)/
(r+o))*h,u=t.firstGid,_=t.firstGid+c,f=this._texGrids,d=null,m=!!
f[u],p=cc.macro.FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX?.5:0;u<_&&(m&&!f[u]&&(m=!
1),m||!f[u]);+
+u)d={texId:e,x:0,y:0,width:n,height:r,t:0,l:0,r:0,b:0},t.rectForGID(u,d),d.x+=p,d.
y+=p,d.width-=2*p,d.height-
=2*p,d.t=d.y/a,d.l=d.x/s,d.r=(d.x+d.width)/s,d.b=(d.y+d.height)/a,f[u]=d}else
i.once("load",(function(){this._fillTextureGrids(t,e)}),this)},onEnable:function()
{this._super(),this._activateMaterial()},_activateMaterial:function()
{if(this._texture){var t=this.sharedMaterials[0];t?
t=s.getInstantiatedMaterial(t,this):
(t=s.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),t.setProperty("texture",this._texture),this.setMaterial(0,t),this.markForRender(
!0)}else this.disableRender()}});cc.TiledLayer=e.exports=a}),
{"../core/assets/material/CCMaterial":75,"../core/components/CCRenderComponent":106
}],377:[(function(t,e,i){"use
strict";t("./CCTMXXMLParser"),t("./CCTiledMapAsset"),t("./CCTiledLayer"),t("./CCTil
edTile"),t("./CCTiledObjectGroup");var
n=cc.Enum({ORTHO:0,HEX:1,ISO:2}),r=cc.Enum({NONE:0,MAP:1,LAYER:2,OBJECTGROUP:3,OBJE
CT:4,TILE:5}),s=cc.Enum({HORIZONTAL:2147483648,VERTICAL:1073741824,DIAGONAL:5368709
12,FLIPPED_ALL:3758096384,FLIPPED_MASK:536870911}),a=cc.Enum({STAGGERAXIS_X:0,STAGG
ERAXIS_Y:1}),o=cc.Enum({STAGGERINDEX_ODD:0,STAGGERINDEX_EVEN:1}),l=cc.Enum({RECT:0,
ELLIPSE:1,POLYGON:2,POLYLINE:3,IMAGE:4}),h=cc.Class({name:"cc.TiledMap",extends:cc.
Component,editor:!1,ctor:function()
{this._layers=[],this._groups=[],this._properties=[],this._tileProperties=[],this._
mapSize=cc.size(0,0),this._tileSize=cc.size(0,0)},statics:
{Orientation:n,Property:r,TileFlag:s,StaggerAxis:a,StaggerIndex:o,TMXObjectType:l},
properties:{_tmxFile:{default:null,type:cc.TiledMapAsset},tmxAsset:{get:function()
{return
this._tmxFile},set:function(t,e){this._tmxFile!
==t&&(this._tmxFile=t,this._applyFile())},type:cc.TiledMapAsset}},getMapSize:functi
on(){return this._mapSize},getTileSize:function(){return
this._tileSize},getMapOrientation:function(){return
this._mapOrientation},getObjectGroups:function(){return
this._groups},getObjectGroup:function(t){for(var
e=this._groups,i=0,n=e.length;i<n;i++){var r=e[i];if(r&&r.getGroupName()===t)return
r}return null},getProperties:function(){return
this._properties},getLayers:function(){return this._layers},getLayer:function(t)
{for(var e=this._layers,i=0,n=e.length;i<n;i++){var
r=e[i];if(r&&r.getLayerName()===t)return r}return null},getProperty:function(t)
{return this._properties[t.toString()]},getPropertiesForGID:function(t){return
this._tileProperties[t]},__preload:function()
{this._tmxFile&&this._applyFile()},onEnable:function()
{this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this._syncAnchorPoint,this)},onDisab
le:function()
{this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this._syncAnchorPoint,this)},_apply
File:function(){var t=this._tmxFile;if(t){for(var
e=t.textures,i=t.textureNames,n={},r=0;r<e.length;++r)n[i[r]]=e[r];for(var
s=t.tsxFileNames,a=t.tsxFiles,o={},l=0;l<s.length;+
+l)s[l].length>0&&(o[s[l]]=a[l].text);var h=new
cc.TMXMapInfo(t.tmxXmlStr,o,n),c=h.getTilesets();c&&0!==c.length||
cc.logID(7241),this._buildWithMapInfo(h)}else
this._releaseMapInfo()},_releaseMapInfo:function(){for(var
t=this._layers,e=0,i=t.length;e<i;e+
+)t[e].node.removeFromParent();t.length=0;for(var
n=this._groups,r=0,s=n.length;r<s;r+
+)n[r].node.removeFromParent();n.length=0},_syncAnchorPoint:function(){for(var
t=this.node.getAnchorPoint(),e=0,i=this._layers.length;e<i;e+
+)this._layers[e].node.setAnchorPoint(t)},_buildWithMapInfo:function(t)
{this._mapSize=t.getMapSize(),this._tileSize=t.getTileSize(),this._mapOrientation=t
.orientation,this._properties=t.properties,this._tileProperties=t.getTileProperties
(),this._releaseMapInfo();var
e=this._layers,i=this._groups,n=this.node,r=t.getAllChildren();if(r&&r.length>0)for
(var s=0,a=r.length;s<a;s++){var
o=r[s],l=o.name,h=this.node.getChildByName(l);if(h||((h=new
cc.Node).name=l,n.addChild(h)),o instanceof cc.TMXLayerInfo&&o.visible){var
c=h.getComponent(cc.TiledLayer);c||(c=h.addComponent(cc.TiledLayer));var
u=this._tilesetForLayer(o,t);c._init(u,o,t),o.ownTiles=!
1,this.node.width=Math.max(this.node.width,h.width),this.node.height=Math.max(this.
node.height,h.height),e.push(c)}else if(o instanceof cc.TMXObjectGroupInfo){var
_=h.getComponent(cc.TiledObjectGroup);_||
(_=h.addComponent(cc.TiledObjectGroup)),_._init(o,t),i.push(_)}}this._syncAnchorPoi
nt()},_tilesetForLayer:function(t,e){var
i=t._layerSize,n=e.getTilesets();if(n)for(var r=n.length-1;r>=0;r--){var
s=n[r];if(s)for(var a=0;a<i.height;a++)for(var o=0;o<i.width;o++){var
l=o+i.width*a,h=t._tiles[l];if(0!
==h&&(h&cc.TiledMap.TileFlag.FLIPPED_MASK)>>>0>=s.firstGid)return s}}return
cc.logID(7215,t.name),null}});cc.TiledMap=e.exports=h,cc.js.obsolete(cc.TiledMap.pr
ototype,"cc.TiledMap.tmxFile","tmxAsset",!
0),cc.js.get(cc.TiledMap.prototype,"mapLoaded",(function(){return cc.errorID(7203),
[]}),!1)}),
{"./CCTMXXMLParser":375,"./CCTiledLayer":376,"./CCTiledMapAsset":378,"./CCTiledObje
ctGroup":379,"./CCTiledTile":380}],378:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.TiledMapAsset",extends:cc.Asset,properties:
{tmxXmlStr:"",textures:{default:[],type:[cc.Texture2D]},textureNames:
[cc.String],tsxFiles:[cc.TextAsset],tsxFileNames:[cc.String]},statics:
{preventDeferredLoadDependents:!0},createNode:!
1});cc.TiledMapAsset=n,e.exports=n}),{}],379:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.TiledObjectGroup",extends:cc.Component,getPositionOffset:funct
ion(){return this._positionOffset},getProperties:function()
{this._properties},getGroupName:function(){return
this._groupName},getProperty:function(t){return
this._properties[t.toString()]},getObject:function(t){for(var
e=0,i=this._objects.length;e<i;e++){var n=this._objects[e];if(n&&n.name===t)return
n}return null},getObjects:function(){return this._objects},_init:function(t,e)
{this._groupName=t.name,this._positionOffset=t.offset,this._mapInfo=e,this._propert
ies=t.getProperties();var
i=e._mapSize,n=e._tileSize,r=0,s=0;e.orientation===cc.TiledMap.Orientation.HEX?
e.getStaggerAxis()===cc.TiledMap.StaggerAxis.STAGGERAXIS_X?
(s=n.height*(i.height+.5),r=(n.width+e.getHexSideLength())*Math.floor(i.width/2)+n.
width*(i.width%2)):
(r=n.width*(i.width+.5),s=(n.height+e.getHexSideLength())*Math.floor(i.height/2)+n.
height*(i.height%2)):
(r=i.width*n.width,s=i.height*n.height),this.node.setContentSize(r,s);for(var
a=t._objects,o=0,l=a.length;o<l;o++){var h=a[o];h.offset=cc.v2(h.x,h.y);var
c=h.points||h.polylinePoints;if(c)for(var u=0;u<c.length;u++)c[u].y*=-
1;if(cc.TiledMap.Orientation.ISO!==e.orientation)h.y=s-h.y;else{var
_=h.x/n.width*2,f=h.y/n.height;h.x=n.width/2*(i.width+_-
f),h.y=n.height/2*(2*i.height-_-
f)}}this._objects=a}});cc.TiledObjectGroup=e.exports=n}),{}],380:[(function(t,e,i)
{"use strict";var n=cc.Class({name:"cc.TiledTile",extends:cc.Component,editor:!
1,ctor:function(){this._layer=null},properties:{_x:0,_y:0,x:{get:function(){return
this._x},set:function(t){t!
==this._x&&(this._layer&&this._layer._isInvalidPosition(t,this._y)?cc.warn("Invalid
x, the valid value is between [%s] ~ [%s]",0,this._layer._layerSize.width):
(this._resetTile(),this._x=t,this._updateInfo()))},type:cc.Integer},y:
{get:function(){return this._y},set:function(t){t!
==this._y&&(this._layer&&this._layer._isInvalidPosition(this._x,t)?cc.warn("Invalid
y, the valid value is between [%s] ~ [%s]",0,this._layer._layerSize.height):
(this._resetTile(),this._y=t,this._updateInfo()))},type:cc.Integer},gid:
{get:function(){return this._layer?
this._layer.getTileGIDAt(this._x,this._y):0},set:function(t)
{this._layer&&this._layer.setTileGIDAt(t,this._x,this._y)},type:cc.Integer}},onEnab
le:function(){var
t=this.node.parent;this._layer=t.getComponent(cc.TiledLayer),this._resetTile(),this
._updateInfo()},onDisable:function(){this._resetTile()},_resetTile:function()
{this._layer&&this._layer.getTiledTileAt(this._x,this._y)===this&&this._layer.setTi
ledTileAt(this._x,this._y,null)},_updateInfo:function(){if(this._layer){var
t=this._x,e=this._y;this._layer.getTiledTileAt(t,e)?cc.warn("There is already a
TiledTile at [%s, %s]",t,e):
(this.node.setPosition(this._layer.getPositionAt(t,e)),this._layer.setTiledTileAt(t
,e,this))}}});cc.TiledTile=e.exports=n}),{}],381:[(function(t,e,i){"use
strict";t("./CCTiledMap"),t("./tmx-layer-assembler")}),{"./CCTiledMap":377,"./tmx-
layer-assembler":382}],382:[(function(t,e,i){"use strict";var
n=t("../core/vmath"),r=t("./CCTiledLayer"),s=t("./CCTiledMap"),a=t("../core/rendere
r/render-
flow"),o=s.Orientation,l=s.TileFlag,h=l.FLIPPED_MASK,c=s.StaggerAxis,u=s.StaggerInd
ex,_=n.mat4.create(),f=n.mat4.create(),d=n.vec3.create(),m={updateRenderData:functi
on(t){var e=t._renderData;e||(e=t._renderData=t.requestRenderData());var
i=t.node._contentSize,n=t.node._anchorPoint;e.updateSizeNPivot(i.width,i.height,n.x
,n.y),e.material=t.sharedMaterials[0],this.updateVertices(t)},fillBuffers:function(
t,e){for(var
i=t._renderData,n=i._data,r=e._meshBuffer,s=i.vertexCount,o=r.request(s,i.indiceCou
nt),l=o.indiceOffset,h=o.byteOffset>>2,c=o.vertexOffset,u=r._vData,_=r._iData,f=r._
uintVData,d=0,m=i.vertexCount;d<m;d++){var p=n[d];u[h++]=p.x,u[h++]=p.y,u[h+
+]=p.u,u[h++]=p.v,f[h++]=p.color}for(var v=0,y=i.indiceCount;v<y;v+=6)_[l++]=c,_[l+
+]=c+1,_[l++]=c+2,_[l++]=c+1,_[l++]=c+3,_[l++]=c+2,c+=4;t.node._renderFlag|
=a.FLAG_UPDATE_RENDER_DATA},updateVertices:function(t){var
e=t.node,i=t._renderData,r=i._data,s=e._color._val,a=e._color.a;i.dataLength=i.vert
exCount=i.indiceCount=0;var m=t._layerOrientation;if(t._tiles&&t._tileset){var
p=e._anchorPoint.x*e._contentSize.width,v=e._anchorPoint.y*e._contentSize.height;n.
mat4.copy(_,e._worldMatrix),n.vec3.set(d,-p,-v,0),n.mat4.translate(_,_,d);var
y=_.m00,g=_.m01,x=_.m04,b=_.m05,A=_.m12,C=_.m13,S=t._mapTileSize.width,T=t._mapTile
Size.height,w=t._tileset._tileSize.width,E=t._tileset._tileSize.height,M=w-S,D=E-
T,B=cc.winSize.width,P=cc.winSize.height,I=t._layerSize.height,R=t._layerSize.width
,O=t._texGrids,L=t._tiledTiles,F=t._offset.x,V=t._offset.y,N=0,k=0,G=R,z=I,U=y,j=b,
W=A+=F*y+V*x,H=C+=F*g+V*b,X=w*y,q=E*b,Y=cc.macro.ENABLE_TILEDMAP_CULLING;if(Y){var
J=cc.Camera.findCamera(t.node);if(J&&(J.getWorldToCameraMatrix(f),n.mat4.mul(_,f,_)
,U=_.m00,j=_.m05,W=F*U+V*_.m04+_.m12,H=F*_.m01+V*j+_.m13,X=w*U,q=E*j),m===o.ORTHO)
{n.mat4.invert(_,_);var
Z=cc.visibleRect,K=_.m00,Q=_.m01,$=_.m04,tt=_.m05,et=_.m12,it=_.m13,nt=Z.topLeft.x*
K+Z.topLeft.y*$
+et,rt=Z.topLeft.x*Q+Z.topLeft.y*tt+it,st=Z.bottomLeft.x*K+Z.bottomLeft.y*$
+et,at=Z.bottomLeft.x*Q+Z.bottomLeft.y*tt+it,ot=Z.topRight.x*K+Z.topRight.y*$
+et,lt=Z.topRight.x*Q+Z.topRight.y*tt+it,ht=Z.bottomRight.x*K+Z.bottomRight.y*$
+et,ct=Z.bottomRight.x*Q+Z.bottomRight.y*tt+it,ut=Math.min(nt,st,ot,ht),_t=Math.max
(nt,st,ot,ht),ft=Math.min(rt,at,lt,ct),dt=Math.max(rt,at,lt,ct);N=Math.floor(ut/S),
k=I-Math.ceil(dt/T),G=Math.ceil((_t+M)/S),z=I-Math.floor((ft-
D)/T),N<0&&(N=0),k<0&&(k=0),G>R&&(G=R),z>I&&(z=I)}}var mt=k*R,pt=void 0,vt=void
0,yt=void 0,gt=void 0,xt=void 0,bt=void 0,At=void 0,Ct=void 0,St=void 0,Tt=void
0,wt=void 0,Et=void 0,Mt=void 0;if(m===o.HEX){var
Dt=t._hexSideLength;St=t._staggerAxis,Tt=t._tileset.tileOffset,Mt=t._staggerIndex==
=u.STAGGERINDEX_ODD?1:-1,wt=St===c.STAGGERAXIS_X?(S-
Dt)/2:0,Et=St===c.STAGGERAXIS_Y?(T-Dt)/2:0}for(var Bt=0,Pt=void 0,It=void 0,Rt=void
0,Ot=void 0,Lt=void 0,Ft=void 0,Vt=void 0,Nt=k;Nt<z;++Nt){for(var kt=N;kt<G;++kt)
{var Gt=mt+kt,zt=!1,Ut=!1,jt=L[Gt];if(vt=O[((pt=jt?jt.gid:t._tiles[Gt])&h)>>>0])
{switch(m){case o.ORTHO:gt=kt*S,xt=(I-Nt-1)*T;break;case o.ISO:gt=S/2*(R+kt-Nt-
1),xt=T/2*(2*I-kt-Nt-2);break;case o.HEX:gt=kt*(S-wt)+(St===c.STAGGERAXIS_Y&&Nt
%2==1?S/2*Mt:0)+Tt.x,xt=(I-Nt-1)*(T-Et)+(St===c.STAGGERAXIS_X&&kt%2==1?T/2*-Mt:0)-
Tt.y}if(jt){var
Wt=jt.node;Vt=s;var
Ht=Wt.opacity*a/255;s=Wt.color.setA(Ht)._val,Pt=y,It=g,Rt=x,Ot=b,Lt=A,Ft=C,Wt._upda
teLocalMatrix(),n.mat4.copy(_,Wt._matrix),n.vec3.set(d,-gt,-
xt,0),n.mat4.translate(_,_,d),n.mat4.multiply(_,e._worldMatrix,_),y=_.m00,g=_.m01,x
=_.m04,b=_.m05,A=_.m12,C=_.m13}if(bt=gt+w,yt=xt+E,Y&&m===o.ISO){if((At=H+xt*j)>P+q)
{kt+=Math.floor(2*(At-P)/q)-1;continue}if((Ct=W+bt*U)<-X){kt+=Math.floor(2*-Ct/X)-
1;continue}if(W+gt*U>B||H+yt*j<0)
{kt=G;continue}}pt>l.DIAGONAL&&(zt=(pt&l.HORIZONTAL)>>>0,Ut=(pt&l.VERTICAL)>>>0),i.
vertexCount+=4,i.indiceCount+=6,i.dataLength=i.vertexCount,r[Bt].x=gt*y+yt*x+A,r[Bt
].y=gt*g+yt*b+C,r[Bt].u=zt?vt.r:vt.l,r[Bt].v=Ut?vt.b:vt.t,r[Bt].color=s,r[+
+Bt].x=gt*y+xt*x+A,r[Bt].y=gt*g+xt*b+C,r[Bt].u=zt?vt.r:vt.l,r[Bt].v=Ut?
vt.t:vt.b,r[Bt].color=s,r[++Bt].x=bt*y+yt*x+A,r[Bt].y=bt*g+yt*b+C,r[Bt].u=zt?
vt.l:vt.r,r[Bt].v=Ut?vt.b:vt.t,r[Bt].color=s,r[+
+Bt].x=bt*y+xt*x+A,r[Bt].y=bt*g+xt*b+C,r[Bt].u=zt?vt.l:vt.r,r[Bt].v=Ut?
vt.t:vt.b,r[Bt].color=s,Bt+
+,jt&&(s=Vt,y=Pt,g=It,x=Rt,b=Ot,A=Lt,C=Ft)}}mt+=R}}}};e.exports=r._assembler=m}),
{"../core/renderer/render-
flow":244,"../core/vmath":316,"./CCTiledLayer":376,"./CCTiledMap":377}],383:
[(function(t,e,i){"use strict";var n=t("./video-player-
impl"),r=n.EventType,s=cc.Enum({REMOTE:0,LOCAL:1}),a=cc.Class({name:"cc.VideoPlayer
",extends:cc.Component,editor:!1,properties:{_resourceType:s.REMOTE,resourceType:
{tooltip:!1,type:s,set:function(t)
{this._resourceType=t,this._updateVideoSource()},get:function(){return
this._resourceType}},_remoteURL:"",remoteURL:{tooltip:!
1,type:cc.String,set:function(t)
{this._remoteURL=t,this._updateVideoSource()},get:function(){return
this._remoteURL}},_clip:{default:null,type:cc.Asset},clip:{tooltip:!
1,get:function(){return this._clip},set:function(t)
{this._clip=t,this._updateVideoSource()},type:cc.Asset},currentTime:{tooltip:!
1,type:cc.Float,set:function(t){this._impl&&this._impl.seekTo(t)},get:function()
{return this._impl?this._impl.currentTime():-1}},_volume:1,volume:{get:function()
{return this._volume},set:function(t){this._volume=t,this.isPlaying()&&!
this._mute&&this._syncVolume()},range:[0,1],type:cc.Float,tooltip:!1},_mute:!
1,mute:{get:function(){return this._mute},set:function(t)
{this._mute=t,this._syncVolume()},tooltip:!1},keepAspectRatio:{tooltip:!1,default:!
0,type:cc.Boolean,notify:function()
{this._impl.setKeepAspectRatioEnabled(this.keepAspectRatio)}},isFullscreen:
{tooltip:!1,default:!1,type:cc.Boolean,notify:function()
{this._impl.setFullScreenEnabled(this.isFullscreen)}},videoPlayerEvent:{default:
[],type:cc.Component.EventHandler}},statics:
{EventType:r,ResourceType:s,Impl:n},ctor:function(){this._impl=new
n},_syncVolume:function(){var t=this._impl;if(t){var e=this._mute?
0:this._volume;t.setVolume(e)}},_updateVideoSource:function(){var
t="";this.resourceType===s.REMOTE?
t=this.remoteURL:this._clip&&(t=this._clip.nativeUrl||""),t&&cc.loader.md5Pipe&&(t=
cc.loader.md5Pipe.transformURL(t)),this._impl.setURL(t,this._mute||
0===this._volume)},onLoad:function(){var
t=this._impl;t&&(t.createDomElementIfNeeded(this._mute||
0===this._volume),this._updateVideoSource(),t.seekTo(this.currentTime),t.setKeepAsp
ectRatioEnabled(this.keepAspectRatio),t.setFullScreenEnabled(this.isFullscreen),thi
s.pause(),t.setEventListener(r.PLAYING,this.onPlaying.bind(this)),t.setEventListene
r(r.PAUSED,this.onPasued.bind(this)),t.setEventListener(r.STOPPED,this.onStopped.bi
nd(this)),t.setEventListener(r.COMPLETED,this.onCompleted.bind(this)),t.setEventLis
tener(r.META_LOADED,this.onMetaLoaded.bind(this)),t.setEventListener(r.CLICKED,this
.onClicked.bind(this)),t.setEventListener(r.READY_TO_PLAY,this.onReadyToPlay.bind(t
his)))},onRestore:function(){this._impl||(this._impl=new n)},onEnable:function()
{this._impl&&this._impl.enable()},onDisable:function()
{this._impl&&this._impl.disable()},onDestroy:function()
{this._impl&&(this._impl.destroy(),this._impl=null)},update:function(t)
{this._impl&&this._impl.updateMatrix(this.node)},onReadyToPlay:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.READY_TO_PLAY),t
his.node.emit("ready-to-play",this)},onMetaLoaded:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.META_LOADED),thi
s.node.emit("meta-loaded",this)},onClicked:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.CLICKED),this.no
de.emit("clicked",this)},onPlaying:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.PLAYING),this.no
de.emit("playing",this)},onPasued:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.PAUSED),this.nod
e.emit("paused",this)},onStopped:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.STOPPED),this.no
de.emit("stopped",this)},onCompleted:function()
{cc.Component.EventHandler.emitEvents(this.videoPlayerEvent,this,r.COMPLETED),this.
node.emit("completed",this)},play:function()
{this._impl&&(this._syncVolume(),this._impl.play())},resume:function()
{this._impl&&(this._syncVolume(),this._impl.resume())},pause:function()
{this._impl&&this._impl.pause()},stop:function()
{this._impl&&this._impl.stop()},getDuration:function(){return this._impl?
this._impl.duration():-1},isPlaying:function(){return!!
this._impl&&this._impl.isPlaying()}});cc.VideoPlayer=e.exports=a}),{"./video-
player-impl":384}],384:[(function(t,e,i){"use strict";var
n=t("../core/vmath"),r=t("../core/platform/utils"),s=t("../core/platform/CCSys"),a=
{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_
DATA:4},o=n.mat4.create(),l=cc.Class({name:"VideoPlayerImpl",ctor:function()
{this._EventList={},this._video=null,this._url="",this._fullScreenEnabled=!
1,this._loadedmeta=!1,this._loaded=!1,this._visible=!1,this._playing=!
1,this._ignorePause=!1,this._forceUpdate=!
0,this._m00=0,this._m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0
,this._h=0,this.__eventListeners={}},_bindEvent:function(){var
t=this._video,e=this,i=this.__eventListeners;i.loadedmetadata=function()
{e._loadedmeta=!0,e._fullScreenEnabled?
cc.screen.requestFullScreen(t):cc.screen.fullScreen()&&cc.screen.exitFullScreen(t),
e._dispatchEvent(l.EventType.META_LOADED)},i.ended=function()
{e._video===t&&(e._playing=!
1,e._dispatchEvent(l.EventType.COMPLETED))},i.play=function()
{e._video===t&&(e._playing=!
0,e._updateVisibility(),e._dispatchEvent(l.EventType.PLAYING))},i.pause=function()
{e._video===t&&(e._playing=!1,e._ignorePause||
e._dispatchEvent(l.EventType.PAUSED))},i.click=function()
{e._dispatchEvent(l.EventType.CLICKED)},t.addEventListener("loadedmetadata",i.loade
dmetadata),t.addEventListener("ended",i.ended),t.addEventListener("play",i.play),t.
addEventListener("pause",i.pause),t.addEventListener("click",i.click),i.onCanPlay=f
unction(){if(!e._loaded&&!e._playing){var t=e._video;t.readyState!
==a.HAVE_ENOUGH_DATA&&t.readyState!==a.HAVE_METADATA||(t.currentTime=0,e._loaded=!
0,e._dispatchEvent(l.EventType.READY_TO_PLAY),e._updateVisibility())}},t.addEventLi
stener("canplay",i.onCanPlay),t.addEventListener("canplaythrough",i.onCanPlay),t.ad
dEventListener("suspend",i.onCanPlay)},_updateVisibility:function(){var
t=this._video;t&&(this._visible?(t.style.visibility="visible",this._forceUpdate=!
0):(t.style.visibility="hidden",t.pause(),this._playing=!1,this._forceUpdate=!
1))},_updateSize:function(t,e){var
i=this._video;i&&(i.style.width=t+"px",i.style.height=e+"px")},_createDom:function(
t){var
e=document.createElement("video");e.style.position="absolute",e.style.bottom="0px",
e.style.left="0px",e.className="cocosVideo",e.setAttribute("preload","auto"),e.setA
ttribute("webkit-playsinline",""),e.setAttribute("x5-
playsinline",""),e.setAttribute("playsinline",""),t&&e.setAttribute("muted",""),thi
s._video=e,cc.game.container.appendChild(e)},createDomElementIfNeeded:function(t)
{this._video||this._createDom(t)},removeDom:function(){var t=this._video;if(t)
{r.contains(cc.game.container,t)&&cc.game.container.removeChild(t);var
e=this.__eventListeners;t.removeEventListener("loadedmetadata",e.loadedmetadata),t.
removeEventListener("ended",e.ended),t.removeEventListener("play",e.play),t.removeE
ventListener("pause",e.pause),t.removeEventListener("click",e.click),t.removeEventL
istener("canplay",e.onCanPlay),t.removeEventListener("canplaythrough",e.onCanPlay),
t.removeEventListener("suspend",e.onCanPlay),e.loadedmetadata=null,e.ended=null,e.p
lay=null,e.pause=null,e.click=null,e.onCanPlay=null}this._video=null,this._url=""},
setURL:function(t,e){var i,n=void 0;if(this._url!==t)
{this._url=t,this.removeDom(),this.createDomElementIfNeeded(e),this._bindEvent();va
r r=this._video;r.style.visibility="hidden",this._loaded=!1,this._playing=!
1,this._loadedmeta=!1,
(n=document.createElement("source")).src=t,r.appendChild(n),i=cc.path.extname(t);fo
r(var s=l._polyfill,a=0;a<s.canPlayType.length;a++)i!
==s.canPlayType[a]&&((n=document.createElement("source")).src=t.replace(i,s.canPlay
Type[a]),r.appendChild(n))}},getURL:function(){return this._url},play:function()
{var t=this._video;if(t&&this._visible&&!
this._playing)if(l._polyfill.autoplayAfterOperation){setTimeout((function()
{t.play()}),20)}else t.play()},pause:function(){var
t=this._video;this._playing&&t&&t.pause()},resume:function()
{this.play()},stop:function(){var
t=this._video;t&&this._visible&&(this._ignorePause=!
0,t.currentTime=0,t.pause(),setTimeout(function()
{this._dispatchEvent(l.EventType.STOPPED),this._ignorePause=!
1}.bind(this),0))},setVolume:function(t){var
e=this._video;e&&(e.volume=t)},seekTo:function(t){var e=this._video;if(e)
{if(this._loaded)e.currentTime=t;else{e.addEventListener(l._polyfill.event,
(function i()
{e.currentTime=t,e.removeEventListener(l._polyfill.event,i)}))}l._polyfill.autoplay
AfterOperation&&this.isPlaying()&&setTimeout((function()
{e.play()}),20)}},isPlaying:function(){var t=this._video;return
l._polyfill.autoplayAfterOperation&&this._playing&&setTimeout((function()
{t.play()}),20),this._playing},duration:function(){var
t=this._video,e=-1;return t?
(e=t.duration,e<=0&&cc.logID(7702),e):e},currentTime:function(){var
t=this._video;return t?t.currentTime:-1},setKeepAspectRatioEnabled:function()
{cc.logID(7700)},isKeepAspectRatioEnabled:function(){return!
0},setFullScreenEnabled:function(t){var
e=this._video;e&&(this._fullScreenEnabled=t,t?
cc.screen.requestFullScreen(e):cc.screen.fullScreen()&&cc.screen.exitFullScreen(e))
},isFullScreenEnabled:function(){return
this._fullScreenEnabled},setEventListener:function(t,e)
{this._EventList[t]=e},removeEventListener:function(t)
{this._EventList[t]=null},_dispatchEvent:function(t){var
e=this._EventList[t];e&&e.call(this,this,this._video.src)},onPlayEvent:function()
{this._EventList[l.EventType.PLAYING].call(this,this,this._video.src)},enable:funct
ion(){var t=l.elements;-1===t.indexOf(this)&&t.push(this),this.setVisible(!
0)},disable:function(){var t=l.elements,e=t.indexOf(this);-1!
==e&&t.splice(e,1),this.setVisible(!1)},destroy:function()
{this.disable(),this.removeDom()},setVisible:function(t){this._visible!
==t&&(this._visible=!!t,this._updateVisibility())},updateMatrix:function(t)
{if(this._video&&this._visible&&(t.getWorldMatrix(o),this._forceUpdate||this._m00!
==o.m00||this._m01!==o.m01||this._m04!==o.m04||this._m05!==o.m05||this._m12!
==o.m12||this._m13!==o.m13||this._w!==t._contentSize.width||this._h!
==t._contentSize.height))
{this._m00=o.m00,this._m01=o.m01,this._m04=o.m04,this._m05=o.m05,this._m12=o.m12,th
is._m13=o.m13,this._w=t._contentSize.width,this._h=t._contentSize.height;var
e=cc.view._scaleX,i=cc.view._scaleY,n=cc.view._devicePixelRatio;e/=n,i/=n;var
r=cc.game.container,s=o.m00*e,a=o.m01,h=o.m04,c=o.m05*i,u=r&&r.style.paddingLeft?
parseInt(r.style.paddingLeft):0,_=r&&r.style.paddingBottom?
parseInt(r.style.paddingBottom):0,f=void 0,d=void 0;l._polyfill.zoomInvalid?
(this._updateSize(this._w*s,this._h*c),s=1,c=1,f=this._w*e,d=this._h*i):
(f=this._w*e,d=this._h*i,this._updateSize(this._w,this._h));var
m=f*o.m00*t._anchorPoint.x,p=d*o.m05*t._anchorPoint.y,v=cc.view._viewportRect;u+=v.
x/n,_+=v.y/n;var y="matrix("+s+","+-a+","+-h+","+c+","+(o.m12*e-m+u)+","+-(o.m13*i-
p+_)+")";this._video.style.transform=y,this._video.style["-webkit-
transform"]=y,this._video.style["transform-origin"]="0px 100%
0px",this._video.style["-webkit-transform-origin"]="0px 100%
0px"}}});l.EventType={PLAYING:0,PAUSED:1,STOPPED:2,COMPLETED:3,META_LOADED:4,CLICKE
D:5,READY_TO_PLAY:6},l.elements=[],l.pauseElements=[],cc.game.on(cc.game.EVENT_HIDE
,(function(){for(var t,e=l.elements,i=0;i<e.length;i++)
(t=e[i]).isPlaying()&&(t.pause(),l.pauseElements.push(t))})),cc.game.on(cc.game.EVE
NT_SHOW,(function(){for(var
t=l.pauseElements,e=t.pop();e;)e.play(),e=t.pop()})),l._polyfill={devicePixelRatio:
!1,event:"canplay",canPlayType:[]};var
h=cc.sys.platform===cc.sys.BAIDU_GAME,c=document.createElement("video");h||
(c.canPlayType("video/ogg")&&(l._polyfill.canPlayType.push(".ogg"),l._polyfill.canP
layType.push(".ogv")),c.canPlayType("video/mp4")&&l._polyfill.canPlayType.push(".mp
4"),c.canPlayType("video/webm")&&l._polyfill.canPlayType.push(".webm")),s.browserTy
pe===s.BROWSER_TYPE_FIREFOX&&(l._polyfill.autoplayAfterOperation=!0),s.OS_ANDROID!
==s.os||s.browserType!==s.BROWSER_TYPE_SOUGOU&&s.browserType!==s.BROWSER_TYPE_360||
(l._polyfill.zoomInvalid=!0);var
u=document.createElement("style");u.innerHTML=".cocosVideo:-moz-full-
screen{transform:matrix(1,0,0,1,0,0) !important;}.cocosVideo:full-
screen{transform:matrix(1,0,0,1,0,0) !important;}.cocosVideo:-webkit-full-
screen{transform:matrix(1,0,0,1,0,0) !
important;}",document.head.appendChild(u),e.exports=l}),
{"../core/platform/CCSys":209,"../core/platform/utils":224,"../core/vmath":316}],38
5:[(function(t,e,i){"use strict";var n=t("./webview-impl"),r=n.EventType;function
s(){}var a=cc.Class({name:"cc.WebView",extends:cc.Component,editor:!1,properties:
{_useOriginalSize:!0,_url:"",url:{type:String,tooltip:!1,get:function(){return
this._url},set:function(t){this._url=t;var
e=this._impl;e&&e.loadURL(t)}},webviewEvents:{default:
[],type:cc.Component.EventHandler}},statics:{EventType:r,Impl:n},ctor:function()
{this._impl=new a.Impl},onRestore:function(){this._impl||(this._impl=new
a.Impl)},onEnable:function(){var
t=this._impl;t.createDomElementIfNeeded(this.node.width,this.node.height),t.setEven
tListener(r.LOADED,this._onWebViewLoaded.bind(this)),t.setEventListener(r.LOADING,t
his._onWebViewLoading.bind(this)),t.setEventListener(r.ERROR,this._onWebViewLoadErr
or.bind(this)),t.loadURL(this._url),t.setVisible(!0)},onDisable:function(){var
t=this._impl;t.setVisible(!
1),t.setEventListener(r.LOADED,s),t.setEventListener(r.LOADING,s),t.setEventListene
r(r.ERROR,s)},onDestroy:function()
{this._impl&&(this._impl.destroy(),this._impl=null)},update:function(t)
{this._impl&&this._impl.updateMatrix(this.node)},_onWebViewLoaded:function()
{cc.Component.EventHandler.emitEvents(this.webviewEvents,this,r.LOADED),this.node.e
mit("loaded",this)},_onWebViewLoading:function(){return
cc.Component.EventHandler.emitEvents(this.webviewEvents,this,r.LOADING),this.node.e
mit("loading",this),!0},_onWebViewLoadError:function()
{cc.Component.EventHandler.emitEvents(this.webviewEvents,this,r.ERROR),this.node.em
it("error",this)},setJavascriptInterfaceScheme:function(t)
{this._impl&&this._impl.setJavascriptInterfaceScheme(t)},setOnJSCallback:function(t
){this._impl&&this._impl.setOnJSCallback(t)},evaluateJS:function(t)
{this._impl&&this._impl.evaluateJS(t)}});cc.WebView=e.exports=a}),{"./webview-
impl":386}],386:[(function(t,e,i){"use strict";var
n=t("../core/vmath"),r=t("../core/platform/utils"),s=t("../core/platform/CCSys"),a=
n.mat4.create(),o=cc.Class({name:"WebViewImpl",ctor:function()
{this._EventList={},this._visible=!
1,this._parent=null,this._div=null,this._iframe=null,this._listener=null,this._forc
eUpdate=!
0,this._m00=0,this._m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0
,this._h=0,this.__eventListeners={}},_updateVisibility:function(){if(this._div){var
t=this._div;this._visible?
t.style.visibility="visible":t.style.visibility="hidden",this._forceUpdate=!
0}},_updateSize:function(t,e){var
i=this._div;i&&(i.style.width=t+"px",i.style.height=e+"px")},_initEvent:function()
{var t=this._iframe;if(t){var e=this.__eventListeners,i=this;e.load=function()
{i._dispatchEvent(o.EventType.LOADED)},e.error=function()
{i._dispatchEvent(o.EventType.ERROR)},t.addEventListener("load",e.load),t.addEventL
istener("error",e.error)}},_initStyle:function(){if(this._div){var
t=this._div;t.style.position="absolute",t.style.bottom="0px",t.style.left="0px"}},_
setOpacity:function(t){var
e=this._iframe;e&&e.style&&(e.style.opacity=t/255)},_createDom:function(t,e)
{o._polyfill.enableDiv?(this._div=document.createElement("div"),this._div.style["-
webkit-overflow"]="auto",this._div.style["-webkit-overflow-
scrolling"]="touch",this._iframe=document.createElement("iframe"),this._div.appendC
hild(this._iframe),this._iframe.style.width="100%",this._iframe.style.height="100%"
):this._div=this._iframe=document.createElement("iframe"),o._polyfill.enableBG&&(th
is._div.style.background="#FFF"),this._div.style.background="#FFF",this._div.style.
height=e+"px",this._div.style.width=t+"px",this._div.style.overflow="scroll",this._
iframe.style.border="none",cc.game.container.appendChild(this._div),this._updateVis
ibility()},_createNativeControl:function(t,e)
{this._createDom(t,e),this._initStyle(),this._initEvent()},createDomElementIfNeeded
:function(t,e){this._div?
this._updateSize(t,e):this._createNativeControl(t,e)},removeDom:function(){var
t=this._div;t&&(r.contains(cc.game.container,t)&&cc.game.container.removeChild(t),t
his._div=null);var e=this._iframe;if(e){var
i=this.__eventListeners;e.removeEventListener("load",i.load),e.removeEventListener(
"error",i.error),i.load=null,i.error=null,this._iframe=null}},setOnJSCallback:funct
ion(t){},setJavascriptInterfaceScheme:function(t){},loadData:function(t,e,i,n)
{},loadHTMLString:function(t,e){},loadURL:function(t){var e=this._iframe;if(e)
{e.src=t;var i=this;e.addEventListener("load",(function t(){i._loaded=!
0,i._updateVisibility(),e.removeEventListener("load",t)})),this._dispatchEvent(o.Ev
entType.LOADING)}},stopLoading:function(){cc.logID(7800)},reload:function(){var
t=this._iframe;if(t){var
e=t.contentWindow;e&&e.location&&e.location.reload()}},canGoBack:function(){return
cc.logID(7801),!0},canGoForward:function(){return cc.logID(7802),!
0},goBack:function(){try{if(o._polyfill.closeHistory)return cc.logID(7803);var
t=this._iframe;if(t){var
e=t.contentWindow;e&&e.location&&e.history.back.call(e)}}catch(t)
{cc.log(t)}},goForward:function(){try{if(o._polyfill.closeHistory)return
cc.logID(7804);var t=this._iframe;if(t){var
e=t.contentWindow;e&&e.location&&e.history.forward.call(e)}}catch(t)
{cc.log(t)}},evaluateJS:function(t){var e=this._iframe;if(e){var
i=e.contentWindow;try{i.eval(t),this._dispatchEvent(o.EventType.JS_EVALUATED)}catch
(t){console.error(t)}}},setScalesPageToFit:function()
{cc.logID(7805)},setEventListener:function(t,e)
{this._EventList[t]=e},removeEventListener:function(t)
{this._EventList[t]=null},_dispatchEvent:function(t){var
e=this._EventList[t];e&&e.call(this,this,this._iframe.src)},_createRenderCmd:functi
on(){return new o.RenderCmd(this)},destroy:function()
{this.removeDom()},setVisible:function(t){this._visible!==t&&(this._visible=!!
t,this._updateVisibility())},updateMatrix:function(t)
{if(this._div&&this._visible&&(t.getWorldMatrix(a),this._forceUpdate||this._m00!
==a.m00||this._m01!==a.m01||this._m04!==a.m04||this._m05!==a.m05||this._m12!
==a.m12||this._m13!==a.m13||this._w!==t._contentSize.width||this._h!
==t._contentSize.height))
{this._m00=a.m00,this._m01=a.m01,this._m04=a.m04,this._m05=a.m05,this._m12=a.m12,th
is._m13=a.m13,this._w=t._contentSize.width,this._h=t._contentSize.height;var
e=cc.view._scaleX,i=cc.view._scaleY,n=cc.view._devicePixelRatio;e/=n,i/=n;var
r=cc.game.container,s=a.m00*e,o=a.m01,l=a.m04,h=a.m05*i,c=r&&r.style.paddingLeft?
parseInt(r.style.paddingLeft):0,u=r&&r.style.paddingBottom?
parseInt(r.style.paddingB
ottom):0;this._updateSize(this._w,this._h);var
_=this._div.clientWidth*e,f=this._div.clientHeight*i,d=_*a.m00*t._anchorPoint.x,m=f
*a.m05*t._anchorPoint.y,p=cc.view._viewportRect;c+=p.x/n,u+=p.y/n;var
v="matrix("+s+","+-o+","+-l+","+h+","+(a.m12*e-d+c)+","+-(a.m13*i-m+u)
+")";this._div.style.transform=v,this._div.style["-webkit-
transform"]=v,this._div.style["transform-origin"]="0px 100% 0px",this._div.style["-
webkit-transform-origin"]="0px 100%
0px",this._setOpacity(t.opacity)}}});o.EventType={LOADING:0,LOADED:1,ERROR:2,JS_EVA
LUATED:3};var l=o._polyfill={devicePixelRatio:!1,enableDiv:!
1};s.os===s.OS_IOS&&(l.enableDiv=!0),s.isMobile?
s.browserType===s.BROWSER_TYPE_FIREFOX&&(l.enableBG=!
0):s.browserType===s.BROWSER_TYPE_IE&&(l.closeHistory=!0),e.exports=o}),
{"../core/platform/CCSys":209,"../core/platform/utils":224,"../core/vmath":316}],38
7:[(function(t,e,i){"use
strict";t("./cocos2d/core"),t("./cocos2d/animation"),t("./cocos2d/particle"),t("./c
ocos2d/tilemap"),t("./cocos2d/videoplayer/CCVideoPlayer"),t("./cocos2d/webview/CCWe
bView"),t("./cocos2d/core/components/CCStudioComponent"),t("./extensions/ccpool/CCN
odePool"),t("./cocos2d/actions"),t("./extensions/spine"),t("./extensions/dragonbone
s"),t("./cocos2d/deprecated")}),
{"./cocos2d/actions":7,"./cocos2d/animation":16,"./cocos2d/core":145,"./cocos2d/cor
e/components/CCStudioComponent":112,"./cocos2d/deprecated":326,"./cocos2d/particle"
:332,"./cocos2d/particle/CCParticleAsset":329,"./cocos2d/tilemap":381,"./cocos2d/ti
lemap/CCTiledMapAsset":378,"./cocos2d/videoplayer/CCVideoPlayer":383,"./cocos2d/web
view/CCWebView":385,"./extensions/ccpool/CCNodePool":388,"./extensions/dragonbones"
:397,"./extensions/spine":401}],388:[(function(t,e,i){"use
strict";cc.NodePool=function(t)
{this.poolHandlerComp=t,this._pool=[]},cc.NodePool.prototype={constructor:cc.NodePo
ol,size:function(){return this._pool.length},clear:function(){for(var
t=this._pool.length,e=0;e<t;+
+e)this._pool[e].destroy();this._pool.length=0},put:function(t){if(t&&-
1===this._pool.indexOf(t)){t.removeFromParent(!1);var e=this.poolHandlerComp?
t.getComponent(this.poolHandlerComp):null;e&&e.unuse&&e.unuse(),this._pool.push(t)}
},get:function(){var t=this._pool.length-1;if(t<0)return null;var
e=this._pool[t];this._pool.length=t;var i=this.poolHandlerComp?
e.getComponent(this.poolHandlerComp):null;return
i&&i.reuse&&i.reuse.apply(i,arguments),e}},e.exports=cc.NodePool}),{}],389:
[(function(t,e,i){"use strict";var
n=[],r=[],s=0,a=0,o=null,l=null,h=0,c=0,u=0,_=0,f=null,d=void 0,m=void
0,p=cc.Class({ctor:function()
{this.frames=[],this.totalTime=0,this._animationName=null,this._tempSegments=null,t
his._tempColors=null},init:function(t){this._animationName=t},clear:function()
{for(var t=0,e=this.frames.length;t<e;t++)
{this.frames[t].segments.length=0}},update:function(t){if(this._animationName){var
e=t.animation;e.play(this._animationName,1);var
i=0;this.totalTime=0;do{t.advanceTime(1/60),this._updateFrame(t,i),i+
+,this.totalTime+=1/60}while(!
e.isCompleted&&this.totalTime<30);this.frames.length=i}else
cc.error("AnimationCache:update animationName is
empty")},_updateFrame:function(t,e)
{a=0,s=0,0,o=null,l=null,h=0,c=0,u=0,_=0,f=null,this.frames[e]=this.frames[e]||
{segments:[],colors:[],vertices:null,uintVert:null,indices:null};var
i=this.frames[e],d=this._tempSegments=i.segments,m=this._tempColors=i.colors;this._
traverseArmature(t),_>0&&(m[_-1].vfOffset=a),m.length=_;var p=u-1;if(p>=0)if(c>0)
{var v=d[p];v.indexCount=c,v.vfCount=5*h,v.vertexCount=h,d.length=u}else
d.length=u-1;if(0!==d.length){for(var y=i.vertices||new
Float32Array(a),g=i.uintVert||new Uint32Array(y.buffer),x=0,b=0;x<a;)y[x++]=n[b+
+],y[x++]=n[b++],y[x++]=n[b++],y[x++]=n[b++],g[x++]=n[b++];for(var A=i.indices||new
Uint16Array(s),C=0;C<s;C+
+)A[C]=r[C];i.vertices=y,i.uintVert=g,i.indices=A}},_traverseArmature:function(t)
{for(var e=this._tempColors,i=this._tempSegments,p=n,v=r,y=void 0,g=void
0,x=t._slots,b=void 0,A=void 0,C=void 0,S=void 0,T=void 0,w=void 0,E=void
0,M=0,D=x.length;M<D;M+
+)if((b=x[M])._visible&&b._displayData)if(b.updateWorldMatrix(),b.childArmature)thi
s._traverseArmature(b.childArmature);else if(T=b.getTexture())
{C=b._color,o===T.url&&l===b._blendMode||(o=T.url,l=b._blendMode,(w=u-1)>=0&&(c>0?
((E=i[w]).indexCount=c,E.vertexCount=h,E.vfCount=5*h):u--),i[u]={tex:T,blendMode:b.
_blendMode,indexCount:0,vertexCount:0,vfCount:0},u++,c=0,h=0),S=(C.a<<24>>>0)+
(C.b<<16)+(C.g<<8)+C.r,f!==S&&(f=S,_>0&&(e[_-1].vfOffset=a),e[_+
+]={r:C.r,g:C.g,b:C.b,a:C.a,vfOffset:0}),y=b._localVertices,g=b._indices,A=b._world
Matrix;for(var B=0,P=y.length;B<P;)d=y[B++],m=y[B++],p[a+
+]=d*A.m00+m*A.m04+A.m12,p[a++]=d*A.m01+m*A.m05+A.m13,p[a++]=y[B++],p[a++]=y[B+
+],p[a++]=S;for(var I=0,R=g.length;I<R;I++)v[s+
+]=h+g[I];a/5,c+=g.length,h+=y.length/4}}}),v=cc.Class({ctor:function()
{this._animationPool={},this._armatureCache={}},dispose:function(){for(var t in
this._armatureCache){var e=this._armatureCache[t];if(e){var
i=e.armature;i&&i.dispose()}}this._armatureCache=null,this._animationPool=null},_re
moveArmature:function(t){var e=this._armatureCache[t],i=e.animationsCache;for(var n
in i){var r=i[n];r&&(this._animationPool[t+"#"+n]=r,r.clear())}var
s=e.armature;s&&s.dispose(),delete
this._armatureCache[t]},resetArmature:function(t){for(var e in
this._armatureCache)-1!
=e.indexOf(t)&&this._removeArmature(e)},getArmatureCache:function(t,e,i){var
n=this._armatureCache[e],r=void 0;if(n)r=n.armature;else{var
s=dragonBones.CCFactory.getInstance().buildArmatureDisplay(t,e,"",i);if(!s||!
s._armature)return;if(r=s._armature,!v.canCache(r))return void
r.dispose();this._armatureCache[e]={armature:r,animationsCache:{}}}return
r},getAnimationCache:function(t,e){var i=this._armatureCache[t];return i?
i.animationsCache[e]:null},updateAnimationCache:function(t,e){var
i=this._armatureCache[t],n=i&&i.armature;if(!n)return null;if(!
n.animation.hasAnimation(e))return null;var r=i.animationsCache,s=r[e];if(!s){var
a=t+"#"+e;(s=this._animationPool[a])?delete this._animationPool[a]:(s=new
p).init(e),r[e]=s}return s.update(n),s.totalTime>=30&&cc.warn("Animation cache is
overflow, maybe animation's frame is infinite, please change armature render mode
to REALTIME, dragonbones uuid is [%s], animation name is
[%s]",t,e),s}});v.sharedCache=new v,v.canCache=function(t){for(var
e=t._slots,i=0,n=e.length;i<n;i++){if(e[i].childArmature)return!1}return!
0},e.exports=v}),{}],390:[(function(t,e,i){"use strict";var
n=t("../../cocos2d/core/components/CCRenderComponent"),r=t("../../cocos2d/core/asse
ts/material/CCMaterial"),s=t("../../cocos2d/core/event/event-
target"),a=(t("../../cocos2d/core/CCNode"),t("../../cocos2d/core/graphics/graphics"
)),o=t("./ArmatureCache"),l=cc.Enum({default:-
1}),h=cc.Enum({"<None>":0}),c=(cc.Enum({REALTIME:0}),cc.Enum({REALTIME:0,SHARED_CAC
HE:1,PRIVATE_CACHE:2}));var
u=cc.Class({name:"dragonBones.ArmatureDisplay",extends:n,editor:!1,statics:
{AnimationCacheMode:c},properties:{_factory:
{default:null,type:dragonBones.CCFactory,serializable:!1},dragonAsset:
{default:null,type:dragonBones.DragonBonesAsset,notify:function()
{this._refresh()},tooltip:!1},dragonAtlasAsset:
{default:null,type:dragonBones.DragonBonesAtlasAsset,notify:function()
{this._parseDragonAtlasAsset(),this._buildArmature(),this._activateMaterial()},tool
tip:!1},_armatureName:"",armatureName:{get:function(){return
this._armatureName},set:function(t){this._armatureName=t;var
e=this.getAnimationNames(this._armatureName);(!this.animationName||
e.indexOf(this.animationName)<0)&&(this.animationName=""),this._armature&&!
this.isAnimationCached()&&this._factory._dragonBones.clock.remove(this._armature),t
his._refresh(),this._armature&&!
this.isAnimationCached()&&this._factory._dragonBones.clock.add(this._armature)},vis
ible:!1},_animationName:"",animationName:{get:function(){return
this._animationName},set:function(t){this._animationName=t},visible:!
1},_defaultArmatureIndex:{default:0,notify:function(){var t="";if(this.dragonAsset)
{var e=void 0;if(this.dragonAsset&&(e=this.dragonAsset.getArmatureEnum()),!e)return
cc.errorID(7400,this.name);t=e[this._defaultArmatureIndex]}void 0!==t?
this.armatureName=t:cc.errorID(7401,this.name)},type:l,visible:!0,editorOnly:!
0,animatable:!1,displayName:"Armature",tooltip:!1},_animationIndex:
{default:0,notify:function(){if(0!==this._animationIndex){var t=void
0;if(this.dragonAsset&&(t=this.dragonAsset.getAnimsEnum(this.armatureName)),t){var
e=t[this._animationIndex];void 0!==e?
this.playAnimation(e,this.playTimes):cc.errorID(7402,this.name)}}else
this.animationName=""},type:h,visible:!0,editorOnly:!
0,displayName:"Animation",tooltip:!1},_preCacheMode:-
1,_cacheMode:c.REALTIME,_defaultCacheMode:{default:0,type:c,notify:function()
{this.setAnimationCacheMode(this._defaultCacheMode)},editorOnly:!0,visible:!
0,animatable:!1,displayName:"Animation Cache Mode",tooltip:!1},timeScale:
{default:1,notify:function()
{this._armature&&(this._armature.animation.timeScale=this.timeScale)},tooltip:!
1},playTimes:{default:-1,tooltip:!1},premultipliedAlpha:{default:!1,tooltip:!
1},debugBones:{default:!1,notify:function(){this._updateDebugDraw()},tooltip:!
1},enableBatch:{default:!1,notify:function(){this._updateBatch()},tooltip:!
1},_armatureKey:"",_accTime:0,_playCount:0,_frameCache:null,_curFrame:null,_playing
:!1,_armatureCache:null},ctor:function(){this._eventTarget=new
s,this._materialCache={},this._inited=!
1,this._factory=dragonBones.CCFactory.getInstance()},onLoad:function(){for(var
t=this.node.children,e=0,i=t.length;e<i;e++){var
n=t[e];0===(n._name&&n._name.search("CHILD_ARMATURE-"))&&n.destroy()}},_updateBatch
:function(){var t=this._materialCache;for(var e in t){var i=t[e];i&&(i.useModel=!
this.enableBatch)}},setMaterial:function(t,e)
{this._super(t,e),this._materialCache={}},__preload:function()
{this._init()},_init:function(){if(!this._inited){this._inited=!
0,this._parseDragonAtlasAsset(),this._refresh(),this._activateMaterial();for(var
t=this.node.children,e=0,i=t.length;e<i;e++){var

n=t[e];n&&"DEBUG_DRAW_NODE"===n._name&&n.destroy()}this._updateDebugDraw()}},getArm
atureKey:function(){return this._armatureKey},setAnimationCacheMode:function(t)
{this._preCacheMode!
==t&&(this._cacheMode=t,this._buildArmature())},isAnimationCached:function(){return
this._cacheMode!==c.REALTIME},onEnable:function(){this._super(),this._armature&&!
this.isAnimationCached()&&this._factory._dragonBones.clock.add(this._armature),this
._activateMaterial()},onDisable:function(){this._super(),this._armature&&!
this.isAnimationCached()&&this._factory._dragonBones.clock.remove(this._armature)},
update:function(t){if(this.isAnimationCached()&&this._playing){var
e=this._frameCache.frames,i=this._frameCache.totalTime,n=e.length;0==this._accTime&
&0==this._playCount&&this._eventTarget&&this._eventTarget.emit(dragonBones.EventObj
ect.START);var r=dragonBones.timeScale;this._accTime+=t*this.timeScale*r;var
s=Math.floor(this._accTime/i*n);if(s>=n)
{if(this._eventTarget&&this._eventTarget.emit(dragonBones.EventObject.LOOP_COMPLETE
),this._eventTarget&&this._eventTarget.emit(dragonBones.EventObject.COMPLETE),this.
_playCount++,-1===this.playTimes||
this.playTimes>0&&this._playCount>=this.playTimes)return
this._accTime=0,this._playing=!
1,void(this._playCount=0);this._accTime=0,s=0}this._curFrame=e[s]}},onDestroy:funct
ion(){this._super(),this._inited=!1,this._cacheMode===c.PRIVATE_CACHE?
(this._armatureCache.dispose(),this._armatureCache=null,this._armature=null):this._
cacheMode===c.SHARED_CACHE?
(this._armatureCache=null,this._armature=null):this._armature&&(this._armature.disp
ose(),this._armature=null)},_updateDebugDraw:function(){if(this.debugBones){if(!
this._debugDraw){var t=new cc.PrivateNode;t.name="DEBUG_DRAW_NODE";var
e=t.addComponent(a);e.lineWidth=1,e.strokeColor=cc.color(255,0,0,255),this._debugDr
aw=e}this._debugDraw.node.parent=this.node}else
this._debugDraw&&(this._debugDraw.node.parent=null)},_activateMaterial:function()
{var t=this.dragonAtlasAsset&&this.dragonAtlasAsset.texture;if(t){var
e=this.sharedMaterials[0];e?e=r.getInstantiatedMaterial(e,this):
((e=r.getInstantiatedBuiltinMaterial("sprite",this)).define("_USE_MODEL",!
0),e.define("USE_TEXTURE",!
0)),e.setProperty("texture",t),this.setMaterial(0,e),this.markForRender(!0)}else
this.disableRender()},_buildArmature:function()
{if(this.dragonAsset&&this.dragonAtlasAsset&&this.armatureName)
{this._armature&&(this._preCacheMode===c.PRIVATE_CACHE?
this._armatureCache.dispose():this._preCacheMode===c.REALTIME&&this._armature.dispo
se(),this._armatureCache=null,this._armature=null,this._displayProxy=null,this._fra
meCache=null,this._curFrame=null,this._playing=!
1,this._preCacheMode=null),this._cacheMode===c.SHARED_CACHE?
this._armatureCache=o.sharedCache:this._cacheMode===c.PRIVATE_CACHE&&(this._armatur
eCache=new o);var
t=this.dragonAtlasAsset._uuid;if(this._armatureKey=this.dragonAsset.init(this._fact
ory,t),this.isAnimationCached()&&(this._armature=this._armatureCache.getArmatureCac
he(this.armatureName,this._armatureKey,t),this._armature||
(this._cacheMode=c.REALTIME)),this._preCacheMode=this._cacheMode,this._cacheMode===
c.REALTIME)
{if(this._displayProxy=this._factory.buildArmatureDisplay(this.armatureName,this._a
rmatureKey,"",t),!
this._displayProxy)return;this._displayProxy._ccNode=this.node,this._displayProxy.s
etEventTarget(this._eventTarget),this._armature=this._displayProxy._armature,this._
armature.animation.timeScale=this.timeScale}this._cacheMode!
==c.REALTIME&&this.debugBones&&cc.warn("Debug bones is invalid in cached
mode"),this._updateBatch(),this.animationName&&this.playAnimation(this.animationNam
e,this.playTimes)}},_parseDragonAtlasAsset:function()
{this.dragonAtlasAsset&&this.dragonAtlasAsset.init(this._factory)},_refresh:functio
n(){this._buildArmature()},_updateCacheModeEnum:!1,_updateAnimEnum:!
1,_updateArmatureEnum:!1,playAnimation:function(t,e){if(this.playTimes=void 0===e?-
1:e,this.animationName=t,this.isAnimationCached()){var
i=this._armatureCache.getAnimationCache(this._armatureKey,t);i||
(i=this._armatureCache.updateAnimationCache(this._armatureKey,t)),i&&(this._accTime
=0,this._playCount=0,this._frameCache=i,this._playing=!
0,this._curFrame=this._frameCache.frames[0])}else if(this._armature)return
this._armature.animation.play(t,this.playTimes)},updateAnimationCache:function(t)
{if(this.isAnimationCached()){var
e=this._armatureCache.updateAnimationCache(this._armatureKey,t);this._frameCache=e|
|this._frameCache}},getArmatureNames:function(){var
t=this._factory.getDragonBonesData(this._armatureKey);return t&&t.armatureNames||
[]},getAnimationNames:function(t){var
e=[],i=this._factory.getDragonBonesData(this._armatureKey);if(i){var
n=i.getArmature(t);if(n)for(var r in
n.animations)n.animations.hasOwnProperty(r)&&e.push(r)}return e},on:function(t,e,i)
{this.addEventListener(t,e,i)},off:function(t,e,i)
{this.removeEventListener(t,e,i)},once:function(t,e,i)
{this._eventTarget.once(t,e,i)},addEventListener:function(t,e,i)
{this._eventTarget.on(t,e,i)},removeEventListener:function(t,e,i)
{this._eventTarget.off(t,e,i)},buildArmature:function(t,e){return
this._factory.createArmatureNode(this,t,e)},armature:function(){return
this._armature}});e.exports=dragonBones.ArmatureDisplay=u}),
{"../../cocos2d/core/CCNode":52,"../../cocos2d/core/assets/material/CCMaterial":75,
"../../cocos2d/core/components/CCRenderComponent":106,"../../cocos2d/core/event/eve
nt-
target":132,"../../cocos2d/core/graphics/graphics":141,"./ArmatureCache":389}],391:
[(function(t,e,i){"use strict";var n=t("../../cocos2d/core/event/event-
target");dragonBones.CCArmatureDisplay=cc.Class({name:"dragonBones.CCArmatureDispla
y",properties:{node:{get:function(){return this}}},ctor:function()
{this._eventTarget=new n},setEventTarget:function(t)
{this._eventTarget=t},getRootDisplay:function(){var t,e=this._armature._parent;if(!
e)return this;for(;e;)t=e,e=e._armature._parent;return
t._armature.getDisplay()},convertToRootSpace:function(t){var
e=this._armature._parent;if(!e)return t;e.updateWorldMatrix();var
i=e._worldMatrix,n=cc.v2(0,0);return
n.x=t.x*i.m00+t.y*i.m04+i.m12,n.y=t.x*i.m01+t.y*i.m05+i.m13,n},convertToWorldSpace:
function(t){var e=this.convertToRootSpace(t);return
this.getRootNode().convertToWorldSpace(e)},getRootNode:function(){var
t=this.getRootDisplay();return t&&t._ccNode},dbInit:function(t)
{this._armature=t},dbClear:function(){this._armature=null},dbUpdate:function()
{},advanceTimeBySelf:function(t){this.shouldAdvanced=!!
t},hasDBEventListener:function(t){return
this._eventTarget.hasEventListener(t)},addDBEventListener:function(t,e,i)
{this._eventTarget.on(t,e,i)},removeDBEventListener:function(t,e,i)
{this._eventTarget.off(t,e,i)},dispatchDBEvent:function(t,e)
{this._eventTarget.emit(t,e)}})}),{"../../cocos2d/core/event/event-
target":132}],392:[(function(t,e,i){"use strict";var
n=dragonBones.BaseObject,r=dragonBones.BaseFactory,s=dragonBones.CCFactory=cc.Class
({name:"dragonBones.CCFactory",extends:r,statics:
{_factory:null,getInstance:function(){return s._factory||(s._factory=new
s),s._factory}},ctor:function(){var t=new
dragonBones.CCArmatureDisplay;this._dragonBones=new
dragonBones.DragonBones(t),cc.director._scheduler&&(cc.game.on(cc.game.EVENT_RESTAR
T,this.initUpdate,this),this.initUpdate())},initUpdate:function(t)
{cc.director._scheduler.enableForTarget(this),cc.director._scheduler.scheduleUpdate
(this,cc.Scheduler.PRIORITY_SYSTEM,!1)},update:function(t)
{this._dragonBones.advanceTime(t)},getDragonBonesDataByRawData:function(t){return(t
instanceof ArrayBuffer?
r._binaryParser:this._dataParser).parseDragonBonesData(t,1)},buildArmatureDisplay:f
unction(t,e,i,n){var r=this.buildArmature(t,e,i,n);return
r&&r._display},createArmatureNode:function(t,e,i){var n=(i=i||new
cc.Node).getComponent(dragonBones.ArmatureDisplay);return n||
(n=i.addComponent(dragonBones.ArmatureDisplay)),i.name=e,n._armatureName=e,n._N$dra
gonAsset=t.dragonAsset,n._N$dragonAtlasAsset=t.dragonAtlasAsset,n._init(),n},_build
TextureAtlasData:function(t,e){return t?
t.renderTexture=e:t=n.borrowObject(dragonBones.CCTextureAtlasData),t},_sortSlots:fu
nction(){for(var t=this._slots,e=[],i=0,n=t.length;i<n;i++){for(var
r=t[i],s=r._zOrder,a=!1,o=e.length-1;o>=0;o--)if(s>=e[o]._zOrder)
{e.splice(o+1,0,r),a=!0;break}a||
e.splice(0,0,r)}this._slots=e},_buildArmature:function(t){var
e=n.borrowObject(dragonBones.Armature);e._skinData=t.skin,e._animation=n.borrowObje
ct(dragonBones.Animation),e._animation._armature=e,e._animation.animations=t.armatu
re.animations,e._isChildArmature=!1;var i=new dragonBones.CCArmatureDisplay;return
e.init(t.armature,i,i,this._dragonBones),e},_buildSlot:function(t,e,i){var
r=n.borrowObject(dragonBones.CCSlot),s=r;return
r.init(e,i,s,s),r},getDragonBonesDataByUUID:function(t){for(var e in
this._dragonBonesDataMap)if(-1!=e.indexOf(t))return
this._dragonBonesDataMap[e];return null},removeDragonBonesDataByUUID:function(t,e)
{for(var i in void 0===e&&(e=!0),this._dragonBonesDataMap)-1!
==i.indexOf(t)&&(e&&this._dragonBones.bufferObject(this._dragonBonesDataMap[i]),del
ete this._dragonBonesDataMap[i])}})}),{}],393:[(function(t,e,i){"use strict";var
n=t("../../cocos2d/core/vmath"),r=dragonBones.BinaryOffset,s=dragonBones.BoneType;d
ragonBones.CCSlot=cc.Class({name:"dragonBones.CCSlot",extends:dragonBones.Slot,ctor
:function()
{this._localVertices=[],this._indices=[],this._matrix=n.mat4.create(),this._worldMa
trix=n.mat4.create(),this._worldMatrixDirty=!0,this._visible=!
1,this._color=cc.color()},_onClear:function()
{this._super(),this._localVertices.length=0,this._indices.length=0,n.mat4.identity(
this._matrix),n.mat4.identity(this._worldMatrix),this._worldMatrixDirty=!
0,this._color=cc.color(),this._visible=!1},statics:{toString:function()
{return"[class dragonBones.CCSlot]"}},_onUpdateDisplay:function()
{},_initDisplay:function(t){},_addDisplay:function(){this._visible=!
0},_replaceDisplay:function(t){},_removeDisplay:function(){this._visible=!
1},_disposeDisplay:function(t){},_updateVisible:function()
{},_updateZOrder:function(){},_updateBlendMode:function(){if(this._child
Armature)for(var t=this._childArmature.getSlots(),e=0,i=t.length;e<i;e++){var
n=t[e];n._blendMode=this._blendMode,n._updateBlendMode()}},_updateColor:function()
{var
t=this._color;t.r=255*this._colorTransform.redMultiplier,t.g=255*this._colorTransfo
rm.greenMultiplier,t.b=255*this._colorTransform.blueMultiplier,t.a=255*this._colorT
ransform.alphaMultiplier},getTexture:function(){return
this._textureData&&this._textureData.spriteFrame&&this._textureData.spriteFrame.get
Texture()},_updateFrame:function(){this._indices.length=0;var
t=this._indices,e=this._localVertices,i=0,n=0,s=this._textureData;if(this._display&
&!(this._displayIndex<0)&&s){var a=this._displayIndex<this.rawDisplayDatas.length?
this.rawDisplayDatas[this._displayIndex]:null,o=this._armature._replacedTexture||
s.parent.renderTexture;if(o&&(!s.spriteFrame||s.spriteFrame.getTexture()!==o)){var
l=cc.rect(s.region.x,s.region.y,s.region.width,s.region.height),h=cc.v2(0,0),c=cc.s
ize(s.region.width,s.region.height);s.spriteFrame=new
cc.SpriteFrame,s.spriteFrame.setTexture(o,l,!1,h,c)}var
u=o.width,_=o.height,f=s.region,d=this._meshData;if(d){var
m=this._armature._armatureData.scale,p=d.parent.parent.parent,v=p.intArray,y=p.floa
tArray,g=v[d.offset+r.MeshVertexCount],x=v[d.offset+r.MeshTriangleCount],b=v[d.offs
et+r.MeshFloatOffset];b<0&&(b+=65536);for(var A=b+2*g,C=0,S=g;C<S;C++)e[n+
+]=y[b+2*C]*m,e[n++]=-y[b+2*C+1]*m,e[n++]=(f.x+y[A+2*C]*f.width)/u,e[n+
+]=(f.y+y[A+2*C+1]*f.height)/_;for(var T=0;T<3*x;++T)t[i+
+]=v[d.offset+r.MeshVertexIndices+T];e.length=n,t.length=i,this._pivotX=0,this._piv
otY=0}else{var
w=this._armature.armatureData.scale;this._pivotX=a.pivot.x,this._pivotY=a.pivot.y;v
ar E=s.frame||s.region,M=E.width*w,D=E.height*w;!
s.frame&&s.rotated&&(M=E.height,D=E.width),this._pivotX*=M,this._pivotY*=D,s.frame&
&(this._pivotX+=s.frame.x*w,this._pivotY+=s.frame.y*w),this._pivotY-=f.height*w;var
B=f.x/u,P=(f.y+f.height)/_,I=(f.x+f.width)/u,R=f.y/_;e[n++]=0,e[n++]=0,e[n+
+]=B,e[n++]=P,e[n++]=f.width,e[n++]=0,e[n++]=I,e[n++]=P,e[n++]=0,e[n+
+]=f.height,e[n++]=B,e[n++]=R,e[n++]=f.width,e[n++]=f.height,e[n++]=I,e[n+
+]=R,t[0]=0,t[1]=1,t[2]=2,t[3]=1,t[4]=3,t[5]=2,e.length=n,t.length=6,this._blendMod
eDirty=!0}}},_updateMesh:function(){var
t=this._armature._armatureData.scale,e=this._meshData,i=this._deformVertices.length
>0&&e.inheritDeform,n=e.weight,a=this._localVertices;if(null!==n){var
o=e.parent.parent.parent,l=o.intArray,h=o.floatArray,c=l[e.offset+r.MeshVertexCount
],u=l[n.offset+r.WeigthFloatOffset];u<0&&(u+=65536);for(var
_=0,f=n.offset+r.WeigthBoneIndices+n.bones.length,d=u,m=0,p=0;_<c;_++,p+=4){for(var
v=l[f++],y=0,g=0,x=0;x<v;++x){var b=l[f++],A=this._meshBones[b];if(null!==A){var
C=A.globalTransformMatrix,S=h[d++],T=h[d++]*t,w=h[d+
+]*t;i&&(T+=this._deformVertices[m++],w+=this._deformVertices[m+
+]),y+=(C.a*T+C.c*w+C.tx)*S,g+=(C.b*T+C.d*w+C.ty)*S}}a[p]=y,a[p+1]=-g}}else if(i)
{var E=this._parent._boneData.type!
==s.Bone,M=e.parent.parent.parent,D=M.intArray,B=M.floatArray,P=D[e.offset+r.MeshVe
rtexCount],I=D[e.offset+r.MeshFloatOffset];I<0&&(I+=65536);for(var
R=0,O=P,L=0;R<O;R++,L+=4){var
F=B[I+2*R]*t+this._deformVertices[2*R],V=B[I+2*R+1]*t+this._deformVertices[2*R+1];i
f(E){var
N=this._parent._getGlobalTransformMatrix(F,V);a[L]=N.a*F+N.c*V+N.tx,a[L+1]=-
N.b*F+N.d*V+N.ty}else a[L]=F,a[L+1]=-V}}},_updateTransform:function(){var
t=this._matrix;t.m00=this.globalTransformMatrix.a,t.m01=-
this.globalTransformMatrix.b,t.m04=-
this.globalTransformMatrix.c,t.m05=this.globalTransformMatrix.d,t.m12=this.globalTr
ansformMatrix.tx-
(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivot
Y),t.m13=-(this.globalTransformMatrix.ty-
(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivot
Y)),this._worldMatrixDirty=!0},updateWorldMatrix:function(){if(this._armature){var
t=this._armature._parent;if(t&&t.updateWorldMatrix(),this._worldMatrixDirty)
{this.calculWorldMatrix();var e=this.childArmature;if(!e)return;for(var
i=e.getSlots(),n=0,r=i.length;n<r;n++){var s=i[n];s&&(s._worldMatrixDirty=!
0)}}}},_mulMat:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m04,a=e.m05,o=e.m12,l=e.m13,h=i.m00,c=i.m01,u=i.m04,_=i.m05,f=i
.m12,d=i.m13;0!==r||0!==s?
(t.m00=h*n+c*s,t.m01=h*r+c*a,t.m04=u*n+_*s,t.m05=u*r+_*a,t.m12=n*f+s*d+o,t.m13=r*f+
a*d+l):
(t.m00=h*n,t.m01=c*a,t.m04=u*n,t.m05=_*a,t.m12=n*f+o,t.m13=a*d+l)},calculWorldMatri
x:function(){var t=this._armature._parent;t?
this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):n.mat4.copy(this._world
Matrix,this._matrix),this._worldMatrixDirty=!1}})}),
{"../../cocos2d/core/vmath":316}],394:[(function(t,e,i){"use
strict";dragonBones.CCTextureAtlasData=cc.Class({extends:dragonBones.TextureAtlasDa
ta,properties:{texture:{default:null,serializable:!1}},statics:{toString:function()
{return"[class dragonBones.CCTextureAtlasData]"}},_onClear:function()
{dragonBones.TextureAtlasData.prototype._onClear.call(this),this.texture=null},crea
teTexture:function(){return
dragonBones.BaseObject.borrowObject(dragonBones.CCTextureData)}}),dragonBones.CCTex
tureData=cc.Class({extends:dragonBones.TextureData,properties:{texture:
{default:null,serializable:!1}},statics:{toString:function(){return"[class
dragonBones.CCTextureData]"}},_onClear:function()
{dragonBones.TextureData.prototype._onClear.call(this),this.texture=null}})}),
{}],395:[(function(t,e,i){"use strict";var
n=t("./ArmatureCache").sharedCache,r=cc.Class({name:"dragonBones.DragonBonesAsset",
extends:cc.Asset,ctor:function(){this.reset()},properties:
{_dragonBonesJson:"",dragonBonesJson:{get:function(){return
this._dragonBonesJson},set:function(t)
{this._dragonBonesJson=t,this.reset()}},_nativeAsset:{get:function(){return
this._buffer},set:function(t){this._buffer=t.buffer||t,this.reset()},override:!
0}},statics:{preventDeferredLoadDependents:!0},createNode:!1,reset:function()
{this._clear()},init:function(t,e){this._factory=t;var
i=null;if(i=this.dragonBonesJson?
JSON.parse(this.dragonBonesJson):this._nativeAsset,!this._uuid){var
n=this._factory.getDragonBonesDataByRawData(i);n?
this._uuid=n.name:cc.warn("dragonbones name is empty")}var
r=this._uuid+"#"+e;return this._factory.getDragonBonesData(r)?r:
(this._factory.parseDragonBonesData(i,r),r)},getArmatureEnum:!1,getAnimsEnum:!
1,_clear:function()
{this._factory&&(n.resetArmature(this._uuid),this._factory.removeDragonBonesDataByU
UID(this._uuid,!0))},destroy:function()
{this._clear(),this._super()}});dragonBones.DragonBonesAsset=e.exports=r}),
{"./ArmatureCache":389}],396:[(function(t,e,i){"use strict";var
n=t("./ArmatureCache").sharedCache,r=cc.Class({name:"dragonBones.DragonBonesAtlasAs
set",extends:cc.Asset,ctor:function(){this._clear()},properties:
{_atlasJson:"",atlasJson:{get:function(){return this._atlasJson},set:function(t)
{this._atlasJson=t,this._clear()}},_texture:
{default:null,type:cc.Texture2D,formerlySerializedAs:"texture"},texture:
{get:function(){return this._texture},set:function(t)
{this._texture=t,this._clear()}},_textureAtlasData:null},statics:
{preventDeferredLoadDependents:!0},createNode:!1,init:function(t)
{this._factory=t;var e=JSON.parse(this.atlasJson);this._uuid=this._uuid||
e.name,this._textureAtlasData?
t.addTextureAtlasData(this._textureAtlasData,this._uuid):this._textureAtlasData=t.p
arseTextureAtlasData(e,this.texture,this._uuid)},_clear:function()
{this._factory&&(n.resetArmature(this._uuid),this._factory.removeTextureAtlasData(t
his._uuid,!0),this._factory.removeDragonBonesDataByUUID(this._uuid,!
0)),this._textureAtlasData=null},destroy:function()
{this._clear(),this._super()}});dragonBones.DragonBonesAtlasAsset=e.exports=r}),
{"./ArmatureCache":389}],397:[(function(t,e,i){"use strict";var
n="undefined"==typeof window?
global:window;n.dragonBones=t("./lib/dragonBones"),void 0!
==n.dragonBones&&(dragonBones._timeScale=1,Object.defineProperty(dragonBones,"timeS
cale",{get:function(){return this._timeScale},set:function(t)
{this._timeScale=t,this.CCFactory.getInstance()._dragonBones.clock.timeScale=t},con
figurable:!
0}),dragonBones.DisplayType={Image:0,Armature:1,Mesh:2},dragonBones.ArmatureType={A
rmature:0,MovieClip:1,Stage:2},dragonBones.ExtensionType={FFD:0,AdjustColor:10,Beve
lFilter:11,BlurFilter:12,DropShadowFilter:13,GlowFilter:14,GradientBevelFilter:15,G
radientGlowFilter:16},dragonBones.EventType={Frame:0,Sound:1},dragonBones.ActionTyp
e={Play:0,Stop:1,GotoAndPlay:2,GotoAndStop:3,FadeIn:4,FadeOut:5},dragonBones.Animat
ionFadeOutMode={None:0,SameLayer:1,SameGroup:2,SameLayerAndGroup:3,All:4},dragonBon
es.BinaryOffset={WeigthBoneCount:0,WeigthFloatOffset:1,WeigthBoneIndices:2,MeshVert
exCount:0,MeshTriangleCount:1,MeshFloatOffset:2,MeshWeightOffset:3,MeshVertexIndice
s:4,TimelineScale:0,TimelineOffset:1,TimelineKeyFrameCount:2,TimelineFrameValueCoun
t:3,TimelineFrameValueOffset:4,TimelineFrameOffset:5,FramePosition:0,FrameTweenType
:1,FrameTweenEasingOrCurveSampleCount:2,FrameCurveSamples:3,DeformMeshOffset:0,Defo
rmCount:1,DeformValueCount:2,DeformValueOffset:3,DeformFloatOffset:4},dragonBones.B
oneType={Bone:0,Surface:1},t("./CCFactory"),t("./CCSlot"),t("./CCTextureData"),t(".
/CCArmatureDisplay"),t("./ArmatureCache"),t("./DragonBonesAsset"),t("./DragonBonesA
tlasAsset"),t("./ArmatureDisplay"),t("./webgl-assembler"))}),
{"./ArmatureCache":389,"./ArmatureDisplay":390,"./CCArmatureDisplay":391,"./CCFacto
ry":392,"./CCSlot":393,"./CCTextureData":394,"./DragonBonesAsset":395,"./DragonBone
sAtlasAsset":396,"./lib/dragonBones":398,"./webgl-assembler":399}],398:
[(function(t,e,i){"use strict";var n,r="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return typeof t}:function(t){return
t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},s=(function(){var t=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var
i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n()
{this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):
(n.prototype=i.prototype,new
n)}})();n||(n={}),(function(t){var e=(function(){function e(i){this._clock=new
t.WorldClock,this._events=[],this._objects=[],this._eventManager=null,this._eventMa
nager=i,console.log("DragonBones: "+e.VERSION+"\nWebsite:
http://dragonbones.com/\nSource and Demos: https://github.com/DragonBones/")}return
e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var
i=0,n=this._objects;i<n.length;i++)
{n[i].returnToPool()}this._objects.length=0}if(this._clock.advanceTime(e),this._eve
nts.length>0){for(var r=0;r<this._events.length;++r){var
s=this._events[r],a=s.armature;null!
==a._armatureData&&(a.eventDispatcher.dispatchDBEvent(s.type,s),s.type===t.EventObj
ect.SOUND_EVENT&&this._eventManager.dispatchDBEvent(s.type,s)),this.bufferObject(s)
}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.prototy
pe,"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.6.2",e.yDown=!
0,e.debug=!1,e.debugDraw=!1,e.webAssembly=!1,e})();t.DragonBones=e,console.warn||
(console.warn=function(){}),console.assert||(console.assert=function(){})})(n||
(n={})),(function(t){var e=(function(){function t(){this.hashCode=t._hashCode+
+,this._isInPool=!1}return t._returnObject=function(e){var
i=String(e.constructor),n=i in t._maxCountMap?
t._maxCountMap[i]:t._defaultMaxCount,r=t._poolsMap[i]=t._poolsMap[i]||
[];r.length<n&&(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,i){if((i<0||i!=i)&&(i=0),null!==e)null!
==(r=(n=String(e))in t._poolsMap?
t._poolsMap[n]:null)&&r.length>i&&(r.length=i),t._maxCountMap[n]=i;else for(var n
in t._defaultMaxCount=i,t._poolsMap){var r;
(r=t._poolsMap[n]).length>i&&(r.length=i),n in
t._maxCountMap&&(t._maxCountMap[n]=i)}},t.clearPool=function(e){if(void
0===e&&(e=null),null!==e){var i=String(e);null!==(r=i in t._poolsMap?
t._poolsMap[i]:null)&&r.length>0&&(r.length=0)}else for(var n in t._poolsMap){var
r;(r=t._poolsMap[n]).length=0}},t.borrowObject=function(e){var i=String(e),n=i in
t._poolsMap?t._poolsMap[i]:null;if(null!==n&&n.length>0){var r=n.pop();return
r._isInPool=!1,r}var s=new e;return
s._onClear(),s},t.prototype.returnToPool=function()
{this._onClear(),t._returnObject(this)},t._hashCode=0,t._defaultMaxCount=3e3,t._max
CountMap={},t._poolsMap={},t})();t.BaseObject=e})(n||(n={})),(function(t){var
e=(function(){function t(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void
0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void
0===s&&(s=0),this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=s}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.proto
type.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],t
his.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,i=0,n=0,r=this.d*t.d,s=this.tx*t.a+t.tx,a=this.ty*t.d+t.ty;return
0===this.b&&0===this.c||
(e+=this.b*t.c,i+=this.b*t.d,n+=this.c*t.a,r+=this.c*t.b),0===t.b&&0===t.c||
(i+=this.a*t.b,n+=this.d*t.c,s+=this.ty*t.c,a+=this.tx*t.b),this.a=e,this.b=i,this.
c=n,this.d=r,this.tx=s,this.ty=a,this},t.prototype.invert=function(){var
t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,s=this.ty;if(0===e&&0===i)return
this.b=this.c=0,0===t||0===n?this.a=this.b=this.tx=this.ty=0:
(t=this.a=1/t,n=this.d=1/n,this.tx=-t*r,this.ty=-n*s),this;var a=t*n-
e*i;if(0===a)return
this.a=this.d=1,this.b=this.c=0,this.tx=this.ty=0,this;a=1/a;var
o=this.a=n*a;return e=this.b=-e*a,i=this.c=-i*a,n=this.d=t*a,this.tx=-
(o*r+i*s),this.ty=-(e*r+n*s),this},t.prototype.transformPoint=function(t,e,i,n)
{void 0===n&&(n=!1),i.x=this.a*t+this.c*e,i.y=this.b*t+this.d*e,n||
(i.x+=this.tx,i.y+=this.ty)},t.prototype.transformRectangle=function(t,e){void
0===e&&(e=!1);var i=this.a,n=this.b,r=this.c,s=this.d,a=e?0:this.tx,o=e?
0:this.ty,l=t.x,h=t.y,c=l+t.width,u=h+t.height,_=i*l+r*h+a,f=n*l+s*h+o,d=i*c+r*h+a,
m=n*c+s*h+o,p=i*c+r*u+a,v=n*c+s*u+o,y=i*l+r*u+a,g=n*l+s*u+o,x=0;_>d&&(x=_,_=d,d=x),
p>y&&(x=p,p=y,y=x),t.x=Math.floor(_<p?_:p),t.width=Math.ceil((d>y?d:y)-
t.x),f>m&&(x=f,f=m,m=x),v>g&&(x=v,v=g,g=x),t.y=Math.floor(f<v?
f:v),t.height=Math.ceil((m>g?m:g)-t.y)},t})();t.Matrix=e})(n||(n={})),(function(t)
{var e=(function(){function t(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void
0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=1),void
0===s&&(s=1),this.x=t,this.y=e,this.skew=i,this.rotation=n,this.scaleX=r,this.scale
Y=s}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.scale
X,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.prototy
pe.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.fromMatri
x=function(e){var
i=this.scaleX,n=this.scaleY,r=t.PI_Q;this.x=e.tx,this.y=e.ty,this.rotation=Math.ata
n(e.b/e.a);var s=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=s>-r&&s<r?
e.d/Math.cos(s):-e.c/Math.sin(s),i>=0&&this.scaleX<0&&(this.scaleX=-
this.scaleX,this.rotation=this.rotation-
Math.PI),n>=0&&this.scaleY<0&&(this.scaleY=-this.scaleY,s-=Math.PI),this.skew=s-
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})(n||(n={})),(function(t){var
e=(function(){function t(t,e,i,n,r,s,a,o){void 0===t&&(t=1),void 0===e&&(e=1),void
0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),void
0===a&&(a=0),void
0===o&&(o=0),this.alphaMultiplier=t,this.redMultiplier=e,this.greenMultiplier=i,thi
s.blueMultiplier=n,this.alphaOffset=r,this.redOffset=s,this.greenOffset=a,this.blue
Offset=o}return t.prototype.copyFrom=function(t)
{this.alphaMultiplier=t.alphaMultiplier,this.redMultiplier=t.redMultiplier,this.gre
enMultiplier=t.greenMultiplier,this.blueMultiplier=t.blueMultiplier,this.alphaOffse
t=t.alphaOffset,this.redOffset=t.redOffset,this.greenOffset=t.greenOffset,this.blue
Offset=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})(n||(n={})),(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})(n||(n={})),(function(t){var e=(function(){function t(t,e,i,n){void
0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void
0===n&&(n=0),this.x=t,this.y=e,this.width=i,this.height=n}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=f
unction(){this.x=this.y=0,this.width=this.height=0},t})();t.Rectangle=e})(n||
(n={})),(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 s(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 i=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.data=null,e}return
s(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=i})(n||(n={})),
(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=nu
ll,e}return s(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.l
ength=0,this.cachedFrames.length=0,this.armatureNames.length=0,this.binary=null,thi
s.intArray=null,this.floatArray=null,this.frameIntArray=null,this.frameFloatArray=n
ull,this.frameArray=null,this.timelineArray=null,this.userData=null},e.prototype.ad
dArmature=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.prototy
pe.getArmature=function(t){return t in this.armatures?
this.armatures[t]:null},e.prototype.dispose=function()
{console.warn("\u5df2\u5e9f\u5f03"),this.returnToPool()},e})
(t.BaseObject);t.DragonBonesData=e})(n||(n={})),(function(t){var e=(function(e)
{function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.aabb=new
t.Rectangle,i.animationNames=[],i.sortedBones=[],i.sortedSlots=[],i.defaultActions=
[],i.actions=[],i.bones={},i.slots={},i.constraints={},i.skins={},i.animations={},i
.canvas=null,i.userData=null,i}return s(i,e),i.toString=function(){return"[class
dragonBones.ArmatureData]"},i.prototype._onClear=function(){for(var
t=0,e=this.defaultActions;t<e.length;t++){e[t].returnToPool()}for(var
i=0,n=this.actions;i<n.length;i++){n[i].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.cac
heFrameRate=0,this.scale=1,this.name="",this.aabb.clear(),this.animationNames.lengt
h=0,this.sortedBones.length=0,this.sortedSlots.length=0,this.defaultActions.length=
0,this.actions.length=0,this.defaultSkin=null,this.defaultAnimation=null,this.canva
s=null,this.userData=null,this.parent=null},i.prototype.sortBones=function(){var
t=this.sortedBones.length;if(!(t<=0)){var
e=this.sortedBones.concat(),i=0,n=0;for(this.sortedBones.length=0;n<t;){var r=e[i+
+];if(i>=t&&(i=0),!(this.sortedBones.indexOf(r)>=0)){var s=!1;for(var a in
this.constraints){var
o=this.constraints[a];if(o.root===r&&this.sortedBones.indexOf(o.target)<0){s=!
0;break}}s||null!==r.parent&&this.sortedBones.indexOf(r.parent)<0||
(this.sortedBones.push(r),n++)}}}},i.prototype.cacheFrames=function(t){if(!
(this.cacheFrameRate>0))for(var e in
this.cacheFrameRate=t,this.animations)this.animations[e].cacheFrames(this.cacheFram
eRate)},i.prototype.setCacheFrame=function(t,e){var
i=this.parent.cachedFrames,n=i.length;return
i.length+=10,i[n]=t.a,i[n+1]=t.b,i[n+2]=t.c,i[n+3]=t.d,i[n+4]=t.tx,i[n+5]=t.ty,i[n+
6]=e.rotation,i[n+7]=e.skew,i[n+8]=e.scaleX,i[n+9]=e.scaleY,n},i.prototype.getCache
Frame=function(t,e,i){var
n=this.parent.cachedFrames;t.a=n[i],t.b=n[i+1],t.c=n[i+2],t.d=n[i+3],t.tx=n[i+4],t.
ty=n[i+5],e.rotation=n[i+6],e.skew=n[i+7],e.scaleX=n[i+8],e.scaleY=n[i+9],e.x=t.tx,
e.y=t.ty},i.prototype.addBone=function(t){t.name in this.bones?console.warn("Same
bone: "+t.name):
(this.bones[t.name]=t,this.sortedBones.push(t))},i.prototype.addSlot=function(t)
{t.name in this.slots?console.warn("Same slot: "+t.name):
(this.slots[t.name]=t,this.sortedSlots.push(t))},i.prototype.addConstraint=function
(t){t.name in this.constraints?console.warn("Same constraint:
"+t.name):this.constraints[t.name]=t},i.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))},i.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===th
is.defaultAnimation&&(this.defaultAnimation=t))},i.prototype.addAction=function(t,e
){e?
this.defaultActions.push(t):this.actions.push(t)},i.prototype.getBone=function(t)
{return t in this.bones?this.bones[t]:null},i.prototype.getSlot=function(t){return
t in this.slots?this.slots[t]:null},i.prototype.getConstraint=function(t){return t
in this.constraints?this.constraints[t]:null},i.prototype.getSkin=function(t)
{return t in this.skins?this.skins[t]:null},i.prototype.getMesh=function(t,e,i){var
n=this.getSkin(t);return null===n?
null:n.getDisplay(e,i)},i.prototype.getAnimation=function(t){return t in
this.animations?this.animations[t]:null},i})(t.BaseObject);t.ArmatureData=e;var
i=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return
i.transform=new t.Transform,i.userData=null,i}return s(i,e),i.toString=function()
{return"[class dragonBones.BoneData]"},i.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.name="",this.transform.identity(),this.userData=nu
ll,this.parent=null},i})(t.BaseObject);t.BoneData=i;var n=(function(t){function e()
{var e=null!==t&&t.apply(this,arguments)||this;return e.vertices=[],e}return
s(e,t),e.toString=function(){return"[class
dragonBones.SurfaceData]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.type=1,this.segmentX=0,this.segmentY=0,this.v
ertices.length=0},e})(i);t.SurfaceData=n;var r=(function(e){function i(){var
t=null!==e&&e.apply(this,arguments)||this;return
t.color=null,t.userData=null,t}return s(i,e),i.createColor=function(){return new
t.ColorTransform},i.toString=function(){return"[class
dragonBones.SlotData]"},i.prototype._onClear=function(){null!
==this.userData&&this.userData.returnToPool(),this.blendMode=0,this.displayIndex=0,
this.zOrder=0,this.name="",this.color=null,this.userData=null,this.parent=null},i.D
EFAULT_COLOR=new t.ColorTransform,i})(t.BaseObject);t.SlotData=r})(n||(n={})),
(function(t){var e=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype._onClear=function()
{this.order=0,this.name="",this.target=null,this.root=null,this.bone=null},e})
(t.BaseObject);t.ConstraintData=e;var i=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return s(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=i})(n||(n={})),(function(t){var
e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(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})(n||(n={})),(function(t){var e=(function(t){function
e(){var e=null!==t&&t.apply(this,arguments)||this;return e.displays={},e}return
s(e,t),e.toString=function(){return"[class
dragonBones.SkinData]"},e.prototype._onClear=function(){for(var t in this.displays)
{for(var e=0,i=this.displays[t];e<i.length;e++){var n=i[e];null!
==n&&n.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 i=this.getDisplays(t);if(null!==i)for(var n=0,r=i;n<r.length;n++){var
s=r[n];if(null!==s&&s.name===e)return s}return
null},e.prototype.getDisplays=function(t){return t in this.displays?
this.displays[t]:null},e})(t.BaseObject);t.SkinData=e})(n||(n={})),(function(t){var
e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return
i.transform=new t.Transform,i}return s(i,e),i.prototype._onClear=function()
{this.name="",this.path="",this.transform.identity(),this.parent=null},i})
(t.BaseObject);t.DisplayData=e;var i=(function(e){function i(){var i=null!
==e&&e.apply(this,arguments)||this;return i.pivot=new t.Point,i}return
s(i,e),i.toString=function(){return"[class
dragonBones.ImageDisplayData]"},i.prototype._onClear=function()
{e.prototype._onClear.call(this),this.type=0,this.pivot.clear(),this.texture=null},
i})(e);t.ImageDisplayData=i;var n=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.actions=[],e}return
s(e,t),e.toString=function(){return"[class
dragonBones.ArmatureDisplayData]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this);for(var e=0,i=this.actions;e<i.length;e++)
{i[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})(e);t.ArmatureDisplayData=n;var r=(function(t){function
e(){var e=null!==t&&t.apply(this,arguments)||this;return
e.weight=null,e.glue=null,e}return s(e,t),e.toString=function(){return"[class
dragonBones.MeshDisplayData]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),null!
==this.weight&&this.weight.returnToPool(),null!
==this.glue&&this.glue.returnToPool(),this.type=2,this.inheritDeform=!
1,this.offset=0,this.weight=null,this.glue=null,this.texture=null},e})
(e);t.MeshDisplayData=r;var a=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.boundingBox=null,e}return
s(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=nu
ll},e})(e);t.BoundingBoxDisplayData=a;var o=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return
e.bones=[],e}return s(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=o;var l=(function(t){function
e(){var e=null!==t&&t.apply(this,arguments)||this;return e.meshes=[],e}return
s(e,t),e.toString=function(){return"[class
dragonBones.GlueData]"},e.prototype._onClear=function()
{this.weights.length=0,this.meshes.length=0},e.prototype.addMesh=function(t)
{this.meshes.push(t)},e})(t.BaseObject);t.GlueData=l})(n||(n={})),(function(t){var
e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(e,t),e.prototype._onClear=function(){this.color=0,this.width=0,this.height=0},e})
(t.BaseObject);t.BoundingBoxData=e;var i=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.RectangleBoundingBoxData]"},e._computeOutCode=function(t,e,i,n,r,s){var
a=0;return t<i?a|=1:t>r&&(a|=2),e<n?a|=4:e>s&&(a|
=8),a},e.rectangleIntersectsSegment=function(t,i,n,r,s,a,o,l,h,c,u){void
0===h&&(h=null),void 0===c&&(c=null),void 0===u&&(u=null);var
_=t>s&&t<o&&i>a&&i<l,f=n>s&&n<o&&r>a&&r<l;if(_&&f)return-1;for(var
d=0,m=e._computeOutCode(t,i,s,a,o,l),p=e._computeOutCode(n,r,s,a,o,l);;){if(0==(m|
p)){d=2;break}if(0!=(m&p))break;var v=0,y=0,g=0,x=0!==m?m:p;0!=(4&x)?(v=t+(n-t)*(a-
i)/(r-i),y=a,null!==u&&(g=.5*-Math.PI)):0!=(8&x)?(v=t+(n-t)*(l-i)/(r-i),y=l,null!
==u&&(g=.5*Math.PI)):0!=(2&x)?(y=i+(r-i)*(o-t)/(n-t),v=o,null!==u&&(g=0)):0!
=(1&x)&&(y=i+(r-i)*(s-t)/(n-t),v=s,null!==u&&(g=Math.PI)),x===m?
(t=v,i=y,m=e._computeOutCode(t,i,s,a,o,l),null!==u&&(u.x=g)):
(n=v,r=y,p=e._computeOutCode(n,r,s,a,o,l),null!==u&&(u.y=g))}return d&&(_?
(d=2,null!==h&&(h.x=n,h.y=r),null!==c&&(c.x=n,c.y=n),null!
==u&&(u.x=u.y+Math.PI)):f?(d=1,null!==h&&(h.x=t,h.y=i),null!
==c&&(c.x=t,c.y=i),null!==u&&(u.y=u.x+Math.PI)):(d=3,null!==h&&(h.x=t,h.y=i),null!
==c&&(c.x=n,c.y=r))),d},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.type=0},e.prototype.containsPoint=function(t,
e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return!
0}return!1},e.prototype.intersectsSegment=function(t,i,n,r,s,a,o){void
0===s&&(s=null),void 0===a&&(a=null),void 0===o&&(o=null);var
l=.5*this.width,h=.5*this.height;return e.rectangleIntersectsSegment(t,i,n,r,-l,-
h,l,h,s,a,o)},e})(e);t.RectangleBoundingBoxData=i;var n=(function(t){function e()
{return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.EllipseData]"},e.ellipseIntersectsSegment=function(t,e,i,n,r,s,a,o,l,h,
c){void 0===l&&(l=null),void 0===h&&(h=null),void 0===c&&(c=null);var
u=a/o,_=u*u,f=i-t,d=(n*=u)-(e*=u),m=Math.sqrt(f*f+d*d),p=f/m,v=d/m,y=(r-t)*p+(s-
e)*v,g=a*a,x=g-(t*t+e*e)+y*y,b=0;if(x>=0){var A=Math.sqrt(x),C=y-A,S=y+A,T=C<0?-
1:C<=m?0:1,w=S<0?-1:S<=m?0:1,E=T*w;if(E<0)return-1;0===E&&(-1===T?
(b=2,i=t+S*p,n=(e+S*v)/u,null!==l&&(l.x=i,l.y=n),null!==h&&(h.x=i,h.y=n),null!
==c&&(c.x=Math.atan2(n/g*_,i/g),c.y=c.x+Math.PI)):1===w?
(b=1,t+=C*p,e=(e+C*v)/u,null!==l&&(l.x=t,l.y=e),null!==h&&(h.x=t,h.y=e),null!
==c&&(c.x=Math.atan2(e/g*_,t/g),c.y=c.x+Math.PI)):(b=3,null!
==l&&(l.x=t+C*p,l.y=(e+C*v)/u,null!==c&&(c.x=Math.atan2(l.y/g*_,l.x/g))),null!
==h&&(h.x=t+S*p,h.y=(e+S*v)/u,null!==c&&(c.y=Math.atan2(h.y/g*_,h.x/g)))))}return
b},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.type=1},e.prototype.containsPoint=function(t,
e){var i=.5*this.width;if(t>=-i&&t<=i){var n=.5*this.height;if(e>=-n&&e<=n)return
e*=i/n,Math.sqrt(t*t+e*e)<=i}return!
1},e.prototype.intersectsSegment=function(t,i,n,r,s,a,o){return void
0===s&&(s=null),void 0===a&&(a=null),void
0===o&&(o=null),e.ellipseIntersectsSegment(t,i,n,r,0,0,.5*this.width,.5*this.height
,s,a,o)},e})(e);t.EllipseBoundingBoxData=n;var r=(function(t){function e(){var
e=null!==t&&t.apply(this,arguments)||this;return
e.vertices=[],e.weight=null,e}return s(e,t),e.toString=function(){return"[class
dragonBones.PolygonBoundingBoxData]"},e.polygonIntersectsSegment=function(t,e,i,n,r
,s,a,o){void 0===s&&(s=null),void 0===a&&(a=null),void
0===o&&(o=null),t===i&&(t=i+1e-6),e===n&&(e=n+1e-6);for(var l=r.length,h=t-i,c=e-
n,u=t*n-e*i,_=0,f=r[l-2],d=r[l-1],m=0,p=0,v=0,y=0,g=0,x=0,b=0;b<l;b+=2){var
A=r[b],C=r[b+1];f===A&&(f=A+1e-4),d===C&&(d=C+1e-4);var S=f-A,T=d-C,w=f*C-
d*A,E=h*T-c*S,M=(u*S-h*w)/E;if((M>=f&&M<=A||M>=A&&M<=f)&&(0===h||M>=t&&M<=i||
M>=i&&M<=t)){var D=(u*T-c*w)/E;if((D>=d&&D<=C||D>=C&&D<=d)&&(0===c||D>=e&&D<=n||
D>=n&&D<=e)){if(null===a){v=M,y=D,g=M,x=D,_++,null!==o&&(o.x=Math.atan2(C-d,A-
f)-.5*Math.PI,o.y=o.x);break}var B=M-t;B<0&&(B=-B),0===_?
(m=B,p=B,v=M,y=D,g=M,x=D,null!==o&&(o.x=Math.atan2(C-d,A-f)-.5*Math.PI,o.y=o.x)):
(B<m&&(m=B,v=M,y=D,null!==o&&(o.x=Math.atan2(C-d,A-
f)-.5*Math.PI)),B>p&&(p=B,g=M,x=D,null!==o&&(o.y=Math.atan2(C-d,A-
f)-.5*Math.PI))),_++}}f=A,d=C}return 1===_?(null!==s&&(s.x=v,s.y=y),null!
==a&&(a.x=v,a.y=y),null!==o&&(o.y=o.x+Math.PI)):_>1&&(_++,null!
==s&&(s.x=v,s.y=y),null!==a&&(a.x=g,a.y=x)),_},e.prototype._onClear=function()
{t.prototype._onClear.call(this),null!
==this.weight&&this.weight.returnToPool(),this.type=2,this.x=0,this.y=0,this.vertic
es.length=0,this.weight=null},e.prototype.containsPoint=function(t,e){var i=!
1;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height)for(var
n=0,r=this.vertices.length,s=r-2;n<r;n+=2){var
a=this.vertices[s+1],o=this.vertices[n+1];if(o<e&&a>=e||a<e&&o>=e){var
l=this.vertices[s],h=this.vertices[n];(e-o)*(l-h)/(a-o)+h<t&&(i=!i)}s=n}return
i},e.prototype.intersectsSegment=function(t,n,r,s,a,o,l){void 0===a&&(a=null),void
0===o&&(o=null),void 0===l&&(l=null);var h=0;return 0!
==i.rectangleIntersectsSegment(t,n,r,s,this.x,this.y,this.x+this.width,this.y+this.
height,null,null,null)&&(h=e.polygonIntersectsSegment(t,n,r,s,this.vertices,a,o,l))
,h},e})(e);t.PolygonBoundingBoxData=r})(n||(n={})),(function(t){var e=(function(t)
{function e(){var e=null!==t&&t.apply(this,arguments)||this;return
e.cachedFrames=[],e.boneTimelines={},e.surfaceTimelines={},e.slotTimelines={},e.con
straintTimelines={},e.animationTimelines={},e.boneCachedFrameIndices={},e.slotCache
dFrameIndices={},e.actionTimeline=null,e.zOrderTimeline=null,e}return
s(e,t),e.toString=function(){return"[class
dragonBones.AnimationData]"},e.prototype._onClear=function(){for(var t in
this.boneTimelines){for(var e=0,i=this.boneTimelines[t];e<i.length;e++)
{i[e].returnToPool()}delete this.boneTimelines[t]}for(var t in
this.surfaceTimelines){for(var n=0,r=this.surfaceTimelines[t];n<r.length;n++)
{r[n].returnToPool()}delete this.surfaceTimelines[t]}for(var t in
this.slotTimelines){for(var s=0,a=this.slotTimelines[t];s<a.length;s++)
{a[s].returnToPool()}delete this.slotTimelines[t]}for(var t in
this.constraintTimelines){for(var o=0,l=this.constraintTimelines[t];o<l.length;o++)
{l[o].returnToPool()}delete this.constraintTimelines[t]}for(var t in
this.animationTimelines){for(var h=0,c=this.animationTimelines[t];h<c.length;h++)
{c[h].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,thi
s.frameFloatOffset=0,this.frameOffset=0,this.frameCount=0,this.playTimes=0,this.dur
ation=0,this.scale=1,this.fadeInTime=0,this.cacheFrameRate=0,this.name="",this.cach
edFrames.length=0,this.actionTimeline=null,this.zOrderTimeline=null,this.parent=nul
l},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
i=0,n=this.cacheFrames.length;i<n;++i)this.cachedFrames[i]=!1;for(var
r=0,s=this.parent.sortedBones;r<s.length;r++){var a=s[r];for(i=0,n=(h=new
Array(e)).length;i<n;++i)h[i]=-1;this.boneCachedFrameIndices[a.name]=h}for(var
o=0,l=this.parent.sortedSlots;o<l.length;o++){var h,c=l[o];for(i=0,n=(h=new
Array(e)).length;i<n;++i)h[i]=-
1;this.slotCachedFrameIndices[c.name]=h}}},e.prototype.addBoneTimeline=function(t,e
){var i=t.name in this.boneTimelines?
this.boneTimelines[t.name]:this.boneTimelines[t.name]=[];i.indexOf(e)<0&&i.push(e)}
,e.prototype.addSurfaceTimeline=function(t,e){var i=t.name in
this.surfaceTimelines?
this.surfaceTimelines[t.name]:this.surfaceTimelines[t.name]=[];i.indexOf(e)<0&&i.pu
sh(e)},e.prototype.addSlotTimeline=function(t,e){var i=t.name in
this.slotTimelines?
this.slotTimelines[t.name]:this.slotTimelines[t.name]=[];i.indexOf(e)<0&&i.push(e)}
,e.prototype.addConstraintTimeline=function(t,e){var i=t.name in
this.constraintTimelines?
this.constraintTimelines[t.name]:this.constraintTimelines[t.name]=[];i.indexOf(e)<0
&&i.push(e)},e.prototype.addAnimationTimeline=function(t,e){var i=t in
this.animationTimelines?
this.animationTimelines[t]:this.animationTimelines[t]=[];i.indexOf(e)<0&&i.push(e)}
,e.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?
this.boneTimelines[t]:null},e.prototype.getSurfaceTimelines=function(t){return t in
this.surfaceTimelines?
this.surfaceTimelines[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
i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(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=i})(n||(n={})),(function(t){var e=(function(t)
{function e(){var e=null!==t&&t.apply(this,arguments)||this;return
e.boneMask=[],e}return s(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.additiveBlending=!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.autoFadeOutTi
me=t.autoFadeOutTime,this.fadeOutTweenType=t.fadeOutTweenType,this.actionEnabled=t.
actionEnabled,this.additiveBlending=t.additiveBlending,this.displayControl=t.displa
yControl,this.pauseFadeIn=t.pauseFadeIn,this.resetToPose=t.resetToPose,this.playTim
es=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.fadeOut
Time,this.fadeInTweenType=t.fadeInTweenType,this.weight=t.weight,this.name=t.name,t
his.animation=t.animation,this.group=t.group,this.boneMask.length=t.boneMask.length
;for(var e=0,i=this.boneMask.length;e<i;+
+e)this.boneMask[e]=t.boneMask[e]},e.prototype.containsBoneMask=function(t){return
0===this.boneMask.length||
this.boneMask.indexOf(t)>=0},e.prototype.addBoneMask=function(t,e,i){void
0===i&&(i=!0);var n=t.getBone(e);if(null!
==n&&(this.boneMask.indexOf(e)<0&&this.boneMask.push(e),i))for(var
r=0,s=t.getBones();r<s.length;r++){var
a=s[r];this.boneMask.indexOf(a.name)<0&&n.contains(a)&&this.boneMask.push(a.name)}}
,e.prototype.removeBoneMask=function(t,e,i){void 0===i&&(i=!0);var
n=this.boneMask.indexOf(e);if(n>=0&&this.boneMask.splice(n,1),i){var
r=t.getBone(e);if(null!==r)if(this.boneMask.length>0)for(var
s=0,a=t.getBones();s<a.length;s++){var
o=a[s],l=this.boneMask.indexOf(o.name);l>=0&&r.contains(o)&&this.boneMask.splice(l,
1)}else for(var h=0,c=t.getBones();h<c.length;h++){(o=c[h])!==r&&(r.contains(o)||
this.boneMask.push(o.name))}}},e})(t.BaseObject);t.AnimationConfig=e})(n||(n={})),
(function(t){var e=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.textures={},e}return
s(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.prototy
pe.copyFrom=function(t){for(var e in
this.autoSearch=t.autoSearch,this.scale=t.scale,this.width=t.width,this.height=t.he
ight,this.name=t.name,this.imagePath=t.imagePath,this.textures)this.textures[e].ret
urnToPool(),delete this.textures[e];for(var e in t.textures){var
i=this.createTexture();i.copyFrom(t.textures[e]),this.textures[e]=i}},e.prototype.a
ddTexture=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 i=(function(e){function i(){var i=null!
==e&&e.apply(this,arguments)||this;return i.region=new
t.Rectangle,i.frame=null,i}return s(i,e),i.createRectangle=function(){return new
t.Rectangle},i.prototype._onClear=function(){this.rotated=!
1,this.name="",this.region.clear(),this.parent=null,this.frame=null},i.prototype.co
pyFrom=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=i.createRectangle():null!
==this.frame&&null===t.frame&&(this.frame=null),null!==this.frame&&null!
==t.frame&&this.frame.copyFrom(t.frame)},i})(t.BaseObject);t.TextureData=i})(n||
(n={})),(function(t){var e=(function(e){function i(){var t=null!
==e&&e.apply(this,arguments)||this;return
t._bones=[],t._slots=[],t._glueSlots=[],t._constraints=[],t._actions=[],t._animatio
n=null,t._proxy=null,t._replaceTextureAtlasData=null,t._clock=null,t}return
s(i,e),i.toString=function(){return"[class
dragonBones.Armature]"},i._onSortSlots=function(t,e){return t._zOrder>e._zOrder?1:-
1},i.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 i=0,n=this._slots;i<n.length;i++)
{n[i].returnToPool()}for(var r=0,s=this._constraints;r<s.length;r++)
{s[r].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._bonesDirty=!
1,this._slotsDirty=!1,this._zOrderDirty=!1,this._flipX=!1,this._flipY=!
1,this._cacheFrameIndex=-
1,this._bones.length=0,this._slots.length=0,this._glueSlots.length=0,this._constrai
nts.length=0,this._actions.length=0,this._armatureData=null,this._animation=null,th
is._proxy=null,this._display=null,this._replaceTextureAtlasData=null,this._replaced
Texture=null,this._dragonBones=null,this._clock=null,this._parent=null},i.prototype
._sortBones=function(){var t=this._bones.length;if(!(t<=0)){var
e=this._bones.concat(),i=0,n=0;for(this._bones.length=0;n<t;){var r=e[i+
+];if(i>=t&&(i=0),!(this._bones.indexOf(r)>=0)){if(r._hasConstraint){for(var s=!
1,a=0,o=this._constraints;a<o.length;a++){var
l=o[a];if(l._root===r&&this._bones.indexOf(l._target)<0){s=!
0;break}}if(s)continue}null!==r.parent&&this._bones.indexOf(r.parent)<0||
(this._bones.push(r),n++)}}}},i.prototype._sortSlots=function()
{this._slots.sort(i._onSortSlots)},i.prototype._sortZOrder=function(t,e){var
i=this._armatureData.sortedSlots,n=null===t;if(this._zOrderDirty||!n){for(var
r=0,s=i.length;r<s;++r){var a=n?r:t[e+r];if(!(a<0||a>=s)){var
o=i[a],l=this.getSlot(o.name);null!==l&&l._setZorder(r)}}this._slotsDirty=!
0,this._zOrderDirty=!n}},i.prototype._addBoneToBoneList=function(t)
{this._bones.indexOf(t)<0&&(this._bonesDirty=!
0,this._bones.push(t))},i.prototype._removeBoneFromBoneList=function(t){var
e=this._bones.indexOf(t);e>=0&&this._bones.splice(e,1)},i.prototype._addSlotToSlotL
ist=function(t){this._slots.indexOf(t)<0&&(this._slotsDirty=!
0,this._slots.push(t))},i.prototype._removeSlotFromSlotList=function(t){var
e=this._slots.indexOf(t);e>=0&&this._slots.splice(e,1)},i.prototype._bufferAction=f
unction(t,e){this._actions.indexOf(t)<0&&(e?
this._actions.push(t):this._actions.unshift(t))},i.prototype.dispose=function()
{null!==this._armatureData&&(this._lockUpdate=!
0,this._dragonBones.bufferObject(this))},i.prototype.init=function(e,i,n,r)
{null===this._armatureData&&(this._armatureData=e,this._animation=t.BaseObject.borr
owObject(t.Animation),this._proxy=i,this._display=n,this._dragonBones=r,this._proxy
.dbInit(this),this._animation.init(this),this._animation.animations=this._armatureD
ata.animations)},i.prototype.advanceTime=function(t){if(!this._lockUpdate)if(null!
==this._armatureData)if(null!==this._armatureData.parent){var
e=this._cacheFrameIndex;if(this._animation.advanceTime(t),this._bonesDirty&&(this._
bonesDirty=!1,this._sortBones()),this._slotsDirty&&(this._slotsDirty=!
1,this._sortSlots()),this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var
i=0,n=0;for(i=0,n=this._bones.length;i<n;+
+i)this._bones[i].update(this._cacheFrameIndex);for(i=0,n=this._slots.length;i<n;+
+i)this._slots[i].update(this._cacheFrameIndex);for(i=0,n=this._glueSlots.length;i<
n;++i)this._glueSlots[i]._updateGlueMesh()}if(this._actions.length>0)
{this._lockUpdate=!0;for(var r=0,s=this._actions;r<s.length;r++){var
a=s[r];0===a.type&&this._animation.fadeIn(a.name)}this._actions.length=0,this._lock
Update=!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.")},i.prototype.invalidUpdate=function(t,e){if(void 0===t&&(t=null),void
0===e&&(e=!1),null!==t&&t.length>0){if(null!
==(a=this.getBone(t))&&(a.invalidUpdate(),e))for(var
i=0,n=this._slots;i<n.length;i++)
{(h=n[i]).parent===a&&h.invalidUpdate()}}else{for(var
r=0,s=this._bones;r<s.length;r++){var a;(a=s[r]).invalidUpdate()}if(e)for(var
o=0,l=this._slots;o<l.length;o++){var h;
(h=l[o]).invalidUpdate()}}},i.prototype.containsPoint=function(t,e){for(var
i=0,n=this._slots;i<n.length;i++){var r=n[i];if(r.containsPoint(t,e))return
r}return null},i.prototype.intersectsSegment=function(t,e,i,n,r,s,a){void
0===r&&(r=null),void 0===s&&(s=null),void 0===a&&(a=null);for(var
o=t===i,l=0,h=0,c=0,u=0,_=0,f=0,d=0,m=0,p=null,v=null,y=0,g=this._slots;y<g.length;
y++){var x=g[y];if(x.intersectsSegment(t,e,i,n,r,s,a)>0){if(null===r&&null===s)
{p=x;break}var b;null!==r&&((b=o?r.y-e:r.x-t)<0&&(b=-b),(null===p||
b<l)&&(l=b,c=r.x,u=r.y,p=x,a&&(d=a.x))),null!==s&&((b=s.x-t)<0&&(b=-b),(null===v||
b>h)&&(h=b,_=s.x,f=s.y,v=x,null!==a&&(m=a.y)))}}return null!==p&&null!
==r&&(r.x=c,r.y=u,null!==a&&(a.x=d)),null!==v&&null!==s&&(s.x=_,s.y=f,null!
==a&&(a.y=m)),p},i.prototype.getBone=function(t){for(var
e=0,i=this._bones;e<i.length;e++){var n=i[e];if(n.name===t)return n}return
null},i.prototype.getBoneByDisplay=function(t){var
e=this.getSlotByDisplay(t);return null!==e?
e.parent:null},i.prototype.getSlot=function(t){for(var
e=0,i=this._slots;e<i.length;e++){var n=i[e];if(n.name===t)return n}return
null},i.prototype.getSlotByDisplay=function(t){if(null!==t)for(var
e=0,i=this._slots;e<i.length;e++){var n=i[e];if(n.display===t)return
n}return null},i.prototype.addBone=function(t,e){console.assert(null!
==t),t._setArmature(this),t._setParent(e.length>0?
this.getBone(e):null)},i.prototype.addSlot=function(t,e){var
i=this.getBone(e);console.assert(null!==t&&null!
==i),t._setArmature(this),t._setParent(i)},i.prototype.addConstraint=function(t)
{this._constraints.indexOf(t)<0&&this._constraints.push(t)},i.prototype.removeBone=
function(t){console.assert(null!
==t&&t.armature===this),t._setParent(null),t._setArmature(null)},i.prototype.remove
Slot=function(t){console.assert(null!
==t&&t.armature===this),t._setParent(null),t._setArmature(null)},i.prototype.getBon
es=function(){return this._bones},i.prototype.getSlots=function(){return
this._slots},Object.defineProperty(i.prototype,"flipX",{get:function(){return
this._flipX},set:function(t){this._flipX!
==t&&(this._flipX=t,this.invalidUpdate())},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"flipY",{get:function(){return
this._flipY},set:function(t){this._flipY!
==t&&(this._flipY=t,this.invalidUpdate())},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"cacheFrameRate",{get:function(){return
this._armatureData.cacheFrameRate},set:function(t)
{if(this._armatureData.cacheFrameRate!==t)
{this._armatureData.cacheFrames(t);for(var e=0,i=this._slots;e<i.length;e++){var
n=i[e].childArmature;null!==n&&(n.cacheFrameRate=t)}}},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"name",{get:function(){return
this._armatureData.name},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"armatureData",{get:function(){return
this._armatureData},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"animation",{get:function(){return
this._animation},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"proxy",{get:function(){return
this._proxy},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"eventDispatcher",{get:function(){return
this._proxy},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"display",{get:function(){return
this._display},enumerable:!0,configurable:!
0}),Object.defineProperty(i.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,i=this._slots;e<i.length;e++){var n=i[e];n.invalidUpdate(),n.update(-
1)}}},enumerable:!0,configurable:!0}),Object.defineProperty(i.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,i=this._slots;e<i.length;e++){var n=i[e].childArmature;null!
==n&&(n.clock=this._clock)}}},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"parent",{get:function(){return
this._parent},enumerable:!0,configurable:!
0}),i.prototype.replaceTexture=function(t)
{this.replacedTexture=t},i.prototype.hasEventListener=function(t){return
this._proxy.hasDBEventListener(t)},i.prototype.addEventListener=function(t,e,i)
{this._proxy.addDBEventListener(t,e,i)},i.prototype.removeEventListener=function(t,
e,i)
{this._proxy.removeDBEventListener(t,e,i)},i.prototype.enableAnimationCache=functio
n(t){this.cacheFrameRate=t},i.prototype.getDisplay=function(){return
this._display},i})(t.BaseObject);t.Armature=e})(n||(n={})),(function(t){var
e=(function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return
i.globalTransformMatrix=new t.Matrix,i.global=new t.Transform,i.offset=new
t.Transform,i}return s(i,e),i.prototype._onClear=function()
{this.globalTransformMatrix.identity(),this.global.identity(),this.offset.identity(
),this.origin=null,this.userData=null,this._globalDirty=!
1,this._armature=null,this._parent=null},i.prototype._setArmature=function(t)
{this._armature=t},i.prototype._setParent=function(t)
{this._parent=t},i.prototype.updateGlobalTransform=function()
{this._globalDirty&&(this._globalDirty=!
1,this.global.fromMatrix(this.globalTransformMatrix))},Object.defineProperty(i.prot
otype,"armature",{get:function(){return this._armature},enumerable:!
0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function()
{return this._parent},enumerable:!0,configurable:!0}),i._helpMatrix=new
t.Matrix,i._helpTransform=new t.Transform,i._helpPoint=new t.Point,i})
(t.BaseObject);t.TransformObject=e})(n||(n={})),(function(t){var e=(function(e)
{function i(){var i=null!==e&&e.apply(this,arguments)||this;return
i.animationPose=new t.Transform,i._blendState=new t.BlendState,i}return
s(i,e),i.toString=function(){return"[class
dragonBones.Bone]"},i.prototype._onClear=function()
{e.prototype._onClear.call(this),this.offsetMode=1,this.animationPose.identity(),th
is._transformDirty=!1,this._childrenTransformDirty=!1,this._localDirty=!
0,this._hasConstraint=!1,this._visible=!0,this._cachedFrameIndex=-
1,this._blendState.clear(),this._boneData=null,this._cachedFrameIndices=null},i.pro
totype._updateGlobalTransformMatrix=function(e){var
i=this._boneData,n=this._parent,r=this._armature.flipX,s=this._armature.flipY===t.D
ragonBones.yDown,a=null!
==n,o=0,l=this.global,h=this.globalTransformMatrix;if(1===this.offsetMode?null!
==this.origin?
(l.x=this.origin.x+this.offset.x+this.animationPose.x,l.y=this.origin.y+this.offset
.y+this.animationPose.y,l.skew=this.origin.skew+this.offset.skew+this.animationPose
.skew,l.rotation=this.origin.rotation+this.offset.rotation+this.animationPose.rotat
ion,l.scaleX=this.origin.scaleX*this.offset.scaleX*this.animationPose.scaleX,l.scal
eY=this.origin.scaleY*this.offset.scaleY*this.animationPose.scaleY):l.copyFrom(this
.offset).add(this.animationPose):0===this.offsetMode?null!==this.origin?
l.copyFrom(this.origin).add(this.animationPose):l.copyFrom(this.animationPose):(a=!
1,l.copyFrom(this.offset)),a){var c=0===n._boneData.type?
n.globalTransformMatrix:n._getGlobalTransformMatrix(l.x,l.y);if(i.inheritScale)i.in
heritRotation||(n.updateGlobalTransform(),o=r&&s?l.rotation-
(n.global.rotation+Math.PI):r?l.rotation+n.global.rotation+Math.PI:s?
l.rotation+n.global.rotation:l.rotation-
n.global.rotation,l.rotation=o),l.toMatrix(h),h.concat(c),i.inheritTranslation?
(l.x=h.tx,l.y=h.ty):(h.tx=l.x,h.ty=l.y),e?l.fromMatrix(h):this._globalDirty=!
0;else{if(i.inheritTranslation){var
u=l.x,_=l.y;l.x=c.a*u+c.c*_+c.tx,l.y=c.b*u+c.d*_+c.ty}else r&&(l.x=-l.x),s&&(l.y=-
l.y);i.inheritRotation?(n.updateGlobalTransform(),o=n.global.scaleX<0?
l.rotation+n.global.rotation+Math.PI:l.rotation+n.global.rotation,c.a*c.d-
c.b*c.c<0&&(o-=2*l.rotation,(r!==s||
i.inheritReflection)&&(l.skew+=Math.PI)),l.rotation=o):(r||s)&&(r&&s?
o=l.rotation+Math.PI:(o=r?Math.PI-l.rotation:-
l.rotation,l.skew+=Math.PI),l.rotation=o),l.toMatrix(h)}}else(r||s)&&(r&&(l.x=-
l.x),s&&(l.y=-l.y),r&&s?o=l.rotation+Math.PI:(o=r?Math.PI-l.rotation:-
l.rotation,l.skew+=Math.PI),l.rotation=o),l.toMatrix(h)},i.prototype._setArmature=f
unction(t){if(this._armature!==t){var e=null,i=null;if(null!
==this._armature&&(e=this.getSlots(),i=this.getBones(),this._armature._removeBoneFr
omBoneList(this)),this._armature=t,null!
==this._armature&&this._armature._addBoneToBoneList(this),null!==e)for(var
n=0,r=e;n<r.length;n++){var
s=r[n];s.parent===this&&s._setArmature(this._armature)}if(null!==i)for(var
a=0,o=i;a<o.length;a++){var
l=o[a];l.parent===this&&l._setArmature(this._armature)}}},i.prototype.init=function
(t)
{null===this._boneData&&(this._boneData=t,this.origin=this._boneData.transform)},i.
prototype.update=function(t){if(this._blendState.dirty=!1,t>=0&&null!
==this._cachedFrameIndices){var
e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e)this._transformDi
rty=!1;else if(e>=0)this._transformDirty=!
0,this._cachedFrameIndex=e;else{if(this._hasConstraint)for(var
i=0,n=this._armature._constraints;i<n.length;i++)
{(a=n[i])._root===this&&a.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,s=this._armature._constraints;r<s.length;r++){var a;
(a=s[r])._root===this&&a.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]=thi
s._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}el
se
this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,t
his._cachedFrameIndex);else
this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!
0},i.prototype.updateByConstraint=function(){this._localDirty&&(this._localDirty=!
1,(this._transformDirty||null!
==this._parent&&this._parent._childrenTransformDirty)&&this._updateGlobalTransformM
atrix(!0),this._transformDirty=!0)},i.prototype.invalidUpdate=function()
{this._transformDirty=!0},i.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(i.prototype,"boneData",{get:function(){return
this._boneData},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"visible",{get:function(){return
this._visible},set:function(t){if(this._visible!==t){this._visible=t;for(var
e=0,i=this._armature.getSlots();e<i.length;e++){var
n=i[e];n._parent===this&&n._updateVisible()}}},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"name",{get:function(){return
this._boneData.name},enumerable:!0,configurable:!
0}),i.prototype.getBones=function(){for(var
t=new Array,e=0,i=this._armature.getBones();e<i.length;e++){var
n=i[e];n.parent===this&&t.push(n)}return t},i.prototype.getSlots=function(){for(var
t=new Array,e=0,i=this._armature.getSlots();e<i.length;e++){var
n=i[e];n.parent===this&&t.push(n)}return
t},Object.defineProperty(i.prototype,"slot",{get:function(){for(var
t=0,e=this._armature.getSlots();t<e.length;t++){var
i=e[t];if(i.parent===this)return i}return null},enumerable:!0,configurable:!0}),i})
(t.TransformObject);t.Bone=e})(n||(n={})),(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
s(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._k
Y=0,this._vertices.length=0,this._deformVertices.length=0,this._matrixCahce.length=
0,this._hullCache.length=0},e.prototype._getAffineTransform=function(t,e,i,n,r,s,a,
o,l,h,c,u,_){var f=a-r,d=o-s,m=l-r,p=h-
s;c.rotation=Math.atan2(d,f),c.skew=Math.atan2(p,m)-.5*Math.PI-
c.rotation,_&&(c.rotation+=Math.PI),c.scaleX=Math.sqrt(f*f+d*d)/i,c.scaleY=Math.sqr
t(m*m+p*p)/n,c.toMatrix(u),c.x=u.tx=r-(u.a*t+u.c*e),c.y=u.ty=s-
(u.b*t+u.d*e)},e.prototype._updateVertices=function(){var
t=this._boneData.vertices,e=this._vertices,i=this._deformVertices;if(null!
==this._parent)if(1===this._parent._boneData.type)for(var n=0,r=t.length;n<r;n+=2)
{var s=t[n]
+i[n],a=t[n+1]+i[n],o=this._parent._getGlobalTransformMatrix(s,a);e[n]=o.a*s+o.c*a+
o.tx,e[n+1]=o.b*s+o.d*a+o.ty}else{var
l=this._parent.globalTransformMatrix;for(n=0,r=t.length;n<r;n+=2){s=t[n]
+i[n],a=t[n+1]+i[n+1];e[n]=l.a*s+l.c*a+l.tx,e[n+1]=l.b*s+l.d*a+l.ty}}else
for(n=0,r=t.length;n<r;n+=2)e[n]=t[n]
+i[n],e[n+1]=t[n+1]+i[n+1]},e.prototype._updateGlobalTransformMatrix=function(t)
{var e=2*this._boneData.segmentX,i=this._vertices.length-
2,n=this._vertices[0],r=this._vertices[1],s=this._vertices[e],a=this._vertices[e+1]
,o=this._vertices[i],l=this._vertices[i+1],h=this._vertices[i-
e],c=this._vertices[i-e+1],u=n+.5*(o-n),_=r+.5*(l-r),f=u+.5*(s+.5*(h-s)-
u),d=_+.5*(a+.5*(c-a)-_),m=s+.5*(o-s),p=a+.5*(l-a),v=h+.5*(o-h),y=c+.5*(l-
c);this._globalDirty=!
1,this._getAffineTransform(0,0,200,200,f,d,m,p,v,y,this.global,this.globalTransform
Matrix,!1)},e.prototype._getGlobalTransformMatrix=function(t,i){var n=1e3;if(t<-n||
n<t||i<-n||n<i)return this.globalTransformMatrix;var r=!
1,s=200,a=this._boneData,o=a.segmentX,l=a.segmentY,h=2*a.segmentX,c=this._dX,u=this
._dY,_=Math.floor((t+s)/c),f=Math.floor((i+s)/u),d=0,m=_*c-s,p=f*u-
s,v=this._matrixCahce,y=e._helpMatrix;if(t<-s){if(i<-s||i>s)return
this.globalTransformMatrix;if(d=7*(2*(o*(l+1)+2*o+l+f)+((r=i>this._kX*(t+s)+p)?
1:0)),this._matrixCahce[d]>0)y.copyFromArray(v,d+1);else{var
g=f*(h+2),x=this._hullCache[4],b=this._hullCache[5],A=this._hullCache[2]-(l-
f)*x,C=this._hullCache[3]-(l-f)*b,S=this._vertices;r?this._getAffineTransform(-
s,p+u,800,u,S[g+h+2],S[g+h+3],A+x,C+b,S[g],S[g+1],e._helpTransform,y,!
0):this._getAffineTransform(-n,p,800,u,A,C,S[g],S[g+1],A+x,C+b,e._helpTransform,y,!
1),v[d]=1,v[d+1]=y.a,v[d+2]=y.b,v[d+3]=y.c,v[d+4]=y.d,v[d+5]=y.tx,v[d+6]=y.ty}}else
if(t>s){if(i<-s||i>s)return this.globalTransformMatrix;if(d=7*(2*(o*(l+1)+o+f)+
((r=i>this._kX*(t-n)+p)?
1:0)),this._matrixCahce[d]>0)y.copyFromArray(v,d+1);else{g=(f+1)*(h+2)-
2,x=this._hullCache[4],b=this._hullCache[5],A=this._hullCache[0]+f*x,C=this._hullCa
che[1]+f*b,S=this._vertices;r?
this._getAffineTransform(n,p+u,800,u,A+x,C+b,S[g+h+2],S[g+h+3],A,C,e._helpTransform
,y,!
0):this._getAffineTransform(s,p,800,u,S[g],S[g+1],A,C,S[g+h+2],S[g+h+3],e._helpTran
sform,y,!
1),v[d]=1,v[d+1]=y.a,v[d+2]=y.b,v[d+3]=y.c,v[d+4]=y.d,v[d+5]=y.tx,v[d+6]=y.ty}}else
if(i<-s){if(t<-s||t>s)return this.globalTransformMatrix;if(d=7*(o*(l+1)+2*_+
((r=i>this._kY*(t-m-c)-n)?
1:0)),this._matrixCahce[d]>0)y.copyFromArray(v,d+1);else{g=2*_,x=this._hullCache[10
],b=this._hullCache[11],A=this._hullCache[8]+_*x,C=this._hullCache[9]+_*b,S=this._v
ertices;r?this._getAffineTransform(m+c,-
s,c,800,S[g+2],S[g+3],S[g],S[g+1],A+x,C+b,e._helpTransform,y,!
0):this._getAffineTransform(m,-n,c,800,A,C,A+x,C+b,S[g],S[g+1],e._helpTransform,y,!
1),v[d]=1,v[d+1]=y.a,v[d+2]=y.b,v[d+3]=y.c,v[d+4]=y.d,v[d+5]=y.tx,v[d+6]=y.ty}}else
if(i>s){if(t<-s||t>s)return this.globalTransformMatrix;if(d=7*(2*(o*(l+1)+o+l+f)+
((r=i>this._kY*(t-m-c)+s)?
1:0)),this._matrixCahce[d]>0)y.copyFromArray(v,d+1);else{g=l*(h+2)+2*_,x=this._hull
Cache[10],b=this._hullCache[11],A=this._hullCache[6]-(o-_)*x,C=this._hullCache[7]-
(o-_)*b,S=this._vertices;r?
this._getAffineTransform(m+c,n,c,800,A+x,C+b,A,C,S[g+2],S[g+3],e._helpTransform,y,!
0):this._getAffineTransform(m,s,c,800,S[g],S[g+1],S[g+2],S[g+3],A,C,e._helpTransfor
m,y,!
1),v[d]=1,v[d+1]=y.a,v[d+2]=y.b,v[d+3]=y.c,v[d+4]=y.d,v[d+5]=y.tx,v[d+6]=y.ty}}else
if(d=7*(2*(o*f+_)+((r=i>this._k*(t-m-c)+p)?
1:0)),this._matrixCahce[d]>0)y.copyFromArray(v,d+1);else{g=2*_+f*(h+2),S=this._vert
ices;r?
this._getAffineTransform(m+c,p+u,c,u,S[g+h+4],S[g+h+5],S[g+h+2],S[g+h+3],S[g+2],S[g
+3],e._helpTransform,y,!
0):this._getAffineTransform(m,p,c,u,S[g],S[g+1],S[g+2],S[g+3],S[g+h+2],S[g+h+3],e._
helpTransform,y,!
1),v[d]=1,v[d+1]=y.a,v[d+2]=y.b,v[d+3]=y.c,v[d+4]=y.d,v[d+5]=y.tx,v[d+6]=y.ty}retur
n y},e.prototype.init=function(e){if(null===this._boneData)
{t.prototype.init.call(this,e);var
i=e.segmentX,n=e.segmentY,r=e.vertices.length;this._dX=400/i,this._dY=400/n,this._k
=-this._dY/this._dX,this._kX=-this._dY/800,this._kY=-
800/this._dX,this._vertices.length=r,this._deformVertices.length=r,this._matrixCahc
e.length=2*(i*n+2*i+2*n)*7,this._hullCache.length=10;for(var s=0;s<r;+
+s)this._deformVertices[s]=0}},e.prototype.update=function(t)
{if(this._blendState.dirty=!1,t>=0&&null!==this._cachedFrameIndices){var
i=this._cachedFrameIndices[t];if(i>=0&&this._cachedFrameIndex===i)this._transformDi
rty=!1;else if(i>=0)this._transformDirty=!
0,this._cachedFrameIndex=i;else{if(this._hasConstraint)for(var
n=0,r=this._armature._constraints;n<r.length;n++)
{(o=r[n])._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
s=0,a=this._armature._constraints;s<a.length;s++){var o;
(o=a[s])._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
c=t>=0;this._localDirty&&this._updateGlobalTransformMatrix(c),c&&null!
==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=thi
s._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}el
se
this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,t
his._cachedFrameIndex);var
u=2*this.global.x,_=2*this.global.y,f=e._helpPoint;this.globalTransformMatrix.trans
formPoint(1e3,-
200,f),this._hullCache[0]=f.x,this._hullCache[1]=f.y,this._hullCache[2]=u-
f.x,this._hullCache[3]=_-
f.y,this.globalTransformMatrix.transformPoint(0,this._dY,f,!
0),this._hullCache[4]=f.x,this._hullCache[5]=f.y,this.globalTransformMatrix.transfo
rmPoint(200,1e3,f),this._hullCache[6]=f.x,this._hullCache[7]=f.y,this._hullCache[8]
=u-f.x,this._hullCache[9]=_-
f.y,this.globalTransformMatrix.transformPoint(this._dX,0,f,!
0),this._hullCache[10]=f.x,this._hullCache[11]=f.y}else
this._childrenTransformDirty&&(this._childrenTransformDirty=!1);this._localDirty=!
0},e})(t.Bone);t.Surface=e})(n||(n={})),(function(t){var e=(function(e){function
i(){var i=null!==e&&e.apply(this,arguments)||this;return i._localMatrix=new
t.Matrix,i._colorTransform=new
t.ColorTransform,i._deformVertices=[],i._displayDatas=[],i._displayList=[],i._meshB
ones=[],i._meshSlots=[],i._rawDisplay=null,i._meshDisplay=null,i}return
s(i,e),i.prototype._onClear=function(){e.prototype._onClear.call(this);for(var
i=[],n=0,r=this._displayList;n<r.length;n++){null!==(o=r[n])&&o!
==this._rawDisplay&&o!==this._meshDisplay&&i.indexOf(o)<0&&i.push(o)}for(var
s=0,a=i;s<a.length;s++){var o;(o=a[s])instanceof t.Armature?
o.dispose():this._disposeDisplay(o,!1)}null!==this._meshDisplay&&this._meshDisplay!
==this._rawDisplay&&this._disposeDisplay(this._meshDisplay,!1),null!
==this._rawDisplay&&this._disposeDisplay(this._rawDisplay,!
1),this.displayController=null,this._displayDirty=!1,this._zOrderDirty=!
1,this._blendModeDirty=!1,this._colorDirty=!1,this._meshDirty=!
1,this._transformDirty=!1,this._visible=!0,this._blendMode=0,this._displayIndex=-
1,this._animationDisplayIndex=-1,this._zOrder=0,this._cachedFrameIndex=-
1,this._pivotX=0,this._pivotY=0,this._localMatrix.identity(),this._colorTransform.i
dentity(),this._deformVertices.length=0,this._displayList.length=0,this._displayDat
as.length=0,this._meshBones.length=0,this._meshSlots.length=0,this._slotData=null,t
his._rawDisplayDatas=null,this._displayData=null,this._textureData=null,this._meshD
ata=null,this._boundingBoxData=null,this._rawDisplay=null,this._meshDisplay=null,th
is._display=null,this._childArmature=null,this._cachedFrameIndices=null},i.prototyp
e._getDefaultRawDisplayData=function(){var
t=this._armature.armatureData.defaultSkin;if(null!==t){var
e=t.getDisplays(this._slotData.name);if(null!==e)return
this._displayIndex<e.length?e[this._displayIndex]:null}return
null},i.prototype._updateDisplayData=function(){var
t=this._displayData,e=this._textureData,n=this._meshData,r=null;if(this._displayInd
ex>=0?(null!
==this._rawDisplayDatas&&null===(r=this._displayIndex<this._rawDisplayDatas.length?
this._rawDisplayDatas[this._displayIndex]:null)&&(r=this._getDefaultRawDisplayData(
)),this._disp
layIndex<this._displayDatas.length&&(this._displayData=this._displayDatas[this._dis
playIndex])):(r=null,this._displayData=null),null!
==this._displayData&&(0===this._displayData.type||2===this._displayData.type)?
2===this._displayData.type?
(this._textureData=this._displayData.texture,this._meshData=this._displayData):null
!==r&&2===r.type?(this._textureData=this._displayData.texture,this._meshData=r):
(this._textureData=this._displayData.texture,this._meshData=null):
(this._textureData=null,this._meshData=null),null!
==this._displayData&&3===this._displayData.type?
this._boundingBoxData=this._displayData.boundingBox:null!==r&&3===r.type?
this._boundingBoxData=r.boundingBox:this._boundingBoxData=null,this._displayData!
==t||this._textureData!==e||this._meshData!==n){if(null!
==this._meshData)this._pivotX=0,this._pivotY=0;else if(null!==this._textureData)
{var
s=this._displayData,a=this._textureData.parent.scale*this._armature._armatureData.s
cale,o=this._textureData.frame;this._pivotX=s.pivot.x,this._pivotY=s.pivot.y;var
l=null!==o?
o:this._textureData.region,h=l.width,c=l.height;this._textureData.rotated&&null===o
&&(h=l.height,c=l.width),this._pivotX*=h*a,this._pivotY*=c*a,null!
==o&&(this._pivotX+=o.x*a,this._pivotY+=o.y*a)}else
this._pivotX=0,this._pivotY=0;if(null!==this._displayData&&null!
==r&&this._displayData!
==r&&null===this._meshData&&(r.transform.toMatrix(i._helpMatrix),i._helpMatrix.inve
rt(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX-
=i._helpPoint.x,this._pivotY-
=i._helpPoint.y,this._displayData.transform.toMatrix(i._helpMatrix),i._helpMatrix.i
nvert(),i._helpMatrix.transformPoint(0,0,i._helpPoint),this._pivotX+=i._helpPoint.x
,this._pivotY+=i._helpPoint.y),null!==r?this.origin=r.transform:null!
==this._displayData?
this.origin=this._displayData.transform:this.origin=null,this._meshData!
==n)if(null!==this._meshData){if(null!==this._meshData.weight)
{this._deformVertices.length=2*this._meshData.weight.count,this._meshBones.length=t
his._meshData.weight.bones.length;for(var u=0,_=this._meshBones.length;u<_;+
+u)this._meshBones[u]=this._armature.getBone(this._meshData.weight.bones[u].name)}e
lse{var
f=this._meshData.parent.parent.parent.intArray[this._meshData.offset+0];this._defor
mVertices.length=2*f,this._meshBones.length=0}var
d=this._armature._glueSlots;if(null!==this._meshData.glue)
{this._meshSlots.length=this._meshData.glue.meshes.length;for(u=0,_=this._meshSlots
.length;u<_;++u){var m=this._meshData.glue.meshes[u];if(null!==m){for(var p=!
1,v=0,y=this._armature.getSlots();v<y.length;v++){for(var
g=y[v],x=0,b=g._displayDatas;x<b.length;x++){var A=b[x];if(null!
==A&&2===A.type&&A.offset===m.offset){p=!
0,this._meshSlots[u]=g;break}}if(p)break}p||(this._meshSlots[u]=null)}else
this._meshSlots[u]=null}d.indexOf(this)<0&&d.push(this)}else{var
C=d.indexOf(this);C>=0&&d.slice(C,1)}for(u=0,_=this._deformVertices.length;u<_;+
+u)this._deformVertices[u]=0;this._meshDirty=!0}else
this._deformVertices.length=0,this._meshBones.length=0,this._meshSlots.length=0;els
e null!==this._meshData&&this._textureData!==e&&(this._meshDirty=!
0);this._displayDirty=!0,this._transformDirty=!
0}},i.prototype._updateDisplay=function(){var e=null!==this._display?
this._display:this._rawDisplay,i=this._childArmature;this._displayIndex>=0&&this._d
isplayIndex<this._displayList.length?
(this._display=this._displayList[this._displayIndex],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);var n=null!
==this._display?this._display:this._rawDisplay;if(n!
==e&&(this._onUpdateDisplay(),this._replaceDisplay(e),this._visibleDirty=!
0,this._blendModeDirty=!0,this._colorDirty=!0),n!==this._rawDisplay&&n!
==this._meshDisplay||this._updateFrame(),this._childArmature!==i&&(null!
==i&&(i._parent=null,i.clock=null,i.inheritAnimation&&i.animation.reset()),null!
==this._childArmature&&(this._childArmature._parent=this,this._childArmature.clock=
this._armature.clock,this._childArmature.inheritAnimation)))
{if(0===this._childArmature.cacheFrameRate){var r=this._armature.cacheFrameRate;0!
==r&&(this._childArmature.cacheFrameRate=r)}var s=null;if(null!
==this._displayData&&1===this._displayData.type)s=this._displayData.actions;else
if(this._displayIndex>=0&&null!==this._rawDisplayDatas){var
a=this._displayIndex<this._rawDisplayDatas.length?
this._rawDisplayDatas[this._displayIndex]:null;null===a&&(a=this._getDefaultRawDisp
layData()),null!==a&&1===a.type&&(s=a.actions)}if(null!==s&&s.length>0)for(var
o=0,l=s;o<l.length;o++){var h=l[o];this._childArmature._bufferAction(h,!1)}else
this._childArmature.animation.play()}},i.prototype._updateGlobalTransformMatrix=fun
ction(t){var e=0===this._parent._boneData.type?
this._parent.globalTransformMatrix:this._parent._getGlobalTransformMatrix(this.glob
al.x,this.global.y);this.globalTransformMatrix.copyFrom(this._localMatrix),this.glo
balTransformMatrix.concat(e),t?
this.global.fromMatrix(this.globalTransformMatrix):this._globalDirty=!
0},i.prototype._isMeshBonesUpdate=function(){for(var
t=0,e=this._meshBones;t<e.length;t++){var i=e[t];if(null!
==i&&i._childrenTransformDirty)return!0}return!
1},i.prototype._setArmature=function(t){this._armature!==t&&(null!
==this._armature&&this._armature._removeSlotFromSlotList(this),this._armature=t,thi
s._onUpdateDisplay(),null!==this._armature?
(this._armature._addSlotToSlotList(this),this._addDisplay()):this._removeDisplay())
},i.prototype._setDisplayIndex=function(t,e){if(void 0===e&&(e=!1),e)
{if(this._animationDisplayIndex===t)return!1;this._animationDisplayIndex=t}return
this._displayIndex!==t&&(this._displayIndex=t,this._displayDirty=!
0,this._updateDisplayData(),this._displayDirty)},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,this._colorDirty},i.prototype._setDisplayList=function(e){if(null!
==e&&e.length>0){this._displayList.length!
==e.length&&(this._displayList.length=e.length);for(var i=0,n=e.length;i<n;++i){var
r=e[i];null!==r&&r!==this._rawDisplay&&r!==this._meshDisplay&&!(r instanceof
t.Armature)&&this._displayList.indexOf(r)<0&&this._initDisplay(r,!
0),this._displayList[i]=r}}else
this._displayList.length>0&&(this._displayList.length=0);return
this._displayIndex>=0&&this._displayIndex<this._displayList.length?
this._displayDirty=this._display!
==this._displayList[this._displayIndex]:this._displayDirty=null!
==this._display,this._updateDisplayData(),this._displayDirty},i.prototype.init=func
tion(t,e,i,n){null===this._slotData&&(this._slotData=t,this._visibleDirty=!
0,this._blendModeDirty=!0,this._colorDirty=!
0,this._blendMode=this._slotData.blendMode,this._zOrder=this._slotData.zOrder,this.
_colorTransform.copyFrom(this._slotData.color),this._rawDisplay=i,this._meshDisplay
=n,this.rawDisplayDatas=e,this._initDisplay(this._rawDisplay,!1),this._rawDisplay!
==this._meshDisplay&&this._initDisplay(this._meshDisplay,!
1))},i.prototype.update=function(t){if(this._displayDirty&&(this._displayDirty=!
1,this._updateDisplay(),this._transformDirty&&(null!==this.origin?
this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix):this
.global.copyFrom(this.offset).toMatrix(this._localMatrix))),this._zOrderDirty&&(thi
s._zOrderDirty=!1,this._updateZOrder()),t>=0&&null!==this._cachedFrameIndices){var
e=this._cachedFrameIndices[t];e>=0&&this._cachedFrameIndex===e?
this._transformDirty=!1:e>=0?(this._transformDirty=!
0,this._cachedFrameIndex=e):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(null!==this._display)
{if(this._visibleDirty&&(this._visibleDirty=!
1,this._updateVisible()),this._blendModeDirty&&(this._blendModeDirty=!
1,this._updateBlendMode()),this._colorDirty&&(this._colorDirty=!
1,this._updateColor()),null!==this._meshData&&this._display===this._meshDisplay)
{var i=null!==this._meshData.weight,n=0!==this._parent._boneData.type,r=null!
==this._meshData.glue;if((this._meshDirty||i&&this._isMeshBonesUpdate()||
n&&this._parent._childrenTransformDirty||
r&&this._parent._childrenTransformDirty)&&(this._meshDirty=!
1,this._updateMesh()),i||n||r)return}if(this._transformDirty)
{if(this._transformDirty=!1,this._cachedFrameIndex<0){var
s=t>=0;this._updateGlobalTransformMatrix(s),s&&null!
==this._cachedFrameIndices&&(this._cachedFrameIndex=this._cachedFrameIndices[t]=thi
s._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global))}el
se
this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,t
his._cachedFrameIndex);this._updateTransform()}}},i.prototype.updateTransformAndMat
rix=function(){this._transformDirty&&(this._transformDirty=!
1,this._updateGlobalTransformMatrix(!
1))},i.prototype.replaceDisplayData=function(t,e){if(void 0===e&&(e=-
1),e<0&&(e=this._displayIndex<0?0:this._displayIndex),this._displayDatas.length<=e)
{this._displayDatas.length=e+1;for(var i=0,n=this._displayDatas.length;i<n;+
+i)this._displayDatas[i]||
(this._displayDatas[i]=null)}this._displayDatas[e]=t},i.prototype.containsPoint=fun
ction(t,e){return null!
==this._boundingBoxData&&(this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(th
is.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,n,r,s,a,o){if(void 0===s&&(s=null),void
0===a&&(a=null),void 0===o&&(o=null),null===this._boundingBoxData)return
0;this.updateTransformAndMatrix(),i._helpMatrix.copyFrom(this.globalTransformMatrix
),i._helpMatrix.invert(),i._helpM
atrix.transformPoint(t,e,i._helpPoint),t=i._helpPoint.x,e=i._helpPoint.y,i._helpMat
rix.transformPoint(n,r,i._helpPoint),n=i._helpPoint.x,r=i._helpPoint.y;var
l=this._boundingBoxData.intersectsSegment(t,e,n,r,s,a,o);return l>0&&(1===l||2===l?
null!==s?(this.globalTransformMatrix.transformPoint(s.x,s.y,s),null!
==a&&(a.x=s.x,a.y=s.y)):null!
==a&&this.globalTransformMatrix.transformPoint(a.x,a.y,a):(null!
==s&&this.globalTransformMatrix.transformPoint(s.x,s.y,s),null!
==a&&this.globalTransformMatrix.transformPoint(a.x,a.y,a)),null!
==o&&(this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),i._help
Point,!
0),o.x=Math.atan2(i._helpPoint.y,i._helpPoint.x),this.globalTransformMatrix.transfo
rmPoint(Math.cos(o.y),Math.sin(o.y),i._helpPoint,!
0),o.y=Math.atan2(i._helpPoint.y,i._helpPoint.x))),l},i.prototype.invalidUpdate=fun
ction(){this._displayDirty=!0,this._transformDirty=!
0},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,"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(){return
this._displayList.concat()},set:function(e){var i=this._displayList.concat(),n=new
Array;this._setDisplayList(e)&&this.update(-1);for(var r=0,s=i;r<s.length;r++)
{null!==(l=s[r])&&l!==this._rawDisplay&&l!
==this._meshDisplay&&this._displayList.indexOf(l)<0&&n.indexOf(l)<0&&n.push(l)}for(
var a=0,o=n;a<o.length;a++){var l;(l=o[a])instanceof t.Armature?
l.dispose():this._disposeDisplay(l,!0)}},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"slotData",{get:function(){return
this._slotData},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"rawDisplayDatas",{get:function(){return
this._rawDisplayDatas},set:function(t){if(this._rawDisplayDatas!
==t)if(this._displayDirty=!0,this._rawDisplayDatas=t,null!==this._rawDisplayDatas)
{this._displayDatas.length=this._rawDisplayDatas.length;for(var
e=0,i=this._displayDatas.length;e<i;++e){var
n=this._rawDisplayDatas[e];null===n&&(n=this._getDefaultRawDisplayData()),this._dis
playDatas[e]=n}}else this._displayDatas.length=0},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){if(this._display!==t){var
e=this._displayList.length;if(this._displayIndex<0&&0===e&&(this._displayIndex=0),!
(this._displayIndex<0)){var
i=this.displayList;e<=this._displayIndex&&(i.length=this._displayIndex+1),i[this._d
isplayIndex]=t,this.displayList=i}}},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}),i.prototype.getDisplay=function(){return
this.display},i.prototype.setDisplay=function(t){this.display=t},i})
(t.TransformObject);t.Slot=e})(n||(n={})),(function(t){var e=(function(e){function
i(){return null!==e&&e.apply(this,arguments)||this}return
s(i,e),i.prototype._onClear=function()
{this._armature=null,this._target=null,this._root=null,this._bone=null},Object.defi
neProperty(i.prototype,"name",{get:function(){return
this._constraintData.name},enumerable:!0,configurable:!0}),i._helpMatrix=new
t.Matrix,i._helpTransform=new t.Transform,i._helpPoint=new t.Point,i})
(t.BaseObject);t.Constraint=e;var i=(function(e){function i(){return null!
==e&&e.apply(this,arguments)||this}return s(i,e),i.toString=function()
{return"[class dragonBones.IKConstraint]"},i.prototype._onClear=function()
{e.prototype._onClear.call(this),this._scaleEnabled=!1,this._bendPositive=!
1,this._weight=1,this._constraintData=null},i.prototype._computeA=function(){var
t=this._target.global,e=this._root.global,i=this._root.globalTransformMatrix,n=Math
.atan2(t.y-e.y,t.x-e.x);e.scaleX<0&&(n+=Math.PI),e.rotation+=(n-
e.rotation)*this._weight,e.toMatrix(i)},i.prototype._computeB=function(){var
e=this._bone._boneData.length,i=this._root,n=this._target.global,r=i.global,s=this.
_bone.global,a=this._bone.globalTransformMatrix,o=a.a*e,l=a.b*e,h=o*o+l*l,c=Math.sq
rt(h),u=s.x-r.x,_=s.y-
r.y,f=u*u+_*_,d=Math.sqrt(f),m=s.rotation,p=r.rotation,v=Math.atan2(_,u),y=(u=n.x-
r.x)*u+(_=n.y-r.y)*_,g=Math.sqrt(y),x=0;if(c+d<=g||g+c<=d||g+d<=c)x=Math.atan2(n.y-
r.y,n.x-r.x),c+d<=g||d<c&&(x+=Math.PI);else{var b=(f-h+y)/(2*y),A=Math.sqrt(f-
b*b*y)/g,C=r.x+u*b,S=r.y+_*b,T=-_*A,w=u*A,E=!1;if(null!==i._parent){var
M=i._parent.globalTransformMatrix;E=M.a*M.d-M.b*M.c<0}E!==this._bendPositive?
(s.x=C-T,s.y=S-w):(s.x=C+T,s.y=S+w),x=Math.atan2(s.y-r.y,s.x-r.x)}var
D=t.Transform.normalizeRadian(x-
v);r.rotation=p+D*this._weight,r.toMatrix(i.globalTransformMatrix);var
B=v+D*this._weight;s.x=r.x+Math.cos(B)*d,s.y=r.y+Math.sin(B)*d;var
P=Math.atan2(n.y-s.y,n.x-s.x);s.scaleX<0&&(P+=Math.PI),s.rotation=r.rotation+m-
p+t.Transform.normalizeRadian(P-D-
m)*this._weight,s.toMatrix(a)},i.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
i=this._constraintData;this._scaleEnabled=i.scaleEnabled,this._scaleEnabled=this._s
caleEnabled,this._bendPositive=i.bendPositive,this._weight=i.weight,this._root._has
Constraint=!0}},i.prototype.update=function(){this._root.updateByConstraint(),null!
==this._bone?
(this._bone.updateByConstraint(),this._computeB()):this._computeA()},i.prototype.in
validUpdate=function(){this._root.invalidUpdate(),null!
==this._bone&&this._bone.invalidUpdate()},i})(e);t.IKConstraint=i})(n||(n={})),
(function(t){var e=(function(){function t(t){void 0===t&&(t=-
1),this.time=0,this.timeScale=1,this._animatebles=[],this._clock=null,this.time=t<0
?.001*(new Date).getTime():t}return t.prototype.advanceTime=function(t){if(t!
=t&&(t=0),t<0&&(t=.001*(new Date).getTime()-this.time),1!
==this.timeScale&&(t*=this.timeScale),t<0?this.time-=t:this.time+=t,0!==t){for(var
e=0,i=0,n=this._animatebles.length;e<n;++e){var r=this._animatebles[e];null!==r?
(i>0&&(this._animatebles[e-i]=r,this._animatebles[e]=null),r.advanceTime(t)):i+
+}if(i>0){for(n=this._animatebles.length;e<n;++e){var s=this._animatebles[e];null!
==s?this._animatebles[e-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.protot
ype.remove=function(t){var
e=this._animatebles.indexOf(t);e>=0&&(this._animatebles[e]=null,t.clock=null)},t.pr
ototype.clear=function(){for(var t=0,e=this._animatebles;t<e.length;t++){var
i=e[t];null!==i&&(i.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.clock=new
t,t})();t.WorldClock=e})(n||(n={})),(function(t){var e=(function(e){function i()
{var t=null!==e&&e.apply(this,arguments)||this;return
t._animationNames=[],t._animationStates=[],t._animations={},t._animationConfig=null
,t}return s(i,e),i.toString=function(){return"[class
dragonBones.Animation]"},i.prototype._onClear=function(){for(var
t=0,e=this._animationStates;t<e.length;t++){e[t].returnToPool()}for(var i in
this._animations)delete this._animations[i];null!
==this._animationConfig&&this._animationConfig.returnToPool(),this.timeScale=1,this
._lockUpdate=!1,this._animationDirty=!
1,this._inheritTimeScale=1,this._animationNames.length=0,this._animationStates.leng
th=0,this._armature=null,this._animationConfig=null,this._lastAnimationState=null},
i.prototype._fadeOut=function(t){switch(t.fadeOutMode){case 1:for(var
e=0,i=this._animationStates;e<i.length;e++)
{null===(h=i[e])._parent&&(h.layer===t.layer&&h.fadeOut(t.fadeOutTime,t.pauseFadeOu
t))}break;case 2:for(var n=0,r=this._animationStates;n<r.length;n++)
{null===(h=r[n])._parent&&(h.group===t.group&&h.fadeOut(t.fadeOutTime,t.pauseFadeOu
t))}break;case 3:for(var s=0,a=this._animationStates;s<a.length;s++)
{null===(h=a[s])._parent&&(h.layer===t.layer&&h.group===t.group&&h.fadeOut(t.fadeOu
tTime,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)}}},i.prototype.i
nit=function(e)
{null===this._armature&&(this._armature=e,this._animationConfig=t.BaseObject.borrow
Object(t.AnimationConfig))},i.prototype.advanceTime=function(t){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);var
e=this._animationStates.length;if(1===e)if((_=this._animationStates[0])._fadeState>
0&&_._subFadeState>0)this._armature._dragonBones.bufferObject(_),this._animationSta
tes.length=0,this._lastAnimationState=null;else{var
i=_._animationData,n=i.cacheFrameRate;if(this._animationDirty&&n>0)
{this._animationDirty=!1;for(var
r=0,s=this._armature.getBones();r<s.length;r++){var
a=s[r];a._cachedFrameIndices=i.getBoneCachedFrameIndices(a.name)}for(var
o=0,l=this._armature.getSlots();o<l.length;o++){var
h=l[o];h._cachedFrameIndices=i.getSlotCachedFrameIndices(h.name)}}_.advanceTime(t,n
)}else if(e>1){for(var c=0,u=0;c<e;++c){var _;
(_=this._animationStates[c])._fadeState>0&&_._subFadeState>0?(u+
+,this._armature._dragonBones.bufferObject(_),this._animationDirty=!
0,this._lastAnimationState===_&&(this._lastAnimationState=null)):
(u>0&&(this._animationStates[c-u]=_),_.advanceTime(t,0)),c===e-
1&&u>0&&(this._animationStates.length-
=u,null===this._lastAnimationState&&this._animationStates.length>0&&(this._lastAnim
ationState=this._animationStates[this._animationStates.length-
1]))}this._armature._cacheFrameIndex=-1}else this._armature._cacheFrameIndex=-
1},i.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._lastAnimationS
tate=null},i.prototype.stop=function(t){if(void 0===t&&(t=null),null!==t)null!
==(n=this.getState(t))&&n.stop();else for(var
e=0,i=this._animationStates;e<i.length;e++){var n;
(n=i[e]).stop()}},i.prototype.playConfig=function(e){var i=e.animation;if(!(i in
this._animations))return console.warn("Non-existent animation.\n","DragonBones
name: "+this._armature.armatureData.parent.name,"Armature name:
"+this._armature.name,"Animation name: "+i),null;var
n=this._animations[i];if(5===e.fadeOutMode)for(var
r=0,s=this._animationStates;r<s.length;r++){var
a=s[r];if(a._animationData===n)return a}0===this._animationStates.length?
e.fadeInTime=0:e.fadeInTime<0&&(e.fadeInTime=n.fadeInTime),e.fadeOutTime<0&&(e.fade
OutTime=e.fadeInTime),e.timeScale<=-100&&(e.timeScale=1/n.scale),n.frameCount>1?
(e.position<0?(e.position%=n.duration,e.position=n.duration-
e.position):e.position===n.duration?e.position-=1e-
6:e.position>n.duration&&(e.position
%=n.duration),e.duration>0&&e.position+e.duration>n.duration&&(e.duration=n.duratio
n-e.position),e.playTimes<0&&(e.playTimes=n.playTimes)):
(e.playTimes=1,e.position=0,e.duration>0&&(e.duration=0)),0===e.duration&&(e.durati
on=-1),this._fadeOut(e);var
o=t.BaseObject.borrowObject(t.AnimationState);if(o.init(this._armature,n,e),this._a
nimationDirty=!0,this._armature._cacheFrameIndex=-1,this._animationStates.length>0)
{for(var l=!1,h=0,c=this._animationStates.length;h<c;++h)
{if(o.layer>this._animationStates[h].layer){l=!
0,this._animationStates.splice(h,0,o);break}if(h!==c-
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
u=0,_=this._armature.getSlots();u<_.length;u++){var f=_[u].childArmature;null!
==f&&f.inheritAnimation&&f.animation.hasAnimation(i)&&null===f.animation.getState(i
)&&f.animation.fadeIn(i)}var d=!1;for(var m in n.animationTimelines)
{this._lockUpdate||(d=!0,this._lockUpdate=!0);var
p=this.fadeIn(m,e.fadeInTime,1,o.layer,null,0);null!==p&&(p.resetToPose=!
1,p._parent=o,p.stop())}return d&&(this._lockUpdate=!1),this._lockUpdate||
(e.fadeInTime<=0&&this._armature.advanceTime(0),this._lastAnimationState=o),o},i.pr
ototype.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._animat
ionConfig.animation=null!==t?t:"",null!
==t&&t.length>0)this.playConfig(this._animationConfig);else
if(null===this._lastAnimationState){var
i=this._armature.armatureData.defaultAnimation;null!
==i&&(this._animationConfig.animation=i.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},i.prototype.fadeIn=function(t,e,i,n,r,s){return void
0===e&&(e=-1),void 0===i&&(i=-1),void 0===n&&(n=0),void 0===r&&(r=null),void
0===s&&(s=3),this._animationConfig.clear(),this._animationConfig.fadeOutMode=s,this
._animationConfig.playTimes=i,this._animationConfig.layer=n,this._animationConfig.f
adeInTime=e,this._animationConfig.animation=t,this._animationConfig.group=null!==r?
r:"",this.playConfig(this._animationConfig)},i.prototype.gotoAndPlayByTime=function
(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=-
1),this._animationConfig.clear(),this._animationConfig.resetToPose=!
0,this._animationConfig.playTimes=i,this._animationConfig.position=e,this._animatio
nConfig.fadeInTime=0,this._animationConfig.animation=t,this.playConfig(this._animat
ionConfig)},i.prototype.gotoAndPlayByFrame=function(t,e,i){void 0===e&&(e=0),void
0===i&&(i=-1),this._animationConfig.clear(),this._animationConfig.resetToPose=!
0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animat
ionConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return
null!
==n&&(this._animationConfig.position=n.duration*e/n.frameCount),this.playConfig(thi
s._animationConfig)},i.prototype.gotoAndPlayByProgress=function(t,e,i){void
0===e&&(e=0),void 0===i&&(i=-
1),this._animationConfig.clear(),this._animationConfig.resetToPose=!
0,this._animationConfig.playTimes=i,this._animationConfig.fadeInTime=0,this._animat
ionConfig.animation=t;var n=t in this._animations?this._animations[t]:null;return
null!==n&&(this._animationConfig.position=n.duration*(e>0?
e:0)),this.playConfig(this._animationConfig)},i.prototype.gotoAndStopByTime=functio
n(t,e){void 0===e&&(e=0);var i=this.gotoAndPlayByTime(t,e,1);return null!
==i&&i.stop(),i},i.prototype.gotoAndStopByFrame=function(t,e){void 0===e&&(e=0);var
i=this.gotoAndPlayByFrame(t,e,1);return null!
==i&&i.stop(),i},i.prototype.gotoAndStopByProgress=function(t,e){void
0===e&&(e=0);var i=this.gotoAndPlayByProgress(t,e,1);return null!
==i&&i.stop(),i},i.prototype.getState=function(t){for(var
e=this._animationStates.length;e--;){var
i=this._animationStates[e];if(i.name===t)return i}return
null},i.prototype.hasAnimation=function(t){return t in
this._animations},i.prototype.getStates=function(){return
this._animationStates},Object.defineProperty(i.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(i.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(i.prototype,"lastAnimationName",{get:function(){return
null!==this._lastAnimationState?this._lastAnimationState.name:""},enumerable:!
0,configurable:!0}),Object.defineProperty(i.prototype,"animationNames",
{get:function(){return this._animationNames},enumerable:!0,configurable:!
0}),Object.defineProperty(i.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(i.prototype,"animationConfig",
{get:function(){return
this._animationConfig.clear(),this._animationConfig},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"lastAnimationState",{get:function(){return
this._lastAnimationState},enumerable:!0,configurable:!
0}),i.prototype.gotoAndPlay=function(t,e,i,n,r,s,a,o,l){void 0===e&&(e=-1),void
0===i&&(i=-1),void 0===n&&(n=-1),void 0===r&&(r=0),void 0===s&&(s=null),void
0===a&&(a=3),void 0===o&&(o=!0),void 0===l&&(l=!
0),this._animationConfig.clear(),this._animationConfig.resetToPose=!
0,this._animationConfig.fadeOutMode=a,this._animationConfig.playTimes=n,this._anima
tionConfig.layer=r,this._animationConfig.fadeInTime=e,this._animationConfig.animati
on=t,this._animationConfig.group=null!==s?s:"";var h=this._animations[t];return
h&&i>0&&(this._animationConfig.timeScale=h.duration/i),this.playConfig(this._animat
ionConfig)},i.prototype.gotoAndStop=function(t,e){return void
0===e&&(e=0),this.gotoAndStopByTime(t,e)},Object.defineProperty(i.prototype,"animat
ionList",{get:function(){return this._animationNames},enumerable:!0,configurable:!
0}),Object.defineProperty(i.prototype,"animationDataList",{get:function(){for(var
t=[],e=0,i=this._animationNames.length;e<i;+
+e)t.push(this._animations[this._animationNames[e]]);return t},enumerable:!
0,configurable:!0}),i})(t.BaseObject);t.Animation=e})(n||(n={})),(function(t){var
e=(function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return
t._blendState=new
n,t._boneMask=[],t._boneTimelines=[],t._surfaceTimelines=[],t._slotTimelines=[],t._
constraintTimelines=[],t._animationTimelines=[],t._poseTimelines=[],t._bonePoses={}
,t._actionTimeline=null,t._zOrderTimeline=null,t._parent=null,t}return
s(r,e),r.toString=function(){return"[class
dragonBones.AnimationState]"},r.prototype._onClear=function(){for(var
t=0,e=this._boneTimelines;t<e.length;t++){e[t].returnToPool()}for(var
i=0,n=this._surfaceTimelines;i<n.length;i++){n[i].returnToPool()}for(var
r=0,s=this._slotTimelines;r<s.length;r++){s[r].returnToPool()}for(var
a=0,o=this._constraintTimelines;a<o.length;a++){o[a].returnToPool()}for(var
l=0,h=this._animationTimelines;l<h.length;l++){h[l].returnToPool()}for(var c in
this._bonePoses)this._bonePoses[c].returnToPool(),delete this._bonePoses[c];null!
==this._actionTimeline&&this._actionTimeline.returnToPool(),null!
==this._zOrderTimeline&&this._zOrderTimeline.returnToPool(),this.actionEnabled=!
1,this.additiveBlending=!1,this.displayControl=!1,this.resetToPose=!
1,this.playTimes=1,this.layer=0,this.timeScale=1,this.weight=1,this.autoFadeOutTime
=0,this.fadeTotalTime=0,this.name="",this.group="",this._timelineDirty=2,this._play
headState=0,this._fadeState=-1,this._subFadeState=-1,this._positi
on=0,this._duration=0,this._fadeTime=0,this._time=0,this._fadeProgress=0,this._weig
htResult=0,this._blendState.clear(),this._boneMask.length=0,this._boneTimelines.len
gth=0,this._surfaceTimelines.length=0,this._slotTimelines.length=0,this._constraint
Timelines.length=0,this._animationTimelines.length=0,this._poseTimelines.length=0,t
his._animationData=null,this._armature=null,this._actionTimeline=null,this._zOrderT
imeline=null,this._parent=null},r.prototype._updateTimelines=function(){for(var
e=0,i=this._armature._constraints;e<i.length;e++){var n=i[e];if(null!
==(l=this._animationData.getConstraintTimelines(n.name)))for(var
r=0,s=l;r<s.length;r++){switch((_=s[r]).type){case 30:
(f=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).constraint=n,f.init(this
._armature,this,_),this._constraintTimelines.push(f)}}else if(this.resetToPose)
{(f=t.BaseObject.borrowObject(t.IKConstraintTimelineState)).constraint=n,f.init(thi
s._armature,this,null),this._constraintTimelines.push(f),this._poseTimelines.push(f
)}}for(var a=0,o=this._armature.animation.getStates();a<o.length;a++){var
l,h=o[a];if(h._parent===this)if(null!
==(l=this._animationData.getAnimationTimelines(h.name)))for(var
c=0,u=l;c<u.length;c++){var _;switch((_=u[c]).type){case 40:var f;
(f=t.BaseObject.borrowObject(t.AnimationTimelineState)).animationState=h,f.init(thi
s._armature,this,_),this._animationTimelines.push(f)}}}},r.prototype._updateBoneAnd
SlotTimelines=function(){for(var e={},n=0,r=this._boneTimelines;n<r.length;n++)
{(l=(y=r[n]).bone.name)in e||(e[l]=[]),e[l].push(y)}for(var
s=0,a=this._armature.getBones();s<a.length;s++){var
o=a[s],l=o.name;if(this.containsBoneMask(l))if(l in e)delete e[l];else
if(0===o._boneData.type){var h=this._animationData.getBoneTimelines(l),c=l in
this._bonePoses?
this._bonePoses[l]:this._bonePoses[l]=t.BaseObject.borrowObject(i);if(null!
==h)for(var u=0,_=h;u<_.length;u++){switch((P=_[u]).type){case 10:
(y=t.BaseObject.borrowObject(t.BoneAllTimelineState)).bone=o,y.bonePose=c,y.init(th
is._armature,this,P),this._boneTimelines.push(y);break;case 11:
(y=t.BaseObject.borrowObject(t.BoneTranslateTimelineState)).bone=o,y.bonePose=c,y.i
nit(this._armature,this,P),this._boneTimelines.push(y);break;case 12:
(y=t.BaseObject.borrowObject(t.BoneRotateTimelineState)).bone=o,y.bonePose=c,y.init
(this._armature,this,P),this._boneTimelines.push(y);break;case 13:
(y=t.BaseObject.borrowObject(t.BoneScaleTimelineState)).bone=o,y.bonePose=c,y.init(
this._armature,this,P),this._boneTimelines.push(y)}}else if(this.resetToPose)
{(y=t.BaseObject.borrowObject(t.BoneAllTimelineState)).bone=o,y.bonePose=c,y.init(t
his._armature,this,null),this._boneTimelines.push(y),this._poseTimelines.push(y)}}e
lse if(1===o._boneData.type){if(null!
==(h=this._animationData.getSurfaceTimelines(l)))for(var f=0,d=h;f<d.length;f++)
{switch((P=d[f]).type){case 50:
(y=t.BaseObject.borrowObject(t.SurfaceTimelineState)).surface=o,y.init(this._armatu
re,this,P),this._surfaceTimelines.push(y)}}else if(this.resetToPose)
{(y=t.BaseObject.borrowObject(t.SurfaceTimelineState)).surface=o,y.init(this._armat
ure,this,null),this._surfaceTimelines.push(y),this._poseTimelines.push(y)}}}for(var
m in e)for(var p=0,v=e[m];p<v.length;p++){var
y=v[p];this._boneTimelines.splice(this._boneTimelines.indexOf(y),1),y.returnToPool(
)}for(var g={},x=[],b=0,A=this._slotTimelines;b<A.length;b++)
{(l=(y=A[b]).slot.name)in g||(g[l]=[]),g[l].push(y)}for(var
C=0,S=this._armature.getSlots();C<S.length;C++){var
T=S[C],w=T.parent.name;if(this.containsBoneMask(w))
{l=T.name,h=this._animationData.getSlotTimelines(l);if(l in g)delete g[l];else{var
E=!1,M=!1;if(x.length=0,null!==h)for(var D=0,B=h;D<B.length;D++){var
P;switch((P=B[D]).type){case 20:
(y=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).slot=T,y.init(this._armatu
re,this,P),this._slotTimelines.push(y),E=!0;break;case 21:
(y=t.BaseObject.borrowObject(t.SlotColorTimelineState)).slot=T,y.init(this._armatur
e,this,P),this._slotTimelines.push(y),M=!0;break;case 22:
(y=t.BaseObject.borrowObject(t.SlotFFDTimelineState)).slot=T,y.init(this._armature,
this,P),this._slotTimelines.push(y),x.push(y.meshOffset)}}if(this.resetToPose){if(!
E)
(y=t.BaseObject.borrowObject(t.SlotDislayTimelineState)).slot=T,y.init(this._armatu
re,this,null),this._slotTimelines.push(y),this._poseTimelines.push(y);if(!M)
(y=t.BaseObject.borrowObject(t.SlotColorTimelineState)).slot=T,y.init(this._armatur
e,this,null),this._slotTimelines.push(y),this._poseTimelines.push(y);if(null!
==T.rawDisplayDatas)for(var I=0,R=T.rawDisplayDatas;I<R.length;I++){var
O=R[I];if(null!==O&&2===O.type){var L=O.offset;if(x.indexOf(L)<0)
(y=t.BaseObject.borrowObject(t.SlotFFDTimelineState)).meshOffset=L,y.slot=T,y.init(
this._armature,this,null),this._slotTimelines.push(y),this._poseTimelines.push(y)}}
}}}}for(var m in g)for(var F=0,V=g[m];F<V.length;F++)
{y=V[F];this._slotTimelines.splice(this._slotTimelines.indexOf(y),1),y.returnToPool
()}},r.prototype._advanceFadeTime=function(e){var
i=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var n=i?
t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasD
BEventListener(n))
(r=t.BaseObject.borrowObject(t.EventObject)).type=n,r.armature=this._armature,r.ani
mationState=this,this._armature._dragonBones.bufferEvent(r)}if(e<0&&(e=-
e),this._fadeTime+=e,this._fadeTime>=this.fadeTotalTime?
(this._subFadeState=1,this._fadeProgress=i?0:1):this._fadeTime>0?
this._fadeProgress=i?1-
this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime:this._fadeProgr
ess=i?1:0,this._subFadeState>0){i||(this._playheadState|=1,this._fadeState=0);var
r;n=i?
t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.ev
entDispatcher.hasDBEventListener(n))
(r=t.BaseObject.borrowObject(t.EventObject)).type=n,r.armature=this._armature,r.ani
mationState=this,this._armature._dragonBones.bufferEvent(r)}},r.prototype.init=func
tion(e,i,n){if(null===this._armature)
{if(this._armature=e,this._animationData=i,this.resetToPose=n.resetToPose,this.addi
tiveBlending=n.additiveBlending,this.displayControl=n.displayControl,this.actionEna
bled=n.actionEnabled,this.layer=n.layer,this.playTimes=n.playTimes,this.timeScale=n
.timeScale,this.fadeTotalTime=n.fadeInTime,this.autoFadeOutTime=n.autoFadeOutTime,t
his.weight=n.weight,this.name=n.name.length>0?
n.name:n.animation,this.group=n.group,n.pauseFadeIn?
this._playheadState=2:this._playheadState=3,n.duration<0?
(this._position=0,this._duration=this._animationData.duration,0!==n.position?
this.timeScale>=0?this._time=n.position:this._time=n.position-
this._duration:this._time=0):
(this._position=n.position,this._duration=n.duration,this._time=0),this.timeScale<0
&&0===this._time&&(this._time=-1e-
6),this.fadeTotalTime<=0&&(this._fadeProgress=.999999),n.boneMask.length>0)
{this._boneMask.length=n.boneMask.length;for(var r=0,s=this._boneMask.length;r<s;+
+r)this._boneMask[r]=n.boneMask[r]}this._actionTimeline=t.BaseObject.borrowObject(t
.ActionTimelineState),this._actionTimeline.init(this._armature,this,this._animation
Data.actionTimeline),this._actionTimeline.currentTime=this._time,this._actionTimeli
ne.currentTime<0&&(this._actionTimeline.currentTime=this._duration-
this._actionTimeline.currentTime),null!
==this._animationData.zOrderTimeline&&(this._zOrderTimeline=t.BaseObject.borrowObje
ct(t.ZOrderTimelineState),this._zOrderTimeline.init(this._armature,this,this._anima
tionData.zOrderTimeline))}},r.prototype.advanceTime=function(e,i)
{if(this._blendState.dirty=!1,0===this._fadeState&&0===this._subFadeState||
this._advanceFadeTime(e),3===this._playheadState&&(1!
==this.timeScale&&(e*=this.timeScale),this._time+=e),0!
==this._timelineDirty&&(2===this._timelineDirty&&this._updateTimelines(),this._time
lineDirty=0,this._updateBoneAndSlotTimelines()),0!==this.weight){var
n=0===this._fadeState&&i>0,r=!0,s=!
0,a=this._time;if(this._weightResult=this.weight*this._fadeProgress,null!
==this._parent&&(this._weightResult*=this._parent._weightResult/this._parent._fadeP
rogress),this._actionTimeline.playState<=0&&this._actionTimeline.update(a),n){var
o=2*i;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*
o)/o}if(null!
==this._zOrderTimeline&&this._zOrderTimeline.playState<=0&&this._zOrderTimeline.upd
ate(a),n){var
l=Math.floor(this._actionTimeline.currentTime*i);this._armature._cacheFrameIndex===
l?(r=!1,s=!1):
(this._armature._cacheFrameIndex=l,this._animationData.cachedFrames[l]?s=!
1:this._animationData.cachedFrames[l]=!0)}if(r){if(s)for(var
h=0,c=this._boneTimelines.length;h<c;++h)
{if((m=this._boneTimelines[h]).playState<=0&&m.update(a),h===c-1||m.bone!
==this._boneTimelines[h+1].bone)0!
==(u=m.bone._blendState.update(this._weightResult,this.layer))&&m.blend(u)}for(h=0,
c=this._surfaceTimelines.length;h<c;++h){var
u=(m=this._surfaceTimelines[h]).surface._blendState.update(this._weightResult,this.
layer);m.playState<=0&&m.update(a),0!
==u&&m.blend(u)}if(this.displayControl)for(h=0,c=this._slotTimelines.length;h<c;+
+h){var _=(m=this._slotTimelines[h]).slot.displayController;null!==_&&_!
==this.name&&_!==this.group||
m.playState<=0&&m.update(a)}for(h=0,c=this._constraintTimelines.length;h<c;++h)
{(m=this._constraintTimelines[h]).playState<=0&&m.update(a)}for(h=0,c=this._animati
onTimelines.length;h<c;++h)
{u=(m=this._animationTimelines[h]).animationState._blendState.update(this._weightRe
sult,this.layer);m.playState<=0&&m.update(a),0!
==u&&m.blend(u)}}if(0===this._fadeState)
{if(this._subFadeState>0&&(this._subFadeState=0,this._poseTimelines.length>0))
{for(var f=0,d=this._poseTimelines;f<d.length;f++){var m;(m=d[f])instanceof
t.BoneTimelineState?this._boneTimelines.splice(this._boneTimelines.indexOf(m),1):m
instanceof t.SurfaceTimelineState?
this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(m),1):m instanceof
t.SlotTimelineState?this._slotTimelines.splice(this._slotTimelines.indexOf(m),1):m
instanceof
t.ConstraintTimelineState&&this._constraintTimelines.splice(this._constraintTimelin
es.indexOf(m),1),m.returnToPool()}this._poseTimelines.length=0}this._ac
tionTimeline.playState>0&&this.autoFadeOutTime>=0&&this.fadeOut(this.autoFadeOutTim
e)}}},r.prototype.play=function()
{this._playheadState=3},r.prototype.stop=function()
{this._playheadState&=1},r.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
i=0,n=this._boneTimelines;i<n.length;i++){(_=n[i]).fadeOut()}for(var
r=0,s=this._surfaceTimelines;r<s.length;r++){(_=s[r]).fadeOut()}for(var
a=0,o=this._slotTimelines;a<o.length;a++){(_=o[a]).fadeOut()}for(var
l=0,h=this._constraintTimelines;l<h.length;l++){(_=h[l]).fadeOut()}for(var
c=0,u=this._animationTimelines;c<u.length;c++){var _;
(_=u[c]).animationState.fadeOut(t,e),_.fadeOut()}}this.displayControl=!
1,this.fadeTotalTime=this._fadeProgress>1e-6?
t/this._fadeProgress:0,this._fadeTime=this.fadeTotalTime*(1-
this._fadeProgress)},r.prototype.containsBoneMask=function(t){return
0===this._boneMask.length||
this._boneMask.indexOf(t)>=0},r.prototype.addBoneMask=function(t,e){void
0===e&&(e=!0);var i=this._armature.getBone(t);if(null!==i)
{if(this._boneMask.indexOf(t)<0&&this._boneMask.push(t),e)for(var
n=0,r=this._armature.getBones();n<r.length;n++){var
s=r[n];this._boneMask.indexOf(s.name)<0&&i.contains(s)&&this._boneMask.push(s.name)
}this._timelineDirty=1}},r.prototype.removeBoneMask=function(t,e){void 0===e&&(e=!
0);var i=this._boneMask.indexOf(t);if(i>=0&&this._boneMask.splice(i,1),e){var
n=this._armature.getBone(t);if(null!==n){var
r=this._armature.getBones();if(this._boneMask.length>0)for(var
s=0,a=r;s<a.length;s++){var
o=a[s],l=this._boneMask.indexOf(o.name);l>=0&&n.contains(o)&&this._boneMask.splice(
l,1)}else for(var h=0,c=r;h<c.length;h++){(o=c[h])!==n&&(n.contains(o)||
this._boneMask.push(o.name))}}}this._timelineDirty=1},r.prototype.removeAllBoneMask
=function()
{this._boneMask.length=0,this._timelineDirty=1},Object.defineProperty(r.prototype,"
isFadeIn",{get:function(){return this._fadeState<0},enumerable:!0,configurable:!
0}),Object.defineProperty(r.prototype,"isFadeOut",{get:function(){return
this._fadeState>0},enumerable:!0,configurable:!
0}),Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return
0===this._fadeState},enumerable:!0,configurable:!
0}),Object.defineProperty(r.prototype,"isPlaying",{get:function(){return 0!
=(2&this._playheadState)&&this._actionTimeline.playState<=0},enumerable:!
0,configurable:!0}),Object.defineProperty(r.prototype,"isCompleted",{get:function()
{return this._actionTimeline.playState>0},enumerable:!0,configurable:!
0}),Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return
this._actionTimeline.currentPlayTimes},enumerable:!0,configurable:!
0}),Object.defineProperty(r.prototype,"totalTime",{get:function(){return
this._duration},enumerable:!0,configurable:!
0}),Object.defineProperty(r.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&&(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
i=0,n=this._boneTimelines;i<n.length;i++){n[i].playState=-1}for(var
r=0,s=this._slotTimelines;r<s.length;r++){s[r].playState=-1}}},enumerable:!
0,configurable:!0}),Object.defineProperty(r.prototype,"animationData",
{get:function(){return this._animationData},enumerable:!0,configurable:!0}),r})
(t.BaseObject);t.AnimationState=e;var i=(function(e){function i(){var i=null!
==e&&e.apply(this,arguments)||this;return i.current=new t.Transform,i.delta=new
t.Transform,i.result=new t.Transform,i}return s(i,e),i.toString=function()
{return"[class dragonBones.BonePose]"},i.prototype._onClear=function()
{this.current.identity(),this.delta.identity(),this.result.identity()},i})
(t.BaseObject);t.BonePose=i;var n=(function(){function t(){}return
t.prototype.update=function(t,e){if(this.dirty){if(!(this.leftWeight>0))return
0;if(this.layer!==e){if(this.layerWeight>=this.leftWeight)return
this.leftWeight=0,0;this.layer=e,this.leftWeight-
=this.layerWeight,this.layerWeight=0}return
t*=this.leftWeight,this.layerWeight+=t,this.blendWeight=t,1}return this.dirty=!
0,this.layer=e,this.layerWeight=t,this.leftWeight=1,this.blendWeight=t,-
1},t.prototype.clear=function(){this.dirty=!
1,this.layer=0,this.leftWeight=0,this.layerWeight=0,this.blendWeight=0},t})
();t.BlendState=n})(n||(n={})),(function(t){var e=(function(t){function e(){return
null!==t&&t.apply(this,arguments)||this}return
s(e,t),e.prototype._onClear=function(){this.playState=-1,this.currentPlayTimes=-
1,this.currentTime=-
1,this._tweenState=0,this._frameRate=0,this._frameValueOffset=0,this._frameCount=0,
this._frameOffset=0,this._frameIndex=-
1,this._frameRateR=0,this._position=0,this._duration=0,this._timeScale=1,this._time
Offset=0,this._dragonBonesData=null,this._animationData=null,this._timelineData=nul
l,this._armature=null,this._animationState=null,this._actionTimeline=null,this._fra
meArray=null,this._frameIntArray=null,this._frameFloatArray=null,this._timelineArra
y=null,this._frameIndices=null},e.prototype._setCurrentTime=function(t){var
e=this.playState,i=this.currentPlayTimes,n=this.currentTime;if(null!
==this._actionTimeline&&this._frameCount<=1)this.playState=this._actionTimeline.pla
yState>=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,s=r*this._duration;t*=this._timeScale,0!
==this._timeOffset&&(t+=this._timeOffset*this._animationData.duration),r>0&&(t>=s||
t<=-s)?
(this.playState<=0&&3===this._animationState._playheadState&&(this.playState=1),thi
s.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._duratio
n-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._actionTim
eline.currentPlayTimes,this.currentTime=this._actionTimeline.currentTime;return(thi
s.currentPlayTimes!==i||this.currentTime!==n)&&((e<0&&this.playState!==e||
this.playState<=0&&this.currentPlayTimes!==i)&&(this._frameIndex=-1),!
0)},e.prototype.init=function(t,e,i)
{this._armature=t,this._animationState=e,this._timelineData=i,this._actionTimeline=
this._animationState._actionTimeline,this===this._actionTimeline&&(this._actionTime
line=null),this._animationData=this._animationState._animationData,this._frameRate=
this._animationData.parent.frameRate,this._frameRateR=1/this._frameRate,this._posit
ion=this._animationState._position,this._duration=this._animationState._duration,th
is._dragonBonesData=this._animationData.parent.parent,null!
==this._timelineData&&(this._frameIntArray=this._dragonBonesData.frameIntArray,this
._frameFloatArray=this._dragonBonesData.frameFloatArray,this._frameArray=this._drag
onBonesData.frameArray,this._timelineArray=this._dragonBonesData.timelineArray,this
._frameIndices=this._dragonBonesData.frameIndices,this._frameCount=this._timelineAr
ray[this._timelineData.offset+2],this._frameValueOffset=this._timelineArray[this._t
imelineData.offset+4],this._timeScale=100/this._timelineArray[this._timelineData.of
fset+0],this._timeOffset=.01*this._timelineArray[this._timelineData.offset+1])},e.p
rototype.fadeOut=function(){},e.prototype.update=function(t)
{if(this._setCurrentTime(t)){if(this._frameCount>1){var
e=Math.floor(this.currentTime*this._frameRate),i=this._frameIndices[this._timelineD
ata.frameIndicesOffset+e];this._frameIndex!
==i&&(this._frameIndex=i,this._frameOffset=this._animationData.frameOffset+this._ti
melineArray[this._timelineData.offset+5+this._frameIndex],this._onArriveAtFrame())}
else this._frameIndex<0&&(this._frameIndex=0,null!
==this._timelineData&&(this._frameOffset=this._animationData.frameOffset+this._time
lineArray[this._timelineData.offset+5]),this._onArriveAtFrame());0!
==this._tweenState&&this._onUpdateFrame()}},e})(t.BaseObject);t.TimelineState=e;var
i=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(e,t),e._getEasingValue=function(t,e,i){var n=e;switch(t){case
3:n=Math.pow(e,2);break;case 4:n=1-Math.pow(1-e,2);break;case 5:n=.5*(1-
Math.cos(e*Math.PI))}return(n-e)*i+e},e._getEasingCurveValue=function(t,e,i,n)
{if(t<=0)return 0;if(t>=1)return 1;var r=i+1,s=Math.floor(t*r),a=0===s?0:e[n+s-
1];return 1e-4*(a+((s===r-1?1e4:e[n+s])-a)*(t*r-
s))},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this._tweenType=0,this._curveCount=0,this._framePo
sition=0,this._frameDurationR=0,this._tweenProgress=0,this._tweenEasing=0},e.protot
ype._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._tweenState=0===th
is._tweenType?1:2,2===this._tweenType?
this._curveCount=this._frameArray[this._frameOffset+2]:0!==this._tweenType&&1!
==this._tweenType&&(this._tweenEasing=.01*this._frameArray[this._frameOffset+2]),th
is._framePosition=this._frameArray[this._frameOffset]*this._frameRateR,this._frameI
ndex===this._frameCount-1)this._frameDurationR=1/(this._animationData.duration-
this._framePosition);else{var
t=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+t
his._frameIndex+1],e=this._frameArray[t]*this._frameRateR-
this._framePosition;this._frameDurationR=e>0?1/e:0}else
this._tweenState=1},e.prototype._onUpdateFrame=function(){2===this._tweenState?
(this._tweenProgress=(this.currentTime-
this._framePosition)*this._frameDurationR,2===this._tweenType?
this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,thi
s._curveCount,this._frameOffset+3):1!
==this._tweenType&&(this._tweenProgress=e._getEasingValue(this._tweenType,this._twe
enProgress,this._tweenEasing))):this._tweenProgress=0},e})
(e);t.TweenTimelineState=i;var n=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.bone=null,this.bonePose=null},e.prototype.ble
nd=function(t){var
e=this.bone._blendState.blendWeight,i=this.bone.animationPose,n=this.bonePose.resul
t;t>0?
(i.x+=n.x*e,i.y+=n.y*e,i.rotation+=n.rotation*e,i.skew+=n.skew*e,i.scaleX+=(n.scale
X-1)*e,i.scaleY+=(n.scaleY-1)*e):1!==e?
(i.x=n.x*e,i.y=n.y*e,i.rotation=n.rotation*e,i.skew=n.skew*e,i.scaleX=(n.scaleX-
1)*e+1,i.scaleY=(n.scaleY-1)*e+1):
(i.x=n.x,i.y=n.y,i.rotation=n.rotation,i.skew=n.skew,i.scaleX=n.scaleX,i.scaleY=n.s
caleY),0===this._animationState._fadeState&&0===this._animationState._subFadeState|
|(this.bone._transformDirty=!0)},e})(i);t.BoneTimelineState=n;var r=(function(t)
{function e(){return null!==t&&t.apply(this,arguments)||this}return
s(e,t),e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.slot=null},e})(i);t.SlotTimelineState=r;var
a=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(e,t),e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.constraint=null},e})
(i);t.ConstraintTimelineState=a})(n||(n={})),(function(t){var e=(function(e)
{function i(){return null!==e&&e.apply(this,arguments)||this}return
s(i,e),i.toString=function(){return"[class
dragonBones.ActionTimelineState]"},i.prototype._onCrossFrame=function(e){var
i=this._armature.eventDispatcher;if(this._animationState.actionEnabled)for(var
n=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e
],r=this._frameArray[n+1],s=this._animationData.parent.actions,a=0;a<r;++a){var
o=s[this._frameArray[n+2+a]];if(0===o.type){if(null!==o.slot){if(null!
==(c=this._armature.getSlot(o.slot.name)))null!
==(u=c.childArmature)&&u._bufferAction(o,!0)}else if(null!==o.bone)for(var
l=0,h=this._armature.getSlots();l<h.length;l++){var c,u;null!
==(u=(c=h[l]).childArmature)&&c.parent._boneData===o.bone&&u._bufferAction(o,!
0)}else this._armature._bufferAction(o,!0)}else{var _=10===o.type?
t.EventObject.FRAME_EVENT:t.EventObject.SOUND_EVENT;if(11===o.type||
i.hasDBEventListener(_)){var
f=t.BaseObject.borrowObject(t.EventObject);f.time=this._frameArray[n]/this._frameRa
te,f.type=_,f.name=o.name,f.data=o.data,f.armature=this._armature,f.animationState=
this._animationState,null!
==o.bone&&(f.bone=this._armature.getBone(o.bone.name)),null!
==o.slot&&(f.slot=this._armature.getSlot(o.slot.name)),this._armature._dragonBones.
bufferEvent(f)}}}},i.prototype._onArriveAtFrame=function()
{},i.prototype._onUpdateFrame=function(){},i.prototype.update=function(e){var
i=this.playState,n=this.currentPlayTimes,r=this.currentTime;if(this._setCurrentTime
(e)){var s=this._armature.eventDispatcher;if(i<0)
{if(this.playState===i)return;if(this._animationState.displayControl&&this._animati
onState.resetToPose&&this._armature._sortZOrder(null,0),n=this.currentPlayTimes,s.h
asDBEventListener(t.EventObject.START)){var
a=t.BaseObject.borrowObject(t.EventObject);a.type=t.EventObject.START,a.armature=th
is._armature,a.animationState=this._animationState,this._armature._dragonBones.buff
erEvent(a)}}var
o=this._animationState.timeScale<0,l=null,h=null;if(this.currentPlayTimes!
==n&&(s.hasDBEventListener(t.EventObject.LOOP_COMPLETE)&&((l=t.BaseObject.borrowObj
ect(t.EventObject)).type=t.EventObject.LOOP_COMPLETE,l.armature=this._armature,l.an
imationState=this._animationState),this.playState>0&&s.hasDBEventListener(t.EventOb
ject.COMPLETE)&&((h=t.BaseObject.borrowObject(t.EventObject)).type=t.EventObject.CO
MPLETE,h.armature=this._armature,h.animationState=this._animationState)),this._fram
eCount>1){var
c=this._timelineData,u=Math.floor(this.currentTime*this._frameRate),_=this._frameIn
dices[c.frameIndicesOffset+u];if(this._frameIndex!==_){var
f=this._frameIndex;if(this._frameIndex=_,null!
==this._timelineArray)if(this._frameOffset=this._animationData.frameOffset+this._ti
melineArray[c.offset+5+this._frameIndex],o){if(f<0){var
d=Math.floor(r*this._frameRate);f=this._frameIndices[c.frameIndicesOffset+d],this.c
urrentPlayTimes===n&&f===_&&(f=-1)}for(;f>=0;){var
m=this._animationData.frameOffset+this._timelineArray[c.offset+5+f],p=this._frameAr
ray[m]/this._frameRate;if(this._position<=p&&p<=this._position+this._duration&&this
._onCrossFrame(f),null!
==l&&0===f&&(this._armature._dragonBones.bufferEvent(l),l=null),f>0?
f--:f=this._frameCount-1,f===_)break}}else{if(f<0)
{d=Math.floor(r*this._frameRate);f=this._frameIndices[c.frameIndicesOffset+d];m=thi
s._animationData.frameOffset+this._timelineArray[c.offset+5+f],p=this._frameArray[m
]/this._frameRate;this.currentPlayTimes===n&&(r<=p?f>0?f--:f=this._frameCount-
1:f===_&&(f=-1))}for(;f>=0;){f<this._frameCount-1?f+
+:f=0;m=this._animationData.frameOffset+this._timelineArray[c.offset+5+f],p=this._f
rameArray[m]/this._frameRate;if(this._position<=p&&p<=this._position+this._duration
&&this._onCrossFrame(f),null!
==l&&0===f&&(this._armature._dragonBones.bufferEvent(l),l=null),f===_)break}}}}else
if(this._frameIndex<0&&(this._frameIndex=0,null!==this._timelineData))
{this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timeli
neData.offset+5];p=this._frameArray[this._frameOffset]/this._frameRate;this.current
PlayTimes===n?r<=p&&this._onCrossFrame(this._frameIndex):this._position<=p&&(o||
null===l||
(this._armature._dragonBones.bufferEvent(l),l=null),this._onCrossFrame(this._frameI
ndex))}null!==l&&this._armature._dragonBones.bufferEvent(l),null!
==h&&this._armature._dragonBones.bufferEvent(h)}},i.prototype.setCurrentTime=functi
on(t){this._setCurrentTime(t),this._frameIndex=-1},i})
(t.TimelineState);t.ActionTimelineState=e;var i=(function(t){function e(){return
null!==t&&t.apply(this,arguments)||this}return s(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._so
rtZOrder(null,0))},e.prototype._onUpdateFrame=function(){},e})
(t.TimelineState);t.ZOrderTimelineState=i;var n=(function(e){function i(){return
null!==e&&e.apply(this,arguments)||this}return s(i,e),i.toString=function()
{return"[class
dragonBones.BoneAllTimelineState]"},i.prototype._onArriveAtFrame=function()
{if(e.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
t=this._animationData.frameFloatOffset+this._frameValueOffset+6*this._frameIndex,i=
this._armature._armatureData.scale,n=this._frameFloatArray,r=this.bonePose.current,
s=this.bonePose.delta;r.x=n[t++]*i,r.y=n[t++]*i,r.rotation=n[t++],r.skew=n[t+
+],r.scaleX=n[t++],r.scaleY=n[t++],2===this._tweenState?
(this._frameIndex===this._frameCount-
1&&(t=this._animationData.frameFloatOffset+this._frameValueOffset),s.x=n[t++]*i-
r.x,s.y=n[t++]*i-r.y,s.rotation=n[t++]-r.rotation,s.skew=n[t++]-
r.skew,s.scaleX=n[t++]-r.scaleX,s.scaleY=n[t++]-r.scaleY):
(s.x=0,s.y=0,s.rotation=0,s.skew=0,s.scaleX=0,s.scaleY=0)}else{r=this.bonePose.curr
ent,s=this.bonePose.delta;r.x=0,r.y=0,r.rotation=0,r.skew=0,r.scaleX=1,r.scaleY=1,s
.x=0,s.y=0,s.rotation=0,s.skew=0,s.scaleX=0,s.scaleY=0}},i.prototype._onUpdateFrame
=function(){e.prototype._onUpdateFrame.call(this);var
t=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._tra
nsformDirty=!0,2!
==this._tweenState&&(this._tweenState=0),n.x=t.x+i.x*this._tweenProgress,n.y=t.y+i.
y*this._tweenProgress,n.rotation=t.rotation+i.rotation*this._tweenProgress,n.skew=t
.skew+i.skew*this._tweenProgress,n.scaleX=t.scaleX+i.scaleX*this._tweenProgress,n.s
caleY=t.scaleY+i.scaleY*this._tweenProgress},i.prototype.fadeOut=function(){var
e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation),e.skew=t.
Transform.normalizeRadian(e.skew)},i})
(t.BoneTimelineState);t.BoneAllTimelineState=n;var r=(function(t){function e()
{return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.BoneTranslateTimelineState]"},e.prototype._onArriveAtFrame=function()
{if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
e=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,i=
this._armature._armatureData.scale,n=this._frameFloatArray,r=this.bonePose.current,
s=this.bonePose.delta;r.x=n[e++]*i,r.y=n[e++]*i,2===this._tweenState?
(this._frameIndex===this._frameCount-
1&&(e=this._animationData.frameFloatOffset+this._frameValueOffset),s.x=n[e++]*i-
r.x,s.y=n[e++]*i-r.y):
(s.x=0,s.y=0)}else{r=this.bonePose.current,s=this.bonePose.delta;r.x=0,r.y=0,s.x=0,
s.y=0}},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this);var
e=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._tra
nsformDirty=!0,2!
==this._tweenState&&(this._tweenState=0),n.x=e.x+i.x*this._tweenProgress,n.y=e.y+i.
y*this._tweenProgress},e})(t.BoneTimelineState);t.BoneTranslateTimelineState=r;var
a=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return
s(i,e),i.toString=function(){return"[class
dragonBones.BoneRotateTimelineState]"},i.prototype._onArriveAtFrame=function()
{if(e.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
t=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,i=
this._frameFloatArray,n=this.bonePose.current,r=this.bonePose.delta;n.rotation=i[t+
+],n.skew=i[t++],2===this._tweenState?(this._frameIndex===this._frameCount-
1&&(t=this._animationData.frameFloatOffset+this._frameValueOffset),r.rotation=i[t+
+]-n.rot
ation,r.skew=i[t++]-n.skew):
(r.rotation=0,r.skew=0)}else{n=this.bonePose.current,r=this.bonePose.delta;n.rotati
on=0,n.skew=0,r.rotation=0,r.skew=0}},i.prototype._onUpdateFrame=function()
{e.prototype._onUpdateFrame.call(this);var
t=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._tra
nsformDirty=!0,2!
==this._tweenState&&(this._tweenState=0),n.rotation=t.rotation+i.rotation*this._twe
enProgress,n.skew=t.skew+i.skew*this._tweenProgress},i.prototype.fadeOut=function()
{var
e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation),e.skew=t.
Transform.normalizeRadian(e.skew)},i})
(t.BoneTimelineState);t.BoneRotateTimelineState=a;var o=(function(t){function e()
{return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.BoneScaleTimelineState]"},e.prototype._onArriveAtFrame=function()
{if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
e=this._animationData.frameFloatOffset+this._frameValueOffset+2*this._frameIndex,i=
this._frameFloatArray,n=this.bonePose.current,r=this.bonePose.delta;n.scaleX=i[e+
+],n.scaleY=i[e++],2===this._tweenState?(this._frameIndex===this._frameCount-
1&&(e=this._animationData.frameFloatOffset+this._frameValueOffset),r.scaleX=i[e++]-
n.scaleX,r.scaleY=i[e++]-n.scaleY):
(r.scaleX=0,r.scaleY=0)}else{n=this.bonePose.current,r=this.bonePose.delta;n.scaleX
=1,n.scaleY=1,r.scaleX=0,r.scaleY=0}},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this);var
e=this.bonePose.current,i=this.bonePose.delta,n=this.bonePose.result;this.bone._tra
nsformDirty=!0,2!
==this._tweenState&&(this._tweenState=0),n.scaleX=e.scaleX+i.scaleX*this._tweenProg
ress,n.scaleY=e.scaleY+i.scaleY*this._tweenProgress},e})
(t.BoneTimelineState);t.BoneScaleTimelineState=o;var l=(function(t){function e()
{var e=null!==t&&t.apply(this,arguments)||this;return
e._current=[],e._delta=[],e._result=[],e}return s(e,t),e.toString=function()
{return"[class dragonBones.SurfaceTimelineState]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.surface=null,this._frameFloatOffset=0,this._v
alueCount=0,this._deformCount=0,this._valueOffset=0,this._current.length=0,this._de
lta.length=0,this._result.length=0},e.prototype._onArriveAtFrame=function()
{if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this
._valueCount,i=this._armature._armatureData.scale,n=this._frameFloatArray;if(2===th
is._tweenState){var r=e+this._valueCount;this._frameIndex===this._frameCount-
1&&(r=this._animationData.frameFloatOffset+this._frameValueOffset);for(var
s=0;s<this._valueCount;++s)this._delta[s]=n[r+s]*i-(this._current[s]=n[e+s]*i)}else
for(s=0;s<this._valueCount;++s)this._current[s]=n[e+s]*i}else
for(s=0;s<this._valueCount;+
+s)this._current[s]=0},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this),this.surface._transformDirty=!0,2!
==this._tweenState&&(this._tweenState=0);for(var e=0;e<this._valueCount;+
+e)this._result[e]=this._current[e]
+this._delta[e]*this._tweenProgress},e.prototype.init=function(e,i,n)
{if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var
r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+
3];this._deformCount=this._frameIntArray[r+1],this._valueCount=this._frameIntArray[
r+2],this._valueOffset=this._frameIntArray[r+3],this._frameFloatOffset=this._frameI
ntArray[r+4]+this._animationData.frameFloatOffset}else
this._deformCount=this.surface._deformVertices.length,this._valueCount=this._deform
Count,this._valueOffset=0,this._frameFloatOffset=0;this._current.length=this._value
Count,this._delta.length=this._valueCount,this._result.length=this._valueCount;for(
var s=0;s<this._valueCount;++s)this._delta[s]=0},e.prototype.blend=function(t)
{for(var
e=this.surface._blendState.blendWeight,i=this.surface._deformVertices,n=0;n<this._d
eformCount;++n){var r=0;r=n<this._valueOffset?
this._frameFloatArray[this._frameFloatOffset+n]:n<this._valueOffset+this._valueCoun
t?this._result[n-this._valueOffset]:this._frameFloatArray[this._frameFloatOffset+n-
this._valueCount],t>0?i[n]+=r*e:i[n]=1!==e?
r*e:r}0===this._animationState._fadeState&&0===this._animationState._subFadeState||
(this.surface._transformDirty=!0)},e})
(t.TweenTimelineState);t.SurfaceTimelineState=l;var h=(function(t){function e()
{return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.SlotDislayTimelineState]"},e.prototype._onArriveAtFrame=function()
{if(this.playState>=0){var t=null!==this._timelineData?
this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;this.slot.di
splayIndex!==t&&this.slot._setDisplayIndex(t,!0)}},e})
(t.SlotTimelineState);t.SlotDislayTimelineState=h;var c=(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._delta=[0,0,0,0,0,0,0,0],e._result=[0,0,0,0,0,0,0,0]
,e}return s(e,t),e.toString=function(){return"[class
dragonBones.SlotColorTimelineState]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this._dirty=!
1},e.prototype._onArriveAtFrame=function()
{if(t.prototype._onArriveAtFrame.call(this),null!==this._timelineData){var
e=this._dragonBonesData.intArray,i=this._frameIntArray,n=this._animationData.frameI
ntOffset+this._frameValueOffset+1*this._frameIndex,r=i[n];r<0&&(r+=65536),this._cur
rent[0]=e[r++],this._current[1]=e[r++],this._current[2]=e[r+
+],this._current[3]=e[r++],this._current[4]=e[r++],this._current[5]=e[r+
+],this._current[6]=e[r++],this._current[7]=e[r+
+],2===this._tweenState&&((r=this._frameIndex===this._frameCount-1?
i[this._animationData.frameIntOffset+this._frameValueOffset]:i[n+1])<0&&(r+=65536),
this._delta[0]=e[r++]-this._current[0],this._delta[1]=e[r++]-
this._current[1],this._delta[2]=e[r++]-this._current[2],this._delta[3]=e[r++]-
this._current[3],this._delta[4]=e[r++]-this._current[4],this._delta[5]=e[r++]-
this._current[5],this._delta[6]=e[r++]-this._current[6],this._delta[7]=e[r++]-
this._current[7])}else{var
s=this.slot._slotData.color;this._current[0]=100*s.alphaMultiplier,this._current[1]
=100*s.redMultiplier,this._current[2]=100*s.greenMultiplier,this._current[3]=100*s.
blueMultiplier,this._current[4]=s.alphaOffset,this._current[5]=s.redOffset,this._cu
rrent[6]=s.greenOffset,this._current[7]=s.blueOffset}},e.prototype._onUpdateFrame=f
unction(){t.prototype._onUpdateFrame.call(this),this._dirty=!0,2!
==this._tweenState&&(this._tweenState=0),this._result[0]=.01*(this._current[0]+this
._delta[0]*this._tweenProgress),this._result[1]=.01*(this._current[1]+this._delta[1
]*this._tweenProgress),this._result[2]=.01*(this._current[2]+this._delta[2]*this._t
weenProgress),this._result[3]=.01*(this._current[3]+this._delta[3]*this._tweenProgr
ess),this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress,this._resu
lt[5]=this._current[5]+this._delta[5]*this._tweenProgress,this._result[6]=this._cur
rent[6]+this._delta[6]*this._tweenProgress,this._result[7]=this._current[7]+this._d
elta[7]*this._tweenProgress},e.prototype.fadeOut=function()
{this._tweenState=0,this._dirty=!1},e.prototype.update=function(e)
{if(t.prototype.update.call(this,e),0!==this._tweenState||this._dirty){var
i=this.slot._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
n=Math.pow(this._animationState._fadeProgress,4);i.alphaMultiplier+=(this._result[0
]-i.alphaMultiplier)*n,i.redMultiplier+=(this._result[1]-
i.redMultiplier)*n,i.greenMultiplier+=(this._result[2]-
i.greenMultiplier)*n,i.blueMultiplier+=(this._result[3]-
i.blueMultiplier)*n,i.alphaOffset+=(this._result[4]-
i.alphaOffset)*n,i.redOffset+=(this._result[5]-
i.redOffset)*n,i.greenOffset+=(this._result[6]-
i.greenOffset)*n,i.blueOffset+=(this._result[7]-
i.blueOffset)*n,this.slot._colorDirty=!0}}else this._dirty&&(this._dirty=!
1,i.alphaMultiplier===this._result[0]&&i.redMultiplier===this._result[1]&&i.greenMu
ltiplier===this._result[2]&&i.blueMultiplier===this._result[3]&&i.alphaOffset===thi
s._result[4]&&i.redOffset===this._result[5]&&i.greenOffset===this._result[6]&&i.blu
eOffset===this._result[7]||
(i.alphaMultiplier=this._result[0],i.redMultiplier=this._result[1],i.greenMultiplie
r=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
],this.slot._colorDirty=!0))}},e})
(t.SlotTimelineState);t.SlotColorTimelineState=c;var u=(function(t){function e()
{var e=null!==t&&t.apply(this,arguments)||this;return
e._current=[],e._delta=[],e._result=[],e}return s(e,t),e.toString=function()
{return"[class dragonBones.SlotFFDTimelineState]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.meshOffset=0,this._dirty=!
1,this._frameFloatOffset=0,this._valueCount=0,this._deformCount=0,this._valueOffset
=0,this._current.length=0,this._delta.length=0,this._result.length=0},e.prototype._
onArriveAtFrame=function(){if(t.prototype._onArriveAtFrame.call(this),null!
==this._timelineData){var
e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this
._valueCount,i=this._armature._armatureData.scale,n=this._frameFloatArray;if(2===th
is._tweenState){var r=e+this._valueCount;this._frameIndex===this._frameCount-
1&&(r=this._animationData.frameFloatOffset+this._frameValueOffset);for(var
s=0;s<this._valueCount;++s)this._delta[s]=n[r+s]*i-(this._current[s]=n[e+s]*i)}else
for(s=0;s<this._valueCount;++s)this._current[s]=n[e+s]*i}else
for(s=0;s<this._valueCount;+
+s)this._current[s]=0},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this),this._dirty=!0,2!==this._tweenState&&(this.
_tweenState=0);for(var e=0;e<this._valueCount;++e)this._result[e]=this._current[e]
+this._delta[e]*this._tweenProgress},e.prototype.init=function(e,i,n)
{if(t.prototype.init.call(this,e,i,n),null!==this._timelineData){var
r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+
3];this.meshOffset=this._frameIntArray[r+0],this.meshOffset<0&&(this.meshOffset+=65
536),this._deformCount=this._frameIntArray[r+1],this._valueCount=this._frameIntArra
y[r+2],this._valueOffset=this._frameIntArray[r+3],this._frameFloatOffset=this._fram
eIntArray[r+4]+this._animationData.frameFloatOffset}else
this._deformCount=this.slot._deformVertices.length,this._valueCount=this._deformCou
nt,this._valueOffset=0,this._frameFloatOffset=0;this._current.length=this._valueCou
nt,this._delta.length=this._valueCount,this._result.length=this._valueCount;for(var
s=0;s<this._valueCount;++s)this._delta[s]=0},e.prototype.fadeOut=function()
{this._tweenState=0,this._dirty=!1},e.prototype.update=function(e){if(null!
==this.slot._meshData&&this.slot._meshData.offset===this.meshOffset&&(t.prototype.u
pdate.call(this,e),0!==this._tweenState||this._dirty)){var
i=this.slot._deformVertices;if(0!==this._animationState._fadeState||0!
==this._animationState._subFadeState){for(var
n=Math.pow(this._animationState._fadeProgress,2),r=0;r<this._deformCount;+
+r)r<this._valueOffset?i[r]+=(this._frameFloatArray[this._frameFloatOffset+r]-
i[r])*n:r<this._valueOffset+this._valueCount?i[r]+=(this._result[r-
this._valueOffset]-i[r])*n:i[r]+=(this._frameFloatArray[this._frameFloatOffset+r-
this._valueCount]-i[r])*n;this.slot._meshDirty=!0}else if(this._dirty)
{this._dirty=!1;for(r=0;r<this._deformCount;++r)r<this._valueOffset?
i[r]=this._frameFloatArray[this._frameFloatOffset+r]:r<this._valueOffset+this._valu
eCount?i[r]=this._result[r-
this._valueOffset]:i[r]=this._frameFloatArray[this._frameFloatOffset+r-
this._valueCount];this.slot._meshDirty=!0}}},e})
(t.SlotTimelineState);t.SlotFFDTimelineState=u;var _=(function(t){function e()
{return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.toString=function()
{return"[class
dragonBones.IKConstraintTimelineState]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this._current=0,this._delta=0},e.prototype._onArri
veAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var
e=this.constraint;if(null!==this._timelineData){var
i=this._animationData.frameIntOffset+this._frameValueOffset+2*this._frameIndex,n=th
is._frameIntArray,r=0!==n[i++];this._current=.01*n[i++],2===this._tweenState?
(this._frameIndex===this._frameCount-
1&&(i=this._animationData.frameIntOffset+this._frameValueOffset),this._delta=.01*n[
i+1]-this._current):this._delta=0,e._bendPositive=r}else{var
s=e._constraintData;this._current=s.weight,this._delta=0,e._bendPositive=s.bendPosi
tive}e.invalidUpdate()},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this),2!
==this._tweenState&&(this._tweenState=0);var
e=this.constraint;e._weight=this._current+this._delta*this._tweenProgress,e.invalid
Update()},e})(t.ConstraintTimelineState);t.IKConstraintTimelineState=_;var
f=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return
e._floats=[0,0,0,0,0,0],e}return s(e,t),e.toString=function(){return"[class
dragonBones.AnimationTimelineState]"},e.prototype._onClear=function()
{t.prototype._onClear.call(this),this.animationState=null},e.prototype._onArriveAtF
rame=function(){if(t.prototype._onArriveAtFrame.call(this),null!
==this._timelineData){var
e=this._animationData.frameIntOffset+this._frameValueOffset+2*this._frameIndex,i=1/
this.animationState._animationData.parent.frameRate,n=this._frameIntArray;this._flo
ats[0]=n[e++]*i,this._floats[3]=.01*n[e++],2===this._tweenState?
(this._frameIndex===this._frameCount-
1&&(e=this._animationData.frameIntOffset+this._frameValueOffset),this._floats[1]=n[
e++]*i-this._floats[0],this._floats[4]=.01*n[e++]-this._floats[3]):
(this._floats[1]=0,this._floats[4]=0)}},e.prototype._onUpdateFrame=function()
{t.prototype._onUpdateFrame.call(this),2!
==this._tweenState&&(this._tweenState=0),this._floats[0]>=0&&(this._floats[2]=this.
_floats[0]+this._floats[1]*this._tweenProgress),this._floats[5]=this._floats[3]+thi
s._floats[4]*this._tweenProgress},e.prototype.blend=function(t){var
e=this.animationState,i=e._blendState.blendWeight;t>0?
(e.weight+=this._floats[5]*i,e.currentTime+=this._floats[2]*i):
(e.weight=this._floats[5]*i,e.currentTime=this._floats[2]*i)},e})
(t.TweenTimelineState);t.AnimationTimelineState=f})(n||(n={})),(function(t){var
e=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return
s(e,t),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.data=null},e.START="start",e.LOOP_COMPLETE="loop
Complete",e.COMPLETE="complete",e.FADE_IN="fadeIn",e.FADE_IN_COMPLETE="fadeInComple
te",e.FADE_OUT="fadeOut",e.FADE_OUT_COMPLETE="fadeOutComplete",e.FRAME_EVENT="frame
Event",e.SOUND_EVENT="soundEvent",e})(t.BaseObject);t.EventObject=e})(n||(n={})),
(function(t){var e=(function(){function e(){}return e._getArmatureType=function(t)
{switch(t.toLowerCase()){case"stage":return 2;case"armature":return
0;case"movieclip":return 1;default:return 0}},e._getBoneType=function(t)
{switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return
0}},e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return
0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return
3;default:return 0}},e._getBoundingBoxType=function(t){switch(t.toLowerCase())
{case"rectangle":return 0;case"ellipse":return 1;case"polygon":return
2;default:return 0}},e._getActionType=function(t){switch(t.toLowerCase())
{case"play":return 0;case"frame":return 10;case"sound":return 11;default:return
0}},e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":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;default:return 0}},e.parseDragonBonesData=function(e)
{return e instanceof ArrayBuffer?
t.BinaryDataParser.getInstance().parseDragonBonesData(e):t.ObjectDataParser.getInst
ance().parseDragonBonesData(e)},e.parseTextureAtlasData=function(i,n){void
0===n&&(n=1),console.warn("\u5df2\u5e9f\u5f03");for(var
r={},s=i[e.SUB_TEXTURE],a=0,o=s.length;a<o;a++){var l=s[a],h=l[e.NAME],c=new
t.Rectangle,u=null;c.x=l[e.X]/n,c.y=l[e.Y]/n,c.width=l[e.WIDTH]/n,c.height=l[e.HEIG
HT]/n,e.FRAME_WIDTH in l&&((u=new
t.Rectangle).x=l[e.FRAME_X]/n,u.y=l[e.FRAME_Y]/n,u.width=l[e.FRAME_WIDTH]/n,u.heigh
t=l[e.FRAME_HEIGHT]/n),r[h]={region:c,frame:u,rotated:!1}}return
r},e.DATA_VERSION_2_3="2.3",e.DATA_VERSION_3_0="3.0",e.DATA_VERSION_4_0="4.0",e.DAT
A_VERSION_4_5="4.5",e.DATA_VERSION_5_0="5.0",e.DATA_VERSION_5_5="5.5",e.DATA_VERSIO
N=e.DATA_VERSION_5_5,e.DATA_VERSIONS=[e.DATA_VERSION_4_0,e.DATA_VERSION_4_5,e.DATA_
VERSION_5_0,e.DATA_VERSION_5_5],e.TEXTURE_ATLAS="textureAtlas",e.SUB_TEXTURE="SubTe
xture",e.FORMAT="format",e.IMAGE_PATH="imagePath",e.WIDTH="width",e.HEIGHT="height"
,e.ROTATED="rotated",e.FRAME_X="frameX",e.FRAME_Y="frameY",e.FRAME_WIDTH="frameWidt
h",e.FRAME_HEIGHT="frameHeight",e.DRADON_BONES="dragonBones",e.USER_DATA="userData"
,e.ARMATURE="armature",e.BONE="bone",e.SURFACE="surface",e.SLOT="slot",e.CONSTRAINT
="constraint",e.IK="ik",e.SKIN="skin",e.DISPLAY="display",e.ANIMATION="animation",e
.Z_ORDER="zOrder",e.FFD="ffd",e.FRAME="frame",e.TRANSLATE_FRAME="translateFrame",e.
ROTATE_FRAME="rotateFrame",e.SCALE_FRAME="scaleFrame",e.DISPLAY_FRAME="displayFrame
",e.COLOR_FRAME="colorFrame",e.DEFAULT_ACTIONS="defaultActions",e.ACTIONS="actions"
,e.EVENTS="events",e.INTS="ints",e.FLOATS="floats",e.STRINGS="strings",e.CANVAS="ca
nvas",e.TRANSFORM="transform",e.PIVOT="pivot",e.AABB="aabb",e.COLOR="color",e.VERSI
ON="version",e.COMPATIBLE_VERSION="compatibleVersion",e.FRAME_RATE="frameRate",e.TY
PE="type",e.SUB_TYPE="subType",e.NAME="name",e.PARENT="parent",e.TARGET="target",e.
STAGE="stage",e.SHARE="share",e.PATH="path",e.LENGTH="length",e.DISPLAY_INDEX="disp
layIndex",e.BLEND_MODE="blendMode",e.INHERIT_TRANSLATION="inheritTranslation",e.INH
ERIT_ROTATION="inheritRotation",e.INHERIT_SCALE="inheritScale",e.INHERIT_REFLECTION
="inheritReflection",e.INHERIT_ANIMATION="inheritAnimation",e.INHERIT_DEFORM="inher
itDeform",e.SEGMENT_X="segmentX",e.SEGMENT_Y="segmentY",e.BEND_POSITIVE="bendPositi
ve",e.CHAIN="chain",e.WEIGHT="weight",e.FADE_IN_TIME="fadeInTime",e.PLAY_TIMES="pla
yTimes",e.SCALE="scale",e.OFFSET="offset",e.POSITION="position",e.DURATION="duratio
n",e.TWEEN_EASING="tweenEasing",e.TWEEN_ROTATE="tweenRotate",e.TWEEN_SCALE="tweenSc
ale",e.CLOCK_WISE="clockwise",e.CURVE="curve",e.SOUND="sound",e.EVENT="event",e.ACT
ION="action",e.X="x",e.Y="y",e.SKEW_X="skX",e.SKEW_Y="skY",e.SCALE_X="scX",e.SCALE_
Y="scY",e.VALUE="value",e.ROTATE="rotate",e.SKEW="skew",e.ALPHA_OFFSET="aO",e.RED_O
FFSET="rO",e.GREEN_OFFSET="gO",e.BLUE_OFFSET="bO",e.ALPHA_MULTIPLIER="aM",e.RED_MUL
TIPLIER="rM",e.GREEN_MULTIPLIER="gM",e.BLUE_MULTIPLIER="bM",e.UVS="uvs",e.VERTICES=
"vertices",e.TRIANGLES="triangles",e.WEIGHTS="weights",e.SLOT_POSE="slotPose",e.BON
E_POSE="bonePose",e.GLUE_WEIGHTS="glueWeights",e.GLUE_MESHES="glueMeshes",e.GOTO_AN
D_PLAY="gotoAndPlay",e.DEFAULT_NAME="default",e})();t.DataParser=e})(n||(n={})),
(function(t){var e=(function(e){function n(){var i=null!
==e&&e.apply(this,arguments)||this;return
i._rawTextureAtlasIndex=0,i._rawBones=[],i._data=null,i._armature=null,i._bone=null
,i._surface=null,i._slot=null,i._skin=null,i._mesh=null,i._animation=null,i._timeli
ne=null,i._rawTextureAtlases=null,i._defaultColorOffset=-
1,i._prevClockwise=0,i._prevRotation=0,i._helpMatrixA=new
t.Matrix,i._helpMatrixB=new t.Matrix,i._helpTransform=new
t.Transform,i._helpColorTransform=new t.ColorTransform,i._helpPoint=new
t.Point,i._helpArray=[],i._intArray=[],i._floatArray=[],i._frameIntArray=[],i._fram
eFloatArray=[],i._frameArray=[],i._timelineArray=[],i._cacheRawMeshes=[],i._cacheMe
shes=[],i._actionFrames=[],i._weightSlotPose={},i._weightBonePoses={},i._cacheBones
={},i._slotChildActions={},i}return s(n,e),n._getBoolean=function(t,e,i){if(e in t)
{var n=t[e],s=void 0===n?"undefined":r(n);if("boolean"===s)return n;if("string"!
==s)return!!n;switch(n)
{case"0":case"NaN":case"":case"false":case"null":case"undefined":return!
1;default:return!0}}return i},n._getNumber=function(t,e,i){if(e in t){var
n=t[e];return null===n||"NaN"===n?i:+n||0}return i},n._getString=function(e,i,n)
{if(i in e){var s=e[i];if("string"===(void 0===s?"undefined":r(s)))
{if(t.DragonBones.webAssembly)for(var a=0,o=s.length;a<o;+
+a)if(s.charCodeAt(a)>255)return encodeURI(s);return s}return String(s)}return
n},n.prototype._getCurvePoint=function(t,e,i,n,r,s,a,o,l,h){var c=1-
l,u=c*c,_=l*l,f=c*u,d=3*l*u,m=3*c*_,p=l*_;h.x=f*t+d*i+m*r+p*a,h.y=f*e+d*n+m*s+p*o},
n.prototype._samplingEasingCurve=function(t,e){for(var i=t.length,n=-
2,r=0,s=e.length;r<s;++r){for(var a=(r+1)/(s+1);(n+6<i?t[n+6]:1)<a;)n+=6;for(var
o=n>=0&&n+6<i,l=o?t[n]:0,h=o?t[n+1]:0,c=t[n+2],u=t[n+3],_=t[n+4],f=t[n+5],d=o?
t[n+6]:1,m=o?t[n+7]:1,p=0,v=1;v-p>1e-4;){var
y=.5*(v+p);this._getCurvePoint(l,h,c,u,_,f,d,m,y,this._helpPoint),a-
this._helpPoint.x>0?
p=y:v=y}e[r]=this._helpPoint.y}},n.prototype._parseActionDataInFrame=function(e,i,n
,r){t.DataParser.EVENT in
e&&this._mergeActionFrame(e[t.DataParser.EVENT],i,10,n,r),t.DataParser.SOUND in
e&&this._mergeActionFrame(e[t.DataParser.SOUND],i,11,n,r),t.DataParser.ACTION in
e&&this._mergeActionFrame(e[t.DataParser.ACTION],i,0,n,r),t.DataParser.EVENTS in
e&&this._mergeActionFrame(e[t.DataParser.EVENTS],i,10,n,r),t.DataParser.ACTIONS in
e&&this._mergeActionFrame(e[t.DataParser.ACTIONS],i,0,n,r)},n.prototype._mergeActio
nFrame=function(e,n,r,s,a){for(var o=t.DragonBones.webAssembly?
this._armature.actions.size():this._armature.actions.length,l=this._parseActionData
(e,r,s,a),h=0,c=null,u=0,_=l;u<_.length;u++){var
f=_[u];this._armature.addAction(f,!1)}0===this._actionFrames.length&&((c=new
i).frameStart=0,this._actionFrames.push(c),c=null);for(var
d=0,m=this._actionFrames;d<m.length;d++){var p=m[d];if(p.frameStart===n)
{c=p;break}if(p.frameStart>n)break;h++}null===c&&((c=new
i).frameStart=n,this._actionFrames.splice(h+1,0,c));for(var v=0;v<l.length;+
+v)c.actions.push(o+v)},n.prototype._parseArmature=function(e,i){var
r=t.BaseObject.borrowObject(t.ArmatureData);if(r.name=n._getString(e,t.DataParser.N
AME,""),r.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,this._data.frameRate),r.
scale=i,t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?
r.type=t.DataParser._getArmatureType(e[t.DataParser.TYPE]):r.type=n._getNumber(e,t.
DataParser.TYPE,0),0===r.frameRate&&(r.frameRate=24),this._armature=r,t.DataParser.
CANVAS in e){var
s=e[t.DataParser.CANVAS],a=t.BaseObject.borrowObject(t.CanvasData);t.DataParser.COL
OR in s?a.hasBackground=!0:a.hasBackground=!
1,a.color=n._getNumber(s,t.DataParser.COLOR,0),a.x=n._getNumber(s,t.DataParser.X,0)
*r.scale,a.y=n._getNumber(s,t.DataParser.Y,0)*r.scale,a.width=n._getNumber(s,t.Data
Parser.WIDTH,0)*r.scale,a.height=n._getNumber(s,t.DataParser.HEIGHT,0)*r.scale,r.ca
nvas=a}if(t.DataParser.AABB in e){var
o=e[t.DataParser.AABB];r.aabb.x=n._getNumber(o,t.DataParser.X,0)*r.scale,r.aabb.y=n
._getNumber(o,t.DataParser.Y,0)*r.scale,r.aabb.width=n._getNumber(o,t.DataParser.WI
DTH,0)*r.scale,r.aabb.height=n._getNumber(o,t.DataParser.HEIGHT,0)*r.scale}if(t.Dat
aParser.BONE in e)for(var l=0,h=e[t.DataParser.BONE];l<h.length;l++){var
c=h[l],u=n._getString(c,t.DataParser.PARENT,""),_=this._parseBone(c);if(u.length>0)
{var f=r.getBone(u);null!==f?_.parent=f:(u in this._cacheBones||
(this._cacheBones[u]=[]),this._cacheBones[u].push(_))}if(_.name in
this._cacheBones){for(var d=0,m=this._cacheBones[_.name];d<m.length;d++)
{m[d].parent=_}delete
this._cacheBones[_.name]}r.addBone(_),this._rawBones.push(_)}if(t.DataParser.IK in
e)for(var p=0,v=e[t.DataParser.IK];p<v.length;p++){var
y=v[p],g=this._parseIKConstraint(y);g&&r.addConstraint(g)}if(r.sortBones(),t.DataPa
rser.SLOT in e)for(var x=0,b=0,A=e[t.DataParser.SLOT];b<A.length;b++){var
C=A[b];r.addSlot(this._parseSlot(C,x++))}if(t.DataParser.SKIN in e)for(var
S=0,T=e[t.DataParser.SKIN];S<T.length;S++){var
w=T[S];r.addSkin(this._parseSkin(w))}for(var E=0,M=this._cacheRawMeshes.length;E<M;
++E){var D=this._cacheRawMeshes[E];t.DataParser.GLUE_WEIGHTS in
D&&t.DataParser.GLUE_MESHES in
D&&this._parseMeshGlue(D,this._cacheMeshes[E])}for(E=0,M=this._cacheRawMeshes.lengt
h;E<M;++E){var
B=this._cacheRawMeshes[E],P=n._getString(B,t.DataParser.SHARE,"");if(0!==P.length)
{var
I=n._getString(B,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME);0===I.length&&(I=t.Da
taParser.DEFAULT_NAME);var R=r.getMesh(I,"",P);if(null!==R){var
O=this._cacheMeshes[E];O.offset=R.offset,O.weight=R.weight,O.glue=R.glue}}}if(t.Dat
aParser.ANIMATION in e)for(var L=0,F=e[t.DataParser.ANIMATION];L<F.length;L++){var
V=F[L],N=this._parseAnimation(V);r.addAnimation(N)}if(t.DataParser.DEFAULT_ACTIONS
in e)for(var
k=0,G=this._parseActionData(e[t.DataParser.DEFAULT_ACTIONS],0,null,null);k<G.length
;k++){var z=G[k];if(r.addAction(z,!0),0===z.type)null!
==(N=r.getAnimation(z.name))&&(r.defaultAnimation=N)}if(t.DataParser.ACTIONS in
e)for(var
U=0,j=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);U<j.length;U++)
{z=j[U];r.addAction(z,!1)}for(var W in
this._rawBones.length=0,this._cacheRawMeshes.length=0,this._cacheMeshes.length=0,th
is._armature=null,this._weightSlotPose)delete this._weightSlotPose[W];for(var W in
this._weightBonePoses)delete this._weightBonePoses[W];for(var W in
this._cacheBones)delete this._cacheBones[W];for(var W in
this._slotChildActions)delete this._slotChildActions[W];return
r},n.prototype._parseBone=function(e){var
i=this._armature.scale;if(0===(t.DataParser.TYPE in e&&"string"==typeof
e[t.DataParser.TYPE]?
t.DataParser._getBoneType(e[t.DataParser.TYPE]):n._getNumber(e,t.DataParser.TYPE,0)
)){var r=t.BaseObject.borrowObject(t.BoneData);return
r.inheritTranslation=n._getBoolean(e,t.DataParser.INHERIT_TRANSLATION,!
0),r.inheritRotation=n._getBoolean(e,t.DataParser.INHERIT_ROTATION,!
0),r.inheritScale=n._getBoolean(e,t.DataParser.INHERIT_SCALE,!
0),r.inheritReflection=n._getBoolean(e,t.DataParser.INHERIT_REFLECTION,!
0),r.length=n._getNumber(e,t.DataParser.LENGTH,0)*i,r.name=n._getString(e,t.DataPar
ser.NAME,""),t.DataParser.TRANSFORM in
e&&this._parseTransform(e[t.DataParser.TRANSFORM],r.transform,i),r}var
s=t.BaseObject.borrowObject(t.SurfaceData);if(s.name=n._getString(e,t.DataParser.NA
ME,""),s.segmentX=n._getNumber(e,t.DataParser.SEGMENT_X,0),s.segmentY=n._getNumber(
e,t.DataParser.SEGMENT_Y,0),s.vertices.length=(s.segmentX+1)*(s.segmentY+1)*2,t.Dat
aParser.VERTICES in e)for(var
a=e[t.DataParser.VERTICES],o=0,l=s.vertices.length;o<l;++o)o<a.length?
s.vertices[o]=a[o]*i:s.vertices[o]=0;return
s},n.prototype._parseIKConstraint=function(e){var
i=this._armature.getBone(n._getString(e,t.DataParser.BONE,""));if(null===i)return
null;var
r=this._armature.getBone(n._getString(e,t.DataParser.TARGET,""));if(null===r)return
null;var s=t.BaseObject.borrowObject(t.IKConstraintData);return
s.scaleEnabled=n._getBoolean(e,t.DataParser.SCALE,!
1),s.bendPositive=n._getBoolean(e,t.DataParser.BEND_POSITIVE,!
0),s.weight=n._getNumber(e,t.DataParser.WEIGHT,1),s.name=n._getString(e,t.DataParse
r.NAME,""),s.target=r,n._getNumber(e,t.DataParser.CHAIN,0)>0&&null!==i.parent?
(s.root=i.parent,s.bone=i):
(s.root=i,s.bone=null),s},n.prototype._parseSlot=function(e,i){var
r=t.BaseObject.borrowObject(t.SlotData);return
r.displayIndex=n._getNumber(e,t.DataParser.DISPLAY_INDEX,0),r.zOrder=i,r.name=n._ge
tString(e,t.DataParser.NAME,""),r.parent=this._armature.getBone(n._getString(e,t.Da
taParser.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=n._g
etNumber(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},n.prototype._parseSkin=function(e){var
i=t.BaseObject.borrowObject(t.SkinData);if(i.name=n._getString(e,t.DataParser.NAME,
t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME),t.
DataParser.SLOT in e){var r=e[t.DataParser.SLOT];this._skin=i;for(var
s=0,a=r;s<a.length;s++){var
o=a[s],l=n._getString(o,t.DataParser.NAME,""),h=this._armature.getSlot(l);if(null!
==h){if(this._slot=h,t.DataParser.DISPLAY in o)for(var
c=0,u=o[t.DataParser.DISPLAY];c<u.length;c++){var _=u[c];_?
i.addDisplay(l,this._parseDisplay(_)):i.addDisplay(l,null)}this._slot=null}}this._s
kin=null}return i},n.prototype._parseDisplay=function(e){var
i=n._getString(e,t.DataParser.NAME,""),r=n._getString(e,t.DataParser.PATH,""),s=0,a
=null;switch(s=t.DataParser.TYPE in e&&"string"==typeof e[t.DataParser.TYPE]?
t.DataParser._getDisplayType(e[t.DataParser.TYPE]):n._getNumber(e,t.DataParser.TYPE
,s)){case 0:var
o=a=t.BaseObject.borrowObject(t.ImageDisplayData);o.name=i,o.path=r.length>0?
r:i,this._parsePivot(e,o);break;case 1:var
l=a=t.BaseObject.borrowObject(t.ArmatureDisplayData);if(l.name=i,l.path=r.length>0?
r:i,l.inheritAnimation=!0,t.DataParser.ACTIONS in e)for(var
h=0,c=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);h<c.length;h++)
{var u=c[h];l.addAction(u)}else if(this._slot.name in this._slotChildActions){var
_=this._skin.getDisplays(this._slot.name);if(null===_?
0===this._slot.displayIndex:this._slot.displayIndex===_.length){for(var
f=0,d=this._slotChildActions[this._slot.name];f<d.length;f++)
{u=d[f];l.addAction(u)}delete this._slotChildActions[this._slot.name]}}break;case
2:var
m=a=t.BaseObject.borrowObject(t.MeshDisplayData);m.inheritDeform=n._getBoolean(e,t.
DataParser.INHERIT_DEFORM,!0),m.name=i,m.path=r.length>0?r:i,t.DataParser.SHARE in
e?
(this._cacheRawMeshes.push(e),this._cacheRawMeshes.push(m)):this._parseMesh(e,m),t.
DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in
e&&(this._cacheRawMeshes.push(e),this._cacheRawMeshes.push(m));break;case 3:var
p=this._parseBoundingBox(e);if(null!==p){var
v=a=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=i,v.path=r.length>0?
r:i,v.boundingBox=p}}return null!==a&&t.DataParser.TRANSFORM in
e&&this._parseTransform(e[t.DataParser.TRANSFORM],a.transform,this._armature.scale)
,a},n.prototype._parsePivot=function(e,i){if(t.DataParser.PIVOT in e){var
r=e[t.DataParser.PIVOT];i.pivot.x=n._getNumber(r,t.DataParser.X,0),i.pivot.y=n._get
Number(r,t.DataParser.Y,0)}else
i.pivot.x=.5,i.pivot.y=.5},n.prototype._parseMesh=function(e,i){var
n=e[t.DataParser.VERTICES],r=e[t.DataParser.UVS],s=e[t.DataParser.TRIANGLES],a=Math
.floor(n.length/2),o=Math.floor(s.length/3),l=this._floatArray.length,h=l+2*a,c=thi
s._intArray.length,u=this._skin.name+"_"+this._slot.name+"_"+i.name;i.offset=c,this
._intArray.length+=4+3*o,this._intArray[c+0]=a,this._intArray[c+1]=o,this._intArray
[c+2]=l;for(var _=0,f=3*o;_<f;+
+_)this._intArray[c+4+_]=s[_];this._floatArray.length+=2*a+2*a;for(_=0,f=2*a;_<f;+
+_)this._floatArray[l+_]=n[_],this._floatArray[h+_]=r[_];if(t.DataParser.WEIGHTS in
e){var
d=e[t.DataParser.WEIGHTS],m=e[t.DataParser.SLOT_POSE],p=e[t.DataParser.BONE_POSE],v
=this._armature.sortedBones,y=new
Array,g=Math.floor(p.length/7),x=this._floatArray.length,b=Math.floor(d.length-
a)/2,A=this._intArray.length,C=t.BaseObject.borrowObject(t.WeightData);C.count=b,C.
offset=A,y.length=g,this._intArray.length+=2+g+a+b,this._intArray[A+1]=x;for(_=0;_<
g;++_){var
S=p[7*_],T=this._rawBones[S];C.addBone(T),y[_]=S,this._intArray[A+2+_]=v.indexOf(T)
}this._floatArray.length+=3*b,this._helpMatrixA.copyFromArray(m,0);_=0;for(var
w=0,E=A+2+g,M=x;_<a;++_){var D=2*_,B=this._intArray[E++]=d[w+
+],P=this._floatArray[l+D],I=this._floatArray[l+D+1];this._helpMatrixA.transformPoi
nt(P,I,this._helpPoint),P=this._helpPoint.x,I=this._helpPoint.y;for(var R=0;R<B;+
+R){S=d[w++];var
O=y.indexOf(S);this._helpMatrixB.copyFromArray(p,7*O+1),this._helpMatrixB.invert(),
this._helpMatrixB.transformPoint(P,I,this._helpPoint),this._intArray[E+
+]=O,this._floatArray[M++]=d[w++],this._floatArray[M+
+]=this._helpPoint.x,this._floatArray[M+
+]=this._helpPoint.y}}i.weight=C,this._weightSlotPose[u]=m,this._weightBonePoses[u]
=p}},n.prototype._parseMeshGlue=function(e,i){var
n=e[t.DataParser.GLUE_WEIGHTS],r=e[t.DataParser.GLUE_MESHES];i.glue=t.BaseObject.bo
rrowObject(t.GlueData),i.glue.weights.length=n.length;for(var s=0,a=n.length;s<a;+
+s)i.glue.weights[s]=n[s];for(s=0,a=r.length;s<a;s+=3){var
o=this._armature.getMesh(r[s],r[s+1],r[s+2]);i.glue.addMesh(o)}},n.prototype._parse
BoundingBox=function(e){var i=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]):n._getNumber(e,t.DataPar
ser.SUB_TYPE,r)){case
0:i=t.BaseObject.borrowObject(t.RectangleBoundingBoxData);break;case
1:i=t.BaseObject.borrowObject(t.EllipseBoundingBoxData);break;case
2:i=this._parsePolygonBoundingBox(e)}return null!
==i&&(i.color=n._getNumber(e,t.DataParser.COLOR,0),0!==i.type&&1!==i.type||
(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataParser.
HEIGHT,0))),i},n.prototype._parsePolygonBoundingBox=function(e){var
i=t.BaseObject.borrowObject(t.PolygonBoundingBoxData);if(t.DataParser.VERTICES in
e){var
n=this._armature.scale,r=e[t.DataParser.VERTICES],s=i.vertices;t.DragonBones.webAss
embly?s.resize(r.length,0):s.length=r.length;for(var a=0,o=r.length;a<o;a+=2){var
l=r[a]*n,h=r[a+1]*n;t.DragonBones.webAssembly?(s.set(a,l),s.set(a+1,h)):
(s[a]=l,s[a+1]=h),0===a?(i.x=l,i.y=h,i.width=l,i.height=h):(l<i.x?
i.x=l:l>i.width&&(i.width=l),h<i.y?i.y=h:h>i.height&&(i.height=h))}i.width-
=i.x,i.height-=i.y}else console.warn("Data error.\n Please reexport DragonBones
Data to fixed the bug.");return i},n.prototype._parseAnimation=function(e){var
i=t.BaseObject.borrowObject(t.AnimationData);if(i.frameCount=Math.max(n._getNumber(
e,t.DataParser.DURATION,1),1),i.playTimes=n._getNumber(e,t.DataParser.PLAY_TIMES,1)
,i.duration=i.frameCount/this._armature.frameRate,i.fadeInTime=n._getNumber(e,t.Dat
aParser.FADE_IN_TIME,0),i.scale=n._getNumber(e,t.DataParser.SCALE,1),i.name=n._getS
tring(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME),0===i.name.length&&(i.name=t.D
ataParser.DEFAULT_NAME),i.frameIntOffset=this._frameIntArray.length,i.frameFloatOff
set=this._frameFloatArray.length,i.frameOffset=this._frameArray.length,this._animat
ion=i,t.DataParser.FRAME in e){var
r=e[t.DataParser.FRAME],s=r.length;if(s>0)for(var a=0,o=0;a<s;++a){var
l=r[a];this._parseActionDataInFrame(l,o,null,null),o+=n._getNumber(l,t.DataParser.D
URATION,1)}}if(t.DataParser.Z_ORDER in
e&&(this._animation.zOrderTimeline=this._parseTimeline(e[t.DataParser.Z_ORDER],null
,t.DataParser.FRAME,1,!1,!1,0,this._parseZOrderFrame)),t.DataParser.BONE in
e)for(var h=0,c=e[t.DataParser.BONE];h<c.length;h++){var
u=c[h];this._parseBoneTimeline(u)}if(t.DataParser.SURFACE in e)for(var
_=0,f=e[t.DataParser.SURFACE];_<f.length;_++){u=f[_];var
d=n._getString(u,t.DataParser.NAME,"");if(this._surface=this._armature.getBone(d),n
ull!==this._surface)null!==(M=this._parseTimeline(u,null,t.DataParser.FRAME,50,!1,!
0,0,this._parseSurfaceFrame))&&this._animation.addSurfaceTimeline(this._surface,M),
this._surface=null}if(t.DataParser.SLOT in e)for(var
m=0,p=e[t.DataParser.SLOT];m<p.length;m++)
{u=p[m];this._parseSlotTimeline(u)}if(t.DataParser.FFD in e)for(var
v=0,y=e[t.DataParser.FFD];v<y.length;v++){u=y[v];var
g=n._getString(u,t.DataParser.SKIN,t.DataParser.DEFAULT_NAME),x=n._getString(u,t.Da
taParser.SLOT,""),b=n._getString(u,t.DataParser.NAME,"");if(0===g.length&&(g=t.Data
Parser.DEFAULT_NAME),this._slot=this._armature.getSlot(x),this._mesh=this._armature
.getMesh(g,x,b),null!==this._slot&&null!==this._mesh)null!
==(M=this._parseTimeline(u,null,t.DataParser.FRAME,22,!1,!
0,0,this._parseSlotFFDFrame))&&this._animation.addSlotTimeline(this._slot,M),this._
slot=null,this._mesh=null}if(t.DataParser.IK in e)for(var
A=0,C=e[t.DataParser.IK];A<C.length;A++){u=C[A];var
S=n._getString(u,t.DataParser.NAME,""),T=this._armature.getConstraint(S);if(null!
==T)null!==(M=this._parseTimeline(u,null,t.DataParser.FRAME,30,!0,!
1,2,this._parseIKConstraintFrame))&&this._animation.addConstraintTimeline(T,M)}if(t
.DataParser.ANIMATION in e)for(var w=0,E=e[t.DataParser.ANIMATION];w<E.length;w++)
{u=E[w];var M,D=n._getString(u,t.DataParser.NAME,"");null!
==(M=this._parseTimeline(u,null,t.DataParser.FRAME,40,!0,!
1,2,this._parseAnimationFrame))&&this._animation.addAnimationTimeline(D,M)}return
this._actionFrames.length>0&&(this._animation.actionTimeline=this._parseTimeline(nu
ll,this._actionFrames,"",0,!1,!
1,0,this._parseActionFrame),this._actionFrames.length=0),this._animation=null,i},n.
prototype._parseTimeline=function(e,r,s,a,o,l,h,c){if(null!==e&&s.length>0&&s in
e&&(r=e[s]),null===r)return null;var u=r.length;if(0===u)return null;var
_=this._frameIntArray.length,f=this._frameFloatArray.length,d=t.BaseObject.borrowOb
ject(t.TimelineData),m=this._timelineArray.length;if(this._timelineArray.length+=5+
u,null!==e?
(this._timelineArray[m+0]=Math.round(100*n._getNumber(e,t.DataParser.SCALE,1)),this
._timelineArray[m+1]=Math.round(100*n._getNumber(e,t.DataParser.OFFSET,0))):
(this._timelineArray[m+0]=100,this._timelineArray[m+1]=0),this._timelineArray[m+2]=
u,this._timelineArray[m+3]=h,this._timelineArray[m+4]=o?_-
this._animation.frameIntOffset:l?f-
this._animation.frameFloatOffset:0,this._timeline=d,d.type=a,d.offset=m,1===u)d.fra
meIndicesOffset=-1,this._timelineArray[m+5+0]=c.call(this,r[0],0,0)-
this._animation.frameOffset;else{var
p=this._animation.frameCount+1,v=this._data.frameIndices,y=0;t.DragonBones.webAssem
bly?(y=v.size(),v.resize(y+p,0)):
(y=v.length,v.length+=p),d.frameIndicesOffset=y;for(var g=0,x=0,b=0,A=0;g<p;++g)
{if(b+A<=g&&x<u){var C=r[x];b=g,A=x===u-1?this._animation.frameCount-b:C instanceof
i?this._actionFrames[x+1].frameStart-
b:n._getNumber(C,t.DataParser.DURATION,1),this._timelineArray[m+5+x]=c.call(this,C,
b,A)-this._animation.frameOffset,x++}t.DragonBones.webAssembly?v.set(y+g,x-
1):v[y+g]=x-1}}return
this._timeline=null,d},n.prototype._parseBoneTimeline=function(e){var
i=this._armature.getBone(n._getString(e,t.DataParser.NAME,""));if(null!==i){var
r;if(this._bone=i,this._slot=this._armature.getSlot(this._bone.name),t.DataParser.T
RANSLATE_FRAME in e)null!
==(r=this._parseTimeline(e,null,t.DataParser.TRANSLATE_FRAME,11,!1,!
0,2,this._parseBoneTranslateFrame))&&this._animation.addBoneTimeline(i,r);if(t.Data
Parser.ROTATE_FRAME in e)null!
==(r=this._parseTimeline(e,null,t.DataParser.ROTATE_FRAME,12,!1,!
0,2,this._parseBoneRotateFrame))&&this._animation.addBoneTimeline(i,r);if(t.DataPar
ser.SCALE_FRAME in e)null!
==(r=this._parseTimeline(e,null,t.DataParser.SCALE_FRAME,13,!1,!
0,2,this._parseBoneScaleFrame))&&this._animation.addBoneTimeline(i,r);if(t.DataPars
er.FRAME in e)null!==(r=this._parseTimeline(e,null,t.DataParser.FRAME,10,!1,!
0,6,this._parseBoneAllFrame))&&this._animation.addBoneTimeline(i,r);this._bone=null
,this._slot=null}},n.prototype._parseSlotTimeline=function(e){var
i=this._armature.getSlot(n._getString(e,t.DataParser.NAME,""));if(null!==i)
{this._slot=i;var r=null;null!==(r=t.DataParser.DISPLAY_FRAME in e?
this._parseTimeline(e,null,t.DataParser.DISPLAY_FRAME,20,!1,!
1,0,this._parseSlotDisplayFrame):this._parseTimeline(e,null,t.DataParser.FRAME,20,!
1,!1,0,this._parseSlotDisplayFrame))&&this._animation.addSlotTimeline(i,r);var
s=null;null!==(s=t.DataParser.COLOR_FRAME in e?
this._parseTimeline(e,null,t.DataParser.COLOR_FRAME,21,!0,!
1,1,this._parseSlotColorFrame):this._parseTimeline(e,null,t.DataParser.FRAME,21,!
0,!
1,1,this._parseSlotColorFrame))&&this._animation.addSlotTimeline(i,s),this._slot=nu
ll}},n.prototype._parseFrame=function(t,e,i){var n=this._frameArray.length;return
this._frameArray.length+=1,this._frameArray[n+0]=e,n},n.prototype._parseTweenFrame=
function(e,i,r){var s=this._parseFrame(e,i,r);if(r>0)if(t.DataParser.CURVE in e)
{var
a=r+1;this._helpArray.length=a,this._samplingEasingCurve(e[t.DataParser.CURVE],this
._helpArray),this._frameArray.length+=2+this._helpArray.length,this._frameArray[s+1
]=2,this._frameArray[s+2]=a;for(var o=0;o<a;+
+o)this._frameArray[s+3+o]=Math.round(1e4*this._helpArray[o])}else{var l=-
2;t.DataParser.TWEEN_EASING in e&&(l=n._getNumber(e,t.DataParser.TWEEN_EASING,-
2)),-2===l?(this._frameArray.length+=1,this._frameArray[s+1]=0):0===l?
(this._frameArray.length+=1,this._frameArray[s+1]=1):l<0?
(this._frameArray.length+=2,this._frameArray[s+1]=3,this._frameArray[s+2]=Math.roun
d(100*-l)):l<=1?
(this._frameArray.length+=2,this._frameArray[s+1]=4,this._frameArray[s+2]=Math.roun
d(100*l)):
(this._frameArray.length+=2,this._frameArray[s+1]=5,this._frameArray[s+2]=Math.roun
d(100*l-100))}else this._frameArray.length+=1,this._frameArray[s+1]=0;return
s},n.prototype._parseActionFrame=function(t,e,i){var
n=this._frameArray.length,r=t.actions.length;this._frameArray.length+=2+r,this._fra
meArray[n+0]=e,this._frameArray[n+0+1]=r;for(var s=0;s<r;+
+s)this._frameArray[n+0+2+s]=t.actions[s];return
n},n.prototype._parseZOrderFrame=function(e,i,n){var
r=this._parseFrame(e,i,n);if(t.DataParser.Z_ORDER in e){var
s=e[t.DataParser.Z_ORDER];if(s.length>0){for(var
a=this._armature.sortedSlots.length,o=new Array(a-s.length/2),l=new
Array(a),h=0;h<o.length;++h)o[h]=0;for(var c=0;c<a;++c)l[c]=-1;for(var
u=0,_=0,f=0,d=s.length;f<d;f+=2){for(var m=s[f],p=s[f+1];u!==m;)o[_++]=u+
+;l[u+p]=u++}for(;u<a;)o[_++]=u+
+;this._frameArray.length+=1+a,this._frameArray[r+1]=a;for(var v=a;v--;)-1===l[v]?
this._frameArray[r+2+v]=o[--_]||0:this._frameArray[r+2+v]=l[v]||0;return r}}return
this._frameArray.length+=1,this._frameArray[r+1]=0,r},n.prototype._parseBoneAllFram
e=function(e,i,r){this._helpTransform.identity(),t.DataParser.TRANSFORM in
e&&this._parseTransform(e[t.DataParser.TRANSFORM],this._helpTransform,1);var
s=this._helpTransform.rotation;0!==i&&(0===this._prevClockwise?
s=this._prevRotation+t.Transform.normalizeRadian(s-this._prevRotation):
((this._prevClockwise>0?
s>=this._prevRotation:s<=this._prevRotation)&&(this._prevClockwise=this._prevClockw
ise>0?this._prevClockwise-1:this._prevClockwise+1),s=this._prevRotation+s-
this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._ge
tNumber(e,t.DataParser.TWEEN_ROTATE,0),this._prevRotation=s;var
a=this._parseTweenFrame(e,i,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++]=s,this._frameFloatArray[o+
+]=this._helpTransform.skew,this._frameFloatArray[o+
+]=this._helpTransform.scaleX,this._frameFloatArray[o+
+]=this._helpTransform.scaleY,this._parseActionDataInFrame(e,i,this._bone,this._slo
t),a},n.prototype._parseBoneTranslateFrame=function(e,i,r){var
s=this._parseTweenFrame(e,i,r),a=this._frameFloatArray.length;return
this._frameFloatArray.length+=2,this._frameFloatArray[a+
+]=n._getNumber(e,t.DataParser.X,0),this._frameFloatArray[a+
+]=n._getNumber(e,t.DataParser.Y,0),s},n.prototype._parseBoneRotateFrame=function(e
,i,r){var s=n._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;0!
==i&&(0===this._prevClockwise?s=this._prevRotation+t.Transform.normalizeRadian(s-
this._prevRotation):((this._prevClockwise>0?
s>=this._prevRotation:s<=this._prevRotation)&&(this._prevClockwise=this._prevClockw
ise>0?this._prevClockwise-1:this._prevClockwise+1),s=this._prevRotation+s-
this._prevRotation+t.Transform.PI_D*this._prevClockwise)),this._prevClockwise=n._ge
tNumber(e,t.DataParser.CLOCK_WISE,0),this._prevRotation=s;var
a=this._parseTweenFrame(e,i,r),o=this._frameFloatArray.length;return
this._frameFloatArray.length+=2,this._frameFloatArray[o+
+]=s,this._frameFloatArray[o+
+]=n._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD,a},n.prototype._parseBon
eScaleFrame=function(e,i,r){var
s=this._parseTweenFrame(e,i,r),a=this._frameFloatArray.length;return
this._frameFloatArray.length+=2,this._frameFloatArray[a+
+]=n._getNumber(e,t.DataParser.X,1),this._frameFloatArray[a+
+]=n._getNumber(e,t.DataParser.Y,1),s},n.prototype._parseSurfaceFrame=function(e,i,
r){var
s=this._frameFloatArray.length,a=this._parseTweenFrame(e,i,r),o=e[t.DataParser.VERT
ICES],l=n._getNumber(e,t.DataParser.OFFSET,0),h=this._surface.vertices.length/2,c=0
,u=0;this._frameFloatArray.length+=2*h;for(var _=0;_<2*h;_+=2)c=_<l||_-l>=o.length?
0:o[_-l],u=_+1<l||_+1-l>=o.length?0:o[_+1-
l],this._frameFloatArray[s+_]=c,this._frameFloatArray[s+_+1]=u;if(0===i){var
f=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[f+0]
=0,this._frameIntArray[f+1]=this._frameFloatArray.length-
s,this._frameIntArray[f+2]=this._frameFloatArray.length-
s,this._frameIntArray[f+3]=0,this._frameIntArray[f+4]=s-
this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=f-
this._animation.frameIntOffset}return
a},n.prototype._parseSlotDisplayFrame=function(e,i,r){var
s=this._parseFrame(e,i,r);return this._frameArray.length+=1,t.DataParser.VALUE in
e?
this._frameArray[s+1]=n._getNumber(e,t.DataParser.VALUE,0):this._frameArray[s+1]=n.
_getNumber(e,t.DataParser.DISPLAY_INDEX,0),this._parseActionDataInFrame(e,i,this._s
lot.parent,this._slot),s},n.prototype._parseSlotColorFrame=function(e,i,n){var
r=this._parseTweenFrame(e,i,n),s=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR
in e){var a=t.DataParser.VALUE in e?
e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in a)
{this._parseColorTransform(a,this._helpColorTransform),s=this._intArray.length,this
._intArray.length+=8,this._intArray[s+
+]=Math.round(100*this._helpColorTransform.alphaMultiplier),this._intArray[s+
+]=Math.round(100*this._helpColorTransform.redMultiplier),this._intArray[s+
+]=Math.round(100*this._helpColorTransform.greenMultiplier),this._intArray[s+
+]=Math.round(100*this._helpColorTransform.blueMultiplier),this._intArray[s+
+]=Math.round(this._helpColorTransform.alphaOffset),this._intArray[s+
+]=Math.round(this._helpColorTransform.redOffset),this._intArray[s+
+]=Math.round(this._helpColorTransform.greenOffset),this._intArray[s+
+]=Math.round(this._helpColorTransform.blueOffset),s-
=8;break}}s<0&&(this._defaultColorOffset<0&&(this._defaultColorOffset=s=this._intAr
ray.length,this._intArray.length+=8,this._intArray[s++]=100,this._intArray[s+
+]=100,this._intArray[s++]=100,this._intArray[s++]=100,this._intArray[s+
+]=0,this._intArray[s++]=0,this._intArray[s++]=0,this._intArray[s+
+]=0),s=this._defaultColorOffset);var l=this._frameIntArray.length;return
this._frameIntArray.length+=1,this._frameIntArray[l]=s,r},n.prototype._parseSlotFFD
Frame=function(e,i,r){var
s=this._frameFloatArray.length,a=this._parseTweenFrame(e,i,r),o=t.DataParser.VERTIC
ES in e?
e[t.DataParser.VERTICES]:null,l=n._getNumber(e,t.DataParser.OFFSET,0),h=this._intAr
ray[this._mesh.offset+0],c=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mes
h.name,u=0,_=0,f=0,d=0;if(null!==this._mesh.weight){var
m=this._weightSlotPose[c];this._helpMatrixA.copyFromArray(m,0),this._frameFloatArra
y.length+=2*this._mesh.weight.count,f=this._mesh.weight.offset+2+this._mesh.weight.
bones.length}else this._frameFloatArray.length+=2*h;for(var
p=0;p<2*h;p+=2)if(null===o?(u=0,_=0):(u=p<l||p-l>=o.length?0:o[p-l],_=p+1<l||p+1-
l>=o.length?0:o[p+1-l]),null!==this._mesh.weight){var
v=this._weightBonePoses[c],y=this._intArray[f+
+];this._helpMatrixA.transformPoint(u,_,this._helpPoint,!
0),u=this._helpPoint.x,_=this._helpPoint.y;for(var g=0;g<y;++g){var
x=this._intArray[f+
+];this._helpMatrixB.copyFromArray(v,7*x+1),this._helpMatrixB.invert(),this._helpMa
trixB.transformPoint(u,_,this._helpPoint,!0),this._frameFloatArray[s+d+
+]=this._helpPoint.x,this._frameFloatArray[s+d++]=this._helpPoint.y}}else
this._frameFloatArray[s+p]=u,this._frameFloatArray[s+p+1]=_;if(0===i){var
b=this._frameIntArray.length;this._frameIntArray.length+=5,this._frameIntArray[b+0]
=this._mesh.offset,this._frameIntArray[b+1]=this._frameFloatArray.length-
s,this._frameIntArray[b+2]=this._frameFloatArray.length-
s,this._frameIntArray[b+3]=0,this._frameIntArray[b+4]=s-
this._animation.frameFloatOffset,this._timelineArray[this._timeline.offset+3]=b-
this._animation.frameIntOffset}return
a},n.prototype._parseIKConstraintFrame=function(e,i,r){var
s=this._parseTweenFrame(e,i,r),a=this._frameIntArray.length;return
this._frameIntArray.length+=2,this._frameIntArray[a+
+]=n._getBoolean(e,t.DataParser.BEND_POSITIVE,!0)?1:0,this._frameIntArray[a+
+]=Math.round(100*n._getNumber(e,t.DataParser.WEIGHT,1)),s},n.prototype._parseAnima
tionFrame=function(e,i,r){var
s=this._parseTweenFrame(e,i,r),a=this._frameIntArray.length;return
this._frameIntArray.length+=2,this._frameIntArray[a+
+]=n._getNumber(e,t.DataParser.VALUE,0),this._frameIntArray[a+
+]=Math.round(100*n._getNumber(e,t.DataParser.WEIGHT,1)),s},n.prototype._parseActio
nData=function(e,i,r,s){var a=new Array;if("string"==typeof e)
(c=t.BaseObject.borrowObject(t.ActionData)).type=i,c.name=e,c.bone=r,c.slot=s,a.pus
h(c);else if(e instanceof Array)for(var o=0,l=e;o<l.length;o++){var
h=l[o],c=t.BaseObject.borrowObject(t.ActionData);if(t.DataParser.GOTO_AND_PLAY in
h?(c.type=0,c.name=n._getString(h,t.DataParser.GOTO_AND_PLAY,"")):
(t.DataParser.TYPE in h&&"string"==typeof h[t.DataParser.TYPE]?
c.type=t.DataParser._getActionType(h[t.DataParser.TYPE]):c.type=n._getNumber(h,t.Da
taParser.TYPE,i),c.name=n._getString(h,t.DataParser.NAME,"")),t.DataParser.BONE
in h){var
u=n._getString(h,t.DataParser.BONE,"");c.bone=this._armature.getBone(u)}else
c.bone=r;if(t.DataParser.SLOT in h){var
_=n._getString(h,t.DataParser.SLOT,"");c.slot=this._armature.getSlot(_)}else
c.slot=s;var f=null;if(t.DataParser.INTS in h)
{null===f&&(f=t.BaseObject.borrowObject(t.UserData));for(var
d=0,m=h[t.DataParser.INTS];d<m.length;d++){var
p=m[d];f.addInt(p)}}if(t.DataParser.FLOATS in h)
{null===f&&(f=t.BaseObject.borrowObject(t.UserData));for(var
v=0,y=h[t.DataParser.FLOATS];v<y.length;v++)
{p=y[v];f.addFloat(p)}}if(t.DataParser.STRINGS in h)
{null===f&&(f=t.BaseObject.borrowObject(t.UserData));for(var
g=0,x=h[t.DataParser.STRINGS];g<x.length;g++)
{p=x[g];f.addString(p)}}c.data=f,a.push(c)}return
a},n.prototype._parseTransform=function(e,i,r)
{i.x=n._getNumber(e,t.DataParser.X,0)*r,i.y=n._getNumber(e,t.DataParser.Y,0)*r,t.Da
taParser.ROTATE in e||t.DataParser.SKEW in e?
(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.ROTATE,0)*t.Tra
nsform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW
,0)*t.Transform.DEG_RAD)):(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in
e)&&(i.rotation=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.SKEW_Y,0)*t
.Transform.DEG_RAD),i.skew=t.Transform.normalizeRadian(n._getNumber(e,t.DataParser.
SKEW_X,0)*t.Transform.DEG_RAD)-
i.rotation),i.scaleX=n._getNumber(e,t.DataParser.SCALE_X,1),i.scaleY=n._getNumber(e
,t.DataParser.SCALE_Y,1)},n.prototype._parseColorTransform=function(e,i)
{i.alphaMultiplier=.01*n._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100),i.redMulti
plier=.01*n._getNumber(e,t.DataParser.RED_MULTIPLIER,100),i.greenMultiplier=.01*n._
getNumber(e,t.DataParser.GREEN_MULTIPLIER,100),i.blueMultiplier=.01*n._getNumber(e,
t.DataParser.BLUE_MULTIPLIER,100),i.alphaOffset=n._getNumber(e,t.DataParser.ALPHA_O
FFSET,0),i.redOffset=n._getNumber(e,t.DataParser.RED_OFFSET,0),i.greenOffset=n._get
Number(e,t.DataParser.GREEN_OFFSET,0),i.blueOffset=n._getNumber(e,t.DataParser.BLUE
_OFFSET,0)},n.prototype._parseArray=function(t)
{this._intArray.length=0,this._floatArray.length=0,this._frameIntArray.length=0,thi
s._frameFloatArray.length=0,this._frameArray.length=0,this._timelineArray.length=0}
,n.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);var
e=this._intArray.length*Int16Array.BYTES_PER_ELEMENT,i=this._floatArray.length*Floa
t32Array.BYTES_PER_ELEMENT,n=this._frameIntArray.length*Int16Array.BYTES_PER_ELEMEN
T,r=this._frameFloatArray.length*Float32Array.BYTES_PER_ELEMENT,s=this._frameArray.
length*Int16Array.BYTES_PER_ELEMENT,a=this._timelineArray.length*Uint16Array.BYTES_
PER_ELEMENT,o=e+i+n+r+s+a;if(t.DragonBones.webAssembly){for(var
l=t.webAssemblyModule.HEAP16.buffer,h=t.webAssemblyModule._malloc(o),c=new
Int16Array(l,h,this._intArray.length),u=new
Float32Array(l,h+e,this._floatArray.length),_=new
Int16Array(l,h+e+i,this._frameIntArray.length),f=new
Float32Array(l,h+e+i+n,this._frameFloatArray.length),d=new
Int16Array(l,h+e+i+n+r,this._frameArray.length),m=new
Uint16Array(l,h+e+i+n+r+s,this._timelineArray.length),p=0,v=this._intArray.length;p
<v;++p)c[p]=this._intArray[p];for(p=0,v=this._floatArray.length;p<v;+
+p)u[p]=this._floatArray[p];for(p=0,v=this._frameIntArray.length;p<v;+
+p)_[p]=this._frameIntArray[p];for(p=0,v=this._frameFloatArray.length;p<v;+
+p)f[p]=this._frameFloatArray[p];for(p=0,v=this._frameArray.length;p<v;+
+p)d[p]=this._frameArray[p];for(p=0,v=this._timelineArray.length;p<v;+
+p)m[p]=this._timelineArray[p];t.webAssemblyModule.setDataBinary(this._data,h,e,i,n
,r,s,a)}else{var y=new ArrayBuffer(o);for(c=new
Int16Array(y,0,this._intArray.length),u=new
Float32Array(y,e,this._floatArray.length),_=new
Int16Array(y,e+i,this._frameIntArray.length),f=new
Float32Array(y,e+i+n,this._frameFloatArray.length),d=new
Int16Array(y,e+i+n+r,this._frameArray.length),m=new
Uint16Array(y,e+i+n+r+s,this._timelineArray.length),p=0,v=this._intArray.length;p<v
;++p)c[p]=this._intArray[p];for(p=0,v=this._floatArray.length;p<v;+
+p)u[p]=this._floatArray[p];for(p=0,v=this._frameIntArray.length;p<v;+
+p)_[p]=this._frameIntArray[p];for(p=0,v=this._frameFloatArray.length;p<v;+
+p)f[p]=this._frameFloatArray[p];for(p=0,v=this._frameArray.length;p<v;+
+p)d[p]=this._frameArray[p];for(p=0,v=this._timelineArray.length;p<v;+
+p)m[p]=this._timelineArray[p];this._data.binary=y,this._data.intArray=c,this._data
.floatArray=u,this._data.frameIntArray=_,this._data.frameFloatArray=f,this._data.fr
ameArray=d,this._data.timelineArray=m}this._defaultColorOffset=-
1},n.prototype.parseDragonBonesData=function(e,i){void
0===i&&(i=1),console.assert(null!==e&&void 0!==e,"Data error.");var
r=n._getString(e,t.DataParser.VERSION,""),s=n._getString(e,t.DataParser.COMPATIBLE_
VERSION,"");if(t.DataParser.DATA_VERSIONS.indexOf(r)>=0||
t.DataParser.DATA_VERSIONS.indexOf(s)>=0){var
a=t.BaseObject.borrowObject(t.DragonBonesData);if(a.version=r,a.name=n._getString(e
,t.DataParser.NAME,""),a.frameRate=n._getNumber(e,t.DataParser.FRAME_RATE,24),0===a
.frameRate&&(a.frameRate=24),t.DataParser.ARMATURE in e)
{this._data=a,this._parseArray(e);for(var
o=0,l=e[t.DataParser.ARMATURE];o<l.length;o++){var
h=l[o];a.addArmature(this._parseArmature(h,i))}this._data.binary||
this._modifyArray(),t.DataParser.STAGE in e?
a.stage=a.getArmature(n._getString(e,t.DataParser.STAGE,"")):a.armatureNames.length
>0&&(a.stage=a.getArmature(a.armatureNames[0])),this._data=null}return
t.DataParser.TEXTURE_ATLAS in
e&&(this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]),a}return
console.assert(!1,"Nonsupport data version: "+r+"\nPlease convert DragonBones data
to support version.\nRead more:
https://github.com/DragonBones/Tools/"),null},n.prototype.parseTextureAtlasData=fun
ction(e,i,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
s=this._rawTextureAtlases[this._rawTextureAtlasIndex++];return
this.parseTextureAtlasData(s,i,r),this._rawTextureAtlasIndex>=this._rawTextureAtlas
es.length&&(this._rawTextureAtlasIndex=0,this._rawTextureAtlases=null),!
0}if(i.width=n._getNumber(e,t.DataParser.WIDTH,0),i.height=n._getNumber(e,t.DataPar
ser.HEIGHT,0),i.scale=1===r?
1/n._getNumber(e,t.DataParser.SCALE,1):r,i.name=n._getString(e,t.DataParser.NAME,""
),i.imagePath=n._getString(e,t.DataParser.IMAGE_PATH,""),t.DataParser.SUB_TEXTURE
in e)for(var a=e[t.DataParser.SUB_TEXTURE],o=0,l=a.length;o<l;++o){var
h=a[o],c=i.createTexture();c.rotated=n._getBoolean(h,t.DataParser.ROTATED,!
1),c.name=n._getString(h,t.DataParser.NAME,""),c.region.x=n._getNumber(h,t.DataPars
er.X,0),c.region.y=n._getNumber(h,t.DataParser.Y,0),c.region.width=n._getNumber(h,t
.DataParser.WIDTH,0),c.region.height=n._getNumber(h,t.DataParser.HEIGHT,0);var
u=n._getNumber(h,t.DataParser.FRAME_WIDTH,-
1),_=n._getNumber(h,t.DataParser.FRAME_HEIGHT,-
1);u>0&&_>0&&(c.frame=t.TextureData.createRectangle(),c.frame.x=n._getNumber(h,t.Da
taParser.FRAME_X,0),c.frame.y=n._getNumber(h,t.DataParser.FRAME_Y,0),c.frame.width=
u,c.frame.height=_),i.addTexture(c)}return!0},n.getInstance=function(){return
null===n._objectDataParserInstance&&(n._objectDataParserInstance=new
n),n._objectDataParserInstance},n._objectDataParserInstance=null,n})
(t.DataParser);t.ObjectDataParser=e;var i=(function(){return function()
{this.frameStart=0,this.actions=[]}})();t.ActionFrame=i})(n||(n={})),(function(t)
{var e=(function(e){function i(){return null!==e&&e.apply(this,arguments)||
this}return s(i,e),i.prototype._inRange=function(t,e,i){return
e<=t&&t<=i},i.prototype._decodeUTF8=function(t){for(var
e,i=0,n="",r=0,s=0,a=0,o=0;t.length>i;){var l=t[i++];if(-1===l)e=0!==s?65533:-
1;else if(0===s)this._inRange(l,0,127)?e=l:(this._inRange(l,194,223)?
(s=1,o=128,r=l-192):this._inRange(l,224,239)?(s=2,o=2048,r=l-
224):this._inRange(l,240,244)&&(s=3,o=65536,r=l-240),r*=Math.pow(64,s),e=null);else
if(this._inRange(l,128,191))if(a+=1,r+=(l-128)*Math.pow(64,s-a),a!
==s)e=null;else{var h=r,c=o;r=0,s=0,a=0,o=0,e=this._inRange(h,c,1114111)&&!
this._inRange(h,55296,57343)?h:l}else r=0,s=0,a=0,o=0,i--,e=l;null!==e&&-1!
==e&&(e<=65535?e>0&&(n+=String.fromCharCode(e)):(e-
=65536,n+=String.fromCharCode(55296+
(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}return
n},i.prototype._getUTF16Key=function(t){for(var e=0,i=t.length;e<i;+
+e)if(t.charCodeAt(e)>255)return encodeURI(t);return
t},i.prototype._parseBinaryTimeline=function(e,i,n){void 0===n&&(n=null);var
r=null!==n?
n:t.BaseObject.borrowObject(t.TimelineData);r.type=e,r.offset=i,this._timeline=r;va
r s=this._timelineArrayBuffer[r.offset+2];if(1===s)r.frameIndicesOffset=-1;else{var
a=0,o=this._animation.frameCount+1,l=this._data.frameIndices;t.DragonBones.webAssem
bly?(a=l.size(),l.resize(a+o,0)):
(a=l.length,l.length+=o),r.frameIndicesOffset=a;for(var h=0,c=0,u=0,_=0;h<o;+
+h)u+_<=h&&c<s&&(u=this._frameArrayBuffer[this._animation.frameOffset+this._timelin
eArrayBuffer[r.offset+5+c]],_=c===s-1?this._animation.frameCount-
u:this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[r.of
fset+5+c+1]]-u,c++),t.DragonBones.webAssembly?l.set(a+h,c-1):l[a+h]=c-1}return
this._timeline=null,r},i.prototype._parseMesh=function(e,i)
{i.offset=e[t.DataParser.OFFSET];var n=this._intArrayBuffer[i.offset+3];if(n>=0)
{var
r=t.BaseObject.borrowObject(t.WeightData),s=this._intArrayBuffer[i.offset+0],a=this
._intArrayBuffer[n+0];r.offset=n;for(var o=0;o<a;++o){var
l=this._intArrayBuffer[n+2+o];r.addBone(this._rawBones[l])}for(var
h=n+2+a,c=0,u=(o=0,s);o<u;++o){var _=this._intArrayBuffer[h+
+];c+=_,h+=_}r.count=c,i.weight=r}},i.prototype._parseAnimation=function(e){var
i=t.BaseObject.borrowObject(t.AnimationData);i.frameCount=Math.max(t.ObjectDataPars
er._getNumber(e,t.DataParser.DURATION,1),1),i.playT
imes=t.ObjectDataParser._getNumber(e,t.DataParser.PLAY_TIMES,1),i.duration=i.frameC
ount/this._armature.frameRate,i.fadeInTime=t.ObjectDataParser._getNumber(e,t.DataPa
rser.FADE_IN_TIME,0),i.scale=t.ObjectDataParser._getNumber(e,t.DataParser.SCALE,1),
i.name=t.ObjectDataParser._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME)
,0===i.name.length&&(i.name=t.DataParser.DEFAULT_NAME);var
n=e[t.DataParser.OFFSET];if(i.frameIntOffset=n[0],i.frameFloatOffset=n[1],i.frameOf
fset=n[2],this._animation=i,t.DataParser.ACTION in
e&&(i.actionTimeline=this._parseBinaryTimeline(0,e[t.DataParser.ACTION])),t.DataPar
ser.Z_ORDER in
e&&(i.zOrderTimeline=this._parseBinaryTimeline(1,e[t.DataParser.Z_ORDER])),t.DataPa
rser.BONE in e){var r=e[t.DataParser.BONE];for(var s in r){var
a=r[s];t.DragonBones.webAssembly&&(s=this._getUTF16Key(s));var
o=this._armature.getBone(s);if(null!==o)for(var l=0,h=a.length;l<h;l+=2){var
c=a[l],u=a[l+1],_=this._parseBinaryTimeline(c,u);this._animation.addBoneTimeline(o,
_)}}}if(t.DataParser.SURFACE in e){r=e[t.DataParser.SURFACE];for(var s in r)
{a=r[s];t.DragonBones.webAssembly&&(s=this._getUTF16Key(s));var
f=this._armature.getBone(s);if(null!==f)for(l=0,h=a.length;l<h;l+=2)
{c=a[l],u=a[l+1],_=this._parseBinaryTimeline(c,u);this._animation.addSurfaceTimelin
e(f,_)}}}if(t.DataParser.SLOT in e){r=e[t.DataParser.SLOT];for(var s in r)
{a=r[s];t.DragonBones.webAssembly&&(s=this._getUTF16Key(s));var
d=this._armature.getSlot(s);if(null!==d)for(l=0,h=a.length;l<h;l+=2)
{c=a[l],u=a[l+1],_=this._parseBinaryTimeline(c,u);this._animation.addSlotTimeline(d
,_)}}}if(t.DataParser.CONSTRAINT in e){r=e[t.DataParser.CONSTRAINT];for(var s in r)
{a=r[s];t.DragonBones.webAssembly&&(s=this._getUTF16Key(s));var
m=this._armature.getConstraint(s);if(null!==m)for(l=0,h=a.length;l<h;l+=2)
{c=a[l],u=a[l+1],_=this._parseBinaryTimeline(c,u);this._animation.addConstraintTime
line(m,_)}}}if(t.DataParser.ANIMATION in e){r=e[t.DataParser.ANIMATION];for(var s
in r)
{a=r[s];t.DragonBones.webAssembly&&(s=this._getUTF16Key(s));for(l=0,h=a.length;l<h;
l+=2)
{c=a[l],u=a[l+1],_=this._parseBinaryTimeline(c,u);this._animation.addAnimationTimel
ine(s,_)}}}return this._animation=null,i},i.prototype._parseArray=function(e){var
i=e[t.DataParser.OFFSET],n=i[1],r=i[3],s=i[5],a=i[7],o=i[9],l=i[11],h=new
Int16Array(this._binary,this._binaryOffset+i[0],n/Int16Array.BYTES_PER_ELEMENT),c=n
ew
Float32Array(this._binary,this._binaryOffset+i[2],r/Float32Array.BYTES_PER_ELEMENT)
,u=new
Int16Array(this._binary,this._binaryOffset+i[4],s/Int16Array.BYTES_PER_ELEMENT),_=n
ew
Float32Array(this._binary,this._binaryOffset+i[6],a/Float32Array.BYTES_PER_ELEMENT)
,f=new
Int16Array(this._binary,this._binaryOffset+i[8],o/Int16Array.BYTES_PER_ELEMENT),d=n
ew
Uint16Array(this._binary,this._binaryOffset+i[10],l/Uint16Array.BYTES_PER_ELEMENT);
if(t.DragonBones.webAssembly){for(var
m=n+r+s+a+o+l,p=t.webAssemblyModule._malloc(m),v=new
Uint8Array(this._binary,this._binaryOffset,m/Uint8Array.BYTES_PER_ELEMENT),y=new
Uint8Array(t.webAssemblyModule.HEAP16.buffer,p,v.length),g=0,x=v.length;g<x;+
+g)y[g]=v[g];t.webAssemblyModule.setDataBinary(this._data,p,n,r,s,a,o,l),this._intA
rrayBuffer=h,this._floatArrayBuffer=c,this._frameIntArrayBuffer=u,this._frameFloatA
rrayBuffer=_,this._frameArrayBuffer=f,this._timelineArrayBuffer=d}else
this._data.binary=this._binary,this._data.intArray=this._intArrayBuffer=h,this._dat
a.floatArray=this._floatArrayBuffer=c,this._data.frameIntArray=this._frameIntArrayB
uffer=u,this._data.frameFloatArray=this._frameFloatArrayBuffer=_,this._data.frameAr
ray=this._frameArrayBuffer=f,this._data.timelineArray=this._timelineArrayBuffer=d},
i.prototype.parseDragonBonesData=function(t,i){void
0===i&&(i=1),console.assert(null!==t&&void 0!==t&&t instanceof ArrayBuffer,"Data
error.");var n=new Uint8Array(t,0,8);if(n[0]!=="D".charCodeAt(0)||n[1]!
=="B".charCodeAt(0)||n[2]!=="D".charCodeAt(0)||n[3]!=="T".charCodeAt(0))return
console.assert(!1,"Nonsupport data."),null;var r=new Uint32Array(t,8,1)[0],s=new
Uint8Array(t,12,r),a=this._decodeUTF8(s),o=JSON.parse(a);return
this._binaryOffset=12+r,this._binary=t,e.prototype.parseDragonBonesData.call(this,o
,i)},i.getInstance=function(){return
null===i._binaryDataParserInstance&&(i._binaryDataParserInstance=new
i),i._binaryDataParserInstance},i._binaryDataParserInstance=null,i})
(t.ObjectDataParser);t.BinaryDataParser=e})(n||(n={})),(function(t){var
e=(function(){function e(i){void 0===i&&(i=null),this.autoSearch=!
1,this._dragonBonesDataMap={},this._textureAtlasDataMap={},this._dragonBones=null,t
his._dataParser=null,null===e._objectParser&&(e._objectParser=new
t.ObjectDataParser),null===e._binaryParser&&(e._binaryParser=new
t.BinaryDataParser),this._dataParser=null!==i?i:e._objectParser}return
e.prototype._isSupportMesh=function(){return!
0},e.prototype._getTextureData=function(t,e){if(t in
this._textureAtlasDataMap)for(var i=0,n=this._textureAtlasDataMap[t];i<n.length;i+
+){if(null!==(l=(o=n[i]).getTexture(e)))return l}if(this.autoSearch)for(var r in
this._textureAtlasDataMap)for(var s=0,a=this._textureAtlasDataMap[r];s<a.length;s+
+){var o,l;if((o=a[s]).autoSearch)if(null!==(l=o.getTexture(e)))return l}return
null},e.prototype._fillBuildArmaturePackage=function(t,e,i,n,r){var
s=null,a=null;if(e.length>0&&e in
this._dragonBonesDataMap&&(a=(s=this._dragonBonesDataMap[e]).getArmature(i)),null==
=a&&(0===e.length||this.autoSearch))for(var o in
this._dragonBonesDataMap)if(s=this._dragonBonesDataMap[o],(0===e.length||
s.autoSearch)&&null!==(a=s.getArmature(i))){e=o;break}if(null!==a)
{if(t.dataName=e,t.textureAtlasName=r,t.data=s,t.armature=a,t.skin=null,n.length>0&
&(t.skin=a.getSkin(n),null===t.skin&&this.autoSearch))for(var o in
this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o].getArmature(n);if(null!
==l){t.skin=l.defaultSkin;break}}return null===t.skin&&(t.skin=a.defaultSkin),!
0}return!1},e.prototype._buildBones=function(e,i){for(var
n=0,r=e.armature.sortedBones;n<r.length;n++){var
s=r[n],a=t.BaseObject.borrowObject(0===s.type?t.Bone:t.Surface);a.init(s),null!
==s.parent?i.addBone(a,s.parent.name):i.addBone(a,"")}var
o=e.armature.constraints;for(var l in o){var
h=o[l],c=t.BaseObject.borrowObject(t.IKConstraint);c.init(h,i),i.addConstraint(c)}}
,e.prototype._buildSlots=function(e,i){var
n=e.skin,r=e.armature.defaultSkin;if(null!==n&&null!==r){var s={};for(var a in
r.displays){var o=r.getDisplays(a);s[a]=o}if(n!==r)for(var a in n.displays)
{o=n.getDisplays(a);s[a]=o}for(var l=0,h=e.armature.sortedSlots;l<h.length;l++){var
c=h[l],u=(o=c.name in s?
s[c.name]:null,this._buildSlot(e,c,o,i));if(i.addSlot(u,c.parent.name),null!==o)
{for(var _=new Array,f=0,d=t.DragonBones.webAssembly?o.size():o.length;f<d;++f){var
m=t.DragonBones.webAssembly?o.get(f):o[f];null!==m?
_.push(this._getSlotDisplay(e,m,null,u)):_.push(null)}u._setDisplayList(_)}u._setDi
splayIndex(c.displayIndex,!0)}}},e.prototype._buildChildArmature=function(t,e,i)
{return this.buildArmature(i.path,null!==t?t.dataName:"","",null!==t?
t.textureAtlasName:"")},e.prototype._getSlotDisplay=function(t,e,i,n){var r=null!
==t?t.dataName:e.parent.parent.parent.name,s=null;switch(e.type){case 0:var
a=e;null!
==t&&t.textureAtlasName.length>0&&(a.texture=this._getTextureData(t.textureAtlasNam
e,e.path)),null===a.texture&&(a.texture=this._getTextureData(r,e.path)),s=null!
==i&&2===i.type&&this._isSupportMesh()?n.meshDisplay:n.rawDisplay;break;case 2:var
o=e;null!
==t&&t.textureAtlasName.length>0&&(o.texture=this._getTextureData(t.textureAtlasNam
e,o.path)),null===o.texture&&(o.texture=this._getTextureData(r,o.path)),s=this._isS
upportMesh()?n.meshDisplay:n.rawDisplay;break;case 1:var
l=e,h=this._buildChildArmature(t,n,e);if(null!==h)
{if(h.inheritAnimation=l.inheritAnimation,!h.inheritAnimation){var
c=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(c.length>0)for(var
u=0,_=c;u<_.length;u++){var f=_[u];h._bufferAction(f,!0)}else
h.animation.play()}l.armature=h.armatureData}s=h}return
s},e.prototype.parseDragonBonesData=function(t,i,n){void 0===i&&(i=null),void
0===n&&(n=1);for(var r=t instanceof ArrayBuffer?
e._binaryParser:this._dataParser,s=r.parseDragonBonesData(t,n);;){var
a=this._buildTextureAtlasData(null,null);if(!r.parseTextureAtlasData(null,a,n))
{a.returnToPool();break}this.addTextureAtlasData(a,i)}return null!
==s&&this.addDragonBonesData(s,i),s},e.prototype.parseTextureAtlasData=function(t,e
,i,n){void 0===i&&(i=null),void 0===n&&(n=1);var
r=this._buildTextureAtlasData(null,null);return
this._dataParser.parseTextureAtlasData(t,r,n),this._buildTextureAtlasData(r,e||
null),this.addTextureAtlasData(r,i),r},e.prototype.updateTextureAtlasData=function(
t,e){var i=this.getTextureAtlasData(t);if(null!==i)for(var n=0,r=i.length;n<r;+
+n)n<e.length&&this._buildTextureAtlasData(i[n],e[n])},e.prototype.getDragonBonesDa
ta=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._dragonBonesDataM
ap[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 i=(e=null!==e?e:t.name)in this._textureAtlasDataMap?
this._textureAtlasDataMap[e]:this._textureAtlasDataMap[e]=[];i.indexOf(t)<0&&i.push
(t)},e.prototype.removeTextureAtlasData=function(t,e){if(void 0===e&&(e=!0),t in
this._textureAtlasDataMap){var i=this._textureAtlasDataMap[t];if(e)for(var
n=0,r=i;n<r.length;n++){var s=r[n];this._dragonBones.bufferObject(s)}delete
this._textureAtlasDataMap[t]}},e.prototype.getArmatureData=function(t,e){void
0===e&&(e="");var n=new i;return this._fillBuildArmaturePackage(n,e,t,"","")?
n.armature:null},e.prototype.clear=function(t){for(var e in void 0===t&&(t=!
0),this._dragonBonesDataMap)t&&this._dragonBones.bufferObject(this._dragonBonesData
Map[e]),delete this._dragonBonesDataMap[e];for(var e in this._textureAtlasDataMap)
{if(t)for(var i=0,n=this._textureAtlasDataMap[e];i<n.length;i++){var
r=n[i];this._dragonBones.bufferObject(r)}delete
this._textureAtlasDataMap[e]}},e.prototype.buildArmature=function(t,e,n,r){void
0===e&&(e=""),void 0===n&&(n=""),void 0===r&&(r="");var s=new i;if(!
this._fillBuildArmaturePackage(s,e||"",t,n||"",r||""))return console.warn("No
armature data: "+t+", "+(null!==e?e:"")),null;var a=this._buildArmature(s);return
this._buildBones(s,a),this._buildSlots(s,a),a.invalidUpdate(null,!
0),a.advanceTime(0),a},e.prototype.replaceDisplay=function(e,i,n){void 0===n&&(n=-
1),n<0&&(n=e.displayIndex),n<0&&(n=0),e.replaceDisplayData(i,n);var
r=e.displayList;if(r.length<=n){r.length=n+1;for(var s=0,a=r.length;s<a;++s)r[s]||
(r[s]=null)}if(null!==i){var
o=e.rawDisplayDatas,l=null;o&&(t.DragonBones.webAssembly?
n<o.size()&&(l=o.get(n)):n<o.length&&(l=o[n])),r[n]=this._getSlotDisplay(null,i,l,e
)}else
r[n]=null;e.displayList=r},e.prototype.replaceSlotDisplay=function(t,e,i,n,r,s)
{void 0===s&&(s=-1);var a=this.getArmatureData(e,t||"");if(!a||!
a.defaultSkin)return!1;var o=a.defaultSkin.getDisplay(i,n);return!!
o&&(this.replaceDisplay(r,o,s),!
0)},e.prototype.replaceSlotDisplayList=function(e,i,n,r){var
s=this.getArmatureData(i,e||"");if(!s||!s.defaultSkin)return!1;var
a=s.defaultSkin.getDisplays(n);if(!a)return!1;for(var
o=0,l=0,h=t.DragonBones.webAssembly?a.size():a.length;l<h;++l){var
c=t.DragonBones.webAssembly?a.get(l):a[l];this.replaceDisplay(r,c,o++)}return!
0},e.prototype.replaceSkin=function(e,i,n,r){void 0===n&&(n=!1),void
0===r&&(r=null);for(var s=!
1,a=i.parent.defaultSkin,o=0,l=e.getSlots();o<l.length;o++){var h=l[o];if(!(null!
==r&&r.indexOf(h.name)>=0)){var c=i.getDisplays(h.name);if(c||(null!==a&&i!
==a&&(c=a.getDisplays(h.name)),c)){var u=t.DragonBones.webAssembly?
c.size():c.length,_=h.displayList;_.length=u;for(var f=0,d=u;f<d;++f){var
m=t.DragonBones.webAssembly?c.get(f):c[f];_[f]=null!==m?
this._getSlotDisplay(null,m,null,h):null}s=!
0,h.rawDisplayDatas=c,h.displayList=_}else
n&&(h.rawDisplayDatas=null,h.displayList=[])}}return
s},e.prototype.replaceAnimation=function(e,i,n){void 0===n&&(n=!0);var
r=i.defaultSkin;if(null===r)return!
1;if(n)e.animation.animations=i.animations;else{var
s=e.animation.animations,a={};for(var o in s)a[o]=s[o];for(var o in
i.animations)a[o]=i.animations[o];e.animation.animations=a}for(var
l=0,h=e.getSlots();l<h.length;l++)for(var
c=h[l],u=0,_=0,f=c.displayList;_<f.length;_++){var d=f[_];if(d instanceof
t.Armature){var m=r.getDisplays(c.name);if(null!==m&&u<(t.DragonBones.webAssembly?
m.size():m.length)){var p=t.DragonBones.webAssembly?m.get(u):m[u];if(null!
==p&&1===p.type){var
v=this.getArmatureData(p.path,p.parent.parent.parent.name);v&&this.replaceAnimation
(d,v,n)}}}u++}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.prototype.changeSkin=function(t,e,i){return void
0===i&&(i=null),this.replaceSkin(t,e,!
1,i)},e.prototype.copyAnimationsToArmature=function(t,e,i,n,r){void
0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=!0);var
s=this.getArmatureData(e,n);return!!
s&&this.replaceAnimation(t,s,r)},e._objectParser=null,e._binaryParser=null,e})
();t.BaseFactory=e;var i=(function(){return function()
{this.dataName="",this.textureAtlasName="",this.skin=null}})
();t.BuildArmaturePackage=i})(n||(n={})),e.exports=n}),{}],399:[(function(t,e,i)
{"use strict";var n=t("./ArmatureDisplay"),r=t("../../cocos2d/core/renderer/render-
flow"),s=t("../../cocos2d/core/assets/material/CCMaterial"),a=cc.gfx,o=cc.vmath.mat
4,l=cc.color(255,0,0,255),h=cc.color(0,0,255,255),c=void 0,u=void 0,_=void 0,f=void
0,d=void 0,m=void 0,p=void 0,v=void 0,y=void 0,g=void 0,x=void 0,b=void 0,A=void
0,C=void 0,S=void 0,T=void 0,w=void 0,E=void 0,M=void 0,D=void 0,B=void 0,P=void
0,I=void 0,R=void 0,O=void 0,L=void 0,F=void 0,V=void 0,N=void 0,k=void 0;function
G(t,e){if(!t)return null;var i=void 0,n=void 0;switch(e){case 1:i=d?
cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE;break;case
10:i=cc.macro.DST_COLOR,n=cc.macro.ONE_MINUS_SRC_ALPHA;break;case
12:i=cc.macro.ONE,n=cc.macro.ONE_MINUS_SRC_COLOR;break;case 0:default:i=d?
cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE_MINUS_SRC_ALPHA}var r=!
x.enableBatch,o=t.url+i+n+r,l=x.sharedMaterials[0];if(!l)return null;var
h=x._materialCache,c=h[o];c?c.texture!
==t&&(c.setProperty("texture",t),c.updateHash(o)):((c=new
s).copy(l),c.define("_USE_MODEL",r),c.setProperty("texture",t),c.effect.getDefaultT
echnique().passes[0].setBlend(!
0,a.BLEND_FUNC_ADD,i,n,a.BLEND_FUNC_ADD,i,n),h[o]=c,c.updateHash(o));return
c}function z(t,e){I=t.a*e*f,m=d?
I/255:1,D=t.r*c*m,B=t.g*u*m,P=t.b*_*m,M=(I<<24>>>0)+(P<<16)+(B<<8)+D}var
U={updateRenderData:function(t,e){},realTimeTraverse:function(t,e,i){for(var
n=t._slots,r=void 0,s=void 0,a=void 0,l=void 0,h=void 0,c=void 0,u=void 0,_=void
0,f=void 0,d=void 0,m=0,x=n.length;m<x;m+
+)if(u=(_=n[m])._color,_._visible&&_._displayData)if(e?
_._mulMat(_._worldMatrix,e,_._matrix):o.copy(_._worldMatrix,_._matrix),_.childArmat
ure)this.realTimeTraverse(_.childArmature,_._worldMatrix,i*u.a/255);else
if(l=G(_.getTexture(),_._blendMode)){(p||l._hash!==g.material._hash)&&(p=!
1,g._flush(),g.node=y,g.material=l),z(u,i),f=_._worldMatrix,h=_._localVertices,S=h.
length>>2,c=_._indices,T=c.length,d=v.request(S,T),A=d.indiceOffset,b=d.byteOffset>
>2,C=d.vertexOffset,r=v._vData,s=v._iData,a=v._uintVData,O=f.m00,L=f.m04,F=f.m12,V=
f.m01,N=f.m05,k=f.m13;for(var D=0,B=h.length;D<B;)w=h[D++],E=h[D++],r[b+
+]=w*O+E*L+F,r[b++]=w*V+E*N+k,r[b++]=h[D++],r[b++]=h[D++],a[b++]=M;for(var
P=0,I=c.length;P<I;P++)s[A++]=C+c[P]}},cacheTraverse:function(t,e){if(t){var
i=t.segments;if(0!=i.length){var n=void 0,r=void 0,s=void 0,a=void 0,o=void
0,l=t.vertices,h=t.indices,c=t.uintVert,u=0,_=0,f=0;e&&(O=e.m00,L=e.m04,F=e.m12,V=e
.m01,N=e.m05,k=e.m13);var d=0,m=t.colors,x=m[d++],D=x.vfOffset;z(x,1);for(var
B=0,P=i.length;B<P;B++){var I=i[B];a=G(I.tex,I.blendMode),(p||a._hash!
==g.material._hash)&&(p=!
1,g._flush(),g.node=y,g.material=a),S=I.vertexCount,T=I.indexCount,o=v.request(S,T)
,A=o.indiceOffset,C=o.vertexOffset,b=o.byteOffset>>2,n=v._vData,r=v._iData,s=v._uin
tVData;for(var U=A,j=A+T;U<j;U++)r[U]=C+h[_++];switch(f=I.vfCount,R){case 1:case
0:n.set(l.subarray(u,u+f),b),u+=f;break;case 16:case 17:for(var
W=b,H=b+f;W<H;)w=l[u++],E=l[u++],n[W++]=w*O+E*L+F,n[W++]=w*V+E*N+k,n[W++]=l[u+
+],n[W++]=l[u++],s[W++]=c[u++]}if(1&R)for(var X=u-
f,q=b+4,Y=b+4+f;q<Y;q+=5,X+=5)X>=D&&(z(x=m[d+
+],1),D=x.vfOffset),s[q]=M}}}},fillBuffers:function(t,e){t.node._renderFlag|
=r.FLAG_UPDATE_RENDER_DATA,p=!
0,d=t.premultipliedAlpha,y=t.node,v=e._meshBuffer,g=e,x=t,R=0;var
i=y._color;c=i.r/255,u=i.g/255,_=i.b/255,f=i.a/255,4294967295!==i._val&&(R|=1);var
n=void 0;if(x.enableBatch&&(n=y._worldMatrix,p=!1,R|
=16),t.isAnimationCached())this.cacheTraverse(t._curFrame,n);else{var
s=t._armature;if(!s)return;this.realTimeTraverse(s,n,1);var
a=t._debugDraw;if(t.debugBones&&a)
{a.clear(),a.lineWidth=5,a.strokeColor=l,a.fillColor=h;for(var
o=s.getBones(),m=0,b=o.length;m<b;m++){var
A=o[m],C=Math.max(A.boneData.length,5),S=A.globalTransformMatrix.tx,T=-
A.globalTransformMatrix.ty,w=S+A.globalTransformMatrix.a*C,E=T-
A.globalTransformMatrix.b*C;a.moveTo(S,T),a.lineTo(w,E),a.stroke()}}}y=void
0,v=void 0,g=void 0,x=void 0}};e.exports=n._assembler=U}),
{"../../cocos2d/core/assets/material/CCMaterial":75,"../../cocos2d/core/renderer/re
nder-flow":244,"./ArmatureDisplay":390}],400:[(function(t,e,i){"use strict";var
n=t("./track-entry-
listeners"),r=t("../../cocos2d/core/components/CCRenderComponent"),s=t("./lib/spine
"),a=t("../../cocos2d/core/assets/material/CCMaterial"),o=t("../../cocos2d/core/gra
phics/graphics"),l=t("./skeleton-cache"),h=cc.Enum({default:-
1}),c=cc.Enum({"<None>":0}),u=cc.Enum({REALTIME:0,SHARED_CACHE:1,PRIVATE_CACHE:2});
sp.Skeleton=cc.Class({name:"sp.Skeleton",extends:r,editor:!1,statics:
{AnimationCacheMode:u},properties:{paused:{default:!1,visible:!1},skeletonData:
{default:null,type:sp.SkeletonData,notify:function()
{this.defaultSkin="",this.defaultAnimation="",this._updateSkeletonData()},tooltip:!
1},defaultSkin:{default:"",visible:!1},defaultAnimation:{default:"",visible:!
1},animation:{get:function(){if(this.isAnimationCached())return
this._animationName;var t=this.getCurrent(0);return
t&&t.animation.name||""},set:function(t){this.defaultAnimation=t,t?
this.setAnimation(0,t,this.loop):this.isAnimationCached()||
(this.clearTrack(0),this.setToSetupPose())},visible:!1},_defaultSkinIndex:
{get:function(){if(this.skeletonData&&this.defaultSkin){var
t=this.skeletonData.getSkinsEnum();if(t){var e=t[this.defaultSkin];if(void 0!
==e)return e}}return 0},set:function(t){var
e;if(this.skeletonData&&(e=this.skeletonData.getSkinsEnum()),!e)return
cc.errorID("",this.name);var i=e[t];void 0!==i?
this.defaultSkin=i:cc.errorID(7501,this.name)},type:h,visible:!
0,displayName:"Default Skin",tooltip:!1},_animationIndex:{get:function(){var
t=this.animation;if(this.skeletonData&&t){var
e=this.skeletonData.getAnimsEnum();if(e){var i=e[t];if(void 0!==i)return i}}return
0},set:function(t){if(0!==t){var
e;if(this.skeletonData&&(e=this.skeletonData.getAnimsEnum()),!e)return
cc.errorID(7502,this.name);var i=e[t];void 0!==i?
this.animation=i:cc.errorID(7503,this.name)}else
this.animation=""},type:c,visible:!0,displayName:"Animation",tooltip:!
1},_preCacheMode:-1,_cacheMode:u.REALTIME,_defaultCacheMode:
{default:0,type:u,notify:f
unction(){this.setAnimationCacheMode(this._defaultCacheMode)},editorOnly:!
0,visible:!0,animatable:!1,displayName:"Animation Cache Mode",tooltip:!1},loop:
{default:!0,tooltip:!1},premultipliedAlpha:{default:!0,tooltip:!1},timeScale:
{default:1,tooltip:!1},debugSlots:{default:!1,editorOnly:!0,tooltip:!
1,notify:function(){this._updateDebugDraw()}},debugBones:{default:!1,editorOnly:!
0,tooltip:!1,notify:function(){this._updateDebugDraw()}},useTint:{default:!
1,tooltip:!1,notify:function(){this._updateUseTint()}},enableBatch:{default:!
1,notify:function(){this._updateBatch()},tooltip:!
1},_accTime:0,_playCount:0,_frameCache:null,_curFrame:null,_skeletonCache:null,_ani
mationName:"",_animationQueue:[],_headAniInfo:null,_playTimes:0,_isAniComplete:!
0},ctor:function()
{this._skeleton=null,this._rootBone=null,this._listener=null,this._boundingBox=cc.r
ect(),this._materialCache={},this._debugRenderer=null,this._startSlotIndex=-
1,this._endSlotIndex=-1,this._startEntry={animation:
{name:""},trackIndex:0},this._endEntry={animation:
{name:""},trackIndex:0}},setMaterial:function(t,e)
{this._super(t,e),this._materialCache={}},_updateUseTint:function(){var
t=this._materialCache;for(var e in t){var
i=t[e];i&&i.define("USE_TINT",this.useTint)}},_updateBatch:function(){var
t=this._materialCache;for(var e in t){var i=t[e];i&&(i.useModel=!
this.enableBatch)}},setSkeletonData:function(t){if(null!=t.width&&null!
=t.height&&this.node.setContentSize(t.width,t.height),this._cacheMode===u.SHARED_CA
CHE?
this._skeletonCache=l.sharedCache:this._cacheMode===u.PRIVATE_CACHE&&(this._skeleto
nCache=new l),this.isAnimationCached()){(this.debugBones||
this.debugSlots)&&cc.warn("Debug bones or slots is invalid in cached mode");var
e=this._skeletonCache.getSkeletonCache(this.skeletonData._uuid,t);this._skeleton=e.
skeleton,this._clipper=e.clipper,this._rootBone=this._skeleton.getRootBone()}else
this._skeleton=new s.Skeleton(t),this._clipper=new
s.SkeletonClipping,this._rootBone=this._skeleton.getRootBone()},setSlotsRange:funct
ion(t,e){this.isAnimationCached()?console.warn("Slots visible range can not be
modified in cached mode."):
(this._startSlotIndex=t,this._endSlotIndex=e)},setAnimationStateData:function(t)
{if(this.isAnimationCached())console.warn("'setAnimationStateData' interface can
not be invoked in cached mode.");else{var e=new
s.AnimationState(t);this._listener&&(this._state&&this._state.removeListener(this._
listener),e.addListener(this._listener)),this._state=e}},__preload:function()
{for(var t=this.node.children,e=0,i=t.length;e<i;e++){var
n=t[e];n&&"DEBUG_DRAW_NODE"===n._name&&n.destroy()}this._activateMaterial(),this._u
pdateSkeletonData(),this._updateDebugDraw(),this._updateUseTint(),this._updateBatch
()},setAnimationCacheMode:function(t){this._preCacheMode!
==t&&(this._cacheMode=t,this._updateSkeletonData())},isAnimationCached:function()
{return this._cacheMode!==u.REALTIME},update:function(t){if(!
this.paused)if(t*=this.timeScale*sp.timeScale,this.isAnimationCached())
{if(this._isAniComplete){if(0===this._animationQueue.length&&!
this._headAniInfo)return;if(this._headAniInfo||
(this._headAniInfo=this._animationQueue.shift()),this._accTime+=t,this._accTime>thi
s._headAniInfo.delay){var
e=this._headAniInfo;this._headAniInfo=null,this.setAnimation(0,e.animationName,e.lo
op)}return}this._updateCache(t)}else
this._updateRealtime(t)},_updateCache:function(t){var
e=this._frameCache.frames,i=this._frameCache.totalTime,n=e.length;0==this._accTime&
&0==this._playCount&&(this._startEntry.animation.name=this._animationName,this._lis
tener&&this._listener.start&&this._listener.start(this._startEntry)),this._accTime+
=t;var r=Math.floor(this._accTime/i*n);if(r>=n)
{if(this._endEntry.animation.name=this._animationName,this._listener&&this._listene
r.complete&&this._listener.complete(this._endEntry),this._listener&&this._listener.
end&&this._listener.end(this._endEntry),this._playCount+
+,this._playTimes>0&&this._playCount>=this._playTimes)return
this._accTime=0,this._playCount=0,void(this._isAniComplete=!
0);this._accTime=0,r=0}this._curFrame=e[r]},_updateRealtime:function(t){var
e=this._skeleton,i=this._state;e&&(e.update(t),i&&(i.update(t),i.apply(e)))},_activ
ateMaterial:function(){var t=this.sharedMaterials[0];t?
t=a.getInstantiatedMaterial(t,this):
(t=a.getInstantiatedBuiltinMaterial("spine",this)).define("_USE_MODEL",!
0),this.setMaterial(0,t),this.markForRender(!0)},onEnable:function()
{this._super(),this._activateMaterial()},onRestore:function()
{this._boundingBox=cc.rect()},updateWorldTransform:function()
{this.isAnimationCached()&&this._skeleton&&this._skeleton.updateWorldTransform()},s
etToSetupPose:function(){this.isAnimationCached()?cc.warn("'SetToSetupPose'
interface can not be invoked in cached
mode."):this._skeleton&&this._skeleton.setToSetupPose()},setBonesToSetupPose:functi
on(){this.isAnimationCached()?cc.warn("'setBonesToSetupPose' interface can not be
invoked in cached
mode."):this._skeleton&&this._skeleton.setBonesToSetupPose()},setSlotsToSetupPose:f
unction(){this.isAnimationCached()?cc.warn("'setSlotsToSetupPose' interface can not
be invoked in cached
mode."):this._skeleton&&this._skeleton.setSlotsToSetupPose()},updateAnimationCache:
function(t){if(this.isAnimationCached()){var
e=this._skeletonCache.updateAnimationCache(this.skeletonData._uuid,t);this._frameCa
che=e||this._frameCache}},findBone:function(t){return this._skeleton?
this._skeleton.findBone(t):null},findSlot:function(t){return this._skeleton?
this._skeleton.findSlot(t):null},setSkin:function(t)
{if(this.isAnimationCached())this._skeletonCache.resetSkeleton(),this._skeletonCach
e.updateSkeletonSkin(this.skeletonData._uuid,t),this._animationName&&(this.animatio
n=this._animationName);else if(this._skeleton)return
this._skeleton.setSkinByName(t);return null},getAttachment:function(t,e){return
this._skeleton?
this._skeleton.getAttachmentByName(t,e):null},setAttachment:function(t,e)
{this._skeleton&&this._skeleton.setAttachment(t,e)},getTextureAtlas:function(t)
{return t.region},setMix:function(t,e,i)
{this._state&&this._state.data.setMix(t,e,i)},setAnimation:function(t,e,i)
{if(this._playTimes=i?0:1,this._animationName=e,this.isAnimationCached()){0!
==t&&cc.warn("Track index can not greater than 0 in cached mode.");var
n=this._skeletonCache.getAnimationCache(this.skeletonData._uuid,e);n||
(n=this._skeletonCache.updateAnimationCache(this.skeletonData._uuid,e)),n&&(this._i
sAniComplete=!
1,this._accTime=0,this._playCount=0,this._frameCache=n,this._curFrame=this._frameCa
che.frames[0])}else if(this._skeleton){var
r=this._skeleton.data.findAnimation(e);if(!r)return cc.logID(7509,e),null;var
s=this._state.setAnimationWith(t,r,i);return
this._state.apply(this._skeleton),s}return null},addAnimation:function(t,e,i,n)
{if(n=n||0,this.isAnimationCached())0!==t&&cc.warn("Track index can not greater
than 0 in cached
mode."),this._animationQueue.push({animationName:e,loop:i,delay:n});else
if(this._skeleton){var r=this._skeleton.data.findAnimation(e);return r?
this._state.addAnimationWith(t,r,i,n):(cc.logID(7510,e),null)}return
null},findAnimation:function(t){return this._skeleton?
this._skeleton.data.findAnimation(t):null},getCurrent:function(t)
{if(this.isAnimationCached())console.warn("'getCurrent' interface can not be
invoked in cached mode.");else if(this._state)return
this._state.getCurrent(t);return null},clearTracks:function()
{this.isAnimationCached()?console.warn("'clearTracks' interface can not be invoked
in cached mode."):this._state&&this._state.clearTracks()},clearTrack:function(t)
{this.isAnimationCached()?console.warn("'clearTrack' interface can not be invoked
in cached
mode."):this._state&&this._state.clearTrack(t)},setStartListener:function(t)
{this._ensureListener(),this._listener.start=t},setInterruptListener:function(t)
{this._ensureListener(),this._listener.interrupt=t},setEndListener:function(t)
{this._ensureListener(),this._listener.end=t},setDisposeListener:function(t)
{this._ensureListener(),this._listener.dispose=t},setCompleteListener:function(t)
{this._ensureListener(),this._listener.complete=t},setEventListener:function(t)
{this._ensureListener(),this._listener.event=t},setTrackStartListener:function(t,e)
{n.getListeners(t).start=e},setTrackInterruptListener:function(t,e)
{n.getListeners(t).interrupt=e},setTrackEndListener:function(t,e)
{n.getListeners(t).end=e},setTrackDisposeListener:function(t,e)
{n.getListeners(t).dispose=e},setTrackCompleteListener:function(t,e)
{n.getListeners(t).complete=function(t){var
i=Math.floor(t.trackTime/t.animationEnd);e(t,i)}},setTrackEventListener:function(t,
e){n.getListeners(t).event=e},getState:function(){return
this._state},_updateAnimEnum:!1,_updateSkinEnum:!1,_ensureListener:function()
{this._listener||(this._listener=new
n,this._state&&this._state.addListener(this._listener))},_updateSkeletonData:functi
on(){if(this.skeletonData){var t=this.skeletonData.getRuntimeData();if(t)
{try{this.setSkeletonData(t),this.isAnimationCached()||
this.setAnimationStateData(new
s.AnimationStateData(this._skeleton.data)),this.defaultSkin&&this.setSkin(this.defa
ultSkin)}catch(t)
{cc.warn(t)}this._preCacheMode=this._cacheMode,this.animation=this.defaultAnimation
}}},_refreshInspector:function()
{this._updateAnimEnum(),this._updateSkinEnum(),Editor.Utils.refreshSelectedInspecto
r("node",this.node.uuid)},_updateDebugDraw:function(){if(this.debugBones||
this.debugSlots){if(!this._debugRenderer){var t=new
cc.PrivateNode;t.name="DEBUG_DRAW_NODE";var
e=t.addComponent(o);e.lineWidth=1,e.strokeColor=cc.color(255,0,0,255),this._debugRe
nderer=e}this._debugRenderer.node.parent=this.node,this.isAnimationCached()&&cc.war
n("Debug bones or slots is invalid in cached mode")}else
this._debugRenderer&&(this._debugRenderer.node.parent=null)}}),e.exports=sp.Skeleto
n}),
{"../../cocos2d/core/assets/material/CCMaterial":75,"../../cocos2d/core/components/
CCRenderComponent":106,"../../cocos2d/core/graphics/graphics":141,"./lib/spine":402
,"./skeleton-cache":403,"./track-entry-listeners":407}],401:[(function(t,e,i){"use
strict";var n="undefined"==typeof window?global:window,r=!
0;r&&(n.sp={},sp._timeScale=1,Object.defineProperty(sp,"timeScale",{get:function()
{return this._timeScale},set:function(t){this._timeScale=t},configurable:!
0}),sp.ATTACHMENT_TYPE={REGION:0,BOUNDING_BOX:1,MESH:2,SKINNED_MESH:3},sp.Animation
EventType=cc.Enum({START:0,INTERRUPT:1,END:2,DISPOSE:3,COMPLETE:4,EVENT:5}),sp.spin
e=t("./lib/spine"),t("./skeleton-texture"),t("./skeleton-
data"),t("./Skeleton"),t("./spine-assembler"))}),
{"./Skeleton":400,"./lib/spine":402,"./skeleton-data":404,"./skeleton-
texture":405,"./spine-assembler":406}],402:[(function(t,e,i){"use strict";var
n,r=(function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:
[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in
e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n()
{this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):
(n.prototype=i.prototype,new n)}})();(function(t){var e,i,n,s=(function(){function
t(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new
Error("timelines cannot be
null.");this.name=t,this.timelines=e,this.duration=i}return
t.prototype.apply=function(t,e,i,n,r,s,a,o){if(null==t)throw new Error("skeleton
cannot be null.");n&&0!=this.duration&&(i%=this.duration,e>0&&(e
%=this.duration));for(var l=this.timelines,h=0,c=l.length;h<c;h+
+)l[h].apply(t,e,i,r,s,a,o)},t.binarySearch=function(t,e,i){void 0===i&&(i=1);var
n=0,r=t.length/i-2;if(0==r)return i;for(var s=r>>>1;;){if(t[(s+1)*i]<=e?
n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},t.linearSearch=function(t,e,i){for(var
n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},t})();t.Animation=s,
(function(t)
{t[t.setup=0]="setup",t[t.current=1]="current",t[t.currentLayered=2]="currentLayere
d"})(e=t.MixPose||(t.MixPose={})),(function(t){t[t.in=0]="in",t[t.out=1]="out"})
(i=t.MixDirection||(t.MixDirection={})),(function(t)
{t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear
=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="defo
rm",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstr
aint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=
11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",
t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"})
(n=t.TimelineType||(t.TimelineType={}));var a=(function(){function e(i)
{if(i<=0)throw new Error("frameCount must be > 0:
"+i);this.curves=t.Utils.newFloatArray((i-1)*e.BEZIER_SIZE)}return
e.prototype.getFrameCount=function(){return
this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t)
{this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t)
{this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var
i=t*e.BEZIER_SIZE;if(i==this.curves.length)return e.LINEAR;var
n=this.curves[i];return n==e.LINEAR?e.LINEAR:n==e.STEPPED?
e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,i,n,r,s){var a=.03*(2*-
i+r),o=.03*(2*-n+s),l=.006*(3*(i-r)+1),h=.006*(3*(n-s)
+1),c=2*a+l,u=2*o+h,_=.3*i+a+.16666667*l,f=.3*n+o+.16666667*h,d=t*e.BEZIER_SIZE,m=t
his.curves;m[d++]=e.BEZIER;for(var p=_,v=f,y=d+e.BEZIER_SIZE-
1;d<y;d+=2)m[d]=p,m[d+1]=v,_+=c,f+=u,c+=l,u+=h,p+=_,v+=f},e.prototype.getCurvePerce
nt=function(i,n){n=t.MathUtils.clamp(n,0,1);var
r=this.curves,s=i*e.BEZIER_SIZE,a=r[s];if(a==e.LINEAR)return
n;if(a==e.STEPPED)return 0;for(var o=0,l=++s,h=s+e.BEZIER_SIZE-
1;s<h;s+=2)if((o=r[s])>=n){var c=void 0,u=void 0;return s==l?(c=0,u=0):(c=r[s-
2],u=r[s-1]),u+(r[s+1]-u)*(n-c)/(o-c)}var _=r[s-1];return _+(1-_)*(n-o)/(1-
o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e})();t.CurveTimeline=a;var
o=(function(i){function a(e){var n=i.call(this,e)||this;return
n.frames=t.Utils.newFloatArray(e<<1),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i)
{t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=i},a.prototype.apply=function(t,i
,n,r,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(n<c[0])switch(l){case
e.setup:return void(u.rotation=u.data.rotation);case e.current:var
_=u.data.rotation-u.rotation;_-=360*(16384-(16384.499999999996-_/360|
0)),u.rotation+=_*o}else if(n>=c[c.length-
a.ENTRIES])if(l==e.setup)u.rotation=u.data.rotation+c[c.length+a.PREV_ROTATION]*o;e
lse{var f=u.data.rotation+c[c.length+a.PREV_ROTATION]-u.rotation;f-=360*(16384-
(16384.499999999996-f/360|0)),u.rotation+=f*o}else{var
d=s.binarySearch(c,n,a.ENTRIES),m=c[d+a.PREV_ROTATION],p=c[d],v=this.getCurvePercen
t((d>>1)-1,1-(n-p)/(c[d+a.PREV_TIME]-p)),y=c[d+a.ROTATION]-m;y=m+(y-=360*(16384-
(16384.499999999996-y/360|0)))*v,l==e.setup?(y-=360*(16384-(16384.499999999996-
y/360|0)),u.rotation=u.data.rotation+y*o):(y=u.data.rotation+y-u.rotation,y-
=360*(16384-(16384.499999999996-y/360|
0)),u.rotation+=y*o)}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-
1,a.ROTATION=1,a})(a);t.RotateTimeline=o;var l=(function(i){function a(e){var
n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,i,n)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=i,this.frames[t+a.Y]=n},a.prototy
pe.apply=function(t,i,n,r,o,l,h){var
c=this.frames,u=t.bones[this.boneIndex];if(n<c[0])switch(l){case e.setup:return
u.x=u.data.x,void(u.y=u.data.y);case e.current:u.x+=(u.data.x-
u.x)*o,u.y+=(u.data.y-u.y)*o}else{var _=0,f=0;if(n>=c[c.length-
a.ENTRIES])_=c[c.length+a.PREV_X],f=c[c.length+a.PREV_Y];else{var
d=s.binarySearch(c,n,a.ENTRIES);_=c[d+a.PREV_X],f=c[d+a.PREV_Y];var
m=c[d],p=this.getCurvePercent(d/a.ENTRIES-1,1-(n-m)/(c[d+a.PREV_TIME]-
m));_+=(c[d+a.X]-_)*p,f+=(c[d+a.Y]-f)*p}l==e.setup?
(u.x=u.data.x+_*o,u.y=u.data.y+f*o):(u.x+=(u.data.x+_-u.x)*o,u.y+=(u.data.y+f-
u.y)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a})
(a);t.TranslateTimeline=l;var h=(function(a){function o(t){return a.call(this,t)||
this}return r(o,a),o.prototype.getPropertyId=function()
{return(n.scale<<24)+this.boneIndex},o.prototype.apply=function(n,r,a,l,h,c,u){var
_=this.frames,f=n.bones[this.boneIndex];if(a<_[0])switch(c){case e.setup:return
f.scaleX=f.data.scaleX,void(f.scaleY=f.data.scaleY);case
e.current:f.scaleX+=(f.data.scaleX-f.scaleX)*h,f.scaleY+=(f.data.scaleY-
f.scaleY)*h}else{var d=0,m=0;if(a>=_[_.length-
o.ENTRIES])d=_[_.length+o.PREV_X]*f.data.scaleX,m=_[_.length+o.PREV_Y]*f.data.scale
Y;else{var p=s.binarySearch(_,a,o.ENTRIES);d=_[p+o.PREV_X],m=_[p+o.PREV_Y];var
v=_[p],y=this.getCurvePercent(p/o.ENTRIES-1,1-(a-v)/(_[p+o.PREV_TIME]-v));d=(d+
(_[p+o.X]-d)*y)*f.data.scaleX,m=(m+(_[p+o.Y]-
m)*y)*f.data.scaleY}if(1==h)f.scaleX=d,f.scaleY=m;else{var g=0,x=0;c==e.setup?
(g=f.data.scaleX,x=f.data.scaleY):(g=f.scaleX,x=f.scaleY),u==i.out?
(d=Math.abs(d)*t.MathUtils.signum(g),m=Math.abs(m)*t.MathUtils.signum(x)):
(g=Math.abs(g)*t.MathUtils.signum(d),x=Math.abs(x)*t.MathUtils.signum(m)),f.scaleX=
g+(d-g)*h,f.scaleY=x+(m-x)*h}}},o})(l);t.ScaleTimeline=h;var c=(function(t)
{function i(e){return t.call(this,e)||this}return
r(i,t),i.prototype.getPropertyId=function()
{return(n.shear<<24)+this.boneIndex},i.prototype.apply=function(t,n,r,a,o,l,h){var
c=this.frames,u=t.bones[this.boneIndex];if(r<c[0])switch(l){case e.setup:return
u.shearX=u.data.shearX,void(u.shearY=u.data.shearY);case
e.current:u.shearX+=(u.data.shearX-u.shearX)*o,u.shearY+=(u.data.shearY-
u.shearY)*o}else{var _=0,f=0;if(r>=c[c.length-
i.ENTRIES])_=c[c.length+i.PREV_X],f=c[c.length+i.PREV_Y];else{var
d=s.binarySearch(c,r,i.ENTRIES);_=c[d+i.PREV_X],f=c[d+i.PREV_Y];var
m=c[d],p=this.getCurvePercent(d/i.ENTRIES-1,1-(r-m)/(c[d+i.PREV_TIME]-
m));_+=(c[d+i.X]-_)*p,f+=(c[d+i.Y]-f)*p}l==e.setup?
(u.shearX=u.data.shearX+_*o,u.shearY=u.data.shearY+f*o):
(u.shearX+=(u.data.shearX+_-u.shearX)*o,u.shearY+=(u.data.shearY+f-
u.shearY)*o)}},i})(l);t.ShearTimeline=c;var u=(function(i){function a(e){var
n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frame
s[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,i,n,r,o,l,h){var
c=t.slots[this.slotIndex],u=this.frames;if(n<u[0])switch(l){case e.setup:return
void c.color.setFromColor(c.data.color);case e.current:var
_=c.color,f=c.data.color;_.add((f.r-_.r)*o,(f.g-_.g)*o,(f.b-_.b)*o,(f.a-
_.a)*o)}else{var d=0,m=0,p=0,v=0;if(n>=u[u.length-a.ENTRIES]){var
y=u.length;d=u[y+a.PREV_R],m=u[y+a.PREV_G],p=u[y+a.PREV_B],v=u[y+a.PREV_A]}else{var
g=s.binarySearch(u,n,a.ENTRIES);d=u[g+a.PREV_R],m=u[g+a.PREV_G],p=u[g+a.PREV_B],v=u
[g+a.PREV_A];var
x=u[g],b=this.getCurvePercent(g/a.ENTRIES-1,1-(n-x)/(u[g+a.PREV_TIME]-
x));d+=(u[g+a.R]-d)*b,m+=(u[g+a.G]-m)*b,p+=(u[g+a.B]-p)*b,v+=(u[g+a.A]-
v)*b}if(1==o)c.color.set(d,m,p,v);else{_=c.color;l==e.setup&&_.setFromColor(c.data.
color),_.add((d-_.r)*o,(m-_.g)*o,(p-_.b)*o,(v-_.a)*o)}}},a.ENTRIES=5,a.PREV_TIME=-
5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a})
(a);t.ColorTimeline=u;var _=(function(i){function a(e){var n=i.call(this,e)||
this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,i,n,r,s,o
,l,h)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=i,this.frames[t+a.G]=n,this.frame
s[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=l,this.fr
ames[t+a.B2]=h},a.prototype.apply=function(t,i,n,r,o,l,h){var
c=t.slots[this.slotIndex],u=this.frames;if(n<u[0])switch(l){case e.setup:return
c.color.setFromColor(c.data.color),void
c.darkColor.setFromColor(c.data.darkColor);case e.current:var
_=c.color,f=c.darkColor,d=c.data.color,m=c.data.darkColor;_.add((d.r-_.r)*o,(d.g-
_.g)*o,(d.b-_.b)*o,(d.a-_.a)*o),f.add((m.r-f.r)*o,(m.g-f.g)*o,(m.b-
f.b)*o,0)}else{var p=0,v=0,y=0,g=0,x=0,b=0,A=0;if(n>=u[u.length-a.ENTRIES]){var
C=u.length;p=u[C+a.PREV_R],v=u[C+a.PREV_G],y=u[C+a.PREV_B],g=u[C+a.PREV_A],x=u[C+a.
PREV_R2],b=u[C+a.PREV_G2],A=u[C+a.PREV_B2]}else{var
S=s.binarySearch(u,n,a.ENTRIES);p=u[S+a.PREV_R],v=u[S+a.PREV_G],y=u[S+a.PREV_B],g=u
[S+a.PREV_A],x=u[S+a.PREV_R2],b=u[S+a.PREV_G2],A=u[S+a.PREV_B2];var
T=u[S],w=this.getCurvePercent(S/a.ENTRIES-1,1-(n-T)/(u[S+a.PREV_TIME]-
T));p+=(u[S+a.R]-p)*w,v+=(u[S+a.G]-v)*w,y+=(u[S+a.B]-y)*w,g+=(u[S+a.A]-
g)*w,x+=(u[S+a.R2]-x)*w,b+=(u[S+a.G2]-b)*w,A+=(u[S+a.B2]-
A)*w}if(1==o)c.color.set(p,v,y,g),c.darkColor.set(x,b,A,1);else{_=c.color,f=c.darkC
olor;l==e.setup&&(_.setFromColor(c.data.color),f.setFromColor(c.data.darkColor)),_.
add((p-_.r)*o,(v-_.g)*o,(y-_.b)*o,(g-_.a)*o),f.add((x-f.r)*o,(b-f.g)*o,(A-
f.b)*o,0)}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-
5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-
1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a})(a);t.TwoColorTimeline=_;var
f=(function(){function r(e)
{this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return
r.prototype.getPropertyId=function()
{return(n.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function()
{return this.frames.length},r.prototype.setFrame=function(t,e,i)
{this.frames[t]=e,this.attachmentNames[t]=i},r.prototype.apply=function(t,n,r,a,o,l
,h){var c=t.slots[this.slotIndex];if(h!=i.out||l!=e.setup){var
u=this.frames;if(r<u[0]){if(l==e.setup){var
_=c.data.attachmentName;c.setAttachment(null==_?
null:t.getAttachment(this.slotIndex,_))}}else{var f=0;f=r>=u[u.length-1]?u.length-
1:s.binarySearch(u,r,1)-1;var
d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?
null:t.getAttachment(this.slotIndex,d))}}else{var
m=c.data.attachmentName;c.setAttachment(null==m?
null:t.getAttachment(this.slotIndex,m))}},r})();t.AttachmentTimeline=f;var
d=null,m=(function(i){function a(e){var n=i.call(this,e)||this;return
n.frames=t.Utils.newFloatArray(e),n.frameVertices=new
Array(e),null==d&&(d=t.Utils.newFloatArray(64)),n}return
r(a,i),a.prototype.getPropertyId=function(){return(n.deform<<27)+
+this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,i)
{this.frames[t]=e,this.frameVertices[t]=i},a.prototype.apply=function(i,n,r,a,o,l,h
){var c=i.slots[this.slotIndex],u=c.getAttachment();if(u instanceof
t.VertexAttachment&&u.applyDeform(this.attachment)){var
_=c.attachmentVertices;0==_.length&&(o=1);var
f=this.frameVertices,d=f[0].length,m=this.frames;if(r<m[0]){var p=u;switch(l){case
e.setup:return void(_.length=0);case e.current:if(1==o){_.length=0;break}var
v=t.Utils.setArraySize(_,d);if(null==p.bones)for(var y=p.vertices,g=0;g<d;g++)v[g]
+=(y[g]-v[g])*o;else{o=1-o;for(g=0;g<d;g++)v[g]*=o}}}else{var
x=t.Utils.setArraySize(_,d);if(r>=m[m.length-1]){var b=f[m.length-
1];if(1==o)t.Utils.arrayCopy(b,0,x,0,d);else if(l==e.setup)
{if(null==(p=u).bones)for(var A=p.vertices,C=0;C<d;C++){var S=A[C];x[C]=S+(b[C]-
S)*o}else for(var T=0;T<d;T++)x[T]=b[T]*o}else for(var w=0;w<d;w++)x[w]+=(b[w]-
x[w])*o}else{var E=s.binarySearch(m,r),M=f[E-
1],D=f[E],B=m[E],P=this.getCurvePercent(E-1,1-(r-B)/(m[E-1]-B));if(1==o)for(var
I=0;I<d;I++){var R=M[I];x[I]=R+(D[I]-R)*P}else if(l==e.setup)
{if(null==(p=u).bones)for(var O=p.vertices,L=0;L<d;L++){R=M[L],S=O[L];x[L]=S+(R+
(D[L]-R)*P-S)*o}else for(var F=0;F<d;F++){R=M[F];x[F]=(R+(D[F]-R)*P)*o}}else
for(var V=0;V<d;V++){R=M[V];x[V]+=(R+(D[V]-R)*P-x[V])*o}}}}},a})
(a);t.DeformTimeline=m;var p=(function(){function e(e)
{this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}return
e.prototype.getPropertyId=function(){return
n.event<<24},e.prototype.getFrameCount=function(){return
this.frames.length},e.prototype.setFrame=function(t,e)
{this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,i,n,r,a,o)
{if(null!=n){var
l=this.frames,h=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,n,r,a,o),
e=-1;else if(e>=l[h-1])return;if(!(i<l[0])){var c=0;if(e<l[0])c=0;else for(var
u=l[c=s.binarySearch(l,e)];c>0&&l[c-1]==u;)c--;for(;c<h&&i>=l[c];c+
+)n.push(this.events[c])}}},e})();t.EventTimeline=p;var v=(function(){function r(e)
{this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return
r.prototype.getPropertyId=function(){return
n.drawOrder<<24},r.prototype.getFrameCount=function(){return
this.frames.length},r.prototype.setFrame=function(t,e,i)
{this.frames[t]=e,this.drawOrders[t]=i},r.prototype.apply=function(n,r,a,o,l,h,c)
{var u=n.drawOrder,_=n.slots;if(c!=i.out||h!=e.setup){var
f=this.frames;if(a<f[0])h==e.setup&&t.Utils.arrayCopy(n.slots,0,n.drawOrder,0,n.slo
ts.length);else{var d=0;d=a>=f[f.length-1]?f.length-1:s.binarySearch(f,a)-1;var
m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(_,0,u,0,_.length);else for(var
p=0,v=m.length;p<v;p++)u[p]=_[m[p]]}}else
t.Utils.arrayCopy(n.slots,0,n.drawOrder,0,n.slots.length)},r})
();t.DrawOrderTimeline=v;var y=(function(a){function o(e){var i=a.call(this,e)||
this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return
r(o,a),o.prototype.getPropertyId=function()
{return(n.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(t
,e,i,n)
{t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.MIX]=i,this.frames[t+o.BEND_DIRECTIO
N]=n},o.prototype.apply=function(t,n,r,a,l,h,c){var
u=this.frames,_=t.ikConstraints[this.ikConstraintIndex];if(r<u[0])switch(h){case
e.setup:return _.mix=_.data.mix,void(_.bendDirection=_.data.bendDirection);case
e.current:_.mix+=(_.data.mix-_.mix)*l,_.bendDirection=_.data.bendDirection}else
if(r>=u[u.length-o.ENTRIES])h==e.setup?(_.mix=_.data.mix+(u[u.length+o.PREV_MIX]-
_.data.mix)*l,_.bendDirection=c==i.out?
_.data.bendDirection:u[u.length+o.PREV_BEND_DIRECTION]):
(_.mix+=(u[u.length+o.PREV_MIX]-
_.mix)*l,c==i.in&&(_.bendDirection=u[u.length+o.PREV_BEND_DIRECTION]));else{var
f=s.binarySearch(u,r,o.ENTRIES),d=u[f+o.PREV_MIX],m=u[f],p=this.getCurvePercent(f/o
.ENTRIES-1,1-(r-m)/(u[f+o.PREV_TIME]-m));h==e.setup?(_.mix=_.data.mix+(d+
(u[f+o.MIX]-d)*p-_.data.mix)*l,_.bendDirection=c==i.out?
_.data.bendDirection:u[f+o.PREV_BEND_DIRECTION]):(_.mix+=(d+(u[f+o.MIX]-d)*p-
_.mix)*l,c==i.in&&(_.bendDirection=u[f+o.PREV_BEND_DIRECTION]))}},o.ENTRIES=3,o.PRE
V_TIME=-3,o.PREV_MIX=-2,o.PREV_BEND_DIRECTION=-1,o.MIX=1,o.BEND_DIRECTION=2,o})
(a);t.IkConstraintTimeline=y;var g=(function(i){function a(e){var
n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFr
ame=function(t,e,i,n,r,s)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]
=n,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,
i,n,r,o,l,h){var
c=this.frames,u=t.transformConstraints[this.transformConstraintIndex];if(n<c[0])
{var _=u.data;switch(l){case e.setup:return
u.rotateMix=_.rotateMix,u.translateMix=_.translateMix,u.scaleMix=_.scaleMix,void(u.
shearMix=_.shearMix);case e.current:u.rotateMix+=(_.rotateMix-
u.rotateMix)*o,u.translateMix+=(_.translateMix-
u.translateMix)*o,u.scaleMix+=(_.scaleMix-u.scaleMix)*o,u.shearMix+=(_.shearMix-
u.shearMix)*o}}else{var f=0,d=0,m=0,p=0;if(n>=c[c.length-a.ENTRIES]){var
v=c.length;f=c[v+a.PREV_ROTATE],d=c[v+a.PREV_TRANSLATE],m=c[v+a.PREV_SCALE],p=c[v+a
.PREV_SHEAR]}else{var
y=s.binarySearch(c,n,a.ENTRIES);f=c[y+a.PREV_ROTATE],d=c[y+a.PREV_TRANSLATE],m=c[y+
a.PREV_SCALE],p=c[y+a.PREV_SHEAR];var g=c[y],x=this.getCurvePercent(y/a.ENTRIES-
1,1-(n-g)/(c[y+a.PREV_TIME]-g));f+=(c[y+a.ROTATE]-f)*x,d+=(c[y+a.TRANSLATE]-
d)*x,m+=(c[y+a.SCALE]-m)*x,p+=(c[y+a.SHEAR]-p)*x}if(l==e.setup)
{_=u.data;u.rotateMix=_.rotateMix+(f-_.rotateMix)*o,u.translateMix=_.translateMix+
(d-_.translateMix)*o,u.scaleMix=_.scaleMix+(m-_.scaleMix)*o,u.shearMix=_.shearMix+
(p-_.shearMix)*o}else u.rotateMix+=(f-u.rotateMix)*o,u.translateMix+=(d-
u.translateMix)*o,u.scaleMix+=(m-u.scaleMix)*o,u.shearMix+=(p-
u.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-
3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a})
(a);t.TransformConstraintTimeline=g;var x=(function(i){function a(e){var
n=i.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFram
e=function(t,e,i)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=i},a.prototype.apply=function
(t,i,n,r,o,l,h){var
c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(n<c[0])switch(l)
{case e.setup:return void(u.position=u.data.position);case
e.current:u.position+=(u.data.position-u.position)*o}else{var _=0;if(n>=c[c.length-
a.ENTRIES])_=c[c.length+a.PREV_VALUE];else{var
f=s.binarySearch(c,n,a.ENTRIES);_=c[f+a.PREV_VALUE];var
d=c[f],m=this.getCurvePercent(f/a.ENTRIES-1,1-(n-d)/(c[f+a.PREV_TIME]-
d));_+=(c[f+a.VALUE]-_)*m}l==e.setup?u.position=u.data.position+(_-
u.data.position)*o:u.position+=(_-u.position)*o}},a.ENTRIES=2,a.PREV_TIME=-
2,a.PREV_VALUE=-1,a.VALUE=1,a})(a);t.PathConstraintPositionTimeline=x;var
b=(function(t){function i(e){return t.call(this,e)||this}return
r(i,t),i.prototype.getPropertyId=function()
{return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},i.prototype.apply=fu
nction(t,n,r,a,o,l,h){var
c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(r<c[0])switch(l)
{case e.setup:return void(u.spacing=u.data.spacing);case
e.current:u.spacing+=(u.data.spacing-u.spacing)*o}else{var _=0;if(r>=c[c.length-
i.ENTRIES])_=c[c.length+i.PREV_VALUE];else{var
f=s.binarySearch(c,r,i.ENTRIES);_=c[f+i.PREV_VALUE];var
d=c[f],m=this.getCurvePercent(f/i.ENTRIES-1,1-(r-d)/(c[f+i.PREV_TIME]-
d));_+=(c[f+i.VALUE]-_)*m}l==e.setup?u.spacing=u.data.spacing+(_-
u.data.spacing)*o:u.spacing+=(_-u.spacing)*o}},i})
(x);t.PathConstraintSpacingTimeline=b;var
A=(function(i){function a(e){var n=i.call(this,e)||this;return
n.frames=t.Utils.newFloatArray(e*a.ENTRIES),n}return
r(a,i),a.prototype.getPropertyId=function()
{return(n.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=fun
ction(t,e,i,n)
{t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=i,this.frames[t+a.TRANSLATE]
=n},a.prototype.apply=function(t,i,n,r,o,l,h){var
c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(n<c[0])switch(l)
{case e.setup:return
u.rotateMix=u.data.rotateMix,void(u.translateMix=u.data.translateMix);case
e.current:u.rotateMix+=(u.data.rotateMix-
u.rotateMix)*o,u.translateMix+=(u.data.translateMix-u.translateMix)*o}else{var
_=0,f=0;if(n>=c[c.length-
a.ENTRIES])_=c[c.length+a.PREV_ROTATE],f=c[c.length+a.PREV_TRANSLATE];else{var
d=s.binarySearch(c,n,a.ENTRIES);_=c[d+a.PREV_ROTATE],f=c[d+a.PREV_TRANSLATE];var
m=c[d],p=this.getCurvePercent(d/a.ENTRIES-1,1-(n-m)/(c[d+a.PREV_TIME]-
m));_+=(c[d+a.ROTATE]-_)*p,f+=(c[d+a.TRANSLATE]-f)*p}l==e.setup?
(u.rotateMix=u.data.rotateMix+(_-
u.data.rotateMix)*o,u.translateMix=u.data.translateMix+(f-u.data.translateMix)*o):
(u.rotateMix+=(_-u.rotateMix)*o,u.translateMix+=(f-
u.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-
1,a.ROTATE=1,a.TRANSLATE=2,a})(a);t.PathConstraintMixTimeline=A})(n||(n={})),
(function(t){var e=(function(){function e(e){this.tracks=new Array,this.events=new
Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new
t.IntSet,this.mixingTo=new Array,this.animationsChanged=!
1,this.timeScale=1,this.trackEntryPool=new t.Pool(function(){return new
i}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var
e=this.tracks,i=0,n=e.length;i<n;i++){var r=e[i];if(null!=r)
{r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;var
s=t*r.timeScale;if(r.delay>0){if(r.delay-=s,r.delay>0)continue;s=-
r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0)
{for(a.delay=0,a.trackTime=o+t*a.timeScale,r.trackTime+=s,this.setCurrent(i,a,!
0);null!=a.mixingFrom;)a.mixTime+=s,a=a.mixingFrom;continue}}else
if(r.trackLast>=r.trackEnd&&null==r.mixingFrom)
{e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!
=r.mixingFrom&&this.updateMixingFrom(r,t)){var
l=r.mixingFrom;for(r.mixingFrom=null;null!
=l;)this.queue.end(l),l=l.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototyp
e.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var
n=this.updateMixingFrom(i,e);return
i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.mixTime>0&&(t.mix
Time>=t.mixDuration||0==t.timeScale)?(0!=i.totalAlpha&&0!=t.mixDuration||
(t.mixingFrom=i.mixingFrom,t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):
(i.trackTime+=e*i.timeScale,t.mixTime+=e*t.timeScale,!
1)},e.prototype.apply=function(i){if(null==i)throw new Error("skeleton cannot be
null.");this.animationsChanged&&this._animationsChanged();for(var
n=this.events,r=this.tracks,s=!1,a=0,o=r.length;a<o;a++){var l=r[a];if(!(null==l||
l.delay>0)){s=!0;var h=0==a?
t.MixPose.current:t.MixPose.currentLayered,c=l.alpha;null!=l.mixingFrom?
c*=this.applyMixingFrom(l,i,h):l.trackTime>=l.trackEnd&&null==l.next&&(c=0);var
u=l.animationLast,_=l.getAnimationTime(),f=l.animation.timelines.length,d=l.animati
on.timelines;if(1==c)for(var m=0;m<f;m+
+)d[m].apply(i,u,_,n,1,t.MixPose.setup,t.MixDirection.in);else{var
p=l.timelineData,v=0==l.timelinesRotation.length;v&&t.Utils.setArraySize(l.timeline
sRotation,f<<1,null);var y=l.timelinesRotation;for(m=0;m<f;m++){var
g=d[m],x=p[m]>=e.FIRST?t.MixPose.setup:h;g instanceof t.RotateTimeline?
this.applyRotateTimeline(g,i,_,c,x,y,m<<1,v):
(t.Utils.webkit602BugfixHelper(c,x),g.apply(i,u,_,n,c,x,t.MixDirection.in))}}this.q
ueueEvents(l,_),n.length=0,l.nextAnimationLast=_,l.nextTrackLast=l.trackTime}}retur
n this.queue.drain(),s},e.prototype.applyMixingFrom=function(i,n,r){var
s=i.mixingFrom;null!=s.mixingFrom&&this.applyMixingFrom(s,n,r);var
a=0;0==i.mixDuration?(a=1,r=t.MixPose.setup):
(a=i.mixTime/i.mixDuration)>1&&(a=1);var o=a<s.eventThreshold?
this.events:null,l=a<s.attachmentThreshold,h=a<s.drawOrderThreshold,c=s.animationLa
st,u=s.getAnimationTime(),_=s.animation.timelines.length,f=s.animation.timelines,d=
s.timelineData,m=s.timelineDipMix,p=0==s.timelinesRotation.length;p&&t.Utils.setArr
aySize(s.timelinesRotation,_<<1,null);var
v,y=s.timelinesRotation,g=s.alpha*i.interruptAlpha,x=g*(1-
a),b=0;s.totalAlpha=0;for(var A=0;A<_;A++){var C=f[A];switch(d[A]){case
e.SUBSEQUENT:if(!l&&C instanceof t.AttachmentTimeline)continue;if(!h&&C instanceof
t.DrawOrderTimeline)continue;v=r,b=x;break;case
e.FIRST:v=t.MixPose.setup,b=x;break;case
e.DIP:v=t.MixPose.setup,b=g;break;default:v=t.MixPose.setup,b=g;var
S=m[A];b*=Math.max(0,1-S.mixTime/S.mixDuration)}s.totalAlpha+=b,C instanceof
t.RotateTimeline?this.applyRotateTimeline(C,n,u,b,v,y,A<<1,p):
(t.Utils.webkit602BugfixHelper(b,v),C.apply(n,c,u,o,b,v,t.MixDirection.out))}return
i.mixDuration>0&&this.queueEvents(s,u),this.events.length=0,s.nextAnimationLast=u,s
.nextTrackLast=s.trackTime,a},e.prototype.applyRotateTimeline=function(e,i,n,r,s,a,
o,l){if(l&&(a[o]=0),1!=r){var
h=e,c=h.frames,u=i.bones[h.boneIndex];if(n<c[0])s==t.MixPose.setup&&(u.rotation=u.d
ata.rotation);else{var _=0;if(n>=c[c.length-
t.RotateTimeline.ENTRIES])_=u.data.rotation+c[c.length+t.RotateTimeline.PREV_ROTATI
ON];else{var
f=t.Animation.binarySearch(c,n,t.RotateTimeline.ENTRIES),d=c[f+t.RotateTimeline.PRE
V_ROTATION],m=c[f],p=h.getCurvePercent((f>>1)-1,1-(n-m)/
(c[f+t.RotateTimeline.PREV_TIME]-m));_=c[f+t.RotateTimeline.ROTATION]-d,_=d+(_-
=360*(16384-(16384.499999999996-_/360|0)))*p+u.data.rotation,_-=360*(16384-
(16384.499999999996-_/360|0))}var v=s==t.MixPose.setup?
u.data.rotation:u.rotation,y=0,g=_-v;if(0==g)y=a[o];else{g-=360*(16384-
(16384.499999999996-g/360|0));var x=0,b=0;l?(x=0,b=g):(x=a[o],b=a[o+1]);var
A=g>0,C=x>=0;t.MathUtils.signum(b)!
=t.MathUtils.signum(g)&&Math.abs(b)<=90&&(Math.abs(x)>180&&(x+=360*t.MathUtils.sign
um(x)),C=A),y=g+x-x%360,C!
=A&&(y+=360*t.MathUtils.signum(x)),a[o]=y}a[o+1]=g,v+=y*r,u.rotation=v-360*(16384-
(16384.499999999996-v/360|0))}}else
e.apply(i,0,n,null,1,s,t.MixDirection.in)},e.prototype.queueEvents=function(t,e)
{for(var i=t.animationStart,n=t.animationEnd,r=n-i,s=t.trackLast
%r,a=this.events,o=0,l=a.length;o<l;o++){var h=a[o];if(h.time<s)break;h.time>n||
this.queue.event(t,h)}for((t.loop?0==r||s>t.trackTime
%r:e>=n&&t.animationLast<n)&&this.queue.complete(t);o<l;o++){a[o].time<i||
this.queue.event(t,a[o])}},e.prototype.clearTracks=function(){var
t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var
e=0,i=this.tracks.length;e<i;e+
+)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.dra
in()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var
e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;)
{var
n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i=n}this.tracks
[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,i)
{var n=this.expandToIndex(t);this.tracks[t]=e,null!
=n&&(i&&this.queue.interrupt(n),e.mixingFrom=n,e.mixTime=0,null!
=n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDurati
on)),n.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=fu
nction(t,e,i){var n=this.data.skeletonData.findAnimation(e);if(null==n)throw new
Error("Animation not found: "+e);return
this.setAnimationWith(t,n,i)},e.prototype.setAnimationWith=function(t,e,i)
{if(null==e)throw new Error("animation cannot be null.");var n=!
0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?
(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.dispose
Next(r),r=r.mixingFrom,n=!1):this.disposeNext(r));var
s=this.trackEntry(t,e,i,r);return
this.setCurrent(t,s,n),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,
i,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new
Error("Animation not found: "+e);return
this.addAnimationWith(t,r,i,n)},e.prototype.addAnimationWith=function(t,e,i,n)
{if(null==e)throw new Error("animation cannot be null.");var
r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var
s=this.trackEntry(t,e,i,r);if(null==r)this.setCurrent(t,s,!
0),this.queue.drain();else if(r.next=s,n<=0){var a=r.animationEnd-
r.animationStart;0!=a?(r.loop?n+=a*(1+(r.trackTime/a|0)):n+=a,n-
=this.data.getMix(r.animation,e)):n=0}return
s.delay=n,s},e.prototype.setEmptyAnimation=function(t,i){var
n=this.setAnimationWith(t,e.emptyAnimation,!1);return
n.mixDuration=i,n.trackEnd=i,n},e.prototype.addEmptyAnimation=function(t,i,n)
{n<=0&&(n-=i);var r=this.addAnimationWith(t,e.emptyAnimation,!1,n);return
r.mixDuration=i,r.trackEnd=i,r},e.prototype.setEmptyAnimations=function(t){var
e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var
i=0,n=this.tracks.length;i<n;i++){var r=this.tracks[i];null!
=r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=e,this.queue.dr
ain()},e.prototype.expandToIndex=function(e){return e<this.tracks.length?
this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e-
this.tracks.length+1,null),this.tracks.length=e+1,null)},e.prototype.trackEntry=fun
ction(t,e,i,n){var r=this.trackEntryPool.obtain();return
r.trackIndex=t,r.animation=e,r.loop=i,r.eventThreshold=0,r.attachmentThreshold=0,r.
drawOrderThreshold=0,r.animationStart=0,r.animationEnd=e.duration,r.animationLast=-
1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-
1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=
0,r.mixDuration=null==n?
0:this.data.getMix(n.animation,e),r},e.prototype.disposeNext=function(t){for(var
e=t.next;null!
=e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=func
tion(){this.animationsChanged=!1;var t=this.propertyIDs;t.clear();for(var
e=this.mixingTo,i=0,n=this.tracks.length;i<n;i++){var
r=this.tracks[i];null!
=r&&r.setTimelineData(null,e,t)}},e.prototype.getCurrent=function(t){return
t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t)
{if(null==t)throw new Error("listener cannot be
null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var
e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearList
eners=function()
{this.listeners.length=0},e.prototype.clearListenerNotifications=function()
{this.queue.clear()},e.emptyAnimation=new t.Animation("<empty>",
[],0),e.SUBSEQUENT=0,e.FIRST=1,e.DIP=2,e.DIP_MIX=3,e})();t.AnimationState=e;var
i=(function(){function i(){this.timelineData=new Array,this.timelineDipMix=new
Array,this.timelinesRotation=new Array}return i.prototype.reset=function()
{this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.ti
melineData.length=0,this.timelineDipMix.length=0,this.timelinesRotation.length=0},i
.prototype.setTimelineData=function(i,n,r){null!=i&&n.push(i);var s=null!
=this.mixingFrom?this.mixingFrom.setTimelineData(this,n,r):this;null!
=i&&n.pop();var a=n,o=n.length-
1,l=this.animation.timelines,h=this.animation.timelines.length,c=t.Utils.setArraySi
ze(this.timelineData,h);this.timelineDipMix.length=0;var
u=t.Utils.setArraySize(this.timelineDipMix,h);t:for(var _=0;_<h;_++){var
f=l[_].getPropertyId();if(r.add(f))if(null!=i&&i.hasTimeline(f)){for(var
d=o;d>=0;d--){var m=a[d];if(!m.hasTimeline(f)&&m.mixDuration>0)
{c[_]=e.DIP_MIX,u[_]=m;continue t}}c[_]=e.DIP}else c[_]=e.FIRST;else
c[_]=e.SUBSEQUENT}return s},i.prototype.hasTimeline=function(t){for(var
e=this.animation.timelines,i=0,n=e.length;i<n;i+
+)if(e[i].getPropertyId()==t)return!0;return!
1},i.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-
this.animationStart;return 0==t?this.animationStart:this.trackTime
%t+this.animationStart}return
Math.min(this.trackTime+this.animationStart,this.animationEnd)},i.prototype.setAnim
ationLast=function(t)
{this.animationLast=t,this.nextAnimationLast=t},i.prototype.isComplete=function()
{return this.trackTime>=this.animationEnd-
this.animationStart},i.prototype.resetRotationDirections=function()
{this.timelinesRotation.length=0},i})();t.TrackEntry=i;var n,r=(function(){function
t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return
t.prototype.start=function(t)
{this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!
0},t.prototype.interrupt=function(t)
{this.objects.push(n.interrupt),this.objects.push(t)},t.prototype.end=function(t)
{this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!
0},t.prototype.dispose=function(t)
{this.objects.push(n.dispose),this.objects.push(t)},t.prototype.complete=function(t
)
{this.objects.push(n.complete),this.objects.push(t)},t.prototype.event=function(t,e
)
{this.objects.push(n.event),this.objects.push(t),this.objects.push(e)},t.prototype.
drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var
t=this.objects,e=this.animState.listeners,i=0;i<t.length;i+=2){var
r=t[i],s=t[i+1];switch(r){case n.start:null!
=s.listener&&s.listener.start&&s.listener.start(s);for(var a=0;a<e.length;a+
+)e[a].start&&e[a].start(s);break;case n.interrupt:null!
=s.listener&&s.listener.interrupt&&s.listener.interrupt(s);for(a=0;a<e.length;a+
+)e[a].interrupt&&e[a].interrupt(s);break;case n.end:null!
=s.listener&&s.listener.end&&s.listener.end(s);for(a=0;a<e.length;a+
+)e[a].end&&e[a].end(s);case n.dispose:null!
=s.listener&&s.listener.dispose&&s.listener.dispose(s);for(a=0;a<e.length;a+
+)e[a].dispose&&e[a].dispose(s);this.animState.trackEntryPool.free(s);break;case
n.complete:null!
=s.listener&&s.listener.complete&&s.listener.complete(s);for(a=0;a<e.length;a+
+)e[a].complete&&e[a].complete(s);break;case n.event:var o=t[2+i++];null!
=s.listener&&s.listener.event&&s.listener.event(s,o);for(a=0;a<e.length;a+
+)e[a].event&&e[a].event(s,o)}}this.clear(),this.drainDisabled=!
1}},t.prototype.clear=function(){this.objects.length=0},t})();t.EventQueue=r,
(function(t)
{t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]=
"dispose",t[t.complete=4]="complete",t[t.event=5]="event"})(n=t.EventType||
(t.EventType={}));var s=(function(){function t(){}return
t.prototype.start=function(t){},t.prototype.interrupt=function(t)
{},t.prototype.end=function(t){},t.prototype.dispose=function(t)
{},t.prototype.complete=function(t){},t.prototype.event=function(t,e){},t})
();t.AnimationStateAdapter2=s})(n||(n={})),(function(t){var e=(function(){function
t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new
Error("skeletonData cannot be null.");this.skeletonData=t}return
t.prototype.setMix=function(t,e,i){var
n=this.skeletonData.findAnimation(t);if(null==n)throw new Error("Animation not
found: "+t);var r=this.skeletonData.findAnimation(e);if(null==r)throw new
Error("Animation not found:
"+e);this.setMixWith(n,r,i)},t.prototype.setMixWith=function(t,e,i)
{if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to
cannot be null.");var
n=t.name+"."+e.name;this.animationToMixTime[n]=i},t.prototype.getMix=function(t,e)
{var i=t.name+"."+e.name,n=this.animationToMixTime[i];return void 0===n?
this.defaultMix:n},t})();t.AnimationStateData=e})(n||(n={})),(function(t){var
e=(function(){function e(t,e){void
0===e&&(e=""),this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textur
eLoader=t,this.pathPrefix=e}return e.downloadText=function(t,e,i){var n=new
XMLHttpRequest;n.open("GET",t,!0),n.onload=function(){200==n.status?
e(n.responseText):i(n.status,n.responseText)},n.onerror=function()
{i(n.status,n.responseText)},n.send()},e.downloadBinary=function(t,e,i){var n=new
XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function()
{200==n.status?e(new
Uint8Array(n.response)):i(n.status,n.responseText)},n.onerror=function()
{i(n.status,n.responseText)},n.send()},e.prototype.loadText=function(t,i,n){var
r=this;void 0===i&&(i=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad+
+,e.downloadText(t,(function(e){r.assets[t]=e,i&&i(t,e),r.toLoad--,r.loaded++}),
(function(e,i){r.errors[t]="Couldn't load text "+t+": status "+status+",
"+i,n&&n(t,"Couldn't load text "+t+": status "+status+", "+i),r.toLoad--,r.loaded+
+}))},e.prototype.loadTexture=function(t,e,i){var n=this;void 0===e&&(e=null),void
0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++;var r=new
Image;r.crossOrigin="anonymous",r.onload=function(i){var
s=n.textureLoader(r);n.assets[t]=s,n.toLoad--,n.loaded+
+,e&&e(t,r)},r.onerror=function(e){n.errors[t]="Couldn't load image
"+t,n.toLoad--,n.loaded++,i&&i(t,"Couldn't load image
"+t)},r.src=t},e.prototype.loadTextureData=function(t,e,i,n){var r=this;void
0===i&&(i=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++;var s=new
Image;s.onload=function(e){var
n=r.textureLoader(s);r.assets[t]=n,r.toLoad--,r.loaded+
+,i&&i(t,s)},s.onerror=function(e){r.errors[t]="Couldn't load image
"+t,r.toLoad--,r.loaded++,n&&n(t,"Couldn't load image
"+t)},s.src=e},e.prototype.loadTextureAtlas=function(i,n,r){var s=this;void
0===n&&(n=null),void 0===r&&(r=null);var a=i.lastIndexOf("/")>=0?
i.substring(0,i.lastIndexOf("/")):"";i=this.pathPrefix+i,this.toLoad+
+,e.downloadText(i,(function(e){var o={count:0},l=new Array;try{new
t.TextureAtlas(e,function(e){l.push(a+"/"+e);var
i=document.createElement("img");return i.width=16,i.height=16,new
t.FakeTexture(i)})}catch(t){var h=t;return s.errors[i]="Couldn't load texture atlas
"+i+": "+h.message,r&&r(i,"Couldn't load texture atlas "+i+":
"+h.message),s.toLoad--,void s.loaded++}for(var c=function(h){var c=!
1;s.loadTexture(h,(function(h,u){if(o.count+
+,o.count==l.length)if(c)s.errors[i]="Couldn't load texture atlas page "+h+"} of
atlas "+i,r&&r(i,"Couldn't load texture atlas page "+h+" of atlas
"+i),s.toLoad--,s.loaded++;else try{var _=new t.TextureAtlas(e,function(t){return
s.get(a+"/"+t)});s.assets[i]=_,n&&n(i,_),s.toLoad--,s.loaded++}catch(t){var
f=t;s.errors[i]="Couldn't load texture atlas "+i+": "+f.message,r&&r(i,"Couldn't
load texture atlas "+i+": "+f.message),s.toLoad--,s.loaded++}}),(function(t,e){c=!
0,o.count++,o.count==l.length&&(s.errors[i]="Couldn't load texture atlas page
"+t+"} of atlas "+i,r&&r(i,"Couldn't load texture atlas page "+t+" of atlas
"+i),s.toLoad--,s.loaded++)}))},u=0,_=l;u<_.length;u++){c(_[u])}}),(function(t,e)
{s.errors[i]="Couldn't load texture atlas "+i+": status "+status+",
"+e,r&&r(i,"Couldn't load texture atlas "+i+": status "+status+",
"+e),s.toLoad--,s.loaded++}))},e.prototype.get=function(t){return
t=this.pathPrefix+t,this.assets[t]},e.prototype.remove=function(t)
{t=this.pathPrefix+t;var
e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null},e.prototype.removeAll=
function(){for(var t in this.assets){var
e=this.assets[t];e.dispose&&e.dispose()}this.assets={}},e.prototype.isLoadingComple
te=function(){return 0==this.toLoad},e.prototype.getToLoad=function(){return
this.toLoad},e.prototype.getLoaded=function(){return
this.loaded},e.prototype.dispose=function()
{this.removeAll()},e.prototype.hasErrors=function(){return
Object.keys(this.errors).length>0},e.prototype.getErrors=function(){return
this.errors},e})();t.AssetManager=e})(n||(n={})),(function(t){var e=(function()
{function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,i,n)
{var r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in
atlas: "+n+" (region attachment: "+i+")");r.renderObject=r;var s=new
t.RegionAttachment(i);return
s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,i,n){var
r=this.atlas.findRegion(n);if(null==r)throw new Error("Region not found in atlas:
"+n+" (mesh attachment: "+i+")");r.renderObject=r;var s=new
t.MeshAttachment(i);return
s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,i){return new
t.BoundingBoxAttachment(i)},e.prototype.newPathAttachment=function(e,i){return
new t.PathAttachment(i)},e.prototype.newPointAttachment=function(e,i){return new
t.PointAttachment(i)},e.prototype.newClippingAttachment=function(e,i){return new
t.ClippingAttachment(i)},e})();t.AtlasAttachmentLoader=e})(n||(n={})),(function(t)
{(function(t)
{t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.S
creen=3]="Screen"})(t.BlendMode||(t.BlendMode={}))})(n||(n={})),(function(t){var
e=(function(){function e(t,e,i){if(this.children=new
Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,t
his.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,thi
s.ashearX=0,this.ashearY=0,this.appliedValid=!
1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!
1,null==t)throw new Error("data cannot be null.");if(null==e)throw new
Error("skeleton cannot be
null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}return
e.prototype.update=function()
{this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,
this.shearX,this.shearY)},e.prototype.updateWorldTransform=function()
{this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,
this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,i,n,r,s,a
,o)
{this.ax=e,this.ay=i,this.arotation=n,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,
this.ashearY=o,this.appliedValid=!0;var l=this.parent;if(null==l){var
h=n+90+o,c=t.MathUtils.cosDeg(n+a)*r,u=t.MathUtils.cosDeg(h)*s,_=t.MathUtils.sinDeg
(n+a)*r,f=t.MathUtils.sinDeg(h)*s,d=this.skeleton;return d.flipX&&(e=-e,c=-c,u=-
u),d.flipY&&(i=-i,_=-_,f=-
f),this.a=c,this.b=u,this.c=_,this.d=f,this.worldX=e+d.x,void(this.worldY=i+d.y)}va
r
m=l.a,p=l.b,v=l.c,y=l.d;switch(this.worldX=m*e+p*i+l.worldX,this.worldY=v*e+y*i+l.w
orldY,this.data.transformMode){case
t.TransformMode.Normal:h=n+90+o,c=t.MathUtils.cosDeg(n+a)*r,u=t.MathUtils.cosDeg(h)
*s,_=t.MathUtils.sinDeg(n+a)*r,f=t.MathUtils.sinDeg(h)*s;return
this.a=m*c+p*_,this.b=m*u+p*f,this.c=v*c+y*_,void(this.d=v*u+y*f);case
t.TransformMode.OnlyTranslation:h=n+90+o;this.a=t.MathUtils.cosDeg(n+a)*r,this.b=t.
MathUtils.cosDeg(h)*s,this.c=t.MathUtils.sinDeg(n+a)*r,this.d=t.MathUtils.sinDeg(h)
*s;break;case t.TransformMode.NoRotationOrReflection:var g=0;(A=m*m+v*v)>1e-4?
(p=v*(A=Math.abs(m*y-p*v)/A),y=m*A,g=Math.atan2(v,m)*t.MathUtils.radDeg):
(m=0,v=0,g=90-Math.atan2(y,p)*t.MathUtils.radDeg);var x=n+a-g,b=n+o-
g+90;c=t.MathUtils.cosDeg(x)*r,u=t.MathUtils.cosDeg(b)*s,_=t.MathUtils.sinDeg(x)*r,
f=t.MathUtils.sinDeg(b)*s;this.a=m*c-p*_,this.b=m*u-
p*f,this.c=v*c+y*_,this.d=v*u+y*f;break;case t.TransformMode.NoScale:case
t.TransformMode.NoScaleOrReflection:var
A,C=t.MathUtils.cosDeg(n),S=t.MathUtils.sinDeg(n),T=m*C+p*S,w=v*C+y*S;
(A=Math.sqrt(T*T+w*w))>1e-5&&(A=1/A),T*=A,w*=A,A=Math.sqrt(T*T+w*w);var
E=Math.PI/2+Math.atan2(w,T),M=Math.cos(E)*A,D=Math.sin(E)*A;c=t.MathUtils.cosDeg(a)
*r,u=t.MathUtils.cosDeg(90+o)*s,_=t.MathUtils.sinDeg(a)*r,f=t.MathUtils.sinDeg(90+o
)*s;return(this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-
p*v<0:this.skeleton.flipX!=this.skeleton.flipY)&&(M=-M,D=-
D),this.a=T*c+M*_,this.b=T*u+M*f,this.c=w*c+D*_,void(this.d=w*u+D*f)}this.skeleton.
flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-
this.c,this.d=-this.d)},e.prototype.setToSetupPose=function(){var
t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,thi
s.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRo
tationX=function(){return
Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=functio
n(){return
Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function()
{return
Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function()
{return
Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function
(){this.appliedValid=!0;var e=this.parent;if(null==e)return
this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.
MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=M
ath.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(t
his.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var
i=e.a,n=e.b,r=e.c,s=e.d,a=1/(i*s-n*r),o=this.worldX-e.worldX,l=this.worldY-
e.worldY;this.ax=o*s*a-l*n*a,this.ay=l*i*a-o*r*a;var
h=a*s,c=a*i,u=a*n,_=a*r,f=h*this.a-u*this.c,d=h*this.b-u*this.d,m=c*this.c-
_*this.a,p=c*this.d-
_*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){var
v=f*p-
d*m;this.ascaleY=v/this.ascaleX,this.ashearY=Math.atan2(f*d+m*p,v)*t.MathUtils.radD
eg,this.arotation=Math.atan2(m,f)*t.MathUtils.radDeg}else
this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+p*p),this.ashearY=0,this.arotation=90-
Math.atan2(p,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var
e=this.a,i=this.b,n=this.c,r=this.d,s=1/(e*r-i*n),a=t.x-this.worldX,o=t.y-
this.worldY;return t.x=a*r*s-o*i*s,t.y=o*e*s-
a*n*s,t},e.prototype.localToWorld=function(t){var e=t.x,i=t.y;return
t.x=e*this.a+i*this.b+this.worldX,t.y=e*this.c+i*this.d+this.worldY,t},e.prototype.
worldToLocalRotation=function(e){var
i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return Math.atan2(this.a*i-
this.c*n,this.d*n-
this.b*i)*t.MathUtils.radDeg},e.prototype.localToWorldRotation=function(e){var
i=t.MathUtils.sinDeg(e),n=t.MathUtils.cosDeg(e);return
Math.atan2(n*this.c+i*this.d,n*this.a+i*this.b)*t.MathUtils.radDeg},e.prototype.rot
ateWorld=function(e){var
i=this.a,n=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e)
;this.a=a*i-o*r,this.b=a*n-o*s,this.c=o*i+a*r,this.d=o*n+a*s,this.appliedValid=!
1},e})();t.Bone=e})(n||(n={})),(function(t){var e,i=(function(){return
function(t,i,n)
{if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,thi
s.shearY=0,this.transformMode=e.Normal,t<0)throw new Error("index must be >=
0.");if(null==i)throw new Error("name cannot be
null.");this.index=t,this.name=i,this.parent=n}})();t.BoneData=i,(function(t)
{t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrRe
flection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflecti
on=4]="NoScaleOrReflection"})(e=t.TransformMode||(t.TransformMode={}))})(n||
(n={})),(function(t){var e=(function(){return function(t,e){if(null==e)throw new
Error("data cannot be null.");this.time=t,this.data=e}})();t.Event=e})(n||(n={})),
(function(t){var e=(function(){return function(t){this.name=t}})();t.EventData=e})
(n||(n={})),(function(t){var e=(function(){function e(t,e)
{if(this.mix=1,this.bendDirection=0,null==t)throw new Error("data cannot be
null.");if(null==e)throw new Error("skeleton cannot be
null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=ne
w Array;for(var i=0;i<t.bones.length;i+
+)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name
)}return e.prototype.getOrder=function(){return
this.data.order},e.prototype.apply=function()
{this.update()},e.prototype.update=function(){var
t=this.target,e=this.bones;switch(e.length){case
1:this.apply1(e[0],t.worldX,t.worldY,this.mix);break;case
2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}},e.prototyp
e.apply1=function(e,i,n,r){e.appliedValid||e.updateAppliedTransform();var
s=e.parent,a=1/(s.a*s.d-s.b*s.c),o=i-s.worldX,l=n-s.worldY,h=(o*s.d-l*s.b)*a-
e.ax,c=(l*s.a-o*s.c)*a-e.ay,u=Math.atan2(c,h)*t.MathUtils.radDeg-e.ashearX-
e.arotation;e.ascaleX<0&&(u+=180),u>180?u-=360:u<-
180&&(u+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+u*r,e.ascaleX,e.asca
leY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,i,n,r,s,a){if(0!=a)
{e.appliedValid||e.updateAppliedTransform(),i.appliedValid||
i.updateAppliedTransform();var
o=e.ax,l=e.ay,h=e.ascaleX,c=e.ascaleY,u=i.ascaleX,_=0,f=0,d=0;h<0?(h=-h,_=180,d=-
1):(_=0,d=1),c<0&&(c=-c,d=-d),u<0?(u=-u,f=180):f=0;var
m=i.ax,p=0,v=0,y=0,g=e.a,x=e.b,b=e.c,A=e.d,C=Math.abs(h-c)<=1e-4;C?
(v=g*m+x*(p=i.ay)+e.worldX,y=b*m+A*p+e.worldY):
(p=0,v=g*m+e.worldX,y=b*m+e.worldY);var S=e.parent;g=S.a,x=S.b,b=S.c;var
T=1/(g*(A=S.d)-x*b),w=n-S.worldX,E=r-S.worldY,M=(w*A-E*x)*T-o,D=(E*g-w*b)*T-
l,B=((w=v-S.worldX)*A-(E=y-S.worldY)*x)*T-o,P=(E*g-w*b)*T-
l,I=Math.sqrt(B*B+P*P),R=i.data.length*u,O=0,L=0;t:if(C){var F=(M*M+D*D-I*I-
(R*=h)*R)/(2*I*R);F<-1?F=-
1:F>1&&(F=1),L=Math.acos(F)*s,g=I+R*F,x=R*Math.sin(L),O=Math.atan2(D*g-
M*x,M*g+D*x)}else{var V=(g=h*R)*g,N=(x=c*R)*x,k=M*M+D*D,G=Math.atan2(D,M),z=-
2*N*I,U=N-V;if((A=z*z-4*U*(b=N*I*I+V*k-V*N))>=0){var j=Math.sqrt(A);z<0&&(j=-j);var
W=(j=-(z+j)/2)/U,H=b/j,X=Math.abs(W)<Math.abs(H)?W:H;if(X*X<=k){E=Math.sqrt(k-
X*X)*s,O=G-Math.atan2(E,X),L=Math.atan2(E/c,(X-I)/h);break t}}var
q=t.MathUtils.PI,Y=I-g,J=Y*Y,Z=0,K=0,Q=I+g,$=Q*Q,tt=0;(b=-g*I/(V-N))>=-
1&&b<=1&&(b=Math.acos(b),(A=(w=g*Math.cos(b)+I)*w+
(E=x*Math.sin(b))*E)<J&&(q=b,J=A,Y=w,Z=E),A>$&&(K=b,$=A,Q=w,tt=E)),k<=(J+$)/2?(O=G-
Math.atan2(Z*s,Y),L=q*s):(O=G-Math.atan2(tt*s,Q),L=K*s)}var
et=Math.atan2(p,m)*d,it=e.arotation;(O=(O-et)*t.MathUtils.radDeg+_-it)>180?O-
=360:O<-
180&&(O+=360),e.updateWorldTransformWith(o,l,it+O*a,e.ascaleX,e.ascaleY,0,0),it=i.a
rotation,(L=((L+et)*t.MathUtils.radDeg-i.ashearX)*d+f-it)>180?L-=360:L<-
180&&(L+=360),i.updateWorldTransformWith(m,p,it+L*a,i.ascaleX,i.ascaleY,i.ashearX,i
.ashearY)}else i.updateWorldTransform()},e})();t.IkConstraint=e})(n||(n={})),
(function(t){var e=(function(){return function(t){this.order=0,this.bones=new
Array,this.bendDirection=1,this.mix=1,this.name=t}})();t.IkConstraintData=e})(n||
(n={})),(function(t){var e=(function(){function e(t,e)
{if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces
=new Array,this.positions=new Array,this.world=new Array,this.curves=new
Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data
cannot be null.");if(null==e)throw new Error("skeleton
cannot be null.");this.data=t,this.bones=new Array;for(var
i=0,n=t.bones.length;i<n;i+
+)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findSlot(t.target.name
),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.t
ranslateMix=t.translateMix}return e.prototype.apply=function()
{this.update()},e.prototype.update=function(){var
i=this.target.getAttachment();if(i instanceof t.PathAttachment){var
n=this.rotateMix,r=this.translateMix,s=n>0;if(r>0||s){var
a=this.data,o=a.spacingMode,l=o==t.SpacingMode.Length,h=a.rotateMode,c=h==t.RotateM
ode.Tangent,u=h==t.RotateMode.ChainScale,_=this.bones.length,f=c?
_:_+1,d=this.bones,m=t.Utils.setArraySize(this.spaces,f),p=null,v=this.spacing;if(u
||l){u&&(p=t.Utils.setArraySize(this.lengths,_));for(var y=0,g=f-1;y<g;){var
x=(B=d[y]).data.length;if(x<e.epsilon)u&&(p[y]=0),m[++y]=0;else{var
b=x*B.a,A=x*B.c,C=Math.sqrt(b*b+A*A);u&&(p[y]=C),m[++y]=(l?x+v:v)*C/x}}}else
for(y=1;y<f;y++)m[y]=v;var
S=this.computeWorldPositions(i,f,c,a.positionMode==t.PositionMode.Percent,o==t.Spac
ingMode.Percent),T=S[0],w=S[1],E=a.offsetRotation,M=!
1;if(0==E)M=h==t.RotateMode.Chain;else M=!1,E*=(D=this.target.bone).a*D.d-
D.b*D.c>0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var D=3;y<_;y++,D+=3){var
B;(B=d[y]).worldX+=(T-B.worldX)*r,B.worldY+=(w-B.worldY)*r;var P=(b=S[D])-
T,I=(A=S[D+1])-w;if(u){var R=p[y];if(0!=R){var O=(Math.sqrt(P*P+I*I)/R-
1)*n+1;B.a*=O,B.c*=O}}if(T=b,w=A,s){var L=B.a,F=B.b,V=B.c,N=B.d,k=0,G=0,z=0;if(k=c?
S[D-1]:0==m[y+1]?S[D+2]:Math.atan2(I,P),k-=Math.atan2(V,L),M)
{G=Math.cos(k),z=Math.sin(k);var U=B.data.length;T+=(U*(G*L-z*V)-
P)*n,w+=(U*(z*L+G*V)-I)*n}else k+=E;k>t.MathUtils.PI?k-=t.MathUtils.PI2:k<-
t.MathUtils.PI&&(k+=t.MathUtils.PI2),k*=n,G=Math.cos(k),z=Math.sin(k),B.a=G*L-
z*V,B.b=G*F-z*N,B.c=z*L+G*V,B.d=z*F+G*N}B.appliedValid=!
1}}}},e.prototype.computeWorldPositions=function(i,n,r,s,a){var
o=this.target,l=this.position,h=this.spaces,c=t.Utils.setArraySize(this.positions,3
*n+2),u=null,_=i.closed,f=i.worldVerticesLength,d=f/6,m=e.NONE;if(!i.constantSpeed)
{var p=i.lengths,v=p[d-=_?1:2];if(s&&(l*=v),a)for(var y=0;y<n;y+
+)h[y]*=v;u=t.Utils.setArraySize(this.world,8);y=0;for(var g=0,x=0;y<n;y++,g+=3)
{var b=l+=H=h[y];if(_)(b%=v)<0&&(b+=v),x=0;else{if(b<0){m!
=e.BEFORE&&(m=e.BEFORE,i.computeWorldVertices(o,2,4,u,0,2)),this.addBeforePosition(
b,u,0,c,g);continue}if(b>v){m!=e.AFTER&&(m=e.AFTER,i.computeWorldVertices(o,f-
6,4,u,0,2)),this.addAfterPosition(b-v,u,0,c,g);continue}}for(;;x++){var A=p[x];if(!
(b>A)){if(0==x)b/=A;else b=(b-(J=p[x-1]))/(A-J);break}}x!=m&&(m=x,_&&x==d?
(i.computeWorldVertices(o,f-
4,4,u,0,2),i.computeWorldVertices(o,0,4,u,4,2)):i.computeWorldVertices(o,6*x+2,8,u,
0,2)),this.addCurvePosition(b,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],c,g,r||
y>0&&0==H)}return c}_?
(f+=2,u=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f-
4,u,0,2),i.computeWorldVertices(o,0,2,u,f-4,2),u[f-2]=u[0],u[f-1]=u[1]):(d--,f-
=4,u=t.Utils.setArraySize(this.world,f),i.computeWorldVertices(o,2,f,u,0,2));for(va
r
C=t.Utils.setArraySize(this.curves,d),S=0,T=u[0],w=u[1],E=0,M=0,D=0,B=0,P=0,I=0,R=0
,O=0,L=0,F=0,V=0,N=0,k=0,G=0,z=(y=0,2);y<d;y+
+,z+=6)E=u[z],M=u[z+1],D=u[z+2],B=u[z+3],P=u[z+4],I=u[z+5],V=2*(R=.1875*(T-2*E+D))+
(L=.09375*(3*(E-D)-T+P)),N=2*(O=.1875*(w-2*M+B))+(F=.09375*(3*(M-B)-w+I)),k=.75*(E-
T)+R+.16666667*L,G=.75*(M-w)
+O+.16666667*F,S+=Math.sqrt(k*k+G*G),k+=V,G+=N,V+=L,N+=F,S+=Math.sqrt(k*k+G*G),k+=V
,G+=N,S+=Math.sqrt(k*k+G*G),k+=V+L,G+=N+F,S+=Math.sqrt(k*k+G*G),C[y]=S,T=P,w=I;if(s
&&(l*=S),a)for(y=0;y<n;y++)h[y]*=S;for(var
U=this.segments,j=0,W=(y=0,g=0,x=0,0);y<n;y++,g+=3){var H;b=l+=H=h[y];if(_)(b
%=S)<0&&(b+=S),x=0;else{if(b<0){this.addBeforePosition(b,u,0,c,g);continue}if(b>S)
{this.addAfterPosition(b-S,u,f-4,c,g);continue}}for(;;x++){var X=C[x];if(!(b>X))
{if(0==x)b/=X;else b=(b-(J=C[x-1]))/(X-J);break}}if(x!=m){m=x;var
q=6*x;for(T=u[q],w=u[q+1],E=u[q+2],M=u[q+3],D=u[q+4],B=u[q+5],P=u[q+6],I=u[q+7],V=2
*(R=.03*(T-2*E+D))+(L=.006*(3*(E-D)-T+P)),N=2*(O=.03*(w-2*M+B))+(F=.006*(3*(M-B)-
w+I)),k=.3*(E-T)+R+.16666667*L,G=.3*(M-w)
+O+.16666667*F,j=Math.sqrt(k*k+G*G),U[0]=j,q=1;q<8;q+
+)k+=V,G+=N,V+=L,N+=F,j+=Math.sqrt(k*k+G*G),U[q]=j;k+=V,G+=N,j+=Math.sqrt(k*k+G*G),
U[8]=j,k+=V+L,G+=N+F,j+=Math.sqrt(k*k+G*G),U[9]=j,W=0}for(b*=j;;W++){var
Y=U[W];if(!(b>Y)){var J;if(0==W)b/=Y;else b=W+(b-(J=U[W-1]))/(Y-
J);break}}this.addCurvePosition(.1*b,T,w,E,M,D,B,P,I,c,g,r||y>0&&0==H)}return
c},e.prototype.addBeforePosition=function(t,e,i,n,r){var s=e[i],a=e[i+1],o=e[i+2]-
s,l=e[i+3]-
a,h=Math.atan2(l,o);n[r]=s+t*Math.cos(h),n[r+1]=a+t*Math.sin(h),n[r+2]=h},e.prototy
pe.addAfterPosition=function(t,e,i,n,r){var s=e[i+2],a=e[i+3],o=s-e[i],l=a-
e[i+1],h=Math.atan2(l,o);n[r]=s+t*Math.cos(h),n[r+1]=a+t*Math.sin(h),n[r+2]=h},e.pr
ototype.addCurvePosition=function(t,e,i,n,r,s,a,o,l,h,c,u){(0==t||isNaN(t))&&(t=1e-
4);var _=t*t,f=_*t,d=1-
t,m=d*d,p=m*d,v=d*t,y=3*v,g=d*y,x=y*t,b=e*p+n*g+s*x+o*f,A=i*p+r*g+a*x+l*f;h[c]=b,h[
c+1]=A,u&&(h[c+2]=Math.atan2(A-(i*m+r*v*2+a*_),b-
(e*m+n*v*2+s*_)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-
1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e})();t.PathConstraint=e})(n||(n={})),
(function(t){var e=(function(){return function(t){this.order=0,this.bones=new
Array,this.name=t}})();t.PathConstraintData=e,(function(t)
{t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"})(t.PositionMode||
(t.PositionMode={})),(function(t)
{t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"})
(t.SpacingMode||(t.SpacingMode={})),(function(t)
{t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"})
(t.RotateMode||(t.RotateMode={}))})(n||(n={})),(function(t){var e=(function()
{function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return
t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t})
(),i=(function(){function t(t){void
0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.erro
rs={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,i,n){var
r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new
e(t),this.clientAssets[t]=r),null!
==i&&(r.textureLoader=i),r.toLoad.push(n),this.queuedAssets[n]!
==n&&(this.queuedAssets[n]=n,!0)},t.prototype.loadText=function(t,e){var
i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new
XMLHttpRequest;n.onreadystatechange=function()
{n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?
i.rawAssets[e]=n.responseText:i.errors[e]="Couldn't load text "+e+": status
"+n.status+", "+n.responseText)},n.open("GET",e,!
0),n.send()}},t.prototype.loadJson=function(t,e){var
i=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var n=new
XMLHttpRequest;n.onreadystatechange=function()
{n.readyState==XMLHttpRequest.DONE&&(n.status>=200&&n.status<300?
i.rawAssets[e]=JSON.parse(n.responseText):i.errors[e]="Couldn't load text "+e+":
status "+n.status+", "+n.responseText)},n.open("GET",e,!
0),n.send()}},t.prototype.loadTexture=function(t,e,i){var
n=this;if(i=this.pathPrefix+i,this.queueAsset(t,e,i)){var r=new
Image;r.src=i,r.crossOrigin="anonymous",r.onload=function(t)
{n.rawAssets[i]=r},r.onerror=function(t){n.errors[i]="Couldn't load image
"+i}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var
i=this.clientAssets[t];return null===i||void 0===i||
i.assets[e]},t.prototype.updateClientAssets=function(t){for(var
e=0;e<t.toLoad.length;e++){var i=t.toLoad[e],n=t.assets[i];if(null===n||void 0===n)
{var r=this.rawAssets[i];if(null===r||void 0===r)continue;r instanceof
HTMLImageElement?
t.assets[i]=t.textureLoader(r):t.assets[i]=r}}},t.prototype.isLoadingComplete=funct
ion(t){var e=this.clientAssets[t];return null===e||void 0===e||
(this.updateClientAssets(e),e.toLoad.length==e.loaded())},t.prototype.dispose=funct
ion(){},t.prototype.hasErrors=function(){return
Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return
this.errors},t})();t.SharedAssetManager=i})(n||(n={})),(function(t){var
e=(function(){function e(e){if(this._updateCache=new
Array,this.updateCacheReset=new Array,this.time=0,this.flipX=!1,this.flipY=!
1,this.x=0,this.y=0,null==e)throw new Error("data cannot be
null.");this.data=e,this.bones=new Array;for(var i=0;i<e.bones.length;i++){var
n=e.bones[i],r=void 0;if(null==n.parent)r=new t.Bone(n,this,null);else{var
s=this.bones[n.parent.index];r=new
t.Bone(n,this,s),s.children.push(r)}this.bones.push(r)}this.slots=new
Array,this.drawOrder=new Array;for(i=0;i<e.slots.length;i++){var
a=e.slots[i],o=(r=this.bones[a.boneData.index],new
t.Slot(a,r));this.slots.push(o),this.drawOrder.push(o)}this.ikConstraints=new
Array;for(i=0;i<e.ikConstraints.length;i++){var
l=e.ikConstraints[i];this.ikConstraints.push(new
t.IkConstraint(l,this))}this.transformConstraints=new
Array;for(i=0;i<e.transformConstraints.length;i++){var
h=e.transformConstraints[i];this.transformConstraints.push(new
t.TransformConstraint(h,this))}this.pathConstraints=new
Array;for(i=0;i<e.pathConstraints.length;i++){var
c=e.pathConstraints[i];this.pathConstraints.push(new
t.PathConstraint(c,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}return
e.prototype.updateCache=function()
{this._updateCache.length=0,this.updateCacheReset.length=0;for(var
t=this.bones,e=0,i=t.length;e<i;e++)t[e].sorted=!1;var
n=this.ikConstraints,r=this.transformConstraints,s=this.pathConstraints,a=n.length,
o=r.length,l=s.length,h=a+o+l;t:for(e=0;e<h;e++){for(var c=0;c<a;c++)
{if((u=n[c]).data.order==e){this.sortIkConstraint(u);continue t}}for(c=0;c<o;c++)
{if((u=r[c]).data.order==e){this.sortTransformConstraint(u);continue
t}}for(c=0;c<l;c++){var u;if((u=s[c]).data.order==e)
{this.sortPathConstraint(u);continue t}}}for(e=0,i=t.length;e<i;e+
+)this.sortBone(t[e])},e.prototype.sortIkConstraint=function(t){var
e=t.target;this.sortBone(e);var i=t.bones,n=i[0];if(this.sortBone(n),i.length>1)
{var r=i[i.length-1];this._updateCache.indexOf(r)>-1||
this.updateCacheReset.push(r)}this._updateCache.push(t),this.sortReset(n.children),
i[i.length-1].sorted=!0},e.prototype.sortPathConstr
aint=function(e){var i=e.target,n=i.data.index,r=i.bone;null!
=this.skin&&this.sortPathConstraintAttachment(this.skin,n,r),null!
=this.data.defaultSkin&&this.data.defaultSkin!
=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,r);for(var
s=0,a=this.data.skins.length;s<a;s+
+)this.sortPathConstraintAttachment(this.data.skins[s],n,r);var
o=i.getAttachment();o instanceof
t.PathAttachment&&this.sortPathConstraintAttachmentWith(o,r);var
l=e.bones,h=l.length;for(s=0;s<h;s+
+)this.sortBone(l[s]);this._updateCache.push(e);for(s=0;s<h;s+
+)this.sortReset(l[s].children);for(s=0;s<h;s++)l[s].sorted=!
0},e.prototype.sortTransformConstraint=function(t){this.sortBone(t.target);var
e=t.bones,i=e.length;if(t.data.local)for(var n=0;n<i;n++){var
r=e[n];this.sortBone(r.parent),this._updateCache.indexOf(r)>-1||
this.updateCacheReset.push(r)}else for(n=0;n<i;n+
+)this.sortBone(e[n]);this._updateCache.push(t);for(var s=0;s<i;s+
+)this.sortReset(e[s].children);for(s=0;s<i;s++)e[s].sorted=!
0},e.prototype.sortPathConstraintAttachment=function(t,e,i){var
n=t.attachments[e];if(n)for(var r in
n)this.sortPathConstraintAttachmentWith(n[r],i)},e.prototype.sortPathConstraintAtta
chmentWith=function(e,i){if(e instanceof t.PathAttachment){var
n=e.bones;if(null==n)this.sortBone(i);else for(var
r=this.bones,s=0;s<n.length;)for(var a=n[s++],o=s+a;s<o;s++){var
l=n[s];this.sortBone(r[l])}}},e.prototype.sortBone=function(t){if(!t.sorted){var
e=t.parent;null!=e&&this.sortBone(e),t.sorted=!
0,this._updateCache.push(t)}},e.prototype.sortReset=function(t){for(var
e=0,i=t.length;e<i;e++){var n=t[e];n.sorted&&this.sortReset(n.children),n.sorted=!
1}},e.prototype.updateWorldTransform=function(){for(var
t=this.updateCacheReset,e=0,i=t.length;e<i;e++){var
n=t[e];n.ax=n.x,n.ay=n.y,n.arotation=n.rotation,n.ascaleX=n.scaleX,n.ascaleY=n.scal
eY,n.ashearX=n.shearX,n.ashearY=n.shearY,n.appliedValid=!0}var
r=this._updateCache;for(e=0,i=r.length;e<i;e+
+)r[e].update()},e.prototype.setToSetupPose=function()
{this.setBonesToSetupPose(),this.setSlotsToSetupPose()},e.prototype.setBonesToSetup
Pose=function(){for(var t=this.bones,e=0,i=t.length;e<i;e+
+)t[e].setToSetupPose();var n=this.ikConstraints;for(e=0,i=n.length;e<i;e++)
{(o=n[e]).bendDirection=o.data.bendDirection,o.mix=o.data.mix}var
r=this.transformConstraints;for(e=0,i=r.length;e<i;e++){var
s=(o=r[e]).data;o.rotateMix=s.rotateMix,o.translateMix=s.translateMix,o.scaleMix=s.
scaleMix,o.shearMix=s.shearMix}var a=this.pathConstraints;for(e=0,i=a.length;e<i;e+
+){var
o;s=(o=a[e]).data;o.position=s.position,o.spacing=s.spacing,o.rotateMix=s.rotateMix
,o.translateMix=s.translateMix}},e.prototype.setSlotsToSetupPose=function(){var
e=this.slots;t.Utils.arrayCopy(e,0,this.drawOrder,0,e.length);for(var
i=0,n=e.length;i<n;i++)e[i].setToSetupPose()},e.prototype.getRootBone=function()
{return 0==this.bones.length?null:this.bones[0]},e.prototype.findBone=function(t)
{if(null==t)throw new Error("boneName cannot be null.");for(var
e=this.bones,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return
null},e.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName
cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i+
+)if(e[i].data.name==t)return i;return-1},e.prototype.findSlot=function(t)
{if(null==t)throw new Error("slotName cannot be null.");for(var
e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return r}return
null},e.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName
cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i+
+)if(e[i].data.name==t)return i;return-1},e.prototype.setSkinByName=function(t){var
e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found:
"+t);this.setSkin(e)},e.prototype.setSkin=function(t){if(null!=t)if(null!
=this.skin)t.attachAll(this,this.skin);else for(var
e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i],s=r.data.attachmentName;if(null!=s)
{var a=t.getAttachment(i,s);null!
=a&&r.setAttachment(a)}}this.skin=t},e.prototype.getAttachmentByName=function(t,e)
{return
this.getAttachment(this.data.findSlotIndex(t),e)},e.prototype.getAttachment=functio
n(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!
=this.skin){var i=this.skin.getAttachment(t,e);if(null!=i)return i}return null!
=this.data.defaultSkin?
this.data.defaultSkin.getAttachment(t,e):null},e.prototype.setAttachment=function(t
,e){if(null==t)throw new Error("slotName cannot be null.");for(var
i=this.slots,n=0,r=i.length;n<r;n++){var s=i[n];if(s.data.name==t){var
a=null;if(null!=e&&null==(a=this.getAttachment(n,e)))throw new Error("Attachment
not found: "+e+", for slot: "+t);return void s.setAttachment(a)}}throw new
Error("Slot not found: "+t)},e.prototype.findIkConstraint=function(t)
{if(null==t)throw new Error("constraintName cannot be null.");for(var
e=this.ikConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return
r}return null},e.prototype.findTransformConstraint=function(t){if(null==t)throw new
Error("constraintName cannot be null.");for(var
e=this.transformConstraints,i=0,n=e.length;i<n;i++){var
r=e[i];if(r.data.name==t)return r}return
null},e.prototype.findPathConstraint=function(t){if(null==t)throw new
Error("constraintName cannot be null.");for(var
e=this.pathConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.data.name==t)return
r}return null},e.prototype.getBounds=function(e,i,n){if(null==e)throw new
Error("offset cannot be null.");if(null==i)throw new Error("size cannot be
null.");for(var
r=this.drawOrder,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEG
ATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=0,c=r.length;h<c;h++){var
u=r[h],_=0,f=null,d=u.getAttachment();if(d instanceof
t.RegionAttachment)_=8,f=t.Utils.setArraySize(n,_,0),d.computeWorldVertices(u.bone,
f,0,2);else if(d instanceof t.MeshAttachment){var
m=d;_=m.worldVerticesLength,f=t.Utils.setArraySize(n,_,0),m.computeWorldVertices(u,
0,_,f,0,2)}if(null!=f)for(var p=0,v=f.length;p<v;p+=2){var
y=f[p],g=f[p+1];s=Math.min(s,y),a=Math.min(a,g),o=Math.max(o,y),l=Math.max(l,g)}}e.
set(s,a),i.set(o-s,l-a)},e.prototype.update=function(t){this.time+=t},e})
();t.Skeleton=e})(n||(n={})),(function(t){var e=(function(){function e()
{this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new
Array,this.polygons=new Array,this.polygonPool=new t.Pool(function(){return
t.Utils.newFloatArray(16)})}return e.prototype.update=function(e,i)
{if(null==e)throw new Error("skeleton cannot be null.");var
n=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;n.leng
th=0,s.freeAll(r),r.length=0;for(var l=0;l<o;l++){var
h=a[l],c=h.getAttachment();if(c instanceof t.BoundingBoxAttachment){var
u=c;n.push(u);var _=s.obtain();_.length!
=u.worldVerticesLength&&(_=t.Utils.newFloatArray(u.worldVerticesLength)),r.push(_),
u.computeWorldVertices(h,0,u.worldVerticesLength,_,0,2)}}i?this.aabbCompute():
(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Nu
mber.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)},e.prototype.aabbCompute
=function(){for(var
t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=
Number.NEGATIVE_INFINITY,r=this.polygons,s=0,a=r.length;s<a;s++)for(var
o=r[s],l=o,h=0,c=o.length;h<c;h+=2){var
u=l[h],_=l[h+1];t=Math.min(t,u),e=Math.min(e,_),i=Math.max(i,u),n=Math.max(n,_)}thi
s.minX=t,this.minY=e,this.maxX=i,this.maxY=n},e.prototype.aabbContainsPoint=functio
n(t,e){return
t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsS
egment=function(t,e,i,n){var
r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||
t>=a&&i>=a||e>=o&&n>=o)return!1;var l=(n-e)/(i-t),h=l*(r-t)+e;if(h>s&&h<o)return!
0;if((h=l*(a-t)+e)>s&&h<o)return!0;var c=(s-e)/l+t;return c>r&&c<a||(c=(o-
e)/l+t)>r&&c<a},e.prototype.aabbIntersectsSkeleton=function(t){return
this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},e.prototype
.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n<r;n+
+)if(this.containsPointPolygon(i[n],t,e))return this.boundingBoxes[n];return
null},e.prototype.containsPointPolygon=function(t,e,i){for(var n=t,r=t.length,s=r-
2,a=!1,o=0;o<r;o+=2){var l=n[o+1],h=n[s+1];if(l<i&&h>=i||h<i&&l>=i){var c=n[o];c+
(i-l)/(h-l)*(n[s]-c)<e&&(a=!a)}s=o}return
a},e.prototype.intersectsSegment=function(t,e,i,n){for(var
r=this.polygons,s=0,a=r.length;s<a;s+
+)if(this.intersectsSegmentPolygon(r[s],t,e,i,n))return
this.boundingBoxes[s];return
null},e.prototype.intersectsSegmentPolygon=function(t,e,i,n,r){for(var
s=t,a=t.length,o=e-n,l=i-r,h=e*r-i*n,c=s[a-2],u=s[a-1],_=0;_<a;_+=2){var
f=s[_],d=s[_+1],m=c*d-u*f,p=c-f,v=u-d,y=o*v-l*p,g=(h*p-o*m)/y;if((g>=c&&g<=f||
g>=f&&g<=c)&&(g>=e&&g<=n||g>=n&&g<=e)){var x=(h*v-l*m)/y;if((x>=u&&x<=d||
x>=d&&x<=u)&&(x>=i&&x<=r||x>=r&&x<=i))return!0}c=f,u=d}return!
1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox
cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?
null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-
this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e})
();t.SkeletonBounds=e})(n||(n={})),(function(t){var e=(function(){function e()
{this.triangulator=new t.Triangulator,this.clippingPolygon=new
Array,this.clipOutput=new Array,this.clippedVertices=new
Array,this.clippedTriangles=new Array,this.scratch=new Array}return
e.prototype.clipStart=function(i,n){if(null!=this.clipAttachment)return
0;this.clipAttachment=n;var
r=n.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);n.computeWor
ldVertices(i,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var
o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate
(a)),l=0,h=o.length;l<h;l++){var
c=o[l];e.makeClockwise(c),c.push(c[0]),c.push(c[1])}return
o.length},e.prototype.clipEndWithSlot=function(t){null!
=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},e.protot
ype.clipEnd=function(){null!=this.clipAtt
achment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.
length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},e.prototype
.isClipping=function(){return null!
=this.clipAttachment},e.prototype.clipTriangles=function(e,i,n,r,s,a,o,l,h,c,u,_)
{var
f=this.clipOutput,d=this.clippedVertices,m=this.clippedTriangles,p=this.clippingPol
ygons,v=this.clippingPolygons.length,y=l?12:8,g=0;c=c||0,u=u||0,_=_||
0,d.length=0,m.length=0;t:for(var x=c,b=c+r;x<b;x+=3){var
A=n[x]*h,C=A+u,S=A+_,T=e[C],w=e[C+1],E=s[S],M=s[S+1];S=(A=n[x+1]*h)+_;var
D=e[C=A+u],B=e[C+1],P=s[S],I=s[S+1];S=(A=n[x+2]*h)+_;for(var
R=e[C=A+u],O=e[C+1],L=s[S],F=s[S+1],V=0;V<v;V++){var N=d.length;if(!
this.clip(T,w,D,B,R,O,p[V],f)){(q=t.Utils.setArraySize(d,N+3*y))
[N]=T,q[N+1]=w,q[N+2]=a.r,q[N+3]=a.g,q[N+4]=a.b,q[N+5]=a.a,l?
(q[N+6]=E,q[N+7]=M,q[N+8]=o.r,q[N+9]=o.g,q[N+10]=o.b,q[N+11]=o.a,q[N+12]=D,q[N+13]=
B,q[N+14]=a.r,q[N+15]=a.g,q[N+16]=a.b,q[N+17]=a.a,q[N+18]=P,q[N+19]=I,q[N+20]=o.r,q
[N+21]=o.g,q[N+22]=o.b,q[N+23]=o.a,q[N+24]=R,q[N+25]=O,q[N+26]=a.r,q[N+27]=a.g,q[N+
28]=a.b,q[N+29]=a.a,q[N+30]=L,q[N+31]=F,q[N+32]=o.r,q[N+33]=o.g,q[N+34]=o.b,q[N+35]
=o.a):
(q[N+6]=E,q[N+7]=M,q[N+8]=D,q[N+9]=B,q[N+10]=a.r,q[N+11]=a.g,q[N+12]=a.b,q[N+13]=a.
a,q[N+14]=P,q[N+15]=I,q[N+16]=R,q[N+17]=O,q[N+18]=a.r,q[N+19]=a.g,q[N+20]=a.b,q[N+2
1]=a.a,q[N+22]=L,q[N+23]=F),N=m.length,(it=t.Utils.setArraySize(m,N+3))
[N]=g,it[N+1]=g+1,it[N+2]=g+2,g+=3;continue t}var k=f.length;if(0!=k){for(var G=B-
O,z=R-D,U=T-R,j=O-w,W=1/(G*U+z*(w-
O)),H=k>>1,X=this.clipOutput,q=t.Utils.setArraySize(d,N+H*y),Y=0;Y<k;Y+=2){var
J=X[Y],Z=X[Y+1];q[N]=J,q[N+1]=Z,q[N+2]=a.r,q[N+3]=a.g,q[N+4]=a.b,q[N+5]=a.a;var
K=J-R,Q=Z-O,$=(G*K+z*Q)*W,tt=(j*K+U*Q)*W,et=1-$-tt;q[N+6]=E*$+P*tt+L*et,q[N+7]=M*$
+I*tt+F*et,l&&(q[N+8]=o.r,q[N+9]=o.g,q[N+10]=o.b,q[N+11]=o.a),N+=y}N=m.length;var
it=t.Utils.setArraySize(m,N+3*(H-2));H--;for(Y=1;Y<H;Y+
+)it[N]=g,it[N+1]=g+Y,it[N+2]=g+Y+1,N+=3;g+=H+1}}}},e.prototype.clip=function(t,e,i
,n,r,s,a,o){var l=o,h=!1,c=null;a.length%4>=2?
(c=o,o=this.scratch):c=this.scratch,c.length=0,c.push(t),c.push(e),c.push(i),c.push
(n),c.push(r),c.push(s),c.push(t),c.push(e),o.length=0;for(var u=a,_=a.length-
4,f=0;;f+=2){for(var d=u[f],m=u[f+1],p=u[f+2],v=u[f+3],y=d-p,g=m-v,x=c,b=c.length-
2,A=o.length,C=0;C<b;C+=2){var S=x[C],T=x[C+1],w=x[C+2],E=x[C+3],M=y*(E-v)-g*(w-
p)>0;if(y*(T-v)-g*(S-p)>0){if(M){o.push(w),o.push(E);continue}var D=((P=w-S)*(m-T)-
(B=E-T)*(d-S))/(B*(p-d)-P*(v-m));o.push(d+(p-d)*D),o.push(m+(v-m)*D)}else if(M){var
B,P;D=((P=w-S)*(m-T)-(B=E-T)*(d-S))/(B*(p-d)-P*(v-m));o.push(d+(p-d)*D),o.push(m+
(v-m)*D),o.push(w),o.push(E)}h=!0}if(A==o.length)return l.length=0,!
0;if(o.push(o[0]),o.push(o[1]),f==_)break;var I=o;(o=c).length=0,c=I}if(l!=o)
{l.length=0;f=0;for(var R=o.length-2;f<R;f++)l[f]=o[f]}else l.length=l.length-
2;return h},e.makeClockwise=function(t){for(var e=t,i=t.length,n=e[i-2]*e[1]-
e[0]*e[i-1],r=0,s=0,a=0,o=0,l=i-3;o<l;o+=2)r=e[o],s=e[o+1],a=e[o+2],n+=r*e[o+3]-
a*s;if(!(n<0)){o=0;var h=i-2;for(l=i>>1;o<l;o+=2){var c=e[o],u=e[o+1],_=h-
o;e[o]=e[_],e[o+1]=e[_+1],e[_]=c,e[_+1]=u}}},e})();t.SkeletonClipping=e})(n||
(n={})),(function(t){var e=(function(){function t(){this.bones=new
Array,this.slots=new Array,this.skins=new Array,this.events=new
Array,this.animations=new Array,this.ikConstraints=new
Array,this.transformConstraints=new Array,this.pathConstraints=new
Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new
Error("boneName cannot be null.");for(var e=this.bones,i=0,n=e.length;i<n;i++){var
r=e[i];if(r.name==t)return r}return null},t.prototype.findBoneIndex=function(t)
{if(null==t)throw new Error("boneName cannot be null.");for(var
e=this.bones,i=0,n=e.length;i<n;i++)if(e[i].name==t)return i;return-
1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be
null.");for(var e=this.slots,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return
r}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new
Error("slotName cannot be null.");for(var e=this.slots,i=0,n=e.length;i<n;i+
+)if(e[i].name==t)return i;return-1},t.prototype.findSkin=function(t)
{if(null==t)throw new Error("skinName cannot be null.");for(var
e=this.skins,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return
null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName
cannot be null.");for(var e=this.events,i=0,n=e.length;i<n;i++){var
r=e[i];if(r.name==t)return r}return null},t.prototype.findAnimation=function(t)
{if(null==t)throw new Error("animationName cannot be null.");for(var
e=this.animations,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return r}return
null},t.prototype.findIkConstraint=function(t){if(null==t)throw new
Error("constraintName cannot be null.");for(var
e=this.ikConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return
r}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new
Error("constraintName cannot be null.");for(var
e=this.transformConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return
r}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new
Error("constraintName cannot be null.");for(var
e=this.pathConstraints,i=0,n=e.length;i<n;i++){var r=e[i];if(r.name==t)return
r}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new
Error("pathConstraintName cannot be null.");for(var
e=this.pathConstraints,i=0,n=e.length;i<n;i++)if(e[i].name==t)return i;return-
1},t})();t.SkeletonData=e})(n||(n={})),(function(t){var e=(function(){function e(t)
{this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return
e.prototype.readSkeletonData=function(i){var n=this.scale,r=new
t.SkeletonData,s="string"==typeof i?JSON.parse(i):i,a=s.skeleton;if(null!
=a&&(r.hash=a.hash,r.version=a.spine,r.width=a.width,r.height=a.height,r.fps=a.fps,
r.imagesPath=a.images),s.bones)for(var o=0;o<s.bones.length;o++){var
l=s.bones[o],h=null,c=this.getValue(l,"parent",null);if(null!
=c&&null==(h=r.findBone(c)))throw new Error("Parent bone not found: "+c);(d=new
t.BoneData(r.bones.length,l.name,h)).length=this.getValue(l,"length",0)*n,d.x=this.
getValue(l,"x",0)*n,d.y=this.getValue(l,"y",0)*n,d.rotation=this.getValue(l,"rotati
on",0),d.scaleX=this.getValue(l,"scaleX",1),d.scaleY=this.getValue(l,"scaleY",1),d.
shearX=this.getValue(l,"shearX",0),d.shearY=this.getValue(l,"shearY",0),d.transform
Mode=e.transformModeFromString(this.getValue(l,"transform","normal")),r.bones.push(
d)}if(s.slots)for(o=0;o<s.slots.length;o++){var
u=(T=s.slots[o]).name,_=T.bone,f=r.findBone(_);if(null==f)throw new Error("Slot
bone not found: "+_);var d=new
t.SlotData(r.slots.length,u,f),m=this.getValue(T,"color",null);null!
=m&&d.color.setFromString(m);var p=this.getValue(T,"dark",null);null!
=p&&(d.darkColor=new
t.Color(1,1,1,1),d.darkColor.setFromString(p)),d.attachmentName=this.getValue(T,"at
tachment",null),d.blendMode=e.blendModeFromString(this.getValue(T,"blend","normal")
),r.slots.push(d)}if(s.ik)for(o=0;o<s.ik.length;o++){var v=s.ik[o];(d=new
t.IkConstraintData(v.name)).order=this.getValue(v,"order",0);for(var
y=0;y<v.bones.length;y++){_=v.bones[y];if(null==(x=r.findBone(_)))throw new
Error("IK bone not found: "+_);d.bones.push(x)}var
g=v.target;if(d.target=r.findBone(g),null==d.target)throw new Error("IK target bone
not found: "+g);d.bendDirection=this.getValue(v,"bendPositive",!0)?1:-
1,d.mix=this.getValue(v,"mix",1),r.ikConstraints.push(d)}if(s.transform)for(o=0;o<s
.transform.length;o++){v=s.transform[o];(d=new
t.TransformConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bon
es.length;y++){_=v.bones[y];if(null==(x=r.findBone(_)))throw new Error("Transform
constraint bone not found:
"+_);d.bones.push(x)}g=v.target;if(d.target=r.findBone(g),null==d.target)throw new
Error("Transform constraint target bone not found:
"+g);d.local=this.getValue(v,"local",!1),d.relative=this.getValue(v,"relative",!
1),d.offsetRotation=this.getValue(v,"rotation",0),d.offsetX=this.getValue(v,"x",0)*
n,d.offsetY=this.getValue(v,"y",0)*n,d.offsetScaleX=this.getValue(v,"scaleX",0),d.o
ffsetScaleY=this.getValue(v,"scaleY",0),d.offsetShearY=this.getValue(v,"shearY",0),
d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getValue(v,"translat
eMix",1),d.scaleMix=this.getValue(v,"scaleMix",1),d.shearMix=this.getValue(v,"shear
Mix",1),r.transformConstraints.push(d)}if(s.path)for(o=0;o<s.path.length;o++)
{v=s.path[o];(d=new
t.PathConstraintData(v.name)).order=this.getValue(v,"order",0);for(y=0;y<v.bones.le
ngth;y++){var x;_=v.bones[y];if(null==(x=r.findBone(_)))throw new Error("Transform
constraint bone not found:
"+_);d.bones.push(x)}g=v.target;if(d.target=r.findSlot(g),null==d.target)throw new
Error("Path target slot not found:
"+g);d.positionMode=e.positionModeFromString(this.getValue(v,"positionMode","percen
t")),d.spacingMode=e.spacingModeFromString(this.getValue(v,"spacingMode","length"))
,d.rotateMode=e.rotateModeFromString(this.getValue(v,"rotateMode","tangent")),d.off
setRotation=this.getValue(v,"rotation",0),d.position=this.getValue(v,"position",0),
d.positionMode==t.PositionMode.Fixed&&(d.position*=n),d.spacing=this.getValue(v,"sp
acing",0),d.spacingMode!=t.SpacingMode.Length&&d.spacingMode!=t.SpacingMode.Fixed||
(d.spacing*=n),d.rotateMix=this.getValue(v,"rotateMix",1),d.translateMix=this.getVa
lue(v,"translateMix",1),r.pathConstraints.push(d)}if(s.skins)for(var b in s.skins)
{var A=s.skins[b],C=new t.Skin(b);for(var u in A){var S=r.findSlotIndex(u);if(-
1==S)throw new Error("Slot not found: "+u);var T=A[u];for(var w in T){var
E=this.readAttachment(T[w],C,S,w,r);null!
=E&&C.addAttachment(S,w,E)}}r.skins.push(C),"default"==C.name&&(r.defaultSkin=C)}o=
0;for(var M=this.linkedMeshes.length;o<M;o++){var
D=this.linkedMeshes[o];if(null==(C=null==D.skin?
r.defaultSkin:r.findSkin(D.skin)))throw new Error("Skin not found: "+D.skin);var
B=C.getAttachment(D.slotIndex,D.parent);if(null==B)throw
new Error("Parent mesh not found:
"+D.parent);D.mesh.setParentMesh(B),D.mesh.updateUVs()}if(this.linkedMeshes.length=
0,s.events)for(var P in s.events){var I=s.events[P];(d=new
t.EventData(P)).intValue=this.getValue(I,"int",0),d.floatValue=this.getValue(I,"flo
at",0),d.stringValue=this.getValue(I,"string",""),r.events.push(d)}if(s.animations)
for(var R in s.animations){var O=s.animations[R];this.readAnimation(O,R,r)}return
r},e.prototype.readAttachment=function(e,n,r,s,a){var
o=this.scale;switch(s=this.getValue(e,"name",s),this.getValue(e,"type","region"))
{case"region":var
l=this.getValue(e,"path",s),h=this.attachmentLoader.newRegionAttachment(n,s,l);retu
rn null==h?null:
(h.path=l,h.x=this.getValue(e,"x",0)*o,h.y=this.getValue(e,"y",0)*o,h.scaleX=this.g
etValue(e,"scaleX",1),h.scaleY=this.getValue(e,"scaleY",1),h.rotation=this.getValue
(e,"rotation",0),h.width=e.width*o,h.height=e.height*o,null!
=(b=this.getValue(e,"color",null))&&h.color.setFromString(b),h.updateOffset(),h);ca
se"boundingbox":var c=this.attachmentLoader.newBoundingBoxAttachment(n,s);return
null==c?null:(this.readVertices(e,c,e.vertexCount<<1),null!
=(b=this.getValue(e,"color",null))&&c.color.setFromString(b),c);case"mesh":case"lin
kedmesh":l=this.getValue(e,"path",s);var
u=this.attachmentLoader.newMeshAttachment(n,s,l);if(null==u)return
null;u.path=l,null!=(b=this.getValue(e,"color",null))&&u.color.setFromString(b);var
_=this.getValue(e,"parent",null);if(null!=_)return
u.inheritDeform=this.getValue(e,"deform",!0),this.linkedMeshes.push(new
i(u,this.getValue(e,"skin",null),r,_)),u;var f=e.uvs;return
this.readVertices(e,u,f.length),u.triangles=e.triangles,u.regionUVs=f,u.updateUVs()
,u.hullLength=2*this.getValue(e,"hull",0),u;case"path":if(null==(l=this.attachmentL
oader.newPathAttachment(n,s)))return null;l.closed=this.getValue(e,"closed",!
1),l.constantSpeed=this.getValue(e,"constantSpeed",!0);var
d=e.vertexCount;this.readVertices(e,l,d<<1);for(var
m=t.Utils.newArray(d/3,0),p=0;p<e.lengths.length;p++)m[p]=e.lengths[p]*o;return
l.lengths=m,null!
=(b=this.getValue(e,"color",null))&&l.color.setFromString(b),l;case"point":var
v=this.attachmentLoader.newPointAttachment(n,s);return null==v?null:
(v.x=this.getValue(e,"x",0)*o,v.y=this.getValue(e,"y",0)*o,v.rotation=this.getValue
(e,"rotation",0),null!
=(b=this.getValue(e,"color",null))&&v.color.setFromString(b),v);case"clipping":var
y=this.attachmentLoader.newClippingAttachment(n,s);if(null==y)return null;var
g=this.getValue(e,"end",null);if(null!=g){var x=a.findSlot(g);if(null==x)throw new
Error("Clipping end slot not found: "+g);y.endSlot=x}var b;d=e.vertexCount;return
this.readVertices(e,y,d<<1),null!
=(b=this.getValue(e,"color",null))&&y.color.setFromString(b),y}return
null},e.prototype.readVertices=function(e,i,n){var
r=this.scale;i.worldVerticesLength=n;var s=e.vertices;if(n!=s.length){var a=new
Array,o=new Array;for(u=0,_=s.length;u<_;){var l=s[u++];o.push(l);for(var
h=u+4*l;u<h;u+=4)o.push(s[u]),a.push(s[u+1]*r),a.push(s[u+2]*r),a.push(s[u+3])}i.bo
nes=o,i.vertices=t.Utils.toFloatArray(a)}else{var c=t.Utils.toFloatArray(s);if(1!
=r)for(var u=0,_=s.length;u<_;u+
+)c[u]*=r;i.vertices=c}},e.prototype.readAnimation=function(e,i,n){var
r=this.scale,s=new Array,a=0;if(e.slots)for(var o in e.slots){var l=e.slots[o];if(-
1==(J=n.findSlotIndex(o)))throw new Error("Slot not found: "+o);for(var h in l){var
c=l[h];if("attachment"==h){(x=new
t.AttachmentTimeline(c.length)).slotIndex=J;for(var u=0,_=0;_<c.length;_++){var
f=c[_];x.setFrame(u+
+,f.time,f.name)}s.push(x),a=Math.max(a,x.frames[x.getFrameCount()-1])}else
if("color"==h){(x=new
t.ColorTimeline(c.length)).slotIndex=J;for(u=0,_=0;_<c.length;_++){f=c[_];var d=new
t.Color;d.setFromString(f.color),x.setFrame(u,f.time,d.r,d.g,d.b,d.a),this.readCurv
e(f,x,u),u++}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=h)throw new Error("Invalid
timeline type for a slot: "+h+" ("+o+")");(x=new
t.TwoColorTimeline(c.length)).slotIndex=J;for(u=0,_=0;_<c.length;_++){f=c[_];var
m=new t.Color,p=new
t.Color;m.setFromString(f.light),p.setFromString(f.dark),x.setFrame(u,f.time,m.r,m.
g,m.b,m.a,p.r,p.g,p.b),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.TwoColorTimeline.ENTRIES])}}}if(e.bones)for(var v in e.bones){var
y=e.bones[v],g=n.findBoneIndex(v);if(-1==g)throw new Error("Bone not found:
"+v);for(var h in y){c=y[h];if("rotate"===h){(x=new
t.RotateTimeline(c.length)).boneIndex=g;for(u=0,_=0;_<c.length;_++)
{f=c[_];x.setFrame(u,f.time,f.angle),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==h&&"scale"!==h&&"shear"!
==h)throw new Error("Invalid timeline type for a bone: "+h+" ("+v+")");var
x=null,b=1;"scale"===h?x=new t.ScaleTimeline(c.length):"shear"===h?x=new
t.ShearTimeline(c.length):(x=new
t.TranslateTimeline(c.length),b=r),x.boneIndex=g;for(u=0,_=0;_<c.length;_++)
{f=c[_];var
A=this.getValue(f,"x",0),C=this.getValue(f,"y",0);x.setFrame(u,f.time,A*b,C*b),this
.readCurve(f,x,u),u++}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.TranslateTimeline.ENTRIES])}}}if(e.ik)for(var S in e.ik){var
T=e.ik[S],w=n.findIkConstraint(S);(x=new
t.IkConstraintTimeline(T.length)).ikConstraintIndex=n.ikConstraints.indexOf(w);for(
u=0,_=0;_<T.length;_++)
{f=T[_];x.setFrame(u,f.time,this.getValue(f,"mix",1),this.getValue(f,"bendPositive"
,!0)?1:-1),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(var S in e.transform)
{T=e.transform[S],w=n.findTransformConstraint(S);(x=new
t.TransformConstraintTimeline(T.length)).transformConstraintIndex=n.transformConstr
aints.indexOf(w);for(u=0,_=0;_<T.length;_++)
{f=T[_];x.setFrame(u,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"transla
teMix",1),this.getValue(f,"scaleMix",1),this.getValue(f,"shearMix",1)),this.readCur
ve(f,x,u),u++}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.TransformConstraintTimeline.ENTRIES])}if(e.paths)for(var S in e.paths)
{T=e.paths[S];var E=n.findPathConstraintIndex(S);if(-1==E)throw new Error("Path
constraint not found: "+S);var M=n.pathConstraints[E];for(var h in T)
{c=T[h];if("position"===h||"spacing"===h){x=null,b=1;"spacing"===h?(x=new
t.PathConstraintSpacingTimeline(c.length),M.spacingMode!
=t.SpacingMode.Length&&M.spacingMode!=t.SpacingMode.Fixed||(b=r)):(x=new
t.PathConstraintPositionTimeline(c.length),M.positionMode==t.PositionMode.Fixed&&(b
=r)),x.pathConstraintIndex=E;for(u=0,_=0;_<c.length;_++)
{f=c[_];x.setFrame(u,f.time,this.getValue(f,h,0)*b),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===h){(x=new
t.PathConstraintMixTimeline(c.length)).pathConstraintIndex=E;for(u=0,_=0;_<c.length
;_++)
{f=c[_];x.setFrame(u,f.time,this.getValue(f,"rotateMix",1),this.getValue(f,"transla
teMix",1)),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[(x.getFrameCount()-
1)*t.PathConstraintMixTimeline.ENTRIES])}}}if(e.deform)for(var D in e.deform){var
B=e.deform[D],P=n.findSkin(D);if(null==P)throw new Error("Skin not found:
"+D);for(var o in B){l=B[o];if(-1==(J=n.findSlotIndex(o)))throw new Error("Slot not
found: "+l.name);for(var h in l){c=l[h];var I=P.getAttachment(J,h);if(null==I)throw
new Error("Deform attachment not found: "+c.name);var R=null!
=I.bones,O=I.vertices,L=R?O.length/3*2:O.length;(x=new
t.DeformTimeline(c.length)).slotIndex=J,x.attachment=I;u=0;for(var
F=0;F<c.length;F++){f=c[F];var V=void
0,N=this.getValue(f,"vertices",null);if(null==N)V=R?
t.Utils.newFloatArray(L):O;else{V=t.Utils.newFloatArray(L);var
k=this.getValue(f,"offset",0);if(t.Utils.arrayCopy(N,0,V,k,N.length),1!=r)for(var
G=(_=k)+N.length;_<G;_++)V[_]*=r;if(!R)for(_=0;_<L;_++)V[_]
+=O[_]}x.setFrame(u,f.time,V),this.readCurve(f,x,u),u+
+}s.push(x),a=Math.max(a,x.frames[x.getFrameCount()-1])}}}var
z=e.drawOrder;if(null==z&&(z=e.draworder),null!=z){x=new
t.DrawOrderTimeline(z.length);var U=n.slots.length;for(u=0,F=0;F<z.length;F++){var
j=z[F],W=null,H=this.getValue(j,"offsets",null);if(null!=H){W=t.Utils.newArray(U,-
1);var X=t.Utils.newArray(U-H.length,0),q=0,Y=0;for(_=0;_<H.length;_++){var
J,Z=H[_];if(-1==(J=n.findSlotIndex(Z.slot)))throw new Error("Slot not found:
"+Z.slot);for(;q!=J;)X[Y++]=q++;W[q+Z.offset]=q++}for(;q<U;)X[Y++]=q++;for(_=U-
1;_>=0;_--)-1==W[_]&&(W[_]=X[--Y])}x.setFrame(u+
+,j.time,W)}s.push(x),a=Math.max(a,x.frames[x.getFrameCount()-1])}if(e.events)
{for(x=new t.EventTimeline(e.events.length),u=0,_=0;_<e.events.length;_++){var
K=e.events[_],Q=n.findEvent(K.name);if(null==Q)throw new Error("Event not found:
"+K.name);var $=new t.Event(t.Utils.toSinglePrecision(K.time),Q);
$.intValue=this.getValue(K,"int",Q.intValue),
$.floatValue=this.getValue(K,"float",Q.floatValue),
$.stringValue=this.getValue(K,"string",Q.stringValue),x.setFrame(u++,
$)}s.push(x),a=Math.max(a,x.frames[x.getFrameCount()-1])}if(isNaN(a))throw new
Error("Error while parsing animation, duration is NaN");n.animations.push(new
t.Animation(i,s,a))},e.prototype.readCurve=function(t,e,i)
{if(t.curve)if("stepped"===t.curve)e.setStepped(i);else if("[object
Array]"===Object.prototype.toString.call(t.curve)){var
n=t.curve;e.setCurve(i,n[0],n[1],n[2],n[3])}},e.prototype.getValue=function(t,e,i)
{return void 0!==t[e]?t[e]:i},e.blendModeFromString=function(e)
{if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return
t.BlendMode.Additive;if("multiply"==e)return
t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new
Error("Unknown blend mode: "+e)},e.positionModeFromString=function(e)
{if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return
t.PositionMode.Percent;throw new Error("Unknown position mode:
"+e)},e.spacingModeFromString=function(e){if("length"==(e=e.toLowerCase()))return
t.SpacingMode.Length;if("fixed"==e)return
t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new
Error("Unknown position mode: "+e)},e.rotateModeFromString=function(e)
{if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return
t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new
Error("Unknown rotate mode: "+e)},e.transformModeFromString=function(e)
{if("normal"==(e=e.toLowerCase()))return
t.TransformMode.Normal;if("onlytranslation"==e)return
t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return
t.TransformMode.NoRotationOrReflection;if("noscale"==e)return
t.TransformMode.NoScale;if("noscaleorreflection"==e)return
t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode:
"+e)},e})();t.SkeletonJson=e;var i=(function(){return function(t,e,i,n)
{this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n}})()})(n||(n={})),
(function(t){var e=(function(){function t(t){if(this.attachments=new
Array,null==t)throw new Error("name cannot be null.");this.name=t}return
t.prototype.addAttachment=function(t,e,i){if(null==i)throw new Error("attachment
cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||
(n[t]={}),n[t][e]=i},t.prototype.getAttachment=function(t,e){var
i=this.attachments[t];return i?i[e]:null},t.prototype.attachAll=function(t,e)
{for(var i=0,n=0;n<t.slots.length;n++){var
r=t.slots[n],s=r.getAttachment();if(s&&i<e.attachments.length){var
a=e.attachments[i];for(var o in a){if(s==a[o]){var l=this.getAttachment(i,o);null!
=l&&r.setAttachment(l);break}}}i++}},t})();t.Skin=e})(n||(n={})),(function(t){var
e=(function(){function e(e,i){if(this.attachmentVertices=new Array,null==e)throw
new Error("data cannot be null.");if(null==i)throw new Error("bone cannot be
null.");this.data=e,this.bone=i,this.color=new
t.Color,this.darkColor=null==e.darkColor?null:new
t.Color,this.setToSetupPose()}return e.prototype.getAttachment=function(){return
this.attachment},e.prototype.setAttachment=function(t){this.attachment!
=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.attachmentV
ertices.length=0)},e.prototype.setAttachmentTime=function(t)
{this.attachmentTime=this.bone.skeleton.time-
t},e.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-
this.attachmentTime},e.prototype.setToSetupPose=function()
{this.color.setFromColor(this.data.color),null!
=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.a
ttachmentName?this.attachment=null:
(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data
.index,this.data.attachmentName)))},e})();t.Slot=e})(n||(n={})),(function(t){var
e=(function(){return function(e,i,n){if(this.color=new t.Color(1,1,1,1),e<0)throw
new Error("index must be >= 0.");if(null==i)throw new Error("name cannot be
null.");if(null==n)throw new Error("boneData cannot be
null.");this.index=e,this.name=i,this.boneData=n}})();t.SlotData=e})(n||(n={})),
(function(t){var e,i,n=(function(){function t(t){this._image=t}return
t.prototype.getImage=function(){return this._image},t.filterFromString=function(t)
{switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return
e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return
e.MipMapNearestNearest;case"mipmaplinearnearest":return
e.MipMapLinearNearest;case"mipmapnearestlinear":return
e.MipMapNearestLinear;case"mipmaplinearlinear":return
e.MipMapLinearLinear;default:throw new Error("Unknown texture filter
"+t)}},t.wrapFromString=function(t){switch(t.toLowerCase())
{case"mirroredtepeat":return i.MirroredRepeat;case"clamptoedge":return
i.ClampToEdge;case"repeat":return i.Repeat;default:throw new Error("Unknown texture
wrap "+t)}},t})();t.Texture=n,(function(t)
{t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[
t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="
MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMap
LinearLinear=9987]="MipMapLinearLinear"})(e=t.TextureFilter||(t.TextureFilter={})),
(function(t)
{t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[
t.Repeat=10497]="Repeat"})(i=t.TextureWrap||(t.TextureWrap={}));var s=(function()
{return function()
{this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!
1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}})
();t.TextureRegion=s;var a=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return
r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e)
{},e.prototype.dispose=function(){},e})(t.Texture);t.FakeTexture=a})(n||(n={})),
(function(t){var e=(function(){function e(t,e){this.pages=new
Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r)
{if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new
i(e),o=new Array(4),l=null;;){var
h=a.readLine();if(null==h)break;if(0==(h=h.trim()).length)l=null;else if(l){var
c=new s;c.name=h,c.page=l,c.rotate="true"==a.readValue(),a.readTuple(o);var
u=parseInt(o[0]),_=parseInt(o[1]);a.readTuple(o);var
f=parseInt(o[0]),d=parseInt(o[1]);c.u=u/l.width,c.v=_/l.height,c.rotate?
(c.u2=(u+d)/l.width,c.v2=(_+f)/l.height):
(c.u2=(u+f)/l.width,c.v2=(_+d)/l.height),c.x=u,c.y=_,c.width=Math.abs(f),c.height=M
ath.abs(d),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),c.originalWidth=par
seInt(o[0]),c.originalHeight=parseInt(o[1]),a.readTuple(o),c.offsetX=parseInt(o[0])
,c.offsetY=parseInt(o[1]),c.index=parseInt(a.readValue()),c.texture=l.texture,this.
regions.push(c)}else{(l=new
n).name=h,2==a.readTuple(o)&&(l.width=parseInt(o[0]),l.height=parseInt(o[1]),a.read
Tuple(o)),a.readTuple(o),l.minFilter=t.Texture.filterFromString(o[0]),l.magFilter=t
.Texture.filterFromString(o[1]);var
m=a.readValue();l.uWrap=t.TextureWrap.ClampToEdge,l.vWrap=t.TextureWrap.ClampToEdge
,"x"==m?l.uWrap=t.TextureWrap.Repeat:"y"==m?
l.vWrap=t.TextureWrap.Repeat:"xy"==m&&(l.uWrap=l.vWrap=t.TextureWrap.Repeat),l.text
ure=r(h),l.texture.setFilters(l.minFilter,l.magFilter),l.texture.setWraps(l.uWrap,l
.vWrap),l.width=l.texture.getImage().width,l.height=l.texture.getImage().height,thi
s.pages.push(l)}}},e.prototype.findRegion=function(t){for(var
e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return
this.regions[e];return null},e.prototype.dispose=function(){for(var
t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},e})
();t.TextureAtlas=e;var i=(function(){function t(t)
{this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return
t.prototype.readLine=function(){return this.index>=this.lines.length?
null:this.lines[this.index++]},t.prototype.readValue=function(){var
t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line:
"+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var
e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line:
"+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-
1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return
t[n]=e.substring(r).trim(),n+1},t})(),n=(function(){return function(){}})
();t.TextureAtlasPage=n;var s=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return r(e,t),e})
(t.TextureRegion);t.TextureAtlasRegion=s})(n||(n={})),(function(t){var
e=(function(){function e(e,i)
{if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=
new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==i)throw new
Error("skeleton cannot be
null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,thi
s.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var
n=0;n<e.bones.length;n+
+)this.bones.push(i.findBone(e.bones[n].name));this.target=i.findBone(e.target.name
)}return e.prototype.apply=function(){this.update()},e.prototype.update=function()
{this.data.local?this.data.relative?
this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?
this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld
=function(){for(var
e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,
a=s.a,o=s.b,l=s.c,h=s.d,c=a*h-o*l>0?t.MathUtils.degRad:-
t.MathUtils.degRad,u=this.data.offsetRotation*c,_=this.data.offsetShearY*c,f=this.b
ones,d=0,m=f.length;d<m;d++){var p=f[d],v=!1;if(0!=e){var y=p.a,g=p.b,x=p.c,b=p.d;
(E=Math.atan2(l,a)-Math.atan2(x,y)+u)>t.MathUtils.PI?E-=t.MathUtils.PI2:E<-
t.MathUtils.PI&&(E+=t.MathUtils.PI2),E*=e;var A=Math.cos(E),C=Math.sin(E);p.a=A*y-
C*x,p.b=A*g-C*b,p.c=C*y+A*x,p.d=C*g+A*b,v=!0}if(0!=i){var
S=this.temp;s.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),p.worldX+=(S
.x-p.worldX)*i,p.worldY+=(S.y-p.worldY)*i,v=!0}if(n>0){var
T=Math.sqrt(p.a*p.a+p.c*p.c),w=Math.sqrt(a*a+l*l);T>1e-5&&(T=(T+(w-
T+this.data.offsetScaleX)*n)/T),p.a*=T,p.c*=T,T=Math.sqrt(p.b*p.b+p.d*p.d),w=Math.s
qrt(o*o+h*h),T>1e-5&&(T=(T+(w-T+this.data.offsetScaleY)*n)/T),p.b*=T,p.d*=T,v=!
0}if(r>0){g=p.b,b=p.d;var E,M=Math.atan2(b,g);(E=Math.atan2(h,o)-Math.atan2(l,a)-
(M-Math.atan2(p.c,p.a)))>t.MathUtils.PI?E-=t.MathUtils.PI2:E<-
t.MathUtils.PI&&(E+=t.MathUtils.PI2),E=M+
(E+_)*r;T=Math.sqrt(g*g+b*b);p.b=Math.cos(E)*T,p.d=Math.sin(E)*T,v=!
0}v&&(p.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var
e=this.rotateMix,i=this.translateMix,n=this.scaleMix,r=this.shearMix,s=this.target,
a=s.a,o=s.b,l=s.c,h=s.d,c=a*h-o*l>0?t.MathUtils.degRad:-
t.MathUtils.degRad,u=this.data.offsetRotation*c,_=this.data.offsetShearY*c,f=this.b
ones,d=0,m=f.length;d<m;d++){var p=f[d],v=!1;if(0!=e){var y=p.a,g=p.b,x=p.c,b=p.d;
(w=Math.atan2(l,a)+u)>t.MathUtils.PI?w-=t.MathUtils.PI2:w<-
t.MathUtils.PI&&(w+=t.MathUtils.PI2),w*=e;var A=Math.cos(w),C=Math.sin(w);p.a=A*y-
C*x,p.b=A*g-C*b,p.c=C*y+A*x,p.d=C*g+A*b,v=!0}if(0!=i){var
S=this.temp;s.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),p.worldX+=S.
x*i,p.worldY+=S.y*i,v=!0}if(n>0){var
T=(Math.sqrt(a*a+l*l)-
1+this.data.offsetScaleX)*n+1;p.a*=T,p.c*=T,T=(Math.sqrt(o*o+h*h)-
1+this.data.offsetScaleY)*n+1,p.b*=T,p.d*=T,v=!0}if(r>0){var w;(w=Math.atan2(h,o)-
Math.atan2(l,a))>t.MathUtils.PI?w-=t.MathUtils.PI2:w<-
t.MathUtils.PI&&(w+=t.MathUtils.PI2);g=p.b,b=p.d;w=Math.atan2(b,g)+(w-
t.MathUtils.PI/2+_)*r;T=Math.sqrt(g*g+b*b);p.b=Math.cos(w)*T,p.d=Math.sin(w)*T,v=!
0}v&&(p.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var
t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;
r.appliedValid||r.updateAppliedTransform();for(var
s=this.bones,a=0,o=s.length;a<o;a++){var l=s[a];l.appliedValid||
l.updateAppliedTransform();var h=l.arotation;if(0!=t){var c=r.arotation-
h+this.data.offsetRotation;h+=(c-=360*(16384-(16384.499999999996-c/360|0)))*t}var
u=l.ax,_=l.ay;0!=e&&(u+=(r.ax-u+this.data.offsetX)*e,_+=(r.ay-
_+this.data.offsetY)*e);var f=l.ascaleX,d=l.ascaleY;i>0&&(f>1e-5&&(f=(f+(r.ascaleX-
f+this.data.offsetScaleX)*i)/f),d>1e-5&&(d=(d+(r.ascaleY-
d+this.data.offsetScaleY)*i)/d));var m=l.ashearY;if(n>0){c=r.ashearY-
m+this.data.offsetShearY;c-=360*(16384-(16384.499999999996-c/360|
0)),l.shearY+=c*n}l.updateWorldTransformWith(u,_,h,f,d,l.ashearX,m)}},e.prototype.a
pplyRelativeLocal=function(){var
t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;
r.appliedValid||r.updateAppliedTransform();for(var
s=this.bones,a=0,o=s.length;a<o;a++){var l=s[a];l.appliedValid||
l.updateAppliedTransform();var h=l.arotation;0!
=t&&(h+=(r.arotation+this.data.offsetRotation)*t);var c=l.ax,u=l.ay;0!
=e&&(c+=(r.ax+this.data.offsetX)*e,u+=(r.ay+this.data.offsetY)*e);var
_=l.ascaleX,f=l.ascaleY;i>0&&(_>1e-5&&(_*=(r.ascaleX-
1+this.data.offsetScaleX)*i+1),f>1e-5&&(f*=(r.ascaleY-
1+this.data.offsetScaleY)*i+1));var
d=l.ashearY;n>0&&(d+=(r.ashearY+this.data.offsetShearY)*n),l.updateWorldTransformWi
th(c,u,h,_,f,l.ashearX,d)}},e.prototype.getOrder=function(){return
this.data.order},e})();t.TransformConstraint=e})(n||(n={})),(function(t){var
e=(function(){return function(t){if(this.order=0,this.bones=new
Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.off
setRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0
,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name
cannot be null.");this.name=t}})();t.TransformConstraintData=e})(n||(n={})),
(function(t){var e=(function(){function e(){this.convexPolygons=new
Array,this.convexPolygonsIndices=new Array,this.indicesArray=new
Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new
t.Pool(function(){return new Array}),this.polygonIndicesPool=new t.Pool(function()
{return new Array})}return e.prototype.triangulate=function(t){var
i=t,n=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s<n;s++)r[s]=s;var
a=this.isConcaveArray;a.length=0;s=0;for(var o=n;s<o;+
+s)a[s]=e.isConcave(s,n,i,r);var l=this.triangles;for(l.length=0;n>3;){for(var h=n-
1,c=(s=0,1);;){t:if(!a[s]){for(var
u=r[h]<<1,_=r[s]<<1,f=r[c]<<1,d=i[u],m=i[u+1],p=i[_],v=i[_+1],y=i[f],g=i[f+1],x=(c+
1)%n;x!=h;x=(x+1)%n)if(a[x]){var
b=r[x]<<1,A=i[b],C=i[b+1];if(e.positiveArea(y,g,d,m,A,C)&&e.positiveArea(d,m,p,v,A,
C)&&e.positiveArea(p,v,y,g,A,C))break t}break}if(0==c){do{if(!
a[s])break;s--}while(s>0);break}h=s,s=c,c=(c+1)%n}l.push(r[(n+s-
1)%n]),l.push(r[s]),l.push(r[(s+1)%n]),r.splice(s,1),a.splice(s,1);var S=(--n+s-
1)%n,T=s==n?0:s;a[S]=e.isConcave(S,n,i,r),a[T]=e.isConcave(T,n,i,r)}return
3==n&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l},e.prototype.decompose=function(t,
i){var n=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var
s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var
a=this.polygonIndicesPool.obtain();a.length=0;var
o=this.polygonPool.obtain();o.length=0;for(var l=-1,h=0,c=0,u=i.length;c<u;c+=3)
{var
_=i[c]<<1,f=i[c+1]<<1,d=i[c+2]<<1,m=n[_],p=n[_+1],v=n[f],y=n[f+1],g=n[d],x=n[d+1],b
=!1;if(l==_){var A=o.length-
4,C=e.winding(o[A],o[A+1],o[A+2],o[A+3],g,x),S=e.winding(g,x,o[0],o[1],o[2],o[3]);C
==h&&S==h&&(o.push(g),o.push(x),a.push(d),b=!0)}b||(o.length>0?
(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),
(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(v),o.push(y),o.pu
sh(g),o.push(x),
(a=this.polygonIndicesPool.obtain()).length=0,a.push(_),a.push(f),a.push(d),h=e.win
ding(m,p,v,y,g,x),l=_)}o.length>0&&(r.push(o),s.push(a));for(c=0,u=r.length;c<u;c+
+)if(0!=(a=s[c]).length)for(var T=a[0],w=a[a.length-1],E=(o=r[c])[A=o.length-
4],M=o[A+1],D=o[A+2],B=o[A+3],P=o[0],I=o[1],R=o[2],O=o[3],L=e.winding(E,M,D,B,P,I),
F=0;F<u;F++)if(F!=c){var V=s[F];if(3==V.length){var
N=V[0],k=V[1],G=V[2],z=r[F];g=z[z.length-2],x=z[z.length-1];if(N==T&&k==w)
{C=e.winding(E,M,D,B,g,x),S=e.winding(g,x,P,I,R,O);C==L&&S==L&&(z.length=0,V.length
=0,o.push(g),o.push(x),a.push(G),E=D,M=B,D=g,B=x,F=0)}}}for(c=r.length-
1;c>=0;c--)0==(o=r[c]).length&&(r.splice(c,1),this.polygonPool.free(o),a=s[c],s.spl
ice(c,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,i,n)
{var r=n[(e+t-1)%e]<<1,s=n[t]<<1,a=n[(t+1)%e]<<1;return!
this.positiveArea(i[r],i[r+1],i[s],i[s+1],i[a],i[a+1])},e.positiveArea=function(t,e
,i,n,r,s){return t*(s-n)+i*(e-s)+r*(n-e)>=0},e.winding=function(t,e,i,n,r,s){var
a=i-t,o=n-e;return r*o-s*a+a*e-t*o>=0?1:-1},e})();t.Triangulator=e})(n||(n={})),
(function(t){var e=(function(){function t(){this.array=new Array}return
t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!
e},t.prototype.contains=function(t){return void 0!=this.array[0|
t]},t.prototype.remove=function(t){this.array[0|t]=void
0},t.prototype.clear=function(){this.array.length=0},t})();t.IntSet=e;var
i=(function(){function t(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void
0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}return
t.prototype.set=function(t,e,i,n){return
this.r=t,this.g=e,this.b=i,this.a=n,this.clamp(),this},t.prototype.setFromColor=fun
ction(t){return
this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=functio
n(t){return t="#"==t.charAt(0)?
t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),1
6)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?
255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,i,n){return
this.r+=t,this.g+=e,this.b+=i,this.a+=n,this.clamp(),this},t.prototype.clamp=functi
on(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?
this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?
this.a=0:this.a>1&&(this.a=1),this},t.WHITE=new t(1,1,1,1),t.RED=new
t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new
t(1,0,1,1),t})();t.Color=i;var n=(function(){function t(){}return
t.clamp=function(t,e,i){return t<e?e:t>i?i:t},t.cosDeg=function(e){return
Math.cos(e*t.degRad)},t.sinDeg=function(e){return
Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-
1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t)
{var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,i)
{return
t.randomTriangularWith(e,i,.5*(e+i))},t.randomTriangularWith=function(t,e,i){var
n=Math.random(),r=e-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):e-Math.sqrt((1-
n)*r*(e-
i))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDe
grees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t})
();t.MathUtils=n;var s=(function(){function t(){}return
t.prototype.apply=function(t,e,i){return t+(e-t)*this.applyInternal(i)},t})
();t.Interpolation=s;var a=(function(t){function e(e){var i=t.call(this)||
this;return i.power=2,i.power=e,i}return
r(e,t),e.prototype.applyInternal=function(t){return t<=.5?
Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-
2:2)+1},e})(s);t.Pow=a;var o=(function(t){function e(e){return t.call(this,e)||
this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-
1,this.power)*(this.power%2==0?-1:1)+1},e})(a);t.PowOut=o;var l=(function()
{function t(){}return t.arrayCopy=function(t,e,i,n,r){for(var s=e,a=n;s<e+r;s++,a+
+)i[a]=t[s]},t.setArraySize=function(t,e,i){void 0===i&&(i=0);var
n=t.length;if(n==e)return t;if(t.length=e,n<e)for(var r=n;r<e;r++)t[r]=i;return
t},t.ensureArrayCapacity=function(e,i,n){return void 0===n&&(n=0),e.length>=i?
e:t.setArraySize(e,i,n)},t.newArray=function(t,e){for(var i=new Array(t),n=0;n<t;n+
+)i[n]=e;return i},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return
new Float32Array(e);for(var i=new Array(e),n=0;n<i.length;n++)i[n]=0;return
i},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new
Int16Array(e);for(var i=new Array(e),n=0;n<i.length;n++)i[n]=0;return
i},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new
Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?
Math.fround(e):e},t.webkit602BugfixHelper=function(t,e)
{},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t})();t.Utils=l;var
h=(function(){function t(){}return t.logBones=function(t){for(var
e=0;e<t.bones.length;e++){var i=t.bones[e];console.log(i.data.name+", "+i.a+",
"+i.b+", "+i.c+", "+i.d+", "+i.worldX+", "+i.worldY)}},t})();t.DebugUtils=h;var
c=(function(){function t(t){this.items=new Array,this.instantiator=t}return
t.prototype.obtain=function(){return this.items.length>0?
this.items.pop():this.instantiator()},t.prototype.free=function(t)
{t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var
e=0;e<t.length;e+
+)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function()
{this.items.length=0},t})();t.Pool=c;var u=(function(){function t(t,e){void
0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return
t.prototype.set=function(t,e){return
this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return
Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var
t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t})();t.Vector2=u;var
_=(function(){function t()
{this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastT
ime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return
t.prototype.update=function(){var t=Date.now()/1e3;this.delta=t-
this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this
.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount+
+,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frame
Time=0,this.frameCount=0)},t})();t.TimeKeeper=_;var f=(function(){function t(t)
{void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!
0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return
this.addedValues>=this.values.length},t.prototype.addValue=function(t)
{this.addedValues<this.values.length&&this.addedValues+
+,this.values[this.lastValue++]=t,this.lastValue>this.values.length-
1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function()
{if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e<this.values.length;e+
+)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return
this.mean}return 0},t})();t.WindowedMean=f})(n||(n={})),Math.fround||
(Math.fround=(function(t){return function(e){return t[0]=e,t[0]}})(new
Float32Array(1))),(function(t){var e=(function(){return function(t)
{if(null==t)throw new Error("name cannot be null.");this.name=t}})
();t.Attachment=e;var i=(function(t){function e(i){var n=t.call(this,i)||
this;return n.id=(65535&e.nextID++)<<11,n.worldVerticesLength=0,n}return
r(e,t),e.prototype.computeWorldVertices=function(t,e,i,n,r,s){i=r+(i>>1)*s;var
a=t.bone.skeleton,o=t.attachmentVertices,l=this.vertices,h=this.bones;if(null!=h)
{for(var c=0,u=0,_=0;_<e;_+=2){c+=(p=h[c])+1,u+=p}var
f=a.bones;if(0==o.length)for(M=r,S=3*u;M<i;M+=s){var d=0,m=0,p=h[c+
+];for(p+=c;c<p;c++,S+=3){x=f[h[c]],D=l[S],B=l[S+1];var
v=l[S+2];d+=(D*x.a+B*x.b+x.worldX)*v,m+=(D*x.c+B*x.d+x.worldY)*v}n[M]=d,n[M+1]=m}el
se for(var y=o,g=(M=r,S=3*u,u<<1);M<i;M+=s){d=0,m=0,p=h[c++];for(p+=c;c<p;c+
+,S+=3,g+=2){x=f[h[c]],D=l[S]
+y[g],B=l[S+1]+y[g+1],v=l[S+2];d+=(D*x.a+B*x.b+x.worldX)*v,m+=(D*x.c+B*x.d+x.worldY
)*v}n[M]=d,n[M+1]=m}}else{o.length>0&&(l=o);for(var
x,b=(x=t.bone).worldX,A=x.worldY,C=x.a,S=x.b,T=x.c,w=x.d,E=e,M=r;M<i;E+=2,M+=s){var
D=l[E],B=l[E+1];n[M]=D*C+B*S+b,n[M+1]=D*T+B*w+A}}},e.prototype.applyDeform=function
(t){return this==t},e.nextID=0,e})(e);t.VertexAttachment=i})(n||(n={})),
(function(t){(function(t)
{t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.Lin
kedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point"})
(t.AttachmentType||(t.AttachmentType={}))})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new
t.Color(1,1,1,1),n}return r(i,e),i})
(t.VertexAttachment);t.BoundingBoxAttachment=e})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new
t.Color(.2275,.2275,.8078,1),n}return r(i,e),i})
(t.VertexAttachment);t.ClippingAttachment=e})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new
t.Color(1,1,1,1),n.inheritDeform=!1,n.tempColor=new t.Color(0,0,0,0),n}return
r(i,e),i.prototype.updateUVs=function(){var e=0,i=0,n=0,r=0;null==this.region?
(e=i=0,n=r=1):(e=this.region.u,i=this.region.v,n=this.region.u2-e,r=this.region.v2-
i);var s=this.regionUVs;null!=this.uvs&&this.uvs.length==s.length||
(this.uvs=t.Utils.newFloatArray(s.length));var
a=this.uvs;if(this.region.rotate)for(var
o=0,l=a.length;o<l;o+=2)a[o]=e+s[o+1]*n,a[o+1]=i+r-s[o]*r;else
for(o=0,l=a.length;o<l;o+=2)a[o]=e+s[o]*n,a[o+1]=i+s[o+1]*r},i.prototype.applyDefor
m=function(t){return this==t||
this.inheritDeform&&this.parentMesh==t},i.prototype.getParentMesh=function(){return
this.parentMesh},i.prototype.setParentMesh=function(t){this.parentMesh=t,null!
=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVe
rticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=
t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},i})
(t.VertexAttachment);t.MeshAttachment=e})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return n.closed=!
1,n.constantSpeed=!1,n.color=new t.Color(1,1,1,1),n}return r(i,e),i})
(t.VertexAttachment);t.PathAttachment=e})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return n.color=new
t.Color(.38,.94,0,1),n}return r(i,e),i.prototype.computeWorldPosition=function(t,e)
{return
e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e},i.prototyp
e.computeWorldRotation=function(e){var
i=t.MathUtils.cosDeg(this.rotation),n=t.MathUtils.sinDeg(this.rotation),r=i*e.a+n*e
.b,s=i*e.c+n*e.d;return Math.atan2(s,r)*t.MathUtils.radDeg},i})
(t.VertexAttachment);t.PointAttachment=e})(n||(n={})),(function(t){var
e=(function(e){function i(i){var n=e.call(this,i)||this;return
n.x=0,n.y=0,n.scaleX=1,n.scaleY=1,n.rotation=0,n.width=0,n.height=0,n.color=new
t.Color(1,1,1,1),n.offset=t.Utils.newFloatArray(8),n.uvs=t.Utils.newFloatArray(8),n
.tempColor=new t.Color(1,1,1,1),n}return r(i,e),i.prototype.updateOffset=function()
{var
t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.origin
alHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*t,r=-
this.height/2*this.scaleY+this.region.offsetY*e,s=n+this.region.width*t,a=r+this.re
gion.height*e,o=this.rotation*Math.PI/180,l=Math.cos(o),h=Math.sin(o),c=n*l+this.x,
u=n*h,_=r*l+this.y,f=r*h,d=s*l+this.x,m=s*h,p=a*l+this.y,v=a*h,y=this.offset;y[i.OX
1]=c-f,y[i.OY1]=_+u,y[i.OX2]=c-v,y[i.OY2]=p+u,y[i.OX3]=d-v,y[i.OY3]=p+m,y[i.OX4]=d-
f,y[i.OY4]=_+m},i.prototype.setRegion=function(t){this.region=t;var
e=this.uvs;t.rotate?
(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):
(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},i.pr
ototype.computeWorldVertices=function(t,e,n,r){var
s=this.offset,a=t.worldX,o=t.worldY,l=t.a,h=t.b,c=t.c,u=t.d,_=0,f=0;_=s[i.OX1],f=s[
i.OY1],e[n]=_*l+f*h+a,e[n+1]=_*c+f*u+o,n+=r,_=s[i.OX2],f=s[i.OY2],e[n]=_*l+f*h+a,e[
n+1]=_*c+f*u+o,n+=r,_=s[i.OX3],f=s[i.OY3],e[n]=_*l+f*h+a,e[n+1]=_*c+f*u+o,n+=r,_=s[
i.OX4],f=s[i.OY4],e[n]=_*l+f*h+a,e[n+1]=_*c+f*u+o},i.OX1=0,i.OY1=1,i.OX2=2,i.OY2=3,
i.OX3=4,i.OY3=5,i.OX4=6,i.OY4=7,i.X1=0,i.Y1=1,i.C1R=2,i.C1G=3,i.C1B=4,i.C1A=5,i.U1=
6,i.V1=7,i.X2=8,i.Y2=9,i.C2R=10,i.C2G=11,i.C2B=12,i.C2A=13,i.U2=14,i.V2=15,i.X3=16,
i.Y3=17,i.C3R=18,i.C3G=19,i.C3B=20,i.C3A=21,i.U3=22,i.V3=23,i.X4=24,i.Y4=25,i.C4R=2
6,i.C4G=27,i.C4B=28,i.C4A=29,i.U4=30,i.V4=31,i})
(t.Attachment);t.RegionAttachment=e})(n||(n={})),(function(t){var e=(function()
{function e(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}return
e.prototype.begin=function(t){},e.prototype.transform=function(e,i,n,r)
{e.x+=t.MathUtils.randomTriangular(-
this.jitterX,this.jitterY),e.y+=t.MathUtils.randomTriangular(-
this.jitterX,this.jitterY)},e.prototype.end=function(){},e})();t.JitterEffect=e})
(n||(n={})),(function(t){var e=(function(){function e(t)
{this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY
=0,this.radius=t}return e.prototype.begin=function(t)
{this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},e.prototype.transform=f
unction(i,n,r,s){var a=this.angle*t.MathUtils.degreesToRadians,o=i.x-
this.worldX,l=i.y-this.worldY,h=Math.sqrt(o*o+l*l);if(h<this.radius){var
c=e.interpolation.apply(0,a,(this.radius-
h)/this.radius),u=Math.cos(c),_=Math.sin(c);i.x=u*o-
_*l+this.worldX,i.y=_*o+u*l+this.worldY}},e.prototype.end=function()
{},e.interpolation=new t.PowOut(2),e})();t.SwirlEffect=e})(n||
(n={})),e.exports=n}),{}],403:[(function(t,e,i){"use strict";var n=t("./track-
entry-
listeners"),r=t("./lib/spine"),s=[],a=[],o=0,l=0,h=null,c=null,u=0,_=0,f=0,d=0,m=nu
ll,p=null,v=0,y=0,g=void 0,x=void 0,b=void 0,A=void 0,C=void 0,S=void 0,T=new
r.Color(1,1,1,1),w=new r.Color(1,1,1,1),E=[0,1,2,2,3,0],M=cc.Class({ctor:function()
{this.frames=[],this.totalTime=0,this._isCompleted=!
1,this._animationName=null,this._tempSegments=null,this._tempColors=null},init:func
tion(t){this._animationName=t},clear:function(){for(var
t=0,e=this.frames.length;t<e;t++)
{this.frames[t].segments.length=0}},bind:function(t){var e=function(t)
{t&&t.animation.name===this._animationName&&(this._isCompleted=!
0)}.bind(this);t.end=e,t.complete=e,t.dispose=e},unbind:function(t)
{t.end=null,t.complete=null,t.dispose=null},update:function(t)
{if(this._animationName){var
e=t.skeleton,i=t.clipper,n=t.listener,r=t.state,s=e.data.findAnimation(this._animat
ionName);r.setAnimationWith(0,s,!1),this.bind(n);var a=0;this._isCompleted=!
1,this.totalTime=0;do{e.update(1/60),r.update(1/60),r.apply(e),e.updateWorldTransfo
rm(),this._updateFrame(e,i,a),a++,this.totalTime+=1/60}while(!
this._isCompleted&&this.totalTime<30);this.frames.length=a,this.unbind(n)}else
cc.error("AnimationCache:update animationName is
empty")},_updateFrame:function(t,e,i)
{l=0,o=0,0,h=null,c=null,u=0,_=0,f=0,d=0,m=null,p=null,this.frames[i]=this.frames[i
]||{segments:[],colors:[],vertices:null,uintVert:null,indices:null};var
n=this.frames[i],r=this._tempSegments=n.segments,v=this._tempColors=n.colors;this._
traverseSkeleton(t,e),d>0&&(v[d-1].vfOffset=l),v.length=d;var y=f-1;if(y>=0)if(_>0)
{var g=r[y];g.indexCount=_,g.vfCount=6*u,g.vertexCount=u,r.length=f}else
r.length=f-1;if(0!=r.length){for(var x=n.vertices||new
Float32Array(l),b=n.uintVert||new Uint32Array(x.buffer),A=0,C=0;A<l;)x[A++]=s[C+
+],x[A++]=s[C++],x[A++]=s[C++],x[A++]=s[C++],b[A++]=s[C++],b[A++]=s[C++];for(var
S=n.indices||new Uint16Array(o),T=0;T<o;T+
+)S[T]=a[T];n.vertices=x,n.uintVert=b,n.indices=S}},fillVertices:function(t,e,i,n,r
)
{if(A=i.a*e.a*t.a*255,g=e.r*t.r*255,x=e.g*t.g*255,b=e.b*t.b*255,T.r=g*i.r,T.g=x*i.g
,T.b=b*i.b,T.a=A,null==r.darkColor?w.set(0,0,0,1):
(w.r=r.darkColor.r*g,w.g=r.darkColor.g*x,w.b=r.darkColor.b*b
),w.a=0,C=(T.a<<24>>>0)+(T.b<<16)+(T.g<<8)+T.r,S=(w.a<<24>>>0)+(w.b<<16)+
(w.g<<8)+w.r,m!==C||p!==S){var h=this._tempColors;m=C,p=S,d>0&&(h[d-
1].vfOffset=l),h[d+
+]={fr:T.r,fg:T.g,fb:T.b,fa:T.a,dr:w.r,dg:w.g,db:w.b,da:w.a,vfOffset:0}}if(n.isClip
ping()){n.clipTriangles(s,v,a,y,s,T,w,!0,6,o,l,l+2);var
c=n.clippedVertices,u=n.clippedTriangles;y=u.length,v=c.length/12*6;for(var
_=0,f=o,E=u.length;_<E;)a[f++]=u[_++];for(var
M=0,D=c.length,B=l;M<D;M+=12,B+=6)s[B]=c[M],s[B+1]=c[M+1],s[B+2]=c[M+6],s[B+3]=c[M+
7],s[B+4]=C,s[B+5]=S}else for(var
P=l,I=l+v;P<I;P+=6)s[P+4]=C,s[P+5]=S},_traverseSkeleton:function(t,e){for(var
i=this._tempSegments,n=t.color,d=void 0,m=void 0,p=void 0,g=void 0,x=void 0,b=void
0,A=void 0,C=void 0,S=void 0,T=void 0,w=void 0,M=void
0,D=0,B=t.drawOrder.length;D<B;D+
+)if(M=t.drawOrder[D],v=0,y=0,d=M.getAttachment())if(b=d instanceof
r.RegionAttachment,A=d instanceof r.MeshAttachment,d instanceof
r.ClippingAttachment)e.clipStart(M,d);else if((b||
A)&&(C=d.region.texture._texture)&&(w=M.data.blendMode,h===C.url&&c===w||
(h=C.url,c=w,(S=f-1)>=0&&(_>0?
((T=i[S]).indexCount=_,T.vertexCount=u,T.vfCount=6*u):f--),i[f]={tex:C,blendMode:w,
indexCount:0,vertexCount:0,vfCount:0},f++,_=0,u=0),b?
(x=E,v=24,y=6,d.computeWorldVertices(M.bone,s,l,6)):A&&(x=d.triangles,v=6*(d.worldV
erticesLength>>1),y=x.length,d.computeWorldVertices(M,0,d.worldVerticesLength,s,l,6
)),0!=v&&0!=y)){for(var P=0,I=o,R=x.length;P<R;)a[I++]=x[P++];g=d.uvs;for(var
O=l,L=l+v,F=0;O<L;O+=6,F+=2)s[O+2]=g[F],s[O+3]=g[F+1];if(m=d.color,p=M.color,this.f
illVertices(n,m,p,e,M),y>0){for(var V=o,N=o+y;V<N;V++)a[V]+=u;o+=y,
(l+=v)/6,_+=y,u+=v/6}e.clipEndWithSlot(M)}e.clipEnd()}}),D=cc.Class({ctor:function(
){this._animationPool={},this._skeletonCache={}},clear:function()
{this._animationPool={},this._skeletonCache={}},removeSkeleton:function(t){var
e=this._skeletonCache[t];if(e){var i=e.animationsCache;for(var n in i){var
r=i[n];r&&(this._animationPool[t+"#"+n]=r,r.clear())}delete
this._skeletonCache[t]}},resetSkeleton:function(t){var
e=this._skeletonCache[t];if(e){var i=e.animationsCache;for(var n in i){var
r=i[n];r&&(this._animationPool[t+"#"+n]=r,r.clear())}}},getSkeletonCache:function(t
,e){var i=this._skeletonCache[t];if(!i){var s=new r.Skeleton(e),a=new
r.SkeletonClipping,o=new r.AnimationStateData(s.data),l=new
r.AnimationState(o),h=new
n;l.addListener(h),this._skeletonCache[t]=i={skeleton:s,clipper:a,state:l,listener:
h,animationsCache:{}}}return i},getAnimationCache:function(t,e){var
i=this._skeletonCache[t];return i?
i.animationsCache[e]:null},updateSkeletonSkin:function(t,e){var
i=this._skeletonCache[t],n=i&&i.skeleton;n&&n.setSkinByName(e)},updateAnimationCach
e:function(t,e){var i=this._skeletonCache[t],n=i&&i.skeleton;if(!n)return null;if(!
n.data.findAnimation(e))return null;var r=i.animationsCache,s=r[e];if(!s){var
a=t+"#"+e;(s=this._animationPool[a])?delete this._animationPool[a]:(s=new
M).init(e),r[e]=s}return s.update(i),s.totalTime>=30&&cc.warn("Animation cache is
overflow, maybe animation's frame is infinite, please change skeleton render mode
to REALTIME, animation name is [%s]",e),s}});D.sharedCache=new D,e.exports=D}),
{"./lib/spine":402,"./track-entry-listeners":407}],404:[(function(t,e,i){"use
strict";var n=t("./skeleton-
cache").sharedCache,r=cc.Class({name:"sp.SkeletonData",extends:cc.Asset,ctor:functi
on(){this.reset()},properties:{skeletonJsonStr:"",_skeletonJson:null,skeletonJson:
{get:function(){return this._skeletonJson},set:function(t)
{this._skeletonJson=t,this.skeletonJsonStr=JSON.stringify(t),!
this._uuid&&t.skeleton&&(this._uuid=t.skeleton.hash),this.reset()}},_atlasText:"",a
tlasText:{get:function(){return this._atlasText},set:function(t)
{this._atlasText=t,this.reset()}},textures:{default:[],type:
[cc.Texture2D]},textureNames:{default:[],type:[cc.String]},scale:1},statics:
{preventDeferredLoadDependents:!0,preventPreloadNativeObject:!0},createNode:!
1,reset:function()
{this._skeletonCache=null,this._atlasCache=null},getRuntimeData:function(t)
{if(this._skeletonCache)return this._skeletonCache;if(!
(this.textures&&this.textures.length>0)&&this.textureNames&&this.textureNames.lengt
h>0)return t||cc.errorID(7507,this.name),null;var e=this._getAtlas(t);if(!e)return
null;var i=new sp.spine.AtlasAttachmentLoader(e),n=new
sp.spine.SkeletonJson(i);n.scale=this.scale;var r=this.skeletonJson;return
this._skeletonCache=n.readSkeletonData(r),e.dispose(n),this._skeletonCache},getSkin
sEnum:!1,getAnimsEnum:!1,_getTexture:function(t){for(var
e=this.textureNames,i=0;i<e.length;i++)if(e[i]===t){var n=this.textures[i],r=new
sp.SkeletonTexture({width:n.width,height:n.height});return
r.setRealTexture(n),r}return cc.errorID(7506,t),null},_getAtlas:function(t){return
this._atlasCache?this._atlasCache:this.atlasText?this._atlasCache=new
sp.spine.TextureAtlas(this.atlasText,this._getTexture.bind(this)):(t||
cc.errorID(7508,this.name),null)},destroy:function()
{n.removeSkeleton(this._uuid),this._super()}});sp.SkeletonData=e.exports=r}),
{"./skeleton-cache":403}],405:[(function(t,e,i){"use
strict";sp.SkeletonTexture=cc.Class({name:"sp.SkeletonTexture",extends:sp.spine.Tex
ture,_texture:null,_material:null,setRealTexture:function(t)
{this._texture=t},getRealTexture:function(){return
this._texture},setFilters:function(t,e)
{this._texture&&this._texture.setFilters(t,e)},setWraps:function(t,e)
{this._texture&&this._texture.setWrapMode(t,e)},dispose:function(){}})}),{}],406:
[(function(t,e,i){"use strict";var
n=t("./Skeleton"),r=t("./lib/spine"),s=t("../../cocos2d/core/renderer/render-
flow"),a=t("../../cocos2d/core/renderer/webgl/vertex-
format"),o=a.vfmtPosUvColor,l=a.vfmtPosUvTwoColor,h=cc.gfx,c=0,u=[0,1,2,2,3,0],_=cc
.color(0,0,255,255),f=cc.color(255,0,0,255),d=cc.color(0,255,0,255),m=void 0,p=void
0;m=new r.Color(1,1,1,1),p=new r.Color(1,1,1,1);var v=void 0,y=void 0,g=void
0,x=void 0,b=void 0,A=void 0,C=void 0,S=void 0,T=void 0,w=void 0,E=void 0,M=void
0,D=void 0,B=void 0,P=void 0,I=void 0,R=0,O=0,L=0,F=0,V=0,N=0,k=0,G=void 0,z=void
0,U=void 0,j=void 0,W=void 0,H=void 0,X=void 0,q=void 0,Y=void 0,J=void 0,Z=void
0,K=void 0,Q=void 0,$=void 0,tt=void 0,et=void 0,it=void 0,nt=void 0,rt=void
0,st=void 0,at=void 0,ot=void 0,lt=void 0,ht=void 0,ct=void 0,ut=void 0,_t=void
0,ft=void 0;function dt(t,e){var i=void 0,n=void 0;switch(e){case
r.BlendMode.Additive:i=v?cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE;break;case
r.BlendMode.Multiply:i=cc.macro.DST_COLOR,n=cc.macro.ONE_MINUS_SRC_ALPHA;break;case
r.BlendMode.Screen:i=cc.macro.ONE,n=cc.macro.ONE_MINUS_SRC_COLOR;break;case
r.BlendMode.Normal:default:i=v?
cc.macro.ONE:cc.macro.SRC_ALPHA,n=cc.macro.ONE_MINUS_SRC_ALPHA}var
s=t.url+i+n,a=ht.sharedMaterials[0];if(!a)return null;var
o=ht._materialCache,l=o[s];l?l.getProperty("texture")!
==t&&(l.setProperty("texture",t),l.updateHash(s)):((l=new
cc.Material).copy(a),l.define("_USE_MODEL",!
0),l.define("USE_TINT",b),l.setProperty("texture",t),l.effect.getDefaultTechnique()
.passes[0].setBlend(!
0,h.BLEND_FUNC_ADD,i,n,h.BLEND_FUNC_ADD,i,n),l.updateHash(s),o[s]=l);return
l}function mt(t){st=t.fa*E,$=S*(y=v?
st/255:1),tt=T*y,et=w*y,it=t.fr*$,nt=t.fg*tt,rt=t.fb*et,M=(st<<24>>>0)+(rt<<16)+
(nt<<8)+it,at=t.dr*$,ot=t.dg*tt,lt=t.db*et,D=((v?255:0)<<24>>>0)+(lt<<16)+
(ot<<8)+at}var pt={updateRenderData:function(t){var
e=t._skeleton;e&&e.updateWorldTransform()},fillVertices:function(t,e,i,n,r){var
s=ct._vData,a=ct._iData,o=ct._uintVData,l=void 0;if(m.a=i.a*e.a*t.a*E*255,y=v?
m.a:255,G=S*e.r*t.r*y,z=T*e.g*t.g*y,U=w*e.b*t.b*y,m.r=G*i.r,m.g=z*i.g,m.b=U*i.b,nul
l==r.darkColor?p.set(0,0,0,1):
(p.r=r.darkColor.r*G,p.g=r.darkColor.g*z,p.b=r.darkColor.b*U),p.a=v?
255:0,n.isClipping()){var
h=s.subarray(L+2);n.clipTriangles(s.subarray(L),R,a.subarray(N),V,h,m,p,b,P);var
c=new
Float32Array(n.clippedVertices),u=n.clippedTriangles;if(V=u.length,R=c.length/I*P,l
=ct.request(R/P,V),N=l.indiceOffset,F=l.vertexOffset,L=l.byteOffset>>2,s=ct._vData,
a=ct._iData,o=ct._uintVData,a.set(u,N),b)for(var
_=0,f=c.length,d=L;_<f;_+=12,d+=P)s[d]=c[_],s[d+1]=c[_+1],s[d+2]=c[_+6],s[d+3]=c[_+
7],M=(c[_+5]<<24>>>0)+(c[_+4]<<16)+(c[_+3]<<8)+c[_+2],o[d+4]=M,D=(c[_+11]<<24>>>0)+
(c[_+10]<<16)+(c[_+9]<<8)+c[_+8],o[d+5]=D;else for(var
g=0,x=c.length,A=L;g<x;g+=8,A+=P)s[A]=c[g],s[A+1]=c[g+1],s[A+2]=c[g+6],s[A+3]=c[g+7
],M=(c[g+5]<<24>>>0)+(c[g+4]<<16)+(c[g+3]<<8)+c[g+2],o[A+4]=M}else
if(M=(m.a<<24>>>0)+(m.b<<16)+(m.g<<8)+m.r,D=(p.a<<24>>>0)+(p.b<<16)+
(p.g<<8)+p.r,b)for(var C=L,B=L+R;C<B;C+=P)o[C+4]=M,o[C+5]=D;else for(var
O=L,k=L+R;O<k;O+=P)o[O+4]=M},realTimeTraverse:function(t){var e=void 0,i=void
0,n=ht._skeleton,s=n.color,a=ht._debugRenderer,o=ht._clipper,l=null,h=void 0,c=void
0,m=void 0,p=void 0,v=void 0,y=void 0,S=void 0,T=void 0,w=void
0;g=ht._startSlotIndex,x=ht._endSlotIndex,j=!1,-1==g&&(j=!
0),A=ht.debugSlots,C=ht.debugBones,a&&(C||
A)&&(a.clear(),a.strokeColor=_,a.lineWidth=5),I=b?12:8,R=0,L=0,F=0,V=0,N=0;for(var
E=0,M=n.drawOrder.length;E<M;E++)if(w=n.drawOrder[E],g>=0&&g==w.data.index&&(j=!
0),j){if(x>=0&&x==w.data.index&&(j=!1),R=0,V=0,h=w.getAttachment())if(y=h
instanceof r.RegionAttachment,S=h instanceof r.MeshAttachment,h instanceof
r.ClippingAttachment)o.clipStart(w,h);else if((y||
S)&&(l=dt(h.region.texture._texture,w.data.blendMode))){if((W||l._hash!
==ut.material._hash)&&(W=!1,ut._flush(),ut.node=_t,ut.material=l),y)
{if(v=u,R=4*P,V=6,T=ct.request(4,6),N=T.indiceOffset,F=T.vertexOffset,L=T.byteOffse
t>>2,e=ct._vData,i=ct._iData,h.computeWorldVertices(w.bone,e,L,P),a&&A)
{a.moveTo(e[L],e[L+1]);for(var
D=L+P,B=L+R;D<B;D+=P)a.lineTo(e[D],e[D+1]);a.close(),a.stroke()}}else
S&&(v=h.triangles,R=(h.worldVerticesLength>>1)*P,V=v.length,T=ct.request(R/P,V),N=T
.indiceOffset,F=T.vertexOffset,L=T.byteOffset>>2,e=ct._vData,i=ct._iData,h.computeW
orldVertices(w,0,h.worldVerticesLength,e,L,P));if(0!=R&&0!=V)
{i.set(v,N),p=h.uvs;for(var
O=L,k=L+R,G=0;O<k;O+=P,G+=2)e[O+2]=p[G],e[O+3]=p[G+1];if(c=h.color,m=w.color,this.f
illVertices(s,c,m,o,w),V>0){for(var z=N,U=N+V;z<U;z++)i[z]+=F;if(t)
{q=t.m00,Y=t.m04,J=t.m12,Z=t.m01,K=t.m05,Q=t.m13;for(var
$=L,tt=L+R;$<tt;$+=P)H=e[$],X=e[$+1],e[$]=H*q+X*Y+J,e[$
+1]=H*Z+X*K+Q}ct.adjust(R/P,V)}o.clipEndWithSlot(w)}}}else
o.clipEndWithSlot(w);if(o.clipEnd(),a&&C){var et=void
0;a.strokeColor=f,a.fillColor=_;for(var it=0,nt=n.bones.length;it<nt;it++){var
rt=(et=n.bones[it]).data.length*et.a+et.worldX,st=et.data.length*et.c+et.worldY;a.m
oveTo(et.worldX,et.worldY),a.lineTo(rt,st),a.stroke(),a.circle(et.worldX,et.worldY,
2*Math.PI),a.fill(),0===it&&(a.fillColor=d)}}},cacheTraverse:function(t){var
e=ht._curFrame;if(e){var i=e.segments;if(0!=i.length){var n=void 0,r=void 0,s=void
0,a=void 0,o=void
0,l=e.vertices,h=e.indices,u=e.uintVert,_=0,f=0,d=0;t&&(q=t.m00,Y=t.m04,J=t.m12,Z=t
.m01,K=t.m05,Q=t.m13);var m=0,p=e.colors,v=p[m++],y=v.vfOffset;mt(v);for(var
g=0,x=i.length;g<x;g++){var A=i[g];if(a=dt(A.tex,A.blendMode)){(W||a._hash!
==ut.material._hash)&&(W=!
1,ut._flush(),ut.node=_t,ut.material=a),O=A.vertexCount,V=A.indexCount,R=O*P,o=ct.r
equest(O,V),N=o.indiceOffset,F=o.vertexOffset,k=o.byteOffset>>2,n=ct._vData,r=ct._i
Data,s=ct._uintVData;for(var C=N,S=N+V;C<S;C++)r[C]=F+h[f++];switch(d=A.vfCount,c)
{case 0:for(var T=k,w=k+R;T<w;)n[T++]=l[_++],n[T++]=l[_++],n[T++]=l[_++],n[T+
+]=l[_++],s[T++]=u[_++],_++;break;case 1:n.set(l.subarray(_,_+R),k),_+=R;break;case
16:for(var E=k,B=k+R;E<B;)H=l[_++],X=l[_++],n[E++]=H*q+X*Y+J,n[E++]=H*Z+X*K+Q,n[E+
+]=l[_++],n[E++]=l[_++],s[E++]=u[_++],_++;break;case 17:for(var
I=k,L=k+R;I<L;)H=l[_++],X=l[_++],n[I++]=H*q+X*Y+J,n[I++]=H*Z+X*K+Q,n[I++]=l[_+
+],n[I++]=l[_++],s[I++]=u[_++],s[I++]=u[_++]}if(ct.adjust(O,V),ft)for(var G=_-
d,z=k+4,U=k+4+R;z<U;z+=P,G+=6)G>=y&&(mt(v=p[m+
+]),y=v.vfOffset),s[z]=M,b&&(s[z+1]=D)}}}}},fillBuffers:function(t,e){var
i=t.node;if(i._renderFlag|=s.FLAG_UPDATE_RENDER_DATA,t._skeleton){var
n=i._color;S=n.r/255,T=n.g/255,w=n.b/255,E=n.a/255,b=t.useTint,B=b?l:o,P=b?
6:5,_t=t.node,ct=e.getBuffer("spine",B),ut=e,ht=t,W=!
0,v=t.premultipliedAlpha,y=1,c=0,ft=!1,(4294967295!==n._val||v)&&(ft=!0),b&&(c|
=1);var r=void 0;ht.enableBatch&&(r=_t._worldMatrix,W=!1,c|
=16),t.isAnimationCached()?this.cacheTraverse(r):this.realTimeTraverse(r),_t=void
0,ct=void 0,ut=void 0,ht=void 0}}};n._assembler=pt,e.exports=pt}),
{"../../cocos2d/core/renderer/render-
flow":244,"../../cocos2d/core/renderer/webgl/vertex-
format":283,"./Skeleton":400,"./lib/spine":402}],407:[(function(t,e,i){"use
strict";var n=function()
{this.start=null,this.end=null,this.complete=null,this.event=null,this.interrupt=nu
ll,this.dispose=null};n.getListeners=function(t){return t.listener||(t.listener=new
n),t.listener},e.exports=n}),{}],408:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};
(function(t,r){"object"===(void 0===i?"undefined":n(i))&&void 0!==e?
r(i):"function"==typeof define&&define.amd?define(["exports"],r):r(t.box2d={})})
(void 0,(function(t){function e(t,e){return void 0!==t?t:e}var i=1e37,n=1e-
5,r=n*n,s=3.14159265359,a=2,o=8,l=.008,h=2/180*s,c=2*l,u=-1;var _=(function()
{function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void
0===i&&(i=0),this.major=0,this.minor=0,this.revision=0,this.major=t,this.minor=e,th
is.revision=i}return t.prototype.toString=function(){return
this.major+"."+this.minor+"."+this.revision},t})(),f=new _(2,3,2);function d(t,e)
{for(var i=[],n=0;n<t;++n)i.push(e(n));return i}function m(t,e){void
0===e&&(e=0);for(var i=[],n=0;n<t;++n)i.push(e);return i}var
p=s/180,v=180/s,y=Math.abs,g=Math.min,x=Math.max;function b(t,e,i){return t<e?
e:t>i?i:t}var A=isFinite;function C(t){return t*t}function S(t){return
1/Math.sqrt(t)}var T=Math.sqrt,w=Math.pow;var
E=Math.cos,M=Math.sin,D=Math.acos,B=Math.asin,P=Math.atan2;var I=(function()
{function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return
t.prototype.Clone=function(){return new
t(this.x,this.y)},t.prototype.SetZero=function(){return
this.x=0,this.y=0,this},t.prototype.Set=function(t,e){return
this.x=t,this.y=e,this},t.prototype.Copy=function(t){return
this.x=t.x,this.y=t.y,this},t.prototype.SelfAdd=function(t){return
this.x+=t.x,this.y+=t.y,this},t.prototype.SelfAddXY=function(t,e){return
this.x+=t,this.y+=e,this},t.prototype.SelfSub=function(t){return this.x-
=t.x,this.y-=t.y,this},t.prototype.SelfSubXY=function(t,e){return this.x-=t,this.y-
=e,this},t.prototype.SelfMul=function(t){return
this.x*=t,this.y*=t,this},t.prototype.SelfMulAdd=function(t,e){return
this.x+=t*e.x,this.y+=t*e.y,this},t.prototype.SelfMulSub=function(t,e){return
this.x-=t*e.x,this.y-=t*e.y,this},t.prototype.Dot=function(t){return
this.x*t.x+this.y*t.y},t.prototype.Cross=function(t){return this.x*t.y-
this.y*t.x},t.prototype.Length=function(){var t=this.x,e=this.y;return
Math.sqrt(t*t+e*e)},t.prototype.LengthSquared=function(){var
t=this.x,e=this.y;return t*t+e*e},t.prototype.Normalize=function(){var
t=this.Length();if(t>=n){var e=1/t;this.x*=e,this.y*=e}return
t},t.prototype.SelfNormalize=function(){var t=this.Length();if(t>=n){var
e=1/t;this.x*=e,this.y*=e}return this},t.prototype.SelfRotate=function(t){var
e=Math.cos(t),i=Math.sin(t),n=this.x;return this.x=e*n-
i*this.y,this.y=i*n+e*this.y,this},t.prototype.IsValid=function(){return
isFinite(this.x)&&isFinite(this.y)},t.prototype.SelfCrossVS=function(t){var
e=this.x;return this.x=t*this.y,this.y=-
t*e,this},t.prototype.SelfCrossSV=function(t){var e=this.x;return this.x=-
t*this.y,this.y=t*e,this},t.prototype.SelfMinV=function(t){return
this.x=g(this.x,t.x),this.y=g(this.y,t.y),this},t.prototype.SelfMaxV=function(t)
{return
this.x=x(this.x,t.x),this.y=x(this.y,t.y),this},t.prototype.SelfAbs=function()
{return this.x=y(this.x),this.y=y(this.y),this},t.prototype.SelfNeg=function()
{return this.x=-this.x,this.y=-this.y,this},t.prototype.SelfSkew=function(){var
t=this.x;return this.x=-this.y,this.y=t,this},t.MakeArray=function(e){return d(e,
(function(e){return new t}))},t.AbsV=function(t,e){return
e.x=y(t.x),e.y=y(t.y),e},t.MinV=function(t,e,i){return
i.x=g(t.x,e.x),i.y=g(t.y,e.y),i},t.MaxV=function(t,e,i){return
i.x=x(t.x,e.x),i.y=x(t.y,e.y),i},t.ClampV=function(t,e,i,n){return
n.x=b(t.x,e.x,i.x),n.y=b(t.y,e.y,i.y),n},t.RotateV=function(t,e,i){var
n=t.x,r=t.y,s=Math.cos(e),a=Math.sin(e);return i.x=s*n-
a*r,i.y=a*n+s*r,i},t.DotVV=function(t,e){return
t.x*e.x+t.y*e.y},t.CrossVV=function(t,e){return t.x*e.y-
t.y*e.x},t.CrossVS=function(t,e,i){var n=t.x;return i.x=e*t.y,i.y=-
e*n,i},t.CrossVOne=function(t,e){var i=t.x;return e.x=t.y,e.y=-
i,e},t.CrossSV=function(t,e,i){var n=e.x;return i.x=-
t*e.y,i.y=t*n,i},t.CrossOneV=function(t,e){var i=t.x;return e.x=-
t.y,e.y=i,e},t.AddVV=function(t,e,i){return
i.x=t.x+e.x,i.y=t.y+e.y,i},t.SubVV=function(t,e,i){return i.x=t.x-e.x,i.y=t.y-
e.y,i},t.MulSV=function(t,e,i){return
i.x=e.x*t,i.y=e.y*t,i},t.MulVS=function(t,e,i){return
i.x=t.x*e,i.y=t.y*e,i},t.AddVMulSV=function(t,e,i,n){return
n.x=t.x+e*i.x,n.y=t.y+e*i.y,n},t.SubVMulSV=function(t,e,i,n){return n.x=t.x-
e*i.x,n.y=t.y-e*i.y,n},t.AddVCrossSV=function(t,e,i,n){var r=i.x;return n.x=t.x-
e*i.y,n.y=t.y+e*r,n},t.MidVV=function(t,e,i){return
i.x=.5*(t.x+e.x),i.y=.5*(t.y+e.y),i},t.ExtVV=function(t,e,i){return i.x=.5*(e.x-
t.x),i.y=.5*(e.y-t.y),i},t.IsEqualToV=function(t,e){return
t.x===e.x&&t.y===e.y},t.DistanceVV=function(t,e){var i=t.x-e.x,n=t.y-e.y;return
Math.sqrt(i*i+n*n)},t.DistanceSquaredVV=function(t,e){var i=t.x-e.x,n=t.y-
e.y;return i*i+n*n},t.NegV=function(t,e){return e.x=-t.x,e.y=-t.y,e},t.ZERO=new
t(0,0),t.UNITX=new t(1,0),t.UNITY=new t(0,1),t.s_t0=new t,t.s_t1=new t,t.s_t2=new
t,t.s_t3=new t,t})(),R=new I(0,0),O=(function(){function t(t,e,i){void
0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}return
t.prototype.Clone=function(){return new
t(this.x,this.y,this.z)},t.prototype.SetZero=function(){return
this.x=0,this.y=0,this.z=0,this},t.prototype.SetXYZ=function(t,e,i){return
this.x=t,this.y=e,this.z=i,this},t.prototype.Copy=function(t){return
this.x=t.x,this.y=t.y,this.z=t.z,this},t.prototype.SelfNeg=function(){return
this.x=-this.x,this.y=-this.y,this.z=-this.z,this},t.prototype.SelfAdd=function(t)
{return
this.x+=t.x,this.y+=t.y,this.z+=t.z,this},t.prototype.SelfAddXYZ=function(t,e,i)
{return this.x+=t,this.y+=e,this.z+=i,this},t.prototype.SelfSub=function(t){return
this.x-=t.x,this.y-=t.y,this.z-=t.z,this},t.prototype.SelfSubXYZ=function(t,e,i)
{return this.x-=t,this.y-=e,this.z-=i,this},t.prototype.SelfMul=function(t){return
this.x*=t,this.y*=t,this.z*=t,this},t.DotV3V3=function(t,e){return
t.x*e.x+t.y*e.y+t.z*e.z},t.CrossV3V3=function(t,e,i){var
n=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return i.x=r*l-s*o,i.y=s*a-n*l,i.z=n*o-
r*a,i},t.ZERO=new t(0,0,0),t.s_t0=new t,t})(),L=(function(){function t()
{this.ex=new I(1,0),this.ey=new I(0,1)}return t.prototype.Clone=function()
{return(new t).Copy(this)},t.FromVV=function(e,i){return(new
t).SetVV(e,i)},t.FromSSSS=function(e,i,n,r){return(new
t).SetSSSS(e,i,n,r)},t.FromAngle=function(e){return(new
t).SetAngle(e)},t.prototype.SetSSSS=function(t,e,i,n){return
this.ex.Set(t,i),this.ey.Set(e,n),this},t.prototype.SetVV=function(t,e){return
this.ex.Copy(t),this.ey.Copy(e),this},t.prototype.SetAngle=function(t){var
e=Math.cos(t),i=Math.sin(t);return this.ex.Set(e,i),this.ey.Set(-
i,e),this},t.prototype.Copy=function(t){return
this.ex.Copy(t.ex),this.ey.Copy(t.ey),this},t.prototype.SetIdentity=function()
{return this.ex.Set(1,0),this.ey.Set(0,1),this},t.prototype.SetZero=function()
{return this.ex.SetZero(),this.ey.SetZero(),this},t.prototype.GetAngle=function()
{return Math.atan2(this.ex.y,this.ex.x)},t.prototype.GetInverse=function(t){var
e=this.ex.x,i=this.ey.x,n=this.ex.y,r=this.ey.y,s=e*r-i*n;return 0!
==s&&(s=1/s),t.ex.x=s*r,t.ey.x=-s*i,t.ex.y=-
s*n,t.ey.y=s*e,t},t.prototype.Solve=function(t,e,i){var
n=this.ex.x,r=this.ey.x,s=this.ex.y,a=this.ey.y,o=n*a-r*s;return 0!
==o&&(o=1/o),i.x=o*(a*t-r*e),i.y=o*(n*e-s*t),i},t.prototype.SelfAbs=function()
{return
this.ex.SelfAbs(),this.ey.SelfAbs(),this},t.prototype.SelfInv=function(){return
this.GetInverse(this),this},t.prototype.SelfAddM=function(t){return
this.ex.SelfAdd(t.ex),this.ey.SelfAdd(t.ey),this},t.prototype.SelfSubM=function(t)
{return this.ex.SelfSub(t.ex),this.ey.SelfSub(t.ey),this},t.AbsM=function(t,e){var
i=t.ex,n=t.ey;return
e.ex.x=y(i.x),e.ex.y=y(i.y),e.ey.x=y(n.x),e.ey.y=y(n.y),e},t.MulMV=function(t,e,i)
{var n=t.ex,r=t.ey,s=e.x,a=e.y;return
i.x=n.x*s+r.x*a,i.y=n.y*s+r.y*a,i},t.MulTMV=function(t,e,i){var
n=t.ex,r=t.ey,s=e.x,a=e.y;return
i.x=n.x*s+n.y*a,i.y=r.x*s+r.y*a,i},t.AddMM=function(t,e,i){var
n=t.ex,r=t.ey,s=e.ex,a=e.ey;return
i.ex.x=n.x+s.x,i.ex.y=n.y+s.y,i.ey.x=r.x+a.x,i.ey.y=r.y+a.y,i},t.MulMM=function(t,e
,i){var
n=t.ex.x,r=t.ex.y,s=t.ey.x,a=t.ey.y,o=e.ex.x,l=e.ex.y,h=e.ey.x,c=e.ey.y;return
i.ex.x=n*o+s*l,i.ex.y=r*o+a*l,i.ey.x=n*h+s*c,i.ey.y=r*h+a*c,i},t.MulTMM=function(t,
e,i){var
n=t.ex.x,r=t.ex.y,s=t.ey.x,a=t.ey.y,o=e.ex.x,l=e.ex.y,h=e.ey.x,c=e.ey.y;return
i.ex.x=n*o+r*l,i.ex.y=s*o+a*l,i.ey.x=n*h+r*c,i.ey.y=s*h+a*c,i},t.IDENTITY=new t,t})
(),F=(function(){function t(){this.ex=new O(1,0,0),this.ey=new O(0,1,0),this.ez=new
O(0,0,1)}return t.prototype.Clone=function(){return(new
t).Copy(this)},t.prototype.SetVVV=function(t,e,i){return
this.ex.Copy(t),this.ey.Copy(e),this.ez.Copy(i),this},t.prototype.Copy=function(t)
{return
this.ex.Copy(t.ex),this.ey.Copy(t.ey),this.ez.Copy(t.ez),this},t.prototype.SetIdent
ity=function(){return
this.ex.SetXYZ(1,0,0),this.ey.SetXYZ(0,1,0),this.ez.SetXYZ(0,0,1),this},t.prototype
.SetZero=function(){return
this.ex.SetZero(),this.ey.SetZero(),this.ez.SetZero(),this},t.prototype.SelfAddM=fu
nction(t){return
this.ex.SelfAdd(t.ex),this.ey.SelfAdd(t.ey),this.ez.SelfAdd(t.ez),this},t.prototype
.Solve33=function(t,e,i,n){var
r=this.ex.x,s=this.ex.y,a=this.ex.z,o=this.ey.x,l=this.ey.y,h=this.ey.z,c=this.ez.x
,u=this.ez.y,_=this.ez.z,f=r*(l*_-h*u)+s*(h*c-o*_)+a*(o*u-l*c);return 0!
==f&&(f=1/f),n.x=f*(t*(l*_-h*u)+e*(h*c-o*_)+i*(o*u-l*c)),n.y=f*(r*(e*_-i*u)+s*(i*c-
t*_)+a*(t*u-e*c)),n.z=f*(r*(l*i-h*e)+s*(h*t-o*i)+a*(o*e-
l*t)),n},t.prototype.Solve22=function(t,e,i){var
n=this.ex.x,r=this.ey.x,s=this.ex.y,a=this.ey.y,o=n*a-r*s;return 0!
==o&&(o=1/o),i.x=o*(a*t-r*e),i.y=o*(n*e-
s*t),i},t.prototype.GetInverse22=function(t){var
e=this.ex.x,i=this.ey.x,n=this.ex.y,r=this.ey.y,s=e*r-i*n;0!
==s&&(s=1/s),t.ex.x=s*r,t.ey.x=-s*i,t.ex.z=0,t.ex.y=-
s*n,t.ey.y=s*e,t.ey.z=0,t.ez.x=0,t.ez.y=0,t.ez.z=0},t.prototype.GetSymInverse33=fun
ction(t){var e=O.DotV3V3(this.ex,O.CrossV3V3(this.ey,this.ez,O.s_t0));0!
==e&&(e=1/e);var
i=this.ex.x,n=this.ey.x,r=this.ez.x,s=this.ey.y,a=this.ez.y,o=this.ez.z;t.ex.x=e*(s
*o-a*a),t.ex.y=e*(r*a-n*o),t.ex.z=e*(n*a-r*s),t.ey.x=t.ex.y,t.ey.y=e*(i*o-
r*r),t.ey.z=e*(r*n-i*a),t.ez.x=t.ex.z,t.ez.y=t.ey.z,t.ez.z=e*(i*s-
n*n)},t.MulM33V3=function(t,e,i){var n=e.x,r=e.y,s=e.z;return
i.x=t.ex.x*n+t.ey.x*r+t.ez.x*s,i.y=t.ex.y*n+t.ey.y*r+t.ez.y*s,i.z=t.ex.z*n+t.ey.z*r
+t.ez.z*s,i},t.MulM33XYZ=function(t,e,i,n,r){return
r.x=t.ex.x*e+t.ey.x*i+t.ez.x*n,r.y=t.ex.y*e+t.ey.y*i+t.ez.y*n,r.z=t.ex.z*e+t.ey.z*i
+t.ez.z*n,r},t.MulM33V2=function(t,e,i){var n=e.x,r=e.y;return
i.x=t.ex.x*n+t.ey.x*r,i.y=t.ex.y*n+t.ey.y*r,i},t.MulM33XY=function(t,e,i,n){return
n.x=t.ex.x*e+t.ey.x*i,n.y=t.ex.y*e+t.ey.y*i,n},t.IDENTITY=new t,t})(),V=(function()
{function t(t){void
0===t&&(t=0),this.s=0,this.c=1,t&&(this.s=Math.sin(t),this.c=Math.cos(t))}return
t.prototype.Clone=function(){return(new t).Copy(this)},t.prototype.Copy=function(t)
{return this.s=t.s,this.c=t.c,this},t.prototype.SetAngle=function(t){return
this.s=Math.sin(t),this.c=Math.cos(t),this},t.prototype.SetIdentity=function()
{return this.s=0,this.c=1,this},t.prototype.GetAngle=function(){return
Math.atan2(this.s,this.c)},t.prototype.GetXAxis=function(t){return
t.x=this.c,t.y=this.s,t},t.prototype.GetYAxis=function(t){return t.x=-
this.s,t.y=this.c,t},t.MulRR=function(t,e,i){var n=t.c,r=t.s,s=e.c,a=e.s;return
i.s=r*s+n*a,i.c=n*s-r*a,i},t.MulTRR=function(t,e,i){var
n=t.c,r=t.s,s=e.c,a=e.s;return i.s=n*a-r*s,i.c=n*s+r*a,i},t.MulRV=function(t,e,i)
{var n=t.c,r=t.s,s=e.x,a=e.y;return i.x=n*s-
r*a,i.y=r*s+n*a,i},t.MulTRV=function(t,e,i){var n=t.c,r=t.s,s=e.x,a=e.y;return
i.x=n*s+r*a,i.y=-r*s+n*a,i},t.IDENTITY=new t,t})(),N=(function(){function t()
{this.p=new I,this.q=new V}return t.prototype.Clone=function(){return(new
t).Copy(this)},t.prototype.Copy=function(t){return
this.p.Copy(t.p),this.q.Copy(t.q),this},t.prototype.SetIdentity=function(){return
this.p.SetZero(),this.q.SetIdentity(),this},t.prototype.SetPositionRotation=functio
n(t,e){return
this.p.Copy(t),this.q.Copy(e),this},t.prototype.SetPositionAngle=function(t,e)
{return this.p.Copy(t),this.q.SetAngle(e),this},t.prototype.SetPosition=function(t)
{return this.p.Copy(t),this},t.prototype.SetPositionXY=function(t,e){return
this.p.Set(t,e),this},t.prototype.SetRotation=function(t){return
this.q.Copy(t),this},t.prototype.SetRotationAngle=function(t){return
this.q.SetAngle(t),this},t.prototype.GetPosition=function(){return
this.p},t.prototype.GetRotation=function(){return
this.q},t.prototype.GetRotationAngle=function(){return
this.q.GetAngle()},t.prototype.GetAngle=function(){return
this.q.GetAngle()},t.MulXV=function(t,e,i){var n=t.q.c,r=t.q.s,s=e.x,a=e.y;return
i.x=n*s-r*a+t.p.x,i.y=r*s+n*a+t.p.y,i},t.MulTXV=function(t,e,i){var
n=t.q.c,r=t.q.s,s=e.x-t.p.x,a=e.y-t.p.y;return i.x=n*s+r*a,i.y=-
r*s+n*a,i},t.MulXX=function(t,e,i){return
V.MulRR(t.q,e.q,i.q),I.AddVV(V.MulRV(t.q,e.p,i.p),t.p,i.p),i},t.MulTXX=function(t,e
,i){return
V.MulTRR(t.q,e.q,i.q),V.MulTRV(t.q,I.SubVV(e.p,t.p,i.p),i.p),i},t.IDENTITY=new
t,t})(),k=(function(){function t(){this.localCenter=new I,this.c0=new I,this.c=new
I,this.a0=0,this.a=0,this.alpha0=0}return t.prototype.Clone=function(){return(new
t).Copy(this)},t.prototype.Copy=function(t){return
this.localCenter.Copy(t.localCenter),this.c0.Copy(t.c0),this.c.Copy(t.c),this.a0=t.
a0,this.a=t.a,this.alpha0=t.alpha0,this},t.prototype.GetTransform=function(t,e){var
i=1-e;t.p.x=i*this.c0.x+e*this.c.x,t.p.y=i*this.c0.y+e*this.c.y;var
n=i*this.a0+e*this.a;return
t.q.SetAngle(n),t.p.SelfSub(V.MulRV(t.q,this.localCenter,I.s_t0)),t},t.prototype.Ad
vance=function(t){var e=(t-this.alpha0)/(1-this.alpha0),i=1-
e;this.c0.x=i*this.c0.x+e*this.c.x,this.c0.y=i*this.c0.y+e*this.c.y,this.a0=i*this.
a0+e*this.a,this.alpha0=t},t.prototype.Normalize=function(){var
t=6.28318530718*Math.floor(this.a0/6.28318530718);this.a0-=t,this.a-=t},t})
(),G=(function(){function t(t,e,i,n){void 0===t&&(t=.5),void 0===e&&(e=.5),void
0===i&&(i=.5),void 0===n&&(n=1),this.r=t,this.g=e,this.b=i,this.a=n}return
t.prototype.Clone=function(){return(new t).Copy(this)},t.prototype.Copy=function(t)
{return
this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.IsEqual=function(t)
{return
this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a},t.prototype.IsZero=function
(){return
0===this.r&&0===this.g&&0===this.b&&0===this.a},t.prototype.Set=function(t,e,i,n)
{void
0===n&&(n=this.a),this.SetRGBA(t,e,i,n)},t.prototype.SetByteRGB=function(t,e,i)
{return
this.r=t/255,this.g=e/255,this.b=i/255,this},t.prototype.SetByteRGBA=function(t,e,i
,n){return
this.r=t/255,this.g=e/255,this.b=i/255,this.a=n/255,this},t.prototype.SetRGB=functi
on(t,e,i){return
this.r=t,this.g=e,this.b=i,this},t.prototype.SetRGBA=function(t,e,i,n){return
this.r=t,this.g=e,this.b=i,this.a=n,this},t.prototype.SelfAdd=function(t){return
this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a,this},t.prototype.Add=function(t,e)
{return
e.r=this.r+t.r,e.g=this.g+t.g,e.b=this.b+t.b,e.a=this.a+t.a,e},t.prototype.SelfSub=
function(t){return this.r-=t.r,this.g-=t.g,this.b-=t.b,this.a-
=t.a,this},t.prototype.Sub=function(t,e){return e.r=this.r-t.r,e.g=this.g-
t.g,e.b=this.b-t.b,e.a=this.a-t.a,e},t.prototype.SelfMul=function(t){return
this.r*=t,this.g*=t,this.b*=t,this.a*=t,this},t.prototype.Mul=function(t,e){return
e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,e.a=this.a*t,e},t.prototype.Mix=function(e,i
){t.MixColors(this,e,i)},t.MixColors=function(t,e,i){var n=i*(e.r-t.r),r=i*(e.g-
t.g),s=i*(e.b-t.b),a=i*(e.a-t.a);t.r+=n,t.g+=r,t.b+=s,t.a+=a,e.r-=n,e.g-=r,e.b-
=s,e.a-=a},t.prototype.MakeStyleString=function(e){return void
0===e&&(e=this.a),t.MakeStyleString(this.r,this.g,this.b,e)},t.MakeStyleString=func
tion(t,e,i,n){return void
0===n&&(n=1),t*=255,e*=255,i*=255,n<1?"rgba("+t+","+e+","+i+","+n+")":"rgb("+t+","+
e+","+i+")"},t.ZERO=new t(0,0,0,0),t.RED=new t(1,0,0),t.GREEN=new
t(0,1,0),t.BLUE=new t(0,0,1),t})();(function(t)
{t[t.e_none=0]="e_none",t[t.e_shapeBit=1]="e_shapeBit",t[t.e_jointBit=2]="e_jointBi
t",t[t.e_aabbBit=4]="e_aabbBit",t[t.e_pairBit=8]="e_pairBit",t[t.e_centerOfMassBit=
16]="e_centerOfMassBit",t[t.e_particleBit=32]="e_particleBit",t[t.e_controllerBit=6
4]="e_controllerBit",t[t.e_all=63]="e_all"})(t.b2DrawFlags||(t.b2DrawFlags={}));var
z=(function(){function t(){this.m_drawFlags=0}return
t.prototype.SetFlags=function(t)
{this.m_drawFlags=t},t.prototype.GetFlags=function(){return
this.m_drawFlags},t.prototype.AppendFlags=function(t){this.m_drawFlags|
=t},t.prototype.ClearFlags=function(t){this.m_drawFlags&=~t},t})(),U=(function()
{function t(){this.m_start=Date.now()}return t.prototype.Reset=function(){return
this.m_start=Date.now(),this},t.prototype.GetMilliseconds=function(){return
Date.now()-this.m_start},t})(),j=(function(){function t()
{this.m_count=0,this.m_min_count=0,this.m_max_count=0}return
t.prototype.GetCount=function(){return
this.m_count},t.prototype.GetMinCount=function(){return
this.m_min_count},t.prototype.GetMaxCount=function(){return
this.m_max_count},t.prototype.ResetCount=function(){var t=this.m_count;return
this.m_count=0,t},t.prototype.ResetMinCount=function()
{this.m_min_count=0},t.prototype.ResetMaxCount=function()
{this.m_max_count=0},t.prototype.Increment=function(){this.m_count+
+,this.m_max_count<this.m_count&&(this.m_max_count=this.m_count)},t.prototype.Decre
ment=function()
{this.m_count--,this.m_min_count>this.m_count&&(this.m_min_count=this.m_count)},t})
(),W=(function(){funct
ion t(t){this.m_stack=[],this.m_count=0,this.m_stack=d(t,(function(t){return
null})),this.m_count=0}return t.prototype.Reset=function(){return
this.m_count=0,this},t.prototype.Push=function(t)
{this.m_stack[this.m_count]=t,this.m_count++},t.prototype.Pop=function()
{this.m_count--;var
t=this.m_stack[this.m_count];if(this.m_stack[this.m_count]=null,null===t)throw new
Error;return t},t.prototype.GetCount=function(){return this.m_count},t})
(),H=(function(){return function(){}})(),X=(function(){return function(){}})
(),q=(function(){function t()
{this.m_buffer=I.MakeArray(2),this.m_vertices=this.m_buffer,this.m_count=0,this.m_r
adius=0}return t.prototype.Copy=function(t){return t.m_vertices===t.m_buffer?
(this.m_vertices=this.m_buffer,this.m_buffer[0].Copy(t.m_buffer[0]),this.m_buffer[1
].Copy(t.m_buffer[1])):this.m_vertices=t.m_vertices,this.m_count=t.m_count,this.m_r
adius=t.m_radius,this},t.prototype.Reset=function(){return
this.m_vertices=this.m_buffer,this.m_count=0,this.m_radius=0,this},t.prototype.SetS
hape=function(t,e)
{t.SetupDistanceProxy(this,e)},t.prototype.SetVerticesRadius=function(t,e,i)
{this.m_vertices=t,this.m_count=e,this.m_radius=i},t.prototype.GetSupport=function(
t){for(var e=0,i=I.DotVV(this.m_vertices[0],t),n=1;n<this.m_count;++n){var
r=I.DotVV(this.m_vertices[n],t);r>i&&(e=n,i=r)}return
e},t.prototype.GetSupportVertex=function(t){for(var
e=0,i=I.DotVV(this.m_vertices[0],t),n=1;n<this.m_count;++n){var
r=I.DotVV(this.m_vertices[n],t);r>i&&(e=n,i=r)}return
this.m_vertices[e]},t.prototype.GetVertexCount=function(){return
this.m_count},t.prototype.GetVertex=function(t){return this.m_vertices[t]},t})
(),Y=(function(){function t()
{this.metric=0,this.count=0,this.indexA=[0,0,0],this.indexB=[0,0,0]}return
t.prototype.Reset=function(){return this.metric=0,this.count=0,this},t})
(),J=(function(){function t(){this.proxyA=new q,this.proxyB=new
q,this.transformA=new N,this.transformB=new N,this.useRadii=!1}return
t.prototype.Reset=function(){return
this.proxyA.Reset(),this.proxyB.Reset(),this.transformA.SetIdentity(),this.transfor
mB.SetIdentity(),this.useRadii=!1,this},t})(),Z=(function(){function t()
{this.pointA=new I,this.pointB=new I,this.distance=0,this.iterations=0}return
t.prototype.Reset=function(){return
this.pointA.SetZero(),this.pointB.SetZero(),this.distance=0,this.iterations=0,this}
,t})(),K=(function(){return function(){this.proxyA=new q,this.proxyB=new
q,this.transformA=new N,this.transformB=new N,this.translationB=new I}})
(),Q=(function(){return function(){this.point=new I,this.normal=new
I,this.lambda=0,this.iterations=0}})
();t.b2_gjkCalls=0,t.b2_gjkIters=0,t.b2_gjkMaxIters=0;var $=(function(){function
t(){this.wA=new I,this.wB=new I,this.w=new
I,this.a=0,this.indexA=0,this.indexB=0}return t.prototype.Copy=function(t){return
this.wA.Copy(t.wA),this.wB.Copy(t.wB),this.w.Copy(t.w),this.a=t.a,this.indexA=t.ind
exA,this.indexB=t.indexB,this},t})(),tt=(function(){function t(){this.m_v1=new
$,this.m_v2=new $,this.m_v3=new
$,this.m_vertices=[],this.m_count=0,this.m_vertices[0]=this.m_v1,this.m_vertices[1]
=this.m_v2,this.m_vertices[2]=this.m_v3}return
t.prototype.ReadCache=function(t,e,i,r,s){this.m_count=t.count;for(var
a=this.m_vertices,o=0;o<this.m_count;++o)
{(_=a[o]).indexA=t.indexA[o],_.indexB=t.indexB[o];var
l=e.GetVertex(_.indexA),h=r.GetVertex(_.indexB);N.MulXV(i,l,_.wA),N.MulXV(s,h,_.wB)
,I.SubVV(_.wB,_.wA,_.w),_.a=0}if(this.m_count>1){var c=t.metric,u=this.GetMetric();
(u<.5*c||2*c<u||u<n)&&(this.m_count=0)}if(0===this.m_count){var _;
(_=a[0]).indexA=0,_.indexB=0;l=e.GetVertex(0),h=r.GetVertex(0);N.MulXV(i,l,_.wA),N.
MulXV(s,h,_.wB),I.SubVV(_.wB,_.wA,_.w),_.a=1,this.m_count=1}},t.prototype.WriteCach
e=function(t){t.metric=this.GetMetric(),t.count=this.m_count;for(var
e=this.m_vertices,i=0;i<this.m_count;+
+i)t.indexA[i]=e[i].indexA,t.indexB[i]=e[i].indexB},t.prototype.GetSearchDirection=
function(t){switch(this.m_count){case 1:return I.NegV(this.m_v1.w,t);case 2:var
e=I.SubVV(this.m_v2.w,this.m_v1.w,t);return
I.CrossVV(e,I.NegV(this.m_v1.w,I.s_t0))>0?
I.CrossOneV(e,t):I.CrossVOne(e,t);default:return
t.SetZero()}},t.prototype.GetClosestPoint=function(t){switch(this.m_count){case
0:return t.SetZero();case 1:return t.Copy(this.m_v1.w);case 2:return
t.Set(this.m_v1.a*this.m_v1.w.x+this.m_v2.a*this.m_v2.w.x,this.m_v1.a*this.m_v1.w.y
+this.m_v2.a*this.m_v2.w.y);case 3:default:return
t.SetZero()}},t.prototype.GetWitnessPoints=function(t,e){switch(this.m_count){case
0:break;case 1:t.Copy(this.m_v1.wA),e.Copy(this.m_v1.wB);break;case
2:t.x=this.m_v1.a*this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x,t.y=this.m_v1.a*this.m_
v1.wA.y+this.m_v2.a*this.m_v2.wA.y,e.x=this.m_v1.a*this.m_v1.wB.x+this.m_v2.a*this.
m_v2.wB.x,e.y=this.m_v1.a*this.m_v1.wB.y+this.m_v2.a*this.m_v2.wB.y;break;case
3:e.x=t.x=this.m_v1.a*this.m_v1.wA.x+this.m_v2.a*this.m_v2.wA.x+this.m_v3.a*this.m_
v3.wA.x,e.y=t.y=this.m_v1.a*this.m_v1.wA.y+this.m_v2.a*this.m_v2.wA.y+this.m_v3.a*t
his.m_v3.wA.y}},t.prototype.GetMetric=function(){switch(this.m_count){case 0:case
1:return 0;case 2:return I.DistanceVV(this.m_v1.w,this.m_v2.w);case 3:return
I.CrossVV(I.SubVV(this.m_v2.w,this.m_v1.w,I.s_t0),I.SubVV(this.m_v3.w,this.m_v1.w,I
.s_t1));default:return 0}},t.prototype.Solve2=function(){var
e=this.m_v1.w,i=this.m_v2.w,n=I.SubVV(i,e,t.s_e12),r=-I.DotVV(e,n);if(r<=0)return
this.m_v1.a=1,void(this.m_count=1);var s=I.DotVV(i,n);if(s<=0)return
this.m_v2.a=1,this.m_count=1,void this.m_v1.Copy(this.m_v2);var
a=1/(s+r);this.m_v1.a=s*a,this.m_v2.a=r*a,this.m_count=2},t.prototype.Solve3=functi
on(){var
e=this.m_v1.w,i=this.m_v2.w,n=this.m_v3.w,r=I.SubVV(i,e,t.s_e12),s=I.DotVV(e,r),a=I
.DotVV(i,r),o=-s,l=I.SubVV(n,e,t.s_e13),h=I.DotVV(e,l),c=I.DotVV(n,l),u=-
h,_=I.SubVV(n,i,t.s_e23),f=I.DotVV(i,_),d=I.DotVV(n,_),m=-
f,p=I.CrossVV(r,l),v=p*I.CrossVV(i,n),y=p*I.CrossVV(n,e),g=p*I.CrossVV(e,i);if(o<=0
&&u<=0)return this.m_v1.a=1,void(this.m_count=1);if(a>0&&o>0&&g<=0){var
x=1/(a+o);return
this.m_v1.a=a*x,this.m_v2.a=o*x,void(this.m_count=2)}if(c>0&&u>0&&y<=0){var
b=1/(c+u);return this.m_v1.a=c*b,this.m_v3.a=u*b,this.m_count=2,void
this.m_v2.Copy(this.m_v3)}if(a<=0&&m<=0)return this.m_v2.a=1,this.m_count=1,void
this.m_v1.Copy(this.m_v2);if(c<=0&&d<=0)return this.m_v3.a=1,this.m_count=1,void
this.m_v1.Copy(this.m_v3);if(d>0&&m>0&&v<=0){var A=1/(d+m);return
this.m_v2.a=d*A,this.m_v3.a=m*A,this.m_count=2,void this.m_v1.Copy(this.m_v3)}var
C=1/(v+y+g);this.m_v1.a=v*C,this.m_v2.a=y*C,this.m_v3.a=g*C,this.m_count=3},t.s_e12
=new I,t.s_e13=new I,t.s_e23=new I,t})(),et=new tt,it=[0,0,0],nt=[0,0,0],rt=new
I,st=new I,at=new I,ot=new I,lt=new I;function ht(e,i,s){++t.b2_gjkCalls;var
a=s.proxyA,o=s.proxyB,l=s.transformA,h=s.transformB,c=et;c.ReadCache(i,a,l,o,h);for
(var u=c.m_vertices,_=it,f=nt,d=0,m=0;m<20;){d=c.m_count;for(var p=0;p<d;+
+p)_[p]=u[p].indexA,f[p]=u[p].indexB;switch(c.m_count){case 1:break;case
2:c.Solve2();break;case 3:c.Solve3()}if(3===c.m_count)break;var
v=c.GetSearchDirection(st);if(v.LengthSquared()<r)break;var
y=u[c.m_count];y.indexA=a.GetSupport(V.MulTRV(l.q,I.NegV(v,I.s_t0),ot)),N.MulXV(l,a
.GetVertex(y.indexA),y.wA),y.indexB=o.GetSupport(V.MulTRV(h.q,v,lt)),N.MulXV(h,o.Ge
tVertex(y.indexB),y.wB),I.SubVV(y.wB,y.wA,y.w),++m,++t.b2_gjkIters;var g=!
1;for(p=0;p<d;++p)if(y.indexA===_[p]&&y.indexB===f[p]){g=!0;break}if(g)break;+
+c.m_count}if(t.b2_gjkMaxIters=x(t.b2_gjkMaxIters,m),c.GetWitnessPoints(e.pointA,e.
pointB),e.distance=I.DistanceVV(e.pointA,e.pointB),e.iterations=m,c.WriteCache(i),s
.useRadii){var b=a.m_radius,A=o.m_radius;if(e.distance>b+A&&e.distance>n)
{e.distance-=b+A;var
C=I.SubVV(e.pointB,e.pointA,at);C.Normalize(),e.pointA.SelfMulAdd(b,C),e.pointB.Sel
fMulSub(A,C)}else{var
S=I.MidVV(e.pointA,e.pointB,rt);e.pointA.Copy(S),e.pointB.Copy(S),e.distance=0}}}va
r ct=new I,ut=new tt,_t=new I,ft=new I,dt=new I,mt=new I,pt=new I,vt=new I;
(function(t){t[t.e_vertex=0]="e_vertex",t[t.e_face=1]="e_face"})
(t.b2ContactFeatureType||(t.b2ContactFeatureType={}));var yt=(function(){function
t(){this._key=0,this._key_invalid=!
1,this._indexA=0,this._indexB=0,this._typeA=0,this._typeB=0}return
Object.defineProperty(t.prototype,"key",{get:function(){return
this._key_invalid&&(this._key_invalid=!1,this._key=this._indexA|this._indexB<<8|
this._typeA<<16|this._typeB<<24),this._key},set:function(t)
{this._key=t,this._key_invalid=!
1,this._indexA=255&this._key,this._indexB=this._key>>8&255,this._typeA=this._key>>1
6&255,this._typeB=this._key>>24&255},enumerable:!0,configurable:!
0}),Object.defineProperty(t.prototype,"indexA",{get:function(){return
this._indexA},set:function(t){this._indexA=t,this._key_invalid=!0},enumerable:!
0,configurable:!0}),Object.defineProperty(t.prototype,"indexB",{get:function()
{return this._indexB},set:function(t){this._indexB=t,this._key_invalid=!
0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"typeA",
{get:function(){return this._typeA},set:function(t)
{this._typeA=t,this._key_invalid=!0},enumerable:!0,configurable:!
0}),Object.defineProperty(t.prototype,"typeB",{get:function(){return
this._typeB},set:function(t){this._typeB=t,this._key_invalid=!0},enumerable:!
0,configurable:!0}),t})(),gt=(function(){function t(){this.cf=new yt}return
t.prototype.Copy=function(t){return
this.key=t.key,this},t.prototype.Clone=function(){return(new
t).Copy(this)},Object.defineProperty(t.prototype,"key",{get:function(){return
this.cf.key},set:function(t){this.cf.key=t},enumerable:!0,configurable:!0}),t})
(),xt=(function(){function t(){this.localPoint=new
I,this.normalImpulse=0,this.tangentImpulse=0,this.id=new gt}return
t.MakeArray=function(e){return d(e,(function(e){return new
t}))},t.prototype.Reset=function()
{this.localPoint.SetZero(),this.normalImpulse=0,this.tangentImpulse=0,this.id.key=0
},t.prototype.Copy=function(t){return
this.localPoint.Copy(t.localPoint),this.normalImpulse=t.normalImpulse,this.tangentI
mpulse=t.tangentImpulse,this.id.Copy(t.id),this},t})();(function(t){t[t.e_unknown=-
1]="e_unknown",t[t.e_circles=0]="e_circles",t[t.e_faceA=1]="e_faceA",t[t.e_faceB=2]
="e_faceB"})(
t.b2ManifoldType||(t.b2ManifoldType={}));var bt=(function(){function e()
{this.points=xt.MakeArray(a),this.localNormal=new I,this.localPoint=new
I,this.type=t.b2ManifoldType.e_unknown,this.pointCount=0}return
e.prototype.Reset=function(){for(var e=0;e<a;+
+e)this.points[e].Reset();this.localNormal.SetZero(),this.localPoint.SetZero(),this
.type=t.b2ManifoldType.e_unknown,this.pointCount=0},e.prototype.Copy=function(t)
{this.pointCount=t.pointCount;for(var e=0;e<a;+
+e)this.points[e].Copy(t.points[e]);return
this.localNormal.Copy(t.localNormal),this.localPoint.Copy(t.localPoint),this.type=t
.type,this},e.prototype.Clone=function(){return(new e).Copy(this)},e})
(),At=(function(){function e(){this.normal=new
I,this.points=I.MakeArray(a),this.separations=m(a)}return
e.prototype.Initialize=function(i,n,s,a,o){if(0!==i.pointCount)switch(i.type){case
t.b2ManifoldType.e_circles:this.normal.Set(1,0);var
l=N.MulXV(n,i.localPoint,e.Initialize_s_pointA),h=N.MulXV(a,i.points[0].localPoint,
e.Initialize_s_pointB);I.DistanceSquaredVV(l,h)>r&&I.SubVV(h,l,this.normal).SelfNor
malize();var
c=I.AddVMulSV(l,s,this.normal,e.Initialize_s_cA),u=I.SubVMulSV(h,o,this.normal,e.In
itialize_s_cB);I.MidVV(c,u,this.points[0]),this.separations[0]=I.DotVV(I.SubVV(u,c,
I.s_t0),this.normal);break;case
t.b2ManifoldType.e_faceA:V.MulRV(n.q,i.localNormal,this.normal);for(var
_=N.MulXV(n,i.localPoint,e.Initialize_s_planePoint),f=0;f<i.pointCount;++f){var
d=N.MulXV(a,i.points[f].localPoint,e.Initialize_s_clipPoint),m=s-
I.DotVV(I.SubVV(d,_,I.s_t0),this.normal);c=I.AddVMulSV(d,m,this.normal,e.Initialize
_s_cA),u=I.SubVMulSV(d,o,this.normal,e.Initialize_s_cB);I.MidVV(c,u,this.points[f])
,this.separations[f]=I.DotVV(I.SubVV(u,c,I.s_t0),this.normal)}break;case
t.b2ManifoldType.e_faceB:V.MulRV(a.q,i.localNormal,this.normal);for(_=N.MulXV(a,i.l
ocalPoint,e.Initialize_s_planePoint),f=0;f<i.pointCount;++f)
{d=N.MulXV(n,i.points[f].localPoint,e.Initialize_s_clipPoint),m=o-
I.DotVV(I.SubVV(d,_,I.s_t0),this.normal),u=I.AddVMulSV(d,m,this.normal,e.Initialize
_s_cB),c=I.SubVMulSV(d,s,this.normal,e.Initialize_s_cA);I.MidVV(c,u,this.points[f])
,this.separations[f]=I.DotVV(I.SubVV(c,u,I.s_t0),this.normal)}this.normal.SelfNeg()
}},e.Initialize_s_pointA=new I,e.Initialize_s_pointB=new I,e.Initialize_s_cA=new
I,e.Initialize_s_cB=new I,e.Initialize_s_planePoint=new
I,e.Initialize_s_clipPoint=new I,e})();(function(t)
{t[t.b2_nullState=0]="b2_nullState",t[t.b2_addState=1]="b2_addState",t[t.b2_persist
State=2]="b2_persistState",t[t.b2_removeState=3]="b2_removeState"})
(t.b2PointState||(t.b2PointState={}));var Ct=(function(){function t(){this.v=new
I,this.id=new gt}return t.MakeArray=function(e){return d(e,(function(e){return new
t}))},t.prototype.Copy=function(t){return
this.v.Copy(t.v),this.id.Copy(t.id),this},t})(),St=(function(){function t()
{this.p1=new I,this.p2=new I,this.maxFraction=1}return t.prototype.Copy=function(t)
{return
this.p1.Copy(t.p1),this.p2.Copy(t.p2),this.maxFraction=t.maxFraction,this},t})
(),Tt=(function(){function t(){this.normal=new I,this.fraction=0}return
t.prototype.Copy=function(t){return
this.normal.Copy(t.normal),this.fraction=t.fraction,this},t})(),wt=(function()
{function t(){this.lowerBound=new I,this.upperBound=new I,this.m_cache_center=new
I,this.m_cache_extent=new I}return t.prototype.Copy=function(t){return
this.lowerBound.Copy(t.lowerBound),this.upperBound.Copy(t.upperBound),this},t.proto
type.IsValid=function(){var t=this.upperBound.x-
this.lowerBound.x,e=this.upperBound.y-this.lowerBound.y,i=t>=0&&e>=0;return
i=i&&this.lowerBound.IsValid()&&this.upperBound.IsValid()},t.prototype.GetCenter=fu
nction(){return
I.MidVV(this.lowerBound,this.upperBound,this.m_cache_center)},t.prototype.GetExtent
s=function(){return
I.ExtVV(this.lowerBound,this.upperBound,this.m_cache_extent)},t.prototype.GetPerime
ter=function(){return 2*(this.upperBound.x-this.lowerBound.x+(this.upperBound.y-
this.lowerBound.y))},t.prototype.Combine1=function(t){return
this.lowerBound.x=g(this.lowerBound.x,t.lowerBound.x),this.lowerBound.y=g(this.lowe
rBound.y,t.lowerBound.y),this.upperBound.x=x(this.upperBound.x,t.upperBound.x),this
.upperBound.y=x(this.upperBound.y,t.upperBound.y),this},t.prototype.Combine2=functi
on(t,e){return
this.lowerBound.x=g(t.lowerBound.x,e.lowerBound.x),this.lowerBound.y=g(t.lowerBound
.y,e.lowerBound.y),this.upperBound.x=x(t.upperBound.x,e.upperBound.x),this.upperBou
nd.y=x(t.upperBound.y,e.upperBound.y),this},t.Combine=function(t,e,i){return
i.Combine2(t,e),i},t.prototype.Contains=function(t){var e=!0;return
e=(e=(e=(e=e&&this.lowerBound.x<=t.lowerBound.x)&&this.lowerBound.y<=t.lowerBound.y
)&&t.upperBound.x<=this.upperBound.x)&&t.upperBound.y<=this.upperBound.y},t.prototy
pe.RayCast=function(t,e){var r=-i,s=i,a=e.p1.x,o=e.p1.y,l=e.p2.x-e.p1.x,h=e.p2.y-
e.p1.y,c=y(l),u=y(h),_=t.normal;if(c<n){if(a<this.lowerBound.x||
this.upperBound.x<a)return!1}else{var f=1/l,d=-1;if((p=(this.lowerBound.x-
a)*f)>(v=(this.upperBound.x-a)*f)){var
m=p;p=v,v=m,d=1}if(p>r&&(_.x=d,_.y=0,r=p),r>(s=g(s,v)))return!1}if(u<n)
{if(o<this.lowerBound.y||this.upperBound.y<o)return!1}else{var p,v;f=1/h,d=-
1;if((p=(this.lowerBound.y-o)*f)>(v=(this.upperBound.y-o)*f))
{m=p;p=v,v=m,d=1}if(p>r&&(_.x=0,_.y=d,r=p),r>(s=g(s,v)))return!1}return!(r<0||
e.maxFraction<r)&&(t.fraction=r,!0)},t.prototype.TestContain=function(t){return!
(t.x<this.lowerBound.x||this.upperBound.x<t.x)&&!(t.y<this.lowerBound.y||
this.upperBound.y<t.y)},t.prototype.TestOverlap=function(t){var e=t.lowerBound.x-
this.upperBound.x,i=t.lowerBound.y-this.upperBound.y,n=this.lowerBound.x-
t.upperBound.x,r=this.lowerBound.y-t.upperBound.y;return!(e>0||i>0)&&!(n>0||
r>0)},t})();function Et(t,e){var i=e.lowerBound.x-t.upperBound.x,n=e.lowerBound.y-
t.upperBound.y,r=t.lowerBound.x-e.upperBound.x,s=t.lowerBound.y-
e.upperBound.y;return!(i>0||n>0)&&!(r>0||s>0)}function Mt(e,i,n,r,s){var
a=0,o=i[0],l=i[1],h=I.DotVV(n,o.v)-r,c=I.DotVV(n,l.v)-r;if(h<=0&&e[a+
+].Copy(o),c<=0&&e[a++].Copy(l),h*c<0){var u=h/(h-c),_=e[a].v;_.x=o.v.x+u*(l.v.x-
o.v.x),_.y=o.v.y+u*(l.v.y-o.v.y);var
f=e[a].id;f.cf.indexA=s,f.cf.indexB=o.id.cf.indexB,f.cf.typeA=t.b2ContactFeatureTyp
e.e_vertex,f.cf.typeB=t.b2ContactFeatureType.e_face,++a}return a}var Dt=new
J,Bt=new Y,Pt=new Z;function It(t,e,i,r,s,a){var
o=Dt.Reset();o.proxyA.SetShape(t,e),o.proxyB.SetShape(i,r),o.transformA.Copy(s),o.t
ransformB.Copy(a),o.useRadii=!0;var l=Bt.Reset();l.count=0;var h=Pt.Reset();return
ht(h,l,o),h.distance<10*n}function Rt(t){if(null===t)throw new Error;return t}var
Ot=(function(){function t(t){void 0===t&&(t=0),this.m_id=0,this.aabb=new
wt,this.parent=null,this.child1=null,this.child2=null,this.height=0,this.m_id=t}ret
urn t.prototype.IsLeaf=function(){return null===this.child1},t})(),Lt=(function()
{function t()
{this.m_root=null,this.m_freeList=null,this.m_path=0,this.m_insertionCount=0,this.m
_stack=new W(256)}return t.prototype.Query=function(t,e){if(null!==this.m_root){var
i=this.m_stack.Reset();for(i.Push(this.m_root);i.GetCount()>0;){var
n=i.Pop();if(n.aabb.TestOverlap(t))if(n.IsLeaf()){if(!e(n))return}else
i.Push(Rt(n.child1)),i.Push(Rt(n.child2))}}},t.prototype.QueryPoint=function(t,e)
{if(null!==this.m_root){var
i=this.m_stack.Reset();for(i.Push(this.m_root);i.GetCount()>0;){var
n=i.Pop();if(n.aabb.TestContain(t))if(n.IsLeaf()){if(!e(n))return}else
i.Push(Rt(n.child1)),i.Push(Rt(n.child2))}}},t.prototype.RayCast=function(e,i)
{if(null!==this.m_root){var n=e.p1,r=e.p2,s=I.SubVV(r,n,t.s_r);s.Normalize();var
a=I.CrossOneV(s,t.s_v),o=I.AbsV(a,t.s_abs_v),l=e.maxFraction,h=t.s_segmentAABB,c=n.
x+l*(r.x-n.x),u=n.y+l*(r.y-
n.y);h.lowerBound.x=g(n.x,c),h.lowerBound.y=g(n.y,u),h.upperBound.x=x(n.x,c),h.uppe
rBound.y=x(n.y,u);var
_=this.m_stack.Reset();for(_.Push(this.m_root);_.GetCount()>0;){var
f=_.Pop();if(Et(f.aabb,h)){var d=f.aabb.GetCenter(),m=f.aabb.GetExtents();if(!
(y(I.DotVV(a,I.SubVV(n,d,I.s_t0)))-I.DotVV(o,m)>0))if(f.IsLeaf()){var
p=t.s_subInput;p.p1.Copy(e.p1),p.p2.Copy(e.p2),p.maxFraction=l;var
v=i(p,f);if(0===v)return;v>0&&(l=v,c=n.x+l*(r.x-n.x),u=n.y+l*(r.y-
n.y),h.lowerBound.x=g(n.x,c),h.lowerBound.y=g(n.y,u),h.upperBound.x=x(n.x,c),h.uppe
rBound.y=x(n.y,u))}else
_.Push(Rt(f.child1)),_.Push(Rt(f.child2))}}}},t.prototype.AllocateNode=function()
{if(this.m_freeList){var e=this.m_freeList;return
this.m_freeList=e.parent,e.parent=null,e.child1=null,e.child2=null,e.height=0,delet
e e.userData,e}return new Ot(t.s_node_id++)},t.prototype.FreeNode=function(t)
{t.parent=this.m_freeList,t.child1=null,t.child2=null,t.height=-1,delete
t.userData,this.m_freeList=t},t.prototype.CreateProxy=function(t,e){var
i=this.AllocateNode();return
i.aabb.lowerBound.x=t.lowerBound.x-.1,i.aabb.lowerBound.y=t.lowerBound.y-.1,i.aabb.
upperBound.x=t.upperBound.x+.1,i.aabb.upperBound.y=t.upperBound.y+.1,i.userData=e,i
.height=0,this.InsertLeaf(i),i},t.prototype.DestroyProxy=function(t)
{this.RemoveLeaf(t),this.FreeNode(t)},t.prototype.MoveProxy=function(t,e,i)
{if(t.aabb.Contains(e))return!1;this.RemoveLeaf(t);var n=.1+2*(i.x>0?i.x:-
i.x),r=.1+2*(i.y>0?i.y:-i.y);return t.aabb.lowerBound.x=e.lowerBound.x-
n,t.aabb.lowerBound.y=e.lowerBound.y-
r,t.aabb.upperBound.x=e.upperBound.x+n,t.aabb.upperBound.y=e.upperBound.y+r,this.In
sertLeaf(t),!0},t.prototype.InsertLeaf=function(e){if(+
+this.m_insertionCount,null===this.m_root)return
this.m_root=e,void(this.m_root.parent=null);for(var i=e.aabb,n=this.m_root;!
n.IsLeaf();){var
r=Rt(n.child1),s=Rt(n.child2),a=n.aabb.GetPerimeter(),o=t.s_combinedAABB;o.Combine2
(n.aabb,i);var l=o.GetPerimeter(),h=2*l,c=2*(l-a),u=void 0,_=t.s_aabb,f=void
0;r.IsLeaf()?(_.Combine2(i,r.aabb),u=_.GetPerimeter()+c):
(_.Combine2(i,r.aabb),f=r.aabb.GetPerimeter(),u=_.GetPerimeter()-f+c);var d=void
0;if(s.IsLeaf()?(_.Combine2(i,s.aabb),d=_.GetPerimeter()+c):
(_.Combine2(i,s.aabb),f=s.aabb.GetPerimeter(),d=_.GetPerimeter()-
f+c),h<u&&h<d)break;n=u<d?r:s}var
m=n,p=m.parent,v=this.AllocateNode();v.parent=p,delete
v.userData,v.aabb.Combine2(i,m.aabb),v.height=m.height+1,p?(p.child1===m?
p.child1=v:p.child2=v,v.child1=m,v.child2=e,m.parent=v,e.parent
=v):(v.child1=m,v.child2=e,m.parent=v,e.parent=v,this.m_root=v);for(var
y=e.parent;null!==y;)
{r=Rt((y=this.Balance(y)).child1),s=Rt(y.child2);y.height=1+x(r.height,s.height),y.
aabb.Combine2(r.aabb,s.aabb),y=y.parent}},t.prototype.RemoveLeaf=function(t){if(t!
==this.m_root){var e,i=Rt(t.parent),n=i&&i.parent;if(e=i.child1===t?
Rt(i.child2):Rt(i.child1),n){n.child1===i?
n.child1=e:n.child2=e,e.parent=n,this.FreeNode(i);for(var r=n;r;){var
s=Rt((r=this.Balance(r)).child1),a=Rt(r.child2);r.aabb.Combine2(s.aabb,a.aabb),r.he
ight=1+x(s.height,a.height),r=r.parent}}else
this.m_root=e,e.parent=null,this.FreeNode(i)}else
this.m_root=null},t.prototype.Balance=function(t){if(t.IsLeaf()||t.height<2)return
t;var e=Rt(t.child1),i=Rt(t.child2),n=i.height-e.height;if(n>1){var
r=Rt(i.child1),s=Rt(i.child2);return i.child1=t,i.parent=t.parent,t.parent=i,null!
==i.parent?i.parent.child1===t?
i.parent.child1=i:i.parent.child2=i:this.m_root=i,r.height>s.height?
(i.child2=r,t.child2=s,s.parent=t,t.aabb.Combine2(e.aabb,s.aabb),i.aabb.Combine2(t.
aabb,r.aabb),t.height=1+x(e.height,s.height),i.height=1+x(t.height,r.height)):
(i.child2=s,t.child2=r,r.parent=t,t.aabb.Combine2(e.aabb,r.aabb),i.aabb.Combine2(t.
aabb,s.aabb),t.height=1+x(e.height,r.height),i.height=1+x(t.height,s.height)),i}if(
n<-1){var a=Rt(e.child1),o=Rt(e.child2);return
e.child1=t,e.parent=t.parent,t.parent=e,null!==e.parent?e.parent.child1===t?
e.parent.child1=e:e.parent.child2=e:this.m_root=e,a.height>o.height?
(e.child2=a,t.child1=o,o.parent=t,t.aabb.Combine2(i.aabb,o.aabb),e.aabb.Combine2(t.
aabb,a.aabb),t.height=1+x(i.height,o.height),e.height=1+x(t.height,a.height)):
(e.child2=o,t.child1=a,a.parent=t,t.aabb.Combine2(i.aabb,a.aabb),e.aabb.Combine2(t.
aabb,o.aabb),t.height=1+x(i.height,a.height),e.height=1+x(t.height,o.height)),e}ret
urn t},t.prototype.GetHeight=function(){return null===this.m_root?
0:this.m_root.height},t.GetAreaNode=function(e){if(null===e)return
0;if(e.IsLeaf())return 0;var i=e.aabb.GetPerimeter();return
i+=t.GetAreaNode(e.child1),i+=t.GetAreaNode(e.child2)},t.prototype.GetAreaRatio=fun
ction(){if(null===this.m_root)return 0;var e=this.m_root.aabb.GetPerimeter();return
t.GetAreaNode(this.m_root)/e},t.prototype.ComputeHeightNode=function(t){if(!t||
t.IsLeaf())return 0;var
e=this.ComputeHeightNode(t.child1),i=this.ComputeHeightNode(t.child2);return
1+x(e,i)},t.prototype.ComputeHeight=function(){return
this.ComputeHeightNode(this.m_root)},t.prototype.ValidateStructure=function(t)
{if(null!==t){this.m_root;var e=t;if(!e.IsLeaf()){var
i=Rt(e.child1),n=Rt(e.child2);this.ValidateStructure(i),this.ValidateStructure(n)}}
},t.prototype.ValidateMetrics=function(e){if(null!==e){var i=e;if(!i.IsLeaf()){var
n=Rt(i.child1),r=Rt(i.child2);t.s_aabb.Combine2(n.aabb,r.aabb),this.ValidateMetrics
(n),this.ValidateMetrics(r)}}},t.prototype.Validate=function()
{},t.GetMaxBalanceNode=function(t,e){if(null===t)return e;if(t.height<=1)return
e;var i=Rt(t.child1),n=Rt(t.child2),r=y(n.height-i.height);return
x(e,r)},t.prototype.GetMaxBalance=function(){return
t.GetMaxBalanceNode(this.m_root,0)},t.prototype.RebuildBottomUp=function()
{this.Validate()},t.ShiftOriginNode=function(e,i){if(null!==e&&!(e.height<=1)){var
n=e.child1,r=e.child2;t.ShiftOriginNode(n,i),t.ShiftOriginNode(r,i),e.aabb.lowerBou
nd.SelfSub(i),e.aabb.upperBound.SelfSub(i)}},t.prototype.ShiftOrigin=function(e)
{t.ShiftOriginNode(this.m_root,e)},t.s_r=new I,t.s_v=new I,t.s_abs_v=new
I,t.s_segmentAABB=new wt,t.s_subInput=new St,t.s_combinedAABB=new wt,t.s_aabb=new
wt,t.s_node_id=0,t})(),Ft=(function(){return function(t,e)
{this.proxyA=t,this.proxyB=e}})(),Vt=(function(){function t(){this.m_tree=new
Lt,this.m_proxyCount=0,this.m_moveCount=0,this.m_moveBuffer=[],this.m_pairCount=0,t
his.m_pairBuffer=[]}return t.prototype.CreateProxy=function(t,e){var
i=this.m_tree.CreateProxy(t,e);return+
+this.m_proxyCount,this.BufferMove(i),i},t.prototype.DestroyProxy=function(t)
{this.UnBufferMove(t),--
this.m_proxyCount,this.m_tree.DestroyProxy(t)},t.prototype.MoveProxy=function(t,e,i
)
{this.m_tree.MoveProxy(t,e,i)&&this.BufferMove(t)},t.prototype.TouchProxy=function(
t){this.BufferMove(t)},t.prototype.GetProxyCount=function(){return
this.m_proxyCount},t.prototype.UpdatePairs=function(t){var
e=this;this.m_pairCount=0;for(var i=function(t){var
i=n.m_moveBuffer[t];if(null===i)return"continue";var r=i.aabb;n.m_tree.Query(r,
(function(t){if(t.m_id===i.m_id)return!0;var n,r;if(t.m_id<i.m_id?(n=t,r=i):
(n=i,r=t),e.m_pairCount===e.m_pairBuffer.length)e.m_pairBuffer[e.m_pairCount]=new
Ft(n,r);else{var s=e.m_pairBuffer[e.m_pairCount];s.proxyA=n,s.proxyB=r}return+
+e.m_pairCount,!0}))},n=this,r=0;r<this.m_moveCount;+
+r)i(r);this.m_moveCount=0,this.m_pairBuffer.length=this.m_pairCount,this.m_pairBuf
fer.sort(Nt);for(var s=0;s<this.m_pairCount;){var
a=this.m_pairBuffer[s],o=a.proxyA.userData,l=a.proxyB.userData;for(o&&l&&t(o,l),+
+s;s<this.m_pairCount;){var h=this.m_pairBuffer[s];if(h.proxyA.m_id!
==a.proxyA.m_id||h.proxyB.m_id!==a.proxyB.m_id)break;+
+s}}},t.prototype.Query=function(t,e)
{this.m_tree.Query(t,e)},t.prototype.QueryPoint=function(t,e)
{this.m_tree.QueryPoint(t,e)},t.prototype.RayCast=function(t,e)
{this.m_tree.RayCast(t,e)},t.prototype.GetTreeHeight=function(){return
this.m_tree.GetHeight()},t.prototype.GetTreeBalance=function(){return
this.m_tree.GetMaxBalance()},t.prototype.GetTreeQuality=function(){return
this.m_tree.GetAreaRatio()},t.prototype.ShiftOrigin=function(t)
{this.m_tree.ShiftOrigin(t)},t.prototype.BufferMove=function(t)
{this.m_moveBuffer[this.m_moveCount]=t,+
+this.m_moveCount},t.prototype.UnBufferMove=function(t){var
e=this.m_moveBuffer.indexOf(t);this.m_moveBuffer[e]=null},t})();function Nt(t,e)
{return t.proxyA.m_id===e.proxyA.m_id?t.proxyB.m_id-e.proxyB.m_id:t.proxyA.m_id-
e.proxyA.m_id}t.b2_toiTime=0,t.b2_toiMaxTime=0,t.b2_toiCalls=0,t.b2_toiIters=0,t.b2
_toiMaxIters=0,t.b2_toiRootIters=0,t.b2_toiMaxRootIters=0;var kt=new N,Gt=new
N,zt=new I,Ut=new I,jt=new I,Wt=new I,Ht=new I,Xt=(function(){return function()
{this.proxyA=new q,this.proxyB=new q,this.sweepA=new k,this.sweepB=new
k,this.tMax=0}})();(function(t)
{t[t.e_unknown=0]="e_unknown",t[t.e_failed=1]="e_failed",t[t.e_overlapped=2]="e_ove
rlapped",t[t.e_touching=3]="e_touching",t[t.e_separated=4]="e_separated"})
(t.b2TOIOutputState||(t.b2TOIOutputState={}));var qt=(function(){return function()
{this.state=t.b2TOIOutputState.e_unknown,this.t=0}})();(function(t){t[t.e_unknown=-
1]="e_unknown",t[t.e_points=0]="e_points",t[t.e_faceA=1]="e_faceA",t[t.e_faceB=2]="
e_faceB"})(t.b2SeparationFunctionType||(t.b2SeparationFunctionType={}));var
Yt=(function(){function e(){this.m_sweepA=new k,this.m_sweepB=new
k,this.m_type=t.b2SeparationFunctionType.e_unknown,this.m_localPoint=new
I,this.m_axis=new I}return e.prototype.Initialize=function(e,i,n,r,s,a)
{this.m_proxyA=i,this.m_proxyB=r;var
o=e.count;this.m_sweepA.Copy(n),this.m_sweepB.Copy(s);var
l=kt,h=Gt;if(this.m_sweepA.GetTransform(l,a),this.m_sweepB.GetTransform(h,a),1===o)
{this.m_type=t.b2SeparationFunctionType.e_points;var
c=this.m_proxyA.GetVertex(e.indexA[0]),u=this.m_proxyB.GetVertex(e.indexB[0]),_=N.M
ulXV(l,c,zt),f=N.MulXV(h,u,Ut);I.SubVV(f,_,this.m_axis);var
d=this.m_axis.Normalize();return
this.m_localPoint.SetZero(),d}if(e.indexA[0]===e.indexA[1])
{this.m_type=t.b2SeparationFunctionType.e_faceB;var
m=this.m_proxyB.GetVertex(e.indexB[0]),p=this.m_proxyB.GetVertex(e.indexB[1]);I.Cro
ssVOne(I.SubVV(p,m,I.s_t0),this.m_axis).SelfNormalize();var
v=V.MulRV(h.q,this.m_axis,jt);I.MidVV(m,p,this.m_localPoint);f=N.MulXV(h,this.m_loc
alPoint,Ut),c=this.m_proxyA.GetVertex(e.indexA[0]),_=N.MulXV(l,c,zt);return(d=I.Dot
VV(I.SubVV(_,f,I.s_t0),v))<0&&(this.m_axis.SelfNeg(),d=-
d),d}this.m_type=t.b2SeparationFunctionType.e_faceA;var
y=this.m_proxyA.GetVertex(e.indexA[0]),g=this.m_proxyA.GetVertex(e.indexA[1]);I.Cro
ssVOne(I.SubVV(g,y,I.s_t0),this.m_axis).SelfNormalize();v=V.MulRV(l.q,this.m_axis,j
t);I.MidVV(y,g,this.m_localPoint);_=N.MulXV(l,this.m_localPoint,zt),u=this.m_proxyB
.GetVertex(e.indexB[0]),f=N.MulXV(h,u,Ut);return(d=I.DotVV(I.SubVV(f,_,I.s_t0),v))<
0&&(this.m_axis.SelfNeg(),d=-d),d},e.prototype.FindMinSeparation=function(e,i,n)
{var
r=kt,s=Gt;switch(this.m_sweepA.GetTransform(r,n),this.m_sweepB.GetTransform(s,n),th
is.m_type){case t.b2SeparationFunctionType.e_points:var
a=V.MulTRV(r.q,this.m_axis,Wt),o=V.MulTRV(s.q,I.NegV(this.m_axis,I.s_t0),Ht);e[0]=t
his.m_proxyA.GetSupport(a),i[0]=this.m_proxyB.GetSupport(o);var
l=this.m_proxyA.GetVertex(e[0]),h=this.m_proxyB.GetVertex(i[0]),c=N.MulXV(r,l,zt),u
=N.MulXV(s,h,Ut);return I.DotVV(I.SubVV(u,c,I.s_t0),this.m_axis);case
t.b2SeparationFunctionType.e_faceA:var
_=V.MulRV(r.q,this.m_axis,jt);c=N.MulXV(r,this.m_localPoint,zt),o=V.MulTRV(s.q,I.Ne
gV(_,I.s_t0),Ht);e[0]=-
1,i[0]=this.m_proxyB.GetSupport(o);h=this.m_proxyB.GetVertex(i[0]),u=N.MulXV(s,h,Ut
);return I.DotVV(I.SubVV(u,c,I.s_t0),_);case
t.b2SeparationFunctionType.e_faceB:_=V.MulRV(s.q,this.m_axis,jt),u=N.MulXV(s,this.m
_localPoint,Ut),a=V.MulTRV(r.q,I.NegV(_,I.s_t0),Wt);i[0]=-
1,e[0]=this.m_proxyA.GetSupport(a);l=this.m_proxyA.GetVertex(e[0]),c=N.MulXV(r,l,zt
);return I.DotVV(I.SubVV(c,u,I.s_t0),_);default:return e[0]=-1,i[0]=-
1,0}},e.prototype.Evaluate=function(e,i,n){var
r=kt,s=Gt;switch(this.m_sweepA.GetTransform(r,n),this.m_sweepB.GetTransform(s,n),th
is.m_type){case t.b2SeparationFunctionType.e_points:var
a=this.m_proxyA.GetVertex(e),o=this.m_proxyB.GetVertex(i),l=N.MulXV(r,a,zt),h=N.Mul
XV(s,o,Ut);return I.DotVV(I.SubVV(h,l,I.s_t0),this.m_axis);case
t.b2SeparationFunctionType.e_faceA:var
c=V.MulRV(r.q,this.m_axis,jt);l=N.MulXV(r,this.m_localPoint,zt),o=this.m_proxyB.Get
Vertex(i),h=N.MulXV(s,o,Ut);return I.DotVV(I.SubVV(h,l,I.s_t0),c);case
t.b2SeparationFunctionType.e_faceB:c=V.MulRV(s.q,this.m_axis,jt),h=N.MulXV(s,this.m
_localPoint,Ut),a=this.m_proxyA.GetVertex(e),l=N.MulXV(r,a,zt);return
I.DotVV(I.SubVV(l,h,I.s_t0),c);default:return 0}},e})(),Jt=new U,Zt=new Y,Kt=new
J,Qt=new
Z,$t=new Yt,te=[0],ee=[0],ie=new k,ne=new k;function re(e,i){var n=Jt.Reset();+
+t.b2_toiCalls,e.state=t.b2TOIOutputState.e_unknown,e.t=i.tMax;var
r=i.proxyA,s=i.proxyB,a=ie.Copy(i.sweepA),h=ne.Copy(i.sweepB);a.Normalize(),h.Norma
lize();var c=i.tMax,u=r.m_radius+s.m_radius,_=x(l,u-
3*l),f=.25*l,d=0,m=0,p=Zt;p.count=0;var
v=Kt;for(v.proxyA.Copy(i.proxyA),v.proxyB.Copy(i.proxyB),v.useRadii=!1;;){var
g=kt,b=Gt;a.GetTransform(g,d),h.GetTransform(b,d),v.transformA.Copy(g),v.transformB
.Copy(b);var A=Qt;if(ht(A,p,v),A.distance<=0)
{e.state=t.b2TOIOutputState.e_overlapped,e.t=0;break}if(A.distance<_+f)
{e.state=t.b2TOIOutputState.e_touching,e.t=d;break}var
C=$t;C.Initialize(p,r,a,s,h,d);for(var S=!1,T=c,w=0;;){var
E=te,M=ee,D=C.FindMinSeparation(E,M,T);if(D>_+f)
{e.state=t.b2TOIOutputState.e_separated,e.t=c,S=!0;break}if(D>_-f){d=T;break}var
B=C.Evaluate(E[0],M[0],d);if(B<_-f){e.state=t.b2TOIOutputState.e_failed,e.t=d,S=!
0;break}if(B<=_+f){e.state=t.b2TOIOutputState.e_touching,e.t=d,S=!0;break}for(var
P=0,I=d,R=T;;){var O=0;O=1&P?I+(_-B)*(R-I)/(D-B):.5*(I+R),++P,+
+t.b2_toiRootIters;var L=C.Evaluate(E[0],M[0],O);if(y(L-_)<f){T=O;break}if(L>_?
(I=O,B=L):(R=O,D=L),50===P)break}if(t.b2_toiMaxRootIters=x(t.b2_toiMaxRootIters,P),
++w===o)break}if(++m,++t.b2_toiIters,S)break;if(20===m)
{e.state=t.b2TOIOutputState.e_failed,e.t=d;break}}t.b2_toiMaxIters=x(t.b2_toiMaxIte
rs,m);var
F=n.GetMilliseconds();t.b2_toiMaxTime=x(t.b2_toiMaxTime,F),t.b2_toiTime+=F}var
se=new I,ae=new I;function oe(e,i,n,r,s){e.pointCount=0;var
a=N.MulXV(n,i.m_p,se),o=N.MulXV(s,r.m_p,ae),l=I.DistanceSquaredVV(a,o),h=i.m_radius
+r.m_radius;l>h*h||
(e.type=t.b2ManifoldType.e_circles,e.localPoint.Copy(i.m_p),e.localNormal.SetZero()
,e.pointCount=1,e.points[0].localPoint.Copy(r.m_p),e.points[0].id.key=0)}var le=new
I,he=new I,ce=new I;function ue(e,r,s,a,o){e.pointCount=0;for(var
l=N.MulXV(o,a.m_p,le),h=N.MulTXV(s,l,he),c=0,u=-
i,_=r.m_radius+a.m_radius,f=r.m_count,d=r.m_vertices,m=r.m_normals,p=0;p<f;++p){var
v=I.DotVV(m[p],I.SubVV(h,d[p],I.s_t0));if(v>_)return;v>u&&(u=v,c=p)}var
y=c,g=(y+1)%f,x=d[y],b=d[g];if(u<n)return
e.pointCount=1,e.type=t.b2ManifoldType.e_faceA,e.localNormal.Copy(m[c]),I.MidVV(x,b
,e.localPoint),e.points[0].localPoint.Copy(a.m_p),void(e.points[0].id.key=0);var
A=I.DotVV(I.SubVV(h,x,I.s_t0),I.SubVV(b,x,I.s_t1)),C=I.DotVV(I.SubVV(h,b,I.s_t0),I.
SubVV(x,b,I.s_t1));if(A<=0)
{if(I.DistanceSquaredVV(h,x)>_*_)return;e.pointCount=1,e.type=t.b2ManifoldType.e_fa
ceA,I.SubVV(h,x,e.localNormal).SelfNormalize(),e.localPoint.Copy(x),e.points[0].loc
alPoint.Copy(a.m_p),e.points[0].id.key=0}else if(C<=0)
{if(I.DistanceSquaredVV(h,b)>_*_)return;e.pointCount=1,e.type=t.b2ManifoldType.e_fa
ceA,I.SubVV(h,b,e.localNormal).SelfNormalize(),e.localPoint.Copy(b),e.points[0].loc
alPoint.Copy(a.m_p),e.points[0].id.key=0}else{var
S=I.MidVV(x,b,ce);if(I.DotVV(I.SubVV(h,S,I.s_t1),m[y])>_)return;e.pointCount=1,e.ty
pe=t.b2ManifoldType.e_faceA,e.localNormal.Copy(m[y]).SelfNormalize(),e.localPoint.C
opy(S),e.points[0].localPoint.Copy(a.m_p),e.points[0].id.key=0}}var _e=new I,fe=new
I,de=new I,me=new I;function pe(t,e,n,r,s){for(var
a=t.m_vertices,o=t.m_normals,l=r.m_count,h=r.m_vertices,c=V.MulRV(e.q,o[n],_e),u=V.
MulTRV(s.q,c,fe),_=0,f=i,d=0;d<l;++d){var m=I.DotVV(h[d],u);m<f&&(f=m,_=d)}var
p=N.MulXV(e,a[n],de),v=N.MulXV(s,h[_],me);return I.DotVV(I.SubVV(v,p,I.s_t0),c)}var
ve=new I,ye=new I;function ge(t,e,n,r,s){for(var
a=e.m_count,o=e.m_normals,l=I.SubVV(N.MulXV(s,r.m_centroid,I.s_t0),N.MulXV(n,e.m_ce
ntroid,I.s_t1),ve),h=V.MulTRV(n.q,l,ye),c=0,u=-i,_=0;_<a;++_){var
f=I.DotVV(o[_],h);f>u&&(u=f,c=_)}var d=pe(e,n,c,r,s),m=(c+a-
1)%a,p=pe(e,n,m,r,s),v=(c+1)%a,y=pe(e,n,v,r,s),g=0,x=0,b=0;if(p>d&&p>y)b=-
1,g=m,x=p;else{if(!(y>d))return t[0]=c,d;b=1,g=v,x=y}for(;(d=pe(e,n,c=-1===b?(g+a-
1)%a:(g+1)%a,r,s))>x;)g=c,x=d;return t[0]=g,x}var xe=new I;function be(e,n,r,s,a,o)
{for(var
l=n.m_normals,h=a.m_count,c=a.m_vertices,u=a.m_normals,_=V.MulTRV(o.q,V.MulRV(r.q,l
[s],I.s_t0),xe),f=0,d=i,m=0;m<h;++m){var p=I.DotVV(_,u[m]);p<d&&(d=p,f=m)}var
v=f,y=(v+1)%h,g=e[0];N.MulXV(o,c[v],g.v);var
x=g.id.cf;x.indexA=s,x.indexB=v,x.typeA=t.b2ContactFeatureType.e_face,x.typeB=t.b2C
ontactFeatureType.e_vertex;var b=e[1];N.MulXV(o,c[y],b.v);var
A=b.id.cf;A.indexA=s,A.indexB=y,A.typeA=t.b2ContactFeatureType.e_face,A.typeB=t.b2C
ontactFeatureType.e_vertex}var
Ae=Ct.MakeArray(2),Ce=Ct.MakeArray(2),Se=Ct.MakeArray(2),Te=[0],we=[0],Ee=new
I,Me=new I,De=new I,Be=new I,Pe=new I,Ie=new I,Re=new I,Oe=new I;function
Le(e,i,n,r,s){e.pointCount=0;var o=i.m_radius+r.m_radius,l=Te;l[0]=0;var
h=ge(l,i,n,r,s);if(!(h>o)){var c=we;c[0]=0;var u=ge(c,r,s,i,n);if(!(u>o)){var
_,f,d,m,p=0,v=0;u>.98*h+.001?
(_=r,f=i,d=s,m=n,p=c[0],e.type=t.b2ManifoldType.e_faceB,v=1):
(_=i,f=r,d=n,m=s,p=l[0],e.type=t.b2ManifoldType.e_faceA,v=0);var
y=Ae;be(y,_,d,p,f,m);var
g=_.m_count,x=_.m_vertices,b=p,A=(p+1)%g,C=x[b],S=x[A],T=I.SubVV(S,C,Ee);T.Normaliz
e();var
w=I.CrossVOne(T,Me),E=I.MidVV(C,S,De),M=V.MulRV(d.q,T,Pe),D=I.CrossVOne(M,Be),B=N.M
ulXV(d,C,Re),P=N.MulXV(d,S,Oe),R=I.DotVV(D,B),O=-I.DotVV(M,B)+o,L=I.DotVV(M,P)
+o,F=Ce,k=Se;if(!(Mt(F,y,I.NegV(M,Ie),O,b)<2||Mt(k,F,M,L,A)<2))
{e.localNormal.Copy(w),e.localPoint.Copy(E);for(var G=0,z=0;z<a;++z){var
U=k[z];if(I.DotVV(D,U.v)-R<=o){var
j=e.points[G];if(N.MulTXV(m,U.v,j.localPoint),j.id.Copy(U.id),v){var
W=j.id.cf;j.id.cf.indexA=W.indexB,j.id.cf.indexB=W.indexA,j.id.cf.typeA=W.typeB,j.i
d.cf.typeB=W.typeA}++G}}e.pointCount=G}}}}var Fe=new I,Ve=new I,Ne=new I,ke=new
I,Ge=new I,ze=new I,Ue=new I,je=new gt;function We(e,i,n,r,s){e.pointCount=0;var
a=N.MulTXV(n,N.MulXV(s,r.m_p,I.s_t0),Fe),o=i.m_vertex1,l=i.m_vertex2,h=I.SubVV(l,o,
Ve),c=I.DotVV(h,I.SubVV(l,a,I.s_t0)),u=I.DotVV(h,I.SubVV(a,o,I.s_t0)),_=i.m_radius+
r.m_radius,f=je;if(f.cf.indexB=0,f.cf.typeB=t.b2ContactFeatureType.e_vertex,u<=0)
{var d=o,m=I.SubVV(a,d,Ne);if(I.DotVV(m,m)>_*_)return;if(i.m_hasVertex0){var
p=i.m_vertex0,v=o,y=I.SubVV(v,p,ke);if(I.DotVV(y,I.SubVV(v,a,I.s_t0))>0)return}retu
rn
f.cf.indexA=0,f.cf.typeA=t.b2ContactFeatureType.e_vertex,e.pointCount=1,e.type=t.b2
ManifoldType.e_circles,e.localNormal.SetZero(),e.localPoint.Copy(d),e.points[0].id.
Copy(f),void e.points[0].localPoint.Copy(r.m_p)}if(c<=0){var
g=l,x=I.SubVV(a,g,Ne);if(I.DotVV(x,x)>_*_)return;if(i.m_hasVertex3){var
b=i.m_vertex3,A=l,C=I.SubVV(b,A,Ge);if(I.DotVV(C,I.SubVV(a,A,I.s_t0))>0)return}retu
rn
f.cf.indexA=1,f.cf.typeA=t.b2ContactFeatureType.e_vertex,e.pointCount=1,e.type=t.b2
ManifoldType.e_circles,e.localNormal.SetZero(),e.localPoint.Copy(g),e.points[0].id.
Copy(f),void e.points[0].localPoint.Copy(r.m_p)}var
S=I.DotVV(h,h),T=ze;T.x=1/S*(c*o.x+u*l.x),T.y=1/S*(c*o.y+u*l.y);var
w=I.SubVV(a,T,Ne);if(!(I.DotVV(w,w)>_*_)){var E=Ue.Set(-
h.y,h.x);I.DotVV(E,I.SubVV(a,o,I.s_t0))<0&&E.Set(-E.x,-
E.y),E.Normalize(),f.cf.indexA=0,f.cf.typeA=t.b2ContactFeatureType.e_face,e.pointCo
unt=1,e.type=t.b2ManifoldType.e_faceA,e.localNormal.Copy(E),e.localPoint.Copy(o),e.
points[0].id.Copy(f),e.points[0].localPoint.Copy(r.m_p)}}var He=(function(){return
function(){this.type=0,this.index=0,this.separation=0}})(),Xe=(function(){return
function(){this.vertices=I.MakeArray(o),this.normals=I.MakeArray(o),this.count=0}})
(),qe=(function(){return function(){this.i1=0,this.i2=0,this.v1=new I,this.v2=new
I,this.normal=new I,this.sideNormal1=new I,this.sideOffset1=0,this.sideNormal2=new
I,this.sideOffset2=0}})(),Ye=new(function(){function e(){this.m_polygonB=new
Xe,this.m_xf=new N,this.m_centroidB=new I,this.m_v0=new I,this.m_v1=new
I,this.m_v2=new I,this.m_v3=new I,this.m_normal0=new I,this.m_normal1=new
I,this.m_normal2=new I,this.m_normal=new
I,this.m_type1=0,this.m_type2=0,this.m_lowerLimit=new I,this.m_upperLimit=new
I,this.m_radius=0,this.m_front=!1}return e.prototype.Collide=function(i,n,r,s,o)
{N.MulTXX(r,o,this.m_xf),N.MulXV(this.m_xf,s.m_centroid,this.m_centroidB),this.m_v0
.Copy(n.m_vertex0),this.m_v1.Copy(n.m_vertex1),this.m_v2.Copy(n.m_vertex2),this.m_v
3.Copy(n.m_vertex3);var
l=n.m_hasVertex0,h=n.m_hasVertex3,c=I.SubVV(this.m_v2,this.m_v1,e.s_edge1);c.Normal
ize(),this.m_normal1.Set(c.y,-c.x);var
u=I.DotVV(this.m_normal1,I.SubVV(this.m_centroidB,this.m_v1,I.s_t0)),_=0,f=0,d=!
1,m=!1;if(l){var
p=I.SubVV(this.m_v1,this.m_v0,e.s_edge0);p.Normalize(),this.m_normal0.Set(p.y,-
p.x),d=I.CrossVV(p,c)>=0,_=I.DotVV(this.m_normal0,I.SubVV(this.m_centroidB,this.m_v
0,I.s_t0))}if(h){var
v=I.SubVV(this.m_v3,this.m_v2,e.s_edge2);v.Normalize(),this.m_normal2.Set(v.y,-
v.x),m=I.CrossVV(c,v)>0,f=I.DotVV(this.m_normal2,I.SubVV(this.m_centroidB,this.m_v2
,I.s_t0))}l&&h?d&&m?(this.m_front=_>=0||u>=0||f>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal0),this.m_u
pperLimit.Copy(this.m_normal2)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal1).SelfNeg())):d?
(this.m_front=_>=0||u>=0&&f>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal0),this.m_u
pperLimit.Copy(this.m_normal1)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal2
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal1).SelfNeg())):m?
(this.m_front=f>=0||_>=0&&u>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1),this.m_u
pperLimit.Copy(this.m_normal2)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal0).SelfNeg())):
(this.m_front=_>=0&&u>=0&&f>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1),this.m_u
pperLimit.Copy(this.m_normal1)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal2
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal0).SelfNeg())):l?d?
(this.m_front=_>=0||u>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal0),this.m_u
pperLimit.Copy(this.m_normal1).SelfNeg()):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
),this.m_upper
Limit.Copy(this.m_normal1).SelfNeg())):(this.m_front=_>=0&&u>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1),this.m_u
pperLimit.Copy(this.m_normal1).SelfNeg()):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
),this.m_upperLimit.Copy(this.m_normal0).SelfNeg())):h?m?(this.m_front=u>=0||
f>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1).SelfNeg(
),this.m_upperLimit.Copy(this.m_normal2)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal1))):
(this.m_front=u>=0&&f>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1).SelfNeg(
),this.m_upperLimit.Copy(this.m_normal1)):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal2
).SelfNeg(),this.m_upperLimit.Copy(this.m_normal1))):
(this.m_front=u>=0,this.m_front?
(this.m_normal.Copy(this.m_normal1),this.m_lowerLimit.Copy(this.m_normal1).SelfNeg(
),this.m_upperLimit.Copy(this.m_normal1).SelfNeg()):
(this.m_normal.Copy(this.m_normal1).SelfNeg(),this.m_lowerLimit.Copy(this.m_normal1
),this.m_upperLimit.Copy(this.m_normal1))),this.m_polygonB.count=s.m_count;for(var
y=0;y<s.m_count;+
+y)N.MulXV(this.m_xf,s.m_vertices[y],this.m_polygonB.vertices[y]),V.MulRV(this.m_xf
.q,s.m_normals[y],this.m_polygonB.normals[y]);this.m_radius=s.m_radius+n.m_radius,i
.pointCount=0;var g=this.ComputeEdgeSeparation(e.s_edgeAxis);if(0!==g.type&&!
(g.separation>this.m_radius)){var
x=this.ComputePolygonSeparation(e.s_polygonAxis);if(!(0!
==x.type&&x.separation>this.m_radius)){var b;b=0===x.type?
g:x.separation>.98*g.separation+.001?x:g;var A=e.s_ie,C=e.s_rf;if(1===b.type)
{i.type=t.b2ManifoldType.e_faceA;var
S=0,T=I.DotVV(this.m_normal,this.m_polygonB.normals[0]);for(y=1;y<this.m_polygonB.c
ount;++y){var
w=I.DotVV(this.m_normal,this.m_polygonB.normals[y]);w<T&&(T=w,S=y)}var
E=S,M=(E+1)%this.m_polygonB.count;
(D=A[0]).v.Copy(this.m_polygonB.vertices[E]),D.id.cf.indexA=0,D.id.cf.indexB=E,D.id
.cf.typeA=t.b2ContactFeatureType.e_face,D.id.cf.typeB=t.b2ContactFeatureType.e_vert
ex,
(B=A[1]).v.Copy(this.m_polygonB.vertices[M]),B.id.cf.indexA=0,B.id.cf.indexB=M,B.id
.cf.typeA=t.b2ContactFeatureType.e_face,B.id.cf.typeB=t.b2ContactFeatureType.e_vert
ex,this.m_front?
(C.i1=0,C.i2=1,C.v1.Copy(this.m_v1),C.v2.Copy(this.m_v2),C.normal.Copy(this.m_norma
l1)):
(C.i1=1,C.i2=0,C.v1.Copy(this.m_v2),C.v2.Copy(this.m_v1),C.normal.Copy(this.m_norma
l1).SelfNeg())}else{var D,B;i.type=t.b2ManifoldType.e_faceB,
(D=A[0]).v.Copy(this.m_v1),D.id.cf.indexA=0,D.id.cf.indexB=b.index,D.id.cf.typeA=t.
b2ContactFeatureType.e_vertex,D.id.cf.typeB=t.b2ContactFeatureType.e_face,
(B=A[1]).v.Copy(this.m_v2),B.id.cf.indexA=0,B.id.cf.indexB=b.index,B.id.cf.typeA=t.
b2ContactFeatureType.e_vertex,B.id.cf.typeB=t.b2ContactFeatureType.e_face,C.i1=b.in
dex,C.i2=(C.i1+1)%this.m_polygonB.count,C.v1.Copy(this.m_polygonB.vertices[C.i1]),C
.v2.Copy(this.m_polygonB.vertices[C.i2]),C.normal.Copy(this.m_polygonB.normals[C.i1
])}C.sideNormal1.Set(C.normal.y,-
C.normal.x),C.sideNormal2.Copy(C.sideNormal1).SelfNeg(),C.sideOffset1=I.DotVV(C.sid
eNormal1,C.v1),C.sideOffset2=I.DotVV(C.sideNormal2,C.v2);var
P=e.s_clipPoints1,R=e.s_clipPoints2;if(!
(Mt(P,A,C.sideNormal1,C.sideOffset1,C.i1)<a||
Mt(R,P,C.sideNormal2,C.sideOffset2,C.i2)<a)){1===b.type?
(i.localNormal.Copy(C.normal),i.localPoint.Copy(C.v1)):
(i.localNormal.Copy(s.m_normals[C.i1]),i.localPoint.Copy(s.m_vertices[C.i1]));var
O=0;for(y=0;y<a;++y)
{if(I.DotVV(C.normal,I.SubVV(R[y].v,C.v1,I.s_t0))<=this.m_radius){var
L=i.points[O];1===b.type?(N.MulTXV(this.m_xf,R[y].v,L.localPoint),L.id=R[y].id):
(L.localPoint.Copy(R[y].v),L.id.cf.typeA=R[y].id.cf.typeB,L.id.cf.typeB=R[y].id.cf.
typeA,L.id.cf.indexA=R[y].id.cf.indexB,L.id.cf.indexB=R[y].id.cf.indexA),+
+O}}i.pointCount=O}}}},e.prototype.ComputeEdgeSeparation=function(t){var
e=t;e.type=1,e.index=this.m_front?0:1,e.separation=i;for(var
n=0;n<this.m_polygonB.count;++n){var
r=I.DotVV(this.m_normal,I.SubVV(this.m_polygonB.vertices[n],this.m_v1,I.s_t0));r<e.
separation&&(e.separation=r)}return
e},e.prototype.ComputePolygonSeparation=function(t){var n=t;n.type=0,n.index=-
1,n.separation=-i;for(var r=e.s_perp.Set(-
this.m_normal.y,this.m_normal.x),s=0;s<this.m_polygonB.count;++s){var
a=I.NegV(this.m_polygonB.normals[s],e.s_n),o=I.DotVV(a,I.SubVV(this.m_polygonB.vert
ices[s],this.m_v1,I.s_t0)),l=I.DotVV(a,I.SubVV(this.m_polygonB.vertices[s],this.m_v
2,I.s_t0)),c=g(o,l);if(c>this.m_radius)return
n.type=2,n.index=s,n.separation=c,n;if(I.DotVV(a,r)>=0)
{if(I.DotVV(I.SubVV(a,this.m_upperLimit,I.s_t0),this.m_normal)<-h)continue}else
if(I.DotVV(I.SubVV(a,this.m_lowerLimit,I.s_t0),this.m_normal)<-
h)continue;c>n.separation&&(n.type=2,n.index=s,n.separation=c)}return
n},e.s_edge1=new I,e.s_edge0=new I,e.s_edge2=new
I,e.s_ie=Ct.MakeArray(2),e.s_rf=new
qe,e.s_clipPoints1=Ct.MakeArray(2),e.s_clipPoints2=Ct.MakeArray(2),e.s_edgeAxis=new
He,e.s_polygonAxis=new He,e.s_n=new I,e.s_perp=new I,e}());function Je(t,e,i,n,r)
{Ye.Collide(t,e,i,n,r)}var Ze=(function(){return function()
{this.mass=0,this.center=new I(0,0),this.I=0}})();(function(t){t[t.e_unknown=-
1]="e_unknown",t[t.e_circleShape=0]="e_circleShape",t[t.e_edgeShape=1]="e_edgeShape
",t[t.e_polygonShape=2]="e_polygonShape",t[t.e_chainShape=3]="e_chainShape",t[t.e_s
hapeTypeCount=4]="e_shapeTypeCount"})(t.b2ShapeType||(t.b2ShapeType={}));var
Ke=(function(){function e(e,i)
{this.m_type=t.b2ShapeType.e_unknown,this.m_radius=0,this.m_type=e,this.m_radius=i}
return e.prototype.Copy=function(t){return
this.m_radius=t.m_radius,this},e.prototype.GetType=function(){return
this.m_type},e})(),Qe=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in
e)e.hasOwnProperty(i)&&(t[i]=e[i])};function $e(t,e){function i()
{this.constructor=t}Qe(t,e),t.prototype=null===e?Object.create(e):
(i.prototype=e.prototype,new i)}var ti=(function(e){function i(i){void
0===i&&(i=0);var n=e.call(this,t.b2ShapeType.e_circleShape,i)||this;return
n.m_p=new I,n}return $e(i,e),i.prototype.Set=function(t,e){return void
0===e&&(e=this.m_radius),this.m_p.Copy(t),this.m_radius=e,this},i.prototype.Clone=f
unction(){return(new i).Copy(this)},i.prototype.Copy=function(t){return
e.prototype.Copy.call(this,t),this.m_p.Copy(t.m_p),this},i.prototype.GetChildCount=
function(){return 1},i.prototype.TestPoint=function(t,e){var
n=N.MulXV(t,this.m_p,i.TestPoint_s_center),r=I.SubVV(e,n,i.TestPoint_s_d);return
I.DotVV(r,r)<=C(this.m_radius)},i.prototype.ComputeDistance=function(t,e,n,r){var
s=N.MulXV(t,this.m_p,i.ComputeDistance_s_center);return
I.SubVV(e,s,n),n.Normalize()-this.m_radius},i.prototype.RayCast=function(t,e,r,s)
{var
a=N.MulXV(r,this.m_p,i.RayCast_s_position),o=I.SubVV(e.p1,a,i.RayCast_s_s),l=I.DotV
V(o,o)-
C(this.m_radius),h=I.SubVV(e.p2,e.p1,i.RayCast_s_r),c=I.DotVV(o,h),u=I.DotVV(h,h),_
=c*c-u*l;if(_<0||u<n)return!1;var f=-(c+T(_));return
0<=f&&f<=e.maxFraction*u&&(f/=u,t.fraction=f,I.AddVMulSV(o,f,h,t.normal).SelfNormal
ize(),!0)},i.prototype.ComputeAABB=function(t,e,n){var
r=N.MulXV(e,this.m_p,i.ComputeAABB_s_p);t.lowerBound.Set(r.x-this.m_radius,r.y-
this.m_radius),t.upperBound.Set(r.x+this.m_radius,r.y+this.m_radius)},i.prototype.C
omputeMass=function(t,e){var
i=C(this.m_radius);t.mass=e*s*i,t.center.Copy(this.m_p),t.I=t.mass*(.5*i+I.DotVV(th
is.m_p,this.m_p))},i.prototype.SetupDistanceProxy=function(t,e)
{t.m_vertices=t.m_buffer,t.m_vertices[0].Copy(this.m_p),t.m_count=1,t.m_radius=this
.m_radius},i.prototype.ComputeSubmergedArea=function(t,e,i,r){var
a=N.MulXV(i,this.m_p,new I),o=-(I.DotVV(t,a)-e);if(o<-this.m_radius+n)return
0;if(o>this.m_radius)return r.Copy(a),s*this.m_radius*this.m_radius;var
l=this.m_radius*this.m_radius,h=o*o,c=l*(B(o/this.m_radius)+s/2)+o*T(l-h),u=-
2/3*w(l-h,1.5)/c;return r.x=a.x+t.x*u,r.y=a.y+t.y*u,c},i.prototype.Dump=function(t)
{t(" const shape: b2CircleShape = new b2CircleShape();\n"),t(" shape.m_radius
= %.15f;\n",this.m_radius),t(" shape.m_p.Set(%.15f,
%.15f);\n",this.m_p.x,this.m_p.y)},i.TestPoint_s_center=new I,i.TestPoint_s_d=new
I,i.ComputeDistance_s_center=new I,i.RayCast_s_position=new I,i.RayCast_s_s=new
I,i.RayCast_s_r=new I,i.ComputeAABB_s_p=new I,i})(Ke),ei=(function(e){function r()
{var i=e.call(this,t.b2ShapeType.e_polygonShape,c)||this;return i.m_centroid=new
I(0,0),i.m_vertices=[],i.m_normals=[],i.m_count=0,i}return
$e(r,e),r.prototype.Clone=function(){return(new
r).Copy(this)},r.prototype.Copy=function(t)
{e.prototype.Copy.call(this,t),this.m_centroid.Copy(t.m_centroid),this.m_count=t.m_
count,this.m_vertices=I.MakeArray(this.m_count),this.m_normals=I.MakeArray(this.m_c
ount);for(var i=0;i<this.m_count;+
+i)this.m_vertices[i].Copy(t.m_vertices[i]),this.m_normals[i].Copy(t.m_normals[i]);
return this},r.prototype.GetChildCount=function(){return
1},r.prototype.Set=function(t,e,i){if(void 0===e&&(e=t.length),void
0===i&&(i=0),e<3)return this.SetAsBox(1,1);for(var
n=g(e,o),s=r.Set_s_ps,a=0,h=0;h<n;++h){for(var c=t[i+h],u=!0,_=0;_<a;+
+_)if(I.DistanceSquaredVV(c,s[_])<.5*l*(.5*l)){u=!1;break}u&&s[a+
+].Copy(c)}if((n=a)<3)return this.SetAsBox(1,1);var f=0,d=s[0].x;for(h=1;h<n;++h)
{var m=s[h].x;(m>d||m===d&&s[h].y<s[f].y)&&(f=h,d=m)}for(var
p=r.Set_s_hull,v=0,y=f;;){p[v]=y;var x=0;for(_=1;_<n;++_)if(x!==y){var
b=I.SubVV(s[x],s[p[v]],r.Set_s_r),A=(c=I.SubVV(s[_],s[p[v]],r.Set_s_v),I.CrossVV(b,
c));A<0&&(x=_),0===A&&c.LengthSquared()>b.LengthSquared()&&(x=_)}else x=_;if(+
+v,y=x,x===f)break}this.m_count=v,this.m_vertices=I.MakeArray(this.m_count),this.m_
normals=I.MakeArray(this.m_count);for(h=0;h<v;+
+h)this.m_vertices[h].Copy(s[p[h]]);for(h=0;h<v;++h){var
C=this.m_vertices[h],S=this.m_vertices[(h+1)%v],T=I.SubVV(S,C,I.s_t0);I.CrossVOne(T
,this.m_normals[h]).SelfNormalize()}return
r.ComputeCentroid(this.m_vertices,v,this.m_centroid),this},r.prototype.SetAsArray=f
unction(t,e){return
void 0===e&&(e=t.length),this.Set(t,e)},r.prototype.SetAsBox=function(t,e,i,n)
{if(void
0===n&&(n=0),this.m_count=4,this.m_vertices=I.MakeArray(this.m_count),this.m_normal
s=I.MakeArray(this.m_count),this.m_vertices[0].Set(-t,-
e),this.m_vertices[1].Set(t,-
e),this.m_vertices[2].Set(t,e),this.m_vertices[3].Set(-
t,e),this.m_normals[0].Set(0,-
1),this.m_normals[1].Set(1,0),this.m_normals[2].Set(0,1),this.m_normals[3].Set(-
1,0),this.m_centroid.SetZero(),i){this.m_centroid.Copy(i);var r=new
N;r.SetPosition(i),r.SetRotationAngle(n);for(var s=0;s<this.m_count;+
+s)N.MulXV(r,this.m_vertices[s],this.m_vertices[s]),V.MulRV(r.q,this.m_normals[s],t
his.m_normals[s])}return this},r.prototype.TestPoint=function(t,e){for(var
i=N.MulTXV(t,e,r.TestPoint_s_pLocal),n=0;n<this.m_count;++n)
{if(I.DotVV(this.m_normals[n],I.SubVV(i,this.m_vertices[n],I.s_t0))>0)return!
1}return!0},r.prototype.ComputeDistance=function(t,e,n,s){for(var
a=N.MulTXV(t,e,r.ComputeDistance_s_pLocal),o=-
i,l=r.ComputeDistance_s_normalForMaxDistance.Copy(a),h=0;h<this.m_count;++h){var
c=I.DotVV(this.m_normals[h],I.SubVV(a,this.m_vertices[h],I.s_t0));c>o&&(o=c,l.Copy(
this.m_normals[h]))}if(o>0){var
u=r.ComputeDistance_s_minDistance.Copy(l),_=o*o;for(h=0;h<this.m_count;++h){var
f=I.SubVV(a,this.m_vertices[h],r.ComputeDistance_s_distance),d=f.LengthSquared();_>
d&&(u.Copy(f),_=d)}return V.MulRV(t.q,u,n),n.Normalize(),Math.sqrt(_)}return
V.MulRV(t.q,l,n),o},r.prototype.RayCast=function(t,e,i,n){for(var
s=N.MulTXV(i,e.p1,r.RayCast_s_p1),a=N.MulTXV(i,e.p2,r.RayCast_s_p2),o=I.SubVV(a,s,r
.RayCast_s_d),l=0,h=e.maxFraction,c=-1,u=0;u<this.m_count;++u){var
_=I.DotVV(this.m_normals[u],I.SubVV(this.m_vertices[u],s,I.s_t0)),f=I.DotVV(this.m_
normals[u],o);if(0===f){if(_<0)return!1}else f<0&&_<l*f?
(l=_/f,c=u):f>0&&_<h*f&&(h=_/f);if(h<l)return!1}return
c>=0&&(t.fraction=l,V.MulRV(i.q,this.m_normals[c],t.normal),!
0)},r.prototype.ComputeAABB=function(t,e,i){for(var
n=N.MulXV(e,this.m_vertices[0],t.lowerBound),s=t.upperBound.Copy(n),a=0;a<this.m_co
unt;++a){var
o=N.MulXV(e,this.m_vertices[a],r.ComputeAABB_s_v);I.MinV(o,n,n),I.MaxV(o,s,s)}var
l=this.m_radius;n.SelfSubXY(l,l),s.SelfAddXY(l,l)},r.prototype.ComputeMass=function
(t,e){for(var
i=r.ComputeMass_s_center.SetZero(),n=0,s=0,a=r.ComputeMass_s_s.SetZero(),o=0;o<this
.m_count;+
+o)a.SelfAdd(this.m_vertices[o]);a.SelfMul(1/this.m_count);for(o=0;o<this.m_count;+
+o){var
l=I.SubVV(this.m_vertices[o],a,r.ComputeMass_s_e1),h=I.SubVV(this.m_vertices[(o+1)%
this.m_count],a,r.ComputeMass_s_e2),c=I.CrossVV(l,h),u=.5*c;n+=u,i.SelfAdd(I.MulSV(
u*(1/3),I.AddVV(l,h,I.s_t0),I.s_t1));var
_=l.x,f=l.y,d=h.x,m=h.y;s+=1/3*.25*c*(_*_+d*_+d*d+
(f*f+m*f+m*m))}t.mass=e*n,i.SelfMul(1/n),I.AddVV(i,a,t.center),t.I=e*s,t.I+=t.mass*
(I.DotVV(t.center,t.center)-I.DotVV(i,i))},r.prototype.Validate=function(){for(var
t=0;t<this.m_count;++t)for(var
e=t,i=(t+1)%this.m_count,n=this.m_vertices[e],s=I.SubVV(this.m_vertices[i],n,r.Vali
date_s_e),a=0;a<this.m_count;++a)if(a!==e&&a!==i){var
o=I.SubVV(this.m_vertices[a],n,r.Validate_s_v);if(I.CrossVV(s,o)<0)return!1}return!
0},r.prototype.SetupDistanceProxy=function(t,e)
{t.m_vertices=this.m_vertices,t.m_count=this.m_count,t.m_radius=this.m_radius},r.pr
ototype.ComputeSubmergedArea=function(t,e,i,s){for(var
a=V.MulTRV(i.q,t,r.ComputeSubmergedArea_s_normalL),o=e-
I.DotVV(t,i.p),l=r.ComputeSubmergedArea_s_depths,h=0,c=-1,u=-1,_=!
1,f=0;f<this.m_count;++f){l[f]=I.DotVV(a,this.m_vertices[f])-o;var d=l[f]<-
n;f>0&&(d?_||(c=f-1,h++):_&&(u=f-1,h++)),_=d}switch(h){case 0:if(_){var
m=r.ComputeSubmergedArea_s_md;return
this.ComputeMass(m,1),N.MulXV(i,m.center,s),m.mass}return 0;case 1:-1===c?
c=this.m_count-1:u=this.m_count-1}for(var
p,v=(c+1)%this.m_count,y=(u+1)%this.m_count,g=(0-l[c])/(l[v]-l[c]),x=(0-l[u])/
(l[y]-l[u]),b=r.ComputeSubmergedArea_s_intoVec.Set(this.m_vertices[c].x*(1-g)
+this.m_vertices[v].x*g,this.m_vertices[c].y*(1-g)
+this.m_vertices[v].y*g),A=r.ComputeSubmergedArea_s_outoVec.Set(this.m_vertices[u].
x*(1-x)+this.m_vertices[y].x*x,this.m_vertices[u].y*(1-x)
+this.m_vertices[y].y*x),C=0,S=r.ComputeSubmergedArea_s_center.SetZero(),T=this.m_v
ertices[v],w=v;w!==y;){p=(w=(w+1)%this.m_count)===y?A:this.m_vertices[w];var
E=.5*((T.x-b.x)*(p.y-b.y)-(T.y-b.y)*(p.x-
b.x));C+=E,S.x+=E*(b.x+T.x+p.x)/3,S.y+=E*(b.y+T.y+p.y)/3,T=p}return
S.SelfMul(1/C),N.MulXV(i,S,s),C},r.prototype.Dump=function(t){t(" const shape:
b2PolygonShape = new b2PolygonShape();\n"),t(" const vs: b2Vec2[] =
b2Vec2.MakeArray(%d);\n",o);for(var e=0;e<this.m_count;++e)t(" vs[%d].Set(%.15f,
%.15f);\n",e,this.m_vertices[e].x,this.m_vertices[e].y);t(" shape.Set(vs,
%d);\n",this.m_count)},r.ComputeCentroid=function(t,e,i){var
n=i;n.SetZero();for(var s=0,a=r.ComputeCentroid_s_pRef.SetZero(),o=0;o<e;++o){var
l=a,h=t[o],c=t[(o+1)%e],u=I.SubVV(h,l,r.ComputeCentroid_s_e1),_=I.SubVV(c,l,r.Compu
teCentroid_s_e2),f=.5*I.CrossVV(u,_);s+=f,n.x+=f*(1/3)*(l.x+h.x+c.x),n.y+=f*(1/3)*(
l.y+h.y+c.y)}return
n.SelfMul(1/s),n},r.Set_s_ps=I.MakeArray(o),r.Set_s_hull=m(o),r.Set_s_r=new
I,r.Set_s_v=new I,r.TestPoint_s_pLocal=new I,r.ComputeDistance_s_pLocal=new
I,r.ComputeDistance_s_normalForMaxDistance=new
I,r.ComputeDistance_s_minDistance=new I,r.ComputeDistance_s_distance=new
I,r.RayCast_s_p1=new I,r.RayCast_s_p2=new I,r.RayCast_s_d=new
I,r.ComputeAABB_s_v=new I,r.ComputeMass_s_center=new I,r.ComputeMass_s_s=new
I,r.ComputeMass_s_e1=new I,r.ComputeMass_s_e2=new I,r.Validate_s_e=new
I,r.Validate_s_v=new I,r.ComputeSubmergedArea_s_normalL=new
I,r.ComputeSubmergedArea_s_depths=m(o),r.ComputeSubmergedArea_s_md=new
Ze,r.ComputeSubmergedArea_s_intoVec=new I,r.ComputeSubmergedArea_s_outoVec=new
I,r.ComputeSubmergedArea_s_center=new I,r.ComputeCentroid_s_pRef=new
I,r.ComputeCentroid_s_e1=new I,r.ComputeCentroid_s_e2=new I,r})(Ke),ii=(function(e)
{function i(){var i=e.call(this,t.b2ShapeType.e_edgeShape,c)||this;return
i.m_vertex1=new I,i.m_vertex2=new I,i.m_vertex0=new I,i.m_vertex3=new
I,i.m_hasVertex0=!1,i.m_hasVertex3=!1,i}return
$e(i,e),i.prototype.Set=function(t,e){return
this.m_vertex1.Copy(t),this.m_vertex2.Copy(e),this.m_hasVertex0=!
1,this.m_hasVertex3=!1,this},i.prototype.Clone=function(){return(new
i).Copy(this)},i.prototype.Copy=function(t){return
e.prototype.Copy.call(this,t),this.m_vertex1.Copy(t.m_vertex1),this.m_vertex2.Copy(
t.m_vertex2),this.m_vertex0.Copy(t.m_vertex0),this.m_vertex3.Copy(t.m_vertex3),this
.m_hasVertex0=t.m_hasVertex0,this.m_hasVertex3=t.m_hasVertex3,this},i.prototype.Get
ChildCount=function(){return 1},i.prototype.TestPoint=function(t,e){return!
1},i.prototype.ComputeDistance=function(t,e,n,r){var
s=N.MulXV(t,this.m_vertex1,i.ComputeDistance_s_v1),a=N.MulXV(t,this.m_vertex2,i.Com
puteDistance_s_v2),o=I.SubVV(e,s,i.ComputeDistance_s_d),l=I.SubVV(a,s,i.ComputeDist
ance_s_s),h=I.DotVV(o,l);if(h>0){var c=I.DotVV(l,l);h>c?
I.SubVV(e,a,o):o.SelfMulSub(h/c,l)}return
n.Copy(o),n.Normalize()},i.prototype.RayCast=function(t,e,n,r){var
s=N.MulTXV(n,e.p1,i.RayCast_s_p1),a=N.MulTXV(n,e.p2,i.RayCast_s_p2),o=I.SubVV(a,s,i
.RayCast_s_d),l=this.m_vertex1,h=this.m_vertex2,c=I.SubVV(h,l,i.RayCast_s_e),u=t.no
rmal.Set(c.y,-
c.x).SelfNormalize(),_=I.DotVV(u,I.SubVV(l,s,I.s_t0)),f=I.DotVV(u,o);if(0===f)retur
n!1;var d=_/f;if(d<0||e.maxFraction<d)return!1;var
m=I.AddVMulSV(s,d,o,i.RayCast_s_q),p=I.SubVV(h,l,i.RayCast_s_r),v=I.DotVV(p,p);if(0
===v)return!1;var y=I.DotVV(I.SubVV(m,l,I.s_t0),p)/v;return!(y<0||
1<y)&&(t.fraction=d,V.MulRV(n.q,t.normal,t.normal),_>0&&t.normal.SelfNeg(),!
0)},i.prototype.ComputeAABB=function(t,e,n){var
r=N.MulXV(e,this.m_vertex1,i.ComputeAABB_s_v1),s=N.MulXV(e,this.m_vertex2,i.Compute
AABB_s_v2);I.MinV(r,s,t.lowerBound),I.MaxV(r,s,t.upperBound);var
a=this.m_radius;t.lowerBound.SelfSubXY(a,a),t.upperBound.SelfAddXY(a,a)},i.prototyp
e.ComputeMass=function(t,e)
{t.mass=0,I.MidVV(this.m_vertex1,this.m_vertex2,t.center),t.I=0},i.prototype.SetupD
istanceProxy=function(t,e)
{t.m_vertices=t.m_buffer,t.m_vertices[0].Copy(this.m_vertex1),t.m_vertices[1].Copy(
this.m_vertex2),t.m_count=2,t.m_radius=this.m_radius},i.prototype.ComputeSubmergedA
rea=function(t,e,i,n){return n.SetZero(),0},i.prototype.Dump=function(t){t("
const shape: b2EdgeShape = new b2EdgeShape();\n"),t(" shape.m_radius =
%.15f;\n",this.m_radius),t(" shape.m_vertex0.Set(%.15f,
%.15f);\n",this.m_vertex0.x,this.m_vertex0.y),t(" shape.m_vertex1.Set(%.15f,
%.15f);\n",this.m_vertex1.x,this.m_vertex1.y),t(" shape.m_vertex2.Set(%.15f,
%.15f);\n",this.m_vertex2.x,this.m_vertex2.y),t(" shape.m_vertex3.Set(%.15f,
%.15f);\n",this.m_vertex3.x,this.m_vertex3.y),t(" shape.m_hasVertex0 =
%s;\n",this.m_hasVertex0),t(" shape.m_hasVertex3 =
%s;\n",this.m_hasVertex3)},i.ComputeDistance_s_v1=new I,i.ComputeDistance_s_v2=new
I,i.ComputeDistance_s_d=new I,i.ComputeDistance_s_s=new I,i.RayCast_s_p1=new
I,i.RayCast_s_p2=new I,i.RayCast_s_d=new I,i.RayCast_s_e=new I,i.RayCast_s_q=new
I,i.RayCast_s_r=new I,i.ComputeAABB_s_v1=new I,i.ComputeAABB_s_v2=new I,i})
(Ke),ni=(function(e){function i(){var i=e.call(this,t.b2ShapeType.e_chainShape,c)||
this;return i.m_vertices=[],i.m_count=0,i.m_prevVertex=new I,i.m_nextVertex=new
I,i.m_hasPrevVertex=!1,i.m_hasNextVertex=!1,i}return
$e(i,e),i.prototype.CreateLoop=function(t,e,i){if(void 0===e&&(e=t.length),void
0===i&&(i=0),e<3)return
this;this.m_count=e+1,this.m_vertices=I.MakeArray(this.m_count);for(var n=0;n<e;+
+n)this.m_vertices[n].Copy(t[i+n]);return
this.m_vertices[e].Copy(this.m_vertices[0]),this.m_prevVertex.Copy(this.m_vertices[
this.m_count-2]),this.m_nextVertex.Copy(this.m_vertices[1]),this.m_hasPrevVertex=!
0,this.m_hasNextVertex=!0,this},i.prototype.CreateChain=function(t,e,i){void
0===e&&(e=t.length),void
0===i&&(i=0),this.m_count=e,this.m_vertices=I.MakeArray(e);for(var n=0;n<e;+
+n)this.m_vertices[n].Copy(t[i+n]);return this.m_hasPrevVertex=!
1,this.m_hasNextVertex=!
1,this.m_prevVertex.SetZero(),this.m_nextVertex.SetZero(),this},i.prototype.SetPrev
Vertex=function(t){return this.m_prevVertex.Copy(t),this.m_hasPrevVertex=!
0,this},i.prototype.SetNextVertex=function(t){return
this.m_nextVertex.Copy(t),this.m_hasNextVertex=!
0,this},i.prototype.Clone=function(){return(new
i).Copy(this)},i.prototype.Copy=function(t){return
e.prototype.Copy.call(this,t),this.CreateChain(t.m_vertices,t.m_count),this.m_prevV
ertex.Copy(t.m_prevVertex),this.m_nextVertex.Copy(t.m_nextVertex),this.m_hasPrevVer
tex=t.m_hasPrevVertex,this.m_hasNextVertex=t.m_hasNextVertex,this},i.prototype.GetC
hildCount=function(){return this.m_count-1},i.prototype.GetChildEdge=function(e,i)
{e.m_type=t.b2ShapeType.e_edgeShape,e.m_radius=this.m_radius,e.m_vertex1.Copy(this.
m_vertices[i]),e.m_vertex2.Copy(this.m_vertices[i+1]),i>0?
(e.m_vertex0.Copy(this.m_vertices[i-1]),e.m_hasVertex0=!0):
(e.m_vertex0.Copy(this.m_prevVertex),e.m_hasVertex0=this.m_hasPrevVertex),i<this.m_
count-2?(e.m_vertex3.Copy(this.m_vertices[i+2]),e.m_hasVertex3=!0):
(e.m_vertex3.Copy(this.m_nextVertex),e.m_hasVertex3=this.m_hasNextVertex)},i.protot
ype.TestPoint=function(t,e){return!1},i.prototype.ComputeDistance=function(t,e,n,r)
{var s=i.ComputeDistance_s_edgeShape;return
this.GetChildEdge(s,r),s.ComputeDistance(t,e,n,0)},i.prototype.RayCast=function(t,e
,n,r){var s=i.RayCast_s_edgeShape;return
s.m_vertex1.Copy(this.m_vertices[r]),s.m_vertex2.Copy(this.m_vertices[(r+1)%this.m_
count]),s.RayCast(t,e,n,0)},i.prototype.ComputeAABB=function(t,e,n){var
r=this.m_vertices[n],s=this.m_vertices[(n+1)%this.m_count],a=N.MulXV(e,r,i.ComputeA
ABB_s_v1),o=N.MulXV(e,s,i.ComputeAABB_s_v2);I.MinV(a,o,t.lowerBound),I.MaxV(a,o,t.u
pperBound)},i.prototype.ComputeMass=function(t,e)
{t.mass=0,t.center.SetZero(),t.I=0},i.prototype.SetupDistanceProxy=function(t,e)
{t.m_vertices=t.m_buffer,t.m_vertices[0].Copy(this.m_vertices[e]),e+1<this.m_count?
t.m_vertices[1].Copy(this.m_vertices[e+1]):t.m_vertices[1].Copy(this.m_vertices[0])
,t.m_count=2,t.m_radius=this.m_radius},i.prototype.ComputeSubmergedArea=function(t,
e,i,n){return n.SetZero(),0},i.prototype.Dump=function(t){t(" const shape:
b2ChainShape = new b2ChainShape();\n"),t(" const vs: b2Vec2[] =
b2Vec2.MakeArray(%d);\n",o);for(var e=0;e<this.m_count;++e)t(" vs[%d].Set(%.15f,
%.15f);\n",e,this.m_vertices[e].x,this.m_vertices[e].y);t("
shape.CreateChain(vs, %d);\n",this.m_count),t(" shape.m_prevVertex.Set(%.15f,
%.15f);\n",this.m_prevVertex.x,this.m_prevVertex.y),t("
shape.m_nextVertex.Set(%.15f,
%.15f);\n",this.m_nextVertex.x,this.m_nextVertex.y),t(" shape.m_hasPrevVertex =
%s;\n",this.m_hasPrevVertex?"true":"false"),t(" shape.m_hasNextVertex =
%s;\n",this.m_hasNextVertex?"true":"false")},i.ComputeDistance_s_edgeShape=new
ii,i.RayCast_s_edgeShape=new ii,i.ComputeAABB_s_v1=new I,i.ComputeAABB_s_v2=new
I,i})(Ke),ri=(function(){function t()
{this.categoryBits=1,this.maskBits=65535,this.groupIndex=0}return
t.prototype.Clone=function(){return(new t).Copy(this)},t.prototype.Copy=function(t)
{return
this.categoryBits=t.categoryBits,this.maskBits=t.maskBits,this.groupIndex=t.groupIn
dex||0,this},t.DEFAULT=new t,t})(),si=(function(){return function()
{this.userData=null,this.friction=.2,this.restitution=0,this.density=0,this.isSenso
r=!1,this.filter=new ri}})(),ai=(function(){return function(t){this.aabb=new
wt,this.childIndex=0,this.fixture=t}})(),oi=(function(){function t(t,e)
{this.m_density=0,this.m_next=null,this.m_friction=0,this.m_restitution=0,this.m_pr
oxies=[],this.m_proxyCount=0,this.m_filter=new ri,this.m_isSensor=!
1,this.m_userData=null,this.m_body=e,this.m_shape=t.shape.Clone()}return
t.prototype.GetType=function(){return
this.m_shape.GetType()},t.prototype.GetShape=function(){return
this.m_shape},t.prototype.SetSensor=function(t){t!
==this.m_isSensor&&(this.m_body.SetAwake(!
0),this.m_isSensor=t)},t.prototype.IsSensor=function(){return
this.m_isSensor},t.prototype.SetFilterData=function(t)
{this.m_filter.Copy(t),this.Refilter()},t.prototype.GetFilterData=function(){return
this.m_filter},t.prototype.Refilter=function(){for(var
t=this.m_body.GetContactList();t;){var
e=t.contact,i=e.GetFixtureA(),n=e.GetFixtureB();i!==this&&n!==this||
e.FlagForFiltering(),t=t.next}var r=this.m_body.GetWorld();if(null!==r)for(var
s=r.m_contactManager.m_broadPhase,a=0;a<this.m_proxyCount;+
+a)s.TouchProxy(this.m_proxies[a].treeNode)},t.prototype.GetBody=function(){return
this.m_body},t.prototype.GetNext=function(){return
this.m_next},t.prototype.GetUserData=function(){return
this.m_userData},t.prototype.SetUserData=function(t)
{this.m_userData=t},t.prototype.TestPoint=function(t){return
this.m_shape.TestPoint(this.m_body.GetTransform(),t)},t.prototype.ComputeDistance=f
unction(t,e,i){return
this.m_shape.ComputeDistance(this.m_body.GetTransform(),t,e,i)},t.prototype.RayCast
=function(t,e,i){return
this.m_shape.RayCast(t,e,this.m_body.GetTransform(),i)},t.prototype.GetMassData=fun
ction(t){return void 0===t&&(t=new
Ze),this.m_shape.ComputeMass(t,this.m_density),t},t.prototype.SetDensity=function(t
){this.m_density=t},t.prototype.GetDensity=function(){return
this.m_density},t.prototype.GetFriction=function(){return
this.m_friction},t.prototype.SetFriction=function(t)
{this.m_friction=t},t.prototype.GetRestitution=function(){return
this.m_restitution},t.prototype.SetRestitution=function(t)
{this.m_restitution=t},t.prototype.GetAABB=function(t){return
this.m_proxies[t].aabb},t.prototype.Dump=function(t,e){t(" const fd:
b2FixtureDef = new b2FixtureDef();\n"),t(" fd.friction =
%.15f;\n",this.m_friction),t(" fd.restitution =
%.15f;\n",this.m_restitution),t(" fd.density = %.15f;\n",this.m_density),t("
fd.isSensor = %s;\n",this.m_isSensor?"true":"false"),t(" fd.filter.categoryBits
= %d;\n",this.m_filter.categoryBits),t(" fd.filter.maskBits =
%d;\n",this.m_filter.maskBits),t(" fd.filter.groupIndex =
%d;\n",this.m_filter.groupIndex),this.m_shape.Dump(t),t("\n"),t(" fd.shape =
shape;\n"),t("\n"),t("
bodies[%d].CreateFixture(fd);\n",e)},t.prototype.Create=function(t){var
i=this;this.m_userData=t.userData,this.m_friction=e(t.friction,.2),this.m_restituti
on=e(t.restitution,0),this.m_next=null,this.m_filter.Copy(e(t.filter,ri.DEFAULT)),t
his.m_isSensor=e(t.isSensor,!1),this.m_proxies=d(this.m_shape.GetChildCount(),
(function(t){return new
ai(i)})),this.m_proxyCount=0,this.m_density=e(t.density,0)},t.prototype.Destroy=fun
ction(){},t.prototype.CreateProxies=function(t){var
e=this.m_body.m_world.m_contactManager.m_broadPhase;this.m_proxyCount=this.m_shape.
GetChildCount();for(var i=0;i<this.m_proxyCount;++i){var n=this.m_proxies[i]=new
ai(this);this.m_shape.ComputeAABB(n.aabb,t,i),n.treeNode=e.CreateProxy(n.aabb,n),n.
childIndex=i}},t.prototype.DestroyProxies=function(){for(var
t=this.m_body.m_world.m_contactManager.m_broadPhase,e=0;e<this.m_proxyCount;++e)
{var i=this.m_proxies[e];delete
i.treeNode.userData,t.DestroyProxy(i.treeNode),delete
i.treeNode}this.m_proxyCount=0},t.prototype.TouchProxies=function(){for(var
t=this.m_body.m_world.m_contactManager.m_broadPhase,e=this.m_proxyCount,i=0;i<e;+
+i)t.TouchProxy(this.m_proxies[i].treeNode)},t.prototype.Synchronize=function(e,i)
{if(0!==this.m_proxyCount)for(var
n=this.m_body.m_world.m_contactManager.m_broadPhase,r=0;r<this.m_proxyCount;++r)
{var
s=this.m_proxies[r],a=t.Synchronize_s_aabb1,o=t.Synchronize_s_aabb2;this.m_shape.Co
mputeAABB(a,e,r),this.m_shape.ComputeAABB(o,i,r),s.aabb.Combine2(a,o);var
l=I.SubVV(i.p,e.p,t.Synchronize_s_displacement);n.MoveProxy(s.treeNode,s.aabb,l)}},
t.Synchronize_s_aabb1=new wt,t.Synchronize_s_aabb2=new
wt,t.Synchronize_s_displacement=new I,t})();(function(t){t[t.b2_unknown=-
1]="b2_unknown",t[t.b2_staticBody=0]="b2_staticBody",t[t.b2_kinematicBody=1]="b2_ki
nematicBody",t[t.b2_dynamicBody=2]="b2_dynamicBody"})(t.b2BodyType||
(t.b2BodyType={}));var li=(function(){return function()
{this.type=t.b2BodyType.b2_staticBody,this.position=new
I(0,0),this.angle=0,this.linearVelocity=new
I(0,0),this.angularVelocity=0,this.linearDamping=0,this.angularDamping=0,this.allow
Sleep=!0,this.awake=!0,this.fixedRotation=!1,this.bullet=!1,this.active=!
0,this.userData=null,this.gravityScale=1}})(),hi=(function(){function i(i,n)
{this.m_type=t.b2BodyType.b2_staticBody,this.m_islandFlag=!1,this.m_awakeFlag=!
1,this.m_autoSleepFlag=!1,this.m_bulletFlag=!1,this.m_fixedRotationFlag=!
1,this.m_activeFlag=!1,this.m_toiFlag=!1,this.m_islandIndex=0,this.m_xf=new
N,this.m_xf0=new N,this.m_sweep=new k,this.m_linearVelocity=new
I,this.m_angularVelocity=0,this.m_force=new
I,this.m_torque=0,this.m_prev=null,this.m_next=null,this.m_fixtureList=null,this.m_
fixtureCount=0,this.m_jointList=null,this.m_contactList=null,this.m_mass=1,this.m_i
nvMass=1,this.m_I=0,this.m_invI=0,this.m_linearDamping=0,this.m_angularDamping=0,th
is.m_gravityScale=1,this.m_sleepTime=0,this.m_userData=null,this.m_controllerList=n
ull,this.m_controllerCount=0,this.m_bulletFlag=e(i.bullet,!
1),this.m_fixedRotationFlag=e(i.fixedRotation,!
1),this.m_autoSleepFlag=e(i.allowSleep,!0),this.m_awakeFlag=e(i.awake,!
0),this.m_activeFlag=e(i.active,!
0),this.m_world=n,this.m_xf.p.Copy(e(i.position,I.ZERO)),this.m_xf.q.SetAngle(e(i.a
ngle,0)),this.m_xf0.Copy(this.m_xf),this.m_sweep.localCenter.SetZero(),this.m_sweep
.c0.Copy(this.m_xf.p),this.m_sweep.c.Copy(this.m_xf.p),this.m_sweep.a0=this.m_sweep
.a=this.m_xf.q.GetAngle(),this.m_sweep.alpha0=0,this.m_linearVelocity.Copy(e(i.line
arVelocity,I.ZERO)),this.m_angularVelocity=e(i.angularVelocity,0),this.m_linearDamp
ing=e(i.linearDamping,0),this.m_angularDamping=e(i.angularDamping,0),this.m_gravity
Scale=e(i.gravityScale,1),this.m_force.SetZero(),this.m_torque=0,this.m_sleepTime=0
,this.m_type=e(i.type,t.b2BodyType.b2_staticBody),i.type===t.b2BodyType.b2_dynamicB
ody?(this.m_mass=1,this.m_invMass=1):
(this.m_mass=0,this.m_invMass=0),this.m_I=0,this.m_invI=0,this.m_userData=i.userDat
a,this.m_fixtureList=null,this.m_fixtureCount=0,this.m_controllerList=null,this.m_c
ontrollerCount=0}return i.prototype.CreateFixture=function(t,e){return void
0===e&&(e=0),t instanceof Ke?
this.CreateFixtureShapeDensity(t,e):this.CreateFixtureDef(t)},i.prototype.CreateFix
tureDef=function(t){if(this.m_world.IsLocked())throw
new Error;var e=new oi(t,this);return
e.Create(t),this.m_activeFlag&&e.CreateProxies(this.m_xf),e.m_next=this.m_fixtureLi
st,this.m_fixtureList=e,+
+this.m_fixtureCount,e.m_density>0&&this.ResetMassData(),this.m_world.m_newFixture=
!0,e},i.prototype.CreateFixtureShapeDensity=function(t,e){void 0===e&&(e=0);var
n=i.CreateFixtureShapeDensity_s_def;return
n.shape=t,n.density=e,this.CreateFixtureDef(n)},i.prototype.DestroyFixture=function
(t){if(this.m_world.IsLocked())throw new Error;for(var
e=this.m_fixtureList,i=null;null!==e;){if(e===t){i?
i.m_next=t.m_next:this.m_fixtureList=t.m_next;break}i=e,e=e.m_next}for(var
n=this.m_contactList;n;){var r=n.contact;n=n.next;var
s=r.GetFixtureA(),a=r.GetFixtureB();t!==s&&t!==a||
this.m_world.m_contactManager.Destroy(r)}this.m_activeFlag&&t.DestroyProxies(),t.m_
next=null,t.Destroy(),--
this.m_fixtureCount,this.ResetMassData()},i.prototype.SetTransformVec=function(t,e)
{this.SetTransformXY(t.x,t.y,e)},i.prototype.SetTransformXY=function(t,e,i)
{if(this.m_world.IsLocked())throw new
Error;this.m_xf.q.SetAngle(i),this.m_xf.p.Set(t,e),this.m_xf0.Copy(this.m_xf),N.Mul
XV(this.m_xf,this.m_sweep.localCenter,this.m_sweep.c),this.m_sweep.a=i,this.m_sweep
.c0.Copy(this.m_sweep.c),this.m_sweep.a0=i;for(var
n=this.m_fixtureList;n;n=n.m_next)n.Synchronize(this.m_xf,this.m_xf);this.m_world.m
_contactManager.FindNewContacts()},i.prototype.SetTransform=function(t)
{this.SetTransformVec(t.p,t.GetAngle())},i.prototype.GetTransform=function(){return
this.m_xf},i.prototype.GetPosition=function(){return
this.m_xf.p},i.prototype.SetPosition=function(t)
{this.SetTransformVec(t,this.GetAngle())},i.prototype.SetPositionXY=function(t,e)
{this.SetTransformXY(t,e,this.GetAngle())},i.prototype.GetAngle=function(){return
this.m_sweep.a},i.prototype.SetAngle=function(t)
{this.SetTransformVec(this.GetPosition(),t)},i.prototype.GetWorldCenter=function()
{return this.m_sweep.c},i.prototype.GetLocalCenter=function(){return
this.m_sweep.localCenter},i.prototype.SetLinearVelocity=function(e){this.m_type!
==t.b2BodyType.b2_staticBody&&(I.DotVV(e,e)>0&&this.SetAwake(!
0),this.m_linearVelocity.Copy(e))},i.prototype.GetLinearVelocity=function(){return
this.m_linearVelocity},i.prototype.SetAngularVelocity=function(e){this.m_type!
==t.b2BodyType.b2_staticBody&&(e*e>0&&this.SetAwake(!
0),this.m_angularVelocity=e)},i.prototype.GetAngularVelocity=function(){return
this.m_angularVelocity},i.prototype.GetDefinition=function(t){return
t.type=this.GetType(),t.allowSleep=this.m_autoSleepFlag,t.angle=this.GetAngle(),t.a
ngularDamping=this.m_angularDamping,t.gravityScale=this.m_gravityScale,t.angularVel
ocity=this.m_angularVelocity,t.fixedRotation=this.m_fixedRotationFlag,t.bullet=this
.m_bulletFlag,t.awake=this.m_awakeFlag,t.linearDamping=this.m_linearDamping,t.linea
rVelocity.Copy(this.GetLinearVelocity()),t.position.Copy(this.GetPosition()),t.user
Data=this.GetUserData(),t},i.prototype.ApplyForce=function(e,i,n){void 0===n&&(n=!
0),this.m_type===t.b2BodyType.b2_dynamicBody&&(n&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_force.x+=e.x,this.m_force.y+=e.y,this.m_torque+=(i.x-
this.m_sweep.c.x)*e.y-(i.y-
this.m_sweep.c.y)*e.x))},i.prototype.ApplyForceToCenter=function(e,i){void
0===i&&(i=!0),this.m_type===t.b2BodyType.b2_dynamicBody&&(i&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_force.x+=e.x,this.m_force.y+=e.y))},i.prototype.ApplyT
orque=function(e,i){void 0===i&&(i=!
0),this.m_type===t.b2BodyType.b2_dynamicBody&&(i&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_torque+=e))},i.prototype.ApplyLinearImpulse=function(e
,i,n){void 0===n&&(n=!0),this.m_type===t.b2BodyType.b2_dynamicBody&&(n&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_linearVelocity.x+=this.m_invMass*e.x,this.m_linearVelo
city.y+=this.m_invMass*e.y,this.m_angularVelocity+=this.m_invI*((i.x-
this.m_sweep.c.x)*e.y-(i.y-
this.m_sweep.c.y)*e.x)))},i.prototype.ApplyLinearImpulseToCenter=function(e,i){void
0===i&&(i=!0),this.m_type===t.b2BodyType.b2_dynamicBody&&(i&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_linearVelocity.x+=this.m_invMass*e.x,this.m_linearVelo
city.y+=this.m_invMass*e.y))},i.prototype.ApplyAngularImpulse=function(e,i){void
0===i&&(i=!0),this.m_type===t.b2BodyType.b2_dynamicBody&&(i&&!
this.m_awakeFlag&&this.SetAwake(!
0),this.m_awakeFlag&&(this.m_angularVelocity+=this.m_invI*e))},i.prototype.GetMass=
function(){return this.m_mass},i.prototype.GetInertia=function(){return
this.m_I+this.m_mass*I.DotVV(this.m_sweep.localCenter,this.m_sweep.localCenter)},i.
prototype.GetMassData=function(t){return
t.mass=this.m_mass,t.I=this.m_I+this.m_mass*I.DotVV(this.m_sweep.localCenter,this.m
_sweep.localCenter),t.center.Copy(this.m_sweep.localCenter),t},i.prototype.SetMassD
ata=function(e){if(this.m_world.IsLocked())throw new
Error;if(this.m_type===t.b2BodyType.b2_dynamicBody)
{this.m_invMass=0,this.m_I=0,this.m_invI=0,this.m_mass=e.mass,this.m_mass<=0&&(this
.m_mass=1),this.m_invMass=1/this.m_mass,e.I>0&&!
this.m_fixedRotationFlag&&(this.m_I=e.I-
this.m_mass*I.DotVV(e.center,e.center),this.m_invI=1/this.m_I);var
n=i.SetMassData_s_oldCenter.Copy(this.m_sweep.c);this.m_sweep.localCenter.Copy(e.ce
nter),N.MulXV(this.m_xf,this.m_sweep.localCenter,this.m_sweep.c),this.m_sweep.c0.Co
py(this.m_sweep.c),I.AddVCrossSV(this.m_linearVelocity,this.m_angularVelocity,I.Sub
VV(this.m_sweep.c,n,I.s_t0),this.m_linearVelocity)}},i.prototype.ResetMassData=func
tion()
{if(this.m_mass=0,this.m_invMass=0,this.m_I=0,this.m_invI=0,this.m_sweep.localCente
r.SetZero(),this.m_type===t.b2BodyType.b2_staticBody||
this.m_type===t.b2BodyType.b2_kinematicBody)return
this.m_sweep.c0.Copy(this.m_xf.p),this.m_sweep.c.Copy(this.m_xf.p),void(this.m_swee
p.a0=this.m_sweep.a);for(var
e=i.ResetMassData_s_localCenter.SetZero(),n=this.m_fixtureList;n;n=n.m_next)if(0!
==n.m_density){var
r=n.GetMassData(i.ResetMassData_s_massData);this.m_mass+=r.mass,e.x+=r.center.x*r.m
ass,e.y+=r.center.y*r.mass,this.m_I+=r.I}this.m_mass>0?
(this.m_invMass=1/this.m_mass,e.x*=this.m_invMass,e.y*=this.m_invMass):
(this.m_mass=1,this.m_invMass=1),this.m_I>0&&!this.m_fixedRotationFlag?(this.m_I-
=this.m_mass*I.DotVV(e,e),this.m_invI=1/this.m_I):(this.m_I=0,this.m_invI=0);var
s=i.ResetMassData_s_oldCenter.Copy(this.m_sweep.c);this.m_sweep.localCenter.Copy(e)
,N.MulXV(this.m_xf,this.m_sweep.localCenter,this.m_sweep.c),this.m_sweep.c0.Copy(th
is.m_sweep.c),I.AddVCrossSV(this.m_linearVelocity,this.m_angularVelocity,I.SubVV(th
is.m_sweep.c,s,I.s_t0),this.m_linearVelocity)},i.prototype.GetWorldPoint=function(t
,e){return N.MulXV(this.m_xf,t,e)},i.prototype.GetWorldVector=function(t,e){return
V.MulRV(this.m_xf.q,t,e)},i.prototype.GetLocalPoint=function(t,e){return
N.MulTXV(this.m_xf,t,e)},i.prototype.GetLocalVector=function(t,e){return
V.MulTRV(this.m_xf.q,t,e)},i.prototype.GetLinearVelocityFromWorldPoint=function(t,e
){return
I.AddVCrossSV(this.m_linearVelocity,this.m_angularVelocity,I.SubVV(t,this.m_sweep.c
,I.s_t0),e)},i.prototype.GetLinearVelocityFromLocalPoint=function(t,e){return
this.GetLinearVelocityFromWorldPoint(this.GetWorldPoint(t,e),e)},i.prototype.GetLin
earDamping=function(){return
this.m_linearDamping},i.prototype.SetLinearDamping=function(t)
{this.m_linearDamping=t},i.prototype.GetAngularDamping=function(){return
this.m_angularDamping},i.prototype.SetAngularDamping=function(t)
{this.m_angularDamping=t},i.prototype.GetGravityScale=function(){return
this.m_gravityScale},i.prototype.SetGravityScale=function(t)
{this.m_gravityScale=t},i.prototype.SetType=function(e)
{if(this.m_world.IsLocked())throw new Error;if(this.m_type!==e)
{this.m_type=e,this.ResetMassData(),this.m_type===t.b2BodyType.b2_staticBody&&(this
.m_linearVelocity.SetZero(),this.m_angularVelocity=0,this.m_sweep.a0=this.m_sweep.a
,this.m_sweep.c0.Copy(this.m_sweep.c),this.SynchronizeFixtures()),this.SetAwake(!
0),this.m_force.SetZero(),this.m_torque=0;for(var i=this.m_contactList;i;){var
n=i;i=i.next,this.m_world.m_contactManager.Destroy(n.contact)}this.m_contactList=nu
ll;for(var
r=this.m_fixtureList;r;r=r.m_next)r.TouchProxies()}},i.prototype.GetType=function()
{return this.m_type},i.prototype.SetBullet=function(t)
{this.m_bulletFlag=t},i.prototype.IsBullet=function(){return
this.m_bulletFlag},i.prototype.SetSleepingAllowed=function(t)
{this.m_autoSleepFlag=t,t||this.SetAwake(!
0)},i.prototype.IsSleepingAllowed=function(){return
this.m_autoSleepFlag},i.prototype.SetAwake=function(t){t?(this.m_awakeFlag=!
0,this.m_sleepTime=0):(this.m_awakeFlag=!
1,this.m_sleepTime=0,this.m_linearVelocity.SetZero(),this.m_angularVelocity=0,this.
m_force.SetZero(),this.m_torque=0)},i.prototype.IsAwake=function(){return
this.m_awakeFlag},i.prototype.SetActive=function(t)
{if(this.m_world.IsLocked())throw new Error;if(t!
==this.IsActive())if(this.m_activeFlag=t,t)for(var
e=this.m_fixtureList;e;e=e.m_next)e.CreateProxies(this.m_xf);else{for(e=this.m_fixt
ureList;e;e=e.m_next)e.DestroyProxies();for(var i=this.m_contactList;i;){var
n=i;i=i.next,this.m_world.m_contactManager.Destroy(n.contact)}this.m_contactList=nu
ll}},i.prototype.IsActive=function(){return
this.m_activeFlag},i.prototype.SetFixedRotation=function(t)
{this.m_fixedRotationFlag!
==t&&(this.m_fixedRotationFlag=t,this.m_angularVelocity=0,this.ResetMassData())},i.
prototype.IsFixedRotation=function(){return
this.m_fixedRotationFlag},i.prototype.GetFixtureList=function(){return
this.m_fixtureList},i.prototype.GetJointList=function(){return
this.m_jointList},i.prototype.GetContactList=function(){return
this.m_contactList},i.prototype.GetNext=function(){return
this.m_next},i.prototype.GetUserData=function(){return
this.m_userData},i.prototype.SetUserData=function(t)
{this.m_userData=t},i.prototype.GetWorld=function(){return
this.m_world},i.prototype.Dump=function(e){var i=this.m_islandIndex;e("{\n"),e("
const bd: b2BodyDef = new b2BodyDef();\n");var n="";switch(this.m_type){case
t.b2BodyType.b2_staticBody:n="b2BodyType.b2_staticBody";break;case
t.b2BodyType.b2_kinematicBody:n="b2BodyType.b2_kinematicBody";break;case
t.b2BodyType.b2_dynamicBody:n="b2BodyType.b2_dynamicBody"}e(" bd.type =
%s;\n",n),e(" bd.position.Set(%.15f, %.15f);\n",this.m_xf.p.x,this.m_xf.p.y),e("
bd.angle = %.15f;\n",this.m_sweep.a),e(" bd.linearVelocity.Set(%.15f,
%.15f);\n",this.m_linearVelocity.x,this.m_linearVelocity.y),e(" bd.angularVelocity
= %.15f;\n",this.m_angularVelocity),e(" bd.linearDamping =
%.15f;\n",this.m_linearDamping),e(" bd.angularDamping =
%.15f;\n",this.m_angularDamping),e(" bd.allowSleep =
%s;\n",this.m_autoSleepFlag?"true":"false"),e(" bd.awake =
%s;\n",this.m_awakeFlag?"true":"false"),e(" bd.fixedRotation =
%s;\n",this.m_fixedRotationFlag?"true":"false"),e(" bd.bullet =
%s;\n",this.m_bulletFlag?"true":"false"),e(" bd.active =
%s;\n",this.m_activeFlag?"true":"false"),e(" bd.gravityScale =
%.15f;\n",this.m_gravityScale),e("\n"),e(" bodies[%d] =
this.m_world.CreateBody(bd);\n",this.m_islandIndex),e("\n");for(var
r=this.m_fixtureList;r;r=r.m_next)e("
{\n"),r.Dump(e,i),e(" }\n");e("}\n")},i.prototype.SynchronizeFixtures=function()
{var
t=i.SynchronizeFixtures_s_xf1;t.q.SetAngle(this.m_sweep.a0),V.MulRV(t.q,this.m_swee
p.localCenter,t.p),I.SubVV(this.m_sweep.c0,t.p,t.p);for(var
e=this.m_fixtureList;e;e=e.m_next)e.Synchronize(t,this.m_xf)},i.prototype.Synchroni
zeTransform=function()
{this.m_xf.q.SetAngle(this.m_sweep.a),V.MulRV(this.m_xf.q,this.m_sweep.localCenter,
this.m_xf.p),I.SubVV(this.m_sweep.c,this.m_xf.p,this.m_xf.p)},i.prototype.ShouldCol
lide=function(e){return(this.m_type!==t.b2BodyType.b2_staticBody||e.m_type!
==t.b2BodyType.b2_staticBody)&&this.ShouldCollideConnected(e)},i.prototype.ShouldCo
llideConnected=function(t){for(var e=this.m_jointList;e;e=e.next)if(e.other===t&&!
e.joint.m_collideConnected)return!1;return!0},i.prototype.Advance=function(t)
{this.m_sweep.Advance(t),this.m_sweep.c.Copy(this.m_sweep.c0),this.m_sweep.a=this.m
_sweep.a0,this.m_xf.q.SetAngle(this.m_sweep.a),V.MulRV(this.m_xf.q,this.m_sweep.loc
alCenter,this.m_xf.p),I.SubVV(this.m_sweep.c,this.m_xf.p,this.m_xf.p)},i.prototype.
GetControllerList=function(){return
this.m_controllerList},i.prototype.GetControllerCount=function(){return
this.m_controllerCount},i.CreateFixtureShapeDensity_s_def=new
si,i.SetMassData_s_oldCenter=new I,i.ResetMassData_s_localCenter=new
I,i.ResetMassData_s_oldCenter=new I,i.ResetMassData_s_massData=new
Ze,i.SynchronizeFixtures_s_xf1=new N,i})();(function(t)
{t[t.e_unknownJoint=0]="e_unknownJoint",t[t.e_revoluteJoint=1]="e_revoluteJoint",t[
t.e_prismaticJoint=2]="e_prismaticJoint",t[t.e_distanceJoint=3]="e_distanceJoint",t
[t.e_pulleyJoint=4]="e_pulleyJoint",t[t.e_mouseJoint=5]="e_mouseJoint",t[t.e_gearJo
int=6]="e_gearJoint",t[t.e_wheelJoint=7]="e_wheelJoint",t[t.e_weldJoint=8]="e_weldJ
oint",t[t.e_frictionJoint=9]="e_frictionJoint",t[t.e_ropeJoint=10]="e_ropeJoint",t[
t.e_motorJoint=11]="e_motorJoint",t[t.e_areaJoint=12]="e_areaJoint"})
(t.b2JointType||(t.b2JointType={})),(function(t)
{t[t.e_inactiveLimit=0]="e_inactiveLimit",t[t.e_atLowerLimit=1]="e_atLowerLimit",t[
t.e_atUpperLimit=2]="e_atUpperLimit",t[t.e_equalLimits=3]="e_equalLimits"})
(t.b2LimitState||(t.b2LimitState={}));var ci=(function(){function t()
{this.linear=new I,this.angularA=0,this.angularB=0}return
t.prototype.SetZero=function(){return
this.linear.SetZero(),this.angularA=0,this.angularB=0,this},t.prototype.Set=functio
n(t,e,i){return this.linear.Copy(t),this.angularA=e,this.angularB=i,this},t})
(),ui=(function(){return function(t,e)
{this.prev=null,this.next=null,this.joint=t,this.other=e}})(),_i=(function(){return
function(e)
{this.type=t.b2JointType.e_unknownJoint,this.userData=null,this.collideConnected=!
1,this.type=e}})(),fi=(function(){function i(i)
{this.m_type=t.b2JointType.e_unknownJoint,this.m_prev=null,this.m_next=null,this.m_
index=0,this.m_islandFlag=!1,this.m_collideConnected=!
1,this.m_userData=null,this.m_type=i.type,this.m_edgeA=new
ui(this,i.bodyB),this.m_edgeB=new
ui(this,i.bodyA),this.m_bodyA=i.bodyA,this.m_bodyB=i.bodyB,this.m_collideConnected=
e(i.collideConnected,!1),this.m_userData=i.userData}return
i.prototype.GetType=function(){return this.m_type},i.prototype.GetBodyA=function()
{return this.m_bodyA},i.prototype.GetBodyB=function(){return
this.m_bodyB},i.prototype.GetNext=function(){return
this.m_next},i.prototype.GetUserData=function(){return
this.m_userData},i.prototype.SetUserData=function(t)
{this.m_userData=t},i.prototype.IsActive=function(){return
this.m_bodyA.IsActive()&&this.m_bodyB.IsActive()},i.prototype.GetCollideConnected=f
unction(){return this.m_collideConnected},i.prototype.Dump=function(t){t("// Dump
is not supported for this joint type.\n")},i.prototype.ShiftOrigin=function(t)
{},i})(),di=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_distanceJoint)||this;return i.localAnchorA=new
I,i.localAnchorB=new I,i.length=1,i.frequencyHz=0,i.dampingRatio=0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i,n)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(n,this.localAnchorB),this.length=I.DistanceVV(i,n),this.frequencyHz=
0,this.dampingRatio=0},i})(_i),mi=(function(t){function i(i){var n=t.call(this,i)||
this;return n.m_frequencyHz=0,n.m_dampingRatio=0,n.m_bias=0,n.m_localAnchorA=new
I,n.m_localAnchorB=new
I,n.m_gamma=0,n.m_impulse=0,n.m_length=0,n.m_indexA=0,n.m_indexB=0,n.m_u=new
I,n.m_rA=new I,n.m_rB=new I,n.m_localCenterA=new I,n.m_localCenterB=new
I,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_mass=0,n.m_qA=new
V,n.m_qB=new V,n.m_lalcA=new I,n.m_lalcB=new
I,n.m_frequencyHz=e(i.frequencyHz,0),n.m_dampingRatio=e(i.dampingRatio,0),n.m_local
AnchorA.Copy(i.localAnchorA),n.m_localAnchorB.Copy(i.localAnchorB),n.m_length=i.len
gth,n}return $e(i,t),i.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},i.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*this.m_impulse*this.m_u.x,e.y=t*this.m_impulse*this.m_u.y,e},i.prototype.GetR
eactionTorque=function(t){return 0},i.prototype.GetLocalAnchorA=function(){return
this.m_localAnchorA},i.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},i.prototype.SetLength=function(t)
{this.m_length=t},i.prototype.Length=function(){return
this.m_length},i.prototype.SetFrequency=function(t)
{this.m_frequencyHz=t},i.prototype.GetFrequency=function(){return
this.m_frequencyHz},i.prototype.SetDampingRatio=function(t)
{this.m_dampingRatio=t},i.prototype.GetDampingRatio=function(){return
this.m_dampingRatio},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2DistanceJointDef = new b2DistanceJointDef();\n"),t(" jd.bodyA =
bodies[%d];\n",e),t(" jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.length =
%.15f;\n",this.m_length),t(" jd.frequencyHz = %.15f;\n",this.m_frequencyHz),t("
jd.dampingRatio = %.15f;\n",this.m_dampingRatio),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.prototype.InitVelocityConstraints
=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.velocities[this.m
_indexA].v,a=t.velocities[this.m_indexA].w,o=t.positions[this.m_indexB].c,h=t.posit
ions[this.m_indexB].a,c=t.velocities[this.m_indexB].v,u=t.velocities[this.m_indexB]
.w,_=this.m_qA.SetAngle(n),f=this.m_qB.SetAngle(h);I.SubVV(this.m_localAnchorA,this
.m_localCenterA,this.m_lalcA),V.MulRV(_,this.m_lalcA,this.m_rA),I.SubVV(this.m_loca
lAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(f,this.m_lalcB,this.m_rB),this.m
_u.x=o.x+this.m_rB.x-e.x-this.m_rA.x,this.m_u.y=o.y+this.m_rB.y-e.y-this.m_rA.y;var
d=this.m_u.Length();d>l?this.m_u.SelfMul(1/d):this.m_u.SetZero();var
m=I.CrossVV(this.m_rA,this.m_u),p=I.CrossVV(this.m_rB,this.m_u),v=this.m_invMassA+t
his.m_invIA*m*m+this.m_invMassB+this.m_invIB*p*p;if(this.m_mass=0!==v?
1/v:0,this.m_frequencyHz>0){var y=d-
this.m_length,g=2*s*this.m_frequencyHz,x=2*this.m_mass*this.m_dampingRatio*g,b=this
.m_mass*g*g,A=t.step.dt;this.m_gamma=A*(x+A*b),this.m_gamma=0!==this.m_gamma?
1/this.m_gamma:0,this.m_bias=y*A*b*this.m_gamma,v+=this.m_gamma,this.m_mass=0!==v?
1/v:0}else this.m_gamma=0,this.m_bias=0;if(t.step.warmStarting)
{this.m_impulse*=t.step.dtRatio;var
C=I.MulSV(this.m_impulse,this.m_u,i.InitVelocityConstraints_s_P);r.SelfMulSub(this.
m_invMassA,C),a-
=this.m_invIA*I.CrossVV(this.m_rA,C),c.SelfMulAdd(this.m_invMassB,C),u+=this.m_invI
B*I.CrossVV(this.m_rB,C)}else
this.m_impulse=0;t.velocities[this.m_indexA].w=a,t.velocities[this.m_indexB].w=u},i
.prototype.SolveVelocityConstraints=function(t){var
e=t.velocities[this.m_indexA].v,n=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=I.AddVCrossSV(e,n,this.m_rA,i.SolveV
elocityConstraints_s_vpA),o=I.AddVCrossSV(r,s,this.m_rB,i.SolveVelocityConstraints_
s_vpB),l=I.DotVV(this.m_u,I.SubVV(o,a,I.s_t0)),h=-
this.m_mass*(l+this.m_bias+this.m_gamma*this.m_impulse);this.m_impulse+=h;var
c=I.MulSV(h,this.m_u,i.SolveVelocityConstraints_s_P);e.SelfMulSub(this.m_invMassA,c
),n-
=this.m_invIA*I.CrossVV(this.m_rA,c),r.SelfMulAdd(this.m_invMassB,c),s+=this.m_invI
B*I.CrossVV(this.m_rB,c),t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB
].w=s},i.prototype.SolvePositionConstraints=function(t)
{if(this.m_frequencyHz>0)return!0;var

e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(n),o=this.m_qB.SetAng
le(s),h=V.MulRV(a,this.m_lalcA,this.m_rA),c=V.MulRV(o,this.m_lalcB,this.m_rB),u=thi
s.m_u;u.x=r.x+c.x-e.x-h.x,u.y=r.y+c.y-e.y-h.y;var _=this.m_u.Normalize()-
this.m_length;_=b(_,-.2,.2);var f=-
this.m_mass*_,d=I.MulSV(f,u,i.SolvePositionConstraints_s_P);return
e.SelfMulSub(this.m_invMassA,d),n-
=this.m_invIA*I.CrossVV(h,d),r.SelfMulAdd(this.m_invMassB,d),s+=this.m_invIB*I.Cros
sVV(c,d),t.positions[this.m_indexA].a=n,t.positions[this.m_indexB].a=s,y(_)<l},i.In
itVelocityConstraints_s_P=new I,i.SolveVelocityConstraints_s_vpA=new
I,i.SolveVelocityConstraints_s_vpB=new I,i.SolveVelocityConstraints_s_P=new
I,i.SolvePositionConstraints_s_P=new I,i})(fi),pi=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_areaJoint)||this;return
i.bodies=[],i.frequencyHz=0,i.dampingRatio=0,i}return
$e(i,e),i.prototype.AddBody=function(t){this.bodies.push(t),1===this.bodies.length?
this.bodyA=t:2===this.bodies.length&&(this.bodyB=t)},i})(_i),vi=(function(t)
{function i(i){var n=t.call(this,i)||
this;n.m_frequencyHz=0,n.m_dampingRatio=0,n.m_impulse=0,n.m_targetArea=0,n.m_bodies
=i.bodies,n.m_frequencyHz=e(i.frequencyHz,0),n.m_dampingRatio=e(i.dampingRatio,0),n
.m_targetLengths=m(i.bodies.length),n.m_normals=I.MakeArray(i.bodies.length),n.m_jo
ints=[],n.m_deltas=I.MakeArray(i.bodies.length),n.m_delta=new I;var r=new
di;r.frequencyHz=n.m_frequencyHz,r.dampingRatio=n.m_dampingRatio,n.m_targetArea=0;f
or(var s=0;s<n.m_bodies.length;++s){var
a=n.m_bodies[s],o=n.m_bodies[(s+1)%n.m_bodies.length],l=a.GetWorldCenter(),h=o.GetW
orldCenter();n.m_targetLengths[s]=I.DistanceVV(l,h),n.m_targetArea+=I.CrossVV(l,h),
r.Initialize(a,o,l,h),n.m_joints[s]=a.GetWorld().CreateJoint(r)}return
n.m_targetArea*=.5,n}return $e(i,t),i.prototype.GetAnchorA=function(t){return
t},i.prototype.GetAnchorB=function(t){return
t},i.prototype.GetReactionForce=function(t,e){return
e},i.prototype.GetReactionTorque=function(t){return
0},i.prototype.SetFrequency=function(t){this.m_frequencyHz=t;for(var
e=0;e<this.m_joints.length;+
+e)this.m_joints[e].SetFrequency(t)},i.prototype.GetFrequency=function(){return
this.m_frequencyHz},i.prototype.SetDampingRatio=function(t)
{this.m_dampingRatio=t;for(var e=0;e<this.m_joints.length;+
+e)this.m_joints[e].SetDampingRatio(t)},i.prototype.GetDampingRatio=function()
{return this.m_dampingRatio},i.prototype.Dump=function(t){t("Area joint dumping is
not supported.\n")},i.prototype.InitVelocityConstraints=function(t){for(var
e=0;e<this.m_bodies.length;++e){var i=this.m_bodies[(e+this.m_bodies.length-
1)%this.m_bodies.length],n=this.m_bodies[(e+1)%this.m_bodies.length],r=t.positions[
i.m_islandIndex].c,s=t.positions[n.m_islandIndex].c,a=this.m_deltas[e];I.SubVV(s,r,
a)}if(t.step.warmStarting)
{this.m_impulse*=t.step.dtRatio;for(e=0;e<this.m_bodies.length;++e){var
o=this.m_bodies[e],l=t.velocities[o.m_islandIndex].v;a=this.m_deltas[e];l.x+=o.m_in
vMass*a.y*.5*this.m_impulse,l.y+=o.m_invMass*-a.x*.5*this.m_impulse}}else
this.m_impulse=0},i.prototype.SolveVelocityConstraints=function(t){for(var
e=0,i=0,n=0;n<this.m_bodies.length;++n){var
r=this.m_bodies[n],s=t.velocities[r.m_islandIndex].v;e+=(o=this.m_deltas[n]).Length
Squared()/r.GetMass(),i+=I.CrossVV(s,o)}var a=-
2*i/e;this.m_impulse+=a;for(n=0;n<this.m_bodies.length;++n)
{r=this.m_bodies[n],s=t.velocities[r.m_islandIndex].v;var
o=this.m_deltas[n];s.x+=r.m_invMass*o.y*.5*a,s.y+=r.m_invMass*-
o.x*.5*a}},i.prototype.SolvePositionConstraints=function(t){for(var
e=0,i=0,r=0;r<this.m_bodies.length;++r){var
s=this.m_bodies[r],a=this.m_bodies[(r+1)%this.m_bodies.length],o=t.positions[s.m_is
landIndex].c,h=t.positions[a.m_islandIndex].c,c=(f=I.SubVV(h,o,this.m_delta)).Lengt
h();c<n&&(c=1),this.m_normals[r].x=f.y/c,this.m_normals[r].y=-
f.x/c,e+=c,i+=I.CrossVV(o,h)}i*=.5;var u=.5*(this.m_targetArea-i)/e,_=!
0;for(r=0;r<this.m_bodies.length;++r)
{s=this.m_bodies[r],o=t.positions[s.m_islandIndex].c;var
f,d=(r+1)%this.m_bodies.length;
(f=I.AddVV(this.m_normals[r],this.m_normals[d],this.m_delta)).SelfMul(u);var
m=f.LengthSquared();m>C(.2)&&f.SelfMul(.2/T(m)),m>C(l)&&(_=!
1),o.x+=f.x,o.y+=f.y}return _},i})(fi),yi=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_frictionJoint)||this;return i.localAnchorA=new
I,i.localAnchorB=new I,i.maxForce=0,i.maxTorque=0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(i,this.localAnchorB)},i})(_i),gi=(function(t){function i(i){var
n=t.call(this,i)||this;return n.m_localAnchorA=new I,n.m_localAnchorB=new
I,n.m_linearImpulse=new
I,n.m_angularImpulse=0,n.m_maxForce=0,n.m_maxTorque=0,n.m_indexA=0,n.m_indexB=0,n.m
_rA=new I,n.m_rB=new I,n.m_localCenterA=new I,n.m_localCenterB=new
I,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_linearMass=new
L,n.m_angularMass=0,n.m_qA=new V,n.m_qB=new V,n.m_lalcA=new I,n.m_lalcB=new
I,n.m_K=new
L,n.m_localAnchorA.Copy(i.localAnchorA),n.m_localAnchorB.Copy(i.localAnchorB),n.m_l
inearImpulse.SetZero(),n.m_maxForce=e(i.maxForce,0),n.m_maxTorque=e(i.maxTorque,0),
n.m_linearMass.SetZero(),n}return
$e(i,t),i.prototype.InitVelocityConstraints=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=t.positions[this.m_indexA].a,i=t.velocities[this.m_indexA].v,n=t.velocities[this.
m_indexA].w,r=t.positions[this.m_indexB].a,s=t.velocities[this.m_indexB].v,a=t.velo
cities[this.m_indexB].w,o=this.m_qA.SetAngle(e),l=this.m_qB.SetAngle(r);I.SubVV(thi
s.m_localAnchorA,this.m_localCenterA,this.m_lalcA);var
h=V.MulRV(o,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
c=V.MulRV(l,this.m_lalcB,this.m_rB),u=this.m_invMassA,_=this.m_invMassB,f=this.m_in
vIA,d=this.m_invIB,m=this.m_K;if(m.ex.x=u+_+f*h.y*h.y+d*c.y*c.y,m.ex.y=-f*h.x*h.y-
d*c.x*c.y,m.ey.x=m.ex.y,m.ey.y=u+_+f*h.x*h.x+d*c.x*c.x,m.GetInverse(this.m_linearMa
ss),this.m_angularMass=f+d,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angul
arMass),t.step.warmStarting)
{this.m_linearImpulse.SelfMul(t.step.dtRatio),this.m_angularImpulse*=t.step.dtRatio
;var p=this.m_linearImpulse;i.SelfMulSub(u,p),n-=f*(I.CrossVV(this.m_rA,p)
+this.m_angularImpulse),s.SelfMulAdd(_,p),a+=d*(I.CrossVV(this.m_rB,p)
+this.m_angularImpulse)}else
this.m_linearImpulse.SetZero(),this.m_angularImpulse=0;t.velocities[this.m_indexA].
w=n,t.velocities[this.m_indexB].w=a},i.prototype.SolveVelocityConstraints=function(
t){var
e=t.velocities[this.m_indexA].v,n=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=this.m_invMassA,o=this.m_invMassB,l=
this.m_invIA,h=this.m_invIB,c=t.step.dt,u=s-n,_=-
this.m_angularMass*u,f=this.m_angularImpulse,d=c*this.m_maxTorque;this.m_angularImp
ulse=b(this.m_angularImpulse+_,-d,d),n-=l*(_=this.m_angularImpulse-f),s+=h*_;var
m=I.SubVV(I.AddVCrossSV(r,s,this.m_rB,I.s_t0),I.AddVCrossSV(e,n,this.m_rA,I.s_t1),i
.SolveVelocityConstraints_s_Cdot_v2),p=L.MulMV(this.m_linearMass,m,i.SolveVelocityC
onstraints_s_impulseV).SelfNeg(),v=i.SolveVelocityConstraints_s_oldImpulseV.Copy(th
is.m_linearImpulse);this.m_linearImpulse.SelfAdd(p);d=c*this.m_maxForce;this.m_line
arImpulse.LengthSquared()>d*d&&(this.m_linearImpulse.Normalize(),this.m_linearImpul
se.SelfMul(d)),I.SubVV(this.m_linearImpulse,v,p),e.SelfMulSub(a,p),n-
=l*I.CrossVV(this.m_rA,p),r.SelfMulAdd(o,p),s+=h*I.CrossVV(this.m_rB,p),t.velocitie
s[this.m_indexA].w=n,t.velocities[this.m_indexB].w=s},i.prototype.SolvePositionCons
traints=function(t){return!0},i.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},i.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*this.m_linearImpulse.x,e.y=t*this.m_linearImpulse.y,e},i.prototype.GetReactio
nTorque=function(t){return
t*this.m_angularImpulse},i.prototype.GetLocalAnchorA=function(){return
this.m_localAnchorA},i.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},i.prototype.SetMaxForce=function(t)
{this.m_maxForce=t},i.prototype.GetMaxForce=function(){return
this.m_maxForce},i.prototype.SetMaxTorque=function(t)
{this.m_maxTorque=t},i.prototype.GetMaxTorque=function(){return
this.m_maxTorque},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2FrictionJointDef = new b2FrictionJointDef();\n"),t(" jd.bodyA =
bodies[%d];\n",e),t(" jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.maxForce =
%.15f;\n",this.m_maxForce),t(" jd.maxTorque = %.15f;\n",this.m_maxTorque),t("
joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.SolveVelocityConstraints_s_Cdot_v
2=new I,i.SolveVelocityConstraints_s_impulseV=new
I,i.SolveVelocityConstraints_s_oldImpulseV=new I,i})(fi),xi=(function(e){function
i(){var i=e.call(this,t.b2JointType.e_gearJoint)||this;return i.ratio=1,i}return
$e(i,e),i})(_i),bi=(function(i){function n(n){var r,s,a=i.call(this,n)||
this;a.m_typeA=t.b2JointType.e_unknownJoint,a.m_typeB=t.b2JointType.e_unknownJoint,
a.m_localAnchorA=new I,a.m_localAnchorB=new I,a.m_localAnchorC=new
I,a.m_localAnchorD=new I,a.m_localAxisC=new I,a.m_localAxisD=new
I,a.m_referenceAngleA=0,a.m_referenceAngleB=0,a.m_constant=0,a.m_ratio=0,a.m_impuls
e=0,a.m_indexA=0,a.m_indexB=0,a.m_indexC=0,a.m_indexD=0,a.m_lcA=new
I,a.m_lcB=new I,a.m_lcC=new I,a.m_lcD=new
I,a.m_mA=0,a.m_mB=0,a.m_mC=0,a.m_mD=0,a.m_iA=0,a.m_iB=0,a.m_iC=0,a.m_iD=0,a.m_JvAC=
new I,a.m_JvBD=new I,a.m_JwA=0,a.m_JwB=0,a.m_JwC=0,a.m_JwD=0,a.m_mass=0,a.m_qA=new
V,a.m_qB=new V,a.m_qC=new V,a.m_qD=new V,a.m_lalcA=new I,a.m_lalcB=new
I,a.m_lalcC=new I,a.m_lalcD=new
I,a.m_joint1=n.joint1,a.m_joint2=n.joint2,a.m_typeA=a.m_joint1.GetType(),a.m_typeB=
a.m_joint2.GetType(),a.m_bodyC=a.m_joint1.GetBodyA(),a.m_bodyA=a.m_joint1.GetBodyB(
);var
o=a.m_bodyA.m_xf,l=a.m_bodyA.m_sweep.a,h=a.m_bodyC.m_xf,c=a.m_bodyC.m_sweep.a;if(a.
m_typeA===t.b2JointType.e_revoluteJoint){var
u=n.joint1;a.m_localAnchorC.Copy(u.m_localAnchorA),a.m_localAnchorA.Copy(u.m_localA
nchorB),a.m_referenceAngleA=u.m_referenceAngle,a.m_localAxisC.SetZero(),r=l-c-
a.m_referenceAngleA}else{var
_=n.joint1;a.m_localAnchorC.Copy(_.m_localAnchorA),a.m_localAnchorA.Copy(_.m_localA
nchorB),a.m_referenceAngleA=_.m_referenceAngle,a.m_localAxisC.Copy(_.m_localXAxisA)
;var
f=a.m_localAnchorC,d=V.MulTRV(h.q,I.AddVV(V.MulRV(o.q,a.m_localAnchorA,I.s_t0),I.Su
bVV(o.p,h.p,I.s_t1),I.s_t0),I.s_t0);r=I.DotVV(I.SubVV(d,f,I.s_t0),a.m_localAxisC)}a
.m_bodyD=a.m_joint2.GetBodyA(),a.m_bodyB=a.m_joint2.GetBodyB();var
m=a.m_bodyB.m_xf,p=a.m_bodyB.m_sweep.a,v=a.m_bodyD.m_xf,y=a.m_bodyD.m_sweep.a;if(a.
m_typeB===t.b2JointType.e_revoluteJoint)
{u=n.joint2;a.m_localAnchorD.Copy(u.m_localAnchorA),a.m_localAnchorB.Copy(u.m_local
AnchorB),a.m_referenceAngleB=u.m_referenceAngle,a.m_localAxisD.SetZero(),s=p-y-
a.m_referenceAngleB}else{_=n.joint2;a.m_localAnchorD.Copy(_.m_localAnchorA),a.m_loc
alAnchorB.Copy(_.m_localAnchorB),a.m_referenceAngleB=_.m_referenceAngle,a.m_localAx
isD.Copy(_.m_localXAxisA);var
g=a.m_localAnchorD,x=V.MulTRV(v.q,I.AddVV(V.MulRV(m.q,a.m_localAnchorB,I.s_t0),I.Su
bVV(m.p,v.p,I.s_t1),I.s_t0),I.s_t0);s=I.DotVV(I.SubVV(x,g,I.s_t0),a.m_localAxisD)}r
eturn a.m_ratio=e(n.ratio,1),a.m_constant=r+a.m_ratio*s,a.m_impulse=0,a}return
$e(n,i),n.prototype.InitVelocityConstraints=function(e)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_indexC=this.m_bodyC.m_islandIndex,this.m_indexD=this.m_bodyD.m_islandIndex,t
his.m_lcA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_lcB.Copy(this.m_bodyB.m_swe
ep.localCenter),this.m_lcC.Copy(this.m_bodyC.m_sweep.localCenter),this.m_lcD.Copy(t
his.m_bodyD.m_sweep.localCenter),this.m_mA=this.m_bodyA.m_invMass,this.m_mB=this.m_
bodyB.m_invMass,this.m_mC=this.m_bodyC.m_invMass,this.m_mD=this.m_bodyD.m_invMass,t
his.m_iA=this.m_bodyA.m_invI,this.m_iB=this.m_bodyB.m_invI,this.m_iC=this.m_bodyC.m
_invI,this.m_iD=this.m_bodyD.m_invI;var
i=e.positions[this.m_indexA].a,r=e.velocities[this.m_indexA].v,s=e.velocities[this.
m_indexA].w,a=e.positions[this.m_indexB].a,o=e.velocities[this.m_indexB].v,l=e.velo
cities[this.m_indexB].w,h=e.positions[this.m_indexC].a,c=e.velocities[this.m_indexC
].v,u=e.velocities[this.m_indexC].w,_=e.positions[this.m_indexD].a,f=e.velocities[t
his.m_indexD].v,d=e.velocities[this.m_indexD].w,m=this.m_qA.SetAngle(i),p=this.m_qB
.SetAngle(a),v=this.m_qC.SetAngle(h),y=this.m_qD.SetAngle(_);if(this.m_mass=0,this.
m_typeA===t.b2JointType.e_revoluteJoint)this.m_JvAC.SetZero(),this.m_JwA=1,this.m_J
wC=1,this.m_mass+=this.m_iA+this.m_iC;else{var
g=V.MulRV(v,this.m_localAxisC,n.InitVelocityConstraints_s_u);I.SubVV(this.m_localAn
chorC,this.m_lcC,this.m_lalcC);var
x=V.MulRV(v,this.m_lalcC,n.InitVelocityConstraints_s_rC);I.SubVV(this.m_localAnchor
A,this.m_lcA,this.m_lalcA);var
b=V.MulRV(m,this.m_lalcA,n.InitVelocityConstraints_s_rA);this.m_JvAC.Copy(g),this.m
_JwC=I.CrossVV(x,g),this.m_JwA=I.CrossVV(b,g),this.m_mass+=this.m_mC+this.m_mA+this
.m_iC*this.m_JwC*this.m_JwC+this.m_iA*this.m_JwA*this.m_JwA}if(this.m_typeB===t.b2J
ointType.e_revoluteJoint)this.m_JvBD.SetZero(),this.m_JwB=this.m_ratio,this.m_JwD=t
his.m_ratio,this.m_mass+=this.m_ratio*this.m_ratio*(this.m_iB+this.m_iD);else{g=V.M
ulRV(y,this.m_localAxisD,n.InitVelocityConstraints_s_u);I.SubVV(this.m_localAnchorD
,this.m_lcD,this.m_lalcD);var
A=V.MulRV(y,this.m_lalcD,n.InitVelocityConstraints_s_rD);I.SubVV(this.m_localAnchor
B,this.m_lcB,this.m_lalcB);var
C=V.MulRV(p,this.m_lalcB,n.InitVelocityConstraints_s_rB);I.MulSV(this.m_ratio,g,thi
s.m_JvBD),this.m_JwD=this.m_ratio*I.CrossVV(A,g),this.m_JwB=this.m_ratio*I.CrossVV(
C,g),this.m_mass+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_mB)
+this.m_iD*this.m_JwD*this.m_JwD+this.m_iB*this.m_JwB*this.m_JwB}this.m_mass=this.m
_mass>0?1/this.m_mass:0,e.step.warmStarting?
(r.SelfMulAdd(this.m_mA*this.m_impulse,this.m_JvAC),s+=this.m_iA*this.m_impulse*thi
s.m_JwA,o.SelfMulAdd(this.m_mB*this.m_impulse,this.m_JvBD),l+=this.m_iB*this.m_impu
lse*this.m_JwB,c.SelfMulSub(this.m_mC*this.m_impulse,this.m_JvAC),u-
=this.m_iC*this.m_impulse*this.m_JwC,f.SelfMulSub(this.m_mD*this.m_impulse,this.m_J
vBD),d-
=this.m_iD*this.m_impulse*this.m_JwD):this.m_impulse=0,e.velocities[this.m_indexA].
w=s,e.velocities[this.m_indexB].w=l,e.velocities[this.m_indexC].w=u,e.velocities[th
is.m_indexD].w=d},n.prototype.SolveVelocityConstraints=function(t){var
e=t.velocities[this.m_indexA].v,i=t.velocities[this.m_indexA].w,n=t.velocities[this
.m_indexB].v,r=t.velocities[this.m_indexB].w,s=t.velocities[this.m_indexC].v,a=t.ve
locities[this.m_indexC].w,o=t.velocities[this.m_indexD].v,l=t.velocities[this.m_ind
exD].w,h=I.DotVV(this.m_JvAC,I.SubVV(e,s,I.s_t0))
+I.DotVV(this.m_JvBD,I.SubVV(n,o,I.s_t0));h+=this.m_JwA*i-this.m_JwC*a+
(this.m_JwB*r-this.m_JwD*l);var c=-
this.m_mass*h;this.m_impulse+=c,e.SelfMulAdd(this.m_mA*c,this.m_JvAC),i+=this.m_iA*
c*this.m_JwA,n.SelfMulAdd(this.m_mB*c,this.m_JvBD),r+=this.m_iB*c*this.m_JwB,s.Self
MulSub(this.m_mC*c,this.m_JvAC),a-
=this.m_iC*c*this.m_JwC,o.SelfMulSub(this.m_mD*c,this.m_JvBD),l-
=this.m_iD*c*this.m_JwD,t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB]
.w=r,t.velocities[this.m_indexC].w=a,t.velocities[this.m_indexD].w=l},n.prototype.S
olvePositionConstraints=function(e){var
i,r,s,a,o,h,c=e.positions[this.m_indexA].c,u=e.positions[this.m_indexA].a,_=e.posit
ions[this.m_indexB].c,f=e.positions[this.m_indexB].a,d=e.positions[this.m_indexC].c
,m=e.positions[this.m_indexC].a,p=e.positions[this.m_indexD].c,v=e.positions[this.m
_indexD].a,y=this.m_qA.SetAngle(u),g=this.m_qB.SetAngle(f),x=this.m_qC.SetAngle(m),
b=this.m_qD.SetAngle(v),A=this.m_JvAC,C=this.m_JvBD,S=0;if(this.m_typeA===t.b2Joint
Type.e_revoluteJoint)A.SetZero(),s=1,o=1,S+=this.m_iA+this.m_iC,i=u-m-
this.m_referenceAngleA;else{var
T=V.MulRV(x,this.m_localAxisC,n.SolvePositionConstraints_s_u),w=V.MulRV(x,this.m_la
lcC,n.SolvePositionConstraints_s_rC),E=V.MulRV(y,this.m_lalcA,n.SolvePositionConstr
aints_s_rA);A.Copy(T),o=I.CrossVV(w,T),s=I.CrossVV(E,T),S+=this.m_mC+this.m_mA+this
.m_iC*o*o+this.m_iA*s*s;var
M=this.m_lalcC,D=V.MulTRV(x,I.AddVV(E,I.SubVV(c,d,I.s_t0),I.s_t0),I.s_t0);i=I.DotVV
(I.SubVV(D,M,I.s_t0),this.m_localAxisC)}if(this.m_typeB===t.b2JointType.e_revoluteJ
oint)C.SetZero(),a=this.m_ratio,h=this.m_ratio,S+=this.m_ratio*this.m_ratio*(this.m
_iB+this.m_iD),r=f-v-
this.m_referenceAngleB;else{T=V.MulRV(b,this.m_localAxisD,n.SolvePositionConstraint
s_s_u);var
B=V.MulRV(b,this.m_lalcD,n.SolvePositionConstraints_s_rD),P=V.MulRV(g,this.m_lalcB,
n.SolvePositionConstraints_s_rB);I.MulSV(this.m_ratio,T,C),h=this.m_ratio*I.CrossVV
(B,T),a=this.m_ratio*I.CrossVV(P,T),S+=this.m_ratio*this.m_ratio*(this.m_mD+this.m_
mB)+this.m_iD*h*h+this.m_iB*a*a;var
R=this.m_lalcD,O=V.MulTRV(b,I.AddVV(P,I.SubVV(_,p,I.s_t0),I.s_t0),I.s_t0);r=I.DotVV
(I.SubVV(O,R,I.s_t0),this.m_localAxisD)}var L=i+this.m_ratio*r-
this.m_constant,F=0;return S>0&&(F=-
L/S),c.SelfMulAdd(this.m_mA*F,A),u+=this.m_iA*F*s,_.SelfMulAdd(this.m_mB*F,C),f+=th
is.m_iB*F*a,d.SelfMulSub(this.m_mC*F,A),m-
=this.m_iC*F*o,p.SelfMulSub(this.m_mD*F,C),v-
=this.m_iD*F*h,e.positions[this.m_indexA].a=u,e.positions[this.m_indexB].a=f,e.posi
tions[this.m_indexC].a=m,e.positions[this.m_indexD].a=v,0<l},n.prototype.GetAnchorA
=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},n.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},n.prototype.GetReactionForce=fun
ction(t,e){return
I.MulSV(t*this.m_impulse,this.m_JvAC,e)},n.prototype.GetReactionTorque=function(t)
{return t*this.m_impulse*this.m_JwA},n.prototype.GetJoint1=function(){return
this.m_joint1},n.prototype.GetJoint2=function(){return
this.m_joint2},n.prototype.GetRatio=function(){return
this.m_ratio},n.prototype.SetRatio=function(t)
{this.m_ratio=t},n.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex,n=this.m_joint1.m_index,r
=this.m_joint2.m_index;t(" const jd: b2GearJointDef = new
b2GearJointDef();\n"),t(" jd.bodyA = bodies[%d];\n",e),t(" jd.bodyB =
bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.joint1 =
joints[%d];\n",n),t(" jd.joint2 = joints[%d];\n",r),t(" jd.ratio =
%.15f;\n",this.m_ratio),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},n.InitVelocityConstraints_s_u=new
I,n.InitVelocityConstraints_s_rA=new I,n.InitVelocityConstraints_s_rB=new
I,n.InitVelocityConstraints_s_rC=new I,n.InitVelocityConstraints_s_rD=new
I,n.SolvePositionConstraints_s_u=new I,n.SolvePositionConstraints_s_rA=new
I,n.SolvePositionConstraints_s_rB=new I,n.SolvePositionConstraints_s_rC=new
I,n.SolvePositionConstraints_s_rD=new I,n})(fi),Ai=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_motorJoint)||this;return i.linearOffset=new
I(0,0),i.angularOffset=0,i.maxForce=1,i.maxTorque=1,i.correctionFactor=.3,i}return
$e(i,e),i.prototype.Initialize=function(t,e)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(this.bodyB.GetPosition(),this.l
inearOffset);var
i=this.bodyA.GetAngle(),n=this.bodyB.GetAngle();this.angularOffset=n-i},i})
(_i),Ci=(function(t){function i(i){var n=t.call(this,i)||this;return
n.m_linearOffset=new I,n.m_angularOffset=0,n.m_linearImpulse=new
I,n.m_angularImpulse=0,n.m_maxForce=0,n.m_maxTorque=0,n.m_correctionFactor=.3,n.m_i
ndexA=0,n.m_indexB=0,n.m_rA=new
I,n.m_rB=new I,n.m_localCenterA=new I,n.m_localCenterB=new I,n.m_linearError=new
I,n.m_angularError=0,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_line
arMass=new L,n.m_angularMass=0,n.m_qA=new V,n.m_qB=new V,n.m_K=new
L,n.m_linearOffset.Copy(e(i.linearOffset,I.ZERO)),n.m_linearImpulse.SetZero(),n.m_m
axForce=e(i.maxForce,0),n.m_maxTorque=e(i.maxTorque,0),n.m_correctionFactor=e(i.cor
rectionFactor,.3),n}return $e(i,t),i.prototype.GetAnchorA=function(t){var
e=this.m_bodyA.GetPosition();return
t.x=e.x,t.y=e.y,t},i.prototype.GetAnchorB=function(t){var
e=this.m_bodyB.GetPosition();return
t.x=e.x,t.y=e.y,t},i.prototype.GetReactionForce=function(t,e){return
I.MulSV(t,this.m_linearImpulse,e)},i.prototype.GetReactionTorque=function(t){return
t*this.m_angularImpulse},i.prototype.SetLinearOffset=function(t)
{I.IsEqualToV(t,this.m_linearOffset)||(this.m_bodyA.SetAwake(!
0),this.m_bodyB.SetAwake(!
0),this.m_linearOffset.Copy(t))},i.prototype.GetLinearOffset=function(){return
this.m_linearOffset},i.prototype.SetAngularOffset=function(t){t!
==this.m_angularOffset&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_angularOffset=t)},i.prototype.GetAngularOffset=function(){return
this.m_angularOffset},i.prototype.SetMaxForce=function(t)
{this.m_maxForce=t},i.prototype.GetMaxForce=function(){return
this.m_maxForce},i.prototype.SetMaxTorque=function(t)
{this.m_maxTorque=t},i.prototype.GetMaxTorque=function(){return
this.m_maxTorque},i.prototype.InitVelocityConstraints=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=t.positions[this.m_indexA].c,i=t.positions[this.m_indexA].a,n=t.velocities[this.m
_indexA].v,r=t.velocities[this.m_indexA].w,s=t.positions[this.m_indexB].c,a=t.posit
ions[this.m_indexB].a,o=t.velocities[this.m_indexB].v,l=t.velocities[this.m_indexB]
.w,h=this.m_qA.SetAngle(i),c=this.m_qB.SetAngle(a),u=V.MulRV(h,I.SubVV(this.m_linea
rOffset,this.m_localCenterA,I.s_t0),this.m_rA),_=V.MulRV(c,I.NegV(this.m_localCente
rB,I.s_t0),this.m_rB),f=this.m_invMassA,d=this.m_invMassB,m=this.m_invIA,p=this.m_i
nvIB,v=this.m_K;if(v.ex.x=f+d+m*u.y*u.y+p*_.y*_.y,v.ex.y=-m*u.x*u.y-
p*_.x*_.y,v.ey.x=v.ex.y,v.ey.y=f+d+m*u.x*u.x+p*_.x*_.x,v.GetInverse(this.m_linearMa
ss),this.m_angularMass=m+p,this.m_angularMass>0&&(this.m_angularMass=1/this.m_angul
arMass),I.SubVV(I.AddVV(s,_,I.s_t0),I.AddVV(e,u,I.s_t1),this.m_linearError),this.m_
angularError=a-i-this.m_angularOffset,t.step.warmStarting)
{this.m_linearImpulse.SelfMul(t.step.dtRatio),this.m_angularImpulse*=t.step.dtRatio
;var y=this.m_linearImpulse;n.SelfMulSub(f,y),r-=m*(I.CrossVV(u,y)
+this.m_angularImpulse),o.SelfMulAdd(d,y),l+=p*(I.CrossVV(_,y)
+this.m_angularImpulse)}else
this.m_linearImpulse.SetZero(),this.m_angularImpulse=0;t.velocities[this.m_indexA].
w=r,t.velocities[this.m_indexB].w=l},i.prototype.SolveVelocityConstraints=function(
t){var
e=t.velocities[this.m_indexA].v,n=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=this.m_invMassA,o=this.m_invMassB,l=
this.m_invIA,h=this.m_invIB,c=t.step.dt,u=t.step.inv_dt,_=s-
n+u*this.m_correctionFactor*this.m_angularError,f=-
this.m_angularMass*_,d=this.m_angularImpulse,m=c*this.m_maxTorque;this.m_angularImp
ulse=b(this.m_angularImpulse+f,-m,m),n-=l*(f=this.m_angularImpulse-d),s+=h*f;var
p=this.m_rA,v=this.m_rB,y=I.AddVV(I.SubVV(I.AddVV(r,I.CrossSV(s,v,I.s_t0),I.s_t0),I
.AddVV(e,I.CrossSV(n,p,I.s_t1),I.s_t1),I.s_t2),I.MulSV(u*this.m_correctionFactor,th
is.m_linearError,I.s_t3),i.SolveVelocityConstraints_s_Cdot_v2),g=L.MulMV(this.m_lin
earMass,y,i.SolveVelocityConstraints_s_impulse_v2).SelfNeg(),x=i.SolveVelocityConst
raints_s_oldImpulse_v2.Copy(this.m_linearImpulse);this.m_linearImpulse.SelfAdd(g);m
=c*this.m_maxForce;this.m_linearImpulse.LengthSquared()>m*m&&(this.m_linearImpulse.
Normalize(),this.m_linearImpulse.SelfMul(m)),I.SubVV(this.m_linearImpulse,x,g),e.Se
lfMulSub(a,g),n-
=l*I.CrossVV(p,g),r.SelfMulAdd(o,g),s+=h*I.CrossVV(v,g),t.velocities[this.m_indexA]
.w=n,t.velocities[this.m_indexB].w=s},i.prototype.SolvePositionConstraints=function
(t){return!0},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2MotorJointDef = new b2MotorJointDef();\n"),t(" jd.bodyA = bodies[%d];\n",e),t("
jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.linearOffset.Set(%.15f,
%.15f);\n",this.m_linearOffset.x,this.m_linearOffset.y),t(" jd.angularOffset =
%.15f;\n",this.m_angularOffset),t(" jd.maxForce = %.15f;\n",this.m_maxForce),t("
jd.maxTorque = %.15f;\n",this.m_maxTorque),t(" jd.correctionFactor =
%.15f;\n",this.m_correctionFactor),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.SolveVelocityConstraints_s_Cdot_v
2=new I,i.SolveVelocityConstraints_s_impulse_v2=new
I,i.SolveVelocityConstraints_s_oldImpulse_v2=new I,i})(fi),Si=(function(e){function
i(){var i=e.call(this,t.b2JointType.e_mouseJoint)||this;return i.target=new
I,i.maxForce=0,i.frequencyHz=5,i.dampingRatio=.7,i}return $e(i,e),i})
(_i),Ti=(function(t){function i(i){var n=t.call(this,i)||this;return
n.m_localAnchorB=new I,n.m_targetA=new
I,n.m_frequencyHz=0,n.m_dampingRatio=0,n.m_beta=0,n.m_impulse=new
I,n.m_maxForce=0,n.m_gamma=0,n.m_indexA=0,n.m_indexB=0,n.m_rB=new
I,n.m_localCenterB=new I,n.m_invMassB=0,n.m_invIB=0,n.m_mass=new L,n.m_C=new
I,n.m_qB=new V,n.m_lalcB=new I,n.m_K=new
L,n.m_targetA.Copy(e(i.target,I.ZERO)),N.MulTXV(n.m_bodyB.GetTransform(),n.m_target
A,n.m_localAnchorB),n.m_maxForce=e(i.maxForce,0),n.m_impulse.SetZero(),n.m_frequenc
yHz=e(i.frequencyHz,0),n.m_dampingRatio=e(i.dampingRatio,0),n.m_beta=0,n.m_gamma=0,
n}return $e(i,t),i.prototype.SetTarget=function(t){this.m_bodyB.IsAwake()||
this.m_bodyB.SetAwake(!0),this.m_targetA.Copy(t)},i.prototype.GetTarget=function()
{return this.m_targetA},i.prototype.SetMaxForce=function(t)
{this.m_maxForce=t},i.prototype.GetMaxForce=function(){return
this.m_maxForce},i.prototype.SetFrequency=function(t)
{this.m_frequencyHz=t},i.prototype.GetFrequency=function(){return
this.m_frequencyHz},i.prototype.SetDampingRatio=function(t)
{this.m_dampingRatio=t},i.prototype.GetDampingRatio=function(){return
this.m_dampingRatio},i.prototype.InitVelocityConstraints=function(t)
{this.m_indexB=this.m_bodyB.m_islandIndex,this.m_localCenterB.Copy(this.m_bodyB.m_s
weep.localCenter),this.m_invMassB=this.m_bodyB.m_invMass,this.m_invIB=this.m_bodyB.
m_invI;var
e=t.positions[this.m_indexB].c,i=t.positions[this.m_indexB].a,n=t.velocities[this.m
_indexB].v,r=t.velocities[this.m_indexB].w,a=this.m_qB.SetAngle(i),o=this.m_bodyB.G
etMass(),l=2*s*this.m_frequencyHz,h=2*o*this.m_dampingRatio*l,c=o*(l*l),u=t.step.dt
;this.m_gamma=u*(h+u*c),0!
==this.m_gamma&&(this.m_gamma=1/this.m_gamma),this.m_beta=u*c*this.m_gamma,I.SubVV(
this.m_localAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(a,this.m_lalcB,this.m
_rB);var
_=this.m_K;_.ex.x=this.m_invMassB+this.m_invIB*this.m_rB.y*this.m_rB.y+this.m_gamma
,_.ex.y=-
this.m_invIB*this.m_rB.x*this.m_rB.y,_.ey.x=_.ex.y,_.ey.y=this.m_invMassB+this.m_in
vIB*this.m_rB.x*this.m_rB.x+this.m_gamma,_.GetInverse(this.m_mass),this.m_C.x=e.x+t
his.m_rB.x-this.m_targetA.x,this.m_C.y=e.y+this.m_rB.y-
this.m_targetA.y,this.m_C.SelfMul(this.m_beta),r*=.98,t.step.warmStarting?
(this.m_impulse.SelfMul(t.step.dtRatio),n.x+=this.m_invMassB*this.m_impulse.x,n.y+=
this.m_invMassB*this.m_impulse.y,r+=this.m_invIB*I.CrossVV(this.m_rB,this.m_impulse
)):this.m_impulse.SetZero(),t.velocities[this.m_indexB].w=r},i.prototype.SolveVeloc
ityConstraints=function(t){var
e=t.velocities[this.m_indexB].v,n=t.velocities[this.m_indexB].w,r=I.AddVCrossSV(e,n
,this.m_rB,i.SolveVelocityConstraints_s_Cdot),s=L.MulMV(this.m_mass,I.AddVV(r,I.Add
VV(this.m_C,I.MulSV(this.m_gamma,this.m_impulse,I.s_t0),I.s_t0),I.s_t0).SelfNeg(),i
.SolveVelocityConstraints_s_impulse),a=i.SolveVelocityConstraints_s_oldImpulse.Copy
(this.m_impulse);this.m_impulse.SelfAdd(s);var
o=t.step.dt*this.m_maxForce;this.m_impulse.LengthSquared()>o*o&&this.m_impulse.Self
Mul(o/this.m_impulse.Length()),I.SubVV(this.m_impulse,a,s),e.SelfMulAdd(this.m_invM
assB,s),n+=this.m_invIB*I.CrossVV(this.m_rB,s),t.velocities[this.m_indexB].w=n},i.p
rototype.SolvePositionConstraints=function(t){return!
0},i.prototype.GetAnchorA=function(t){return
t.x=this.m_targetA.x,t.y=this.m_targetA.y,t},i.prototype.GetAnchorB=function(t)
{return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
I.MulSV(t,this.m_impulse,e)},i.prototype.GetReactionTorque=function(t){return
0},i.prototype.Dump=function(t){t("Mouse joint dumping is not
supported.\n")},i.prototype.ShiftOrigin=function(t)
{this.m_targetA.SelfSub(t)},i.SolveVelocityConstraints_s_Cdot=new
I,i.SolveVelocityConstraints_s_impulse=new
I,i.SolveVelocityConstraints_s_oldImpulse=new I,i})(fi),wi=(function(e){function
i(){var i=e.call(this,t.b2JointType.e_prismaticJoint)||this;return
i.localAnchorA=new I,i.localAnchorB=new I,i.localAxisA=new
I(1,0),i.referenceAngle=0,i.enableLimit=!
1,i.lowerTranslation=0,i.upperTranslation=0,i.enableMotor=!
1,i.maxMotorForce=0,i.motorSpeed=0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i,n)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(i,this.localAnchorB),this.bodyA.GetLocalVector(n,this.localAxisA),th
is.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()},i})
(_i),Ei=(function(i){function n(n){var r=i.call(this,n)||this;return
r.m_localAnchorA=new I,r.m_localAnchorB=new I,r.m_localXAxisA=new
I,r.m_localYAxisA=new I,r.m_referenceAngle=0,r.m_impulse=new
O(0,0,0),r.m_motorImpulse=0,r.m_lowerTranslation=0,r.m_upperTranslation=0,r.m_maxMo
torForce=0,r.m_motorSpeed=0,r.m_enableLimit=!1,r.m_e
nableMotor=!
1,r.m_limitState=t.b2LimitState.e_inactiveLimit,r.m_indexA=0,r.m_indexB=0,r.m_local
CenterA=new I,r.m_localCenterB=new
I,r.m_invMassA=0,r.m_invMassB=0,r.m_invIA=0,r.m_invIB=0,r.m_axis=new
I(0,0),r.m_perp=new I(0,0),r.m_s1=0,r.m_s2=0,r.m_a1=0,r.m_a2=0,r.m_K=new
F,r.m_K3=new F,r.m_K2=new L,r.m_motorMass=0,r.m_qA=new V,r.m_qB=new V,r.m_lalcA=new
I,r.m_lalcB=new I,r.m_rA=new I,r.m_rB=new
I,r.m_localAnchorA.Copy(e(n.localAnchorA,I.ZERO)),r.m_localAnchorB.Copy(e(n.localAn
chorB,I.ZERO)),r.m_localXAxisA.Copy(e(n.localAxisA,new
I(1,0))).SelfNormalize(),I.CrossOneV(r.m_localXAxisA,r.m_localYAxisA),r.m_reference
Angle=e(n.referenceAngle,0),r.m_lowerTranslation=e(n.lowerTranslation,0),r.m_upperT
ranslation=e(n.upperTranslation,0),r.m_maxMotorForce=e(n.maxMotorForce,0),r.m_motor
Speed=e(n.motorSpeed,0),r.m_enableLimit=e(n.enableLimit,!
1),r.m_enableMotor=e(n.enableMotor,!1),r}return
$e(n,i),n.prototype.InitVelocityConstraints=function(e)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
i=e.positions[this.m_indexA].c,r=e.positions[this.m_indexA].a,s=e.velocities[this.m
_indexA].v,a=e.velocities[this.m_indexA].w,o=e.positions[this.m_indexB].c,h=e.posit
ions[this.m_indexB].a,c=e.velocities[this.m_indexB].v,u=e.velocities[this.m_indexB]
.w,_=this.m_qA.SetAngle(r),f=this.m_qB.SetAngle(h);I.SubVV(this.m_localAnchorA,this
.m_localCenterA,this.m_lalcA);var
d=V.MulRV(_,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
m=V.MulRV(f,this.m_lalcB,this.m_rB),p=I.AddVV(I.SubVV(o,i,I.s_t0),I.SubVV(m,d,I.s_t
1),n.InitVelocityConstraints_s_d),v=this.m_invMassA,g=this.m_invMassB,x=this.m_invI
A,b=this.m_invIB;if(V.MulRV(_,this.m_localXAxisA,this.m_axis),this.m_a1=I.CrossVV(I
.AddVV(p,d,I.s_t0),this.m_axis),this.m_a2=I.CrossVV(m,this.m_axis),this.m_motorMass
=v+g+x*this.m_a1*this.m_a1+b*this.m_a2*this.m_a2,this.m_motorMass>0&&(this.m_motorM
ass=1/this.m_motorMass),V.MulRV(_,this.m_localYAxisA,this.m_perp),this.m_s1=I.Cross
VV(I.AddVV(p,d,I.s_t0),this.m_perp),this.m_s2=I.CrossVV(m,this.m_perp),this.m_K.ex.
x=v+g+x*this.m_s1*this.m_s1+b*this.m_s2*this.m_s2,this.m_K.ex.y=x*this.m_s1+b*this.
m_s2,this.m_K.ex.z=x*this.m_s1*this.m_a1+b*this.m_s2*this.m_a2,this.m_K.ey.x=this.m
_K.ex.y,this.m_K.ey.y=x+b,0===this.m_K.ey.y&&(this.m_K.ey.y=1),this.m_K.ey.z=x*this
.m_a1+b*this.m_a2,this.m_K.ez.x=this.m_K.ex.z,this.m_K.ez.y=this.m_K.ey.z,this.m_K.
ez.z=v+g+x*this.m_a1*this.m_a1+b*this.m_a2*this.m_a2,this.m_enableLimit){var
A=I.DotVV(this.m_axis,p);y(this.m_upperTranslation-this.m_lowerTranslation)<2*l?
this.m_limitState=t.b2LimitState.e_equalLimits:A<=this.m_lowerTranslation?
this.m_limitState!
==t.b2LimitState.e_atLowerLimit&&(this.m_limitState=t.b2LimitState.e_atLowerLimit,t
his.m_impulse.z=0):A>=this.m_upperTranslation?this.m_limitState!
==t.b2LimitState.e_atUpperLimit&&(this.m_limitState=t.b2LimitState.e_atUpperLimit,t
his.m_impulse.z=0):
(this.m_limitState=t.b2LimitState.e_inactiveLimit,this.m_impulse.z=0)}else
this.m_limitState=t.b2LimitState.e_inactiveLimit,this.m_impulse.z=0;if(this.m_enabl
eMotor||(this.m_motorImpulse=0),e.step.warmStarting)
{this.m_impulse.SelfMul(e.step.dtRatio),this.m_motorImpulse*=e.step.dtRatio;var
C=I.AddVV(I.MulSV(this.m_impulse.x,this.m_perp,I.s_t0),I.MulSV(this.m_motorImpulse+
this.m_impulse.z,this.m_axis,I.s_t1),n.InitVelocityConstraints_s_P),S=this.m_impuls
e.x*this.m_s1+this.m_impulse.y+
(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,T=this.m_impulse.x*this.m_s2+this.
m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a2;s.SelfMulSub(v,C),a-
=x*S,c.SelfMulAdd(g,C),u+=b*T}else
this.m_impulse.SetZero(),this.m_motorImpulse=0;e.velocities[this.m_indexA].w=a,e.ve
locities[this.m_indexB].w=u},n.prototype.SolveVelocityConstraints=function(e){var
i=e.velocities[this.m_indexA].v,r=e.velocities[this.m_indexA].w,s=e.velocities[this
.m_indexB].v,a=e.velocities[this.m_indexB].w,o=this.m_invMassA,l=this.m_invMassB,h=
this.m_invIA,c=this.m_invIB;if(this.m_enableMotor&&this.m_limitState!
==t.b2LimitState.e_equalLimits){var u=I.DotVV(this.m_axis,I.SubVV(s,i,I.s_t0))
+this.m_a2*a-this.m_a1*r,_=this.m_motorMass*(this.m_motorSpeed-
u),f=this.m_motorImpulse,d=e.step.dt*this.m_maxMotorForce;this.m_motorImpulse=b(thi
s.m_motorImpulse+_,-d,d),_=this.m_motorImpulse-f;var
m=I.MulSV(_,this.m_axis,n.SolveVelocityConstraints_s_P),p=_*this.m_a1,v=_*this.m_a2
;i.SelfMulSub(o,m),r-=h*p,s.SelfMulAdd(l,m),a+=c*v}var
y=I.DotVV(this.m_perp,I.SubVV(s,i,I.s_t0))+this.m_s2*a-this.m_s1*r,A=a-
r;if(this.m_enableLimit&&this.m_limitState!==t.b2LimitState.e_inactiveLimit){var
C=I.DotVV(this.m_axis,I.SubVV(s,i,I.s_t0))+this.m_a2*a-
this.m_a1*r,S=n.SolveVelocityConstraints_s_f1.Copy(this.m_impulse),T=this.m_K.Solve
33(-y,-A,-
C,n.SolveVelocityConstraints_s_df3);this.m_impulse.SelfAdd(T),this.m_limitState===t
.b2LimitState.e_atLowerLimit?
this.m_impulse.z=x(this.m_impulse.z,0):this.m_limitState===t.b2LimitState.e_atUpper
Limit&&(this.m_impulse.z=g(this.m_impulse.z,0));var w=-y-(this.m_impulse.z-
S.z)*this.m_K.ez.x,E=-A-(this.m_impulse.z-
S.z)*this.m_K.ez.y,M=this.m_K.Solve22(w,E,n.SolveVelocityConstraints_s_f2r);M.x+=S.
x,M.y+=S.y,this.m_impulse.x=M.x,this.m_impulse.y=M.y,T.x=this.m_impulse.x-
S.x,T.y=this.m_impulse.y-S.y,T.z=this.m_impulse.z-
S.z;m=I.AddVV(I.MulSV(T.x,this.m_perp,I.s_t0),I.MulSV(T.z,this.m_axis,I.s_t1),n.Sol
veVelocityConstraints_s_P),p=T.x*this.m_s1+T.y+T.z*this.m_a1,v=T.x*this.m_s2+T.y+T.
z*this.m_a2;i.SelfMulSub(o,m),r-=h*p,s.SelfMulAdd(l,m),a+=c*v}else{var
D=this.m_K.Solve22(-y,-
A,n.SolveVelocityConstraints_s_df2);this.m_impulse.x+=D.x,this.m_impulse.y+=D.y;m=I
.MulSV(D.x,this.m_perp,n.SolveVelocityConstraints_s_P),p=D.x*this.m_s1+D.y,v=D.x*th
is.m_s2+D.y;i.SelfMulSub(o,m),r-
=h*p,s.SelfMulAdd(l,m),a+=c*v}e.velocities[this.m_indexA].w=r,e.velocities[this.m_i
ndexB].w=a},n.prototype.SolvePositionConstraints=function(t){var
e=t.positions[this.m_indexA].c,i=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(i),o=this.m_qB.SetAng
le(s),c=this.m_invMassA,u=this.m_invMassB,_=this.m_invIA,f=this.m_invIB,d=V.MulRV(a
,this.m_lalcA,this.m_rA),m=V.MulRV(o,this.m_lalcB,this.m_rB),p=I.SubVV(I.AddVV(r,m,
I.s_t0),I.AddVV(e,d,I.s_t1),n.SolvePositionConstraints_s_d),v=V.MulRV(a,this.m_loca
lXAxisA,this.m_axis),g=I.CrossVV(I.AddVV(p,d,I.s_t0),v),A=I.CrossVV(m,v),C=V.MulRV(
a,this.m_localYAxisA,this.m_perp),S=I.CrossVV(I.AddVV(p,d,I.s_t0),C),T=I.CrossVV(m,
C),w=n.SolvePositionConstraints_s_impulse,E=I.DotVV(C,p),M=s-i-
this.m_referenceAngle,D=y(E),B=y(M),P=!1,R=0;if(this.m_enableLimit){var
O=I.DotVV(v,p);y(this.m_upperTranslation-this.m_lowerTranslation)<2*l?
(R=b(O,-.2,.2),D=x(D,y(O)),P=!0):O<=this.m_lowerTranslation?(R=b(O-
this.m_lowerTranslation+l,-.2,0),D=x(D,this.m_lowerTranslation-O),P=!
0):O>=this.m_upperTranslation&&(R=b(O-this.m_upperTranslation-l,0,.2),D=x(D,O-
this.m_upperTranslation),P=!0)}if(P){var
L=c+u+_*S*S+f*T*T,F=_*S+f*T,N=_*S*g+f*T*A;0===(U=_+f)&&(U=1);var
k=_*g+f*A,G=c+u+_*g*g+f*A*A,z=this.m_K3;z.ex.SetXYZ(L,F,N),z.ey.SetXYZ(F,U,k),z.ez.
SetXYZ(N,k,G),w=z.Solve33(-E,-M,-R,w)}else{var
U;L=c+u+_*S*S+f*T*T,F=_*S+f*T;0===(U=_+f)&&(U=1);var
j=this.m_K2;j.ex.Set(L,F),j.ey.Set(F,U);var W=j.Solve(-E,-
M,n.SolvePositionConstraints_s_impulse1);w.x=W.x,w.y=W.y,w.z=0}var
H=I.AddVV(I.MulSV(w.x,C,I.s_t0),I.MulSV(w.z,v,I.s_t1),n.SolvePositionConstraints_s_
P),X=w.x*S+w.y+w.z*g,q=w.x*T+w.y+w.z*A;return e.SelfMulSub(c,H),i-
=_*X,r.SelfMulAdd(u,H),s+=f*q,t.positions[this.m_indexA].a=i,t.positions[this.m_ind
exB].a=s,D<=l&&B<=h},n.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},n.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},n.prototype.GetReactionForce=fun
ction(t,e){return e.x=t*(this.m_impulse.x*this.m_perp.x+
(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x),e.y=t*(this.m_impulse.x*this.
m_perp.y+
(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y),e},n.prototype.GetReactionTor
que=function(t){return t*this.m_impulse.y},n.prototype.GetLocalAnchorA=function()
{return this.m_localAnchorA},n.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},n.prototype.GetLocalAxisA=function(){return
this.m_localXAxisA},n.prototype.GetReferenceAngle=function(){return
this.m_referenceAngle},n.prototype.GetJointTranslation=function(){var
t=this.m_bodyA.GetWorldPoint(this.m_localAnchorA,n.GetJointTranslation_s_pA),e=this
.m_bodyB.GetWorldPoint(this.m_localAnchorB,n.GetJointTranslation_s_pB),i=I.SubVV(e,
t,n.GetJointTranslation_s_d),r=this.m_bodyA.GetWorldVector(this.m_localXAxisA,n.Get
JointTranslation_s_axis);return I.DotVV(i,r)},n.prototype.GetJointSpeed=function()
{var
t=this.m_bodyA,e=this.m_bodyB;I.SubVV(this.m_localAnchorA,t.m_sweep.localCenter,thi
s.m_lalcA);var
i=V.MulRV(t.m_xf.q,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,e.m_sweep.lo
calCenter,this.m_lalcB);var
n=V.MulRV(e.m_xf.q,this.m_lalcB,this.m_rB),r=I.AddVV(t.m_sweep.c,i,I.s_t0),s=I.AddV
V(e.m_sweep.c,n,I.s_t1),a=I.SubVV(s,r,I.s_t2),o=t.GetWorldVector(this.m_localXAxisA
,this.m_axis),l=t.m_linearVelocity,h=e.m_linearVelocity,c=t.m_angularVelocity,u=e.m
_angularVelocity;return I.DotVV(a,I.CrossSV(c,o,I.s_t0))
+I.DotVV(o,I.SubVV(I.AddVCrossSV(h,u,n,I.s_t0),I.AddVCrossSV(l,c,i,I.s_t1),I.s_t0))
},n.prototype.IsLimitEnabled=function(){return
this.m_enableLimit},n.prototype.EnableLimit=function(t){t!
==this.m_enableLimit&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_enableLimit=t,this.m_impulse.z=0)},n.prototype.GetLowerLimit=function()
{return this.m_lowerTranslation},n.prototype.GetUpperLimit=function(){return
this.m_upperTranslation},n.prototype.SetLimits=function(t,e)
{t===this.m_lowerTranslation&&e===this.m_upperTranslation||(this.m_bodyA.SetAwake(!
0),this.m_body
B.SetAwake(!
0),this.m_lowerTranslation=t,this.m_upperTranslation=e,this.m_impulse.z=0)},n.proto
type.IsMotorEnabled=function(){return
this.m_enableMotor},n.prototype.EnableMotor=function(t){t!
==this.m_enableMotor&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_enableMotor=t)},n.prototype.SetMotorSpeed=function(t){t!
==this.m_motorSpeed&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_motorSpeed=t)},n.prototype.GetMotorSpeed=function(){return
this.m_motorSpeed},n.prototype.SetMaxMotorForce=function(t){t!
==this.m_maxMotorForce&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_maxMotorForce=t)},n.prototype.GetMaxMotorForce=function(){return
this.m_maxMotorForce},n.prototype.GetMotorForce=function(t){return
t*this.m_motorImpulse},n.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2PrismaticJointDef = new b2PrismaticJointDef();\n"),t(" jd.bodyA =
bodies[%d];\n",e),t(" jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t("
jd.localAxisA.Set(%.15f, %.15f);\n",this.m_localXAxisA.x,this.m_localXAxisA.y),t("
jd.referenceAngle = %.15f;\n",this.m_referenceAngle),t(" jd.enableLimit =
%s;\n",this.m_enableLimit?"true":"false"),t(" jd.lowerTranslation =
%.15f;\n",this.m_lowerTranslation),t(" jd.upperTranslation =
%.15f;\n",this.m_upperTranslation),t(" jd.enableMotor =
%s;\n",this.m_enableMotor?"true":"false"),t(" jd.motorSpeed =
%.15f;\n",this.m_motorSpeed),t(" jd.maxMotorForce =
%.15f;\n",this.m_maxMotorForce),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},n.InitVelocityConstraints_s_d=new
I,n.InitVelocityConstraints_s_P=new I,n.SolveVelocityConstraints_s_P=new
I,n.SolveVelocityConstraints_s_f2r=new I,n.SolveVelocityConstraints_s_f1=new
O,n.SolveVelocityConstraints_s_df3=new O,n.SolveVelocityConstraints_s_df2=new
I,n.SolvePositionConstraints_s_d=new I,n.SolvePositionConstraints_s_impulse=new
O,n.SolvePositionConstraints_s_impulse1=new I,n.SolvePositionConstraints_s_P=new
I,n.GetJointTranslation_s_pA=new I,n.GetJointTranslation_s_pB=new
I,n.GetJointTranslation_s_d=new I,n.GetJointTranslation_s_axis=new I,n})
(fi),Mi=(function(e){function i(){var i=e.call(this,t.b2JointType.e_pulleyJoint)||
this;return i.groundAnchorA=new I(-1,1),i.groundAnchorB=new
I(1,1),i.localAnchorA=new I(-1,0),i.localAnchorB=new
I(1,0),i.lengthA=0,i.lengthB=0,i.ratio=1,i.collideConnected=!0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i,n,r,s,a)
{this.bodyA=t,this.bodyB=e,this.groundAnchorA.Copy(i),this.groundAnchorB.Copy(n),th
is.bodyA.GetLocalPoint(r,this.localAnchorA),this.bodyB.GetLocalPoint(s,this.localAn
chorB),this.lengthA=I.DistanceVV(r,i),this.lengthB=I.DistanceVV(s,n),this.ratio=a},
i})(_i),Di=(function(t){function i(i){var n=t.call(this,i)||this;return
n.m_groundAnchorA=new I,n.m_groundAnchorB=new
I,n.m_lengthA=0,n.m_lengthB=0,n.m_localAnchorA=new I,n.m_localAnchorB=new
I,n.m_constant=0,n.m_ratio=0,n.m_impulse=0,n.m_indexA=0,n.m_indexB=0,n.m_uA=new
I,n.m_uB=new I,n.m_rA=new I,n.m_rB=new I,n.m_localCenterA=new
I,n.m_localCenterB=new
I,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_mass=0,n.m_qA=new
V,n.m_qB=new V,n.m_lalcA=new I,n.m_lalcB=new
I,n.m_groundAnchorA.Copy(e(i.groundAnchorA,new I(-
1,1))),n.m_groundAnchorB.Copy(e(i.groundAnchorB,new
I(1,0))),n.m_localAnchorA.Copy(e(i.localAnchorA,new I(-
1,0))),n.m_localAnchorB.Copy(e(i.localAnchorB,new
I(1,0))),n.m_lengthA=e(i.lengthA,0),n.m_lengthB=e(i.lengthB,0),n.m_ratio=e(i.ratio,
1),n.m_constant=e(i.lengthA,0)+n.m_ratio*e(i.lengthB,0),n.m_impulse=0,n}return
$e(i,t),i.prototype.InitVelocityConstraints=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.velocities[this.m
_indexA].v,s=t.velocities[this.m_indexA].w,a=t.positions[this.m_indexB].c,o=t.posit
ions[this.m_indexB].a,h=t.velocities[this.m_indexB].v,c=t.velocities[this.m_indexB]
.w,u=this.m_qA.SetAngle(n),_=this.m_qB.SetAngle(o);I.SubVV(this.m_localAnchorA,this
.m_localCenterA,this.m_lalcA),V.MulRV(u,this.m_lalcA,this.m_rA),I.SubVV(this.m_loca
lAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(_,this.m_lalcB,this.m_rB),this.m
_uA.Copy(e).SelfAdd(this.m_rA).SelfSub(this.m_groundAnchorA),this.m_uB.Copy(a).Self
Add(this.m_rB).SelfSub(this.m_groundAnchorB);var
f=this.m_uA.Length(),d=this.m_uB.Length();f>10*l?
this.m_uA.SelfMul(1/f):this.m_uA.SetZero(),d>10*l?
this.m_uB.SelfMul(1/d):this.m_uB.SetZero();var
m=I.CrossVV(this.m_rA,this.m_uA),p=I.CrossVV(this.m_rB,this.m_uB),v=this.m_invMassA
+this.m_invIA*m*m,y=this.m_invMassB+this.m_invIB*p*p;if(this.m_mass=v+this.m_ratio*
this.m_ratio*y,this.m_mass>0&&(this.m_mass=1/this.m_mass),t.step.warmStarting)
{this.m_impulse*=t.step.dtRatio;var g=I.MulSV(-
this.m_impulse,this.m_uA,i.InitVelocityConstraints_s_PA),x=I.MulSV(-
this.m_ratio*this.m_impulse,this.m_uB,i.InitVelocityConstraints_s_PB);r.SelfMulAdd(
this.m_invMassA,g),s+=this.m_invIA*I.CrossVV(this.m_rA,g),h.SelfMulAdd(this.m_invMa
ssB,x),c+=this.m_invIB*I.CrossVV(this.m_rB,x)}else
this.m_impulse=0;t.velocities[this.m_indexA].w=s,t.velocities[this.m_indexB].w=c},i
.prototype.SolveVelocityConstraints=function(t){var
e=t.velocities[this.m_indexA].v,n=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=I.AddVCrossSV(e,n,this.m_rA,i.SolveV
elocityConstraints_s_vpA),o=I.AddVCrossSV(r,s,this.m_rB,i.SolveVelocityConstraints_
s_vpB),l=-I.DotVV(this.m_uA,a)-this.m_ratio*I.DotVV(this.m_uB,o),h=-
this.m_mass*l;this.m_impulse+=h;var c=I.MulSV(-
h,this.m_uA,i.SolveVelocityConstraints_s_PA),u=I.MulSV(-
this.m_ratio*h,this.m_uB,i.SolveVelocityConstraints_s_PB);e.SelfMulAdd(this.m_invMa
ssA,c),n+=this.m_invIA*I.CrossVV(this.m_rA,c),r.SelfMulAdd(this.m_invMassB,u),s+=th
is.m_invIB*I.CrossVV(this.m_rB,u),t.velocities[this.m_indexA].w=n,t.velocities[this
.m_indexB].w=s},i.prototype.SolvePositionConstraints=function(t){var
e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(n),o=this.m_qB.SetAng
le(s);I.SubVV(this.m_localAnchorA,this.m_localCenterA,this.m_lalcA);var
h=V.MulRV(a,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
c=V.MulRV(o,this.m_lalcB,this.m_rB),u=this.m_uA.Copy(e).SelfAdd(h).SelfSub(this.m_g
roundAnchorA),_=this.m_uB.Copy(r).SelfAdd(c).SelfSub(this.m_groundAnchorB),f=u.Leng
th(),d=_.Length();f>10*l?u.SelfMul(1/f):u.SetZero(),d>10*l?
_.SelfMul(1/d):_.SetZero();var
m=I.CrossVV(h,u),p=I.CrossVV(c,_),v=this.m_invMassA+this.m_invIA*m*m,g=this.m_invMa
ssB+this.m_invIB*p*p,x=v+this.m_ratio*this.m_ratio*g;x>0&&(x=1/x);var
b=this.m_constant-f-this.m_ratio*d,A=y(b),C=-x*b,S=I.MulSV(-
C,u,i.SolvePositionConstraints_s_PA),T=I.MulSV(-
this.m_ratio*C,_,i.SolvePositionConstraints_s_PB);return
e.SelfMulAdd(this.m_invMassA,S),n+=this.m_invIA*I.CrossVV(h,S),r.SelfMulAdd(this.m_
invMassB,T),s+=this.m_invIB*I.CrossVV(c,T),t.positions[this.m_indexA].a=n,t.positio
ns[this.m_indexB].a=s,A<l},i.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},i.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*this.m_impulse*this.m_uB.x,e.y=t*this.m_impulse*this.m_uB.y,e},i.prototype.Ge
tReactionTorque=function(t){return 0},i.prototype.GetGroundAnchorA=function()
{return this.m_groundAnchorA},i.prototype.GetGroundAnchorB=function(){return
this.m_groundAnchorB},i.prototype.GetLengthA=function(){return
this.m_lengthA},i.prototype.GetLengthB=function(){return
this.m_lengthB},i.prototype.GetRatio=function(){return
this.m_ratio},i.prototype.GetCurrentLengthA=function(){var
t=this.m_bodyA.GetWorldPoint(this.m_localAnchorA,i.GetCurrentLengthA_s_p),e=this.m_
groundAnchorA;return I.DistanceVV(t,e)},i.prototype.GetCurrentLengthB=function()
{var
t=this.m_bodyB.GetWorldPoint(this.m_localAnchorB,i.GetCurrentLengthB_s_p),e=this.m_
groundAnchorB;return I.DistanceVV(t,e)},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2PulleyJointDef = new b2PulleyJointDef();\n"),t(" jd.bodyA =
bodies[%d];\n",e),t(" jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.groundAnchorA.Set(%.15f,
%.15f);\n",this.m_groundAnchorA.x,this.m_groundAnchorA.y),t("
jd.groundAnchorB.Set(%.15f,
%.15f);\n",this.m_groundAnchorB.x,this.m_groundAnchorB.y),t("
jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.lengthA =
%.15f;\n",this.m_lengthA),t(" jd.lengthB = %.15f;\n",this.m_lengthB),t(" jd.ratio
= %.15f;\n",this.m_ratio),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.prototype.ShiftOrigin=function(t)
{this.m_groundAnchorA.SelfSub(t),this.m_groundAnchorB.SelfSub(t)},i.InitVelocityCon
straints_s_PA=new I,i.InitVelocityConstraints_s_PB=new
I,i.SolveVelocityConstraints_s_vpA=new I,i.SolveVelocityConstraints_s_vpB=new
I,i.SolveVelocityConstraints_s_PA=new I,i.SolveVelocityConstraints_s_PB=new
I,i.SolvePositionConstraints_s_PA=new I,i.SolvePositionConstraints_s_PB=new
I,i.GetCurrentLengthA_s_p=new I,i.GetCurrentLengthB_s_p=new I,i})
(fi),Bi=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_revoluteJoint)||this;return
i.localAnchorA=new I(0,0),i.localAnchorB=new
I(0,0),i.referenceAngle=0,i.enableLimit=!
1,i.lowerAngle=0,i.upperAngle=0,i.enableMotor=!
1,i.motorSpeed=0,i.maxMotorTorque=0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(i,this.localAnchorB),this.referenceAngle=this.bodyB.GetAngle()-
this.bodyA.GetAngle()},i})(_i),Pi=(function(i){function n(n){var r=i.call(this,n)||
this;return r.m_localAnchorA=new I,r.m_localAnchorB=new I,r.m_impulse=new
O,r.m_motorImpulse=0,r.m_enableMotor=!
1,r.m_maxMotorTorque=0,r.m_motorSpeed=0,r.m_enableLimit=!
1,r.m_referenceAngle=0,r.m_lowerAngle=0,r.m_upperAngle=0,r.m_indexA=0,r.m_indexB=0,
r.m_rA=new I,r.m_rB=new I,r.m_localCenterA=new I,r.m_localCenterB=new
I,r.m_invMassA=0,r.m_invMassB=0,r.m_invIA=0,r.m_invIB=0,r.m_mass=new
F,r.m_motorMass=0,r.m_limitState=t.b2LimitState.e_inactiveLimit,r.m_qA=new
V,r.m_qB=new V,r.m_lalcA=new I,r.m_lalcB=new I,r.m_K=new
L,r.m_localAnchorA.Copy(e(n.localAnchorA,I.ZERO)),r.m_localAnchorB.Copy(e(n.localAn
chorB,I.ZERO)),r.m_referenceAngle=e(n.referenceAngle,0),r.m_impulse.SetZero(),r.m_m
otorImpulse=0,r.m_lowerAngle=e(n.lowerAngle,0),r.m_upperAngle=e(n.upperAngle,0),r.m
_maxMotorTorque=e(n.maxMotorTorque,0),r.m_motorSpeed=e(n.motorSpeed,0),r.m_enableLi
mit=e(n.enableLimit,!1),r.m_enableMotor=e(n.enableMotor,!
1),r.m_limitState=t.b2LimitState.e_inactiveLimit,r}return
$e(n,i),n.prototype.InitVelocityConstraints=function(e)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
i=e.positions[this.m_indexA].a,r=e.velocities[this.m_indexA].v,s=e.velocities[this.
m_indexA].w,a=e.positions[this.m_indexB].a,o=e.velocities[this.m_indexB].v,l=e.velo
cities[this.m_indexB].w,c=this.m_qA.SetAngle(i),u=this.m_qB.SetAngle(a);I.SubVV(thi
s.m_localAnchorA,this.m_localCenterA,this.m_lalcA),V.MulRV(c,this.m_lalcA,this.m_rA
),I.SubVV(this.m_localAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(u,this.m_la
lcB,this.m_rB);var
_=this.m_invMassA,f=this.m_invMassB,d=this.m_invIA,m=this.m_invIB,p=d+m===0;if(this
.m_mass.ex.x=_+f+this.m_rA.y*this.m_rA.y*d+this.m_rB.y*this.m_rB.y*m,this.m_mass.ey
.x=-this.m_rA.y*this.m_rA.x*d-this.m_rB.y*this.m_rB.x*m,this.m_mass.ez.x=-
this.m_rA.y*d-
this.m_rB.y*m,this.m_mass.ex.y=this.m_mass.ey.x,this.m_mass.ey.y=_+f+this.m_rA.x*th
is.m_rA.x*d+this.m_rB.x*this.m_rB.x*m,this.m_mass.ez.y=this.m_rA.x*d+this.m_rB.x*m,
this.m_mass.ex.z=this.m_mass.ez.x,this.m_mass.ey.z=this.m_mass.ez.y,this.m_mass.ez.
z=d+m,this.m_motorMass=d+m,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass
),this.m_enableMotor&&!p||(this.m_motorImpulse=0),this.m_enableLimit&&!p){var v=a-
i-this.m_referenceAngle;y(this.m_upperAngle-this.m_lowerAngle)<2*h?
this.m_limitState=t.b2LimitState.e_equalLimits:v<=this.m_lowerAngle?
(this.m_limitState!
==t.b2LimitState.e_atLowerLimit&&(this.m_impulse.z=0),this.m_limitState=t.b2LimitSt
ate.e_atLowerLimit):v>=this.m_upperAngle?(this.m_limitState!
==t.b2LimitState.e_atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=t.b2LimitSt
ate.e_atUpperLimit):
(this.m_limitState=t.b2LimitState.e_inactiveLimit,this.m_impulse.z=0)}else
this.m_limitState=t.b2LimitState.e_inactiveLimit;if(e.step.warmStarting)
{this.m_impulse.SelfMul(e.step.dtRatio),this.m_motorImpulse*=e.step.dtRatio;var
g=n.InitVelocityConstraints_s_P.Set(this.m_impulse.x,this.m_impulse.y);r.SelfMulSub
(_,g),s-=d*(I.CrossVV(this.m_rA,g)
+this.m_motorImpulse+this.m_impulse.z),o.SelfMulAdd(f,g),l+=m*(I.CrossVV(this.m_rB,
g)+this.m_motorImpulse+this.m_impulse.z)}else
this.m_impulse.SetZero(),this.m_motorImpulse=0;e.velocities[this.m_indexA].w=s,e.ve
locities[this.m_indexB].w=l},n.prototype.SolveVelocityConstraints=function(e){var
i=e.velocities[this.m_indexA].v,r=e.velocities[this.m_indexA].w,s=e.velocities[this
.m_indexB].v,a=e.velocities[this.m_indexB].w,o=this.m_invMassA,l=this.m_invMassB,h=
this.m_invIA,c=this.m_invIB,u=h+c===0;if(this.m_enableMotor&&this.m_limitState!
==t.b2LimitState.e_equalLimits&&!u){var _=a-r-this.m_motorSpeed,f=-
this.m_motorMass*_,d=this.m_motorImpulse,m=e.step.dt*this.m_maxMotorTorque;this.m_m
otorImpulse=b(this.m_motorImpulse+f,-m,m),r-=h*(f=this.m_motorImpulse-
d),a+=c*f}if(this.m_enableLimit&&this.m_limitState!
==t.b2LimitState.e_inactiveLimit&&!u){var
p=I.SubVV(I.AddVCrossSV(s,a,this.m_rB,I.s_t0),I.AddVCrossSV(i,r,this.m_rA,I.s_t1),n
.SolveVelocityConstraints_s_Cdot1),v=a-
r,y=this.m_mass.Solve33(p.x,p.y,v,n.SolveVelocityConstraints_s_impulse_v3).SelfNeg(
);if(this.m_limitState===t.b2LimitState.e_equalLimits)this.m_impulse.SelfAdd(y);els
e if(this.m_limitState===t.b2LimitState.e_atLowerLimit){if(this.m_impulse.z+y.z<0)
{var g=-p.x+this.m_impulse.z*this.m_mass.ez.x,x=-
p.y+this.m_impulse.z*this.m_mass.ez.y,A=this.m_mass.Solve22(g,x,n.SolveVelocityCons
traints_s_reduced_v2);y.x=A.x,y.y=A.y,y.z=-
this.m_impulse.z,this.m_impulse.x+=A.x,this.m_impulse.y+=A.y,this.m_impulse.z=0}els
e this.m_impulse.SelfAdd(y)}else
if(this.m_limitState===t.b2LimitState.e_atUpperLimit){if(this.m_impulse.z+y.z>0)
{g=-p.x+this.m_impulse.z*this.m_mass.ez.x,x=-
p.y+this.m_impulse.z*this.m_mass.ez.y,A=this.m_mass.Solve22(g,x,n.SolveVelocityCons
traints_s_reduced_v2);y.x=A.x,y.y=A.y,y.z=-
this.m_impulse.z,this.m_impulse.x+=A.x,this.m_impulse.y+=A.y,this.m_impulse.z=0}els
e this.m_impulse.SelfAdd(y)}var
C=n.SolveVelocityConstraints_s_P.Set(y.x,y.y);i.SelfMulSub(o,C),r-
=h*(I.CrossVV(this.m_rA,C)+y.z),s.SelfMulAdd(l,C),a+=c*(I.CrossVV(this.m_rB,C)
+y.z)}else{var
S=I.SubVV(I.AddVCrossSV(s,a,this.m_rB,I.s_t0),I.AddVCrossSV(i,r,this.m_rA,I.s_t1),n
.SolveVelocityConstraints_s_Cdot_v2),T=this.m_mass.Solve22(-S.x,-
S.y,n.SolveVelocityConstraints_s_impulse_v2);this.m_impulse.x+=T.x,this.m_impulse.y
+=T.y,i.SelfMulSub(o,T),r-
=h*I.CrossVV(this.m_rA,T),s.SelfMulAdd(l,T),a+=c*I.CrossVV(this.m_rB,T)}e.velocitie
s[this.m_indexA].w=r,e.velocities[this.m_indexB].w=a},n.prototype.SolvePositionCons
traints=function(e){var
i,r=e.positions[this.m_indexA].c,s=e.positions[this.m_indexA].a,a=e.positions[this.
m_indexB].c,o=e.positions[this.m_indexB].a,c=this.m_qA.SetAngle(s),u=this.m_qB.SetA
ngle(o),_=0,f=this.m_invIA+this.m_invIB===0;if(this.m_enableLimit&&this.m_limitStat
e!==t.b2LimitState.e_inactiveLimit&&!f){var d=o-s-
this.m_referenceAngle,m=0;if(this.m_limitState===t.b2LimitState.e_equalLimits){var
p=b(d-this.m_lowerAngle,-.13962634015955555,.13962634015955555);m=-
this.m_motorMass*p,_=y(p)}else
if(this.m_limitState===t.b2LimitState.e_atLowerLimit){_=-(p=d-
this.m_lowerAngle),p=b(p+h,-.13962634015955555,0),m=-this.m_motorMass*p}else
if(this.m_limitState===t.b2LimitState.e_atUpperLimit){_=p=d-
this.m_upperAngle,p=b(p-h,0,.13962634015955555),m=-this.m_motorMass*p}s-
=this.m_invIA*m,o+=this.m_invIB*m}c.SetAngle(s),u.SetAngle(o),I.SubVV(this.m_localA
nchorA,this.m_localCenterA,this.m_lalcA);var
v=V.MulRV(c,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
g=V.MulRV(u,this.m_lalcB,this.m_rB),x=I.SubVV(I.AddVV(a,g,I.s_t0),I.AddVV(r,v,I.s_t
1),n.SolvePositionConstraints_s_C_v2);i=x.Length();var
A=this.m_invMassA,C=this.m_invMassB,S=this.m_invIA,T=this.m_invIB,w=this.m_K;w.ex.x
=A+C+S*v.y*v.y+T*g.y*g.y,w.ex.y=-S*v.x*v.y-
T*g.x*g.y,w.ey.x=w.ex.y,w.ey.y=A+C+S*v.x*v.x+T*g.x*g.x;var
E=w.Solve(x.x,x.y,n.SolvePositionConstraints_s_impulse).SelfNeg();return
r.SelfMulSub(A,E),s-
=S*I.CrossVV(v,E),a.SelfMulAdd(C,E),o+=T*I.CrossVV(g,E),e.positions[this.m_indexA].
a=s,e.positions[this.m_indexB].a=o,i<=l&&_<=h},n.prototype.GetAnchorA=function(t)
{return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},n.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},n.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*this.m_impulse.x,e.y=t*this.m_impulse.y,e},n.prototype.GetReactionTorque=func
tion(t){return t*this.m_impulse.z},n.prototype.GetLocalAnchorA=function(){return
this.m_localAnchorA},n.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},n.prototype.GetReferenceAngle=function(){return
this.m_referenceAngle},n.prototype.GetJointAngle=function(){return
this.m_bodyB.m_sweep.a-this.m_bodyA.m_sweep.a-
this.m_referenceAngle},n.prototype.GetJointSpeed=function(){return
this.m_bodyB.m_angularVelocity-
this.m_bodyA.m_angularVelocity},n.prototype.IsMotorEnabled=function(){return
this.m_enableMotor},n.prototype.EnableMotor=function(t){t!
==this.m_enableMotor&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_enableMotor=t)},n.prototype.GetMotorTorque=function(t){return
t*this.m_motorImpulse},n.prototype.GetMotorSpeed=function(){return
this.m_motorSpeed},n.prototype.SetMaxMotorTorque=function(t){t!
==this.m_maxMotorTorque&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_maxMotorTorque=t)},n.prototype.GetMaxMotorTorque=function(){return
this.m_maxMotorTorque},n.prototype.IsLimitEnabled=function(){return
this.m_enableLimit},n.prototype.EnableLimit=function(t){t!
==this.m_enableLimit&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_enableLimit=t,this.m_impulse.z=0)},n.prototype.GetLowerLimit=function()
{return this.m_lowerAngle},n.prototype.GetUpperLimit=function(){return
this.m_upperAngle},n.prototype.SetLimits=function(t,e)
{t===this.m_lowerAngle&&e===this.m_upperAngle||(this.m_bodyA.SetAwake(!
0),this.m_bodyB.SetAwake(!
0),this.m_impulse.z=0,this.m_lowerAngle=t,this.m_upperAngle=e)},n.prototype.SetMoto
rSpeed=function(t){t!==this.m_motorSpeed&&(this.m_bodyA.SetAwake(!
0),this.m_bodyB.SetAwake(!0),this.m_motorSpeed=t)},n.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2RevoluteJointDef = new b2RevoluteJointDef();\n"),t(" jd.bodyA =
bodies[%d];\n",e),t("
jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.referenceAngle =
%.15f;\n",this.m_referenceAngle),t(" jd.enableLimit =
%s;\n",this.m_enableLimit?"true":"false"),t(" jd.lowerAngle =
%.15f;\n",this.m_lowerAngle),t(" jd.upperAngle = %.15f;\n",this.m_upperAngle),t("
jd.enableMotor = %s;\n",this.m_enableMotor?"true":"false"),t(" jd.motorSpeed =
%.15f;\n",this.m_motorSpeed),t(" jd.maxMotorTorque =
%.15f;\n",this.m_maxMotorTorque),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},n.InitVelocityConstraints_s_P=new
I,n.SolveVelocityConstraints_s_P=new I,n.SolveVelocityConstraints_s_Cdot_v2=new
I,n.SolveVelocityConstraints_s_Cdot1=new
I,n.SolveVelocityConstraints_s_impulse_v3=new
O,n.SolveVelocityConstraints_s_reduced_v2=new
I,n.SolveVelocityConstraints_s_impulse_v2=new
I,n.SolvePositionConstraints_s_C_v2=new I,n.SolvePositionConstraints_s_impulse=new
I,n})(fi),Ii=(function(e){function i(){var
i=e.call(this,t.b2JointType.e_ropeJoint)||this;return i.localAnchorA=new I(-
1,0),i.localAnchorB=new I(1,0),i.maxLength=0,i}return $e(i,e),i})
(_i),Ri=(function(i){function n(n){var r=i.call(this,n)||this;return
r.m_localAnchorA=new I,r.m_localAnchorB=new
I,r.m_maxLength=0,r.m_length=0,r.m_impulse=0,r.m_indexA=0,r.m_indexB=0,r.m_u=new
I,r.m_rA=new I,r.m_rB=new I,r.m_localCenterA=new I,r.m_localCenterB=new
I,r.m_invMassA=0,r.m_invMassB=0,r.m_invIA=0,r.m_invIB=0,r.m_mass=0,r.m_state=t.b2Li
mitState.e_inactiveLimit,r.m_qA=new V,r.m_qB=new V,r.m_lalcA=new I,r.m_lalcB=new
I,r.m_localAnchorA.Copy(e(n.localAnchorA,new I(-
1,0))),r.m_localAnchorB.Copy(e(n.localAnchorB,new
I(1,0))),r.m_maxLength=e(n.maxLength,0),r}return
$e(n,i),n.prototype.InitVelocityConstraints=function(e)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
i=e.positions[this.m_indexA].c,r=e.positions[this.m_indexA].a,s=e.velocities[this.m
_indexA].v,a=e.velocities[this.m_indexA].w,o=e.positions[this.m_indexB].c,h=e.posit
ions[this.m_indexB].a,c=e.velocities[this.m_indexB].v,u=e.velocities[this.m_indexB]
.w,_=this.m_qA.SetAngle(r),f=this.m_qB.SetAngle(h);I.SubVV(this.m_localAnchorA,this
.m_localCenterA,this.m_lalcA),V.MulRV(_,this.m_lalcA,this.m_rA),I.SubVV(this.m_loca
lAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(f,this.m_lalcB,this.m_rB),this.m
_u.Copy(o).SelfAdd(this.m_rB).SelfSub(i).SelfSub(this.m_rA),this.m_length=this.m_u.
Length();var d=this.m_length-this.m_maxLength;if(this.m_state=d>0?
t.b2LimitState.e_atUpperLimit:t.b2LimitState.e_inactiveLimit,!
(this.m_length>l))return
this.m_u.SetZero(),this.m_mass=0,void(this.m_impulse=0);this.m_u.SelfMul(1/this.m_l
ength);var
m=I.CrossVV(this.m_rA,this.m_u),p=I.CrossVV(this.m_rB,this.m_u),v=this.m_invMassA+t
his.m_invIA*m*m+this.m_invMassB+this.m_invIB*p*p;if(this.m_mass=0!==v?
1/v:0,e.step.warmStarting){this.m_impulse*=e.step.dtRatio;var
y=I.MulSV(this.m_impulse,this.m_u,n.InitVelocityConstraints_s_P);s.SelfMulSub(this.
m_invMassA,y),a-
=this.m_invIA*I.CrossVV(this.m_rA,y),c.SelfMulAdd(this.m_invMassB,y),u+=this.m_invI
B*I.CrossVV(this.m_rB,y)}else
this.m_impulse=0;e.velocities[this.m_indexA].w=a,e.velocities[this.m_indexB].w=u},n
.prototype.SolveVelocityConstraints=function(t){var
e=t.velocities[this.m_indexA].v,i=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=I.AddVCrossSV(e,i,this.m_rA,n.SolveV
elocityConstraints_s_vpA),o=I.AddVCrossSV(r,s,this.m_rB,n.SolveVelocityConstraints_
s_vpB),l=this.m_length-
this.m_maxLength,h=I.DotVV(this.m_u,I.SubVV(o,a,I.s_t0));l<0&&(h+=t.step.inv_dt*l);
var c=-
this.m_mass*h,u=this.m_impulse;this.m_impulse=g(0,this.m_impulse+c),c=this.m_impuls
e-u;var
_=I.MulSV(c,this.m_u,n.SolveVelocityConstraints_s_P);e.SelfMulSub(this.m_invMassA,_
),i-
=this.m_invIA*I.CrossVV(this.m_rA,_),r.SelfMulAdd(this.m_invMassB,_),s+=this.m_invI
B*I.CrossVV(this.m_rB,_),t.velocities[this.m_indexA].w=i,t.velocities[this.m_indexB
].w=s},n.prototype.SolvePositionConstraints=function(t){var
e=t.positions[this.m_indexA].c,i=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(i),o=this.m_qB.SetAng
le(s);I.SubVV(this.m_localAnchorA,this.m_localCenterA,this.m_lalcA);var
h=V.MulRV(a,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
c=V.MulRV(o,this.m_lalcB,this.m_rB),u=this.m_u.Copy(r).SelfAdd(c).SelfSub(e).SelfSu
b(h),_=u.Normalize(),f=_-this.m_maxLength;f=b(f,0,.2);var d=-
this.m_mass*f,m=I.MulSV(d,u,n.SolvePositionConstraints_s_P);return
e.SelfMulSub(this.m_invMassA,m),i-
=this.m_invIA*I.CrossVV(h,m),r.SelfMulAdd(this.m_invMassB,m),s+=this.m_invIB*I.Cros
sVV(c,m),t.positions[this.m_indexA].a=i,t.positions[this.m_indexB].a=s,_-
this.m_maxLength<l},n.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},n.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},n.prototype.GetReactionForce=fun
ction(t,e){return
I.MulSV(t*this.m_impulse,this.m_u,e)},n.prototype.GetReactionTorque=function(t)
{return 0},n.prototype.GetLocalAnchorA=function(){return
this.m_localAnchorA},n.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},n.prototype.SetMaxLength=function(t)
{this.m_maxLength=t},n.prototype.GetMaxLength=function(){return
this.m_maxLength},n.prototype.GetLimitState=function(){return
this.m_state},n.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2RopeJointDef = new b2RopeJointDef();\n"),t(" jd.bodyA = bodies[%d];\n",e),t("
jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.maxLength =
%.15f;\n",this.m_maxLength),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},n.InitVelocityConstraints_s_P=new
I,n.SolveVelocityConstraints_s_vpA=new I,n.SolveVelocityConstraints_s_vpB=new
I,n.SolveVelocityConstraints_s_P=new I,n.SolvePositionConstraints_s_P=new I,n})
(fi),Oi=(function(e){function i(){var i=e.call(this,t.b2JointType.e_weldJoint)||
this;return i.localAnchorA=new I,i.localAnchorB=new
I,i.referenceAngle=0,i.frequencyHz=0,i.dampingRatio=0,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(i,this.localAnchorB),this.referenceAngle=this.bodyB.GetAngle()-
this.bodyA.GetAngle()},i})(_i),Li=(function(t){function i(i){var n=t.call(this,i)||
this;return n.m_frequencyHz=0,n.m_dampingRatio=0,n.m_bias=0,n.m_localAnchorA=new
I,n.m_localAnchorB=new I,n.m_referenceAngle=0,n.m_gamma=0,n.m_impulse=new
O(0,0,0),n.m_indexA=0,n.m_indexB=0,n.m_rA=new I,n.m_rB=new I,n.m_localCenterA=new
I,n.m_localCenterB=new
I,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_mass=new F,n.m_qA=new
V,n.m_qB=new V,n.m_lalcA=new I,n.m_lalcB=new I,n.m_K=new
F,n.m_frequencyHz=e(i.frequencyHz,0),n.m_dampingRatio=e(i.dampingRatio,0),n.m_local
AnchorA.Copy(e(i.localAnchorA,I.ZERO)),n.m_localAnchorB.Copy(e(i.localAnchorB,I.ZER
O)),n.m_referenceAngle=e(i.referenceAngle,0),n.m_impulse.SetZero(),n}return
$e(i,t),i.prototype.InitVelocityConstraints=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=t.positions[this.m_indexA].a,n=t.velocities[this.m_indexA].v,r=t.velocities[this.
m_indexA].w,a=t.positions[this.m_indexB].a,o=t.velocities[this.m_indexB].v,l=t.velo
cities[this.m_indexB].w,h=this.m_qA.SetAngle(e),c=this.m_qB.SetAngle(a);I.SubVV(thi
s.m_localAnchorA,this.m_localCenterA,this.m_lalcA),V.MulRV(h,this.m_lalcA,this.m_rA
),I.SubVV(this.m_localAnchorB,this.m_localCenterB,this.m_lalcB),V.MulRV(c,this.m_la
lcB,this.m_rB);var
u=this.m_invMassA,_=this.m_invMassB,f=this.m_invIA,d=this.m_invIB,m=this.m_K;if(m.e
x.x=u+_+this.m_rA.y*this.m_rA.y*f+this.m_rB.y*this.m_rB.y*d,m.ey.x=-
this.m_rA.y*this.m_rA.x*f-this.m_rB.y*this.m_rB.x*d,m.ez.x=-this.m_rA.y*f-
this.m_rB.y*d,m.ex.y=m.ey.x,m.ey.y=u+_+this.m_rA.x*this.m_rA.x*f+this.m_rB.x*this.m
_rB.x*d,m.ez.y=this.m_rA.x*f+this.m_rB.x*d,m.ex.z=m.ez.x,m.ey.z=m.ez.y,m.ez.z=f+d,t
his.m_frequencyHz>0){m.GetInverse22(this.m_mass);var p=f+d,v=p>0?1/p:0,y=a-e-
this.m_referenceAngle,g=2*s*this.m_frequencyHz,x=2*v*this.m_dampingRatio*g,b=v*g*g,
A=t.step.dt;this.m_gamma=A*(x+A*b),this.m_gamma=0!==this.m_gamma?
1/this.m_gamma:0,this.m_bias=y*A*b*this.m_gamma,p+=this.m_gamma,this.m_mass.ez.z=0!
==p?1/p:0}else
m.GetSymInverse33(this.m_mass),this.m_gamma=0,this.m_bias=0;if(t.step.warmStarting)
{this.m_impulse.SelfMul(t.step.dtRatio);var
C=i.InitVelocityConstraints_s_P.Set(this.m_impulse.x,this.m_impulse.y);n.SelfMulSub
(u,C),r-=f*(I.CrossVV(this.m_rA,C)
+this.m_impulse.z),o.SelfMulAdd(_,C),l+=d*(I.CrossVV(this.m_rB,C)
+this.m_impulse.z)}else
this.m_impulse.SetZero();t.velocities[this.m_indexA].w=r,t.velocities[this.m_indexB
].w=l},i.prototype.SolveVelocityConstraints=function(t){var
e=t.velocities[this.m_indexA].v,n=t.velocities[this.m_indexA].w,r=t.velocities[this
.m_indexB].v,s=t.velocities[this.m_indexB].w,a=this.m_invMassA,o=this.m_invMassB,l=
this.m_invIA,h=this.m_invIB;if(this.m_frequencyHz>0){var
c=s-n,u=-
this.m_mass.ez.z*(c+this.m_bias+this.m_gamma*this.m_impulse.z);this.m_impulse.z+=u,
n-=l*u,s+=h*u;var
_=I.SubVV(I.AddVCrossSV(r,s,this.m_rB,I.s_t0),I.AddVCrossSV(e,n,this.m_rA,I.s_t1),i
.SolveVelocityConstraints_s_Cdot1),f=F.MulM33XY(this.m_mass,_.x,_.y,i.SolveVelocity
Constraints_s_impulse1).SelfNeg();this.m_impulse.x+=f.x,this.m_impulse.y+=f.y;var
d=f;e.SelfMulSub(a,d),n-
=l*I.CrossVV(this.m_rA,d),r.SelfMulAdd(o,d),s+=h*I.CrossVV(this.m_rB,d)}else{_=I.Su
bVV(I.AddVCrossSV(r,s,this.m_rB,I.s_t0),I.AddVCrossSV(e,n,this.m_rA,I.s_t1),i.Solve
VelocityConstraints_s_Cdot1),c=s-n;var
m=F.MulM33XYZ(this.m_mass,_.x,_.y,c,i.SolveVelocityConstraints_s_impulse).SelfNeg()
;this.m_impulse.SelfAdd(m);d=i.SolveVelocityConstraints_s_P.Set(m.x,m.y);e.SelfMulS
ub(a,d),n-=l*(I.CrossVV(this.m_rA,d)
+m.z),r.SelfMulAdd(o,d),s+=h*(I.CrossVV(this.m_rB,d)
+m.z)}t.velocities[this.m_indexA].w=n,t.velocities[this.m_indexB].w=s},i.prototype.
SolvePositionConstraints=function(t){var
e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(n),o=this.m_qB.SetAng
le(s),c=this.m_invMassA,u=this.m_invMassB,_=this.m_invIA,f=this.m_invIB;I.SubVV(thi
s.m_localAnchorA,this.m_localCenterA,this.m_lalcA);var
d=V.MulRV(a,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
m,p,v=V.MulRV(o,this.m_lalcB,this.m_rB),g=this.m_K;if(g.ex.x=c+u+d.y*d.y*_+v.y*v.y*
f,g.ey.x=-d.y*d.x*_-v.y*v.x*f,g.ez.x=-d.y*_-
v.y*f,g.ex.y=g.ey.x,g.ey.y=c+u+d.x*d.x*_+v.x*v.x*f,g.ez.y=d.x*_+v.x*f,g.ex.z=g.ez.x
,g.ey.z=g.ez.y,g.ez.z=_+f,this.m_frequencyHz>0)
{m=(b=I.SubVV(I.AddVV(r,v,I.s_t0),I.AddVV(e,d,I.s_t1),i.SolvePositionConstraints_s_
C1)).Length(),p=0;var
x=g.Solve22(b.x,b.y,i.SolvePositionConstraints_s_P).SelfNeg();e.SelfMulSub(c,x),n-
=_*I.CrossVV(d,x),r.SelfMulAdd(u,x),s+=f*I.CrossVV(v,x)}else{var
b=I.SubVV(I.AddVV(r,v,I.s_t0),I.AddVV(e,d,I.s_t1),i.SolvePositionConstraints_s_C1),
A=s-n-this.m_referenceAngle;m=b.Length(),p=y(A);var
C=g.Solve33(b.x,b.y,A,i.SolvePositionConstraints_s_impulse).SelfNeg();x=i.SolvePosi
tionConstraints_s_P.Set(C.x,C.y);e.SelfMulSub(c,x),n-=_*(I.CrossVV(this.m_rA,x)
+C.z),r.SelfMulAdd(u,x),s+=f*(I.CrossVV(this.m_rB,x)+C.z)}return
t.positions[this.m_indexA].a=n,t.positions[this.m_indexB].a=s,m<=l&&p<=h},i.prototy
pe.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},i.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*this.m_impulse.x,e.y=t*this.m_impulse.y,e},i.prototype.GetReactionTorque=func
tion(t){return t*this.m_impulse.z},i.prototype.GetLocalAnchorA=function(){return
this.m_localAnchorA},i.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},i.prototype.GetReferenceAngle=function(){return
this.m_referenceAngle},i.prototype.SetFrequency=function(t)
{this.m_frequencyHz=t},i.prototype.GetFrequency=function(){return
this.m_frequencyHz},i.prototype.SetDampingRatio=function(t)
{this.m_dampingRatio=t},i.prototype.GetDampingRatio=function(){return
this.m_dampingRatio},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2WeldJointDef = new b2WeldJointDef();\n"),t(" jd.bodyA = bodies[%d];\n",e),t("
jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t(" jd.referenceAngle =
%.15f;\n",this.m_referenceAngle),t(" jd.frequencyHz =
%.15f;\n",this.m_frequencyHz),t(" jd.dampingRatio =
%.15f;\n",this.m_dampingRatio),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.InitVelocityConstraints_s_P=new
I,i.SolveVelocityConstraints_s_Cdot1=new
I,i.SolveVelocityConstraints_s_impulse1=new
I,i.SolveVelocityConstraints_s_impulse=new O,i.SolveVelocityConstraints_s_P=new
I,i.SolvePositionConstraints_s_C1=new I,i.SolvePositionConstraints_s_P=new
I,i.SolvePositionConstraints_s_impulse=new O,i})(fi),Fi=(function(e){function i()
{var i=e.call(this,t.b2JointType.e_wheelJoint)||this;return i.localAnchorA=new
I(0,0),i.localAnchorB=new I(0,0),i.localAxisA=new I(1,0),i.enableMotor=!
1,i.maxMotorTorque=0,i.motorSpeed=0,i.frequencyHz=2,i.dampingRatio=.7,i}return
$e(i,e),i.prototype.Initialize=function(t,e,i,n)
{this.bodyA=t,this.bodyB=e,this.bodyA.GetLocalPoint(i,this.localAnchorA),this.bodyB
.GetLocalPoint(i,this.localAnchorB),this.bodyA.GetLocalVector(n,this.localAxisA)},i
})(_i),Vi=(function(t){function i(i){var n=t.call(this,i)||this;return
n.m_frequencyHz=0,n.m_dampingRatio=0,n.m_localAnchorA=new I,n.m_localAnchorB=new
I,n.m_localXAxisA=new I,n.m_localYAxisA=new
I,n.m_impulse=0,n.m_motorImpulse=0,n.m_springImpulse=0,n.m_maxMotorTorque=0,n.m_mot
orSpeed=0,n.m_enableMotor=!1,n.m_indexA=0,n.m_indexB=0,n.m_localCenterA=new
I,n.m_localCenterB=new
I,n.m_invMassA=0,n.m_invMassB=0,n.m_invIA=0,n.m_invIB=0,n.m_ax=new I,n.m_ay=new
I,n.m_sAx=0,n.m_sBx=0,n.m_sAy=0,n.m_sBy=0,n.m_mass=0,n.m_motorMass=0,n.m_springMass
=0,n.m_bias=0,n.m_gamma=0,n.m_qA=new V,n.m_qB=new V,n.m_lalcA=new I,n.m_lalcB=new
I,n.m_rA=new I,n.m_rB=new
I,n.m_frequencyHz=e(i.frequencyHz,2),n.m_dampingRatio=e(i.dampingRatio,.7),n.m_loca
lAnchorA.Copy(e(i.localAnchorA,I.ZERO)),n.m_localAnchorB.Copy(e(i.localAnchorB,I.ZE
RO)),n.m_localXAxisA.Copy(e(i.localAxisA,I.UNITX)),I.CrossOneV(n.m_localXAxisA,n.m_
localYAxisA),n.m_maxMotorTorque=e(i.maxMotorTorque,0),n.m_motorSpeed=e(i.motorSpeed
,0),n.m_enableMotor=e(i.enableMotor,!1),n.m_ax.SetZero(),n.m_ay.SetZero(),n}return
$e(i,t),i.prototype.GetMotorSpeed=function(){return
this.m_motorSpeed},i.prototype.GetMaxMotorTorque=function(){return
this.m_maxMotorTorque},i.prototype.SetSpringFrequencyHz=function(t)
{this.m_frequencyHz=t},i.prototype.GetSpringFrequencyHz=function(){return
this.m_frequencyHz},i.prototype.SetSpringDampingRatio=function(t)
{this.m_dampingRatio=t},i.prototype.GetSpringDampingRatio=function(){return
this.m_dampingRatio},i.prototype.InitVelocityConstraints=function(t)
{this.m_indexA=this.m_bodyA.m_islandIndex,this.m_indexB=this.m_bodyB.m_islandIndex,
this.m_localCenterA.Copy(this.m_bodyA.m_sweep.localCenter),this.m_localCenterB.Copy
(this.m_bodyB.m_sweep.localCenter),this.m_invMassA=this.m_bodyA.m_invMass,this.m_in
vMassB=this.m_bodyB.m_invMass,this.m_invIA=this.m_bodyA.m_invI,this.m_invIB=this.m_
bodyB.m_invI;var
e=this.m_invMassA,n=this.m_invMassB,r=this.m_invIA,a=this.m_invIB,o=t.positions[thi
s.m_indexA].c,l=t.positions[this.m_indexA].a,h=t.velocities[this.m_indexA].v,c=t.ve
locities[this.m_indexA].w,u=t.positions[this.m_indexB].c,_=t.positions[this.m_index
B].a,f=t.velocities[this.m_indexB].v,d=t.velocities[this.m_indexB].w,m=this.m_qA.Se
tAngle(l),p=this.m_qB.SetAngle(_);I.SubVV(this.m_localAnchorA,this.m_localCenterA,t
his.m_lalcA);var
v=V.MulRV(m,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
y=V.MulRV(p,this.m_lalcB,this.m_rB),g=I.SubVV(I.AddVV(u,y,I.s_t0),I.AddVV(o,v,I.s_t
1),i.InitVelocityConstraints_s_d);if(V.MulRV(m,this.m_localYAxisA,this.m_ay),this.m
_sAy=I.CrossVV(I.AddVV(g,v,I.s_t0),this.m_ay),this.m_sBy=I.CrossVV(y,this.m_ay),thi
s.m_mass=e+n+r*this.m_sAy*this.m_sAy+a*this.m_sBy*this.m_sBy,this.m_mass>0&&(this.m
_mass=1/this.m_mass),this.m_springMass=0,this.m_bias=0,this.m_gamma=0,this.m_freque
ncyHz>0)
{V.MulRV(m,this.m_localXAxisA,this.m_ax),this.m_sAx=I.CrossVV(I.AddVV(g,v,I.s_t0),t
his.m_ax),this.m_sBx=I.CrossVV(y,this.m_ax);var
x=e+n+r*this.m_sAx*this.m_sAx+a*this.m_sBx*this.m_sBx;if(x>0)
{this.m_springMass=1/x;var
b=I.DotVV(g,this.m_ax),A=2*s*this.m_frequencyHz,C=2*this.m_springMass*this.m_dampin
gRatio*A,S=this.m_springMass*A*A,T=t.step.dt;this.m_gamma=T*(C+T*S),this.m_gamma>0&
&(this.m_gamma=1/this.m_gamma),this.m_bias=b*T*S*this.m_gamma,this.m_springMass=x+t
his.m_gamma,this.m_springMass>0&&(this.m_springMass=1/this.m_springMass)}}else
this.m_springImpulse=0;if(this.m_enableMotor?
(this.m_motorMass=r+a,this.m_motorMass>0&&(this.m_motorMass=1/this.m_motorMass)):
(this.m_motorMass=0,this.m_motorImpulse=0),t.step.warmStarting)
{this.m_impulse*=t.step.dtRatio,this.m_springImpulse*=t.step.dtRatio,this.m_motorIm
pulse*=t.step.dtRatio;var
w=I.AddVV(I.MulSV(this.m_impulse,this.m_ay,I.s_t0),I.MulSV(this.m_springImpulse,thi
s.m_ax,I.s_t1),i.InitVelocityConstraints_s_P),E=this.m_impulse*this.m_sAy+this.m_sp
ringImpulse*this.m_sAx+this.m_motorImpulse,M=this.m_impulse*this.m_sBy+this.m_sprin
gImpulse*this.m_sBx+this.m_motorImpulse;h.SelfMulSub(this.m_invMassA,w),c-
=this.m_invIA*E,f.SelfMulAdd(this.m_invMassB,w),d+=this.m_invIB*M}else
this.m_impulse=0,this.m_springImpulse=0,this.m_motorImpulse=0;t.velocities[this.m_i
ndexA].w=c,t.velocities[this.m_indexB].w=d},i.prototype.SolveVelocityConstraints=fu
nction(t){var
e=this.m_invMassA,n=this.m_invMassB,r=this.m_invIA,s=this.m_invIB,a=t.velocities[th
is.m_indexA].v,o=t.velocities[this.m_indexA].w,l=t.velocities[this.m_indexB].v,h=t.
velocities[this.m_indexB].w,c=I.DotVV(this.m_ax,I.SubVV(l,a,I.s_t0))+this.m_sBx*h-
this.m_sAx*o,u=-
this.m_springMass*(c+this.m_bias+this.m_gamma*this.m_springImpulse);this.m_springIm
pulse+=u;var
_=I.MulSV(u,this.m_ax,i.SolveVelocityConstraints_s_P),f=u*this.m_sAx,d=u*this.m_sBx
;a.SelfMulSub(e,_),o-=r*f,l.SelfMulAdd(n,_);c=(h+=s*d)-o-this.m_motorSpeed,u=-
this.m_motorMass*c;var
m=this.m_motorImpulse,p=t.step.dt*this.m_maxMotorTorque;this.m_motorImpulse=b(this.
m_motorImpulse+u,-p,p),o-=r*(u=this.m_motorImpulse-
m),h+=s*u;c=I.DotVV(this.m_ay,I.SubVV(l,a,I.s_t0))+this.m_sBy*h-this.m_sAy*o,u=-
this.m_mass*c;this.m_impulse+=u;_=I.MulSV(u,this.m_ay,i.SolveVelocityConstraints_s_
P),f=u*this.m_sAy,d=u*this.m_sBy;a.SelfMulSub(e,_),o-
=r*f,l.SelfMulAdd(n,_),h+=s*d,t.velocities[this.m_indexA].w=o,t.velocities[this.m_i
ndexB].w=h},i.prototype.SolvePositionConstraints=function(t){var

e=t.positions[this.m_indexA].c,n=t.positions[this.m_indexA].a,r=t.positions[this.m_
indexB].c,s=t.positions[this.m_indexB].a,a=this.m_qA.SetAngle(n),o=this.m_qB.SetAng
le(s);I.SubVV(this.m_localAnchorA,this.m_localCenterA,this.m_lalcA);var
h=V.MulRV(a,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,this.m_localCenterB
,this.m_lalcB);var
c,u=V.MulRV(o,this.m_lalcB,this.m_rB),_=I.AddVV(I.SubVV(r,e,I.s_t0),I.SubVV(u,h,I.s
_t1),i.SolvePositionConstraints_s_d),f=V.MulRV(a,this.m_localYAxisA,this.m_ay),d=I.
CrossVV(I.AddVV(_,h,I.s_t0),f),m=I.CrossVV(u,f),p=I.DotVV(_,this.m_ay),v=this.m_inv
MassA+this.m_invMassB+this.m_invIA*this.m_sAy*this.m_sAy+this.m_invIB*this.m_sBy*th
is.m_sBy;c=0!==v?-p/v:0;var
g=I.MulSV(c,f,i.SolvePositionConstraints_s_P),x=c*d,b=c*m;return
e.SelfMulSub(this.m_invMassA,g),n-
=this.m_invIA*x,r.SelfMulAdd(this.m_invMassB,g),s+=this.m_invIB*b,t.positions[this.
m_indexA].a=n,t.positions[this.m_indexB].a=s,y(p)<=l},i.prototype.GetDefinition=fun
ction(t){return t},i.prototype.GetAnchorA=function(t){return
this.m_bodyA.GetWorldPoint(this.m_localAnchorA,t)},i.prototype.GetAnchorB=function(
t){return
this.m_bodyB.GetWorldPoint(this.m_localAnchorB,t)},i.prototype.GetReactionForce=fun
ction(t,e){return
e.x=t*(this.m_impulse*this.m_ay.x+this.m_springImpulse*this.m_ax.x),e.y=t*(this.m_i
mpulse*this.m_ay.y+this.m_springImpulse*this.m_ax.y),e},i.prototype.GetReactionTorq
ue=function(t){return t*this.m_motorImpulse},i.prototype.GetLocalAnchorA=function()
{return this.m_localAnchorA},i.prototype.GetLocalAnchorB=function(){return
this.m_localAnchorB},i.prototype.GetLocalAxisA=function(){return
this.m_localXAxisA},i.prototype.GetJointTranslation=function(){return
this.GetPrismaticJointTranslation()},i.prototype.GetJointLinearSpeed=function()
{return this.GetPrismaticJointSpeed()},i.prototype.GetJointAngle=function(){return
this.GetRevoluteJointAngle()},i.prototype.GetJointAngularSpeed=function(){return
this.GetRevoluteJointSpeed()},i.prototype.GetPrismaticJointTranslation=function()
{var t=this.m_bodyA,e=this.m_bodyB,i=t.GetWorldPoint(this.m_localAnchorA,new
I),n=e.GetWorldPoint(this.m_localAnchorB,new I),r=I.SubVV(n,i,new
I),s=t.GetWorldVector(this.m_localXAxisA,new I);return
I.DotVV(r,s)},i.prototype.GetPrismaticJointSpeed=function(){var
t=this.m_bodyA,e=this.m_bodyB;I.SubVV(this.m_localAnchorA,t.m_sweep.localCenter,thi
s.m_lalcA);var
i=V.MulRV(t.m_xf.q,this.m_lalcA,this.m_rA);I.SubVV(this.m_localAnchorB,e.m_sweep.lo
calCenter,this.m_lalcB);var
n=V.MulRV(e.m_xf.q,this.m_lalcB,this.m_rB),r=I.AddVV(t.m_sweep.c,i,I.s_t0),s=I.AddV
V(e.m_sweep.c,n,I.s_t1),a=I.SubVV(s,r,I.s_t2),o=t.GetWorldVector(this.m_localXAxisA
,new
I),l=t.m_linearVelocity,h=e.m_linearVelocity,c=t.m_angularVelocity,u=e.m_angularVel
ocity;return I.DotVV(a,I.CrossSV(c,o,I.s_t0))
+I.DotVV(o,I.SubVV(I.AddVCrossSV(h,u,n,I.s_t0),I.AddVCrossSV(l,c,i,I.s_t1),I.s_t0))
},i.prototype.GetRevoluteJointAngle=function(){return this.m_bodyB.m_sweep.a-
this.m_bodyA.m_sweep.a},i.prototype.GetRevoluteJointSpeed=function(){var
t=this.m_bodyA.m_angularVelocity;return this.m_bodyB.m_angularVelocity-
t},i.prototype.IsMotorEnabled=function(){return
this.m_enableMotor},i.prototype.EnableMotor=function(t){t!
==this.m_enableMotor&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_enableMotor=t)},i.prototype.SetMotorSpeed=function(t){t!
==this.m_motorSpeed&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_motorSpeed=t)},i.prototype.SetMaxMotorTorque=function(t){t!
==this.m_maxMotorTorque&&(this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!
0),this.m_maxMotorTorque=t)},i.prototype.GetMotorTorque=function(t){return
t*this.m_motorImpulse},i.prototype.Dump=function(t){var
e=this.m_bodyA.m_islandIndex,i=this.m_bodyB.m_islandIndex;t(" const jd:
b2WheelJointDef = new b2WheelJointDef();\n"),t(" jd.bodyA = bodies[%d];\n",e),t("
jd.bodyB = bodies[%d];\n",i),t(" jd.collideConnected =
%s;\n",this.m_collideConnected?"true":"false"),t(" jd.localAnchorA.Set(%.15f,
%.15f);\n",this.m_localAnchorA.x,this.m_localAnchorA.y),t("
jd.localAnchorB.Set(%.15f,
%.15f);\n",this.m_localAnchorB.x,this.m_localAnchorB.y),t("
jd.localAxisA.Set(%.15f, %.15f);\n",this.m_localXAxisA.x,this.m_localXAxisA.y),t("
jd.enableMotor = %s;\n",this.m_enableMotor?"true":"false"),t(" jd.motorSpeed =
%.15f;\n",this.m_motorSpeed),t(" jd.maxMotorTorque =
%.15f;\n",this.m_maxMotorTorque),t(" jd.frequencyHz =
%.15f;\n",this.m_frequencyHz),t(" jd.dampingRatio =
%.15f;\n",this.m_dampingRatio),t(" joints[%d] =
this.m_world.CreateJoint(jd);\n",this.m_index)},i.InitVelocityConstraints_s_d=new
I,i.InitVelocityConstraints_s_P=new I,i.SolveVelocityConstraints_s_P=new
I,i.SolvePositionConstraints_s_d=new I,i.SolvePositionConstraints_s_P=new I,i})
(fi);function Ni(t,e){return T(t*e)}function ki(t,e){return t>e?t:e}var
Gi=(function(){return function(t){this.prev=null,this.next=null,this.contact=t}})
(),zi=(function(){function t(){this.m_islandFlag=!1,this.m_touchingFlag=!
1,this.m_enabledFlag=!1,this.m_filterFlag=!1,this.m_bulletHitFlag=!
1,this.m_toiFlag=!
1,this.m_prev=null,this.m_next=null,this.m_indexA=0,this.m_indexB=0,this.m_manifold
=new
bt,this.m_toiCount=0,this.m_toi=0,this.m_friction=0,this.m_restitution=0,this.m_tan
gentSpeed=0,this.m_oldManifold=new bt,this.m_nodeA=new Gi(this),this.m_nodeB=new
Gi(this)}return t.prototype.GetManifold=function(){return
this.m_manifold},t.prototype.GetWorldManifold=function(t){var
e=this.m_fixtureA.GetBody(),i=this.m_fixtureB.GetBody(),n=this.m_fixtureA.GetShape(
),r=this.m_fixtureB.GetShape();t.Initialize(this.m_manifold,e.GetTransform(),n.m_ra
dius,i.GetTransform(),r.m_radius)},t.prototype.IsTouching=function(){return
this.m_touchingFlag},t.prototype.SetEnabled=function(t)
{this.m_enabledFlag=t},t.prototype.IsEnabled=function(){return
this.m_enabledFlag},t.prototype.GetNext=function(){return
this.m_next},t.prototype.GetFixtureA=function(){return
this.m_fixtureA},t.prototype.GetChildIndexA=function(){return
this.m_indexA},t.prototype.GetFixtureB=function(){return
this.m_fixtureB},t.prototype.GetChildIndexB=function(){return
this.m_indexB},t.prototype.FlagForFiltering=function(){this.m_filterFlag=!
0},t.prototype.SetFriction=function(t)
{this.m_friction=t},t.prototype.GetFriction=function(){return
this.m_friction},t.prototype.ResetFriction=function()
{this.m_friction=Ni(this.m_fixtureA.m_friction,this.m_fixtureB.m_friction)},t.proto
type.SetRestitution=function(t)
{this.m_restitution=t},t.prototype.GetRestitution=function(){return
this.m_restitution},t.prototype.ResetRestitution=function()
{this.m_restitution=ki(this.m_fixtureA.m_restitution,this.m_fixtureB.m_restitution)
},t.prototype.SetTangentSpeed=function(t)
{this.m_tangentSpeed=t},t.prototype.GetTangentSpeed=function(){return
this.m_tangentSpeed},t.prototype.Reset=function(t,e,i,n){this.m_islandFlag=!
1,this.m_touchingFlag=!1,this.m_enabledFlag=!0,this.m_filterFlag=!
1,this.m_bulletHitFlag=!1,this.m_toiFlag=!
1,this.m_fixtureA=t,this.m_fixtureB=i,this.m_indexA=e,this.m_indexB=n,this.m_manifo
ld.pointCount=0,this.m_prev=null,this.m_next=null,delete
this.m_nodeA.contact,this.m_nodeA.prev=null,this.m_nodeA.next=null,delete
this.m_nodeA.other,delete
this.m_nodeB.contact,this.m_nodeB.prev=null,this.m_nodeB.next=null,delete
this.m_nodeB.other,this.m_toiCount=0,this.m_friction=Ni(this.m_fixtureA.m_friction,
this.m_fixtureB.m_friction),this.m_restitution=ki(this.m_fixtureA.m_restitution,thi
s.m_fixtureB.m_restitution)},t.prototype.Update=function(t){var
e=this.m_oldManifold;this.m_oldManifold=this.m_manifold,this.m_manifold=e,this.m_en
abledFlag=!0;var i=!
1,n=this.m_touchingFlag,r=this.m_fixtureA.IsSensor(),s=this.m_fixtureB.IsSensor(),a
=r||
s,o=this.m_fixtureA.GetBody(),l=this.m_fixtureB.GetBody(),h=o.GetTransform(),c=l.Ge
tTransform();if(a){var
u=this.m_fixtureA.GetShape(),_=this.m_fixtureB.GetShape();i=It(u,this.m_indexA,_,th
is.m_indexB,h,c),this.m_manifold.pointCount=0}else{this.Evaluate(this.m_manifold,h,
c),i=this.m_manifold.pointCount>0;for(var f=0;f<this.m_manifold.pointCount;++f){var
d=this.m_manifold.points[f];d.normalImpulse=0,d.tangentImpulse=0;for(var
m=d.id,p=0;p<this.m_oldManifold.pointCount;++p){var
v=this.m_oldManifold.points[p];if(v.id.key===m.key)
{d.normalImpulse=v.normalImpulse,d.tangentImpulse=v.tangentImpulse;break}}}i!
==n&&(o.SetAwake(!0),l.SetAwake(!0))}this.m_touchingFlag=i,!
n&&i&&t&&t.BeginContact(this),n&&!i&&t&&t.EndContact(this),!
a&&i&&t&&t.PreSolve(this,this.m_oldManifold)},t.prototype.ComputeTOI=function(e,i)
{var
n=t.ComputeTOI_s_input;n.proxyA.SetShape(this.m_fixtureA.GetShape(),this.m_indexA),
n.proxyB.SetShape(this.m_fixtureB.GetShape(),this.m_indexB),n.sweepA.Copy(e),n.swee
pB.Copy(i),n.tMax=l;var r=t.ComputeTOI_s_output;return
re(r,n),r.t},t.ComputeTOI_s_input=new Xt,t.ComputeTOI_s_output=new qt,t})
(),Ui=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,e,i)
{oe(t,this.m_fixtureA.GetShape(),e,this.m_fixtureB.GetShape(),i)},e})
(zi),ji=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,e,i)
{Le(t,this.m_fixtureA.GetShape(),e,this.m_fixtureB.GetShape(),i)},e})
(zi),Wi=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,e,i)
{ue(t,this.m_fixtureA.GetShape(),e,this.m_fixtureB.GetShape(),i)},e})
(zi),Hi=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,e,i)
{We(t,this.m_fixtureA.GetShape(),e,this.m_fixtureB.GetShape(),i)}
,e})(zi),Xi=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,e,i)
{Je(t,this.m_fixtureA.GetShape(),e,this.m_fixtureB.GetShape(),i)},e})
(zi),qi=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,i,n){var
r=this.m_fixtureA.GetShape(),s=this.m_fixtureB.GetShape(),a=r,o=e.Evaluate_s_edge;a
.GetChildEdge(o,this.m_indexA),We(t,o,i,s,n)},e.Evaluate_s_edge=new ii,e})
(zi),Yi=(function(t){function e(){return t.call(this)||this}return
$e(e,t),e.Create=function(t){return new e},e.Destroy=function(t,e)
{},e.prototype.Reset=function(e,i,n,r)
{t.prototype.Reset.call(this,e,i,n,r)},e.prototype.Evaluate=function(t,i,n){var
r=this.m_fixtureA.GetShape(),s=this.m_fixtureB.GetShape(),a=r,o=e.Evaluate_s_edge;a
.GetChildEdge(o,this.m_indexA),Je(t,o,i,s,n)},e.Evaluate_s_edge=new ii,e})
(zi),Ji=(function(){return function()
{this.createFcn=null,this.destroyFcn=null,this.primary=!1}})(),Zi=(function()
{function e(t)
{this.m_allocator=null,this.m_allocator=t,this.InitializeRegisters()}return
e.prototype.AddType=function(t,e,i,n){var r=this,s=d(256,(function(e){return
t(r.m_allocator)}));function a(e){return s.pop()||t(e)}function o(t,e)
{s.push(t)}this.m_registers[i][n].createFcn=a,this.m_registers[i]
[n].destroyFcn=o,this.m_registers[i][n].primary=!0,i!==n&&(this.m_registers[n]
[i].createFcn=a,this.m_registers[n][i].destroyFcn=o,this.m_registers[n]
[i].primary=!1)},e.prototype.InitializeRegisters=function()
{this.m_registers=[];for(var e=0;e<t.b2ShapeType.e_shapeTypeCount;e++)
{this.m_registers[e]=[];for(var i=0;i<t.b2ShapeType.e_shapeTypeCount;i+
+)this.m_registers[e][i]=new
Ji}this.AddType(Ui.Create,Ui.Destroy,t.b2ShapeType.e_circleShape,t.b2ShapeType.e_ci
rcleShape),this.AddType(Wi.Create,Wi.Destroy,t.b2ShapeType.e_polygonShape,t.b2Shape
Type.e_circleShape),this.AddType(ji.Create,ji.Destroy,t.b2ShapeType.e_polygonShape,
t.b2ShapeType.e_polygonShape),this.AddType(Hi.Create,Hi.Destroy,t.b2ShapeType.e_edg
eShape,t.b2ShapeType.e_circleShape),this.AddType(Xi.Create,Xi.Destroy,t.b2ShapeType
.e_edgeShape,t.b2ShapeType.e_polygonShape),this.AddType(qi.Create,qi.Destroy,t.b2Sh
apeType.e_chainShape,t.b2ShapeType.e_circleShape),this.AddType(Yi.Create,Yi.Destroy
,t.b2ShapeType.e_chainShape,t.b2ShapeType.e_polygonShape)},e.prototype.Create=funct
ion(t,e,i,n){var r=t.GetType(),s=i.GetType(),a=this.m_registers[r]
[s];if(a.createFcn){var o=a.createFcn(this.m_allocator);return a.primary?
o.Reset(t,e,i,n):o.Reset(i,n,t,e),o}return null},e.prototype.Destroy=function(t)
{var e=t.m_fixtureA,i=t.m_fixtureB;t.m_manifold.pointCount>0&&!e.IsSensor()&&!
i.IsSensor()&&(e.GetBody().SetAwake(!0),i.GetBody().SetAwake(!0));var
n=e.GetType(),r=i.GetType(),s=this.m_registers[n]
[r];s.destroyFcn&&s.destroyFcn(t,this.m_allocator)},e})(),Ki=(function(){function
t(){}return t.prototype.SayGoodbyeJoint=function(t)
{},t.prototype.SayGoodbyeFixture=function(t)
{},t.prototype.SayGoodbyeParticleGroup=function(t)
{},t.prototype.SayGoodbyeParticle=function(t,e){},t})(),Qi=(function(){function e()
{}return e.prototype.ShouldCollide=function(e,i){var
n=e.GetBody(),r=i.GetBody();if(r.GetType()===t.b2BodyType.b2_staticBody&&n.GetType(
)===t.b2BodyType.b2_staticBody)return!1;if(!r.ShouldCollideConnected(n))return!
1;var s=e.GetFilterData(),a=i.GetFilterData();return
s.groupIndex===a.groupIndex&&0!==s.groupIndex?s.groupIndex>0:0!
=(s.maskBits&a.categoryBits)&&0!
=(s.categoryBits&a.maskBits)},e.prototype.ShouldCollideFixtureParticle=function(t,e
,i){return!0},e.prototype.ShouldCollideParticleParticle=function(t,e,i){return!
0},e.b2_defaultFilter=new e,e})(),$i=(function(){return function()
{this.normalImpulses=m(a),this.tangentImpulses=m(a),this.count=0}})
(),tn=(function(){function t(){}return t.prototype.BeginContact=function(t)
{},t.prototype.EndContact=function(t)
{},t.prototype.BeginContactFixtureParticle=function(t,e)
{},t.prototype.EndContactFixtureParticle=function(t,e)
{},t.prototype.BeginContactParticleParticle=function(t,e)
{},t.prototype.EndContactParticleParticle=function(t,e)
{},t.prototype.PreSolve=function(t,e){},t.prototype.PostSolve=function(t,e)
{},t.b2_defaultListener=new t,t})(),en=(function(){function t(){}return
t.prototype.ReportFixture=function(t){return!
0},t.prototype.ReportParticle=function(t,e){return!
1},t.prototype.ShouldQueryParticleSystem=function(t){return!0},t})(),nn=(function()
{function t(){}return t.prototype.ReportFixture=function(t,e,i,n){return
n},t.prototype.ReportParticle=function(t,e,i,n,r){return
0},t.prototype.ShouldQueryParticleSystem=function(t){return!0},t})(),rn=(function()
{function e(){this.m_broadPhase=new
Vt,this.m_contactList=null,this.m_contactCount=0,this.m_contactFilter=Qi.b2_default
Filter,this.m_contactListener=tn.b2_defaultListener,this.m_allocator=null,this.m_co
ntactFactory=new Zi(this.m_allocator)}return e.prototype.AddPair=function(t,e){var
i=t.fixture,n=e.fixture,r=t.childIndex,s=e.childIndex,a=i.GetBody(),o=n.GetBody();i
f(a!==o){for(var l=o.GetContactList();l;){if(l.other===a){var
h=l.contact.GetFixtureA(),c=l.contact.GetFixtureB(),u=l.contact.GetChildIndexA(),_=
l.contact.GetChildIndexB();if(h===i&&c===n&&u===r&&_===s)return;if(h===n&&c===i&&u=
==s&&_===r)return}l=l.next}if(!this.m_contactFilter||
this.m_contactFilter.ShouldCollide(i,n)){var
f=this.m_contactFactory.Create(i,r,n,s);null!
==f&&(i=f.GetFixtureA(),n=f.GetFixtureB(),r=f.GetChildIndexA(),s=f.GetChildIndexB()
,a=i.m_body,o=n.m_body,f.m_prev=null,f.m_next=this.m_contactList,null!
==this.m_contactList&&(this.m_contactList.m_prev=f),this.m_contactList=f,f.m_nodeA.
contact=f,f.m_nodeA.other=o,f.m_nodeA.prev=null,f.m_nodeA.next=a.m_contactList,null
!
==a.m_contactList&&(a.m_contactList.prev=f.m_nodeA),a.m_contactList=f.m_nodeA,f.m_n
odeB.contact=f,f.m_nodeB.other=a,f.m_nodeB.prev=null,f.m_nodeB.next=o.m_contactList
,null!
==o.m_contactList&&(o.m_contactList.prev=f.m_nodeB),o.m_contactList=f.m_nodeB,i.IsS
ensor()||n.IsSensor()||(a.SetAwake(!0),o.SetAwake(!0)),+
+this.m_contactCount)}}},e.prototype.FindNewContacts=function(){var
t=this;this.m_broadPhase.UpdatePairs((function(e,i)
{t.AddPair(e,i)}))},e.prototype.Destroy=function(t){var
e=t.GetFixtureA(),i=t.GetFixtureB(),n=e.GetBody(),r=i.GetBody();this.m_contactListe
ner&&t.IsTouching()&&this.m_contactListener.EndContact(t),t.m_prev&&(t.m_prev.m_nex
t=t.m_next),t.m_next&&(t.m_next.m_prev=t.m_prev),t===this.m_contactList&&(this.m_co
ntactList=t.m_next),t.m_nodeA.prev&&(t.m_nodeA.prev.next=t.m_nodeA.next),t.m_nodeA.
next&&(t.m_nodeA.next.prev=t.m_nodeA.prev),t.m_nodeA===n.m_contactList&&(n.m_contac
tList=t.m_nodeA.next),t.m_nodeB.prev&&(t.m_nodeB.prev.next=t.m_nodeB.next),t.m_node
B.next&&(t.m_nodeB.next.prev=t.m_nodeB.prev),t.m_nodeB===r.m_contactList&&(r.m_cont
actList=t.m_nodeB.next),this.m_contactFactory.Destroy(t),--
this.m_contactCount},e.prototype.Collide=function(){for(var
e=this.m_contactList;e;){var
i=e.GetFixtureA(),n=e.GetFixtureB(),r=e.GetChildIndexA(),s=e.GetChildIndexB(),a=i.G
etBody(),o=n.GetBody();if(e.m_filterFlag){if(this.m_contactFilter&&!
this.m_contactFilter.ShouldCollide(i,n))
{e=(c=e).m_next,this.Destroy(c);continue}e.m_filterFlag=!1}var
l=a.IsAwake()&&a.m_type!==t.b2BodyType.b2_staticBody,h=o.IsAwake()&&o.m_type!
==t.b2BodyType.b2_staticBody;if(l||h){var
c,u=i.m_proxies[r].treeNode,_=n.m_proxies[s].treeNode;if(Et(u.aabb,_.aabb))e.Update
(this.m_contactListener),e=e.m_next;else e=(c=e).m_next,this.Destroy(c)}else
e=e.m_next}},e})(),sn=(function(){function t()
{this.step=0,this.collide=0,this.solve=0,this.solveInit=0,this.solveVelocity=0,this
.solvePosition=0,this.broadphase=0,this.solveTOI=0}return
t.prototype.Reset=function(){return
this.step=0,this.collide=0,this.solve=0,this.solveInit=0,this.solveVelocity=0,this.
solvePosition=0,this.broadphase=0,this.solveTOI=0,this},t})(),an=(function()
{function t()
{this.dt=0,this.inv_dt=0,this.dtRatio=0,this.velocityIterations=0,this.positionIter
ations=0,this.particleIterations=0,this.warmStarting=!1}return
t.prototype.Copy=function(t){return
this.dt=t.dt,this.inv_dt=t.inv_dt,this.dtRatio=t.dtRatio,this.positionIterations=t.
positionIterations,this.velocityIterations=t.velocityIterations,this.particleIterat
ions=t.particleIterations,this.warmStarting=t.warmStarting,this},t})
(),on=(function(){function t(){this.c=new I,this.a=0}return t.MakeArray=function(e)
{return d(e,(function(e){return new t}))},t})(),ln=(function(){function t()
{this.v=new I,this.w=0}return t.MakeArray=function(e){return d(e,(function(e)
{return new t}))},t})(),hn=(function(){return function(){this.step=new an}})
(),cn=(function(){function t(){this.rA=new I,this.rB=new
I,this.normalImpulse=0,this.tangentImpulse=0,this.normalMass=0,this.tangentMass=0,t
his.velocityBias=0}return t.MakeArray=function(e){return d(e,(function(e){return
new t}))},t})(),un=(function(){function t()
{this.points=cn.MakeArray(a),this.normal=new I,this.tangent=new
I,this.normalMass=new L,this.K=new
L,this.indexA=0,this.indexB=0,this.invMassA=0,this.invMassB=0,this.invIA=0,this.inv
IB=0,this.friction=0,this.restitution=0,this.tangentSpeed=0,this.pointCount=0,this.
contactIndex=0}return t.MakeArray=function(e){return d(e,(function(e){return new
t}))},t})(),_n=(function(){function e()
{this.localPoints=I.MakeArray(a),this.localNormal=new I,this.localPoint=new
I,this.indexA=0,this.indexB=0,this.invMassA=0,this.invMassB=0,this.localCenterA=new
I,this.localCenterB=new
I,this.invIA=0,this.invIB=0,this.type=t.b2ManifoldType.e_unknown,this.radiusA=0,thi
s.radiusB=0,this.pointCount=0}return e.MakeArray=function(t){return d(t,
(function(t){return new e}))},e})(),fn=(function(){return function(){this.step=new
an,this.count=0,this.allocator=null}})(),dn=(function(){function
e(){this.normal=new I,this.point=new I,this.separation=0}return
e.prototype.Initialize=function(i,n,r,s){var
a=e.Initialize_s_pointA,o=e.Initialize_s_pointB,l=e.Initialize_s_planePoint,h=e.Ini
tialize_s_clipPoint;switch(i.type){case
t.b2ManifoldType.e_circles:N.MulXV(n,i.localPoint,a),N.MulXV(r,i.localPoints[0],o),
I.SubVV(o,a,this.normal).SelfNormalize(),I.MidVV(a,o,this.point),this.separation=I.
DotVV(I.SubVV(o,a,I.s_t0),this.normal)-i.radiusA-i.radiusB;break;case
t.b2ManifoldType.e_faceA:V.MulRV(n.q,i.localNormal,this.normal),N.MulXV(n,i.localPo
int,l),N.MulXV(r,i.localPoints[s],h),this.separation=I.DotVV(I.SubVV(h,l,I.s_t0),th
is.normal)-i.radiusA-i.radiusB,this.point.Copy(h);break;case
t.b2ManifoldType.e_faceB:V.MulRV(r.q,i.localNormal,this.normal),N.MulXV(r,i.localPo
int,l),N.MulXV(n,i.localPoints[s],h),this.separation=I.DotVV(I.SubVV(h,l,I.s_t0),th
is.normal)-i.radiusA-
i.radiusB,this.point.Copy(h),this.normal.SelfNeg()}},e.Initialize_s_pointA=new
I,e.Initialize_s_pointB=new I,e.Initialize_s_planePoint=new
I,e.Initialize_s_clipPoint=new I,e})(),mn=(function(){function t(){this.m_step=new
an,this.m_allocator=null,this.m_positionConstraints=_n.MakeArray(1024),this.m_veloc
ityConstraints=un.MakeArray(1024),this.m_count=0}return
t.prototype.Initialize=function(t)
{if(this.m_step.Copy(t.step),this.m_allocator=t.allocator,this.m_count=t.count,this
.m_positionConstraints.length<this.m_count)for(var
e=x(2*this.m_positionConstraints.length,this.m_count);this.m_positionConstraints.le
ngth<e;)this.m_positionConstraints[this.m_positionConstraints.length]=new
_n;if(this.m_velocityConstraints.length<this.m_count)for(e=x(2*this.m_velocityConst
raints.length,this.m_count);this.m_velocityConstraints.length<e;)this.m_velocityCon
straints[this.m_velocityConstraints.length]=new
un;this.m_positions=t.positions,this.m_velocities=t.velocities,this.m_contacts=t.co
ntacts;for(var i=0;i<this.m_count;++i){var
n=this.m_contacts[i],r=n.m_fixtureA,s=n.m_fixtureB,a=r.GetShape(),o=s.GetShape(),l=
a.m_radius,h=o.m_radius,c=r.GetBody(),u=s.GetBody(),_=n.GetManifold(),f=_.pointCoun
t,d=this.m_velocityConstraints[i];d.friction=n.m_friction,d.restitution=n.m_restitu
tion,d.tangentSpeed=n.m_tangentSpeed,d.indexA=c.m_islandIndex,d.indexB=u.m_islandIn
dex,d.invMassA=c.m_invMass,d.invMassB=u.m_invMass,d.invIA=c.m_invI,d.invIB=u.m_invI
,d.contactIndex=i,d.pointCount=f,d.K.SetZero(),d.normalMass.SetZero();var
m=this.m_positionConstraints[i];m.indexA=c.m_islandIndex,m.indexB=u.m_islandIndex,m
.invMassA=c.m_invMass,m.invMassB=u.m_invMass,m.localCenterA.Copy(c.m_sweep.localCen
ter),m.localCenterB.Copy(u.m_sweep.localCenter),m.invIA=c.m_invI,m.invIB=u.m_invI,m
.localNormal.Copy(_.localNormal),m.localPoint.Copy(_.localPoint),m.pointCount=f,m.r
adiusA=l,m.radiusB=h,m.type=_.type;for(var p=0;p<f;++p){var
v=_.points[p],y=d.points[p];this.m_step.warmStarting?
(y.normalImpulse=this.m_step.dtRatio*v.normalImpulse,y.tangentImpulse=this.m_step.d
tRatio*v.tangentImpulse):
(y.normalImpulse=0,y.tangentImpulse=0),y.rA.SetZero(),y.rB.SetZero(),y.normalMass=0
,y.tangentMass=0,y.velocityBias=0,m.localPoints[p].Copy(v.localPoint)}}return
this},t.prototype.InitializeVelocityConstraints=function(){for(var
e=t.InitializeVelocityConstraints_s_xfA,i=t.InitializeVelocityConstraints_s_xfB,n=t
.InitializeVelocityConstraints_s_worldManifold,r=0;r<this.m_count;++r){var
s=this.m_velocityConstraints[r],a=this.m_positionConstraints[r],o=a.radiusA,l=a.rad
iusB,h=this.m_contacts[s.contactIndex].GetManifold(),c=s.indexA,u=s.indexB,_=s.invM
assA,f=s.invMassB,d=s.invIA,m=s.invIB,p=a.localCenterA,v=a.localCenterB,y=this.m_po
sitions[c].c,g=this.m_positions[c].a,x=this.m_velocities[c].v,b=this.m_velocities[c
].w,A=this.m_positions[u].c,C=this.m_positions[u].a,S=this.m_velocities[u].v,T=this
.m_velocities[u].w;e.q.SetAngle(g),i.q.SetAngle(C),I.SubVV(y,V.MulRV(e.q,p,I.s_t0),
e.p),I.SubVV(A,V.MulRV(i.q,v,I.s_t0),i.p),n.Initialize(h,e,o,i,l),s.normal.Copy(n.n
ormal),I.CrossVOne(s.normal,s.tangent);for(var w=s.pointCount,E=0;E<w;++E){var
M=s.points[E];I.SubVV(n.points[E],y,M.rA),I.SubVV(n.points[E],A,M.rB);var
D=I.CrossVV(M.rA,s.normal),B=I.CrossVV(M.rB,s.normal),P=_+f+d*D*D+m*B*B;M.normalMas
s=P>0?1/P:0;var
R=s.tangent,O=I.CrossVV(M.rA,R),L=I.CrossVV(M.rB,R),F=_+f+d*O*O+m*L*L;M.tangentMass
=F>0?1/F:0,M.velocityBias=0;var
N=I.DotVV(s.normal,I.SubVV(I.AddVCrossSV(S,T,M.rB,I.s_t0),I.AddVCrossSV(x,b,M.rA,I.
s_t1),I.s_t0));N<-1&&(M.velocityBias+=-
s.restitution*N)}s.pointCount}},t.prototype.WarmStart=function(){for(var
e=t.WarmStart_s_P,i=0;i<this.m_count;++i){for(var
n=this.m_velocityConstraints[i],r=n.indexA,s=n.indexB,a=n.invMassA,o=n.invIA,l=n.in
vMassB,h=n.invIB,c=n.pointCount,u=this.m_velocities[r].v,_=this.m_velocities[r].w,f
=this.m_velocities[s].v,d=this.m_velocities[s].w,m=n.normal,p=n.tangent,v=0;v<c;+
+v){var
y=n.points[v];I.AddVV(I.MulSV(y.normalImpulse,m,I.s_t0),I.MulSV(y.tangentImpulse,p,
I.s_t1),e),_-
=o*I.CrossVV(y.rA,e),u.SelfMulSub(a,e),d+=h*I.CrossVV(y.rB,e),f.SelfMulAdd(l,e)}thi
s.m_velocities[r].w=_,this.m_velocities[s].w=d}},t.prototype.SolveVelocityConstrain
ts=function(){for(var
e=t.SolveVelocityConstraints_s_dv,i=(t.SolveVelocityConstraints_s_dv1,t.SolveVeloci
tyConstraints_s_dv2,t.SolveVelocityConstraints_s_P),n=(t.SolveVelocityConstraints_s
_a,t.SolveVelocityConstraints_s_b,t.SolveVelocityConstraints_s_x,t.SolveVelocityCon
straints_s_d,t.SolveVelocityConstraints_s_P1,t.SolveVelocityConstraints_s_P2,t.Solv
eVelocityConstraints_s_P1P2,0);n<this.m_count;++n){for(var
r=this.m_velocityConstraints[n],s=r.indexA,a=r.indexB,o=r.invMassA,l=r.invIA,h=r.in
vMassB,c=r.invIB,u=r.pointCount,_=this.m_velocities[s].v,f=this.m_velocities[s].w,d
=this.m_velocities[a].v,m=this.m_velocities[a].w,p=r.normal,v=r.tangent,y=r.frictio
n,g=0;g<u;++g){var
A=r.points[g];I.SubVV(I.AddVCrossSV(d,m,A.rB,I.s_t0),I.AddVCrossSV(_,f,A.rA,I.s_t1)
,e);var C=I.DotVV(e,v)-r.tangentSpeed,S=A.tangentMass*-
C,T=y*A.normalImpulse;S=(w=b(A.tangentImpulse+S,-T,T))-
A.tangentImpulse,A.tangentImpulse=w,I.MulSV(S,v,i),_.SelfMulSub(o,i),f-
=l*I.CrossVV(A.rA,i),d.SelfMulAdd(h,i),m+=c*I.CrossVV(A.rB,i)}r.pointCount;for(g=0;
g<u;++g)
{A=r.points[g];I.SubVV(I.AddVCrossSV(d,m,A.rB,I.s_t0),I.AddVCrossSV(_,f,A.rA,I.s_t1
),e);var w,E=I.DotVV(e,p);S=-A.normalMass*(E-
A.velocityBias);S=(w=x(A.normalImpulse+S,0))-
A.normalImpulse,A.normalImpulse=w,I.MulSV(S,p,i),_.SelfMulSub(o,i),f-
=l*I.CrossVV(A.rA,i),d.SelfMulAdd(h,i),m+=c*I.CrossVV(A.rB,i)}this.m_velocities[s].
w=f,this.m_velocities[a].w=m}},t.prototype.StoreImpulses=function(){for(var
t=0;t<this.m_count;++t)for(var
e=this.m_velocityConstraints[t],i=this.m_contacts[e.contactIndex].GetManifold(),n=0
;n<e.pointCount;+
+n)i.points[n].normalImpulse=e.points[n].normalImpulse,i.points[n].tangentImpulse=e
.points[n].tangentImpulse},t.prototype.SolvePositionConstraints=function(){for(var
e=t.SolvePositionConstraints_s_xfA,i=t.SolvePositionConstraints_s_xfB,n=t.SolvePosi
tionConstraints_s_psm,r=t.SolvePositionConstraints_s_rA,s=t.SolvePositionConstraint
s_s_rB,a=t.SolvePositionConstraints_s_P,o=0,h=0;h<this.m_count;++h){for(var
c=this.m_positionConstraints[h],u=c.indexA,_=c.indexB,f=c.localCenterA,d=c.invMassA
,m=c.invIA,p=c.localCenterB,v=c.invMassB,y=c.invIB,x=c.pointCount,A=this.m_position
s[u].c,C=this.m_positions[u].a,S=this.m_positions[_].c,T=this.m_positions[_].a,w=0;
w<x;++w)
{e.q.SetAngle(C),i.q.SetAngle(T),I.SubVV(A,V.MulRV(e.q,f,I.s_t0),e.p),I.SubVV(S,V.M
ulRV(i.q,p,I.s_t0),i.p),n.Initialize(c,e,i,w);var
E=n.normal,M=n.point,D=n.separation;I.SubVV(M,A,r),I.SubVV(M,S,s),o=g(o,D);var
B=b(.2*(D+l),-.2,0),P=I.CrossVV(r,E),R=I.CrossVV(s,E),O=d+v+m*P*P+y*R*R,L=O>0?-
B/O:0;I.MulSV(L,E,a),A.SelfMulSub(d,a),C-
=m*I.CrossVV(r,a),S.SelfMulAdd(v,a),T+=y*I.CrossVV(s,a)}this.m_positions[u].a=C,thi
s.m_positions[_].a=T}return o>-
3*l},t.prototype.SolveTOIPositionConstraints=function(e,i){for(var
n=t.SolveTOIPositionConstraints_s_xfA,r=t.SolveTOIPositionConstraints_s_xfB,s=t.Sol
veTOIPositionConstraints_s_psm,a=t.SolveTOIPositionConstraints_s_rA,o=t.SolveTOIPos
itionConstraints_s_rB,h=t.SolveTOIPositionConstraints_s_P,c=0,u=0;u<this.m_count;+
+u){var
_=this.m_positionConstraints[u],f=_.indexA,d=_.indexB,m=_.localCenterA,p=_.localCen
terB,v=_.pointCount,y=0,x=0;f!==e&&f!==i||(y=_.invMassA,x=_.invIA);var A=0,C=0;d!
==e&&d!==i||(A=_.invMassB,C=_.invIB);for(var
S=this.m_positions[f].c,T=this.m_positions[f].a,w=this.m_positions[d].c,E=this.m_po
sitions[d].a,M=0;M<v;++M)
{n.q.SetAngle(T),r.q.SetAngle(E),I.SubVV(S,V.MulRV(n.q,m,I.s_t0),n.p),I.SubVV(w,V.M
ulRV(r.q,p,I.s_t0),r.p),s.Initialize(_,n,r,M);var
D=s.normal,B=s.point,P=s.separation;I.SubVV(B,S,a),I.SubVV(B,w,o),c=g(c,P);var
R=b(.75*(P+l),-.2,0),O=I.CrossVV(a,D),L=I.CrossVV(o,D),F=y+A+x*O*O+C*L*L,N=F>0?-
R/F:0;I.MulSV(N,D,h),S.SelfMulSub(y,h),T-
=x*I.CrossVV(a,h),w.SelfMulAdd(A,h),E+=C*I.CrossVV(o,h)}this.m_positions[f].a=T,thi
s.m_positions[d].a=E}return c>=-1.5*l},t.InitializeVelocityConstraints_s_xfA=new
N,t.InitializeVelocityConstraints_s_xfB=new
N,t.InitializeVelocityConstraints_s_worldManifold=new At,t.WarmStart_s_P=new
I,t.SolveVelocityConstraints_s_dv=new I,t.SolveVelocityConstraints_s_dv1=new
I,t.SolveVelocityConstraints_s_dv2=new I,t.SolveVelocityConstraints_s_P=new
I,t.SolveVelocityConstraints_s_a=new I,t.SolveVelocityConstraints_s_b=new
I,t.SolveVelocityConstraints_s_x=new I,t.SolveVelocityConstraints_s_d=new
I,t.SolveVelocityConstraints_s_P1=new I,t.SolveVelocityConstraints_s_P2=new
I,t.SolveVelocityConstraints_s_P1P2=new I,t.SolvePositionConstraints_s_xfA=new
N,t.SolvePositionConstraints_s_xfB=new N,t.SolvePositionConstraints_s_psm=new
dn,t.SolvePositionConstraints_s_rA=new I,t.SolvePositionConstraints_s_rB=new
I,t.SolvePositionConstraints_s_P=new I,t.SolveTOIPositionConstraints_s_xfA=new
N,t.SolveTOIPositionConstraints_s_xfB=new N,t.SolveTOIPositionConstraints_s_psm=new
dn,t.SolveTOIPositionConstraints_s_rA=new I,t.SolveTOIPositionConstraints_s_rB=new
I,t.SolveTOIPositionConstraints_s_P=new I,t})(),pn=(function(){function
e()
{this.m_allocator=null,this.m_bodies=[],this.m_contacts=[],this.m_joints=[],this.m_
positions=on.MakeArray(1024),this.m_velocities=ln.MakeArray(1024),this.m_bodyCount=
0,this.m_jointCount=0,this.m_contactCount=0,this.m_bodyCapacity=0,this.m_contactCap
acity=0,this.m_jointCapacity=0}return e.prototype.Initialize=function(t,e,i,n,r)
{if(this.m_bodyCapacity=t,this.m_contactCapacity=e,this.m_jointCapacity=i,this.m_bo
dyCount=0,this.m_contactCount=0,this.m_jointCount=0,this.m_allocator=n,this.m_liste
ner=r,this.m_positions.length<t)for(var
s=x(2*this.m_positions.length,t);this.m_positions.length<s;)this.m_positions[this.m
_positions.length]=new
on;if(this.m_velocities.length<t)for(s=x(2*this.m_velocities.length,t);this.m_veloc
ities.length<s;)this.m_velocities[this.m_velocities.length]=new
ln},e.prototype.Clear=function()
{this.m_bodyCount=0,this.m_contactCount=0,this.m_jointCount=0},e.prototype.AddBody=
function(t){t.m_islandIndex=this.m_bodyCount,this.m_bodies[this.m_bodyCount+
+]=t},e.prototype.AddContact=function(t){this.m_contacts[this.m_contactCount+
+]=t},e.prototype.AddJoint=function(t){this.m_joints[this.m_jointCount+
+]=t},e.prototype.Solve=function(n,r,s,a){for(var
o=e.s_timer.Reset(),l=r.dt,h=0;h<this.m_bodyCount;++h){var
c=this.m_bodies[h];this.m_positions[h].c.Copy(c.m_sweep.c);var
u=c.m_sweep.a,_=this.m_velocities[h].v.Copy(c.m_linearVelocity),f=c.m_angularVeloci
ty;c.m_sweep.c0.Copy(c.m_sweep.c),c.m_sweep.a0=c.m_sweep.a,c.m_type===t.b2BodyType.
b2_dynamicBody&&(_.x+=l*(c.m_gravityScale*s.x+c.m_invMass*c.m_force.x),_.y+=l*(c.m_
gravityScale*s.y+c.m_invMass*c.m_force.y),f+=l*c.m_invI*c.m_torque,_.SelfMul(1/
(1+l*c.m_linearDamping)),f*=1/
(1+l*c.m_angularDamping)),this.m_positions[h].a=u,this.m_velocities[h].w=f}o.Reset(
);var
d=e.s_solverData;d.step.Copy(r),d.positions=this.m_positions,d.velocities=this.m_ve
locities;var
m=e.s_contactSolverDef;m.step.Copy(r),m.contacts=this.m_contacts,m.count=this.m_con
tactCount,m.positions=this.m_positions,m.velocities=this.m_velocities,m.allocator=t
his.m_allocator;var
p=e.s_contactSolver.Initialize(m);p.InitializeVelocityConstraints(),r.warmStarting&
&p.WarmStart();for(h=0;h<this.m_jointCount;+
+h)this.m_joints[h].InitVelocityConstraints(d);n.solveInit=o.GetMilliseconds(),o.Re
set();for(h=0;h<r.velocityIterations;++h){for(var v=0;v<this.m_jointCount;+
+v)this.m_joints[v].SolveVelocityConstraints(d);p.SolveVelocityConstraints()}p.Stor
eImpulses(),n.solveVelocity=o.GetMilliseconds();for(h=0;h<this.m_bodyCount;++h){var
x=this.m_positions[h].c,b=(u=this.m_positions[h].a,_=this.m_velocities[h].v,f=this.
m_velocities[h].w,I.MulSV(l,_,e.s_translation));if(I.DotVV(b,b)>4){var
A=2/b.Length();_.SelfMul(A)}var
C=l*f;if(C*C>2.4674011002726646)f*=A=1.570796326795/y(C);x.x+=l*_.x,x.y+=l*_.y,u+=l
*f,this.m_positions[h].a=u,this.m_velocities[h].w=f}o.Reset();var S=!
1;for(h=0;h<r.positionIterations;++h){var T=p.SolvePositionConstraints(),w=!
0;for(v=0;v<this.m_jointCount;++v){var
E=this.m_joints[v].SolvePositionConstraints(d);w=w&&E}if(T&&w){S=!
0;break}}for(h=0;h<this.m_bodyCount;++h){var
M=this.m_bodies[h];M.m_sweep.c.Copy(this.m_positions[h].c),M.m_sweep.a=this.m_posit
ions[h].a,M.m_linearVelocity.Copy(this.m_velocities[h].v),M.m_angularVelocity=this.
m_velocities[h].w,M.SynchronizeTransform()}if(n.solvePosition=o.GetMilliseconds(),t
his.Report(p.m_velocityConstraints),a){var D=i;for(h=0;h<this.m_bodyCount;++h)
{(c=this.m_bodies[h]).GetType()!==t.b2BodyType.b2_staticBody&&(!c.m_autoSleepFlag||
c.m_angularVelocity*c.m_angularVelocity>.0012184696791469947||
I.DotVV(c.m_linearVelocity,c.m_linearVelocity)>1e-4?(c.m_sleepTime=0,D=0):
(c.m_sleepTime+=l,D=g(D,c.m_sleepTime)))}if(D>=.5&&S)for(h=0;h<this.m_bodyCount;+
+h){(c=this.m_bodies[h]).SetAwake(!1)}}},e.prototype.SolveTOI=function(t,i,n)
{for(var r=0;r<this.m_bodyCount;++r){var
s=this.m_bodies[r];this.m_positions[r].c.Copy(s.m_sweep.c),this.m_positions[r].a=s.
m_sweep.a,this.m_velocities[r].v.Copy(s.m_linearVelocity),this.m_velocities[r].w=s.
m_angularVelocity}var
a=e.s_contactSolverDef;a.contacts=this.m_contacts,a.count=this.m_contactCount,a.all
ocator=this.m_allocator,a.step.Copy(t),a.positions=this.m_positions,a.velocities=th
is.m_velocities;var
o=e.s_contactSolver.Initialize(a);for(r=0;r<t.positionIterations;++r)
{if(o.SolveTOIPositionConstraints(i,n))break}this.m_bodies[i].m_sweep.c0.Copy(this.
m_positions[i].c),this.m_bodies[i].m_sweep.a0=this.m_positions[i].a,this.m_bodies[n
].m_sweep.c0.Copy(this.m_positions[n].c),this.m_bodies[n].m_sweep.a0=this.m_positio
ns[n].a,o.InitializeVelocityConstraints();for(r=0;r<t.velocityIterations;+
+r)o.SolveVelocityConstraints();var l=t.dt;for(r=0;r<this.m_bodyCount;++r){var
h=this.m_positions[r].c,c=this.m_positions[r].a,u=this.m_velocities[r].v,_=this.m_v
elocities[r].w,f=I.MulSV(l,u,e.s_translation);if(I.DotVV(f,f)>4){var
d=2/f.Length();u.SelfMul(d)}var
m=l*_;if(m*m>2.4674011002726646)_*=d=1.570796326795/y(m);h.SelfMulAdd(l,u),c+=l*_,t
his.m_positions[r].a=c,this.m_velocities[r].w=_;var
p=this.m_bodies[r];p.m_sweep.c.Copy(h),p.m_sweep.a=c,p.m_linearVelocity.Copy(u),p.m
_angularVelocity=_,p.SynchronizeTransform()}this.Report(o.m_velocityConstraints)},e
.prototype.Report=function(t){if(null!==this.m_listener)for(var
i=0;i<this.m_contactCount;++i){var n=this.m_contacts[i];if(n){var
r=t[i],s=e.s_impulse;s.count=r.pointCount;for(var a=0;a<r.pointCount;+
+a)s.normalImpulses[a]=r.points[a].normalImpulse,s.tangentImpulses[a]=r.points[a].t
angentImpulse;this.m_listener.PostSolve(n,s)}}},e.s_timer=new U,e.s_solverData=new
hn,e.s_contactSolverDef=new fn,e.s_contactSolver=new mn,e.s_translation=new
I,e.s_impulse=new $i,e})();(function(t)
{t[t.b2_waterParticle=0]="b2_waterParticle",t[t.b2_zombieParticle=2]="b2_zombiePart
icle",t[t.b2_wallParticle=4]="b2_wallParticle",t[t.b2_springParticle=8]="b2_springP
article",t[t.b2_elasticParticle=16]="b2_elasticParticle",t[t.b2_viscousParticle=32]
="b2_viscousParticle",t[t.b2_powderParticle=64]="b2_powderParticle",t[t.b2_tensileP
article=128]="b2_tensileParticle",t[t.b2_colorMixingParticle=256]="b2_colorMixingPa
rticle",t[t.b2_destructionListenerParticle=512]="b2_destructionListenerParticle",t[
t.b2_barrierParticle=1024]="b2_barrierParticle",t[t.b2_staticPressureParticle=2048]
="b2_staticPressureParticle",t[t.b2_reactiveParticle=4096]="b2_reactiveParticle",t[
t.b2_repulsiveParticle=8192]="b2_repulsiveParticle",t[t.b2_fixtureContactListenerPa
rticle=16384]="b2_fixtureContactListenerParticle",t[t.b2_particleContactListenerPar
ticle=32768]="b2_particleContactListenerParticle",t[t.b2_fixtureContactFilterPartic
le=65536]="b2_fixtureContactFilterParticle",t[t.b2_particleContactFilterParticle=13
1072]="b2_particleContactFilterParticle"})(t.b2ParticleFlag||
(t.b2ParticleFlag={}));var vn=(function(){return function()
{this.flags=0,this.position=new I,this.velocity=new I,this.color=new
G(0,0,0,0),this.lifetime=0,this.userData=null,this.group=null}})();function
yn(t,e,i){return b(Math.ceil(Math.sqrt(t/(.01*e))*i),1,8)}var gn=(function()
{function t(){this.m_index=u}return t.prototype.GetIndex=function(){return
this.m_index},t.prototype.SetIndex=function(t){this.m_index=t},t})();(function(t)
{t[t.b2_solidParticleGroup=1]="b2_solidParticleGroup",t[t.b2_rigidParticleGroup=2]=
"b2_rigidParticleGroup",t[t.b2_particleGroupCanBeEmpty=4]="b2_particleGroupCanBeEmp
ty",t[t.b2_particleGroupWillBeDestroyed=8]="b2_particleGroupWillBeDestroyed",t[t.b2
_particleGroupNeedsUpdateDepth=16]="b2_particleGroupNeedsUpdateDepth",t[t.b2_partic
leGroupInternalMask=24]="b2_particleGroupInternalMask"})(t.b2ParticleGroupFlag||
(t.b2ParticleGroupFlag={}));var xn=(function(){return function()
{this.flags=0,this.groupFlags=0,this.position=new
I,this.angle=0,this.linearVelocity=new I,this.angularVelocity=0,this.color=new
G,this.strength=1,this.shapeCount=0,this.stride=0,this.particleCount=0,this.lifetim
e=0,this.userData=null,this.group=null}})(),bn=(function(){function e(t)
{this.m_firstIndex=0,this.m_lastIndex=0,this.m_groupFlags=0,this.m_strength=1,this.
m_prev=null,this.m_next=null,this.m_timestamp=-
1,this.m_mass=0,this.m_inertia=0,this.m_center=new I,this.m_linearVelocity=new
I,this.m_angularVelocity=0,this.m_transform=new
N,this.m_userData=null,this.m_system=t}return e.prototype.GetNext=function(){return
this.m_next},e.prototype.GetParticleSystem=function(){return
this.m_system},e.prototype.GetParticleCount=function(){return this.m_lastIndex-
this.m_firstIndex},e.prototype.GetBufferIndex=function(){return
this.m_firstIndex},e.prototype.ContainsParticle=function(t){return
this.m_firstIndex<=t&&t<this.m_lastIndex},e.prototype.GetAllParticleFlags=function(
){if(!this.m_system.m_flagsBuffer.data)throw new Error;for(var
t=0,e=this.m_firstIndex;e<this.m_lastIndex;e++)t|
=this.m_system.m_flagsBuffer.data[e];return t},e.prototype.GetGroupFlags=function()
{return this.m_groupFlags},e.prototype.SetGroupFlags=function(e){e|
=this.m_groupFlags&t.b2ParticleGroupFlag.b2_particleGroupInternalMask,this.m_system
.SetGroupFlags(this,e)},e.prototype.GetMass=function(){return
this.UpdateStatistics(),this.m_mass},e.prototype.GetInertia=function(){return
this.UpdateStatistics(),this.m_inertia},e.prototype.GetCenter=function(){return
this.UpdateStatistics(),this.m_center},e.prototype.GetLinearVelocity=function()
{return
this.UpdateStatistics(),this.m_linearVelocity},e.prototype.GetAngularVelocity=funct
ion(){return
this.UpdateStatistics(),this.m_angularVelocity},e.prototype.GetTransform=function()
{return this.m_transform},e.prototype.GetPosition=function(){return
this.m_transform.p},e.prototype.GetAngle=function(){return
this.m_transform.q.GetAngle()},e.prototype.GetLinearVelocityFromWorldPoint=function
(t,i){var n=e.GetLinearVelocityFromWorldPoint_s_t0;return
this.UpdateStatistics(),I.AddVCrossSV(this.m_linearVelocity,this.m_angularVelocity,
I.SubVV(t,this.m_center,n),i)},e.prototype.GetUserData=function(){return
this.m_userData},e.prototype.SetUserData=function(t)
{this.m_userData=t},e.prototype.ApplyForce=function(t)
{this.m_system.ApplyForce(this.m_firstIndex,this.m_lastIndex,t)},e.prototype.ApplyL
ine
arImpulse=function(t)
{this.m_system.ApplyLinearImpulse(this.m_firstIndex,this.m_lastIndex,t)},e.prototyp
e.DestroyParticles=function(t){if(this.m_system.m_world.IsLocked())throw new
Error;for(var e=this.m_firstIndex;e<this.m_lastIndex;e+
+)this.m_system.DestroyParticle(e,t)},e.prototype.UpdateStatistics=function(){if(!
this.m_system.m_positionBuffer.data)throw new Error;if(!
this.m_system.m_velocityBuffer.data)throw new Error;var t=new I,e=new
I;if(this.m_timestamp!==this.m_system.m_timestamp){var
i=this.m_system.GetParticleMass();this.m_mass=i*(this.m_lastIndex-
this.m_firstIndex),this.m_center.SetZero(),this.m_linearVelocity.SetZero();for(var
n=this.m_firstIndex;n<this.m_lastIndex;n+
+)this.m_center.SelfMulAdd(i,this.m_system.m_positionBuffer.data[n]),this.m_linearV
elocity.SelfMulAdd(i,this.m_system.m_velocityBuffer.data[n]);if(this.m_mass>0){var
r=1/this.m_mass;this.m_center.SelfMul(r),this.m_linearVelocity.SelfMul(r)}this.m_in
ertia=0,this.m_angularVelocity=0;for(n=this.m_firstIndex;n<this.m_lastIndex;n+
+)I.SubVV(this.m_system.m_positionBuffer.data[n],this.m_center,t),I.SubVV(this.m_sy
stem.m_velocityBuffer.data[n],this.m_linearVelocity,e),this.m_inertia+=i*I.DotVV(t,
t),this.m_angularVelocity+=i*I.CrossVV(t,e);this.m_inertia>0&&(this.m_angularVeloci
ty*=1/this.m_inertia),this.m_timestamp=this.m_system.m_timestamp}},e.GetLinearVeloc
ityFromWorldPoint_s_t0=new I,e})(),An=(function(){function t(t)
{this.m_front=0,this.m_back=0,this.m_capacity=0,this.m_buffer=d(t,(function(t)
{return null})),this.m_capacity=t}return t.prototype.Push=function(t)
{if(this.m_back>=this.m_capacity){for(var e=this.m_front;e<this.m_back;e+
+)this.m_buffer[e-this.m_front]=this.m_buffer[e];this.m_back-
=this.m_front,this.m_front=0,this.m_back>=this.m_capacity&&(this.m_capacity>0?
(this.m_buffer.concat(d(this.m_capacity,(function(t){return
null}))),this.m_capacity*=2):(this.m_buffer.concat(d(1,(function(t){return
null}))),this.m_capacity=1))}this.m_buffer[this.m_back]=t,this.m_back+
+},t.prototype.Pop=function(){this.m_buffer[this.m_front]=null,this.m_front+
+},t.prototype.Empty=function(){return
this.m_front===this.m_back},t.prototype.Front=function(){var
t=this.m_buffer[this.m_front];if(!t)throw new Error;return t},t})(),Cn=(function()
{function t(e)
{this.m_generatorCapacity=0,this.m_generatorCount=0,this.m_countX=0,this.m_countY=0
,this.m_diagram=[],this.m_generatorBuffer=d(e,(function(e){return new
t.Generator})),this.m_generatorCapacity=e}return
t.prototype.AddGenerator=function(t,e,i){var
n=this.m_generatorBuffer[this.m_generatorCount+
+];n.center.Copy(t),n.tag=e,n.necessary=i},t.prototype.Generate=function(e,n)
{for(var r=1/e,s=new I(+i,+i),a=new I(-i,-i),o=0,l=0;l<this.m_generatorCount;l++)
{(f=this.m_generatorBuffer[l]).necessary&&(I.MinV(s,f.center,s),I.MaxV(a,f.center,a
),++o)}if(0===o)return this.m_countX=0,void(this.m_countY=0);s.x-=n,s.y-
=n,a.x+=n,a.y+=n,this.m_countX=1+Math.floor(r*(a.x-
s.x)),this.m_countY=1+Math.floor(r*(a.y-s.y)),this.m_diagram=[];var h=new
An(4*this.m_countX*this.m_countY);for(l=0;l<this.m_generatorCount;l++)
{(f=this.m_generatorBuffer[l]).center.SelfSub(s).SelfMul(r);var
c=Math.floor(f.center.x),u=Math.floor(f.center.y);c>=0&&u>=0&&c<this.m_countX&&u<th
is.m_countY&&h.Push(new t.Task(c,u,c+u*this.m_countX,f))}for(;!h.Empty();)
{c=(d=h.Front()).m_x,u=d.m_y;var
_=d.m_i,f=d.m_generator;h.Pop(),this.m_diagram[_]||
(this.m_diagram[_]=f,c>0&&h.Push(new t.Task(c-1,u,_-1,f)),u>0&&h.Push(new
t.Task(c,u-1,_-this.m_countX,f)),c<this.m_countX-1&&h.Push(new
t.Task(c+1,u,_+1,f)),u<this.m_countY-1&&h.Push(new
t.Task(c,u+1,_+this.m_countX,f)))}for(u=0;u<this.m_countY;u+
+)for(c=0;c<this.m_countX-1;c++){_=c+u*this.m_countX;(m=this.m_diagram[_])!
==(p=this.m_diagram[_+1])&&(h.Push(new t.Task(c,u,_,p)),h.Push(new
t.Task(c+1,u,_+1,m)))}for(u=0;u<this.m_countY-1;u++)for(c=0;c<this.m_countX;c++)
{_=c+u*this.m_countX;(m=this.m_diagram[_])!
==(p=this.m_diagram[_+this.m_countX])&&(h.Push(new t.Task(c,u,_,p)),h.Push(new
t.Task(c,u+1,_+this.m_countX,m)))}for(;!h.Empty();){var
d,m,p;c=(d=h.Front()).m_x,u=d.m_y,_=d.m_i,l=d.m_generator;if(h.Pop(),
(m=this.m_diagram[_])!==(p=l)){var v=m.center.x-c,y=m.center.y-u,g=p.center.x-
c,x=p.center.y-u;v*v+y*y>g*g+x*x&&(this.m_diagram[_]=p,c>0&&h.Push(new t.Task(c-
1,u,_-1,p)),u>0&&h.Push(new t.Task(c,u-1,_-this.m_countX,p)),c<this.m_countX-
1&&h.Push(new t.Task(c+1,u,_+1,p)),u<this.m_countY-1&&h.Push(new
t.Task(c,u+1,_+this.m_countX,p)))}}},t.prototype.GetNodes=function(t){for(var
e=0;e<this.m_countY-1;e++)for(var i=0;i<this.m_countX-1;i++){var
n=i+e*this.m_countX,r=this.m_diagram[n],s=this.m_diagram[n+1],a=this.m_diagram[n+th
is.m_countX],o=this.m_diagram[n+1+this.m_countX];s!==a&&(r!==s&&r!
==a&&(r.necessary||s.necessary||a.necessary)&&t(r.tag,s.tag,a.tag),o!==s&&o!
==a&&(r.necessary||s.necessary||a.necessary)&&t(s.tag,o.tag,a.tag))}},t})
();function Sn(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Tn(t,e){return
t<e}function wn(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=t.length-e),void
0===n&&(n=Tn);for(var r=e,s=[],a=0;;){for(;r+1<i;i++){var
o=t[r+Math.floor(Math.random()*(i-r))];s[a++]=i;for(var l=r-1;;){for(;n(t[+
+l],o););for(;n(o,t[--i]););if(l>=i)break;Sn(t,l,i)}}if(0===a)break;r=i,i=s[--
a]}return t}function En(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=t.length-
e),void 0===n&&(n=Tn),wn(t,e,i,n)}function Mn(t,e,i){void
0===i&&(i=t.length);for(var n=0,r=0;r<i;++r)e(t[r])||(r!==n?Sn(t,n++,r):++n);return
n}function Dn(t,e,i,n,r){void 0===r&&(r=Tn);for(var s=i-e;s>0;){var
a=Math.floor(s/2),o=e+a;r(t[o],n)?(e=++o,s-=a+1):s=a}return e}function
Bn(t,e,i,n,r){void 0===r&&(r=Tn);for(var s=i-e;s>0;){var
a=Math.floor(s/2),o=e+a;r(n,t[o])?s=a:(e=++o,s-=a+1)}return e}function Pn(t,e,i,n)
{for(var r=i;e!==r;)Sn(t,e++,r++),r===n?r=i:e===i&&(i=r)}function In(t,e,i,n)
{if(e===i)return i;for(var r=e;++e!==i;)n(t[r],t[e])||Sn(t,++r,e);return++r}
(function(t){var e=(function(){return function(){this.center=new
I,this.tag=0,this.necessary=!1}})();t.Generator=e;var i=(function(){return
function(t,e,i,n){this.m_x=t,this.m_y=e,this.m_i=i,this.m_generator=n}})
();t.Task=i})(Cn||(Cn={}));var Rn=(function(){function t(t)
{this.data=[],this.count=0,this.capacity=0,this.allocator=t}return
t.prototype.Append=function(){return
this.count>=this.capacity&&this.Grow(),this.count+
+},t.prototype.Reserve=function(t){if(!(this.capacity>=t)){for(var
e=this.capacity;e<t;+
+e)this.data[e]=this.allocator();this.capacity=t}},t.prototype.Grow=function(){var
t=this.capacity?2*this.capacity:256;this.Reserve(t)},t.prototype.Free=function(){0!
==this.data.length&&(this.data=[],this.capacity=0,this.count=0)},t.prototype.Shorte
n=function(t){},t.prototype.Data=function(){return
this.data},t.prototype.GetCount=function(){return
this.count},t.prototype.SetCount=function(t)
{this.count=t},t.prototype.GetCapacity=function(){return
this.capacity},t.prototype.RemoveIf=function(t)
{this.count=Mn(this.data,t,this.count)},t.prototype.Unique=function(t)
{this.count=In(this.data,0,this.count,t)},t})(),On=(function(t){function e(e){var
i=t.call(this)||this;return i.m_system=e,i}return
$e(e,t),e.prototype.ShouldQueryParticleSystem=function(t){return!
1},e.prototype.ReportFixture=function(t){if(t.IsSensor())return!0;for(var
e=t.GetShape().GetChildCount(),i=0;i<e;i++)for(var
n=t.GetAABB(i),r=this.m_system.GetInsideBoundsEnumerator(n),s=void 0;
(s=r.GetNext())>=0;)this.ReportFixtureAndParticle(t,i,s);return!
0},e.prototype.ReportParticle=function(t,e){return!
1},e.prototype.ReportFixtureAndParticle=function(t,e,i){},e})(en),Ln=(function()
{function t(){this.indexA=0,this.indexB=0,this.weight=0,this.normal=new
I,this.flags=0}return t.prototype.SetIndices=function(t,e)
{this.indexA=t,this.indexB=e},t.prototype.SetWeight=function(t)
{this.weight=t},t.prototype.SetNormal=function(t)
{this.normal.Copy(t)},t.prototype.SetFlags=function(t)
{this.flags=t},t.prototype.GetIndexA=function(){return
this.indexA},t.prototype.GetIndexB=function(){return
this.indexB},t.prototype.GetWeight=function(){return
this.weight},t.prototype.GetNormal=function(){return
this.normal},t.prototype.GetFlags=function(){return
this.flags},t.prototype.IsEqual=function(t){return
this.indexA===t.indexA&&this.indexB===t.indexB&&this.flags===t.flags&&this.weight==
=t.weight&&this.normal.x===t.normal.x&&this.normal.y===t.normal.y},t.prototype.IsNo
tEqual=function(t){return!
this.IsEqual(t)},t.prototype.ApproximatelyEqual=function(t){return
this.indexA===t.indexA&&this.indexB===t.indexB&&this.flags===t.flags&&y(this.weight
-t.weight)<.01&&I.DistanceSquaredVV(this.normal,t.normal)<1e-4},t})
(),Fn=(function(){return function(){this.index=0,this.weight=0,this.normal=new
I,this.mass=0}})(),Vn=(function(){return function()
{this.indexA=0,this.indexB=0,this.flags=0,this.strength=0,this.distance=0}})
(),Nn=(function(){return function()
{this.indexA=0,this.indexB=0,this.indexC=0,this.flags=0,this.strength=0,this.pa=new
I(0,0),this.pb=new I(0,0),this.pc=new
I(0,0),this.ka=0,this.kb=0,this.kc=0,this.s=0}})(),kn=(function(){function t()
{this.strictContactCheck=!
1,this.density=1,this.gravityScale=1,this.radius=1,this.maxCount=0,this.pressureStr
ength=.005,this.dampingStrength=1,this.elasticStrength=.25,this.springStrength=.25,
this.viscousStrength=.25,this.surfaceTensionPressureStrength=.2,this.surfaceTension
NormalStrength=.2,this.repulsiveStrength=1,this.powderStrength=.5,this.ejectionStre
ngth=.5,this.staticPressureStrength=.2,this.staticPressureRelaxation=.2,this.static
PressureIterations=8,this.colorMixingStrength=.5,this.destroyByAge=!
0,this.lifetimeGranularity=1/60}return t.prototype.Copy=function(t){return
this.strictContactCheck=t.strictContactCheck,this.density=t.density,this.gravitySca
le=t.gravityScale,this.radius=t.radius,this.maxCount=t.maxCount,this.pressureStreng
th=t.pressureStrength,this.dampingStrength=t.dampingStrength,this.elasticStrength=t
.elasticStrength,this.springStrength=t.springStrength,this.viscousStrength=t.viscou
sStrength,this.surfaceTensionPressureStrength=t.surfaceTensionPressureStrength,this
.surfaceTensionNormalStrength=t.surfaceTens
ionNormalStrength,this.repulsiveStrength=t.repulsiveStrength,this.powderStrength=t.
powderStrength,this.ejectionStrength=t.ejectionStrength,this.staticPressureStrength
=t.staticPressureStrength,this.staticPressureRelaxation=t.staticPressureRelaxation,
this.staticPressureIterations=t.staticPressureIterations,this.colorMixingStrength=t
.colorMixingStrength,this.destroyByAge=t.destroyByAge,this.lifetimeGranularity=t.li
fetimeGranularity,this},t.prototype.Clone=function(){return(new t).Copy(this)},t})
();t.b2ParticleSystem=(function(){function n(t,e){this.m_paused=!
1,this.m_timestamp=0,this.m_allParticleFlags=0,this.m_needsUpdateAllParticleFlags=!
1,this.m_allGroupFlags=0,this.m_needsUpdateAllGroupFlags=!1,this.m_hasForce=!
1,this.m_iterationIndex=0,this.m_inverseDensity=0,this.m_particleDiameter=0,this.m_
inverseDiameter=0,this.m_squaredDiameter=0,this.m_count=0,this.m_internalAllocatedC
apacity=0,this.m_handleIndexBuffer=new
n.UserOverridableBuffer,this.m_flagsBuffer=new
n.UserOverridableBuffer,this.m_positionBuffer=new
n.UserOverridableBuffer,this.m_velocityBuffer=new
n.UserOverridableBuffer,this.m_forceBuffer=[],this.m_weightBuffer=[],this.m_staticP
ressureBuffer=[],this.m_accumulationBuffer=[],this.m_accumulation2Buffer=[],this.m_
depthBuffer=[],this.m_colorBuffer=new
n.UserOverridableBuffer,this.m_groupBuffer=[],this.m_userDataBuffer=new
n.UserOverridableBuffer,this.m_stuckThreshold=0,this.m_lastBodyContactStepBuffer=ne
w n.UserOverridableBuffer,this.m_bodyContactCountBuffer=new
n.UserOverridableBuffer,this.m_consecutiveContactStepsBuffer=new
n.UserOverridableBuffer,this.m_stuckParticleBuffer=new Rn(function(){return
0}),this.m_proxyBuffer=new Rn(function(){return new
n.Proxy}),this.m_contactBuffer=new Rn(function(){return new
Ln}),this.m_bodyContactBuffer=new Rn(function(){return new
Fn}),this.m_pairBuffer=new Rn(function(){return new Vn}),this.m_triadBuffer=new
Rn(function(){return new Nn}),this.m_expirationTimeBuffer=new
n.UserOverridableBuffer,this.m_indexByExpirationTimeBuffer=new
n.UserOverridableBuffer,this.m_timeElapsed=0,this.m_expirationTimeBufferRequiresSor
ting=!1,this.m_groupCount=0,this.m_groupList=null,this.m_def=new
kn,this.m_prev=null,this.m_next=null,this.SetStrictContactCheck(t.strictContactChec
k),this.SetDensity(t.density),this.SetGravityScale(t.gravityScale),this.SetRadius(t
.radius),this.SetMaxParticleCount(t.maxCount),this.m_def=t.Clone(),this.m_world=e,t
his.SetDestructionByAge(this.m_def.destroyByAge)}return n.computeTag=function(t,e)
{return(e+n.yOffset>>>0<<n.yShift)+
(n.xScale*t+n.xOffset>>>0)>>>0},n.computeRelativeTag=function(t,e,i){return t+
(i<<n.yShift)+(e<<n.xShift)>>>0},n.prototype.Drop=function()
{for(;this.m_groupList;)this.DestroyParticleGroup(this.m_groupList);this.FreeUserOv
erridableBuffer(this.m_handleIndexBuffer),this.FreeUserOverridableBuffer(this.m_fla
gsBuffer),this.FreeUserOverridableBuffer(this.m_lastBodyContactStepBuffer),this.Fre
eUserOverridableBuffer(this.m_bodyContactCountBuffer),this.FreeUserOverridableBuffe
r(this.m_consecutiveContactStepsBuffer),this.FreeUserOverridableBuffer(this.m_posit
ionBuffer),this.FreeUserOverridableBuffer(this.m_velocityBuffer),this.FreeUserOverr
idableBuffer(this.m_colorBuffer),this.FreeUserOverridableBuffer(this.m_userDataBuff
er),this.FreeUserOverridableBuffer(this.m_expirationTimeBuffer),this.FreeUserOverri
dableBuffer(this.m_indexByExpirationTimeBuffer),this.FreeBuffer(this.m_forceBuffer,
this.m_internalAllocatedCapacity),this.FreeBuffer(this.m_weightBuffer,this.m_intern
alAllocatedCapacity),this.FreeBuffer(this.m_staticPressureBuffer,this.m_internalAll
ocatedCapacity),this.FreeBuffer(this.m_accumulationBuffer,this.m_internalAllocatedC
apacity),this.FreeBuffer(this.m_accumulation2Buffer,this.m_internalAllocatedCapacit
y),this.FreeBuffer(this.m_depthBuffer,this.m_internalAllocatedCapacity),this.FreeBu
ffer(this.m_groupBuffer,this.m_internalAllocatedCapacity)},n.prototype.CreatePartic
le=function(t){if(this.m_world.IsLocked())throw new
Error;if(this.m_count>=this.m_internalAllocatedCapacity){var i=this.m_count?
2*this.m_count:256;this.ReallocateInternalAllocatedBuffers(i)}if(this.m_count>=this
.m_internalAllocatedCapacity){if(!this.m_def.destroyByAge)return
u;this.DestroyOldestParticle(0,!1),this.SolveZombie()}var n=this.m_count++;if(!
this.m_flagsBuffer.data)throw new
Error;if(this.m_flagsBuffer.data[n]=0,this.m_lastBodyContactStepBuffer.data&&(this.
m_lastBodyContactStepBuffer.data[n]=0),this.m_bodyContactCountBuffer.data&&(this.m_
bodyContactCountBuffer.data[n]=0),this.m_consecutiveContactStepsBuffer.data&&(this.
m_consecutiveContactStepsBuffer.data[n]=0),!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new
Error;this.m_positionBuffer.data[n]=(this.m_positionBuffer.data[n]||new
I).Copy(e(t.position,I.ZERO)),this.m_velocityBuffer.data[n]=(this.m_velocityBuffer.
data[n]||new
I).Copy(e(t.velocity,I.ZERO)),this.m_weightBuffer[n]=0,this.m_forceBuffer[n]=(this.
m_forceBuffer[n]||new
I).SetZero(),this.m_staticPressureBuffer&&(this.m_staticPressureBuffer[n]=0),this.m
_depthBuffer&&(this.m_depthBuffer[n]=0);var r=(new G).Copy(e(t.color,G.ZERO));!
this.m_colorBuffer.data&&r.IsZero()||
(this.m_colorBuffer.data=this.RequestBuffer(this.m_colorBuffer.data),this.m_colorBu
ffer.data[n]=(this.m_colorBuffer.data[n]||new G).Copy(r)),
(this.m_userDataBuffer.data||
t.userData)&&(this.m_userDataBuffer.data=this.RequestBuffer(this.m_userDataBuffer.d
ata),this.m_userDataBuffer.data[n]=t.userData),this.m_handleIndexBuffer.data&&(this
.m_handleIndexBuffer.data[n]=null);var
s=this.m_proxyBuffer.data[this.m_proxyBuffer.Append()],a=e(t.lifetime,0),o=a>0;if(t
his.m_expirationTimeBuffer.data||o){if(this.SetParticleLifetime(n,o?
a:this.ExpirationTimeToLifetime(-this.GetQuantizedTimeElapsed())),!
this.m_indexByExpirationTimeBuffer.data)throw new
Error;this.m_indexByExpirationTimeBuffer.data[n]=n}s.index=n;var
l=e(t.group,null);return this.m_groupBuffer[n]=l,l&&(l.m_firstIndex<l.m_lastIndex?
(this.RotateBuffer(l.m_firstIndex,l.m_lastIndex,n),l.m_lastIndex=n+1):
(l.m_firstIndex=n,l.m_lastIndex=n+1)),this.SetParticleFlags(n,e(t.flags,0)),n},n.pr
ototype.GetParticleHandleFromIndex=function(t)
{this.m_handleIndexBuffer.data=this.RequestBuffer(this.m_handleIndexBuffer.data);va
r e=this.m_handleIndexBuffer.data[t];return e||((e=new
gn).SetIndex(t),this.m_handleIndexBuffer.data[t]=e,e)},n.prototype.DestroyParticle=
function(e,i){if(void 0===i&&(i=!1),!this.m_flagsBuffer.data)throw new Error;var
n=t.b2ParticleFlag.b2_zombieParticle;i&&(n|
=t.b2ParticleFlag.b2_destructionListenerParticle),this.SetParticleFlags(e,this.m_fl
agsBuffer.data[e]|n)},n.prototype.DestroyOldestParticle=function(t,e){void
0===e&&(e=!1);var i=this.GetParticleCount();if(!
this.m_indexByExpirationTimeBuffer.data)throw new Error;if(!
this.m_expirationTimeBuffer.data)throw new Error;var
n=this.m_indexByExpirationTimeBuffer.data[i-
(t+1)],r=this.m_indexByExpirationTimeBuffer.data[t];this.DestroyParticle(this.m_exp
irationTimeBuffer.data[n]>0?
n:r,e)},n.prototype.DestroyParticlesInShape=function(t,e,i){void 0===i&&(i=!1);var
r=n.DestroyParticlesInShape_s_aabb;if(this.m_world.IsLocked())throw new Error;var
s=new n.DestroyParticlesInShapeCallback(this,t,e,i),a=r;return
t.ComputeAABB(a,e,0),this.m_world.QueryAABB(s,a),s.Destroyed()},n.prototype.CreateP
articleGroup=function(t){var
i=n.CreateParticleGroup_s_transform;if(this.m_world.IsLocked())throw new Error;var
r=i;r.SetPositionAngle(e(t.position,I.ZERO),e(t.angle,0));var
s=this.m_count;if(t.shape&&this.CreateParticlesWithShapeForGroup(t.shape,t,r),t.sha
pes&&this.CreateParticlesWithShapesForGroup(t.shapes,e(t.shapeCount,t.shapes.length
),t,r),t.positionData)for(var a=e(t.particleCount,t.positionData.length),o=0;o<a;o+
+){var l=t.positionData[o];this.CreateParticleForGroup(t,r,l)}var
h=this.m_count,c=new
bn(this);c.m_firstIndex=s,c.m_lastIndex=h,c.m_strength=e(t.strength,1),c.m_userData
=t.userData,c.m_transform.Copy(r),c.m_prev=null,c.m_next=this.m_groupList,this.m_gr
oupList&&(this.m_groupList.m_prev=c),this.m_groupList=c,+
+this.m_groupCount;for(o=s;o<h;o+
+)this.m_groupBuffer[o]=c;this.SetGroupFlags(c,e(t.groupFlags,0));var u=new
n.ConnectionFilter;return this.UpdateContacts(!
0),this.UpdatePairsAndTriads(s,h,u),t.group&&(this.JoinParticleGroups(t.group,c),c=
t.group),c},n.prototype.JoinParticleGroups=function(t,e)
{if(this.m_world.IsLocked())throw new
Error;this.RotateBuffer(e.m_firstIndex,e.m_lastIndex,this.m_count),this.RotateBuffe
r(t.m_firstIndex,t.m_lastIndex,e.m_firstIndex);var i=new
n.JoinParticleGroupsFilter(e.m_firstIndex);this.UpdateContacts(!
0),this.UpdatePairsAndTriads(t.m_firstIndex,e.m_lastIndex,i);for(var
r=e.m_firstIndex;r<e.m_lastIndex;r++)this.m_groupBuffer[r]=t;var s=t.m_groupFlags|
e.m_groupFlags;this.SetGroupFlags(t,s),t.m_lastIndex=e.m_lastIndex,e.m_firstIndex=e
.m_lastIndex,this.DestroyParticleGroup(e)},n.prototype.SplitParticleGroup=function(
t){this.UpdateContacts(!0);var e=d(t.GetParticleCount(),(function(t){return new
n.ParticleListNode}));n.InitializeParticleLists(t,e),this.MergeParticleListsInConta
ct(t,e);var
i=n.FindLongestParticleList(t,e);this.MergeZombieParticleListNodes(t,e,i),this.Crea
teParticleGroupsFromParticleList(t,e,i),this.UpdatePairsAndTriadsWithParticleList(t
,e)},n.prototype.GetParticleGroupList=function(){return
this.m_groupList},n.prototype.GetParticleGroupCount=function(){return
this.m_groupCount},n.prototype.GetParticleCount=function(){return
this.m_count},n.prototype.GetMaxParticleCount=function(){return
this.m_def.maxCount},n.prototype.SetMaxParticleCount=function(t)
{this.m_def.maxCount=t},n.prototype.GetAllParticleFlags=function(){return
this.m_allParticleFlags},n.prototype.GetAllGroupFlags=function(){return
this.m_allGroupFlags},n.prototype.SetPaused=function(t)
{this.m_paused=t},n.prototype.GetPaused=function(){return
this.m_paused},n.prototype.SetDensity=function(t)
{this.m_def.density=t,this.m_inverseDensity=1/this.m_def.density},n.prototype.GetDe
nsity=function(){return
this.m_def.density},n.prototype.SetGravityScale=function(t)
{this.m_def.gravityScale=t},n.prototype.GetGravityScale=function(){return
this.m_def.gravityScale},n.prototype.SetDamping=function(t)
{this.m_def.dampingStrength=t},n.prototype.GetDamping=function(){return
this.m_def.dampingStrength},n.prototype.SetStaticPressureIterations=function(t)
{this.m_def.staticPressureIterations=t},n.prototype.GetStaticPressureIterations=fun
ction(){return
this.m_def.staticPressureIterations},n.prototype.SetRadius=function(t)
{this.m_particleDiameter=2*t,this.m_squaredDiameter=this.m_particleDiameter*this.m_
particleDiameter,this.m_inverseDiameter=1/this.m_particleDiameter},n.prototype.GetR
adius=function(){return
this.m_particleDiameter/2},n.prototype.GetPositionBuffer=function(){if(!
this.m_positionBuffer.data)throw new Error;return
this.m_positionBuffer.data},n.prototype.GetVelocityBuffer=function(){if(!
this.m_velocityBuffer.data)throw new Error;return
this.m_velocityBuffer.data},n.prototype.GetColorBuffer=function(){return
this.m_colorBuffer.data=this.RequestBuffer(this.m_colorBuffer.data),this.m_colorBuf
fer.data},n.prototype.GetGroupBuffer=function(){return
this.m_groupBuffer},n.prototype.GetWeightBuffer=function(){return
this.m_weightBuffer},n.prototype.GetUserDataBuffer=function(){return
this.m_userDataBuffer.data=this.RequestBuffer(this.m_userDataBuffer.data),this.m_us
erDataBuffer.data},n.prototype.GetFlagsBuffer=function(){if(!
this.m_flagsBuffer.data)throw new Error;return
this.m_flagsBuffer.data},n.prototype.SetParticleFlags=function(e,i){if(!
this.m_flagsBuffer.data)throw new
Error;this.m_flagsBuffer.data[e]&~i&&(this.m_needsUpdateAllParticleFlags=!
0),~this.m_allParticleFlags&i&&(i&t.b2ParticleFlag.b2_tensileParticle&&(this.m_accu
mulation2Buffer=this.RequestBuffer(this.m_accumulation2Buffer)),i&t.b2ParticleFlag.
b2_colorMixingParticle&&(this.m_colorBuffer.data=this.RequestBuffer(this.m_colorBuf
fer.data)),this.m_allParticleFlags|
=i),this.m_flagsBuffer.data[e]=i},n.prototype.GetParticleFlags=function(t){if(!
this.m_flagsBuffer.data)throw new Error;return
this.m_flagsBuffer.data[t]},n.prototype.SetFlagsBuffer=function(t,e)
{this.SetUserOverridableBuffer(this.m_flagsBuffer,t,e)},n.prototype.SetPositionBuff
er=function(t,e)
{this.SetUserOverridableBuffer(this.m_positionBuffer,t,e)},n.prototype.SetVelocityB
uffer=function(t,e)
{this.SetUserOverridableBuffer(this.m_velocityBuffer,t,e)},n.prototype.SetColorBuff
er=function(t,e)
{this.SetUserOverridableBuffer(this.m_colorBuffer,t,e)},n.prototype.SetUserDataBuff
er=function(t,e)
{this.SetUserOverridableBuffer(this.m_userDataBuffer,t,e)},n.prototype.GetContacts=
function(){return this.m_contactBuffer.data},n.prototype.GetContactCount=function()
{return this.m_contactBuffer.count},n.prototype.GetBodyContacts=function(){return
this.m_bodyContactBuffer.data},n.prototype.GetBodyContactCount=function(){return
this.m_bodyContactBuffer.count},n.prototype.GetPairs=function(){return
this.m_pairBuffer.data},n.prototype.GetPairCount=function(){return
this.m_pairBuffer.count},n.prototype.GetTriads=function(){return
this.m_triadBuffer.data},n.prototype.GetTriadCount=function(){return
this.m_triadBuffer.count},n.prototype.SetStuckThreshold=function(t)
{this.m_stuckThreshold=t,t>0&&(this.m_lastBodyContactStepBuffer.data=this.RequestBu
ffer(this.m_lastBodyContactStepBuffer.data),this.m_bodyContactCountBuffer.data=this
.RequestBuffer(this.m_bodyContactCountBuffer.data),this.m_consecutiveContactStepsBu
ffer.data=this.RequestBuffer(this.m_consecutiveContactStepsBuffer.data))},n.prototy
pe.GetStuckCandidates=function(){return
this.m_stuckParticleBuffer.Data()},n.prototype.GetStuckCandidateCount=function()
{return
this.m_stuckParticleBuffer.GetCount()},n.prototype.ComputeCollisionEnergy=function(
){if(!this.m_velocityBuffer.data)throw new Error;for(var
t=n.ComputeCollisionEnergy_s_v,e=this.m_velocityBuffer.data,i=0,r=0;r<this.m_contac
tBuffer.count;r++){var
s=this.m_contactBuffer.data[r],a=s.indexA,o=s.indexB,l=s.normal,h=I.SubVV(e[o],e[a]
,t),c=I.DotVV(h,l);c<0&&(i+=c*c)}return.5*this.GetParticleMass()*i},n.prototype.Set
StrictContactCheck=function(t)
{this.m_def.strictContactCheck=t},n.prototype.GetStrictContactCheck=function()
{return
this.m_def.strictContactCheck},n.prototype.SetParticleLifetime=function(t,e){var
i=null===this.m_indexByExpirationTimeBuffer.data;if(this.m_expirationTimeBuffer.dat
a=this.RequestBuffer(this.m_expirationTimeBuffer.data),this.m_indexByExpirationTime
Buffer.data=this.RequestBuffer(this.m_indexByExpirationTimeBuffer.data),i)for(var
n=this.GetParticleCount(),r=0;r<n;+
+r)this.m_indexByExpirationTimeBuffer.data[r]=r;var
s=e/this.m_def.lifetimeGranularity,a=s>0?this.GetQuantizedTimeElapsed()+s:s;a!
==this.m_expirationTimeBuffer.data[t]&&(this.m_expirationTimeBuffer.data[t]=a,this.
m_expirationTimeBufferRequiresSorting=!
0)},n.prototype.GetParticleLifetime=function(t){return
this.ExpirationTimeToLifetime(this.GetExpirationTimeBuffer()
[t])},n.prototype.SetDestructionByAge=function(t)
{t&&this.GetExpirationTimeBuffer(),this.m_def.destroyByAge=t},n.prototype.GetDestru
ctionByAge=function(){return
this.m_def.destroyByAge},n.prototype.GetExpirationTimeBuffer=function(){return
this.m_expirationTimeBuffer.data=this.RequestBuffer(this.m_expirationTimeBuffer.dat
a),this.m_expirationTimeBuffer.data},n.prototype.ExpirationTimeToLifetime=function(
t){return(t>0?t-
this.GetQuantizedTimeElapsed():t)*this.m_def.lifetimeGranularity},n.prototype.GetIn
dexByExpirationTimeBuffer=function(){if(this.GetParticleCount()?
this.SetParticleLifetime(0,this.GetParticleLifetime(0)):this.m_indexByExpirationTim
eBuffer.data=this.RequestBuffer(this.m_indexByExpirationTimeBuffer.data),!
this.m_indexByExpirationTimeBuffer.data)throw new Error;return
this.m_indexByExpirationTimeBuffer.data},n.prototype.ParticleApplyLinearImpulse=fun
ction(t,e)
{this.ApplyLinearImpulse(t,t+1,e)},n.prototype.ApplyLinearImpulse=function(t,e,i)
{if(!this.m_velocityBuffer.data)throw new Error;for(var
n=this.m_velocityBuffer.data,r=(e-t)*this.GetParticleMass(),s=(new
I).Copy(i).SelfMul(1/r),a=t;a<e;a+
+)n[a].SelfAdd(s)},n.IsSignificantForce=function(t){return 0!==t.x||0!
==t.y},n.prototype.ParticleApplyForce=function(t,e){if(!
this.m_flagsBuffer.data)throw new
Error;n.IsSignificantForce(e)&&this.ForceCanBeApplied(this.m_flagsBuffer.data[t])&&
(this.PrepareForceBuffer(),this.m_forceBuffer[t].SelfAdd(e))},n.prototype.ApplyForc
e=function(t,e,i){var r=(new I).Copy(i).SelfMul(1/(e-
t));if(n.IsSignificantForce(r)){this.PrepareForceBuffer();for(var s=t;s<e;s+
+)this.m_forceBuffer[s].SelfAdd(r)}},n.prototype.GetNext=function(){return
this.m_next},n.prototype.QueryAABB=function(t,e){if(0!==this.m_proxyBuffer.count)
{var
i=this.m_proxyBuffer.count,r=Dn(this.m_proxyBuffer.data,0,i,n.computeTag(this.m_inv
erseDiameter*e.lowerBound.x,this.m_inverseDiameter*e.lowerBound.y),n.Proxy.CompareP
roxyTag),s=Bn(this.m_proxyBuffer.data,r,i,n.computeTag(this.m_inverseDiameter*e.upp
erBound.x,this.m_inverseDiameter*e.upperBound.y),n.Proxy.CompareTagProxy);if(!
this.m_positionBuffer.data)throw new Error;for(var
a=this.m_positionBuffer.data,o=r;o<s;++o){var
l=this.m_proxyBuffer.data[o].index,h=a[l];if(e.lowerBound.x<h.x&&h.x<e.upperBound.x
&&e.lowerBound.y<h.y&&h.y<e.upperBound.y&&!
t.ReportParticle(this,l))break}}},n.prototype.QueryShapeAABB=function(t,e,i,r){void
0===r&&(r=0);var
s=n.QueryShapeAABB_s_aabb;e.ComputeAABB(s,i,r),this.QueryAABB(t,s)},n.prototype.Que
ryPointAABB=function(t,e,i){void 0===i&&(i=l);var
r=n.QueryPointAABB_s_aabb;r.lowerBound.Set(e.x-i,e.y-
i),r.upperBound.Set(e.x+i,e.y+i),this.QueryAABB(t,r)},n.prototype.RayCast=function(
t,e,i){var
r=n.RayCast_s_aabb,s=n.RayCast_s_p,a=n.RayCast_s_v,o=n.RayCast_s_n,l=n.RayCast_s_po
int;if(0!==this.m_proxyBuffer.count){if(!this.m_positionBuffer.data)throw new
Error;var
h=this.m_positionBuffer.data,c=r;I.MinV(e,i,c.lowerBound),I.MaxV(e,i,c.upperBound);
for(var u,_=1,f=I.SubVV(i,e,a),d=I.DotVV(f,f),m=this.GetInsideBoundsEnumerator(c);
(u=m.GetNext())>=0;){var p=I.SubVV(e,h[u],s),v=I.DotVV(p,f),y=v*v-d*(I.DotVV(p,p)-
this.m_squaredDiameter);if(y>=0){var x=T(y),b=(-v-
x)/d;if(b>_)continue;if(b<0&&((b=(-v+x)/d)<0||b>_))continue;var
A=I.AddVMulSV(p,b,f,o);A.Normalize();var
C=t.ReportParticle(this,u,I.AddVMulSV(e,b,f,l),A,b);if((_=g(_,C))<=0)break}}}},n.pr
ototype.ComputeAABB=function(t){var
e=this.GetParticleCount();if(t.lowerBound.x=+i,t.lowerBound.y=+i,t.upperBound.x=-
i,t.upperBound.y=-i,!this.m_positionBuffer.data)throw new Error;for(var
n=this.m_positionBuffer.data,r=0;r<e;r++){var
s=n[r];I.MinV(t.lowerBound,s,t.lowerBound),I.MaxV(t.upperBound,s,t.upperBound)}t.lo
werBound.x-=this.m_particleDiameter,t.lowerBound.y-
=this.m_particleDiameter,t.upperBound.x+=this.m_particleDiameter,t.upperBound.y+=th
is.m_particleDiameter},n.prototype.FreeBuffer=function(t,e){null!
==t&&(t.length=0)},n.prototype.FreeUserOverridableBuffer=function(t)
{0===t.userSuppliedCapacity&&this.FreeBuffer(t.data,this.m_internalAllocatedCapacit
y)},n.prototype.ReallocateBuffer3=function(t,e,i){if(i<=e)throw new Error;var n=t?
t.slice():[];return n.length=i,n},n.prototype.ReallocateBuffer5=function(t,e,i,n,r)
{if(n<=i)throw new Error;if(e&&!(n<=e))throw new Error;return r&&!t||e||
(t=this.ReallocateBuffer3(t,i,n)),t},n.prototype.ReallocateBuffer4=function(t,e,i,n
){return
this.ReallocateBuffer5(t.data,t.userSuppliedCapacity,e,i,n)},n.prototype.RequestBuf
fer=function(t){return t||
(0===this.m_internalAllocatedCapacity&&this.ReallocateInternalAllocatedBuffers(256)
,
(t=[]).length=this.m_internalAllocatedCapacity),t},n.prototype.ReallocateHandleBuff
ers=function(t)
{this.m_handleIndexBuffer.data=this.ReallocateBuffer4(this.m_handleIndexBuffer,this
.m_internalAllocatedCapacity,t,!
0)},n.prototype.ReallocateInternalAllocatedBuffers=function(t){function e(t,e)
{return e&&t>e?
e:t}if(t=e(t=e(t=e(t=e(t=e(t=e(t,this.m_def.maxCount),this.m_flagsBuffer.userSuppli
edCapacity),this.m_positionBuffer.userSuppliedCapacity),this.m_velocityBuffer.userS
uppliedCapacity),this.m_colorBuffer.userSuppliedCapacity),this.m_userDataBuffer.use
rSu
ppliedCapacity),this.m_internalAllocatedCapacity<t)
{this.ReallocateHandleBuffers(t),this.m_flagsBuffer.data=this.ReallocateBuffer4(thi
s.m_flagsBuffer,this.m_internalAllocatedCapacity,t,!1);var
i=this.m_stuckThreshold>0;this.m_lastBodyContactStepBuffer.data=this.ReallocateBuff
er4(this.m_lastBodyContactStepBuffer,this.m_internalAllocatedCapacity,t,i),this.m_b
odyContactCountBuffer.data=this.ReallocateBuffer4(this.m_bodyContactCountBuffer,thi
s.m_internalAllocatedCapacity,t,i),this.m_consecutiveContactStepsBuffer.data=this.R
eallocateBuffer4(this.m_consecutiveContactStepsBuffer,this.m_internalAllocatedCapac
ity,t,i),this.m_positionBuffer.data=this.ReallocateBuffer4(this.m_positionBuffer,th
is.m_internalAllocatedCapacity,t,!
1),this.m_velocityBuffer.data=this.ReallocateBuffer4(this.m_velocityBuffer,this.m_i
nternalAllocatedCapacity,t,!
1),this.m_forceBuffer=this.ReallocateBuffer5(this.m_forceBuffer,0,this.m_internalAl
locatedCapacity,t,!
1),this.m_weightBuffer=this.ReallocateBuffer5(this.m_weightBuffer,0,this.m_internal
AllocatedCapacity,t,!
1),this.m_staticPressureBuffer=this.ReallocateBuffer5(this.m_staticPressureBuffer,0
,this.m_internalAllocatedCapacity,t,!
0),this.m_accumulationBuffer=this.ReallocateBuffer5(this.m_accumulationBuffer,0,thi
s.m_internalAllocatedCapacity,t,!
1),this.m_accumulation2Buffer=this.ReallocateBuffer5(this.m_accumulation2Buffer,0,t
his.m_internalAllocatedCapacity,t,!
0),this.m_depthBuffer=this.ReallocateBuffer5(this.m_depthBuffer,0,this.m_internalAl
locatedCapacity,t,!
0),this.m_colorBuffer.data=this.ReallocateBuffer4(this.m_colorBuffer,this.m_interna
lAllocatedCapacity,t,!
0),this.m_groupBuffer=this.ReallocateBuffer5(this.m_groupBuffer,0,this.m_internalAl
locatedCapacity,t,!
1),this.m_userDataBuffer.data=this.ReallocateBuffer4(this.m_userDataBuffer,this.m_i
nternalAllocatedCapacity,t,!
0),this.m_expirationTimeBuffer.data=this.ReallocateBuffer4(this.m_expirationTimeBuf
fer,this.m_internalAllocatedCapacity,t,!
0),this.m_indexByExpirationTimeBuffer.data=this.ReallocateBuffer4(this.m_indexByExp
irationTimeBuffer,this.m_internalAllocatedCapacity,t,!
1),this.m_internalAllocatedCapacity=t}},n.prototype.CreateParticleForGroup=function
(t,i,n){var r=new
vn;r.flags=e(t.flags,0),N.MulXV(i,n,r.position),I.AddVV(e(t.linearVelocity,I.ZERO),
I.CrossSV(e(t.angularVelocity,0),I.SubVV(r.position,e(t.position,I.ZERO),I.s_t0),I.
s_t0),r.velocity),r.color.Copy(e(t.color,G.ZERO)),r.lifetime=e(t.lifetime,0),r.user
Data=t.userData,this.CreateParticle(r)},n.prototype.CreateParticlesStrokeShapeForGr
oup=function(i,r,s){var
a=n.CreateParticlesStrokeShapeForGroup_s_edge,o=n.CreateParticlesStrokeShapeForGrou
p_s_d,l=n.CreateParticlesStrokeShapeForGroup_s_p,h=e(r.stride,0);0===h&&(h=this.Get
ParticleStride());for(var c=0,u=i.GetChildCount(),_=0;_<u;_++){var
f=null;i.GetType()===t.b2ShapeType.e_edgeShape?f=i:
(f=a,i.GetChildEdge(f,_));for(var
d=I.SubVV(f.m_vertex2,f.m_vertex1,o),m=d.Length();c<m;){var
p=I.AddVMulSV(f.m_vertex1,c/m,d,l);this.CreateParticleForGroup(r,s,p),c+=h}c-
=m}},n.prototype.CreateParticlesFillShapeForGroup=function(t,i,r){var
s=n.CreateParticlesFillShapeForGroup_s_aabb,a=n.CreateParticlesFillShapeForGroup_s_
p,o=e(i.stride,0);0===o&&(o=this.GetParticleStride());var
l=N.IDENTITY,h=s;t.ComputeAABB(h,l,0);for(var
c=Math.floor(h.lowerBound.y/o)*o;c<h.upperBound.y;c+=o)for(var
u=Math.floor(h.lowerBound.x/o)*o;u<h.upperBound.x;u+=o){var
_=a.Set(u,c);t.TestPoint(l,_)&&this.CreateParticleForGroup(i,r,_)}},n.prototype.Cre
ateParticlesWithShapeForGroup=function(e,i,n){switch(e.GetType()){case
t.b2ShapeType.e_edgeShape:case
t.b2ShapeType.e_chainShape:this.CreateParticlesStrokeShapeForGroup(e,i,n);break;cas
e t.b2ShapeType.e_polygonShape:case
t.b2ShapeType.e_circleShape:this.CreateParticlesFillShapeForGroup(e,i,n)}},n.protot
ype.CreateParticlesWithShapesForGroup=function(t,e,i,r){var s=new
n.CompositeShape(t,e);this.CreateParticlesFillShapeForGroup(s,i,r)},n.prototype.Clo
neParticle=function(t,e){var i=new vn;if(!this.m_flagsBuffer.data)throw new
Error;if(!this.m_positionBuffer.data)throw new Error;if(!
this.m_velocityBuffer.data)throw new
Error;i.flags=this.m_flagsBuffer.data[t],i.position.Copy(this.m_positionBuffer.data
[t]),i.velocity.Copy(this.m_velocityBuffer.data[t]),this.m_colorBuffer.data&&i.colo
r.Copy(this.m_colorBuffer.data[t]),this.m_userDataBuffer.data&&(i.userData=this.m_u
serDataBuffer.data[t]),i.group=e;var
n=this.CreateParticle(i);if(this.m_handleIndexBuffer.data){var
r=this.m_handleIndexBuffer.data[t];r&&r.SetIndex(n),this.m_handleIndexBuffer.data[n
]=r,this.m_handleIndexBuffer.data[t]=null}return
this.m_lastBodyContactStepBuffer.data&&(this.m_lastBodyContactStepBuffer.data[n]=th
is.m_lastBodyContactStepBuffer.data[t]),this.m_bodyContactCountBuffer.data&&(this.m
_bodyContactCountBuffer.data[n]=this.m_bodyContactCountBuffer.data[t]),this.m_conse
cutiveContactStepsBuffer.data&&(this.m_consecutiveContactStepsBuffer.data[n]=this.m
_consecutiveContactStepsBuffer.data[t]),this.m_hasForce&&this.m_forceBuffer[n].Copy
(this.m_forceBuffer[t]),this.m_staticPressureBuffer&&(this.m_staticPressureBuffer[n
]=this.m_staticPressureBuffer[t]),this.m_depthBuffer&&(this.m_depthBuffer[n]=this.m
_depthBuffer[t]),this.m_expirationTimeBuffer.data&&(this.m_expirationTimeBuffer.dat
a[n]=this.m_expirationTimeBuffer.data[t]),n},n.prototype.DestroyParticlesInGroup=fu
nction(t,e){void 0===e&&(e=!1);for(var i=t.m_firstIndex;i<t.m_lastIndex;i+
+)this.DestroyParticle(i,e)},n.prototype.DestroyParticleGroup=function(t)
{this.m_world.m_destructionListener&&this.m_world.m_destructionListener.SayGoodbyeP
articleGroup(t),this.SetGroupFlags(t,0);for(var e=t.m_firstIndex;e<t.m_lastIndex;e+
+)this.m_groupBuffer[e]=null;t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_ne
xt.m_prev=t.m_prev),t===this.m_groupList&&(this.m_groupList=t.m_next),--
this.m_groupCount},n.ParticleCanBeConnected=function(e,i){return 0!
=(e&(t.b2ParticleFlag.b2_wallParticle|t.b2ParticleFlag.b2_springParticle|
t.b2ParticleFlag.b2_elasticParticle))||null!==i&&0!
=(i.GetGroupFlags()&t.b2ParticleGroupFlag.b2_rigidParticleGroup)},n.prototype.Updat
ePairsAndTriads=function(e,i,r){var
s=n.UpdatePairsAndTriads_s_dab,a=n.UpdatePairsAndTriads_s_dbc,o=n.UpdatePairsAndTri
ads_s_dca;if(!this.m_flagsBuffer.data)throw new Error;if(!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;for(var l=this.m_positionBuffer.data,h=0,c=e;c<i;c++)h|
=this.m_flagsBuffer.data[c];if(h&n.k_pairFlags)for(var
u=0;u<this.m_contactBuffer.count;u++){var
_=this.m_contactBuffer.data[u],f=_.indexA,d=_.indexB,m=this.m_flagsBuffer.data[f],p
=this.m_flagsBuffer.data[d],v=this.m_groupBuffer[f],y=this.m_groupBuffer[d];if(f>=e
&&f<i&&d>=e&&d<i&&!((m|p)&t.b2ParticleFlag.b2_zombieParticle)&&(m|
p)&n.k_pairFlags&&(r.IsNecessary(f)||
r.IsNecessary(d))&&n.ParticleCanBeConnected(m,v)&&n.ParticleCanBeConnected(p,y)&&r.
ShouldCreatePair(f,d)){var
x=this.m_pairBuffer.data[this.m_pairBuffer.Append()];x.indexA=f,x.indexB=d,x.flags=
_.flags,x.strength=g(v?v.m_strength:1,y?
y.m_strength:1),x.distance=I.DistanceVV(l[f],l[d])}En(this.m_pairBuffer.data,0,this
.m_pairBuffer.count,n.ComparePairIndices),this.m_pairBuffer.Unique(n.MatchPairIndic
es)}if(h&n.k_triadFlags){var b=new Cn(i-e);for(c=e;c<i;c++){var
A=this.m_flagsBuffer.data[c],C=this.m_groupBuffer[c];A&t.b2ParticleFlag.b2_zombiePa
rticle||!n.ParticleCanBeConnected(A,C)||b.AddGenerator(l[c],c,r.IsNecessary(c))}var
S=this.GetParticleStride();b.Generate(S/2,2*S);var
T=this;b.GetNodes((function(t,e,i){if(!T.m_flagsBuffer.data)throw new Error;var
h=T.m_flagsBuffer.data[t],c=T.m_flagsBuffer.data[e],u=T.m_flagsBuffer.data[i];if((h
|c|u)&n.k_triadFlags&&r.ShouldCreateTriad(t,e,i)){var
_=l[t],f=l[e],d=l[i],m=I.SubVV(_,f,s),p=I.SubVV(f,d,a),v=I.SubVV(d,_,o),y=4*T.m_squ
aredDiameter;if(I.DotVV(m,m)>y||I.DotVV(p,p)>y||I.DotVV(v,v)>y)return;var
x=T.m_groupBuffer[t],b=T.m_groupBuffer[e],A=T.m_groupBuffer[i],C=T.m_triadBuffer.da
ta[T.m_triadBuffer.Append()];C.indexA=t,C.indexB=e,C.indexC=i,C.flags=h|c|
u,C.strength=g(g(x?x.m_strength:1,b?b.m_strength:1),A?A.m_strength:1);var
S=(_.x+f.x+d.x)/3,w=(_.y+f.y+d.y)/3;C.pa.x=_.x-S,C.pa.y=_.y-w,C.pb.x=f.x-
S,C.pb.y=f.y-w,C.pc.x=d.x-S,C.pc.y=d.y-w,C.ka=-I.DotVV(v,m),C.kb=-
I.DotVV(m,p),C.kc=-I.DotVV(p,v),C.s=I.CrossVV(_,f)+I.CrossVV(f,d)
+I.CrossVV(d,_)}})),En(this.m_triadBuffer.data,0,this.m_triadBuffer.count,n.Compare
TriadIndices),this.m_triadBuffer.Unique(n.MatchTriadIndices)}},n.prototype.UpdatePa
irsAndTriadsWithReactiveParticles=function(){var e=new
n.ReactiveFilter(this.m_flagsBuffer);if(this.UpdatePairsAndTriads(0,this.m_count,e)
,!this.m_flagsBuffer.data)throw new Error;for(var i=0;i<this.m_count;i+
+)this.m_flagsBuffer.data[i]&=~t.b2ParticleFlag.b2_reactiveParticle;this.m_allParti
cleFlags&=~t.b2ParticleFlag.b2_reactiveParticle},n.ComparePairIndices=function(t,e)
{var i=t.indexA-e.indexA;return 0!==i?
i<0:t.indexB<e.indexB},n.MatchPairIndices=function(t,e){return
t.indexA===e.indexA&&t.indexB===e.indexB},n.CompareTriadIndices=function(t,e){var
i=t.indexA-e.indexA;if(0!==i)return i<0;var n=t.indexB-e.indexB;return 0!==n?
n<0:t.indexC<e.indexC},n.MatchTriadIndices=function(t,e){return
t.indexA===e.indexA&&t.indexB===e.indexB&&t.indexC===e.indexC},n.InitializeParticle
Lists=function(t,e){for(var i=t.GetBufferIndex(),n=t.GetParticleCount(),r=0;r<n;r+
+){var
s=e[r];s.list=s,s.next=null,s.count=1,s.index=r+i}},n.prototype.MergeParticleListsI
nContact=function(t,e){for(var
i=t.GetBufferIndex(),r=0;r<this.m_contactBuffer.count;r++){var
s=this.m_contactBuffer.data[r],a=s.indexA,o=s.indexB;if(t.ContainsParticle(a)&&t.Co
ntainsParticle(o)){var l=e[a-i].list,h=e[o-i].list;if(l!==h){if(l.count<h.count)
{var c=l;l=h,h=c}n.MergeParticleLists(l,h)}}}},n.MergeParticleLists=function(t,e)
{for(var i=e;;){i.list=t;var n=i.next;if(!n)
{i.next=t.next;break}i=n}t.next=e,t.count+=e.count,e.count=0},n.FindLongestParticle
List=function(t,e){for(var i=t.GetParticleCount(),n=e[0],r=0;r<i;r++){var
s=e[r];n.count<s.count&&(n=s)}return
n},n.prototype.MergeZombieParticleListNodes=function(e,i,r){if(!
this.m_flagsBuffer.data)throw new Error;for(var s=e.GetParticleCount(),a=0;a<s;a++)
{var o=i[a];o!
==r&&this.m_flagsBuffer.data[o.index]&t.b2ParticleFlag.b2_zombieParticle&&n.MergePa
rticleListAndNode(r,o)}},n.MergeParticleListAndNode=function(t,e)
{e.list=t,e.next=t.next,t.next=e,t.count+
+,e.count=0},n.prototype.CreateParticleGroupsFromParticleList=function(e,i,n){if(!
this.m_flagsBuffer.data)throw new Error;var r=e.GetParticleCount(),s=new
xn;s.groupFlags=e.GetGroupFlags(),s.userData=e.GetUserData();for(var a=0;a<r;a++)
{var o=i[a];if(o.count&&o!==n)for(var l=this.CreateParticleGroup(s),h=o;h;h=h.next)
{var c=h.index,u=this.CloneParticle(c,l);this.m_flagsBuffer.data[c]|
=t.b2ParticleFlag.b2_zombieParticle,h.index=u}}},n.prototype.UpdatePairsAndTriadsWi
thParticleList=function(t,e){for(var
i=t.GetBufferIndex(),n=0;n<this.m_pairBuffer.count;n++){var
r=this.m_pairBuffer.data[n],s=r.indexA,a=r.indexB;t.ContainsParticle(s)&&(r.indexA=
e[s-i].index),t.ContainsParticle(a)&&(r.indexB=e[a-
i].index)}for(n=0;n<this.m_triadBuffer.count;n++){var
o=this.m_triadBuffer.data[n],l=(s=o.indexA,a=o.indexB,o.indexC);t.ContainsParticle(
s)&&(o.indexA=e[s-i].index),t.ContainsParticle(a)&&(o.indexB=e[a-
i].index),t.ContainsParticle(l)&&(o.indexC=e[l-
i].index)}},n.prototype.ComputeDepth=function(){for(var
e=[],n=0,r=0;r<this.m_contactBuffer.count;r++){var
s=(y=this.m_contactBuffer.data[r]).indexA,a=y.indexB,o=this.m_groupBuffer[s],l=this
.m_groupBuffer[a];o&&o===l&&o.m_groupFlags&t.b2ParticleGroupFlag.b2_particleGroupNe
edsUpdateDepth&&(e[n++]=y)}for(var
h=[],c=0,u=this.m_groupList;u;u=u.GetNext())if(u.m_groupFlags&t.b2ParticleGroupFlag
.b2_particleGroupNeedsUpdateDepth){h[c+
+]=u,this.SetGroupFlags(u,u.m_groupFlags&~t.b2ParticleGroupFlag.b2_particleGroupNee
dsUpdateDepth);for(var _=u.m_firstIndex;_<u.m_lastIndex;_+
+)this.m_accumulationBuffer[_]=0}for(r=0;r<n;r++){s=(y=e[r]).indexA,a=y.indexB;var
f=y.weight;this.m_accumulationBuffer[s]+=f,this.m_accumulationBuffer[a]
+=f}for(_=0;_<c;_++)for(var d=(u=h[_]).m_firstIndex;d<u.m_lastIndex;d++)
{f=this.m_accumulationBuffer[d];this.m_depthBuffer[d]=f<.8?0:i}for(var
m=T(this.m_count)>>0,p=0;p<m;p++){var v=!1;for(r=0;r<n;r++)
{s=(y=e[r]).indexA,a=y.indexB;var y,g=1-
y.weight,x=this.m_depthBuffer[s],b=this.m_depthBuffer[a],A=b+g,C=x+g;x>A&&(this.m_d
epthBuffer[s]=A,v=!0),b>C&&(this.m_depthBuffer[a]=C,v=!0)}if(!
v)break}for(_=0;_<c;_++)for(var S=(u=h[_]).m_firstIndex;S<u.m_lastIndex;S+
+)this.m_depthBuffer[S]<i?
this.m_depthBuffer[S]*=this.m_particleDiameter:this.m_depthBuffer[S]=0},n.prototype
.GetInsideBoundsEnumerator=function(t){var
e=n.computeTag(this.m_inverseDiameter*t.lowerBound.x-
1,this.m_inverseDiameter*t.lowerBound.y-
1),i=n.computeTag(this.m_inverseDiameter*t.upperBound.x+1,this.m_inverseDiameter*t.
upperBound.y+1),r=this.m_proxyBuffer.count,s=Dn(this.m_proxyBuffer.data,0,r,e,n.Pro
xy.CompareProxyTag),a=Bn(this.m_proxyBuffer.data,0,r,i,n.Proxy.CompareTagProxy);ret
urn new
n.InsideBoundsEnumerator(this,e,i,s,a)},n.prototype.UpdateAllParticleFlags=function
(){if(!this.m_flagsBuffer.data)throw new Error;this.m_allParticleFlags=0;for(var
t=0;t<this.m_count;t++)this.m_allParticleFlags|
=this.m_flagsBuffer.data[t];this.m_needsUpdateAllParticleFlags=!
1},n.prototype.UpdateAllGroupFlags=function(){this.m_allGroupFlags=0;for(var
t=this.m_groupList;t;t=t.GetNext())this.m_allGroupFlags|
=t.m_groupFlags;this.m_needsUpdateAllGroupFlags=!
1},n.prototype.AddContact=function(t,e,i){if(!this.m_flagsBuffer.data)throw new
Error;if(!this.m_positionBuffer.data)throw new Error;var
r=n.AddContact_s_d,s=this.m_positionBuffer.data,a=I.SubVV(s[e],s[t],r),o=I.DotVV(a,
a);if(o<this.m_squaredDiameter){var l=S(o);isFinite(l)||(l=198177537e11);var
h=this.m_contactBuffer.data[this.m_contactBuffer.Append()];h.indexA=t,h.indexB=e,h.
flags=this.m_flagsBuffer.data[t]|this.m_flagsBuffer.data[e],h.weight=1-
o*l*this.m_inverseDiameter,I.MulSV(l,a,h.normal)}},n.prototype.FindContacts_Referen
ce=function(t){var e=this.m_proxyBuffer.count;this.m_contactBuffer.count=0;for(var
i=0,r=0;i<e;i++){for(var
s=n.computeRelativeTag(this.m_proxyBuffer.data[i].tag,1,0),a=i+1;a<e&&!
(s<this.m_proxyBuffer.data[a].tag);a+
+)this.AddContact(this.m_proxyBuffer.data[i].index,this.m_proxyBuffer.data[a].index
,this.m_contactBuffer);for(var
o=n.computeRelativeTag(this.m_proxyBuffer.data[i].tag,-1,1);r<e&&!
(o<=this.m_proxyBuffer.data[r].tag);r++);var
l=n.computeRelativeTag(this.m_proxyBuffer.data[i].tag,1,1);for(a=r;a<e&&!
(l<this.m_proxyBuffer.data[a].tag);a+
+)this.AddContact(this.m_proxyBuffer.data[i].index,this.m_proxyBuffer.data[a].index
,this.m_contactBuffer)}},n.prototype.FindContacts=function(t)
{this.FindContacts_Reference(t)},n.prototype.UpdateProxies_Reference=function(t)
{if(!this.m_positionBuffer.data)throw new Error;for(var
e=this.m_positionBuffer.data,i=this.m_inverseDiameter,r=0;r<this.m_proxyBuffer.coun
t;++r){var
s=this.m_proxyBuffer.data[r],a=e[s.index];s.tag=n.computeTag(i*a.x,i*a.y)}},n.proto
type.UpdateProxies=function(t)
{this.UpdateProxies_Reference(t)},n.prototype.SortProxies=function(t)
{wn(this.m_proxyBuffer.data,0,this.m_proxyBuffer.count,n.Proxy.CompareProxyProxy)},
n.prototype.FilterContacts=function(e){var
i=this.GetParticleContactFilter();if(null!==i){var
n=this;this.m_contactBuffer.RemoveIf((function(e){return 0!
=(e.flags&t.b2ParticleFlag.b2_particleContactFilterParticle)&&!
i.ShouldCollideParticleParticle(n,e.indexA,e.indexB)}))}},n.prototype.NotifyContact
ListenerPreContact=function(t){if(null!==this.GetParticleContactListener())throw
t.Initialize(this.m_contactBuffer,this.m_flagsBuffer),new
Error},n.prototype.NotifyContactListenerPostContact=function(t){var
e=this.GetParticleContactListener();if(null!==e){for(var
i=0;i<this.m_contactBuffer.count;++i){var
n=this.m_contactBuffer.data[i];e.BeginContactParticleParticle(this,n)}throw new
Error}},n.b2ParticleContactIsZombie=function(e)
{return(e.flags&t.b2ParticleFlag.b2_zombieParticle)===t.b2ParticleFlag.b2_zombiePar
ticle},n.prototype.UpdateContacts=function(t)
{this.UpdateProxies(this.m_proxyBuffer),this.SortProxies(this.m_proxyBuffer);var
e=new
n.b2ParticlePairSet;this.NotifyContactListenerPreContact(e),this.FindContacts(this.
m_contactBuffer),this.FilterContacts(this.m_contactBuffer),this.NotifyContactListen
erPostContact(e),t&&this.m_contactBuffer.RemoveIf(n.b2ParticleContactIsZombie)},n.p
rototype.NotifyBodyContactListenerPreContact=function(t){if(null!
==this.GetFixtureContactListener())throw
t.Initialize(this.m_bodyContactBuffer,this.m_flagsBuffer),new
Error},n.prototype.NotifyBodyContactListenerPostContact=function(t){var
e=this.GetFixtureContactListener();if(null!==e){for(var
i=0;i<this.m_bodyContactBuffer.count;i++){var
n=this.m_bodyContactBuffer.data[i];e.BeginContactFixtureParticle(this,n)}throw new
Error}},n.prototype.UpdateBodyContacts=function(){var
t=n.UpdateBodyContacts_s_aabb,e=new
n.FixtureParticleSet;if(this.NotifyBodyContactListenerPreContact(e),this.m_stuckThr
eshold>0){if(!this.m_bodyContactCountBuffer.data)throw new Error;if(!
this.m_lastBodyContactStepBuffer.data)throw new Error;if(!
this.m_consecutiveContactStepsBuffer.data)throw new Error;for(var
i=this.GetParticleCount(),r=0;r<i;r+
+)this.m_bodyContactCountBuffer.data[r]=0,this.m_timestamp>this.m_lastBodyContactSt
epBuffer.data[r]
+1&&(this.m_consecutiveContactStepsBuffer.data[r]=0)}this.m_bodyContactBuffer.SetCo
unt(0),this.m_stuckParticleBuffer.SetCount(0);var s=t;this.ComputeAABB(s);var a=new
n.UpdateBodyContactsCallback(this,this.GetFixtureContactFilter());this.m_world.Quer
yAABB(a,s),this.m_def.strictContactCheck&&this.RemoveSpuriousBodyContacts(),this.No
tifyBodyContactListenerPostContact(e)},n.prototype.Solve=function(e){var
i=n.Solve_s_subStep;if(0!
==this.m_count&&(this.m_expirationTimeBuffer.data&&this.SolveLifetimes(e),this.m_al
lParticleFlags&t.b2ParticleFlag.b2_zombieParticle&&this.SolveZombie(),this.m_needsU
pdateAllParticleFlags&&this.UpdateAllParticleFlags(),this.m_needsUpdateAllGroupFlag
s&&this.UpdateAllGroupFlags(),!
this.m_paused))for(this.m_iterationIndex=0;this.m_iterationIndex<e.particleIteratio
ns;this.m_iterationIndex++){++this.m_timestamp;var
r=i.Copy(e);if(r.dt/=e.particleIterations,r.inv_dt*=e.particleIterations,this.Updat
eContacts(!
1),this.UpdateBodyContacts(),this.ComputeWeight(),this.m_allGroupFlags&t.b2Particle
GroupFlag.b2_particleGroupNeedsUpdateDepth&&this.ComputeDepth(),this.m_allParticleF
lags&t.b2ParticleFlag.b2_reactiveParticle&&this.UpdatePairsAndTriadsWithReactivePar
ticles(),this.m_hasForce&&this.SolveForce(r),this.m_allParticleFlags&t.b2ParticleFl
ag.b2_viscousParticle&&this.SolveViscous(),this.m_allParticleFlags&t.b2ParticleFlag
.b2_repulsiveParticle&&this.SolveRepulsive(r),this.m_allParticleFlags&t.b2ParticleF
lag.b2_powderParticle&&this.SolvePowder(r),this.m_allParticleFlags&t.b2ParticleFlag
.b2_tensileParticle&&this.SolveTensile(r),this.m_allGroupFlags&t.b2ParticleGroupFla
g.b2_solidParticleGroup&&this.SolveSolid(r),this.m_allParticleFlags&t.b2ParticleFla
g.b2_colorMixingParticle&&this.SolveColorMixing(),this.SolveGravity(r),this.m_allPa
rticleFlags&t.b2ParticleFlag.b2_staticPressureParticle&&this.SolveStaticPressure(r)
,this.SolvePressure(r),this.SolveDamping(r),this.m_allParticleFlags&n.k_extraDampin
gFlags&&this.SolveExtraDamping(),this.m_allParticleFlags&t.b2ParticleFlag.b2_elasti
cParticle&&this.SolveElastic(r),this.m_allParticleFlags&t.b2ParticleFlag.b2_springP
article&&this.SolveSpring(r),this.LimitVelocity(r),this.m_allGroupFlags&t.b2Particl
eGroupFlag.b2_rigidParticleGroup&&this.SolveRigidDamping(),this.m_allParticleFlags&
t.b2ParticleFlag.b2_barrierParticle&&this.SolveBarrier(r),this.SolveCollision(r),th
is.m_allGroupFlags&t.b2ParticleGroupFlag.b2_rigidParticleGroup&&this.SolveRigid(r),
this.m_allParticleFlags&t.b2ParticleFlag.b2_wallParticle&&this.SolveWall(),!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;for(var s=0;s<this.m_count;s+
+)this.m_positionBuffer.data[s].SelfMulAdd(r.dt,this.m_velocityBuffer.data[s])}
},n.prototype.SolveCollision=function(t){var e=n.SolveCollision_s_aabb;if(!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;var
r=this.m_positionBuffer.data,s=this.m_velocityBuffer.data,a=e;a.lowerBound.x=+i,a.l
owerBound.y=+i,a.upperBound.x=-i,a.upperBound.y=-i;for(var o=0;o<this.m_count;o++)
{var
l=s[o],h=r[o],c=h.x+t.dt*l.x,u=h.y+t.dt*l.y;a.lowerBound.x=g(a.lowerBound.x,g(h.x,c
)),a.lowerBound.y=g(a.lowerBound.y,g(h.y,u)),a.upperBound.x=x(a.upperBound.x,x(h.x,
c)),a.upperBound.y=x(a.upperBound.y,x(h.y,u))}var _=new
n.SolveCollisionCallback(this,t);this.m_world.QueryAABB(_,a)},n.prototype.LimitVelo
city=function(t){if(!this.m_velocityBuffer.data)throw new Error;for(var
e=this.m_velocityBuffer.data,i=this.GetCriticalVelocitySquared(t),n=0;n<this.m_coun
t;n++){var
r=e[n],s=I.DotVV(r,r);s>i&&r.SelfMul(T(i/s))}},n.prototype.SolveGravity=function(t)
{if(!this.m_velocityBuffer.data)throw new Error;for(var
e=n.SolveGravity_s_gravity,i=this.m_velocityBuffer.data,r=I.MulSV(t.dt*this.m_def.g
ravityScale,this.m_world.GetGravity(),e),s=0;s<this.m_count;s+
+)i[s].SelfAdd(r)},n.prototype.SolveBarrier=function(e){var
i=n.SolveBarrier_s_aabb,r=n.SolveBarrier_s_va,s=n.SolveBarrier_s_vb,a=n.SolveBarrie
r_s_pba,o=n.SolveBarrier_s_vba,l=n.SolveBarrier_s_vc,h=n.SolveBarrier_s_pca,c=n.Sol
veBarrier_s_vca,u=n.SolveBarrier_s_qba,_=n.SolveBarrier_s_qca,f=n.SolveBarrier_s_dv
,d=n.SolveBarrier_s_f;if(!this.m_flagsBuffer.data)throw new Error;if(!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;for(var
m=this.m_positionBuffer.data,p=this.m_velocityBuffer.data,v=0;v<this.m_count;v++)
{0!=(this.m_flagsBuffer.data[v]&n.k_barrierWallFlags)&&p[v].SetZero()}for(var
y=2.5*e.dt,g=this.GetParticleMass(),x=0;x<this.m_pairBuffer.count;x++){var
b=this.m_pairBuffer.data[x];if(b.flags&t.b2ParticleFlag.b2_barrierParticle){var
A=b.indexA,C=b.indexB,S=m[A],w=m[C],E=i;I.MinV(S,w,E.lowerBound),I.MaxV(S,w,E.upper
Bound);for(var
M=this.m_groupBuffer[A],D=this.m_groupBuffer[C],B=this.GetLinearVelocity(M,A,S,r),P
=this.GetLinearVelocity(D,C,w,s),R=I.SubVV(w,S,a),O=I.SubVV(P,B,o),L=this.GetInside
BoundsEnumerator(E),F=void 0;(F=L.GetNext())>=0;){var
V=m[F],N=this.m_groupBuffer[F];if(M!==N&&D!==N){var
k=this.GetLinearVelocity(N,F,V,l),G=I.SubVV(V,S,h),z=I.SubVV(k,B,c),U=I.CrossVV(O,z
),j=I.CrossVV(R,z)-I.CrossVV(G,O),W=I.CrossVV(R,G),H=void 0,X=void
0,q=u,Y=_;if(0===U){if(0===j)continue;if(!((X=-
W/j)>=0&&X<y))continue;if(I.AddVMulSV(R,X,O,q),I.AddVMulSV(G,X,z,Y),!
((H=I.DotVV(q,Y)/I.DotVV(q,q))>=0&&H<=1))continue}else{var J=j*j-
4*W*U;if(J<0)continue;var Z=T(J),K=(-j-Z)/(2*U),Q=(-j+Z)/(2*U);if(K>Q){var
$=K;K=Q,Q=$}if(X=K,I.AddVMulSV(R,X,O,q),I.AddVMulSV(G,X,z,Y),H=I.DotVV(q,Y)/I.DotVV
(q,q),!(X>=0&&X<y&&H>=0&&H<=1)){if(!
((X=Q)>=0&&X<y))continue;if(I.AddVMulSV(R,X,O,q),I.AddVMulSV(G,X,z,Y),!
((H=I.DotVV(q,Y)/I.DotVV(q,q))>=0&&H<=1))continue}}var tt=f;tt.x=B.x+H*O.x-
k.x,tt.y=B.y+H*O.y-k.y;var et=I.MulSV(g,tt,d);if(N&&this.IsRigidGroup(N)){var
it=N.GetMass(),nt=N.GetInertia();it>0&&N.m_linearVelocity.SelfMulAdd(1/it,et),nt>0&
&(N.m_angularVelocity+=I.CrossVV(I.SubVV(V,N.GetCenter(),I.s_t0),et)/nt)}else
p[F].SelfAdd(tt);this.ParticleApplyForce(F,et.SelfMul(-
e.inv_dt))}}}}},n.prototype.SolveStaticPressure=function(e){if(!
this.m_flagsBuffer.data)throw new
Error;this.m_staticPressureBuffer=this.RequestBuffer(this.m_staticPressureBuffer);f
or(var
i=this.GetCriticalPressure(e),n=this.m_def.staticPressureStrength*i,r=.25*i,s=this.
m_def.staticPressureRelaxation,a=0;a<this.m_def.staticPressureIterations;a++)
{for(var o=0;o<this.m_count;o++)this.m_accumulationBuffer[o]=0;for(var
l=0;l<this.m_contactBuffer.count;l++){var
h=this.m_contactBuffer.data[l];if(h.flags&t.b2ParticleFlag.b2_staticPressureParticl
e){var c=h.indexA,u=h.indexB,_=h.weight;this.m_accumulationBuffer[c]
+=_*this.m_staticPressureBuffer[u],this.m_accumulationBuffer[u]
+=_*this.m_staticPressureBuffer[c]}}for(o=0;o<this.m_count;o++)
{_=this.m_weightBuffer[o];if(this.m_flagsBuffer.data[o]&t.b2ParticleFlag.b2_staticP
ressureParticle){var
f=(this.m_accumulationBuffer[o]+n*(_-1))/(_+s);this.m_staticPressureBuffer[o]=b(f,0
,r)}else this.m_staticPressureBuffer[o]=0}}},n.prototype.ComputeWeight=function()
{for(var t=0;t<this.m_count;t+
+)this.m_weightBuffer[t]=0;for(t=0;t<this.m_bodyContactBuffer.count;t++){var
e=(n=this.m_bodyContactBuffer.data[t]).index,i=n.weight;this.m_weightBuffer[e]
+=i}for(t=0;t<this.m_contactBuffer.count;t++)
{e=(n=this.m_contactBuffer.data[t]).indexA;var
n,r=n.indexB;i=n.weight;this.m_weightBuffer[e]+=i,this.m_weightBuffer[r]
+=i}},n.prototype.SolvePressure=function(e){var i=n.SolvePressure_s_f;if(!
this.m_flagsBuffer.data)throw new Error;if(!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
r=this.m_positionBuffer.data,s=this.m_velocityBuffer.data,a=this.GetCriticalPressur
e(e),o=this.m_def.pressureStrength*a,l=.25*a,h=0;h<this.m_count;h++){var
c=this.m_weightBuffer[h],u=o*x(0,c-
1);this.m_accumulationBuffer[h]=g(u,l)}if(this.m_allParticleFlags&n.k_noPressureFla
gs)for(h=0;h<this.m_count;h+
+)this.m_flagsBuffer.data[h]&n.k_noPressureFlags&&(this.m_accumulationBuffer[h]=0);
if(this.m_allParticleFlags&t.b2ParticleFlag.b2_staticPressureParticle)for(h=0;h<thi
s.m_count;h+
+)this.m_flagsBuffer.data[h]&t.b2ParticleFlag.b2_staticPressureParticle&&(this.m_ac
cumulationBuffer[h]+=this.m_staticPressureBuffer[h]);for(var
_=e.dt/(this.m_def.density*this.m_particleDiameter),f=this.GetParticleInvMass(),d=0
;d<this.m_bodyContactBuffer.count;d++){var
m=(C=this.m_bodyContactBuffer.data[d]).index,p=C.body,v=(c=C.weight,C.mass),y=C.nor
mal,b=r[m],A=(u=this.m_accumulationBuffer[m]
+o*c,I.MulSV(_*c*v*u,y,i));s[m].SelfMulSub(f,A),p.ApplyLinearImpulse(A,b,!
0)}for(d=0;d<this.m_contactBuffer.count;d++){var
C;m=(C=this.m_contactBuffer.data[d]).indexA,p=C.indexB,c=C.weight,y=C.normal,u=this
.m_accumulationBuffer[m]
+this.m_accumulationBuffer[p],A=I.MulSV(_*c*u,y,i);s[m].SelfSub(A),s[p].SelfAdd(A)}
},n.prototype.SolveDamping=function(t){var
e=n.SolveDamping_s_v,i=n.SolveDamping_s_f;if(!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
r=this.m_positionBuffer.data,s=this.m_velocityBuffer.data,a=this.m_def.dampingStren
gth,o=1/this.GetCriticalVelocity(t),l=this.GetParticleInvMass(),h=0;h<this.m_bodyCo
ntactBuffer.count;h++){var
c=(b=this.m_bodyContactBuffer.data[h]).index,u=b.body,_=b.weight,f=b.mass,d=b.norma
l,m=r[c],p=I.SubVV(u.GetLinearVelocityFromWorldPoint(m,I.s_t0),s[c],e);if((A=I.DotV
V(p,d))<0){var v=x(a*_,g(-
o*A,.5)),y=I.MulSV(v*f*A,d,i);s[c].SelfMulAdd(l,y),u.ApplyLinearImpulse(y.SelfNeg()
,m,!0)}}for(h=0;h<this.m_contactBuffer.count;h++){var
b,A;c=(b=this.m_contactBuffer.data[h]).indexA,u=b.indexB,_=b.weight,d=b.normal,p=I.
SubVV(s[u],s[c],e);if((A=I.DotVV(p,d))<0){v=x(a*_,g(-
o*A,.5)),y=I.MulSV(v*A,d,i);s[c].SelfAdd(y),s[u].SelfSub(y)}}},n.prototype.SolveRig
idDamping=function(){var
t=n.SolveRigidDamping_s_t0,e=n.SolveRigidDamping_s_t1,i=n.SolveRigidDamping_s_p,r=n
.SolveRigidDamping_s_v,s=[0],a=[0],o=[0],l=[0],h=[0],c=[0];if(!
this.m_positionBuffer.data)throw new Error;for(var
u=this.m_positionBuffer.data,_=this.m_def.dampingStrength,f=0;f<this.m_bodyContactB
uffer.count;f++){var
d=(A=this.m_bodyContactBuffer.data[f]).index;if((C=this.m_groupBuffer[d])&&this.IsR
igidGroup(C)){var
m=A.body,p=A.normal,v=A.weight,y=u[d],x=I.SubVV(m.GetLinearVelocityFromWorldPoint(y
,t),C.GetLinearVelocityFromWorldPoint(y,e),r);if((E=I.DotVV(x,p))<0)
{this.InitDampingParameterWithRigidGroupOrParticle(s,a,o,!
0,C,d,y,p),this.InitDampingParameter(l,h,c,m.GetMass(),m.GetInertia()-
m.GetMass()*m.GetLocalCenter().LengthSquared(),m.GetWorldCenter(),y,p);var
b=_*g(v,1)*this.ComputeDampingImpulse(s[0],a[0],o[0],l[0],h[0],c[0],E);this.ApplyDa
mping(s[0],a[0],o[0],!0,C,d,b,p),m.ApplyLinearImpulse(I.MulSV(-b,p,I.s_t0),y,!
0)}}}for(f=0;f<this.m_contactBuffer.count;f++)
{d=(A=this.m_contactBuffer.data[f]).indexA,m=A.indexB,p=A.normal,v=A.weight;var
A,C=this.m_groupBuffer[d],S=this.m_groupBuffer[m],T=this.IsRigidGroup(C),w=this.IsR
igidGroup(S);if(C!==S&&(T||w)){var
E;y=I.MidVV(u[d],u[m],i),x=I.SubVV(this.GetLinearVelocity(S,m,y,t),this.GetLinearVe
locity(C,d,y,e),r);if((E=I.DotVV(x,p))<0)
{this.InitDampingParameterWithRigidGroupOrParticle(s,a,o,T,C,d,y,p),this.InitDampin
gParameterWithRigidGroupOrParticle(l,h,c,w,S,m,y,p);b=_*v*this.ComputeDampingImpuls
e(s[0],a[0],o[0],l[0],h[0],c[0],E);this.ApplyDamping(s[0],a[0],o[0],T,C,d,b,p),this
.ApplyDamping(l[0],h[0],c[0],w,S,m,-
b,p)}}}},n.prototype.SolveExtraDamping=function(){var
t=n.SolveExtraDamping_s_v,e=n.SolveExtraDamping_s_f;if(!
this.m_flagsBuffer.data)throw new Error;if(!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
i=this.m_velocityBuffer.data,r=this.m_positionBuffer.data,s=this.GetParticleInvMass
(),a=0;a<this.m_bodyContactBuffer.count;a++){var
o=this.m_bodyContactBuffer.data[a],l=o.index;if(this.m_flagsBuffer.data[l]&n.k_extr
aDampingFlags){var
h=o.body,c=o.mass,u=o.normal,_=r[l],f=I.SubVV(h.GetLinearVelocityFromWorldPoint(_,I
.s_t0),i[l],t),d=I.DotVV(f,u);if(d<0){var
m=I.MulSV(.5*c*d,u,e);i[l].SelfMulAdd(s,m),h.ApplyLinearImpulse(m.SelfNeg(),_,!
0)}}}},n.prototype.SolveWall=function(){if(!this.m_flagsBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
e=this.m_velocityBuffer.data,i=0;i<this.m_count;i+
+)this.m_flagsBuffer.data[i]&t.b2ParticleFlag.b2_wallParticle&&e[i].SetZero()},n.pr
ototype.SolveRigid=function(e){var
i=n.SolveRigid_s_position,r=n.SolveRigid_s_rotation,s=n.SolveRigid_s_transform,a=n.
SolveRigid_s_velocityTransform;if(!this.m_positionBuffer.data)throw new Error;if(!
this.m_velocityBuffer.data)throw new Error;for(var
o=this.m_positionBuffer.data,l=this.m_velocityBuffer.data,h=this.m_groupList;h;h=h.
GetNext())if(h.m_groupFlags&t.b2ParticleGroupFlag.b2_rigidParticleGroup)
{h.UpdateStatistics();var c=r;c.SetAngle(e.dt*h.m_angularVelocity);var

u=I.AddVV(h.m_center,I.SubVV(I.MulSV(e.dt,h.m_linearVelocity,I.s_t0),V.MulRV(c,h.m_
center,I.s_t1),I.s_t0),i),_=s;_.SetPositionRotation(u,c),N.MulXX(_,h.m_transform,h.
m_transform);var
f=a;f.p.x=e.inv_dt*_.p.x,f.p.y=e.inv_dt*_.p.y,f.q.s=e.inv_dt*_.q.s,f.q.c=e.inv_dt*(
_.q.c-1);for(var d=h.m_firstIndex;d<h.m_lastIndex;d+
+)N.MulXV(f,o[d],l[d])}},n.prototype.SolveElastic=function(e){var
i=n.SolveElastic_s_pa,r=n.SolveElastic_s_pb,s=n.SolveElastic_s_pc,a=n.SolveElastic_
s_r,o=n.SolveElastic_s_t0;if(!this.m_positionBuffer.data)throw new Error;if(!
this.m_velocityBuffer.data)throw new Error;for(var
l=this.m_positionBuffer.data,h=this.m_velocityBuffer.data,c=e.inv_dt*this.m_def.ela
sticStrength,u=0;u<this.m_triadBuffer.count;u++){var
_=this.m_triadBuffer.data[u];if(_.flags&t.b2ParticleFlag.b2_elasticParticle){var
f=_.indexA,d=_.indexB,m=_.indexC,p=_.pa,v=_.pb,y=_.pc,g=i.Copy(l[f]),x=r.Copy(l[d])
,b=s.Copy(l[m]),A=h[f],C=h[d],T=h[m];g.SelfMulAdd(e.dt,A),x.SelfMulAdd(e.dt,C),b.Se
lfMulAdd(e.dt,T);var w=(g.x+x.x+b.x)/3,E=(g.y+x.y+b.y)/3;g.x-=w,g.y-=E,x.x-=w,x.y-
=E,b.x-=w,b.y-=E;var M=a;M.s=I.CrossVV(p,g)+I.CrossVV(v,x)
+I.CrossVV(y,b),M.c=I.DotVV(p,g)+I.DotVV(v,x)+I.DotVV(y,b);var
D=S(M.s*M.s+M.c*M.c);isFinite(D)||(D=198177537e11),M.s*=D,M.c*=D;var
B=c*_.strength;V.MulRV(M,p,o),I.SubVV(o,g,o),I.MulSV(B,o,o),A.SelfAdd(o),V.MulRV(M,
v,o),I.SubVV(o,x,o),I.MulSV(B,o,o),C.SelfAdd(o),V.MulRV(M,y,o),I.SubVV(o,b,o),I.Mul
SV(B,o,o),T.SelfAdd(o)}}},n.prototype.SolveSpring=function(e){var
i=n.SolveSpring_s_pa,r=n.SolveSpring_s_pb,s=n.SolveSpring_s_d,a=n.SolveSpring_s_f;i
f(!this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw
new Error;for(var
o=this.m_positionBuffer.data,l=this.m_velocityBuffer.data,h=e.inv_dt*this.m_def.spr
ingStrength,c=0;c<this.m_pairBuffer.count;c++){var
u=this.m_pairBuffer.data[c];if(u.flags&t.b2ParticleFlag.b2_springParticle){var
_=u.indexA,f=u.indexB,d=i.Copy(o[_]),m=r.Copy(o[f]),p=l[_],v=l[f];d.SelfMulAdd(e.dt
,p),m.SelfMulAdd(e.dt,v);var
y=I.SubVV(m,d,s),g=u.distance,x=y.Length(),b=h*u.strength,A=I.MulSV(b*(g-
x)/x,y,a);p.SelfSub(A),v.SelfAdd(A)}}},n.prototype.SolveTensile=function(e){var
i=n.SolveTensile_s_weightedNormal,r=n.SolveTensile_s_s,s=n.SolveTensile_s_f;if(!
this.m_velocityBuffer.data)throw new Error;for(var
a=this.m_velocityBuffer.data,o=0;o<this.m_count;o+
+)this.m_accumulation2Buffer[o]=new
I,this.m_accumulation2Buffer[o].SetZero();for(var
l=0;l<this.m_contactBuffer.count;l++)
{if((y=this.m_contactBuffer.data[l]).flags&t.b2ParticleFlag.b2_tensileParticle){var
h=y.indexA,c=y.indexB,u=y.weight,_=y.normal,f=I.MulSV((1-
u)*u,_,i);this.m_accumulation2Buffer[h].SelfSub(f),this.m_accumulation2Buffer[c].Se
lfAdd(f)}}var
d=this.GetCriticalVelocity(e),m=this.m_def.surfaceTensionPressureStrength*d,p=this.
m_def.surfaceTensionNormalStrength*d,v=.5*d;for(l=0;l<this.m_contactBuffer.count;l+
+){var
y;if((y=this.m_contactBuffer.data[l]).flags&t.b2ParticleFlag.b2_tensileParticle)
{h=y.indexA,c=y.indexB,u=y.weight,_=y.normal;var x=this.m_weightBuffer[h]
+this.m_weightBuffer[c],b=I.SubVV(this.m_accumulation2Buffer[c],this.m_accumulation
2Buffer[h],r),A=g(m*(x-
2)+p*I.DotVV(b,_),v)*u,C=I.MulSV(A,_,s);a[h].SelfSub(C),a[c].SelfAdd(C)}}},n.protot
ype.SolveViscous=function(){var e=n.SolveViscous_s_v,i=n.SolveViscous_s_f;if(!
this.m_flagsBuffer.data)throw new Error;if(!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
r=this.m_positionBuffer.data,s=this.m_velocityBuffer.data,a=this.m_def.viscousStren
gth,o=this.GetParticleInvMass(),l=0;l<this.m_bodyContactBuffer.count;l++){var
h=(p=this.m_bodyContactBuffer.data[l]).index;if(this.m_flagsBuffer.data[h]&t.b2Part
icleFlag.b2_viscousParticle){var
c=p.body,u=p.weight,_=p.mass,f=r[h],d=I.SubVV(c.GetLinearVelocityFromWorldPoint(f,I
.s_t0),s[h],e),m=I.MulSV(a*_*u,d,i);s[h].SelfMulAdd(o,m),c.ApplyLinearImpulse(m.Sel
fNeg(),f,!0)}}for(l=0;l<this.m_contactBuffer.count;l++){var
p;if((p=this.m_contactBuffer.data[l]).flags&t.b2ParticleFlag.b2_viscousParticle)
{h=p.indexA,c=p.indexB,u=p.weight,d=I.SubVV(s[c],s[h],e),m=I.MulSV(a*u,d,i);s[h].Se
lfAdd(m),s[c].SelfSub(m)}}},n.prototype.SolveRepulsive=function(e){var
i=n.SolveRepulsive_s_f;if(!this.m_velocityBuffer.data)throw new Error;for(var
r=this.m_velocityBuffer.data,s=this.m_def.repulsiveStrength*this.GetCriticalVelocit
y(e),a=0;a<this.m_contactBuffer.count;a++){var
o=this.m_contactBuffer.data[a];if(o.flags&t.b2ParticleFlag.b2_repulsiveParticle)
{var l=o.indexA,h=o.indexB;if(this.m_groupBuffer[l]!==this.m_groupBuffer[h]){var
c=o.weight,u=o.normal,_=I.MulSV(s*c,u,i);r[l].SelfSub(_),r[h].SelfAdd(_)}}}},n.prot
otype.SolvePowder=function(e){var i=n.SolvePowder_s_f;if(!
this.m_flagsBuffer.data)throw new Error;if(!this.m_positionBuffer.data)throw new
Error;if(!this.m_velocityBuffer.data)throw new Error;for(var
r=this.m_positionBuffer.data,s=this.m_velocityBuffer.data,a=this.m_def.powderStreng
th*this.GetCriticalVelocity(e),o=this.GetParticleInvMass(),l=0;l<this.m_bodyContact
Buffer.count;l++){var
h=(m=this.m_bodyContactBuffer.data[l]).index;if(this.m_flagsBuffer.data[h]&t.b2Part
icleFlag.b2_powderParticle)if((p=m.weight)>.25){var
c=m.body,u=m.mass,_=r[h],f=m.normal,d=I.MulSV(a*u*(p-.25),f,i);s[h].SelfMulSub(o,d)
,c.ApplyLinearImpulse(d,_,!0)}}for(l=0;l<this.m_contactBuffer.count;l++){var
m,p;if((m=this.m_contactBuffer.data[l]).flags&t.b2ParticleFlag.b2_powderParticle)if
((p=m.weight)>.25)
{h=m.indexA,c=m.indexB,f=m.normal,d=I.MulSV(a*(p-.25),f,i);s[h].SelfSub(d),s[c].Sel
fAdd(d)}}},n.prototype.SolveSolid=function(t){var e=n.SolveSolid_s_f;if(!
this.m_velocityBuffer.data)throw new Error;var
i=this.m_velocityBuffer.data;this.m_depthBuffer=this.RequestBuffer(this.m_depthBuff
er);for(var
r=t.inv_dt*this.m_def.ejectionStrength,s=0;s<this.m_contactBuffer.count;s++){var
a=this.m_contactBuffer.data[s],o=a.indexA,l=a.indexB;if(this.m_groupBuffer[o]!
==this.m_groupBuffer[l]){var h=a.weight,c=a.normal,u=this.m_depthBuffer[o]
+this.m_depthBuffer[l],_=I.MulSV(r*u*h,c,e);i[o].SelfSub(_),i[l].SelfAdd(_)}}},n.pr
ototype.SolveForce=function(t){if(!this.m_velocityBuffer.data)throw new
Error;for(var
e=this.m_velocityBuffer.data,i=t.dt*this.GetParticleInvMass(),n=0;n<this.m_count;n+
+)e[n].SelfMulAdd(i,this.m_forceBuffer[n]);this.m_hasForce=!
1},n.prototype.SolveColorMixing=function(){if(!this.m_flagsBuffer.data)throw new
Error;if(!this.m_colorBuffer.data)throw new Error;var
e=.5*this.m_def.colorMixingStrength;if(e)for(var
i=0;i<this.m_contactBuffer.count;i++){var
n=this.m_contactBuffer.data[i],r=n.indexA,s=n.indexB;if(this.m_flagsBuffer.data[r]&
this.m_flagsBuffer.data[s]&t.b2ParticleFlag.b2_colorMixingParticle){var
a=this.m_colorBuffer.data[r],o=this.m_colorBuffer.data[s];G.MixColors(a,o,e)}}},n.p
rototype.SolveZombie=function(){if(!this.m_flagsBuffer.data)throw new Error;if(!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;for(var e=0,i=[],n=0;n<this.m_count;n++)i[n]=u;var
r=0;for(n=0;n<this.m_count;n++){var
s=this.m_flagsBuffer.data[n];if(s&t.b2ParticleFlag.b2_zombieParticle){var
a=this.m_world.m_destructionListener;if(s&t.b2ParticleFlag.b2_destructionListenerPa
rticle&&a&&a.SayGoodbyeParticle(this,n),this.m_handleIndexBuffer.data)
(o=this.m_handleIndexBuffer.data[n])&&(o.SetIndex(u),this.m_handleIndexBuffer.data[
n]=null);i[n]=u}else{if(i[n]=e,n!==e){var o;if(this.m_handleIndexBuffer.data)
(o=this.m_handleIndexBuffer.data[n])&&o.SetIndex(e),this.m_handleIndexBuffer.data[e
]=o;this.m_flagsBuffer.data[e]=this.m_flagsBuffer.data[n],this.m_lastBodyContactSte
pBuffer.data&&(this.m_lastBodyContactStepBuffer.data[e]=this.m_lastBodyContactStepB
uffer.data[n]),this.m_bodyContactCountBuffer.data&&(this.m_bodyContactCountBuffer.d
ata[e]=this.m_bodyContactCountBuffer.data[n]),this.m_consecutiveContactStepsBuffer.
data&&(this.m_consecutiveContactStepsBuffer.data[e]=this.m_consecutiveContactStepsB
uffer.data[n]),this.m_positionBuffer.data[e].Copy(this.m_positionBuffer.data[n]),th
is.m_velocityBuffer.data[e].Copy(this.m_velocityBuffer.data[n]),this.m_groupBuffer[
e]=this.m_groupBuffer[n],this.m_hasForce&&this.m_forceBuffer[e].Copy(this.m_forceBu
ffer[n]),this.m_staticPressureBuffer&&(this.m_staticPressureBuffer[e]=this.m_static
PressureBuffer[n]),this.m_depthBuffer&&(this.m_depthBuffer[e]=this.m_depthBuffer[n]
),this.m_colorBuffer.data&&this.m_colorBuffer.data[e].Copy(this.m_colorBuffer.data[
n]),this.m_userDataBuffer.data&&(this.m_userDataBuffer.data[e]=this.m_userDataBuffe
r.data[n]),this.m_expirationTimeBuffer.data&&(this.m_expirationTimeBuffer.data[e]=t
his.m_expirationTimeBuffer.data[n])}e++,r|=s}}for(var l=function(t){return
t.index<0},h=function(t){return t.indexA<0||t.indexB<0},c=function(t){return
t.index<0},_=function(t){return t.indexA<0||t.indexB<0},f=function(t){return
t.indexA<0||t.indexB<0||t.indexC<0},d=0;d<this.m_proxyBuffer.count;d++){var
m=this.m_proxyBuffer.data[d];m.index=i[m.index]}this.m_proxyBuffer.RemoveIf(l);for(
d=0;d<this.m_contactBuffer.count;d++)
{(p=this.m_contactBuffer.data[d]).indexA=i[p.indexA],p.indexB=i[p.indexB]}this.m_co
ntactBuffer.RemoveIf(h);for(d=0;d<this.m_bodyContactBuffer.count;d++){var p;
(p=this.m_bodyContactBuffer.data[d]).index=i[p.index]}this.m_bodyContactBuffer.Remo
veIf(c);for(d=0;d<this.m_pairBuffer.count;d++){var
v=this.m_pairBuffer.data[d];v.indexA=i[v.indexA],v.indexB=i[v.indexB]}this.m_pairBu
ffer.RemoveIf(_);for(d=0;d<this.m_triadBuffer.count;d++){var
y=this.m_triadBuffer.data[d];y.indexA=i[y.indexA],y.indexB=i[y.indexB],y.indexC=i[y
.indexC]}if(this.m_triadBuffer.RemoveIf(f),this.m_indexByExpirationTimeBuffer.data)
for(var b=0,A=0;A<this.m_count;A++){var
C=i[this.m_indexByExpirationTimeBuffer.data[A]];C!
==u&&(this.m_indexByExpirationTimeBuffer.data[b++]=C)}for(var
S=this.m_groupList;S;S=S.GetNext()){var T=e,w=0,E=!
1;for(n=S.m_firstIndex;n<S.m_lastIndex;n++){var M=i[n];M>=0?
(T=g(T,M),w=x(w,M+1)):E=!0}T<w?
(S.m_firstIndex=T,S.m_lastIndex=w,E&&S.m_groupFlags&t.b2ParticleGroupFlag.b2_solidP
articleGroup&&this.SetGroupFlags(S,S.m_groupFlags|
t.b2ParticleGroupFlag.b2_particleGro
upNeedsUpdateDepth)):
(S.m_firstIndex=0,S.m_lastIndex=0,S.m_groupFlags&t.b2ParticleGroupFlag.b2_particleG
roupCanBeEmpty||this.SetGroupFlags(S,S.m_groupFlags|
t.b2ParticleGroupFlag.b2_particleGroupWillBeDestroyed))}this.m_count=e,this.m_allPa
rticleFlags=r,this.m_needsUpdateAllParticleFlags=!1;for(S=this.m_groupList;S;){var
D=S.GetNext();S.m_groupFlags&t.b2ParticleGroupFlag.b2_particleGroupWillBeDestroyed&
&this.DestroyParticleGroup(S),S=D}},n.prototype.SolveLifetimes=function(t){if(!
this.m_expirationTimeBuffer.data)throw new Error;if(!
this.m_indexByExpirationTimeBuffer.data)throw new
Error;this.m_timeElapsed=this.LifetimeToExpirationTime(t.dt);var
e=this.GetQuantizedTimeElapsed(),i=this.m_expirationTimeBuffer.data,n=this.m_indexB
yExpirationTimeBuffer.data,r=this.GetParticleCount();if(this.m_expirationTimeBuffer
RequiresSorting){wn(n,0,r,(function(t,e){var n=i[t],r=i[e],s=n<=0;return s===r<=0?
n>r:s})),this.m_expirationTimeBufferRequiresSorting=!1}for(var s=r-1;s>=0;--s){var
a=n[s],o=i[a];if(e<o||
o<=0)break;this.DestroyParticle(a)}},n.prototype.RotateBuffer=function(t,e,i){if(t!
==e&&e!==i){if(!this.m_flagsBuffer.data)throw new Error;if(!
this.m_positionBuffer.data)throw new Error;if(!this.m_velocityBuffer.data)throw new
Error;if(Pn(this.m_flagsBuffer.data,t,e,i),this.m_lastBodyContactStepBuffer.data&&P
n(this.m_lastBodyContactStepBuffer.data,t,e,i),this.m_bodyContactCountBuffer.data&&
Pn(this.m_bodyContactCountBuffer.data,t,e,i),this.m_consecutiveContactStepsBuffer.d
ata&&Pn(this.m_consecutiveContactStepsBuffer.data,t,e,i),Pn(this.m_positionBuffer.d
ata,t,e,i),Pn(this.m_velocityBuffer.data,t,e,i),Pn(this.m_groupBuffer,t,e,i),this.m
_hasForce&&Pn(this.m_forceBuffer,t,e,i),this.m_staticPressureBuffer&&Pn(this.m_stat
icPressureBuffer,t,e,i),this.m_depthBuffer&&Pn(this.m_depthBuffer,t,e,i),this.m_col
orBuffer.data&&Pn(this.m_colorBuffer.data,t,e,i),this.m_userDataBuffer.data&&Pn(thi
s.m_userDataBuffer.data,t,e,i),this.m_handleIndexBuffer.data)
{Pn(this.m_handleIndexBuffer.data,t,e,i);for(var n=t;n<i;++n){var
r=this.m_handleIndexBuffer.data[n];r&&r.SetIndex(f(r.GetIndex()))}}if(this.m_expira
tionTimeBuffer.data){Pn(this.m_expirationTimeBuffer.data,t,e,i);var
s=this.GetParticleCount();if(!this.m_indexByExpirationTimeBuffer.data)throw new
Error;var a=this.m_indexByExpirationTimeBuffer.data;for(n=0;n<s;+
+n)a[n]=f(a[n])}for(var o=0;o<this.m_proxyBuffer.count;o++){var
l=this.m_proxyBuffer.data[o];l.index=f(l.index)}for(o=0;o<this.m_contactBuffer.coun
t;o++)
{(h=this.m_contactBuffer.data[o]).indexA=f(h.indexA),h.indexB=f(h.indexB)}for(o=0;o
<this.m_bodyContactBuffer.count;o++){var h;
(h=this.m_bodyContactBuffer.data[o]).index=f(h.index)}for(o=0;o<this.m_pairBuffer.c
ount;o++){var
c=this.m_pairBuffer.data[o];c.indexA=f(c.indexA),c.indexB=f(c.indexB)}for(o=0;o<thi
s.m_triadBuffer.count;o++){var
u=this.m_triadBuffer.data[o];u.indexA=f(u.indexA),u.indexB=f(u.indexB),u.indexC=f(u
.indexC)}for(var
_=this.m_groupList;_;_=_.GetNext())_.m_firstIndex=f(_.m_firstIndex),_.m_lastIndex=f
(_.m_lastIndex-1)+1}function f(n){return n<t?n:n<e?n+i-e:n<i?n+t-
e:n}},n.prototype.GetCriticalVelocity=function(t){return
this.m_particleDiameter*t.inv_dt},n.prototype.GetCriticalVelocitySquared=function(t
){var e=this.GetCriticalVelocity(t);return
e*e},n.prototype.GetCriticalPressure=function(t){return
this.m_def.density*this.GetCriticalVelocitySquared(t)},n.prototype.GetParticleStrid
e=function()
{return.75*this.m_particleDiameter},n.prototype.GetParticleMass=function(){var
t=this.GetParticleStride();return
this.m_def.density*t*t},n.prototype.GetParticleInvMass=function(){var
t=this.m_inverseDiameter*(1/.75);return
this.m_inverseDensity*t*t},n.prototype.GetFixtureContactFilter=function(){return
this.m_allParticleFlags&t.b2ParticleFlag.b2_fixtureContactFilterParticle?
this.m_world.m_contactManager.m_contactFilter:null},n.prototype.GetParticleContactF
ilter=function(){return
this.m_allParticleFlags&t.b2ParticleFlag.b2_particleContactFilterParticle?
this.m_world.m_contactManager.m_contactFilter:null},n.prototype.GetFixtureContactLi
stener=function(){return
this.m_allParticleFlags&t.b2ParticleFlag.b2_fixtureContactListenerParticle?
this.m_world.m_contactManager.m_contactListener:null},n.prototype.GetParticleContac
tListener=function(){return
this.m_allParticleFlags&t.b2ParticleFlag.b2_particleContactListenerParticle?
this.m_world.m_contactManager.m_contactListener:null},n.prototype.SetUserOverridabl
eBuffer=function(t,e,i)
{t.data=e,t.userSuppliedCapacity=i},n.prototype.SetGroupFlags=function(e,i){var
n=e.m_groupFlags;(n^i)&t.b2ParticleGroupFlag.b2_solidParticleGroup&&(i|
=t.b2ParticleGroupFlag.b2_particleGroupNeedsUpdateDepth),n&~i&&(this.m_needsUpdateA
llGroupFlags=!
0),~this.m_allGroupFlags&i&&(i&t.b2ParticleGroupFlag.b2_solidParticleGroup&&(this.m
_depthBuffer=this.RequestBuffer(this.m_depthBuffer)),this.m_allGroupFlags|
=i),e.m_groupFlags=i},n.BodyContactCompare=function(t,e){return t.index===e.index?
t.weight>e.weight:t.index<e.index},n.prototype.RemoveSpuriousBodyContacts=function(
)
{wn(this.m_bodyContactBuffer.data,0,this.m_bodyContactBuffer.count,n.BodyContactCom
pare);var
t=n.RemoveSpuriousBodyContacts_s_n,e=n.RemoveSpuriousBodyContacts_s_pos,i=n.RemoveS
puriousBodyContacts_s_normal,r=this,s=-
1,a=0;this.m_bodyContactBuffer.count=Mn(this.m_bodyContactBuffer.data,(function(n)
{if(n.index!==s&&(a=0,s=n.index),a++>3)return!0;var
o=t.Copy(n.normal);if(o.SelfMul(r.m_particleDiameter*(1-n.weight)),!
r.m_positionBuffer.data)throw new Error;var
h=I.AddVV(r.m_positionBuffer.data[n.index],o,e);if(!n.fixture.TestPoint(h)){for(var
c=n.fixture.GetShape().GetChildCount(),u=0;u<c;u++){var
_=i;if(n.fixture.ComputeDistance(h,_,u)<l)return!1}return!0}return!
1}),this.m_bodyContactBuffer.count)},n.prototype.DetectStuckParticle=function(t)
{if(!(this.m_stuckThreshold<=0)){if(!this.m_bodyContactCountBuffer.data)throw new
Error;if(!this.m_consecutiveContactStepsBuffer.data)throw new Error;if(!
this.m_lastBodyContactStepBuffer.data)throw new Error;+
+this.m_bodyContactCountBuffer.data[t],2===this.m_bodyContactCountBuffer.data[t]&&(
+
+this.m_consecutiveContactStepsBuffer.data[t],this.m_consecutiveContactStepsBuffer.
data[t]>this.m_stuckThreshold&&(this.m_stuckParticleBuffer.data[this.m_stuckParticl
eBuffer.Append()]=t)),this.m_lastBodyContactStepBuffer.data[t]=this.m_timestamp}},n
.prototype.ValidateParticleIndex=function(t){return
t>=0&&t<this.GetParticleCount()&&t!
==u},n.prototype.GetQuantizedTimeElapsed=function(){return
Math.floor(this.m_timeElapsed/4294967296)},n.prototype.LifetimeToExpirationTime=fun
ction(t){return
this.m_timeElapsed+Math.floor(t/this.m_def.lifetimeGranularity*4294967296)},n.proto
type.ForceCanBeApplied=function(e){return!
(e&t.b2ParticleFlag.b2_wallParticle)},n.prototype.PrepareForceBuffer=function()
{if(!this.m_hasForce){for(var t=0;t<this.m_count;t+
+)this.m_forceBuffer[t].SetZero();this.m_hasForce=!
0}},n.prototype.IsRigidGroup=function(e){return null!==e&&0!
=(e.m_groupFlags&t.b2ParticleGroupFlag.b2_rigidParticleGroup)},n.prototype.GetLinea
rVelocity=function(t,e,i,n){if(t&&this.IsRigidGroup(t))return
t.GetLinearVelocityFromWorldPoint(i,n);if(!this.m_velocityBuffer.data)throw new
Error;return
n.Copy(this.m_velocityBuffer.data[e])},n.prototype.InitDampingParameter=function(t,
e,i,n,r,s,a,o){t[0]=n>0?1/n:0,e[0]=r>0?
1/r:0,i[0]=I.CrossVV(I.SubVV(a,s,I.s_t0),o)},n.prototype.InitDampingParameterWithRi
gidGroupOrParticle=function(e,i,n,r,s,a,o,l)
{if(s&&r)this.InitDampingParameter(e,i,n,s.GetMass(),s.GetInertia(),s.GetCenter(),o
,l);else{if(!this.m_flagsBuffer.data)throw new Error;var
h=this.m_flagsBuffer.data[a];this.InitDampingParameter(e,i,n,h&t.b2ParticleFlag.b2_
wallParticle?
0:this.GetParticleMass(),0,o,o,l)}},n.prototype.ComputeDampingImpulse=function(t,e,
i,n,r,s,a){var o=t+e*i*i+n+r*s*s;return o>0?
a/o:0},n.prototype.ApplyDamping=function(t,e,i,n,r,s,a,o)
{if(r&&n)r.m_linearVelocity.SelfMulAdd(a*t,o),r.m_angularVelocity+=a*i*e;else{if(!
this.m_velocityBuffer.data)throw new
Error;this.m_velocityBuffer.data[s].SelfMulAdd(a*t,o)}},n.xTruncBits=12,n.yTruncBit
s=12,n.tagBits=32,n.yOffset=1<<n.yTruncBits-1,n.yShift=n.tagBits-
n.yTruncBits,n.xShift=n.tagBits-n.yTruncBits-
n.xTruncBits,n.xScale=1<<n.xShift,n.xOffset=n.xScale*(1<<n.xTruncBits-
1),n.yMask=(1<<n.yTruncBits)-
1<<n.yShift,n.xMask=~n.yMask,n.DestroyParticlesInShape_s_aabb=new
wt,n.CreateParticleGroup_s_transform=new N,n.ComputeCollisionEnergy_s_v=new
I,n.QueryShapeAABB_s_aabb=new wt,n.QueryPointAABB_s_aabb=new
wt,n.RayCast_s_aabb=new wt,n.RayCast_s_p=new I,n.RayCast_s_v=new
I,n.RayCast_s_n=new I,n.RayCast_s_point=new
I,n.k_pairFlags=t.b2ParticleFlag.b2_springParticle,n.k_triadFlags=t.b2ParticleFlag.
b2_elasticParticle,n.k_noPressureFlags=t.b2ParticleFlag.b2_powderParticle|
t.b2ParticleFlag.b2_tensileParticle,n.k_extraDampingFlags=t.b2ParticleFlag.b2_stati
cPressureParticle,n.k_barrierWallFlags=t.b2ParticleFlag.b2_barrierParticle|
t.b2ParticleFlag.b2_wallParticle,n.CreateParticlesStrokeShapeForGroup_s_edge=new
ii,n.CreateParticlesStrokeShapeForGroup_s_d=new
I,n.CreateParticlesStrokeShapeForGroup_s_p=new
I,n.CreateParticlesFillShapeForGroup_s_aabb=new
wt,n.CreateParticlesFillShapeForGroup_s_p=new I,n.UpdatePairsAndTriads_s_dab=new
I,n.UpdatePairsAndTriads_s_dbc=new I,n.UpdatePairsAndTriads_s_dca=new
I,n.AddContact_s_d=new I,n.UpdateBodyContacts_s_aabb=new wt,n.Solve_s_subStep=new
an,n.SolveCollision_s_aabb=new wt,n.SolveGravity_s_gravity=new
I,n.SolveBarrier_s_aabb=new wt,n.SolveBarrier_s_va=new I,n.SolveBarrier_s_vb=new
I,n.SolveBarrier_s_pba=new I,n.SolveBarrier_s_vba=new I,n.SolveBarrier_s_vc=new
I,n.SolveBarrier_s_pca=new I,n.SolveBarrier_s_vca=new I,n.SolveBarrier_s_qba=new
I,n.SolveBarrier_s_qca=new I,n.SolveBarrier_s_dv=new I,n.SolveBarrier_s_f=new
I,n.SolvePressure_s_f=new I,n.SolveDamping_s_v=new I,n.SolveDamping_s_f=new
I,n.SolveRigidDamping_s_t0=new I,n.SolveRigidDamping_s_t1=new
I,n.SolveRigidDamping_s_p=new I,n.SolveRigidDamping_s_v=new
I,n.SolveExtraDamping_s_v=new
I,n.SolveExtraDamping_s_f=new I,n.SolveRigid_s_position=new
I,n.SolveRigid_s_rotation=new V,n.SolveRigid_s_transform=new
N,n.SolveRigid_s_velocityTransform=new N,n.SolveElastic_s_pa=new
I,n.SolveElastic_s_pb=new I,n.SolveElastic_s_pc=new I,n.SolveElastic_s_r=new
V,n.SolveElastic_s_t0=new I,n.SolveSpring_s_pa=new I,n.SolveSpring_s_pb=new
I,n.SolveSpring_s_d=new I,n.SolveSpring_s_f=new
I,n.SolveTensile_s_weightedNormal=new I,n.SolveTensile_s_s=new
I,n.SolveTensile_s_f=new I,n.SolveViscous_s_v=new I,n.SolveViscous_s_f=new
I,n.SolveRepulsive_s_f=new I,n.SolvePowder_s_f=new I,n.SolveSolid_s_f=new
I,n.RemoveSpuriousBodyContacts_s_n=new I,n.RemoveSpuriousBodyContacts_s_pos=new
I,n.RemoveSpuriousBodyContacts_s_normal=new I,n})(),(function(e){var n=(function()
{return function(){this.data=null,this.userSuppliedCapacity=0}})
();e.UserOverridableBuffer=n;var r=(function(){function t()
{this.index=u,this.tag=0}return t.CompareProxyProxy=function(t,e){return
t.tag<e.tag},t.CompareTagProxy=function(t,e){return
t<e.tag},t.CompareProxyTag=function(t,e){return t.tag<e},t})();e.Proxy=r;var
s=(function(){function t(t,i,n,r,s)
{this.m_system=t,this.m_xLower=(i&e.xMask)>>>0,this.m_xUpper=(n&e.xMask)>>>0,this.m
_yLower=(i&e.yMask)>>>0,this.m_yUpper=(n&e.yMask)>>>0,this.m_first=r,this.m_last=s}
return t.prototype.GetNext=function(){for(;this.m_first<this.m_last;){var
t=(this.m_system.m_proxyBuffer.data[this.m_first].tag&e.xMask)>>>0;if(t>=this.m_xLo
wer&&t<=this.m_xUpper)return this.m_system.m_proxyBuffer.data[this.m_first+
+].index;this.m_first++}return u},t})();e.InsideBoundsEnumerator=s;var
a=(function(){return function(){this.next=null,this.count=0,this.index=0}})
();e.ParticleListNode=a;var o=(function(){function t(){}return
t.prototype.Allocate=function(t,e){return e},t.prototype.Clear=function()
{},t.prototype.GetCount=function(){return 0},t.prototype.Invalidate=function(t)
{},t.prototype.GetValidBuffer=function(){return[]},t.prototype.GetBuffer=function()
{return[]},t.prototype.SetCount=function(t){},t})();e.FixedSetAllocator=o;var
h=(function(){return function(t,e){this.second=u,this.first=t,this.second=e}})
();e.FixtureParticle=h;var c=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return
$e(e,t),e.prototype.Initialize=function(t,e){},e.prototype.Find=function(t){return
u},e})(e.FixedSetAllocator);e.FixtureParticleSet=c;var _=(function(){return
function(t,e){this.first=u,this.second=u,this.first=t,this.second=e}})
();e.ParticlePair=_;var f=(function(t){function e(){return null!
==t&&t.apply(this,arguments)||this}return
$e(e,t),e.prototype.Initialize=function(t,e){},e.prototype.Find=function(t){return
u},e})(e.FixedSetAllocator);e.b2ParticlePairSet=f;var d=(function(){function t()
{}return t.prototype.IsNecessary=function(t){return!
0},t.prototype.ShouldCreatePair=function(t,e){return!
0},t.prototype.ShouldCreateTriad=function(t,e,i){return!0},t})
();e.ConnectionFilter=d;var m=(function(t){function e(e,i,n,r){var s=t.call(this)||
this;return s.m_callDestructionListener=!
1,s.m_destroyed=0,s.m_system=e,s.m_shape=i,s.m_xf=n,s.m_callDestructionListener=r,s
.m_destroyed=0,s}return $e(e,t),e.prototype.ReportFixture=function(t){return!
1},e.prototype.ReportParticle=function(t,e){if(t!==this.m_system)return!1;if(!
this.m_system.m_positionBuffer.data)throw new Error;return
this.m_shape.TestPoint(this.m_xf,this.m_system.m_positionBuffer.data[e])&&(this.m_s
ystem.DestroyParticle(e,this.m_callDestructionListener),this.m_destroyed++),!
0},e.prototype.Destroyed=function(){return this.m_destroyed},e})
(en);e.DestroyParticlesInShapeCallback=m;var p=(function(t){function e(e){var
i=t.call(this)||this;return i.m_threshold=0,i.m_threshold=e,i}return
$e(e,t),e.prototype.ShouldCreatePair=function(t,e){return
t<this.m_threshold&&this.m_threshold<=e||
e<this.m_threshold&&this.m_threshold<=t},e.prototype.ShouldCreateTriad=function(t,e
,i){return(t<this.m_threshold||e<this.m_threshold||
i<this.m_threshold)&&(this.m_threshold<=t||this.m_threshold<=e||
this.m_threshold<=i)},e})(e.ConnectionFilter);e.JoinParticleGroupsFilter=p;var
v=(function(e){function n(i,n){void 0===n&&(n=i.length);var
r=e.call(this,t.b2ShapeType.e_unknown,0)||this;return
r.m_shapeCount=0,r.m_shapes=i,r.m_shapeCount=n,r}return
$e(n,e),n.prototype.Clone=function(){throw new
Error},n.prototype.GetChildCount=function(){return
1},n.prototype.TestPoint=function(t,e){for(var i=0;i<this.m_shapeCount;i+
+)if(this.m_shapes[i].TestPoint(t,e))return!0;return!
1},n.prototype.ComputeDistance=function(t,e,i,n){return
0},n.prototype.RayCast=function(t,e,i,n){return!
1},n.prototype.ComputeAABB=function(t,e,n){var r=new
wt;t.lowerBound.x=+i,t.lowerBound.y=+i,t.upperBound.x=-i,t.upperBound.y=-i;for(var
s=0;s<this.m_shapeCount;s++)for(var a=this.m_shapes[s].GetChildCount(),o=0;o<a;o++)
{var
l=r;this.m_shapes[s].ComputeAABB(l,e,o),t.Combine1(l)}},n.prototype.ComputeMass=fun
ction(t,e){},n.prototype.SetupDistanceProxy=function(t,e)
{},n.prototype.ComputeSubmergedArea=function(t,e,i,n){return
0},n.prototype.Dump=function(t){},n})(Ke);e.CompositeShape=v;var y=(function(e)
{function i(t){var i=e.call(this)||this;return i.m_flagsBuffer=t,i}return
$e(i,e),i.prototype.IsNecessary=function(e){if(!this.m_flagsBuffer.data)throw new
Error;return 0!
=(this.m_flagsBuffer.data[e]&t.b2ParticleFlag.b2_reactiveParticle)},i})
(e.ConnectionFilter);e.ReactiveFilter=y;var g=(function(i){function n(t,e){var
n=i.call(this,t)||this;return n.m_contactFilter=e,n}return
$e(n,i),n.prototype.ShouldCollideFixtureParticle=function(e,i,n)
{if(this.m_contactFilter&&this.m_system.GetFlagsBuffer()
[n]&t.b2ParticleFlag.b2_fixtureContactFilterParticle)return
this.m_contactFilter.ShouldCollideFixtureParticle(e,this.m_system,n);return!
0},n.prototype.ReportFixtureAndParticle=function(i,n,r){var
s=e.UpdateBodyContactsCallback.ReportFixtureAndParticle_s_n,a=e.UpdateBodyContactsC
allback.ReportFixtureAndParticle_s_rp;if(!this.m_system.m_flagsBuffer.data)throw
new Error;if(!this.m_system.m_positionBuffer.data)throw new Error;var
o=this.m_system.m_positionBuffer.data[r],l=s,h=i.ComputeDistance(o,l,n);if(h<this.m
_system.m_particleDiameter&&this.ShouldCollideFixtureParticle(i,this.m_system,r))
{var c=i.GetBody(),u=c.GetWorldCenter(),_=c.GetMass(),f=c.GetInertia()-
_*c.GetLocalCenter().LengthSquared(),d=_>0?1/_:0,m=f>0?
1/f:0,p=this.m_system.m_flagsBuffer.data[r]&t.b2ParticleFlag.b2_wallParticle?
0:this.m_system.GetParticleInvMass(),v=I.SubVV(o,u,a),y=I.CrossVV(v,l),g=p+d+m*y*y,
x=this.m_system.m_bodyContactBuffer.data[this.m_system.m_bodyContactBuffer.Append()
];x.index=r,x.body=c,x.fixture=i,x.weight=1-
h*this.m_system.m_inverseDiameter,x.normal.Copy(l.SelfNeg()),x.mass=g>0?
1/g:0,this.m_system.DetectStuckParticle(r)}},n.ReportFixtureAndParticle_s_n=new
I,n.ReportFixtureAndParticle_s_rp=new I,n})(On);e.UpdateBodyContactsCallback=g;var
x=(function(i){function n(t,e){var n=i.call(this,t)||this;return
n.m_step=e,n}return $e(n,i),n.prototype.ReportFixtureAndParticle=function(i,n,r)
{var
s=e.SolveCollisionCallback.ReportFixtureAndParticle_s_p1,a=e.SolveCollisionCallback
.ReportFixtureAndParticle_s_output,o=e.SolveCollisionCallback.ReportFixtureAndParti
cle_s_input,h=e.SolveCollisionCallback.ReportFixtureAndParticle_s_p,c=e.SolveCollis
ionCallback.ReportFixtureAndParticle_s_v,u=e.SolveCollisionCallback.ReportFixtureAn
dParticle_s_f,_=i.GetBody();if(!this.m_system.m_positionBuffer.data)throw new
Error;if(!this.m_system.m_velocityBuffer.data)throw new Error;var
f=this.m_system.m_positionBuffer.data[r],d=this.m_system.m_velocityBuffer.data[r],m
=a,p=o;if(0===this.m_system.m_iterationIndex){var
v=N.MulTXV(_.m_xf0,f,s);i.GetShape().GetType()===t.b2ShapeType.e_circleShape&&(v.Se
lfSub(_.GetLocalCenter()),V.MulRV(_.m_xf0.q,v,v),V.MulTRV(_.m_xf.q,v,v),v.SelfAdd(_
.GetLocalCenter())),N.MulXV(_.m_xf,v,p.p1)}else
p.p1.Copy(f);if(I.AddVMulSV(f,this.m_step.dt,d,p.p2),p.maxFraction=1,i.RayCast(m,p,
n)){var y=m.normal,g=h;g.x=(1-m.fraction)*p.p1.x+m.fraction*p.p2.x+l*y.x,g.y=(1-
m.fraction)*p.p1.y+m.fraction*p.p2.y+l*y.y;var x=c;x.x=this.m_step.inv_dt*(g.x-
f.x),x.y=this.m_step.inv_dt*(g.y-
f.y),this.m_system.m_velocityBuffer.data[r].Copy(x);var
b=u;b.x=this.m_step.inv_dt*this.m_system.GetParticleMass()*(d.x-
x.x),b.y=this.m_step.inv_dt*this.m_system.GetParticleMass()*(d.y-
x.y),this.m_system.ParticleApplyForce(r,b)}},n.prototype.ReportParticle=function(t,
e){return!1},n.ReportFixtureAndParticle_s_p1=new
I,n.ReportFixtureAndParticle_s_output=new Tt,n.ReportFixtureAndParticle_s_input=new
St,n.ReportFixtureAndParticle_s_p=new I,n.ReportFixtureAndParticle_s_v=new
I,n.ReportFixtureAndParticle_s_f=new I,n})(On);e.SolveCollisionCallback=x})
(t.b2ParticleSystem||(t.b2ParticleSystem={}));var Gn=(function(){function e(t)
{this.m_newFixture=!1,this.m_locked=!1,this.m_clearForces=!
0,this.m_contactManager=new
rn,this.m_bodyList=null,this.m_jointList=null,this.m_particleSystemList=null,this.m
_bodyCount=0,this.m_jointCount=0,this.m_gravity=new I,this.m_allowSleep=!
0,this.m_destructionListener=null,this.m_debugDraw=null,this.m_inv_dt0=0,this.m_war
mStarting=!0,this.m_continuousPhysics=!0,this.m_subStepping=!
1,this.m_stepComplete=!0,this.m_profile=new sn,this.m_island=new
pn,this.s_stack=[],this.m_controllerList=null,this.m_controllerCount=0,this.m_gravi
ty.Copy(t)}return e.prototype.SetDestructionListener=function(t)
{this.m_destructionListener=t},e.prototype.SetContactFilter=function(t)
{this.m_contactManager.m_contactFilter=t},e.prototype.SetContactListener=function(t
){this.m_contactManager.m_contactListener=t},e.prototype.SetDebugDraw=function(t)
{this.m_debugDraw=t},e.prototype.CreateBody=function(t){if(void
0===t&&(t={}),this.IsLocked())throw new Error;var e=new hi(t,this);return
e.m_prev=null,e.m_next=this.m_bodyList,this.m_bodyList&&(this.m_bodyList.m_prev=e),
this.m_bodyList=e,++this.m_bodyCount,e},e.prototype.DestroyBody=function(t)
{if(this.IsLocked())throw new Error;for(var e=t.m_jointList;e;){var
i=e;e=e.next,this.m_destructionListener&&this.m_destructionListener.SayGoodbyeJoint
(i.joint),this.DestroyJoint(i.joint
),t.m_jointList=e}t.m_jointList=null;for(var n=t.m_controllerList;n;){var
r=n;n=n.nextController,r.controller.RemoveBody(t)}for(var s=t.m_contactList;s;){var
a=s;s=s.next,this.m_contactManager.Destroy(a.contact)}t.m_contactList=null;for(var
o=t.m_fixtureList;o;){var
l=o;o=o.m_next,this.m_destructionListener&&this.m_destructionListener.SayGoodbyeFix
ture(l),l.DestroyProxies(),l.Destroy(),t.m_fixtureList=o,t.m_fixtureCount-
=1}t.m_fixtureList=null,t.m_fixtureCount=0,t.m_prev&&(t.m_prev.m_next=t.m_next),t.m
_next&&(t.m_next.m_prev=t.m_prev),t===this.m_bodyList&&(this.m_bodyList=t.m_next),-
-this.m_bodyCount},e._Joint_Create=function(e,i){switch(e.type){case
t.b2JointType.e_distanceJoint:return new mi(e);case
t.b2JointType.e_mouseJoint:return new Ti(e);case
t.b2JointType.e_prismaticJoint:return new Ei(e);case
t.b2JointType.e_revoluteJoint:return new Pi(e);case
t.b2JointType.e_pulleyJoint:return new Di(e);case t.b2JointType.e_gearJoint:return
new bi(e);case t.b2JointType.e_wheelJoint:return new Vi(e);case
t.b2JointType.e_weldJoint:return new Li(e);case
t.b2JointType.e_frictionJoint:return new gi(e);case
t.b2JointType.e_ropeJoint:return new Ri(e);case t.b2JointType.e_motorJoint:return
new Ci(e);case t.b2JointType.e_areaJoint:return new vi(e)}throw new
Error},e._Joint_Destroy=function(t,e){},e.prototype.CreateJoint=function(t)
{if(this.IsLocked())throw new Error;var
i=e._Joint_Create(t,null);i.m_prev=null,i.m_next=this.m_jointList,this.m_jointList&
&(this.m_jointList.m_prev=i),this.m_jointList=i,+
+this.m_jointCount,i.m_edgeA.prev=null,i.m_edgeA.next=i.m_bodyA.m_jointList,i.m_bod
yA.m_jointList&&(i.m_bodyA.m_jointList.prev=i.m_edgeA),i.m_bodyA.m_jointList=i.m_ed
geA,i.m_edgeB.prev=null,i.m_edgeB.next=i.m_bodyB.m_jointList,i.m_bodyB.m_jointList&
&(i.m_bodyB.m_jointList.prev=i.m_edgeB),i.m_bodyB.m_jointList=i.m_edgeB;var
n=t.bodyA,r=t.bodyB;if(!t.collideConnected)for(var
s=r.GetContactList();s;)s.other===n&&s.contact.FlagForFiltering(),s=s.next;return
i},e.prototype.DestroyJoint=function(t){if(this.IsLocked())throw new Error;var
i=t.m_collideConnected;t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_next.m_p
rev=t.m_prev),t===this.m_jointList&&(this.m_jointList=t.m_next);var
n=t.m_bodyA,r=t.m_bodyB;if(n.SetAwake(!0),r.SetAwake(!
0),t.m_edgeA.prev&&(t.m_edgeA.prev.next=t.m_edgeA.next),t.m_edgeA.next&&(t.m_edgeA.
next.prev=t.m_edgeA.prev),t.m_edgeA===n.m_jointList&&(n.m_jointList=t.m_edgeA.next)
,t.m_edgeA.prev=null,t.m_edgeA.next=null,t.m_edgeB.prev&&(t.m_edgeB.prev.next=t.m_e
dgeB.next),t.m_edgeB.next&&(t.m_edgeB.next.prev=t.m_edgeB.prev),t.m_edgeB===r.m_joi
ntList&&(r.m_jointList=t.m_edgeB.next),t.m_edgeB.prev=null,t.m_edgeB.next=null,e._J
oint_Destroy(t,null),--this.m_jointCount,!i)for(var
s=r.GetContactList();s;)s.other===n&&s.contact.FlagForFiltering(),s=s.next},e.proto
type.CreateParticleSystem=function(e){if(this.IsLocked())throw new Error;var i=new
t.b2ParticleSystem(e,this);return
i.m_prev=null,i.m_next=this.m_particleSystemList,this.m_particleSystemList&&(this.m
_particleSystemList.m_prev=i),this.m_particleSystemList=i,i},e.prototype.DestroyPar
ticleSystem=function(t){if(this.IsLocked())throw new
Error;t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_next.m_prev=t.m_prev),t==
=this.m_particleSystemList&&(this.m_particleSystemList=t.m_next)},e.prototype.Calcu
lateReasonableParticleIterations=function(t)
{if(null===this.m_particleSystemList)return 1;return yn(this.m_gravity.Length(),
(function(t){for(var e=i,n=t.GetParticleSystemList();null!
==n;n=n.m_next)e=g(e,n.GetRadius());return e})
(this),t)},e.prototype.Step=function(t,i,n,r){void
0===r&&(r=this.CalculateReasonableParticleIterations(t));var
s=e.Step_s_stepTimer.Reset();this.m_newFixture&&(this.m_contactManager.FindNewConta
cts(),this.m_newFixture=!1),this.m_locked=!0;var
a=e.Step_s_step;a.dt=t,a.velocityIterations=i,a.positionIterations=n,a.particleIter
ations=r,a.inv_dt=t>0?
1/t:0,a.dtRatio=this.m_inv_dt0*t,a.warmStarting=this.m_warmStarting;var
o=e.Step_s_timer.Reset();if(this.m_contactManager.Collide(),this.m_profile.collide=
o.GetMilliseconds(),this.m_stepComplete&&a.dt>0){for(var
l=e.Step_s_timer.Reset(),h=this.m_particleSystemList;h;h=h.m_next)h.Solve(a);this.S
olve(a),this.m_profile.solve=l.GetMilliseconds()}if(this.m_continuousPhysics&&a.dt>
0){var
c=e.Step_s_timer.Reset();this.SolveTOI(a),this.m_profile.solveTOI=c.GetMilliseconds
()}a.dt>0&&(this.m_inv_dt0=a.inv_dt),this.m_clearForces&&this.ClearForces(),this.m_
locked=!
1,this.m_profile.step=s.GetMilliseconds()},e.prototype.ClearForces=function()
{for(var
t=this.m_bodyList;t;t=t.m_next)t.m_force.SetZero(),t.m_torque=0},e.prototype.DrawPa
rticleSystem=function(t){if(null!==this.m_debugDraw){var
e=t.GetParticleCount();if(e){var
i=t.GetRadius(),n=t.GetPositionBuffer();if(t.m_colorBuffer.data){var
r=t.GetColorBuffer();this.m_debugDraw.DrawParticles(n,i,r,e)}else
this.m_debugDraw.DrawParticles(n,i,null,e)}}},e.prototype.DrawDebugData=function()
{if(null!==this.m_debugDraw){var
i=this.m_debugDraw.GetFlags(),n=e.DrawDebugData_s_color.SetRGB(0,0,0);if(i&t.b2Draw
Flags.e_shapeBit)for(var r=this.m_bodyList;r;r=r.m_next){var
s=r.m_xf;this.m_debugDraw.PushTransform(s);for(var
a=r.GetFixtureList();a;a=a.m_next)r.IsActive()?
r.GetType()===t.b2BodyType.b2_staticBody?
(n.SetRGB(.5,.9,.5),this.DrawShape(a,n)):r.GetType()===t.b2BodyType.b2_kinematicBod
y?(n.SetRGB(.5,.5,.9),this.DrawShape(a,n)):r.IsAwake()?
(n.SetRGB(.9,.7,.7),this.DrawShape(a,n)):(n.SetRGB(.6,.6,.6),this.DrawShape(a,n)):
(n.SetRGB(.5,.5,.3),this.DrawShape(a,n));this.m_debugDraw.PopTransform(s)}if(i&t.b2
DrawFlags.e_particleBit)for(var
o=this.m_particleSystemList;o;o=o.m_next)this.DrawParticleSystem(o);if(i&t.b2DrawFl
ags.e_jointBit)for(var
l=this.m_jointList;l;l=l.m_next)this.DrawJoint(l);if(i&t.b2DrawFlags.e_aabbBit)
{n.SetRGB(.9,.3,.9);var
h=e.DrawDebugData_s_vs;for(r=this.m_bodyList;r;r=r.m_next)if(r.IsActive())for(a=r.G
etFixtureList();a;a=a.m_next)for(var c=0;c<a.m_proxyCount;++c){var
u=a.m_proxies[c].treeNode.aabb;h[0].Set(u.lowerBound.x,u.lowerBound.y),h[1].Set(u.u
pperBound.x,u.lowerBound.y),h[2].Set(u.upperBound.x,u.upperBound.y),h[3].Set(u.lowe
rBound.x,u.upperBound.y),this.m_debugDraw.DrawPolygon(h,4,n)}}if(i&t.b2DrawFlags.e_
centerOfMassBit)for(r=this.m_bodyList;r;r=r.m_next)
{(s=e.DrawDebugData_s_xf).q.Copy(r.m_xf.q),s.p.Copy(r.GetWorldCenter()),this.m_debu
gDraw.DrawTransform(s)}if(i&t.b2DrawFlags.e_controllerBit)for(var
_=this.m_controllerList;_;_=_.m_next)_.Draw(this.m_debugDraw)}},e.prototype.QueryAA
BB=function(t,e,i){if(this.m_contactManager.m_broadPhase.Query(e,(function(e){var
n=e.userData.fixture;return t?t.ReportFixture(n):!i||i(n)})),t instanceof
en)for(var
n=this.m_particleSystemList;n;n=n.m_next)t.ShouldQueryParticleSystem(n)&&n.QueryAAB
B(t,e)},e.prototype.QueryAllAABB=function(t,e){return void
0===e&&(e=[]),this.QueryAABB(null,t,(function(t){return e.push(t),!
0})),e},e.prototype.QueryPointAABB=function(t,e,i)
{if(this.m_contactManager.m_broadPhase.QueryPoint(e,(function(e){var
n=e.userData.fixture;return t?t.ReportFixture(n):!i||i(n)})),t instanceof
en)for(var
n=this.m_particleSystemList;n;n=n.m_next)t.ShouldQueryParticleSystem(n)&&n.QueryPoi
ntAABB(t,e)},e.prototype.QueryAllPointAABB=function(t,e){return void
0===e&&(e=[]),this.QueryPointAABB(null,t,(function(t){return e.push(t),!
0})),e},e.prototype.QueryFixtureShape=function(t,i,n,r,s){var
a=e.QueryFixtureShape_s_aabb;if(i.ComputeAABB(a,r,n),this.m_contactManager.m_broadP
hase.Query(a,(function(e){var
a=e.userData,o=a.fixture;if(It(i,n,o.GetShape(),a.childIndex,r,o.GetBody().GetTrans
form())){if(t)return t.ReportFixture(o);if(s)return s(o)}return!0})),t instanceof
en)for(var
o=this.m_particleSystemList;o;o=o.m_next)t.ShouldQueryParticleSystem(o)&&o.QueryAAB
B(t,a)},e.prototype.QueryAllFixtureShape=function(t,e,i,n){return void
0===n&&(n=[]),this.QueryFixtureShape(null,t,e,i,(function(t){return n.push(t),!
0})),n},e.prototype.QueryFixturePoint=function(t,e,i)
{if(this.m_contactManager.m_broadPhase.QueryPoint(e,(function(n){var
r=n.userData.fixture;if(r.TestPoint(e)){if(t)return t.ReportFixture(r);if(i)return
i(r)}return!0})),t)for(var
n=this.m_particleSystemList;n;n=n.m_next)t.ShouldQueryParticleSystem(n)&&n.QueryPoi
ntAABB(t,e)},e.prototype.QueryAllFixturePoint=function(t,e){return void
0===e&&(e=[]),this.QueryFixturePoint(null,t,(function(t){return e.push(t),!
0})),e},e.prototype.RayCast=function(t,i,n,r){var
s=e.RayCast_s_input;if(s.maxFraction=1,s.p1.Copy(i),s.p2.Copy(n),this.m_contactMana
ger.m_broadPhase.RayCast(s,(function(s,a){var
o=a.userData,l=o.fixture,h=o.childIndex,c=e.RayCast_s_output;if(l.RayCast(c,s,h))
{var u=c.fraction,_=e.RayCast_s_point;if(_.Set((1-u)*i.x+u*n.x,(1-
u)*i.y+u*n.y),t)return t.ReportFixture(l,_,c.normal,u);if(r)return
r(l,_,c.normal,u)}return s.maxFraction})),t)for(var
a=this.m_particleSystemList;a;a=a.m_next)t.ShouldQueryParticleSystem(a)&&a.RayCast(
t,i,n)},e.prototype.RayCastOne=function(t,e){var i=null,n=1;return
this.RayCast(null,t,e,(function(t,e,r,s){return
s<n&&(n=s,i=t),n})),i},e.prototype.RayCastAll=function(t,e,i){return void
0===i&&(i=[]),this.RayCast(null,t,e,(function(t,e,n,r){return
i.push(t),1})),i},e.prototype.GetBodyList=function(){return
this.m_bodyList},e.prototype.GetJointList=function(){return
this.m_jointList},e.prototype.GetParticleSystemList=function(){return
this.m_particleSystemList},e.prototype.GetContactList=function(){return
this.m_contactManager.m_contactList},e.prototype.SetAllowSleeping=function(t){if(t!
==this.m_allowSleep&&(this.m_allowSleep=t,!this.m_allowSleep))for(var
e=this.m_bodyList;e;e=e.m_next)e.SetAwake(!
0)},e.prototype.GetAllowSleeping=function(){return
this.m_allowSleep},e.prototype.SetWarmStarting=function(t)
{this.m_warmStarting=t},e.prototype.GetWarmStarting=function(){return
this.m_warmStarting},e.prototype.SetContinuousPhysics=function(t)
{this.m_continuousPhysics=t},e.prototype.GetContinuousPhysics=function(){return
this.m_continuousPhysics},e.prototype.SetSubStepping=function(t)
{this.m_subStepping=t},e.prototype.GetSubStepping=function(){return
this.m_subStepping},e.prototype.GetProxyCount=function(){return
this.m_contactManager.m_broadPhase.GetProxyCount()},e.prototype.GetBodyCount=functi
on(){return this.m_bodyCount},e.prototype.GetJointCount=function(){return
this.m_jointCount},e.prototype.GetContactCount=function(){return
this.m_contactManager.m_contactCount},e.prototype.GetTreeHeight=function(){return
this.m_contactManager.m_broadPhase.GetTreeHeight()},e.prototype.GetTreeBalance=func
tion(){return
this.m_contactManager.m_broadPhase.GetTreeBalance()},e.prototype.GetTreeQuality=fun
ction(){return
this.m_contactManager.m_broadPhase.GetTreeQuality()},e.prototype.SetGravity=functio
n(t,e){if(void 0===e&&(e=!0),!
I.IsEqualToV(this.m_gravity,t)&&(this.m_gravity.Copy(t),e))for(var
i=this.m_bodyList;i;i=i.m_next)i.SetAwake(!0)},e.prototype.GetGravity=function()
{return this.m_gravity},e.prototype.IsLocked=function(){return
this.m_locked},e.prototype.SetAutoClearForces=function(t)
{this.m_clearForces=t},e.prototype.GetAutoClearForces=function(){return
this.m_clearForces},e.prototype.ShiftOrigin=function(t){if(this.IsLocked())throw
new Error;for(var
e=this.m_bodyList;e;e=e.m_next)e.m_xf.p.SelfSub(t),e.m_sweep.c0.SelfSub(t),e.m_swee
p.c.SelfSub(t);for(var
i=this.m_jointList;i;i=i.m_next)i.ShiftOrigin(t);this.m_contactManager.m_broadPhase
.ShiftOrigin(t)},e.prototype.GetContactManager=function(){return
this.m_contactManager},e.prototype.GetProfile=function(){return
this.m_profile},e.prototype.Dump=function(e){if(!this.m_locked){e("const g: b2Vec2
= new b2Vec2(%.15f,
%.15f);\n",this.m_gravity.x,this.m_gravity.y),e("this.m_world.SetGravity(g);\n"),e(
"const bodies: b2Body[] = [];\n"),e("const joints: b2Joint[] = [];\n");for(var
i=0,n=this.m_bodyList;n;n=n.m_next)n.m_islandIndex=i,n.Dump(e),++i;i=0;for(var
r=this.m_jointList;r;r=r.m_next)r.m_index=i,+
+i;for(r=this.m_jointList;r;r=r.m_next)r.m_type!
==t.b2JointType.e_gearJoint&&(e("{\n"),r.Dump(e),e("}\n"));for(r=this.m_jointList;r
;r=r.m_next)r.m_type===t.b2JointType.e_gearJoint&&(e("{\n"),r.Dump(e),e("}\n"))}},e
.prototype.DrawJoint=function(i){if(null!==this.m_debugDraw){var
n=i.GetBodyA(),r=i.GetBodyB(),s=n.m_xf,a=r.m_xf,o=s.p,l=a.p,h=i.GetAnchorA(e.DrawJo
int_s_p1),c=i.GetAnchorB(e.DrawJoint_s_p2),u=e.DrawJoint_s_color.SetRGB(.5,.8,.8);s
witch(i.m_type){case
t.b2JointType.e_distanceJoint:this.m_debugDraw.DrawSegment(h,c,u);break;case
t.b2JointType.e_pulleyJoint:var
_=i,f=_.GetGroundAnchorA(),d=_.GetGroundAnchorB();this.m_debugDraw.DrawSegment(f,h,
u),this.m_debugDraw.DrawSegment(d,c,u),this.m_debugDraw.DrawSegment(f,d,u);break;ca
se t.b2JointType.e_mouseJoint:var
m=e.DrawJoint_s_c;m.Set(0,1,0),this.m_debugDraw.DrawPoint(h,4,m),this.m_debugDraw.D
rawPoint(c,4,m),m.Set(.8,.8,.8),this.m_debugDraw.DrawSegment(h,c,m);break;default:t
his.m_debugDraw.DrawSegment(o,h,u),this.m_debugDraw.DrawSegment(h,c,u),this.m_debug
Draw.DrawSegment(l,c,u)}}},e.prototype.DrawShape=function(i,n){if(null!
==this.m_debugDraw){var r=i.GetShape();switch(r.m_type){case
t.b2ShapeType.e_circleShape:var
s=r,a=s.m_p,o=s.m_radius,l=I.UNITX;this.m_debugDraw.DrawSolidCircle(a,o,l,n);break;
case t.b2ShapeType.e_edgeShape:var
h=r,c=h.m_vertex1,u=h.m_vertex2;this.m_debugDraw.DrawSegment(c,u,n);break;case
t.b2ShapeType.e_chainShape:var
_=r,f=_.m_count,d=_.m_vertices,m=e.DrawShape_s_ghostColor.SetRGBA(.75*n.r,.75*n.g,.
75*n.b,n.a);c=d[0];if(this.m_debugDraw.DrawPoint(c,4,n),_.m_hasPrevVertex){var
p=_.m_prevVertex;this.m_debugDraw.DrawSegment(p,c,m),this.m_debugDraw.DrawCircle(p,
.1,m)}for(var v=1;v<f;++v)
{u=d[v];this.m_debugDraw.DrawSegment(c,u,n),this.m_debugDraw.DrawPoint(u,4,n),c=u}i
f(_.m_hasNextVertex){var
y=_.m_nextVertex;this.m_debugDraw.DrawSegment(y,c,m),this.m_debugDraw.DrawCircle(y,
.1,m)}break;case t.b2ShapeType.e_polygonShape:var
g=r,x=g.m_count;d=g.m_vertices;this.m_debugDraw.DrawSolidPolygon(d,x,n)}}},e.protot
ype.Solve=function(e){for(var
i=this.m_bodyList;i;i=i.m_next)i.m_xf0.Copy(i.m_xf);for(var
n=this.m_controllerList;n;n=n.m_next)n.Step(e);this.m_profile.solveInit=0,this.m_pr
ofile.solveVelocity=0,this.m_profile.solvePosition=0;var
r=this.m_island;r.Initialize(this.m_bodyCount,this.m_contactManager.m_contactCount,
this.m_jointCount,null,this.m_contactManager.m_contactListener);for(i=this.m_bodyLi
st;i;i=i.m_next)i.m_islandFlag=!1;for(var
s=this.m_contactManager.m_contactList;s;s=s.m_next)s.m_islandFlag=!1;for(var
a=this.m_jointList;a;a=a.m_next)a.m_islandFlag=!1;for(var
o=this.s_stack,l=this.m_bodyList;l;l=l.m_next)if(!
l.m_islandFlag&&l.IsAwake()&&l.IsActive()&&l.GetType()!
==t.b2BodyType.b2_staticBody){r.Clear();var h=0;for(o[h++]=l,l.m_islandFlag=!
0;h>0;){if(!(i=o[--h]))throw new Error;if(r.AddBody(i),i.m_awakeFlag=!
0,i.GetType()!==t.b2BodyType.b2_staticBody){for(var c=i.m_contactList;c;c=c.next)
{var u=c.contact;if(!u.m_islandFlag&&(u.IsEnabled()&&u.IsTouching())){var
_=u.m_fixtureA.m_isSensor,f=u.m_fixtureB.m_isSensor;if(!_&&!f)
{if(r.AddContact(u),u.m_islandFlag=!0,!(m=c.other))throw new Error;m.m_islandFlag||
(o[h++]=m,m.m_islandFlag=!0)}}}for(var d=i.m_jointList;d;d=d.next){var m;if(!
d.joint.m_islandFlag)
(m=d.other).IsActive()&&(r.AddJoint(d.joint),d.joint.m_islandFlag=!
0,m.m_islandFlag||(o[h++]=m,m.m_islandFlag=!0))}}}var p=new
sn;r.Solve(p,e,this.m_gravity,this.m_allowSleep),this.m_profile.solveInit+=p.solveI
nit,this.m_profile.solveVelocity+=p.solveVelocity,this.m_profile.solvePosition+=p.s
olvePosition;for(var v=0;v<r.m_bodyCount;++v)
{(i=r.m_bodies[v]).GetType()===t.b2BodyType.b2_staticBody&&(i.m_islandFlag=!
1)}}for(v=0;v<o.length&&o[v];++v)o[v]=null;var y=new
U;for(i=this.m_bodyList;i;i=i.m_next)i.m_islandFlag&&i.GetType()!
==t.b2BodyType.b2_staticBody&&i.SynchronizeFixtures();this.m_contactManager.FindNew
Contacts(),this.m_profile.broadphase=y.GetMilliseconds()},e.prototype.SolveTOI=func
tion(i){var
r=this.m_island;if(r.Initialize(64,32,0,null,this.m_contactManager.m_contactListene
r),this.m_stepComplete){for(var s=this.m_bodyList;s;s=s.m_next)s.m_islandFlag=!
1,s.m_sweep.alpha0=0;for(var
a=this.m_contactManager.m_contactList;a;a=a.m_next)a.m_toiFlag=!1,a.m_islandFlag=!
1,a.m_toiCount=0,a.m_toi=1}for(;;){var
o=null,l=1;for(a=this.m_contactManager.m_contactList;a;a=a.m_next)if(a.IsEnabled()&
&!(a.m_toiCount>8)){var h=1;if(a.m_toiFlag)h=a.m_toi;else{var
c=a.GetFixtureA(),u=a.GetFixtureB();if(c.IsSensor()||u.IsSensor())continue;var
_=c.GetBody(),f=u.GetBody(),d=_.m_type,m=f.m_type,p=_.IsAwake()&&d!
==t.b2BodyType.b2_staticBody,v=f.IsAwake()&&m!==t.b2BodyType.b2_staticBody;if(!p&&!
v)continue;var y=_.IsBullet()||d!==t.b2BodyType.b2_dynamicBody,x=f.IsBullet()||m!
==t.b2BodyType.b2_dynamicBody;if(!y&&!x)continue;var
b=_.m_sweep.alpha0;_.m_sweep.alpha0<f.m_sweep.alpha0?
(b=f.m_sweep.alpha0,_.m_sweep.Advance(b)):f.m_sweep.alpha0<_.m_sweep.alpha0&&(b=_.m
_sweep.alpha0,f.m_sweep.Advance(b));var
A=a.GetChildIndexA(),C=a.GetChildIndexB(),S=e.SolveTOI_s_toi_input;S.proxyA.SetShap
e(c.GetShape(),A),S.proxyB.SetShape(u.GetShape(),C),S.sweepA.Copy(_.m_sweep),S.swee
pB.Copy(f.m_sweep),S.tMax=1;var T=e.SolveTOI_s_toi_output;re(T,S);var
w=T.t;h=T.state===t.b2TOIOutputState.e_touching?g(b+(1-
b)*w,1):1,a.m_toi=h,a.m_toiFlag=!0}h<l&&(o=a,l=h)}if(null===o||1-10*n<l)
{this.m_stepComplete=!0;break}var
E=o.GetFixtureA(),M=o.GetFixtureB(),D=E.GetBody(),B=M.GetBody(),P=e.SolveTOI_s_back
up1.Copy(D.m_sweep),I=e.SolveTOI_s_backup2.Copy(B.m_sweep);if(D.Advance(l),B.Advanc
e(l),o.Update(this.m_contactManager.m_contactListener),o.m_toiFlag=!1,+
+o.m_toiCount,o.IsEnabled()&&o.IsTouching()){D.SetAwake(!0),B.SetAwake(!
0),r.Clear(),r.AddBody(D),r.AddBody(B),r.AddContact(o),D.m_islandFlag=!
0,B.m_islandFlag=!0,o.m_islandFlag=!0;for(var R=0;R<2;++R){if((z=0===R?
D:B).m_type===t.b2BodyType.b2_dynamicBody)for(var
O=z.m_contactList;O&&r.m_bodyCount!==r.m_bodyCapacity&&r.m_contactCount!
==r.m_contactCapacity;O=O.next){var L=O.contact;if(!L.m_islandFlag){var
F=O.other;if(F.m_type!==t.b2BodyType.b2_dynamicBody||z.IsBullet()||F.IsBullet())
{var V=L.m_fixtureA.m_isSensor,N=L.m_fixtureB.m_isSensor;if(!V&&!N){var
k=e.SolveTOI_s_backup.Copy(F.m_sweep);F.m_islandFlag||
F.Advance(l),L.Update(this.m_contactManager.m_contactListener),L.IsEnabled()&&L.IsT
ouching()?(L.m_islandFlag=!0,r.AddContact(L),F.m_islandFlag||(F.m_islandFlag=!
0,F.m_type!==t.b2BodyType.b2_staticBody&&F.SetAwake(!0),r.AddBody(F))):
(F.m_sweep.Copy(k),F.SynchronizeTransform())}}}}}var
G=e.SolveTOI_s_subStep;G.dt=(1-
l)*i.dt,G.inv_dt=1/G.dt,G.dtRatio=1,G.positionIterations=20,G.velocityIterations=i.
velocityIterations,G.particleIterations=i.particleIterations,G.warmStarting=!
1,r.SolveTOI(G,D.m_islandIndex,B.m_islandIndex);for(R=0;R<r.m_bodyCount;++R){var
z;if((z=r.m_bodies[R]).m_islandFlag=!1,z.m_type===t.b2BodyType.b2_dynamicBody)
{z.SynchronizeFixtures();for(O=z.m_contactList;O;O=O.next)O.contact.m_toiFlag=!
1,O.contact.m_islandFlag=!
1}}if(this.m_contactManager.FindNewContacts(),this.m_subStepping)
{this.m_stepComplete=!1;break}}else o.SetEnabled(!
1),D.m_sweep.Copy(P),B.m_sweep.Copy(I),D.SynchronizeTransform(),B.SynchronizeTransf
orm()}},e.prototype.AddController=function(t){return
t.m_next=this.m_controllerList,t.m_prev=null,this.m_controllerList&&(this.m_control
lerList.m_prev=t),this.m_controllerList=t,+
+this.m_controllerCount,t},e.prototype.RemoveController=function(t){return
t.m_prev&&(t.m_prev.m_next=t.m_next),t.m_next&&(t.m_next.m_prev=t.m_prev),this.m_co
ntrollerList===t&&(this.m_controllerList=t.m_next),--
this.m_controllerCount,t.m_prev=null,t.m_next=null,t},e.Step_s_step=new
an,e.Step_s_stepTimer=new U,e.Step_s_timer=new U,e.DrawDebugData_s_color=new
G(0,0,0),e.DrawDebugData_s_vs=I.MakeArray(4),e.DrawDebugData_s_xf=new
N,e.QueryFixtureShape_s_aabb=new wt,e.RayCast_s_input=new St,e.RayCast_s_output=new
Tt,e.RayCast_s_point=new I,e.DrawJoint_s_p1=new I,e.DrawJoint_s_p2=new
I,e.DrawJoint_s_color=new G(.5,.8,.8),e.DrawJoint_s_c=new
G,e.DrawShape_s_ghostColor=new G,e.SolveTOI_s_subStep=new
an,e.SolveTOI_s_backup=new k,e.SolveTOI_s_backup1=new k,e.SolveTOI_s_backup2=new
k,e.SolveTOI_s_toi_input=new Xt,e.SolveTOI_s_toi_output=new qt,e})
(),zn=(function(){return function(t,e)
{this.prevBody=null,this.nextBody=null,this.prevController=null,this.nextController
=null,this.controller=t,this.body=e}})(),Un=(function(){function t()
{this.m_bodyList=null,this.m_bodyCount=0,this.m_prev=null,this.m_next=null}return
t.prototype.GetNext=function(){return this.m_next},t.prototype.GetPrev=function()
{return this.m_prev},t.prototype.GetBodyList=function(){return
this.m_bodyList},t.prototype.AddBody=function(t){var e=new
zn(this,t);e.nextBody=this.m_bodyList,e.prevBody=null,this.m_bodyList&&(this.m_body
List.prevBody=e),this.m_bodyList=e,+
+this.m_bodyCount,e.nextController=t.m_controllerList,e.prevController=null,t.m_con
trollerList&&(t.m_controllerList.prevController=e),t.m_controllerList=e,+
+t.m_controllerCount},t.prototype.RemoveBody=function(t)
{if(this.m_bodyCount<=0)throw new Error;for(var e=this.m_bodyList;e&&e.body!
==t;)e=e.nextBody;if(null===e)throw new
Error;e.prevBody&&(e.prevBody.nextBody=e.nextBody),e.nextBody&&(e.nextBody.prevBody
=e.prevBody),this.m_bodyList===e&&(this.m_bodyList=e.nextBody),--
this.m_bodyCount,e.nextController&&(e.nextController.prevController=e.prevControlle
r),e.prevController&&(e.prevController.nextController=e.nextController),t.m_control
lerList===e&&(t.m_controllerList=e.nextController),--
t.m_controllerCount},t.prototype.Clear=function()
{for(;this.m_bodyList;)this.RemoveBody(this.m_bodyList.body);this.m_bodyCount=0},t}
)(),jn=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||
this;return e.normal=new I(0,1),e.offset=0,e.density=0,e.velocity=new
I(0,0),e.linearDrag=0,e.angularDrag=0,e.useDensity=!1,e.useWorldGravity=!
0,e.gravity=new I(0,0),e}return $e(e,t),e.prototype.Step=function(t)
{if(this.m_bodyList)
{this.useWorldGravity&&this.gravity.Copy(this.m_bodyList.body.GetWorld().GetGravity
());for(var e=this.m_bodyList;e;e=e.nextBody){var i=e.body;if(i.IsAwake()){for(var
r=new I,s=new I,a=0,o=0,l=i.GetFixtureList();l;l=l.m_next){var h=new
I,c=l.GetShape().ComputeSubmergedArea(this.normal,this.offset,i.GetTransform(),h);a
+=c,r.x+=c*h.x,r.y+=c*h.y;var u=0;o+=c*(u=this.useDensity?
l.GetDensity():1),s.x+=c*h.x*u,s.y+=c*h.y*u}if(r.x/=a,r.y/=a,s.x/=o,s.y/=o,!(a<n))
{var
_=this.gravity.Clone().SelfNeg();_.SelfMul(this.density*a),i.ApplyForce(_,s);var
f=i.GetLinearVelocityFromWorldPoint(r,new I);f.SelfSub(this.velocity),f.SelfMul(-
this.linearDrag*a),i.ApplyForce(f,r),i.ApplyTorque(-
i.GetInertia()/i.GetMass()*a*i.GetAngularVelocity()*this.angularDrag)}}}}},e.protot
ype.Draw=function(t){var e=100,i=new I,n=new
I;i.x=this.normal.x*this.offset+this.normal.y*e,i.y=this.normal.y*this.offset-
this.normal.x*e,n.x=this.normal.x*this.offset-
this.normal.y*e,n.y=this.normal.y*this.offset+this.normal.x*e;var r=new
G(0,0,.8);t.DrawSegment(i,n,r)},e})(Un),Wn=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.A=new I(0,0),e}return
$e(e,t),e.prototype.Step=function(t){for(var
i=I.MulSV(t.dt,this.A,e.Step_s_dtA),n=this.m_bodyList;n;n=n.nextBody){var
r=n.body;r.IsAwake()&&r.SetLinearVelocity(I.AddVV(r.GetLinearVelocity(),i,I.s_t0))}
},e.prototype.Draw=function(t){},e.Step_s_dtA=new I,e})(Un),Hn=(function(t)
{function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.F=new
I(0,0),e}return $e(e,t),e.prototype.Step=function(t){for(var
e=this.m_bodyList;e;e=e.nextBody){var
i=e.body;i.IsAwake()&&i.ApplyForce(this.F,i.GetWorldCenter())}},e.prototype.Draw=fu
nction(t){},e})(Un),Xn=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.G=1,e.invSqr=!0,e}return
$e(e,t),e.prototype.Step=function(t){if(this.invSqr)for(var
i=this.m_bodyList;i;i=i.nextBody)for(var
r=(h=i.body).GetWorldCenter(),s=h.GetMass(),a=this.m_bodyList;a&&a!
==i;a=a.nextBody){var o=(c=a.body).GetWorldCenter(),l=c.GetMass();if(!((f=(u=o.x-
r.x)*u+(_=o.y-r.y)*_)<n))
(d=e.Step_s_f.Set(u,_)).SelfMul(this.G/f/T(f)*s*l),h.IsAwake()&&h.ApplyForce(d,r),c
.IsAwake()&&c.ApplyForce(d.SelfMul(-1),o)}else
for(i=this.m_bodyList;i;i=i.nextBody){var
h;for(r=(h=i.body).GetWorldCenter(),s=h.GetMass(),a=this.m_bodyList;a&&a!
==i;a=a.nextBody){var c,u,_,f,d;o=(c=a.body).GetWorldCenter(),l=c.GetMass();if(!
((f=(u=o.x-r.x)*u+(_=o.y-r.y)*_)<n))
(d=e.Step_s_f.Set(u,_)).SelfMul(this.G/f*s*l),h.IsAwake()&&h.ApplyForce(d,r),c.IsAw
ake()&&c.ApplyForce(d.SelfMul(-1),o)}}},e.prototype.Draw=function(t)
{},e.Step_s_f=new I,e})(Un),qn=(function(t){function e(){var e=null!
==t&&t.apply(this,arguments)||this;return e.T=new L,e.maxTimestep=0,e}return
$e(e,t),e.prototype.Step=function(t){var i=t.dt;if(!(i<=n))
{i>this.maxTimestep&&this.maxTimestep>0&&(i=this.maxTimestep);for(var
r=this.m_bodyList;r;r=r.nextBody){var s=r.body;if(s.IsAwake()){var
a=s.GetWorldVector(L.MulMV(this.T,s.GetLocalVector(s.GetLinearVelocity(),I.s_t0),I.
s_t1),e.Step_s_damping);s.SetLinearVelocity(I.AddVV(s.GetLinearVelocity(),I.MulSV(i
,a,I.s_t0),I.s_t1))}}}},e.prototype.Draw=function(t)
{},e.prototype.SetAxisAligned=function(t,e){this.T.ex.x=-
t,this.T.ex.y=0,this.T.ey.x=0,this.T.ey.y=-e,this.maxTimestep=t>0||e>0?
1/x(t,e):0},e.Step_s_damping=new I,e})(Un),Yn=(function(){return function()
{this.vertices=[],this.count=0,this.masses=[],this.gravity=new
I(0,0),this.damping=.1,this.k2=.9,this.k3=.1}})(),Jn=(function(){function t()
{this.m_count=0,this.m_ps=[],this.m_p0s=[],this.m_vs=[],this.m_ims=[],this.m_Ls=[],
this.m_as=[],this.m_gravity=new I,this.m_damping=0,this.m_k2=1,this.m_k3=.1}return
t.prototype.GetVertexCount=function(){return
this.m_count},t.prototype.GetVertices=function(){return
this.m_ps},t.prototype.Initialize=function(t)
{this.m_count=t.count,this.m_ps=I.MakeArray(this.m_count),this.m_p0s=I.MakeArray(th
is.m_count),this.m_vs=I.MakeArray(this.m_count),this.m_ims=m(this.m_count);for(var
e=0;e<this.m_count;++e)
{this.m_ps[e].Copy(t.vertices[e]),this.m_p0s[e].Copy(t.vertices[e]),this.m_vs[e].Se
tZero();var i=t.masses[e];this.m_ims[e]=i>0?1/i:0}var n=this.m_count-
1,r=this.m_count-2;this.m_Ls=m(n),this.m_as=m(r);for(e=0;e<n;++e){var
s=this.m_ps[e],a=this.m_ps[e+1];this.m_Ls[e]=I.DistanceVV(s,a)}for(e=0;e<r;++e)
{s=this.m_ps[e],a=this.m_ps[e+1];var
o=this.m_ps[e+2],l=I.SubVV(a,s,I.s_t0),h=I.SubVV(o,a,I.s_t1),c=I.CrossVV(l,h),u=I.D
otVV(l,h);this.m_as[e]=P(c,u)}this.m_gravity.Copy(t.gravity),this.m_damping=t.dampi
ng,this.m_k2=t.k2,this.m_k3=t.k3},t.prototype.Step=function(t,e){if(0!==t){for(var
i=Math.exp(-t*this.m_damping),n=0;n<this.m_count;+
+n)this.m_p0s[n].Copy(this.m_ps[n]),this.m_ims[n]>0&&this.m_vs[n].SelfMulAdd(t,this
.m_gravity),this.m_vs[n].SelfMul(i),this.m_ps[n].SelfMulAdd(t,this.m_vs[n]);for(n=0
;n<e;++n)this.SolveC2(),this.SolveC3(),this.SolveC2();var
r=1/t;for(n=0;n<this.m_count;+
+n)I.MulSV(r,I.SubVV(this.m_ps[n],this.m_p0s[n],I.s_t0),this.m_vs[n])}},t.prototype
.SolveC2=function(){for(var e=this.m_count-1,i=0;i<e;++i){var
n=this.m_ps[i],r=this.m_ps[i+1],s=I.SubVV(r,n,t.s_d),a=s.Normalize(),o=this.m_ims[i
],l=this.m_ims[i+1];if(o+l!==0){var
h=o/(o+l),c=l/(o+l);n.SelfMulSub(this.m_k2*h*(this.m_Ls[i]-
a),s),r.SelfMulAdd(this.m_k2*c*(this.m_Ls[i]-
a),s)}}},t.prototype.SetAngle=function(t){for(var e=this.m_count-2,i=0;i<e;+
+i)this.m_as[i]=t},t.prototype.SolveC3=function(){for(var e=this.m_count-2,i=0;i<e;
++i){var
n=this.m_ps[i],r=this.m_ps[i+1],a=this.m_ps[i+2],o=this.m_ims[i],l=this.m_ims[i+1],
h=this.m_ims[i+2],c=I.SubVV(r,n,t.s_d1),u=I.SubVV(a,r,t.s_d2),_=c.LengthSquared(),f
=u.LengthSquared();if(_*f!=0){var
d=I.CrossVV(c,u),m=I.DotVV(c,u),p=P(d,m),v=I.MulSV(-
1/_,c.SelfSkew(),t.s_Jd1),y=I.MulSV(1/f,u.SelfSkew(),t.s_Jd2),g=I.NegV(v,t.s_J1),x=
I.SubVV(v,y,t.s_J2),b=y,A=o*I.DotVV(g,g)+l*I.DotVV(x,x)+h*I.DotVV(b,b);if(0!==A)
{A=1/A;for(var C=p-this.m_as[i];C>s;)C=(p-=2*s)-this.m_as[i];for(;C<-s;)C=(p+=2*s)-
this.m_as[i];var S=-
this.m_k3*A*C;n.SelfMulAdd(o*S,g),r.SelfMulAdd(l*S,x),a.SelfMulAdd(h*S,b)}}}},t.pro
totype.Draw=function(t){for(var e=new G(.4,.5,.7),i=0;i<this.m_count-1;+
+i)t.DrawSegment(this.m_ps[i],this.m_ps[i+1],e)},t.s_d=new I,t.s_d1=new
I,t.s_d2=new I,t.s_Jd1=new I,t.s_Jd2=new I,t.s_J1=new I,t.s_J2=new I,t})
();t.b2Assert=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-
1]=arguments[i];if(!t)throw new(Error.bind.apply(Error,[void
0].concat(e)))},t.b2Maybe=e,t.b2_maxFloat=i,t.b2_epsilon=n,t.b2_epsilon_sq=r,t.b2_p
i=s,t.b2_maxManifoldPoints=a,t.b2_maxPolygonVertices=o,t.b2_aabbExtension=.1,t.b2_a
abbMultiplier=2,t.b2_linearSlop=l,t.b2_angularSlop=h,t.b2_polygonRadius=c,t.b2_maxS
ubSteps=8,t.b2_maxTOIContacts=32,t.b2_velocityThreshold=1,t.b2_maxLinearCorrection=
.2,t.b2_maxAngularCorrection=.13962634015955555,t.b2_maxTranslation=2,t.b2_maxTrans
lationSquared=4,t.b2_maxRotation=1.570796326795,t.b2_maxRotationSquared=2.467401100
2726646,t.b2_baumgarte=.2,t.b2_toiBaumgarte=.75,t.b2_invalidParticleIndex=u,t.b2_ma
xParticleIndex=2147483647,t.b2_particleStride=.75,t.b2_minParticleWeight=1,t.b2_max
ParticlePressure=.25,t.b2_maxParticleForce=.5,t.b2_maxTriadDistance=2,t.b2_maxTriad
DistanceSquared=4,t.b2_minParticleSystemBufferCapacity=256,t.b2_barrierCollisionTim
e=2.5,t.b2_timeToSleep=.5,t.b2_linearSleepTolerance=.01,t.b2_angularSleepTolerance=
.03490658503988889,t.b2Alloc=function(t){return null},t.b2Free=function(t)
{},t.b2Log=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-
1]=arguments[i]},t.b2Version=_,t.b2_version=f,t.b2_branch="master",t.b2_commit="fbf
51801d80fc389d43dc46524520e89043b6faf",t.b2ParseInt=function(t){return
parseInt(t,10)},t.b2ParseUInt=function(t){return
Math.abs(parseInt(t,10))},t.b2MakeArray=d,t.b2MakeNullArray=function(t){for(var
e=[],i=0;i<t;++i)e.push(null);return
e},t.b2MakeNumberArray=m,t.b2_pi_over_180=p,t.b2_180_over_pi=v,t.b2_two_pi=6.283185
30718,t.b2Abs=y,t.b2Min=g,t.b2Max=x,t.b2Clamp=b,t.b2Swap=function(t,e){var
i=t[0];t[0]=e[0],e[0]=i},t.b2IsValid=A,t.b2Sq=C,t.b2InvSqrt=S,t.b2Sqrt=T,t.b2Pow=w,
t.b2DegToRad=function(t){return t*p},t.b2RadToDeg=function(t){return
t*v},t.b2Cos=E,t.b2Sin=M,t.b2Acos=D,t.b2Asin=B,t.b2Atan2=P,t.b2NextPowerOfTwo=funct
ion(t){return
t|=t>>1&2147483647,t|=t>>2&1073741823,t|=t>>4&268435455,t|=t>>8&16777215,1+(t|
=t>>16&65535)},t.b2IsPowerOfTwo=function(t){return t>0&&0==(t&t-
1)},t.b2Random=function(){return 2*Math.random()-1},t.b2RandomRange=function(t,e)
{return(e-t)*Math.random()
+t},t.b2Vec2=I,t.b2Vec2_zero=R,t.b2Vec3=O,t.b2Mat22=L,t.b2Mat33=F,t.b2Rot=V,t.b2Tra
nsform=N,t.b2Sweep=k,t.b2Color=G,t.b2Draw=z,t.b2Timer=U,t.b2Counter=j,t.b2GrowableS
tack=W,t.b2BlockAllocator=H,t.b2StackAllocator=X,t.b2ContactFeature=yt,t.b2ContactI
D=gt,t.b2ManifoldPoint=xt,t.b2Manifold=bt,t.b2WorldManifold=At,t.b2GetPointStates=f
unction(e,i,n,r){var s;for(s=0;s<n.pointCount;++s){var
o=n.points[s].id.key;e[s]=t.b2PointState.b2_removeState;for(var
l=0,h=r.pointCount;l<h;++l)if(r.points[l].id.key===o)
{e[s]=t.b2PointState.b2_persistState;break}}for(;s<a;+
+s)e[s]=t.b2PointState.b2_nullState;for(s=0;s<r.pointCount;+
+s)for(o=r.points[s].id.key,i[s]=t.b2PointState.b2_addState,l=0,h=n.pointCount;l<h;
++l)if(n.points[l].id.key===o){i[s]=t.b2PointState.b2_persistState;break}for(;s<a;+
+s)i[s]=t.b2PointState.b2_nullState},t.b2ClipVertex=Ct,t.b2RayCastInput=St,t.b2RayC
astOutput=Tt,t.b2AABB=wt,t.b2TestOverlapAABB=Et,t.b2ClipSegmentToLine=Mt,t.b2TestOv
erlapShape=It,t.b2DistanceProxy=q,t.b2SimplexCache=Y,t.b2DistanceInput=J,t.b2Distan
ceOutput=Z,t.b2ShapeCastInput=K,t.b2ShapeCastOutput=Q,t.b2_gjk_reset=function()
{t.b2_gjkCalls=0,t.b2_gjkIters=0,t.b2_gjkMaxIters=0},t.b2SimplexVertex=$,t.b2Simple
x=tt,t.b2Distance=ht,t.b2ShapeCast=function(t,e)
{t.iterations=0,t.lambda=1,t.normal.SetZero(),t.point.SetZero();var
i=e.proxyA,n=e.proxyB,r=x(i.m_radius,c)
+x(n.m_radius,c),s=e.transformA,a=e.transformB,o=e.translationB,h=ct.Set(0,0),u=0,_
=ut;_.m_count=0;for(var
f=_.m_vertices,d=i.GetSupport(V.MulTRV(s.q,I.NegV(o,I.s_t1),I.s_t0)),m=N.MulXV(s,i.
GetVertex(d),_t),p=n.GetSupport(V.MulTRV(a.q,o,I.s_t0)),v=N.MulXV(a,n.GetVertex(p),
ft),g=I.SubVV(m,v,dt),b=x(c,r-c),A=.5*l,C=0;C<20&&y(g.Length()-b)>A;)
{t.iterations+=1,d=i.GetSupport(V.MulTRV(s.q,I.NegV(g,I.s_t1),I.s_t0)),m=N.MulXV(s,
i.GetVertex(d),_t),p=n.GetSupport(V.MulTRV(a.q,g,I.s_t0)),v=N.MulXV(a,n.GetVertex(p
),ft);var S=I.SubVV(m,v,mt);g.Normalize();var T=I.DotVV(g,S),w=I.DotVV(g,o);if(T-
b>u*w){if(w<=0)return!1;if((u=(T-b)/w)>1)return!
1;h.Copy(g).SelfNeg(),_.m_count=0}var
E=f[_.m_count];switch(E.indexA=p,E.wA.Copy(v).SelfMulAdd(u,o),E.indexB=d,E.wB.Copy(
m),E.w.Copy(E.wB).SelfSub(E.wA),E.a=1,_.m_count+=1,_.m_count){case 1:break;case
2:_.Solve2();break;case 3:_.Solve3()}if(3===_.m_count)return!
1;_.GetClosestPoint(g),++C}var M=pt,D=vt;return
_.GetWitnessPoints(M,D),g.LengthSquared()>0&&(h.Copy(g).SelfNeg(),h.Normalize()),t.
normal.Copy(h),t.lambda=u,t.iterations=C,!
0},t.b2Pair=Ft,t.b2BroadPhase=Vt,t.b2PairLessThan=Nt,t.b2TreeNode=Ot,t.b2DynamicTre
e=Lt,t.b2_toi_reset=function()
{t.b2_toiTime=0,t.b2_toiMaxTime=0,t.b2_toiCalls=0,t.b2_toiIters=0,t.b2_toiMaxIters=
0,t.b2_toiRootIters=0,t.b2_toiMaxRootIters=0},t.b2TOIInput=Xt,t.b2TOIOutput=qt,t.b2
SeparationFunction=Yt,t.b2TimeOfImpact=re,t.b2CollideCircles=oe,t.b2CollidePolygonA
ndCircle=ue,t.b2CollidePolygons=Le,t.b2CollideEdgeAndCircle=We,t.b2CollideEdgeAndPo
lygon=Je,t.b2MassData=Ze,t.b2Shape=Ke,t.b2CircleShape=ti,t.b2PolygonShape=ei,t.b2Ed
geShape=ii,t.b2ChainShape=ni,t.b2Filter=ri,t.b2FixtureDef=si,t.b2FixtureProxy=ai,t.
b2Fixture=oi,t.b2BodyDef=li,t.b2Body=hi,t.b2World=Gn,t.b2DestructionListener=Ki,t.b
2ContactFilter=Qi,t.b2ContactImpulse=$i,t.b2ContactListener=tn,t.b2QueryCallback=en
,t.b2RayCastCallback=nn,t.b2Island=pn,t.b2Profile=sn,t.b2TimeStep=an,t.b2Position=o
n,t.b2Velocity=ln,t.b2SolverData=hn,t.b2ContactManager=rn,t.b2MixFriction=Ni,t.b2Mi
xRestitution=ki,t.b2ContactEdge=Gi,t.b2Contact=zi,t.b2ContactRegister=Ji,t.b2Contac
tFactory=Zi,t.g_blockSolve=!
1,t.b2VelocityConstraintPoint=cn,t.b2ContactVelocityConstraint=un,t.b2ContactPositi
onConstraint=_n,t.b2ContactSolverDef=fn,t.b2PositionSolverManifold=dn,t.b2ContactSo
lver=mn,t.b2CircleContact=Ui,t.b2PolygonContact=ji,t.b2PolygonAndCircleContact=Wi,t
.b2EdgeAndCircleContact=Hi,t.b2EdgeAndPolygonContact=Xi,t.b2ChainAndCircleContact=q
i,t.b2ChainAndPolygonContact=Yi,t.b2Jacobian=ci,t.b2JointEdge=ui,t.b2JointDef=_i,t.
b2Joint=fi,t.b2AreaJointDef=pi,t.b2AreaJoint=vi,t.b2DistanceJointDef=di,t.b2Distanc
eJoint=mi,t.b2FrictionJointDef=yi,t.b2FrictionJoint=gi,t.b2GearJointDef=xi,t.b2Gear
Joint=bi,t.b2MotorJointDef=Ai,t.b2MotorJoint=Ci,t.b2MouseJointDef=Si,t.b2MouseJoint
=Ti,t.b2PrismaticJointDef=wi,t.b2PrismaticJoint=Ei,t.b2_minPulleyLength=2,t.b2Pulle
yJointDef=Mi,t.b2PulleyJoint=Di,t.b2RevoluteJointDef=Bi,t.b2RevoluteJoint=Pi,t.b2Ro
peJointDef=Ii,t.b2RopeJoint=Ri,t.b2WeldJointDef=Oi,t.b2WeldJoint=Li,t.b2WheelJointD
ef=Fi,t.b2WheelJoint=Vi,t.b2ControllerEdge=zn,t.b2Controller=Un,t.b2BuoyancyControl
ler=jn,t.b2ConstantAccelController=Wn,t.b2ConstantForceController=Hn,t.b2GravityCon
troller=Xn,t.b2TensorDampingController=qn,t.b2ParticleDef=vn,t.b2CalculateParticleI
terations=yn,t.b2ParticleHandle=gn,t.b2ParticleGroupDef=xn,t.b2ParticleGroup=bn,t.b
2GrowableBuffer=Rn,t.b2FixtureParticleQueryCallback=On,t.b2ParticleContact=Ln,t.b2P
articleBodyContact=Fn,t.b2ParticlePair=Vn,t.b2ParticleTriad=Nn,t.b2ParticleSystemDe
f=kn,t.b2RopeDef=Yn,t.b2Rope=Jn,Object.defineProperty(t,"__esModule",{value:!
0})}))}),{}],409:[(function(t,e,i){"use strict";var n="undefined"==typeof window?
global:window;n.cc=n.cc||{},n._cc=n._cc||
{},t("./predefine"),t("./polyfill/string"),t("./polyfill/misc"),t("./polyfill/array
"),t("./polyfill/object"),t("./polyfill/array-
buffer"),t("./polyfill/number"),t("./polyfill/typescript"),t("./cocos2d/core/predef
ine"),t("./cocos2d"),t("./extends"),e.exports=n.cc}),
{"./cocos2d":327,"./cocos2d/core/predefine":225,"./extends":387,"./package":void
0,"./polyfill/array":411,"./polyfill/array-
buffer":410,"./polyfill/misc":412,"./polyfill/number":413,"./polyfill/object":414,"
./polyfill/string":415,"./polyfill/typescript":416,"./predefine":417}],410:
[(function(t,e,i){"use strict";if(!ArrayBuffer.isView){var
n=Object.getPrototypeOf(Object.getPrototypeOf(new
Uint8Array)).constructor;ArrayBuffer.isView=function(t){return t instanceof n}}}),
{}],411:[(function(t,e,i){"use strict";Array.isArray||(Array.isArray=function(t)
{return"[object
Array]"===Object.prototype.toString.call(t)}),Array.prototype.find||
(Array.prototype.find=function(t){for(var e=this.length,i=0;i<e;i++){var
n=this[i];if(t.call(this,n,i,this))return n}})}),{}],412:[(function(t,e,i){"use
strict";if(Math.sign||(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-
1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof
t&&isFinite(t)&&Math.floor(t)===t}),!console.time){var n=window.performance||
Date,r=Object.create(null);console.time=function(t)
{r[t]=n.now()},console.timeEnd=function(t){var e=r[t],i=n.now()-e;console.log(t+":
"+i+"ms")}}}),{}],413:[(function(t,e,i){"use
strict";Number.parseFloat=Number.parseFloat||
parseFloat,Number.parseInt=Number.parseInt||parseInt}),{}],414:[(function(t,e,i)
{"use strict";Object.assign||(Object.assign=function(t,e){return
cc.js.mixin(t,e)}),Object.getOwnPropertyDescriptors||
(Object.getOwnPropertyDescriptors=function(t){for(var
e={},i=Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)),n=0;n<
i.length;++n){var r=i[n];e[r]=Object.getOwnPropertyDescriptor(t,r)}return e})}),
{}],415:[(function(t,e,i){"use strict";String.prototype.startsWith||
(String.prototype.startsWith=function(t,e){return e=e||
0,this.lastIndexOf(t,e)===e}),String.prototype.endsWith||
(String.prototype.endsWith=function(t,e){(void 0===e||
e>this.length)&&(e=this.length),e-=t.length;var i=this.indexOf(t,e);return-1!
==i&&i===e})}),{}],416:[(function(t,e,i){"use strict";var n="function"==typeof
Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t)
{return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!
==Symbol.prototype?"symbol":typeof t},r=Object.setPrototypeOf||{__proto__:
[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in
e)e.hasOwnProperty(i)&&(t[i]=e[i])};window.__extends=function(t,e){function i()
{this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):
(i.prototype=e.prototype,new i)},window.__assign=Object.assign||function(t){for(var
e,i=1,n=arguments.length;i<n;i++)for(var r in
e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return
t},window.__rest=function(t,e){var i={};for(var n in
t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!
=t&&"function"==typeof Object.getOwnPropertySymbols){var
r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r+
+)e.indexOf(n[r])<0&&(i[n[r]]=t[n[r]])}return
i},window.__decorate=function(t,e,i,r){var s,a=arguments.length,o=a<3?e:null===r?
r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof
Reflect?"undefined":n(Reflect))&&"function"==typeof
Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)
(s=t[l])&&(o=(a<3?s(o):a>3?s(e,i,o):s(e,i))||o);return
a>3&&o&&Object.defineProperty(e,i,o),o},window.__param=function(t,e){return
function(i,n){e(i,n,t)}},window.__metadata=function(t,e)
{if("object"===("undefined"==typeof
Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return
Reflect.metadata(t,e)},window.__awaiter=function(t,e,i,n){return new(i||
(i=Promise))(function(r,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function
o(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){t.done?r(t.value):new
i(function(e){e(t.value)}).then(a,o)}l((n=n.apply(t,e||
[])).next())})},window.__generator=function(t,e){var
i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:
[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof
Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return
function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is
already executing.");for(;a;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||
((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return
r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return
a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case
7:s=a.ops.pop(),a.trys.pop();continue;default:if(!
(r=(r=a.trys).length>0&&r[r.length-1])&&(6===s[0]||2===s[0]))
{a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3]))
{a.label=s[1];break}if(6===s[0]&&a.label<r[1])
{a.label=r[1],r=s;break}if(r&&a.label<r[2])
{a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(
t,a)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?
s[1]:void 0,done:!0}}},window.__exportStar=function(t,e){for(var i in
t)e.hasOwnProperty(i)||(e[i]=t[i])},window.__values=function(t){var
e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):
{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!
t}}}},window.__read=function(t,e){var i="function"==typeof
Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,s=i.call(t),a=[];try{for(;(void
0===e||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(t)
{r={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw
r.error}}return a},window.__spread=function(){for(var
t=[],e=0;e<arguments.length;e++)t=t.concat(__read(arguments[e]));return
t},window.__await=function(t){return this instanceof __await?(this.v=t,this):new
__await(t)},window.__asyncGenerator=function(t,e,i){if(!Symbol.asyncIterator)throw
new TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(t,e||
[]),s=[];return
n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return
this},n;function a(t){r[t]&&(n[t]=function(e){return new Promise(function(i,n)
{s.push([t,e,i,n])>1||o(t,e)})})}function o(t,e){try{l(r[t](e))}catch(t){u(s[0]
[3],t)}}function l(t){t.value instanceof __await?
Promise.resolve(t.value.v).then(h,c):u(s[0][2],t)}function h(t)
{o("next",t)}function c(t){o("throw",t)}function u(t,e)
{t(e),s.shift(),s.length&&o(s[0][0],s[0][1])}},window.__asyncDelegator=function(t)
{var e,i;return e={},n("next"),n("throw",(function(t){throw
t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,r)
{e[n]=t[n]?function(e){return(i=!i)?{value:__await(t[n](e)),done:"return"===n}:r?
r(e):e}:r}},window.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new
TypeError("Symbol.asyncIterator is not defined.");var
e,i=t[Symbol.asyncIterator];return i?i.call(t):(t="function"==typeof __values?
__values(t):t[Symbol.iterator]
(),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return
this},e);function n(i){e[i]=t[i]&&function(e){return new Promise(function(n,s)
{r(n,s,(e=t[i](e)).done,e.value)})}}function r(t,e,i,n)
{Promise.resolve(n).then((function(e)
{t({value:e,done:i})}),e)}},window.__makeTemplateObject=function(t,e){return
Object.defineProperty?Object.defineProperty(t,"raw",
{value:e}):t.raw=e,t},window.__importStar=function(t){if(t&&t.__esModule)return
t;var e={};if(null!=t)for(var i in
t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return
e.default=t,e},window.__importDefault=function(t){return t&&t.__esModule?t:
{default:t}}}),{}],417:[(function(t,e,i){"use strict";"function"==typeof
Symbol&&Symbol.iterator;var n="undefined"==typeof window?global:window;function
r(t,e){void 0===n[t]&&(n[t]=e)}r("CC_BUILD",!1),n.CC_BUILD=!0,n.CC_TEST=!
1,n.CC_EDITOR=!1,n.CC_PREVIEW=!1,n.CC_DEV=!1,n.CC_DEBUG=!1,n.CC_JSB=!
1,n.CC_WECHATGAMESUB=!1,n.CC_WECHATGAME=!1,n.CC_QQPLAY=!1,n.CC_RUNTIME=!
1,n.CC_SUPPORT_JIT=!0;n.CocosEngine=cc.ENGINE_VERSION="2.1.1"}),{}]},{},[409]);

You might also like