>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,p=this.readBits(i.cplext[o])+i.cplens[o],o=i.bitReverse[this.readBits(5)]>>3,i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o],o=0;oc)return this.flushBuffer(),1;for(_=n?f[n-1]:0;o--;)f[n++]=_}else{if(n+(o=17===o?3+this.readBits(3):11+this.readBits(7))>c)return this.flushBuffer(),1;for(;o--;)f[n++]=0}for(p=this.literalTree.length,n=0;n
=256){var p,m;if(0==(o-=256))break;for(o--,p=this.readBits(i.cplext[o])+i.cplens[o],o=this.DecodeValue(this.distanceTree),i.cpdext[o]>8?(m=this.readBits(8),m|=this.readBits(i.cpdext[o]-8)<<8):m=this.readBits(i.cpdext[o]),m+=i.cpdist[o];p--;)s=this.buf32k[this.bIdx-m&32767],this.addBuffer(s)}else this.addBuffer(o)}}while(!t);return this.flushBuffer(),this.byteAlign(),0},i.prototype.unzipFile=function(t){var e;for(this.gunzip(),e=0;e>>0;t=n}for(var r,a=1,s=0,o=t.length,c=0;0>>0}function o(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e instanceof(a?Uint8Array:Array)?e:new(a?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(a?Uint8Array:Array)(i<<1);if(a)n.set(e);else for(t=0;t>>8&255]<<16|_[t>>>16&255]<<8|_[t>>>24&255])>>32-e:_[t]>>8-e),8>e+s)o=o<>e-n-1&1,8==++s&&(s=0,r[a++]=_[o],o=0,a===r.length&&(r=this.f()));r[a]=o,this.buffer=r,this.i=s,this.index=a},o.prototype.finish=function(){var t,e=this.buffer,i=this.index;return 0c;++c){for(var h=f=c,u=7,f=f>>>1;f;f>>>=1)h<<=1,h|=1&f,--u;l[c]=(h<>>0}var _=l;function d(t){this.buffer=new(a?Uint16Array:Array)(2*t),this.length=0}function p(t){var e,i,n,r,s,o,c,l,h,u=t.length,f=0,_=Number.POSITIVE_INFINITY;for(l=0;lf&&(f=t[l]),t[l]<_&&(_=t[l]);for(e=1<>=1;for(h=o;ha[n]);)r=a[i],a[i]=a[n],a[n]=r,r=a[i+1],a[i+1]=a[n+1],a[n+1]=r,i=n;return this.length},d.prototype.pop=function(){var t,e,i,n,r,a=this.buffer;for(e=a[0],t=a[1],this.length-=2,a[0]=a[this.length],a[1]=a[this.length+1],r=0;!((n=2*r+2)>=this.length)&&(n+2a[n]&&(n+=2),a[n]>a[r]);)i=a[r],a[r]=a[n],a[n]=i,i=a[r+1],a[r+1]=a[n+1],a[n+1]=i,r=n;return{index:t,value:e,length:this.length}};var v,g=2,y={NONE:0,r:1,j:g,N:3},T=[];for(v=0;288>v;v++)switch(i){case 143>=v:T.push([v+48,8]);break;case 255>=v:T.push([v-144+400,9]);break;case 279>=v:T.push([v-256+0,7]);break;case 287>=v:T.push([v-280+192,8]);break;default:t("invalid literal: "+v)}function A(t,e){this.length=t,this.G=e}function b(){var e=E;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)}}m.prototype.n=function(){var n,r,s,c,l=this.input;switch(this.h){case 0:for(s=0,c=l.length;s>>8&255,v[y++]=255&f,v[y++]=f>>>8&255,a)v.set(_,y),y+=_.length,v=v.subarray(0,y);else{for(p=0,m=_.length;pZ)for(;0Z?Z:138)>Z-3&&Q=Q?(it[J++]=17,it[J++]=Q-3,nt[17]++):(it[J++]=18,it[J++]=Q-11,nt[18]++),Z-=Q;else if(it[J++]=et[X],nt[et[X]]++,3>--Z)for(;0Z?Z:6)>Z-3&&QG;G++)Y[G]=k[j[G]];for(P=19;4=E;E++)C=b(),x[E]=C[2]<<24|C[1]<<16|C[0];var S=a?new Uint32Array(x):x;function w(n,r){function s(e,n){var r,a,s,o,c=e.G,l=[],h=0;switch(r=S[e.length],l[h++]=65535&r,l[h++]=r>>16&255,l[h++]=r>>24,i){case 1===c:a=[0,c-1,0];break;case 2===c:a=[1,c-2,0];break;case 3===c:a=[2,c-3,0];break;case 4===c:a=[3,c-4,0];break;case 6>=c:a=[4,c-5,1];break;case 8>=c:a=[5,c-7,1];break;case 12>=c:a=[6,c-9,2];break;case 16>=c:a=[7,c-13,2];break;case 24>=c:a=[8,c-17,3];break;case 32>=c:a=[9,c-25,3];break;case 48>=c:a=[10,c-33,4];break;case 64>=c:a=[11,c-49,4];break;case 96>=c:a=[12,c-65,5];break;case 128>=c:a=[13,c-97,5];break;case 192>=c:a=[14,c-129,6];break;case 256>=c:a=[15,c-193,6];break;case 384>=c:a=[16,c-257,7];break;case 512>=c:a=[17,c-385,7];break;case 768>=c:a=[18,c-513,8];break;case 1024>=c:a=[19,c-769,8];break;case 1536>=c:a=[20,c-1025,9];break;case 2048>=c:a=[21,c-1537,9];break;case 3072>=c:a=[22,c-2049,10];break;case 4096>=c:a=[23,c-3073,10];break;case 6144>=c:a=[24,c-4097,11];break;case 8192>=c:a=[25,c-6145,11];break;case 12288>=c:a=[26,c-8193,12];break;case 16384>=c:a=[27,c-12289,12];break;case 24576>=c:a=[28,c-16385,13];break;case 32768>=c:a=[29,c-24577,13];break;default:t("invalid distance")}for(r=a,l[h++]=r[0],l[h++]=r[1],l[h++]=r[2],s=0,o=l.length;s=l;)T[l++]=0;for(l=0;29>=l;)b[l++]=0}for(T[256]=1,o=0,c=r.length;o=c){for(d&&s(d,-1),l=0,h=c-o;lD&&o+Dw&&(x=C,w=D),258===D)break}_=new A(w,o-x),d?d.length<_.length?(p=r[o-1],v[g++]=p,++T[p],s(_,0)):s(d,-1):_.length2*y[_-1]+T[_]&&(y[_]=2*y[_-1]+T[_]),b[_]=Array(y[_]),E[_]=Array(y[_]);for(f=0;fr[f]?(b[_][p]=m,E[_][p]=g,v+=2):(b[_][p]=r[f],E[_][p]=f,++f);C[_]=0,1===T[_]&&i(_)}for(s=A,o=0,c=n.length;o1<h&&t("undercommitted"),i=0,n=e.length;i>>=1;return o}function R(t,e){this.input=t,this.a=new(a?Uint8Array:Array)(32768),this.h=I.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 m(this.input,n)}var I=y;function O(e,i){switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=a?new Uint8Array(e):e,this.s=!1,this.m=N,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 P:this.b=32768,this.a=new(a?Uint8Array:Array)(32768+this.l+258);break;case N:this.b=0,this.a=new(a?Uint8Array:Array)(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid inflate mode"))}}R.prototype.n=function(){var e,i,n,r,o,c,l,h=0;switch(l=this.a,e=ht){case ht:i=Math.LOG2E*Math.log(32768)-8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,l[h++]=n,e){case ht:switch(this.h){case I.NONE:o=0;break;case I.r:o=1;break;case I.j:o=2;break;default:t(Error("unsupported compression type"))}break;default:t(Error("invalid compression method"))}return r=o<<6|0,l[h++]=r|31-(256*n+r)%31,c=s(this.input),this.z.b=h,h=(l=this.z.n()).length,a&&((l=new Uint8Array(l.buffer)).length<=h+4&&(this.a=new Uint8Array(l.length+4),this.a.set(l),l=this.a),l=l.subarray(0,h+4)),l[h++]=c>>24&255,l[h++]=c>>16&255,l[h++]=c>>8&255,l[h++]=255&c,l},r("Zlib.Deflate",R),r("Zlib.Deflate.compress",(function(t,e){return new R(t,e).n()})),r("Zlib.Deflate.CompressionType",I),r("Zlib.Deflate.CompressionType.NONE",I.NONE),r("Zlib.Deflate.CompressionType.FIXED",I.r),r("Zlib.Deflate.CompressionType.DYNAMIC",I.j);var P=0,N=1,F={D:P,C:N};O.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,s=this.c,o=this.a,c=this.b,l=e,h=e,u=e,f=o.length,_=e;switch(this.e=this.g=0,(l=r[s++])===e&&t(Error("invalid uncompressed block header: LEN (first byte)")),h=l,(l=r[s++])===e&&t(Error("invalid uncompressed block header: LEN (second byte)")),h|=l<<8,(l=r[s++])===e&&t(Error("invalid uncompressed block header: NLEN (first byte)")),u=l,(l=r[s++])===e&&t(Error("invalid uncompressed block header: NLEN (second byte)")),h===~(u|=l<<8)&&t(Error("invalid uncompressed block header: length verify")),s+h>r.length&&t(Error("input buffer is broken")),this.m){case P:for(;c+h>o.length;){if(h-=_=f-c,a)o.set(r.subarray(s,s+_),c),c+=_,s+=_;else for(;_--;)o[c++]=r[s++];this.b=c,o=this.f(),c=this.b}break;case N:for(;c+h>o.length;)o=this.f({v:2});break;default:t(Error("invalid inflate mode"))}if(a)o.set(r.subarray(s,s+h),c),c+=h,s+=h;else for(;h--;)o[c++]=r[s++];this.c=s,this.b=c,this.a=o;break;case 1:this.o(J,$);break;case 2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var L,B,k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=a?new Uint16Array(k):k,U=[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],z=a?new Uint16Array(U):U,G=[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],H=a?new Uint8Array(G):G,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],j=a?new Uint16Array(W):W,Y=[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],X=a?new Uint8Array(Y):Y,q=new(a?Uint8Array:Array)(288);for(L=0,B=q.length;L=L?8:255>=L?9:279>=L?7:8;var Z,K,J=p(q),Q=new(a?Uint8Array:Array)(30);for(Z=0,K=Q.length;Z>>n,i.e=s-n,i.c=c,r}function et(i,n){for(var r,a,s,o=i.g,c=i.e,l=i.input,h=i.c,u=n[0],f=n[1];c>>16,i.g=o>>s,i.e=c-s,i.c=h,65535&a}function it(t){function e(t,e,i){var n,r,a,s;for(s=0;sr)n>=c&&(this.b=n,i=this.f(),n=this.b),i[n++]=r;else for(o=z[a=r-257],0=c&&(this.b=n,i=this.f(),n=this.b);o--;)i[n]=i[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},O.prototype.I=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,a,s,o,c=i.length;256!==(r=et(this,t));)if(256>r)n>=c&&(c=(i=this.f()).length),i[n++]=r;else for(o=z[a=r-257],0c&&(c=(i=this.f()).length);o--;)i[n]=i[n++-s];for(;8<=this.e;)this.e-=8,this.c--;this.b=n},O.prototype.f=function(){var t,e,i=new(a?Uint8Array:Array)(this.b-32768),n=this.b-32768,r=this.a;if(a)i.set(r.subarray(32768,i.length));else for(t=0,e=i.length;tt;++t)r[t]=r[n+t];return this.b=32768,r},O.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|0,s=this.input,o=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof t.F&&(r+=t.F)),i=2>r?(n=(s.length-this.c)/this.u[2]/2*258|0)e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=function(){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!==s(e)&&t(Error("invalid adler-32 checksum")),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",F),F.ADAPTIVE=F.C,F.BLOCK=F.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p),a&&new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a&&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]),a&&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]),a&&new Uint16Array([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]),a&&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]);var rt,at,st=new(a?Uint8Array:Array)(288);for(rt=0,at=st.length;rt=rt?8:255>=rt?9:279>=rt?7:8;p(st);var ot,ct,lt=new(a?Uint8Array:Array)(30);for(ot=0,ct=lt.length;oth.ERROR){var e=function(t){if(cc.game.canvas){if(!i){var e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("width","200"),e.setAttribute("height",cc.game.canvas.height);var n=e.style;n.zIndex="99999",n.position="absolute",n.top=n.left="0",(i=document.createElement("textarea")).setAttribute("rows","20"),i.setAttribute("cols","30"),i.setAttribute("disabled","true");var r=i.style;r.backgroundColor="transparent",r.borderBottom="1px solid #cccccc",r.borderTopWidth=r.borderLeftWidth=r.borderRightWidth="0px",r.borderTopStyle=r.borderLeftStyle=r.borderRightStyle="none",r.padding="0px",r.margin=0,e.appendChild(i),cc.game.canvas.parentNode.appendChild(e)}i.value=i.value+t+"\r\n",i.scrollTop=i.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!==h.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN : "+cc.js.formatStr.apply(null,arguments))}),t===h.INFO_FOR_WEB_PAGE&&(cc.log=function(){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!==h.ERROR&&(console.warn.bind?cc.warn=console.warn.bind(console):cc.warn=function(){return console.warn.apply(console,arguments)}),t===h.INFO&&(console.log.bind?cc.log=console.log.bind(console):cc.log=function(){return console.log.apply(console,arguments)})}},getError:a("ERROR"),isDisplayStats:function(){return!!cc.profiler&&cc.profiler.isShowingStats()},setDisplayStats:function(t){cc.profiler&&cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS&&(t?cc.profiler.showStats():cc.profiler.hideStats(),cc.game.config.showFPS=!!t)}}}),{"../../DebugInfos":void 0,"./platform/utils":192}],27:[(function(t,e){"use strict";var i=t("./event/event-target"),n=t("./component-scheduler"),r=t("./node-activator"),a=t("./platform/CCObject"),s=t("./CCGame"),o=t("./renderer"),c=t("./event-manager"),l=t("./CCScheduler");cc.Director=function(){i.call(this),this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=null,this._scene=null,this._loadingScene="",this._totalFrames=0,this._lastUpdate=0,this._deltaTime=0,this._startTime=0,this._maxParticleDeltaTime=0,this._scheduler=null,this._compScheduler=null,this._nodeActivator=null,this._actionManager=null;var t=this;s.on(s.EVENT_SHOW,(function(){t._lastUpdate=performance.now()})),s.once(s.EVENT_ENGINE_INITED,this.init,this)},cc.Director.prototype={constructor:cc.Director,init:function(){return this._totalFrames=0,this._lastUpdate=performance.now(),this._startTime=this._lastUpdate,this._paused=!1,this._purgeDirectorInNextLoop=!1,this._winSizeInPoints=cc.size(0,0),this._scheduler=new l,cc.ActionManager?(this._actionManager=new cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,l.PRIORITY_SYSTEM,!1)):this._actionManager=null,this.sharedInit(),!0},sharedInit:function(){this._compScheduler=new n,this._nodeActivator=new r,c&&c.setEnabled(!0),cc.AnimationManager?(this._animationManager=new cc.AnimationManager,this._scheduler.scheduleUpdate(this._animationManager,l.PRIORITY_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?(this._collisionManager=new cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,l.PRIORITY_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?(this._physicsManager=new cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,l.PRIORITY_SYSTEM,!1)):this._physicsManager=null,cc.Physics3DManager?(this._physics3DManager=new cc.Physics3DManager,this._scheduler.scheduleUpdate(this._physics3DManager,l.PRIORITY_SYSTEM,!1)):this._physics3DManager=null,cc._widgetManager&&cc._widgetManager.init(this)},calculateDeltaTime:function(t){t||(t=performance.now()),this._deltaTime=t>this._lastUpdate?(t-this._lastUpdate)/1e3:0,this._lastUpdate=t},convertToGL:function(t){var e=s.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,a=n.top+window.pageYOffset-e.clientTop,o=i._devicePixelRatio*(t.x-r),c=i._devicePixelRatio*(a+n.height-t.y);return i._isRotated?cc.v2(i._viewportRect.width-c,o):cc.v2(o,c)},convertToUI:function(t){var e=s.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-e.clientLeft,a=n.top+window.pageYOffset-e.clientTop,o=cc.v2(0,0);return i._isRotated?(o.x=r+t.y/i._devicePixelRatio,o.y=a+n.height-(i._viewportRect.width-t.x)/i._devicePixelRatio):(o.x=r+t.x*i._devicePixelRatio,o.y=a+n.height-t.y*i._devicePixelRatio),o},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.assetManager.releaseAll()},purgeDirector:function(){this._scheduler.unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActivator.reset(),c&&c.setEnabled(!1),cc.isValid(this._scene)&&this._scene.destroy(),this._scene=null,cc.renderer.clear(),cc.assetManager.builtins.clear(),cc.game.pause(),cc.assetManager.releaseAll()},reset:function(){this.purgeDirector(),c&&c.setEnabled(!0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler.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.Scheduler.PRIORITY_SYSTEM,!1),cc.game.resume()},runSceneImmediate:function(t,e,i){cc.assertID(t instanceof cc.Scene||t instanceof cc.SceneAsset,1216),t instanceof cc.SceneAsset&&(t=t.scene),t._load();for(var n=Object.keys(s._persistRootNodes).map((function(t){return s._persistRootNodes[t]})),r=0;r2||e<0)&&(t.renderMode=0),"boolean"!=typeof t.registerSystemEvent&&(t.registerSystemEvent=!0),t.showFPS=1!==e&&!!t.showFPS,this.collisionMatrix=t.collisionMatrix||[],this.groupList=t.groupList||[],n._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(n.getError(3820,e))},_initRenderer:function(){if(!this._rendererInitialized){var t,e,i,n,s=this.config.id,o=s instanceof HTMLElement?s:document.querySelector(s)||document.querySelector("#"+s);if("CANVAS"===o.tagName?(t=o.width,e=o.height,this.canvas=i=o,this.container=n=document.createElement("DIV"),i.parentNode&&i.parentNode.insertBefore(n,i)):("DIV"!==o.tagName&&cc.warnID(3819),t=o.clientWidth,e=o.clientHeight,this.canvas=i=document.createElement("CANVAS"),this.container=n=document.createElement("DIV"),o.appendChild(n)),n.setAttribute("id","Cocos2dGameContainer"),n.appendChild(i),this.frame=n.parentNode===document.body?document.documentElement:n.parentNode,(function(t){(" "+t.className+" ").indexOf(" gameCanvas ")>-1||(t.className&&(t.className+=" "),t.className+="gameCanvas")})(i),i.setAttribute("width",t||480),i.setAttribute("height",e||320),i.setAttribute("tabindex",99),this._determineRenderType(),this.renderType===this.RENDER_TYPE_WEBGL){var c={stencil:!0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVAS};r.initWebGL(i,c),this._renderContext=r.device._gl,!cc.macro.CLEANUP_IMAGE_CACHE&&a&&(a.enabled=!0)}this._renderContext||(this.renderType=this.RENDER_TYPE_CANVAS,r.initCanvas(i),this._renderContext=r.device._ctx),this.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1},this._rendererInitialized=!0}},_initEvents:function(){var t,e=window;this.config.registerSystemEvent&&cc.internal.inputManager.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,s.emit(s.EVENT_HIDE))}function r(t,e,n,r,a){i&&(i=!1,s.emit(s.EVENT_SHOW,t,e,n,r,a))}if(t)for(var a=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilitychange","qbrowserVisibilityChange"],o=0;o-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(s.EVENT_HIDE,(function(){s.pause()})),this.on(s.EVENT_SHOW,(function(){s.resume()}))}};i.call(s),cc.js.addon(s,i.prototype),cc.game=e.exports=s}),{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-atlas/manager":202,"./CCDebug":26,"./event/event-target":141,"./renderer/index.js":199}],29:[(function(t,e){"use strict";var i=t("./value-types"),n=t("./value-types/utils"),r=t("./utils/base-node"),a=t("./utils/prefab-helper"),s=t("./utils/trans-pool").NodeMemPool,o=t("./utils/affine-transform"),c=t("./event-manager"),l=t("./platform/CCMacro"),h=t("./platform/js"),u=(t("./event/event"),t("./event/event-target")),f=t("./renderer/render-flow"),_=cc.Object.Flags.Destroying,d=Math.PI/180,p=!!cc.ActionManager,m=function(){},v=new i.Vec3,g=new i.Quat,y=new i.Vec3,T=new i.Vec3,A=new i.Quat,b=new i.Quat,E=new i.Vec3,C=new i.Vec3,x=new i.Vec3,S=new i.Vec3,w=new i.Vec3,D=new i.Quat,M=new i.Quat,R=new i.Vec3,I=new i.Quat,O=new i.Vec3,P=new i.Quat,N=new i.Vec3,F=new i.Vec3,L=new i.Quat,B=new i.Quat,k=(new i.Quat,cc.mat4()),V=new i.Vec3,U=new h.Pool;U.get=function(){return this._get()||[]};var z=cc.Enum({DEBUG:31}),G=cc.Enum({POSITION:1,SCALE:2,ROTATION:4,SKEW:8,TRS:7,RS:6,TRSS:15,PHYSICS_POSITION:16,PHYSICS_SCALE:32,PHYSICS_ROTATION:64,PHYSICS_TRS:112,PHYSICS_RS:96,ALL_POSITION:17,ALL_SCALE:34,ALL_ROTATION:68,ALL_TRS:119,ALL:65535}),H=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENTER:"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",SIBLING_ORDER_CHANGED:"sibling-order-changed"}),W=[H.TOUCH_START,H.TOUCH_MOVE,H.TOUCH_END,H.TOUCH_CANCEL],j=[H.MOUSE_DOWN,H.MOUSE_ENTER,H.MOUSE_MOVE,H.MOUSE_LEAVE,H.MOUSE_UP,H.MOUSE_WHEEL],Y=!0,X=function(t){if(0!==t){Y&&cc.warn("`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.",""),Y=!1}},q=null,Z=function(t,e){var i=t.getLocation(),n=this.owner;return!!n._hitTest(i,this)&&(e.type=H.TOUCH_START,e.touch=t,e.bubbles=!0,n.dispatchEvent(e),!0)},K=function(t,e){var i=this.owner;e.type=H.TOUCH_MOVE,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},J=function(t,e){var i=t.getLocation(),n=this.owner;n._hitTest(i,this)?e.type=H.TOUCH_END:e.type=H.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,n.dispatchEvent(e)},Q=function(t,e){t.getLocation();var i=this.owner;e.type=H.TOUCH_CANCEL,e.touch=t,e.bubbles=!0,i.dispatchEvent(e)},$=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_DOWN,t.bubbles=!0,i.dispatchEvent(t))},tt=function(t){var e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||(q&&q._mouseListener&&(t.type=H.MOUSE_LEAVE,q.dispatchEvent(t),q._mouseListener._previousIn=!1),q=this.owner,t.type=H.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!0),t.type=H.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!this._previousIn)return;t.type=H.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!1,q=null}t.stopPropagation()},et=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_UP,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())},it=function(t){var e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=H.MOUSE_WHEEL,t.bubbles=!0,i.dispatchEvent(t),t.stopPropagation())};function nt(t,e){if(e){for(var i=0,n=null,r=t;r&&cc.Node.isNode(r);r=r._parent,++i)if(r.getComponent(e)){var a={index:i,node:r};n?n.push(a):n=[a]}return n}return null}function rt(t,e){if(!(t._objFlags&_)){if(t._bubblingListeners)for(var i=0,n=e.length;i=0;--r)if((n=i[r])._capturingListeners&&(e.currentTarget=n,n._capturingListeners.emit(e.type,e,i),e._propagationStopped))return void(i.length=0);if(i.length=0,e.eventPhase=2,e.currentTarget=t,t._capturingListeners&&t._capturingListeners.emit(e.type,e),!e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.emit(e.type,e),!e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,i),e.eventPhase=3,r=0;r>16},set:function(t){t>l.MAX_ZINDEX?(cc.warnID(1636),t=l.MAX_ZINDEX):t0&&(this._renderFlag|=f.FLAG_CHILDREN)},_checkListenerMask:function(){if(this._touchListener){var t=this._touchListener.mask=nt(this,cc.Mask);this._mouseListener&&(this._mouseListener.mask=t)}else this._mouseListener&&(this._mouseListener.mask=nt(this,cc.Mask))},_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_ONE,swallowTouches:!0,owner:this,mask:nt(this,cc.Mask),onTouchBegan:Z,onTouchMoved:K,onTouchEnded:J,onTouchCancelled:Q}),c.addListener(this._touchListener,this),e=!0),i=!0):-1!==j.indexOf(t)&&(this._mouseListener||(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previousIn:!1,owner:this,mask:nt(this,cc.Mask),onMouseDown:$,onMouseMove:tt,onMouseUp:et,onMouseScroll:it}),c.addListener(this._mouseListener,this),e=!0),i=!0),e&&!this._activeInHierarchy&&cc.director.getScheduler().schedule((function(){this._activeInHierarchy||c.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 H.POSITION_CHANGED:this._eventMask|=1;break;case H.SCALE_CHANGED:this._eventMask|=2;break;case H.ROTATION_CHANGED:this._eventMask|=4;break;case H.SIZE_CHANGED:this._eventMask|=8;break;case H.ANCHOR_CHANGED:this._eventMask|=16;break;case H.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,a=null;(a=this._checknSetupSysEvent(t)&&n?this._capturingListeners=this._capturingListeners||new u:this._bubblingListeners=this._bubblingListeners||new u).once(t,e,i),a.once(t,(function(){r.off(t,e,i)}),void 0)},_onDispatch: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.on(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),a=!r&&-1!==j.indexOf(t);if(r||a)this._offDispatch(t,e,i,n),r?this._touchListener&&!rt(this,W)&&(c.removeListener(this._touchListener),this._touchListener=null):a&&this._mouseListener&&!rt(this,j)&&(c.removeListener(this._mouseListener),this._mouseListener=null);else if(this._bubblingListeners&&(this._bubblingListeners.off(t,e,i),!this._bubblingListeners.hasEventListener(t)))switch(t){case H.POSITION_CHANGED:this._eventMask&=-2;break;case H.SCALE_CHANGED:this._eventMask&=-3;break;case H.ROTATION_CHANGED:this._eventMask&=-5;break;case H.SIZE_CHANGED:this._eventMask&=-9;break;case H.ANCHOR_CHANGED:this._eventMask&=-17;break;case H.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.off(t,e,i),i&&i.__eventTargets&&h.array.fastRemove(i.__eventTargets,this))}else this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListeners&&this._bubblingListeners.removeAll(t)},targetOff:function(t){var e=this._bubblingListeners;e&&(e.targetOff(t),1&this._eventMask&&!e.hasEventListener(H.POSITION_CHANGED)&&(this._eventMask&=-2),2&this._eventMask&&!e.hasEventListener(H.SCALE_CHANGED)&&(this._eventMask&=-3),4&this._eventMask&&!e.hasEventListener(H.ROTATION_CHANGED)&&(this._eventMask&=-5),8&this._eventMask&&!e.hasEventListener(H.SIZE_CHANGED)&&(this._eventMask&=-9),16&this._eventMask&&!e.hasEventListener(H.ANCHOR_CHANGED)&&(this._eventMask&=-17),32&this._eventMask&&!e.hasEventListener(H.COLOR_CHANGED)&&(this._eventMask&=-33)),this._capturingListeners&&this._capturingListeners.targetOff(t),t&&t.__eventTargets&&h.array.fastRemove(t.__eventTargets,this),this._touchListener&&!rt(this,W)&&(c.removeListener(this._touchListener),this._touchListener=null),this._mouseListener&&!rt(this,j)&&(c.removeListener(this._mouseListener),this._mouseListener=null)},hasEventListener:function(t){var e=!1;return this._bubblingListeners&&(e=this._bubblingListeners.hasEventListener(t)),!e&&this._capturingListeners&&(e=this._capturingListeners.hasEventListener(t)),e},emit:function(t,e,i,n,r,a){this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,a)},dispatchEvent:function(t){var e=U.get();at(this,t,e),U.put(e)},pauseSystemEvents:function(t){c.pauseTarget(this,t)},resumeSystemEvents:function(t){c.resumeTarget(this,t)},_hitTest:function(t,e){var n=this._contentSize.width,r=this._contentSize.height,a=N,s=F,o=cc.Camera.findCamera(this);if(o?o.getScreenToWorldPoint(t,a):a.set(t),this._updateWorldMatrix(),!i.Mat4.invert(k,this._worldMatrix))return!1;i.Vec2.transformMat4(s,a,k),s.x+=this._anchorPoint.x*n,s.y+=this._anchorPoint.y*r;var c=!1;if(s.x>=0&&s.y>=0&&s.x<=n&&s.y<=r&&(c=!0,e&&e.mask))for(var l=e.mask,h=this,u=l?l.length:0,f=0,_=0;h&&_d.index){l.length=_;break}}return c},_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:p?function(t){if(this.active){cc.assertID(t,1618);var e=cc.director.getActionManager();return e._suppressDeprecation||(e._suppressDeprecation=!0,cc.warnID(1639)),e.addAction(t,this,!1),t}}:m,pauseAllActions:p?function(){cc.director.getActionManager().pauseTarget(this)}:m,resumeAllActions:p?function(){cc.director.getActionManager().resumeTarget(this)}:m,stopAllActions:p?function(){cc.director.getActionManager().removeAllActionsFromTarget(this)}:m,stopAction:p?function(t){cc.director.getActionManager().removeAction(t)}:m,stopActionByTag:p?function(t){t!==cc.Action.TAG_INVALID?cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:m,getActionByTag:p?function(t){return t===cc.Action.TAG_INVALID?(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:function(){return null},getNumberOfRunningActions:p?function(){return cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function(){return 0},getPosition:function(t){return t=t||new i.Vec3,i.Trs.toPosition(t,this._trs)},setPosition:function(t,e,i){var n;void 0===e?(n=t.x,e=t.y,i=t.z):n=t;var r=this._trs;void 0===i&&(i=r[2]),(r[0]!==n||r[1]!==e||r[2]!==i)&&(r[0]=n,r[1]=e,r[2]=i,this.setLocalDirty(G.ALL_POSITION),this._renderFlag|=f.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(H.POSITION_CHANGED))},getScale:function(t){return void 0!==t?i.Trs.toScale(t,this._trs):(cc.errorID(1400,"cc.Node.getScale","cc.Node.scale or cc.Node.getScale(cc.Vec3)"),this._trs[7])},setScale:function(t,e,i){var n;t&&"number"!=typeof t?(n=t.x,e=t.y,i=t.z):void 0!==t&&void 0===e?(n=t,e=t,i=t):n=t;var r=this._trs;void 0===i&&(i=r[9]),r[7]===n&&r[8]===e&&r[9]===i||(r[7]=n,r[8]=e,r[9]=i,this.setLocalDirty(G.ALL_SCALE),this._renderFlag|=f.FLAG_TRANSFORM,2&this._eventMask&&this.emit(H.SCALE_CHANGED))},getRotation:function(t){return t instanceof i.Quat?i.Trs.toRotation(t,this._trs):-this.angle},setRotation:function(t,e,i,n){if("number"==typeof t&&void 0===e)this.angle=-t;else{var r=t;void 0===e&&(r=t.x,e=t.y,i=t.z,n=t.w);var a=this._trs;a[3]===r&&a[4]===e&&a[5]===i&&a[6]===n||(a[3]=r,a[4]=e,a[5]=i,a[6]=n,this.setLocalDirty(G.ALL_ROTATION),4&this._eventMask&&this.emit(H.ROTATION_CHANGED))}},getContentSize:function(){return cc.size(this._contentSize.width,this._contentSize.height)},setContentSize:function(t,e){var i=this._contentSize;if(void 0===e){if((0,n.approx)(t.width,i.width)&&(0,n.approx)(t.height,i.height))return;i.width=t.width,i.height=t.height}else{if((0,n.approx)(t,i.width)&&(0,n.approx)(e,i.height))return;i.width=t,i.height=e}8&this._eventMask&&this.emit(H.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(G.ALL_POSITION),16&this._eventMask&&this.emit(H.ANCHOR_CHANGED)},_invTransformPoint:function(t,e){this._parent?this._parent._invTransformPoint(t,e):i.Vec3.copy(t,e);var n=this._trs;return i.Trs.toPosition(y,n),i.Vec3.sub(t,t,y),i.Trs.toRotation(A,n),i.Quat.conjugate(b,A),i.Vec3.transformQuat(t,t,b),i.Trs.toScale(y,n),i.Vec3.inverseSafe(T,y),i.Vec3.mul(t,t,T),t},getWorldPosition:function(t){i.Trs.toPosition(t,this._trs);for(var e,n=this._parent;n;)e=n._trs,i.Trs.toScale(v,e),i.Vec3.mul(t,t,v),i.Trs.toRotation(g,e),i.Vec3.transformQuat(t,t,g),i.Trs.toPosition(v,e),i.Vec3.add(t,t,v),n=n._parent;return t},setWorldPosition:function(t){var e=this._trs;this._parent?this._parent._invTransformPoint(E,t):i.Vec3.copy(E,t),i.Trs.fromPosition(e,E),this.setLocalDirty(G.ALL_POSITION),1&this._eventMask&&this.emit(H.POSITION_CHANGED)},getWorldRotation:function(t){i.Trs.toRotation(L,this._trs),i.Quat.copy(t,L);for(var e=this._parent;e;)i.Trs.toRotation(L,e._trs),i.Quat.mul(t,L,t),e=e._parent;return t},setWorldRotation:function(t){this._parent?(this._parent.getWorldRotation(B),i.Quat.conjugate(B,B),i.Quat.mul(B,B,t)):i.Quat.copy(B,t),i.Trs.fromRotation(this._trs,B),this.setLocalDirty(G.ALL_ROTATION)},getWorldScale:function(t){i.Trs.toScale(C,this._trs),i.Vec3.copy(t,C);for(var e=this._parent;e;)i.Trs.toScale(C,e._trs),i.Vec3.mul(t,t,C),e=e._parent;return t},setWorldScale:function(t){this._parent?(this._parent.getWorldScale(x),i.Vec3.div(x,t,x)):i.Vec3.copy(x,t),i.Trs.fromScale(this._trs,x),this.setLocalDirty(G.ALL_SCALE)},getWorldRT:function(t){var e=S,n=D,r=this._trs;i.Trs.toPosition(e,r),i.Trs.toRotation(n,r);for(var a=this._parent;a;)r=a._trs,i.Trs.toScale(w,r),i.Vec3.mul(e,e,w),i.Trs.toRotation(M,r),i.Vec3.transformQuat(e,e,M),i.Trs.toPosition(w,r),i.Vec3.add(e,e,w),i.Quat.mul(n,M,n),a=a._parent;return i.Mat4.fromRT(t,n,e),t},lookAt:function(t,e){this.getWorldPosition(R),i.Vec3.sub(R,R,t),i.Vec3.normalize(R,R),i.Quat.fromViewUp(I,R,e),this.setWorldRotation(I)},_updateLocalMatrix:lt,_calculWorldMatrix:function(){this._localMatDirty&G.TRSS&&this._updateLocalMatrix();var t=this._parent;t?this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):i.Mat4.copy(this._worldMatrix,this._matrix),this._worldMatDirty=!1},_mulMat:ft,_updateWorldMatrix:function(){if(this._parent&&this._parent._updateWorldMatrix(),this._worldMatDirty){this._calculWorldMatrix();for(var t=this._children,e=0,i=t.length;e1){for(var n,r,a=1,s=t.length;a0&&(r=t[o-1])._localZOrder>n._localZOrder;o--)t[o]=r;t[o]=n}this.emit(H.CHILD_REORDER,this)}cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this)}},_delaySort:function(){this._reorderChildDirty||(this._reorderChildDirty=!0,cc.director.__fastOn(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this))},_restoreProperties:!1,onRestore:!1},pt=cc.Class(dt),mt=pt.prototype;h.getset(mt,"position",mt.getPosition,mt.setPosition,!1,!0),cc.Node=e.exports=pt}),{"./event-manager":139,"./event/event":142,"./event/event-target":141,"./platform/CCMacro":173,"./platform/js":189,"./renderer/render-flow":200,"./utils/affine-transform":234,"./utils/base-node":235,"./utils/prefab-helper":245,"./utils/trans-pool":251,"./value-types":257,"./value-types/utils":264}],30:[(function(t,e){"use strict";var i=t("./CCNode"),n=t("./renderer/render-flow"),r=(cc.Object.Flags.HideInHierarchy,i._LocalDirtyFlag),a=cc.Class({name:"cc.PrivateNode",extends:i,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(){},override:!0},showInEditor:{default:!1,editorOnly:!0,override:!0}},ctor:function(){this._localZOrder=cc.macro.MIN_ZINDEX<<16,this._originPos=cc.v2()},_posDirty:function(t){this.setLocalDirty(r.POSITION),this._renderFlag|=n.FLAG_TRANSFORM,!0===t&&1&this._eventMask&&this.emit(i.EventType.POSITION_CHANGED)},_updateLocalMatrix:function(){if(this._localMatDirty){var t=this.parent;t&&(this._trs[0]=this._originPos.x-(t._anchorPoint.x-.5)*t._contentSize.width,this._trs[1]=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(i.EventType.ANCHOR_CHANGED,this._posDirty,this),t&&t.on(i.EventType.ANCHOR_CHANGED,this._posDirty,this))},_updateOrderOfArrival:function(){}}),s=a.prototype;cc.js.getset(s,"parent",s.getParent,s.setParent),cc.js.getset(s,"position",s.getPosition,s.setPosition),cc.PrivateNode=e.exports=a}),{"./CCNode":29,"./renderer/render-flow":200}],31:[(function(t,e){"use strict";cc.Scene=cc.Class({name:"cc.Scene",extends:t("./CCNode"),properties:{_is3DNode:{default:!0,override:!0},autoReleaseAssets:!1},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;e0,this._repeat=r,this._runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},u.getInterval=function(){return this._interval},u.setInterval=function(t){this._interval=t},u.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._timesExecuted+=1),this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},u.getCallback=function(){return this._callback},u.trigger=function(){this._target&&this._callback&&(this._lock=!0,this._callback.call(this._target,this._elapsed),this._lock=!1)},u.cancel=function(){this._scheduler.unschedule(this._callback,this._target)};var f=[];h.get=function(){return f.pop()||new h},h.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._updatesPosList=[],this._hashForUpdates=i.createMap(!0),this._hashForTimers=i.createMap(!0),this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!1,this._arrayForTimers=[]},cc.Scheduler.prototype={constructor:cc.Scheduler,_removeHashElement:function(t){delete this._hashForTimers[t.target._id];for(var e=this._arrayForTimers,i=0,n=e.length;i=a&&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,a=n.length;r=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var a=0;if(t<0)for(e=0;e=t&&this.unscheduleUpdate(n.target),a==this._updatesNegList.length&&e++;if(t<=0)for(e=0;e=t&&this.unscheduleUpdate(n.target),a==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,a=0;a=t&&(r.paused=!0,a.push(r.target));if(t<=0)for(i=0;i=t&&(r.paused=!0,a.push(r.target));return a},resumeTargets:function(t){if(t)for(var e=0;e1?n:n[0]}},cc.AssetManager=N,cc.assetManager=new N,Object.defineProperty(cc,"resources",{get:function(){return O.get(P.RESOURCES)}}),e.exports=cc.assetManager}),{"./builtins":34,"./bundle":35,"./cache":36,"./depend-util":38,"./downloader":45,"./factory":46,"./fetch":47,"./helper":49,"./load":51,"./pack-manager":52,"./parser":53,"./pipeline":54,"./preprocess":55,"./releaseManager":56,"./request-item":57,"./shared":58,"./task":59,"./urlTransformer":60,"./utilities":61}],34:[(function(t,e){"use strict";var i=t("./cache"),n=t("./releaseManager"),r=t("./shared").BuiltinBundleName,a={_assets:new i({material:new i,effect:new i}),_loadBuiltins:function(t,e){var i=t+"s",n=this._assets.get(t);return cc.assetManager.internal.loadDir(i,null,null,(function(t,i){if(t)cc.error(t.message,t.stack);else for(var r=0;re.length)||47===t.charCodeAt(e.length)}return this.paths.forEach((function(n,r){if(r.startsWith(t)&&s(r,t)||!t)for(var o=0,c=n.length;o1){var _=Object.create(null);n.forEach((function(t){_[t._uuid]=t})),r={isCompleted:h,_map:_}}else r=n[0]}i&&i(e,r)}))},getXMLHttpRequest:function(){return new XMLHttpRequest},_parseLoadResArgs:i.parseLoadResArgs,getItem:function(t){return cc.assetManager.assets.has(t)?{content:cc.assetManager.assets.get(t)}:null},loadRes:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete,o=cc.path.extname(t);o&&(t=t.slice(0,-o.length)),cc.resources.load(t,e,a,s)},loadResArray:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete;t.forEach((function(e,i){var n=cc.path.extname(e);n&&(t[i]=e.slice(0,-n.length))})),cc.resources.load(t,e,a,s)},loadResDir:function(t,e,i,n){var r=this._parseLoadResArgs(e,i,n),a=(e=r.type,r.onProgress),s=r.onComplete;cc.resources.loadDir(t,e,a,(function(i,n){var r=[];i||(r=cc.resources.getDirWithPath(t,e).map((function(t){return t.path}))),s&&s(i,n,r)}))},getRes:function(t,e){return cc.assetManager.assets.has(t)?cc.assetManager.assets.get(t):cc.resources.get(t,e)},getResCount:function(){return cc.assetManager.assets.count},getDependsRecursively:function(t){return t?n.getDepsRecursively("string"==typeof t?t:t._uuid).concat([t._uuid]):[]},get assetLoader(){},get md5Pipe(){return u},get downloader(){return cc.assetManager.downloader},get loader(){return cc.assetManager.parser},addDownloadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({url:t},i)}}cc.assetManager.downloader.register(e)},addLoadHandlers:function(t){var e=Object.create(null);for(var i in t){var n=t[i];e["."+i]=function(t,e,i){n({content:t},i)}}cc.assetManager.parser.register(e)},flowInDeps:function(){},release:function(t){if(Array.isArray(t))for(var e=0;eF._maxInterval?F._maxInterval:cc.director._deltaTime;t-I>1e3*e&&(R=0,I=t)},N=function t(e,i){for(O=!1,P();w.length>0&&M0&&M0&&(a(N,g,y),O=!0),s.apply(this,arguments)}))}P(),M0){var i=n.create({name:t.name+" dependencies",input:c,progress:_,options:a,onProgress:t.onProgress,onError:n.prototype.recycle,onComplete:function(n){n||(t.output.push.apply(t.output,this.output),i.recycle()),r&&u(t),e(n)}});h.async(i)}else r&&u(t),e()}))}}),{"./pack-manager":52,"./shared":58,"./task":59,"./utilities":61}],48:[(function(t,e){"use strict";var i,n=t("../utils/text-utils"),r=null,a="BES bswy:->@123\u4e01\u3041\u1101",s=Object.create(null),o=-1,c=[],l=3e3,h=(i=void 0,function(){if(void 0===i)if(window.FontFace){var t=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),e=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);i=t?parseInt(t[1],10)>42:!e}else i=!1;return i});function u(){for(var t=!0,e=Date.now(),i=c.length-1;i>=0;i--){var s=c[i],h=s.fontFamilyName;if(e-s.startTime>l)cc.warnID(4933,h),s.onComplete(null,h),c.splice(i,1);else{var u=s.refWidth,f="40px "+h;r.font=f,u!==n.safeMeasureText(r,a,f)?(c.splice(i,1),s.onComplete(null,h)):t=!1}}t&&(clearInterval(o),o=-1)}var f={loadFont:function(t,e,i){var _=f._getFontFamily(t);if(s[_])return i(null,_);if(!r){var d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}var p="40px "+_;r.font=p;var m=n.safeMeasureText(r,a,p),v=document.createElement("style");v.type="text/css";var g="";isNaN(_-0)?g+="@font-face { font-family:"+_+"; src:":g+="@font-face { font-family:'"+_+"'; src:",g+="url('"+t+"');",v.textContent=g+"}",document.body.appendChild(v);var y,T,A,b,E,C,x=document.createElement("div"),S=x.style;if(S.fontFamily=_,x.innerHTML=".",S.position="absolute",S.left="-100px",S.top="-100px",document.body.appendChild(x),h())y=Date.now(),T=_,A=i,b=new Promise(function(t,e){(function i(){Date.now()-y>=l?e():document.fonts.load("40px "+T).then((function(e){e.length>=1?t():setTimeout(i,100)}),(function(){e()}))})()}),E=null,C=new Promise(function(t,e){E=setTimeout(e,l)}),Promise.race([C,b]).then((function(){E&&(clearTimeout(E),E=null),A(null,T)}),(function(){cc.warnID(4933,T),A(null,T)}));else{var w={fontFamilyName:_,refWidth:m,onComplete:i,startTime:Date.now()};c.push(w),-1===o&&(o=setInterval(u,100))}s[_]=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":249}],49:[(function(t,e){"use strict";var i,n=t("./shared").bundles,r={decodeUuid:t("../utils/decode-uuid"),getUuidFromURL:(i=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]{8,})/,function(t){var e=t.match(i);return e?e[1]:""}),getUrlWithUuid:function(t,e){(e=e||Object.create(null)).__isNative__=e.isNative,e.ext=e.nativeExt;var i=n.find((function(e){return e.getAssetInfo(t)}));return i&&(e.bundle=i.name),cc.assetManager._transform(t,e)},isScene:function(t){return t&&(t.constructor===cc.SceneAsset||t instanceof cc.Scene)},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}};e.exports=r}),{"../utils/decode-uuid":238,"./shared":58}],50:[(function(t){"use strict";t("./deprecated"),t("./CCAssetManager")}),{"./CCAssetManager":33,"./deprecated":39}],51:[(function(t,e){"use strict";var i=t("./pack-manager"),n=t("./pipeline"),r=t("./parser"),a=t("./utilities"),s=a.getDepends,o=a.cache,c=a.gatherAsset,l=a.setProperties,h=a.forEach,u=a.clear,f=a.checkCircleReference,_=t("./shared"),d=_.assets,p=_.files,m=_.parsed,v=_.pipeline,g=t("./task"),y=new n("loadOneAsset",[function(t,e){var n=t.output=t.input,r=n.options,a=n.isNative,s=n.uuid,o=n.file,c=r.reload;if(o||!c&&!a&&d.has(s))return e();i.load(n,t.options,(function(t,i){n.file=i,e(t)}))},function(t,e){var i=t.output=t.input,n=t.progress,a=t.options.__exclude__,s=i.id,o=i.file,c=i.options;if(i.isNative)r.parse(s,o,i.ext,c,(function(r,a){if(r)return e(r);i.content=a,n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),p.remove(s),m.remove(s),e()}));else{var l=i.uuid;if(l in a){var h=a[l],u=h.finish,_=h.content,v=h.err,g=h.callbacks;n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),u||f(l,l,a)?(_&&_.addRef&&_.addRef(),i.content=_,e(v)):g.push({done:e,item:i})}else if(!c.reload&&d.has(l)){var y=d.get(l);c.__asyncLoadAssets__||!y.__asyncLoadAssets__?(i.content=y.addRef(),n.canInvoke&&t.dispatch("progress",++n.finish,n.total,i),e()):T(t,y,e,!1)}else r.parse(s,o,"import",c,(function(i,n){if(i)return e(i);n._uuid=l,T(t,n,e,!0)}))}}]);function T(t,e,i,n){var r=t.input,a=t.progress,c=r.uuid,h=r.id,u=r.options,f=r.config,_=u.__asyncLoadAssets__,d=u.cacheAsset,y=[];e.addRef&&e.addRef(),s(c,e,Object.create(null),y,!1,_,f),a.canInvoke&&t.dispatch("progress",++a.finish,a.total+=y.length,r);var T=t.options.__exclude__[c]={content:e,finish:!1,callbacks:[{done:i,item:r}]},A=g.create({input:y,options:t.options,onProgress:t.onProgress,onError:g.prototype.recycle,progress:a,onComplete:function(t){if(e.decRef&&e.decRef(!1),e.__asyncLoadAssets__=_,T.finish=!0,T.err=t,!t){for(var i=Array.isArray(A.output)?A.output:[A.output],r=Object.create(null),a=0,s=i.length;a6||l<3||l>6||h<3||h>6)&&(c<4||7===c||9===c||11===c||c>12||l<4||7===l||9===l||11===l||l>12||1!==h))return new Error("Invalid block number in ASTC header");var u=t(c,l),f=o[7]+(o[8]<<8)+(o[9]<<16),_=o[10]+(o[11]<<8)+(o[12]<<16);o[13],o[14],o[15],a={_data:new Uint8Array(s,16),_compressed:!0,width:f,height:_,format:u}}catch(d){r=d}n(r,a)}})(),parsePlist:function(t,e,n){var r=null,a=i.parse(t);a||(r=new Error("parse failed")),n&&n(r,a)},parseImport:function(t,e,i){if(!t)return i&&i(new Error("Json is empty"));var n,a=null;try{n=r(t,e)}catch(s){a=s}i&&i(a,n)},init:function(){_.clear()},register:function(t,e){"object"==typeof t?n.mixin(p,t):p[t]=e},parse:function(t,e,i,n,r){var a,o,h;(a=c.get(t))?r(null,a):(o=_.get(t))?o.push(r):(h=p[i])?(_.add(t,[r]),h(e,n,(function(e,i){e?l.remove(t):s(i)||c.add(t,i);for(var n=_.remove(t),r=0,a=n.length;r